1 line
1.1 MiB
1 line
1.1 MiB
webpackJsonp([14],{"2ef/":function(t,e){},"5eDb":function(t,e,n){(function(e){!function(){"use strict";var n=function(t){if(null===t)return"null";if(void 0===t)return"undefined";var e=typeof t;return"object"===e&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"===e&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":e},r=function(t){return{eq:t}},o=r(function(t,e){return t===e}),i=function(t){return r(function(e,n){if(e.length!==n.length)return!1;for(var r=e.length,o=0;o<r;o++)if(!t.eq(e[o],n[o]))return!1;return!0})},u=function(t,e){return function(t,e){return r(function(n,r){return t.eq(e(n),e(r))})}(i(t),function(t){return function(t,e){return Array.prototype.slice.call(t).sort(e)}(t,e)})},a=function(t){return r(function(e,n){var r=Object.keys(e),i=Object.keys(n);if(!u(o).eq(r,i))return!1;for(var a=r.length,c=0;c<a;c++){var s=r[c];if(!t.eq(e[s],n[s]))return!1}return!0})},c=r(function(t,e){if(t===e)return!0;var r=n(t);return r===n(e)&&(function(t){return-1!==["undefined","boolean","number","string","function","xml","null"].indexOf(t)}(r)?t===e:"array"===r?i(c).eq(t,e):"object"===r&&a(c).eq(t,e))}),s=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},l=function(t){return function(e){return typeof e===t}},f=function(t){return function(e){return t===e}},d=s("string"),m=s("object"),g=s("array"),h=f(null),p=l("boolean"),v=f(void 0),b=function(t){return null===t||void 0===t},y=function(t){return!b(t)},w=l("function"),x=l("number"),C=function(){},S=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t(e.apply(null,n))}},k=function(t,e){return function(n){return t(e(n))}},O=function(t){return function(){return t}},T=function(t){return t},_=function(t,e){return t===e};function E(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=e.concat(n);return t.apply(null,o)}}var D=function(t){return function(e){return!t(e)}},A=function(t){return t()},N=function(t){t()},M=O(!1),z=O(!0),R=function(){return B},B=function(){var t=function(t){return t()},e=T;return{fold:function(t,e){return t()},isSome:M,isNone:z,getOr:e,getOrThunk:t,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:O(null),getOrUndefined:O(void 0),or:e,orThunk:t,map:R,each:C,bind:R,exists:M,forall:z,filter:function(){return R()},toArray:function(){return[]},toString:O("none()")}}(),L=function(t){var e=O(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},isSome:z,isNone:M,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return L(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:B},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},P={some:L,none:R,from:function(t){return null===t||void 0===t?B:L(t)}},H=Array.prototype.slice,I=Array.prototype.indexOf,F=Array.prototype.push,V=function(t,e){return I.call(t,e)},U=function(t,e){return V(t,e)>-1},j=function(t,e){for(var n=0,r=t.length;n<r;n++){if(e(t[n],n))return!0}return!1},W=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},q=function(t,e){for(var n=0,r=t.length;n<r;n++){e(t[n],n)}},$=function(t,e){for(var n=t.length-1;n>=0;n--){e(t[n],n)}},G=function(t,e){for(var n=[],r=[],o=0,i=t.length;o<i;o++){var u=t[o];(e(u,o)?n:r).push(u)}return{pass:n,fail:r}},K=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n},X=function(t,e,n){return $(t,function(t,r){n=e(n,t,r)}),n},Y=function(t,e,n){return q(t,function(t,r){n=e(n,t,r)}),n},J=function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return P.some(i);if(n(i,r))break}return P.none()},Q=function(t,e){return J(t,e,M)},Z=function(t,e){for(var n=0,r=t.length;n<r;n++){if(e(t[n],n))return P.some(n)}return P.none()},tt=function(t,e){return function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!g(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);F.apply(e,t[n])}return e}(W(t,e))},et=function(t,e){for(var n=0,r=t.length;n<r;++n){if(!0!==e(t[n],n))return!1}return!0},nt=function(t){var e=H.call(t,0);return e.reverse(),e},rt=function(t,e){return K(t,function(t){return!U(e,t)})},ot=function(t,e){var n=H.call(t,0);return n.sort(e),n},it=function(t,e){return e>=0&&e<t.length?P.some(t[e]):P.none()},ut=function(t){return it(t,0)},at=function(t){return it(t,t.length-1)},ct=w(Array.from)?Array.from:function(t){return H.call(t)},st=function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return P.none()},lt=Object.keys,ft=Object.hasOwnProperty,dt=function(t,e){for(var n=lt(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}},mt=function(t,e){return gt(t,function(t,n){return{k:n,v:e(t,n)}})},gt=function(t,e){var n={};return dt(t,function(t,r){var o=e(t,r);n[o.k]=o.v}),n},ht=function(t){return function(e,n){t[n]=e}},pt=function(t,e,n,r){return dt(t,function(t,o){(e(t,o)?n:r)(t,o)}),{}},vt=function(t,e){var n={};return pt(t,e,ht(n),C),n},bt=function(t){return function(t,e){var n=[];return dt(t,function(t,r){n.push(e(t,r))}),n}(t,T)},yt=function(t,e){return wt(t,e)?P.from(t[e]):P.none()},wt=function(t,e){return ft.call(t,e)},xt=function(t,e){return wt(t,e)&&void 0!==t[e]&&null!==t[e]},Ct=Array.isArray,St=function(t,e,n){var r,o;if(!t)return!1;if(n=n||t,void 0!==t.length){for(r=0,o=t.length;r<o;r++)if(!1===e.call(n,t[r],r,t))return!1}else for(r in t)if(wt(t,r)&&!1===e.call(n,t[r],r,t))return!1;return!0},kt=function(t,e){var n=[];return St(t,function(r,o){n.push(e(r,o,t))}),n},Ot=function(t,e){var n=[];return St(t,function(r,o){e&&!e(r,o,t)||n.push(r)}),n},Tt=function(t,e){if(t)for(var n=0,r=t.length;n<r;n++)if(t[n]===e)return n;return-1},_t=function(t,e,n,r){for(var o=v(n)?t[0]:n,i=0;i<t.length;i++)o=e.call(r,o,t[i],i);return o},Et=function(t,e,n){var r,o;for(r=0,o=t.length;r<o;r++)if(e.call(n,t[r],r,t))return r;return-1},Dt=function(t){return t[t.length-1]},At=function(){return(At=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function Nt(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}var Mt=function(t){var e,n=!1;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=!0,e=t.apply(null,r)),e}},zt=function(){return Rt(0,0)},Rt=function(t,e){return{major:t,minor:e}},Bt={nu:Rt,detect:function(t,e){var n=String(e).toLowerCase();return 0===t.length?zt():function(t,e){var n=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(r.test(e))return r}}(t,e);if(!n)return{major:0,minor:0};var r=function(t){return Number(e.replace(n,"$"+t))};return Rt(r(1),r(2))}(t,n)},unknown:zt},Lt=function(t,e){var n=String(e).toLowerCase();return Q(t,function(t){return t.search(n)})},Pt=function(t,e){return-1!==t.indexOf(e)},Ht=function(t,e){return function(t,e,n){return""===e||t.length>=e.length&&t.substr(n,n+e.length)===e}(t,e,0)},It=function(t){return function(e){return e.replace(t,"")}},Ft=It(/^\s+|\s+$/g),Vt=It(/^\s+/g),Ut=It(/\s+$/g),jt=function(t){return t.length>0},Wt=function(t){return!jt(t)},qt=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,$t=function(t){return function(e){return Pt(e,t)}},Gt=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return Pt(t,"edge/")&&Pt(t,"chrome")&&Pt(t,"safari")&&Pt(t,"applewebkit")}},{name:"Chrome",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,qt],search:function(t){return Pt(t,"chrome")&&!Pt(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return Pt(t,"msie")||Pt(t,"trident")}},{name:"Opera",versionRegexes:[qt,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:$t("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:$t("firefox")},{name:"Safari",versionRegexes:[qt,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(Pt(t,"safari")||Pt(t,"mobile/"))&&Pt(t,"applewebkit")}}],Kt=[{name:"Windows",search:$t("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return Pt(t,"iphone")||Pt(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:$t("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:$t("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:$t("linux"),versionRegexes:[]},{name:"Solaris",search:$t("sunos"),versionRegexes:[]},{name:"FreeBSD",search:$t("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:$t("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],Xt={browsers:O(Gt),oses:O(Kt)},Yt=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isEdge:r("Edge"),isChrome:r("Chrome"),isIE:r("IE"),isOpera:r("Opera"),isFirefox:r("Firefox"),isSafari:r("Safari")}},Jt={unknown:function(){return Yt({current:void 0,version:Bt.unknown()})},nu:Yt,edge:O("Edge"),chrome:O("Chrome"),ie:O("IE"),opera:O("Opera"),firefox:O("Firefox"),safari:O("Safari")},Qt=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isWindows:r("Windows"),isiOS:r("iOS"),isAndroid:r("Android"),isOSX:r("OSX"),isLinux:r("Linux"),isSolaris:r("Solaris"),isFreeBSD:r("FreeBSD"),isChromeOS:r("ChromeOS")}},Zt={unknown:function(){return Qt({current:void 0,version:Bt.unknown()})},nu:Qt,windows:O("Windows"),ios:O("iOS"),android:O("Android"),linux:O("Linux"),osx:O("OSX"),solaris:O("Solaris"),freebsd:O("FreeBSD"),chromeos:O("ChromeOS")},te=function(t,e,n){var r=Xt.browsers(),o=Xt.oses(),i=e.bind(function(t){return function(t,e){return st(e.brands,function(e){var n=e.brand.toLowerCase();return Q(t,function(t){var e;return n===(null===(e=t.brand)||void 0===e?void 0:e.toLowerCase())}).map(function(t){return{current:t.name,version:Bt.nu(parseInt(e.version,10),0)}})})}(r,t)}).orThunk(function(){return function(t,e){return Lt(t,e).map(function(t){var n=Bt.detect(t.versionRegexes,e);return{current:t.name,version:n}})}(r,t)}).fold(Jt.unknown,Jt.nu),u=function(t,e){return Lt(t,e).map(function(t){var n=Bt.detect(t.versionRegexes,e);return{current:t.name,version:n}})}(o,t).fold(Zt.unknown,Zt.nu);return{browser:i,os:u,deviceType:function(t,e,n,r){var o=t.isiOS()&&!0===/ipad/i.test(n),i=t.isiOS()&&!o,u=t.isiOS()||t.isAndroid(),a=u||r("(pointer:coarse)"),c=o||!i&&u&&r("(min-device-width:768px)"),s=i||u&&!c,l=e.isSafari()&&t.isiOS()&&!1===/safari/i.test(n),f=!s&&!c&&!l;return{isiPad:O(o),isiPhone:O(i),isTablet:O(c),isPhone:O(s),isTouch:O(a),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:O(l),isDesktop:O(f)}}(u,i,t,n)}},ee=function(t){return window.matchMedia(t).matches},ne=Mt(function(){return te(navigator.userAgent,P.from(navigator.userAgentData),ee)}),re=function(){return ne()},oe=navigator.userAgent,ie=re(),ue=ie.browser,ae=ie.os,ce=ie.deviceType,se=/WebKit/.test(oe)&&!ue.isEdge(),le="FormData"in window&&"FileReader"in window&&"URL"in window&&!!URL.createObjectURL,fe=-1!==oe.indexOf("Windows Phone"),de={opera:ue.isOpera(),webkit:se,ie:!(!ue.isIE()&&!ue.isEdge())&&ue.version.major,gecko:ue.isFirefox(),mac:ae.isOSX()||ae.isiOS(),iOS:ce.isiPad()||ce.isiPhone(),android:ae.isAndroid(),contentEditable:!0,transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",caretAfter:!0,range:window.getSelection&&"Range"in window,documentMode:ue.isIE()?document.documentMode||7:10,fileApi:le,ceFalse:!0,cacheSuffix:null,container:null,experimentalShadowDom:!1,canHaveCSP:!ue.isIE(),desktop:ce.isDesktop(),windowsPhone:fe,browser:{current:ue.current,version:ue.version,isChrome:ue.isChrome,isEdge:ue.isEdge,isFirefox:ue.isFirefox,isIE:ue.isIE,isOpera:ue.isOpera,isSafari:ue.isSafari},os:{current:ae.current,version:ae.version,isAndroid:ae.isAndroid,isChromeOS:ae.isChromeOS,isFreeBSD:ae.isFreeBSD,isiOS:ae.isiOS,isLinux:ae.isLinux,isOSX:ae.isOSX,isSolaris:ae.isSolaris,isWindows:ae.isWindows},deviceType:{isDesktop:ce.isDesktop,isiPad:ce.isiPad,isiPhone:ce.isiPhone,isPhone:ce.isPhone,isTablet:ce.isTablet,isTouch:ce.isTouch,isWebView:ce.isWebView}},me=/^\s*|\s*$/g,ge=function(t){return null===t||void 0===t?"":(""+t).replace(me,"")},he=function(t,e){return e?!("array"!==e||!Ct(t))||typeof t===e:void 0!==t},pe=function(t,e,n,r){r=r||this,t&&(n&&(t=t[n]),St(t,function(t,o){if(!1===e.call(r,t,o,n))return!1;pe(t,e,n,r)}))},ve={trim:ge,isArray:Ct,is:he,toArray:function(t){if(Ct(t))return t;for(var e=[],n=0,r=t.length;n<r;n++)e[n]=t[n];return e},makeMap:function(t,e,n){var r;for(t=t||[],e=e||",","string"==typeof t&&(t=t.split(e)),n=n||{},r=t.length;r--;)n[t[r]]={};return n},each:St,map:kt,grep:Ot,inArray:Tt,hasOwn:wt,extend:function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r++){var o=e[r];for(var i in o)if(wt(o,i)){var u=o[i];void 0!==u&&(t[i]=u)}}return t},create:function(t,e,n){var r,o,i,u=0,a=(t=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(t))[3].match(/(^|\.)(\w+)$/i)[2],c=this.createNS(t[3].replace(/\.\w+$/,""),n);if(!c[a]){if("static"===t[2])return c[a]=e,void(this.onCreate&&this.onCreate(t[2],t[3],c[a]));e[a]||(e[a]=function(){},u=1),c[a]=e[a],this.extend(c[a].prototype,e),t[5]&&(r=this.resolve(t[5]).prototype,o=t[5].match(/\.(\w+)$/i)[1],i=c[a],c[a]=u?function(){return r[o].apply(this,arguments)}:function(){return this.parent=r[o],i.apply(this,arguments)},c[a].prototype[a]=c[a],this.each(r,function(t,e){c[a].prototype[e]=r[e]}),this.each(e,function(t,e){r[e]?c[a].prototype[e]=function(){return this.parent=r[e],t.apply(this,arguments)}:e!==a&&(c[a].prototype[e]=t)})),this.each(e.static,function(t,e){c[a][e]=t})}},walk:pe,createNS:function(t,e){var n,r;for(e=e||window,t=t.split("."),n=0;n<t.length;n++)e[r=t[n]]||(e[r]={}),e=e[r];return e},resolve:function(t,e){var n,r;for(e=e||window,n=0,r=(t=t.split(".")).length;n<r&&(e=e[t[n]]);n++);return e},explode:function(t,e){return!t||he(t,"array")?t:kt(t.split(e||","),ge)},_addCacheSuffix:function(t){var e=de.cacheSuffix;return e&&(t+=(-1===t.indexOf("?")?"?":"&")+e),t}},be=function(t){if(null===t||void 0===t)throw new Error("Node cannot be null or undefined");return{dom:t}},ye={fromHtml:function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return be(n.childNodes[0])},fromTag:function(t,e){var n=(e||document).createElement(t);return be(n)},fromText:function(t,e){var n=(e||document).createTextNode(t);return be(n)},fromDom:be,fromPoint:function(t,e,n){return P.from(t.dom.elementFromPoint(e,n)).map(be)}},we=function(t,e){var n=[],r=function(t){return n.push(t),e(t)},o=e(t);do{o=o.bind(r)}while(o.isSome());return n},xe=function(t,e){var n=t.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},Ce=function(t){return 1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType||0===t.childElementCount},Se=function(t,e){return t.dom===e.dom},ke=function(t,e){return n=t.dom,r=e.dom,function(t,e,n){return 0!=(t.compareDocumentPosition(e)&n)}(n,r,Node.DOCUMENT_POSITION_CONTAINED_BY);var n,r},Oe=function(t,e){return re().browser.isIE()?ke(t,e):function(t,e){var n=t.dom,r=e.dom;return n!==r&&n.contains(r)}(t,e)};"undefined"!=typeof window?window:Function("return this;")();var Te=function(t){return t.dom.nodeName.toLowerCase()},_e=function(t){return t.dom.nodeType},Ee=function(t){return function(e){return _e(e)===t}},De=Ee(1),Ae=Ee(3),Ne=Ee(9),Me=Ee(11),ze=function(t){return ye.fromDom(t.dom.ownerDocument)},Re=function(t){return Ne(t)?t:ze(t)},Be=function(t){return ye.fromDom(Re(t).dom.defaultView)},Le=function(t){return P.from(t.dom.parentNode).map(ye.fromDom)},Pe=function(t){return P.from(t.dom.previousSibling).map(ye.fromDom)},He=function(t){return P.from(t.dom.nextSibling).map(ye.fromDom)},Ie=function(t){return nt(we(t,Pe))},Fe=function(t){return we(t,He)},Ve=function(t){return W(t.dom.childNodes,ye.fromDom)},Ue=function(t,e){var n=t.dom.childNodes;return P.from(n[e]).map(ye.fromDom)},je=function(t){return Ue(t,0)},We=function(t){return Ue(t,t.dom.childNodes.length-1)},qe=function(t){return t.dom.childNodes.length},$e=function(t){return Me(t)&&y(t.dom.host)},Ge=w(Element.prototype.attachShadow)&&w(Node.prototype.getRootNode),Ke=O(Ge),Xe=Ge?function(t){return ye.fromDom(t.dom.getRootNode())}:Re,Ye=function(t){return $e(t)?t:function(t){var e=t.dom.head;if(null===e||void 0===e)throw new Error("Head is not available yet");return ye.fromDom(e)}(Re(t))},Je=function(t){return ye.fromDom(t.dom.host)},Qe=function(t){return y(t.dom.shadowRoot)},Ze=function(t,e){Le(t).each(function(n){n.dom.insertBefore(e.dom,t.dom)})},tn=function(t,e){He(t).fold(function(){Le(t).each(function(t){nn(t,e)})},function(t){Ze(t,e)})},en=function(t,e){je(t).fold(function(){nn(t,e)},function(n){t.dom.insertBefore(e.dom,n.dom)})},nn=function(t,e){t.dom.appendChild(e.dom)},rn=function(t,e){q(e,function(e){nn(t,e)})},on=function(t){t.dom.textContent="",q(Ve(t),function(t){un(t)})},un=function(t){var e=t.dom;null!==e.parentNode&&e.parentNode.removeChild(e)},an=function(t){var e,n=Ve(t);n.length>0&&(e=t,q(n,function(t){Ze(e,t)})),un(t)},cn=function(t){var e=Ae(t)?t.dom.parentNode:t.dom;if(void 0===e||null===e||null===e.ownerDocument)return!1;var n,r,o=e.ownerDocument;return(n=ye.fromDom(e),r=Xe(n),$e(r)?P.some(r):P.none()).fold(function(){return o.body.contains(e)},k(cn,Je))},sn=function(t,e){return{left:t,top:e,translate:function(n,r){return sn(t+n,e+r)}}},ln=sn,fn=function(t,e){return void 0!==t?t:void 0!==e?e:0},dn=function(t){var e=t.dom,n=e.ownerDocument.body;return n===e?ln(n.offsetLeft,n.offsetTop):cn(t)?function(t){var e=t.getBoundingClientRect();return ln(e.left,e.top)}(e):ln(0,0)},mn=function(t){var e=void 0!==t?t.dom:document,n=e.body.scrollLeft||e.documentElement.scrollLeft,r=e.body.scrollTop||e.documentElement.scrollTop;return ln(n,r)},gn=function(t,e,n){var r=(void 0!==n?n.dom:document).defaultView;r&&r.scrollTo(t,e)},hn=function(t,e){re().browser.isSafari()&&w(t.dom.scrollIntoViewIfNeeded)?t.dom.scrollIntoViewIfNeeded(!1):t.dom.scrollIntoView(e)},pn=function(t,e,n,r){return{x:t,y:e,width:n,height:r,right:t+n,bottom:e+r}},vn=function(t){var e=void 0===t?window:t,n=e.document,r=mn(ye.fromDom(n));return function(t){var e=void 0===t?window:t;return re().browser.isFirefox()?P.none():P.from(e.visualViewport)}(e).fold(function(){var t=e.document.documentElement,n=t.clientWidth,o=t.clientHeight;return pn(r.left,r.top,n,o)},function(t){return pn(Math.max(t.pageLeft,r.left),Math.max(t.pageTop,r.top),t.width,t.height)})},bn=function(t){return function(e){return!!e&&e.nodeType===t}},yn=function(t){return!!t&&!Object.getPrototypeOf(t)},wn=bn(1),xn=function(t){var e=t.map(function(t){return t.toLowerCase()});return function(t){if(t&&t.nodeName){var n=t.nodeName.toLowerCase();return U(e,n)}return!1}},Cn=function(t,e){var n=e.toLowerCase().split(" ");return function(e){if(wn(e))for(var r=0;r<n.length;r++){var o=e.ownerDocument.defaultView.getComputedStyle(e,null);if((o?o.getPropertyValue(t):null)===n[r])return!0}return!1}},Sn=function(t){return function(e){return wn(e)&&e.hasAttribute(t)}},kn=function(t){return wn(t)&&t.hasAttribute("data-mce-bogus")},On=function(t){return wn(t)&&"TABLE"===t.tagName},Tn=function(t){return function(e){if(wn(e)){if(e.contentEditable===t)return!0;if(e.getAttribute("data-mce-contenteditable")===t)return!0}return!1}},_n=xn(["textarea","input"]),En=bn(3),Dn=bn(8),An=bn(9),Nn=bn(11),Mn=xn(["br"]),zn=xn(["img"]),Rn=Tn("true"),Bn=Tn("false"),Ln=xn(["td","th"]),Pn=xn(["video","audio","object","embed"]),Hn=function(t,e,n){return void 0===n&&(n=_),t.exists(function(t){return n(t,e)})},In=function(t,e,n){return t.isSome()&&e.isSome()?P.some(n(t.getOrDie(),e.getOrDie())):P.none()},Fn=function(t){return void 0!==t.style&&w(t.style.getPropertyValue)},Vn=function(t,e,n){if(!(d(n)||p(n)||x(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")},Un=function(t,e,n){Vn(t.dom,e,n)},jn=function(t,e){var n=t.dom;dt(e,function(t,e){Vn(n,e,t)})},Wn=function(t,e){var n=t.dom.getAttribute(e);return null===n?void 0:n},qn=function(t,e){return P.from(Wn(t,e))},$n=function(t,e){var n=t.dom;return!(!n||!n.hasAttribute)&&n.hasAttribute(e)},Gn=function(t,e){t.dom.removeAttribute(e)},Kn=function(t,e){var n=t.dom;dt(e,function(t,e){!function(t,e,n){if(!d(n))throw console.error("Invalid call to CSS.set. Property ",e,":: Value ",n,":: Element ",t),new Error("CSS value must be a string: "+n);Fn(t)&&t.style.setProperty(e,n)}(n,e,t)})},Xn=function(t,e){var n=t.dom,r=window.getComputedStyle(n).getPropertyValue(e);return""!==r||cn(t)?r:Yn(n,e)},Yn=function(t,e){return Fn(t)?t.style.getPropertyValue(e):""},Jn=function(t,e){var n=t.dom,r=Yn(n,e);return P.from(r).filter(function(t){return t.length>0})},Qn=function(t){var e={},n=t.dom;if(Fn(n))for(var r=0;r<n.style.length;r++){var o=n.style.item(r);e[o]=n.style[o]}return e},Zn=re().browser,tr=function(t){return Q(t,De)},er=function(t,e){return t.children&&U(t.children,e)},nr=function(t,e,n){var r=0,o=0,i=t.ownerDocument;if(n=n||t,e){if(n===t&&e.getBoundingClientRect&&"static"===Xn(ye.fromDom(t),"position")){var u=e.getBoundingClientRect();return{x:r=u.left+(i.documentElement.scrollLeft||t.scrollLeft)-i.documentElement.clientLeft,y:o=u.top+(i.documentElement.scrollTop||t.scrollTop)-i.documentElement.clientTop}}for(var a=e;a&&a!==n&&a.nodeType&&!er(a,n);){var c=a;r+=c.offsetLeft||0,o+=c.offsetTop||0,a=c.offsetParent}for(a=e.parentNode;a&&a!==n&&a.nodeType&&!er(a,n);)r-=a.scrollLeft||0,o-=a.scrollTop||0,a=a.parentNode;o+=function(t){return Zn.isFirefox()&&"table"===Te(t)?tr(Ve(t)).filter(function(t){return"caption"===Te(t)}).bind(function(t){return tr(Fe(t)).map(function(e){var n=e.dom.offsetTop,r=t.dom.offsetTop,o=t.dom.offsetHeight;return n<=r?-o:0})}).getOr(0):0}(ye.fromDom(e))}return{x:r,y:o}},rr={},or={exports:rr};!function(t,n,r,o){!function(e,o){"object"==typeof n&&void 0!==r?r.exports=o():"function"==typeof t&&t.amd?t(o):(e="undefined"!=typeof globalThis?globalThis:e||self).EphoxContactWrapper=o()}(this,function(){var t,n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{},r={exports:{}};t=r,function(e){var n=setTimeout;function r(){}function o(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],s(t,this)}function i(t,e){for(;3===t._state;)t=t._value;0!==t._state?(t._handled=!0,o._immediateFn(function(){var n=1===t._state?e.onFulfilled:e.onRejected;if(null!==n){var r;try{r=n(t._value)}catch(t){return void a(e.promise,t)}u(e.promise,r)}else(1===t._state?u:a)(e.promise,t._value)})):t._deferreds.push(e)}function u(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if(e instanceof o)return t._state=3,t._value=e,void c(t);if("function"==typeof n)return void s((r=n,i=e,function(){r.apply(i,arguments)}),t)}t._state=1,t._value=e,c(t)}catch(e){a(t,e)}var r,i}function a(t,e){t._state=2,t._value=e,c(t)}function c(t){2===t._state&&0===t._deferreds.length&&o._immediateFn(function(){t._handled||o._unhandledRejectionFn(t._value)});for(var e=0,n=t._deferreds.length;e<n;e++)i(t,t._deferreds[e]);t._deferreds=null}function s(t,e){var n=!1;try{t(function(t){n||(n=!0,u(e,t))},function(t){n||(n=!0,a(e,t))})}catch(t){if(n)return;n=!0,a(e,t)}}o.prototype.catch=function(t){return this.then(null,t)},o.prototype.then=function(t,e){var n=new this.constructor(r);return i(this,new function(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}(t,e,n)),n},o.all=function(t){var e=Array.prototype.slice.call(t);return new o(function(t,n){if(0===e.length)return t([]);var r=e.length;function o(i,u){try{if(u&&("object"==typeof u||"function"==typeof u)){var a=u.then;if("function"==typeof a)return void a.call(u,function(t){o(i,t)},n)}e[i]=u,0==--r&&t(e)}catch(t){n(t)}}for(var i=0;i<e.length;i++)o(i,e[i])})},o.resolve=function(t){return t&&"object"==typeof t&&t.constructor===o?t:new o(function(e){e(t)})},o.reject=function(t){return new o(function(e,n){n(t)})},o.race=function(t){return new o(function(e,n){for(var r=0,o=t.length;r<o;r++)t[r].then(e,n)})},o._immediateFn="function"==typeof setImmediate?function(t){setImmediate(t)}:function(t){n(t,0)},o._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)},o._setImmediateFn=function(t){o._immediateFn=t},o._setUnhandledRejectionFn=function(t){o._unhandledRejectionFn=t},t.exports?t.exports=o:e.Promise||(e.Promise=o)}(n);var o=r.exports;return{boltExport:("undefined"!=typeof window?window:Function("return this;")()).Promise||o}})}(void 0,rr,or);var ir=or.exports.boltExport,ur=function(t){var e=P.none(),n=[],r=function(t){o()?u(t):n.push(t)},o=function(){return e.isSome()},i=function(t){q(t,u)},u=function(t){e.each(function(e){setTimeout(function(){t(e)},0)})};return t(function(t){o()||(e=P.some(t),i(n),n=[])}),{get:r,map:function(t){return ur(function(e){r(function(n){e(t(n))})})},isReady:o}},ar={nu:ur,pure:function(t){return ur(function(e){e(t)})}},cr=function(t){setTimeout(function(){throw t},0)},sr=function(t){var e=function(e){t().then(e,cr)};return{map:function(e){return sr(function(){return t().then(e)})},bind:function(e){return sr(function(){return t().then(function(t){return e(t).toPromise()})})},anonBind:function(e){return sr(function(){return t().then(function(){return e.toPromise()})})},toLazy:function(){return ar.nu(e)},toCached:function(){var e=null;return sr(function(){return null===e&&(e=t()),e})},toPromise:t,get:e}},lr=function(t){return sr(function(){return new ir(t)})},fr=function(t,e){return e(function(e){var n=[],r=0;0===t.length?e([]):q(t,function(o,i){o.get(function(o){return function(i){n[o]=i,++r>=t.length&&e(n)}}(i))})})},dr=function(t){return{isValue:z,isError:M,getOr:O(t),getOrThunk:O(t),getOrDie:O(t),or:function(e){return dr(t)},orThunk:function(e){return dr(t)},fold:function(e,n){return n(t)},map:function(e){return dr(e(t))},mapError:function(e){return dr(t)},each:function(e){e(t)},bind:function(e){return e(t)},exists:function(e){return e(t)},forall:function(e){return e(t)},toOptional:function(){return P.some(t)}}},mr=function(t){return{isValue:M,isError:z,getOr:T,getOrThunk:function(t){return t()},getOrDie:function(){return(e=String(t),function(){throw new Error(e)})();var e},or:T,orThunk:function(t){return t()},fold:function(e,n){return e(t)},map:function(e){return mr(t)},mapError:function(e){return mr(e(t))},each:C,bind:function(e){return mr(t)},exists:M,forall:z,toOptional:P.none}},gr={value:dr,error:mr,fromOption:function(t,e){return t.fold(function(){return mr(e)},dr)}},hr=function(t){if(!g(t))throw new Error("cases must be an array");if(0===t.length)throw new Error("there must be at least one case");var e=[],n={};return q(t,function(r,o){var i=lt(r);if(1!==i.length)throw new Error("one and only one name per case");var u=i[0],a=r[u];if(void 0!==n[u])throw new Error("duplicate key detected:"+u);if("cata"===u)throw new Error("cannot have a case named cata (sorry)");if(!g(a))throw new Error("case arguments must be an array");e.push(u),n[u]=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=n.length;if(i!==a.length)throw new Error("Wrong number of arguments to case "+u+". Expected "+a.length+" ("+a+"), got "+i);return{fold:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];if(e.length!==t.length)throw new Error("Wrong number of arguments to fold. Expected "+t.length+", got "+e.length);return e[o].apply(null,n)},match:function(t){var r=lt(t);if(e.length!==r.length)throw new Error("Wrong number of arguments to match. Expected: "+e.join(",")+"\nActual: "+r.join(","));if(!et(e,function(t){return U(r,t)}))throw new Error("Not all branches were specified when using match. Specified: "+r.join(", ")+"\nRequired: "+e.join(", "));return t[u].apply(null,n)},log:function(t){console.log(t,{constructors:e,constructor:u,params:n})}}}}),n};hr([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);var pr=function(t){return t.fold(T,T)};function vr(t,e,n,r,o){return t(n,r)?P.some(n):w(o)&&o(n)?P.none():e(n,r,o)}var br,yr,wr,xr,Cr,Sr,kr,Or,Tr,_r,Er,Dr,Ar,Nr,Mr,zr,Rr,Br,Lr,Pr,Hr=function(t,e,n){for(var r=t.dom,o=w(n)?n:M;r.parentNode;){r=r.parentNode;var i=ye.fromDom(r);if(e(i))return P.some(i);if(o(i))break}return P.none()},Ir=function(t,e,n){return vr(function(t,e){return e(t)},Hr,t,e,n)},Fr=function(t,e){return Q(t.dom.childNodes,function(t){return e(ye.fromDom(t))}).map(ye.fromDom)},Vr=function(t,e,n){return Hr(t,function(t){return xe(t,e)},n)},Ur=function(t,e){return function(t,e){var n=void 0===e?document:e.dom;return Ce(n)?P.none():P.from(n.querySelector(t)).map(ye.fromDom)}(e,t)},jr=function(t,e,n){return vr(function(t,e){return xe(t,e)},Vr,t,e,n)},Wr=window.Promise?window.Promise:ir,qr=function(t,e){return"number"!=typeof e&&(e=0),setTimeout(t,e)},$r=function(t,e){return"number"!=typeof e&&(e=1),setInterval(t,e)},Gr=function(t,e){var n,r=function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];clearTimeout(n),n=qr(function(){t.apply(this,r)},e)};return r.stop=function(){clearTimeout(n)},r},Kr={requestAnimationFrame:function(t,e){br?br.then(t):br=new Wr(function(t){e||(e=document.body),function(t,e){for(var n=window.requestAnimationFrame,r=["ms","moz","webkit"],o=0;o<r.length&&!n;o++)n=window[r[o]+"RequestAnimationFrame"];n||(n=function(t){window.setTimeout(t,0)}),n(t,e)}(t,e)}).then(t)},setTimeout:qr,setInterval:$r,setEditorTimeout:function(t,e,n){return qr(function(){t.removed||e()},n)},setEditorInterval:function(t,e,n){var r=$r(function(){t.removed?clearInterval(r):e()},n);return r},debounce:Gr,throttle:Gr,clearInterval:function(t){return clearInterval(t)},clearTimeout:function(t){return clearTimeout(t)}},Xr=function(t,e){void 0===e&&(e={});var n=0,r={},o=ye.fromDom(t),i=Re(o),u=e.maxLoadTime||5e3,a=function(a,c,s){var l,f=ve._addCacheSuffix(a),d=function(t){return yt(r,t).getOrThunk(function(){return{id:"mce-u"+n++,passed:[],failed:[],count:0}})}(f);r[f]=d,d.count++;var m=function(t,e){for(var n=t.length;n--;)t[n]();d.status=e,d.passed=[],d.failed=[],l&&(l.onload=null,l.onerror=null,l=null)},g=function(){return m(d.passed,2)},h=function(){return m(d.failed,3)},p=function(){var e;e=p,function(){for(var e=t.styleSheets,n=e.length;n--;){var r=e[n].ownerNode;if(r&&r.id===l.id)return g(),!0}return!1}()||(Date.now()-y<u?Kr.setTimeout(e):h())};if(c&&d.passed.push(c),s&&d.failed.push(s),1!==d.status)if(2!==d.status)if(3!==d.status){d.status=1;var v=ye.fromTag("link",i.dom);jn(v,{rel:"stylesheet",type:"text/css",id:d.id});var b,y=Date.now();e.contentCssCors&&Un(v,"crossOrigin","anonymous"),e.referrerPolicy&&Un(v,"referrerpolicy",e.referrerPolicy),(l=v.dom).onload=p,l.onerror=h,b=v,nn(Ye(o),b),Un(v,"href",f)}else h();else g()},c=function(t){return lr(function(e){a(t,S(e,O(gr.value(t))),S(e,O(gr.error(t))))})},s=function(t){var e=ve._addCacheSuffix(t);yt(r,e).each(function(t){var n,i;0===--t.count&&(delete r[e],n=t.id,i=Ye(o),Ur(i,"#"+n).each(un))})};return{load:a,loadAll:function(t,e,n){var r;(r=W(t,c),fr(r,lr)).get(function(t){var r=G(t,function(t){return t.isValue()});r.fail.length>0?n(r.fail.map(pr)):e(r.pass.map(pr))})},unload:s,unloadAll:function(t){q(t,function(t){s(t)})},_setReferrerPolicy:function(t){e.referrerPolicy=t}}},Yr=function(){var t=new WeakMap;return{forElement:function(e,n){var r=Xe(e).dom;return P.from(t.get(r)).getOrThunk(function(){var e=Xr(r,n);return t.set(r,e),e})}}}(),Jr=function(){function t(t,e){this.node=t,this.rootNode=e,this.current=this.current.bind(this),this.next=this.next.bind(this),this.prev=this.prev.bind(this),this.prev2=this.prev2.bind(this)}return t.prototype.current=function(){return this.node},t.prototype.next=function(t){return this.node=this.findSibling(this.node,"firstChild","nextSibling",t),this.node},t.prototype.prev=function(t){return this.node=this.findSibling(this.node,"lastChild","previousSibling",t),this.node},t.prototype.prev2=function(t){return this.node=this.findPreviousNode(this.node,"lastChild","previousSibling",t),this.node},t.prototype.findSibling=function(t,e,n,r){var o,i;if(t){if(!r&&t[e])return t[e];if(t!==this.rootNode){if(o=t[n])return o;for(i=t.parentNode;i&&i!==this.rootNode;i=i.parentNode)if(o=i[n])return o}}},t.prototype.findPreviousNode=function(t,e,n,r){var o,i,u;if(t){if(o=t[n],this.rootNode&&o===this.rootNode)return;if(o){if(!r)for(u=o[e];u;u=u[e])if(!u[e])return u;return o}if((i=t.parentNode)&&i!==this.rootNode)return i}},t}(),Qr=function(t){var e;return function(n){return e=e||function(t,e){for(var n={},r=0,o=t.length;r<o;r++){var i=t[r];n[String(i)]=e(i,r)}return n}(t,z),wt(e,Te(n))}},Zr=Qr(["h1","h2","h3","h4","h5","h6"]),to=Qr(["article","aside","details","div","dt","figcaption","footer","form","fieldset","header","hgroup","html","main","nav","section","summary","body","p","dl","multicol","dd","figure","address","center","blockquote","h1","h2","h3","h4","h5","h6","listing","xmp","pre","plaintext","menu","dir","ul","ol","li","hr","table","tbody","thead","tfoot","th","tr","td","caption"]),eo=function(t){return De(t)&&!to(t)},no=function(t){return De(t)&&"br"===Te(t)},ro=Qr(["h1","h2","h3","h4","h5","h6","p","div","address","pre","form","blockquote","center","dir","fieldset","header","footer","article","section","hgroup","aside","nav","figure"]),oo=Qr(["ul","ol","dl"]),io=Qr(["li","dd","dt"]),uo=Qr(["thead","tbody","tfoot"]),ao=Qr(["td","th"]),co=Qr(["pre","script","textarea","style"]),so="\ufeff",lo=function(t){return"\ufeff"===t},fo=function(t){return t.replace(/\uFEFF/g,"")},mo=wn,go=En,ho=function(t){return go(t)&&(t=t.parentNode),mo(t)&&t.hasAttribute("data-mce-caret")},po=function(t){return go(t)&&lo(t.data)},vo=function(t){return ho(t)||po(t)},bo=function(t){return t.firstChild!==t.lastChild||!Mn(t.firstChild)},yo=function(t){var e=t.container();return!!En(e)&&(e.data.charAt(t.offset())===so||t.isAtStart()&&po(e.previousSibling))},wo=function(t){var e=t.container();return!!En(e)&&(e.data.charAt(t.offset()-1)===so||t.isAtEnd()&&po(e.nextSibling))},xo=function(t,e,n){var r,o=e.ownerDocument.createElement(t);o.setAttribute("data-mce-caret",n?"before":"after"),o.setAttribute("data-mce-bogus","all"),o.appendChild(((r=document.createElement("br")).setAttribute("data-mce-bogus","1"),r));var i=e.parentNode;return n?i.insertBefore(o,e):e.nextSibling?i.insertBefore(o,e.nextSibling):i.appendChild(o),o},Co=function(t){return go(t)&&t.data[0]===so},So=function(t){return go(t)&&t.data[t.data.length-1]===so},ko=function(t){return t&&t.hasAttribute("data-mce-caret")?(e=t.getElementsByTagName("br"),n=e[e.length-1],kn(n)&&n.parentNode.removeChild(n),t.removeAttribute("data-mce-caret"),t.removeAttribute("data-mce-bogus"),t.removeAttribute("style"),t.removeAttribute("_moz_abspos"),t):null;var e,n},Oo=function(t){return ho(t.startContainer)},To=Rn,_o=Bn,Eo=Mn,Do=En,Ao=xn(["script","style","textarea"]),No=xn(["img","input","textarea","hr","iframe","video","audio","object","embed"]),Mo=xn(["table"]),zo=vo,Ro=function(t){return!zo(t)&&(Do(t)?!Ao(t.parentNode):No(t)||Eo(t)||Mo(t)||Bo(t))},Bo=function(t){return!1===function(t){return wn(t)&&"true"===t.getAttribute("unselectable")}(t)&&_o(t)},Lo=function(t,e){return Ro(t)&&function(t,e){for(t=t.parentNode;t&&t!==e;t=t.parentNode){if(Bo(t))return!1;if(To(t))return!0}return!0}(t,e)},Po=/^[ \t\r\n]*$/,Ho=function(t){return Po.test(t)},Io=function(t,e){var n,r,o,i=ye.fromDom(e),u=ye.fromDom(t);return n=u,r="pre,code",o=E(Se,i),Vr(n,r,o).isSome()},Fo=function(t,e){return Ro(t)&&!1===function(t,e){return En(t)&&Ho(t.data)&&!1===Io(t,e)}(t,e)||function(t){return wn(t)&&"A"===t.nodeName&&!t.hasAttribute("href")&&(t.hasAttribute("name")||t.hasAttribute("id"))}(t)||Vo(t)},Vo=Sn("data-mce-bookmark"),Uo=Sn("data-mce-bogus"),jo=(yr="data-mce-bogus",wr="all",function(t){return wn(t)&&t.getAttribute(yr)===wr}),Wo=function(t,e){return void 0===e&&(e=!0),function(t,e){var n=0;if(Fo(t,t))return!1;var r=t.firstChild;if(!r)return!0;var o=new Jr(r,t);do{if(e){if(jo(r)){r=o.next(!0);continue}if(Uo(r)){r=o.next();continue}}if(Mn(r))n++,r=o.next();else{if(Fo(r,t))return!1;r=o.next()}}while(r);return n<=1}(t.dom,e)},qo=function(t,e){return y(t)&&(Fo(t,e)||eo(ye.fromDom(t)))},$o=function(t){return function(t){return"span"===t.nodeName.toLowerCase()}(t)&&"bookmark"===t.getAttribute("data-mce-type")},Go=function(t,e){return En(t)&&t.data.length>0&&function(t,e){var n=new Jr(t,e).prev(!1),r=new Jr(t,e).next(!1),o=v(n)||qo(n,e),i=v(r)||qo(r,e);return o&&i}(t,e)},Ko=function(t,e,n){var r=n||e;if(wn(e)&&$o(e))return e;for(var o=e.childNodes,i=o.length-1;i>=0;i--)Ko(t,o[i],r);if(wn(e)){var u=e.childNodes;1===u.length&&$o(u[0])&&e.parentNode.insertBefore(u[0],e)}return function(t){return Nn(t)||An(t)}(e)||Fo(e,r)||function(t){return!!wn(t)&&t.childNodes.length>0}(e)||Go(e,r)||t.remove(e),e},Xo=ve.makeMap,Yo=/[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Jo=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Qo=/[<>&\"\']/g,Zo=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,ti={128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"},ei={'"':""","'":"'","<":"<",">":">","&":"&","`":"`"},ni={"<":"<",">":">","&":"&",""":'"',"'":"'"},ri=function(t,e){var n,r,o,i={};if(t){for(t=t.split(","),e=e||10,n=0;n<t.length;n+=2)r=String.fromCharCode(parseInt(t[n],e)),ei[r]||(o="&"+t[n+1]+";",i[r]=o,i[o]=r);return i}},oi=ri("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32),ii=function(t,e){return t.replace(e?Yo:Jo,function(t){return ei[t]||t})},ui=function(t,e){return t.replace(e?Yo:Jo,function(t){return t.length>1?"&#"+(1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320)+65536)+";":ei[t]||"&#"+t.charCodeAt(0)+";"})},ai=function(t,e,n){return n=n||oi,t.replace(e?Yo:Jo,function(t){return ei[t]||n[t]||t})},ci={encodeRaw:ii,encodeAllRaw:function(t){return(""+t).replace(Qo,function(t){return ei[t]||t})},encodeNumeric:ui,encodeNamed:ai,getEncodeFunc:function(t,e){var n=ri(e)||oi,r=Xo(t.replace(/\+/g,","));return r.named&&r.numeric?function(t,e){return t.replace(e?Yo:Jo,function(t){return void 0!==ei[t]?ei[t]:void 0!==n[t]?n[t]:t.length>1?"&#"+(1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320)+65536)+";":"&#"+t.charCodeAt(0)+";"})}:r.named?e?function(t,e){return ai(t,e,n)}:ai:r.numeric?ui:ii},decode:function(t){return t.replace(Zo,function(t,e){return e?(e="x"===e.charAt(0).toLowerCase()?parseInt(e.substr(1),16):parseInt(e,10))>65535?(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e))):ti[e]||String.fromCharCode(e):ni[t]||oi[t]||(n=t,(r=ye.fromTag("div").dom).innerHTML=n,r.textContent||r.innerText||n);var n,r})}},si={},li={},fi=ve.makeMap,di=ve.each,mi=ve.extend,gi=ve.explode,hi=ve.inArray,pi=function(t,e){return(t=ve.trim(t))?t.split(e||" "):[]},vi=function(t,e){var n=fi(t," ",fi(t.toUpperCase()," "));return mi(n,e)},bi=function(t){return vi("td th li dt dd figcaption caption details summary",t.getTextBlockElements())},yi=function(t,e){var n;return t&&(n={},"string"==typeof t&&(t={"*":t}),di(t,function(t,r){n[r]=n[r.toUpperCase()]="map"===e?fi(t,/[, ]/):gi(t,/[, ]/)})),n},wi=function(t){var e,n,r,o,i,u,a,c,s,l,f={},d={},m=[],g={},h={},p=function(e,n,r){var o=t[e];return o?o=fi(o,/[, ]/,fi(o.toUpperCase(),/[, ]/)):(o=si[e])||(o=vi(n,r),si[e]=o),o},v=(e=(t=t||{}).schema,c={},s=function(t,e,r){var o,i,u,a=function(t,e){var n,r,o={};for(n=0,r=t.length;n<r;n++)o[t[n]]=e||{};return o};r=r||[],e=e||"","string"==typeof r&&(r=pi(r));var s=pi(t);for(o=s.length;o--;)u={attributes:a(i=pi([n,e].join(" "))),attributesOrder:i,children:a(r,li)},c[s[o]]=u},l=function(t,e){var n,r,o,i,u=pi(t);n=u.length;for(var a=pi(e);n--;)for(r=c[u[n]],o=0,i=a.length;o<i;o++)r.attributes[a[o]]={},r.attributesOrder.push(a[o])},si[e]?si[e]:(n="id accesskey class dir lang style tabindex title role",r="address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul",o="a abbr b bdo br button cite code del dfn em embed i iframe img input ins kbd label map noscript object q s samp script select small span strong sub sup textarea u var #text #comment","html4"!==e&&(n+=" contenteditable contextmenu draggable dropzone hidden spellcheck translate",r+=" article aside details dialog figure main header footer hgroup section nav",o+=" audio canvas command datalist mark meter output picture progress time wbr video ruby bdi keygen"),"html5-strict"!==e&&(n+=" xml:lang",o=[o,a="acronym applet basefont big font strike tt"].join(" "),di(pi(a),function(t){s(t,"",o)}),r=[r,u="center dir isindex noframes"].join(" "),i=[r,o].join(" "),di(pi(u),function(t){s(t,"",i)})),i=i||[r,o].join(" "),s("html","manifest","head body"),s("head","","base command link meta noscript script style title"),s("title hr noscript br"),s("base","href target"),s("link","href rel media hreflang type sizes hreflang"),s("meta","name http-equiv content charset"),s("style","media type scoped"),s("script","src async defer type charset"),s("body","onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload onmessage onoffline ononline onpagehide onpageshow onpopstate onresize onscroll onstorage onunload",i),s("address dt dd div caption","",i),s("h1 h2 h3 h4 h5 h6 pre p abbr code var samp kbd sub sup i b u bdo span legend em strong small s cite dfn","",o),s("blockquote","cite",i),s("ol","reversed start type","li"),s("ul","","li"),s("li","value",i),s("dl","","dt dd"),s("a","href target rel media hreflang type",o),s("q","cite",o),s("ins del","cite datetime",i),s("img","src sizes srcset alt usemap ismap width height"),s("iframe","src name width height",i),s("embed","src type width height"),s("object","data type typemustmatch name usemap form width height",[i,"param"].join(" ")),s("param","name value"),s("map","name",[i,"area"].join(" ")),s("area","alt coords shape href target rel media hreflang type"),s("table","border","caption colgroup thead tfoot tbody tr"+("html4"===e?" col":"")),s("colgroup","span","col"),s("col","span"),s("tbody thead tfoot","","tr"),s("tr","","td th"),s("td","colspan rowspan headers",i),s("th","colspan rowspan headers scope abbr",i),s("form","accept-charset action autocomplete enctype method name novalidate target",i),s("fieldset","disabled form name",[i,"legend"].join(" ")),s("label","form for",o),s("input","accept alt autocomplete checked dirname disabled form formaction formenctype formmethod formnovalidate formtarget height list max maxlength min multiple name pattern readonly required size src step type value width"),s("button","disabled form formaction formenctype formmethod formnovalidate formtarget name type value","html4"===e?i:o),s("select","disabled form multiple name required size","option optgroup"),s("optgroup","disabled label","option"),s("option","disabled label selected value"),s("textarea","cols dirname disabled form maxlength name readonly required rows wrap"),s("menu","type label",[i,"li"].join(" ")),s("noscript","",i),"html4"!==e&&(s("wbr"),s("ruby","",[o,"rt rp"].join(" ")),s("figcaption","",i),s("mark rt rp summary bdi","",o),s("canvas","width height",i),s("video","src crossorigin poster preload autoplay mediagroup loop muted controls width height buffered",[i,"track source"].join(" ")),s("audio","src crossorigin preload autoplay mediagroup loop muted controls buffered volume",[i,"track source"].join(" ")),s("picture","","img source"),s("source","src srcset type media sizes"),s("track","kind src srclang label default"),s("datalist","",[o,"option"].join(" ")),s("article section nav aside main header footer","",i),s("hgroup","","h1 h2 h3 h4 h5 h6"),s("figure","",[i,"figcaption"].join(" ")),s("time","datetime",o),s("dialog","open",i),s("command","type label icon disabled checked radiogroup command"),s("output","for form name",o),s("progress","value max",o),s("meter","value min max low high optimum",o),s("details","open",[i,"summary"].join(" ")),s("keygen","autofocus challenge disabled form keytype name")),"html5-strict"!==e&&(l("script","language xml:space"),l("style","xml:space"),l("object","declare classid code codebase codetype archive standby align border hspace vspace"),l("embed","align name hspace vspace"),l("param","valuetype type"),l("a","charset name rev shape coords"),l("br","clear"),l("applet","codebase archive code object alt name width height align hspace vspace"),l("img","name longdesc align border hspace vspace"),l("iframe","longdesc frameborder marginwidth marginheight scrolling align"),l("font basefont","size color face"),l("input","usemap align"),l("select"),l("textarea"),l("h1 h2 h3 h4 h5 h6 div p legend caption","align"),l("ul","type compact"),l("li","type"),l("ol dl menu dir","compact"),l("pre","width xml:space"),l("hr","align noshade size width"),l("isindex","prompt"),l("table","summary width frame rules cellspacing cellpadding align bgcolor"),l("col","width align char charoff valign"),l("colgroup","width align char charoff valign"),l("thead","align char charoff valign"),l("tr","align char charoff valign bgcolor"),l("th","axis align char charoff valign nowrap bgcolor width height"),l("form","accept"),l("td","abbr axis scope align char charoff valign nowrap bgcolor width height"),l("tfoot","align char charoff valign"),l("tbody","align char charoff valign"),l("area","nohref"),l("body","background bgcolor text link vlink alink")),"html4"!==e&&(l("input button select textarea","autofocus"),l("input textarea","placeholder"),l("a","download"),l("link script img","crossorigin"),l("img","loading"),l("iframe","sandbox seamless allowfullscreen loading")),di(pi("a form meter progress dfn"),function(t){c[t]&&delete c[t].children[t]}),delete c.caption.children.table,delete c.script,si[e]=c,c));!1===t.verify_html&&(t.valid_elements="*[*]");var b=yi(t.valid_styles),y=yi(t.invalid_styles,"map"),w=yi(t.valid_classes,"map"),x=p("whitespace_elements","pre script noscript style textarea video audio iframe object code"),C=p("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),S=p("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),k=p("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls"),T=p("non_empty_elements","td th iframe video audio object script code pre",S),_=p("move_caret_before_on_enter_elements","td th iframe video audio object script code table",S),E=p("text_block_elements","h1 h2 h3 h4 h5 h6 p div address pre form blockquote center dir fieldset header footer article section hgroup aside main nav figure"),D=p("block_elements","hr table tbody thead tfoot th tr td li ol ul caption dl dt dd noscript menu isindex option datalist select optgroup figcaption details summary",E),A=p("text_inline_elements","span strong b em i font s strike u var cite dfn code mark q sup sub samp");di((t.special||"script noscript iframe noframes noembed title style textarea xmp").split(" "),function(t){h[t]=new RegExp("</"+t+"[^>]*>","gi")});var N=function(t){return new RegExp("^"+t.replace(/([?+*])/g,".$1")+"$")},M=function(t){var e,n,r,o,i,u,a,c,s,l,d,g,h,p,v,b,y,w,x=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)])?$/,C=/^([!\-])?(\w+[\\:]:\w+|[^=:<]+)?(?:([=:<])(.*))?$/,S=/[*?+]/;if(t){var k=pi(t,",");for(f["@"]&&(b=f["@"].attributes,y=f["@"].attributesOrder),e=0,n=k.length;e<n;e++)if(i=x.exec(k[e])){if(p=i[1],s=i[2],v=i[3],c=i[5],u={attributes:g={},attributesOrder:h=[]},"#"===p&&(u.paddEmpty=!0),"-"===p&&(u.removeEmpty=!0),"!"===i[4]&&(u.removeEmptyAttrs=!0),b&&(dt(b,function(t,e){g[e]=t}),h.push.apply(h,y)),c)for(r=0,o=(c=pi(c,"|")).length;r<o;r++)if(i=C.exec(c[r])){if(a={},d=i[1],l=i[2].replace(/[\\:]:/g,":"),p=i[3],w=i[4],"!"===d&&(u.attributesRequired=u.attributesRequired||[],u.attributesRequired.push(l),a.required=!0),"-"===d){delete g[l],h.splice(hi(h,l),1);continue}p&&("="===p&&(u.attributesDefault=u.attributesDefault||[],u.attributesDefault.push({name:l,value:w}),a.defaultValue=w),":"===p&&(u.attributesForced=u.attributesForced||[],u.attributesForced.push({name:l,value:w}),a.forcedValue=w),"<"===p&&(a.validValues=fi(w,"?"))),S.test(l)?(u.attributePatterns=u.attributePatterns||[],a.pattern=N(l),u.attributePatterns.push(a)):(g[l]||h.push(l),g[l]=a)}b||"@"!==s||(b=g,y=h),v&&(u.outputName=s,f[v]=u),S.test(s)?(u.pattern=N(s),m.push(u)):f[s]=u}}},z=function(t){f={},m=[],M(t),di(v,function(t,e){d[e]=t.children})},R=function(t){var e=/^(~)?(.+)$/;t&&(si.text_block_elements=si.block_elements=null,di(pi(t,","),function(t){var n=e.exec(t),r="~"===n[1],o=r?"span":"div",i=n[2];if(d[i]=d[o],g[i]=o,r||(D[i.toUpperCase()]={},D[i]={}),!f[i]){var u=f[o];delete(u=mi({},u)).removeEmptyAttrs,delete u.removeEmpty,f[i]=u}di(d,function(t,e){t[o]&&(d[e]=t=mi({},d[e]),t[i]=t[o])})}))},B=function(e){var n=/^([+\-]?)([A-Za-z0-9_\-.\u00b7\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u037d\u037f-\u1fff\u200c-\u200d\u203f-\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]+)\[([^\]]+)]$/;si[t.schema]=null,e&&di(pi(e,","),function(t){var e,r,o=n.exec(t);o&&(r=o[1],e=r?d[o[2]]:d[o[2]]={"#comment":{}},e=d[o[2]],di(pi(o[3],"|"),function(t){"-"===r?delete e[t]:e[t]={}}))})},L=function(t){var e,n=f[t];if(n)return n;for(e=m.length;e--;)if((n=m[e]).pattern.test(t))return n};t.valid_elements?z(t.valid_elements):(di(v,function(t,e){f[e]={attributes:t.attributes,attributesOrder:t.attributesOrder},d[e]=t.children}),"html5"!==t.schema&&di(pi("strong/b em/i"),function(t){var e=pi(t,"/");f[e[1]].outputName=e[0]}),di(A,function(e,n){f[n]&&(t.padd_empty_block_inline_children&&(f[n].paddInEmptyBlock=!0),f[n].removeEmpty=!0)}),di(pi("ol ul blockquote a table tbody"),function(t){f[t]&&(f[t].removeEmpty=!0)}),di(pi("p h1 h2 h3 h4 h5 h6 th td pre div address caption li"),function(t){f[t].paddEmpty=!0}),di(pi("span"),function(t){f[t].removeEmptyAttrs=!0})),R(t.custom_elements),B(t.valid_children),M(t.extended_valid_elements),B("+ol[ul|ol],+ul[ul|ol]"),di({dd:"dl",dt:"dl",li:"ul ol",td:"tr",th:"tr",tr:"tbody thead tfoot",tbody:"table",thead:"table",tfoot:"table",legend:"fieldset",area:"map",param:"video audio object"},function(t,e){f[e]&&(f[e].parentsRequired=pi(t))}),t.invalid_elements&&di(gi(t.invalid_elements),function(t){f[t]&&delete f[t]}),L("span")||M("span[!data-mce-type|*]");var P=O(b),H=O(y),I=O(w),F=O(k),V=O(D),U=O(E),j=O(A),W=O(S),q=O(C),$=O(T),G=O(_),K=O(x),X=O(h),Y=O(g);return{children:d,elements:f,getValidStyles:P,getValidClasses:I,getBlockElements:V,getInvalidStyles:H,getShortEndedElements:W,getTextBlockElements:U,getTextInlineElements:j,getBoolAttrs:F,getElementRule:L,getSelfClosingElements:q,getNonEmptyElements:$,getMoveCaretBeforeOnEnterElements:G,getWhiteSpaceElements:K,getSpecialElements:X,isValidChild:function(t,e){var n=d[t.toLowerCase()];return!(!n||!n[e.toLowerCase()])},isValid:function(t,e){var n,r,o=L(t);if(o){if(!e)return!0;if(o.attributes[e])return!0;if(n=o.attributePatterns)for(r=n.length;r--;)if(n[r].pattern.test(t))return!0}return!1},getCustomElements:Y,addValidElements:M,setValidElements:z,addCustomElements:R,addValidChildren:B}},xi=function(t,e,n,r){var o=function(t){return(t=parseInt(t,10).toString(16)).length>1?t:"0"+t};return"#"+o(e)+o(n)+o(r)},Ci=function(t,e){var n,r,o,i=this,u=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,a=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,c=/\s*([^:]+):\s*([^;]+);?/g,s=/\s+$/,l={};t=t||{},e&&(r=e.getValidStyles(),o=e.getInvalidStyles());var f="\\\" \\' \\; \\: ; : \ufeff".split(" ");for(n=0;n<f.length;n++)l[f[n]]="\ufeff"+n,l["\ufeff"+n]=f[n];return{toHex:function(t){return t.replace(u,xi)},parse:function(e){var r,o,f,d,m,g,h,p,v={},b=t.url_converter,y=t.url_converter_scope||i,w=function(t,e,r){var o=v[t+"-top"+e];if(o){var i=v[t+"-right"+e];if(i){var u=v[t+"-bottom"+e];if(u){var a=v[t+"-left"+e];if(a){var c=[o,i,u,a];for(n=c.length-1;n--&&c[n]===c[n+1];);n>-1&&r||(v[t+e]=-1===n?c[0]:c.join(" "),delete v[t+"-top"+e],delete v[t+"-right"+e],delete v[t+"-bottom"+e],delete v[t+"-left"+e])}}}}},x=function(t){var e,n=v[t];if(n){for(e=(n=n.split(" ")).length;e--;)if(n[e]!==n[0])return!1;return v[t]=n[0],!0}},C=function(t){return d=!0,l[t]},S=function(t,e){return d&&(t=t.replace(/\uFEFF[0-9]/g,function(t){return l[t]})),e||(t=t.replace(/\\([\'\";:])/g,"$1")),t},k=function(t){return String.fromCharCode(parseInt(t.slice(1),16))},O=function(t){return t.replace(/\\[0-9a-f]+/gi,k)},T=function(e,n,r,o,i,u){if(i=i||u)return"'"+(i=S(i)).replace(/\'/g,"\\'")+"'";if(n=S(n||r||o),!t.allow_script_urls){var a=n.replace(/[\s\r\n]+/g,"");if(/(java|vb)script:/i.test(a))return"";if(!t.allow_svg_data_urls&&/^data:image\/svg/i.test(a))return""}return b&&(n=b.call(y,n,"style")),"url('"+n.replace(/\'/g,"\\'")+"')"};if(e){for(e=(e=e.replace(/[\u0000-\u001F]/g,"")).replace(/\\[\"\';:\uFEFF]/g,C).replace(/\"[^\"]+\"|\'[^\']+\'/g,function(t){return t.replace(/[;:]/g,C)});r=c.exec(e);)if(c.lastIndex=r.index+r[0].length,o=r[1].replace(s,"").toLowerCase(),f=r[2].replace(s,""),o&&f){if(o=O(o),f=O(f),-1!==o.indexOf("\ufeff")||-1!==o.indexOf('"'))continue;if(!t.allow_script_urls&&("behavior"===o||/expression\s*\(|\/\*|\*\//.test(f)))continue;"font-weight"===o&&"700"===f?f="bold":"color"!==o&&"background-color"!==o||(f=f.toLowerCase()),f=(f=f.replace(u,xi)).replace(a,T),v[o]=d?S(f,!0):f}w("border","",!0),w("border","-width"),w("border","-color"),w("border","-style"),w("padding",""),w("margin",""),m="border",h="border-style",p="border-color",x(g="border-width")&&x(h)&&x(p)&&(v[m]=v[g]+" "+v[h]+" "+v[p],delete v[g],delete v[h],delete v[p]),"medium none"===v.border&&delete v.border,"none"===v["border-image"]&&delete v["border-image"]}return v},serialize:function(t,e){var n="",i=function(e){var o,i=r[e];if(i)for(var u=0,a=i.length;u<a;u++)e=i[u],(o=t[e])&&(n+=(n.length>0?" ":"")+e+": "+o+";")};return e&&r?(i("*"),i(e)):dt(t,function(t,r){!t||o&&!function(t,e){var n=o["*"];return!(n&&n[t]||(n=o[e])&&n[t])}(r,e)||(n+=(n.length>0?" ":"")+r+": "+t+";")}),n}}},Si={keyLocation:!0,layerX:!0,layerY:!0,returnValue:!0,webkitMovementX:!0,webkitMovementY:!0,keyIdentifier:!0,mozPressure:!0},ki=function(t){return t instanceof Event||w(t.initEvent)},Oi=function(t,e,n,r){var o,i=function(t,e){var n=null!==e&&void 0!==e?e:{};for(var r in t)wt(Si,r)||(n[r]=t[r]);return y(n.composedPath)&&(n.composedPath=function(){return t.composedPath()}),n}(e,r);return i.type=t,b(i.target)&&(i.target=null!==(o=i.srcElement)&&void 0!==o?o:n),function(t){return b(t.preventDefault)||ki(t)}(e)&&(i.preventDefault=function(){i.defaultPrevented=!0,i.isDefaultPrevented=z,w(e.preventDefault)?e.preventDefault():ki(e)&&(e.returnValue=!1)},i.stopPropagation=function(){i.cancelBubble=!0,i.isPropagationStopped=z,w(e.stopPropagation)?e.stopPropagation():ki(e)&&(e.cancelBubble=!0)},i.stopImmediatePropagation=function(){i.isImmediatePropagationStopped=z,i.stopPropagation()},function(t){return t.isDefaultPrevented===z||t.isDefaultPrevented===M}(i)||(i.isDefaultPrevented=!0===i.defaultPrevented?z:M,i.isPropagationStopped=!0===i.cancelBubble?z:M,i.isImmediatePropagationStopped=M)),i},Ti="mce-data-",_i=/^(?:mouse|contextmenu)|click/,Ei=function(t,e,n,r){t.addEventListener?t.addEventListener(e,n,r||!1):t.attachEvent&&t.attachEvent("on"+e,n)},Di=function(t,e,n,r){t.removeEventListener?t.removeEventListener(e,n,r||!1):t.detachEvent&&t.detachEvent("on"+e,n)},Ai=function(t,e){var n=Oi(t.type,t,document,e);if(function(t){return y(t)&&_i.test(t.type)}(t)&&v(t.pageX)&&!v(t.clientX)){var r=n.target.ownerDocument||document,o=r.documentElement,i=r.body,u=n;u.pageX=t.clientX+(o&&o.scrollLeft||i&&i.scrollLeft||0)-(o&&o.clientLeft||i&&i.clientLeft||0),u.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},Ni=function(t,e,n){var r=t.document,o={type:"ready"};if(n.domLoaded)e(o);else{var i=function(){Di(t,"DOMContentLoaded",i),Di(t,"load",i),n.domLoaded||(n.domLoaded=!0,e(o)),t=null};"complete"===r.readyState||"interactive"===r.readyState&&r.body?i():Ei(t,"DOMContentLoaded",i),n.domLoaded||Ei(t,"load",i)}},Mi=function(){function t(){this.domLoaded=!1,this.events={},this.count=1,this.expando=Ti+(+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,u,a,c,s,l,f=this,d=window,m=function(t){f.executeHandlers(Ai(t||d.event),o)};if(t&&3!==t.nodeType&&8!==t.nodeType){t[f.expando]?o=t[f.expando]:(o=f.count++,t[f.expando]=o,f.events[o]={}),r=r||t;var g=e.split(" ");for(u=g.length;u--;)s=m,c=l=!1,"DOMContentLoaded"===(a=g[u])&&(a="ready"),f.domLoaded&&"ready"===a&&"complete"===t.readyState?n.call(r,Ai({type:a})):(f.hasMouseEnterLeave||(c=f.mouseEnterLeave[a])&&(s=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=Ai(t||d.event)).type="mouseout"===t.type?"mouseleave":"mouseenter",t.target=e,f.executeHandlers(t,o))}),f.hasFocusIn||"focusin"!==a&&"focusout"!==a||(l=!0,c="focusin"===a?"focus":"blur",s=function(t){(t=Ai(t||d.event)).type="focus"===t.type?"focusin":"focusout",f.executeHandlers(t,o)}),(i=f.events[o][a])?"ready"===a&&f.domLoaded?n(Ai({type:a})):i.push({func:n,scope:r}):(f.events[o][a]=i=[{func:n,scope:r}],i.fakeName=c,i.capture=l,i.nativeHandler=s,"ready"===a?Ni(t,s,f):Ei(t,c||a,s,l)));return t=i=null,n}},t.prototype.unbind=function(t,e,n){var r,o,i,u,a;if(!t||3===t.nodeType||8===t.nodeType)return this;var c=t[this.expando];if(c){if(a=this.events[c],e){var s=e.split(" ");for(o=s.length;o--;)if(r=a[u=s[o]]){if(n)for(i=r.length;i--;)if(r[i].func===n){var l=r.nativeHandler,f=r.fakeName,d=r.capture;(r=r.slice(0,i).concat(r.slice(i+1))).nativeHandler=l,r.fakeName=f,r.capture=d,a[u]=r}n&&0!==r.length||(delete a[u],Di(t,r.fakeName||u,r.nativeHandler,r.capture))}}else dt(a,function(e,n){Di(t,e.fakeName||n,e.nativeHandler,e.capture)}),a={};for(u in a)if(wt(a,u))return this;delete this.events[c];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=Ai({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<i;o++){var u=r[o];if(u&&!1===u.func.call(u.scope,t)&&t.preventDefault(),t.isImmediatePropagationStopped())return}},t.Event=new t,t}(),zi="sizzle"+-new Date,Ri=window.document,Bi=0,Li=0,Pi=pu(),Hi=pu(),Ii=pu(),Fi=function(t,e){return t===e&&(Ar=!0),0},Vi="undefined",Ui=1<<31,ji={}.hasOwnProperty,Wi=[],qi=Wi.pop,$i=Wi.push,Gi=Wi.push,Ki=Wi.slice,Xi=Wi.indexOf||function(t){for(var e=0,n=this.length;e<n;e++)if(this[e]===t)return e;return-1},Yi="[\\x20\\t\\r\\n\\f]",Ji="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",Qi="\\["+Yi+"*("+Ji+")(?:"+Yi+"*([*^$|!~]?=)"+Yi+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+Ji+"))|)"+Yi+"*\\]",Zi=":("+Ji+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+Qi+")*)|.*)\\)|)",tu=new RegExp("^"+Yi+"+|((?:^|[^\\\\])(?:\\\\.)*)"+Yi+"+$","g"),eu=new RegExp("^"+Yi+"*,"+Yi+"*"),nu=new RegExp("^"+Yi+"*([>+~]|"+Yi+")"+Yi+"*"),ru=new RegExp("="+Yi+"*([^\\]'\"]*?)"+Yi+"*\\]","g"),ou=new RegExp(Zi),iu=new RegExp("^"+Ji+"$"),uu={ID:new RegExp("^#("+Ji+")"),CLASS:new RegExp("^\\.("+Ji+")"),TAG:new RegExp("^("+Ji+"|[*])"),ATTR:new RegExp("^"+Qi),PSEUDO:new RegExp("^"+Zi),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+Yi+"*(even|odd|(([+-]|)(\\d*)n|)"+Yi+"*(?:([+-]|)"+Yi+"*(\\d+)|))"+Yi+"*\\)|)","i"),bool:new RegExp("^(?:checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)$","i"),needsContext:new RegExp("^"+Yi+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+Yi+"*((?:-\\d)?\\d*)"+Yi+"*\\)|)(?=[^-]|$)","i")},au=/^(?:input|select|textarea|button)$/i,cu=/^h\d$/i,su=/^[^{]+\{\s*\[native \w/,lu=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,fu=/[+~]/,du=/'|\\/g,mu=new RegExp("\\\\([\\da-f]{1,6}"+Yi+"?|("+Yi+")|.)","ig"),gu=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{Gi.apply(Wi=Ki.call(Ri.childNodes),Ri.childNodes),Wi[Ri.childNodes.length].nodeType}catch(t){Gi={apply:Wi.length?function(t,e){$i.apply(t,Ki.call(e))}:function(t,e){for(var n=t.length,r=0;t[n++]=e[r++];);t.length=n-1}}}var hu=function(t,e,n,r){var o,i,u,a,c,s,l,f,d,m;if((e?e.ownerDocument||e:Ri)!==Mr&&Nr(e),e=e||Mr,n=n||[],!t||"string"!=typeof t)return n;if(1!==(a=e.nodeType)&&9!==a)return[];if(Rr&&!r){if(o=lu.exec(t))if(u=o[1]){if(9===a){if(!(i=e.getElementById(u))||!i.parentNode)return n;if(i.id===u)return n.push(i),n}else if(e.ownerDocument&&(i=e.ownerDocument.getElementById(u))&&Pr(e,i)&&i.id===u)return n.push(i),n}else{if(o[2])return Gi.apply(n,e.getElementsByTagName(t)),n;if((u=o[3])&&xr.getElementsByClassName)return Gi.apply(n,e.getElementsByClassName(u)),n}if(xr.qsa&&(!Br||!Br.test(t))){if(f=l=zi,d=e,m=9===a&&t,1===a&&"object"!==e.nodeName.toLowerCase()){for(s=Or(t),(l=e.getAttribute("id"))?f=l.replace(du,"\\$&"):e.setAttribute("id",f),f="[id='"+f+"'] ",c=s.length;c--;)s[c]=f+Cu(s[c]);d=fu.test(t)&&wu(e.parentNode)||e,m=s.join(",")}if(m)try{return Gi.apply(n,d.querySelectorAll(m)),n}catch(t){}finally{l||e.removeAttribute("id")}}}return _r(t.replace(tu,"$1"),e,n,r)};function pu(){var t=[];return function e(n,r){return t.push(n+" ")>Cr.cacheLength&&delete e[t.shift()],e[n+" "]=r}}function vu(t){return t[zi]=!0,t}function bu(t,e){var n=e&&t,r=n&&1===t.nodeType&&1===e.nodeType&&(~e.sourceIndex||Ui)-(~t.sourceIndex||Ui);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===e)return-1;return t?1:-1}function yu(t){return vu(function(e){return e=+e,vu(function(n,r){for(var o,i=t([],n.length,e),u=i.length;u--;)n[o=i[u]]&&(n[o]=!(r[o]=n[o]))})})}function wu(t){return t&&typeof t.getElementsByTagName!==Vi&&t}function xu(){}function Cu(t){for(var e=0,n=t.length,r="";e<n;e++)r+=t[e].value;return r}function Su(t,e,n){var r=e.dir,o=n&&"parentNode"===r,i=Li++;return e.first?function(e,n,i){for(;e=e[r];)if(1===e.nodeType||o)return t(e,n,i)}:function(e,n,u){var a,c,s=[Bi,i];if(u){for(;e=e[r];)if((1===e.nodeType||o)&&t(e,n,u))return!0}else for(;e=e[r];)if(1===e.nodeType||o){if((a=(c=e[zi]||(e[zi]={}))[r])&&a[0]===Bi&&a[1]===i)return s[2]=a[2];if(c[r]=s,s[2]=t(e,n,u))return!0}}}function ku(t){return t.length>1?function(e,n,r){for(var o=t.length;o--;)if(!t[o](e,n,r))return!1;return!0}:t[0]}function Ou(t,e,n,r,o){for(var i,u=[],a=0,c=t.length,s=null!=e;a<c;a++)(i=t[a])&&(n&&!n(i,r,o)||(u.push(i),s&&e.push(a)));return u}function Tu(t,e,n,r,o,i){return r&&!r[zi]&&(r=Tu(r)),o&&!o[zi]&&(o=Tu(o,i)),vu(function(i,u,a,c){var s,l,f,d=[],m=[],g=u.length,h=i||function(t,e,n){for(var r=0,o=e.length;r<o;r++)hu(t,e[r],n);return n}(e||"*",a.nodeType?[a]:a,[]),p=!t||!i&&e?h:Ou(h,d,t,a,c),v=n?o||(i?t:g||r)?[]:u:p;if(n&&n(p,v,a,c),r)for(s=Ou(v,m),r(s,[],a,c),l=s.length;l--;)(f=s[l])&&(v[m[l]]=!(p[m[l]]=f));if(i){if(o||t){if(o){for(s=[],l=v.length;l--;)(f=v[l])&&s.push(p[l]=f);o(null,v=[],s,c)}for(l=v.length;l--;)(f=v[l])&&(s=o?Xi.call(i,f):d[l])>-1&&(i[s]=!(u[s]=f))}}else v=Ou(v===u?v.splice(g,v.length):v),o?o(null,u,v,c):Gi.apply(u,v)})}function _u(t){for(var e,n,r,o=t.length,i=Cr.relative[t[0].type],u=i||Cr.relative[" "],a=i?1:0,c=Su(function(t){return t===e},u,!0),s=Su(function(t){return Xi.call(e,t)>-1},u,!0),l=[function(t,n,r){var o=!i&&(r||n!==Er)||((e=n).nodeType?c(t,n,r):s(t,n,r));return e=null,o}];a<o;a++)if(n=Cr.relative[t[a].type])l=[Su(ku(l),n)];else{if((n=Cr.filter[t[a].type].apply(null,t[a].matches))[zi]){for(r=++a;r<o&&!Cr.relative[t[r].type];r++);return Tu(a>1&&ku(l),a>1&&Cu(t.slice(0,a-1).concat({value:" "===t[a-2].type?"*":""})).replace(tu,"$1"),n,a<r&&_u(t.slice(a,r)),r<o&&_u(t=t.slice(r)),r<o&&Cu(t))}l.push(n)}return ku(l)}xr=hu.support={},kr=hu.isXML=function(t){var e=t&&(t.ownerDocument||t).documentElement;return!!e&&"HTML"!==e.nodeName},Nr=hu.setDocument=function(t){var e,n=t?t.ownerDocument||t:Ri,r=n.defaultView;return n!==Mr&&9===n.nodeType&&n.documentElement?(Mr=n,zr=n.documentElement,Rr=!kr(n),r&&r!==function(t){try{return t.top}catch(t){}return null}(r)&&(r.addEventListener?r.addEventListener("unload",function(){Nr()},!1):r.attachEvent&&r.attachEvent("onunload",function(){Nr()})),xr.attributes=!0,xr.getElementsByTagName=!0,xr.getElementsByClassName=su.test(n.getElementsByClassName),xr.getById=!0,Cr.find.ID=function(t,e){if(typeof e.getElementById!==Vi&&Rr){var n=e.getElementById(t);return n&&n.parentNode?[n]:[]}},Cr.filter.ID=function(t){var e=t.replace(mu,gu);return function(t){return t.getAttribute("id")===e}},Cr.find.TAG=xr.getElementsByTagName?function(t,e){if(typeof e.getElementsByTagName!==Vi)return e.getElementsByTagName(t)}:function(t,e){var n,r=[],o=0,i=e.getElementsByTagName(t);if("*"===t){for(;n=i[o++];)1===n.nodeType&&r.push(n);return r}return i},Cr.find.CLASS=xr.getElementsByClassName&&function(t,e){if(Rr)return e.getElementsByClassName(t)},Lr=[],Br=[],xr.disconnectedMatch=!0,Br=Br.length&&new RegExp(Br.join("|")),Lr=Lr.length&&new RegExp(Lr.join("|")),e=su.test(zr.compareDocumentPosition),Pr=e||su.test(zr.contains)?function(t,e){var n=9===t.nodeType?t.documentElement:t,r=e&&e.parentNode;return t===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):t.compareDocumentPosition&&16&t.compareDocumentPosition(r)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1},Fi=e?function(t,e){if(t===e)return Ar=!0,0;var r=!t.compareDocumentPosition-!e.compareDocumentPosition;return r||(1&(r=(t.ownerDocument||t)===(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!xr.sortDetached&&e.compareDocumentPosition(t)===r?t===n||t.ownerDocument===Ri&&Pr(Ri,t)?-1:e===n||e.ownerDocument===Ri&&Pr(Ri,e)?1:Dr?Xi.call(Dr,t)-Xi.call(Dr,e):0:4&r?-1:1)}:function(t,e){if(t===e)return Ar=!0,0;var r,o=0,i=t.parentNode,u=e.parentNode,a=[t],c=[e];if(!i||!u)return t===n?-1:e===n?1:i?-1:u?1:Dr?Xi.call(Dr,t)-Xi.call(Dr,e):0;if(i===u)return bu(t,e);for(r=t;r=r.parentNode;)a.unshift(r);for(r=e;r=r.parentNode;)c.unshift(r);for(;a[o]===c[o];)o++;return o?bu(a[o],c[o]):a[o]===Ri?-1:c[o]===Ri?1:0},n):Mr},hu.matches=function(t,e){return hu(t,null,null,e)},hu.matchesSelector=function(t,e){if((t.ownerDocument||t)!==Mr&&Nr(t),e=e.replace(ru,"='$1']"),xr.matchesSelector&&Rr&&(!Lr||!Lr.test(e))&&(!Br||!Br.test(e)))try{var n=(void 0).call(t,e);if(n||xr.disconnectedMatch||t.document&&11!==t.document.nodeType)return n}catch(t){}return hu(e,Mr,null,[t]).length>0},hu.contains=function(t,e){return(t.ownerDocument||t)!==Mr&&Nr(t),Pr(t,e)},hu.attr=function(t,e){(t.ownerDocument||t)!==Mr&&Nr(t);var n=Cr.attrHandle[e.toLowerCase()],r=n&&ji.call(Cr.attrHandle,e.toLowerCase())?n(t,e,!Rr):void 0;return void 0!==r?r:xr.attributes||!Rr?t.getAttribute(e):(r=t.getAttributeNode(e))&&r.specified?r.value:null},hu.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},hu.uniqueSort=function(t){var e,n=[],r=0,o=0;if(Ar=!xr.detectDuplicates,Dr=!xr.sortStable&&t.slice(0),t.sort(Fi),Ar){for(;e=t[o++];)e===t[o]&&(r=n.push(o));for(;r--;)t.splice(n[r],1)}return Dr=null,t},Sr=hu.getText=function(t){var e,n="",r=0,o=t.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)n+=Sr(t)}else if(3===o||4===o)return t.nodeValue}else for(;e=t[r++];)n+=Sr(e);return n},(Cr=hu.selectors={cacheLength:50,createPseudo:vu,match:uu,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(mu,gu),t[3]=(t[3]||t[4]||t[5]||"").replace(mu,gu),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||hu.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&hu.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return uu.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&ou.test(n)&&(e=Or(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)&&(t[0]=t[0].slice(0,e),t[2]=n.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(mu,gu).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=Pi[t+" "];return e||(e=new RegExp("(^|"+Yi+")"+t+"("+Yi+"|$)"))&&Pi(t,function(t){return e.test("string"==typeof t.className&&t.className||typeof t.getAttribute!==Vi&&t.getAttribute("class")||"")})},ATTR:function(t,e,n){return function(r){var o=hu.attr(r,t);return null==o?"!="===e:!e||(o+="","="===e?o===n:"!="===e?o!==n:"^="===e?n&&0===o.indexOf(n):"*="===e?n&&o.indexOf(n)>-1:"$="===e?n&&o.slice(-n.length)===n:"~="===e?(" "+o+" ").indexOf(n)>-1:"|="===e&&(o===n||o.slice(0,n.length+1)===n+"-"))}},CHILD:function(t,e,n,r,o){var i="nth"!==t.slice(0,3),u="last"!==t.slice(-4),a="of-type"===e;return 1===r&&0===o?function(t){return!!t.parentNode}:function(e,n,c){var s,l,f,d,m,g,h=i!==u?"nextSibling":"previousSibling",p=e.parentNode,v=a&&e.nodeName.toLowerCase(),b=!c&&!a;if(p){if(i){for(;h;){for(f=e;f=f[h];)if(a?f.nodeName.toLowerCase()===v:1===f.nodeType)return!1;g=h="only"===t&&!g&&"nextSibling"}return!0}if(g=[u?p.firstChild:p.lastChild],u&&b){for(m=(s=(l=p[zi]||(p[zi]={}))[t]||[])[0]===Bi&&s[1],d=s[0]===Bi&&s[2],f=m&&p.childNodes[m];f=++m&&f&&f[h]||(d=m=0)||g.pop();)if(1===f.nodeType&&++d&&f===e){l[t]=[Bi,m,d];break}}else if(b&&(s=(e[zi]||(e[zi]={}))[t])&&s[0]===Bi)d=s[1];else for(;(f=++m&&f&&f[h]||(d=m=0)||g.pop())&&((a?f.nodeName.toLowerCase()!==v:1!==f.nodeType)||!++d||(b&&((f[zi]||(f[zi]={}))[t]=[Bi,d]),f!==e)););return(d-=o)===r||d%r==0&&d/r>=0}}},PSEUDO:function(t,e){var n,r=Cr.pseudos[t]||Cr.setFilters[t.toLowerCase()]||hu.error("unsupported pseudo: "+t);return r[zi]?r(e):r.length>1?(n=[t,t,"",e],Cr.setFilters.hasOwnProperty(t.toLowerCase())?vu(function(t,n){for(var o,i=r(t,e),u=i.length;u--;)t[o=Xi.call(t,i[u])]=!(n[o]=i[u])}):function(t){return r(t,0,n)}):r}},pseudos:{not:vu(function(t){var e=[],n=[],r=Tr(t.replace(tu,"$1"));return r[zi]?vu(function(t,e,n,o){for(var i,u=r(t,null,o,[]),a=t.length;a--;)(i=u[a])&&(t[a]=!(e[a]=i))}):function(t,o,i){return e[0]=t,r(e,null,i,n),e[0]=null,!n.pop()}}),has:vu(function(t){return function(e){return hu(t,e).length>0}}),contains:vu(function(t){return t=t.replace(mu,gu),function(e){return(e.textContent||e.innerText||Sr(e)).indexOf(t)>-1}}),lang:vu(function(t){return iu.test(t||"")||hu.error("unsupported lang: "+t),t=t.replace(mu,gu).toLowerCase(),function(e){var n;do{if(n=Rr?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(n=n.toLowerCase())===t||0===n.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(t){var e=window.location&&window.location.hash;return e&&e.slice(1)===t.id},root:function(t){return t===zr},focus:function(t){return t===Mr.activeElement&&(!Mr.hasFocus||Mr.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:function(t){return!1===t.disabled},disabled:function(t){return!0===t.disabled},checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!Cr.pseudos.empty(t)},header:function(t){return cu.test(t.nodeName)},input:function(t){return au.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:yu(function(){return[0]}),last:yu(function(t,e){return[e-1]}),eq:yu(function(t,e,n){return[n<0?n+e:n]}),even:yu(function(t,e){for(var n=0;n<e;n+=2)t.push(n);return t}),odd:yu(function(t,e){for(var n=1;n<e;n+=2)t.push(n);return t}),lt:yu(function(t,e,n){for(var r=n<0?n+e:n;--r>=0;)t.push(r);return t}),gt:yu(function(t,e,n){for(var r=n<0?n+e:n;++r<e;)t.push(r);return t})}}).pseudos.nth=Cr.pseudos.eq,q(["radio","checkbox","file","password","image"],function(t){var e;Cr.pseudos[t]=(e=t,function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e})}),q(["submit","reset"],function(t){var e;Cr.pseudos[t]=(e=t,function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e})}),xu.prototype=Cr.filters=Cr.pseudos,Cr.setFilters=new xu,Or=hu.tokenize=function(t,e){var n,r,o,i,u,a,c,s=Hi[t+" "];if(s)return e?0:s.slice(0);for(u=t,a=[],c=Cr.preFilter;u;){for(i in n&&!(r=eu.exec(u))||(r&&(u=u.slice(r[0].length)||u),a.push(o=[])),n=!1,(r=nu.exec(u))&&(n=r.shift(),o.push({value:n,type:r[0].replace(tu," ")}),u=u.slice(n.length)),Cr.filter)Cr.filter.hasOwnProperty(i)&&(!(r=uu[i].exec(u))||c[i]&&!(r=c[i](r))||(n=r.shift(),o.push({value:n,type:i,matches:r}),u=u.slice(n.length)));if(!n)break}return e?u.length:u?hu.error(t):Hi(t,a).slice(0)},Tr=hu.compile=function(t,e){var n,r=[],o=[],i=Ii[t+" "];if(!i){for(e||(e=Or(t)),n=e.length;n--;)(i=_u(e[n]))[zi]?r.push(i):o.push(i);(i=Ii(t,function(t,e){var n=e.length>0,r=t.length>0,o=function(o,i,u,a,c){var s,l,f,d=0,m="0",g=o&&[],h=[],p=Er,v=o||r&&Cr.find.TAG("*",c),b=Bi+=null==p?1:Math.random()||.1,y=v.length;for(c&&(Er=i!==Mr&&i);m!==y&&null!=(s=v[m]);m++){if(r&&s){for(l=0;f=t[l++];)if(f(s,i,u)){a.push(s);break}c&&(Bi=b)}n&&((s=!f&&s)&&d--,o&&g.push(s))}if(d+=m,n&&m!==d){for(l=0;f=e[l++];)f(g,h,i,u);if(o){if(d>0)for(;m--;)g[m]||h[m]||(h[m]=qi.call(a));h=Ou(h)}Gi.apply(a,h),c&&!o&&h.length>0&&d+e.length>1&&hu.uniqueSort(a)}return c&&(Bi=b,Er=p),g};return n?vu(o):o}(o,r))).selector=t}return i},_r=hu.select=function(t,e,n,r){var o,i,u,a,c,s="function"==typeof t&&t,l=!r&&Or(t=s.selector||t);if(n=n||[],1===l.length){if((i=l[0]=l[0].slice(0)).length>2&&"ID"===(u=i[0]).type&&xr.getById&&9===e.nodeType&&Rr&&Cr.relative[i[1].type]){if(!(e=(Cr.find.ID(u.matches[0].replace(mu,gu),e)||[])[0]))return n;s&&(e=e.parentNode),t=t.slice(i.shift().value.length)}for(o=uu.needsContext.test(t)?0:i.length;o--&&(u=i[o],!Cr.relative[a=u.type]);)if((c=Cr.find[a])&&(r=c(u.matches[0].replace(mu,gu),fu.test(i[0].type)&&wu(e.parentNode)||e))){if(i.splice(o,1),!(t=r.length&&Cu(i)))return Gi.apply(n,r),n;break}}return(s||Tr(t,l))(r,e,!Rr,n,fu.test(t)&&wu(e.parentNode)||e),n},xr.sortStable=zi.split("").sort(Fi).join("")===zi,xr.detectDuplicates=!!Ar,Nr(),xr.sortDetached=!0;var Eu=document,Du=Array.prototype.push,Au=Array.prototype.slice,Nu=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,Mu=Mi.Event,zu=ve.makeMap("children,contents,next,prev"),Ru=function(t){return void 0!==t},Bu=function(t){return"string"==typeof t},Lu=function(t,e){var n,r=(e=e||Eu).createElement("div"),o=e.createDocumentFragment();for(r.innerHTML=t;n=r.firstChild;)o.appendChild(n);return o},Pu=function(t,e,n,r){var o;if(Bu(e))e=Lu(e,Ju(t[0]));else if(e.length&&!e.nodeType){if(e=ea.makeArray(e),r)for(o=e.length-1;o>=0;o--)Pu(t,e[o],n,r);else for(o=0;o<e.length;o++)Pu(t,e[o],n,r);return t}if(e.nodeType)for(o=t.length;o--;)n.call(t[o],e);return t},Hu=function(t,e){return t&&e&&-1!==(" "+t.className+" ").indexOf(" "+e+" ")},Iu=function(t,e,n){var r,o;return e=ea(e)[0],t.each(function(){n&&r===this.parentNode?o.appendChild(this):(r=this.parentNode,o=e.cloneNode(!1),this.parentNode.insertBefore(o,this),o.appendChild(this))}),t},Fu=ve.makeMap("fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom"," "),Vu=ve.makeMap("checked compact declare defer disabled ismap multiple nohref noshade nowrap readonly selected"," "),Uu={for:"htmlFor",class:"className",readonly:"readOnly"},ju={float:"cssFloat"},Wu={},qu={},$u=function(t,e){return new ea.fn.init(t,e)},Gu=/^\s*|\s*$/g,Ku=function(t){return null===t||void 0===t?"":(""+t).replace(Gu,"")},Xu=function(t,e){var n,r,o,i;if(t)if(void 0===(n=t.length)){for(r in t)if(t.hasOwnProperty(r)&&(i=t[r],!1===e.call(i,r,i)))break}else for(o=0;o<n&&(i=t[o],!1!==e.call(i,o,i));o++);return t},Yu=function(t,e){var n=[];return Xu(t,function(t,r){e(r,t)&&n.push(r)}),n},Ju=function(t){return t?9===t.nodeType?t:t.ownerDocument:Eu};$u.fn=$u.prototype={constructor:$u,selector:"",context:null,length:0,init:function(t,e){var n,r;if(!t)return this;if(t.nodeType)return this.context=this[0]=t,this.length=1,this;if(e&&e.nodeType)this.context=e;else{if(e)return ea(t).attr(e);this.context=e=document}if(Bu(t)){if(this.selector=t,!(n="<"===t.charAt(0)&&">"===t.charAt(t.length-1)&&t.length>=3?[null,t,null]:Nu.exec(t)))return ea(e).find(t);if(n[1])for(r=Lu(t,Ju(e)).firstChild;r;)Du.call(this,r),r=r.nextSibling;else{if(!(r=Ju(e).getElementById(n[2])))return this;if(r.id!==n[2])return this.find(t);this.length=1,this[0]=r}}else this.add(t,!1);return this},toArray:function(){return ve.toArray(this)},add:function(t,e){var n,r;if(Bu(t))return this.add(ea(t));if(!1!==e)for(n=ea.unique(this.toArray().concat(ea.makeArray(t))),this.length=n.length,r=0;r<n.length;r++)this[r]=n[r];else Du.apply(this,ea.makeArray(t));return this},attr:function(t,e){var n,r=this;if("object"==typeof t)Xu(t,function(t,e){r.attr(t,e)});else{if(!Ru(e)){if(r[0]&&1===r[0].nodeType){if((n=Wu[t])&&n.get)return n.get(r[0],t);if(Vu[t])return r.prop(t)?t:void 0;null===(e=r[0].getAttribute(t,2))&&(e=void 0)}return e}this.each(function(){var n;if(1===this.nodeType){if((n=Wu[t])&&n.set)return void n.set(this,e);null===e?this.removeAttribute(t,2):this.setAttribute(t,e,2)}})}return r},removeAttr:function(t){return this.attr(t,null)},prop:function(t,e){var n=this;if("object"==typeof(t=Uu[t]||t))Xu(t,function(t,e){n.prop(t,e)});else{if(!Ru(e))return n[0]&&n[0].nodeType&&t in n[0]?n[0][t]:e;this.each(function(){1===this.nodeType&&(this[t]=e)})}return n},css:function(t,e){var n,r,o=this,i=function(t){return t.replace(/-(\D)/g,function(t,e){return e.toUpperCase()})},u=function(t){return t.replace(/[A-Z]/g,function(t){return"-"+t})};if("object"==typeof t)Xu(t,function(t,e){o.css(t,e)});else if(Ru(e))t=i(t),"number"!=typeof e||Fu[t]||(e=e.toString()+"px"),o.each(function(){var n=this.style;if((r=qu[t])&&r.set)r.set(this,e);else{try{this.style[ju[t]||t]=e}catch(t){}null!==e&&""!==e||(n.removeProperty?n.removeProperty(u(t)):n.removeAttribute(t))}});else{if(n=o[0],(r=qu[t])&&r.get)return r.get(n);if(!n.ownerDocument.defaultView)return n.currentStyle?n.currentStyle[i(t)]:"";try{return n.ownerDocument.defaultView.getComputedStyle(n,null).getPropertyValue(u(t))}catch(t){return}}return o},remove:function(){for(var t,e=this.length;e--;)t=this[e],Mu.clean(t),t.parentNode&&t.parentNode.removeChild(t);return this},empty:function(){for(var t,e=this.length;e--;)for(t=this[e];t.firstChild;)t.removeChild(t.firstChild);return this},html:function(t){var e;if(Ru(t)){e=this.length;try{for(;e--;)this[e].innerHTML=t}catch(n){ea(this[e]).empty().append(t)}return this}return this[0]?this[0].innerHTML:""},text:function(t){var e;if(Ru(t)){for(e=this.length;e--;)"innerText"in this[e]?this[e].innerText=t:this[0].textContent=t;return this}return this[0]?this[0].innerText||this[0].textContent:""},append:function(){return Pu(this,arguments,function(t){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.appendChild(t)})},prepend:function(){return Pu(this,arguments,function(t){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.insertBefore(t,this.firstChild)},!0)},before:function(){return this[0]&&this[0].parentNode?Pu(this,arguments,function(t){this.parentNode.insertBefore(t,this)}):this},after:function(){return this[0]&&this[0].parentNode?Pu(this,arguments,function(t){this.parentNode.insertBefore(t,this.nextSibling)},!0):this},appendTo:function(t){return ea(t).append(this),this},prependTo:function(t){return ea(t).prepend(this),this},replaceWith:function(t){return this.before(t).remove()},wrap:function(t){return Iu(this,t)},wrapAll:function(t){return Iu(this,t,!0)},wrapInner:function(t){return this.each(function(){ea(this).contents().wrapAll(t)}),this},unwrap:function(){return this.parent().each(function(){ea(this).replaceWith(this.childNodes)})},clone:function(){var t=[];return this.each(function(){t.push(this.cloneNode(!0))}),ea(t)},addClass:function(t){return this.toggleClass(t,!0)},removeClass:function(t){return this.toggleClass(t,!1)},toggleClass:function(t,e){var n=this;return"string"!=typeof t?n:(-1!==t.indexOf(" ")?Xu(t.split(" "),function(){n.toggleClass(this,e)}):n.each(function(n,r){var o=Hu(r,t);if(o!==e){var i=r.className;o?r.className=Ku((" "+i+" ").replace(" "+t+" "," ")):r.className+=i?" "+t:t}}),n)},hasClass:function(t){return Hu(this[0],t)},each:function(t){return Xu(this,t)},on:function(t,e){return this.each(function(){Mu.bind(this,t,e)})},off:function(t,e){return this.each(function(){Mu.unbind(this,t,e)})},trigger:function(t){return this.each(function(){"object"==typeof t?Mu.fire(this,t.type,t):Mu.fire(this,t)})},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},slice:function(){return ea(Au.apply(this,arguments))},eq:function(t){return-1===t?this.slice(t):this.slice(t,+t+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},find:function(t){var e,n,r=[];for(e=0,n=this.length;e<n;e++)ea.find(t,this[e],r);return ea(r)},filter:function(t){return ea("function"==typeof t?Yu(this.toArray(),function(e,n){return t(n,e)}):ea.filter(t,this.toArray()))},closest:function(t){var e=[];return t instanceof ea&&(t=t[0]),this.each(function(n,r){for(;r;){if("string"==typeof t&&ea(r).is(t)){e.push(r);break}if(r===t){e.push(r);break}r=r.parentNode}}),ea(e)},offset:function(t){var e,n,r,o,i=0,u=0;return t?this.css(t):((e=this[0])&&(r=(n=e.ownerDocument).documentElement,e.getBoundingClientRect&&(i=(o=e.getBoundingClientRect()).left+(r.scrollLeft||n.body.scrollLeft)-r.clientLeft,u=o.top+(r.scrollTop||n.body.scrollTop)-r.clientTop)),{left:i,top:u})},push:Du,sort:Array.prototype.sort,splice:Array.prototype.splice},ve.extend($u,{extend:ve.extend,makeArray:function(t){return(e=t)&&e===e.window||t.nodeType?[t]:ve.toArray(t);var e},inArray:function(t,e){var n;if(e.indexOf)return e.indexOf(t);for(n=e.length;n--;)if(e[n]===t)return n;return-1},isArray:ve.isArray,each:Xu,trim:Ku,grep:Yu,find:hu,expr:hu.selectors,unique:hu.uniqueSort,text:hu.getText,contains:hu.contains,filter:function(t,e,n){var r=e.length;for(n&&(t=":not("+t+")");r--;)1!==e[r].nodeType&&e.splice(r,1);return e=1===e.length?ea.find.matchesSelector(e[0],t)?[e[0]]:[]:ea.find.matches(t,e)}});var Qu=function(t,e,n){var r=[],o=t[e];for("string"!=typeof n&&n instanceof ea&&(n=n[0]);o&&9!==o.nodeType;){if(void 0!==n){if(o===n)break;if("string"==typeof n&&ea(o).is(n))break}1===o.nodeType&&r.push(o),o=o[e]}return r},Zu=function(t,e,n,r){var o=[];for(r instanceof ea&&(r=r[0]);t;t=t[e])if(!n||t.nodeType===n){if(void 0!==r){if(t===r)break;if("string"==typeof r&&ea(t).is(r))break}o.push(t)}return o},ta=function(t,e,n){for(t=t[e];t;t=t[e])if(t.nodeType===n)return t;return null};Xu({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return Qu(t,"parentNode")},next:function(t){return ta(t,"nextSibling",1)},prev:function(t){return ta(t,"previousSibling",1)},children:function(t){return Zu(t.firstChild,"nextSibling",1)},contents:function(t){return ve.toArray(("iframe"===t.nodeName?t.contentDocument||t.contentWindow.document:t).childNodes)}},function(t,e){$u.fn[t]=function(n){var r=[];this.each(function(){var t=e.call(r,this,n,r);t&&(ea.isArray(t)?r.push.apply(r,t):r.push(t))}),this.length>1&&(zu[t]||(r=ea.unique(r)),0===t.indexOf("parents")&&(r=r.reverse()));var o=ea(r);return n?o.filter(n):o}}),Xu({parentsUntil:function(t,e){return Qu(t,"parentNode",e)},nextUntil:function(t,e){return Zu(t,"nextSibling",1,e).slice(1)},prevUntil:function(t,e){return Zu(t,"previousSibling",1,e).slice(1)}},function(t,e){$u.fn[t]=function(n,r){var o=[];this.each(function(){var t=e.call(o,this,n,o);t&&(ea.isArray(t)?o.push.apply(o,t):o.push(t))}),this.length>1&&(o=ea.unique(o),0!==t.indexOf("parents")&&"prevUntil"!==t||(o=o.reverse()));var i=ea(o);return r?i.filter(r):i}}),$u.fn.is=function(t){return!!t&&this.filter(t).length>0},$u.fn.init.prototype=$u.fn,$u.overrideDefaults=function(t){var e,n=function(r,o){return e=e||t(),0===arguments.length&&(r=e.element),o||(o=e.context),new n.fn.init(r,o)};return ea.extend(n,this),n},$u.attrHooks=Wu,$u.cssHooks=qu;var ea=$u,na=ve.each,ra=ve.grep,oa=de.ie,ia=/^([a-z0-9],?)+$/i,ua=function(t,e){var n=e.attr("style"),r=t.serialize(t.parse(n),e[0].nodeName);r||(r=null),e.attr("data-mce-style",r)},aa=function(t,e){var n,r,o=0;if(t)for(n=t.nodeType,t=t.previousSibling;t;t=t.previousSibling)r=t.nodeType,(!e||3!==r||r!==n&&t.nodeValue.length)&&(o++,n=r);return o},ca=function(t,e){void 0===e&&(e={});var n={},r=window,o={},i=0,u=Yr.forElement(ye.fromDom(t),{contentCssCors:e.contentCssCors,referrerPolicy:e.referrerPolicy}),a=[],c=e.schema?e.schema:wi({}),s=Ci({url_converter:e.url_converter,url_converter_scope:e.url_converter_scope},e.schema),l=e.ownEvents?new Mi:Mi.Event,f=c.getBlockElements(),m=ea.overrideDefaults(function(){return{context:t,element:j.getRoot()}}),g=function(e){return e&&t&&d(e)?t.getElementById(e):e},h=function(t){return m("string"==typeof t?g(t):t)},p=function(t,e,n){var r,o,i=h(t);return i.length&&(o=(r=W[e])&&r.get?r.get(i,e):i.attr(e)),void 0===o&&(o=n||""),o},v=function(t){var e=g(t);return e?e.attributes:[]},y=function(t,n,r){""===r&&(r=null);var o=h(t),i=o.attr(n);if(o.length){var u=W[n];u&&u.set?u.set(o,r,n):o.attr(n,r),i!==r&&e.onSetAttrib&&e.onSetAttrib({attrElm:o,attrName:n,attrValue:r})}},w=function(){return e.root_element||t.body},x=function(e,n){return nr(t.body,g(e),n)},S=function(t,e,n){var r=h(t);return n?r.css(e):("float"===(e=e.replace(/-(\D)/g,function(t,e){return e.toUpperCase()}))&&(e=de.browser.isIE()?"styleFloat":"cssFloat"),r[0]&&r[0].style?r[0].style[e]:void 0)},k=function(t){var e,n;return t=g(t),e=S(t,"width"),n=S(t,"height"),-1===e.indexOf("px")&&(e=0),-1===n.indexOf("px")&&(n=0),{w:parseInt(e,10)||t.offsetWidth||t.clientWidth,h:parseInt(n,10)||t.offsetHeight||t.clientHeight}},T=function(t,e){var n;if(!t)return!1;if(!Array.isArray(t)){if("*"===e)return 1===t.nodeType;if(ia.test(e)){var r=e.toLowerCase().split(/,/),o=t.nodeName.toLowerCase();for(n=r.length-1;n>=0;n--)if(r[n]===o)return!0;return!1}if(t.nodeType&&1!==t.nodeType)return!1}var i=Array.isArray(t)?t:[t];return hu(e,i[0].ownerDocument||i[0],null,i).length>0},_=function(t,e,n,r){var o,i=[],u=g(t);for(r=void 0===r,n=n||("BODY"!==w().nodeName?w().parentNode:null),ve.is(e,"string")&&(o=e,e="*"===e?function(t){return 1===t.nodeType}:function(t){return T(t,o)});u&&!(u===n||b(u.nodeType)||An(u)||Nn(u));){if(!e||"function"==typeof e&&e(u)){if(!r)return[u];i.push(u)}u=u.parentNode}return r?i:null},E=function(t,e,n){var r=e;if(t)for("string"==typeof e&&(r=function(t){return T(t,e)}),t=t[n];t;t=t[n])if("function"==typeof r&&r(t))return t;return null},D=function(t,e,n){var r,o="string"==typeof t?g(t):t;if(!o)return!1;if(ve.isArray(o)&&(o.length||0===o.length))return r=[],na(o,function(t,o){t&&r.push(e.call(n,"string"==typeof t?g(t):t,o))}),r;var i=n||this;return e.call(i,o)},A=function(t,e){h(t).each(function(t,n){na(e,function(t,e){y(n,e,t)})})},N=function(t,e){var n=h(t);oa?n.each(function(t,n){if(!1!==n.canHaveHTML){for(;n.firstChild;)n.removeChild(n.firstChild);try{n.innerHTML="<br>"+e,n.removeChild(n.firstChild)}catch(t){ea("<div></div>").html("<br>"+e).contents().slice(1).appendTo(n)}return e}}):n.html(e)},M=function(e,n,r,o,i){return D(e,function(e){var u="string"==typeof n?t.createElement(n):n;return A(u,r),o&&("string"!=typeof o&&o.nodeType?u.appendChild(o):"string"==typeof o&&N(u,o)),i?u:e.appendChild(u)})},z=function(e,n,r){return M(t.createElement(e),e,n,r,!0)},R=ci.encodeAllRaw,B=function(t,e){var n=h(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]},L=function(t,e,n){h(t).toggleClass(e,n).each(function(){""===this.className&&ea(this).attr("class",null)})},P=function(t,e,n){return D(e,function(e){return ve.is(e,"array")&&(t=t.cloneNode(!0)),n&&na(ra(e.childNodes),function(e){t.appendChild(e)}),e.parentNode.replaceChild(t,e)})},H=function(t){if(wn(t)){var e="a"===t.nodeName.toLowerCase()&&!p(t,"href")&&p(t,"id");if(p(t,"name")||p(t,"data-mce-bookmark")||e)return!0}return!1},I=function(){return t.createRange()},F=function(n,o,i,u){if(ve.isArray(n)){for(var c=n.length,s=[];c--;)s[c]=F(n[c],o,i,u);return s}return!e.collect||n!==t&&n!==r||a.push([n,o,i,u]),l.bind(n,o,i,u||j)},V=function(e,n,o){if(ve.isArray(e)){for(var i=e.length,u=[];i--;)u[i]=V(e[i],n,o);return u}if(a.length>0&&(e===t||e===r))for(i=a.length;i--;){var c=a[i];e!==c[0]||n&&n!==c[1]||o&&o!==c[2]||l.unbind(c[0],c[1],c[2])}return l.unbind(e,n,o)},U=function(t){if(t&&wn(t)){var e=t.getAttribute("data-mce-contenteditable");return e&&"inherit"!==e?e:"inherit"!==t.contentEditable?t.contentEditable:null}return null},j={doc:t,settings:e,win:r,files:o,stdMode:!0,boxModel:!0,styleSheetLoader:u,boundEvents:a,styles:s,schema:c,events:l,isBlock:function(t){if("string"==typeof t)return!!f[t];if(t){var e=t.nodeType;if(e)return!(1!==e||!f[t.nodeName])}return!1},$:m,$$:h,root:null,clone:function(e,n){if(!oa||1!==e.nodeType||n)return e.cloneNode(n);var r=t.createElement(e.nodeName);return na(v(e),function(t){y(r,t.nodeName,p(e,t.nodeName))}),r},getRoot:w,getViewPort:function(t){var e=vn(t);return{x:e.x,y:e.y,w:e.width,h:e.height}},getRect:function(t){t=g(t);var e=x(t),n=k(t);return{x:e.x,y:e.y,w:n.w,h:n.h}},getSize:k,getParent:function(t,e,n){var r=_(t,e,n,!1);return r&&r.length>0?r[0]:null},getParents:_,get:g,getNext:function(t,e){return E(t,e,"nextSibling")},getPrev:function(t,e){return E(t,e,"previousSibling")},select:function(n,r){return hu(n,g(r)||e.root_element||t,[])},is:T,add:M,create:z,createHTML:function(t,e,n){var r,o="";for(r in o+="<"+t,e)xt(e,r)&&(o+=" "+r+'="'+R(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:B,setStyle:function(t,n,r){var o=d(n)?h(t).css(n,r):h(t).css(n);e.update_styles&&ua(s,o)},getStyle:S,setStyles:function(t,n){var r=h(t).css(n);e.update_styles&&ua(s,r)},removeAllAttribs:function(t){return D(t,function(t){var e,n=t.attributes;for(e=n.length-1;e>=0;e--)t.removeAttributeNode(n.item(e))})},setAttrib:y,setAttribs:A,getAttrib:p,getPos:x,parseStyle:function(t){return s.parse(t)},serializeStyle:function(t,e){return s.serialize(t,e)},addStyle:function(e){var r,o;if(j!==ca.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=""),q(t.split(","),function(t){o[t]=!0,u.load(t,C)})},addClass:function(t,e){h(t).addClass(e)},removeClass:function(t,e){L(t,e,!1)},hasClass:function(t,e){return h(t).hasClass(e)},toggleClass:L,show:function(t){h(t).show()},hide:function(t){h(t).hide()},isHidden:function(t){return"none"===h(t).css("display")},uniqueId:function(t){return(t||"mce_")+i++},setHTML:N,getOuterHTML:function(t){var e="string"==typeof t?g(t):t;return wn(e)?e.outerHTML:ea("<div></div>").append(ea(e).clone()).html()},setOuterHTML:function(t,e){h(t).each(function(){try{if("outerHTML"in this)return void(this.outerHTML=e)}catch(t){}B(ea(this).html(e),!0)})},decode:ci.decode,encode:R,insertAfter:function(t,e){var n=g(e);return D(t,function(t){var e=n.parentNode,r=n.nextSibling;return r?e.insertBefore(t,r):e.appendChild(t),t})},replace:P,rename:function(t,e){var n;return t.nodeName!==e.toUpperCase()&&(n=z(e),na(v(t),function(e){y(n,e.nodeName,p(t,e.nodeName))}),P(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 s.toHex(ve.trim(t))},run:D,getAttribs:v,isEmpty:function(t,e){var n,r,o=0;if(H(t))return!1;if(t=t.firstChild){var i=new Jr(t,t.parentNode),u=c?c.getWhiteSpaceElements():{};e=e||(c?c.getNonEmptyElements():null);do{if(n=t.nodeType,wn(t)){var a=t.getAttribute("data-mce-bogus");if(a){t=i.next("all"===a);continue}if(r=t.nodeName.toLowerCase(),e&&e[r]){if("br"===r){o++,t=i.next();continue}return!1}if(H(t))return!1}if(8===n)return!1;if(3===n&&!Ho(t.nodeValue))return!1;if(3===n&&t.parentNode&&u[t.parentNode.nodeName]&&Ho(t.nodeValue))return!1;t=i.next()}while(t)}return o<=1},createRng:I,nodeIndex:aa,split:function(t,e,n){var r,o,i,u=I();if(t&&e)return u.setStart(t.parentNode,aa(t)),u.setEnd(e.parentNode,aa(e)),r=u.extractContents(),(u=I()).setStart(e.parentNode,aa(e)+1),u.setEnd(t.parentNode,aa(t)+1),o=u.extractContents(),(i=t.parentNode).insertBefore(Ko(j,r),t),n?i.insertBefore(n,t):i.insertBefore(e,t),i.insertBefore(Ko(j,o),t),B(t),n||e},bind:F,unbind:V,fire:function(t,e,n){return l.fire(t,e,n)},getContentEditable:U,getContentEditableParent:function(t){for(var e=w(),n=null;t&&t!==e&&null===(n=U(t));t=t.parentNode);return n},destroy:function(){if(a.length>0)for(var t=a.length;t--;){var e=a[t];l.unbind(e[0],e[1],e[2])}dt(o,function(t,e){u.unload(e),delete o[e]}),hu.setDocument&&hu.setDocument()},isChildOf:function(t,e){if(oa){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}},W=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 n=t.serialize(t.parse(n),e[0].nodeName)}}};return r&&(i.href=i.src=o),i}(s,e,O(j));return j};ca.DOM=ca(document),ca.nodeIndex=aa;var sa=ca.DOM,la=ve.each,fa=ve.grep,da=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=sa,i=function(){o.remove(u),r&&(r.onerror=r.onload=r=null)},u=o.uniqueId();(r=document.createElement("script")).id=u,r.type="text/javascript",r.src=ve._addCacheSuffix(t),this.settings.referrerPolicy&&o.setAttrib(r,"referrerpolicy",this.settings.referrerPolicy),r.onload=function(){i(),e()},r.onerror=function(){i(),w(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=[],u=function(t,e){la(o.scriptLoadedCallbacks[e],function(e){w(e[t])&&e[t].call(e.scope)}),o.scriptLoadedCallbacks[e]=void 0};o.queueLoadedCallbacks.push({success:e,failure:r,scope:n||this});var a=function(){var e=fa(t);if(t.length=0,la(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--,u("success",t),a()},function(){o.states[t]=3,o.loading--,i.push(t),u("failure",t),a()})):u("failure",t):u("success",t)}),!o.loading){var n=o.queueLoadedCallbacks.slice(0);o.queueLoadedCallbacks.length=0,la(n,function(t){0===i.length?w(t.success)&&t.success.call(t.scope):w(t.failure)&&t.failure.call(t.scope,i)})}};a()},t.ScriptLoader=new t,t}(),ma=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},ga={},ha=ma("en"),pa=function(){return yt(ga,ha.get())},va={getData:function(){return mt(ga,function(t){return At({},t)})},setCode:function(t){t&&ha.set(t)},getCode:function(){return ha.get()},add:function(t,e){var n=ga[t];n||(ga[t]=n={}),dt(e,function(t,e){n[e.toLowerCase()]=t})},translate:function(t){var e,n=pa().getOr({}),r=function(t){return w(t)?Object.prototype.toString.call(t):o(t)?"":""+t},o=function(t){return""===t||null===t||void 0===t},i=function(t){var e=r(t);return yt(n,e.toLowerCase()).map(r).getOr(e)},u=function(t){return t.replace(/{context:\w+}$/,"")};if(o(t))return"";if(m(e=t)&&wt(e,"raw"))return r(t.raw);if(function(t){return g(t)&&t.length>1}(t)){var a=t.slice(1);return u(i(t[0]).replace(/\{([0-9]+)\}/g,function(t,e){return wt(a,e)?r(a[e]):t}))}return u(i(t))},isRtl:function(){return pa().bind(function(t){return yt(t,"_dir")}).exists(function(t){return"rtl"===t})},hasCode:function(t){return wt(ga,t)}},ba=function(){var t=[],e={},n={},r=[],o=function(t,e){var n=K(r,function(n){return n.name===t&&n.state===e});q(n,function(t){return t.callback()})},i=function(t){var e;return n[t]&&(e=n[t].dependencies),e||[]},u=function(t,e){return"object"==typeof e?e:"string"==typeof t?{prefix:"",resource:e,suffix:""}:{prefix:t.prefix,resource:e,suffix:t.suffix}},a=function(t,r,c,s,l){if(!e[t]){var f="string"==typeof r?r:r.prefix+r.resource+r.suffix;0!==f.indexOf("/")&&-1===f.indexOf("://")&&(f=ba.baseURL+"/"+f),e[t]=f.substring(0,f.lastIndexOf("/"));var d=function(){o(t,"loaded"),function(t,e,n,r){var o=i(t);q(o,function(t){var n=u(e,t);a(n.resource,n,void 0,void 0)}),n&&(r?n.call(r):n.call(da))}(t,r,c,s)};n[t]?d():da.ScriptLoader.add(f,d,s,l)}},c=function(t,o,i){void 0===i&&(i="added"),wt(n,t)&&"added"===i?o():wt(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!==ba.languageLoad&&c(t,function(){var r=va.getCode();!r||n&&-1===(","+(n||"")+",").indexOf(","+r+",")||da.ScriptLoader.add(e[t]+"/langs/"+r+".js")},"loaded")},add:function(e,r,i){var u=r;return t.push(u),n[e]={instance:u,dependencies:i},o(e,"added"),u},remove:function(t){delete e[t],delete n[t]},createUrl:u,addComponents:function(t,n){var r=e[t];q(n,function(t){da.ScriptLoader.add(r+"/"+t)})},load:a,waitFor:c}};ba.languageLoad=!0,ba.baseURL="",ba.PluginManager=ba(),ba.ThemeManager=ba();var ya=function(){var t=function(t){var e=ma(P.none()),n=function(){return e.get().each(t)};return{clear:function(){n(),e.set(P.none())},isSet:function(){return e.get().isSome()},get:function(){return e.get()},set:function(t){n(),e.set(P.some(t))}}}(C);return At(At({},t),{on:function(e){return t.get().each(e)}})},wa=function(t,e){var n=null;return{cancel:function(){h(n)||(clearTimeout(n),n=null)},throttle:function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];h(n)&&(n=setTimeout(function(){n=null,t.apply(null,r)},e))}}},xa=function(t,e){var n=null,r=function(){h(n)||(clearTimeout(n),n=null)};return{cancel:r,throttle:function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];r(),n=setTimeout(function(){n=null,t.apply(null,o)},e)}}},Ca=function(t,e){var n=Wn(t,e);return void 0===n||""===n?[]:n.split(" ")},Sa=function(t){return void 0!==t.dom.classList},ka=function(t,e){return function(t,e,n){var r=Ca(t,e).concat([n]);return Un(t,e,r.join(" ")),!0}(t,"class",e)},Oa=function(t,e){return function(t,e,n){var r=K(Ca(t,e),function(t){return t!==n});return r.length>0?Un(t,e,r.join(" ")):Gn(t,e),!1}(t,"class",e)},Ta=function(t,e){Sa(t)?t.dom.classList.add(e):ka(t,e)},_a=function(t){0===(Sa(t)?t.dom.classList:function(t){return Ca(t,"class")}(t)).length&&Gn(t,"class")},Ea=function(t,e){return Sa(t)&&t.dom.classList.contains(e)},Da=function(t,e){var n=[];return q(Ve(t),function(t){e(t)&&(n=n.concat([t])),n=n.concat(Da(t,e))}),n},Aa=function(t,e){return function(t,e){var n=void 0===e?document:e.dom;return Ce(n)?[]:W(n.querySelectorAll(t),ye.fromDom)}(e,t)},Na=O("mce-annotation"),Ma=O("data-mce-annotation"),za=O("data-mce-annotation-uid"),Ra=function(t,e){var n=t.selection.getRng(),r=ye.fromDom(n.startContainer),o=ye.fromDom(t.getBody()),i=e.fold(function(){return"."+Na()},function(t){return"["+Ma()+'="'+t+'"]'}),u=Ue(r,n.startOffset).getOr(r),a=function(t,e){return $n(t,e)?P.some(Wn(t,e)):P.none()};return jr(u,i,function(t){return Se(t,o)}).bind(function(e){return a(e,""+za()).bind(function(n){return a(e,""+Ma()).map(function(e){var r=Ba(t,n);return{uid:n,name:e,elements:r}})})})},Ba=function(t,e){var n=ye.fromDom(t.getBody());return Aa(n,"["+za()+'="'+e+'"]')},La=function(t,e){var n=ma({}),r=function(){return{listeners:[],previous:ya()}},o=function(t,e){i(t,function(t){return e(t),t})},i=function(t,e){var o=n.get(),i=e(yt(o,t).getOrThunk(r));o[t]=i,n.set(o)},u=xa(function(){var e=n.get(),r=ot(lt(e));q(r,function(e){i(e,function(n){var r=n.previous.get();return Ra(t,P.some(e)).fold(function(){r.isSome()&&(!function(t){o(t,function(e){q(e.listeners,function(e){return e(!1,t)})})}(e),n.previous.clear())},function(t){var e=t.uid,i=t.name,u=t.elements;Hn(r,e)||(!function(t,e,n){o(t,function(r){q(r.listeners,function(r){return r(!0,t,{uid:e,nodes:W(n,function(t){return t.dom})})})})}(i,e,u),n.previous.set(e))}),{previous:n.previous,listeners:n.listeners}})})},30);t.on("remove",function(){u.cancel()}),t.on("NodeChange",function(){u.throttle()});return{addListener:function(t,e){i(t,function(t){return{previous:t.previous,listeners:t.listeners.concat([e])}})}}},Pa=function(t,e){t.on("init",function(){t.serializer.addNodeFilter("span",function(t){q(t,function(t){(function(t){return P.from(t.attr(Ma())).bind(e.lookup)})(t).each(function(e){!1===e.persistent&&t.unwrap()})})})})},Ha=0,Ia=function(t){var e=(new Date).getTime();return t+"_"+Math.floor(1e9*Math.random())+ ++Ha+String(e)},Fa=function(t,e){var n,r,o=ze(t).dom,i=ye.fromDom(o.createDocumentFragment()),u=(n=e,(r=(o||document).createElement("div")).innerHTML=n,Ve(ye.fromDom(r)));rn(i,u),on(t),nn(t,i)},Va=function(t,e){return ye.fromDom(t.dom.cloneNode(e))},Ua=function(t){return Va(t,!1)},ja=function(t){return Va(t,!0)},Wa=function(t,e,n){void 0===n&&(n=M);var r=new Jr(t,e),o=function(t){var e;do{e=r[t]()}while(e&&!En(e)&&!n(e));return P.from(e).filter(En)};return{current:function(){return P.from(r.current()).filter(En)},next:function(){return o("next")},prev:function(){return o("prev")},prev2:function(){return o("prev2")}}},qa=function(t,e){var n=e||function(e){return t.isBlock(e)||Mn(e)||Bn(e)},r=function(t,e,n,o){if(En(t)){var i=o(t,e,t.data);if(-1!==i)return P.some({container:t,offset:i})}return n().bind(function(t){return r(t.container,t.offset,n,o)})};return{backwards:function(t,e,o,i){var u=Wa(t,i,n);return r(t,e,function(){return u.prev().map(function(t){return{container:t,offset:t.length}})},o).getOrNull()},forwards:function(t,e,o,i){var u=Wa(t,i,n);return r(t,e,function(){return u.next().map(function(t){return{container:t,offset:0}})},o).getOrNull()}}},$a=Math.round,Ga=function(t){return t?{left:$a(t.left),top:$a(t.top),bottom:$a(t.bottom),right:$a(t.right),width:$a(t.width),height:$a(t.height)}:{left:0,top:0,bottom:0,right:0,width:0,height:0}},Ka=function(t,e){return t=Ga(t),e?t.right=t.left:(t.left=t.left+t.width,t.right=t.left),t.width=0,t},Xa=function(t,e,n){return t>=0&&t<=Math.min(e.height,n.height)/2},Ya=function(t,e){var n=Math.min(e.height/2,t.height/2);return t.bottom-n<e.top||!(t.top>e.bottom)&&Xa(e.top-t.bottom,t,e)},Ja=function(t,e){return t.top>e.bottom||!(t.bottom<e.top)&&Xa(e.bottom-t.top,t,e)},Qa=function(t,e,n){return e>=t.left&&e<=t.right&&n>=t.top&&n<=t.bottom},Za=function(t){var e=t.startContainer,n=t.startOffset;return e.hasChildNodes()&&t.endOffset===n+1?e.childNodes[n]:null},tc=function(t,e){if(wn(t)&&t.hasChildNodes()){var n=t.childNodes;return n[(r=e,o=0,i=n.length-1,Math.min(Math.max(r,o),i))]}return t;var r,o,i},ec=new RegExp("[̀-ͯ҃-҇҈-҉֑-ֽֿׁ-ׂׄ-ׇׅؐ-ًؚ-ٰٟۖ-ۜ۟-ۤۧ-۪ۨ-ܑۭܰ-݊ަ-ް߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣣ-ंऺ़ु-ै्॑-ॗॢ-ॣঁ়াু-ৄ্ৗৢ-ৣਁ-ਂ਼ੁ-ੂੇ-ੈੋ-੍ੑੰ-ੱੵઁ-ં઼ુ-ૅે-ૈ્ૢ-ૣଁ଼ାିୁ-ୄ୍ୖୗୢ-ୣஂாீ்ௗఀా-ీె-ైొ-్ౕ-ౖౢ-ౣಁ಼ಿೂೆೌ-್ೕ-ೖೢ-ೣഁാു-ൄ്ൗൢ-ൣ්ාි-ුූෟัิ-ฺ็-๎ັິ-ູົ-ຼ່-ໍ༘-ཱ༹༙༵༷-ཾྀ-྄྆-྇ྍ-ྗྙ-ྼ࿆ိ-ူဲ-့္-်ွ-ှၘ-ၙၞ-ၠၱ-ၴႂႅ-ႆႍႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒ-ᝓᝲ-ᝳ឴-឵ិ-ួំ៉-៓៝᠋-᠍ᢩᤠ-ᤢᤧ-ᤨᤲ᤹-᤻ᨗ-ᨘᨛᩖᩘ-ᩞ᩠ᩢᩥ-ᩬᩳ-᩿᩼᪰-᪽᪾ᬀ-ᬃ᬴ᬶ-ᬺᬼᭂ᭫-᭳ᮀ-ᮁᮢ-ᮥᮨ-ᮩ᮫-ᮭ᯦ᯨ-ᯩᯭᯯ-ᯱᰬ-ᰳᰶ-᰷᳐-᳔᳒-᳢᳠-᳨᳭᳴᳸-᳹᷀-᷵᷼-᷿-⃐-⃜⃝-⃠⃡⃢-⃤⃥-⃰⳯-⵿⳱ⷠ-〪ⷿ-〭〮-゙〯-゚꙯꙰-꙲ꙴ-꙽ꚞ-ꚟ꛰-꛱ꠂ꠆ꠋꠥ-ꠦ꣄꣠-꣱ꤦ-꤭ꥇ-ꥑꦀ-ꦂ꦳ꦶ-ꦹꦼꧥꨩ-ꨮꨱ-ꨲꨵ-ꨶꩃꩌꩼꪰꪲ-ꪴꪷ-ꪸꪾ-꪿꫁ꫬ-ꫭ꫶ꯥꯨ꯭ﬞ︀-️︠-゙︯-゚]"),nc=function(t){return"string"==typeof t&&t.charCodeAt(0)>=768&&ec.test(t)},rc=wn,oc=Ro,ic=Cn("display","block table"),uc=Cn("float","left right"),ac=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){for(var n=0;n<t.length;n++)if(!t[n](e))return!1;return!0}}(rc,oc,D(uc)),cc=D(Cn("white-space","pre pre-line pre-wrap")),sc=En,lc=Mn,fc=ca.nodeIndex,dc=function(t,e){return e<0&&wn(t)&&t.hasChildNodes()?void 0:tc(t,e)},mc=function(t){return"createRange"in t?t.createRange():ca.DOM.createRng()},gc=function(t){return t&&/[\r\n\t ]/.test(t)},hc=function(t){return!!t.setStart&&!!t.setEnd},pc=function(t){var e=t.startContainer,n=t.startOffset;if(gc(t.toString())&&cc(e.parentNode)&&En(e)){var r=e.data;if(gc(r[n-1])||gc(r[n+1]))return!0}return!1},vc=function(t){return 0===t.left&&0===t.right&&0===t.top&&0===t.bottom},bc=function(t){var e,n=t.getClientRects();return e=n.length>0?Ga(n[0]):Ga(t.getBoundingClientRect()),!hc(t)&&lc(t)&&vc(e)?function(t){var e=t.ownerDocument,n=mc(e),r=e.createTextNode(" "),o=t.parentNode;o.insertBefore(r,t),n.setStart(r,0),n.setEnd(r,1);var i=Ga(n.getBoundingClientRect());return o.removeChild(r),i}(t):vc(e)&&hc(t)?function(t){var e=t.startContainer,n=t.endContainer,r=t.startOffset,o=t.endOffset;if(e===n&&En(n)&&0===r&&1===o){var i=t.cloneRange();return i.setEndAfter(n),bc(i)}return null}(t):e},yc=function(t,e){var n=Ka(t,e);return n.width=1,n.right=n.left+1,n},wc=function(t,e,n){var r=function(){return n||(n=function(t){var e=[],n=function(t){var n,r;0!==t.height&&(e.length>0&&(n=t,r=e[e.length-1],n.left===r.left&&n.top===r.top&&n.bottom===r.bottom&&n.right===r.right)||e.push(t))},r=function(t,r){var o=mc(t.ownerDocument);if(r<t.data.length){if(nc(t.data[r]))return e;if(nc(t.data[r-1])&&(o.setStart(t,r),o.setEnd(t,r+1),!pc(o)))return n(yc(bc(o),!1)),e}r>0&&(o.setStart(t,r-1),o.setEnd(t,r),pc(o)||n(yc(bc(o),!1))),r<t.data.length&&(o.setStart(t,r),o.setEnd(t,r+1),pc(o)||n(yc(bc(o),!0)))},o=t.container(),i=t.offset();if(sc(o))return r(o,i),e;if(rc(o))if(t.isAtEnd()){var u=dc(o,i);sc(u)&&r(u,u.data.length),ac(u)&&!lc(u)&&n(yc(bc(u),!1))}else{if(u=dc(o,i),sc(u)&&r(u,0),ac(u)&&t.isAtEnd())return n(yc(bc(u),!1)),e;var a=dc(t.container(),t.offset()-1);ac(a)&&!lc(a)&&(ic(a)||ic(u)||!ac(u))&&n(yc(bc(a),!1)),ac(u)&&n(yc(bc(u),!0))}return e}(wc(t,e))),n};return{container:O(t),offset:O(e),toRange:function(){var n=mc(t.ownerDocument);return n.setStart(t,e),n.setEnd(t,e),n},getClientRects:r,isVisible:function(){return r().length>0},isAtStart:function(){return sc(t),0===e},isAtEnd:function(){return sc(t)?e>=t.data.length:e>=t.childNodes.length},isEqual:function(n){return n&&t===n.container()&&e===n.offset()},getNode:function(n){return dc(t,n?e-1:e)}}};wc.fromRangeStart=function(t){return wc(t.startContainer,t.startOffset)},wc.fromRangeEnd=function(t){return wc(t.endContainer,t.endOffset)},wc.after=function(t){return wc(t.parentNode,fc(t)+1)},wc.before=function(t){return wc(t.parentNode,fc(t))},wc.isAbove=function(t,e){return In(ut(e.getClientRects()),at(t.getClientRects()),Ya).getOr(!1)},wc.isBelow=function(t,e){return In(at(e.getClientRects()),ut(t.getClientRects()),Ja).getOr(!1)},wc.isAtStart=function(t){return!!t&&t.isAtStart()},wc.isAtEnd=function(t){return!!t&&t.isAtEnd()},wc.isTextPosition=function(t){return!!t&&En(t.container())},wc.isElementPosition=function(t){return!1===wc.isTextPosition(t)};var xc,Cc=function(t,e){En(e)&&0===e.data.length&&t.remove(e)},Sc=function(t,e,n){Nn(n)?function(t,e,n){var r=P.from(n.firstChild),o=P.from(n.lastChild);e.insertNode(n),r.each(function(e){return Cc(t,e.previousSibling)}),o.each(function(e){return Cc(t,e.nextSibling)})}(t,e,n):function(t,e,n){e.insertNode(n),Cc(t,n.previousSibling),Cc(t,n.nextSibling)}(t,e,n)},kc=En,Oc=kn,Tc=ca.nodeIndex,_c=function(t){var e=t.parentNode;return Oc(e)?_c(e):e},Ec=function(t){return t?_t(t.childNodes,function(t,e){return Oc(e)&&"BR"!==e.nodeName?t=t.concat(Ec(e)):t.push(e),t},[]):[]},Dc=function(t){return function(e){return t===e}},Ac=function(t){return(kc(t)?"text()":t.nodeName.toLowerCase())+"["+function(t){var e,n;e=Ec(_c(t)),n=Et(e,Dc(t),t),e=e.slice(0,n+1);var r=_t(e,function(t,n,r){return kc(n)&&kc(e[r-1])&&t++,t},0);return e=Ot(e,xn([t.nodeName])),(n=Et(e,Dc(t),t))-r}(t)+"]"},Nc=function(t,e){var n,r,o,i,u,a=[];return n=e.container(),r=e.offset(),kc(n)?o=function(t,e){for(;(t=t.previousSibling)&&kc(t);)e+=t.data.length;return e}(n,r):(r>=(i=n.childNodes).length?(o="after",r=i.length-1):o="before",n=i[r]),a.push(Ac(n)),u=function(t,e,n){var r=[];for(e=e.parentNode;!(e===t||n&&n(e));e=e.parentNode)r.push(e);return r}(t,n),u=Ot(u,D(kn)),(a=a.concat(kt(u,function(t){return Ac(t)}))).reverse().join("/")+","+o},Mc=function(t,e){var n;if(!e)return null;var r=e.split(","),o=r[0].split("/");n=r.length>1?r[1]:"before";var i=_t(o,function(t,e){var n,r,o,i,u=/([\w\-\(\)]+)\[([0-9]+)\]/.exec(e);return u?("text()"===u[1]&&(u[1]="#text"),n=t,r=u[1],o=parseInt(u[2],10),i=Ec(n),i=Ot(i,function(t,e){return!kc(t)||!kc(i[e-1])}),(i=Ot(i,xn([r])))[o]):null},t);return i?kc(i)?function(t,e){for(var n,r=t,o=0;kc(r);){if(n=r.data.length,e>=o&&e<=o+n){t=r,e-=o;break}if(!kc(r.nextSibling)){t=r,e=n;break}o+=n,r=r.nextSibling}return kc(t)&&e>t.data.length&&(e=t.data.length),wc(t,e)}(i,parseInt(n,10)):(n="after"===n?Tc(i)+1:Tc(i),wc(i.parentNode,n)):null},zc=Bn,Rc=function(t,e,n,r,o){var i,u=r[o?"startContainer":"endContainer"],a=r[o?"startOffset":"endOffset"],c=[],s=0,l=t.getRoot();for(En(u)?c.push(n?function(t,e,n){var r,o;for(o=t(e.data.slice(0,n)).length,r=e.previousSibling;r&&En(r);r=r.previousSibling)o+=t(r.data).length;return o}(e,u,a):a):(a>=(i=u.childNodes).length&&i.length&&(s=1,a=Math.max(0,i.length-1)),c.push(t.nodeIndex(i[a],n)+s));u&&u!==l;u=u.parentNode)c.push(t.nodeIndex(u,n));return c},Bc=function(t,e,n){var r=0;return ve.each(t.select(e),function(t){if("all"!==t.getAttribute("data-mce-bogus"))return t!==n&&void r++}),r},Lc=function(t,e){var n,r,o,i=e?"start":"end";n=t[i+"Container"],r=t[i+"Offset"],wn(n)&&"TR"===n.nodeName&&(n=(o=n.childNodes)[Math.min(e?r:r-1,o.length-1)])&&(r=e?0:n.childNodes.length,t["set"+(e?"Start":"End")](n,r))},Pc=function(t){return Lc(t,!0),Lc(t,!1),t},Hc=function(t,e){var n;if(wn(t)&&(t=tc(t,e),zc(t)))return t;if(vo(t)){if(En(t)&&ho(t)&&(t=t.parentNode),n=t.previousSibling,zc(n))return n;if(n=t.nextSibling,zc(n))return n}},Ic=function(t,e,n){var r=n.getNode(),o=r?r.nodeName:null,i=n.getRng();if(zc(r)||"IMG"===o)return{name:o,index:Bc(n.dom,o,r)};var u=function(t){return Hc(t.startContainer,t.startOffset)||Hc(t.endContainer,t.endOffset)}(i);return u?{name:o=u.tagName,index:Bc(n.dom,o,u)}:function(t,e,n,r){var o=e.dom,i={};return i.start=Rc(o,t,n,r,!0),e.isCollapsed()||(i.end=Rc(o,t,n,r,!1)),Oo(r)&&(i.isFakeCaret=!0),i}(t,n,e,i)},Fc=function(t,e,n){var r={"data-mce-type":"bookmark",id:e,style:"overflow:hidden;line-height:0px"};return n?t.create("span",r,""):t.create("span",r)},Vc=function(t,e){var n=t.dom,r=t.getRng(),o=n.uniqueId(),i=t.isCollapsed(),u=t.getNode(),a=u.nodeName;if("IMG"===a)return{name:a,index:Bc(n,a,u)};var c=Pc(r.cloneRange());if(!i){c.collapse(!1);var s=Fc(n,o+"_end",e);Sc(n,c,s)}(r=Pc(r)).collapse(!0);var l=Fc(n,o+"_start",e);return Sc(n,r,l),t.moveToBookmark({id:o,keep:!0}),{id:o}},Uc=function(t,e,n){return 2===e?Ic(fo,n,t):3===e?function(t){var e=t.getRng();return{start:Nc(t.dom.getRoot(),wc.fromRangeStart(e)),end:Nc(t.dom.getRoot(),wc.fromRangeEnd(e))}}(t):e?function(t){return{rng:t.getRng()}}(t):Vc(t,!1)},jc=E(Ic,T,!0),Wc=ca.DOM,qc=function(t,e,n){var r=t.getParam(e,n);if(-1!==r.indexOf("=")){var o=t.getParam(e,"","hash");return yt(o,t.id).getOr(n)}return r},$c=function(t){return t.getParam("content_security_policy","")},Gc=function(t){if(t.getParam("force_p_newlines",!1))return"p";var e=t.getParam("forced_root_block","p");return!1===e?"":!0===e?"p":e},Kc=function(t){return t.getParam("forced_root_block_attrs",{})},Xc=function(t){return t.getParam("automatic_uploads",!0,"boolean")},Yc=function(t){return t.getParam("icons","","string")},Jc=function(t){return t.getParam("referrer_policy","","string")},Qc=function(t){return t.getParam("language","en","string")},Zc=function(t){return t.getParam("indent_use_margin",!1)},ts=function(t){var e=t.getParam("font_css",[]);return g(e)?e:W(e.split(","),Ft)},es=function(t){var e=t.getParam("object_resizing");return!1!==e&&!de.iOS&&(d(e)?e:"table,img,figure.image,div,video,iframe")},ns=function(t){return t.getParam("event_root")},rs=function(t){return t.getParam("theme")},os=function(t){return!1!==t.getParam("inline_boundaries")},is=function(t){return t.getParam("plugins","","string")},us=wn,as=En,cs=function(t){var e=t.parentNode;e&&e.removeChild(t)},ss=function(t){var e=fo(t);return{count:t.length-e.length,text:e}},ls=function(t){for(var e;-1!==(e=t.data.lastIndexOf(so));)t.deleteData(e,1)},fs=function(t,e){return hs(t),e},ds=function(t,e){var n,r,o,i=e.container(),u=(n=ct(i.childNodes),r=t,o=V(n,r),-1===o?P.none():P.some(o)).map(function(t){return t<e.offset()?wc(i,e.offset()-1):e}).getOr(e);return hs(t),u},ms=function(t,e){return as(t)&&e.container()===t?function(t,e){var n=ss(t.data.substr(0,e.offset())),r=ss(t.data.substr(e.offset()));return(n.text+r.text).length>0?(ls(t),wc(t,e.offset()-n.count)):e}(t,e):fs(t,e)},gs=function(t,e){return wc.isTextPosition(e)?ms(t,e):function(t,e){return e.container()===t.parentNode?ds(t,e):fs(t,e)}(t,e)},hs=function(t){us(t)&&vo(t)&&(bo(t)?t.removeAttribute("data-mce-caret"):cs(t)),as(t)&&(ls(t),0===t.data.length&&cs(t))},ps=re().browser,vs=Bn,bs=Pn,ys=Ln,ws=function(t,e,n){var r,o,i=Ka(e.getBoundingClientRect(),n);if("BODY"===t.tagName){var u=t.ownerDocument.documentElement;r=t.scrollLeft||u.scrollLeft,o=t.scrollTop||u.scrollTop}else{var a=t.getBoundingClientRect();r=t.scrollLeft-a.left,o=t.scrollTop-a.top}i.left+=r,i.right+=r,i.top+=o,i.bottom+=o,i.width=1;var c=e.offsetWidth-e.clientWidth;return c>0&&(n&&(c*=-1),i.left+=c,i.right+=c),i},xs=function(t,e,n,r){var o,i,u=ya(),a=Gc(t),c=a.length>0?a:"p",s=function(){!function(t){for(var e=Aa(ye.fromDom(t),"*[contentEditable=false],video,audio,embed,object"),n=0;n<e.length;n++){var r,o=e[n].dom,i=o.previousSibling;So(i)&&(1===(r=i.data).length?i.parentNode.removeChild(i):i.deleteData(r.length-1,1)),i=o.nextSibling,Co(i)&&(1===(r=i.data).length?i.parentNode.removeChild(i):i.deleteData(0,1))}}(e),i&&(hs(i),i=null),u.on(function(t){ea(t.caret).remove(),u.clear()}),o&&(Kr.clearInterval(o),o=void 0)},l=function(){o=Kr.setInterval(function(){r()?ea("div.mce-visual-caret",e).toggleClass("mce-visual-caret-hidden"):ea("div.mce-visual-caret",e).addClass("mce-visual-caret-hidden")},500)};return{show:function(t,r){var o;if(s(),ys(r))return null;if(!n(r))return i=function(t,e){var n=t.ownerDocument.createTextNode(so),r=t.parentNode;if(e){if(o=t.previousSibling,go(o)){if(vo(o))return o;if(So(o))return o.splitText(o.data.length-1)}r.insertBefore(n,t)}else{var o=t.nextSibling;if(go(o)){if(vo(o))return o;if(Co(o))return o.splitText(1),o}t.nextSibling?r.insertBefore(n,t.nextSibling):r.appendChild(n)}return n}(r,t),o=r.ownerDocument.createRange(),Ss(i.nextSibling)?(o.setStart(i,0),o.setEnd(i,0)):(o.setStart(i,1),o.setEnd(i,1)),o;i=xo(c,r,t);var a=ws(e,r,t);ea(i).css("top",a.top);var f=ea('<div class="mce-visual-caret" data-mce-bogus="all"></div>').css(At({},a)).appendTo(e)[0];return u.set({caret:f,element:r,before:t}),t&&ea(f).addClass("mce-visual-caret-before"),l(),(o=r.ownerDocument.createRange()).setStart(i,0),o.setEnd(i,0),o},hide:s,getCss:function(){return".mce-visual-caret {position: absolute;background-color: black;background-color: currentcolor;}.mce-visual-caret-hidden {display: none;}*[data-mce-caret] {position: absolute;left: -1000px;right: auto;top: 0;margin: 0;padding: 0;}"},reposition:function(){u.on(function(t){var n=ws(e,t.element,t.before);ea(t.caret).css(At({},n))})},destroy:function(){return Kr.clearInterval(o)}}},Cs=function(){return ps.isIE()||ps.isEdge()||ps.isFirefox()},Ss=function(t){return vs(t)||bs(t)},ks=function(t){return Ss(t)||On(t)&&Cs()},Os=Bn,Ts=Pn,_s=Cn("display","block table table-cell table-caption list-item"),Es=vo,Ds=ho,As=wn,Ns=Ro,Ms=function(t){return t>0},zs=function(t){return t<0},Rs=function(t,e){for(var n;n=t(e);)if(!Ds(n))return n;return null},Bs=function(t,e,n,r,o){var i=new Jr(t,r),u=Os(t)||Ds(t);if(zs(e)){if(u&&n(t=Rs(i.prev.bind(i),!0)))return t;for(;t=Rs(i.prev.bind(i),o);)if(n(t))return t}if(Ms(e)){if(u&&n(t=Rs(i.next.bind(i),!0)))return t;for(;t=Rs(i.next.bind(i),o);)if(n(t))return t}return null},Ls=function(t,e){for(;t&&t!==e;){if(_s(t))return t;t=t.parentNode}return null},Ps=function(t,e,n){return Ls(t.container(),n)===Ls(e.container(),n)},Hs=function(t,e){if(!e)return null;var n=e.container(),r=e.offset();return As(n)?n.childNodes[r+t]:null},Is=function(t,e){var n=e.ownerDocument.createRange();return t?(n.setStartBefore(e),n.setEndBefore(e)):(n.setStartAfter(e),n.setEndAfter(e)),n},Fs=function(t,e,n){return Ls(e,t)===Ls(n,t)},Vs=function(t,e,n){for(var r=t?"previousSibling":"nextSibling";n&&n!==e;){var o=n[r];if(Es(o)&&(o=o[r]),Os(o)||Ts(o)){if(Fs(e,o,n))return o;break}if(Ns(o))break;n=n.parentNode}return null},Us=E(Is,!0),js=E(Is,!1),Ws=function(t,e,n){var r,o=E(Vs,!0,e),i=E(Vs,!1,e),u=n.startContainer,a=n.startOffset;if(ho(u)){As(u)||(u=u.parentNode);var c=u.getAttribute("data-mce-caret");if("before"===c&&(r=u.nextSibling,ks(r)))return Us(r);if("after"===c&&(r=u.previousSibling,ks(r)))return js(r)}if(!n.collapsed)return n;if(En(u)){if(Es(u)){if(1===t){if(r=i(u))return Us(r);if(r=o(u))return js(r)}if(-1===t){if(r=o(u))return js(r);if(r=i(u))return Us(r)}return n}if(So(u)&&a>=u.data.length-1)return 1===t&&(r=i(u))?Us(r):n;if(Co(u)&&a<=1)return-1===t&&(r=o(u))?js(r):n;if(a===u.data.length)return(r=i(u))?Us(r):n;if(0===a)return(r=o(u))?js(r):n}return n},qs=function(t,e){return P.from(Hs(t?0:-1,e)).filter(Os)},$s=function(t,e,n){var r=Ws(t,e,n);return-1===t?wc.fromRangeStart(r):wc.fromRangeEnd(r)},Gs=function(t){return P.from(t.getNode()).map(ye.fromDom)},Ks=function(t,e){for(;e=t(e);)if(e.isVisible())return e;return e},Xs=function(t,e){var n=Ps(t,e);return!(n||!Mn(t.getNode()))||n};!function(t){t[t.Backwards=-1]="Backwards",t[t.Forwards=1]="Forwards"}(xc||(xc={}));var Ys,Js=Bn,Qs=En,Zs=wn,tl=Mn,el=Ro,nl=function(t){return No(t)||function(t){return!!Bo(t)&&!0!==Y(ct(t.getElementsByTagName("*")),function(t,e){return t||To(e)},!1)}(t)},rl=Lo,ol=function(t,e){return t.hasChildNodes()&&e<t.childNodes.length?t.childNodes[e]:null},il=function(t,e){if(Ms(t)){if(el(e.previousSibling)&&!Qs(e.previousSibling))return wc.before(e);if(Qs(e))return wc(e,0)}if(zs(t)){if(el(e.nextSibling)&&!Qs(e.nextSibling))return wc.after(e);if(Qs(e))return wc(e,e.data.length)}return zs(t)?tl(e)?wc.before(e):wc.after(e):wc.before(e)},ul=function(t,e,n){var r,o,i,u;if(!Zs(n)||!e)return null;if(e.isEqual(wc.after(n))&&n.lastChild){if(u=wc.after(n.lastChild),zs(t)&&el(n.lastChild)&&Zs(n.lastChild))return tl(n.lastChild)?wc.before(n.lastChild):u}else u=e;var a=u.container(),c=u.offset();if(Qs(a)){if(zs(t)&&c>0)return wc(a,--c);if(Ms(t)&&c<a.length)return wc(a,++c);r=a}else{if(zs(t)&&c>0&&(o=ol(a,c-1),el(o)))return!nl(o)&&(i=Bs(o,t,rl,o))?Qs(i)?wc(i,i.data.length):wc.after(i):Qs(o)?wc(o,o.data.length):wc.before(o);if(Ms(t)&&c<a.childNodes.length&&(o=ol(a,c),el(o)))return tl(o)?function(t,e){var n=e.nextSibling;return n&&el(n)?Qs(n)?wc(n,0):wc.before(n):ul(xc.Forwards,wc.after(e),t)}(n,o):!nl(o)&&(i=Bs(o,t,rl,o))?Qs(i)?wc(i,0):wc.before(i):Qs(o)?wc(o,0):wc.after(o);r=o||u.getNode()}if((Ms(t)&&u.isAtEnd()||zs(t)&&u.isAtStart())&&(r=Bs(r,t,z,n,!0),rl(r,n)))return il(t,r);o=Bs(r,t,rl,n);var s=Dt(K(function(t,e){for(var n=[];t&&t!==e;)n.push(t),t=t.parentNode;return n}(a,n),Js));return!s||o&&s.contains(o)?o?il(t,o):null:u=Ms(t)?wc.after(s):wc.before(s)},al=function(t){return{next:function(e){return ul(xc.Forwards,e,t)},prev:function(e){return ul(xc.Backwards,e,t)}}},cl=function(t){return wc.isTextPosition(t)?0===t.offset():Ro(t.getNode())},sl=function(t){if(wc.isTextPosition(t)){var e=t.container();return t.offset()===e.data.length}return Ro(t.getNode(!0))},ll=function(t,e){return!wc.isTextPosition(t)&&!wc.isTextPosition(e)&&t.getNode()===e.getNode(!0)},fl=function(t,e,n){return t?!ll(e,n)&&(r=e,!(!wc.isTextPosition(r)&&Mn(r.getNode())))&&sl(e)&&cl(n):!ll(n,e)&&cl(e)&&sl(n);var r},dl=function(t,e,n){var r=al(e);return P.from(t?r.next(n):r.prev(n))},ml=function(t,e,n){return dl(t,e,n).bind(function(r){return Ps(n,r,e)&&fl(t,n,r)?dl(t,e,r):P.some(r)})},gl=function(t,e,n,r){return ml(t,e,n).bind(function(n){return r(n)?gl(t,e,n,r):P.some(n)})},hl=function(t,e){var n,r=t?e.firstChild:e.lastChild;return En(r)?P.some(wc(r,t?0:r.data.length)):r?Ro(r)?P.some(t?wc.before(r):Mn(n=r)?wc.before(n):wc.after(n)):function(t,e,n){var r=t?wc.before(n):wc.after(n);return dl(t,e,r)}(t,e,r):P.none()},pl=E(dl,!0),vl=E(dl,!1),bl=E(hl,!0),yl=E(hl,!1),wl=function(t){return wn(t)&&"_mce_caret"===t.id},xl=function(t,e){for(;e&&e!==t;){if("_mce_caret"===e.id)return e;e=e.parentNode}return null},Cl=function(t){return ve.isArray(t.start)},Sl=function(t,e){return wn(e)&&t.isBlock(e)&&!e.innerHTML&&!de.ie&&(e.innerHTML='<br data-mce-bogus="1" />'),e},kl=function(t,e){return yl(t).fold(M,function(t){return e.setStart(t.container(),t.offset()),e.setEnd(t.container(),t.offset()),!0})},Ol=function(t,e,n){return!(!function(t){return!1===t.hasChildNodes()}(e)||!xl(t,e))&&(function(t,e){var n=t.ownerDocument.createTextNode(so);t.appendChild(n),e.setStart(n,0),e.setEnd(n,0)}(e,n),!0)},Tl=function(t,e,n,r){var o,i,u,a,c=n[e?"start":"end"],s=t.getRoot();if(c){for(u=c[0],i=s,o=c.length-1;o>=1;o--){if(a=i.childNodes,Ol(s,i,r))return!0;if(c[o]>a.length-1)return!!Ol(s,i,r)||kl(i,r);i=a[c[o]]}3===i.nodeType&&(u=Math.min(c[0],i.nodeValue.length)),1===i.nodeType&&(u=Math.min(c[0],i.childNodes.length)),e?r.setStart(i,u):r.setEnd(i,u)}return!0},_l=function(t){return En(t)&&t.data.length>0},El=function(t,e,n){var r,o,i,u,a,c,s=t.get(n.id+"_"+e),l=n.keep;if(s){if(r=s.parentNode,"start"===e?(l?s.hasChildNodes()?(r=s.firstChild,o=1):_l(s.nextSibling)?(r=s.nextSibling,o=0):_l(s.previousSibling)?(r=s.previousSibling,o=s.previousSibling.data.length):(r=s.parentNode,o=t.nodeIndex(s)+1):o=t.nodeIndex(s),a=r,c=o):(l?s.hasChildNodes()?(r=s.firstChild,o=1):_l(s.previousSibling)?(r=s.previousSibling,o=s.previousSibling.data.length):(r=s.parentNode,o=t.nodeIndex(s)):o=t.nodeIndex(s),a=r,c=o),!l){for(u=s.previousSibling,i=s.nextSibling,ve.each(ve.grep(s.childNodes),function(t){En(t)&&(t.nodeValue=t.nodeValue.replace(/\uFEFF/g,""))});s=t.get(n.id+"_"+e);)t.remove(s,!0);u&&i&&u.nodeType===i.nodeType&&En(u)&&!de.opera&&(o=u.nodeValue.length,u.appendData(i.nodeValue),t.remove(i),a=u,c=o)}return P.some(wc(a,c))}return P.none()},Dl=function(t,e){var n=t.dom;if(e){if(Cl(e))return function(t,e){var n=t.createRng();return Tl(t,!0,e,n)&&Tl(t,!1,e,n)?P.some(n):P.none()}(n,e);if(function(t){return d(t.start)}(e))return P.some(function(t,e){var n,r=t.createRng();return n=Mc(t.getRoot(),e.start),r.setStart(n.container(),n.offset()),n=Mc(t.getRoot(),e.end),r.setEnd(n.container(),n.offset()),r}(n,e));if(function(t){return wt(t,"id")}(e))return function(t,e){var n=El(t,"start",e),r=El(t,"end",e);return In(n,r.or(n),function(e,n){var r=t.createRng();return r.setStart(Sl(t,e.container()),e.offset()),r.setEnd(Sl(t,n.container()),n.offset()),r})}(n,e);if(function(t){return wt(t,"name")}(e))return function(t,e){return P.from(t.select(e.name)[e.index]).map(function(e){var n=t.createRng();return n.selectNode(e),n})}(n,e);if(function(t){return wt(t,"rng")}(e))return P.some(e.rng)}return P.none()},Al=function(t,e,n){return Uc(t,e,n)},Nl=function(t,e){Dl(t,e).each(function(e){t.setRng(e)})},Ml=function(t){return wn(t)&&"SPAN"===t.tagName&&"bookmark"===t.getAttribute("data-mce-type")},zl=(Ys=" ",function(t){return Ys===t}),Rl=function(t){return""!==t&&-1!==" \f\n\r\t\v".indexOf(t)},Bl=function(t){return!Rl(t)&&!zl(t)},Ll=function(t){return!!t.nodeType},Pl=function(t,e,n){var r=n.startOffset,o=n.startContainer;if((o!==n.endContainer||!function(t){return t&&/^(IMG)$/.test(t.nodeName)}(o.childNodes[r]))&&wn(o)){var i=o.childNodes,u=void 0;r<i.length?(o=i[r],u=new Jr(o,t.getParent(o,t.isBlock))):(o=i[i.length-1],(u=new Jr(o,t.getParent(o,t.isBlock))).next(!0));for(var a=u.current();a;a=u.next())if(En(a)&&!Vl(a))return n.setStart(a,0),void e.setRng(n)}},Hl=function(t,e,n){if(t){var r=e?"nextSibling":"previousSibling";for(t=n?t:t[r];t;t=t[r])if(wn(t)||!Vl(t))return t}},Il=function(t,e){return Ll(e)&&(e=e.nodeName),!!t.schema.getTextBlockElements()[e.toLowerCase()]},Fl=function(t,e,n){return t.schema.isValidChild(e,n)},Vl=function(t,e){if(void 0===e&&(e=!1),y(t)&&En(t)){var n=e?t.data.replace(/ /g," "):t.data;return Ho(n)}return!1},Ul=function(t,e){return w(t)?t=t(e):y(e)&&(t=t.replace(/%(\w+)/g,function(t,n){return e[n]||t})),t},jl=function(t,e){return t=t||"",e=e||"",t=""+(t.nodeName||t),e=""+(e.nodeName||e),t.toLowerCase()===e.toLowerCase()},Wl=function(t,e,n){return"color"!==n&&"backgroundColor"!==n||(e=t.toHex(e)),"fontWeight"===n&&700===e&&(e="bold"),"fontFamily"===n&&(e=e.replace(/[\'\"]/g,"").replace(/,\s+/g,",")),""+e},ql=function(t,e,n){return Wl(t,t.getStyle(e,n),n)},$l=function(t,e){var n;return t.getParent(e,function(e){return(n=t.getStyle(e,"text-decoration"))&&"none"!==n}),n},Gl=function(t,e,n){return t.getParents(e,n,t.getRoot())},Kl=function(t,e,n){var r=["inline","block","selector","attributes","styles","classes"],o=function(t){return vt(t,function(t,e){return j(r,function(t){return t===e})})};return j(t.formatter.get(e),function(e){var r=o(e);return j(t.formatter.get(n),function(t){var e,n,i,u=o(t);return e=r,n=u,void 0===i&&(i=c),a(i).eq(e,n)})})},Xl=function(t){return xt(t,"block")},Yl=function(t){return xt(t,"selector")},Jl=function(t){return xt(t,"inline")},Ql=function(t){return Yl(t)&&!1!==t.expand&&!Jl(t)},Zl=Ml,tf=Gl,ef=Vl,nf=Il,rf=function(t,e){for(var n=e;n;){if(wn(n)&&t.getContentEditable(n))return"false"===t.getContentEditable(n)?n:e;n=n.parentNode}return e},of=function(t,e,n,r){for(var o=e.data,i=n;t?i>=0:i<o.length;t?i--:i++)if(r(o.charAt(i)))return t?i+1:i;return-1},uf=function(t,e,n){return of(t,e,n,function(t){return zl(t)||Rl(t)})},af=function(t,e,n){return of(t,e,n,Bl)},cf=function(t,e,n,r,o,i){var u,a=t.getParent(n,t.isBlock)||e,c=function(e,n,r){var i=qa(t),c=o?i.backwards:i.forwards;return P.from(c(e,n,function(t,e){return Zl(t.parentNode)?-1:(u=t,r(o,t,e))},a))};return c(n,r,uf).bind(function(t){return i?c(t.container,t.offset+(o?-1:0),af):P.some(t)}).orThunk(function(){return u?P.some({container:u,offset:o?0:u.length}):P.none()})},sf=function(t,e,n,r,o){En(r)&&Wt(r.data)&&r[o]&&(r=r[o]);for(var i=tf(t,r),u=0;u<i.length;u++)for(var a=0;a<e.length;a++){var c=e[a];if((!y(c.collapsed)||c.collapsed===n.collapsed)&&(Yl(c)&&t.is(i[u],c.selector)))return i[u]}return r},lf=function(t,e,n,r){var o=n,i=t.dom,u=i.getRoot(),a=e[0];if(Xl(a)&&(o=a.wrapper?null:i.getParent(n,a.block,u)),!o){var c=i.getParent(n,"LI,TD,TH");o=i.getParent(En(n)?n.parentNode:n,function(e){return e!==u&&nf(t,e)},c)}if(o&&Xl(a)&&a.wrapper&&(o=tf(i,o,"ul,ol").reverse()[0]||o),!o)for(o=n;o[r]&&!i.isBlock(o[r])&&(o=o[r],!jl(o,"br")););return o||n},ff=function(t,e,n,r){var o=n.parentNode;return!y(n[r])&&(!(o!==e&&!b(o)&&!t.isBlock(o))||ff(t,e,o,r))},df=function(t,e,n,r,o){var i,u=n,a=o?"previousSibling":"nextSibling",c=t.getRoot();if(En(n)&&!ef(n)&&(o?r>0:r<n.data.length))return n;for(;;){if(!e[0].block_expand&&t.isBlock(u))return u;for(var s=u[a];s;s=s[a]){var l=En(s)&&!ff(t,c,s,a);if(!Zl(s)&&(!Mn(i=s)||!i.getAttribute("data-mce-bogus")||i.nextSibling)&&!ef(s,l))return u}if(u===c||u.parentNode===c){n=u;break}u=u.parentNode}return n},mf=function(t){return Zl(t.parentNode)||Zl(t)},gf=function(t,e,n,r){void 0===r&&(r=!1);var o=e.startContainer,i=e.startOffset,u=e.endContainer,a=e.endOffset,c=t.dom,s=n[0];(wn(o)&&o.hasChildNodes()&&(o=tc(o,i),En(o)&&(i=0)),wn(u)&&u.hasChildNodes()&&(u=tc(u,e.collapsed?a:a-1),En(u)&&(a=u.nodeValue.length)),o=rf(c,o),u=rf(c,u),mf(o)&&(o=Zl(o)?o:o.parentNode,o=e.collapsed?o.previousSibling||o:o.nextSibling||o,En(o)&&(i=e.collapsed?o.length:0)),mf(u)&&(u=Zl(u)?u:u.parentNode,u=e.collapsed?u.nextSibling||u:u.previousSibling||u,En(u)&&(a=e.collapsed?0:u.length)),e.collapsed)&&(cf(c,t.getBody(),o,i,!0,r).each(function(t){var e=t.container,n=t.offset;o=e,i=n}),cf(c,t.getBody(),u,a,!1,r).each(function(t){var e=t.container,n=t.offset;u=e,a=n}));return(Jl(s)||s.block_expand)&&(Jl(s)&&En(o)&&0!==i||(o=df(c,n,o,i,!0)),Jl(s)&&En(u)&&a!==u.nodeValue.length||(u=df(c,n,u,a,!1))),Ql(s)&&(o=sf(c,n,e,o,"previousSibling"),u=sf(c,n,e,u,"nextSibling")),(Xl(s)||Yl(s))&&(o=lf(t,n,o,"previousSibling"),u=lf(t,n,u,"nextSibling"),Xl(s)&&(c.isBlock(o)||(o=df(c,n,o,i,!0)),c.isBlock(u)||(u=df(c,n,u,a,!1)))),wn(o)&&(i=c.nodeIndex(o),o=o.parentNode),wn(u)&&(a=c.nodeIndex(u)+1,u=u.parentNode),{startContainer:o,startOffset:i,endContainer:u,endOffset:a}},hf=function(t,e,n){var r=e.startOffset,o=tc(e.startContainer,r),i=e.endOffset,u=tc(e.endContainer,i-1),a=function(t){var e=t[0];En(e)&&e===o&&r>=e.data.length&&t.splice(0,1);var n=t[t.length-1];return 0===i&&t.length>0&&n===u&&En(n)&&t.splice(t.length-1,1),t},c=function(t,e,n){for(var r=[];t&&t!==n;t=t[e])r.push(t);return r},s=function(e,n){return t.getParent(e,function(t){return t.parentNode===n},n)},l=function(t,e,r){for(var o=r?"nextSibling":"previousSibling",i=t,u=i.parentNode;i&&i!==e;i=u){u=i.parentNode;var s=c(i===t?i:i[o],o);s.length&&(r||s.reverse(),n(a(s)))}};if(o===u)return n(a([o]));var f=t.findCommonAncestor(o,u);if(t.isChildOf(o,u))return l(o,f,!0);if(t.isChildOf(u,o))return l(u,f);var d=s(o,f)||o,m=s(u,f)||u;l(o,d,!0);var g=c(d===o?d:d.nextSibling,"nextSibling",m===u?m.nextSibling:m);g.length&&n(a(g)),l(u,m)},pf=function(t){var e=[];if(t)for(var n=0;n<t.rangeCount;n++)e.push(t.getRangeAt(n));return e},vf=function(t){return K(function(t){return tt(t,function(t){var e=Za(t);return e?[ye.fromDom(e)]:[]})}(t),ao)},bf=function(t,e){var n=Aa(e,"td[data-mce-selected],th[data-mce-selected]");return n.length>0?n:vf(t)},yf=function(t){return bf(pf(t.selection.getSel()),ye.fromDom(t.getBody()))},wf=function(t,e){return Vr(t,"table",e)},xf=function(t){return je(t).fold(O([t]),function(e){return[t].concat(xf(e))})},Cf=function(t){return We(t).fold(O([t]),function(e){return"br"===Te(e)?Pe(e).map(function(e){return[t].concat(Cf(e))}).getOr([]):[t].concat(Cf(e))})},Sf=function(t,e){return In(function(t){var e=t.startContainer,n=t.startOffset;return En(e)?0===n?P.some(ye.fromDom(e)):P.none():P.from(e.childNodes[n]).map(ye.fromDom)}(e),function(t){var e=t.endContainer,n=t.endOffset;return En(e)?n===e.data.length?P.some(ye.fromDom(e)):P.none():P.from(e.childNodes[n-1]).map(ye.fromDom)}(e),function(e,n){var r=Q(xf(t),E(Se,e)),o=Q(Cf(t),E(Se,n));return r.isSome()&&o.isSome()}).getOr(!1)},kf=function(t,e,n,r){var o=n,i=new Jr(n,o),u=vt(t.schema.getMoveCaretBeforeOnEnterElements(),function(t,e){return!U(["td","th","table"],e.toLowerCase())});do{if(En(n)&&0!==ve.trim(n.nodeValue).length)return void(r?e.setStart(n,0):e.setEnd(n,n.nodeValue.length));if(u[n.nodeName])return void(r?e.setStartBefore(n):"BR"===n.nodeName?e.setEndBefore(n):e.setEndAfter(n))}while(n=r?i.next():i.prev());"BODY"===o.nodeName&&(r?e.setStart(o,0):e.setEnd(o,o.childNodes.length))},Of=function(t){var e=t.selection.getSel();return e&&e.rangeCount>0},Tf=function(t,e){var n=yf(t);n.length>0?q(n,function(n){var r=n.dom,o=t.dom.createRng();o.setStartBefore(r),o.setEndAfter(r),e(o,!0)}):e(t.selection.getRng(),!1)},_f=function(t,e,n){var r=Vc(t,e);n(r),t.moveToBookmark(r)},Ef=function(t,e){var n=function(e){return t(e)?P.from(e.dom.nodeValue):P.none()};return{get:function(r){if(!t(r))throw new Error("Can only get "+e+" value of a "+e+" node");return n(r).getOr("")},getOption:n,set:function(n,r){if(!t(n))throw new Error("Can only set raw "+e+" value of a "+e+" node");n.dom.nodeValue=r}}}(Ae,"text"),Df=function(t){return Ef.get(t)},Af=function(t,e,n,r){return Le(e).fold(function(){return"skipping"},function(o){return"br"===r||function(t){return Ae(t)&&Df(t)===so}(e)?"valid":function(t){return De(t)&&Ea(t,Na())}(e)?"existing":wl(e.dom)?"caret":Fl(t,n,r)&&Fl(t,Te(o),n)?"valid":"invalid-child"})},Nf=function(t,e,n,r){var o=e.uid,i=void 0===o?Ia("mce-annotation"):o,u=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}(e,["uid"]),a=ye.fromTag("span",t);Ta(a,Na()),Un(a,""+za(),i),Un(a,""+Ma(),n);var c=r(i,u),s=c.attributes,l=void 0===s?{}:s,f=c.classes,d=void 0===f?[]:f;return jn(a,l),function(t,e){q(e,function(e){Ta(t,e)})}(a,d),a},Mf=function(t,e,n,r,o){var i=[],u=Nf(t.getDoc(),o,n,r),a=ya(),c=function(){a.clear()},s=function(t){q(t,l)},l=function(e){var n,r;switch(Af(t,e,"span",Te(e))){case"invalid-child":c();var o=Ve(e);s(o),c();break;case"valid":var a=r.get().getOrThunk(function(){var t=Ua(u);return i.push(t),r.set(t),t});Ze(n=e,r=a),nn(r,n)}};return hf(t.dom,e,function(t){c(),function(t){var e=W(t,ye.fromDom);s(e)}(t)}),i},zf=function(t,e,n,r){t.undoManager.transact(function(){var o=t.selection,i=o.getRng(),u=yf(t).length>0;if(i.collapsed&&!u&&function(t,e){var n=gf(t,e,[{inline:"span"}]);e.setStart(n.startContainer,n.startOffset),e.setEnd(n.endContainer,n.endOffset),t.selection.setRng(e)}(t,i),o.getRng().collapsed&&!u){var a=Nf(t.getDoc(),r,e,n.decorate);Fa(a," "),o.getRng().insertNode(a.dom),o.select(a.dom)}else _f(o,!1,function(){Tf(t,function(o){Mf(t,o,e,n.decorate,r)})})})},Rf=function(t){var e,n=(e={},{register:function(t,n){e[t]={name:t,settings:n}},lookup:function(t){return yt(e,t).map(function(t){return t.settings})}});Pa(t,n);var r=La(t);return{register:function(t,e){n.register(t,e)},annotate:function(e,r){n.lookup(e).each(function(n){zf(t,e,n,r)})},annotationChanged:function(t,e){r.addListener(t,e)},remove:function(e){Ra(t,P.some(e)).each(function(t){var e=t.elements;q(e,an)})},getAll:function(e){var n=function(t,e){var n=ye.fromDom(t.getBody()),r=Aa(n,"["+Ma()+'="'+e+'"]'),o={};return q(r,function(t){var e=Wn(t,za()),n=yt(o,e).getOr([]);o[e]=n.concat([t])}),o}(t,e);return mt(n,function(t){return W(t,function(t){return t.dom})})}}},Bf=function(t){return{getBookmark:E(Al,t),moveToBookmark:E(Nl,t)}};Bf.isBookmarkNode=Ml;var Lf=function(t,e){for(;e&&e!==t;){if(Rn(e)||Bn(e))return e;e=e.parentNode}return null},Pf=function(t,e,n){if(n.collapsed)return!1;if(de.browser.isIE()&&n.startOffset===n.endOffset-1&&n.startContainer===n.endContainer){var r=n.startContainer.childNodes[n.startOffset];if(wn(r))return j(r.getClientRects(),function(n){return Qa(n,t,e)})}return j(n.getClientRects(),function(n){return Qa(n,t,e)})},Hf=function(t,e,n){return t.fire(e,n)},If=function(t,e,n,r){return t.fire("FormatApply",{format:e,node:n,vars:r})},Ff=function(t,e,n,r){return t.fire("FormatRemove",{format:e,node:n,vars:r})},Vf={BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,ESC:27,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,modifierPressed:function(t){return t.shiftKey||t.ctrlKey||t.altKey||Vf.metaKeyPressed(t)},metaKeyPressed:function(t){return de.mac?t.metaKey:t.ctrlKey&&!t.altKey}},Uf=Bn,jf=function(t,e){var n,r,o,i,u,a,c,s,l,f,d,m,g,h,p,v=e.dom,b=ve.each,w=e.getDoc(),x=document,C=Math.abs,S=Math.round,k=e.getBody(),O={nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]},T=function(t){return t&&("IMG"===t.nodeName||e.dom.is(t,"figure.image"))},_=function(t){return Pn(t)||v.hasClass(t,"mce-preview-object")},E=function(t){var n=t.target;(function(t,e){if("longpress"===t.type||0===t.type.indexOf("touch")){var n=t.touches[0];return T(t.target)&&!Pf(n.clientX,n.clientY,e)}return T(t.target)&&!Pf(t.clientX,t.clientY,e)})(t,e.selection.getRng())&&!t.isDefaultPrevented()&&e.selection.select(n)},D=function(t){return v.is(t,"figure.image")?[t.querySelector("img")]:v.hasClass(t,"mce-preview-object")&&y(t.firstElementChild)?[t,t.firstElementChild]:[t]},A=function(t){var n=es(e);return!!n&&("false"!==t.getAttribute("data-mce-resize")&&(t!==e.getBody()&&(v.hasClass(t,"mce-preview-object")?xe(ye.fromDom(t.firstElementChild),n):xe(ye.fromDom(t),n))))},N=function(t,n,r){if(y(r)){var o=D(t);q(o,function(t){t.style[n]||!e.schema.isValid(t.nodeName.toLowerCase(),n)?v.setStyle(t,n,r):v.setAttrib(t,n,""+r)})}},M=function(t,e,n){N(t,"width",e),N(t,"height",n)},z=function(t){var u,b,y,w;u=t.screenX-a,b=t.screenY-c,m=u*i[2]+s,g=b*i[3]+l,m=m<5?5:m,g=g<5?5:g,((T(n)||_(n))&&!1!==function(t){return t.getParam("resize_img_proportional",!0,"boolean")}(e)?!Vf.modifierPressed(t):Vf.modifierPressed(t))&&(C(u)>C(b)?(g=S(m*f),m=S(g/f)):(m=S(g/f),g=S(m*f))),M(r,m,g),y=i.startPos.x+u,w=i.startPos.y+b,y=y>0?y:0,w=w>0?w:0,v.setStyles(o,{left:y,top:w,display:"block"}),o.innerHTML=m+" × "+g,i[2]<0&&r.clientWidth<=m&&v.setStyle(r,"left",void 0+(s-m)),i[3]<0&&r.clientHeight<=g&&v.setStyle(r,"top",void 0+(l-g)),(u=k.scrollWidth-h)+(b=k.scrollHeight-p)!==0&&v.setStyles(o,{left:y-u,top:w-b}),d||(!function(t,e,n,r,o){t.fire("ObjectResizeStart",{target:e,width:n,height:r,origin:o})}(e,n,s,l,"corner-"+i.name),d=!0)},R=function(){var t=d;d=!1,t&&(N(n,"width",m),N(n,"height",g)),v.unbind(w,"mousemove",z),v.unbind(w,"mouseup",R),x!==w&&(v.unbind(x,"mousemove",z),v.unbind(x,"mouseup",R)),v.remove(r),v.remove(o),v.remove(u),B(n),t&&(!function(t,e,n,r,o){t.fire("ObjectResized",{target:e,width:n,height:r,origin:o})}(e,n,m,g,"corner-"+i.name),v.setAttrib(n,"style",v.getAttrib(n,"style"))),e.nodeChanged()},B=function(t){I();var d=v.getPos(t,k),y=d.x,C=d.y,S=t.getBoundingClientRect(),T=S.width||S.right-S.left,E=S.height||S.bottom-S.top;n!==t&&(L(),n=t,m=g=0);var N=e.fire("ObjectSelected",{target:t}),B=v.getAttrib(n,"data-mce-selected","1");A(t)&&!N.isDefaultPrevented()?b(O,function(t,e){var d,m=function(d){var m,g=D(n)[0];a=d.screenX,c=d.screenY,s=g.clientWidth,l=g.clientHeight,f=l/s,(i=t).name=e,i.startPos={x:T*t[0]+y,y:E*t[1]+C},h=k.scrollWidth,p=k.scrollHeight,u=v.add(k,"div",{class:"mce-resize-backdrop","data-mce-bogus":"all"}),v.setStyles(u,{position:"fixed",left:"0",top:"0",width:"100%",height:"100%"}),r=_(m=n)?v.create("img",{src:de.transparentSrc}):m.cloneNode(!0),v.addClass(r,"mce-clonedresizable"),v.setAttrib(r,"data-mce-bogus","all"),r.contentEditable="false",v.setStyles(r,{left:y,top:C,margin:0}),M(r,T,E),r.removeAttribute("data-mce-selected"),k.appendChild(r),v.bind(w,"mousemove",z),v.bind(w,"mouseup",R),x!==w&&(v.bind(x,"mousemove",z),v.bind(x,"mouseup",R)),o=v.add(k,"div",{class:"mce-resize-helper","data-mce-bogus":"all"},s+" × "+l)};(d=v.get("mceResizeHandle"+e))&&v.remove(d),d=v.add(k,"div",{id:"mceResizeHandle"+e,"data-mce-bogus":"all",class:"mce-resizehandle",unselectable:!0,style:"cursor:"+e+"-resize; margin:0; padding:0"}),11===de.ie&&(d.contentEditable=!1),v.bind(d,"mousedown",function(t){t.stopImmediatePropagation(),t.preventDefault(),m(t)}),t.elm=d,v.setStyles(d,{left:T*t[0]+y-d.offsetWidth/2,top:E*t[1]+C-d.offsetHeight/2})}):L(),v.getAttrib(n,"data-mce-selected")||n.setAttribute("data-mce-selected",B)},L=function(){I(),n&&n.removeAttribute("data-mce-selected"),dt(O,function(t,e){var n=v.get("mceResizeHandle"+e);n&&(v.unbind(n),v.remove(n))})},P=function(n){var r,o=function(t,e){if(t)do{if(t===e)return!0}while(t=t.parentNode)};d||e.removed||(b(v.select("img[data-mce-selected],hr[data-mce-selected]"),function(t){t.removeAttribute("data-mce-selected")}),r="mousedown"===n.type?n.target:t.getNode(),o(r=v.$(r).closest("table,img,figure.image,hr,video,span.mce-preview-object")[0],k)&&(F(),o(t.getStart(!0),r)&&o(t.getEnd(!0),r))?B(r):L())},H=function(t){return Uf(Lf(e.getBody(),t))},I=function(){dt(O,function(t){t.elm&&(v.unbind(t.elm),delete t.elm)})},F=function(){try{e.getDoc().execCommand("enableObjectResizing",!1,"false")}catch(t){}};e.on("init",function(){if(F(),de.browser.isIE()||de.browser.isEdge()){e.on("mousedown click",function(t){var n=t.target,r=n.nodeName;d||!/^(TABLE|IMG|HR)$/.test(r)||H(n)||(2!==t.button&&e.selection.select(n,"TABLE"===r),"mousedown"===t.type&&e.nodeChanged())});var t=function(t){var n=function(t){Kr.setEditorTimeout(e,function(){return e.selection.select(t)})};if(H(t.target)||Pn(t.target))return t.preventDefault(),void n(t.target);/^(TABLE|IMG|HR)$/.test(t.target.nodeName)&&(t.preventDefault(),"IMG"===t.target.tagName&&n(t.target))};v.bind(k,"mscontrolselect",t),e.on("remove",function(){return v.unbind(k,"mscontrolselect",t)})}var r=Kr.throttle(function(t){e.composing||P(t)});e.on("NodeChange ResizeEditor ResizeWindow ResizeContent drop",r),e.on("keyup compositionend",function(t){n&&"TABLE"===n.nodeName&&r(t)}),e.on("hide blur",L),e.on("contextmenu longpress",E,!0)}),e.on("remove",I);return{isResizable:A,showResizeRect:B,hideResizeRect:L,updateResizeRect:P,destroy:function(){n=r=u=null}}},Wf=function(t){return Rn(t)||Bn(t)},qf=function(t,e,n){var r,o,i=n;if(i.caretPositionFromPoint)(o=i.caretPositionFromPoint(t,e))&&((r=n.createRange()).setStart(o.offsetNode,o.offset),r.collapse(!0));else if(i.caretRangeFromPoint)r=i.caretRangeFromPoint(t,e);else if(i.body.createTextRange){r=i.body.createTextRange();try{r.moveToPoint(t,e),r.collapse(!0)}catch(o){r=function(t,e,n){var r,o=n.elementFromPoint(t,e),i=n.body.createTextRange();if(o&&"HTML"!==o.tagName||(o=n.body),i.moveToElementText(o),(r=(r=ve.toArray(i.getClientRects())).sort(function(t,n){return(t=Math.abs(Math.max(t.top-e,t.bottom-e)))-(n=Math.abs(Math.max(n.top-e,n.bottom-e)))})).length>0){e=(r[0].bottom+r[0].top)/2;try{return i.moveToPoint(t,e),i.collapse(!0),i}catch(t){}}return null}(t,e,n)}return function(t,e){var n=t&&t.parentElement?t.parentElement():null;return Bn(function(t,e,n){for(;t&&t!==e;){if(n(t))return t;t=t.parentNode}return null}(n,e,Wf))?null:t}(r,n.body)}return r},$f=function(t,e){return t&&e&&t.startContainer===e.startContainer&&t.startOffset===e.startOffset&&t.endContainer===e.endContainer&&t.endOffset===e.endOffset},Gf=function(t,e,n){return null!==function(t,e,n){for(;t&&t!==e;){if(n(t))return t;t=t.parentNode}return null}(t,e,n)},Kf=function(t,e,n){return Gf(t,e,function(t){return t.nodeName===n})},Xf=function(t){return t&&"TABLE"===t.nodeName},Yf=function(t){return t&&/^(TD|TH|CAPTION)$/.test(t.nodeName)},Jf=function(t,e){return vo(t)&&!1===Gf(t,e,wl)},Qf=function(t,e,n){for(var r=new Jr(e,t.getParent(e.parentNode,t.isBlock)||t.getRoot());e=r[n?"prev":"next"]();)if(Mn(e))return!0},Zf=function(t,e,n,r,o){var i,u,a=t.getRoot(),c=t.schema.getNonEmptyElements(),s=t.getParent(o.parentNode,t.isBlock)||a;if(r&&Mn(o)&&e&&t.isEmpty(s))return P.some(wc(o.parentNode,t.nodeIndex(o)));for(var l=new Jr(o,s);u=l[r?"prev":"next"]();){if("false"===t.getContentEditableParent(u)||Jf(u,a))return P.none();if(En(u)&&u.nodeValue.length>0)return!1===Kf(u,a,"A")?P.some(wc(u,r?u.nodeValue.length:0)):P.none();if(t.isBlock(u)||c[u.nodeName.toLowerCase()])return P.none();i=u}return n&&i?P.some(wc(i,0)):P.none()},td=function(t,e,n,r){var o,i,u,a,c=t.getRoot(),s=!1;o=r[(n?"start":"end")+"Container"],i=r[(n?"start":"end")+"Offset"];var l=wn(o)&&i===o.childNodes.length,f=t.schema.getNonEmptyElements();if(a=n,vo(o))return P.none();if(wn(o)&&i>o.childNodes.length-1&&(a=!1),An(o)&&(o=c,i=0),o===c){if(a&&(u=o.childNodes[i>0?i-1:0])){if(vo(u))return P.none();if(f[u.nodeName]||Xf(u))return P.none()}if(o.hasChildNodes()){if(i=Math.min(!a&&i>0?i-1:i,o.childNodes.length-1),o=o.childNodes[i],i=En(o)&&l?o.data.length:0,!e&&o===c.lastChild&&Xf(o))return P.none();if(function(t,e){for(;e&&e!==t;){if(Bn(e))return!0;e=e.parentNode}return!1}(c,o)||vo(o))return P.none();if(o.hasChildNodes()&&!1===Xf(o)){u=o;var d=new Jr(o,c);do{if(Bn(u)||vo(u)){s=!1;break}if(En(u)&&u.nodeValue.length>0){i=a?0:u.nodeValue.length,o=u,s=!0;break}if(f[u.nodeName.toLowerCase()]&&!Yf(u)){i=t.nodeIndex(u),o=u.parentNode,a||i++,s=!0;break}}while(u=a?d.next():d.prev())}}}return e&&(En(o)&&0===i&&Zf(t,l,e,!0,o).each(function(t){o=t.container(),i=t.offset(),s=!0}),wn(o)&&((u=o.childNodes[i])||(u=o.childNodes[i-1]),!u||!Mn(u)||function(t,e){return t.previousSibling&&t.previousSibling.nodeName===e}(u,"A")||Qf(t,u,!1)||Qf(t,u,!0)||Zf(t,l,e,!0,u).each(function(t){o=t.container(),i=t.offset(),s=!0}))),a&&!e&&En(o)&&i===o.nodeValue.length&&Zf(t,l,e,!1,o).each(function(t){o=t.container(),i=t.offset(),s=!0}),s?P.some(wc(o,i)):P.none()},ed=function(t,e){var n=e.collapsed,r=e.cloneRange(),o=wc.fromRangeStart(e);return td(t,n,!0,r).each(function(t){n&&wc.isAbove(o,t)||r.setStart(t.container(),t.offset())}),n||td(t,n,!1,r).each(function(t){r.setEnd(t.container(),t.offset())}),n&&r.collapse(!0),$f(e,r)?P.none():P.some(r)},nd=function(t,e){return t.splitText(e)},rd=function(t){var e=t.startContainer,n=t.startOffset,r=t.endContainer,o=t.endOffset;return e===r&&En(e)?n>0&&n<e.nodeValue.length&&(e=(r=nd(e,n)).previousSibling,o>n?(e=r=nd(r,o-=n).previousSibling,o=r.nodeValue.length,n=0):o=0):(En(e)&&n>0&&n<e.nodeValue.length&&(e=nd(e,n),n=0),En(r)&&o>0&&o<r.nodeValue.length&&(o=(r=nd(r,o).previousSibling).nodeValue.length)),{startContainer:e,startOffset:n,endContainer:r,endOffset:o}},od=function(t){return{walk:function(e,n){return hf(t,e,n)},split:rd,normalize:function(e){return ed(t,e).fold(M,function(t){return e.setStart(t.startContainer,t.startOffset),e.setEnd(t.endContainer,t.endOffset),!0})}}};od.compareRanges=$f,od.getCaretRangeFromPoint=qf,od.getSelectedNode=Za,od.getNode=tc;var id,ud=function(t,e){var n=function(n){var r=e(n);if(r<=0||null===r){var o=Xn(n,t);return parseFloat(o)||0}return r},r=function(t,e){return Y(e,function(e,n){var r=Xn(t,n),o=void 0===r?0:parseInt(r,10);return isNaN(o)?e:e+o},0)};return{set:function(e,n){if(!x(n)&&!n.match(/^[0-9]+$/))throw new Error(t+".set accepts only positive integer values. Value was "+n);var r=e.dom;Fn(r)&&(r.style[t]=n+"px")},get:n,getOuter:n,aggregate:r,max:function(t,e,n){var o=r(t,n);return e>o?e-o:0}}}("height",function(t){var e=t.dom;return cn(t)?e.getBoundingClientRect().height:e.offsetHeight}),ad=function(t,e){return t.view(e).fold(O([]),function(e){var n=t.owner(e),r=ad(t,n);return[e].concat(r)})},cd=Object.freeze({__proto__:null,view:function(t){var e;return(t.dom===document?P.none():P.from(null===(e=t.dom.defaultView)||void 0===e?void 0:e.frameElement)).map(ye.fromDom)},owner:function(t){return Re(t)}}),sd=function(t){var e=ye.fromDom(document),n=mn(e),r=function(t,e){var n=e.owner(t);return ad(e,n)}(t,cd),o=dn(t),i=X(r,function(t,e){var n=dn(e);return{left:t.left+n.left,top:t.top+n.top}},{left:0,top:0});return ln(i.left+o.left+n.left,i.top+o.top+n.top)},ld=function(t){return"textarea"===Te(t)},fd=function(t,e){var n=function(t){var e=t.dom.ownerDocument,n=e.body,r=e.defaultView,o=e.documentElement;if(n===t.dom)return ln(n.offsetLeft,n.offsetTop);var i=fn(null===r||void 0===r?void 0:r.pageYOffset,o.scrollTop),u=fn(null===r||void 0===r?void 0:r.pageXOffset,o.scrollLeft),a=fn(o.clientTop,n.clientTop),c=fn(o.clientLeft,n.clientLeft);return dn(t).translate(u-c,i-a)}(t),r=function(t){return ud.get(t)}(t);return{element:t,bottom:n.top+r,height:r,pos:n,cleanup:e}},dd=function(t,e){var n=function(t,e){var n=Ve(t);if(0===n.length||ld(t))return{element:t,offset:e};if(e<n.length&&!ld(n[e]))return{element:n[e],offset:0};var r=n[n.length-1];return ld(r)?{element:t,offset:e}:"img"===Te(r)?{element:r,offset:1}:Ae(r)?{element:r,offset:Df(r).length}:{element:r,offset:Ve(r).length}}(t,e),r=ye.fromHtml('<span data-mce-bogus="all" style="display: inline-block;">\ufeff</span>');return Ze(n.element,r),fd(r,function(){return un(r)})},md=function(t,e,n,r){vd(t,function(o,i){return hd(t,e,n,r)},n)},gd=function(t,e,n,r,o){var i={elm:r.element.dom,alignToTop:o};(function(t,e){return t.fire("ScrollIntoView",e).isDefaultPrevented()})(t,i)||(n(e,mn(e).top,r,o),function(t,e){t.fire("AfterScrollIntoView",e)}(t,i))},hd=function(t,e,n,r){var o=ye.fromDom(t.getBody()),i=ye.fromDom(t.getDoc());o.dom.offsetWidth;var u=dd(ye.fromDom(n.startContainer),n.startOffset);gd(t,i,e,u,r),u.cleanup()},pd=function(t,e,n,r){var o=ye.fromDom(t.getDoc());gd(t,o,n,function(t){return fd(ye.fromDom(t),C)}(e),r)},vd=function(t,e,n){var r=n.startContainer,o=n.startOffset,i=n.endContainer,u=n.endOffset;e(ye.fromDom(r),ye.fromDom(i));var a=t.dom.createRng();a.setStart(r,o),a.setEnd(i,u),t.selection.setRng(n)},bd=function(t,e,n,r){var o=t.pos;if(n)gn(o.left,o.top,r);else{var i=o.top-e+t.height;gn(o.left,i,r)}},yd=function(t,e,n,r,o){var i=n+e,u=r.pos.top,a=r.bottom,c=a-u>=n;if(u<e)bd(r,n,!1!==o,t);else if(u>i){bd(r,n,c?!1!==o:!0===o,t)}else a>i&&!c&&bd(r,n,!0===o,t)},wd=function(t,e,n,r){var o=t.dom.defaultView.innerHeight;yd(t,e,o,n,r)},xd=function(t,e,n,r){var o=t.dom.defaultView.innerHeight;yd(t,e,o,n,r);var i=sd(n.element),u=vn(window);i.top<u.y?hn(n.element,!1!==r):i.top>u.bottom&&hn(n.element,!0===r)},Cd=function(t,e,n){return md(t,wd,e,n)},Sd=function(t,e,n){return pd(t,e,wd,n)},kd=function(t,e,n){return md(t,xd,e,n)},Od=function(t,e,n){return pd(t,e,xd,n)},Td=function(t,e,n){(t.inline?Cd:kd)(t,e,n)},_d=function(t){var e=Xe(t).dom;return t.dom===e.activeElement},Ed=function(t){return void 0===t&&(t=ye.fromDom(document)),P.from(t.dom.activeElement).map(ye.fromDom)},Dd=function(t,e,n,r){return{start:t,soffset:e,finish:n,foffset:r}},Ad=hr([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Nd=(Ad.before,Ad.on,Ad.after,function(t){return t.fold(T,T,T)}),Md=hr([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),zd={domRange:Md.domRange,relative:Md.relative,exact:Md.exact,exactFromRange:function(t){return Md.exact(t.start,t.soffset,t.finish,t.foffset)},getWin:function(t){var e=function(t){return t.match({domRange:function(t){return ye.fromDom(t.startContainer)},relative:function(t,e){return Nd(t)},exact:function(t,e,n,r){return t}})}(t);return Be(e)},range:Dd},Rd=re().browser,Bd=function(t,e){var n=Ae(e)?Df(e).length:Ve(e).length+1;return t>n?n:t<0?0:t},Ld=function(t){return zd.range(t.start,Bd(t.soffset,t.start),t.finish,Bd(t.foffset,t.finish))},Pd=function(t,e){return!yn(e.dom)&&(Oe(t,e)||Se(t,e))},Hd=function(t){return function(e){return Pd(t,e.start)&&Pd(t,e.finish)}},Id=function(t){return!0===t.inline||Rd.isIE()},Fd=function(t){return zd.range(ye.fromDom(t.startContainer),t.startOffset,ye.fromDom(t.endContainer),t.endOffset)},Vd=function(t){return function(t){var e=t.getSelection();return(e&&0!==e.rangeCount?P.from(e.getRangeAt(0)):P.none()).map(Fd)}(Be(t).dom).filter(Hd(t))},Ud=function(t){var e=document.createRange();try{return e.setStart(t.start.dom,t.soffset),e.setEnd(t.finish.dom,t.foffset),P.some(e)}catch(t){return P.none()}},jd=function(t){var e=Id(t)?Vd(ye.fromDom(t.getBody())):P.none();t.bookmark=e.isSome()?e:t.bookmark},Wd=function(t){return(t.bookmark?t.bookmark:P.none()).bind(function(e){return n=ye.fromDom(t.getBody()),r=e,P.from(r).filter(Hd(n)).map(Ld);var n,r}).bind(Ud)},qd={isEditorUIElement:function(t){var e=t.className.toString();return-1!==e.indexOf("tox-")||-1!==e.indexOf("mce-")}},$d=function(t,e){re().browser.isIE()?function(t){t.on("focusout",function(){jd(t)})}(t):function(t,e){t.on("mouseup touchend",function(t){e.throttle()})}(t,e),t.on("keyup NodeChange",function(e){(function(t){return"nodechange"===t.type&&t.selectionChange})(e)||jd(t)})},Gd=function(t){var e=wa(function(){jd(t)},0);t.on("init",function(){t.inline&&function(t,e){var n=function(){e.throttle()};ca.DOM.bind(document,"mouseup",n),t.on("remove",function(){ca.DOM.unbind(document,"mouseup",n)})}(t,e),$d(t,e)}),t.on("remove",function(){e.cancel()})},Kd=ca.DOM,Xd=function(t,e){var n=function(t){return t.getParam("custom_ui_selector","","string")}(t);return null!==Kd.getParent(e,function(e){return function(t){return qd.isEditorUIElement(t)}(e)||!!n&&t.dom.is(e,n)})},Yd=function(t,e){var n=e.editor;Gd(n),n.on("focusin",function(){var e=t.focusedEditor;e!==n&&(e&&e.fire("blur",{focusedEditor:n}),t.setActive(n),t.focusedEditor=n,n.fire("focus",{blurredEditor:e}),n.focus(!0))}),n.on("focusout",function(){Kr.setEditorTimeout(n,function(){var e=t.focusedEditor;Xd(n,function(t){try{var e=Xe(ye.fromDom(t.getElement()));return Ed(e).fold(function(){return document.body},function(t){return t.dom})}catch(t){return document.body}}(n))||e!==n||(n.fire("blur",{focusedEditor:null}),t.focusedEditor=null)})}),id||(id=function(e){var n=t.activeEditor;n&&function(t){if(Ke()&&y(t.target)){var e=ye.fromDom(t.target);if(De(e)&&Qe(e)&&t.composed&&t.composedPath){var n=t.composedPath();if(n)return ut(n)}}return P.from(t.target)}(e).each(function(e){e.ownerDocument===document&&(e===document.body||Xd(n,e)||t.focusedEditor!==n||(n.fire("blur",{focusedEditor:null}),t.focusedEditor=null))})},Kd.bind(document,"focusin",id))},Jd=function(t,e){t.focusedEditor===e.editor&&(t.focusedEditor=null),t.activeEditor||(Kd.unbind(document,"focusin",id),id=null)},Qd=function(t,e){return function(t){return t.collapsed?P.from(tc(t.startContainer,t.startOffset)).map(ye.fromDom):P.none()}(e).bind(function(e){return uo(e)?P.some(e):!1===Oe(t,e)?P.some(t):P.none()})},Zd=function(t,e){Qd(ye.fromDom(t.getBody()),e).bind(function(t){return bl(t.dom)}).fold(function(){t.selection.normalize()},function(e){return t.selection.setRng(e.toRange())})},tm=function(t){if(t.setActive)try{t.setActive()}catch(e){t.focus()}else t.focus()},em=function(t){return _d(t)||(e=t,Ed(Xe(e)).filter(function(t){return e.dom.contains(t.dom)})).isSome();var e},nm=function(t){return t.inline?function(t){var e=t.getBody();return e&&em(ye.fromDom(e))}(t):function(t){return t.iframeElement&&_d(ye.fromDom(t.iframeElement))}(t)},rm=function(t){return nm(t)||function(t){var e=Xe(ye.fromDom(t.getElement()));return Ed(e).filter(function(e){return n=e.dom,!(void 0!==(r=n.classList)&&(r.contains("tox-edit-area")||r.contains("tox-edit-area__iframe")||r.contains("mce-content-body")))&&Xd(t,e.dom);var n,r}).isSome()}(t)},om=function(t){return t.editorManager.setActive(t)},im=function(t,e){t.removed||(e?om(t):function(t){var e=t.selection,n=t.getBody(),r=e.getRng();t.quirks.refreshContentEditable(),void 0!==t.bookmark&&!1===nm(t)&&Wd(t).each(function(e){t.selection.setRng(e),r=e});var o=function(t,e){return t.dom.getParent(e,function(e){return"true"===t.dom.getContentEditable(e)})}(t,e.getNode());if(t.$.contains(n,o))return tm(o),Zd(t,r),void om(t);t.inline||(de.opera||tm(n),t.getWin().focus()),(de.gecko||t.inline)&&(tm(n),Zd(t,r)),om(t)}(t))},um=function(t,e,n,r,o){var i=n?e.startContainer:e.endContainer,u=n?e.startOffset:e.endOffset;return P.from(i).map(ye.fromDom).map(function(t){return r&&e.collapsed?t:Ue(t,o(t,u)).getOr(t)}).bind(function(t){return De(t)?P.some(t):Le(t).filter(De)}).map(function(t){return t.dom}).getOr(t)},am=function(t,e,n){return um(t,e,!0,n,function(t,e){return Math.min(qe(t),e)})},cm=function(t,e,n){return um(t,e,!1,n,function(t,e){return e>0?e-1:e})},sm=function(t,e){for(var n=t;t&&En(t)&&0===t.length;)t=e?t.nextSibling:t.previousSibling;return t||n},lm=function(t,e){return W(e,function(e){var n=t.fire("GetSelectionRange",{range:e});return n.range!==e?n.range:e})},fm={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11},dm=function(t,e,n){var r=n?"lastChild":"firstChild",o=n?"prev":"next";if(t[r])return t[r];if(t!==e){var i=t[o];if(i)return i;for(var u=t.parent;u&&u!==e;u=u.parent)if(i=u[o])return i}},mm=function(t){if(!Ho(t.value))return!1;var e=t.parent;return!e||"span"===e.name&&!e.attr("style")||!/^[ ]+$/.test(t.value)},gm=function(t){var e="a"===t.name&&!t.attr("href")&&t.attr("id");return t.attr("name")||t.attr("id")&&!t.firstChild||t.attr("data-mce-bookmark")||e},hm=function(){function t(t,e){this.name=t,this.type=e,1===e&&(this.attributes=[],this.attributes.map={})}return t.create=function(e,n){var r=new t(e,fm[e]||1);return n&&dt(n,function(t,e){r.attr(e,t)}),r},t.prototype.replace=function(t){return t.parent&&t.remove(),this.insert(t,this),this.remove(),this},t.prototype.attr=function(t,e){var n,r=this;if("string"!=typeof t)return void 0!==t&&null!==t&&dt(t,function(t,e){r.attr(e,t)}),r;if(n=r.attributes){if(void 0!==e){if(null===e){if(t in n.map){delete n.map[t];for(var o=n.length;o--;)if(n[o].name===t)return n.splice(o,1),r}return r}if(t in n.map){for(o=n.length;o--;)if(n[o].name===t){n[o].value=e;break}}else n.push({name:t,value:e});return n.map[t]=e,r}return n.map[t]}},t.prototype.clone=function(){var e,n=new t(this.name,this.type);if(e=this.attributes){var r=[];r.map={};for(var o=0,i=e.length;o<i;o++){var u=e[o];"id"!==u.name&&(r[r.length]={name:u.name,value:u.value},r.map[u.name]=u.value)}n.attributes=r}return n.value=this.value,n.shortEnded=this.shortEnded,n},t.prototype.wrap=function(t){return this.parent.insert(t,this),t.append(this),this},t.prototype.unwrap=function(){for(var t=this.firstChild;t;){var e=t.next;this.insert(t,this,!0),t=e}this.remove()},t.prototype.remove=function(){var t=this.parent,e=this.next,n=this.prev;return t&&(t.firstChild===this?(t.firstChild=e,e&&(e.prev=null)):n.next=e,t.lastChild===this?(t.lastChild=n,n&&(n.next=null)):e.prev=n,this.parent=this.next=this.prev=null),this},t.prototype.append=function(t){t.parent&&t.remove();var e=this.lastChild;return e?(e.next=t,t.prev=e,this.lastChild=t):this.lastChild=this.firstChild=t,t.parent=this,t},t.prototype.insert=function(t,e,n){t.parent&&t.remove();var r=e.parent||this;return n?(e===r.firstChild?r.firstChild=t:e.prev.next=t,t.prev=e.prev,t.next=e,e.prev=t):(e===r.lastChild?r.lastChild=t:e.next.prev=t,t.next=e.next,t.prev=e,e.next=t),t.parent=r,t},t.prototype.getAll=function(t){for(var e=[],n=this.firstChild;n;n=dm(n,this))n.name===t&&e.push(n);return e},t.prototype.children=function(){for(var t=[],e=this.firstChild;e;e=e.next)t.push(e);return t},t.prototype.empty=function(){if(this.firstChild){for(var t=[],e=this.firstChild;e;e=dm(e,this))t.push(e);for(var n=t.length;n--;){(e=t[n]).parent=e.firstChild=e.lastChild=e.next=e.prev=null}}return this.firstChild=this.lastChild=null,this},t.prototype.isEmpty=function(t,e,n){void 0===e&&(e={});var r=this.firstChild;if(gm(this))return!1;if(r)do{if(1===r.type){if(r.attr("data-mce-bogus"))continue;if(t[r.name])return!1;if(gm(r))return!1}if(8===r.type)return!1;if(3===r.type&&!mm(r))return!1;if(3===r.type&&r.parent&&e[r.parent.name]&&Ho(r.value))return!1;if(n&&n(r))return!1}while(r=dm(r,this));return!0},t.prototype.walk=function(t){return dm(this,null,t)},t}(),pm=ve.makeMap("NOSCRIPT STYLE SCRIPT XMP IFRAME NOEMBED NOFRAMES PLAINTEXT"," "),vm=function(t){return d(t.nodeValue)&&Pt(t.nodeValue,so)},bm=function(t){return(0===t.length?"":W(t,function(t){return"["+t+"]"}).join(",")+",")+'[data-mce-bogus="all"]'},ym=function(t,e,n){return document.createTreeWalker(t,e,n,!1)},wm=function(t){return ym(t,NodeFilter.SHOW_COMMENT,function(t){return vm(t)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP})},xm=function(t){return ym(t,NodeFilter.SHOW_TEXT,function(t){if(vm(t)){var e=t.parentNode;return e&&wt(pm,e.nodeName)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}return NodeFilter.FILTER_SKIP})},Cm=function(t){return null!==wm(t).nextNode()},Sm=function(t){return null!==xm(t).nextNode()},km=function(t,e){return null!==e.querySelector(bm(t))},Om=function(t,e){q(function(t,e){return e.querySelectorAll(bm(t))}(t,e),function(e){var n=ye.fromDom(e);"all"===Wn(n,"data-mce-bogus")?un(n):q(t,function(t){$n(n,t)&&Gn(n,t)})})},Tm=function(t){for(var e=t.nextNode();null!==e;)e.nodeValue=null,e=t.nextNode()},_m=S(Tm,wm),Em=S(Tm,xm),Dm=function(t,e){var n=[{condition:E(km,e),action:E(Om,e)},{condition:Cm,action:_m},{condition:Sm,action:Em}],r=t,o=!1;return q(n,function(e){var n=e.condition,i=e.action;n(r)&&(o||(r=t.cloneNode(!0),o=!0),i(r))}),r},Am=function(t,e,n,r){var o,i=function(t,e){return At(At({},t),{format:e,get:!0,getInner:!0})}(e,n),u=e.no_events?i:t.fire("BeforeGetContent",i);return o="raw"===u.format?ve.trim(fo(Dm(r,t.serializer.getTempAttrs()).innerHTML)):"text"===u.format?t.dom.isEmpty(r)?"":fo(r.innerText||r.textContent):"tree"===u.format?t.serializer.serialize(r,u):function(t,e){var n=Gc(t),r=new RegExp("^(<"+n+"[^>]*>( | |\\s| |<br \\/>|)<\\/"+n+">[\r\n]*|<br \\/>[\r\n]*)$");return e.replace(r,"")}(t,t.serializer.serialize(r,u)),U(["text","tree"],u.format)||co(ye.fromDom(r))?u.content=o:u.content=ve.trim(o),u.no_events?u.content:t.fire("GetContent",u).content},Nm=ve.each,Mm=function(t){return{compare:function(e,n){if(e.nodeName!==n.nodeName)return!1;var r=function(e){var n={};return Nm(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(wt(t,r)){if(void 0===(n=e[r]))return!1;if(t[r]!==n)return!1;delete e[r]}for(r in e)if(wt(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")))||Ml(e)||Ml(n))}}},zm=ve.makeMap,Rm=function(t){var e=[],n=(t=t||{}).indent,r=zm(t.indent_before||""),o=zm(t.indent_after||""),i=ci.getEncodeFunc(t.entity_encoding||"raw",t.entities),u="html"===t.element_format;return{start:function(t,a,c){var s,l,f,d;if(n&&r[t]&&e.length>0&&(d=e[e.length-1]).length>0&&"\n"!==d&&e.push("\n"),e.push("<",t),a)for(s=0,l=a.length;s<l;s++)f=a[s],e.push(" ",f.name,'="',i(f.value,!0),'"');e[e.length]=!c||u?">":" />",c&&n&&o[t]&&e.length>0&&(d=e[e.length-1]).length>0&&"\n"!==d&&e.push("\n")},end:function(t){var r;e.push("</",t,">"),n&&o[t]&&e.length>0&&(r=e[e.length-1]).length>0&&"\n"!==r&&e.push("\n")},text:function(t,n){t.length>0&&(e[e.length]=n?t:i(t))},cdata:function(t){e.push("<![CDATA[",t,"]]>")},comment:function(t){e.push("\x3c!--",t,"--\x3e")},pi:function(t,r){r?e.push("<?",t," ",i(r),"?>"):e.push("<?",t,"?>"),n&&e.push("\n")},doctype:function(t){e.push("<!DOCTYPE",t,">",n?"\n":"")},reset:function(){e.length=0},getContent:function(){return e.join("").replace(/\n$/,"")}}},Bm=function(t,e){void 0===e&&(e=wi());var n=Rm(t);(t=t||{}).validate=!("validate"in t)||t.validate;return{serialize:function(r){var o=t.validate,i={3:function(t){n.text(t.value,t.raw)},8:function(t){n.comment(t.value)},7:function(t){n.pi(t.name,t.value)},10:function(t){n.doctype(t.value)},4:function(t){n.cdata(t.value)},11:function(t){if(t=t.firstChild)do{u(t)}while(t=t.next)}};n.reset();var u=function(t){var r=i[t.type];if(r)r(t);else{var a=t.name,c=t.shortEnded,s=t.attributes;if(o&&s&&s.length>1){var l=[];l.map={};var f=e.getElementRule(t.name);if(f){for(var d=0,m=f.attributesOrder.length;d<m;d++)if((h=f.attributesOrder[d])in s.map){var g=s.map[h];l.map[h]=g,l.push({name:h,value:g})}for(d=0,m=s.length;d<m;d++){var h;(h=s[d].name)in l.map||(g=s.map[h],l.map[h]=g,l.push({name:h,value:g}))}s=l}}if(n.start(t.name,s,c),!c){if(t=t.firstChild)do{u(t)}while(t=t.next);n.end(a)}}};return 1!==r.type||t.inner?i[11](r):u(r),n.getContent()}}},Lm=new Set;q(["margin","margin-left","margin-right","margin-top","margin-bottom","padding","padding-left","padding-right","padding-top","padding-bottom","border","border-width","border-style","border-color","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","float","position","left","right","top","bottom","z-index","display","transform","width","max-width","min-width","height","max-height","min-height","overflow","overflow-x","overflow-y","text-overflow","vertical-align","transition","transition-delay","transition-duration","transition-property","transition-timing-function"],function(t){Lm.add(t)});var Pm=["font","text-decoration","text-emphasis"],Hm=function(t,e){return lt(t.parseStyle(t.getAttrib(e,"style")))},Im=function(t,e){return et(Hm(t,e),function(t){return!function(t){return Lm.has(t)}(t)})},Fm=function(t,e,n){var r=Hm(t,e),o=Hm(t,n),i=function(r){var o=t.getStyle(e,r),i=t.getStyle(n,r);return jt(o)&&jt(i)&&o!==i};return j(r,function(t){var e=function(e){return j(e,function(e){return e===t})};if(!e(o)&&e(Pm)){var n=K(o,function(t){return j(Pm,function(e){return Ht(t,e)})});return j(n,i)}return i(t)})},Vm=function(t,e,n){return P.from(n.container()).filter(En).exists(function(r){var o=t?0:-1;return e(r.data.charAt(n.offset()+o))})},Um=E(Vm,!0,Rl),jm=E(Vm,!1,Rl),Wm=function(t){var e=t.container();return En(e)&&(0===e.data.length||lo(e.data)&&Bf.isBookmarkNode(e.parentNode))},qm=function(t,e){return function(n){return P.from(Hs(t?0:-1,n)).filter(e).isSome()}},$m=function(t){return zn(t)&&"block"===Xn(ye.fromDom(t),"display")},Gm=function(t){return Bn(t)&&!function(t){return wn(t)&&"all"===t.getAttribute("data-mce-bogus")}(t)},Km=qm(!0,$m),Xm=qm(!1,$m),Ym=qm(!0,Pn),Jm=qm(!1,Pn),Qm=qm(!0,On),Zm=qm(!1,On),tg=qm(!0,Gm),eg=qm(!1,Gm),ng=function(t){var e=Aa(t,"br"),n=K(function(t){for(var e=[],n=t.dom;n;)e.push(ye.fromDom(n)),n=n.lastChild;return e}(t).slice(-1),no);e.length===n.length&&q(n,un)},rg=function(t){on(t),nn(t,ye.fromHtml('<br data-mce-bogus="1">'))},og=function(t){We(t).each(function(e){Pe(e).each(function(n){to(t)&&no(e)&&to(n)&&un(e)})})},ig=function(t,e,n){return Oe(e,t)?function(t,e){for(var n=w(e)?e:M,r=t.dom,o=[];null!==r.parentNode&&void 0!==r.parentNode;){var i=r.parentNode,u=ye.fromDom(i);if(o.push(u),!0===n(u))break;r=i}return o}(t,function(t){return n(t)||Se(t,e)}).slice(0,-1):[]},ug=function(t,e){return ig(t,e,M)},ag=function(t,e){return[t].concat(ug(t,e))},cg=function(t,e,n){return gl(t,e,n,Wm)},sg=function(t,e){return Q(ag(ye.fromDom(e.container()),t),to)},lg=function(t,e,n){return cg(t,e.dom,n).forall(function(t){return sg(e,n).fold(function(){return!1===Ps(t,n,e.dom)},function(r){return!1===Ps(t,n,e.dom)&&Oe(r,ye.fromDom(t.container()))})})},fg=function(t,e,n){return sg(e,n).fold(function(){return cg(t,e.dom,n).forall(function(t){return!1===Ps(t,n,e.dom)})},function(e){return cg(t,e.dom,n).isNone()})},dg=E(fg,!1),mg=E(fg,!0),gg=E(lg,!1),hg=E(lg,!0),pg=function(t){return Gs(t).exists(no)},vg=function(t,e,n){var r=K(ag(ye.fromDom(n.container()),e),to),o=ut(r).getOr(e);return dl(t,o.dom,n).filter(pg)},bg=function(t,e){return Gs(e).exists(no)||vg(!0,t,e).isSome()},yg=function(t,e){return function(t){return P.from(t.getNode(!0)).map(ye.fromDom)}(e).exists(no)||vg(!1,t,e).isSome()},wg=E(vg,!1),xg=E(vg,!0),Cg=function(t){return wc.isTextPosition(t)&&!t.isAtStart()&&!t.isAtEnd()},Sg=function(t,e){var n=K(ag(ye.fromDom(e.container()),t),to);return ut(n).getOr(t)},kg=function(t,e){return Cg(e)?jm(e):jm(e)||vl(Sg(t,e).dom,e).exists(jm)},Og=function(t,e){return Cg(e)?Um(e):Um(e)||pl(Sg(t,e).dom,e).exists(Um)},Tg=function(t){return Gs(t).bind(function(t){return Ir(t,De)}).exists(function(t){return e=Xn(t,"white-space"),U(["pre","pre-wrap"],e);var e})},_g=function(t,e){return function(t,e){return vl(t.dom,e).isNone()}(t,e)||function(t,e){return pl(t.dom,e).isNone()}(t,e)||dg(t,e)||mg(t,e)||yg(t,e)||bg(t,e)},Eg=function(t,e){return!Tg(e)&&(dg(t,e)||gg(t,e)||yg(t,e)||kg(t,e))},Dg=function(t,e){return!Tg(e)&&(mg(t,e)||hg(t,e)||bg(t,e)||Og(t,e))},Ag=function(t,e){return Eg(t,e)||Dg(t,function(t){var e=t.container(),n=t.offset();return En(e)&&n<e.data.length?wc(e,n+1):t}(e))},Ng=function(t,e){return zl(t.charAt(e))},Mg=function(t){var e=t.container();return En(e)&&Pt(e.data," ")},zg=function(t){var e=t.data,n=function(t){var e=t.split("");return W(e,function(t,n){return zl(t)&&n>0&&n<e.length-1&&Bl(e[n-1])&&Bl(e[n+1])?" ":t}).join("")}(e);return n!==e&&(t.data=n,!0)},Rg=function(t,e){return P.some(e).filter(Mg).bind(function(e){var n=e.container();return function(t,e){var n=e.data,r=wc(e,0);return!(!Ng(n,0)||Ag(t,r)||(e.data=" "+n.slice(1),0))}(t,n)||zg(n)||function(t,e){var n=e.data,r=wc(e,n.length-1);return!(!Ng(n,n.length-1)||Ag(t,r)||(e.data=n.slice(0,-1)+" ",0))}(t,n)?P.some(e):P.none()})},Bg=function(t){var e=ye.fromDom(t.getBody());t.selection.isCollapsed()&&Rg(e,wc.fromRangeStart(t.selection.getRng())).each(function(e){t.selection.setRng(e.toRange())})},Lg=function(t,e,n){if(0!==n){var r=ye.fromDom(t),o=Hr(r,to).getOr(r),i=t.data.slice(e,e+n),u=e+n>=t.data.length&&Dg(o,wc(t,t.data.length)),a=0===e&&Eg(o,wc(t,0));t.replaceData(e,n,function(t,e,n){return Y(t,function(r,o){return Rl(o)||zl(o)?r.previousCharIsSpace||""===r.str&&e||r.str.length===t.length-1&&n?{previousCharIsSpace:!1,str:r.str+" "}:{previousCharIsSpace:!0,str:r.str+" "}:{previousCharIsSpace:!1,str:r.str+o}},{previousCharIsSpace:!1,str:""}).str}(i,a,u))}},Pg=function(t,e){var n=t.data.slice(e),r=n.length-Vt(n).length;Lg(t,e,r)},Hg=function(t,e){var n=t.data.slice(0,e),r=n.length-Ut(n).length;Lg(t,e-r,r)},Ig=function(t,e,n,r){void 0===r&&(r=!0);var o=Ut(t.data).length,i=r?t:e,u=r?e:t;return r?i.appendData(u.data):i.insertData(0,u.data),un(ye.fromDom(u)),n&&Pg(i,o),i},Fg=function(t,e){return function(t,e){var n=t.container(),r=t.offset();return!1===wc.isTextPosition(t)&&n===e.parentNode&&r>wc.before(e).offset()}(e,t)?wc(e.container(),e.offset()-1):e},Vg=function(t){return Ro(t.previousSibling)?P.some((e=t.previousSibling,En(e)?wc(e,e.data.length):wc.after(e))):t.previousSibling?yl(t.previousSibling):P.none();var e},Ug=function(t){return Ro(t.nextSibling)?P.some((e=t.nextSibling,En(e)?wc(e,0):wc.before(e))):t.nextSibling?bl(t.nextSibling):P.none();var e},jg=function(t,e){return Vg(e).orThunk(function(){return Ug(e)}).orThunk(function(){return function(t,e){var n=wc.before(e.previousSibling?e.previousSibling:e.parentNode);return vl(t,n).fold(function(){return pl(t,wc.after(e))},P.some)}(t,e)})},Wg=function(t,e){return Ug(e).orThunk(function(){return Vg(e)}).orThunk(function(){return function(t,e){return pl(t,wc.after(e)).fold(function(){return vl(t,wc.before(e))},P.some)}(t,e)})},qg=function(t,e,n){return function(t,e,n){return t?Wg(e,n):jg(e,n)}(t,e,n).map(E(Fg,n))},$g=function(t,e,n){n.fold(function(){t.focus()},function(n){t.selection.setRng(n.toRange(),e)})},Gg=function(t,e){return e&&wt(t.schema.getBlockElements(),Te(e))},Kg=function(t){if(Wo(t)){var e=ye.fromHtml('<br data-mce-bogus="1">');return on(t),nn(t,e),P.some(wc.before(e.dom))}return P.none()},Xg=function(t,e,n){var r,o,i,u,a=Pe(t).filter(Ae),c=He(t).filter(Ae);return un(t),(r=a,o=c,i=e,u=function(t,e,r){var o=t.dom,i=e.dom,u=o.data.length;return Ig(o,i,n),r.container()===i?wc(o,u):r},r.isSome()&&o.isSome()&&i.isSome()?P.some(u(r.getOrDie(),o.getOrDie(),i.getOrDie())):P.none()).orThunk(function(){return n&&(a.each(function(t){return Hg(t.dom,t.dom.length)}),c.each(function(t){return Pg(t.dom,0)})),e})},Yg=function(t,e,n,r){void 0===r&&(r=!0);var o,i=qg(e,t.getBody(),n.dom),u=Hr(n,E(Gg,t),(o=t.getBody(),function(t){return t.dom===o})),a=Xg(n,i,function(t,e){return wt(t.schema.getTextInlineElements(),Te(e))}(t,n));t.dom.isEmpty(t.getBody())?(t.setContent(""),t.selection.setCursorLocation()):u.bind(Kg).fold(function(){r&&$g(t,e,a)},function(n){r&&$g(t,e,P.some(n))})},Jg=function(t){return Aa(t,"td,th")},Qg=function(t,e){return{start:t,end:e}},Zg=hr([{singleCellTable:["rng","cell"]},{fullTable:["table"]},{partialTable:["cells","outsideDetails"]},{multiTable:["startTableCells","endTableCells","betweenRng"]}]),th=function(t,e){return jr(ye.fromDom(t),"td,th",e)},eh=function(t){return!Se(t.start,t.end)},nh=function(t,e){return wf(t.start,e).bind(function(n){return wf(t.end,e).bind(function(t){return e=Se(n,t),r=n,e?P.some(r):P.none();var e,r})})},rh=function(t){return function(e){return nh(e,t).map(function(t){return function(t,e,n){return{rng:t,table:e,cells:n}}(e,t,Jg(t))})}},oh=function(t,e,n,r){if(n.collapsed||!t.forall(eh))return P.none();if(e.isSameTable){var o=t.bind(rh(r));return P.some({start:o,end:o})}var i=th(n.startContainer,r),u=th(n.endContainer,r),a=i.bind(function(t){return function(e){return wf(e,t).bind(function(t){return at(Jg(t)).map(function(t){return Qg(e,t)})})}}(r)).bind(rh(r)),c=u.bind(function(t){return function(e){return wf(e,t).bind(function(t){return ut(Jg(t)).map(function(t){return Qg(t,e)})})}}(r)).bind(rh(r));return P.some({start:a,end:c})},ih=function(t,e){return Z(t,function(t){return Se(t,e)})},uh=function(t){return In(ih(t.cells,t.rng.start),ih(t.cells,t.rng.end),function(e,n){return t.cells.slice(e,n+1)})},ah=function(t,e,n){return t.exists(function(t){return function(t,e){return!eh(t)&&nh(t,e).exists(function(t){var e=t.dom.rows;return 1===e.length&&1===e[0].cells.length})}(t,n)&&Sf(t.start,e)})},ch=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},sh=function(t,e){var n=function(t){return function(e){return Se(t,e)}}(t),r=function(t,e){var n=th(t.startContainer,e),r=th(t.endContainer,e);return In(n,r,Qg)}(e,n),o=function(t,e){var n=function(t){return wf(ye.fromDom(t),e)},r=n(t.startContainer),o=n(t.endContainer),i=r.isSome(),u=o.isSome(),a=In(r,o,Se).getOr(!1);return{startTable:r,endTable:o,isStartInTable:i,isEndInTable:u,isSameTable:a,isMultiTable:!a&&i&&u}}(e,n);return ah(r,e,n)?r.map(function(t){return Zg.singleCellTable(e,t.start)}):o.isMultiTable?function(t,e,n,r){return oh(t,e,n,r).bind(function(t){var r=t.start,o=t.end,i=r.bind(uh).getOr([]),u=o.bind(uh).getOr([]);if(i.length>0&&u.length>0){var a=ch(n,e);return P.some(Zg.multiTable(i,u,a))}return P.none()})}(r,o,e,n):function(t,e,n,r){return oh(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=uh(t).getOr([]);if(r&&t.cells.length===o.length)return P.some(Zg.fullTable(t.table));if(o.length>0){if(r)return P.some(Zg.partialTable(o,P.none()));var i=ch(n,e);return P.some(Zg.partialTable(o,P.some(At(At({},e),{rng:i}))))}return P.none()})}(r,o,e,n)},lh=function(t){var e;return(8===_e(e=t)||"#comment"===Te(e)?Pe(t):We(t)).bind(lh).orThunk(function(){return P.some(t)})},fh=function(t){return q(t,function(t){Gn(t,"contenteditable"),rg(t)})},dh=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)),ph(t,o,e,!1)},mh=function(t){var e=yf(t),n=ye.fromDom(t.selection.getNode());Ln(n.dom)&&Wo(n)?t.selection.setCursorLocation(n.dom,0):t.selection.collapse(!0),e.length>1&&j(e,function(t){return Se(t,n)})&&Un(n,"data-mce-selected","1")},gh=function(t,e,n){var r=t.selection.getRng(),o=n.bind(function(n){var o=n.rng,i=n.isStartInTable,u=function(t,e){return P.from(t.dom.getParent(e,t.dom.isBlock)).map(ye.fromDom)}(t,i?o.endContainer:o.startContainer);o.deleteContents(),function(t,e,n){n.each(function(n){e?un(n):(rg(n),t.selection.setCursorLocation(n.dom,0))})}(t,i,u.filter(Wo));var a=i?e[0]:e[e.length-1];return dh(t,a,r,i),Wo(a)?P.none():P.some(i?e.slice(1):e.slice(0,-1))}).getOr(e);return fh(o),mh(t),!0},hh=function(t,e,n,r){var o=t.selection.getRng(),i=e[0],u=n[n.length-1];dh(t,i,o,!0),dh(t,u,o,!1);var a=Wo(i)?e:e.slice(1),c=Wo(u)?n:n.slice(0,-1);return fh(a.concat(c)),r.deleteContents(),mh(t),!0},ph=function(t,e,n,r){void 0===r&&(r=!0),e.deleteContents();var o,i=lh(n).getOr(n),u=ye.fromDom(t.dom.getParent(i.dom,t.dom.isBlock));if(Wo(u)&&(rg(u),r&&t.selection.setCursorLocation(u.dom,0)),!Se(n,u)){var a=Hn(Le(u),n)?[]:Le(o=u).map(Ve).map(function(t){return K(t,function(t){return!Se(o,t)})}).getOr([]);q(a.concat(Ve(n)),function(t){Se(t,u)||Oe(t,u)||!Wo(t)||un(t)})}return!0},vh=function(t,e){return Yg(t,!1,e),!0},bh=function(t,e,n,r){return wh(e,r).fold(function(){return function(t,e,n){return sh(e,n).map(function(e){return e.fold(E(ph,t),E(vh,t),E(gh,t),E(hh,t))})}(t,e,n)},function(e){return function(t,e){return xh(t,e)}(t,e)}).getOr(!1)},yh=function(t,e){return Q(ag(e,t),ao)},wh=function(t,e){return Q(ag(e,t),(n="caption",function(t){return De(t)&&Te(t)===n}));var n},xh=function(t,e){return rg(e),t.selection.setCursorLocation(e.dom,0),P.some(!0)},Ch=function(t,e,n,r,o){return ml(n,t.getBody(),o).bind(function(i){return function(t,e,n,r){return bl(t.dom).bind(function(o){return yl(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 xh(t,e)}(t,r):function(t,e,n){return wh(t,ye.fromDom(n.getNode())).map(function(t){return!1===Se(t,e)})}(e,r,i)}).or(P.some(!0))},Sh=function(t,e,n,r){var o=wc.fromRangeStart(t.selection.getRng());return yh(n,r).bind(function(r){return Wo(r)?xh(t,r):function(t,e,n,r,o){return ml(n,t.getBody(),o).bind(function(t){return yh(e,ye.fromDom(t.getNode())).map(function(t){return!1===Se(t,r)})})}(t,n,e,r,o)}).getOr(!1)},kh=function(t,e){return t?Qm(e):Zm(e)},Oh=function(t,e,n){var r=ye.fromDom(t.getBody());return wh(r,n).fold(function(){return Sh(t,e,r,n)||function(t,e){var n=wc.fromRangeStart(t.selection.getRng());return kh(e,n)||dl(e,t.getBody(),n).exists(function(t){return kh(e,t)})}(t,e)},function(n){return function(t,e,n,r){var o=wc.fromRangeStart(t.selection.getRng());return Wo(r)?xh(t,r):Ch(t,n,e,r,o)}(t,e,r,n).getOr(!1)})},Th=function(t,e){var n=ye.fromDom(t.selection.getStart(!0)),r=yf(t);return t.selection.isCollapsed()&&0===r.length?Oh(t,e,n):function(t,e,n){var r=ye.fromDom(t.getBody()),o=t.selection.getRng();return 0!==n.length?gh(t,n,P.none()):bh(t,r,o,e)}(t,n,r)},_h=function(t){var e=wc.fromRangeStart(t),n=wc.fromRangeEnd(t),r=t.commonAncestorContainer;return dl(!1,r,n).map(function(o){return!Ps(e,n,r)&&Ps(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)},Eh=function(t){return t.collapsed?t:_h(t)},Dh=function(t){return t&&t.firstChild&&t.firstChild===t.lastChild&&function(t){return" "===t.data||Mn(t)}(t.firstChild)},Ah=function(t){return t.length>0&&(!(e=t[t.length-1]).firstChild||Dh(e))?t.slice(0,-1):t;var e},Nh=function(t,e){var n=t.getParent(e,t.isBlock);return n&&"LI"===n.nodeName?n:null},Mh=function(t,e){var n=wc.after(t),r=al(e).prev(n);return r?r.toRange():null},zh=function(t,e,n){var r=t.parentNode;return ve.each(e,function(e){r.insertBefore(e,t)}),function(t,e){var n=wc.before(t),r=al(e).next(n);return r?r.toRange():null}(t,n)},Rh=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),u=Nh(e,n.startContainer),a=Ah((o=i.firstChild,K(o.childNodes,function(t){return"LI"===t.nodeName}))),c=e.getRoot(),s=function(t){var r=wc.fromRangeStart(n),o=al(e.getRoot()),i=1===t?o.prev(r):o.next(r);return!i||Nh(e,i.getNode())!==u};return s(1)?zh(u,a,c):s(2)?function(t,e,n,r){return r.insertAfter(e.reverse(),t),Mh(e[0],n)}(u,a,c,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),ve.each(e,function(e){i.insertBefore(e,t)}),i.insertBefore(o[1],t),i.removeChild(t),Mh(e[e.length-1],n)}(u,a,c,n)},Bh=Ln,Lh=function(t){var e=t.dom,n=Eh(t.selection.getRng());t.selection.setRng(n);var r=e.getParent(n.startContainer,Bh);!function(t,e,n){return null!==n&&n===t.getParent(e.endContainer,Bh)&&Sf(ye.fromDom(n),e)}(e,n,r)?t.getDoc().execCommand("Delete",!1,null):ph(t,n,ye.fromDom(r))},Ph=function(t,e,n){var r,o,i,u=t.selection,a=t.dom;/^ | $/.test(e)&&(e=function(t,e,n){var r=ye.fromDom(t.getRoot());return n=Eg(r,wc.fromRangeStart(e))?n.replace(/^ /," "):n.replace(/^ /," "),n=Dg(r,wc.fromRangeEnd(e))?n.replace(/( | )(<br( \/)>)?$/," "):n.replace(/ (<br( \/)?>)?$/," ")}(a,u.getRng(),e));var c=t.parser,s=n.merge,l=Bm({validate:function(t){return t.getParam("validate")}(t)},t.schema),f='<span id="mce_marker" data-mce-type="bookmark"></span>',d=t.fire("BeforeSetContent",{content:e,format:"html",selection:!0,paste:n.paste});if(d.isDefaultPrevented())t.fire("SetContent",{content:d.content,format:"html",selection:!0,paste:n.paste});else{e=d.content,n.preserve_zwsp||(e=fo(e)),-1===e.indexOf("{$caret}")&&(e+="{$caret}"),e=e.replace(/\{\$caret\}/,f);var m=(o=u.getRng()).startContainer||(o.parentElement?o.parentElement():null),g=t.getBody();m===g&&u.isCollapsed()&&a.isBlock(g.firstChild)&&function(t,e){return e&&!t.schema.getShortEndedElements()[e.nodeName]}(t,g.firstChild)&&a.isEmpty(g.firstChild)&&((o=a.createRng()).setStart(g.firstChild,0),o.setEnd(g.firstChild,0),u.setRng(o)),u.isCollapsed()||Lh(t);var h,p={context:(r=u.getNode()).nodeName.toLowerCase(),data:n.data,insert:!0},v=c.parse(e,p);if(!0===n.paste&&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)||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}(e.firstChild)}(t,e))}(t,r)&&(r=r.prev),!(!n||n!==r||"ul"!==n.name&&"ol"!==n.name)}(t.schema,v)&&function(t,e){return!!Nh(t,e)}(a,r))return o=Rh(l,a,u.getRng(),v),u.setRng(o),void t.fire("SetContent",d);if(function(t){for(var e=t;e=e.walk();)1===e.type&&e.attr("data-mce-fragment","1")}(v),"mce_marker"===(i=v.lastChild).attr("id")){var b=i;for(i=i.prev;i;i=i.walk(!0))if(3===i.type||!a.isBlock(i.name)){t.schema.isValidChild(i.parent.name,"span")&&i.parent.insert(b,i,"br"===i.name);break}}if(t._selectionOverrides.showBlockCaretContainer(r),p.invalid){t.selection.setContent(f),r=u.getNode();var w=t.getBody();for(9===r.nodeType?r=i=w:i=r;i!==w;)r=i,i=i.parentNode;e=r===w?w.innerHTML:a.getOuterHTML(r),e=l.serialize(c.parse(e.replace(/<span (id="mce_marker"|id=mce_marker).+?<\/span>/i,function(){return l.serialize(v)}))),r===w?a.setHTML(w,e):a.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=l.serialize(v),r);!function(t,e){var n=t.schema.getTextInlineElements(),r=t.dom;if(e){var o=t.getBody(),i=Mm(r);ve.each(r.select("*[data-mce-fragment]"),function(t){if(y(n[t.nodeName.toLowerCase()])&&Im(r,t))for(var e=t.parentNode;y(e)&&e!==o&&!Fm(r,t,e);e=e.parentNode)if(i.compare(e,t)){r.remove(t,!0);break}})}}(t,s),function(t,e){var n,r=t.dom,o=t.selection;if(e){o.scrollIntoView(e);var i=Lf(t.getBody(),e);if("false"===r.getContentEditable(i))return r.remove(e),void o.select(i);var u=r.createRng(),a=e.previousSibling;if(En(a)){if(u.setStart(a,a.nodeValue.length),!de.ie){var c=e.nextSibling;En(c)&&(a.appendData(c.data),c.parentNode.removeChild(c))}}else u.setStartBefore(e),u.setEndBefore(e);var s=r.getParent(e,r.isBlock);r.remove(e),s&&r.isEmpty(s)&&(t.$(s).empty(),u.setStart(s,0),u.setEnd(s,0),Bh(s)||function(t){return!!t.getAttribute("data-mce-fragment")}(s)||!(n=function(e){var n=wc.fromRangeStart(e);if(n=al(t.getBody()).next(n))return n.toRange()}(u))?r.add(s,r.create("br",{"data-mce-bogus":"1"})):(u=n,r.remove(s))),o.setRng(u)}}(t,a.get("mce_marker")),h=t.getBody(),ve.each(h.getElementsByTagName("*"),function(t){t.removeAttribute("data-mce-fragment")}),function(t,e){P.from(t.getParent(e,"td,th")).map(ye.fromDom).each(og)}(a,u.getStart()),t.fire("SetContent",d),t.addVisual()}},Hh=function(t,e){e(t),t.firstChild&&Hh(t.firstChild,e),t.next&&Hh(t.next,e)},Ih=function(t,e,n){var r=function(t,e,n){var r={},o={},i=[];for(var u in n.firstChild&&Hh(n.firstChild,function(n){q(t,function(t){t.name===n.name&&(r[t.name]?r[t.name].nodes.push(n):r[t.name]={filter:t,nodes:[n]})}),q(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)wt(r,u)&&i.push(r[u]);for(var a in o)wt(o,a)&&i.push(o[a]);return i}(t,e,n);q(r,function(t){q(t.filter.callbacks,function(e){e(t.nodes,t.filter.name,{})})})},Fh=function(t){return t instanceof hm},Vh=function(t,e,n){t.dom.setHTML(t.getBody(),e),!0!==n&&function(t){nm(t)&&bl(t.getBody()).each(function(e){var n=e.getNode(),r=On(n)?bl(n).getOr(e):e;t.selection.setRng(r.toRange())})}(t)},Uh=function(t,e,n){var r=function(t,e){return At(At({format:"html"},t),{set:!0,content:Fh(e)?"":e})}(n,e),o=n.no_events?r:t.fire("BeforeSetContent",r);return Fh(e)||(e=o.content),P.from(t.getBody()).fold(O(e),function(n){return Fh(e)?function(t,e,n,r){Ih(t.parser.getNodeFilters(),t.parser.getAttributeFilters(),n);var o=Bm({validate:t.validate},t.schema).serialize(n);return r.content=fo(co(ye.fromDom(e))?o:ve.trim(o)),Vh(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=fo(n)).length||/^\s+$/.test(n)){var o='<br data-mce-bogus="1">';"TABLE"===e.nodeName?n="<tr><td>"+o+"</td></tr>":/^(UL|OL)$/.test(e.nodeName)&&(n="<li>"+o+"</li>");var i=Gc(t);i&&t.schema.isValidChild(e.nodeName.toLowerCase(),i.toLowerCase())?(n=o,n=t.dom.createHTML(i,Kc(t),n)):n||(n='<br data-mce-bogus="1">'),Vh(t,n,r.no_selection),t.fire("SetContent",r)}else"raw"!==r.format&&(n=Bm({validate:t.validate},t.schema).serialize(t.parser.parse(n,{isRootContent:!0,insert:!0}))),r.content=co(ye.fromDom(e))?n:ve.trim(n),Vh(t,r.content,r.no_selection),r.no_events||t.fire("SetContent",r);return r.content}(t,n,e,o)})},jh=function(t,e){return function(t,e){var n=t.dom;return n.parentNode?Fr(ye.fromDom(n.parentNode),function(n){return!Se(t,n)&&e(n)}):P.none()}(t,e).isSome()},Wh=function(t){return w(t)?t:M},qh=function(t,e,n){var r=e(t),o=Wh(n);return r.orThunk(function(){return o(t)?P.none():function(t,e,n){for(var r=t.dom,o=Wh(n);r.parentNode;){r=r.parentNode;var i=ye.fromDom(r),u=e(i);if(u.isSome())return u;if(o(i))break}return P.none()}(t,e,o)})},$h=jl,Gh=function(t,e,n){var r=t.formatter.get(n);if(r)for(var o=0;o<r.length;o++){var i=r[o];if(Yl(i)&&!1===i.inherit&&t.dom.is(e,i.selector))return!0}return!1},Kh=function(t,e,n,r,o){var i=t.dom.getRoot();return e!==i&&(e=t.dom.getParent(e,function(e){return!!Gh(t,e,n)||(e.parentNode===i||!!Jh(t,e,n,r,!0))}),!!Jh(t,e,n,r,o))},Xh=function(t,e,n){return!!$h(e,n.inline)||(!!$h(e,n.block)||(n.selector?1===e.nodeType&&t.is(e,n.selector):void 0))},Yh=function(t,e,n,r,o,i){var u=n[r];if(w(n.onmatch))return n.onmatch(e,n,r);if(u)if(v(u.length)){for(var a in u)if(wt(u,a)){var c="attributes"===r?t.getAttrib(e,a):ql(t,e,a),s=Ul(u[a],i),l=b(c)||Wt(c);if(l&&b(s))continue;if(o&&l&&!n.exact)return!1;if((!o||n.exact)&&!$h(c,Wl(t,s,a)))return!1}}else for(var f=0;f<u.length;f++)if("attributes"===r?t.getAttrib(e,u[f]):ql(t,e,u[f]))return!0;return!0},Jh=function(t,e,n,r,o){var i=t.formatter.get(n),u=t.dom;if(i&&e)for(var a=0;a<i.length;a++){var c=i[a];if(Xh(t.dom,e,c)&&Yh(u,e,c,"attributes",o,r)&&Yh(u,e,c,"styles",o,r)){var s=c.classes;if(s)for(var l=0;l<s.length;l++)if(!t.dom.hasClass(e,Ul(s[l],r)))return;return c}}},Qh=function(t,e,n,r,o){if(r)return Kh(t,r,e,n,o);if(r=t.selection.getNode(),Kh(t,r,e,n,o))return!0;var i=t.selection.getStart();return!(i===r||!Kh(t,i,e,n,o))},Zh=function(t,e){var n=function(e){return Se(e,ye.fromDom(t.getBody()))};return P.from(t.selection.getStart(!0)).bind(function(r){return qh(ye.fromDom(r),function(n){return st(e,function(e){return function(e,n){return Jh(t,e.dom,n)?P.some(n):P.none()}(n,e)})},n)}).getOrNull()},tp=function(t,e,n){return Y(n,function(n,r){var o=function(t,e){return j(t.formatter.get(e),function(t){var e=function(t){return t.length>1&&"%"===t.charAt(0)};return j(["styles","attributes"],function(n){return yt(t,n).exists(function(t){var n=g(t)?t:bt(t);return j(n,e)})})})}(t,r);return t.formatter.matchNode(e,r,{},o)?n.concat([r]):n},[])},ep=so,np=function(t){return function(t){for(var e=[];t;){if(3===t.nodeType&&t.nodeValue!==ep||t.childNodes.length>1)return[];1===t.nodeType&&e.push(t),t=t.firstChild}return e}(t).length>0},rp=function(t){if(t){var e=new Jr(t,t);for(t=e.current();t;t=e.next())if(En(t))return t}return null},op=function(t){var e=ye.fromTag("span");return jn(e,{id:"_mce_caret","data-mce-bogus":"1","data-mce-type":"format-caret"}),t&&nn(e,ye.fromText(ep)),e},ip=function(t,e,n){void 0===n&&(n=!0);var r=t.dom,o=t.selection;if(np(e))Yg(t,!1,ye.fromDom(e),n);else{var i=o.getRng(),u=r.getParent(e,r.isBlock),a=i.startContainer,c=i.startOffset,s=i.endContainer,l=i.endOffset,f=function(t){var e=rp(t);return e&&e.nodeValue.charAt(0)===ep&&e.deleteData(0,1),e}(e);r.remove(e,!0),a===f&&c>0&&i.setStart(f,c-1),s===f&&l>0&&i.setEnd(f,l-1),u&&r.isEmpty(u)&&rg(ye.fromDom(u)),o.setRng(i)}},up=function(t,e,n){void 0===n&&(n=!0);var r=t.dom,o=t.selection;if(e)ip(t,e,n);else if(!(e=xl(t.getBody(),o.getStart())))for(;e=r.get("_mce_caret");)ip(t,e,!1)},ap=function(t,e){return t.appendChild(e),e},cp=function(t,e){var n=X(t,function(t,e){return ap(t,e.cloneNode(!1))},e);return ap(n,n.ownerDocument.createTextNode(ep))},sp=function(t,e,n,r){var o,i,u,a=t.dom,c=t.selection,s=[],l=c.getRng(),f=l.startContainer,d=l.startOffset;for(i=f,3===f.nodeType&&(d!==f.nodeValue.length&&(o=!0),i=i.parentNode);i;){if(Jh(t,i,e,n,r)){u=i;break}i.nextSibling&&(o=!0),s.push(i),i=i.parentNode}if(u)if(o){var m=c.getBookmark();l.collapse(!0);var g=gf(t,l,t.formatter.get(e),!0);g=rd(g),t.formatter.remove(e,n,g,r),c.moveToBookmark(m)}else{var h=xl(t.getBody(),u),p=op(!1).dom;!function(t,e,n){var r=t.dom,o=r.getParent(n,E(Il,t));o&&r.isEmpty(o)?n.parentNode.replaceChild(e,n):(ng(ye.fromDom(n)),r.isEmpty(n)?n.parentNode.replaceChild(e,n):r.insertAfter(e,n))}(t,p,null!==h?h:u);var v=function(t,e,n,r,o,i){var u=t.formatter,a=t.dom,c=K(lt(u.get()),function(t){return t!==r&&!Pt(t,"removeformat")}),s=tp(t,n,c);if(K(s,function(e){return!Kl(t,e,r)}).length>0){var l=n.cloneNode(!1);return a.add(e,l),u.remove(r,o,l,i),a.remove(l),P.some(l)}return P.none()}(t,p,u,e,n,r),b=cp(s.concat(v.toArray()),p);ip(t,h,!1),c.setCursorLocation(b,1),a.isEmpty(u)&&a.remove(u)}},lp=function(t){t.on("mouseup keydown",function(e){!function(t,e){var n=t.selection,r=t.getBody();up(t,null,!1),8!==e&&46!==e||!n.isCollapsed()||n.getStart().innerHTML!==ep||up(t,xl(r,n.getStart())),37!==e&&39!==e||up(t,xl(r,n.getStart()))}(t,e.keyCode)})},fp=function(t,e){var n=t.schema.getTextInlineElements();return wt(n,Te(e))&&!wl(e.dom)&&!kn(e.dom)},dp={},mp=Ot,gp=St;!function(t,e){dp[t]||(dp[t]=[]),dp[t].push(e)}("pre",function(t){var e,n=t.selection.getRng(),r=xn(["pre"]);n.collapsed||(e=t.selection.getSelectedBlocks(),gp(mp(mp(e,r),function(t){return r(t.previousSibling)&&-1!==Tt(e,t.previousSibling)}),function(t){var e,n;e=t.previousSibling,ea(n=t).remove(),ea(e).append("<br><br>").append(n.childNodes)}))});var hp=ve.each,pp=function(t){return wn(t)&&!Ml(t)&&!wl(t)&&!kn(t)},vp=function(t,e){for(var n=t;n;n=n[e]){if(En(n)&&jt(n.data))return t;if(wn(n)&&!Ml(n))return n}return t},bp=function(t,e,n){var r=Mm(t);if(e&&n&&(e=vp(e,"previousSibling"),n=vp(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),ve.each(ve.grep(n.childNodes),function(t){e.appendChild(t)}),e}return n},yp=function(t,e,n,r){if(r&&!1!==e.merge_siblings){var o=bp(t,Hl(r),r);bp(t,o,Hl(o,!0))}},wp=function(t,e,n){hp(t.childNodes,function(t){pp(t)&&(e(t)&&n(t),t.hasChildNodes()&&wp(t,e,n))})},xp=function(t,e){return function(n){return!(!n||!ql(t,n,e))}},Cp=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)}},Sp=hr([{keep:[]},{rename:["name"]},{removed:[]}]),kp=/^(src|href|style)$/,Op=ve.each,Tp=jl,_p=function(t,e,n){return t.isChildOf(e,n)&&e!==n&&!t.isBlock(n)},Ep=function(t,e,n){var r=e[n?"startContainer":"endContainer"],o=e[n?"startOffset":"endOffset"];if(wn(r)){var i=r.childNodes.length-1;!n&&o&&o--,r=r.childNodes[o>i?i:o]}return En(r)&&n&&o>=r.nodeValue.length&&(r=new Jr(r,t.getBody()).next()||r),En(r)&&!n&&0===o&&(r=new Jr(r,t.getBody()).prev()||r),r},Dp=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},Ap=function(t,e,n,r){var o=t.create(n,r);return e.parentNode.insertBefore(o,e),o.appendChild(e),o},Np=function(t,e,n,r,o){var i=ye.fromDom(e),u=ye.fromDom(t.create(r,o)),a=n?Fe(i):Ie(i);return rn(u,a),n?(Ze(i,u),en(u,i)):(tn(i,u),nn(u,i)),u.dom},Mp=function(t,e,n,r){var o=Hl(e,n,r);return b(o)||"BR"===o.nodeName||t.isBlock(o)},zp=function(t,e,n){var r,o=e.parentNode,i=t.dom,u=Gc(t);Xl(n)&&(u?o===i.getRoot()&&(n.list_block&&Tp(e,n.list_block)||q(ct(e.childNodes),function(e){Fl(t,u,e.nodeName.toLowerCase())?r?r.appendChild(e):(r=Ap(i,e,u),i.setAttribs(r,t.settings.forced_root_block_attrs)):r=null})):i.isBlock(e)&&!i.isBlock(o)&&(Mp(i,e,!1)||Mp(i,e.firstChild,!0,!0)||e.insertBefore(i.create("br"),e.firstChild),Mp(i,e,!0)||Mp(i,e.lastChild,!1,!0)||e.appendChild(i.create("br")))),function(t){return Yl(t)&&Jl(t)&&Hn(yt(t,"mixed"),!0)}(n)&&!Tp(n.inline,e)||i.remove(e,!0)},Rp=function(t,e,n,r,o){var i,u=t.dom;if(!function(t,e,n){return!(!Jl(n)||!Tp(e,n.inline))||!(!Xl(n)||!Tp(e,n.block))||(Yl(n)?wn(e)&&t.is(e,n.selector):void 0)}(u,r,e)&&!function(t,e){return e.links&&"A"===t.nodeName}(r,e))return Sp.keep();var a=r;if(Jl(e)&&"all"===e.remove&&g(e.preserve_attributes)){var c=K(u.getAttribs(a),function(t){return U(e.preserve_attributes,t.name.toLowerCase())});if(u.removeAllAttribs(a),q(c,function(t){return u.setAttrib(a,t.name,t.value)}),c.length>0)return Sp.rename("span")}if("all"!==e.remove){Op(e.styles,function(t,r){t=Wl(u,Ul(t,n),r+""),x(r)&&(r=t,o=null),(e.remove_similar||!o||Tp(ql(u,o,r),t))&&u.setStyle(a,r,""),i=!0}),i&&""===u.getAttrib(a,"style")&&(a.removeAttribute("style"),a.removeAttribute("data-mce-style")),Op(e.attributes,function(t,r){var i;if(t=Ul(t,n),x(r)&&(r=t,o=null),e.remove_similar||!o||Tp(u.getAttrib(o,r),t)){if("class"===r&&(t=u.getAttrib(a,r))&&(i="",q(t.split(/\s+/),function(t){/mce\-\w+/.test(t)&&(i+=(i?" ":"")+t)}),i))return void u.setAttrib(a,r,i);if(kp.test(r)&&a.removeAttribute("data-mce-"+r),"style"===r&&xn(["li"])(a)&&"none"===u.getStyle(a,"list-style-type"))return a.removeAttribute(r),void u.setStyle(a,"list-style-type","none");"class"===r&&a.removeAttribute("className"),a.removeAttribute(r)}}),Op(e.classes,function(t){t=Ul(t,n),o&&!u.hasClass(o,t)||u.removeClass(a,t)});for(var s=u.getAttribs(a),l=0;l<s.length;l++){var f=s[l].nodeName;if(0!==f.indexOf("_")&&0!==f.indexOf("data-"))return Sp.keep()}}return"none"!==e.remove?(zp(t,a,e),Sp.removed()):Sp.keep()},Bp=function(t,e,n,r,o){return Rp(t,e,n,r,o).fold(M,function(e){return t.dom.rename(r,e),!0},z)},Lp=function(t,e,n,r){return Rp(t,e,n,r,r).fold(O(r),function(e){return t.dom.createFragment().appendChild(r),t.dom.rename(r,e)},O(null))},Pp=function(t,e,n,r,o){var i=t.formatter.get(e),u=i[0],a=!0,c=t.dom,s=t.selection,l=function(r){var a=function(t,e,n,r,o){var i;return q(Gl(t.dom,e.parentNode).reverse(),function(e){if(!i&&"_start"!==e.id&&"_end"!==e.id){var u=Jh(t,e,n,r,o);u&&!1!==u.split&&(i=e)}}),i}(t,r,e,n,o);return function(t,e,n,r,o,i,u,a){var c,s,l,f=t.dom;if(n){for(var d=n.parentNode,m=r.parentNode;m&&m!==d;m=m.parentNode){c=f.clone(m,!1);for(var g=0;g<e.length&&null!==(c=Lp(t,e[g],a,c));g++);c&&(s&&c.appendChild(s),l||(l=c),s=c)}!i||u.mixed&&f.isBlock(n)||(r=f.split(n,r)),s&&(o.parentNode.insertBefore(s,o),l.appendChild(o),Jl(u)&&yp(f,u,0,s))}return r}(t,i,a,r,r,!0,u,n)},f=function(e){return j(i,function(r){return Bp(t,r,n,e,e)})},d=function(e){var n=!0,r=!1;wn(e)&&c.getContentEditable(e)&&(n=a,a="true"===c.getContentEditable(e),r=!0);var o=ct(e.childNodes);if(a&&!r){var s=f(e)||j(i,function(t){return Xh(c,e,t)}),l=e.parentNode;!s&&y(l)&&Ql(u)&&f(l)}if(u.deep&&o.length){for(var m=0;m<o.length;m++)d(o[m]);r&&(a=n)}q(["underline","line-through","overline"],function(n){wn(e)&&t.dom.getStyle(e,"text-decoration")===n&&e.parentNode&&$l(c,e.parentNode)===n&&Bp(t,{deep:!1,exact:!0,inline:"span",styles:{textDecoration:n}},null,e)})},m=function(t){var e=c.get(t?"_start":"_end"),n=e[t?"firstChild":"lastChild"];return function(t){return Ml(t)&&wn(t)&&("_start"===t.id||"_end"===t.id)}(n)&&(n=n[t?"firstChild":"lastChild"]),En(n)&&0===n.data.length&&(n=t?e.previousSibling||e.nextSibling:e.nextSibling||e.previousSibling),c.remove(e,!0),n},g=function(e){var n,r,o=gf(t,e,i,e.collapsed);if(u.split){if(o=rd(o),(n=Ep(t,o,!0))!==(r=Ep(t,o))){if(n=Dp(n,!0),r=Dp(r,!1),_p(c,n,r)){var a=P.from(n.firstChild).getOr(n);return l(Np(c,a,!0,"span",{id:"_start","data-mce-type":"bookmark"})),void m(!0)}if(_p(c,r,n)){a=P.from(r.lastChild).getOr(r);return l(Np(c,a,!1,"span",{id:"_end","data-mce-type":"bookmark"})),void m(!1)}n=Ap(c,n,"span",{id:"_start","data-mce-type":"bookmark"}),r=Ap(c,r,"span",{id:"_end","data-mce-type":"bookmark"});var s=c.createRng();s.setStartAfter(n),s.setEndBefore(r),hf(c,s,function(t){q(t,function(t){Ml(t)||Ml(t.parentNode)||l(t)})}),l(n),l(r),n=m(!0),r=m()}else n=r=l(n);o.startContainer=n.parentNode?n.parentNode:n,o.startOffset=c.nodeIndex(n),o.endContainer=r.parentNode?r.parentNode:r,o.endOffset=c.nodeIndex(r)+1}hf(c,o,function(t){q(t,d)})};if(r){if(Ll(r)){var h=c.createRng();h.setStartBefore(r),h.setEndAfter(r),g(h)}else g(r);Ff(t,e,r,n)}else if("false"!==c.getContentEditable(s.getNode()))s.isCollapsed()&&Jl(u)&&!yf(t).length?sp(t,e,n,o):(_f(s,!0,function(){Tf(t,g)}),Jl(u)&&Qh(t,e,n,s.getStart())&&Pl(c,s,s.getRng()),t.nodeChanged()),Ff(t,e,r,n);else{r=s.getNode();for(var p=0;p<i.length&&(!i[p].ceFalseOverride||!Bp(t,i[p],n,r,r));p++);Ff(t,e,r,n)}},Hp=ve.each,Ip=function(t,e,n,r){Hp(e,function(e){Jl(e)&&Hp(t.dom.select(e.inline,r),function(r){pp(r)&&Bp(t,e,n,r,e.exact?r:null)}),function(t,e,n){if(e.clear_child_styles){var r=e.links?"*:not(a)":"*";hp(t.select(r,n),function(n){pp(n)&&hp(e.styles,function(e,r){t.setStyle(n,r,"")})})}}(t.dom,e,r)})},Fp=ve.each,Vp=function(t){return wn(t)&&!Ml(t)&&!wl(t)&&!kn(t)},Up=function(t,e,n,r){var o=t.formatter.get(e),i=o[0],u=!r&&t.selection.isCollapsed(),a=t.dom,c=t.selection,s=function(t,e){if(void 0===e&&(e=i),w(e.onformat)&&e.onformat(t,e,n,r),Fp(e.styles,function(e,r){a.setStyle(t,r,Ul(e,n))}),e.styles){var o=a.getAttrib(t,"style");o&&a.setAttrib(t,"data-mce-style",o)}Fp(e.attributes,function(e,r){a.setAttrib(t,r,Ul(e,n))}),Fp(e.classes,function(e){e=Ul(e,n),a.hasClass(t,e)||a.addClass(t,e)})},l=function(t,e){var n=!1;return Fp(t,function(t){return!!Yl(t)&&(y(t.collapsed)&&t.collapsed!==u?void 0:a.is(e,t.selector)&&!wl(e)?(s(e,t),n=!0,!1):void 0)}),n},f=function(t){if(d(t)){var e=a.create(t);return s(e),e}return null},m=function(r,u,a){var c=[],d=!0,m=i.inline||i.block,g=f(m);hf(r,u,function(u){var f,h=function(u){var p=!1,v=d,b=u.nodeName.toLowerCase(),w=u.parentNode,x=w.nodeName.toLowerCase();if(wn(u)&&r.getContentEditable(u)&&(v=d,d="true"===r.getContentEditable(u),p=!0),Mn(u)&&!function(t,e,n,r){if(function(t){return t.getParam("format_empty_lines",!1,"boolean")}(t)&&Jl(e)){var o=bi(t.schema),i=jh(ye.fromDom(n),function(t){return wl(t.dom)});return xt(o,r)&&Wo(ye.fromDom(n.parentNode),!1)&&!i}return!1}(t,i,u,x))return f=null,void(Xl(i)&&r.remove(u));if(Xl(i)&&i.wrapper&&Jh(t,u,e,n))f=null;else{if(d&&!p&&Xl(i)&&!i.wrapper&&Il(t,b)&&Fl(t,x,m)){var C=r.rename(u,m);return s(C),c.push(C),void(f=null)}if(Yl(i)){var S=l(o,u);if(!S&&y(w)&&Ql(i)&&(S=l(o,w)),!Jl(i)||S)return void(f=null)}!d||p||!Fl(t,m,b)||!Fl(t,x,m)||!a&&En(u)&&lo(u.data)||wl(u)||Jl(i)&&r.isBlock(u)?(f=null,q(ct(u.childNodes),h),p&&(d=v),f=null):(f||(f=r.clone(g,!1),u.parentNode.insertBefore(f,u),c.push(f)),f.appendChild(u))}};q(u,h)}),!0===i.links&&q(c,function(t){var e=function(t){"A"===t.nodeName&&s(t,i),q(ct(t.childNodes),e)};e(t)}),q(c,function(u){var a=function(t){var e=0;return q(t.childNodes,function(t){(function(t){return y(t)&&En(t)&&0===t.length})(t)||Ml(t)||e++}),e}(u);!(c.length>1)&&r.isBlock(u)||0!==a?(Jl(i)||Xl(i)&&i.wrapper)&&(i.exact||1!==a||(u=function(t){return Q(t.childNodes,Vp).filter(function(t){return Xh(r,t,i)}).map(function(e){var n=r.clone(e,!1);return s(n),r.replace(n,t,!0),r.remove(e,!0),n}).getOr(t)}(u)),Ip(t,o,n,u),function(t,e,n,r,o){Jh(t,o.parentNode,n,r)&&Bp(t,e,r,o)||e.merge_with_parents&&t.dom.getParent(o.parentNode,function(i){if(Jh(t,i,n,r))return Bp(t,e,r,o),!0})}(t,i,e,n,u),function(t,e,n,r){e.styles&&e.styles.backgroundColor&&wp(r,xp(t,"fontSize"),Cp(t,"backgroundColor",Ul(e.styles.backgroundColor,n)))}(r,i,n,u),function(t,e,n,r){var o=function(e){if(1===e.nodeType&&e.parentNode&&1===e.parentNode.nodeType){var n=$l(t,e.parentNode);t.getStyle(e,"color")&&n?t.setStyle(e,"text-decoration",n):t.getStyle(e,"text-decoration")===n&&t.setStyle(e,"text-decoration",null)}};e.styles&&(e.styles.color||e.styles.textDecoration)&&(ve.walk(r,o,"childNodes"),o(r))}(r,i,0,u),function(t,e,n,r){!Jl(e)||"sub"!==e.inline&&"sup"!==e.inline||(wp(r,xp(t,"fontSize"),Cp(t,"fontSize","")),t.remove(t.select("sup"===e.inline?"sub":"sup",r),!0))}(r,i,0,u),yp(r,i,0,u)):r.remove(u,!0)})};if("false"!==a.getContentEditable(c.getNode())){if(i){if(r)if(Ll(r)){if(!l(o,r)){var g=a.createRng();g.setStartBefore(r),g.setEndAfter(r),m(a,gf(t,g,o),!0)}}else m(a,r,!0);else if(u&&Jl(i)&&!yf(t).length)!function(t,e,n){var r,o,i=t.selection,u=i.getRng(),a=u.startOffset,c=u.startContainer.nodeValue;(r=xl(t.getBody(),i.getStart()))&&(o=rp(r));var s,l,f=/[^\s\u00a0\u00ad\u200b\ufeff]/;if(c&&a>0&&a<c.length&&f.test(c.charAt(a))&&f.test(c.charAt(a-1))){var d=i.getBookmark();u.collapse(!0);var m=gf(t,u,t.formatter.get(e));m=rd(m),t.formatter.apply(e,n,m),i.moveToBookmark(d)}else r&&o.nodeValue===ep?t.formatter.apply(e,n,r):(s=t.getDoc(),l=op(!0).dom,o=(r=s.importNode(l,!0)).firstChild,u.insertNode(r),a=1,t.formatter.apply(e,n,r)),i.setCursorLocation(o,a)}(t,e,n);else{var h=c.getNode(),p=o[0];t.settings.forced_root_block||!p.defaultBlock||a.getParent(h,a.isBlock)||Up(t,p.defaultBlock),c.setRng(Eh(c.getRng())),_f(c,!0,function(){Tf(t,function(e,n){var r=n?e:gf(t,e,o);m(a,r,!1)})}),Pl(a,c,c.getRng()),t.nodeChanged()}!function(t,e){gp(dp[t],function(t){t(e)})}(e,t)}If(t,e,r,n)}else{r=c.getNode();for(var v=0,b=o.length;v<b;v++){var x=o[v];if(x.ceFalseOverride&&Yl(x)&&a.is(r,x.selector)){s(r,x);break}}If(t,e,r,n)}},jp=function(t){return wt(t,"vars")},Wp=function(t){return t.selection.getStart()},qp=function(t,e,n,r,o){return J(e,function(e){var i=t.formatter.matchNode(e,n,null!==o&&void 0!==o?o:{},r);return!v(i)},function(e){return!!Gh(t,e,n)||!r&&y(t.formatter.matchNode(e,n,o,!0))})},$p=function(t,e){var n=null!==e&&void 0!==e?e:Wp(t);return K(Gl(t.dom,n),function(t){return wn(t)&&!kn(t)})},Gp=function(t,e,n){var r=$p(t,e);dt(n,function(n,o){var i=function(n){var i=qp(t,r,o,n.similar,jp(n)?n.vars:void 0),u=i.isSome();if(n.state.get()!==u){n.state.set(u);var a=i.getOr(e);jp(n)?n.callback(u,{node:a,format:o,parents:r}):q(n.callbacks,function(t){return t(u,{node:a,format:o,parents:r})})}};q([n.withSimilar,n.withoutSimilar],i),q(n.withVars,i)})},Kp=function(t,e,n,r,o,i){return null===e.get()&&function(t,e){t.set({}),e.on("NodeChange",function(n){Gp(e,n.element,t.get())}),e.on("FormatApply FormatRemove",function(n){var r=P.from(n.node).map(function(t){return Ll(t)?t:t.startContainer}).bind(function(t){return wn(t)?P.some(t):P.from(t.parentElement)}).getOrThunk(function(){return Wp(e)});Gp(e,r,t.get())})}(e,t),function(t,e,n,r,o,i){var u=e.get();q(n.split(","),function(e){var n=yt(u,e).getOrThunk(function(){var t={withSimilar:{state:ma(!1),similar:!0,callbacks:[]},withoutSimilar:{state:ma(!1),similar:!1,callbacks:[]},withVars:[]};return u[e]=t,t}),a=function(){var n=$p(t);return qp(t,n,e,o,i).isSome()};if(v(i)){var c=o?n.withSimilar:n.withoutSimilar;c.callbacks.push(r),1===c.callbacks.length&&c.state.set(a())}else n.withVars.push({state:ma(a()),similar:o,vars:i,callback:r})}),e.set(u)}(t,e,n,r,o,i),{unbind:function(){return function(t,e,n){var r=t.get();q(e.split(","),function(t){return yt(r,t).each(function(e){r[t]={withSimilar:At(At({},e.withSimilar),{callbacks:K(e.withSimilar.callbacks,function(t){return t!==n})}),withoutSimilar:At(At({},e.withoutSimilar),{callbacks:K(e.withoutSimilar.callbacks,function(t){return t!==n})}),withVars:K(e.withVars,function(t){return t.callback!==n})}})}),t.set(r)}(e,n,r)}}},Xp=function(t,e){var n=(e||document).createDocumentFragment();return q(t,function(t){n.appendChild(t.dom)}),ye.fromDom(n)},Yp=function(t,e,n){return{element:t,width:e,rows:n}},Jp=function(t,e){return{element:t,cells:e}},Qp=function(t,e){return{x:t,y:e}},Zp=function(t,e){var n=parseInt(Wn(t,e),10);return isNaN(n)?1:n},tv=function(t,e,n){var r=t.rows;return!!(r[n]?r[n].cells:[])[e]},ev=function(t){return Y(t,function(t,e){return e.cells.length>t?e.cells.length:t},0)},nv=function(t,e){for(var n=t.rows,r=0;r<n.length;r++)for(var o=n[r].cells,i=0;i<o.length;i++)if(Se(o[i],e))return P.some(Qp(i,r));return P.none()},rv=function(t,e,n,r,o){for(var i=[],u=t.rows,a=n;a<=o;a++){var c=u[a].cells,s=e<r?c.slice(e,r+1):c.slice(r,e+1);i.push(Jp(u[a].element,s))}return i},ov=function(t){var e=Yp(Ua(t),0,[]);return q(Aa(t,"tr"),function(t,n){q(Aa(t,"td,th"),function(r,o){!function(t,e,n,r,o){for(var i=Zp(o,"rowspan"),u=Zp(o,"colspan"),a=t.rows,c=n;c<n+i;c++){a[c]||(a[c]=Jp(ja(r),[]));for(var s=e;s<e+u;s++)a[c].cells[s]=c===n&&s===e?o:Ua(o)}}(e,function(t,e,n){for(;tv(t,e,n);)e++;return e}(e,o,n),n,t,r)})}),Yp(e.element,ev(e.rows),e.rows)},iv=function(t){return function(t,e){var n=Ua(t.element),r=ye.fromTag("tbody");return rn(r,e),nn(n,r),n}(t,function(t){return W(t.rows,function(t){var e=W(t.cells,function(t){var e=ja(t);return Gn(e,"colspan"),Gn(e,"rowspan"),e}),n=Ua(t.element);return rn(n,e),n})}(t))},uv=function(t,e,n){return nv(t,e).bind(function(e){return nv(t,n).map(function(n){return function(t,e,n){var r=e.x,o=e.y,i=n.x,u=n.y,a=o<u?rv(t,r,o,i,u):rv(t,r,u,i,o);return Yp(t.element,ev(a),a)}(t,e,n)})})},av=function(t,e){return Q(t,function(t){return"li"===Te(t)&&Sf(t,e)}).fold(O([]),function(e){return function(t){return Q(t,function(t){return"ul"===Te(t)||"ol"===Te(t)})}(t).map(function(t){var e=ye.fromTag(Te(t)),n=vt(Qn(t),function(t,e){return Ht(e,"list-style")});return Kn(e,n),[ye.fromTag("li"),e]}).getOr([])})},cv=function(t,e){var n=ye.fromDom(e.commonAncestorContainer),r=ag(n,t),o=K(r,function(t){return eo(t)||Zr(t)}),i=av(r,e),u=o.concat(i.length?i:function(t){return io(t)?Le(t).filter(oo).fold(O([]),function(e){return[t,e]}):oo(t)?[t]:[]}(n));return W(u,Ua)},sv=function(){return Xp([])},lv=function(t,e){return n=ye.fromDom(e.cloneContents()),r=cv(t,e),o=Y(r,function(t,e){return nn(e,t),e},n),r.length>0?Xp([o]):o;var n,r,o},fv=function(t,e){return(n=t,r=e[0],Vr(r,"table",E(Se,n))).bind(function(t){var n=e[0],r=e[e.length-1],o=ov(t);return uv(o,n,r).map(function(t){return Xp([iv(t)])})}).getOrThunk(sv);var n,r},dv=function(t,e){var n=bf(e,t);return n.length>0?fv(t,n):function(t,e){return e.length>0&&e[0].collapsed?sv():lv(t,e[0])}(t,e)},mv=function(t,e){return e>=0&&e<t.length&&Rl(t.charAt(e))},gv=function(t,e){var n=fo(t.innerText);return e?function(t){return t.replace(/^[ \f\n\r\t\v]+/,"")}(n):n},hv=function(t,e,n){void 0===n&&(n={});var r=function(t,e){return At(At({},t),{format:e,get:!0,selection:!0})}(n,e),o=t.fire("BeforeGetContent",r);if(o.isDefaultPrevented())return t.fire("GetContent",o),o.content;if("text"===o.format)return function(t){return P.from(t.selection.getRng()).map(function(e){var n=P.from(t.dom.getParent(e.commonAncestorContainer,t.dom.isBlock)),r=t.getBody(),o=function(t){return t.map(function(t){return t.nodeName}).getOr("div").toLowerCase()}(n),i=de.browser.isIE()&&"pre"!==o,u=t.dom.add(r,o,{"data-mce-bogus":"all",style:"overflow: hidden; opacity: 0;"},e.cloneContents()),a=gv(u,i),c=fo(u.textContent);if(t.dom.remove(u),mv(c,0)||mv(c,c.length-1)){var s=n.getOr(r),l=gv(s,i),f=l.indexOf(a);if(-1===f)return a;var d=mv(l,f-1),m=mv(l,f+a.length);return(d?" ":"")+a+(m?" ":"")}return a}).getOr("")}(t);o.getInner=!0;var i=function(t,e){var n=t.selection.getRng(),r=t.dom.create("body"),o=t.selection.getSel(),i=lm(t,pf(o)),u=e.contextual?dv(ye.fromDom(t.getBody()),i).dom:n.cloneContents();return u&&r.appendChild(u),t.selection.serializer.serialize(r,e)}(t,o);return"tree"===o.format?i:(o.content=t.selection.isCollapsed()?"":i,t.fire("GetContent",o),o.content)},pv=function(t){return wn(t)?t.outerHTML:En(t)?ci.encodeRaw(t.data,!1):Dn(t)?"\x3c!--"+t.data+"--\x3e":""},vv=function(t,e,n){var r=function(t){var e,n=document.createElement("div"),r=document.createDocumentFragment();for(t&&(n.innerHTML=t);e=n.firstChild;)r.appendChild(e);return r}(e);if(t.hasChildNodes()&&n<t.childNodes.length){var o=t.childNodes[n];o.parentNode.insertBefore(r,o)}else t.appendChild(r)},bv=function(t,e){var n,r,o,i,u,a,c,s,l,f=W(ct(e.childNodes),pv);return function(t,e){var n=0;q(t,function(t){0===t[0]?n++:1===t[0]?(vv(e,t[1],n),n++):2===t[0]&&function(t,e){if(t.hasChildNodes()&&e<t.childNodes.length){var n=t.childNodes[e];n.parentNode.removeChild(n)}}(e,n)})}((r=t,o=(n=f).length+r.length+2,i=new Array(o),u=new Array(o),a=function(t,e,o,i,u){var c=s(t,e,o,i);if(null===c||c.start===e&&c.diag===e-i||c.end===t&&c.diag===t-o)for(var l=t,f=o;l<e||f<i;)l<e&&f<i&&n[l]===r[f]?(u.push([0,n[l]]),++l,++f):e-t>i-o?(u.push([2,n[l]]),++l):(u.push([1,r[f]]),++f);else{a(t,c.start,o,c.start-c.diag,u);for(var d=c.start;d<c.end;++d)u.push([0,n[d]]);a(c.end,e,c.end-c.diag,i,u)}},c=function(t,e,o,i){for(var u=t;u-e<i&&u<o&&n[u]===r[u-e];)++u;return function(t,e,n){return{start:t,end:e,diag:n}}(t,u,e)},s=function(t,e,o,a){var s=e-t,l=a-o;if(0===s||0===l)return null;var f,d,m,g,h,p=s-l,v=l+s,b=(v%2==0?v:v+1)/2;for(i[1+b]=t,u[1+b]=e+1,f=0;f<=b;++f){for(d=-f;d<=f;d+=2){for(m=d+b,d===-f||d!==f&&i[m-1]<i[m+1]?i[m]=i[m+1]:i[m]=i[m-1]+1,h=(g=i[m])-t+o-d;g<e&&h<a&&n[g]===r[h];)i[m]=++g,++h;if(p%2!=0&&p-f<=d&&d<=p+f&&u[m-p]<=i[m])return c(u[m-p],d+t-o,e,a)}for(d=p-f;d<=p+f;d+=2){for(m=d+b-p,d===p-f||d!==p+f&&u[m+1]<=u[m-1]?u[m]=u[m+1]-1:u[m]=u[m-1],h=(g=u[m]-1)-t+o-d;g>=t&&h>=o&&n[g]===r[h];)u[m]=g--,h--;if(p%2==0&&-f<=d&&d<=f&&u[m]<=i[m+p])return c(u[m],d+t-o,e,a)}}},l=[],a(0,n.length,0,r.length,l),l),e),e},yv=Mt(function(){return document.implementation.createHTMLDocument("undo")}),wv=function(t){var e,n=t.serializer.getTempAttrs(),r=Dm(t.getBody(),n);return function(t){return null!==t.querySelector("iframe")}(r)?(e=!0,{type:"fragmented",fragments:K(W(ct(r.childNodes),e?S(fo,pv):pv),function(t){return t.length>0}),content:"",bookmark:null,beforeBookmark:null}):{type:"complete",fragments:null,content:fo(r.innerHTML),bookmark:null,beforeBookmark:null}},xv=function(t,e,n){var r=n?e.beforeBookmark:e.bookmark;"fragmented"===e.type?bv(e.fragments,t.getBody()):t.setContent(e.content,{format:"raw",no_selection:!y(r)||!Cl(r)||!r.isFakeCaret}),t.selection.moveToBookmark(r)},Cv=function(t){return"fragmented"===t.type?t.fragments.join(""):t.content},Sv=function(t){var e=ye.fromTag("body",yv());return Fa(e,Cv(t)),q(Aa(e,"*[data-mce-bogus]"),an),e.dom.innerHTML},kv=function(t,e){return!(!t||!e)&&(!!function(t,e){return Cv(t)===Cv(e)}(t,e)||function(t,e){return Sv(t)===Sv(e)}(t,e))},Ov=function(t){return 0===t.get()},Tv=function(t,e,n){Ov(n)&&(t.typing=e)},_v=function(t,e){t.typing&&(Tv(t,!1,e),t.add())},Ev=function(t){return{undoManager:{beforeChange:function(e,n){return function(t,e,n){Ov(e)&&n.set(jc(t.selection))}(t,e,n)},add:function(e,n,r,o,i,u){return function(t,e,n,r,o,i,u){var a=wv(t);if(i=i||{},i=ve.extend(i,a),!1===Ov(r)||t.removed)return null;var c=e.data[n.get()];if(t.fire("BeforeAddUndo",{level:i,lastLevel:c,originalEvent:u}).isDefaultPrevented())return null;if(c&&kv(c,i))return null;e.data[n.get()]&&o.get().each(function(t){e.data[n.get()].beforeBookmark=t});var s=function(t){return t.getParam("custom_undo_redo_levels",0,"number")}(t);if(s&&e.data.length>s){for(var l=0;l<e.data.length-1;l++)e.data[l]=e.data[l+1];e.data.length--,n.set(e.data.length)}i.bookmark=jc(t.selection),n.get()<e.data.length-1&&(e.data.length=n.get()+1),e.data.push(i),n.set(e.data.length-1);var f={level:i,lastLevel:c,originalEvent:u};return n.get()>0?(t.setDirty(!0),t.fire("AddUndo",f),t.fire("change",f)):t.fire("AddUndo",f),i}(t,e,n,r,o,i,u)},undo:function(e,n,r){return function(t,e,n,r){var o;return e.typing&&(e.add(),e.typing=!1,Tv(e,!1,n)),r.get()>0&&(r.set(r.get()-1),o=e.data[r.get()],xv(t,o,!0),t.setDirty(!0),t.fire("Undo",{level:o})),o}(t,e,n,r)},redo:function(e,n){return function(t,e,n){var r;return e.get()<n.length-1&&(e.set(e.get()+1),r=n[e.get()],xv(t,r,!1),t.setDirty(!0),t.fire("Redo",{level:r})),r}(t,e,n)},clear:function(e,n){return function(t,e,n){e.data=[],n.set(0),e.typing=!1,t.fire("ClearUndos")}(t,e,n)},reset:function(t){return function(t){t.clear(),t.add()}(t)},hasUndo:function(e,n){return function(t,e,n){return n.get()>0||e.typing&&e.data[0]&&!kv(wv(t),e.data[0])}(t,e,n)},hasRedo:function(t,e){return function(t,e){return e.get()<t.data.length-1&&!t.typing}(t,e)},transact:function(t,e,n){return function(t,e,n){return _v(t,e),t.beforeChange(),t.ignore(n),t.add()}(t,e,n)},ignore:function(t,e){return function(t,e){try{t.set(t.get()+1),e()}finally{t.set(t.get()-1)}}(t,e)},extra:function(e,n,r,o){return function(t,e,n,r,o){if(e.transact(r)){var i=e.data[n.get()].bookmark,u=e.data[n.get()-1];xv(t,u,!0),e.transact(o)&&(e.data[n.get()-1].beforeBookmark=i)}}(t,e,n,r,o)}},formatter:{match:function(e,n,r,o){return Qh(t,e,n,r,o)},matchAll:function(e,n){return function(t,e,n){var r=[],o={},i=t.selection.getStart();return t.dom.getParent(i,function(i){for(var u=0;u<e.length;u++){var a=e[u];!o[a]&&Jh(t,i,a,n)&&(o[a]=!0,r.push(a))}},t.dom.getRoot()),r}(t,e,n)},matchNode:function(e,n,r,o){return Jh(t,e,n,r,o)},canApply:function(e){return function(t,e){var n=t.formatter.get(e),r=t.dom;if(n)for(var o=t.selection.getStart(),i=Gl(r,o),u=n.length-1;u>=0;u--){var a=n[u];if(!Yl(a)||y(a.defaultBlock))return!0;for(var c=i.length-1;c>=0;c--)if(r.is(i[c],a.selector))return!0}return!1}(t,e)},closest:function(e){return Zh(t,e)},apply:function(e,n,r){return Up(t,e,n,r)},remove:function(e,n,r,o){return Pp(t,e,n,r,o)},toggle:function(e,n,r){return function(t,e,n,r){var o=t.formatter.get(e);!Qh(t,e,n,r)||"toggle"in o[0]&&!o[0].toggle?Up(t,e,n,r):Pp(t,e,n,r)}(t,e,n,r)},formatChanged:function(e,n,r,o,i){return Kp(t,e,n,r,o,i)}},editor:{getContent:function(e,n){return function(t,e,n){return P.from(t.getBody()).fold(O("tree"===e.format?new hm("body",11):""),function(r){return Am(t,e,n,r)})}(t,e,n)},setContent:function(e,n){return Uh(t,e,n)},insertContent:function(e,n){return Ph(t,e,n)},addVisual:function(e){return function(t,e){var n=t.dom,r=y(e)?e:t.getBody();v(t.hasVisual)&&(t.hasVisual=function(t){return t.getParam("visual",!0,"boolean")}(t)),q(n.select("table,a",r),function(e){switch(e.nodeName){case"TABLE":var r=function(t){return t.getParam("visual_table_class","mce-item-table","string")}(t),o=n.getAttrib(e,"border");o&&"0"!==o||!t.hasVisual?n.removeClass(e,r):n.addClass(e,r);break;case"A":if(!n.getAttrib(e,"href")){var i=n.getAttrib(e,"name")||e.id,u=function(t){return t.getParam("visual_anchor_class","mce-item-anchor","string")}(t);i&&t.hasVisual?n.addClass(e,u):n.removeClass(e,u)}}}),t.fire("VisualAid",{element:e,hasVisual:t.hasVisual})}(t,e)}},selection:{getContent:function(e,n){return hv(t,e,n)}},raw:{getModel:function(){return P.none()}}}},Dv=function(t){return wt(t.plugins,"rtc")},Av=function(t){var e=t;return function(t){return yt(t.plugins,"rtc").bind(function(t){return P.from(t.setup)})}(t).fold(function(){return e.rtcInstance=Ev(t),P.none()},function(t){var n,r;return e.rtcInstance=(n=O(null),r=O(""),{undoManager:{beforeChange:C,add:n,undo:n,redo:n,clear:C,reset:C,hasUndo:M,hasRedo:M,transact:n,ignore:C,extra:C},formatter:{match:M,matchAll:O([]),matchNode:O(void 0),canApply:M,closest:r,apply:C,remove:C,toggle:C,formatChanged:O({unbind:C})},editor:{getContent:r,setContent:r,insertContent:C,addVisual:C},selection:{getContent:r},raw:{getModel:O(P.none())}}),P.some(function(){return t().then(function(t){return e.rtcInstance=function(t){var e=function(t){return m(t)?t:{}},n=t.undoManager,r=t.formatter,o=t.editor,i=t.selection,u=t.raw;return{undoManager:{beforeChange:n.beforeChange,add:n.add,undo:n.undo,redo:n.redo,clear:n.clear,reset:n.reset,hasUndo:n.hasUndo,hasRedo:n.hasRedo,transact:function(t,e,r){return n.transact(r)},ignore:function(t,e){return n.ignore(e)},extra:function(t,e,r,o){return n.extra(r,o)}},formatter:{match:function(t,n,o,i){return r.match(t,e(n),i)},matchAll:r.matchAll,matchNode:r.matchNode,canApply:function(t){return r.canApply(t)},closest:function(t){return r.closest(t)},apply:function(t,n,o){return r.apply(t,e(n))},remove:function(t,n,o,i){return r.remove(t,e(n))},toggle:function(t,n,o){return r.toggle(t,e(n))},formatChanged:function(t,e,n,o,i){return r.formatChanged(e,n,o,i)}},editor:{getContent:function(t,e){return o.getContent(t)},setContent:function(t,e){return o.setContent(t,e)},insertContent:function(t,e){return o.insertContent(t)},addVisual:o.addVisual},selection:{getContent:function(t,e){return i.getContent(e)}},raw:{getModel:function(){return P.some(u.getRawModel())}}}}(t),t.rtc.isRemote})})})},Nv=function(t){return t.rtcInstance?t.rtcInstance:Ev(t)},Mv=function(t){var e=t.rtcInstance;if(e)return e;throw new Error("Failed to get RTC instance not yet initialized.")},zv=function(t,e){return void 0===e&&(e={}),function(t,e,n){return Mv(t).selection.getContent(e,n)}(t,e.format?e.format:"html",e)},Rv=function(t){return 0===t.dom.length?(un(t),P.none()):P.some(t)},Bv=function(t,e,n,r){t.bind(function(t){return(r?Hg:Pg)(t.dom,r?t.dom.length:0),e.filter(Ae).map(function(e){return function(t,e,n,r){var o=t.dom,i=e.dom,u=r?o.length:i.length;r?(Ig(o,i,!1,!r),n.setStart(i,u)):(Ig(i,o,!1,!r),n.setEnd(i,u))}(t,e,n,r)})}).orThunk(function(){return function(t,e){return t.filter(function(t){return Bf.isBookmarkNode(t.dom)}).bind(e?He:Pe)}(e,r).or(e).filter(Ae).map(function(t){return function(t,e){Le(t).each(function(n){var r=t.dom;e&&Eg(n,wc(r,0))?Pg(r,0):!e&&Dg(n,wc(r,r.length))&&Hg(r,r.length)})}(t,r)})})},Lv=function(t,e,n){void 0===n&&(n={});var r=function(t,e){return At(At({format:"html"},t),{set:!0,selection:!0,content:e})}(n,e),o=r;if(!r.no_events){var i=t.fire("BeforeSetContent",r);if(i.isDefaultPrevented())return void t.fire("SetContent",i);o=i}o.content=function(t,e){if("raw"!==e.format){var n=t.selection.getRng(),r=t.dom.getParent(n.commonAncestorContainer,t.dom.isBlock),o=r?{context:r.nodeName.toLowerCase()}:{},i=t.parser.parse(e.content,At(At({isRootContent:!0,forced_root_block:!1},o),e));return Bm({validate:t.validate},t.schema).serialize(i)}return e.content}(t,o);var u=t.selection.getRng();!function(t,e){var n=P.from(e.firstChild).map(ye.fromDom),r=P.from(e.lastChild).map(ye.fromDom);t.deleteContents(),t.insertNode(e);var o=n.bind(Pe).filter(Ae).bind(Rv),i=r.bind(He).filter(Ae).bind(Rv);Bv(o,n,t,!0),Bv(i,r,t,!1),t.collapse(!1)}(u,u.createContextualFragment(o.content)),t.selection.setRng(u),Td(t,u),o.no_events||t.fire("SetContent",o)},Pv=function(t,e,n){if(t&&wt(t,e)){var r=K(t[e],function(t){return t!==n});0===r.length?delete t[e]:t[e]=r}};var Hv=function(t){return!!t.select},Iv=function(t){return!(!t||!t.ownerDocument)&&Oe(ye.fromDom(t.ownerDocument),ye.fromDom(t))},Fv=function(t,e,n,r){var o,i,u=function(t,e){var n,r,o=function(e,n){return Q(n,function(n){return t.is(n,e)})},i=function(e){return t.getParents(e,null,t.getRoot())};return{selectorChangedWithUnbind:function(t,u){return n||(n={},r={},e.on("NodeChange",function(t){var e=t.element,u=i(e),a={};ve.each(n,function(t,e){o(e,u).each(function(n){r[e]||(q(t,function(t){t(!0,{node:n,selector:e,parents:u})}),r[e]=t),a[e]=t})}),ve.each(r,function(t,n){a[n]||(delete r[n],ve.each(t,function(t){t(!1,{node:e,selector:n,parents:u})}))})})),n[t]||(n[t]=[]),n[t].push(u),o(t,i(e.selection.getStart())).each(function(){r[t]=n[t]}),{unbind:function(){Pv(n,t,u),Pv(r,t,u)}}}}}(t,r).selectorChangedWithUnbind,a=function(t,e){return Lv(r,t,e)},c=function(t){var e=l();e.collapse(!!t),f(e)},s=function(){return e.getSelection?e.getSelection():e.document.selection},l=function(){var n,u,a,c=function(t,e,n){try{return e.compareBoundaryPoints(t,n)}catch(t){return-1}},l=e.document;if(void 0!==r.bookmark&&!1===nm(r)){var f=Wd(r);if(f.isSome())return f.map(function(t){return lm(r,[t])[0]}).getOr(l.createRange())}try{(n=s())&&!yn(n.anchorNode)&&(u=n.rangeCount>0?n.getRangeAt(0):n.createRange?n.createRange():l.createRange(),u=lm(r,[u])[0])}catch(t){}return u||(u=l.createRange?l.createRange():l.body.createTextRange()),u.setStart&&9===u.startContainer.nodeType&&u.collapsed&&(a=t.getRoot(),u.setStart(a,0),u.setEnd(a,0)),o&&i&&(0===c(u.START_TO_START,u,o)&&0===c(u.END_TO_END,u,o)?u=i:(o=null,i=null)),u},f=function(t,e){var n;if(function(t){return!!t&&(!!Hv(t)||Iv(t.startContainer)&&Iv(t.endContainer))}(t)){var u=Hv(t)?t:null;if(u){i=null;try{u.select()}catch(t){}}else{var a=s();if(t=r.fire("SetSelectionRange",{range:t,forward:e}).range,a){i=t;try{a.removeAllRanges(),a.addRange(t)}catch(t){}!1===e&&a.extend&&(a.collapse(t.endContainer,t.endOffset),a.extend(t.startContainer,t.startOffset)),o=a.rangeCount>0?a.getRangeAt(0):null}t.collapsed||t.startContainer!==t.endContainer||!a.setBaseAndExtent||de.ie||t.endOffset-t.startOffset<2&&t.startContainer.hasChildNodes()&&(n=t.startContainer.childNodes[t.startOffset])&&"IMG"===n.tagName&&(a.setBaseAndExtent(t.startContainer,t.startOffset,t.endContainer,t.endOffset),a.anchorNode===t.startContainer&&a.focusNode===t.endContainer||a.setBaseAndExtent(n,0,n,1)),r.fire("AfterSetSelectionRange",{range:t,forward:e})}}},d=function(){var e=s(),n=null===e||void 0===e?void 0:e.anchorNode,r=null===e||void 0===e?void 0:e.focusNode;if(!e||!n||!r||yn(n)||yn(r))return!0;var o=t.createRng();o.setStart(n,e.anchorOffset),o.collapse(!0);var i=t.createRng();return i.setStart(r,e.focusOffset),i.collapse(!0),o.compareBoundaryPoints(o.START_TO_START,i)<=0},m={bookmarkManager:null,controlSelection:null,dom:t,win:e,serializer:n,editor:r,collapse:c,setCursorLocation:function(e,n){var o=t.createRng();y(e)&&y(n)?(o.setStart(e,n),o.setEnd(e,n),f(o),c(!1)):(kf(t,o,r.getBody(),!0),f(o))},getContent:function(t){return zv(r,t)},setContent:a,getBookmark:function(t,e){return g.getBookmark(t,e)},moveToBookmark:function(t){return g.moveToBookmark(t)},select:function(e,n){return function(t,e,n){return P.from(e).map(function(e){var r=t.nodeIndex(e),o=t.createRng();return o.setStart(e.parentNode,r),o.setEnd(e.parentNode,r+1),n&&(kf(t,o,e,!0),kf(t,o,e,!1)),o})}(t,e,n).each(f),e},isCollapsed:function(){var t=l(),e=s();return!(!t||t.item)&&(t.compareEndPoints?0===t.compareEndPoints("StartToEnd",t):!e||t.collapsed)},isForward:d,setNode:function(e){return a(t.getOuterHTML(e)),e},getNode:function(){return function(t,e){var n,r,o;if(!e)return t;r=e.startContainer,o=e.endContainer;var i=e.startOffset,u=e.endOffset;return n=e.commonAncestorContainer,!e.collapsed&&(r===o&&u-i<2&&r.hasChildNodes()&&(n=r.childNodes[i]),3===r.nodeType&&3===o.nodeType&&(r=r.length===i?sm(r.nextSibling,!0):r.parentNode,o=0===u?sm(o.previousSibling,!1):o.parentNode,r&&r===o))?r:n&&3===n.nodeType?n.parentNode:n}(r.getBody(),l())},getSel:s,setRng:f,getRng:l,getStart:function(t){return am(r.getBody(),l(),t)},getEnd:function(t){return cm(r.getBody(),l(),t)},getSelectedBlocks:function(e,n){return function(t,e,n,r){var o,i=[],u=t.getRoot();if(n=t.getParent(n||am(u,e,e.collapsed),t.isBlock),r=t.getParent(r||cm(u,e,e.collapsed),t.isBlock),n&&n!==u&&i.push(n),n&&r&&n!==r){o=n;for(var a=new Jr(n,u);(o=a.next())&&o!==r;)t.isBlock(o)&&i.push(o)}return r&&n!==r&&r!==u&&i.push(r),i}(t,l(),e,n)},normalize:function(){var e=l(),n=s();if(!(pf(n).length>1)&&Of(r)){var o=ed(t,e);return o.each(function(t){f(t,d())}),o.getOr(e)}return e},selectorChanged:function(t,e){return u(t,e),m},selectorChangedWithUnbind:u,getScrollContainer:function(){for(var e,n=t.getRoot();n&&"BODY"!==n.nodeName;){if(n.scrollHeight>n.clientHeight){e=n;break}n=n.parentNode}return e},scrollIntoView:function(t,e){y(t)?function(t,e,n){(t.inline?Sd:Od)(t,e,n)}(r,t,e):Td(r,l(),e)},placeCaretAt:function(t,e){return f(qf(t,e,r.getDoc()))},getBoundingClientRect:function(){var t=l();return t.collapsed?wc.fromRangeStart(t).getClientRects()[0]:t.getBoundingClientRect()},destroy:function(){e=o=i=null,h.destroy()}},g=Bf(m),h=jf(m,r);return m.bookmarkManager=g,m.controlSelection=h,m},Vv=function(t,e,n){t.addNodeFilter("font",function(t){q(t,function(t){var r=e.parse(t.attr("style")),o=t.attr("color"),i=t.attr("face"),u=t.attr("size");o&&(r.color=o),i&&(r["font-family"]=i),u&&(r["font-size"]=n[parseInt(t.attr("size"),10)-1]),t.name="span",t.attr("style",e.serialize(r)),function(t,e){q(e,function(e){t.attr(e,null)})}(t,["color","face","size"])})})},Uv=function(t,e){var n=Ci();e.convert_fonts_to_spans&&Vv(t,n,ve.explode(e.font_size_legacy_values)),function(t,e){t.addNodeFilter("strike",function(t){q(t,function(t){var n=e.parse(t.attr("style"));n["text-decoration"]="line-through",t.name="span",t.attr("style",e.serialize(n))})})}(t,n)},jv=function(t){var e,n=decodeURIComponent(t).split(","),r=/data:([^;]+)/.exec(n[0]);return r&&(e=r[1]),{type:e,data:n[1]}},Wv=function(t,e){var n;try{n=atob(e)}catch(t){return P.none()}for(var r=new Uint8Array(n.length),o=0;o<r.length;o++)r[o]=n.charCodeAt(o);return P.some(new Blob([r],{type:t}))},qv=function(t){return 0===t.indexOf("blob:")?function(t){return new Wr(function(e,n){var r=function(){n("Cannot convert "+t+" to Blob. Resource might not exist or is inaccessible.")};try{var o=new XMLHttpRequest;o.open("GET",t,!0),o.responseType="blob",o.onload=function(){200===o.status?e(o.response):r()},o.onerror=r,o.send()}catch(t){r()}})}(t):0===t.indexOf("data:")?(e=t,new Wr(function(t){var n=jv(e),r=n.type,o=n.data;Wv(r,o).fold(function(){return t(new Blob([]))},t)})):null;var e},$v=0,Gv=function(t){return(t||"blobid")+$v++},Kv=function(t,e,n,r){var o,i;if(0!==e.src.indexOf("blob:")){var u=jv(e.src),a=u.data,c=u.type;o=a,(i=t.getByData(o,c))?n({image:e,blobInfo:i}):qv(e.src).then(function(r){i=t.create(Gv(),r,o),t.add(i),n({image:e,blobInfo:i})},function(t){r(t)})}else(i=t.getByUri(e.src))?n({image:e,blobInfo:i}):qv(e.src).then(function(r){(function(t){return new Wr(function(e){var n=new FileReader;n.onloadend=function(){e(n.result)},n.readAsDataURL(t)})})(r).then(function(u){o=jv(u).data,i=t.create(Gv(),r,o),t.add(i),n({image:e,blobInfo:i})})},function(t){r(t)})},Xv=function(t,e){var n={};return{findAll:function(r,o){o||(o=z);var i=K(function(t){return t?ct(t.getElementsByTagName("img")):[]}(r),function(e){var n=e.src;return!!de.fileApi&&!e.hasAttribute("data-mce-bogus")&&!e.hasAttribute("data-mce-placeholder")&&!(!n||n===de.transparentSrc)&&(0===n.indexOf("blob:")?!t.isUploaded(n)&&o(e):0===n.indexOf("data:")&&o(e))}),u=W(i,function(t){if(void 0!==n[t.src])return new Wr(function(e){n[t.src].then(function(n){if("string"==typeof n)return n;e({image:t,blobInfo:n.blobInfo})})});var r=new Wr(function(n,r){Kv(e,t,n,r)}).then(function(t){return delete n[t.image.src],t}).catch(function(e){return delete n[t.src],e});return n[t.src]=r,r});return Wr.all(u)}}},Yv=function(t,e){return t.replace(e.re,function(t){return yt(e.uris,t).getOr(t)})},Jv=function(t,e,n,r){(t.padd_empty_with_br||e.insert)&&n[r.name]?r.empty().append(new hm("br",1)).shortEnded=!0:r.empty().append(new hm("#text",3)).value=" "},Qv=function(t,e){return t&&t.firstChild&&t.firstChild===t.lastChild&&t.firstChild.name===e},Zv=function(t,e,n,r){return r.isEmpty(e,n,function(e){return function(t,e){var n=t.getElementRule(e.name);return n&&n.paddEmpty}(t,e)})},tb=function(t,e){var n=e.blob_cache,r=function(t){var r,o,i=t.attr("src");(function(t){return t.attr("src")===de.transparentSrc||y(t.attr("data-mce-placeholder"))})(t)||function(t){return y(t.attr("data-mce-bogus"))}(t)||(r=i,o=/data:([^;]+);base64,([a-z0-9\+\/=\s]+)/i.exec(r),o?P.some({type:o[1],data:decodeURIComponent(o[2])}):P.none()).filter(function(){return function(t,e){if(e.images_dataimg_filter){var n=new Image;return n.src=t.attr("src"),dt(t.attributes.map,function(t,e){n.setAttribute(e,t)}),e.images_dataimg_filter(n)}return!0}(t,e)}).bind(function(t){var e=t.type,r=t.data;return P.from(n.getByData(r,e)).orThunk(function(){return Wv(e,r).map(function(t){var e=n.create(Gv(),t,r);return n.add(e),e})})}).each(function(e){t.attr("src",e.blobUri())})};n&&t.addAttributeFilter("src",function(t){return q(t,r)})},eb=ve.each,nb=ve.trim,rb="source protocol authority userInfo user password host port relative path directory file query anchor".split(" "),ob={ftp:21,http:80,https:443,mailto:25},ib=["img","video"],ub=function(t,e,n){return!t.allow_html_data_urls&&(/^data:image\//i.test(e)?function(t,e){return y(t)?!t:!y(e)||!U(ib,e)}(t.allow_svg_data_urls,n)&&/^data:image\/svg\+xml/i.test(e):/^data:/i.test(e))},ab=function(){function t(e,n){e=nb(e),this.settings=n||{};var r=this.settings.base_uri,o=this;if(/^([\w\-]+):([^\/]{2})/i.test(e)||/^\s*#/.test(e))o.source=e;else{var i=0===e.indexOf("//");if(0!==e.indexOf("/")||i||(e=(r&&r.protocol||"http")+"://mce_host"+e),!/^[\w\-]*:?\/\//.test(e)){var u=this.settings.base_uri?this.settings.base_uri.path:new t(document.location.href).directory;if(this.settings.base_uri&&""==this.settings.base_uri.protocol)e="//mce_host"+o.toAbsPath(u,e);else{var a=/([^#?]*)([#?]?.*)/.exec(e);e=(r&&r.protocol||"http")+"://mce_host"+o.toAbsPath(u,a[1])+a[2]}}e=e.replace(/@@/g,"(mce_at)");var c=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?(\[[a-zA-Z0-9:.%]+\]|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e);eb(rb,function(t,e){var n=c[e];n&&(n=n.replace(/\(mce_at\)/g,"@@")),o[t]=n}),r&&(o.protocol||(o.protocol=r.protocol),o.userInfo||(o.userInfo=r.userInfo),o.port||"mce_host"!==o.host||(o.port=r.port),o.host&&"mce_host"!==o.host||(o.host=r.host),o.source=""),i&&(o.protocol="")}}return t.parseDataUri=function(t){var e,n=decodeURIComponent(t).split(","),r=/data:([^;]+)/.exec(n[0]);return r&&(e=r[1]),{type:e,data:n[1]}},t.isDomSafe=function(t,e,n){if(void 0===n&&(n={}),n.allow_script_urls)return!0;var r=ci.decode(t).replace(/[\s\u0000-\u001F]+/g,"");try{r=decodeURIComponent(r)}catch(t){r=unescape(r)}return!/((java|vb)script|mhtml):/i.test(r)&&!ub(n,r,e)},t.getDocumentBaseUrl=function(t){var e;return e=0!==t.protocol.indexOf("http")&&"file:"!==t.protocol?t.href:t.protocol+"//"+t.host+t.pathname,/^[^:]+:\/\/\/?[^\/]+\//.test(e)&&(e=e.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(e)||(e+="/")),e},t.prototype.setPath=function(t){var e=/^(.*?)\/?(\w+)?$/.exec(t);this.path=e[0],this.directory=e[1],this.file=e[2],this.source="",this.getURI()},t.prototype.toRelative=function(e){var n;if("./"===e)return e;var r=new t(e,{base_uri:this});if("mce_host"!==r.host&&this.host!==r.host&&r.host||this.port!==r.port||this.protocol!==r.protocol&&""!==r.protocol)return r.getURI();var o=this.getURI(),i=r.getURI();return o===i||"/"===o.charAt(o.length-1)&&o.substr(0,o.length-1)===i?o:(n=this.toRelPath(this.path,r.path),r.query&&(n+="?"+r.query),r.anchor&&(n+="#"+r.anchor),n)},t.prototype.toAbsolute=function(e,n){var r=new t(e,{base_uri:this});return r.getURI(n&&this.isSameOrigin(r))},t.prototype.isSameOrigin=function(t){if(this.host==t.host&&this.protocol==t.protocol){if(this.port==t.port)return!0;var e=ob[this.protocol];if(e&&(this.port||e)==(t.port||e))return!0}return!1},t.prototype.toRelPath=function(t,e){var n,r,o=0,i="",u=t.substring(0,t.lastIndexOf("/")).split("/"),a=e.split("/");if(u.length>=a.length)for(n=0,r=u.length;n<r;n++)if(n>=a.length||u[n]!==a[n]){o=n+1;break}if(u.length<a.length)for(n=0,r=a.length;n<r;n++)if(n>=u.length||u[n]!==a[n]){o=n+1;break}if(1===o)return e;for(n=0,r=u.length-(o-1);n<r;n++)i+="../";for(n=o-1,r=a.length;n<r;n++)i+=n!==o-1?"/"+a[n]:a[n];return i},t.prototype.toAbsPath=function(t,e){var n,r,o=0,i=[],u=/\/$/.test(e)?"/":"",a=t.split("/"),c=e.split("/");for(eb(a,function(t){t&&i.push(t)}),a=i,n=c.length-1,i=[];n>=0;n--)0!==c[n].length&&"."!==c[n]&&(".."!==c[n]?o>0?o--:i.push(c[n]):o++);return 0!==(r=(n=a.length-o)<=0?nt(i).join("/"):a.slice(0,n).join("/")+"/"+nt(i).join("/")).indexOf("/")&&(r="/"+r),u&&r.lastIndexOf("/")!==r.length-1&&(r+=u),r},t.prototype.getURI=function(t){var e;return void 0===t&&(t=!1),this.source&&!t||(e="",t||(this.protocol?e+=this.protocol+"://":e+="//",this.userInfo&&(e+=this.userInfo+"@"),this.host&&(e+=this.host),this.port&&(e+=":"+this.port)),this.path&&(e+=this.path),this.query&&(e+="?"+this.query),this.anchor&&(e+="#"+this.anchor),this.source=e),this.source},t}(),cb=ve.makeMap("button,fieldset,form,iframe,img,image,input,object,output,select,textarea"),sb=Mt(function(){return document.implementation.createHTMLDocument("parser")}),lb=function(t,e,n){for(var r=/<([!?\/])?([A-Za-z0-9\-_:.]+)/g,o=/(?:\s(?:[^'">]+(?:"[^"]*"|'[^']*'))*[^"'>]*(?:"[^">]*|'[^'>]*)?|\s*|\/)>/g,i=t.getShortEndedElements(),u=1,a=n;0!==u;)for(r.lastIndex=a;;){var c=r.exec(e);if(null===c)return a;if("!"===c[1]){a=Ht(c[2],"--")?fb(e,!1,c.index+"!--".length):fb(e,!0,c.index+1);break}o.lastIndex=r.lastIndex;var s=o.exec(e);if(!h(s)&&s.index===r.lastIndex){"/"===c[1]?u-=1:wt(i,c[2])||(u+=1),a=r.lastIndex+s[0].length;break}}return a},fb=function(t,e,n){void 0===n&&(n=0);var r=t.toLowerCase();if(-1!==r.indexOf("[if ",n)&&function(t,e){return/^\s*\[if [\w\W]+\]>.*<!\[endif\](--!?)?>/.test(t.substr(e))}(r,n)){var o=r.indexOf("[endif]",n);return r.indexOf(">",o)}if(e){var i=r.indexOf(">",n);return-1!==i?i:r.length}var u=/--!?>/g;u.lastIndex=n;var a=u.exec(t);return a?a.index+a[0].length:r.length},db=function(t,e){var n=t.exec(e);if(n){var r=n[1],o=n[2];return"string"==typeof r&&"data-mce-bogus"===r.toLowerCase()?o:null}return null},mb=function(t,e){void 0===e&&(e=wi()),t=t||{};var n=sb(),r=n.createElement("form");!1!==t.fix_self_closing&&(t.fix_self_closing=!0);var o=t.comment?t.comment:C,i=t.cdata?t.cdata:C,u=t.text?t.text:C,a=t.start?t.start:C,c=t.end?t.end:C,s=t.pi?t.pi:C,l=t.doctype?t.doctype:C,f=function(f,d){void 0===d&&(d="html");for(var m,g,h,p,v,b,y,w,x,C,S,k,O,T,_,E,D,A,N,M=f.html,z=0,R=[],B=0,L=ci.decode,P=ve.makeMap("src,href,data,background,action,formaction,poster,xlink:href"),H="html"===d?0:1,I=function(t){var e,n;for(e=R.length;e--&&R[e].name!==t;);if(e>=0){for(n=R.length-1;n>=e;n--)(t=R[n]).valid&&c(t.name);R.length=e}},F=function(t,e){return u(Yv(t,f),e)},V=function(e){""!==e&&(">"===e.charAt(0)&&(e=" "+e),t.allow_conditional_comments||"[if"!==e.substr(0,3).toLowerCase()||(e=" "+e),o(Yv(e,f)))},U=function(t,e){var n=t||"",r=!Ht(n,"--"),o=fb(M,r,e);return t=M.substr(e,o-e),V(r?n+t:t),o+1},j=function(e,o,i,u,a){if(i=function(t){return Yv(t,f)}((o=o.toLowerCase())in K?o:L(i||u||a||"")),X&&!w&&!1===function(t){return 0===t.indexOf("data-")||0===t.indexOf("aria-")}(o)){var c=T[o];if(!c&&_){for(var s=_.length;s--&&!(c=_[s]).pattern.test(o););-1===s&&(c=null)}if(!c)return;if(c.validValues&&!(i in c.validValues))return}("name"===o||"id"===o)&&e in cb&&(i in n||i in r)||P[o]&&!ab.isDomSafe(i,e,t)||w&&(o in P||0===o.indexOf("on"))||(p.map[o]=i,p.push({name:o,value:i}))},W=new RegExp("<(?:(?:!--([\\w\\W]*?)--!?>)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:![Dd][Oo][Cc][Tt][Yy][Pp][Ee]([\\w\\W]*?)>)|(?:!(--)?)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)>)|(?:([A-Za-z][A-Za-z0-9\\-_:.]*)(\\s(?:[^'\">]+(?:\"[^\"]*\"|'[^']*'))*[^\"'>]*(?:\"[^\">]*|'[^'>]*)?|\\s*|\\/)>))","g"),q=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g,$=e.getShortEndedElements(),G=t.self_closing_elements||e.getSelfClosingElements(),K=e.getBoolAttrs(),X=t.validate,Y=t.remove_internals,J=t.fix_self_closing,Q=e.getSpecialElements(),Z=M+">";m=W.exec(Z);){var tt=m[0];if(z<m.index&&F(L(M.substr(z,m.index-z))),g=m[7])":"===(g=g.toLowerCase()).charAt(0)&&(g=g.substr(1)),I(g);else if(g=m[8]){if(m.index+tt.length>M.length){F(L(M.substr(m.index))),z=m.index+tt.length;continue}":"===(g=g.toLowerCase()).charAt(0)&&(g=g.substr(1)),x=g in $,J&&G[g]&&R.length>0&&R[R.length-1].name===g&&I(g);var et=db(q,m[9]);if(null!==et){if("all"===et){z=lb(e,M,W.lastIndex),W.lastIndex=z;continue}S=!1}if(!X||(C=e.getElementRule(g))){if(S=!0,X&&(T=C.attributes,_=C.attributePatterns),(O=m[9])?((w=-1!==O.indexOf("data-mce-type"))&&Y&&(S=!1),(p=[]).map={},O.replace(q,function(t,e,n,r,o){return j(g,e,n,r,o),""})):(p=[]).map={},X&&!w){if(E=C.attributesRequired,D=C.attributesDefault,A=C.attributesForced,C.removeEmptyAttrs&&!p.length&&(S=!1),A)for(v=A.length;v--;)y=(k=A[v]).name,"{$uid}"===(N=k.value)&&(N="mce_"+B++),p.map[y]=N,p.push({name:y,value:N});if(D)for(v=D.length;v--;)(y=(k=D[v]).name)in p.map||("{$uid}"===(N=k.value)&&(N="mce_"+B++),p.map[y]=N,p.push({name:y,value:N}));if(E){for(v=E.length;v--&&!(E[v]in p.map););-1===v&&(S=!1)}if(k=p.map["data-mce-bogus"]){if("all"===k){z=lb(e,M,W.lastIndex),W.lastIndex=z;continue}S=!1}}S&&a(g,p,x)}else S=!1;if(h=Q[g]){h.lastIndex=z=m.index+tt.length,(m=h.exec(M))?(S&&(b=M.substr(z,m.index-z)),z=m.index+m[0].length):(b=M.substr(z),z=M.length),S&&(b.length>0&&F(b,!0),c(g)),W.lastIndex=z;continue}x||(O&&O.indexOf("/")===O.length-1?S&&c(g):R.push({name:g,valid:S}))}else if(g=m[1])V(g);else if(g=m[2]){if(!(1===H||t.preserve_cdata||R.length>0&&e.isValidChild(R[R.length-1].name,"#cdata"))){z=U("",m.index+2),W.lastIndex=z;continue}i(g)}else if(g=m[3])l(g);else{if((g=m[4])||"<!"===tt){z=U(g,m.index+tt.length),W.lastIndex=z;continue}if(g=m[5]){if(1!==H){z=U("?",m.index+2),W.lastIndex=z;continue}s(g,m[6])}}z=m.index+tt.length}for(z<M.length&&F(L(M.substr(z))),v=R.length-1;v>=0;v--)(g=R[v]).valid&&c(g.name)};return{parse:function(t,e){void 0===e&&(e="html"),f(function(t){for(var e,n=/data:[^;<"'\s]+;base64,([a-z0-9\+\/=\s]+)/gi,r=[],o={},i=Ia("img"),u=0,a=0;e=n.exec(t);){var c=e[0],s=i+"_"+a++;o[s]=c,u<e.index&&r.push(t.substr(u,e.index-u)),r.push(s),u=e.index+c.length}var l=new RegExp(i+"_[0-9]+","g");return 0===u?{prefix:i,uris:o,html:t,re:l}:(u<t.length&&r.push(t.substr(u)),{prefix:i,uris:o,html:r.join(""),re:l})}(t),e)}}};mb.findEndTag=lb;var gb,hb,pb=ve.makeMap,vb=ve.each,bb=ve.explode,yb=ve.extend,wb=function(t,e){void 0===e&&(e=wi());var n={},r=[],o={},i={};(t=t||{}).validate=!("validate"in t)||t.validate,t.root_name=t.root_name||"body";var u=function(t){var e=t.name;e in n&&((a=o[e])?a.push(t):o[e]=[t]);for(var u=r.length;u--;){var a,c=r[u].name;if(c in t.attributes.map)(a=i[c])?a.push(t):i[c]=[t]}return t},a={schema:e,addAttributeFilter:function(t,e){vb(bb(t),function(t){var n;for(n=0;n<r.length;n++)if(r[n].name===t)return void r[n].callbacks.push(e);r.push({name:t,callbacks:[e]})})},getAttributeFilters:function(){return[].concat(r)},addNodeFilter:function(t,e){vb(bb(t),function(t){var r=n[t];r||(n[t]=r=[]),r.push(e)})},getNodeFilters:function(){var t=[];for(var e in n)wt(n,e)&&t.push({name:e,callbacks:n[e]});return t},filterNode:u,parse:function(a,c){var s,l,f,d,m,g,h,p,v=[];c=c||{},o={},i={};var b=yb(pb("script,style,head,html,body,title,meta,param"),e.getBlockElements()),w=bi(e),x=e.getNonEmptyElements(),C=e.children,S=t.validate,k=function(t){return!1===t?"":!0===t?"p":t}("forced_root_block"in c?c.forced_root_block:t.forced_root_block),O=e.getWhiteSpaceElements(),T=/^[ \t\r\n]+/,_=/[ \t\r\n]+$/,E=/[ \t\r\n]+/g,D=/^[ \t\r\n]+$/,A=wt(O,c.context)||wt(O,t.root_name),N=function(t,e){var r,i=new hm(t,e);return t in n&&((r=o[t])?r.push(i):o[t]=[i]),i},M=function(t){for(var n=e.getBlockElements(),r=t.prev;r&&3===r.type;){var o=r.value.replace(_,"");if(o.length>0)return void(r.value=o);var i=r.next;if(i){if(3===i.type&&i.value.length){r=r.prev;continue}if(!n[i.name]&&"script"!==i.name&&"style"!==i.name){r=r.prev;continue}}var u=r.prev;r.remove(),r=u}},z=mb({validate:S,document:t.document,allow_html_data_urls:t.allow_html_data_urls,allow_svg_data_urls:t.allow_svg_data_urls,allow_script_urls:t.allow_script_urls,allow_conditional_comments:t.allow_conditional_comments,preserve_cdata:t.preserve_cdata,self_closing_elements:function(t){var e={};for(var n in t)"li"!==n&&"p"!==n&&(e[n]=t[n]);return e}(e.getSelfClosingElements()),cdata:function(t){p.append(N("#cdata",4)).value=t},text:function(t,e){var n;A||(t=t.replace(E," "),function(t,e){return t&&(wt(e,t.name)||"br"===t.name)}(p.lastChild,b)&&(t=t.replace(T,""))),0!==t.length&&((n=N("#text",3)).raw=!!e,p.append(n).value=t)},comment:function(t){p.append(N("#comment",8)).value=t},pi:function(t,e){p.append(N(t,7)).value=e,M(p)},doctype:function(t){p.append(N("#doctype",10)).value=t,M(p)},start:function(t,n,o){var u=S?e.getElementRule(t):{};if(u){var a=N(u.outputName||t,1);a.attributes=n,a.shortEnded=o,p.append(a);var c=C[p.name];c&&C[a.name]&&!c[a.name]&&v.push(a);for(var s=r.length;s--;){var l=r[s].name;l in n.map&&((g=i[l])?g.push(a):i[l]=[a])}b[t]&&M(a),o||(p=a),!A&&O[t]&&(A=!0)}},end:function(n){var r,o,i,u=S?e.getElementRule(n):{};if(u){if(b[n]&&!A){if((r=p.firstChild)&&3===r.type)if((o=r.value.replace(T,"")).length>0)r.value=o,r=r.next;else for(i=r.next,r.remove(),r=i;r&&3===r.type;)o=r.value,i=r.next,(0===o.length||D.test(o))&&(r.remove(),r=i),r=i;if((r=p.lastChild)&&3===r.type)if((o=r.value.replace(_,"")).length>0)r.value=o,r=r.prev;else for(i=r.prev,r.remove(),r=i;r&&3===r.type;)o=r.value,i=r.prev,(0===o.length||D.test(o))&&(r.remove(),r=i),r=i}A&&O[n]&&(A=!1);var a=Zv(e,x,O,p),s=p.parent;u.paddInEmptyBlock&&a&&function(t){for(var n=t;y(n);){if(n.name in w)return Zv(e,x,O,n);n=n.parent}return!1}(p)?Jv(t,c,b,p):u.removeEmpty&&a?b[p.name]?p.empty().remove():p.unwrap():u.paddEmpty&&(function(t){return Qv(t,"#text")&&" "===t.firstChild.value}(p)||a)&&Jv(t,c,b,p),p=s}}},e),R=p=new hm(c.context||t.root_name,11);if(z.parse(a,c.format),S&&v.length&&(c.context?c.invalid=!0:function(t){for(var n=pb("tr,td,th,tbody,thead,tfoot,table"),r=e.getNonEmptyElements(),o=e.getWhiteSpaceElements(),i=e.getTextBlockElements(),a=e.getSpecialElements(),c=function(t,n){if(void 0===n&&(n=t.parent),a[t.name])t.empty().remove();else{for(var r=0,o=t.children();r<o.length;r++){var i=o[r];e.isValidChild(n.name,i.name)||c(i,n)}t.unwrap()}},s=0;s<t.length;s++){var l=t[s],f=void 0,d=void 0,m=void 0;if(l.parent&&!l.fixed)if(i[l.name]&&"li"===l.parent.name){for(var g=l.next;g&&i[g.name];)g.name="li",g.fixed=!0,l.parent.insert(g,l.parent),g=g.next;l.unwrap()}else{var h=[l];for(f=l.parent;f&&!e.isValidChild(f.name,l.name)&&!n[f.name];f=f.parent)h.push(f);if(f&&h.length>1)if(e.isValidChild(f.name,l.name)){h.reverse();for(var p=d=u(h[0].clone()),v=0;v<h.length-1;v++){e.isValidChild(p.name,h[v].name)?(m=u(h[v].clone()),p.append(m)):m=p;for(var b=h[v].firstChild;b&&b!==h[v+1];){var y=b.next;m.append(b),b=y}p=m}Zv(e,r,o,d)?f.insert(l,h[0],!0):(f.insert(d,h[0],!0),f.insert(l,d)),f=h[0],(Zv(e,r,o,f)||Qv(f,"br"))&&f.empty().remove()}else c(l);else if(l.parent){if("li"===l.name){if((g=l.prev)&&("ul"===g.name||"ol"===g.name)){g.append(l);continue}if((g=l.next)&&("ul"===g.name||"ol"===g.name)){g.insert(l,g.firstChild,!0);continue}l.wrap(u(new hm("ul",1)));continue}e.isValidChild(l.parent.name,"div")&&e.isValidChild("div",l.name)?l.wrap(u(new hm("div",1))):c(l)}}}}(v)),k&&("body"===R.name||c.isRootContent)&&function(){var n=R.firstChild,r=null,o=function(t){t&&((n=t.firstChild)&&3===n.type&&(n.value=n.value.replace(T,"")),(n=t.lastChild)&&3===n.type&&(n.value=n.value.replace(_,"")))};if(e.isValidChild(R.name,k.toLowerCase())){for(;n;){var i=n.next;3===n.type||1===n.type&&"p"!==n.name&&!b[n.name]&&!n.attr("data-mce-type")?r?r.append(n):((r=N(k,1)).attr(t.forced_root_block_attrs),R.insert(r,n),r.append(n)):(o(r),r=null),n=i}o(r)}}(),!c.invalid){for(h in o)if(wt(o,h)){for(g=n[h],d=(s=o[h]).length;d--;)s[d].parent||s.splice(d,1);for(l=0,f=g.length;l<f;l++)g[l](s,h,c)}for(l=0,f=r.length;l<f;l++)if((g=r[l]).name in i){for(d=(s=i[g.name]).length;d--;)s[d].parent||s.splice(d,1);for(d=0,m=g.callbacks.length;d<m;d++)g.callbacks[d](s,g.name,c)}}return R}};return function(t,e){var n=t.schema;e.remove_trailing_brs&&t.addNodeFilter("br",function(t,r,o){var i,u,a,c,s,l,f,d,m=t.length,g=ve.extend({},n.getBlockElements()),h=n.getNonEmptyElements(),p=n.getWhiteSpaceElements();for(g.body=1,i=0;i<m;i++)if(a=(u=t[i]).parent,g[u.parent.name]&&u===a.lastChild){for(s=u.prev;s;){if("span"!==(l=s.name)||"bookmark"!==s.attr("data-mce-type")){"br"===l&&(u=null);break}s=s.prev}u&&(u.remove(),Zv(n,h,p,a)&&(f=n.getElementRule(a.name))&&(f.removeEmpty?a.remove():f.paddEmpty&&Jv(e,o,g,a)))}else{for(c=u;a&&a.firstChild===c&&a.lastChild===c&&(c=a,!g[a.name]);)a=a.parent;c===a&&!0!==e.padd_empty_with_br&&((d=new hm("#text",3)).value=" ",u.replace(d))}}),t.addAttributeFilter("href",function(t){var n,r,o=t.length;if(!e.allow_unsafe_link_target)for(;o--;){var i=t[o];"a"===i.name&&"_blank"===i.attr("target")&&i.attr("rel",(n=i.attr("rel"),r=n?ve.trim(n):"",/\b(noopener)\b/g.test(r)?r:function(t){return t.split(" ").filter(function(t){return t.length>0}).concat(["noopener"]).sort().join(" ")}(r)))}}),e.allow_html_in_named_anchor||t.addAttributeFilter("id,name",function(t){for(var e,n,r,o,i=t.length;i--;)if("a"===(o=t[i]).name&&o.firstChild&&!o.attr("href")){r=o.parent,e=o.lastChild;do{n=e.prev,r.insert(e,o),e=n}while(e)}}),e.fix_list_elements&&t.addNodeFilter("ul,ol",function(t){for(var e,n,r=t.length;r--;)if("ul"===(n=(e=t[r]).parent).name||"ol"===n.name)if(e.prev&&"li"===e.prev.name)e.prev.append(e);else{var o=new hm("li",1);o.attr("style","list-style-type: none"),e.wrap(o)}}),e.validate&&n.getValidClasses()&&t.addAttributeFilter("class",function(t){for(var e=n.getValidClasses(),r=t.length;r--;){for(var o=t[r],i=o.attr("class").split(" "),u="",a=0;a<i.length;a++){var c=i[a],s=!1,l=e["*"];l&&l[c]&&(s=!0),l=e[o.name],!s&&l&&l[c]&&(s=!0),s&&(u&&(u+=" "),u+=c)}u.length||(u=null),o.attr("class",u)}}),tb(t,e)}(a,t),function(t,e){e.inline_styles&&Uv(t,e)}(a,t),a},xb=function(t,e,n){return function(t,e){return t&&t.hasEventListeners("PreProcess")&&!e.no_events}(t,n)?function(t,e,n){var r,o=t.dom,i=e.cloneNode(!0),u=document.implementation;if(u.createHTMLDocument){var a=u.createHTMLDocument("");ve.each("BODY"===i.nodeName?i.childNodes:[i],function(t){a.body.appendChild(a.importNode(t,!0))}),i="BODY"!==i.nodeName?a.body.firstChild:a.body,r=o.doc,o.doc=a}return function(t,e){t.fire("PreProcess",e)}(t,At(At({},n),{node:i})),r&&(o.doc=r),i}(t,e,n):e},Cb=function(t,e,n){-1===ve.inArray(e,n)&&(t.addAttributeFilter(n,function(t,e){for(var n=t.length;n--;)t[n].attr(e,null)}),e.push(n))},Sb=function(t,e,n,r,o){return function(t,e,n){return!e.no_events&&t?function(t,e){return t.fire("PostProcess",e)}(t,At(At({},e),{content:n})).content:n}(t,o,function(t,e,n){return Bm(t,e).serialize(n)}(e,n,r))},kb=function(t,e){var n=["data-mce-selected"],r=e&&e.dom?e.dom:ca.DOM,o=e&&e.schema?e.schema:wi(t);t.entity_encoding=t.entity_encoding||"named",t.remove_trailing_brs=!("remove_trailing_brs"in t)||t.remove_trailing_brs;var i=wb(t,o);!function(t,e,n){t.addAttributeFilter("data-mce-tabindex",function(t,e){for(var n=t.length;n--;){var r=t[n];r.attr("tabindex",r.attr("data-mce-tabindex")),r.attr(e,null)}}),t.addAttributeFilter("src,href,style",function(t,r){for(var o="data-mce-"+r,i=e.url_converter,u=e.url_converter_scope,a=t.length;a--;){var c=t[a],s=c.attr(o);void 0!==s?(c.attr(r,s.length>0?s:null),c.attr(o,null)):(s=c.attr(r),"style"===r?s=n.serializeStyle(n.parseStyle(s),c.name):i&&(s=i.call(u,s,r,c.name)),c.attr(r,s.length>0?s:null))}}),t.addAttributeFilter("class",function(t){for(var e=t.length;e--;){var n=t[e],r=n.attr("class");r&&(r=n.attr("class").replace(/(?:^|\s)mce-item-\w+(?!\S)/g,""),n.attr("class",r.length>0?r:null))}}),t.addAttributeFilter("data-mce-type",function(t,e,n){for(var r=t.length;r--;){var o=t[r];"bookmark"!==o.attr("data-mce-type")||n.cleanup||(P.from(o.firstChild).exists(function(t){return!lo(t.value)})?o.unwrap():o.remove())}}),t.addNodeFilter("noscript",function(t){for(var e=t.length;e--;){var n=t[e].firstChild;n&&(n.value=ci.decode(n.value))}}),t.addNodeFilter("script,style",function(t,n){for(var r=function(t){return t.replace(/(<!--\[CDATA\[|\]\]-->)/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*((<!--)?(\s*\/\/)?\s*<!\[CDATA\[|(<!--\s*)?\/\*\s*<!\[CDATA\[\s*\*\/|(\/\/)?\s*<!--|\/\*\s*<!--\s*\*\/)\s*[\r\n]*/gi,"").replace(/\s*(\/\*\s*\]\]>\s*\*\/(-->)?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")},o=t.length;o--;){var i=t[o],u=i.firstChild?i.firstChild.value:"";if("script"===n){var a=i.attr("type");a&&i.attr("type","mce-no/type"===a?null:a.replace(/^mce\-/,"")),"xhtml"===e.element_format&&u.length>0&&(i.firstChild.value="// <![CDATA[\n"+r(u)+"\n// ]]>")}else"xhtml"===e.element_format&&u.length>0&&(i.firstChild.value="\x3c!--\n"+r(u)+"\n--\x3e")}}),t.addNodeFilter("#comment",function(t){for(var r=t.length;r--;){var o=t[r];e.preserve_cdata&&0===o.value.indexOf("[CDATA[")?(o.name="#cdata",o.type=4,o.value=n.decode(o.value.replace(/^\[CDATA\[|\]\]$/g,""))):0===o.value.indexOf("mce:protected ")&&(o.name="#text",o.type=3,o.raw=!0,o.value=unescape(o.value).substr(14))}}),t.addNodeFilter("xml:namespace,input",function(t,e){for(var n=t.length;n--;){var r=t[n];7===r.type?r.remove():1===r.type&&("input"!==e||r.attr("type")||r.attr("type","text"))}}),t.addAttributeFilter("data-mce-type",function(e){q(e,function(e){"format-caret"===e.attr("data-mce-type")&&(e.isEmpty(t.schema.getNonEmptyElements())?e.remove():e.unwrap())})}),t.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style,data-mce-selected,data-mce-expando,data-mce-type,data-mce-resize,data-mce-placeholder",function(t,e){for(var n=t.length;n--;)t[n].attr(e,null)})}(i,t,r);return{schema:o,addNodeFilter:i.addNodeFilter,addAttributeFilter:i.addAttributeFilter,serialize:function(n,u){void 0===u&&(u={});var a=At({format:"html"},u),c=xb(e,n,a),s=function(t,e,n){var r=fo(n.getInner?e.innerHTML:t.getOuterHTML(e));return n.selection||co(ye.fromDom(e))?r:ve.trim(r)}(r,c,a),l=function(t,e,n){var r=n.selection?At({forced_root_block:!1},n):n,o=t.parse(e,r);return function(t){var e=function(t){return t&&"br"===t.name},n=t.lastChild;if(e(n)){var r=n.prev;e(r)&&(n.remove(),r.remove())}}(o),o}(i,s,a);return"tree"===a.format?l:Sb(e,t,o,l,a)},addRules:o.addValidElements,setRules:o.setValidElements,addTempAttr:E(Cb,i,n),getTempAttrs:O(n),getNodeFilters:i.getNodeFilters,getAttributeFilters:i.getAttributeFilters}},Ob=function(t,e){var n=kb(t,e);return{schema:n.schema,addNodeFilter:n.addNodeFilter,addAttributeFilter:n.addAttributeFilter,serialize:n.serialize,addRules:n.addRules,setRules:n.setRules,addTempAttr:n.addTempAttr,getTempAttrs:n.getTempAttrs,getNodeFilters:n.getNodeFilters,getAttributeFilters:n.getAttributeFilters}},Tb=function(t,e){return void 0===e&&(e={}),function(t,e,n){return Nv(t).editor.getContent(e,n)}(t,e,e.format?e.format:"html")},_b=function(t,e,n){return void 0===n&&(n={}),function(t,e,n){return Nv(t).editor.setContent(e,n)}(t,e,n)},Eb=ca.DOM,Db=function(t){return P.from(t).each(function(t){return t.destroy()})},Ab=function(t){if(!t.removed){var e=t._selectionOverrides,n=t.editorUpload,r=t.getBody(),o=t.getElement();r&&t.save({is_removing:!0}),t.removed=!0,t.unbindAllNativeEvents(),t.hasHiddenInput&&o&&Eb.remove(o.nextSibling),function(t){t.fire("remove")}(t),t.editorManager.remove(t),!t.inline&&r&&function(t){Eb.setStyle(t.id,"display",t.orgDisplay)}(t),function(t){t.fire("detach")}(t),Eb.remove(t.getContainer()),Db(e),Db(n),t.destroy()}},Nb=function(t,e){var n=t.selection,r=t.dom;t.destroyed||(e||t.removed?(e||(t.editorManager.off("beforeunload",t._beforeUnload),t.theme&&t.theme.destroy&&t.theme.destroy(),Db(n),Db(r)),function(t){var e=t.formElement;e&&(e._mceOldSubmit&&(e.submit=e._mceOldSubmit,e._mceOldSubmit=null),Eb.unbind(e,"submit reset",t.formEventDelegate))}(t),function(t){t.contentAreaContainer=t.formElement=t.container=t.editorContainer=null,t.bodyElement=t.contentDocument=t.contentWindow=null,t.iframeElement=t.targetElm=null,t.selection&&(t.selection=t.selection.win=t.selection.dom=t.selection.dom.doc=null)}(t),t.destroyed=!0):t.remove())},Mb=(gb=function(t,e){return m(t)&&m(e)?Mb(t,e):e},function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(0===t.length)throw new Error("Can't merge zero objects");for(var n={},r=0;r<t.length;r++){var o=t[r];for(var i in o)wt(o,i)&&(n[i]=gb(n[i],o[i]))}return n}),zb="autoresize_on_init,content_editable_state,convert_fonts_to_spans,inline_styles,padd_empty_with_br,block_elements,boolean_attributes,editor_deselector,editor_selector,elements,file_browser_callback_types,filepicker_validator_handler,force_hex_style_colors,force_p_newlines,gecko_spellcheck,images_dataimg_filter,media_scripts,mode,move_caret_before_on_enter_elements,non_empty_elements,self_closing_elements,short_ended_elements,special,spellchecker_select_languages,spellchecker_whitelist,tab_focus,table_responsive_width,text_block_elements,text_inline_elements,toolbar_drawer,types,validate,whitespace_elements,paste_word_valid_elements,paste_retain_style_properties,paste_convert_word_fake_lists".split(","),Rb="bbcode,colorpicker,contextmenu,fullpage,legacyoutput,spellchecker,textcolor".split(","),Bb="imagetools,toc".split(","),Lb=function(t){var e=K(zb,function(e){return wt(t,e)}),n=t.forced_root_block;return!1!==n&&""!==n||e.push("forced_root_block (false only)"),ot(e)},Pb=function(t){var e=ve.makeMap(t.plugins," "),n=function(t){return wt(e,t)},r=Nt(Nt([],K(Rb,n),!0),tt(Bb,function(t){return n(t)?[t+" (moving to premium)"]:[]}),!0);return ot(r)},Hb=re().deviceType,Ib=Hb.isTouch(),Fb=Hb.isPhone(),Vb=Hb.isTablet(),Ub=["lists","autolink","autosave"],jb={table_grid:!1,object_resizing:!1,resize:!1},Wb=function(t){var e=g(t)?t.join(" "):t,n=W(d(e)?e.split(" "):[],Ft);return K(n,function(t){return t.length>0})},qb=function(t,e){var n,r,o=(r={},pt(e,function(e,n){return U(t,n)},ht(n={}),ht(r)),{t:n,f:r});return function(t,e){return{sections:O(t),settings:O(e)}}(o.t,o.f)},$b=function(t,e){return wt(t.sections(),e)},Gb=function(t,e){return yt(t,"toolbar_mode").orThunk(function(){return yt(t,"toolbar_drawer").map(function(t){return!1===t?"wrap":t})}).getOr(e)},Kb=function(t,e,n,r){return t&&function(t,e,n){var r=t.sections();return $b(t,e)&&r[e].theme===n}(e,"mobile","mobile")?K(r,E(U,Ub)):t&&$b(e,"mobile")?r:n},Xb=function(t,e,n,r){var o=Wb(n.forced_plugins),i=Wb(r.plugins),u=function(t,e){return $b(t,e)?t.sections()[e]:{}}(e,"mobile"),a=u.plugins?Wb(u.plugins):i,c=function(t,e){return[].concat(Wb(t)).concat(Wb(e))}(o,Kb(t,e,i,a));if(de.browser.isIE()&&U(c,"rtc"))throw new Error("RTC plugin is not supported on IE 11.");return ve.extend(r,{plugins:c.join(" ")})},Yb=function(t,e,n,r,o){var i=t?{mobile:function(t,e){var n={resize:!1,toolbar_mode:Gb(t,"scrolling"),toolbar_sticky:!1};return At(At(At({},jb),n),e?{menubar:!1}:{})}(o.mobile||{},e)}:{},u=qb(["mobile"],Mb(i,o)),a=ve.extend(n,r,u.settings(),function(t,e){return t&&$b(e,"mobile")}(t,u)?function(t,e,n){void 0===n&&(n={});var r=t.sections(),o=yt(r,e).getOr({});return ve.extend({},n,o)}(u,"mobile"):{},{validate:!0,external_plugins:function(t,e){var n=e.external_plugins?e.external_plugins:{};return t&&t.external_plugins?ve.extend({},t.external_plugins,n):n}(r,u.settings())});return Xb(t,u,r,a)},Jb=function(t,e,n,r,o){var i=function(t,e,n,r,o){var i={id:e,theme:"silver",toolbar_mode:Gb(t,"floating"),plugins:"",document_base_url:n,add_form_submit_trigger:!0,submit_patch:!0,add_unload_trigger:!0,convert_urls:!0,relative_urls:!0,remove_script_host:!0,object_resizing:!0,doctype:"<!DOCTYPE html>",visual:!0,font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",forced_root_block:"p",hidden_input:!0,inline_styles:!0,convert_fonts_to_spans:!0,indent:!0,indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",entity_encoding:"named",url_converter:o.convertURL,url_converter_scope:o};return At(At({},i),r?jb:{})}(o,e,n,Ib,t),u=Yb(Fb||Vb,Fb,i,r,o);return!1!==u.deprecation_warnings&&function(t,e){var n=Lb(t),r=Pb(e),o=r.length>0,i=n.length>0,u="mobile"===e.theme;if(o||i||u){var a=u?"\n\nThemes:\n- mobile":"",c=o?"\n\nPlugins:\n- "+r.join("\n- "):"",s=i?"\n\nSettings:\n- "+n.join("\n- "):"";console.warn("The following deprecated features are currently enabled, these will be removed in TinyMCE 6.0. See https://www.tiny.cloud/docs/release-notes/6.0-upcoming-changes/ for more information."+a+c+s)}}(o,u),u},Qb=function(t,e,n){return P.from(e.settings[n]).filter(t)},Zb=function(t,e,n,r){var o,i=e in t.settings?t.settings[e]:n;return"hash"===r?function(t){var e={};return"string"==typeof t?q(t.indexOf("=")>0?t.split(/[;,](?![^=;,]*(?:[;,]|$))/):t.split(","),function(t){var n=t.split("=");n.length>1?e[ve.trim(n[0])]=ve.trim(n[1]):e[ve.trim(n[0])]=ve.trim(n[0])}):e=t,e}(i):"string"===r?Qb(d,t,e).getOr(n):"number"===r?Qb(x,t,e).getOr(n):"boolean"===r?Qb(p,t,e).getOr(n):"object"===r?Qb(m,t,e).getOr(n):"array"===r?Qb(g,t,e).getOr(n):"string[]"===r?Qb((o=d,function(t){return g(t)&&et(t,o)}),t,e).getOr(n):"function"===r?Qb(w,t,e).getOr(n):i},ty=(hb={},{add:function(t,e){hb[t]=e},get:function(t){return hb[t]?hb[t]:{icons:{}}},has:function(t){return wt(hb,t)}}),ey=function(t,e){return e.dom[t]},ny=function(t,e){return parseInt(Xn(e,t),10)},ry=E(ey,"clientWidth"),oy=E(ey,"clientHeight"),iy=E(ny,"margin-top"),uy=E(ny,"margin-left"),ay=function(t,e,n){var r,o=ye.fromDom(t.getBody()),i=t.inline?o:(r=o,ye.fromDom(Re(r).dom.documentElement)),u=function(t,e,n,r){var o=function(t){return t.dom.getBoundingClientRect()}(e);return{x:n-(t?o.left+e.dom.clientLeft+uy(e):0),y:r-(t?o.top+e.dom.clientTop+iy(e):0)}}(t.inline,i,e,n);return function(t,e,n){var r=ry(t),o=oy(t);return e>=0&&n>=0&&e<=r&&n<=o}(i,u.x,u.y)},cy=function(t){var e,n=t.inline?t.getBody():t.getContentAreaContainer();return(e=n,P.from(e).map(ye.fromDom)).map(cn).getOr(!1)},sy=function(t){var e=[],n=function(){var e,n=t.theme;return n&&n.getNotificationManagerImpl?n.getNotificationManagerImpl():{open:e=function(){throw new Error("Theme did not provide a NotificationManager implementation.")},close:e,reposition:e,getArgs:e}},r=function(){return P.from(e[0])},o=function(){e.length>0&&n().reposition(e)},i=function(t){Z(e,function(e){return e===t}).each(function(t){e.splice(t,1)})},u=function(u,a){if(void 0===a&&(a=!0),!t.removed&&cy(t))return a&&t.fire("BeforeOpenNotification",{notification:u}),Q(e,function(t){return e=n().getArgs(t),r=u,!(e.type!==r.type||e.text!==r.text||e.progressBar||e.timeout||r.progressBar||r.timeout);var e,r}).getOrThunk(function(){t.editorManager.setActive(t);var a=n().open(u,function(){i(a),o(),r().fold(function(){return t.focus()},function(t){return ye.fromDom(t.getEl()).dom.focus()})});return function(t){e.push(t)}(a),o(),t.fire("OpenNotification",{notification:At({},a)}),a})},a=O(e);return function(t){t.on("SkinLoaded",function(){var e=function(t){return t.getParam("service_message")}(t);e&&u({text:e,type:"warning",timeout:0},!1),o()}),t.on("show ResizeEditor ResizeWindow NodeChange",function(){Kr.requestAnimationFrame(o)}),t.on("remove",function(){q(e.slice(),function(t){n().close(t)})})}(t),{open:u,close:function(){r().each(function(t){n().close(t),i(t),o()})},getNotifications:a}},ly=ba.PluginManager,fy=ba.ThemeManager;var dy=function(t){var e=[],n=function(){var e,n=t.theme;return n&&n.getWindowManagerImpl?n.getWindowManagerImpl():{open:e=function(){throw new Error("Theme did not provide a WindowManager implementation.")},openUrl:e,alert:e,confirm:e,close:e,getParams:e,setParams:e}},r=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return e?e.apply(t,n):void 0}},o=function(n){e.push(n),function(e){t.fire("OpenWindow",{dialog:e})}(n)},i=function(n){!function(e){t.fire("CloseWindow",{dialog:e})}(n),0===(e=K(e,function(t){return t!==n})).length&&t.focus()},u=function(e){t.editorManager.setActive(t),jd(t);var n=e();return o(n),n};return t.on("remove",function(){q(e,function(t){n().close(t)})}),{open:function(t,e){return u(function(){return n().open(t,e,i)})},openUrl:function(t){return u(function(){return n().openUrl(t,i)})},alert:function(t,e,o){var i=n();i.alert(t,r(o||i,e))},confirm:function(t,e,o){var i=n();i.confirm(t,r(o||i,e))},close:function(){P.from(e[e.length-1]).each(function(t){n().close(t),i(t)})}}},my=function(t,e){t.notificationManager.open({type:"error",text:e})},gy=function(t,e){t._skinLoaded?my(t,e):t.on("SkinLoaded",function(){my(t,e)})},hy=function(t,e,n){Hf(t,e,{message:n}),console.error(n)},py=function(t,e,n){return n?"Failed to load "+t+": "+n+" from url "+e:"Failed to load "+t+" url: "+e},vy=function(t,e,n){hy(t,"PluginLoadError",py("plugin",e,n))},by=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=window.console;r&&(r.error?r.error.apply(r,Nt([t],e,!1)):r.log.apply(r,Nt([t],e,!1)))},yy=function(t){return wy(t,function(t){var e=t.getParam("content_css");return d(e)?W(e.split(","),Ft):g(e)?e:!1===e||t.inline?[]:["default"]}(t))},wy=function(t,e){var n=t.editorManager.baseURL+"/skins/content",r="content"+t.editorManager.suffix+".css",o=!0===t.inline;return W(e,function(e){return function(t){return/^[a-z0-9\-]+$/i.test(t)}(e)&&!o?n+"/"+e+"/"+r:t.documentBaseURI.toAbsolute(e)})},xy=function(t){t.contentCSS=t.contentCSS.concat(yy(t),function(t){return wy(t,ts(t))}(t))},Cy=function(){var t={},e=function(t,e){return{status:t,resultUri:e}},n=function(e){return e in t};return{hasBlobUri:n,getResultUri:function(e){var n=t[e];return n?n.resultUri:null},isPending:function(e){return!!n(e)&&1===t[e].status},isUploaded:function(e){return!!n(e)&&2===t[e].status},markPending:function(n){t[n]=e(1,null)},markUploaded:function(n,r){t[n]=e(2,r)},removeFailed:function(e){delete t[e]},destroy:function(){t={}}}},Sy=0,ky=function(t){return t+Sy+++(e=function(){return Math.round(4294967295*Math.random()).toString(36)},"s"+(new Date).getTime().toString(36)+e()+e()+e());var e},Oy=function(t,e){var n={},r=function(t,n,r,o){var i=new XMLHttpRequest;i.open("POST",e.url),i.withCredentials=e.credentials,i.upload.onprogress=function(t){o(t.loaded/t.total*100)},i.onerror=function(){r("Image upload failed due to a XHR Transport error. Code: "+i.status)},i.onload=function(){if(i.status<200||i.status>=300)r("HTTP Error: "+i.status);else{var t,o,u=JSON.parse(i.responseText);if(u&&"string"==typeof u.location)n((t=e.basePath,o=u.location,t?t.replace(/\/$/,"")+"/"+o.replace(/^\//,""):o));else r("Invalid JSON: "+i.responseText)}};var u=new FormData;u.append("file",t.blob(),t.filename()),i.send(u)},o=function(t,e){return{url:e,blobInfo:t,status:!0}},i=function(t,e,n){return{url:"",blobInfo:t,status:!1,error:{message:e,options:n}}},u=function(t,e){ve.each(n[t],function(t){t(e)}),delete n[t]},a=function(r,a){return r=ve.grep(r,function(e){return!t.isUploaded(e.blobUri())}),Wr.all(ve.map(r,function(r){return t.isPending(r.blobUri())?function(t){var e=t.blobUri();return new Wr(function(t){n[e]=n[e]||[],n[e].push(t)})}(r):function(e,n,r){return t.markPending(e.blobUri()),new Wr(function(a){var c;try{var s=function(){c&&c.close()};n(e,function(n){s(),t.markUploaded(e.blobUri(),n),u(e.blobUri(),o(e,n)),a(o(e,n))},function(n,r){var o=r||{};s(),t.removeFailed(e.blobUri()),u(e.blobUri(),i(e,n,o)),a(i(e,n,o))},function(t){t<0||t>100||P.from(c).orThunk(function(){return P.from(r).map(A)}).each(function(e){c=e,e.progressBar.value(t)})})}catch(t){a(i(e,t.message,{}))}})}(r,e.handler,a)}))};return!1===w(e.handler)&&(e.handler=r),{upload:function(t,n){return e.url||e.handler!==r?a(t,n):new Wr(function(t){t([])})}}},Ty=function(t){return function(){return t.notificationManager.open({text:t.translate("Image uploading..."),type:"info",timeout:-1,progressBar:!0})}},_y=function(t,e){return Oy(e,{url:function(t){return t.getParam("images_upload_url","","string")}(t),basePath:function(t){return t.getParam("images_upload_base_path","","string")}(t),credentials:function(t){return t.getParam("images_upload_credentials",!1,"boolean")}(t),handler:function(t){return t.getParam("images_upload_handler",null,"function")}(t)})},Ey=function(t){var e,n,r,o,i,u,a=(e=[],n=function(t){if(!t.blob||!t.base64)throw new Error("blob and base64 representations of the image are required for BlobInfo to be created");var e,n=t.id||ky("blobid"),r=t.name||n,o=t.blob;return{id:O(n),name:O(r),filename:O(t.filename||r+"."+(e=o.type,{"image/jpeg":"jpg","image/jpg":"jpg","image/gif":"gif","image/png":"png","image/apng":"apng","image/avif":"avif","image/svg+xml":"svg","image/webp":"webp","image/bmp":"bmp","image/tiff":"tiff"}[e.toLowerCase()]||"dat")),blob:O(o),base64:O(t.base64),blobUri:O(t.blobUri||URL.createObjectURL(o)),uri:O(t.uri)}},{create:function(t,e,r,o,i){if(d(t))return n({id:t,name:o,filename:i,blob:e,base64:r});if(m(t))return n(t);throw new Error("Unknown input type")},add:function(t){o(t.id())||e.push(t)},get:o=function(t){return r(function(e){return e.id()===t})},getByUri:function(t){return r(function(e){return e.blobUri()===t})},getByData:function(t,e){return r(function(n){return n.base64()===t&&n.blob().type===e})},findFirst:r=function(t){return Q(e,t).getOrUndefined()},removeByUri:function(t){e=K(e,function(e){return e.blobUri()!==t||(URL.revokeObjectURL(e.blobUri()),!1)})},destroy:function(){q(e,function(t){URL.revokeObjectURL(t.blobUri())}),e=[]}}),c=Cy(),s=[],l=function(t){var e=ma(null);t.on("change AddUndo",function(t){e.set(At({},t.level))});return{fireIfChanged:function(){var n=t.undoManager.data;at(n).filter(function(t){return!kv(e.get(),t)}).each(function(e){t.setDirty(!0),t.fire("change",{level:e,lastLevel:it(n,n.length-2).getOrNull()})})}}}(t),f=function(e){return function(n){return t.selection?e(n):[]}},g=function(t,e,n){var r=0;do{-1!==(r=t.indexOf(e,r))&&(t=t.substring(0,r)+n+t.substr(r+e.length),r+=n.length-e.length+1)}while(-1!==r);return t},h=function(t,e,n){var r='src="'+n+'"'+(n===de.transparentSrc?' data-mce-placeholder="1"':"");return t=g(t,'src="'+e+'"',r),t=g(t,'data-mce-src="'+e+'"','data-mce-src="'+n+'"')},p=function(e,n){q(t.undoManager.data,function(t){"fragmented"===t.type?t.fragments=W(t.fragments,function(t){return h(t,e,n)}):t.content=h(t.content,e,n)})},v=function(e,n){var r,o=t.convertURL(n,"src");p(e.src,n),t.$(e).attr({src:function(t){return t.getParam("images_reuse_filename",!1,"boolean")}(t)?(r=n,r+(-1===r.indexOf("?")?"?":"&")+(new Date).getTime()):n,"data-mce-src":o})},b=function(e){return i||(i=_y(t,c)),x().then(f(function(n){var r=W(n,function(t){return t.blobInfo});return i.upload(r,Ty(t)).then(f(function(r){var o=[],i=W(r,function(e,r){var i=n[r].blobInfo,u=n[r].image;return e.status&&function(t){return t.getParam("images_replace_blob_uris",!0,"boolean")}(t)?(a.removeByUri(u.src),Dv(t)||v(u,e.url)):e.error&&(e.error.options.remove&&(p(u.getAttribute("src"),de.transparentSrc),o.push(u)),function(t,e){gy(t,va.translate(["Failed to upload image: {0}",e]))}(t,e.error.message)),{element:u,status:e.status,uploadUri:e.url,blobInfo:i}});return i.length>0&&l.fireIfChanged(),o.length>0&&(Dv(t)?console.error("Removing images on failed uploads is currently unsupported for RTC"):t.undoManager.transact(function(){q(o,function(e){t.dom.remove(e),a.removeByUri(e.src)})})),e&&e(i),i}))}))},y=function(e){if(Xc(t))return b(e)},w=function(e){return!1!==et(s,function(t){return t(e)})&&(0!==e.getAttribute("src").indexOf("data:")||function(t){return t.getParam("images_dataimg_filter",z,"function")}(t)(e))},x=function(){return u||(u=Xv(c,a)),u.findAll(t.getBody(),w).then(f(function(e){return e=K(e,function(e){return"string"!=typeof e||(gy(t,e),!1)}),Dv(t)||q(e,function(t){p(t.image.src,t.blobInfo.blobUri()),t.image.src=t.blobInfo.blobUri(),t.image.removeAttribute("data-mce-src")}),e}))},C=function(e){return e.replace(/src="(blob:[^"]+)"/g,function(e,n){var r=c.getResultUri(n);if(r)return'src="'+r+'"';var o=a.getByUri(n);return o||(o=Y(t.editorManager.get(),function(t,e){return t||e.editorUpload&&e.editorUpload.blobCache.getByUri(n)},null)),o?'src="data:'+o.blob().type+";base64,"+o.base64()+'"':e})};return t.on("SetContent",function(){Xc(t)?y():x()}),t.on("RawSaveContent",function(t){t.content=C(t.content)}),t.on("GetContent",function(t){t.source_view||"raw"===t.format||"tree"===t.format||(t.content=C(t.content))}),t.on("PostRender",function(){t.parser.addNodeFilter("img",function(t){q(t,function(t){var e=t.attr("src");if(!a.getByUri(e)){var n=c.getResultUri(e);n&&t.attr("src",n)}})})}),{blobCache:a,addFilter:function(t){s.push(t)},uploadImages:b,uploadImagesAuto:y,scanForImages:x,destroy:function(){a.destroy(),c.destroy(),u=i=null}}},Dy=function(t){var e={},n=function(t,r){t&&(d(t)?(g(r)||(r=[r]),q(r,function(t){v(t.deep)&&(t.deep=!Yl(t)),v(t.split)&&(t.split=!Yl(t)||Jl(t)),v(t.remove)&&Yl(t)&&!Jl(t)&&(t.remove="none"),Yl(t)&&Jl(t)&&(t.mixed=!0,t.block_expand=!0),d(t.classes)&&(t.classes=t.classes.split(/\s+/))}),e[t]=r):dt(t,function(t,e){n(e,t)}))};return n(function(t){var e={valigntop:[{selector:"td,th",styles:{verticalAlign:"top"}}],valignmiddle:[{selector:"td,th",styles:{verticalAlign:"middle"}}],valignbottom:[{selector:"td,th",styles:{verticalAlign:"bottom"}}],alignleft:[{selector:"figure.image",collapsed:!1,classes:"align-left",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"left"},inherit:!1,preview:!1,defaultBlock:"div"},{selector:"img,table,audio,video",collapsed:!1,styles:{float:"left"},preview:"font-family font-size"}],aligncenter:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"center"},inherit:!1,preview:"font-family font-size",defaultBlock:"div"},{selector:"figure.image",collapsed:!1,classes:"align-center",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"img,audio,video",collapsed:!1,styles:{display:"block",marginLeft:"auto",marginRight:"auto"},preview:!1},{selector:"table",collapsed:!1,styles:{marginLeft:"auto",marginRight:"auto"},preview:"font-family font-size"}],alignright:[{selector:"figure.image",collapsed:!1,classes:"align-right",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"right"},inherit:!1,preview:"font-family font-size",defaultBlock:"div"},{selector:"img,table,audio,video",collapsed:!1,styles:{float:"right"},preview:"font-family font-size"}],alignjustify:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"justify"},inherit:!1,defaultBlock:"div",preview:"font-family font-size"}],bold:[{inline:"strong",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b",remove:"all",preserve_attributes:["class","style"]}],italic:[{inline:"em",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i",remove:"all",preserve_attributes:["class","style"]}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:!0},{inline:"u",remove:"all",preserve_attributes:["class","style"]}],strikethrough:[{inline:"span",styles:{textDecoration:"line-through"},exact:!0},{inline:"strike",remove:"all",preserve_attributes:["class","style"]},{inline:"s",remove:"all",preserve_attributes:["class","style"]}],forecolor:{inline:"span",styles:{color:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},fontname:{inline:"span",toggle:!1,styles:{fontFamily:"%value"},clear_child_styles:!0},fontsize:{inline:"span",toggle:!1,styles:{fontSize:"%value"},clear_child_styles:!0},lineheight:{selector:"h1,h2,h3,h4,h5,h6,p,li,td,th,div",defaultBlock:"p",styles:{lineHeight:"%value"}},fontsize_class:{inline:"span",attributes:{class:"%value"}},blockquote:{block:"blockquote",wrapper:!0,remove:"all"},subscript:{inline:"sub"},superscript:{inline:"sup"},code:{inline:"code"},link:{inline:"a",selector:"a",remove:"all",split:!0,deep:!0,onmatch:function(t,e,n){return wn(t)&&t.hasAttribute("href")},onformat:function(e,n,r){ve.each(r,function(n,r){t.setAttrib(e,r,n)})}},lang:{inline:"span",clear_child_styles:!0,remove_similar:!0,attributes:{lang:"%value","data-mce-lang":function(t){var e;return null!==(e=null===t||void 0===t?void 0:t.customValue)&&void 0!==e?e:null}}},removeformat:[{selector:"b,strong,em,i,font,u,strike,s,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins,small",remove:"all",split:!0,expand:!1,block_expand:!0,deep:!0},{selector:"span",attributes:["style","class"],remove:"empty",split:!0,expand:!1,deep:!0},{selector:"*",attributes:["style","class"],split:!1,expand:!1,deep:!0}]};return ve.each("p h1 h2 h3 h4 h5 h6 div address pre dt dd samp".split(/\s/),function(t){e[t]={block:t,remove:"all"}}),e}(t.dom)),n(function(t){return t.getParam("formats")}(t)),{get:function(t){return y(t)?e[t]:e},has:function(t){return wt(e,t)},register:n,unregister:function(t){return t&&e[t]&&delete e[t],e}}},Ay=ve.each,Ny=ca.DOM,My=function(t,e){var n,r,o,i=e&&e.schema||wi({}),u=function(t){r="string"==typeof t?{name:t,classes:[],attrs:{}}:t;var e=Ny.create(r.name);return function(t,e){e.classes.length&&Ny.addClass(t,e.classes.join(" ")),Ny.setAttribs(t,e.attrs)}(e,r),e},a=function(t,e,n){var r,o,c=e.length>0&&e[0],s=c&&c.name,l=function(t,e){var n="string"!=typeof t?t.nodeName.toLowerCase():t,r=i.getElementRule(n),o=r&&r.parentsRequired;return!(!o||!o.length)&&(e&&-1!==ve.inArray(o,e)?e:o[0])}(t,s);if(l)s===l?(o=e[0],e=e.slice(1)):o=l;else if(c)o=e[0],e=e.slice(1);else if(!n)return t;return o&&(r=u(o)).appendChild(t),n&&(r||(r=Ny.create("div")).appendChild(t),ve.each(n,function(e){var n=u(e);r.insertBefore(n,t)})),a(r,e,o&&o.siblings)};return t&&t.length?(r=t[0],n=u(r),(o=Ny.create("div")).appendChild(a(n,t.slice(1),r.siblings)),o):""},zy=function(t){var e,n={classes:[],attrs:{}};return"*"!==(t=n.selector=ve.trim(t))&&(e=t.replace(/(?:([#\.]|::?)([\w\-]+)|(\[)([^\]]+)\]?)/g,function(t,e,r,o,i){switch(e){case"#":n.attrs.id=r;break;case".":n.classes.push(r);break;case":":-1!==ve.inArray("checked disabled enabled read-only required".split(" "),r)&&(n.attrs[r]=r)}if("["===o){var u=i.match(/([\w\-]+)(?:\=\"([^\"]+))?/);u&&(n.attrs[u[1]]=u[2])}return""})),n.name=e||"div",n},Ry=function(t,e){var n,r,o,i="",u=function(t){var e=t.getParam("preview_styles","font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius outline text-shadow");return d(e)?e:""}(t);if(""===u)return"";var a=function(t){return t.replace(/%(\w+)/g,"")};if("string"==typeof e){if(!(e=t.formatter.get(e)))return;e=e[0]}if("preview"in e){var c=yt(e,"preview");if(Hn(c,!1))return"";u=c.getOr(u)}n=e.block||e.inline||"span";var s,l=(s=e.selector)&&"string"==typeof s?(s=(s=s.split(/\s*,\s*/)[0]).replace(/\s*(~\+|~|\+|>)\s*/g,"$1"),ve.map(s.split(/(?:>|\s+(?![^\[\]]+\]))/),function(t){var e=ve.map(t.split(/(?:~\+|~|\+)/),zy),n=e.pop();return e.length&&(n.siblings=e),n}).reverse()):[];l.length?(l[0].name||(l[0].name=n),n=e.selector,r=My(l,t)):r=My([n],t);var f=Ny.select(n,r)[0]||r.firstChild;return Ay(e.styles,function(t,e){var n=a(t);n&&Ny.setStyle(f,e,n)}),Ay(e.attributes,function(t,e){var n=a(t);n&&Ny.setAttrib(f,e,n)}),Ay(e.classes,function(t){var e=a(t);Ny.hasClass(f,e)||Ny.addClass(f,e)}),t.fire("PreviewFormats"),Ny.setStyles(r,{position:"absolute",left:-65535}),t.getBody().appendChild(r),o=Ny.getStyle(t.getBody(),"fontSize",!0),o=/px$/.test(o)?parseInt(o,10):0,Ay(u.split(" "),function(e){var n=Ny.getStyle(f,e,!0);if(!("background-color"===e&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(n)&&(n=Ny.getStyle(t.getBody(),e,!0),"#ffffff"===Ny.toHex(n).toLowerCase())||"color"===e&&"#000000"===Ny.toHex(n).toLowerCase())){if("font-size"===e&&/em|%$/.test(n)){if(0===o)return;n=parseFloat(n)/(/%$/.test(n)?100:1)*o+"px"}"border"===e&&n&&(i+="padding:0 2px;"),i+=e+":"+n+";"}}),t.fire("AfterPreviewFormats"),Ny.remove(r),i},By=function(t){var e=Dy(t),n=ma(null);return function(t){t.addShortcut("meta+b","","Bold"),t.addShortcut("meta+i","","Italic"),t.addShortcut("meta+u","","Underline");for(var e=1;e<=6;e++)t.addShortcut("access+"+e,"",["FormatBlock",!1,"h"+e]);t.addShortcut("access+7","",["FormatBlock",!1,"p"]),t.addShortcut("access+8","",["FormatBlock",!1,"div"]),t.addShortcut("access+9","",["FormatBlock",!1,"address"])}(t),lp(t),{get:e.get,has:e.has,register:e.register,unregister:e.unregister,apply:function(e,n,r){!function(t,e,n,r){Mv(t).formatter.apply(e,n,r)}(t,e,n,r)},remove:function(e,n,r,o){!function(t,e,n,r,o){Mv(t).formatter.remove(e,n,r,o)}(t,e,n,r,o)},toggle:function(e,n,r){!function(t,e,n,r){Mv(t).formatter.toggle(e,n,r)}(t,e,n,r)},match:function(e,n,r,o){return function(t,e,n,r,o){return Mv(t).formatter.match(e,n,r,o)}(t,e,n,r,o)},closest:function(e){return function(t,e){return Mv(t).formatter.closest(e)}(t,e)},matchAll:function(e,n){return function(t,e,n){return Mv(t).formatter.matchAll(e,n)}(t,e,n)},matchNode:function(e,n,r,o){return function(t,e,n,r,o){return Mv(t).formatter.matchNode(e,n,r,o)}(t,e,n,r,o)},canApply:function(e){return function(t,e){return Mv(t).formatter.canApply(e)}(t,e)},formatChanged:function(e,r,o,i){return function(t,e,n,r,o,i){return Mv(t).formatter.formatChanged(e,n,r,o,i)}(t,n,e,r,o,i)},getCssText:E(Ry,t)}},Ly=function(t){switch(t.toLowerCase()){case"undo":case"redo":case"mcerepaint":case"mcefocus":return!0;default:return!1}},Py=function(t){var e=ya(),n=ma(0),r=ma(0),o={data:[],typing:!1,beforeChange:function(){!function(t,e,n){Mv(t).undoManager.beforeChange(e,n)}(t,n,e)},add:function(i,u){return function(t,e,n,r,o,i,u){return Mv(t).undoManager.add(e,n,r,o,i,u)}(t,o,r,n,e,i,u)},undo:function(){return function(t,e,n,r){return Mv(t).undoManager.undo(e,n,r)}(t,o,n,r)},redo:function(){return function(t,e,n){return Mv(t).undoManager.redo(e,n)}(t,r,o.data)},clear:function(){!function(t,e,n){Mv(t).undoManager.clear(e,n)}(t,o,r)},reset:function(){!function(t,e){Mv(t).undoManager.reset(e)}(t,o)},hasUndo:function(){return function(t,e,n){return Mv(t).undoManager.hasUndo(e,n)}(t,o,r)},hasRedo:function(){return function(t,e,n){return Mv(t).undoManager.hasRedo(e,n)}(t,o,r)},transact:function(e){return function(t,e,n,r){return Mv(t).undoManager.transact(e,n,r)}(t,o,n,e)},ignore:function(e){!function(t,e,n){Mv(t).undoManager.ignore(e,n)}(t,n,e)},extra:function(e,n){!function(t,e,n,r,o){Mv(t).undoManager.extra(e,n,r,o)}(t,o,r,e,n)}};return Dv(t)||function(t,e,n){var r=ma(!1),o=function(t){Tv(e,!1,n),e.add({},t)};t.on("init",function(){e.add()}),t.on("BeforeExecCommand",function(t){var r=t.command;Ly(r)||(_v(e,n),e.beforeChange())}),t.on("ExecCommand",function(t){var e=t.command;Ly(e)||o(t)}),t.on("ObjectResizeStart cut",function(){e.beforeChange()}),t.on("SaveContent ObjectResized blur",o),t.on("dragend",o),t.on("keyup",function(n){var i=n.keyCode;n.isDefaultPrevented()||((i>=33&&i<=36||i>=37&&i<=40||45===i||n.ctrlKey)&&(o(),t.nodeChanged()),46!==i&&8!==i||t.nodeChanged(),r.get()&&e.typing&&!1===kv(wv(t),e.data[0])&&(!1===t.isDirty()&&(t.setDirty(!0),t.fire("change",{level:e.data[0],lastLevel:null})),t.fire("TypingUndo"),r.set(!1),t.nodeChanged()))}),t.on("keydown",function(t){var i=t.keyCode;if(!t.isDefaultPrevented())if(i>=33&&i<=36||i>=37&&i<=40||45===i)e.typing&&o(t);else{var u=t.ctrlKey&&!t.altKey||t.metaKey;!(i<16||i>20)||224===i||91===i||e.typing||u||(e.beforeChange(),Tv(e,!0,n),e.add({},t),r.set(!0))}}),t.on("mousedown",function(t){e.typing&&o(t)});t.on("input",function(t){t.inputType&&("insertReplacementText"===t.inputType||function(t){return"insertText"===t.inputType&&null===t.data}(t)||function(t){return"insertFromPaste"===t.inputType||"insertFromDrop"===t.inputType}(t))&&o(t)}),t.on("AddUndo Undo Redo ClearUndos",function(e){e.isDefaultPrevented()||t.nodeChanged()})}(t,o,n),function(t){t.addShortcut("meta+z","","Undo"),t.addShortcut("meta+y,meta+shift+z","","Redo")}(t),o},Hy=[9,27,Vf.HOME,Vf.END,19,20,44,144,145,33,34,45,16,17,18,91,92,93,Vf.DOWN,Vf.UP,Vf.LEFT,Vf.RIGHT].concat(de.browser.isFirefox()?[224]:[]),Iy=function(t){return"keydown"===t.type||"keyup"===t.type},Fy=function(t){var e=t.keyCode;return e===Vf.BACKSPACE||e===Vf.DELETE},Vy=function(t){var e=t.dom,n=Gc(t),r=function(t){return t.getParam("placeholder",Wc.getAttrib(t.getElement(),"placeholder"),"string")}(t),o=function(i,u){if(!function(t){if(Iy(t)){var e=t.keyCode;return!Fy(t)&&(Vf.metaKeyPressed(t)||t.altKey||e>=112&&e<=123||U(Hy,e))}return!1}(i)){var a=t.getBody(),c=!function(t){return Iy(t)&&!(Fy(t)||"keyup"===t.type&&229===t.keyCode)}(i)&&function(t,e,n){if(Wo(ye.fromDom(e),!1)){var r=""===n,o=e.firstElementChild;return!o||!t.getStyle(e.firstElementChild,"padding-left")&&!t.getStyle(e.firstElementChild,"padding-right")&&(r?!t.isBlock(o):n===o.nodeName.toLowerCase())}return!1}(e,a,n);(""!==e.getAttrib(a,"data-mce-placeholder")!==c||u)&&(e.setAttrib(a,"data-mce-placeholder",c?r:null),e.setAttrib(a,"aria-placeholder",c?r:null),function(t,e){t.fire("PlaceholderToggle",{state:e})}(t,c),t.on(c?"keydown":"keyup",o),t.off(c?"keyup":"keydown",o))}};r&&t.on("init",function(e){o(e,!0),t.on("change SetContent ExecCommand",o),t.on("paste",function(e){return Kr.setEditorTimeout(t,function(){return o(e)})})})},Uy=/[\u0591-\u07FF\uFB1D-\uFDFF\uFE70-\uFEFC]/,jy=function(t,e){return xe(ye.fromDom(e),function(t){return t.getParam("inline_boundaries_selector","a[href],code,.mce-annotation","string")}(t))},Wy=function(t){return"rtl"===ca.DOM.getStyle(t,"direction",!0)||(e=t.textContent,Uy.test(e));var e},qy=function(t,e,n){var r=function(t,e,n){return K(ca.DOM.getParents(n.container(),"*",e),t)}(t,e,n);return P.from(r[r.length-1])},$y=function(t,e){if(!e)return e;var n=e.container(),r=e.offset();return t?po(n)?En(n.nextSibling)?wc(n.nextSibling,0):wc.after(n):yo(e)?wc(n,r+1):e:po(n)?En(n.previousSibling)?wc(n.previousSibling,n.previousSibling.data.length):wc.before(n):wo(e)?wc(n,r-1):e},Gy=E($y,!0),Ky=E($y,!1),Xy=function(t){return ro(t)||io(t)},Yy=function(t,e){return Oe(t,e)?Ir(e,Xy,function(t){return function(e){return Se(t,ye.fromDom(e.dom.parentNode))}}(t)):P.none()},Jy=function(t){t.dom.isEmpty(t.getBody())&&(t.setContent(""),function(t){var e=t.getBody(),n=e.firstChild&&t.dom.isBlock(e.firstChild)?e.firstChild:e;t.selection.setCursorLocation(n,0)}(t))},Qy=function(t,e){return{from:t,to:e}},Zy=function(t,e){var n=ye.fromDom(t),r=ye.fromDom(e.container());return Yy(n,r).map(function(t){return function(t,e){return{block:t,position:e}}(t,e)})},tw=function(t,e,n){var r=Zy(t,wc.fromRangeStart(n)),o=r.bind(function(n){return dl(e,t,n.position).bind(function(n){return Zy(t,n).map(function(n){return function(t,e,n){return Mn(n.position.getNode())&&!1===Wo(n.block)?hl(!1,n.block.dom).bind(function(r){return r.isEqual(n.position)?dl(e,t,r).bind(function(e){return Zy(t,e)}):P.some(n)}).getOr(n):n}(t,e,n)})})});return In(r,o,Qy).filter(function(t){return function(t){return!1===Se(t.from.block,t.to.block)}(t)&&function(t){return Le(t.from.block).bind(function(e){return Le(t.to.block).filter(function(t){return Se(e,t)})}).isSome()}(t)&&function(t){return!1===Bn(t.from.block.dom)&&!1===Bn(t.to.block.dom)}(t)})},ew=function(t){var e=Ve(t);return Z(e,to).fold(O(e),function(t){return e.slice(0,t)})},nw=function(t){var e=ew(t);return q(e,un),e},rw=function(t,e){var n=ag(e,t);return Q(n.reverse(),function(t){return Wo(t)}).each(un)},ow=function(t,e,n,r){if(Wo(n))return rg(n),bl(n.dom);0===K(Ie(r),function(t){return!Wo(t)}).length&&Wo(e)&&Ze(r,ye.fromTag("br"));var o=vl(n.dom,wc.before(r.dom));return q(nw(e),function(t){Ze(r,t)}),rw(t,e),o},iw=function(t,e,n){if(Wo(n))return un(n),Wo(e)&&rg(e),bl(e.dom);var r=yl(n.dom);return q(nw(e),function(t){nn(n,t)}),rw(t,e),r},uw=function(t,e){return Oe(e,t)?function(t,e){var n=ag(e,t);return P.from(n[n.length-1])}(e,t):P.none()},aw=function(t,e){hl(t,e.dom).map(function(t){return t.getNode()}).map(ye.fromDom).filter(no).each(un)},cw=function(t,e,n){return aw(!0,e),aw(!1,n),uw(e,n).fold(E(iw,t,e,n),E(ow,t,e,n))},sw=function(t,e,n,r){return e?cw(t,r,n):cw(t,n,r)},lw=function(t,e){var n=ye.fromDom(t.getBody()),r=function(t,e,n){return n.collapsed?tw(t,e,n):P.none()}(n.dom,e,t.selection.getRng()).bind(function(t){return sw(n,e,t.from.block,t.to.block)});return r.each(function(e){t.selection.setRng(e.toRange())}),r.isSome()},fw=function(t,e){var n=ye.fromDom(e),r=E(Se,t);return Hr(n,ao,r).isSome()},dw=function(t,e){var n=vl(t.dom,wc.fromRangeStart(e)).isNone(),r=pl(t.dom,wc.fromRangeEnd(e)).isNone();return!function(t,e){return fw(t,e.startContainer)||fw(t,e.endContainer)}(t,e)&&n&&r},mw=function(t){var e=ye.fromDom(t.getBody()),n=t.selection.getRng();return dw(e,n)?function(t){return t.setContent(""),t.selection.setCursorLocation(),!0}(t):function(t,e){var n=e.getRng();return In(Yy(t,ye.fromDom(n.startContainer)),Yy(t,ye.fromDom(n.endContainer)),function(r,o){return!1===Se(r,o)&&(n.deleteContents(),sw(t,!0,r,o).each(function(t){e.setRng(t.toRange())}),!0)}).getOr(!1)}(e,t.selection)},gw=function(t,e){return!t.selection.isCollapsed()&&mw(t)},hw=Rn,pw=Bn,vw=function(t,e,n,r,o){return P.from(e._selectionOverrides.showCaret(t,n,r,o))},bw=function(t,e){return t.fire("BeforeObjectSelected",{target:e}).isDefaultPrevented()?P.none():P.some(function(t){var e=t.ownerDocument.createRange();return e.selectNode(t),e}(e))},yw=function(t,e,n){var r=Ws(1,t.getBody(),e),o=wc.fromRangeStart(r),i=o.getNode();if(Ss(i))return vw(1,t,i,!o.isAtEnd(),!1);var u=o.getNode(!0);if(Ss(u))return vw(1,t,u,!1,!1);var a=t.dom.getParent(o.getNode(),function(t){return pw(t)||hw(t)});return Ss(a)?vw(1,t,a,!1,n):P.none()},ww=function(t,e,n){return e.collapsed?yw(t,e,n).getOr(e):e},xw=function(t){return tg(t)||Ym(t)},Cw=function(t){return eg(t)||Jm(t)},Sw=function(t,e,n,r,o,i){return vw(r,t,i.getNode(!o),o,!0).each(function(n){if(e.collapsed){var r=e.cloneRange();o?r.setEnd(n.startContainer,n.startOffset):r.setStart(n.endContainer,n.endOffset),r.deleteContents()}else e.deleteContents();t.selection.setRng(n)}),function(t,e){En(e)&&0===e.data.length&&t.remove(e)}(t.dom,n),!0},kw=function(t,e){return function(t,e){var n=t.selection.getRng();if(!En(n.commonAncestorContainer))return!1;var r=e?xc.Forwards:xc.Backwards,o=al(t.getBody()),i=E(Ks,e?o.next:o.prev),u=e?xw:Cw,a=$s(r,t.getBody(),n),c=$y(e,i(a));if(!c||!Xs(a,c))return!1;if(u(c))return Sw(t,n,a.getNode(),r,e,c);var s=i(c);return!!(s&&u(s)&&Xs(c,s))&&Sw(t,n,a.getNode(),r,e,s)}(t,e)},Ow=hr([{remove:["element"]},{moveToElement:["element"]},{moveToPosition:["position"]}]),Tw=function(t,e,n,r){var o=r.getNode(!1===e);return Yy(ye.fromDom(t),ye.fromDom(n.getNode())).map(function(t){return Wo(t)?Ow.remove(t.dom):Ow.moveToElement(o)}).orThunk(function(){return P.some(Ow.moveToElement(o))})},_w=function(t,e,n){return dl(e,t,n).bind(function(r){return o=r.getNode(),ao(ye.fromDom(o))||io(ye.fromDom(o))?P.none():function(t,e,n,r){var o=function(e){return eo(ye.fromDom(e))&&!Ps(n,r,t)};return qs(!e,n).fold(function(){return qs(e,r).fold(M,o)},o)}(t,e,n,r)?P.none():e&&Bn(r.getNode())?Tw(t,e,n,r):!1===e&&Bn(r.getNode(!0))?Tw(t,e,n,r):e&&eg(n)?P.some(Ow.moveToPosition(r)):!1===e&&tg(n)?P.some(Ow.moveToPosition(r)):P.none();var o})},Ew=function(t,e,n){return function(t,e){var n=e.getNode(!1===t),r=t?"after":"before";return wn(n)&&n.getAttribute("data-mce-caret")===r}(e,n)?function(t,e){return t&&Bn(e.nextSibling)?P.some(Ow.moveToElement(e.nextSibling)):!1===t&&Bn(e.previousSibling)?P.some(Ow.moveToElement(e.previousSibling)):P.none()}(e,n.getNode(!1===e)).fold(function(){return _w(t,e,n)},P.some):_w(t,e,n).bind(function(e){return function(t,e,n){return n.fold(function(t){return P.some(Ow.remove(t))},function(t){return P.some(Ow.moveToElement(t))},function(n){return Ps(e,n,t)?P.none():P.some(Ow.moveToPosition(n))})}(t,n,e)})},Dw=function(t,e){return P.from(Lf(t.getBody(),e))},Aw=function(t,e){var n=t.selection.getNode();return Dw(t,n).filter(Bn).fold(function(){return function(t,e,n){var r=Ws(e?1:-1,t,n),o=wc.fromRangeStart(r),i=ye.fromDom(t);return!1===e&&eg(o)?P.some(Ow.remove(o.getNode(!0))):e&&tg(o)?P.some(Ow.remove(o.getNode())):!1===e&&tg(o)&&yg(i,o)?wg(i,o).map(function(t){return Ow.remove(t.getNode())}):e&&eg(o)&&bg(i,o)?xg(i,o).map(function(t){return Ow.remove(t.getNode())}):Ew(t,e,o)}(t.getBody(),e,t.selection.getRng()).exists(function(n){return n.fold(function(t,e){return function(n){return t._selectionOverrides.hideFakeCaret(),Yg(t,e,ye.fromDom(n)),!0}}(t,e),function(t,e){return function(n){var r=e?wc.before(n):wc.after(n);return t.selection.setRng(r.toRange()),!0}}(t,e),function(t){return function(e){return t.selection.setRng(e.toRange()),!0}}(t))})},z)},Nw=function(t,e){var n=t.selection.getNode();return!(!Bn(n)||Ln(n))&&Dw(t,n.parentNode).filter(Bn).fold(function(){var n;return n=ye.fromDom(t.getBody()),q(Aa(n,".mce-offscreen-selection"),un),Yg(t,e,ye.fromDom(t.selection.getNode())),Jy(t),!0},z)},Mw=function(t){var e=t.dom,n=t.selection,r=Lf(t.getBody(),n.getNode());if(Rn(r)&&e.isBlock(r)&&e.isEmpty(r)){var o=e.create("br",{"data-mce-bogus":"1"});e.setHTML(r,""),r.appendChild(o),n.setRng(wc.before(o).toRange())}return!0},zw=function(t,e){return t.selection.isCollapsed()?Aw(t,e):Nw(t,e)},Rw=function(t,e){return!!t.selection.isCollapsed()&&function(t,e){var n=wc.fromRangeStart(t.selection.getRng());return dl(e,t.getBody(),n).filter(function(t){return e?Km(t):Xm(t)}).bind(function(t){return P.from(Hs(e?0:-1,t))}).exists(function(e){return t.selection.select(e),!0})}(t,e)},Bw=En,Lw=function(t){return Bw(t)&&t.data[0]===so},Pw=function(t){return Bw(t)&&t.data[t.data.length-1]===so},Hw=function(t){return t.ownerDocument.createTextNode(so)},Iw=function(t,e){return t?function(t){if(Bw(t.previousSibling))return Pw(t.previousSibling)?t.previousSibling:(t.previousSibling.appendData(so),t.previousSibling);if(Bw(t))return Lw(t)?t:(t.insertData(0,so),t);var e=Hw(t);return t.parentNode.insertBefore(e,t),e}(e):function(t){if(Bw(t.nextSibling))return Lw(t.nextSibling)?t.nextSibling:(t.nextSibling.insertData(0,so),t.nextSibling);if(Bw(t))return Pw(t)?t:(t.appendData(so),t);var e=Hw(t);return t.nextSibling?t.parentNode.insertBefore(e,t.nextSibling):t.parentNode.appendChild(e),e}(e)},Fw=E(Iw,!0),Vw=E(Iw,!1),Uw=function(t,e){return En(t.container())?Iw(e,t.container()):Iw(e,t.getNode())},jw=function(t,e){var n=e.get();return n&&t.container()===n&&po(n)},Ww=function(t,e){return e.fold(function(e){hs(t.get());var n=Fw(e);return t.set(n),P.some(wc(n,n.length-1))},function(e){return bl(e).map(function(e){if(jw(e,t))return wc(t.get(),1);hs(t.get());var n=Uw(e,!0);return t.set(n),wc(n,1)})},function(e){return yl(e).map(function(e){if(jw(e,t))return wc(t.get(),t.get().length-1);hs(t.get());var n=Uw(e,!1);return t.set(n),wc(n,n.length-1)})},function(e){hs(t.get());var n=Vw(e);return t.set(n),P.some(wc(n,1))})},qw=function(t,e){for(var n=0;n<t.length;n++){var r=t[n].apply(null,e);if(r.isSome())return r}return P.none()},$w=hr([{before:["element"]},{start:["element"]},{end:["element"]},{after:["element"]}]),Gw=function(t,e){var n=Ls(e,t);return n||t},Kw=function(t,e,n){var r=Gy(n),o=Gw(e,r.container());return qy(t,o,r).fold(function(){return pl(o,r).bind(E(qy,t,o)).map(function(t){return $w.before(t)})},P.none)},Xw=function(t,e){return null===xl(t,e)},Yw=function(t,e,n){return qy(t,e,n).filter(E(Xw,e))},Jw=function(t,e,n){var r=Ky(n);return Yw(t,e,r).bind(function(t){return vl(t,r).isNone()?P.some($w.start(t)):P.none()})},Qw=function(t,e,n){var r=Gy(n);return Yw(t,e,r).bind(function(t){return pl(t,r).isNone()?P.some($w.end(t)):P.none()})},Zw=function(t,e,n){var r=Ky(n),o=Gw(e,r.container());return qy(t,o,r).fold(function(){return vl(o,r).bind(E(qy,t,o)).map(function(t){return $w.after(t)})},P.none)},tx=function(t){return!1===Wy(nx(t))},ex=function(t,e,n){return qw([Kw,Jw,Qw,Zw],[t,e,n]).filter(tx)},nx=function(t){return t.fold(T,T,T,T)},rx=function(t){return t.fold(O("before"),O("start"),O("end"),O("after"))},ox=function(t){return t.fold($w.before,$w.before,$w.after,$w.after)},ix=function(t){return t.fold($w.start,$w.start,$w.end,$w.end)},ux=function(t,e,n,r,o,i){return In(qy(e,n,r),qy(e,n,o),function(e,r){return e!==r&&function(t,e,n){var r=Ls(e,t),o=Ls(n,t);return r&&r===o}(n,e,r)?$w.after(t?e:r):i}).getOr(i)},ax=function(t,e){return t.fold(z,function(t){return r=e,!(rx(n=t)===rx(r)&&nx(n)===nx(r));var n,r})},cx=function(t,e){return t?e.fold(S(P.some,$w.start),P.none,S(P.some,$w.after),P.none):e.fold(P.none,S(P.some,$w.before),P.none,S(P.some,$w.end))},sx=function(t,e,n,r){var o=$y(t,r),i=ex(e,n,o);return ex(e,n,o).bind(E(cx,t)).orThunk(function(){return function(t,e,n,r,o){var i=$y(t,o);return dl(t,n,i).map(E($y,t)).fold(function(){return r.map(ox)},function(o){return ex(e,n,o).map(E(ux,t,e,n,i,o)).filter(E(ax,r))}).filter(tx)}(t,e,n,i,r)})};E(sx,!1),E(sx,!0);var lx,fx=function(t,e,n){var r=t?1:-1;return e.setRng(wc(n.container(),n.offset()+r).toRange()),e.getSel().modify("move",t?"forward":"backward","word"),!0},dx=function(t,e){var n=e.selection.getRng(),r=t?wc.fromRangeEnd(n):wc.fromRangeStart(n);return!!function(t){return w(t.selection.getSel().modify)}(e)&&(t&&yo(r)?fx(!0,e.selection,r):!(t||!wo(r))&&fx(!1,e.selection,r))};!function(t){t[t.Br=0]="Br",t[t.Block=1]="Block",t[t.Wrap=2]="Wrap",t[t.Eol=3]="Eol"}(lx||(lx={}));var mx,gx=function(t,e){return t===xc.Backwards?nt(e):e},hx=function(t,e,n){return t===xc.Forwards?e.next(n):e.prev(n)},px=function(t,e,n,r){return Mn(r.getNode(e===xc.Forwards))?lx.Br:!1===Ps(n,r)?lx.Block:lx.Wrap},vx=function(t,e,n,r){for(var o=al(n),i=r,u=[];i;){var a=hx(e,o,i);if(!a)break;if(Mn(a.getNode(!1)))return e===xc.Forwards?{positions:gx(e,u).concat([a]),breakType:lx.Br,breakAt:P.some(a)}:{positions:gx(e,u),breakType:lx.Br,breakAt:P.some(a)};if(a.isVisible()){if(t(i,a)){var c=px(0,e,i,a);return{positions:gx(e,u),breakType:c,breakAt:P.some(a)}}u.push(a),i=a}else i=a}return{positions:gx(e,u),breakType:lx.Eol,breakAt:P.none()}},bx=function(t,e,n,r){return e(n,r).breakAt.map(function(r){var o=e(n,r).positions;return t===xc.Backwards?o.concat(r):[r].concat(o)}).getOr([])},yx=function(t,e){return Y(t,function(t,n){return t.fold(function(){return P.some(n)},function(r){return In(ut(r.getClientRects()),ut(n.getClientRects()),function(t,o){var i=Math.abs(e-t.left);return Math.abs(e-o.left)<=i?n:r}).or(t)})},P.none())},wx=function(t,e){return ut(e.getClientRects()).bind(function(e){return yx(t,e.left)})},xx=E(vx,wc.isAbove,-1),Cx=E(vx,wc.isBelow,1),Sx=E(bx,-1,xx),kx=E(bx,1,Cx),Ox=function(t){var e=function(e){return W(e,function(e){var n=Ga(e);return n.node=t,n})};if(wn(t))return e(t.getClientRects());if(En(t)){var n=t.ownerDocument.createRange();return n.setStart(t,0),n.setEnd(t,t.data.length),e(n.getClientRects())}},Tx=function(t){return tt(t,Ox)};!function(t){t[t.Up=-1]="Up",t[t.Down=1]="Down"}(mx||(mx={}));var _x,Ex,Dx=function(t,e,n,r,o,i){var u=0,a=[],c=function(r){var i=Tx([r]);-1===t&&(i=i.reverse());for(var c=0;c<i.length;c++){var l=i[c];if(!n(l,s)){if(a.length>0&&e(l,Dt(a))&&u++,l.line=u,o(l))return!0;a.push(l)}}},s=Dt(i.getClientRects());if(!s)return a;var l=i.getNode();return c(l),function(t,e,n,r){for(;r=Bs(r,t,Lo,e);)if(n(r))return}(t,r,c,l),a},Ax=E(Dx,mx.Up,Ya,Ja),Nx=E(Dx,mx.Down,Ja,Ya),Mx=function(t){return function(e){return function(t,e){return e.line>t}(t,e)}},zx=function(t){return function(e){return function(t,e){return e.line===t}(t,e)}},Rx=Bn,Bx=Bs,Lx=function(t,e){return Math.abs(t.left-e)},Px=function(t,e){return Math.abs(t.right-e)},Hx=function(t,e){return t>=e.left&&t<=e.right},Ix=function(t,e){return t>=e.top&&t<=e.bottom},Fx=function(t,e,n){return void 0===n&&(n=z),_t(t,function(t,r){if(Hx(e,r))return n(r)?r:t;if(Hx(e,t))return n(t)?t:r;var o=Math.min(Lx(t,e),Px(t,e)),i=Math.min(Lx(r,e),Px(r,e));return i===o&&xt(r,"node")&&Rx(r.node)?r:i<o?r:t})},Vx=function(t,e,n,r,o){var i=Bx(r,t,Lo,e,!o);do{if(!i||n(i))return}while(i=Bx(i,t,Lo,e))},Ux=function(t,e,n){var r=Tx(function(t){return K(ct(t.getElementsByTagName("*")),ks)}(t)),o=K(r,E(Ix,n)),i=function(t){return!On(t.node)&&!Pn(t.node)},u=Fx(o,e,i);if(u){var a=i(u);if((u=Fx(function(t,e,n){void 0===n&&(n=!0);var r=[],o=function(t,n){var o=K(Tx([n]),function(n){return!t(n,e)});return r=r.concat(o),0===o.length};return r.push(e),Vx(mx.Up,t,E(o,Ya),e.node,n),Vx(mx.Down,t,E(o,Ja),e.node,n),r}(t,u,a),e,i))&&ks(u.node))return function(t,e){return{node:t.node,before:Lx(t,e)<Px(t,e)}}(u,e)}return null},jx=function(t,e){t.selection.setRng(e),Td(t,t.selection.getRng())},Wx=function(t,e,n){return P.some(ww(t,e,n))},qx=function(t,e,n,r,o,i){var u=e===xc.Forwards,a=al(t.getBody()),c=E(Ks,u?a.next:a.prev),s=u?r:o;if(!n.collapsed){var l=Za(n);if(i(l))return vw(e,t,l,e===xc.Backwards,!1)}var f=$s(e,t.getBody(),n);if(s(f))return bw(t,f.getNode(!u));var d=$y(u,c(f)),m=Oo(n);if(!d)return m?P.some(n):P.none();if(s(d))return vw(e,t,d.getNode(!u),u,!1);var g=c(d);return g&&s(g)&&Xs(d,g)?vw(e,t,g.getNode(!u),u,!1):m?Wx(t,d.toRange(),!1):P.none()},$x=function(t,e,n,r,o,i){var u=$s(e,t.getBody(),n),a=Dt(u.getClientRects()),c=e===mx.Down;if(!a)return P.none();var s,l=(c?Nx:Ax)(t.getBody(),Mx(1),u),f=K(l,zx(1)),d=a.left,m=Fx(f,d);if(m&&i(m.node)){var g=Math.abs(d-m.left),h=Math.abs(d-m.right);return vw(e,t,m.node,g<h,!1)}if(s=r(u)?u.getNode():o(u)?u.getNode(!0):Za(n)){var p=function(t,e,n,r){var o,i,u,a,c=al(e),s=[],l=0,f=function(t){return Dt(t.getClientRects())};1===t?(o=c.next,i=Ja,u=Ya,a=wc.after(r)):(o=c.prev,i=Ya,u=Ja,a=wc.before(r));var d=f(a);do{if(a.isVisible()){var m=f(a);if(!u(m,d)){s.length>0&&i(m,Dt(s))&&l++;var g=Ga(m);if(g.position=a,g.line=l,n(g))return s;s.push(g)}}}while(a=o(a));return s}(e,t.getBody(),Mx(1),s),v=Fx(K(p,zx(1)),d);if(v)return Wx(t,v.position.toRange(),!1);if(v=Dt(K(p,zx(0))))return Wx(t,v.position.toRange(),!1)}return 0===f.length?Gx(t,c).filter(c?o:r).map(function(e){return ww(t,e.toRange(),!1)}):P.none()},Gx=function(t,e){var n=t.selection.getRng(),r=t.getBody();if(e){var o=wc.fromRangeEnd(n),i=Cx(r,o);return at(i.positions)}o=wc.fromRangeStart(n),i=xx(r,o);return ut(i.positions)},Kx=function(t,e,n){return Gx(t,e).filter(n).exists(function(e){return t.selection.setRng(e.toRange()),!0})},Xx=function(t,e){var n=t.dom.createRng();n.setStart(e.container(),e.offset()),n.setEnd(e.container(),e.offset()),t.selection.setRng(n)},Yx=function(t,e){t?e.setAttribute("data-mce-selected","inline-boundary"):e.removeAttribute("data-mce-selected")},Jx=function(t,e,n){return Ww(e,n).map(function(e){return Xx(t,e),n})},Qx=function(t,e){if(t.selection.isCollapsed()&&!0!==t.composing&&e.get()){var n=wc.fromRangeStart(t.selection.getRng());wc.isTextPosition(n)&&!1===function(t){return yo(t)||wo(t)}(n)&&(Xx(t,gs(e.get(),n)),e.set(null))}},Zx=function(t,e,n){return!!os(t)&&function(t,e,n){var r=t.getBody(),o=wc.fromRangeStart(t.selection.getRng()),i=E(jy,t);return sx(n,i,r,o).bind(function(n){return Jx(t,e,n)})}(t,e,n).isSome()},tC=function(t,e,n){return!!os(e)&&dx(t,e)},eC=function(t){var e=ma(null),n=E(jy,t);return t.on("NodeChange",function(r){var o,i,u,a,c,s;!os(t)||de.browser.isIE()&&r.initial||(o=n,i=t.dom,u=r.parents,a=W(Aa(ye.fromDom(i.getRoot()),'*[data-mce-selected="inline-boundary"]'),function(t){return t.dom}),c=K(a,o),s=K(u,o),q(rt(c,s),E(Yx,!1)),q(rt(s,c),E(Yx,!0)),Qx(t,e),function(t,e,n,r){if(e.selection.isCollapsed()){var o=K(r,t);q(o,function(r){var o=wc.fromRangeStart(e.selection.getRng());ex(t,e.getBody(),o).bind(function(t){return Jx(e,n,t)})})}}(n,t,e,r.parents))}),e},nC=E(tC,!0),rC=E(tC,!1),oC=function(t,e,n){if(os(t)){var r=Gx(t,e).getOrThunk(function(){var n=t.selection.getRng();return e?wc.fromRangeEnd(n):wc.fromRangeStart(n)});return ex(E(jy,t),t.getBody(),r).exists(function(e){var r=ox(e);return Ww(n,r).exists(function(e){return Xx(t,e),!0})})}return!1},iC=function(t,e){return function(n){return Ww(e,n).exists(function(e){return Xx(t,e),!0})}},uC=function(t,e,n,r){var o=t.getBody(),i=E(jy,t);t.undoManager.ignore(function(){t.selection.setRng(function(t,e){var n=document.createRange();return n.setStart(t.container(),t.offset()),n.setEnd(e.container(),e.offset()),n}(n,r)),t.execCommand("Delete"),ex(i,o,wc.fromRangeStart(t.selection.getRng())).map(ix).map(iC(t,e))}),t.nodeChanged()},aC=function(t,e,n,r){var o=function(t,e){var n=Ls(e,t);return n||t}(t.getBody(),r.container()),i=E(jy,t),u=ex(i,o,r);return u.bind(function(t){return n?t.fold(O(P.some(ix(t))),P.none,O(P.some(ox(t))),P.none):t.fold(P.none,O(P.some(ox(t))),P.none,O(P.some(ix(t))))}).map(iC(t,e)).getOrThunk(function(){var a=ml(n,o,r),c=a.bind(function(t){return ex(i,o,t)});return In(u,c,function(){return qy(i,o,r).exists(function(e){return!!function(t){return In(bl(t),yl(t),function(e,n){var r=$y(!0,e),o=$y(!1,n);return pl(t,r).forall(function(t){return t.isEqual(o)})}).getOr(!0)}(e)&&(Yg(t,n,ye.fromDom(e)),!0)})}).orThunk(function(){return c.bind(function(o){return a.map(function(o){return n?uC(t,e,r,o):uC(t,e,o,r),!0})})}).getOr(!1)})},cC=function(t,e,n){if(t.selection.isCollapsed()&&os(t)){var r=wc.fromRangeStart(t.selection.getRng());return aC(t,e,n,r)}return!1},sC=function(t){return 1===qe(t)},lC=function(t,e,n,r){var o=E(fp,e),i=W(K(r,o),function(t){return t.dom});if(0===i.length)Yg(e,t,n);else{var u=function(t,e){var n=op(!1),r=cp(e,n.dom);return Ze(ye.fromDom(t),n),un(ye.fromDom(t)),wc(r,0)}(n.dom,i);e.selection.setRng(u.toRange())}},fC=function(t,e){var n=ye.fromDom(t.getBody()),r=ye.fromDom(t.selection.getStart()),o=K(function(t,e){var n=ag(e,t);return Z(n,to).fold(O(n),function(t){return n.slice(0,t)})}(n,r),sC);return at(o).exists(function(n){var r,i=wc.fromRangeStart(t.selection.getRng());return!(!function(t,e,n){return In(bl(n),yl(n),function(r,o){var i=$y(!0,r),u=$y(!1,o),a=$y(!1,e);return t?pl(n,a).exists(function(t){return t.isEqual(u)&&e.isEqual(i)}):vl(n,a).exists(function(t){return t.isEqual(i)&&e.isEqual(u)})}).getOr(!0)}(e,i,n.dom)||(r=n,wl(r.dom)&&np(r.dom)))&&(lC(e,t,n,o),!0)})},dC=function(t,e){return!!t.selection.isCollapsed()&&fC(t,e)},mC=function(t,e,n){return t._selectionOverrides.hideFakeCaret(),Yg(t,e,ye.fromDom(n)),!0},gC=function(t,e){return t.selection.isCollapsed()?function(t,e){var n=e?Ym:Jm,r=e?xc.Forwards:xc.Backwards,o=$s(r,t.getBody(),t.selection.getRng());return n(o)?mC(t,e,o.getNode(!e)):P.from($y(e,o)).filter(function(t){return n(t)&&Xs(o,t)}).exists(function(n){return mC(t,e,n.getNode(!e))})}(t,e):function(t,e){var n=t.selection.getNode();return!!Pn(n)&&mC(t,e,n)}(t,e)},hC=function(t){var e=parseInt(t,10);return isNaN(e)?0:e},pC=function(t,e){return(t||"table"===Te(e)?"margin":"padding")+("rtl"===Xn(e,"direction")?"-right":"-left")},vC=function(t){var e=yC(t);return!t.mode.isReadOnly()&&(e.length>1||function(t,e){return et(e,function(e){var n=pC(Zc(t),e),r=Jn(e,n).map(hC).getOr(0);return"false"!==t.dom.getContentEditable(e.dom)&&r>0})}(t,e))},bC=function(t){return oo(t)||io(t)},yC=function(t){return K((e=t.selection.getSelectedBlocks(),W(e,ye.fromDom)),function(t){return!bC(t)&&!function(t){return Le(t).exists(bC)}(t)&&Ir(t,function(t){return Rn(t.dom)||Bn(t.dom)}).exists(function(t){return Rn(t.dom)})});var e},wC=function(t,e){var n=t.dom,r=t.selection,o=t.formatter,i=function(t){return t.getParam("indentation","40px","string")}(t),u=/[a-z%]+$/i.exec(i)[0],a=parseInt(i,10),c=Zc(t),s=Gc(t);t.queryCommandState("InsertUnorderedList")||t.queryCommandState("InsertOrderedList")||""!==s||n.getParent(r.getNode(),n.isBlock)||o.apply("div"),q(yC(t),function(t){!function(t,e,n,r,o,i){var u=pC(n,ye.fromDom(i));if("outdent"===e){var a=Math.max(0,hC(i.style[u])-r);t.setStyle(i,u,a?a+o:"")}else a=hC(i.style[u])+r+o,t.setStyle(i,u,a)}(n,e,c,a,u,t.dom)})},xC=function(t,e){if(t.selection.isCollapsed()&&vC(t)){var n=t.dom,r=t.selection.getRng(),o=wc.fromRangeStart(r),i=n.getParent(r.startContainer,n.isBlock);if(null!==i&&dg(ye.fromDom(i),o))return wC(t,"outdent"),!0}return!1},CC=function(t,e){t.getDoc().execCommand(e,!1,null)},SC=function(t,e){t.addCommand("delete",function(){!function(t,e){xC(t)||zw(t,!1)||kw(t,!1)||cC(t,e,!1)||lw(t,!1)||Th(t)||Rw(t,!1)||gC(t,!1)||gw(t)||dC(t,!1)||(CC(t,"Delete"),Jy(t))}(t,e)}),t.addCommand("forwardDelete",function(){!function(t,e){zw(t,!0)||kw(t,!0)||cC(t,e,!0)||lw(t,!0)||Th(t)||Rw(t,!0)||gC(t,!0)||gw(t)||dC(t,!0)||CC(t,"ForwardDelete")}(t,e)})},kC=function(t){return void 0===t.touches||1!==t.touches.length?P.none():P.some(t.touches[0])},OC=function(t){var e=ya(),n=ma(!1),r=xa(function(e){t.fire("longpress",At(At({},e),{type:"longpress"})),n.set(!0)},400);t.on("touchstart",function(t){kC(t).each(function(o){r.cancel();var i={x:o.clientX,y:o.clientY,target:t.target};r.throttle(t),n.set(!1),e.set(i)})},!0),t.on("touchmove",function(o){r.cancel(),kC(o).each(function(r){e.on(function(o){(function(t,e){var n=Math.abs(t.clientX-e.x),r=Math.abs(t.clientY-e.y);return n>5||r>5})(r,o)&&(e.clear(),n.set(!1),t.fire("longpresscancel"))})})},!0),t.on("touchend touchcancel",function(o){r.cancel(),"touchcancel"!==o.type&&e.get().filter(function(t){return t.target.isEqualNode(o.target)}).each(function(){n.get()?o.preventDefault():t.fire("tap",At(At({},o),{type:"tap"}))})},!0)},TC=function(t,e){return wt(t,e.nodeName)},_C=function(t,e){return!!En(e)||!!wn(e)&&(!TC(t,e)&&!Ml(e))},EC=function(t,e){if(En(e)){if(0===e.nodeValue.length)return!0;if(/^\s+$/.test(e.nodeValue)&&(!e.nextSibling||TC(t,e.nextSibling)))return!0}return!1},DC=function(t){var e,n,r,o=t.dom,i=t.selection,u=t.schema,a=u.getBlockElements(),c=i.getStart(),s=t.getBody(),l=Gc(t);if(c&&wn(c)&&l){var f=s.nodeName.toLowerCase();if(u.isValidChild(f,l.toLowerCase())&&!function(t,e,n){return j(ug(ye.fromDom(n),ye.fromDom(e)),function(e){return TC(t,e.dom)})}(a,s,c)){var d=i.getRng(),m=d.startContainer,g=d.startOffset,h=d.endContainer,p=d.endOffset,v=nm(t);for(c=s.firstChild;c;)if(_C(a,c)){if(EC(a,c)){n=c,c=c.nextSibling,o.remove(n);continue}e||(e=o.create(l,Kc(t)),c.parentNode.insertBefore(e,c),r=!0),n=c,c=c.nextSibling,e.appendChild(n)}else e=null,c=c.nextSibling;r&&v&&(d.setStart(m,g),d.setEnd(h,p),i.setRng(d),t.nodeChanged())}}},AC=function(t,e){e.hasAttribute("data-mce-caret")&&(ko(e),function(t){t.selection.setRng(t.selection.getRng())}(t),t.selection.scrollIntoView(e))},NC=function(t,e){var n=function(t){return Ur(ye.fromDom(t.getBody()),"*[data-mce-caret]").map(function(t){return t.dom}).getOrNull()}(t);if(n)return"compositionstart"===e.type?(e.preventDefault(),e.stopPropagation(),void AC(t,n)):void(bo(n)&&(AC(t,n),t.undoManager.add()))},MC=Bn,zC=function(t,e,n){var r=al(t.getBody()),o=E(Ks,1===e?r.next:r.prev);if(n.collapsed&&function(t){return""!==Gc(t)}(t)){var i=t.dom.getParent(n.startContainer,"PRE");if(!i)return;if(!o(wc.fromRangeStart(n))){var u=function(t){var e=t.dom.create(Gc(t));return(!de.ie||de.ie>=11)&&(e.innerHTML='<br data-mce-bogus="1">'),e}(t);1===e?t.$(i).after(u):t.$(i).before(u),t.selection.select(u,!0),t.selection.collapse()}}},RC=function(t,e){var n=e?xc.Forwards:xc.Backwards,r=t.selection.getRng();return function(t,e,n){return qx(e,t,n,tg,eg,MC)}(n,t,r).orThunk(function(){return zC(t,n,r),P.none()})},BC=function(t,e){var n=e?1:-1,r=t.selection.getRng();return function(t,e,n){return $x(e,t,n,function(t){return tg(t)||Qm(t)},function(t){return eg(t)||Zm(t)},MC)}(n,t,r).orThunk(function(){return zC(t,n,r),P.none()})},LC=function(t,e){return RC(t,e).exists(function(e){return jx(t,e),!0})},PC=function(t,e){return BC(t,e).exists(function(e){return jx(t,e),!0})},HC=function(t,e){return Kx(t,e,e?eg:tg)},IC=function(t){return U(["figcaption"],Te(t))},FC=function(t){var e=document.createRange();return e.setStartBefore(t.dom),e.setEndBefore(t.dom),e},VC=function(t,e,n){n?nn(t,e):en(t,e)},UC=function(t,e,n,r){return""===e?function(t,e){var n=ye.fromTag("br");return VC(t,n,e),FC(n)}(t,r):function(t,e,n,r){var o=ye.fromTag(n),i=ye.fromTag("br");return jn(o,r),nn(o,i),VC(t,o,e),FC(i)}(t,r,e,n)},jC=function(t,e,n){return e?function(t,e){return Cx(t,e).breakAt.isNone()}(t.dom,n):function(t,e){return xx(t,e).breakAt.isNone()}(t.dom,n)},WC=function(t,e){var n=ye.fromDom(t.getBody()),r=wc.fromRangeStart(t.selection.getRng()),o=Gc(t),i=Kc(t);return function(t,e){var n=E(Se,e);return Ir(ye.fromDom(t.container()),to,n).filter(IC)}(r,n).exists(function(){if(jC(n,e,r)){var u=UC(n,o,i,e);return t.selection.setRng(u),!0}return!1})},qC=function(t,e){return!!t.selection.isCollapsed()&&WC(t,e)},$C=function(t,e){return tt(function(t){return W(t,function(t){return At({shiftKey:!1,altKey:!1,ctrlKey:!1,metaKey:!1,keyCode:0,action:C},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]:[]})},GC=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return function(){return t.apply(null,e)}},KC=function(t,e){return Q($C(t,e),function(t){return t.action()})},XC=function(t,e){var n=e?xc.Forwards:xc.Backwards,r=t.selection.getRng();return qx(t,n,r,Ym,Jm,Pn).exists(function(e){return jx(t,e),!0})},YC=function(t,e){var n=e?1:-1,r=t.selection.getRng();return $x(t,n,r,Ym,Jm,Pn).exists(function(e){return jx(t,e),!0})},JC=function(t,e){return Kx(t,e,e?Jm:Ym)},QC=function(t,e,n,r,o){var i=Aa(ye.fromDom(n),"td,th,caption").map(function(t){return t.dom});return function(t,e,n){return Y(t,function(t,r){return t.fold(function(){return P.some(r)},function(t){var o=Math.sqrt(Math.abs(t.x-e)+Math.abs(t.y-n)),i=Math.sqrt(Math.abs(r.x-e)+Math.abs(r.y-n));return P.some(i<o?r:t)})},P.none())}(K(function(t,e){return tt(e,function(e){var n=function(t,e){return{left:t.left-e,top:t.top-e,right:t.right+2*e,bottom:t.bottom+2*e,width:t.width+e,height:t.height+e}}(Ga(e.getBoundingClientRect()),-1);return[{x:n.left,y:t(n),cell:e},{x:n.right,y:t(n),cell:e}]})}(t,i),function(t){return e(t,o)}),r,o).map(function(t){return t.cell})},ZC=E(QC,function(t){return t.bottom},function(t,e){return t.y<e}),tS=E(QC,function(t){return t.top},function(t,e){return t.y>e}),eS=function(t,e){return ut(e.getClientRects()).bind(function(e){return ZC(t,e.left,e.top)}).bind(function(t){return wx(yl(n=t).map(function(t){return xx(n,t).positions.concat(t)}).getOr([]),e);var n})},nS=function(t,e){return at(e.getClientRects()).bind(function(e){return tS(t,e.left,e.top)}).bind(function(t){return wx(bl(n=t).map(function(t){return[t].concat(Cx(n,t).positions)}).getOr([]),e);var n})},rS=function(t,e,n){var r=t(e,n);return function(t){return t.breakType===lx.Wrap&&0===t.positions.length}(r)||!Mn(n.getNode())&&function(t){return t.breakType===lx.Br&&1===t.positions.length}(r)?!function(t,e,n){return n.breakAt.exists(function(n){return t(e,n).breakAt.isSome()})}(t,e,r):r.breakAt.isNone()},oS=E(rS,xx),iS=E(rS,Cx),uS=function(t,e,n,r){var o=t.selection.getRng(),i=e?1:-1;return!(!Cs()||!function(t,e,n){var r=wc.fromRangeStart(e);return hl(!t,n).exists(function(t){return t.isEqual(r)})}(e,o,n))&&(vw(i,t,n,!e,!1).each(function(e){jx(t,e)}),!0)},aS=function(t,e){var n=e.getNode(t);return wn(n)&&"TABLE"===n.nodeName?P.some(n):P.none()},cS=function(t,e,n){var r=aS(!!e,n),o=!1===e;r.fold(function(){return jx(t,n.toRange())},function(r){return hl(o,t.getBody()).filter(function(t){return t.isEqual(n)}).fold(function(){return jx(t,n.toRange())},function(o){return function(t,e,n,r){var o=Gc(e);o?e.undoManager.transact(function(){var r=ye.fromTag(o);jn(r,Kc(e)),nn(r,ye.fromTag("br")),t?tn(ye.fromDom(n),r):Ze(ye.fromDom(n),r);var i=e.dom.createRng();i.setStart(r.dom,0),i.setEnd(r.dom,0),jx(e,i)}):jx(e,r.toRange())}(e,t,r,n)})})},sS=function(t,e,n,r){var o=t.selection.getRng(),i=wc.fromRangeStart(o),u=t.getBody();if(!e&&oS(r,i)){var a=function(t,e,n){return eS(e,n).orThunk(function(){return ut(n.getClientRects()).bind(function(n){return yx(Sx(t,wc.before(e)),n.left)})}).getOr(wc.before(e))}(u,n,i);return cS(t,e,a),!0}if(e&&iS(r,i)){a=function(t,e,n){return nS(e,n).orThunk(function(){return ut(n.getClientRects()).bind(function(n){return yx(kx(t,wc.after(e)),n.left)})}).getOr(wc.after(e))}(u,n,i);return cS(t,e,a),!0}return!1},lS=function(t,e,n){return P.from(t.dom.getParent(t.selection.getNode(),"td,th")).bind(function(r){return P.from(t.dom.getParent(r,"table")).map(function(o){return n(t,e,o,r)})}).getOr(!1)},fS=function(t,e){return lS(t,e,uS)},dS=function(t,e){return lS(t,e,sS)},mS=function(t,e){t.on("keydown",function(n){!1===n.isDefaultPrevented()&&function(t,e,n){var r=re().os;KC([{keyCode:Vf.RIGHT,action:GC(LC,t,!0)},{keyCode:Vf.LEFT,action:GC(LC,t,!1)},{keyCode:Vf.UP,action:GC(PC,t,!1)},{keyCode:Vf.DOWN,action:GC(PC,t,!0)},{keyCode:Vf.RIGHT,action:GC(fS,t,!0)},{keyCode:Vf.LEFT,action:GC(fS,t,!1)},{keyCode:Vf.UP,action:GC(dS,t,!1)},{keyCode:Vf.DOWN,action:GC(dS,t,!0)},{keyCode:Vf.RIGHT,action:GC(XC,t,!0)},{keyCode:Vf.LEFT,action:GC(XC,t,!1)},{keyCode:Vf.UP,action:GC(YC,t,!1)},{keyCode:Vf.DOWN,action:GC(YC,t,!0)},{keyCode:Vf.RIGHT,action:GC(Zx,t,e,!0)},{keyCode:Vf.LEFT,action:GC(Zx,t,e,!1)},{keyCode:Vf.RIGHT,ctrlKey:!r.isOSX(),altKey:r.isOSX(),action:GC(nC,t,e)},{keyCode:Vf.LEFT,ctrlKey:!r.isOSX(),altKey:r.isOSX(),action:GC(rC,t,e)},{keyCode:Vf.UP,action:GC(qC,t,!1)},{keyCode:Vf.DOWN,action:GC(qC,t,!0)}],n).each(function(t){n.preventDefault()})}(t,e,n)})},gS=function(t,e){t.on("keydown",function(n){!1===n.isDefaultPrevented()&&function(t,e,n){KC([{keyCode:Vf.BACKSPACE,action:GC(xC,t,!1)},{keyCode:Vf.BACKSPACE,action:GC(zw,t,!1)},{keyCode:Vf.DELETE,action:GC(zw,t,!0)},{keyCode:Vf.BACKSPACE,action:GC(kw,t,!1)},{keyCode:Vf.DELETE,action:GC(kw,t,!0)},{keyCode:Vf.BACKSPACE,action:GC(cC,t,e,!1)},{keyCode:Vf.DELETE,action:GC(cC,t,e,!0)},{keyCode:Vf.BACKSPACE,action:GC(Th,t,!1)},{keyCode:Vf.DELETE,action:GC(Th,t,!0)},{keyCode:Vf.BACKSPACE,action:GC(Rw,t,!1)},{keyCode:Vf.DELETE,action:GC(Rw,t,!0)},{keyCode:Vf.BACKSPACE,action:GC(gC,t,!1)},{keyCode:Vf.DELETE,action:GC(gC,t,!0)},{keyCode:Vf.BACKSPACE,action:GC(gw,t,!1)},{keyCode:Vf.DELETE,action:GC(gw,t,!0)},{keyCode:Vf.BACKSPACE,action:GC(lw,t,!1)},{keyCode:Vf.DELETE,action:GC(lw,t,!0)},{keyCode:Vf.BACKSPACE,action:GC(dC,t,!1)},{keyCode:Vf.DELETE,action:GC(dC,t,!0)}],n).each(function(t){n.preventDefault()})}(t,e,n)}),t.on("keyup",function(e){!1===e.isDefaultPrevented()&&function(t,e){KC([{keyCode:Vf.BACKSPACE,action:GC(Mw,t)},{keyCode:Vf.DELETE,action:GC(Mw,t)}],e)}(t,e)})},hS=function(t,e){var n,r=e,o=t.dom,i=t.schema.getMoveCaretBeforeOnEnterElements();if(e){if(/^(LI|DT|DD)$/.test(e.nodeName)){var u=function(t){for(;t;){if(1===t.nodeType||3===t.nodeType&&t.data&&/[\r\n\s]/.test(t.data))return t;t=t.nextSibling}}(e.firstChild);u&&/^(UL|OL|DL)$/.test(u.nodeName)&&e.insertBefore(o.doc.createTextNode(" "),e.firstChild)}var a=o.createRng();if(e.normalize(),e.hasChildNodes()){for(var c=new Jr(e,e);n=c.current();){if(En(n)){a.setStart(n,0),a.setEnd(n,0);break}if(i[n.nodeName.toLowerCase()]){a.setStartBefore(n),a.setEndBefore(n);break}r=n,n=c.next()}n||(a.setStart(r,0),a.setEnd(r,0))}else Mn(e)?e.nextSibling&&o.isBlock(e.nextSibling)?(a.setStartBefore(e),a.setEndBefore(e)):(a.setStartAfter(e),a.setEndAfter(e)):(a.setStart(e,0),a.setEnd(e,0));t.selection.setRng(a),Td(t,a)}},pS=function(t){return P.from(t.dom.getParent(t.selection.getStart(!0),t.dom.isBlock))},vS=function(t,e){return t&&t.parentNode&&t.parentNode.nodeName===e},bS=function(t){return t&&/^(OL|UL|LI)$/.test(t.nodeName)},yS=function(t){var e=t.parentNode;return/^(LI|DT|DD)$/.test(e.nodeName)?e:t},wS=function(t,e,n){for(var r=t[n?"firstChild":"lastChild"];r&&!wn(r);)r=r[n?"nextSibling":"previousSibling"];return r===e},xS=function(t,e,n,r,o){var i=t.dom,u=t.selection.getRng();if(n!==t.getBody()){var a;bS(a=n)&&bS(a.parentNode)&&(o="LI");var c=o?e(o):i.create("BR");if(wS(n,r,!0)&&wS(n,r,!1))if(vS(n,"LI")){var s=yS(n);i.insertAfter(c,s),!function(t){var e;return(null===(e=t.parentNode)||void 0===e?void 0:e.firstChild)===t}(n)?i.remove(n):i.remove(s)}else i.replace(c,n);else if(wS(n,r,!0))vS(n,"LI")?(i.insertAfter(c,yS(n)),c.appendChild(i.doc.createTextNode(" ")),c.appendChild(n)):n.parentNode.insertBefore(c,n),i.remove(r);else if(wS(n,r,!1))i.insertAfter(c,yS(n)),i.remove(r);else{n=yS(n);var l=u.cloneRange();l.setStartAfter(r),l.setEndAfter(n);var f=l.extractContents();"LI"===o&&function(t,e){return t.firstChild&&t.firstChild.nodeName===e}(f,"LI")?(c=f.firstChild,i.insertAfter(f,n)):(i.insertAfter(f,n),i.insertAfter(c,n)),i.remove(r)}hS(t,c)}},CS=function(t,e){return e&&"A"===e.nodeName&&t.isEmpty(e)},SS=function(t){t.innerHTML='<br data-mce-bogus="1">'},kS=function(t,e){return t.nodeName===e||t.previousSibling&&t.previousSibling.nodeName===e},OS=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)},TS=function(t,e,n){return!1===En(e)?n:t?1===n&&e.data.charAt(n-1)===so?0:n:n===e.data.length-1&&e.data.charAt(n)===so?e.data.length:n},_S=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},ES=function(t,e){var n=Gc(t);n&&n.toLowerCase()===e.tagName.toLowerCase()&&function(t,e,n){var r=t.dom;P.from(n.style).map(r.parseStyle).each(function(t){var n=Qn(ye.fromDom(e)),o=At(At({},n),t);r.setStyles(e,o)});var o=P.from(n.class).map(function(t){return t.split(/\s+/)}),i=P.from(e.className).map(function(t){return K(t.split(/\s+/),function(t){return""!==t})});In(o,i,function(t,n){var o=K(n,function(e){return!U(t,e)}),i=Nt(Nt([],t,!0),o,!0);r.setAttrib(e,"class",i.join(" "))});var u=["style","class"],a=vt(n,function(t,e){return!U(u,e)});r.setAttribs(e,a)}(t,e,Kc(t))},DS=function(t,e){var n,r,o,i,u,a,c,s,l,f,d=t.dom,m=t.schema,g=m.getNonEmptyElements(),h=t.selection.getRng(),p=function(e){var n,o,u,a=r,c=m.getTextInlineElements();if(u=n=e||"TABLE"===s||"HR"===s?d.create(e||l):i.cloneNode(!1),!1===function(t){return t.getParam("keep_styles",!0)}(t))d.setAttrib(n,"style",null),d.setAttrib(n,"class",null);else do{if(c[a.nodeName]){if(wl(a)||Ml(a))continue;o=a.cloneNode(!1),d.setAttrib(o,"id",""),n.hasChildNodes()?(o.appendChild(n.firstChild),n.appendChild(o)):(u=o,n.appendChild(o))}}while((a=a.parentNode)&&a!==x);return ES(t,n),SS(u),n},v=function(t){var e,n,u=TS(t,r,o);if(En(r)&&(t?u>0:u<r.nodeValue.length))return!1;if(r.parentNode===i&&f&&!t)return!0;if(t&&wn(r)&&r===i.firstChild)return!0;if(kS(r,"TABLE")||kS(r,"HR"))return f&&!t||!f&&t;var a=new Jr(r,i);for(En(r)&&(t&&0===u?a.prev():t||u!==r.nodeValue.length||a.next());e=a.current();){if(wn(e)){if(!e.getAttribute("data-mce-bogus")&&(n=e.nodeName.toLowerCase(),g[n]&&"br"!==n))return!1}else if(En(e)&&!Ho(e.nodeValue))return!1;t?a.prev():a.next()}return!0},b=function(){u=/^(H[1-6]|PRE|FIGURE)$/.test(s)&&"HGROUP"!==C?p(l):p(),function(t){return t.getParam("end_container_on_empty_block",!1)}(t)&&OS(d,c)&&d.isEmpty(i)?u=d.split(c,i):d.insertAfter(u,i),hS(t,u)};ed(d,h).each(function(t){h.setStart(t.startContainer,t.startOffset),h.setEnd(t.endContainer,t.endOffset)}),r=h.startContainer,o=h.startOffset,l=Gc(t);var y=!(!e||!e.shiftKey),w=!(!e||!e.ctrlKey);wn(r)&&r.hasChildNodes()&&(f=o>r.childNodes.length-1,r=r.childNodes[Math.min(o,r.childNodes.length-1)]||r,o=f&&En(r)?r.nodeValue.length:0);var x=_S(d,r);if(x){(l&&!y||!l&&y)&&(r=function(t,e,n,r,o){var i,u,a,c,s,l,f=e||"P",d=t.dom,m=_S(d,r);if(!(u=d.getParent(r,d.isBlock))||!OS(d,u)){if(l=(u=u||m)===t.getBody()||function(t){return t&&/^(TD|TH|CAPTION)$/.test(t.nodeName)}(u)?u.nodeName.toLowerCase():u.parentNode.nodeName.toLowerCase(),!u.hasChildNodes())return i=d.create(f),ES(t,i),u.appendChild(i),n.setStart(i,0),n.setEnd(i,0),i;for(c=r;c.parentNode!==u;)c=c.parentNode;for(;c&&!d.isBlock(c);)a=c,c=c.previousSibling;if(a&&t.schema.isValidChild(l,f.toLowerCase())){for(i=d.create(f),ES(t,i),a.parentNode.insertBefore(i,a),c=a;c&&!d.isBlock(c);)s=c.nextSibling,i.appendChild(c),c=s;n.setStart(r,o),n.setEnd(r,o)}}return r}(t,l,h,r,o)),i=d.getParent(r,d.isBlock),c=i?d.getParent(i.parentNode,d.isBlock):null,s=i?i.nodeName.toUpperCase():"";var C=c?c.nodeName.toUpperCase():"";"LI"!==C||w||(i=c,c=c.parentNode,s=C),/^(LI|DT|DD)$/.test(s)&&d.isEmpty(i)?xS(t,p,c,i,l):l&&i===t.getBody()||(l=l||"P",ho(i)?(u=ko(i),d.isEmpty(i)&&SS(i),ES(t,u),hS(t,u)):v()?b():v(!0)?(u=i.parentNode.insertBefore(p(),i),hS(t,kS(i,"HR")?u:i)):((n=function(t){var e=t.cloneRange();return e.setStart(t.startContainer,TS(!0,t.startContainer,t.startOffset)),e.setEnd(t.endContainer,TS(!1,t.endContainer,t.endOffset)),e}(h).cloneRange()).setEndAfter(i),function(t){q(Da(ye.fromDom(t),Ae),function(t){var e=t.dom;e.nodeValue=fo(e.nodeValue)})}(a=n.extractContents()),function(t){do{En(t)&&(t.nodeValue=t.nodeValue.replace(/^[\r\n]+/,"")),t=t.firstChild}while(t)}(a),u=a.firstChild,d.insertAfter(a,i),function(t,e,n){var r,o=n,i=[];if(o){for(;o=o.firstChild;){if(t.isBlock(o))return;wn(o)&&!e[o.nodeName.toLowerCase()]&&i.push(o)}for(r=i.length;r--;)!(o=i[r]).hasChildNodes()||o.firstChild===o.lastChild&&""===o.firstChild.nodeValue?t.remove(o):CS(t,o)&&t.remove(o)}}(d,g,u),function(t,e){e.normalize();var n=e.lastChild;n&&!/^(left|right)$/gi.test(t.getStyle(n,"float",!0))||t.add(e,"br")}(d,i),d.isEmpty(i)&&SS(i),u.normalize(),d.isEmpty(u)?(d.remove(u),b()):(ES(t,u),hS(t,u))),d.setAttrib(u,"id",""),t.fire("NewBlock",{newBlock:u}))}},AS=function(t,e,n){var r=t.dom.createRng();n?(r.setStartBefore(e),r.setEndBefore(e)):(r.setStartAfter(e),r.setEndAfter(e)),t.selection.setRng(r),Td(t,r)},NS=function(t,e){var n,r,o=t.selection,i=t.dom,u=o.getRng();ed(i,u).each(function(t){u.setStart(t.startContainer,t.startOffset),u.setEnd(t.endContainer,t.endOffset)});var a=u.startOffset,c=u.startContainer;if(1===c.nodeType&&c.hasChildNodes()){var s=a>c.childNodes.length-1;c=c.childNodes[Math.min(a,c.childNodes.length-1)]||c,a=s&&3===c.nodeType?c.nodeValue.length:0}var l=i.getParent(c,i.isBlock),f=l?i.getParent(l.parentNode,i.isBlock):null,d=f?f.nodeName.toUpperCase():"",m=!(!e||!e.ctrlKey);"LI"!==d||m||(l=f),c&&3===c.nodeType&&a>=c.nodeValue.length&&(function(t,e,n){for(var r,o=new Jr(e,n),i=t.getNonEmptyElements();r=o.next();)if(i[r.nodeName.toLowerCase()]||r.length>0)return!0}(t.schema,c,l)||(n=i.create("br"),u.insertNode(n),u.setStartAfter(n),u.setEndAfter(n),r=!0)),n=i.create("br"),Sc(i,u,n),AS(t,n,r),t.undoManager.add()},MS=function(t,e){var n=ye.fromTag("br");Ze(ye.fromDom(e),n),t.undoManager.add()},zS=function(t,e){RS(t.getBody(),e)||tn(ye.fromDom(e),ye.fromTag("br"));var n=ye.fromTag("br");tn(ye.fromDom(e),n),AS(t,n.dom,!1),t.undoManager.add()},RS=function(t,e){return n=wc.after(e),!!Mn(n.getNode())||pl(t,wc.after(e)).map(function(t){return Mn(t.getNode())}).getOr(!1);var n},BS=function(t){return t&&"A"===t.nodeName&&"href"in t},LS=function(t){return t.fold(M,BS,BS,M)},PS=function(t,e){e.fold(C,E(MS,t),E(zS,t),C)},HS=function(t,e){var n=function(t){var e=E(jy,t),n=wc.fromRangeStart(t.selection.getRng());return ex(e,t.getBody(),n).filter(LS)}(t);n.isSome()?n.each(E(PS,t)):NS(t,e)},IS=function(t,e){return pS(t).filter(function(t){return e.length>0&&xe(ye.fromDom(t),e)}).isSome()},FS=hr([{br:[]},{block:[]},{none:[]}]),VS=function(t,e){return function(t){return IS(t,function(t){return t.getParam("no_newline_selector","")}(t))}(t)},US=function(t){return function(e,n){return""===Gc(e)===t}},jS=function(t){return function(e,n){return function(t){return pS(t).filter(function(t){return io(ye.fromDom(t))}).isSome()}(e)===t}},WS=function(t,e){return function(n,r){return function(t){return pS(t).fold(O(""),function(t){return t.nodeName.toUpperCase()})}(n)===t.toUpperCase()===e}},qS=function(t){return WS("pre",t)},$S=function(t){return function(e,n){return function(t){return t.getParam("br_in_pre",!0)}(e)===t}},GS=function(t,e){return function(t){return IS(t,function(t){return t.getParam("br_newline_selector",".mce-toc h2,figcaption,caption")}(t))}(t)},KS=function(t,e){return e},XS=function(t){var e=Gc(t),n=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}(t.dom,t.selection.getStart());return n&&t.schema.isValidChild(n.nodeName,e||"P")},YS=function(t,e){return function(n,r){return Y(t,function(t,e){return t&&e(n,r)},!0)?P.some(e):P.none()}},JS=function(t,e){return qw([YS([VS],FS.none()),YS([WS("summary",!0)],FS.br()),YS([qS(!0),$S(!1),KS],FS.br()),YS([qS(!0),$S(!1)],FS.block()),YS([qS(!0),$S(!0),KS],FS.block()),YS([qS(!0),$S(!0)],FS.br()),YS([jS(!0),KS],FS.br()),YS([jS(!0)],FS.block()),YS([US(!0),KS,XS],FS.block()),YS([US(!0)],FS.br()),YS([GS],FS.br()),YS([US(!1),KS],FS.br()),YS([XS],FS.block())],[t,!(!e||!e.shiftKey)]).getOr(FS.none())},QS=function(t,e){JS(t,e).fold(function(){HS(t,e)},function(){DS(t,e)},C)},ZS=function(t){t.on("keydown",function(e){e.keyCode===Vf.ENTER&&function(t,e){var n;e.isDefaultPrevented()||(e.preventDefault(),(n=t.undoManager).typing&&(n.typing=!1,n.add()),t.undoManager.transact(function(){!1===t.selection.isCollapsed()&&t.execCommand("Delete"),QS(t,e)}))}(t,e)})},tk=function(t,e){t.on("keydown",function(n){!1===n.isDefaultPrevented()&&function(t,e,n){KC([{keyCode:Vf.END,action:GC(HC,t,!0)},{keyCode:Vf.HOME,action:GC(HC,t,!1)},{keyCode:Vf.END,action:GC(JC,t,!0)},{keyCode:Vf.HOME,action:GC(JC,t,!1)},{keyCode:Vf.END,action:GC(oC,t,!0,e)},{keyCode:Vf.HOME,action:GC(oC,t,!1,e)}],n).each(function(t){n.preventDefault()})}(t,e,n)})},ek=re().browser,nk=function(t){!function(t){var e=wa(function(){t.composing||Bg(t)},0);ek.isIE()&&(t.on("keypress",function(t){e.throttle()}),t.on("remove",function(t){e.cancel()}))}(t),t.on("input",function(e){!1===e.isComposing&&Bg(t)})},rk=re(),ok=function(t){return t.stopImmediatePropagation()},ik=function(t){return t.keyCode===Vf.PAGE_UP||t.keyCode===Vf.PAGE_DOWN},uk=function(t,e,n){n&&!t.get()?e.on("NodeChange",ok,!0):!n&&t.get()&&e.off("NodeChange",ok),t.set(n)},ak=function(t,e){if(!rk.os.isOSX()){var n=ma(!1);t.on("keydown",function(e){ik(e)&&uk(n,t,!0)}),t.on("keyup",function(r){!1===r.isDefaultPrevented()&&function(t,e,n){KC([{keyCode:Vf.PAGE_UP,action:GC(oC,t,!1,e)},{keyCode:Vf.PAGE_DOWN,action:GC(oC,t,!0,e)}],n)}(t,e,r),ik(r)&&n.get()&&(uk(n,t,!1),t.nodeChanged())})}},ck=function(t,e){var n=e.container(),r=e.offset();return En(n)?(n.insertData(r,t),P.some(wc(n,r+t.length))):Gs(e).map(function(n){var r=ye.fromText(t);return e.isAtEnd()?tn(n,r):Ze(n,r),wc(r.dom,t.length)})},sk=E(ck," "),lk=E(ck," "),fk=function(t,e){return function(n){return function(t,e){return!Tg(e)&&(_g(t,e)||kg(t,e)||Og(t,e))}(t,n)?sk(e):lk(e)}},dk=function(t){var e=wc.fromRangeStart(t.selection.getRng()),n=ye.fromDom(t.getBody());if(t.selection.isCollapsed()){var r=E(jy,t),o=wc.fromRangeStart(t.selection.getRng());return ex(r,t.getBody(),o).bind(function(t){return function(e){return e.fold(function(e){return vl(t.dom,wc.before(e))},function(t){return bl(t)},function(t){return yl(t)},function(e){return pl(t.dom,wc.after(e))})}}(n)).bind(fk(n,e)).exists(function(t){return function(e){return t.selection.setRng(e.toRange()),t.nodeChanged(),!0}}(t))}return!1},mk=function(t){t.on("keydown",function(e){!1===e.isDefaultPrevented()&&function(t,e){KC([{keyCode:Vf.SPACEBAR,action:GC(dk,t)}],e).each(function(t){e.preventDefault()})}(t,e)})},gk=function(t){var e=eC(t);return function(t){t.on("keyup compositionstart",E(NC,t))}(t),mS(t,e),gS(t,e),ZS(t),mk(t),nk(t),tk(t,e),ak(t,e),e},hk=function(){function t(t){var e;this.lastPath=[],this.editor=t;var n=this;"onselectionchange"in t.getDoc()||t.on("NodeChange click mouseup keyup focus",function(n){var r=t.selection.getRng(),o={startContainer:r.startContainer,startOffset:r.startOffset,endContainer:r.endContainer,endOffset:r.endOffset};"nodechange"!==n.type&&$f(o,e)||t.fire("SelectionChange"),e=o}),t.on("contextmenu",function(){t.fire("SelectionChange")}),t.on("SelectionChange",function(){var e=t.selection.getStart(!0);!e||!de.range&&t.selection.isCollapsed()||Of(t)&&!n.isSameElementPath(e)&&t.dom.isChildOf(e,t.getBody())&&t.nodeChanged({selectionChange:!0})}),t.on("mouseup",function(e){!e.isDefaultPrevented()&&Of(t)&&("IMG"===t.selection.getNode().nodeName?Kr.setEditorTimeout(t,function(){t.nodeChanged()}):t.nodeChanged())})}return t.prototype.nodeChanged=function(t){var e,n,r,o=this.editor.selection;this.editor.initialized&&o&&!this.editor.getParam("disable_nodechange")&&!this.editor.mode.isReadOnly()&&(r=this.editor.getBody(),(e=o.getStart(!0)||r).ownerDocument===this.editor.getDoc()&&this.editor.dom.isChildOf(e,r)||(e=r),n=[],this.editor.dom.getParent(e,function(t){if(t===r)return!0;n.push(t)}),(t=t||{}).element=e,t.parents=n,this.editor.fire("NodeChange",t))},t.prototype.isSameElementPath=function(t){var e,n=this.editor.$(t).parentsUntil(this.editor.getBody()).add(t);if(n.length===this.lastPath.length){for(e=n.length;e>=0&&n[e]===this.lastPath[e];e--);if(-1===e)return this.lastPath=n,!0}return this.lastPath=n,!1},t}(),pk=function(t){!function(t){t.on("click",function(e){t.dom.getParent(e.target,"details")&&e.preventDefault()})}(t),function(t){t.parser.addNodeFilter("details",function(t){q(t,function(t){t.attr("data-mce-open",t.attr("open")),t.attr("open","open")})}),t.serializer.addNodeFilter("details",function(t){q(t,function(t){var e=t.attr("data-mce-open");t.attr("open",d(e)?e:null),t.attr("data-mce-open",null)})})}(t)},vk=function(t){return wn(t)&&ro(ye.fromDom(t))},bk=function(t){t.on("click",function(e){e.detail>=3&&function(t){var e=t.selection.getRng(),n=wc.fromRangeStart(e),r=wc.fromRangeEnd(e);if(wc.isElementPosition(n)){var o=n.container();vk(o)&&bl(o).each(function(t){return e.setStart(t.container(),t.offset())})}wc.isElementPosition(r)&&(o=n.container(),vk(o)&&yl(o).each(function(t){return e.setEnd(t.container(),t.offset())}));t.selection.setRng(Eh(e))}(t)})},yk=function(t){var e=t.getBoundingClientRect(),n=t.ownerDocument,r=n.documentElement,o=n.defaultView;return{top:e.top+o.pageYOffset-r.clientTop,left:e.left+o.pageXOffset-r.clientLeft}},wk=function(t,e){return n=function(t){return t.inline?yk(t.getBody()):{left:0,top:0}}(t),r=function(t){var e=t.getBody();return t.inline?{left:e.scrollLeft,top:e.scrollTop}:{left:0,top:0}}(t),{pageX:(o=function(t,e){if(e.target.ownerDocument!==t.getDoc()){var n=yk(t.getContentAreaContainer()),r=function(t){var e=t.getBody(),n=t.getDoc().documentElement,r={left:e.scrollLeft,top:e.scrollTop},o={left:e.scrollLeft||n.scrollLeft,top:e.scrollTop||n.scrollTop};return t.inline?r:o}(t);return{left:e.pageX-n.left+r.left,top:e.pageY-n.top+r.top}}return{left:e.pageX,top:e.pageY}}(t,e)).left-n.left+r.left,pageY:o.top-n.top+r.top};var n,r,o},xk=Bn,Ck=Rn,Sk=function(t){t&&t.parentNode&&t.parentNode.removeChild(t)},kk=function(t,e){return function(n){if(function(t){return 0===t.button}(n)){var r=Q(e.dom.getParents(n.target),function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){for(var n=0;n<t.length;n++)if(t[n](e))return!0;return!1}}(xk,Ck)).getOr(null);if(a=e.getBody(),xk(c=r)&&c!==a){var o=e.dom.getPos(r),i=e.getBody(),u=e.getDoc().documentElement;t.set({element:r,dragging:!1,screenX:n.screenX,screenY:n.screenY,maxX:(e.inline?i.scrollWidth:u.offsetWidth)-2,maxY:(e.inline?i.scrollHeight:u.offsetHeight)-2,relX:n.pageX-o.x,relY:n.pageY-o.y,width:r.offsetWidth,height:r.offsetHeight,ghost:function(t,e,n,r){var o=t.dom,i=e.cloneNode(!0);o.setStyles(i,{width:n,height:r}),o.setAttrib(i,"data-mce-selected",null);var u=o.create("div",{class:"mce-drag-container","data-mce-bogus":"all",unselectable:"on",contenteditable:"false"});return o.setStyles(u,{position:"absolute",opacity:.5,overflow:"hidden",border:0,padding:0,margin:0,width:n,height:r}),o.setStyles(i,{margin:0,boxSizing:"border-box"}),u.appendChild(i),u}(e,r,r.offsetWidth,r.offsetHeight)})}}var a,c}},Ok=function(t,e){return function(n){t.on(function(t){if(t.dragging){if(function(t,e,n){return e!==n&&!t.dom.isChildOf(e,n)&&!xk(e)}(e,(u=e.selection,3===(a=u.getSel().getRangeAt(0).startContainer).nodeType?a.parentNode:a),t.element)){var r=(o=t.element,(i=o.cloneNode(!0)).removeAttribute("data-mce-selected"),i);e.fire("drop",{clientX:n.clientX,clientY:n.clientY}).isDefaultPrevented()||e.undoManager.transact(function(){Sk(t.element),e.insertContent(e.dom.getOuterHTML(r)),e._selectionOverrides.hideFakeCaret()})}e.fire("dragend")}var o,i,u,a}),Tk(t)}},Tk=function(t){t.on(function(t){Sk(t.ghost)}),t.clear()},_k=function(t){var e=ya(),n=ca.DOM,r=document,o=kk(e,t),i=function(t,e){var n=Kr.throttle(function(t,n){e._selectionOverrides.hideFakeCaret(),e.selection.placeCaretAt(t,n)},0);return e.on("remove",n.stop),function(r){return t.on(function(t){var o,i,u=Math.max(Math.abs(r.screenX-t.screenX),Math.abs(r.screenY-t.screenY));if(!t.dragging&&u>10){if(e.fire("dragstart",{target:t.element}).isDefaultPrevented())return;t.dragging=!0,e.focus()}if(t.dragging){var a=function(t,e){return{pageX:e.pageX-t.relX,pageY:e.pageY+5}}(t,wk(e,r));o=t.ghost,i=e.getBody(),o.parentNode!==i&&i.appendChild(o),function(t,e,n,r,o,i){var u=0,a=0;t.style.left=e.pageX+"px",t.style.top=e.pageY+"px",e.pageX+n>o&&(u=e.pageX+n-o),e.pageY+r>i&&(a=e.pageY+r-i),t.style.width=n-u+"px",t.style.height=r-a+"px"}(t.ghost,a,t.width,t.height,t.maxX,t.maxY),n(r.clientX,r.clientY)}})}}(e,t),u=Ok(e,t),a=function(t,e){return function(){t.on(function(t){t.dragging&&e.fire("dragend")}),Tk(t)}}(e,t);t.on("mousedown",o),t.on("mousemove",i),t.on("mouseup",u),n.bind(r,"mousemove",i),n.bind(r,"mouseup",a),t.on("remove",function(){n.unbind(r,"mousemove",i),n.unbind(r,"mouseup",a)}),t.on("keydown",function(t){t.keyCode===Vf.ESC&&a()})},Ek=function(t){_k(t),function(t){t.on("drop",function(e){var n=void 0!==e.clientX?t.getDoc().elementFromPoint(e.clientX,e.clientY):null;(xk(n)||"false"===t.dom.getContentEditableParent(n))&&e.preventDefault()})}(t),function(t){return t.getParam("block_unsupported_drop",!0,"boolean")}(t)&&function(t){var e=function(e){if(!e.isDefaultPrevented()){var n=e.dataTransfer;n&&(U(n.types,"Files")||n.files.length>0)&&(e.preventDefault(),"drop"===e.type&&gy(t,"Dropped file type is not supported"))}},n=function(n){Xd(t,n.target)&&e(n)},r=function(){var r=ca.DOM,o=t.dom,i=document,u=t.inline?t.getBody():t.getDoc(),a=["drop","dragover"];q(a,function(t){r.bind(i,t,n),o.bind(u,t,e)}),t.on("remove",function(){q(a,function(t){r.unbind(i,t,n),o.unbind(u,t,e)})})};t.on("init",function(){Kr.setEditorTimeout(t,r,0)})}(t)},Dk=Rn,Ak=Bn,Nk=function(t,e){return Lf(t.getBody(),e)},Mk=function(t){var e,n=t.selection,r=t.dom,o=r.isBlock,i=t.getBody(),u=xs(t,i,o,function(){return nm(t)}),a="sel-"+r.uniqueId(),c=function(t){return t!==i&&(Ak(t)||Pn(t))&&r.isChildOf(t,i)},s=function(t){return tg(t)||eg(t)||Ym(t)||Jm(t)},l=function(t){t&&n.setRng(t)},f=n.getRng,d=function(e,r,o,i){return void 0===i&&(i=!0),t.fire("ShowCaret",{target:r,direction:e,before:o}).isDefaultPrevented()?null:(i&&n.scrollIntoView(r,-1===e),u.show(o,r))},m=function(t){return vo(t)||Co(t)||So(t)},g=function(t){return m(t.startContainer)||m(t.endContainer)},h=function(e){var n=t.schema.getShortEndedElements(),o=r.createRng(),i=e.startContainer,u=e.startOffset,a=e.endContainer,c=e.endOffset;return wt(n,i.nodeName.toLowerCase())?0===u?o.setStartBefore(i):o.setStartAfter(i):o.setStart(i,u),wt(n,a.nodeName.toLowerCase())?0===c?o.setEndBefore(a):o.setEndAfter(a):o.setEnd(a,c),o},p=function(o){var i=o.cloneNode(!0),u=t.fire("ObjectSelected",{target:o,targetClone:i});if(u.isDefaultPrevented())return null;var c=function(e,o,i){var u=t.$,c=Ur(ye.fromDom(t.getBody()),"#"+a).fold(function(){return u([])},function(t){return u([t.dom])});0===c.length&&(c=u('<div data-mce-bogus="all" class="mce-offscreen-selection"></div>').attr("id",a)).appendTo(t.getBody());var s=r.createRng();o===i&&de.ie?(c.empty().append('<p style="font-size: 0" data-mce-bogus="all"> </p>').append(o),s.setStartAfter(c[0].firstChild.firstChild),s.setEndAfter(o)):(c.empty().append(" ").append(o).append(" "),s.setStart(c[0].firstChild,1),s.setEnd(c[0].lastChild,0)),c.css({top:r.getPos(e,t.getBody()).y}),c[0].focus();var l=n.getSel();return l.removeAllRanges(),l.addRange(s),s}(o,u.targetClone,i),s=ye.fromDom(o);return q(Aa(ye.fromDom(t.getBody()),"*[data-mce-selected]"),function(t){Se(s,t)||Gn(t,"data-mce-selected")}),r.getAttrib(o,"data-mce-selected")||o.setAttribute("data-mce-selected","1"),e=o,w(),c},v=function(t,e){if(!t)return null;if(t.collapsed){if(!g(t)){var n=e?1:-1,o=$s(n,i,t),u=o.getNode(!e);if(ks(u))return d(n,u,!!e&&!o.isAtEnd(),!1);var a=o.getNode(e);if(ks(a))return d(n,a,!e&&!o.isAtEnd(),!1)}return null}var s=t.startContainer,l=t.startOffset,f=t.endOffset;if(3===s.nodeType&&0===l&&Ak(s.parentNode)&&(s=s.parentNode,l=r.nodeIndex(s),s=s.parentNode),1!==s.nodeType)return null;if(f===l+1&&s===t.endContainer){var m=s.childNodes[l];if(c(m))return p(m)}return null},y=function(){e&&e.removeAttribute("data-mce-selected"),Ur(ye.fromDom(t.getBody()),"#"+a).each(un),e=null},w=function(){u.hide()};return de.ceFalse&&!Dv(t)&&function(){t.on("mouseup",function(e){var n=f();n.collapsed&&ay(t,e.clientX,e.clientY)&&yw(t,n,!1).each(l)}),t.on("click",function(e){var o=Nk(t,e.target);o&&(Ak(o)&&(e.preventDefault(),t.focus()),Dk(o)&&r.isChildOf(o,n.getNode())&&y())}),t.on("blur NewBlock",y),t.on("ResizeWindow FullscreenStateChanged",u.reposition);var m=function(e,n){var i,u,a=r.getParent(e,o),c=r.getParent(n,o);return!b(a)&&(!(e===c||!r.isChildOf(a,c)||!1!==Ak(Nk(t,a)))||!r.isChildOf(c,a)&&(i=a,u=c,!(r.getParent(i,o)===r.getParent(u,o)))&&function(t){var e=t.firstChild;if(b(e))return!1;var n=wc.before(e);if(Mn(n.getNode())&&1===t.childNodes.length)return!s(n);var r=al(t).next(n);return r&&!s(r)}(a))};t.on("tap",function(e){var n=e.target,r=Nk(t,n);Ak(r)?(e.preventDefault(),bw(t,r).each(v)):c(n)&&bw(t,n).each(v)},!0),t.on("mousedown",function(e){var o=e.target;if((o===i||"HTML"===o.nodeName||r.isChildOf(o,i))&&!1!==ay(t,e.clientX,e.clientY)){var u=Nk(t,o);if(u)Ak(u)?(e.preventDefault(),bw(t,u).each(v)):(y(),Dk(u)&&e.shiftKey||Pf(e.clientX,e.clientY,n.getRng())||(w(),n.placeCaretAt(e.clientX,e.clientY)));else if(c(o))bw(t,o).each(v);else if(!1===ks(o)){y(),w();var a=Ux(i,e.clientX,e.clientY);if(a&&!m(o,a.node)){e.preventDefault();var s=d(1,a.node,a.before,!1);l(s),t.getBody().focus()}}}}),t.on("keypress",function(t){Vf.modifierPressed(t)||Ak(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=h(t.range);var e=v(t.range,t.forward);e&&(t.range=e)});t.on("AfterSetSelectionRange",function(t){var e=t.range,n=e.startContainer.parentNode;g(e)||"mcepastebin"===n.id||w(),function(t){return r.hasClass(t,"mce-offscreen-selection")}(n)||y()}),t.on("copy",function(t){var e,n=t.clipboardData;if(!t.isDefaultPrevented()&&t.clipboardData&&!de.ie){var o=(e=r.get(a))?e.getElementsByTagName("*")[0]:e;o&&(t.preventDefault(),n.clearData(),n.setData("text/html",o.outerHTML),n.setData("text/plain",o.outerText||o.innerText))}}),Ek(t),function(t){var e=wa(function(){if(!t.removed&&t.getBody().contains(document.activeElement)){var e=t.selection.getRng();if(e.collapsed){var n=ww(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(Pn(n)){var r=Lf(t.getBody(),n),o=Bn(r)?r:n;t.selection.getNode()!==o&&bw(t,o).each(function(e){return t.selection.setRng(e)})}})})}(t)}(),{showCaret:d,showBlockCaretContainer:function(t){t.hasAttribute("data-mce-caret")&&(ko(t),l(f()),n.scrollIntoView(t))},hideFakeCaret:w,destroy:function(){u.destroy(),e=null}}},zk=function(t){var e,n,r=ve.each,o=Vf.BACKSPACE,i=Vf.DELETE,u=t.dom,a=t.selection,c=t.parser,s=de.gecko,l=de.ie,f=de.webkit,d=l?"Text":"URL",m=function(e,n){try{t.getDoc().execCommand(e,!1,n)}catch(t){}},g=function(t){return t.isDefaultPrevented()},h=function(){var e=function(t){var e=u.create("body"),n=t.cloneContents();return e.appendChild(n),a.serializer.serialize(e,{format:"html"})};t.on("keydown",function(n){var r,a,c,s,l,f=n.keyCode;if(!g(n)&&(f===i||f===o)){if(r=t.selection.isCollapsed(),a=t.getBody(),r&&!u.isEmpty(a))return;if(!r&&(c=t.selection.getRng(),s=e(c),(l=u.createRng()).selectNode(t.getBody()),s!==e(l)))return;n.preventDefault(),t.setContent(""),a.firstChild&&u.isBlock(a.firstChild)?t.selection.setCursorLocation(a.firstChild,0):t.selection.setCursorLocation(a,0),t.nodeChanged()}})},p=function(){t.shortcuts.add("meta+a",null,"SelectAll")},v=function(){t.inline||u.bind(t.getDoc(),"mousedown mouseup",function(e){var n;if(e.target===t.getDoc().documentElement)if(n=a.getRng(),t.getBody().focus(),"mousedown"===e.type){if(vo(n.startContainer))return;a.placeCaretAt(e.clientX,e.clientY)}else a.setRng(n)})},b=function(){Range.prototype.getClientRects||t.on("mousedown",function(e){if(!g(e)&&"HTML"===e.target.nodeName){var n=t.getBody();n.blur(),Kr.setEditorTimeout(t,function(){n.focus()})}})},y=function(){t.on("click",function(e){var n=e.target;/^(IMG|HR)$/.test(n.nodeName)&&"false"!==u.getContentEditableParent(n)&&(e.preventDefault(),t.selection.select(n),t.nodeChanged()),"A"===n.nodeName&&u.hasClass(n,"mce-item-anchor")&&(e.preventDefault(),a.select(n))})},w=function(){t.on("keydown",function(t){if(!g(t)&&t.keyCode===o&&a.isCollapsed()&&0===a.getRng().startOffset){var e=a.getNode().previousSibling;if(e&&e.nodeName&&"table"===e.nodeName.toLowerCase())return t.preventDefault(),!1}})},x=function(){(function(t){return t.getParam("readonly")})(t)||t.on("BeforeExecCommand mousedown",function(){m("StyleWithCSS",!1),m("enableInlineTableEditing",!1),es(t)||m("enableObjectResizing",!1)})},S=function(){t.on("SetContent ExecCommand",function(t){"setcontent"!==t.type&&"mceInsertLink"!==t.command||r(u.select("a"),function(t){var e=t.parentNode,n=u.getRoot();if(e.lastChild===t){for(;e&&!u.isBlock(e);){if(e.parentNode.lastChild!==e||e===n)return;e=e.parentNode}u.add(e,"br",{"data-mce-bogus":1})}})})},k=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()})},T=function(){t.inline||(t.contentStyles.push("body {min-height: 150px}"),t.on("click",function(e){var n;if("HTML"===e.target.nodeName){if(de.ie>11)return void t.getBody().focus();n=t.selection.getRng(),t.getBody().focus(),t.selection.setRng(n),t.selection.normalize(),t.nodeChanged()}}))},_=function(){de.mac&&t.on("keydown",function(e){!Vf.metaKeyPressed(e)||e.shiftKey||37!==e.keyCode&&39!==e.keyCode||(e.preventDefault(),t.selection.getSel().modify("move",37===e.keyCode?"backward":"forward","lineboundary"))})},E=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()})})},A=function(){t.on("dragstart",function(e){!function(e){var n,r;e.dataTransfer&&(t.selection.isCollapsed()&&"IMG"===e.target.tagName&&a.select(e.target),(n=t.selection.getContent()).length>0&&(r="data:text/mce-internal,"+escape(t.id)+","+escape(n),e.dataTransfer.setData(d,r)))}(e)}),t.on("drop",function(e){if(!g(e)){var n=function(t){var e;return t.dataTransfer&&(e=t.dataTransfer.getData(d))&&e.indexOf("data:text/mce-internal,")>=0?(e=e.substr("data:text/mce-internal,".length).split(","),{id:unescape(e[0]),html:unescape(e[1])}):null}(e);if(n&&n.id!==t.id){e.preventDefault();var r=qf(e.x,e.y,t.getDoc());a.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=C;return Dv(t)?(f&&(v(),y(),D(),p(),de.iOS&&(O(),T(),E())),s&&(b(),x(),k(),_())):(t.on("keydown",function(e){var n,r;if(!g(e)&&e.keyCode===Vf.BACKSPACE){var o=(n=a.getRng()).startContainer,i=n.startOffset,c=u.getRoot();if(r=o,n.collapsed&&0===i){for(;r&&r.parentNode&&r.parentNode.firstChild===r&&r.parentNode!==c;)r=r.parentNode;"BLOCKQUOTE"===r.tagName&&(t.formatter.toggle("blockquote",null,r),(n=u.createRng()).setStart(o,0),n.setEnd(o,0),a.setRng(n))}}}),h(),de.windowsPhone||t.on("keyup focusin mouseup",function(t){Vf.modifierPressed(t)||a.normalize()},!0),f&&(v(),y(),Gc(t)&&t.on("init",function(){m("DefaultParagraphSeparator",Gc(t))}),D(),w(),c.addNodeFilter("br",function(t){for(var e=t.length;e--;)"Apple-interchange-newline"===t[e].attr("class")&&t[e].remove()}),de.iOS?(O(),T(),E()):p()),de.ie>=11&&(T(),w()),de.ie&&(p(),m("AutoUrlDetect",!1),A()),s&&(t.on("keydown",function(e){if(!g(e)&&e.keyCode===o){if(!t.getBody().getElementsByTagName("hr").length)return;if(a.isCollapsed()&&0===a.getRng().startOffset){var n=a.getNode(),r=n.previousSibling;if("HR"===n.nodeName)return u.remove(n),void e.preventDefault();r&&r.nodeName&&"hr"===r.nodeName.toLowerCase()&&(u.remove(r),e.preventDefault())}}}),b(),e=function(){var e=u.getAttribs(a.getStart().cloneNode(!1));return function(){var n=a.getStart();n!==t.getBody()&&(u.setAttrib(n,"style",null),r(e,function(t){n.setAttributeNode(t.cloneNode(!0))}))}},n=function(){return!a.isCollapsed()&&u.getParent(a.getStart(),u.isBlock)!==u.getParent(a.getEnd(),u.isBlock)},t.on("keypress",function(r){var o;if(!g(r)&&(8===r.keyCode||46===r.keyCode)&&n())return o=e(),t.getDoc().execCommand("delete",!1,null),o(),r.preventDefault(),!1}),u.bind(t.getDoc(),"cut",function(r){var o;!g(r)&&n()&&(o=e(),Kr.setEditorTimeout(t,function(){o()}))}),x(),S(),k(),_(),w())),{refreshContentEditable:N,isHidden:function(){if(!s||t.removed)return!1;var e=t.selection.getSel();return!e||!e.rangeCount||0===e.rangeCount}}},Rk=ca.DOM,Bk=function(t){return vt(t,function(t){return!1===v(t)})},Lk=function(t){var e=t.settings;return Bk({block_elements:e.block_elements,boolean_attributes:e.boolean_attributes,custom_elements:e.custom_elements,extended_valid_elements:e.extended_valid_elements,invalid_elements:e.invalid_elements,invalid_styles:e.invalid_styles,move_caret_before_on_enter_elements:e.move_caret_before_on_enter_elements,non_empty_elements:e.non_empty_elements,schema:e.schema,self_closing_elements:e.self_closing_elements,short_ended_elements:e.short_ended_elements,special:e.special,text_block_elements:e.text_block_elements,text_inline_elements:e.text_inline_elements,valid_children:e.valid_children,valid_classes:e.valid_classes,valid_elements:e.valid_elements,valid_styles:e.valid_styles,verify_html:e.verify_html,whitespace_elements:e.whitespace_elements,padd_empty_block_inline_children:e.format_empty_lines})},Pk=function(t){var e=t.settings,n=t.editorUpload.blobCache;return Bk({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:function(t){return t.inline?t.getElement().nodeName.toLowerCase():void 0}(t),validate:!0,blob_cache:n,document:t.getDoc(),images_dataimg_filter:e.images_dataimg_filter})},Hk=function(t){var e=t.dom.getRoot();t.inline||Of(t)&&t.selection.getStart(!0)!==e||bl(e).each(function(e){var n=e.getNode(),r=On(n)?bl(n).getOr(e):e;de.browser.isIE()?function(t,e){var n=ye.fromDom(t.getBody()),r=(Id(t)?P.from(e):P.none()).map(Fd).filter(Hd(n));t.bookmark=r.isSome()?r:t.bookmark}(t,r.toRange()):t.selection.setRng(r.toRange())})},Ik=function(t){t.bindPendingEventDelegates(),t.initialized=!0,function(t){t.fire("Init")}(t),t.focus(!0),Hk(t),t.nodeChanged({initial:!0}),t.execCallback("init_instance_callback",t),function(t){t.settings.auto_focus&&Kr.setEditorTimeout(t,function(){var e;(e=!0===t.settings.auto_focus?t:t.editorManager.get(t.settings.auto_focus)).destroyed||e.focus()},100)}(t)},Fk=function(t){return t.inline?t.ui.styleSheetLoader:t.dom.styleSheetLoader},Vk=function(t){var e=Fk(t),n=ts(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 u="";ve.each(t.contentStyles,function(t){u+=t+"\r\n"}),t.dom.addStyle(u)}var a=Wr.all(function(t,e,n){var r=[new Wr(function(n,r){return Fk(t).loadAll(e,n,r)})];return t.inline?r:r.concat([new Wr(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=ye.fromDom(t.getBody()),r=Ye(Xe(n)),o=ye.fromTag("style");Un(o,"type","text/css"),nn(o,ye.fromText(e)),nn(r,o),t.on("remove",function(){un(o)})}(t,t.settings.content_style),a},Uk=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,Rk.setAttrib(r,"spellcheck","false")),t.quirks=zk(t),function(t){t.fire("PostRender")}(t);var o=function(t){return t.getParam("directionality",va.isRtl()?"rtl":void 0)}(t);void 0!==o&&(r.dir=o),e.protect&&t.on("BeforeSetContent",function(t){ve.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})},jk=function(t){!0!==t.removed&&(!function(t){Dv(t)||t.load({initial:!0,format:"html"}),t.startContent=t.getContent({format:"raw"})}(t),Ik(t))},Wk=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&&(Rk.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"===Rk.getStyle(i,"position",!0)&&(i.style.position="relative"),i.contentEditable=t.getParam("content_editable_state",!0)),i.disabled=!1,t.editorUpload=Ey(t),t.schema=wi(Lk(t)),t.dom=ca(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:function(t){return t.getParam("content_css_cors",!1,"boolean")}(t),referrerPolicy:Jc(t),onSetAttrib:function(e){t.fire("SetAttrib",e)}}),t.parser=function(t){var e=wb(Pk(t),t.schema);return e.addAttributeFilter("src,href,style,tabindex",function(e,n){for(var r,o,i=e.length,u=t.dom,a="data-mce-"+n;i--;)if((o=(r=e[i]).attr(n))&&!r.attr(a)){if(0===o.indexOf("data:")||0===o.indexOf("blob:"))continue;"style"===n?((o=u.serializeStyle(u.parseStyle(o),r.name)).length||(o=null),r.attr(a,o),r.attr(n,o)):"tabindex"===n?(r.attr(a,o),r.attr(n,null)):r.attr(a,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 hm("br",1)).shortEnded=!0)}}),e}(t),t.serializer=Ob(function(t){var e=t.settings;return At(At(At({},Pk(t)),Lk(t)),Bk({url_converter:e.url_converter,url_converter_scope:e.url_converter_scope,element_format:e.element_format,entities:e.entities,entity_encoding:e.entity_encoding,indent:e.indent,indent_after:e.indent_after,indent_before:e.indent_before}))}(t),t),t.selection=Fv(t.dom,t.getWin(),t.serializer,t),t.annotator=Rf(t),t.formatter=By(t),t.undoManager=Py(t),t._nodeChangeDispatcher=new hk(t),t._selectionOverrides=Mk(t),OC(t),pk(t),Dv(t)||bk(t);var u=function(t){return Dv(t)?ma(null):gk(t)}(t);SC(t,u),function(t){Gc(t)&&t.on("NodeChange",E(DC,t))}(t),Vy(t);var a=Av(t);Uk(t),a.fold(function(){Vk(t).then(function(){return jk(t)})},function(e){t.setProgressState(!0),Vk(t).then(function(){e().then(function(e){t.setProgressState(!1),jk(t)},function(e){t.notificationManager.open({type:"error",text:String(e)}),jk(t)})})})},qk=ca.DOM,$k=function(t){var e=function(t){return t.getParam("doctype","<!DOCTYPE html>")}(t)+"<html><head>";(function(t){return t.getParam("document_base_url","")})(t)!==t.documentBaseUrl&&(e+='<base href="'+t.documentBaseURI.getURI()+'" />'),e+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';var n=function(t){return qc(t,"body_id","tinymce")}(t),r=function(t){return qc(t,"body_class","")}(t),o=t.translate(function(t){return t.getParam("iframe_aria_text","Rich Text Area. Press ALT-0 for help.","string")}(t));return $c(t)&&(e+='<meta http-equiv="Content-Security-Policy" content="'+$c(t)+'" />'),e+='</head><body id="'+n+'" class="mce-content-body '+r+'" data-id="'+t.id+'" aria-label="'+o+'"><br></body></html>'},Gk=function(t,e){var n,r,o,i,u=t.translate("Rich Text Area"),a=(n=t.id,r=u,e.height,o=function(t){return t.getParam("iframe_attrs",{})}(t),i=ye.fromTag("iframe"),jn(i,o),jn(i,{id:n+"_ifr",frameBorder:"0",allowTransparency:"true",title:r}),Ta(i,"tox-edit-area__iframe"),i).dom;a.onload=function(){a.onload=null,t.fire("load")};var c=function(t,e){if(document.domain!==window.location.hostname&&de.browser.isIE()){var n=ky("mce");t[n]=function(){Wk(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 qk.setAttrib(e,"src",r),!0}return!1}(t,a);return t.contentAreaContainer=e.iframeContainer,t.iframeElement=a,t.iframeHTML=$k(t),qk.add(e.iframeContainer,a),c},Kk=ca.DOM,Xk=function(t,e,n){var r=ly.get(n),o=ly.urls[n]||t.documentBaseUrl.replace(/\/$/,"");if(n=ve.trim(n),r&&-1===ve.inArray(e,n)){if(ve.each(ly.dependencies(n),function(n){Xk(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=va.translate(["Failed to initialize plugin: {0}",e]);Hf(t,"PluginLoadError",{message:r}),by(r,n),gy(t,r)}(t,n,e)}}},Yk=function(t){return t.replace(/^\-/,"")},Jk=function(t){return{editorContainer:t,iframeContainer:t,api:{}}},Qk=function(t){var e=t.getElement();return t.inline?Jk(null):function(t){var e=Kk.create("div");return Kk.insertAfter(e,t),Jk(e)}(e)},Zk=function(t){var e=t.getElement();return t.orgDisplay=e.style.display,d(rs(t))?function(t){return t.theme.renderUI()}(t):w(rs(t))?function(t){var e=t.getElement(),n=rs(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):Qk(t)},tO=function(t){t.fire("ScriptsLoaded"),function(t){var e=ve.trim(Yc(t)),n=t.ui.registry.getAll().icons,r=At(At({},ty.get("default").icons),ty.get(e).icons);dt(r,function(e,r){wt(n,r)||t.ui.registry.addIcon(r,e)})}(t),function(t){var e=rs(t);if(d(e)){t.settings.theme=Yk(e);var n=fy.get(e);t.theme=new n(t,fy.urls[e]),t.theme.init&&t.theme.init(t,fy.urls[e]||t.documentBaseUrl.replace(/\/$/,""),t.$)}else t.theme={}}(t),function(t){var e=[];ve.each(is(t).split(/[ ,]/),function(n){Xk(t,e,Yk(n))})}(t);var e=Zk(t);!function(t,e){var n={show:P.from(e.show).getOr(C),hide:P.from(e.hide).getOr(C),disable:P.from(e.disable).getOr(C),isDisabled:P.from(e.isDisabled).getOr(M),enable:function(){t.mode.isReadOnly()||P.from(e.enable).map(N)}};t.ui=At(At({},t.ui),n)}(t,P.from(e.api).getOr({}));var n={editorContainer:e.editorContainer,iframeContainer:e.iframeContainer};return t.editorContainer=n.editorContainer?n.editorContainer:null,xy(t),t.inline?Wk(t):function(t,e){var n=Gk(t,e);e.editorContainer&&(qk.get(e.editorContainer).style.display=t.orgDisplay,t.hidden=qk.isHidden(e.editorContainer)),t.getElement().style.display="none",qk.setAttrib(t.id,"aria-hidden","true"),n||Wk(t)}(t,n)},eO=ca.DOM,nO=function(t){return"-"===t.charAt(0)},rO=function(t,e){var n=Qc(e),r=function(t){return t.getParam("language_url","","string")}(e);if(!1===va.hasCode(n)&&"en"!==n){var o=""!==r?r:e.editorManager.baseURL+"/langs/"+n+".js";t.add(o,C,void 0,function(){!function(t,e,n){hy(t,"LanguageLoadError",py("language",e,n))}(e,o,n)})}},oO=function(t,e,n){return P.from(e).filter(function(t){return t.length>0&&!ty.has(t)}).map(function(e){return{url:t.editorManager.baseURL+"/icons/"+e+"/icons"+n+".js",name:P.some(e)}})},iO=function(t,e,n){var r=oO(e,"default",n),o=function(t){return P.from(function(t){return t.getParam("icons_url","","string")}(t)).filter(function(t){return t.length>0}).map(function(t){return{url:t,name:P.none()}})}(e).orThunk(function(){return oO(e,Yc(e),"")});q(function(t){for(var e=[],n=function(t){e.push(t)},r=0;r<t.length;r++)t[r].each(n);return e}([r,o]),function(n){t.add(n.url,C,void 0,function(){!function(t,e,n){hy(t,"IconsLoadError",py("icons",e,n))}(e,n.url,n.name.getOrUndefined())})})},uO=function(t,e){var n=da.ScriptLoader;!function(t,e,n,r){var o=rs(e);if(d(o)){if(!nO(o)&&!wt(fy.urls,o)){var i=function(t){return t.getParam("theme_url")}(e);i?fy.load(o,e.documentBaseURI.toAbsolute(i)):fy.load(o,"themes/"+o+"/theme"+n+".js")}t.loadQueue(function(){fy.waitFor(o,r)})}else r()}(n,t,e,function(){rO(n,t),iO(n,t,e),function(t,e){ve.each(function(t){return t.getParam("external_plugins")}(t),function(e,n){ly.load(n,e,C,void 0,function(){vy(t,e,n)}),t.settings.plugins+=" "+n}),ve.each(is(t).split(/[ ,]/),function(n){if((n=ve.trim(n))&&!ly.urls[n])if(nO(n)){n=n.substr(1,n.length);var r=ly.dependencies(n);ve.each(r,function(n){var r={prefix:"plugins/",resource:n,suffix:"/plugin"+e+".js"},o=ly.createUrl(r,n);ly.load(o.resource,o,C,void 0,function(){vy(t,o.prefix+o.resource+o.suffix,o.resource)})})}else{var o={prefix:"plugins/",resource:n,suffix:"/plugin"+e+".js"};ly.load(n,o,C,void 0,function(){vy(t,o.prefix+o.resource+o.suffix,n)})}})}(t,e),n.loadQueue(function(){t.removed||tO(t)},t,function(){t.removed||tO(t)})})},aO=function(t){var e=t.id;va.setCode(Qc(t));var n=function(){eO.unbind(window,"ready",n),t.render()};if(Mi.Event.domLoaded){if(t.getElement()&&de.contentEditable){var r=ye.fromDom(t.getElement()),o=function(t){return Y(t.dom.attributes,function(t,e){return t[e.name]=e.value,t},{})}(r);t.on("remove",function(){$(r.dom.attributes,function(t){return Gn(r,t.name)}),jn(r,o)}),t.ui.styleSheetLoader=function(t,e){return Yr.forElement(t,{contentCssCors:function(t){return t.getParam("content_css_cors")}(e),referrerPolicy:Jc(e)})}(r,t),!function(t){return t.getParam("inline")}(t)?(t.orgVisibility=t.getElement().style.visibility,t.getElement().style.visibility="hidden"):t.inline=!0;var i=t.getElement().form||eO.getParent(e,"form");i&&(t.formElement=i,function(t){return t.getParam("hidden_input")}(t)&&!_n(t.getElement())&&(eO.insertAfter(eO.create("input",{type:"hidden",name:e}),e),t.hasHiddenInput=!0),t.formEventDelegate=function(e){t.fire(e.type,e)},eO.bind(i,"submit reset",t.formEventDelegate),t.on("reset",function(){t.resetContent()}),!function(t){return t.getParam("submit_patch")}(t)||i.submit.nodeType||i.submit.length||i._mceOldSubmit||(i._mceOldSubmit=i.submit,i.submit=function(){return t.editorManager.triggerSave(),t.setDirty(!1),i._mceOldSubmit(i)})),t.windowManager=dy(t),t.notificationManager=sy(t),function(t){return"xml"===t.getParam("encoding")}(t)&&t.on("GetContent",function(t){t.save&&(t.content=eO.encode(t.content))}),function(t){return t.getParam("add_form_submit_trigger")}(t)&&t.on("submit",function(){t.initialized&&t.save()}),function(t){return t.getParam("add_unload_trigger")}(t)&&(t._beforeUnload=function(){!t.initialized||t.destroyed||t.isHidden()||t.save({format:"raw",no_events:!0,set_dirty:!1})},t.editorManager.on("BeforeUnload",t._beforeUnload)),t.editorManager.add(t),uO(t,t.suffix)}}else eO.bind(window,"ready",n)},cO=function(t,e){return function(t,e){return Mv(t).editor.addVisual(e)}(t,e)},sO={"font-size":"size","font-family":"face"},lO=function(t,e,n){return qh(ye.fromDom(n),function(e){return function(e){return Jn(e,t).orThunk(function(){return"font"===Te(e)?yt(sO,t).bind(function(t){return qn(e,t)}):P.none()})}(e)},function(t){return Se(ye.fromDom(e),t)})},fO=function(t){return function(e,n){return P.from(n).map(ye.fromDom).filter(De).bind(function(n){return lO(t,e,n.dom).or(function(t,e){return P.from(ca.DOM.getStyle(e,t,!0))}(t,n.dom))}).getOr("")}},dO=fO("font-size"),mO=S(function(t){return t.replace(/[\'\"\\]/g,"").replace(/,\s+/g,",")},fO("font-family")),gO=function(t){return bl(t.getBody()).map(function(t){var e=t.container();return En(e)?e.parentNode:e})},hO=function(t,e){return function(t){return P.from(t.selection.getRng()).bind(function(e){var n=t.getBody();return e.startContainer===n&&0===e.startOffset?P.none():P.from(t.selection.getStart(!0))})}(t).orThunk(E(gO,t)).map(ye.fromDom).filter(De).bind(e)},pO=function(t,e){return hO(t,k(P.some,e))},vO=function(t,e){if(/^[0-9.]+$/.test(e)){var n=parseInt(e,10);if(n>=1&&n<=7){var r=function(t){return ve.explode(t.getParam("font_size_style_values","xx-small,x-small,small,medium,large,x-large,xx-large"))}(t),o=function(t){return ve.explode(t.getParam("font_size_classes",""))}(t);return o?o[n-1]||e:r[n-1]||e}return e}return e},bO=function(t,e){var n=vO(t,e);t.formatter.toggle("fontname",{value:function(t){var e=t.split(/\s*,\s*/);return W(e,function(t){return-1===t.indexOf(" ")||Ht(t,'"')||Ht(t,"'")?t:"'"+t+"'"}).join(",")}(n)}),t.nodeChanged()},yO=function(t,e){var n=function(t){if("string"!=typeof t){var e=ve.extend({paste:t.paste,data:{paste:t.paste}},t);return{content:t.content,details:e}}return{content:t,details:{}}}(e);!function(t,e,n){Nv(t).editor.insertContent(e,n)}(t,n.content,n.details)},wO=ve.each,xO=ve.map,CO=ve.inArray,SO=function(){function t(t){this.commands={state:{},exec:{},value:{}},this.editor=t,this.setupCommands(t)}return t.prototype.execCommand=function(t,e,n,r){var o,i=!1,u=this;if(!u.editor.removed){var a;if("mcefocus"!==t.toLowerCase()&&(/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(t)||r&&r.skip_focus?(a=u.editor,Wd(a).each(function(t){return a.selection.setRng(t)})):u.editor.focus()),(r=u.editor.fire("BeforeExecCommand",{command:t,ui:e,value:n})).isDefaultPrevented())return!1;var c=t.toLowerCase();if(o=u.commands.exec[c])return o(c,e,n),u.editor.fire("ExecCommand",{command:t,ui:e,value:n}),!0;if(wO(this.editor.plugins,function(r){if(r.execCommand&&r.execCommand(t,e,n))return u.editor.fire("ExecCommand",{command:t,ui:e,value:n}),i=!0,!1}),i)return i;if(u.editor.theme&&u.editor.theme.execCommand&&u.editor.theme.execCommand(t,e,n))return u.editor.fire("ExecCommand",{command:t,ui:e,value:n}),!0;try{i=u.editor.getDoc().execCommand(t,e,n)}catch(t){}return!!i&&(u.editor.fire("ExecCommand",{command:t,ui:e,value:n}),!0)}},t.prototype.queryCommandState=function(t){var e;if(!this.editor.quirks.isHidden()&&!this.editor.removed){if(t=t.toLowerCase(),e=this.commands.state[t])return e(t);try{return this.editor.getDoc().queryCommandState(t)}catch(t){}return!1}},t.prototype.queryCommandValue=function(t){var e;if(!this.editor.quirks.isHidden()&&!this.editor.removed){if(t=t.toLowerCase(),e=this.commands.value[t])return e(t);try{return this.editor.getDoc().queryCommandValue(t)}catch(t){}}},t.prototype.addCommands=function(t,e){void 0===e&&(e="exec");var n=this;wO(t,function(t,r){wO(r.toLowerCase().split(","),function(r){n.commands[e][r]=t})})},t.prototype.addCommand=function(t,e,n){var r=this;t=t.toLowerCase(),this.commands.exec[t]=function(t,o,i,u){return e.call(n||r.editor,o,i,u)}},t.prototype.queryCommandSupported=function(t){if(t=t.toLowerCase(),this.commands.exec[t])return!0;try{return this.editor.getDoc().queryCommandSupported(t)}catch(t){}return!1},t.prototype.addQueryStateHandler=function(t,e,n){var r=this;t=t.toLowerCase(),this.commands.state[t]=function(){return e.call(n||r.editor)}},t.prototype.addQueryValueHandler=function(t,e,n){var r=this;t=t.toLowerCase(),this.commands.value[t]=function(){return e.call(n||r.editor)}},t.prototype.hasCustomCommand=function(t){return t=t.toLowerCase(),!!this.commands.exec[t]},t.prototype.execNativeCommand=function(t,e,n){return void 0===e&&(e=!1),void 0===n&&(n=null),this.editor.getDoc().execCommand(t,e,n)},t.prototype.isFormatMatch=function(t){return this.editor.formatter.match(t)},t.prototype.toggleFormat=function(t,e){this.editor.formatter.toggle(t,e),this.editor.nodeChanged()},t.prototype.storeSelection=function(t){this.selectionBookmark=this.editor.selection.getBookmark(t)},t.prototype.restoreSelection=function(){this.editor.selection.moveToBookmark(this.selectionBookmark)},t.prototype.setupCommands=function(t){var e=this;this.addCommands({"mceResetDesignMode,mceBeginUndoLevel":C,"mceEndUndoLevel,mceAddUndoLevel":function(){t.undoManager.add()},mceFocus:function(e,n,r){im(t,r)},"Cut,Copy,Paste":function(n){var r,o=t.getDoc();try{e.execNativeCommand(n)}catch(t){r=!0}if("paste"!==n||o.queryCommandEnabled(n)||(r=!0),r||!o.queryCommandSupported(n)){var i=t.translate("Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.");de.mac&&(i=i.replace(/Ctrl\+/g,"⌘+")),t.notificationManager.open({text:i,type:"error"})}},unlink:function(){if(t.selection.isCollapsed()){var e=t.dom.getParent(t.selection.getStart(),"a");e&&t.dom.remove(e,!0)}else t.formatter.remove("link")},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull,JustifyNone":function(n){var r=n.substring(7);"full"===r&&(r="justify"),wO("left,center,right,justify".split(","),function(e){r!==e&&t.formatter.remove("align"+e)}),"none"!==r&&e.toggleFormat("align"+r)},"InsertUnorderedList,InsertOrderedList":function(n){var r;e.execNativeCommand(n);var o=t.dom.getParent(t.selection.getNode(),"ol,ul");o&&(r=o.parentNode,/^(H[1-6]|P|ADDRESS|PRE)$/.test(r.nodeName)&&(e.storeSelection(),t.dom.split(r,o),e.restoreSelection()))},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(t){e.toggleFormat(t)},"ForeColor,HiliteColor":function(t,n,r){e.toggleFormat(t,{value:r})},FontName:function(e,n,r){bO(t,r)},FontSize:function(e,n,r){!function(t,e){t.formatter.toggle("fontsize",{value:vO(t,e)}),t.nodeChanged()}(t,r)},LineHeight:function(e,n,r){!function(t,e){t.formatter.toggle("lineheight",{value:String(e)}),t.nodeChanged()}(t,r)},Lang:function(t,n,r){e.toggleFormat(t,{value:r.code,customValue:r.customCode})},RemoveFormat:function(e){t.formatter.remove(e)},mceBlockQuote:function(){e.toggleFormat("blockquote")},FormatBlock:function(t,n,r){return e.toggleFormat(r||"p")},mceCleanup:function(){var e=t.selection.getBookmark();t.setContent(t.getContent()),t.selection.moveToBookmark(e)},mceRemoveNode:function(n,r,o){var i=o||t.selection.getNode();i!==t.getBody()&&(e.storeSelection(),t.dom.remove(i,!0),e.restoreSelection())},mceSelectNodeDepth:function(e,n,r){var o=0;t.dom.getParent(t.selection.getNode(),function(e){if(1===e.nodeType&&o++===r)return t.selection.select(e),!1},t.getBody())},mceSelectNode:function(e,n,r){t.selection.select(r)},mceInsertContent:function(e,n,r){yO(t,r)},mceInsertRawHTML:function(e,n,r){t.selection.setContent("tiny_mce_marker");var o=t.getContent();t.setContent(o.replace(/tiny_mce_marker/g,function(){return r}))},mceInsertNewLine:function(e,n,r){QS(t,r)},mceToggleFormat:function(t,n,r){e.toggleFormat(r)},mceSetContent:function(e,n,r){t.setContent(r)},"Indent,Outdent":function(e){wC(t,e)},mceRepaint:C,InsertHorizontalRule:function(){t.execCommand("mceInsertContent",!1,"<hr />")},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(),Rn);if(e){var n=t.dom.createRng();n.selectNodeContents(e),t.selection.setRng(n)}},mceNewDocument:function(){t.setContent("")},InsertLineBreak:function(e,n,r){return HS(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=xO(r,function(n){return!!t.formatter.matchNode(n,e)});return-1!==CO(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 vC(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 pO(t,function(e){return mO(t.getBody(),e.dom)}).getOr("")}(t)},this),e.addQueryValueHandler("FontSize",function(){return function(t){return pO(t,function(e){return dO(t.getBody(),e.dom)}).getOr("")}(t)},this),e.addQueryValueHandler("LineHeight",function(){return function(t){return pO(t,function(e){var n=ye.fromDom(t.getBody());return qh(e,function(t){return Jn(t,"line-height")},E(Se,n)).getOrThunk(function(){var t=parseFloat(Xn(e,"line-height")),n=parseFloat(Xn(e,"font-size"));return String(t/n)})}).getOr("")}(t)},this)},t}(),kO=function(t,e,n){Ea(t,e)&&!1===n?function(t,e){Sa(t)?t.dom.classList.remove(e):Oa(t,e);_a(t)}(t,e):n&&Ta(t,e)},OO=function(t,e,n){try{t.getDoc().execCommand(e,!1,String(n))}catch(t){}},TO=function(t,e){t.dom.contentEditable=e?"true":"false"},_O=function(t,e){var n=ye.fromDom(t.getBody());kO(n,"mce-content-readonly",e),e?(t.selection.controlSelection.hideResizeRect(),t._selectionOverrides.hideFakeCaret(),function(t){P.from(t.selection.getNode()).each(function(t){t.removeAttribute("data-mce-selected")})}(t),t.readonly=!0,TO(n,!1),q(Aa(n,'*[contenteditable="true"]'),function(t){Un(t,"data-mce-contenteditable","true"),TO(t,!1)})):(t.readonly=!1,TO(n,!0),function(t){q(Aa(t,'*[data-mce-contenteditable="true"]'),function(t){Gn(t,"data-mce-contenteditable"),TO(t,!0)})}(n),OO(t,"StyleWithCSS",!1),OO(t,"enableInlineTableEditing",!1),OO(t,"enableObjectResizing",!1),rm(t)&&t.focus(),function(t){t.selection.setRng(t.selection.getRng())}(t),t.nodeChanged())},EO=function(t){return t.readonly},DO=function(t){t.parser.addAttributeFilter("contenteditable",function(e){EO(t)&&q(e,function(t){t.attr("data-mce-contenteditable",t.attr("contenteditable")),t.attr("contenteditable","false")})}),t.serializer.addAttributeFilter("data-mce-contenteditable",function(e){EO(t)&&q(e,function(t){t.attr("contenteditable",t.attr("data-mce-contenteditable"))})}),t.serializer.addTempAttr("data-mce-contenteditable")},AO=function(t,e){if(function(t){return"click"===t.type}(e)&&!Vf.metaKeyPressed(e)){var n=ye.fromDom(e.target);(function(t,e){return jr(e,"a",function(e){return Se(e,ye.fromDom(t.getBody()))}).bind(function(t){return qn(t,"href")})})(t,n).each(function(n){if(e.preventDefault(),/^#/.test(n)){var r=t.dom.select(n+',[name="'+(Ht(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})}},NO=ve.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"," "),MO=function(){function t(t){this.bindings={},this.settings=t||{},this.scope=this.settings.scope||this,this.toggleEvent=this.settings.toggleEvent||M}return t.isNative=function(t){return!!NO[t.toLowerCase()]},t.prototype.fire=function(t,e){var n=t.toLowerCase(),r=Oi(n,e||{},this.scope);this.settings.beforeFire&&this.settings.beforeFire(r);var o=this.bindings[n];if(o)for(var i=0,u=o.length;i<u;i++){var a=o[i];if(!a.removed){if(a.once&&this.off(n,a.func),r.isImmediatePropagationStopped())return r;if(!1===a.func.call(this.scope,r))return r.preventDefault(),r}}return r},t.prototype.on=function(t,e,n,r){if(!1===e&&(e=M),e){var o={func:e,removed:!1};r&&ve.extend(o,r);for(var i=t.toLowerCase().split(" "),u=i.length;u--;){var a=i[u],c=this.bindings[a];c||(c=[],this.toggleEvent(a,!0)),c=n?Nt([o],c,!0):Nt(Nt([],c,!0),[o],!1),this.bindings[a]=c}}return this},t.prototype.off=function(t,e){var n=this;if(t)for(var r=t.toLowerCase().split(" "),o=r.length;o--;){var i=r[o],u=this.bindings[i];if(!i)return dt(this.bindings,function(t,e){n.toggleEvent(e,!1),delete n.bindings[e]}),this;if(u){if(e){var a=G(u,function(t){return t.func===e});u=a.fail,this.bindings[i]=u,q(a.pass,function(t){t.removed=!0})}else u.length=0;u.length||(this.toggleEvent(t,!1),delete this.bindings[i])}}else dt(this.bindings,function(t,e){n.toggleEvent(e,!1)}),this.bindings={};return this},t.prototype.once=function(t,e,n){return this.on(t,e,n,{once:!0})},t.prototype.has=function(t){return t=t.toLowerCase(),!(!this.bindings[t]||0===this.bindings[t].length)},t}(),zO=function(t){return t._eventDispatcher||(t._eventDispatcher=new MO({scope:t,toggleEvent:function(e,n){MO.isNative(e)&&t.toggleNativeEvent&&t.toggleNativeEvent(e,n)}})),t._eventDispatcher},RO={fire:function(t,e,n){if(this.removed&&"remove"!==t&&"detach"!==t)return e;var r=zO(this).fire(t,e);if(!1!==n&&this.parent)for(var o=this.parent();o&&!r.isPropagationStopped();)o.fire(t,r,!1),o=o.parent();return r},on:function(t,e,n){return zO(this).on(t,e,n)},off:function(t,e){return zO(this).off(t,e)},once:function(t,e){return zO(this).once(t,e)},hasEventListeners:function(t){return zO(this).has(t)}},BO=ca.DOM,LO=function(t,e){if("selectionchange"===e)return t.getDoc();if(!t.inline&&/^mouse|touch|click|contextmenu|drop|dragover|dragend/.test(e))return t.getDoc().documentElement;var n=ns(t);return n?(t.eventRoot||(t.eventRoot=BO.select(n)[0]),t.eventRoot):t.getBody()},PO=function(t,e,n){!function(t){return!t.hidden&&!EO(t)}(t)?EO(t)&&AO(t,n):t.fire(e,n)},HO=function(t,e){var n;if(t.delegates||(t.delegates={}),!t.delegates[e]&&!t.removed){var r=LO(t,e);if(ns(t)){if(_x||(_x={},t.editorManager.on("removeEditor",function(){t.editorManager.activeEditor||_x&&(dt(_x,function(e,n){t.dom.unbind(LO(t,n))}),_x=null)})),_x[e])return;n=function(n){for(var r=n.target,o=t.editorManager.get(),i=o.length;i--;){var u=o[i].getBody();(u===r||BO.isChildOf(r,u))&&PO(o[i],e,n)}},_x[e]=n,BO.bind(r,e,n)}else n=function(n){PO(t,e,n)},BO.bind(r,e,n),t.delegates[e]=n}},IO=At(At({},RO),{bindPendingEventDelegates:function(){var t=this;ve.each(t._pendingNativeEvents,function(e){HO(t,e)})},toggleNativeEvent:function(t,e){"focus"!==t&&"blur"!==t&&(this.removed||(e?this.initialized?HO(this,t):this._pendingNativeEvents?this._pendingNativeEvents.push(t):this._pendingNativeEvents=[t]:this.initialized&&(this.dom.unbind(LO(this,t),t,this.delegates[t]),delete this.delegates[t])))},unbindAllNativeEvents:function(){var t=this,e=t.getBody(),n=t.dom;t.delegates&&(dt(t.delegates,function(e,n){t.dom.unbind(LO(t,n),n,e)}),delete t.delegates),!t.inline&&e&&n&&(e.onload=null,n.unbind(t.getWin()),n.unbind(t.getDoc())),n&&(n.unbind(e),n.unbind(t.getContainer()))}}),FO=["design","readonly"],VO=function(t,e,n,r){var o=n[e.get()],i=n[r];try{i.activate()}catch(t){return void console.error("problem while activating editor mode "+r+":",t)}o.deactivate(),o.editorReadOnly!==i.editorReadOnly&&_O(t,i.editorReadOnly),e.set(r),function(t,e){t.fire("SwitchMode",{mode:e})}(t,r)},UO=function(t){var e=ma("design"),n=ma({design:{activate:C,deactivate:C,editorReadOnly:!1},readonly:{activate:C,deactivate:C,editorReadOnly:!0}});return function(t){t.serializer?DO(t):t.on("PreInit",function(){DO(t)})}(t),function(t){t.on("ShowCaret",function(e){EO(t)&&e.preventDefault()}),t.on("ObjectSelected",function(e){EO(t)&&e.preventDefault()})}(t),{isReadOnly:function(){return EO(t)},set:function(r){return function(t,e,n,r){if(r!==n.get()){if(!wt(e,r))throw new Error("Editor mode '"+r+"' is invalid");t.initialized?VO(t,n,e,r):t.on("init",function(){return VO(t,n,e,r)})}}(t,n.get(),e,r)},get:function(){return e.get()},register:function(t,e){n.set(function(t,e,n){var r;if(U(FO,e))throw new Error("Cannot override default mode "+e);return At(At({},t),((r={})[e]=At(At({},n),{deactivate:function(){try{n.deactivate()}catch(t){console.error("problem while deactivating editor mode "+e+":",t)}}}),r))}(n.get(),t,e))}}},jO=ve.each,WO=ve.explode,qO={f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123},$O=ve.makeMap("alt,ctrl,shift,meta,access"),GO=function(t){var e,n={};jO(WO(t.toLowerCase(),"+"),function(t){t in $O?n[t]=!0:/^[0-9]{2,}$/.test(t)?n.keyCode=parseInt(t,10):(n.charCode=t.charCodeAt(0),n.keyCode=qO[t]||t.toUpperCase().charCodeAt(0))});var r=[n.keyCode];for(e in $O)n[e]?r.push(e):n[e]=!1;return n.id=r.join(","),n.access&&(n.alt=!0,de.mac?n.ctrl=!0:n.shift=!0),n.meta&&(de.mac?n.meta=!0:(n.ctrl=!0,n.meta=!1)),n},KO=function(){function t(t){this.shortcuts={},this.pendingPatterns=[],this.editor=t;var e=this;t.on("keyup keypress keydown",function(t){!e.hasModifier(t)&&!e.isFunctionKey(t)||t.isDefaultPrevented()||(jO(e.shortcuts,function(n){if(e.matchShortcut(t,n))return e.pendingPatterns=n.subpatterns.slice(0),"keydown"===t.type&&e.executeShortcutAction(n),!0}),e.matchShortcut(t,e.pendingPatterns[0])&&(1===e.pendingPatterns.length&&"keydown"===t.type&&e.executeShortcutAction(e.pendingPatterns[0]),e.pendingPatterns.shift()))})}return t.prototype.add=function(t,e,n,r){var o=this,i=o.normalizeCommandFunc(n);return jO(WO(ve.trim(t)),function(t){var n=o.createShortcut(t,e,i,r);o.shortcuts[n.id]=n}),!0},t.prototype.remove=function(t){var e=this.createShortcut(t);return!!this.shortcuts[e.id]&&(delete this.shortcuts[e.id],!0)},t.prototype.normalizeCommandFunc=function(t){var e=this,n=t;return"string"==typeof n?function(){e.editor.execCommand(n,!1,null)}:ve.isArray(n)?function(){e.editor.execCommand(n[0],n[1],n[2])}:n},t.prototype.createShortcut=function(t,e,n,r){var o=ve.map(WO(t,">"),GO);return o[o.length-1]=ve.extend(o[o.length-1],{func:n,scope:r||this.editor}),ve.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}(),XO=function(){var t,e,n,r,o,i,u,a,c=(e={},n={},r={},o={},i={},u={},{addButton:(a=function(t,e){return function(n,r){return t[n.toLowerCase()]=At(At({},r),{type:e})}})(t={},"button"),addGroupToolbarButton:a(t,"grouptoolbarbutton"),addToggleButton:a(t,"togglebutton"),addMenuButton:a(t,"menubutton"),addSplitButton:a(t,"splitbutton"),addMenuItem:a(e,"menuitem"),addNestedMenuItem:a(e,"nestedmenuitem"),addToggleMenuItem:a(e,"togglemenuitem"),addAutocompleter:a(n,"autocompleter"),addContextMenu:a(o,"contextmenu"),addContextToolbar:a(i,"contexttoolbar"),addContextForm:a(i,"contextform"),addSidebar:a(u,"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:u}}});return{addAutocompleter:c.addAutocompleter,addButton:c.addButton,addContextForm:c.addContextForm,addContextMenu:c.addContextMenu,addContextToolbar:c.addContextToolbar,addIcon:c.addIcon,addMenuButton:c.addMenuButton,addMenuItem:c.addMenuItem,addNestedMenuItem:c.addNestedMenuItem,addSidebar:c.addSidebar,addSplitButton:c.addSplitButton,addToggleButton:c.addToggleButton,addGroupToolbarButton:c.addGroupToolbarButton,addToggleMenuItem:c.addToggleMenuItem,getAll:c.getAll}},YO=ca.DOM,JO=ve.extend,QO=ve.each,ZO=ve.resolve,tT=de.ie,eT=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,JO(this,IO),this.settings=Jb(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&&(da.ScriptLoader._setReferrerPolicy(this.settings.referrer_policy),ca.DOM.styleSheetLoader._setReferrerPolicy(this.settings.referrer_policy)),ba.languageLoad=this.settings.language_load,ba.baseURL=n.baseURL,this.id=t,this.setDirty(!1),this.documentBaseURI=new ab(this.settings.document_base_url,{base_uri:this.baseUri}),this.baseURI=this.baseUri,this.inline=!!this.settings.inline,this.shortcuts=new KO(this),this.editorCommands=new SO(this),this.settings.cache_suffix&&(de.cacheSuffix=this.settings.cache_suffix.replace(/^[\?\&]+/,"")),this.ui={registry:XO(),styleSheetLoader:void 0,show:C,hide:C,enable:C,disable:C,isDisabled:M};var o=UO(this);this.mode=o,this.setMode=o.set,n.fire("SetupEditor",{editor:this}),this.execCallback("setup",this),this.$=ea.overrideDefaults(function(){return{context:r.inline?r.getBody():r.getDoc(),element:r.getBody()}})}return t.prototype.render=function(){aO(this)},t.prototype.focus=function(t){this.execCommand("mceFocus",!1,t)},t.prototype.hasFocus=function(){return nm(this)},t.prototype.execCallback=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r,o=this.settings[t];if(o)return this.callbackLookup&&(r=this.callbackLookup[t])&&(o=r.func,r=r.scope),"string"==typeof o&&(r=(r=o.replace(/\.\w+$/,""))?ZO(r):0,o=ZO(o),this.callbackLookup=this.callbackLookup||{},this.callbackLookup[t]={func:o,scope:r}),o.apply(r||this,e)},t.prototype.translate=function(t){return va.translate(t)},t.prototype.getParam=function(t,e,n){return Zb(this,t,e,n)},t.prototype.hasPlugin=function(t,e){return!!U(is(this).split(/[ ,]/),t)&&(!e||void 0!==ly.get(t))},t.prototype.nodeChanged=function(t){this._nodeChangeDispatcher.nodeChanged(t)},t.prototype.addCommand=function(t,e,n){this.editorCommands.addCommand(t,e,n)},t.prototype.addQueryStateHandler=function(t,e,n){this.editorCommands.addQueryStateHandler(t,e,n)},t.prototype.addQueryValueHandler=function(t,e,n){this.editorCommands.addQueryValueHandler(t,e,n)},t.prototype.addShortcut=function(t,e,n,r){this.shortcuts.add(t,e,n,r)},t.prototype.execCommand=function(t,e,n,r){return this.editorCommands.execCommand(t,e,n,r)},t.prototype.queryCommandState=function(t){return this.editorCommands.queryCommandState(t)},t.prototype.queryCommandValue=function(t){return this.editorCommands.queryCommandValue(t)},t.prototype.queryCommandSupported=function(t){return this.editorCommands.queryCommandSupported(t)},t.prototype.show=function(){this.hidden&&(this.hidden=!1,this.inline?this.getBody().contentEditable="true":(YO.show(this.getContainer()),YO.hide(this.id)),this.load(),this.fire("show"))},t.prototype.hide=function(){var t=this.getDoc();this.hidden||(tT&&t&&!this.inline&&t.execCommand("SelectAll"),this.save(),this.inline?(this.getBody().contentEditable="false",this===this.editorManager.focusedEditor&&(this.editorManager.focusedEditor=null)):(YO.hide(this.getContainer()),YO.setStyle(this.id,"display",this.orgDisplay)),this.hidden=!0,this.fire("hide"))},t.prototype.isHidden=function(){return!!this.hidden},t.prototype.setProgressState=function(t,e){this.fire("ProgressState",{state:t,time:e})},t.prototype.load=function(t){var e,n=this.getElement();if(this.removed)return"";if(n){(t=t||{}).load=!0;var r=_n(n)?n.value:n.innerHTML;return e=this.setContent(r,t),t.element=n,t.no_events||this.fire("LoadContent",t),t.element=n=null,e}},t.prototype.save=function(t){var e,n,r=this,o=r.getElement();if(o&&r.initialized&&!r.removed)return(t=t||{}).save=!0,t.element=o,t.content=r.getContent(t),t.no_events||r.fire("SaveContent",t),"raw"===t.format&&r.fire("RawSaveContent",t),e=t.content,_n(o)?o.value=e:(!t.is_removing&&r.inline||(o.innerHTML=e),(n=YO.getParent(r.id,"form"))&&QO(n.elements,function(t){if(t.name===r.id)return t.value=e,!1})),t.element=o=null,!1!==t.set_dirty&&r.setDirty(!1),e},t.prototype.setContent=function(t,e){return _b(this,t,e)},t.prototype.getContent=function(t){return Tb(this,t)},t.prototype.insertContent=function(t,e){e&&(t=JO({content:t},e)),this.execCommand("mceInsertContent",!1,t)},t.prototype.resetContent=function(t){void 0===t?_b(this,this.startContent,{format:"raw"}):_b(this,t),this.undoManager.reset(),this.setDirty(!1),this.nodeChanged()},t.prototype.isDirty=function(){return!this.isNotDirty},t.prototype.setDirty=function(t){var e=!this.isNotDirty;this.isNotDirty=!t,t&&t!==e&&this.fire("dirty")},t.prototype.getContainer=function(){return this.container||(this.container=YO.get(this.editorContainer||this.id+"_parent")),this.container},t.prototype.getContentAreaContainer=function(){return this.contentAreaContainer},t.prototype.getElement=function(){return this.targetElm||(this.targetElm=YO.get(this.id)),this.targetElm},t.prototype.getWin=function(){var t;return this.contentWindow||(t=this.iframeElement)&&(this.contentWindow=t.contentWindow),this.contentWindow},t.prototype.getDoc=function(){var t;return this.contentDocument||(t=this.getWin())&&(this.contentDocument=t.document),this.contentDocument},t.prototype.getBody=function(){var t=this.getDoc();return this.bodyElement||(t?t.body:null)},t.prototype.convertURL=function(t,e,n){var r=this.settings;return r.urlconverter_callback?this.execCallback("urlconverter_callback",t,n,!0,e):!r.convert_urls||n&&"LINK"===n.nodeName||0===t.indexOf("file:")||0===t.length?t:r.relative_urls?this.documentBaseURI.toRelative(t):t=this.documentBaseURI.toAbsolute(t,r.remove_script_host)},t.prototype.addVisual=function(t){cO(this,t)},t.prototype.remove=function(){Ab(this)},t.prototype.destroy=function(t){Nb(this,t)},t.prototype.uploadImages=function(t){return this.editorUpload.uploadImages(t)},t.prototype._scanForImages=function(){return this.editorUpload.scanForImages()},t.prototype.addButton=function(){throw new Error("editor.addButton has been removed in tinymce 5x, use editor.ui.registry.addButton or editor.ui.registry.addToggleButton or editor.ui.registry.addSplitButton instead")},t.prototype.addSidebar=function(){throw new Error("editor.addSidebar has been removed in tinymce 5x, use editor.ui.registry.addSidebar instead")},t.prototype.addMenuItem=function(){throw new Error("editor.addMenuItem has been removed in tinymce 5x, use editor.ui.registry.addMenuItem instead")},t.prototype.addContextToolbar=function(){throw new Error("editor.addContextToolbar has been removed in tinymce 5x, use editor.ui.registry.addContextToolbar instead")},t}(),nT=ca.DOM,rT=ve.explode,oT=ve.each,iT=ve.extend,uT=0,aT=!1,cT=[],sT=[],lT=function(t){var e=t.type;oT(gT.get(),function(n){switch(e){case"scroll":n.fire("ScrollWindow",t);break;case"resize":n.fire("ResizeWindow",t)}})},fT=function(t){t!==aT&&(t?ea(window).on("resize scroll",lT):ea(window).off("resize scroll",lT),aT=t)},dT=function(t){var e=sT;delete cT[t.id];for(var n=0;n<cT.length;n++)if(cT[n]===t){cT.splice(n,1);break}return sT=K(sT,function(e){return t!==e}),gT.activeEditor===t&&(gT.activeEditor=sT.length>0?sT[0]:null),gT.focusedEditor===t&&(gT.focusedEditor=null),e.length!==sT.length},mT="CSS1Compat"!==document.compatMode,gT=At(At({},RO),{baseURI:null,baseURL:null,defaultSettings:{},documentBaseURL:null,suffix:null,$:ea,majorVersion:"5",minorVersion:"10.9",releaseDate:"2023-11-15",editors:cT,i18n:va,activeEditor:null,focusedEditor:null,settings:{},setup:function(){var t,e,n="";e=ab.getDocumentBaseUrl(document.location),/^[^:]+:\/\/\/?[^\/]+\//.test(e)&&(e=e.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(e)||(e+="/"));var r,o=window.tinymce||window.tinyMCEPreInit;if(o)t=o.base||o.baseURL,n=o.suffix;else{for(var i=document.getElementsByTagName("script"),u=0;u<i.length;u++){var a;if(""!==(a=i[u].src||"")){var c=a.substring(a.lastIndexOf("/"));if(/tinymce(\.full|\.jquery|)(\.min|\.dev|)\.js/.test(a)){-1!==c.indexOf(".min")&&(n=".min"),t=a.substring(0,a.lastIndexOf("/"));break}}}if(!t&&document.currentScript)-1!==(a=document.currentScript.src).indexOf(".min")&&(n=".min"),t=a.substring(0,a.lastIndexOf("/"))}this.baseURL=new ab(e).toAbsolute(t),this.documentBaseURL=e,this.baseURI=new ab(this.baseURL),this.suffix=n,(r=this).on("AddEditor",E(Yd,r)),r.on("RemoveEditor",E(Jd,r))},overrideDefaults:function(t){var e=t.base_url;e&&this._setBaseUrl(e);var n=t.suffix;t.suffix&&(this.suffix=n),this.defaultSettings=t;var r=t.plugin_base_urls;void 0!==r&&dt(r,function(t,e){ba.PluginManager.urls[e]=t})},init:function(t){var e,n=this,r=ve.makeMap("area base basefont br col frame hr img input isindex link meta param embed source wbr track colgroup option table tbody tfoot thead tr th td script noscript style textarea video audio iframe object menu"," "),o=function(t){var e=t.id;return e||(e=yt(t,"name").filter(function(t){return!nT.get(t)}).getOrThunk(nT.uniqueId),t.setAttribute("id",e)),e},i=function(t,e){return e.constructor===RegExp?e.test(t.className):nT.hasClass(t,e)},u=function(t){e=t},a=function(){var e,c=0,s=[],l=function(t,r,o){var i=new eT(t,r,n);s.push(i),i.on("init",function(){++c===e.length&&u(s)}),i.targetElm=i.targetElm||o,i.render()};nT.unbind(window,"ready",a),function(e){var r=t[e];if(r)r.apply(n,[])}("onpageload"),e=ea.unique(function(t){var e=[];if(de.browser.isIE()&&de.browser.version.major<11)return by("TinyMCE does not support the browser you are using. For a list of supported browsers please see: https://www.tinymce.com/docs/get-started/system-requirements/"),[];if(mT)return by("Failed to initialize the editor as the document is not in standards mode. TinyMCE requires standards mode."),[];if(t.types)return oT(t.types,function(t){e=e.concat(nT.select(t.selector))}),e;if(t.selector)return nT.select(t.selector);if(t.target)return[t.target];switch(t.mode){case"exact":var n=t.elements||"";n.length>0&&oT(rT(n),function(t){var n=nT.get(t);n?e.push(n):oT(document.forms,function(n){oT(n.elements,function(n){n.name===t&&(t="mce_editor_"+uT++,nT.setAttrib(n,"id",t),e.push(n))})})});break;case"textareas":case"specific_textareas":oT(nT.select("textarea"),function(n){t.editor_deselector&&i(n,t.editor_deselector)||t.editor_selector&&!i(n,t.editor_selector)||e.push(n)})}return e}(t)),t.types?oT(t.types,function(n){ve.each(e,function(e){return!nT.is(e,n.selector)||(l(o(e),iT({},t,n),e),!1)})}):(ve.each(e,function(t){var e;(e=n.get(t.id))&&e.initialized&&!(e.getContainer()||e.getBody()).parentNode&&(dT(e),e.unbindAllNativeEvents(),e.destroy(!0),e.removed=!0,e=null)}),0===(e=ve.grep(e,function(t){return!n.get(t.id)})).length?u([]):oT(e,function(e){!function(t,e){return t.inline&&e.tagName.toLowerCase()in r}(t,e)?l(o(e),t,e):by("Could not initialize inline editor on invalid inline target element",e)}))};return n.settings=t,nT.bind(window,"ready",a),new Wr(function(t){e?t(e):u=function(e){t(e)}})},get:function(t){return 0===arguments.length?sT.slice(0):d(t)?Q(sT,function(e){return e.id===t}).getOr(null):x(t)&&sT[t]?sT[t]:null},add:function(t){var e=this;return cT[t.id]===t?t:(null===e.get(t.id)&&("length"!==t.id&&(cT[t.id]=t),cT.push(t),sT.push(t)),fT(!0),e.activeEditor=t,e.fire("AddEditor",{editor:t}),Ex||(Ex=function(t){var n=e.fire("BeforeUnload");if(n.returnValue)return t.preventDefault(),t.returnValue=n.returnValue,n.returnValue},window.addEventListener("beforeunload",Ex)),t)},createEditor:function(t,e){return this.add(new eT(t,e,this))},remove:function(t){var e,n,r=this;if(t){if(!d(t))return n=t,h(r.get(n.id))?null:(dT(n)&&r.fire("RemoveEditor",{editor:n}),0===sT.length&&window.removeEventListener("beforeunload",Ex),n.remove(),fT(sT.length>0),n);oT(nT.select(t),function(t){(n=r.get(t.id))&&r.remove(n)})}else for(e=sT.length-1;e>=0;e--)r.remove(sT[e])},execCommand:function(t,e,n){var r=this.get(n);switch(t){case"mceAddEditor":return this.get(n)||new eT(n,this.settings,this).render(),!0;case"mceRemoveEditor":return r&&r.remove(),!0;case"mceToggleEditor":return r?(r.isHidden()?r.show():r.hide(),!0):(this.execCommand("mceAddEditor",!1,n),!0)}return!!this.activeEditor&&this.activeEditor.execCommand(t,e,n)},triggerSave:function(){oT(sT,function(t){t.save()})},addI18n:function(t,e){va.add(t,e)},translate:function(t){return va.translate(t)},setActive:function(t){var e=this.activeEditor;this.activeEditor!==t&&(e&&e.fire("deactivate",{relatedTarget:t}),t.fire("activate",{relatedTarget:e})),this.activeEditor=t},_setBaseUrl:function(t){this.baseURL=new ab(this.documentBaseURL).toAbsolute(t.replace(/\/+$/,"")),this.baseURI=new ab(this.baseURL)}});gT.setup();var hT,pT,vT,bT,yT=Math.min,wT=Math.max,xT=Math.round,CT=function(t,e,n){var r=e.x,o=e.y,i=t.w,u=t.h,a=e.w,c=e.h,s=(n||"").split("");return"b"===s[0]&&(o+=c),"r"===s[1]&&(r+=a),"c"===s[0]&&(o+=xT(c/2)),"c"===s[1]&&(r+=xT(a/2)),"b"===s[3]&&(o-=u),"r"===s[4]&&(r-=i),"c"===s[3]&&(o-=xT(u/2)),"c"===s[4]&&(r-=xT(i/2)),ST(r,o,i,u)},ST=function(t,e,n,r){return{x:t,y:e,w:n,h:r}},kT={inflate:function(t,e,n){return ST(t.x-e,t.y-n,t.w+2*e,t.h+2*n)},relativePosition:CT,findBestRelativePosition:function(t,e,n,r){var o,i;for(i=0;i<r.length;i++)if((o=CT(t,e,r[i])).x>=n.x&&o.x+o.w<=n.w+n.x&&o.y>=n.y&&o.y+o.h<=n.h+n.y)return r[i];return null},intersect:function(t,e){var n=wT(t.x,e.x),r=wT(t.y,e.y),o=yT(t.x+t.w,e.x+e.w),i=yT(t.y+t.h,e.y+e.h);return o-n<0||i-r<0?null:ST(n,r,o-n,i-r)},clamp:function(t,e,n){var r=t.x,o=t.y,i=t.x+t.w,u=t.y+t.h,a=e.x+e.w,c=e.y+e.h,s=wT(0,e.x-r),l=wT(0,e.y-o),f=wT(0,i-a),d=wT(0,u-c);return r+=s,o+=l,n&&(i+=s,u+=l,r-=f,o-=d),ST(r,o,(i-=f)-r,(u-=d)-o)},create:ST,fromClientRect:function(t){return ST(t.left,t.top,t.width,t.height)}},OT=(hT={},pT={},{load:function(t,e){var n='Script at URL "'+e+'" failed to load',r='Script at URL "'+e+"\" did not call `tinymce.Resource.add('"+t+"', data)` within 1 second";if(void 0!==hT[t])return hT[t];var o=new Wr(function(o,i){var u=function(t,e,n){void 0===n&&(n=1e3);var r=!1,o=null,i=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];r||(r=!0,null!==o&&(clearTimeout(o),o=null),t.apply(null,e))}},u=i(t),a=i(e);return{start:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];r||null!==o||(o=setTimeout(function(){return a.apply(null,t)},n))},resolve:u,reject:a}}(o,i);pT[t]=u.resolve,da.ScriptLoader.loadScript(e,function(){return u.start(r)},function(){return u.reject(n)})});return hT[t]=o,o},add:function(t,e){void 0!==pT[t]&&(pT[t](e),delete pT[t]),hT[t]=Wr.resolve(e)}}),TT=ve.each,_T=ve.extend,ET=function(){};ET.extend=vT=function(t){var e=this.prototype,n=function(){var t,e,n;if(!bT&&(this.init&&this.init.apply(this,arguments),e=this.Mixins))for(t=e.length;t--;)(n=e[t]).init&&n.init.apply(this,arguments)},r=function(){return this};bT=!0;var o=new this;return bT=!1,t.Mixins&&(TT(t.Mixins,function(e){for(var n in e)"init"!==n&&(t[n]=e[n])}),e.Mixins&&(t.Mixins=e.Mixins.concat(t.Mixins))),t.Methods&&TT(t.Methods.split(","),function(e){t[e]=r}),t.Properties&&TT(t.Properties.split(","),function(e){var n="_"+e;t[e]=function(t){return void 0!==t?(this[n]=t,this):this[n]}}),t.Statics&&TT(t.Statics,function(t,e){n[e]=t}),t.Defaults&&e.Defaults&&(t.Defaults=_T({},e.Defaults,t.Defaults)),dt(t,function(t,n){"function"==typeof t&&e[n]?o[n]=function(t,n){return function(){var r=this._super;this._super=e[t];var o=n.apply(this,arguments);return this._super=r,o}}(n,t):o[n]=t}),n.prototype=o,n.constructor=n,n.extend=vT,n};var DT,AT=Math.min,NT=Math.max,MT=Math.round,zT={serialize:function(t){var e=JSON.stringify(t);return d(e)?e.replace(/[\u0080-\uFFFF]/g,function(t){var e=t.charCodeAt(0).toString(16);return"\\u"+"0000".substring(e.length)+e}):e},parse:function(t){try{return JSON.parse(t)}catch(t){}}},RT={callbacks:{},count:0,send:function(t){var e=this,n=ca.DOM,r=void 0!==t.count?t.count:e.count,o="tinymce_jsonp_"+r;e.callbacks[r]=function(i){n.remove(o),delete e.callbacks[r],t.callback(i)},n.add(n.doc.body,"script",{id:o,src:t.url,type:"text/javascript"}),e.count++}},BT=At(At({},RO),{send:function(t){var e,n=0,r=function(){!t.async||4===e.readyState||n++>1e4?(t.success&&n<1e4&&200===e.status?t.success.call(t.success_scope,""+e.responseText,e,t):t.error&&t.error.call(t.error_scope,n>1e4?"TIMED_OUT":"GENERAL",e,t),e=null):Kr.setTimeout(r,10)};if(t.scope=t.scope||this,t.success_scope=t.success_scope||t.scope,t.error_scope=t.error_scope||t.scope,t.async=!1!==t.async,t.data=t.data||"",BT.fire("beforeInitialize",{settings:t}),(e=new XMLHttpRequest).overrideMimeType&&e.overrideMimeType(t.content_type),e.open(t.type||(t.data?"POST":"GET"),t.url,t.async),t.crossDomain&&(e.withCredentials=!0),t.content_type&&e.setRequestHeader("Content-Type",t.content_type),t.requestheaders&&ve.each(t.requestheaders,function(t){e.setRequestHeader(t.key,t.value)}),e.setRequestHeader("X-Requested-With","XMLHttpRequest"),(e=BT.fire("beforeSend",{xhr:e,settings:t}).xhr).send(t.data),!t.async)return r();Kr.setTimeout(r,10)}}),LT=ve.extend,PT=function(){function t(t){this.settings=LT({},t),this.count=0}return t.sendRPC=function(e){return(new t).send(e)},t.prototype.send=function(t){var e=t.error,n=t.success,r=LT(this.settings,t);r.success=function(t,o){void 0===(t=zT.parse(t))&&(t={error:"JSON Parse error."}),t.error?e.call(r.error_scope||r.scope,t.error,o):n.call(r.success_scope||r.scope,t.result)},r.error=function(t,n){e&&e.call(r.error_scope||r.scope,t,n)},r.data=zT.serialize({id:t.id||"c"+this.count++,method:t.method,params:t.params}),r.content_type="application/json",BT.send(r)},t}();try{var HT="__storage_test__";(DT=window.localStorage).setItem(HT,HT),DT.removeItem(HT)}catch(t){DT=function(){return t={},e=[],n={getItem:function(e){var n=t[e];return n||null},setItem:function(n,r){e.push(n),t[n]=String(r)},key:function(t){return e[t]},removeItem:function(n){e=e.filter(function(t){return t===n}),delete t[n]},clear:function(){e=[],t={}},length:0},Object.defineProperty(n,"length",{get:function(){return e.length},configurable:!1,enumerable:!1}),n;var t,e,n}()}var IT={geom:{Rect:kT},util:{Promise:Wr,Delay:Kr,Tools:ve,VK:Vf,URI:ab,Class:ET,EventDispatcher:MO,Observable:RO,I18n:va,XHR:BT,JSON:zT,JSONRequest:PT,JSONP:RT,LocalStorage:DT,Color:function(t){var e={},n=0,r=0,o=0,i=function(t){var i;return"object"==typeof t?"r"in t?(n=t.r,r=t.g,o=t.b):"v"in t&&function(t,e,i){if(t=(parseInt(t,10)||0)%360,e=parseInt(e,10)/100,i=parseInt(i,10)/100,e=NT(0,AT(e,1)),i=NT(0,AT(i,1)),0!==e){var u=t/60,a=i*e,c=a*(1-Math.abs(u%2-1)),s=i-a;switch(Math.floor(u)){case 0:n=a,r=c,o=0;break;case 1:n=c,r=a,o=0;break;case 2:n=0,r=a,o=c;break;case 3:n=0,r=c,o=a;break;case 4:n=c,r=0,o=a;break;case 5:n=a,r=0,o=c;break;default:n=r=o=0}n=MT(255*(n+s)),r=MT(255*(r+s)),o=MT(255*(o+s))}else n=r=o=MT(255*i)}(t.h,t.s,t.v):(i=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)[^\)]*\)/gi.exec(t))?(n=parseInt(i[1],10),r=parseInt(i[2],10),o=parseInt(i[3],10)):(i=/#([0-F]{2})([0-F]{2})([0-F]{2})/gi.exec(t))?(n=parseInt(i[1],16),r=parseInt(i[2],16),o=parseInt(i[3],16)):(i=/#([0-F])([0-F])([0-F])/gi.exec(t))&&(n=parseInt(i[1]+i[1],16),r=parseInt(i[2]+i[2],16),o=parseInt(i[3]+i[3],16)),n=n<0?0:n>255?255:n,r=r<0?0:r>255?255:r,o=o<0?0:o>255?255:o,e};return t&&i(t),e.toRgb=function(){return{r:n,g:r,b:o}},e.toHsv=function(){return function(t,e,n){var r,o;o=0;var i=AT(t/=255,AT(e/=255,n/=255)),u=NT(t,NT(e,n));return i===u?{h:0,s:0,v:100*(o=i)}:(r=(u-i)/u,o=u,{h:MT(60*((t===i?3:n===i?1:5)-(t===i?e-n:n===i?t-e:n-t)/(u-i))),s:MT(100*r),v:MT(100*o)})}(n,r,o)},e.toHex=function(){var t=function(t){return(t=parseInt(t,10).toString(16)).length>1?t:"0"+t};return"#"+t(n)+t(r)+t(o)},e.parse=i,e},ImageUploader:function(t){var e=Cy(),n=_y(t,e);return{upload:function(e,r){return void 0===r&&(r=!0),n.upload(e,r?Ty(t):void 0)}}}},dom:{EventUtils:Mi,Sizzle:hu,DomQuery:ea,TreeWalker:Jr,TextSeeker:qa,DOMUtils:ca,ScriptLoader:da,RangeUtils:od,Serializer:Ob,StyleSheetLoader:Xr,ControlSelection:jf,BookmarkManager:Bf,Selection:Fv,Event:Mi.Event},html:{Styles:Ci,Entities:ci,Node:hm,Schema:wi,SaxParser:mb,DomParser:wb,Writer:Rm,Serializer:Bm},Env:de,AddOnManager:ba,Annotator:Rf,Formatter:By,UndoManager:Py,EditorCommands:SO,WindowManager:dy,NotificationManager:sy,EditorObservable:IO,Shortcuts:KO,Editor:eT,FocusManager:qd,EditorManager:gT,DOM:ca.DOM,ScriptLoader:da.ScriptLoader,PluginManager:ly,ThemeManager:fy,IconManager:ty,Resource:OT,trim:ve.trim,isArray:ve.isArray,is:ve.is,toArray:ve.toArray,makeMap:ve.makeMap,each:ve.each,map:ve.map,grep:ve.grep,inArray:ve.inArray,extend:ve.extend,create:ve.create,walk:ve.walk,createNS:ve.createNS,resolve:ve.resolve,explode:ve.explode,_addCacheSuffix:ve._addCacheSuffix,isOpera:de.opera,isWebKit:de.webkit,isIE:de.ie,isGecko:de.gecko,isMac:de.mac},FT=ve.extend(gT,IT);!function(t){window.tinymce=t,window.tinyMCE=t}(FT),function(e){try{t.exports=e}catch(t){}}(FT)}()}).call(e,n("DuR2"))},Aenb:function(t,e,n){(function(t){!function(){"use strict";var e=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},n=function(t){return function(e){return typeof e===t}},r=function(t){return function(e){return t===e}},o=e("string"),i=e("object"),u=e("array"),a=r(null),c=n("boolean"),s=r(void 0),l=function(t){return null===t||void 0===t},f=function(t){return!l(t)},d=n("function"),m=n("number"),g=function(t,e){if(u(t)){for(var n=0,r=t.length;n<r;++n)if(!e(t[n]))return!1;return!0}return!1},h=function(){},p=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t(e.apply(null,n))}},v=function(t){return function(){return t}},b=function(t){return t},y=function(t,e){return t===e};function w(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=e.concat(n);return t.apply(null,o)}}var x=function(t){return function(e){return!t(e)}},C=function(t){return function(){throw new Error(t)}},S=v(!1),k=v(!0),O=tinymce.util.Tools.resolve("tinymce.ThemeManager"),T=function(){return(T=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function _(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}function E(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}var D,A,N=function(){return M},M={fold:function(t,e){return t()},isSome:S,isNone:k,getOr:A=b,getOrThunk:D=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:v(null),getOrUndefined:v(void 0),or:A,orThunk:D,map:N,each:h,bind:N,exists:S,forall:k,filter:function(){return N()},toArray:function(){return[]},toString:v("none()")},z=function(t){var e=v(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},isSome:k,isNone:S,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return z(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:M},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},R={some:z,none:N,from:function(t){return null===t||void 0===t?M:z(t)}},B=Array.prototype.slice,L=Array.prototype.indexOf,P=Array.prototype.push,H=function(t,e){return L.call(t,e)},I=function(t,e){var n=H(t,e);return-1===n?R.none():R.some(n)},F=function(t,e){return H(t,e)>-1},V=function(t,e){for(var n=0,r=t.length;n<r;n++){if(e(t[n],n))return!0}return!1},U=function(t,e){for(var n=[],r=0;r<t;r++)n.push(e(r));return n},j=function(t,e){for(var n=[],r=0;r<t.length;r+=e){var o=B.call(t,r,r+e);n.push(o)}return n},W=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},q=function(t,e){for(var n=0,r=t.length;n<r;n++){e(t[n],n)}},$=function(t,e){for(var n=[],r=[],o=0,i=t.length;o<i;o++){var u=t[o];(e(u,o)?n:r).push(u)}return{pass:n,fail:r}},G=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n},K=function(t,e,n){return function(t,e){for(var n=t.length-1;n>=0;n--)e(t[n],n)}(t,function(t,r){n=e(n,t,r)}),n},X=function(t,e,n){return q(t,function(t,r){n=e(n,t,r)}),n},Y=function(t,e){return function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return R.some(i);if(n(i,r))break}return R.none()}(t,e,S)},J=function(t,e){for(var n=0,r=t.length;n<r;n++){if(e(t[n],n))return R.some(n)}return R.none()},Q=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!u(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);P.apply(e,t[n])}return e},Z=function(t,e){return Q(W(t,e))},tt=function(t,e){for(var n=0,r=t.length;n<r;++n){if(!0!==e(t[n],n))return!1}return!0},et=function(t){var e=B.call(t,0);return e.reverse(),e},nt=function(t,e){return G(t,function(t){return!F(e,t)})},rt=function(t,e){for(var n={},r=0,o=t.length;r<o;r++){var i=t[r];n[String(i)]=e(i,r)}return n},ot=function(t){return[t]},it=function(t,e){var n=B.call(t,0);return n.sort(e),n},ut=function(t,e){return e>=0&&e<t.length?R.some(t[e]):R.none()},at=function(t){return ut(t,0)},ct=function(t){return ut(t,t.length-1)},st=d(Array.from)?Array.from:function(t){return B.call(t)},lt=function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return R.none()},ft=Object.keys,dt=Object.hasOwnProperty,mt=function(t,e){for(var n=ft(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}},gt=function(t,e){return ht(t,function(t,n){return{k:n,v:e(t,n)}})},ht=function(t,e){var n={};return mt(t,function(t,r){var o=e(t,r);n[o.k]=o.v}),n},pt=function(t,e){var n,r={};return function(t,e,n,r){mt(t,function(t,o){(e(t,o)?n:r)(t,o)})}(t,e,(n=r,function(t,e){n[e]=t}),h),r},vt=function(t,e){var n=[];return mt(t,function(t,r){n.push(e(t,r))}),n},bt=function(t,e){for(var n=ft(t),r=0,o=n.length;r<o;r++){var i=n[r],u=t[i];if(e(u,i,t))return R.some(u)}return R.none()},yt=function(t){return vt(t,b)},wt=function(t,e){return xt(t,e)?R.from(t[e]):R.none()},xt=function(t,e){return dt.call(t,e)},Ct=function(t,e){return xt(t,e)&&void 0!==t[e]&&null!==t[e]},St=function(t,e,n){return void 0===n&&(n=y),t.exists(function(t){return n(t,e)})},kt=function(t){for(var e=[],n=function(t){e.push(t)},r=0;r<t.length;r++)t[r].each(n);return e},Ot=function(t,e,n){return t.isSome()&&e.isSome()?R.some(n(t.getOrDie(),e.getOrDie())):R.none()},Tt=function(t,e){return t?R.some(e):R.none()},_t=function(t,e,n){return""===e||t.length>=e.length&&t.substr(n,n+e.length)===e},Et=function(t,e){return-1!==t.indexOf(e)},Dt=function(t,e){return _t(t,e,0)},At=function(t,e){return _t(t,e,t.length-e.length)},Nt=function(t){return function(e){return e.replace(t,"")}}(/^\s+|\s+$/g),Mt=function(t){return t.length>0},zt=function(t){return void 0!==t.style&&d(t.style.getPropertyValue)},Rt=function(t){if(null===t||void 0===t)throw new Error("Node cannot be null or undefined");return{dom:t}},Bt={fromHtml:function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return Rt(n.childNodes[0])},fromTag:function(t,e){var n=(e||document).createElement(t);return Rt(n)},fromText:function(t,e){var n=(e||document).createTextNode(t);return Rt(n)},fromDom:Rt,fromPoint:function(t,e,n){return R.from(t.dom.elementFromPoint(e,n)).map(Rt)}};"undefined"!=typeof window?window:Function("return this;")();var Lt,Pt=function(t){return t.dom.nodeName.toLowerCase()},Ht=function(t){return function(e){return function(t){return t.dom.nodeType}(e)===t}},It=Ht(1),Ft=Ht(3),Vt=Ht(9),Ut=Ht(11),jt=function(t){var e,n=!1;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=!0,e=t.apply(null,r)),e}},Wt=function(){return qt(0,0)},qt=function(t,e){return{major:t,minor:e}},$t={nu:qt,detect:function(t,e){var n=String(e).toLowerCase();return 0===t.length?Wt():function(t,e){var n=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(r.test(e))return r}}(t,e);if(!n)return{major:0,minor:0};var r=function(t){return Number(e.replace(n,"$"+t))};return qt(r(1),r(2))}(t,n)},unknown:Wt},Gt=function(t,e){var n=String(e).toLowerCase();return Y(t,function(t){return t.search(n)})},Kt=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Xt=function(t){return function(e){return Et(e,t)}},Yt=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return Et(t,"edge/")&&Et(t,"chrome")&&Et(t,"safari")&&Et(t,"applewebkit")}},{name:"Chrome",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Kt],search:function(t){return Et(t,"chrome")&&!Et(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return Et(t,"msie")||Et(t,"trident")}},{name:"Opera",versionRegexes:[Kt,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Xt("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Xt("firefox")},{name:"Safari",versionRegexes:[Kt,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(Et(t,"safari")||Et(t,"mobile/"))&&Et(t,"applewebkit")}}],Jt=[{name:"Windows",search:Xt("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return Et(t,"iphone")||Et(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Xt("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:Xt("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Xt("linux"),versionRegexes:[]},{name:"Solaris",search:Xt("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Xt("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:Xt("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],Qt={browsers:v(Yt),oses:v(Jt)},Zt=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isEdge:r("Edge"),isChrome:r("Chrome"),isIE:r("IE"),isOpera:r("Opera"),isFirefox:r("Firefox"),isSafari:r("Safari")}},te={unknown:function(){return Zt({current:void 0,version:$t.unknown()})},nu:Zt,edge:v("Edge"),chrome:v("Chrome"),ie:v("IE"),opera:v("Opera"),firefox:v("Firefox"),safari:v("Safari")},ee=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isWindows:r("Windows"),isiOS:r("iOS"),isAndroid:r("Android"),isOSX:r("OSX"),isLinux:r("Linux"),isSolaris:r("Solaris"),isFreeBSD:r("FreeBSD"),isChromeOS:r("ChromeOS")}},ne={unknown:function(){return ee({current:void 0,version:$t.unknown()})},nu:ee,windows:v("Windows"),ios:v("iOS"),android:v("Android"),linux:v("Linux"),osx:v("OSX"),solaris:v("Solaris"),freebsd:v("FreeBSD"),chromeos:v("ChromeOS")},re=function(t,e,n){var r=Qt.browsers(),o=Qt.oses(),i=e.bind(function(t){return function(t,e){return lt(e.brands,function(e){var n=e.brand.toLowerCase();return Y(t,function(t){var e;return n===(null===(e=t.brand)||void 0===e?void 0:e.toLowerCase())}).map(function(t){return{current:t.name,version:$t.nu(parseInt(e.version,10),0)}})})}(r,t)}).orThunk(function(){return function(t,e){return Gt(t,e).map(function(t){var n=$t.detect(t.versionRegexes,e);return{current:t.name,version:n}})}(r,t)}).fold(te.unknown,te.nu),u=function(t,e){return Gt(t,e).map(function(t){var n=$t.detect(t.versionRegexes,e);return{current:t.name,version:n}})}(o,t).fold(ne.unknown,ne.nu);return{browser:i,os:u,deviceType:function(t,e,n,r){var o=t.isiOS()&&!0===/ipad/i.test(n),i=t.isiOS()&&!o,u=t.isiOS()||t.isAndroid(),a=u||r("(pointer:coarse)"),c=o||!i&&u&&r("(min-device-width:768px)"),s=i||u&&!c,l=e.isSafari()&&t.isiOS()&&!1===/safari/i.test(n),f=!s&&!c&&!l;return{isiPad:v(o),isiPhone:v(i),isTablet:v(c),isPhone:v(s),isTouch:v(a),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:v(l),isDesktop:v(f)}}(u,i,t,n)}},oe=function(t){return window.matchMedia(t).matches},ie=jt(function(){return re(navigator.userAgent,R.from(navigator.userAgentData),oe)}),ue=function(){return ie()},ae=function(t,e){var n=t.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},ce=function(t){return 1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType||0===t.childElementCount},se=function(t,e){return t.dom===e.dom},le=function(t,e){return n=t.dom,r=e.dom,function(t,e,n){return 0!=(t.compareDocumentPosition(e)&n)}(n,r,Node.DOCUMENT_POSITION_CONTAINED_BY);var n,r},fe=function(t,e){return ue().browser.isIE()?le(t,e):function(t,e){var n=t.dom,r=e.dom;return n!==r&&n.contains(r)}(t,e)},de=function(t){return Bt.fromDom(t.dom.ownerDocument)},me=function(t){return Vt(t)?t:de(t)},ge=function(t){return Bt.fromDom(me(t).dom.documentElement)},he=function(t){return Bt.fromDom(me(t).dom.defaultView)},pe=function(t){return R.from(t.dom.parentNode).map(Bt.fromDom)},ve=function(t){return R.from(t.dom.offsetParent).map(Bt.fromDom)},be=function(t){return W(t.dom.childNodes,Bt.fromDom)},ye=function(t,e){var n=t.dom.childNodes;return R.from(n[e]).map(Bt.fromDom)},we=function(t,e){return{element:t,offset:e}},xe=function(t,e){var n=be(t);return n.length>0&&e<n.length?we(n[e],0):we(t,e)},Ce=function(t){return Ut(t)&&f(t.dom.host)},Se=d(Element.prototype.attachShadow)&&d(Node.prototype.getRootNode),ke=v(Se),Oe=Se?function(t){return Bt.fromDom(t.dom.getRootNode())}:me,Te=function(t){return Ce(t)?t:Bt.fromDom(me(t).dom.body)},_e=function(t){var e=Oe(t);return Ce(e)?R.some(e):R.none()},Ee=function(t){return Bt.fromDom(t.dom.host)},De=function(t){return f(t.dom.shadowRoot)},Ae=function(t){var e=Ft(t)?t.dom.parentNode:t.dom;if(void 0===e||null===e||null===e.ownerDocument)return!1;var n,r,o=e.ownerDocument;return _e(Bt.fromDom(e)).fold(function(){return o.body.contains(e)},(n=Ae,r=Ee,function(t){return n(r(t))}))},Ne=function(){return Me(Bt.fromDom(document))},Me=function(t){var e=t.dom.body;if(null===e||void 0===e)throw new Error("Body is not available yet");return Bt.fromDom(e)},ze=function(t,e,n){if(!(o(n)||c(n)||m(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")},Re=function(t,e,n){ze(t.dom,e,n)},Be=function(t,e){var n=t.dom;mt(e,function(t,e){ze(n,e,t)})},Le=function(t,e){var n=t.dom.getAttribute(e);return null===n?void 0:n},Pe=function(t,e){return R.from(Le(t,e))},He=function(t,e){var n=t.dom;return!(!n||!n.hasAttribute)&&n.hasAttribute(e)},Ie=function(t,e){t.dom.removeAttribute(e)},Fe=function(t,e,n){if(!o(n))throw console.error("Invalid call to CSS.set. Property ",e,":: Value ",n,":: Element ",t),new Error("CSS value must be a string: "+n);zt(t)&&t.style.setProperty(e,n)},Ve=function(t,e){zt(t)&&t.style.removeProperty(e)},Ue=function(t,e,n){var r=t.dom;Fe(r,e,n)},je=function(t,e){var n=t.dom;mt(e,function(t,e){Fe(n,e,t)})},We=function(t,e){var n=t.dom;mt(e,function(t,e){t.fold(function(){Ve(n,e)},function(t){Fe(n,e,t)})})},qe=function(t,e){var n=t.dom,r=window.getComputedStyle(n).getPropertyValue(e);return""!==r||Ae(t)?r:$e(n,e)},$e=function(t,e){return zt(t)?t.style.getPropertyValue(e):""},Ge=function(t,e){var n=t.dom,r=$e(n,e);return R.from(r).filter(function(t){return t.length>0})},Ke=function(t,e,n){var r=Bt.fromTag(t);return Ue(r,e,n),Ge(r,e).isSome()},Xe=function(t,e){var n=t.dom;Ve(n,e),St(Pe(t,"style").map(Nt),"")&&Ie(t,"style")},Ye=function(t){return t.dom.offsetWidth},Je=function(t,e){var n=function(n){var r=e(n);if(r<=0||null===r){var o=qe(n,t);return parseFloat(o)||0}return r},r=function(t,e){return X(e,function(e,n){var r=qe(t,n),o=void 0===r?0:parseInt(r,10);return isNaN(o)?e:e+o},0)};return{set:function(e,n){if(!m(n)&&!n.match(/^[0-9]+$/))throw new Error(t+".set accepts only positive integer values. Value was "+n);var r=e.dom;zt(r)&&(r.style[t]=n+"px")},get:n,getOuter:n,aggregate:r,max:function(t,e,n){var o=r(t,n);return e>o?e-o:0}}},Qe=Je("height",function(t){var e=t.dom;return Ae(t)?e.getBoundingClientRect().height:e.offsetHeight}),Ze=function(t){return Qe.get(t)},tn=function(t){return Qe.getOuter(t)},en=function(t,e){return{left:t,top:e,translate:function(n,r){return en(t+n,e+r)}}},nn=en,rn=function(t,e){return void 0!==t?t:void 0!==e?e:0},on=function(t){var e=t.dom.ownerDocument,n=e.body,r=e.defaultView,o=e.documentElement;if(n===t.dom)return nn(n.offsetLeft,n.offsetTop);var i=rn(null===r||void 0===r?void 0:r.pageYOffset,o.scrollTop),u=rn(null===r||void 0===r?void 0:r.pageXOffset,o.scrollLeft),a=rn(o.clientTop,n.clientTop),c=rn(o.clientLeft,n.clientLeft);return un(t).translate(u-c,i-a)},un=function(t){var e=t.dom,n=e.ownerDocument.body;return n===e?nn(n.offsetLeft,n.offsetTop):Ae(t)?function(t){var e=t.getBoundingClientRect();return nn(e.left,e.top)}(e):nn(0,0)},an=Je("width",function(t){return t.dom.offsetWidth}),cn=function(t){return an.get(t)},sn=function(t){return an.getOuter(t)},ln=function(t){var e=Bt.fromDom(function(t){if(ke()&&f(t.target)){var e=Bt.fromDom(t.target);if(It(e)&&De(e)&&t.composed&&t.composedPath){var n=t.composedPath();if(n)return at(n)}}return R.from(t.target)}(t).getOr(t.target)),n=function(){return t.stopPropagation()},r=function(){return t.preventDefault()},o=p(r,n);return function(t,e,n,r,o,i,u){return{target:t,x:e,y:n,stop:r,prevent:o,kill:i,raw:u}}(e,t.clientX,t.clientY,n,r,o,t)},fn=function(t,e,n,r,o){var i=function(t,e){return function(n){t(n)&&e(ln(n))}}(n,r);return t.dom.addEventListener(e,i,o),{unbind:w(dn,t,e,i,o)}},dn=function(t,e,n,r){t.dom.removeEventListener(e,n,r)},mn=function(t,e){pe(t).each(function(n){n.dom.insertBefore(e.dom,t.dom)})},gn=function(t,e){(function(t){return R.from(t.dom.nextSibling).map(Bt.fromDom)})(t).fold(function(){pe(t).each(function(t){pn(t,e)})},function(t){mn(t,e)})},hn=function(t,e){(function(t){return ye(t,0)})(t).fold(function(){pn(t,e)},function(n){t.dom.insertBefore(e.dom,n.dom)})},pn=function(t,e){t.dom.appendChild(e.dom)},vn=function(t,e){q(e,function(e){pn(t,e)})},bn=function(t){t.dom.textContent="",q(be(t),function(t){yn(t)})},yn=function(t){var e=t.dom;null!==e.parentNode&&e.parentNode.removeChild(e)},wn=function(t){var e,n=be(t);n.length>0&&(e=t,q(n,function(t){mn(e,t)})),yn(t)},xn=function(t){var e=void 0!==t?t.dom:document,n=e.body.scrollLeft||e.documentElement.scrollLeft,r=e.body.scrollTop||e.documentElement.scrollTop;return nn(n,r)},Cn=function(t,e,n){var r=(void 0!==n?n.dom:document).defaultView;r&&r.scrollTo(t,e)},Sn=function(t,e,n,r){return{x:t,y:e,width:n,height:r,right:t+n,bottom:e+r}},kn=function(t){var e=void 0===t?window:t,n=e.document,r=xn(Bt.fromDom(n));return function(t){var e=void 0===t?window:t;return ue().browser.isFirefox()?R.none():R.from(e.visualViewport)}(e).fold(function(){var t=e.document.documentElement,n=t.clientWidth,o=t.clientHeight;return Sn(r.left,r.top,n,o)},function(t){return Sn(Math.max(t.pageLeft,r.left),Math.max(t.pageTop,r.top),t.width,t.height)})},On=function(t,e){return t.view(e).fold(v([]),function(e){var n=t.owner(e),r=On(t,n);return[e].concat(r)})},Tn=Object.freeze({__proto__:null,view:function(t){var e;return(t.dom===document?R.none():R.from(null===(e=t.dom.defaultView)||void 0===e?void 0:e.frameElement)).map(Bt.fromDom)},owner:function(t){return de(t)}}),_n=function(t){var e=Bt.fromDom(document),n=xn(e);return function(t,e){var n=e.owner(t),r=On(e,n);return R.some(r)}(t,Tn).fold(w(on,t),function(e){var r=un(t),o=K(e,function(t,e){var n=un(e);return{left:t.left+n.left,top:t.top+n.top}},{left:0,top:0});return nn(o.left+r.left+n.left,o.top+r.top+n.top)})},En=function(t,e,n,r){return{x:t,y:e,width:n,height:r,right:t+n,bottom:e+r}},Dn=function(t){var e=on(t),n=sn(t),r=tn(t);return En(e.left,e.top,n,r)},An=function(t){var e=_n(t),n=sn(t),r=tn(t);return En(e.left,e.top,n,r)},Nn=function(){return kn(window)},Mn=function(t){return{isValue:k,isError:S,getOr:v(t),getOrThunk:v(t),getOrDie:v(t),or:function(e){return Mn(t)},orThunk:function(e){return Mn(t)},fold:function(e,n){return n(t)},map:function(e){return Mn(e(t))},mapError:function(e){return Mn(t)},each:function(e){e(t)},bind:function(e){return e(t)},exists:function(e){return e(t)},forall:function(e){return e(t)},toOptional:function(){return R.some(t)}}},zn=function(t){return{isValue:S,isError:k,getOr:b,getOrThunk:function(t){return t()},getOrDie:function(){return C(String(t))()},or:b,orThunk:function(t){return t()},fold:function(e,n){return e(t)},map:function(e){return zn(t)},mapError:function(e){return zn(e(t))},each:h,bind:function(e){return zn(t)},exists:S,forall:k,toOptional:R.none}},Rn={value:Mn,error:zn,fromOption:function(t,e){return t.fold(function(){return zn(e)},Mn)}};!function(t){t[t.Error=0]="Error",t[t.Value=1]="Value"}(Lt||(Lt={}));var Bn=function(t,e,n){return t.stype===Lt.Error?e(t.serror):n(t.svalue)},Ln=function(t){return{stype:Lt.Value,svalue:t}},Pn=function(t){return{stype:Lt.Error,serror:t}},Hn=function(t){return t.fold(Pn,Ln)},In=function(t){return Bn(t,Rn.error,Rn.value)},Fn=Ln,Vn=function(t){var e=[],n=[];return q(t,function(t){Bn(t,function(t){return n.push(t)},function(t){return e.push(t)})}),{values:e,errors:n}},Un=Pn,jn=function(t,e){return t.stype===Lt.Value?e(t.svalue):t},Wn=function(t,e){return t.stype===Lt.Error?e(t.serror):t},qn=function(t,e){return t.stype===Lt.Value?{stype:Lt.Value,svalue:e(t.svalue)}:t},$n=function(t,e){return t.stype===Lt.Error?{stype:Lt.Error,serror:e(t.serror)}:t},Gn=Bn,Kn=function(t,e,n,r){return{tag:"field",key:t,newKey:e,presence:n,prop:r}},Xn=function(t,e,n){switch(t.tag){case"field":return e(t.key,t.newKey,t.presence,t.prop);case"custom":return n(t.newKey,t.instantiator)}},Yn=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(0===e.length)throw new Error("Can't merge zero objects");for(var r={},o=0;o<e.length;o++){var i=e[o];for(var u in i)xt(i,u)&&(r[u]=t(r[u],i[u]))}return r}},Jn=Yn(function(t,e){return i(t)&&i(e)?Jn(t,e):e}),Qn=Yn(function(t,e){return e}),Zn=function(t){return{tag:"defaultedThunk",process:t}},tr=function(t){return Zn(v(t))},er=function(t){return{tag:"mergeWithThunk",process:t}},nr=function(t){return p(Un,Q)(t)},rr=function(t){var e=Vn(t);return e.errors.length>0?nr(e.errors):Fn(e.values)},or=function(t){return i(t)&&ft(t).length>100?" removed due to size":JSON.stringify(t,null,2)},ir=function(t,e){return Un([{path:t,getErrorInfo:e}])},ur=function(t){return{extract:function(e,n){return Wn(t(n),function(t){return function(t,e){return ir(t,v(e))}(e,t)})},toString:v("val")}},ar=ur(Fn),cr=function(t,e,n,r){return wt(e,n).fold(function(){return function(t,e,n){return ir(t,function(){return'Could not find valid *required* value for "'+e+'" in '+or(n)})}(t,n,e)},r)},sr=function(t,e,n,r){return r(wt(t,e).getOrThunk(function(){return n(t)}))},lr=function(t,e,n,r,o){var i=function(t){return o.extract(e.concat([r]),t)},u=function(t){return t.fold(function(){return Fn(R.none())},function(t){var n=o.extract(e.concat([r]),t);return qn(n,R.some)})};switch(t.tag){case"required":return cr(e,n,r,i);case"defaultedThunk":return sr(n,r,t.process,i);case"option":return function(t,e,n){return n(wt(t,e))}(n,r,u);case"defaultedOptionThunk":return function(t,e,n,r){return r(wt(t,e).map(function(e){return!0===e?n(t):e}))}(n,r,t.process,u);case"mergeWithThunk":return sr(n,r,v({}),function(e){var r=Jn(t.process(n),e);return i(r)})}},fr=function(t){return{extract:function(e,n){return t().extract(e,n)},toString:function(){return t().toString()}}},dr=function(t){return ft(pt(t,f))},mr=function(t){var e=gr(t),n=K(t,function(t,e){return Xn(e,function(e){var n;return Jn(t,((n={})[e]=!0,n))},v(t))},{});return{extract:function(t,r){var o=c(r)?[]:dr(r),i=G(o,function(t){return!Ct(n,t)});return 0===i.length?e.extract(t,r):function(t,e){return ir(t,function(){return"There are unsupported fields: ["+e.join(", ")+"] specified"})}(t,i)},toString:e.toString}},gr=function(t){return{extract:function(e,n){return function(t,e,n){for(var r={},o=[],i=0,u=n;i<u.length;i++){var a=u[i];Xn(a,function(n,i,u,a){var c=lr(u,t,e,n,a);Gn(c,function(t){o.push.apply(o,t)},function(t){r[i]=t})},function(t,n){r[t]=n(e)})}return o.length>0?Un(o):Fn(r)}(e,n,t)},toString:function(){return"obj{\n"+W(t,function(t){return Xn(t,function(t,e,n,r){return t+" -> "+r.toString()},function(t,e){return"state("+t+")"})}).join("\n")+"}"}}},hr=function(t){return{extract:function(e,n){var r=W(n,function(n,r){return t.extract(e.concat(["["+r+"]"]),n)});return rr(r)},toString:function(){return"array("+t.toString()+")"}}},pr=function(t){return{extract:function(e,n){for(var r=[],o=0,i=t;o<i.length;o++){var u=i[o].extract(e,n);if(u.stype===Lt.Value)return u;r.push(u)}return rr(r)},toString:function(){return"oneOf("+W(t,function(t){return t.toString()}).join(", ")+")"}}},vr=function(t,e){return{extract:function(n,r){var o=ft(r),i=function(e,n){return hr(ur(t)).extract(e,n)}(n,o);return jn(i,function(t){var o=W(t,function(t){return Kn(t,t,{tag:"required",process:{}},e)});return gr(o).extract(n,r)})},toString:function(){return"setOf("+e.toString()+")"}}},br=p(hr,gr),yr=v(ar),wr=function(t,e){return ur(function(n){var r=typeof n;return t(n)?Fn(n):Un("Expected type: "+e+" but got: "+r)})},xr=wr(m,"number"),Cr=wr(o,"string"),Sr=wr(c,"boolean"),kr=wr(d,"function"),Or=function(t){if(Object(t)!==t)return!0;switch({}.toString.call(t).slice(8,-1)){case"Boolean":case"Number":case"String":case"Date":case"RegExp":case"Blob":case"FileList":case"ImageData":case"ImageBitmap":case"ArrayBuffer":return!0;case"Array":case"Object":return Object.keys(t).every(function(e){return Or(t[e])});default:return!1}},Tr=ur(function(t){return Or(t)?Fn(t):Un("Expected value to be acceptable for sending via postMessage")}),_r=function(t,e,n,r){return wt(n,r).fold(function(){return function(t,e,n){return ir(t,function(){return'The chosen schema: "'+n+'" did not exist in branches: '+or(e)})}(t,n,r)},function(n){return n.extract(t.concat(["branch: "+r]),e)})},Er=function(t,e){return{extract:function(n,r){return wt(r,t).fold(function(){return function(t,e){return ir(t,function(){return'Choice schema did not contain choice key: "'+e+'"'})}(n,t)},function(t){return _r(n,r,e,t)})},toString:function(){return"chooseOn("+t+"). Possible values: "+ft(e)}}},Dr=function(t){return ur(function(e){return t(e).fold(Un,Fn)})},Ar=function(t,e){return vr(function(e){return Hn(t(e))},e)},Nr=function(t,e,n){return In(function(t,e,n){var r=e.extract([t],n);return $n(r,function(t){return{input:n,errors:t}})}(t,e,n))},Mr=function(t){return t.fold(function(t){throw new Error(Rr(t))},b)},zr=function(t,e,n){return Mr(Nr(t,e,n))},Rr=function(t){return"Errors: \n"+(e=t.errors,n=e.length>10?e.slice(0,10).concat([{path:[],getErrorInfo:v("... (only showing first ten failures)")}]):e,W(n,function(t){return"Failed path: ("+t.path.join(" > ")+")\n"+t.getErrorInfo()})).join("\n")+"\n\nInput object: "+or(t.input);var e,n},Br=function(t,e){return Er(t,gt(e,gr))},Lr=Kn,Pr=function(t,e){return{tag:"custom",newKey:t,instantiator:e}},Hr=function(t){return Dr(function(e){return F(t,e)?Rn.value(e):Rn.error('Unsupported value: "'+e+'", choose one of "'+t.join(", ")+'".')})},Ir=function(t){return Lr(t,t,{tag:"required",process:{}},yr())},Fr=function(t,e){return Lr(t,t,{tag:"required",process:{}},e)},Vr=function(t){return Fr(t,Cr)},Ur=function(t,e){return Lr(t,t,{tag:"required",process:{}},Hr(e))},jr=function(t){return Fr(t,kr)},Wr=function(t,e){return Lr(t,t,{tag:"required",process:{}},gr(e))},qr=function(t,e){return Lr(t,t,{tag:"required",process:{}},br(e))},$r=function(t,e){return Lr(t,t,{tag:"required",process:{}},hr(e))},Gr=function(t){return Lr(t,t,{tag:"option",process:{}},yr())},Kr=function(t,e){return Lr(t,t,{tag:"option",process:{}},e)},Xr=function(t){return Kr(t,xr)},Yr=function(t){return Kr(t,Cr)},Jr=function(t){return Kr(t,kr)},Qr=function(t,e){return Kr(t,hr(e))},Zr=function(t,e){return Kr(t,gr(e))},to=function(t,e){return Lr(t,t,tr(e),yr())},eo=function(t,e,n){return Lr(t,t,tr(e),n)},no=function(t,e){return eo(t,e,xr)},ro=function(t,e){return eo(t,e,Cr)},oo=function(t,e,n){return eo(t,e,Hr(n))},io=function(t,e){return eo(t,e,Sr)},uo=function(t,e){return eo(t,e,kr)},ao=function(t,e,n){return eo(t,e,hr(n))},co=function(t,e,n){return eo(t,e,gr(n))},so=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},lo=function(t){if(!u(t))throw new Error("cases must be an array");if(0===t.length)throw new Error("there must be at least one case");var e=[],n={};return q(t,function(r,o){var i=ft(r);if(1!==i.length)throw new Error("one and only one name per case");var a=i[0],c=r[a];if(void 0!==n[a])throw new Error("duplicate key detected:"+a);if("cata"===a)throw new Error("cannot have a case named cata (sorry)");if(!u(c))throw new Error("case arguments must be an array");e.push(a),n[a]=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=n.length;if(i!==c.length)throw new Error("Wrong number of arguments to case "+a+". Expected "+c.length+" ("+c+"), got "+i);return{fold:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];if(e.length!==t.length)throw new Error("Wrong number of arguments to fold. Expected "+t.length+", got "+e.length);return e[o].apply(null,n)},match:function(t){var r=ft(t);if(e.length!==r.length)throw new Error("Wrong number of arguments to match. Expected: "+e.join(",")+"\nActual: "+r.join(","));if(!tt(e,function(t){return F(r,t)}))throw new Error("Not all branches were specified when using match. Specified: "+r.join(", ")+"\nRequired: "+e.join(", "));return t[a].apply(null,n)},log:function(t){console.log(t,{constructors:e,constructor:a,params:n})}}}}),n};lo([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);var fo,mo=function(t,e){return function(t,e){var n={};return mt(t,function(t,r){F(e,r)||(n[r]=t)}),n}(t,e)},go=function(t,e){return function(t,e){var n;return(n={})[t]=e,n}(t,e)},ho=function(t){return function(t){var e={};return q(t,function(t){e[t.key]=t.value}),e}(t)},po=function(t,e){var n,r,o=(n=[],r=[],q(t,function(t){t.fold(function(t){n.push(t)},function(t){r.push(t)})}),{errors:n,values:r});return o.errors.length>0?function(t){return Rn.error(Q(t))}(o.errors):function(t,e){return 0===t.length?Rn.value(e):Rn.value(Jn(e,Qn.apply(void 0,t)))}(o.values,e)},vo=function(t){return d(t)?t:S},bo=function(t,e,n){for(var r=t.dom,o=vo(n);r.parentNode;){r=r.parentNode;var i=Bt.fromDom(r),u=e(i);if(u.isSome())return u;if(o(i))break}return R.none()},yo=function(t,e,n){var r=e(t),o=vo(n);return r.orThunk(function(){return o(t)?R.none():bo(t,e,o)})},wo=function(t,e){return se(t.element,e.event.target)},xo={can:k,abort:S,run:h},Co=function(t){if(!Ct(t,"can")&&!Ct(t,"abort")&&!Ct(t,"run"))throw new Error("EventHandler defined by: "+JSON.stringify(t,null,2)+" does not have can, abort, or run!");return T(T({},xo),t)},So=function(t){return{can:function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return X(t,function(t,r){return t&&e(r).apply(void 0,n)},!0)}}(t,function(t){return t.can}),abort:function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return X(t,function(t,r){return t||e(r).apply(void 0,n)},!1)}}(t,function(t){return t.abort}),run:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];q(t,function(t){t.run.apply(void 0,e)})}}},ko=v,Oo=ko("touchstart"),To=ko("touchmove"),_o=ko("touchend"),Eo=ko("touchcancel"),Do=ko("mousedown"),Ao=ko("mousemove"),No=ko("mouseout"),Mo=ko("mouseup"),zo=ko("mouseover"),Ro=ko("focusin"),Bo=ko("focusout"),Lo=ko("keydown"),Po=ko("keyup"),Ho=ko("input"),Io=ko("change"),Fo=ko("click"),Vo=ko("transitioncancel"),Uo=ko("transitionend"),jo=ko("transitionstart"),Wo=ko("selectstart"),qo=function(t){return v("alloy."+t)},$o={tap:qo("tap")},Go=qo("focus"),Ko=qo("blur.post"),Xo=qo("paste.post"),Yo=qo("receive"),Jo=qo("execute"),Qo=qo("focus.item"),Zo=$o.tap,ti=qo("longpress"),ei=qo("sandbox.close"),ni=qo("typeahead.cancel"),ri=qo("system.init"),oi=qo("system.touchmove"),ii=qo("system.touchend"),ui=qo("system.scroll"),ai=qo("system.resize"),ci=qo("system.attached"),si=qo("system.detached"),li=qo("system.dismissRequested"),fi=qo("system.repositionRequested"),di=qo("focusmanager.shifted"),mi=qo("slotcontainer.visibility"),gi=qo("change.tab"),hi=qo("dismiss.tab"),pi=qo("highlight"),vi=qo("dehighlight"),bi=function(t,e){Ci(t,t.element,e,{})},yi=function(t,e,n){Ci(t,t.element,e,n)},wi=function(t){bi(t,Jo())},xi=function(t,e,n){Ci(t,e,n,{})},Ci=function(t,e,n,r){var o=T({target:e},r);t.getSystem().triggerEvent(n,e,o)},Si=function(t,e,n,r){t.getSystem().triggerEvent(n,e,r.event)},ki=function(t){return ho(t)},Oi=function(t,e){return{key:t,value:Co({abort:e})}},Ti=function(t){return{key:t,value:Co({run:function(t,e){e.event.prevent()}})}},_i=function(t,e){return{key:t,value:Co({run:e})}},Ei=function(t,e,n){return{key:t,value:Co({run:function(t,r){e.apply(void 0,[t,r].concat(n))}})}},Di=function(t){return function(e){return{key:t,value:Co({run:function(t,n){wo(t,n)&&e(t,n)}})}}},Ai=function(t,e,n){return function(t,e){return _i(t,function(n,r){n.getSystem().getByUid(e).each(function(e){Si(e,e.element,t,r)})})}(t,e.partUids[n])},Ni=function(t,e){return _i(t,function(t,n){var r=n.event,o=t.getSystem().getByDom(r.target).getOrThunk(function(){return yo(r.target,function(e){return t.getSystem().getByDom(e).toOptional()},S).getOr(t)});e(t,o,n)})},Mi=function(t){return _i(t,function(t,e){e.cut()})},zi=function(t,e){return Di(t)(e)},Ri=Di(ci()),Bi=Di(si()),Li=Di(ri()),Pi=function(t){return function(e){return _i(t,e)}}(Jo()),Hi=function(t){return t.dom.innerHTML},Ii=function(t,e){var n,r,o=de(t).dom,i=Bt.fromDom(o.createDocumentFragment()),u=(n=e,(r=(o||document).createElement("div")).innerHTML=n,be(Bt.fromDom(r)));vn(i,u),bn(t),pn(t,i)},Fi=function(t){return function(t,e){return Bt.fromDom(t.dom.cloneNode(e))}(t,!1)},Vi=function(t){return Ce(t)?"#shadow-root":function(t){var e=Bt.fromTag("div"),n=Bt.fromDom(t.dom.cloneNode(!0));return pn(e,n),Hi(e)}(Fi(t))},Ui=function(t){return Vi(t)},ji=ki([function(t,e){return{key:t,value:Co({can:e})}}(Go(),function(t,e){var n=e.event,r=n.originator,o=n.target;return!function(t,e,n){return se(e,t.element)&&!se(e,n)}(t,r,o)||(console.warn(Go()+" did not get interpreted by the desired target. \nOriginator: "+Ui(r)+"\nTarget: "+Ui(o)+"\nCheck the "+Go()+" event handlers"),!1)})]),Wi=Object.freeze({__proto__:null,events:ji}),qi=0,$i=function(t){var e=(new Date).getTime();return t+"_"+Math.floor(1e9*Math.random())+ ++qi+String(e)},Gi=v("alloy-id-"),Ki=v("data-alloy-id"),Xi=Gi(),Yi=Ki(),Ji=function(t,e){Object.defineProperty(t.dom,Yi,{value:e,writable:!0})},Qi=function(t){var e=It(t)?t.dom[Yi]:null;return R.from(e)},Zi=function(t){return $i(t)},tu=b,eu=function(t){var e=function(e){return"The component must be in a context to execute: "+e+(t?"\n"+Ui(t().element)+" is not in context.":"")},n=function(t){return function(){throw new Error(e(t))}},r=function(t){return function(){console.warn(e(t))}};return{debugInfo:v("fake"),triggerEvent:r("triggerEvent"),triggerFocus:r("triggerFocus"),triggerEscape:r("triggerEscape"),broadcast:r("broadcast"),broadcastOn:r("broadcastOn"),broadcastEvent:r("broadcastEvent"),build:n("build"),addToWorld:n("addToWorld"),removeFromWorld:n("removeFromWorld"),addToGui:n("addToGui"),removeFromGui:n("removeFromGui"),getByUid:n("getByUid"),getByDom:n("getByDom"),isConnected:S}},nu=eu(),ru=function(t){return W(t,function(t){return At(t,"/*")?t.substring(0,t.length-"/*".length):t})},ou=function(t,e){var n=t.toString(),r=n.indexOf(")")+1,o=n.indexOf("("),i=n.substring(o+1,r-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:e,parameters:ru(i)}},t},iu=$i("alloy-premade"),uu=function(t){return go(iu,t)},au=function(t){return function(t,e){var n=e.toString(),r=n.indexOf(")")+1,o=n.indexOf("("),i=n.substring(o+1,r-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:"OVERRIDE",parameters:ru(i.slice(1))}},t}(function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return t.apply(void 0,E([e.getApis(),e],n,!1))},t)},cu={init:function(){return su({readState:v("No State required")})}},su=function(t){return t},lu=function(t,e){var n={};return mt(t,function(t,r){mt(t,function(t,o){var i=wt(n,o).getOr([]);n[o]=i.concat([e(r,t)])})}),n},fu=function(t){return{classes:s(t.classes)?[]:t.classes,attributes:s(t.attributes)?{}:t.attributes,styles:s(t.styles)?{}:t.styles}},du=function(t){return t.cHandler},mu=function(t,e){return{name:t,handler:e}},gu=function(t,e,n){var r=T(T({},n),function(t,e){var n={};return q(t,function(t){n[t.name()]=t.handlers(e)}),n}(e,t));return lu(r,mu)},hu=function(t){var e=function(t){return d(t)?{can:k,abort:S,run:t}:t}(t);return function(t,n){for(var r=[],o=2;o<arguments.length;o++)r[o-2]=arguments[o];var i=[t,n].concat(r);e.abort.apply(void 0,i)?n.stop():e.can.apply(void 0,i)&&e.run.apply(void 0,i)}},pu=function(t,e,n){var r=e[n];return r?function(t,e,n,r){try{var o=it(n,function(n,o){var i=n[e],u=o[e],a=r.indexOf(i),c=r.indexOf(u);if(-1===a)throw new Error("The ordering for "+t+" does not have an entry for "+i+".\nOrder specified: "+JSON.stringify(r,null,2));if(-1===c)throw new Error("The ordering for "+t+" does not have an entry for "+u+".\nOrder specified: "+JSON.stringify(r,null,2));return a<c?-1:c<a?1:0});return Rn.value(o)}catch(t){return Rn.error([t])}}("Event: "+n,"name",t,r).map(function(t){var e=W(t,function(t){return t.handler});return So(e)}):function(t,e){return Rn.error(["The event ("+t+') has more than one behaviour that listens to it.\nWhen this occurs, you must specify an event ordering for the behaviours in your spec (e.g. [ "listing", "toggling" ]).\nThe behaviours that can trigger it are: '+JSON.stringify(W(e,function(t){return t.name}),null,2)])}(n,t)},vu=function(t,e){var n=vt(t,function(t,n){return(1===t.length?Rn.value(t[0].handler):pu(t,e,n)).map(function(r){var o=hu(r),i=t.length>1?G(e[n],function(e){return V(t,function(t){return t.name===e})}).join(" > "):t[0].name;return go(n,function(t,e){return{handler:t,purpose:e}}(o,i))})});return po(n,{})},bu="alloy.base.behaviour",yu=gr([Lr("dom","dom",{tag:"required",process:{}},gr([Ir("tag"),to("styles",{}),to("classes",[]),to("attributes",{}),Gr("value"),Gr("innerHtml")])),Ir("components"),Ir("uid"),to("events",{}),to("apis",{}),Lr("eventOrder","eventOrder",function(t){return er(v(t))}((fo={},fo[Jo()]=["disabling",bu,"toggling","typeaheadevents"],fo[Go()]=[bu,"focusing","keying"],fo[ri()]=[bu,"disabling","toggling","representing"],fo[Ho()]=[bu,"representing","streaming","invalidating"],fo[si()]=[bu,"representing","item-events","tooltipping"],fo[Do()]=["focusing",bu,"item-type-events"],fo[Oo()]=["focusing",bu,"item-type-events"],fo[zo()]=["item-type-events","tooltipping"],fo[Yo()]=["receiving","reflecting","tooltipping"],fo)),yr()),Gr("domModification")]),wu=function(t,e){var n=Le(t,e);return void 0===n||""===n?[]:n.split(" ")},xu=function(t){return void 0!==t.dom.classList},Cu=function(t,e){return function(t,e,n){var r=wu(t,e).concat([n]);return Re(t,e,r.join(" ")),!0}(t,"class",e)},Su=function(t,e){return function(t,e,n){var r=G(wu(t,e),function(t){return t!==n});return r.length>0?Re(t,e,r.join(" ")):Ie(t,e),!1}(t,"class",e)},ku=function(t,e){xu(t)?t.dom.classList.add(e):Cu(t,e)},Ou=function(t){0===(xu(t)?t.dom.classList:function(t){return wu(t,"class")}(t)).length&&Ie(t,"class")},Tu=function(t,e){xu(t)?t.dom.classList.remove(e):Su(t,e);Ou(t)},_u=function(t,e){return xu(t)&&t.dom.classList.contains(e)},Eu=function(t,e){q(e,function(e){ku(t,e)})},Du=function(t,e){q(e,function(e){Tu(t,e)})},Au=function(t){return t.dom.value},Nu=function(t,e){if(void 0===e)throw new Error("Value.set was undefined");t.dom.value=e},Mu=function(t,e){return function(t,e){var n=W(e,function(t){return Zr(t.name(),[Ir("config"),to("state",cu)])}),r=Nr("component.behaviours",gr(n),t.behaviours).fold(function(e){throw new Error(Rr(e)+"\nComplete spec:\n"+JSON.stringify(t,null,2))},b);return{list:e,data:gt(r,function(t){var e=t.map(function(t){return{config:t.config,state:t.state.init(t.config)}});return v(e)})}}(t,e)},zu=function(t){var e=function(t){var e=wt(t,"behaviours").getOr({});return Z(ft(e),function(t){var n=e[t];return f(n)?[n.me]:[]})}(t);return Mu(t,e)},Ru=function(t,e,n){var r,o,i,u=T(T({},(r=t).dom),{uid:r.uid,domChildren:W(r.components,function(t){return t.element})}),a=function(t){return t.domModification.fold(function(){return fu({})},fu)}(t),c={"alloy.base.modification":a},s=e.length>0?function(t,e,n,r){var o=T({},e);q(n,function(e){o[e.name()]=e.exhibit(t,r)});var i=lu(o,function(t,e){return{name:t,modification:e}}),u=function(t){return K(t,function(t,e){return T(T({},e.modification),t)},{})},a=K(i.classes,function(t,e){return e.modification.concat(t)},[]),c=u(i.attributes),s=u(i.styles);return fu({classes:a,attributes:c,styles:s})}(n,c,e,u):a;return i=s,T(T({},o=u),{attributes:T(T({},o.attributes),i.attributes),styles:T(T({},o.styles),i.styles),classes:o.classes.concat(i.classes)})},Bu=function(t,e,n){var r={"alloy.base.behaviour":function(t){return t.events}(t)};return function(t,e,n,r){var o=gu(t,n,r);return vu(o,e)}(n,t.eventOrder,e,r).getOrDie()},Lu=function(t){var e=function(){return l},n=so(nu),r=Mr(function(t){return Nr("custom.definition",yu,t)}(t)),o=zu(t),i=function(t){return t.list}(o),u=function(t){return t.data}(o),a=function(t){var e=Bt.fromTag(t.tag);Be(e,t.attributes),Eu(e,t.classes),je(e,t.styles),t.innerHtml.each(function(t){return Ii(e,t)});var n=t.domChildren;return vn(e,n),t.value.each(function(t){Nu(e,t)}),t.uid,Ji(e,t.uid),e}(Ru(r,i,u)),c=Bu(r,i,u),s=so(r.components),l={uid:t.uid,getSystem:n.get,config:function(e){var n=u;return(d(n[e.name()])?n[e.name()]:function(){throw new Error("Could not find "+e.name()+" in "+JSON.stringify(t,null,2))})()},hasConfigured:function(t){return d(u[t.name()])},spec:t,readState:function(t){return u[t]().map(function(t){return t.state.readState()}).getOr("not enabled")},getApis:function(){return r.apis},connect:function(t){n.set(t)},disconnect:function(){n.set(eu(e))},element:a,syncComponents:function(){var t=be(a),e=Z(t,function(t){return n.get().getByDom(t).fold(function(){return[]},ot)});s.set(e)},components:s.get,events:c};return l},Pu=function(t){var e=tu(t),n=e.events,r=_(e,["events"]),o=function(t){var e=wt(t,"components").getOr([]);return W(e,Vu)}(r),i=T(T({},r),{events:T(T({},Wi),n),components:o});return Rn.value(Lu(i))},Hu=function(t){var e=Bt.fromText(t);return Iu({element:e})},Iu=function(t){var e=zr("external.component",mr([Ir("element"),Gr("uid")]),t),n=so(eu()),r=e.uid.getOrThunk(function(){return Zi("external")});Ji(e.element,r);var o={uid:r,getSystem:n.get,config:R.none,hasConfigured:S,connect:function(t){n.set(t)},disconnect:function(){n.set(eu(function(){return o}))},getApis:function(){return{}},element:e.element,spec:t,readState:v("No state"),syncComponents:h,components:v([]),events:{}};return uu(o)},Fu=Zi,Vu=function(t){return function(t){return wt(t,iu)}(t).getOrThunk(function(){var e=function(t){return xt(t,"uid")}(t)?t:T({uid:Fu("")},t);return Pu(e).getOrDie()})},Uu=uu;function ju(t,e,n,r,o){return t(n,r)?R.some(n):d(o)&&o(n)?R.none():e(n,r,o)}var Wu,qu=function(t,e,n){for(var r=t.dom,o=d(n)?n:S;r.parentNode;){r=r.parentNode;var i=Bt.fromDom(r);if(e(i))return R.some(i);if(o(i))break}return R.none()},$u=function(t,e,n){return ju(function(t,e){return e(t)},qu,t,e,n)},Gu=function(t,e,n){return $u(t,e,n).isSome()},Ku=function(t,e,n){return qu(t,function(t){return ae(t,e)},n)},Xu=function(t,e){return function(t,e){return Y(t.dom.childNodes,function(t){return e(Bt.fromDom(t))}).map(Bt.fromDom)}(t,function(t){return ae(t,e)})},Yu=function(t,e){return function(t,e){var n=void 0===e?document:e.dom;return ce(n)?R.none():R.from(n.querySelector(t)).map(Bt.fromDom)}(e,t)},Ju=function(t,e,n){return ju(function(t,e){return ae(t,e)},Ku,t,e,n)},Qu=function(){var t=$i("aria-owns");return{id:t,link:function(e){Re(e,"aria-owns",t)},unlink:function(t){Ie(t,"aria-owns")}}},Zu=function(t,e){return function(t){return $u(t,function(t){if(!It(t))return!1;var e=Le(t,"id");return void 0!==e&&e.indexOf("aria-owns")>-1}).bind(function(t){var e=Le(t,"id"),n=Oe(t);return Yu(n,'[aria-owns="'+e+'"]')})}(e).exists(function(e){return ta(t,e)})},ta=function(t,e){return Gu(e,function(e){return se(e,t.element)},S)||Zu(t,e)};!function(t){t[t.STOP=0]="STOP",t[t.NORMAL=1]="NORMAL",t[t.LOGGING=2]="LOGGING"}(Wu||(Wu={}));var ea=so({}),na=function(t,e,n){switch(wt(ea.get(),t).orThunk(function(){var e=ft(ea.get());return lt(e,function(e){return t.indexOf(e)>-1?R.some(ea.get()[e]):R.none()})}).getOr(Wu.NORMAL)){case Wu.NORMAL:return n(ia());case Wu.LOGGING:var r=function(t,e){var n=[],r=(new Date).getTime();return{logEventCut:function(t,e,r){n.push({outcome:"cut",target:e,purpose:r})},logEventStopped:function(t,e,r){n.push({outcome:"stopped",target:e,purpose:r})},logNoParent:function(t,e,r){n.push({outcome:"no-parent",target:e,purpose:r})},logEventNoHandlers:function(t,e){n.push({outcome:"no-handlers-left",target:e})},logEventResponse:function(t,e,r){n.push({outcome:"response",purpose:r,target:e})},write:function(){var o=(new Date).getTime();F(["mousemove","mouseover","mouseout",ri()],t)||console.log(t,{event:t,time:o-r,target:e.dom,sequence:W(n,function(t){return F(["cut","stopped","response"],t.outcome)?"{"+t.purpose+"} "+t.outcome+" at ("+Ui(t.target)+")":t.outcome})})}}}(t,e),o=n(r);return r.write(),o;case Wu.STOP:return!0}},ra=["alloy/data/Fields","alloy/debugging/Debugging"],oa=function(t,e,n){return na(t,e,n)},ia=v({logEventCut:h,logEventStopped:h,logNoParent:h,logEventNoHandlers:h,logEventResponse:h,write:h}),ua=v([Ir("menu"),Ir("selectedMenu")]),aa=v([Ir("item"),Ir("selectedItem")]);v(gr(aa().concat(ua())));var ca=v(gr(aa())),sa=Wr("initSize",[Ir("numColumns"),Ir("numRows")]),la=function(){return Wr("markers",[Ir("backgroundMenu")].concat(ua()).concat(aa()))},fa=function(t){return Wr("markers",W(t,Ir))},da=function(t,e,n){return function(){var t=new Error;if(void 0!==t.stack){var e=t.stack.split("\n");return Y(e,function(t){return t.indexOf("alloy")>0&&!V(ra,function(e){return t.indexOf(e)>-1})}).getOr("unknown")}}(),Lr(e,e,n,Dr(function(t){return Rn.value(function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.apply(void 0,e)})}))},ma=function(t){return da(0,t,tr(h))},ga=function(t){return da(0,t,tr(R.none))},ha=function(t){return da(0,t,{tag:"required",process:{}})},pa=function(t){return da(0,t,{tag:"required",process:{}})},va=function(t,e){return Pr(t,v(e))},ba=function(t){return Pr(t,b)},ya=v(sa),wa=function(t,e,n,r,o,i,u,a){return void 0===a&&(a=!1),{x:t,y:e,bubble:n,direction:r,placement:o,restriction:i,label:u+"-"+o,alwaysFit:a}},xa=lo([{southeast:[]},{southwest:[]},{northeast:[]},{northwest:[]},{south:[]},{north:[]},{east:[]},{west:[]}]),Ca=xa.southeast,Sa=xa.southwest,ka=xa.northeast,Oa=xa.northwest,Ta=xa.south,_a=xa.north,Ea=xa.east,Da=xa.west,Aa=function(t,e,n,r){var o=t+e;return o>r?n:o<n?r:o},Na=function(t,e,n){return Math.min(Math.max(t,e),n)},Ma=function(t,e){return rt(["left","right","top","bottom"],function(n){return wt(e,n).map(function(e){return function(t,e){switch(e){case 1:return t.x;case 0:return t.x+t.width;case 2:return t.y;case 3:return t.y+t.height}}(t,e)})})},za=function(t){return t.x},Ra=function(t,e){return t.x+t.width/2-e.width/2},Ba=function(t,e){return t.x+t.width-e.width},La=function(t,e){return t.y-e.height},Pa=function(t){return t.y+t.height},Ha=function(t,e){return t.y+t.height/2-e.height/2},Ia=function(t,e,n){return wa(za(t),Pa(t),n.southeast(),Ca(),"southeast",Ma(t,{left:1,top:3}),"layout")},Fa=function(t,e,n){return wa(Ba(t,e),Pa(t),n.southwest(),Sa(),"southwest",Ma(t,{right:0,top:3}),"layout")},Va=function(t,e,n){return wa(za(t),La(t,e),n.northeast(),ka(),"northeast",Ma(t,{left:1,bottom:2}),"layout")},Ua=function(t,e,n){return wa(Ba(t,e),La(t,e),n.northwest(),Oa(),"northwest",Ma(t,{right:0,bottom:2}),"layout")},ja=function(t,e,n){return wa(Ra(t,e),La(t,e),n.north(),_a(),"north",Ma(t,{bottom:2}),"layout")},Wa=function(t,e,n){return wa(Ra(t,e),Pa(t),n.south(),Ta(),"south",Ma(t,{top:3}),"layout")},qa=function(t,e,n){return wa(function(t){return t.x+t.width}(t),Ha(t,e),n.east(),Ea(),"east",Ma(t,{left:0}),"layout")},$a=function(t,e,n){return wa(function(t,e){return t.x-e.width}(t,e),Ha(t,e),n.west(),Da(),"west",Ma(t,{right:1}),"layout")},Ga=function(){return[Ia,Fa,Va,Ua,Wa,ja,qa,$a]},Ka=function(){return[Fa,Ia,Ua,Va,Wa,ja,qa,$a]},Xa=function(){return[Va,Ua,Ia,Fa,ja,Wa]},Ya=function(){return[Ua,Va,Fa,Ia,ja,Wa]},Ja=function(){return[Ia,Fa,Va,Ua,Wa,ja]},Qa=function(){return[Fa,Ia,Ua,Va,Wa,ja]},Za=Object.freeze({__proto__:null,events:function(t){return ki([_i(Yo(),function(e,n){var r=t.channels,o=n,i=function(t,e){return e.universal?t:G(t,function(t){return F(e.channels,t)})}(ft(r),o);q(i,function(t){var n=r[t],i=n.schema,u=zr("channel["+t+"] data\nReceiver: "+Ui(e.element),i,o.data);n.onReceive(e,u)})})])}}),tc=[Fr("channels",Ar(Rn.value,mr([ha("onReceive"),to("schema",yr())])))],ec=function(t,e,n){return Li(function(r,o){n(r,t,e)})},nc=function(t,e,n,r,o,i){var u,a,c=mr(t),s=Zr(e,[(u="config",a=t,Kr(u,mr(a)))]);return ic(c,s,e,n,r,o,i)},rc=function(t,e,n){return function(t,e,n){var r=n.toString(),o=r.indexOf(")")+1,i=r.indexOf("("),u=r.substring(i+1,o-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:e,parameters:ru(u.slice(0,1).concat(u.slice(3)))}},t}(function(r){for(var o=[],i=1;i<arguments.length;i++)o[i-1]=arguments[i];var u=[r].concat(o);return r.config({name:v(t)}).fold(function(){throw new Error("We could not find any behaviour configuration for: "+t+". Using API: "+n)},function(t){var n=Array.prototype.slice.call(u,1);return e.apply(void 0,[r,t.config,t.state].concat(n))})},n,e)},oc=function(t){return{key:t,value:void 0}},ic=function(t,e,n,r,o,i,u){var a=function(t){return Ct(t,n)?t[n]():R.none()},c=gt(o,function(t,e){return rc(n,t,e)}),s=gt(i,function(t,e){return ou(t,e)}),l=T(T(T({},s),c),{revoke:w(oc,n),config:function(e){var r=zr(n+"-config",t,e);return{key:n,value:{config:r,me:l,configAsRaw:jt(function(){return zr(n+"-config",t,e)}),initialConfig:e,state:u}}},schema:v(e),exhibit:function(t,e){return Ot(a(t),wt(r,"exhibit"),function(t,n){return n(e,t.config,t.state)}).getOrThunk(function(){return fu({})})},name:v(n),handlers:function(t){return a(t).map(function(t){return wt(r,"events").getOr(function(){return{}})(t.config,t.state)}).getOr({})}});return l},uc=function(t){return ho(t)},ac=mr([Ir("fields"),Ir("name"),to("active",{}),to("apis",{}),to("state",cu),to("extra",{})]),cc=function(t){var e=zr("Creating behaviour: "+t.name,ac,t);return nc(e.fields,e.name,e.active,e.apis,e.extra,e.state)},sc=mr([Ir("branchKey"),Ir("branches"),Ir("name"),to("active",{}),to("apis",{}),to("state",cu),to("extra",{})]),lc=function(t){var e,n,r,o,i,u,a,c,s=zr("Creating behaviour: "+t.name,sc,t);return e=Br(s.branchKey,s.branches),n=s.name,r=s.active,o=s.apis,i=s.extra,u=s.state,a=e,c=Zr(n,[Kr("config",e)]),ic(a,c,n,r,o,i,u)},fc=v(void 0),dc=cc({fields:tc,name:"receiving",active:Za}),mc=Object.freeze({__proto__:null,exhibit:function(t,e){return fu({classes:[],styles:e.useFixed()?{}:{position:"relative"}})}}),gc=function(){return Bt.fromDom(document)},hc=function(t){return t.dom.focus()},pc=function(t){var e=Oe(t).dom;return t.dom===e.activeElement},vc=function(t){return void 0===t&&(t=gc()),R.from(t.dom.activeElement).map(Bt.fromDom)},bc=function(t){return vc(Oe(t)).filter(function(e){return t.dom.contains(e.dom)})},yc=function(t,e){var n=Oe(e),r=vc(n).bind(function(t){var n,r,o=function(e){return se(t,e)};return o(e)?R.some(e):(n=o,(r=function(t){for(var e=0;e<t.childNodes.length;e++){var o=Bt.fromDom(t.childNodes[e]);if(n(o))return R.some(o);var i=r(t.childNodes[e]);if(i.isSome())return i}return R.none()})(e.dom))}),o=t(e);return r.each(function(t){vc(n).filter(function(e){return se(e,t)}).fold(function(){hc(t)},h)}),o},wc=function(t,e,n,r,o){var i=function(t){return t+"px"};return{position:t,left:e.map(i),top:n.map(i),right:r.map(i),bottom:o.map(i)}},xc=function(t,e){We(t,function(t){return T(T({},t),{position:R.some(t.position)})}(e))},Cc=lo([{none:[]},{relative:["x","y","width","height"]},{fixed:["x","y","width","height"]}]),Sc=function(t,e,n,r,o,i){var u,a,c,s,l,f,d,m,g,h=e.rect,p=h.x-n,v=h.y-r,b=o-(p+h.width),y=i-(v+h.height),w=R.some(p),x=R.some(v),C=R.some(b),S=R.some(y),k=R.none();return u=e.direction,a=function(){return wc(t,w,x,k,k)},c=function(){return wc(t,k,x,C,k)},s=function(){return wc(t,w,k,k,S)},l=function(){return wc(t,k,k,C,S)},f=function(){return wc(t,w,x,k,k)},d=function(){return wc(t,w,k,k,S)},m=function(){return wc(t,w,x,k,k)},g=function(){return wc(t,k,x,C,k)},u.fold(a,c,s,l,f,d,m,g)},kc=function(t,e){return t.fold(function(){var t=e.rect;return wc("absolute",R.some(t.x),R.some(t.y),R.none(),R.none())},function(t,n,r,o){return Sc("absolute",e,t,n,r,o)},function(t,n,r,o){return Sc("fixed",e,t,n,r,o)})},Oc=function(t,e){var n=w(_n,e),r=t.fold(n,n,function(){var t=xn();return _n(e).translate(-t.left,-t.top)}),o=sn(e),i=tn(e);return En(r.left,r.top,o,i)},Tc=function(t,e,n){var r=nn(e,n);return t.fold(v(r),v(r),function(){var t=xn();return r.translate(-t.left,-t.top)})};Cc.none;var _c,Ec=Cc.relative,Dc=Cc.fixed,Ac=function(t){return Pe(t,"data-alloy-placement")},Nc=lo([{fit:["reposition"]},{nofit:["reposition","visibleW","visibleH","isVisible"]}]),Mc=function(t,e,n,r){var o=t.bubble,i=o.offset,u=function(t,e,n){var r=function(r,o){return e[r].map(function(e){var i="top"===r||"bottom"===r,u=i?n.top:n.left,a=("left"===r||"top"===r?Math.max:Math.min)(e,o)+u;return i?Na(a,t.y,t.bottom):Na(a,t.x,t.right)}).getOr(o)},o=r("left",t.x),i=r("top",t.y),u=r("right",t.right),a=r("bottom",t.bottom);return En(o,i,u-o,a-i)}(r,t.restriction,i),a=t.x+i.left,c=t.y+i.top,s=En(a,c,e,n),l=function(t,e){var n=e.x,r=e.y,o=e.right,i=e.bottom,u=t.x,a=t.y,c=t.right,s=t.bottom,l=t.width,f=t.height;return{originInBounds:u>=n&&u<=o&&a>=r&&a<=i,sizeInBounds:c<=o&&c>=n&&s<=i&&s>=r,visibleW:Math.min(l,u>=n?o-u:c-n),visibleH:Math.min(f,a>=r?i-a:s-r)}}(s,u),f=l.originInBounds,d=l.sizeInBounds,m=l.visibleW,g=l.visibleH,h=f&&d,p=h?s:function(t,e){var n=e.x,r=e.y,o=e.right,i=e.bottom,u=t.x,a=t.y,c=t.width,s=t.height,l=Math.max(n,o-c),f=Math.max(r,i-s),d=Na(u,n,l),m=Na(a,r,f),g=Math.min(d+c,o)-d,h=Math.min(m+s,i)-m;return En(d,m,g,h)}(s,u),b=p.width>0&&p.height>0,y=function(t,e,n){var r,o,i,u=v(e.bottom-n.y),a=v(n.bottom-e.y),c=(r=a,o=a,i=u,t.fold(r,r,i,i,r,i,o,o)),s=v(e.right-n.x),l=v(n.right-e.x);return{maxWidth:function(t,e,n,r){return t.fold(e,r,e,r,n,n,e,r)}(t,l,l,s),maxHeight:c}}(t.direction,p,r),w=y.maxWidth,x={rect:p,maxHeight:y.maxHeight,maxWidth:w,direction:t.direction,placement:t.placement,classes:{on:o.classesOn,off:o.classesOff},layout:t.label,testY:c};return h||t.alwaysFit?Nc.fit(x):Nc.nofit(x,m,g,b)},zc=function(t){var e=so(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))}}},Rc=function(){return zc(function(t){return t.destroy()})},Bc=function(){return zc(function(t){return t.unbind()})},Lc=function(){var t=zc(h);return T(T({},t),{on:function(e){return t.get().each(e)}})},Pc=k,Hc=function(t,e,n){return function(t,e,n,r){return fn(t,e,n,r,!1)}(t,e,Pc,n)},Ic=function(t,e,n){return function(t,e,n,r){return fn(t,e,n,r,!0)}(t,e,Pc,n)},Fc=ln,Vc=["top","bottom","right","left"],Uc="data-alloy-transition-timer",jc=function(t,e){return function(t,e){return tt(e,function(e){return _u(t,e)})}(t,e.classes)},Wc=function(t,e){var n=function(t){return parseFloat(t).toFixed(3)};return bt(e,function(e,r){var o,i,u,a=t[r].map(n),c=e.map(n);return o=a,i=c,void 0===u&&(u=y),!Ot(o,i,u).getOr(o.isNone()&&i.isNone())}).isSome()},qc=function(t,e){var n,r=Bc(),i=Bc(),u=function(e){var n,r=null!==(n=e.raw.pseudoElement)&&void 0!==n?n:"";return se(e.target,t)&&!Mt(r)&&F(Vc,e.raw.propertyName)},a=function(o){if(l(o)||u(o)){r.clear(),i.clear();var a=null===o||void 0===o?void 0:o.raw.type;(l(a)||a===Uo())&&(clearTimeout(n),Ie(t,Uc),Du(t,e.classes))}},c=function(){r.set(Hc(t,Uo(),a)),i.set(Hc(t,Vo(),a))};if("ontransitionstart"in t.dom)var s=Hc(t,jo(),function(t){u(t)&&(s.unbind(),c())});else c();var f=function(t){var e=function(e){var n=qe(t,e),r=o(n)?n.split(/\s*,\s*/):[];return G(r,Mt)},n=function(t){if(o(t)&&/^[\d.]+/.test(t)){var e=parseFloat(t);return At(t,"ms")?e:1e3*e}return 0},r=e("transition-delay"),i=e("transition-duration");return X(i,function(t,e,o){var i=n(r[o])+n(e);return Math.max(t,i)},0)}(t);requestAnimationFrame(function(){n=setTimeout(a,f+17),Re(t,Uc,n)})},$c=function(t,e,n,r,o,i){var u=function(t,e,n){return n.exists(function(n){var r=t.mode;return"all"===r||n[r]!==e[r]})}(r,o,i);if(u||jc(t,r)){Ue(t,"position",n.position);var a=Oc(e,t),c=kc(e,T(T({},o),{rect:a})),s=rt(Vc,function(t){return c[t]});Wc(n,s)&&(We(t,s),u&&function(t,e){Eu(t,e.classes),Pe(t,Uc).each(function(e){clearTimeout(parseInt(e,10)),Ie(t,Uc)}),qc(t,e)}(t,r),Ye(t))}else Du(t,r.classes)},Gc=function(t,e,n,r){Xe(e,"max-height"),Xe(e,"max-width");var o,i={width:sn(o=e),height:tn(o)};return function(t,e,n,r,o,i){var u=r.width,a=r.height,c=function(e,c,s,l,f){var d=e(n,r,o,t,i),m=Mc(d,u,a,i);return m.fold(v(m),function(t,e,n,r){return(f===r?n>l||e>s:!f&&r)?m:Nc.nofit(c,s,l,f)})};return X(e,function(t,e){var n=w(c,e);return t.fold(v(t),n)},Nc.nofit({rect:n,maxHeight:r.height,maxWidth:r.width,direction:Ca(),placement:"southeast",classes:{on:[],off:[]},layout:"none",testY:n.y},-1,-1,!1)).fold(b,b)}(e,r.preference,t,i,n,r.bounds)},Kc=function(t,e){!function(t,e){Re(t,"data-alloy-placement",e)}(t,e.placement)},Xc=function(t,e){!function(t,e){var n=Qe.max(t,e,["margin-top","border-top-width","padding-top","padding-bottom","border-bottom-width","margin-bottom"]);Ue(t,"max-height",n+"px")}(t,Math.floor(e))},Yc=v(function(t,e){Xc(t,e),je(t,{"overflow-x":"hidden","overflow-y":"auto"})}),Jc=v(function(t,e){Xc(t,e)}),Qc=function(t,e,n){return void 0===t[e]?n:t[e]},Zc=function(t,e,n,r,o,i,u,a){var c=Qc(u,"maxHeightFunction",Yc()),s=Qc(u,"maxWidthFunction",h),l=t.anchorBox,f=t.origin,d={bounds:function(t,e){return e.fold(function(){return t.fold(Nn,Nn,En)},function(e){return t.fold(e,e,function(){var n=e(),r=Tc(t,n.x,n.y);return En(r.left,r.top,n.width,n.height)})})}(f,i),origin:f,preference:r,maxHeightFunction:c,maxWidthFunction:s,lastPlacement:o,transition:a};return ts(l,e,n,d)},ts=function(t,e,n,r){var o=Gc(t,e,n,r);return function(t,e,n){var r=kc(n.origin,e);n.transition.each(function(o){$c(t,n.origin,r,o,e,n.lastPlacement)}),xc(t,r)}(e,o,r),Kc(e,o),function(t,e){var n=e.classes;Du(t,n.off),Eu(t,n.on)}(e,o),function(t,e,n){(0,n.maxHeightFunction)(t,e.maxHeight)}(e,o,r),function(t,e,n){(0,n.maxWidthFunction)(t,e.maxWidth)}(e,o,r),{layout:o.layout,placement:o.placement}},es=["valignCentre","alignLeft","alignRight","alignCentre","top","bottom","left","right","inset"],ns=function(t,e,n,r){void 0===r&&(r=1);var o=t*r,i=e*r,u=function(t){return wt(n,t).getOr([])},a=function(t,e,n){var r=nt(es,n);return{offset:nn(t,e),classesOn:Z(n,u),classesOff:Z(r,u)}};return{southeast:function(){return a(-t,e,["top","alignLeft"])},southwest:function(){return a(t,e,["top","alignRight"])},south:function(){return a(-t/2,e,["top","alignCentre"])},northeast:function(){return a(-t,-e,["bottom","alignLeft"])},northwest:function(){return a(t,-e,["bottom","alignRight"])},north:function(){return a(-t/2,-e,["bottom","alignCentre"])},east:function(){return a(t,-e/2,["valignCentre","left"])},west:function(){return a(-t,-e/2,["valignCentre","right"])},insetNortheast:function(){return a(o,i,["top","alignLeft","inset"])},insetNorthwest:function(){return a(-o,i,["top","alignRight","inset"])},insetNorth:function(){return a(-o/2,i,["top","alignCentre","inset"])},insetSoutheast:function(){return a(o,-i,["bottom","alignLeft","inset"])},insetSouthwest:function(){return a(-o,-i,["bottom","alignRight","inset"])},insetSouth:function(){return a(-o/2,-i,["bottom","alignCentre","inset"])},insetEast:function(){return a(-o,-i/2,["valignCentre","right","inset"])},insetWest:function(){return a(o,-i/2,["valignCentre","left","inset"])}}},rs=function(){return ns(0,0,{})},os=b,is=function(t,e){return function(n){return"rtl"===us(n)?e:t}},us=function(t){return"rtl"===qe(t,"direction")?"rtl":"ltr"};!function(t){t.TopToBottom="toptobottom",t.BottomToTop="bottomtotop"}(_c||(_c={}));var as="data-alloy-vertical-dir",cs=function(t){return Gu(t,function(t){return It(t)&&Le(t,"data-alloy-vertical-dir")===_c.BottomToTop})},ss=function(){return Zr("layouts",[Ir("onLtr"),Ir("onRtl"),Gr("onBottomLtr"),Gr("onBottomRtl")])},ls=function(t,e,n,r,o,i,u){var a=u.map(cs).getOr(!1),c=e.layouts.map(function(e){return e.onLtr(t)}),s=e.layouts.map(function(e){return e.onRtl(t)}),l=a?e.layouts.bind(function(e){return e.onBottomLtr.map(function(e){return e(t)})}).or(c).getOr(o):c.getOr(n),f=a?e.layouts.bind(function(e){return e.onBottomRtl.map(function(e){return e(t)})}).or(s).getOr(i):s.getOr(r);return is(l,f)(t)},fs=[Ir("hotspot"),Gr("bubble"),to("overrides",{}),ss(),va("placement",function(t,e,n){var r=e.hotspot,o=Oc(n,r.element),i=ls(t.element,e,Ja(),Qa(),Xa(),Ya(),R.some(e.hotspot.element));return R.some(os({anchorBox:o,bubble:e.bubble.getOr(rs()),overrides:e.overrides,layouts:i,placer:R.none()}))})],ds=[Ir("x"),Ir("y"),to("height",0),to("width",0),to("bubble",rs()),to("overrides",{}),ss(),va("placement",function(t,e,n){var r=Tc(n,e.x,e.y),o=En(r.left,r.top,e.width,e.height),i=ls(t.element,e,Ga(),Ka(),Ga(),Ka(),R.none());return R.some(os({anchorBox:o,bubble:e.bubble,overrides:e.overrides,layouts:i,placer:R.none()}))})],ms=lo([{screen:["point"]},{absolute:["point","scrollLeft","scrollTop"]}]),gs=function(t){return t.fold(b,function(t,e,n){return t.translate(-e,-n)})},hs=function(t){return t.fold(b,b)},ps=function(t){return X(t,function(t,e){return t.translate(e.left,e.top)},nn(0,0))},vs=function(t){var e=W(t,hs);return ps(e)},bs=ms.screen,ys=ms.absolute,ws=function(t,e,n){var r=de(t.element),o=xn(r),i=function(t,e,n){var r=he(n.root).dom;return R.from(r.frameElement).map(Bt.fromDom).filter(function(e){var n=de(e),r=de(t.element);return se(n,r)}).map(on)}(t,0,n).getOr(o);return ys(i,o.left,o.top)},xs=function(t,e,n,r){var o=bs(nn(t,e));return R.some(function(t,e,n){return{point:t,width:e,height:n}}(o,n,r))},Cs=function(t,e,n,r,o){return t.map(function(t){var i,u,a,c,s,l,f,d=[e,t.point],m=(i=function(){return vs(d)},u=function(){return vs(d)},a=function(){return function(t){var e=W(t,gs);return ps(e)}(d)},r.fold(i,u,a)),g=(c=m.left,s=m.top,l=t.width,f=t.height,{x:c,y:s,width:l,height:f}),h=n.showAbove?Xa():Ja(),p=n.showAbove?Ya():Qa(),v=ls(o,n,h,p,h,p,R.none());return os({anchorBox:g,bubble:n.bubble.getOr(rs()),overrides:n.overrides,layouts:v,placer:R.none()})})},Ss=[Ir("node"),Ir("root"),Gr("bubble"),ss(),to("overrides",{}),to("showAbove",!1),va("placement",function(t,e,n){var r=ws(t,0,e);return e.node.filter(Ae).bind(function(o){var i=o.dom.getBoundingClientRect(),u=xs(i.left,i.top,i.width,i.height),a=e.node.getOr(t.element);return Cs(u,r,e,n,a)})})],ks=function(t,e,n,r){return{start:t,soffset:e,finish:n,foffset:r}},Os=lo([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Ts=(Os.before,Os.on,Os.after,function(t){return t.fold(b,b,b)}),_s=lo([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Es={domRange:_s.domRange,relative:_s.relative,exact:_s.exact,exactFromRange:function(t){return _s.exact(t.start,t.soffset,t.finish,t.foffset)},getWin:function(t){var e=function(t){return t.match({domRange:function(t){return Bt.fromDom(t.startContainer)},relative:function(t,e){return Ts(t)},exact:function(t,e,n,r){return t}})}(t);return he(e)},range:ks},Ds=function(t,e,n){var r,o=t.document.createRange();return r=o,e.fold(function(t){r.setStartBefore(t.dom)},function(t,e){r.setStart(t.dom,e)},function(t){r.setStartAfter(t.dom)}),function(t,e){e.fold(function(e){t.setEndBefore(e.dom)},function(e,n){t.setEnd(e.dom,n)},function(e){t.setEndAfter(e.dom)})}(o,n),o},As=function(t,e,n,r,o){var i=t.document.createRange();return i.setStart(e.dom,n),i.setEnd(r.dom,o),i},Ns=function(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom,width:t.width,height:t.height}},Ms=lo([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),zs=function(t,e,n){return e(Bt.fromDom(n.startContainer),n.startOffset,Bt.fromDom(n.endContainer),n.endOffset)},Rs=function(t,e){return function(t,e){var n=e.ltr();return n.collapsed?e.rtl().filter(function(t){return!1===t.collapsed}).map(function(t){return Ms.rtl(Bt.fromDom(t.endContainer),t.endOffset,Bt.fromDom(t.startContainer),t.startOffset)}).getOrThunk(function(){return zs(0,Ms.ltr,n)}):zs(0,Ms.ltr,n)}(0,function(t,e){return e.match({domRange:function(t){return{ltr:v(t),rtl:R.none}},relative:function(e,n){return{ltr:jt(function(){return Ds(t,e,n)}),rtl:jt(function(){return R.some(Ds(t,n,e))})}},exact:function(e,n,r,o){return{ltr:jt(function(){return As(t,e,n,r,o)}),rtl:jt(function(){return R.some(As(t,r,o,e,n))})}}})}(t,e))},Bs=function(t,e){return Rs(t,e).match({ltr:function(e,n,r,o){var i=t.document.createRange();return i.setStart(e.dom,n),i.setEnd(r.dom,o),i},rtl:function(e,n,r,o){var i=t.document.createRange();return i.setStart(r.dom,o),i.setEnd(e.dom,n),i}})};Ms.ltr,Ms.rtl;var Ls,Ps=function(t,e){var n=function(e){return t(e)?R.from(e.dom.nodeValue):R.none()};return{get:function(r){if(!t(r))throw new Error("Can only get "+e+" value of a "+e+" node");return n(r).getOr("")},getOption:n,set:function(n,r){if(!t(n))throw new Error("Can only set raw "+e+" value of a "+e+" node");n.dom.nodeValue=r}}}(Ft,"text"),Hs=function(t){return Ps.getOption(t)},Is=["img","br"],Fs=function(t){return Hs(t).filter(function(t){return 0!==t.trim().length||t.indexOf(" ")>-1}).isSome()||F(Is,Pt(t))},Vs=function(t,e){var n=function(t){for(var r=be(t),o=r.length-1;o>=0;o--){var i=r[o];if(e(i))return R.some(i);var u=n(i);if(u.isSome())return u}return R.none()};return n(t)},Us=function(t,e){return function(t,e){var n=void 0===e?document:e.dom;return ce(n)?[]:W(n.querySelectorAll(t),Bt.fromDom)}(e,t)},js=function(t,e,n,r){var o=function(t,e,n,r){var o=de(t).dom.createRange();return o.setStart(t.dom,e),o.setEnd(n.dom,r),o}(t,e,n,r),i=se(t,n)&&e===r;return o.collapsed&&!i},Ws=function(t){if(t.rangeCount>0){var e=t.getRangeAt(0),n=t.getRangeAt(t.rangeCount-1);return R.some(ks(Bt.fromDom(e.startContainer),e.startOffset,Bt.fromDom(n.endContainer),n.endOffset))}return R.none()},qs=function(t){if(null===t.anchorNode||null===t.focusNode)return Ws(t);var e=Bt.fromDom(t.anchorNode),n=Bt.fromDom(t.focusNode);return js(e,t.anchorOffset,n,t.focusOffset)?R.some(ks(e,t.anchorOffset,n,t.focusOffset)):Ws(t)},$s=function(t){return function(t){return R.from(t.getSelection())}(t).filter(function(t){return t.rangeCount>0}).bind(qs)},Gs=function(t,e){return function(t){var e=t.getClientRects(),n=e.length>0?e[0]:t.getBoundingClientRect();return n.width>0||n.height>0?R.some(n).map(Ns):R.none()}(Bs(t,e))},Ks=function(t,e){return function(t){var e=t.getBoundingClientRect();return e.width>0||e.height>0?R.some(e).map(Ns):R.none()}(Bs(t,e))},Xs=function(t,e){return{element:t,offset:e}},Ys=function(t,e){var n=be(t);if(0===n.length)return Xs(t,e);if(e<n.length)return Xs(n[e],0);var r=n[n.length-1],o=Ft(r)?function(t){return Ps.get(t)}(r).length:be(r).length;return Xs(r,o)},Js=function(t,e){return Ft(t)?Xs(t,e):Ys(t,e)},Qs=function(t,e){return e.getSelection.getOrThunk(function(){return function(){return $s(t)}})().map(function(t){var e=Js(t.start,t.soffset),n=Js(t.finish,t.foffset);return Es.range(e.element,e.offset,n.element,n.offset)})},Zs=[Gr("getSelection"),Ir("root"),Gr("bubble"),ss(),to("overrides",{}),to("showAbove",!1),va("placement",function(t,e,n){var r=he(e.root).dom,o=ws(t,0,e),i=Qs(r,e).bind(function(t){return Ks(r,Es.exactFromRange(t)).orThunk(function(){var e=Bt.fromText("\ufeff");mn(t.start,e);var n=Gs(r,Es.exact(e,0,e,1));return yn(e),n}).bind(function(t){return xs(t.left,t.top,t.width,t.height)})}),u=Qs(r,e).bind(function(t){return It(t.start)?R.some(t.start):(e=t.start,pe(e));var e}).getOr(t.element);return Cs(i,o,e,n,u)})],tl=function(t){return t.x+t.width},el=function(t,e){return t.x-e.width},nl=function(t,e){return t.y-e.height+t.height},rl=function(t){return t.y},ol=function(t,e,n){return wa(tl(t),rl(t),n.southeast(),Ca(),"southeast",Ma(t,{left:0,top:2}),"link-layout")},il=function(t,e,n){return wa(el(t,e),rl(t),n.southwest(),Sa(),"southwest",Ma(t,{right:1,top:2}),"link-layout")},ul=function(t,e,n){return wa(tl(t),nl(t,e),n.northeast(),ka(),"northeast",Ma(t,{left:0,bottom:3}),"link-layout")},al=function(t,e,n){return wa(el(t,e),nl(t,e),n.northwest(),Oa(),"northwest",Ma(t,{right:1,bottom:3}),"link-layout")},cl=function(){return[ol,il,ul,al]},sl=function(){return[il,ol,al,ul]},ll=[Ir("item"),ss(),to("overrides",{}),va("placement",function(t,e,n){var r=Oc(n,e.item.element),o=ls(t.element,e,cl(),sl(),cl(),sl(),R.none());return R.some(os({anchorBox:r,bubble:rs(),overrides:e.overrides,layouts:o,placer:R.none()}))})],fl=Br("type",{selection:Zs,node:Ss,hotspot:fs,submenu:ll,makeshift:ds}),dl=[$r("classes",Cr),oo("mode","all",["all","layout","placement"])],ml=[to("useFixed",S),Gr("getBounds")],gl=[Fr("anchor",fl),Zr("transition",dl)],hl=function(t,e,n,r,o,i,u){var a=function(t,e){return function(t,e){return{anchorBox:t,origin:e}}(t,e)}(n.anchorBox,e);return Zc(a,o.element,n.bubble,n.layouts,i,r,n.overrides,u)},pl=function(t,e,n,r,o,i){var u=i.map(Dn);return vl(t,e,n,r,o,u)},vl=function(t,e,n,r,o,i){var u=zr("placement.info",gr(gl),o),a=u.anchor,c=r.element,s=n.get(r.uid);yc(function(){Ue(c,"position","fixed");var o=Ge(c,"visibility");Ue(c,"visibility","hidden");var l,f=e.useFixed()?(l=document.documentElement,Dc(0,0,l.clientWidth,l.clientHeight)):function(t){var e=on(t.element),n=t.element.dom.getBoundingClientRect();return Ec(e.left,e.top,n.width,n.height)}(t),d=a.placement,m=i.map(v).or(e.getBounds);d(t,a,f).each(function(e){var o=e.placer.getOr(hl)(t,f,e,m,r,s,u.transition);n.set(r.uid,o)}),o.fold(function(){Xe(c,"visibility")},function(t){Ue(c,"visibility",t)}),Ge(c,"left").isNone()&&Ge(c,"top").isNone()&&Ge(c,"right").isNone()&&Ge(c,"bottom").isNone()&&St(Ge(c,"position"),"fixed")&&Xe(c,"position")},c)},bl=cc({fields:ml,name:"positioning",active:mc,apis:Object.freeze({__proto__:null,position:function(t,e,n,r,o){pl(t,e,n,r,o,R.none())},positionWithin:pl,positionWithinBounds:vl,getMode:function(t,e,n){return e.useFixed()?"fixed":"absolute"},reset:function(t,e,n,r){var o=r.element;q(["position","left","right","top","bottom"],function(t){return Xe(o,t)}),function(t){Ie(t,"data-alloy-placement")}(o),n.clear(r.uid)}}),state:Object.freeze({__proto__:null,init:function(){var t={};return su({readState:function(){return t},clear:function(e){f(e)?delete t[e]:t={}},set:function(e,n){t[e]=n},get:function(e){return wt(t,e)}})}})}),yl=function(t){bi(t,si());var e=t.components();q(e,yl)},wl=function(t){var e=t.components();q(e,wl),bi(t,ci())},xl=function(t,e){pn(t.element,e.element)},Cl=function(t,e){var n=t.components();!function(t){q(t.components(),function(t){return yn(t.element)}),bn(t.element),t.syncComponents()}(t);var r=nt(n,e);q(r,function(e){yl(e),t.getSystem().removeFromWorld(e)}),q(e,function(e){e.getSystem().isConnected()?xl(t,e):(t.getSystem().addToWorld(e),xl(t,e),Ae(t.element)&&wl(e)),t.syncComponents()})},Sl=function(t,e){kl(t,e,pn)},kl=function(t,e,n){t.getSystem().addToWorld(e),n(t.element,e.element),Ae(t.element)&&wl(e),t.syncComponents()},Ol=function(t){yl(t),yn(t.element),t.getSystem().removeFromWorld(t)},Tl=function(t){var e=pe(t.element).bind(function(e){return t.getSystem().getByDom(e).toOptional()});Ol(t),e.each(function(t){t.syncComponents()})},_l=function(t){var e=t.components();q(e,Ol),bn(t.element),t.syncComponents()},El=function(t,e){Dl(t,e,pn)},Dl=function(t,e,n){n(t,e.element);var r=be(e.element);q(r,function(t){e.getByDom(t).each(wl)})},Al=function(t){var e=be(t.element);q(e,function(e){t.getByDom(e).each(yl)}),yn(t.element)},Nl=function(t,e,n,r){n.get().each(function(e){_l(t)});var o=e.getAttachPoint(t);Sl(o,t);var i=t.getSystem().build(r);return Sl(t,i),n.set(i),i},Ml=function(t,e,n,r){var o=Nl(t,e,n,r);return e.onOpen(t,o),o},zl=function(t,e,n){n.get().each(function(r){_l(t),Tl(t),e.onClose(t,r),n.clear()})},Rl=function(t,e,n){return n.isOpen()},Bl=function(t,e,n){var r=e.getAttachPoint(t);Ue(t.element,"position",bl.getMode(r)),function(t,e,n,r){Ge(t.element,e).fold(function(){Ie(t.element,n)},function(e){Re(t.element,n,e)}),Ue(t.element,e,r)}(t,"visibility",e.cloakVisibilityAttr,"hidden")},Ll=function(t,e,n){var r;r=t.element,V(["top","left","right","bottom"],function(t){return Ge(r,t).isSome()})||Xe(t.element,"position"),function(t,e,n){Pe(t.element,n).fold(function(){return Xe(t.element,e)},function(n){return Ue(t.element,e,n)})}(t,"visibility",e.cloakVisibilityAttr)},Pl=Object.freeze({__proto__:null,cloak:Bl,decloak:Ll,open:Ml,openWhileCloaked:function(t,e,n,r,o){Bl(t,e),Ml(t,e,n,r),o(),Ll(t,e)},close:zl,isOpen:Rl,isPartOf:function(t,e,n,r){return Rl(0,0,n)&&n.get().exists(function(n){return e.isPartOf(t,n,r)})},getState:function(t,e,n){return n.get()},setContent:function(t,e,n,r){return n.get().map(function(){return Nl(t,e,n,r)})}}),Hl=Object.freeze({__proto__:null,events:function(t,e){return ki([_i(ei(),function(n,r){zl(n,t,e)})])}}),Il=[ma("onOpen"),ma("onClose"),Ir("isPartOf"),Ir("getAttachPoint"),to("cloakVisibilityAttr","data-precloak-visibility")],Fl=cc({fields:Il,name:"sandboxing",active:Hl,apis:Pl,state:Object.freeze({__proto__:null,init:function(){var t=Lc(),e=v("not-implemented");return su({readState:e,isOpen:t.isSet,clear:t.clear,set:t.set,get:t.get})}})}),Vl=v("dismiss.popups"),Ul=v("reposition.popups"),jl=v("mouse.released"),Wl=mr([to("isExtraPart",S),Zr("fireEventInstead",[to("event",li())])]),ql=function(t){var e,n=zr("Dismissal",Wl,t);return(e={})[Vl()]={schema:mr([Ir("target")]),onReceive:function(t,e){Fl.isOpen(t)&&(Fl.isPartOf(t,e.target)||n.isExtraPart(t,e.target)||n.fireEventInstead.fold(function(){return Fl.close(t)},function(e){return bi(t,e.event)}))}},e},$l=mr([Zr("fireEventInstead",[to("event",fi())]),jr("doReposition")]),Gl=function(t){var e,n=zr("Reposition",$l,t);return(e={})[Ul()]={onReceive:function(t){Fl.isOpen(t)&&n.fireEventInstead.fold(function(){return n.doReposition(t)},function(e){return bi(t,e.event)})}},e},Kl=function(t,e,n){e.store.manager.onLoad(t,e,n)},Xl=function(t,e,n){e.store.manager.onUnload(t,e,n)},Yl=Object.freeze({__proto__:null,onLoad:Kl,onUnload:Xl,setValue:function(t,e,n,r){e.store.manager.setValue(t,e,n,r)},getValue:function(t,e,n){return e.store.manager.getValue(t,e,n)},getState:function(t,e,n){return n}}),Jl=Object.freeze({__proto__:null,events:function(t,e){var n=t.resetOnDom?[Ri(function(n,r){Kl(n,t,e)}),Bi(function(n,r){Xl(n,t,e)})]:[ec(t,e,Kl)];return ki(n)}}),Ql=function(){var t=so(null);return su({set:t.set,get:t.get,isNotSet:function(){return null===t.get()},clear:function(){t.set(null)},readState:function(){return{mode:"memory",value:t.get()}}})},Zl=function(){var t=so({}),e=so({});return su({readState:function(){return{mode:"dataset",dataByValue:t.get(),dataByText:e.get()}},lookup:function(n){return wt(t.get(),n).orThunk(function(){return wt(e.get(),n)})},update:function(n){var r=t.get(),o=e.get(),i={},u={};q(n,function(t){i[t.value]=t,wt(t,"meta").each(function(e){wt(e,"text").each(function(e){u[e]=t})})}),t.set(T(T({},r),i)),e.set(T(T({},o),u))},clear:function(){t.set({}),e.set({})}})},tf=Object.freeze({__proto__:null,memory:Ql,dataset:Zl,manual:function(){return su({readState:h})},init:function(t){return t.store.manager.state(t)}}),ef=function(t,e,n,r){var o=e.store;n.update([r]),o.setValue(t,r),e.onSetValue(t,r)},nf=[Gr("initialValue"),Ir("getFallbackEntry"),Ir("getDataKey"),Ir("setValue"),va("manager",{setValue:ef,getValue:function(t,e,n){var r=e.store,o=r.getDataKey(t);return n.lookup(o).getOrThunk(function(){return r.getFallbackEntry(o)})},onLoad:function(t,e,n){e.store.initialValue.each(function(r){ef(t,e,n,r)})},onUnload:function(t,e,n){n.clear()},state:Zl})],rf=[Ir("getValue"),to("setValue",h),Gr("initialValue"),va("manager",{setValue:function(t,e,n,r){e.store.setValue(t,r),e.onSetValue(t,r)},getValue:function(t,e,n){return e.store.getValue(t)},onLoad:function(t,e,n){e.store.initialValue.each(function(n){e.store.setValue(t,n)})},onUnload:h,state:cu.init})],of=[Gr("initialValue"),va("manager",{setValue:function(t,e,n,r){n.set(r),e.onSetValue(t,r)},getValue:function(t,e,n){return n.get()},onLoad:function(t,e,n){e.store.initialValue.each(function(t){n.isNotSet()&&n.set(t)})},onUnload:function(t,e,n){n.clear()},state:Ql})],uf=[eo("store",{mode:"memory"},Br("mode",{memory:of,manual:rf,dataset:nf})),ma("onSetValue"),to("resetOnDom",!1)],af=cc({fields:uf,name:"representing",active:Jl,apis:Yl,extra:{setValueFrom:function(t,e){var n=af.getValue(e);af.setValue(t,n)}},state:tf}),cf=function(t,e){return co(t,{},W(e,function(e){return n=e.name(),r="Cannot configure "+e.name()+" for "+t,Lr(n,n,{tag:"option",process:{}},ur(function(t){return Un("The field: "+n+" is forbidden. "+r)}));var n,r}).concat([Pr("dump",b)]))},sf=function(t){return t.dump},lf=function(t,e){return T(T({},uc(e)),t.dump)},ff=cf,df=lf,mf=lo([{single:["required","valueThunk"]},{multiple:["required","valueThunks"]}]),gf=function(t){return xt(t,"uiType")},hf=function(t,e,n,r){return gf(n)&&"placeholder"===n.uiType?function(t,e,n,r){return t.exists(function(t){return t!==n.owner})?mf.single(!0,v(n)):wt(r,n.name).fold(function(){throw new Error("Unknown placeholder component: "+n.name+"\nKnown: ["+ft(r)+"]\nNamespace: "+t.getOr("none")+"\nSpec: "+JSON.stringify(n,null,2))},function(t){return t.replace()})}(t,0,n,r):mf.single(!1,v(n))},pf=function(t,e,n,r){return hf(t,0,n,r).fold(function(o,i){var u=gf(n)?i(e,n.config,n.validated):i(e),a=wt(u,"components").getOr([]),c=Z(a,function(n){return pf(t,e,n,r)});return[T(T({},u),{components:c})]},function(t,r){if(gf(n)){var o=r(e,n.config,n.validated);return n.validated.preprocess.getOr(b)(o)}return r(e)})},vf=function(t,e,n,r){var o=gt(r,function(t,e){return r=t,o=!1,{name:v(n=e),required:function(){return r.fold(function(t,e){return t},function(t,e){return t})},used:function(){return o},replace:function(){if(o)throw new Error("Trying to use the same placeholder more than once: "+n);return o=!0,r}};var n,r,o}),i=function(t,e,n,r){return Z(n,function(n){return pf(t,e,n,r)})}(t,e,n,o);return mt(o,function(n){if(!1===n.used()&&n.required())throw new Error("Placeholder: "+n.name()+" was not found in components list\nNamespace: "+t.getOr("none")+"\nComponents: "+JSON.stringify(e.components,null,2))}),i},bf=mf.single,yf=mf.multiple,wf=v("placeholder"),xf=lo([{required:["data"]},{external:["data"]},{optional:["data"]},{group:["data"]}]),Cf=to("factory",{sketch:b}),Sf=to("schema",[]),kf=Ir("name"),Of=Lr("pname","pname",Zn(function(t){return"<alloy."+$i(t.name)+">"}),yr()),Tf=Pr("schema",function(){return[Gr("preprocess")]}),_f=to("defaults",v({})),Ef=to("overrides",v({})),Df=gr([Cf,Sf,kf,Of,_f,Ef]),Af=gr([Cf,Sf,kf,_f,Ef]),Nf=gr([Cf,Sf,kf,Of,_f,Ef]),Mf=gr([Cf,Tf,kf,Ir("unit"),Of,_f,Ef]),zf=function(t){return t.fold(R.some,R.none,R.some,R.some)},Rf=function(t){var e=function(t){return t.name};return t.fold(e,e,e,e)},Bf=function(t,e){return function(n){var r=zr("Converting part type",e,n);return t(r)}},Lf=Bf(xf.required,Df),Pf=Bf(xf.external,Af),Hf=Bf(xf.optional,Nf),If=Bf(xf.group,Mf),Ff=v("entirety"),Vf=Object.freeze({__proto__:null,required:Lf,external:Pf,optional:Hf,group:If,asNamedPart:zf,name:Rf,asCommon:function(t){return t.fold(b,b,b,b)},original:Ff}),Uf=function(t,e,n,r){return Jn(e.defaults(t,n,r),n,{uid:t.partUids[e.name]},e.overrides(t,n,r))},jf=function(t,e){var n={};return q(e,function(e){zf(e).each(function(e){var r=Wf(t,e.pname);n[e.name]=function(n){var o=zr("Part: "+e.name+" in "+t,gr(e.schema),n);return T(T({},r),{config:n,validated:o})}})}),n},Wf=function(t,e){return{uiType:wf(),owner:t,name:e}},qf=function(t,e,n){return{uiType:wf(),owner:t,name:e,config:n,validated:{}}},$f=function(t){return Z(t,function(t){return t.fold(R.none,R.some,R.none,R.none).map(function(t){return Wr(t.name,t.schema.concat([ba(Ff())]))}).toArray()})},Gf=function(t){return W(t,Rf)},Kf=function(t,e,n){return function(t,e,n){var r={},o={};return q(n,function(t){t.fold(function(t){r[t.pname]=bf(!0,function(e,n,r){return t.factory.sketch(Uf(e,t,n,r))})},function(t){var n=e.parts[t.name];o[t.name]=v(t.factory.sketch(Uf(e,t,n[Ff()]),n))},function(t){r[t.pname]=bf(!1,function(e,n,r){return t.factory.sketch(Uf(e,t,n,r))})},function(t){r[t.pname]=yf(!0,function(e,n,r){var o=e[t.name];return W(o,function(n){return t.factory.sketch(Jn(t.defaults(e,n,r),n,t.overrides(e,n)))})})})}),{internals:v(r),externals:v(o)}}(0,e,n)},Xf=function(t,e,n){return vf(R.some(t),e,e.components,n)},Yf=function(t,e,n){var r=e.partUids[n];return t.getSystem().getByUid(r).toOptional()},Jf=function(t,e,n){return Yf(t,e,n).getOrDie("Could not find part: "+n)},Qf=function(t,e,n){var r={},o=e.partUids,i=t.getSystem();return q(n,function(t){r[t]=v(i.getByUid(o[t]))}),r},Zf=function(t,e){var n=t.getSystem();return gt(e.partUids,function(t,e){return v(n.getByUid(t))})},td=function(t){return ft(t.partUids)},ed=function(t,e,n){var r={},o=e.partUids,i=t.getSystem();return q(n,function(t){r[t]=v(i.getByUid(o[t]).getOrDie())}),r},nd=function(t,e){var n=Gf(e);return ho(W(n,function(e){return{key:e,value:t+"-"+e}}))},rd=function(t){return Lr("partUids","partUids",er(function(e){return nd(e.uid,t)}),yr())},od=Object.freeze({__proto__:null,generate:jf,generateOne:qf,schemas:$f,names:Gf,substitutes:Kf,components:Xf,defaultUids:nd,defaultUidsSchema:rd,getAllParts:Zf,getAllPartNames:td,getPart:Yf,getPartOrDie:Jf,getParts:Qf,getPartsOrDie:ed}),id=function(t,e,n,r,o){var i=function(t,e){return(t.length>0?[Wr("parts",t)]:[]).concat([Ir("uid"),to("dom",{}),to("components",[]),ba("originalSpec"),to("debug.sketcher",{})]).concat(e)}(r,o);return zr(t+" [SpecSchema]",mr(i.concat(e)),n)},ud=function(t,e,n,r,o){var i=ad(o),u=$f(n),a=rd(n),c=id(t,e,i,u,[a]),s=Kf(0,c,n);return r(c,Xf(t,c,s.internals()),i,s.externals())},ad=function(t){return function(t){return xt(t,"uid")}(t)?t:T(T({},t),{uid:Zi("uid")})},cd=mr([Ir("name"),Ir("factory"),Ir("configFields"),to("apis",{}),to("extraApis",{})]),sd=mr([Ir("name"),Ir("factory"),Ir("configFields"),Ir("partFields"),to("apis",{}),to("extraApis",{})]),ld=function(t){var e=zr("Sketcher for "+t.name,cd,t),n=gt(e.apis,au),r=gt(e.extraApis,function(t,e){return ou(t,e)});return T(T({name:e.name,configFields:e.configFields,sketch:function(t){return function(t,e,n,r){var o=ad(r);return n(id(t,e,o,[],[]),o)}(e.name,e.configFields,e.factory,t)}},n),r)},fd=function(t){var e=zr("Sketcher for "+t.name,sd,t),n=jf(e.name,e.partFields),r=gt(e.apis,au),o=gt(e.extraApis,function(t,e){return ou(t,e)});return T(T({name:e.name,partFields:e.partFields,configFields:e.configFields,sketch:function(t){return ud(e.name,e.configFields,e.partFields,e.factory,t)},parts:n},r),o)},dd=function(t){return"input"===Pt(t)&&"radio"!==Le(t,"type")||"textarea"===Pt(t)},md=Object.freeze({__proto__:null,getCurrent:function(t,e,n){return e.find(t)}}),gd=[Ir("find")],hd=cc({fields:gd,name:"composing",apis:md}),pd=["input","button","textarea","select"],vd=function(t,e,n){(e.disabled()?Sd:kd)(t,e)},bd=function(t,e){return!0===e.useNative&&F(pd,Pt(t.element))},yd=function(t){Re(t.element,"disabled","disabled")},wd=function(t){Ie(t.element,"disabled")},xd=function(t){Re(t.element,"aria-disabled","true")},Cd=function(t){Re(t.element,"aria-disabled","false")},Sd=function(t,e,n){e.disableClass.each(function(e){ku(t.element,e)}),(bd(t,e)?yd:xd)(t),e.onDisabled(t)},kd=function(t,e,n){e.disableClass.each(function(e){Tu(t.element,e)}),(bd(t,e)?wd:Cd)(t),e.onEnabled(t)},Od=function(t,e){return bd(t,e)?function(t){return He(t.element,"disabled")}(t):function(t){return"true"===Le(t.element,"aria-disabled")}(t)},Td=Object.freeze({__proto__:null,enable:kd,disable:Sd,isDisabled:Od,onLoad:vd,set:function(t,e,n,r){(r?Sd:kd)(t,e)}}),_d=Object.freeze({__proto__:null,exhibit:function(t,e){return fu({classes:e.disabled()?e.disableClass.toArray():[]})},events:function(t,e){return ki([Oi(Jo(),function(e,n){return Od(e,t)}),ec(t,e,vd)])}}),Ed=[uo("disabled",S),to("useNative",!0),Gr("disableClass"),ma("onDisabled"),ma("onEnabled")],Dd=cc({fields:Ed,name:"disabling",active:_d,apis:Td}),Ad=function(t,e,n,r){var o=Us(t.element,"."+e.highlightClass);q(o,function(n){V(r,function(t){return t.element===n})||(Tu(n,e.highlightClass),t.getSystem().getByDom(n).each(function(n){e.onDehighlight(t,n),bi(n,vi())}))})},Nd=function(t,e,n,r){Ad(t,e,0,[r]),Md(t,e,n,r)||(ku(r.element,e.highlightClass),e.onHighlight(t,r),bi(r,pi()))},Md=function(t,e,n,r){return _u(r.element,e.highlightClass)},zd=function(t,e,n,r){var o=Us(t.element,"."+e.itemClass);return R.from(o[r]).fold(function(){return Rn.error(new Error("No element found with index "+r))},t.getSystem().getByDom)},Rd=function(t,e,n){return Yu(t.element,"."+e.itemClass).bind(function(e){return t.getSystem().getByDom(e).toOptional()})},Bd=function(t,e,n){var r=Us(t.element,"."+e.itemClass);return(r.length>0?R.some(r[r.length-1]):R.none()).bind(function(e){return t.getSystem().getByDom(e).toOptional()})},Ld=function(t,e,n,r){var o=Us(t.element,"."+e.itemClass);return J(o,function(t){return _u(t,e.highlightClass)}).bind(function(e){var n=Aa(e,r,0,o.length-1);return t.getSystem().getByDom(o[n]).toOptional()})},Pd=function(t,e,n){var r=Us(t.element,"."+e.itemClass);return kt(W(r,function(e){return t.getSystem().getByDom(e).toOptional()}))},Hd=Object.freeze({__proto__:null,dehighlightAll:function(t,e,n){return Ad(t,e,0,[])},dehighlight:function(t,e,n,r){Md(t,e,n,r)&&(Tu(r.element,e.highlightClass),e.onDehighlight(t,r),bi(r,vi()))},highlight:Nd,highlightFirst:function(t,e,n){Rd(t,e).each(function(r){Nd(t,e,n,r)})},highlightLast:function(t,e,n){Bd(t,e).each(function(r){Nd(t,e,n,r)})},highlightAt:function(t,e,n,r){zd(t,e,n,r).fold(function(t){throw t},function(r){Nd(t,e,n,r)})},highlightBy:function(t,e,n,r){var o=Pd(t,e);Y(o,r).each(function(r){Nd(t,e,n,r)})},isHighlighted:Md,getHighlighted:function(t,e,n){return Yu(t.element,"."+e.highlightClass).bind(function(e){return t.getSystem().getByDom(e).toOptional()})},getFirst:Rd,getLast:Bd,getPrevious:function(t,e,n){return Ld(t,e,0,-1)},getNext:function(t,e,n){return Ld(t,e,0,1)},getCandidates:Pd}),Id=[Ir("highlightClass"),Ir("itemClass"),ma("onHighlight"),ma("onDehighlight")],Fd=cc({fields:Id,name:"highlighting",apis:Hd}),Vd=[8],Ud=[9],jd=[13],Wd=[27],qd=[32],$d=[37],Gd=[38],Kd=[39],Xd=[40],Yd=function(t,e,n){var r=et(t.slice(0,e)),o=et(t.slice(e+1));return Y(r.concat(o),n)},Jd=function(t,e,n){var r=et(t.slice(0,e));return Y(r,n)},Qd=function(t,e,n){var r=t.slice(0,e),o=t.slice(e+1);return Y(o.concat(r),n)},Zd=function(t,e,n){var r=t.slice(e+1);return Y(r,n)},tm=function(t){return function(e){var n=e.raw;return F(t,n.which)}},em=function(t){return function(e){return tt(t,function(t){return t(e)})}},nm=function(t){return!0===t.raw.shiftKey},rm=function(t){return!0===t.raw.ctrlKey},om=x(nm),im=function(t,e){return{matches:t,classification:e}},um=function(t,e,n){e.exists(function(t){return n.exists(function(e){return se(e,t)})})||yi(t,di(),{prevFocus:e,newFocus:n})},am=function(){var t=function(t){return bc(t.element)};return{get:t,set:function(e,n){var r=t(e);e.getSystem().triggerFocus(n,e.element);var o=t(e);um(e,r,o)}}},cm=function(){var t=function(t){return Fd.getHighlighted(t).map(function(t){return t.element})};return{get:t,set:function(e,n){var r=t(e);e.getSystem().getByDom(n).fold(h,function(t){Fd.highlight(e,t)});var o=t(e);um(e,r,o)}}};!function(t){t.OnFocusMode="onFocus",t.OnEnterOrSpaceMode="onEnterOrSpace",t.OnApiMode="onApi"}(Ls||(Ls={}));var sm,lm=function(t,e,n,r,o){var i=function(t,e,n,r,o){var i,u,a=n(t,e,r,o);return(i=a,u=e.event,Y(i,function(t){return t.matches(u)}).map(function(t){return t.classification})).bind(function(n){return n(t,e,r,o)})},u={schema:function(){return t.concat([to("focusManager",am()),eo("focusInside","onFocus",Dr(function(t){return F(["onFocus","onEnterOrSpace","onApi"],t)?Rn.value(t):Rn.error("Invalid value for focusInside")})),va("handler",u),va("state",e),va("sendFocusIn",o)])},processKey:i,toEvents:function(t,e){var u=t.focusInside!==Ls.OnFocusMode?R.none():o(t).map(function(n){return _i(Go(),function(r,o){n(r,t,e),o.stop()})}),a=[_i(Lo(),function(r,u){i(r,u,n,t,e).fold(function(){!function(n,r){var i=tm(qd.concat(jd))(r.event);t.focusInside===Ls.OnEnterOrSpaceMode&&i&&wo(n,r)&&o(t).each(function(o){o(n,t,e),r.stop()})}(r,u)},function(t){u.stop()})}),_i(Po(),function(n,o){i(n,o,r,t,e).each(function(t){o.stop()})})];return ki(u.toArray().concat(a))}};return u},fm=function(t){var e=[Gr("onEscape"),Gr("onEnter"),to("selector",'[data-alloy-tabstop="true"]:not(:disabled)'),to("firstTabstop",0),to("useTabstopAt",k),Gr("visibilitySelector")].concat([t]),n=function(t,e){var n=t.visibilitySelector.bind(function(t){return Ju(e,t)}).getOr(e);return Ze(n)>0},r=function(t,e,r){(function(t,e){var r=Us(t.element,e.selector),o=G(r,function(t){return n(e,t)});return R.from(o[e.firstTabstop])})(t,e).each(function(n){e.focusManager.set(t,n)})},o=function(t,e,r,o,i){return i(e,r,function(t){return function(t,e){return n(t,e)&&t.useTabstopAt(e)}(o,t)}).fold(function(){return o.cyclic?R.some(!0):R.none()},function(e){return o.focusManager.set(t,e),R.some(!0)})},i=function(t,e,n,r){var i=Us(t.element,n.selector);return function(t,e){return e.focusManager.get(t).bind(function(t){return Ju(t,e.selector)})}(t,n).bind(function(e){return J(i,w(se,e)).bind(function(e){return o(t,i,e,n,r)})})},u=v([im(em([nm,tm(Ud)]),function(t,e,n){var r=n.cyclic?Yd:Jd;return i(t,0,n,r)}),im(tm(Ud),function(t,e,n){var r=n.cyclic?Qd:Zd;return i(t,0,n,r)}),im(tm(Wd),function(t,e,n){return n.onEscape.bind(function(n){return n(t,e)})}),im(em([om,tm(jd)]),function(t,e,n){return n.onEnter.bind(function(n){return n(t,e)})})]),a=v([]);return lm(e,cu.init,u,a,function(){return R.some(r)})},dm=fm(Pr("cyclic",S)),mm=fm(Pr("cyclic",k)),gm=function(t,e,n){return dd(n)&&tm(qd)(e.event)?R.none():function(t,e,n){return xi(t,n,Jo()),R.some(!0)}(t,0,n)},hm=function(t,e){return R.some(!0)},pm=[to("execute",gm),to("useSpace",!1),to("useEnter",!0),to("useControlEnter",!1),to("useDown",!1)],vm=function(t,e,n){return n.execute(t,e,t.element)},bm=lm(pm,cu.init,function(t,e,n,r){var o=n.useSpace&&!dd(t.element)?qd:[],i=n.useEnter?jd:[],u=n.useDown?Xd:[],a=o.concat(i).concat(u);return[im(tm(a),vm)].concat(n.useControlEnter?[im(em([rm,tm(jd)]),vm)]:[])},function(t,e,n,r){return n.useSpace&&!dd(t.element)?[im(tm(qd),hm)]:[]},function(){return R.none()}),ym=function(){var t=Lc();return su({readState:function(){return t.get().map(function(t){return{numRows:String(t.numRows),numColumns:String(t.numColumns)}}).getOr({numRows:"?",numColumns:"?"})},setGridSize:function(e,n){t.set({numRows:e,numColumns:n})},getNumRows:function(){return t.get().map(function(t){return t.numRows})},getNumColumns:function(){return t.get().map(function(t){return t.numColumns})}})},wm=Object.freeze({__proto__:null,flatgrid:ym,init:function(t){return t.state(t)}}),xm=function(t){return function(e,n,r,o){var i=t(e.element);return Om(i,e,n,r,o)}},Cm=function(t,e){var n=is(t,e);return xm(n)},Sm=function(t,e){var n=is(e,t);return xm(n)},km=function(t){return function(e,n,r,o){return Om(t,e,n,r,o)}},Om=function(t,e,n,r,o){return r.focusManager.get(e).bind(function(n){return t(e.element,n,r,o)}).map(function(t){return r.focusManager.set(e,t),!0})},Tm=km,_m=km,Em=km,Dm=function(t){return!((e=t.dom).offsetWidth<=0&&e.offsetHeight<=0);var e},Am=function(t,e,n){var r=Us(t,n);return function(t,e){return J(t,e).map(function(e){return{index:e,candidates:t}})}(G(r,Dm),function(t){return se(t,e)})},Nm=function(t,e){return J(t,function(t){return se(e,t)})},Mm=function(t,e,n,r){return r(Math.floor(e/n),e%n).bind(function(e){var r=e.row*n+e.column;return r>=0&&r<t.length?R.some(t[r]):R.none()})},zm=function(t,e,n,r,o){return Mm(t,e,r,function(e,i){var u=e===n-1?t.length-e*r:r,a=Aa(i,o,0,u-1);return R.some({row:e,column:a})})},Rm=function(t,e,n,r,o){return Mm(t,e,r,function(e,i){var u=Aa(e,o,0,n-1),a=u===n-1?t.length-u*r:r,c=Na(i,0,a-1);return R.some({row:u,column:c})})},Bm=[Ir("selector"),to("execute",gm),ga("onEscape"),to("captureTab",!1),ya()],Lm=function(t,e,n){Yu(t.element,e.selector).each(function(n){e.focusManager.set(t,n)})},Pm=function(t){return function(e,n,r,o){return Am(e,n,r.selector).bind(function(e){return t(e.candidates,e.index,o.getNumRows().getOr(r.initSize.numRows),o.getNumColumns().getOr(r.initSize.numColumns))})}},Hm=function(t,e,n){return n.captureTab?R.some(!0):R.none()},Im=Pm(function(t,e,n,r){return zm(t,e,n,r,-1)}),Fm=Pm(function(t,e,n,r){return zm(t,e,n,r,1)}),Vm=Pm(function(t,e,n,r){return Rm(t,e,n,r,-1)}),Um=Pm(function(t,e,n,r){return Rm(t,e,n,r,1)}),jm=v([im(tm($d),Cm(Im,Fm)),im(tm(Kd),Sm(Im,Fm)),im(tm(Gd),Tm(Vm)),im(tm(Xd),_m(Um)),im(em([nm,tm(Ud)]),Hm),im(em([om,tm(Ud)]),Hm),im(tm(Wd),function(t,e,n){return n.onEscape(t,e)}),im(tm(qd.concat(jd)),function(t,e,n,r){return function(t,e){return e.focusManager.get(t).bind(function(t){return Ju(t,e.selector)})}(t,n).bind(function(r){return n.execute(t,e,r)})})]),Wm=v([im(tm(qd),hm)]),qm=lm(Bm,ym,jm,Wm,function(){return R.some(Lm)}),$m=function(t,e,n,r){var o=function(t,e,n){var i,u=Aa(e,r,0,n.length-1);return u===t?R.none():(i=n[u],"button"===Pt(i)&&"disabled"===Le(i,"disabled")?o(t,u,n):R.from(n[u]))};return Am(t,n,e).bind(function(t){var e=t.index,n=t.candidates;return o(e,e,n)})},Gm=[Ir("selector"),to("getInitial",R.none),to("execute",gm),ga("onEscape"),to("executeOnMove",!1),to("allowVertical",!0)],Km=function(t,e,n){return function(t,e){return e.focusManager.get(t).bind(function(t){return Ju(t,e.selector)})}(t,n).bind(function(r){return n.execute(t,e,r)})},Xm=function(t,e,n){e.getInitial(t).orThunk(function(){return Yu(t.element,e.selector)}).each(function(n){e.focusManager.set(t,n)})},Ym=function(t,e,n){return $m(t,n.selector,e,-1)},Jm=function(t,e,n){return $m(t,n.selector,e,1)},Qm=function(t){return function(e,n,r,o){return t(e,n,r,o).bind(function(){return r.executeOnMove?Km(e,n,r):R.some(!0)})}},Zm=function(t,e,n){return n.onEscape(t,e)},tg=v([im(tm(qd),hm)]),eg=lm(Gm,cu.init,function(t,e,n,r){var o=$d.concat(n.allowVertical?Gd:[]),i=Kd.concat(n.allowVertical?Xd:[]);return[im(tm(o),Qm(Cm(Ym,Jm))),im(tm(i),Qm(Sm(Ym,Jm))),im(tm(jd),Km),im(tm(qd),Km),im(tm(Wd),Zm)]},tg,function(){return R.some(Xm)}),ng=function(t,e,n){return R.from(t[e]).bind(function(t){return R.from(t[n]).map(function(t){return{rowIndex:e,columnIndex:n,cell:t}})})},rg=function(t,e,n,r){var o=t[e].length,i=Aa(n,r,0,o-1);return ng(t,e,i)},og=function(t,e,n,r){var o=Aa(n,r,0,t.length-1),i=t[o].length,u=Na(e,0,i-1);return ng(t,o,u)},ig=function(t,e,n,r){var o=t[e].length,i=Na(n+r,0,o-1);return ng(t,e,i)},ug=function(t,e,n,r){var o=Na(n+r,0,t.length-1),i=t[o].length,u=Na(e,0,i-1);return ng(t,o,u)},ag=[Wr("selectors",[Ir("row"),Ir("cell")]),to("cycles",!0),to("previousSelector",R.none),to("execute",gm)],cg=function(t,e,n){e.previousSelector(t).orThunk(function(){var n=e.selectors;return Yu(t.element,n.cell)}).each(function(n){e.focusManager.set(t,n)})},sg=function(t,e){return function(n,r,o){var i=o.cycles?t:e;return Ju(r,o.selectors.row).bind(function(t){var e=Us(t,o.selectors.cell);return Nm(e,r).bind(function(e){var r=Us(n,o.selectors.row);return Nm(r,t).bind(function(t){var n=function(t,e){return W(t,function(t){return Us(t,e.selectors.cell)})}(r,o);return i(n,t,e).map(function(t){return t.cell})})})})}},lg=sg(function(t,e,n){return rg(t,e,n,-1)},function(t,e,n){return ig(t,e,n,-1)}),fg=sg(function(t,e,n){return rg(t,e,n,1)},function(t,e,n){return ig(t,e,n,1)}),dg=sg(function(t,e,n){return og(t,n,e,-1)},function(t,e,n){return ug(t,n,e,-1)}),mg=sg(function(t,e,n){return og(t,n,e,1)},function(t,e,n){return ug(t,n,e,1)}),gg=v([im(tm($d),Cm(lg,fg)),im(tm(Kd),Sm(lg,fg)),im(tm(Gd),Tm(dg)),im(tm(Xd),_m(mg)),im(tm(qd.concat(jd)),function(t,e,n){return bc(t.element).bind(function(r){return n.execute(t,e,r)})})]),hg=v([im(tm(qd),hm)]),pg=lm(ag,cu.init,gg,hg,function(){return R.some(cg)}),vg=[Ir("selector"),to("execute",gm),to("moveOnTab",!1)],bg=function(t,e,n){return n.focusManager.get(t).bind(function(r){return n.execute(t,e,r)})},yg=function(t,e,n){Yu(t.element,e.selector).each(function(n){e.focusManager.set(t,n)})},wg=function(t,e,n){return $m(t,n.selector,e,-1)},xg=function(t,e,n){return $m(t,n.selector,e,1)},Cg=v([im(tm(Gd),Em(wg)),im(tm(Xd),Em(xg)),im(em([nm,tm(Ud)]),function(t,e,n,r){return n.moveOnTab?Em(wg)(t,e,n,r):R.none()}),im(em([om,tm(Ud)]),function(t,e,n,r){return n.moveOnTab?Em(xg)(t,e,n,r):R.none()}),im(tm(jd),bg),im(tm(qd),bg)]),Sg=v([im(tm(qd),hm)]),kg=lm(vg,cu.init,Cg,Sg,function(){return R.some(yg)}),Og=[ga("onSpace"),ga("onEnter"),ga("onShiftEnter"),ga("onLeft"),ga("onRight"),ga("onTab"),ga("onShiftTab"),ga("onUp"),ga("onDown"),ga("onEscape"),to("stopSpaceKeyup",!1),Gr("focusIn")],Tg=lm(Og,cu.init,function(t,e,n){return[im(tm(qd),n.onSpace),im(em([om,tm(jd)]),n.onEnter),im(em([nm,tm(jd)]),n.onShiftEnter),im(em([nm,tm(Ud)]),n.onShiftTab),im(em([om,tm(Ud)]),n.onTab),im(tm(Gd),n.onUp),im(tm(Xd),n.onDown),im(tm($d),n.onLeft),im(tm(Kd),n.onRight),im(tm(qd),n.onSpace),im(tm(Wd),n.onEscape)]},function(t,e,n){return n.stopSpaceKeyup?[im(tm(qd),hm)]:[]},function(t){return t.focusIn}),_g=dm.schema(),Eg=mm.schema(),Dg=eg.schema(),Ag=qm.schema(),Ng=pg.schema(),Mg=bm.schema(),zg=kg.schema(),Rg=Tg.schema(),Bg=lc({branchKey:"mode",branches:Object.freeze({__proto__:null,acyclic:_g,cyclic:Eg,flow:Dg,flatgrid:Ag,matrix:Ng,execution:Mg,menu:zg,special:Rg}),name:"keying",active:{events:function(t,e){return t.handler.toEvents(t,e)}},apis:{focusIn:function(t,e,n){e.sendFocusIn(e).fold(function(){t.getSystem().triggerFocus(t.element,t.element)},function(r){r(t,e,n)})},setGridSize:function(t,e,n,r,o){!function(t){return Ct(t,"setGridSize")}(n)?console.error("Layout does not support setGridSize"):n.setGridSize(r,o)}},state:wm}),Lg=function(t,e,n,r){var o=t.getSystem().build(r);kl(t,o,n)},Pg=function(t,e,n,r){var o=Hg(t);Y(o,function(t){return se(r.element,t.element)}).each(Tl)},Hg=function(t,e){return t.components()},Ig=function(t,e,n,r,o){var i=Hg(t);return R.from(i[r]).map(function(e){return Pg(t,0,0,e),o.each(function(e){Lg(t,0,function(t,e){var n,o;o=e,ye(n=t,r).fold(function(){pn(n,o)},function(t){mn(t,o)})},e)}),e})},Fg=cc({fields:[],name:"replacing",apis:Object.freeze({__proto__:null,append:function(t,e,n,r){Lg(t,0,pn,r)},prepend:function(t,e,n,r){Lg(t,0,hn,r)},remove:Pg,replaceAt:Ig,replaceBy:function(t,e,n,r,o){var i=Hg(t);return J(i,r).bind(function(e){return Ig(t,0,0,e,o)})},set:function(t,e,n,r){yc(function(){var e=W(r,t.getSystem().build);Cl(t,e)},t.element)},contents:Hg})}),Vg=function(t,e){return{key:t,value:{config:{},me:function(t,e){var n=ki(e);return cc({fields:[Ir("enabled")],name:t,active:{events:v(n)}})}(t,e),configAsRaw:v({}),initialConfig:{},state:cu}}},Ug=function(t,e){e.ignore||(hc(t.element),e.onFocus(t))},jg=Object.freeze({__proto__:null,focus:Ug,blur:function(t,e){e.ignore||t.element.dom.blur()},isFocused:function(t){return pc(t.element)}}),Wg=Object.freeze({__proto__:null,exhibit:function(t,e){var n=e.ignore?{}:{attributes:{tabindex:"-1"}};return fu(n)},events:function(t){return ki([_i(Go(),function(e,n){Ug(e,t),n.stop()})].concat(t.stopMousedown?[_i(Do(),function(t,e){e.event.prevent()})]:[]))}}),qg=[ma("onFocus"),to("stopMousedown",!1),to("ignore",!1)],$g=cc({fields:qg,name:"focusing",active:Wg,apis:jg}),Gg=function(t,e,n){var r=e.aria;r.update(t,r,n.get())},Kg=function(t,e,n){e.toggleClass.each(function(e){n.get()?ku(t.element,e):Tu(t.element,e)})},Xg=function(t,e,n){Qg(t,e,n,!n.get())},Yg=function(t,e,n){n.set(!0),Kg(t,e,n),Gg(t,e,n)},Jg=function(t,e,n){n.set(!1),Kg(t,e,n),Gg(t,e,n)},Qg=function(t,e,n,r){(r?Yg:Jg)(t,e,n)},Zg=function(t,e,n){Qg(t,e,n,e.selected)},th=Object.freeze({__proto__:null,onLoad:Zg,toggle:Xg,isOn:function(t,e,n){return n.get()},on:Yg,off:Jg,set:Qg}),eh=Object.freeze({__proto__:null,exhibit:function(){return fu({})},events:function(t,e){var n,r,o,i=(n=t,r=e,o=Xg,Pi(function(t){o(t,n,r)})),u=ec(t,e,Zg);return ki(Q([t.toggleOnExecute?[i]:[],[u]]))}}),nh=function(t,e,n){Re(t.element,"aria-expanded",n)},rh=[to("selected",!1),Gr("toggleClass"),to("toggleOnExecute",!0),eo("aria",{mode:"none"},Br("mode",{pressed:[to("syncWithExpanded",!1),va("update",function(t,e,n){Re(t.element,"aria-pressed",n),e.syncWithExpanded&&nh(t,e,n)})],checked:[va("update",function(t,e,n){Re(t.element,"aria-checked",n)})],expanded:[va("update",nh)],selected:[va("update",function(t,e,n){Re(t.element,"aria-selected",n)})],none:[va("update",h)]}))],oh=cc({fields:rh,name:"toggling",active:eh,apis:th,state:(sm=!1,{init:function(){var t=so(sm);return{get:function(){return t.get()},set:function(e){return t.set(e)},clear:function(){return t.set(sm)},readState:function(){return t.get()}}}})}),ih=function(){var t=function(t,e){e.stop(),wi(t)};return[_i(Fo(),t),_i(Zo(),t),Mi(Oo()),Mi(Do())]},uh=function(t){return ki(Q([t.map(function(t){return Pi(function(e,n){t(e),n.stop()})}).toArray(),ih()]))},ah=function(t){(bc(t.element).isNone()||$g.isFocused(t))&&($g.isFocused(t)||$g.focus(t),yi(t,"alloy.item-hover",{item:t}))},ch=function(t){yi(t,"alloy.item-focus",{item:t})},sh=v("alloy.item-hover"),lh=v("alloy.item-focus"),fh=[Ir("data"),Ir("components"),Ir("dom"),to("hasSubmenu",!1),Gr("toggling"),ff("itemBehaviours",[oh,$g,Bg,af]),to("ignoreFocus",!1),to("domModification",{}),va("builder",function(t){return{dom:t.dom,domModification:T(T({},t.domModification),{attributes:T(T(T({role:t.toggling.isSome()?"menuitemcheckbox":"menuitem"},t.domModification.attributes),{"aria-haspopup":t.hasSubmenu}),t.hasSubmenu?{"aria-expanded":!1}:{})}),behaviours:df(t.itemBehaviours,[t.toggling.fold(oh.revoke,function(t){return oh.config(T({aria:{mode:"checked"}},t))}),$g.config({ignore:t.ignoreFocus,stopMousedown:t.ignoreFocus,onFocus:function(t){ch(t)}}),Bg.config({mode:"execution"}),af.config({store:{mode:"memory",initialValue:t.data}}),Vg("item-type-events",E(E([],ih(),!0),[_i(zo(),ah),_i(Qo(),$g.focus)],!1))]),components:t.components,eventOrder:t.eventOrder}}),to("eventOrder",{})],dh=[Ir("dom"),Ir("components"),va("builder",function(t){return{dom:t.dom,components:t.components,events:ki([(e=Qo(),_i(e,function(t,e){e.stop()}))])};var e})],mh=v("item-widget"),gh=v([Lf({name:"widget",overrides:function(t){return{behaviours:uc([af.config({store:{mode:"manual",getValue:function(e){return t.data},setValue:h}})])}}})]),hh=[Ir("uid"),Ir("data"),Ir("components"),Ir("dom"),to("autofocus",!1),to("ignoreFocus",!1),ff("widgetBehaviours",[af,$g,Bg]),to("domModification",{}),rd(gh()),va("builder",function(t){var e=Kf(mh(),t,gh()),n=Xf(mh(),t,e.internals()),r=function(e){return Yf(e,t,"widget").map(function(t){return Bg.focusIn(t),t})},o=function(e,n){return dd(n.event.target)?R.none():t.autofocus?(n.setSource(e.element),R.none()):R.none()};return{dom:t.dom,components:n,domModification:t.domModification,events:ki([Pi(function(t,e){r(t).each(function(t){e.stop()})}),_i(zo(),ah),_i(Qo(),function(e,n){t.autofocus?r(e):$g.focus(e)})]),behaviours:df(t.widgetBehaviours,[af.config({store:{mode:"memory",initialValue:t.data}}),$g.config({ignore:t.ignoreFocus,onFocus:function(t){ch(t)}}),Bg.config({mode:"special",focusIn:t.autofocus?function(t){r(t)}:fc(),onLeft:o,onRight:o,onEscape:function(e,n){return $g.isFocused(e)||t.autofocus?t.autofocus?(n.setSource(e.element),R.none()):R.none():($g.focus(e),R.some(!0))}})])}})],ph=Br("type",{widget:hh,item:fh,separator:dh}),vh=v([If({factory:{sketch:function(t){var e=zr("menu.spec item",ph,t);return e.builder(e)}},name:"items",unit:"item",defaults:function(t,e){return xt(e,"uid")?e:T(T({},e),{uid:Zi("item")})},overrides:function(t,e){return{type:e.type,ignoreFocus:t.fakeFocus,domModification:{classes:[t.markers.item]}}}})]),bh=v([Ir("value"),Ir("items"),Ir("dom"),Ir("components"),to("eventOrder",{}),cf("menuBehaviours",[Fd,af,hd,Bg]),eo("movement",{mode:"menu",moveOnTab:!0},Br("mode",{grid:[ya(),va("config",function(t,e){return{mode:"flatgrid",selector:"."+t.markers.item,initSize:{numColumns:e.initSize.numColumns,numRows:e.initSize.numRows},focusManager:t.focusManager}})],matrix:[va("config",function(t,e){return{mode:"matrix",selectors:{row:e.rowSelector,cell:"."+t.markers.item},focusManager:t.focusManager}}),Ir("rowSelector")],menu:[to("moveOnTab",!0),va("config",function(t,e){return{mode:"menu",selector:"."+t.markers.item,moveOnTab:e.moveOnTab,focusManager:t.focusManager}})]})),Fr("markers",ca()),to("fakeFocus",!1),to("focusManager",am()),ma("onHighlight")]),yh=v("alloy.menu-focus"),wh=fd({name:"Menu",configFields:bh(),partFields:vh(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,markers:t.markers,behaviours:lf(t.menuBehaviours,[Fd.config({highlightClass:t.markers.selectedItem,itemClass:t.markers.item,onHighlight:t.onHighlight}),af.config({store:{mode:"memory",initialValue:t.value}}),hd.config({find:R.some}),Bg.config(t.movement.config(t,t.movement))]),events:ki([_i(lh(),function(t,e){var n=e.event;t.getSystem().getByDom(n.target).each(function(n){Fd.highlight(t,n),e.stop(),yi(t,yh(),{menu:t,item:n})})}),_i(sh(),function(t,e){var n=e.event.item;Fd.highlight(t,n)})]),components:e,eventOrder:t.eventOrder,domModification:{attributes:{role:"menu"}}}}}),xh=function(t,e,n,r){return wt(n,r).bind(function(r){return wt(t,r).bind(function(r){var o=xh(t,e,n,r);return R.some([r].concat(o))})}).getOr([])},Ch=function(t,e){var n={};mt(t,function(t,e){q(t,function(t){n[t]=e})});var r=e,o=ht(e,function(t,e){return{k:t,v:e}}),i=gt(o,function(t,e){return[e].concat(xh(n,r,o,e))});return gt(n,function(t){return wt(i,t).getOr([t])})},Sh=function(t){return"prepared"===t.type?R.some(t.menu):R.none()},kh={init:function(){var t=so({}),e=so({}),n=so({}),r=Lc(),o=so({}),i=function(e,n,r){return u(e).bind(function(o){return function(e){return bt(t.get(),function(t,n){return t===e})}(e).bind(function(t){return n(t).map(function(t){return{triggeredMenu:o,triggeringItem:t,triggeringPath:r}})})})},u=function(t){return a(t).bind(Sh)},a=function(t){return wt(e.get(),t)},c=function(e){return wt(t.get(),e)};return{setMenuBuilt:function(t,n){var r;e.set(T(T({},e.get()),((r={})[t]={type:"prepared",menu:n},r)))},setContents:function(i,u,a,c){r.set(i),t.set(a),e.set(u),o.set(c);var s=Ch(c,a);n.set(s)},expand:function(e){return wt(t.get(),e).map(function(t){var r=wt(n.get(),e).getOr([]);return[t].concat(r)})},refresh:function(t){return wt(n.get(),t)},collapse:function(t){return wt(n.get(),t).bind(function(t){return t.length>1?R.some(t.slice(1)):R.none()})},lookupMenu:a,lookupItem:c,otherMenus:function(t){var e=o.get();return nt(ft(e),t)},getPrimary:function(){return r.get().bind(u)},getMenus:function(){return e.get()},clear:function(){t.set({}),e.set({}),n.set({}),r.clear()},isClear:function(){return r.get().isNone()},getTriggeringPath:function(t,e){var o=G(c(t).toArray(),function(t){return u(t).isSome()});return wt(n.get(),t).bind(function(t){var n=et(o.concat(t));return function(t){for(var e=[],n=0;n<t.length;n++){var r=t[n];if(!r.isSome())return R.none();e.push(r.getOrDie())}return R.some(e)}(Z(n,function(t,o){return i(t,e,n.slice(0,o+1)).fold(function(){return St(r.get(),t)?[]:[R.none()]},function(t){return[R.some(t)]})}))})}}},extractPreparedMenu:Sh},Oh=v("collapse-item"),Th=ld({name:"TieredMenu",configFields:[pa("onExecute"),pa("onEscape"),ha("onOpenMenu"),ha("onOpenSubmenu"),ma("onRepositionMenu"),ma("onCollapseMenu"),to("highlightImmediately",!0),Wr("data",[Ir("primary"),Ir("menus"),Ir("expansions")]),to("fakeFocus",!1),ma("onHighlight"),ma("onHover"),la(),Ir("dom"),to("navigateOnHover",!0),to("stayInDom",!1),cf("tmenuBehaviours",[Bg,Fd,hd,Fg]),to("eventOrder",{})],apis:{collapseMenu:function(t,e){t.collapseMenu(e)},highlightPrimary:function(t,e){t.highlightPrimary(e)},repositionMenus:function(t,e){t.repositionMenus(e)}},factory:function(t,e){var n,r=Lc(),o=kh.init(),i=function(e){var n=function(e,n,r){return gt(r,function(r,o){var i=function(){return wh.sketch(T(T({},r),{value:o,markers:t.markers,fakeFocus:t.fakeFocus,onHighlight:t.onHighlight,focusManager:t.fakeFocus?cm():am()}))};return o===n?{type:"prepared",menu:e.getSystem().build(i())}:{type:"notbuilt",nbMenu:i}})}(e,t.data.primary,t.data.menus),r=a();return o.setContents(t.data.primary,n,t.data.expansions,r),o.getPrimary()},u=function(t){return af.getValue(t).value},a=function(e){return gt(t.data.menus,function(t,e){return Z(t.items,function(t){return"separator"===t.type?[]:[t.data.value]})})},c=function(t,e){Fd.highlight(t,e),Fd.getHighlighted(e).orThunk(function(){return Fd.getFirst(e)}).each(function(e){xi(t,e.element,Qo())})},s=function(t,e){return kt(W(e,function(e){return t.lookupMenu(e).bind(function(t){return"prepared"===t.type?R.some(t.menu):R.none()})}))},l=function(e,n,r){var o=s(n,n.otherMenus(r));q(o,function(n){Du(n.element,[t.markers.backgroundMenu]),t.stayInDom||Fg.remove(e,n)})},f=function(e,n){var o=function(e){return r.get().getOrThunk(function(){var n={},o=Us(e.element,"."+t.markers.item),i=G(o,function(t){return"true"===Le(t,"aria-haspopup")});return q(i,function(t){e.getSystem().getByDom(t).each(function(t){var e=u(t);n[e]=t})}),r.set(n),n})}(e);mt(o,function(t,e){var r=F(n,e);Re(t.element,"aria-expanded",r)})},d=function(e,n,r){return R.from(r[0]).bind(function(o){return n.lookupMenu(o).bind(function(o){if("notbuilt"===o.type)return R.none();var i=o.menu,u=s(n,r.slice(1));return q(u,function(e){ku(e.element,t.markers.backgroundMenu)}),Ae(i.element)||Fg.append(e,Uu(i)),Du(i.element,[t.markers.backgroundMenu]),c(e,i),l(e,n,r),R.some(i)})})};!function(t){t[t.HighlightSubmenu=0]="HighlightSubmenu",t[t.HighlightParent=1]="HighlightParent"}(n||(n={}));var m=function(e,r,i){if(void 0===i&&(i=n.HighlightSubmenu),r.hasConfigured(Dd)&&Dd.isDisabled(r))return R.some(r);var a=u(r);return o.expand(a).bind(function(u){return f(e,u),R.from(u[0]).bind(function(a){return o.lookupMenu(a).bind(function(c){var s=function(t,e,n){if("notbuilt"===n.type){var r=t.getSystem().build(n.nbMenu());return o.setMenuBuilt(e,r),r}return n.menu}(e,a,c);return Ae(s.element)||Fg.append(e,Uu(s)),t.onOpenSubmenu(e,r,s,et(u)),i===n.HighlightSubmenu?(Fd.highlightFirst(s),d(e,o,u)):(Fd.dehighlightAll(s),R.some(r))})})})},g=function(e,n){var r=u(n);return o.collapse(r).bind(function(r){return f(e,r),d(e,o,r).map(function(r){return t.onCollapseMenu(e,n,r),r})})},p=function(e){return function(n,r){return Ju(r.getSource(),"."+t.markers.item).bind(function(t){return n.getSystem().getByDom(t).toOptional().bind(function(t){return e(n,t).map(k)})})}},v=ki([_i(yh(),function(t,e){var n=e.event.item;o.lookupItem(u(n)).each(function(){var n=e.event.menu;Fd.highlight(t,n);var r=u(e.event.item);o.refresh(r).each(function(e){return l(t,o,e)})})}),Pi(function(e,r){var o=r.event.target;e.getSystem().getByDom(o).each(function(r){0===u(r).indexOf("collapse-item")&&g(e,r),m(e,r,n.HighlightSubmenu).fold(function(){t.onExecute(e,r)},h)})}),Ri(function(e,n){i(e).each(function(n){Fg.append(e,Uu(n)),t.onOpenMenu(e,n),t.highlightImmediately&&c(e,n)})})].concat(t.navigateOnHover?[_i(sh(),function(e,r){var i=r.event.item;!function(t,e){var n=u(e);o.refresh(n).bind(function(e){return f(t,e),d(t,o,e)})}(e,i),m(e,i,n.HighlightParent),t.onHover(e,i)})]:[])),b=function(t){return Fd.getHighlighted(t).bind(Fd.getHighlighted)},y={collapseMenu:function(t){b(t).each(function(e){g(t,e)})},highlightPrimary:function(t){o.getPrimary().each(function(e){c(t,e)})},repositionMenus:function(e){o.getPrimary().bind(function(t){return b(e).bind(function(t){var e=u(t),n=yt(o.getMenus()),r=kt(W(n,kh.extractPreparedMenu));return o.getTriggeringPath(e,function(t){return e=t,lt(r,function(t){if(!t.getSystem().isConnected())return R.none();var n=Fd.getCandidates(t);return Y(n,function(t){return u(t)===e})});var e})}).map(function(e){return{primary:t,triggeringPath:e}})}).fold(function(){(function(t){return R.from(t.components()[0]).filter(function(t){return"menu"===Le(t.element,"role")})})(e).each(function(n){t.onRepositionMenu(e,n,[])})},function(n){var r=n.primary,o=n.triggeringPath;t.onRepositionMenu(e,r,o)})}};return{uid:t.uid,dom:t.dom,markers:t.markers,behaviours:lf(t.tmenuBehaviours,[Bg.config({mode:"special",onRight:p(function(t,e){return dd(e.element)?R.none():m(t,e,n.HighlightSubmenu)}),onLeft:p(function(t,e){return dd(e.element)?R.none():g(t,e)}),onEscape:p(function(e,n){return g(e,n).orThunk(function(){return t.onEscape(e,n).map(function(){return e})})}),focusIn:function(t,e){o.getPrimary().each(function(e){xi(t,e.element,Qo())})}}),Fd.config({highlightClass:t.markers.selectedMenu,itemClass:t.markers.menu}),hd.config({find:function(t){return Fd.getHighlighted(t)}}),Fg.config({})]),eventOrder:t.eventOrder,apis:y,events:v}},extraApis:{tieredData:function(t,e,n){return{primary:t,menus:e,expansions:n}},singleData:function(t,e){return{primary:t,menus:go(t,e),expansions:{}}},collapseItem:function(t){return{value:$i(Oh()),meta:{text:t}}}}}),_h=ld({name:"InlineView",configFields:[Ir("lazySink"),ma("onShow"),ma("onHide"),Jr("onEscape"),cf("inlineBehaviours",[Fl,af,dc]),Zr("fireDismissalEventInstead",[to("event",li())]),Zr("fireRepositionEventInstead",[to("event",fi())]),to("getRelated",R.none),to("isExtraPart",S),to("eventOrder",R.none)],factory:function(t,e){var n=function(t,e,n,o){r(t,e,n,function(){return o.map(function(t){return Dn(t)})})},r=function(e,n,r,o){var i=t.lazySink(e).getOrDie();Fl.openWhileCloaked(e,n,function(){return bl.positionWithinBounds(i,e,r,o())}),af.setValue(e,R.some({mode:"position",config:r,getBounds:o}))},o=function(e,n,r,o){var i=function(t,e,n,r,o){var i=function(){return t.lazySink(e)},u="horizontal"===r.type?{layouts:{onLtr:function(){return Ja()},onRtl:function(){return Qa()}}}:{},a=function(t){return function(t){return 2===t.length}(t)?u:{}};return Th.sketch({dom:{tag:"div"},data:r.data,markers:r.menu.markers,highlightImmediately:r.menu.highlightImmediately,onEscape:function(){return Fl.close(e),t.onEscape.map(function(t){return t(e)}),R.some(!0)},onExecute:function(){return R.some(!0)},onOpenMenu:function(t,e){bl.positionWithinBounds(i().getOrDie(),e,n,o())},onOpenSubmenu:function(t,e,n,r){var o=i().getOrDie();bl.position(o,n,{anchor:T({type:"submenu",item:e},a(r))})},onRepositionMenu:function(t,e,r){var u=i().getOrDie();bl.positionWithinBounds(u,e,n,o()),q(r,function(t){var e=a(t.triggeringPath);bl.position(u,t.triggeredMenu,{anchor:T({type:"submenu",item:t.triggeringItem},e)})})}})}(t,e,n,r,o);Fl.open(e,i),af.setValue(e,R.some({mode:"menu",menu:i}))},i=function(e){Fl.isOpen(e)&&af.getValue(e).each(function(n){switch(n.mode){case"menu":Fl.getState(e).each(Th.repositionMenus);break;case"position":var r=t.lazySink(e).getOrDie();bl.positionWithinBounds(r,e,n.config,n.getBounds())}})},u={setContent:function(t,e){Fl.setContent(t,e)},showAt:function(t,e,r){n(t,e,r,R.none())},showWithin:n,showWithinBounds:r,showMenuAt:function(t,e,n){o(t,e,n,R.none)},showMenuWithinBounds:o,hide:function(t){Fl.isOpen(t)&&(af.setValue(t,R.none()),Fl.close(t))},getContent:function(t){return Fl.getState(t)},reposition:i,isOpen:Fl.isOpen};return{uid:t.uid,dom:t.dom,behaviours:lf(t.inlineBehaviours,[Fl.config({isPartOf:function(e,n,r){return ta(n,r)||function(e,n){return t.getRelated(e).exists(function(t){return ta(t,n)})}(e,r)},getAttachPoint:function(e){return t.lazySink(e).getOrDie()},onOpen:function(e){t.onShow(e)},onClose:function(e){t.onHide(e)}}),af.config({store:{mode:"memory",initialValue:R.none()}}),dc.config({channels:T(T({},ql(T({isExtraPart:e.isExtraPart},t.fireDismissalEventInstead.map(function(t){return{fireEventInstead:{event:t.event}}}).getOr({})))),Gl(T(T({},t.fireRepositionEventInstead.map(function(t){return{fireEventInstead:{event:t.event}}}).getOr({})),{doReposition:i})))})]),eventOrder:t.eventOrder,apis:u}},apis:{showAt:function(t,e,n,r){t.showAt(e,n,r)},showWithin:function(t,e,n,r,o){t.showWithin(e,n,r,o)},showWithinBounds:function(t,e,n,r,o){t.showWithinBounds(e,n,r,o)},showMenuAt:function(t,e,n,r){t.showMenuAt(e,n,r)},showMenuWithinBounds:function(t,e,n,r,o){t.showMenuWithinBounds(e,n,r,o)},hide:function(t,e){t.hide(e)},isOpen:function(t,e){return t.isOpen(e)},getContent:function(t,e){return t.getContent(e)},setContent:function(t,e,n){t.setContent(e,n)},reposition:function(t,e){t.reposition(e)}}}),Eh=function(t){return t.x},Dh=function(t,e){return t.x+t.width/2-e.width/2},Ah=function(t,e){return t.x+t.width-e.width},Nh=function(t){return t.y},Mh=function(t,e){return t.y+t.height-e.height},zh=function(t,e){return t.y+t.height/2-e.height/2},Rh=function(t,e,n){return wa(Ah(t,e),Mh(t,e),n.insetSouthwest(),Oa(),"southwest",Ma(t,{right:0,bottom:3}),"layout-inset")},Bh=function(t,e,n){return wa(Eh(t),Mh(t,e),n.insetSoutheast(),ka(),"southeast",Ma(t,{left:1,bottom:3}),"layout-inset")},Lh=function(t,e,n){return wa(Ah(t,e),Nh(t),n.insetNorthwest(),Sa(),"northwest",Ma(t,{right:0,top:2}),"layout-inset")},Ph=function(t,e,n){return wa(Eh(t),Nh(t),n.insetNortheast(),Ca(),"northeast",Ma(t,{left:1,top:2}),"layout-inset")},Hh=function(t,e,n){return wa(Dh(t,e),Nh(t),n.insetNorth(),Ta(),"north",Ma(t,{top:2}),"layout-inset")},Ih=function(t,e,n){return wa(Dh(t,e),Mh(t,e),n.insetSouth(),_a(),"south",Ma(t,{bottom:3}),"layout-inset")},Fh=function(t,e,n){return wa(Ah(t,e),zh(t,e),n.insetEast(),Da(),"east",Ma(t,{right:0}),"layout-inset")},Vh=function(t,e,n){return wa(Eh(t),zh(t,e),n.insetWest(),Ea(),"west",Ma(t,{left:1}),"layout-inset")},Uh=function(t){switch(t){case"north":return Hh;case"northeast":return Ph;case"northwest":return Lh;case"south":return Ih;case"southeast":return Bh;case"southwest":return Rh;case"east":return Fh;case"west":return Vh}},jh=function(t,e,n,r,o){return Ac(r).map(Uh).getOr(Hh)(t,e,n,r,o)},Wh=function(t){switch(t){case"north":return Ih;case"northeast":return Bh;case"northwest":return Rh;case"south":return Hh;case"southeast":return Ph;case"southwest":return Lh;case"east":return Vh;case"west":return Fh}},qh=function(t,e,n,r,o){return Ac(r).map(Wh).getOr(Hh)(t,e,n,r,o)},$h=tinymce.util.Tools.resolve("tinymce.util.Delay"),Gh=ld({name:"Button",factory:function(t){var e=uh(t.action),n=t.dom.tag,r=function(e){return wt(t.dom,"attributes").bind(function(t){return wt(t,e)})};return{uid:t.uid,dom:t.dom,components:t.components,events:e,behaviours:df(t.buttonBehaviours,[$g.config({}),Bg.config({mode:"execution",useSpace:!0,useEnter:!0})]),domModification:{attributes:function(){if("button"===n){var t=r("type").getOr("button"),e=r("role").map(function(t){return{role:t}}).getOr({});return T({type:t},e)}return{role:r("role").getOr("button")}}()},eventOrder:t.eventOrder}},configFields:[to("uid",void 0),Ir("dom"),to("components",[]),ff("buttonBehaviours",[$g,Bg]),Gr("action"),Gr("role"),to("eventOrder",{})]}),Kh=function(t){var e=Bt.fromHtml(t),n=be(e),r=function(t){var e=void 0!==t.dom.attributes?t.dom.attributes:[];return X(e,function(t,e){var n;return"class"===e.name?t:T(T({},t),((n={})[e.name]=e.value,n))},{})}(e),o=function(t){return Array.prototype.slice.call(t.dom.classList,0)}(e),i=0===n.length?{}:{innerHtml:Hi(e)};return T({tag:Pt(e),classes:o,attributes:r},i)},Xh=function(t){var e=function(t){return void 0!==t.uid}(t)&&Ct(t,"uid")?t.uid:Zi("memento");return{get:function(t){return t.getSystem().getByUid(e).getOrDie()},getOpt:function(t){return t.getSystem().getByUid(e).toOptional()},asSpec:function(){return T(T({},t),{uid:e})}}};function Yh(t){"@babel/helpers - typeof";return(Yh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Jh(t,e){return(Jh=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Qh(t,e,n){return(Qh=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var o=new(Function.bind.apply(t,r));return n&&Jh(o,n.prototype),o}).apply(null,arguments)}function Zh(t){return function(t){if(Array.isArray(t))return tp(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return tp(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return tp(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function tp(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var ep=Object.hasOwnProperty,np=Object.setPrototypeOf,rp=Object.isFrozen,op=Object.getPrototypeOf,ip=Object.getOwnPropertyDescriptor,up=Object.freeze,ap=Object.seal,cp=Object.create,sp="undefined"!=typeof Reflect&&Reflect,lp=sp.apply,fp=sp.construct;lp||(lp=function(t,e,n){return t.apply(e,n)}),up||(up=function(t){return t}),ap||(ap=function(t){return t}),fp||(fp=function(t,e){return Qh(t,Zh(e))});var dp,mp=Sp(Array.prototype.forEach),gp=Sp(Array.prototype.pop),hp=Sp(Array.prototype.push),pp=Sp(String.prototype.toLowerCase),vp=Sp(String.prototype.match),bp=Sp(String.prototype.replace),yp=Sp(String.prototype.indexOf),wp=Sp(String.prototype.trim),xp=Sp(RegExp.prototype.test),Cp=(dp=TypeError,function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return fp(dp,e)});function Sp(t){return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return lp(t,e,r)}}function kp(t,e){np&&np(t,null);for(var n=e.length;n--;){var r=e[n];if("string"==typeof r){var o=pp(r);o!==r&&(rp(e)||(e[n]=o),r=o)}t[r]=!0}return t}function Op(t){var e,n=cp(null);for(e in t)lp(ep,t,[e])&&(n[e]=t[e]);return n}function Tp(t,e){for(;null!==t;){var n=ip(t,e);if(n){if(n.get)return Sp(n.get);if("function"==typeof n.value)return Sp(n.value)}t=op(t)}return function(t){return console.warn("fallback value for",t),null}}var _p=up(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Ep=up(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Dp=up(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Ap=up(["animate","color-profile","cursor","discard","fedropshadow","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Np=up(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),Mp=up(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),zp=up(["#text"]),Rp=up(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),Bp=up(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Lp=up(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Pp=up(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Hp=ap(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Ip=ap(/<%[\w\W]*|[\w\W]*%>/gm),Fp=ap(/^data-[\-\w.\u00B7-\uFFFF]/),Vp=ap(/^aria-[\-\w]+$/),Up=ap(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),jp=ap(/^(?:\w+script|data):/i),Wp=ap(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),qp=ap(/^html$/i),$p=function(){return"undefined"==typeof window?null:window},Gp=function(t,e){if("object"!==Yh(t)||"function"!=typeof t.createPolicy)return null;var n=null;e.currentScript&&e.currentScript.hasAttribute("data-tt-policy-suffix")&&(n=e.currentScript.getAttribute("data-tt-policy-suffix"));var r="dompurify"+(n?"#"+n:"");try{return t.createPolicy(r,{createHTML:function(t){return t}})}catch(t){return console.warn("TrustedTypes policy "+r+" could not be created."),null}};var Kp=function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:$p(),n=function(e){return t(e)};if(n.version="2.3.8",n.removed=[],!e||!e.document||9!==e.document.nodeType)return n.isSupported=!1,n;var r=e.document,o=e.document,i=e.DocumentFragment,u=e.HTMLTemplateElement,a=e.Node,c=e.Element,s=e.NodeFilter,l=e.NamedNodeMap,f=void 0===l?e.NamedNodeMap||e.MozNamedAttrMap:l,d=e.HTMLFormElement,m=e.DOMParser,g=e.trustedTypes,h=c.prototype,p=Tp(h,"cloneNode"),v=Tp(h,"nextSibling"),b=Tp(h,"childNodes"),y=Tp(h,"parentNode");if("function"==typeof u){var w=o.createElement("template");w.content&&w.content.ownerDocument&&(o=w.content.ownerDocument)}var x=Gp(g,r),C=x?x.createHTML(""):"",S=o,k=S.implementation,O=S.createNodeIterator,T=S.createDocumentFragment,_=S.getElementsByTagName,E=r.importNode,D={};try{D=Op(o).documentMode?o.documentMode:{}}catch(t){}var A={};n.isSupported="function"==typeof y&&k&&void 0!==k.createHTMLDocument&&9!==D;var N,M,z=Hp,R=Ip,B=Fp,L=Vp,P=jp,H=Wp,I=Up,F=null,V=kp({},[].concat(Zh(_p),Zh(Ep),Zh(Dp),Zh(Np),Zh(zp))),U=null,j=kp({},[].concat(Zh(Rp),Zh(Bp),Zh(Lp),Zh(Pp))),W=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),q=null,$=null,G=!0,K=!0,X=!1,Y=!1,J=!1,Q=!1,Z=!1,tt=!1,et=!1,nt=!1,rt=!0,ot=!0,it=!1,ut={},at=null,ct=kp({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),st=null,lt=kp({},["audio","video","img","source","image","track"]),ft=null,dt=kp({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),mt="http://www.w3.org/1998/Math/MathML",gt="http://www.w3.org/2000/svg",ht="http://www.w3.org/1999/xhtml",pt=ht,vt=!1,bt=["application/xhtml+xml","text/html"],yt=null,wt=o.createElement("form"),xt=function(t){return t instanceof RegExp||t instanceof Function},Ct=function(t){yt&&yt===t||(t&&"object"===Yh(t)||(t={}),t=Op(t),F="ALLOWED_TAGS"in t?kp({},t.ALLOWED_TAGS):V,U="ALLOWED_ATTR"in t?kp({},t.ALLOWED_ATTR):j,ft="ADD_URI_SAFE_ATTR"in t?kp(Op(dt),t.ADD_URI_SAFE_ATTR):dt,st="ADD_DATA_URI_TAGS"in t?kp(Op(lt),t.ADD_DATA_URI_TAGS):lt,at="FORBID_CONTENTS"in t?kp({},t.FORBID_CONTENTS):ct,q="FORBID_TAGS"in t?kp({},t.FORBID_TAGS):{},$="FORBID_ATTR"in t?kp({},t.FORBID_ATTR):{},ut="USE_PROFILES"in t&&t.USE_PROFILES,G=!1!==t.ALLOW_ARIA_ATTR,K=!1!==t.ALLOW_DATA_ATTR,X=t.ALLOW_UNKNOWN_PROTOCOLS||!1,Y=t.SAFE_FOR_TEMPLATES||!1,J=t.WHOLE_DOCUMENT||!1,tt=t.RETURN_DOM||!1,et=t.RETURN_DOM_FRAGMENT||!1,nt=t.RETURN_TRUSTED_TYPE||!1,Z=t.FORCE_BODY||!1,rt=!1!==t.SANITIZE_DOM,ot=!1!==t.KEEP_CONTENT,it=t.IN_PLACE||!1,I=t.ALLOWED_URI_REGEXP||I,pt=t.NAMESPACE||ht,t.CUSTOM_ELEMENT_HANDLING&&xt(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(W.tagNameCheck=t.CUSTOM_ELEMENT_HANDLING.tagNameCheck),t.CUSTOM_ELEMENT_HANDLING&&xt(t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(W.attributeNameCheck=t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),t.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(W.allowCustomizedBuiltInElements=t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),N=N=-1===bt.indexOf(t.PARSER_MEDIA_TYPE)?"text/html":t.PARSER_MEDIA_TYPE,M="application/xhtml+xml"===N?function(t){return t}:pp,Y&&(K=!1),et&&(tt=!0),ut&&(F=kp({},Zh(zp)),U=[],!0===ut.html&&(kp(F,_p),kp(U,Rp)),!0===ut.svg&&(kp(F,Ep),kp(U,Bp),kp(U,Pp)),!0===ut.svgFilters&&(kp(F,Dp),kp(U,Bp),kp(U,Pp)),!0===ut.mathMl&&(kp(F,Np),kp(U,Lp),kp(U,Pp))),t.ADD_TAGS&&(F===V&&(F=Op(F)),kp(F,t.ADD_TAGS)),t.ADD_ATTR&&(U===j&&(U=Op(U)),kp(U,t.ADD_ATTR)),t.ADD_URI_SAFE_ATTR&&kp(ft,t.ADD_URI_SAFE_ATTR),t.FORBID_CONTENTS&&(at===ct&&(at=Op(at)),kp(at,t.FORBID_CONTENTS)),ot&&(F["#text"]=!0),J&&kp(F,["html","head","body"]),F.table&&(kp(F,["tbody"]),delete q.tbody),up&&up(t),yt=t)},St=kp({},["mi","mo","mn","ms","mtext"]),kt=kp({},["foreignobject","desc","title","annotation-xml"]),Ot=kp({},["title","style","font","a","script"]),Tt=kp({},Ep);kp(Tt,Dp),kp(Tt,Ap);var _t=kp({},Np);kp(_t,Mp);var Et=function(t){hp(n.removed,{element:t});try{t.parentNode.removeChild(t)}catch(e){try{t.outerHTML=C}catch(e){t.remove()}}},Dt=function(t,e){try{hp(n.removed,{attribute:e.getAttributeNode(t),from:e})}catch(t){hp(n.removed,{attribute:null,from:e})}if(e.removeAttribute(t),"is"===t&&!U[t])if(tt||et)try{Et(e)}catch(t){}else try{e.setAttribute(t,"")}catch(t){}},At=function(t){var e,n;if(Z)t="<remove></remove>"+t;else{var r=vp(t,/^[\r\n\t ]+/);n=r&&r[0]}"application/xhtml+xml"===N&&(t='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+t+"</body></html>");var i=x?x.createHTML(t):t;if(pt===ht)try{e=(new m).parseFromString(i,N)}catch(t){}if(!e||!e.documentElement){e=k.createDocument(pt,"template",null);try{e.documentElement.innerHTML=vt?"":i}catch(t){}}var u=e.body||e.documentElement;return t&&n&&u.insertBefore(o.createTextNode(n),u.childNodes[0]||null),pt===ht?_.call(e,J?"html":"body")[0]:J?e.documentElement:u},Nt=function(t){return O.call(t.ownerDocument||t,t,s.SHOW_ELEMENT|s.SHOW_COMMENT|s.SHOW_TEXT,null,!1)},Mt=function(t){return"object"===Yh(a)?t instanceof a:t&&"object"===Yh(t)&&"number"==typeof t.nodeType&&"string"==typeof t.nodeName},zt=function(t,e,r){A[t]&&mp(A[t],function(t){t.call(n,e,r,yt)})},Rt=function(t){var e,r;if(zt("beforeSanitizeElements",t,null),(r=t)instanceof d&&("string"!=typeof r.nodeName||"string"!=typeof r.textContent||"function"!=typeof r.removeChild||!(r.attributes instanceof f)||"function"!=typeof r.removeAttribute||"function"!=typeof r.setAttribute||"string"!=typeof r.namespaceURI||"function"!=typeof r.insertBefore))return Et(t),!0;if(xp(/[\u0080-\uFFFF]/,t.nodeName))return Et(t),!0;var o=M(t.nodeName);if(zt("uponSanitizeElement",t,{tagName:o,allowedTags:F}),t.hasChildNodes()&&!Mt(t.firstElementChild)&&(!Mt(t.content)||!Mt(t.content.firstElementChild))&&xp(/<[/\w]/g,t.innerHTML)&&xp(/<[/\w]/g,t.textContent))return Et(t),!0;if("select"===o&&xp(/<template/i,t.innerHTML))return Et(t),!0;if(!F[o]||q[o]){if(!q[o]&&Lt(o)){if(W.tagNameCheck instanceof RegExp&&xp(W.tagNameCheck,o))return!1;if(W.tagNameCheck instanceof Function&&W.tagNameCheck(o))return!1}if(ot&&!at[o]){var i=y(t)||t.parentNode,u=b(t)||t.childNodes;if(u&&i)for(var a=u.length-1;a>=0;--a)i.insertBefore(p(u[a],!0),v(t))}return Et(t),!0}return t instanceof c&&!function(t){var e=y(t);e&&e.tagName||(e={namespaceURI:ht,tagName:"template"});var n=pp(t.tagName),r=pp(e.tagName);return t.namespaceURI===gt?e.namespaceURI===ht?"svg"===n:e.namespaceURI===mt?"svg"===n&&("annotation-xml"===r||St[r]):Boolean(Tt[n]):t.namespaceURI===mt?e.namespaceURI===ht?"math"===n:e.namespaceURI===gt?"math"===n&&kt[r]:Boolean(_t[n]):t.namespaceURI===ht&&!(e.namespaceURI===gt&&!kt[r])&&!(e.namespaceURI===mt&&!St[r])&&!_t[n]&&(Ot[n]||!Tt[n])}(t)?(Et(t),!0):"noscript"!==o&&"noembed"!==o||!xp(/<\/no(script|embed)/i,t.innerHTML)?(Y&&3===t.nodeType&&(e=t.textContent,e=bp(e,z," "),e=bp(e,R," "),t.textContent!==e&&(hp(n.removed,{element:t.cloneNode()}),t.textContent=e)),zt("afterSanitizeElements",t,null),!1):(Et(t),!0)},Bt=function(t,e,n){if(rt&&("id"===e||"name"===e)&&(n in o||n in wt))return!1;if(K&&!$[e]&&xp(B,e));else if(G&&xp(L,e));else if(!U[e]||$[e]){if(!(Lt(t)&&(W.tagNameCheck instanceof RegExp&&xp(W.tagNameCheck,t)||W.tagNameCheck instanceof Function&&W.tagNameCheck(t))&&(W.attributeNameCheck instanceof RegExp&&xp(W.attributeNameCheck,e)||W.attributeNameCheck instanceof Function&&W.attributeNameCheck(e))||"is"===e&&W.allowCustomizedBuiltInElements&&(W.tagNameCheck instanceof RegExp&&xp(W.tagNameCheck,n)||W.tagNameCheck instanceof Function&&W.tagNameCheck(n))))return!1}else if(ft[e]);else if(xp(I,bp(n,H,"")));else if("src"!==e&&"xlink:href"!==e&&"href"!==e||"script"===t||0!==yp(n,"data:")||!st[t])if(X&&!xp(P,bp(n,H,"")));else if(n)return!1;return!0},Lt=function(t){return t.indexOf("-")>0},Pt=function(t){var e,r,o,i;zt("beforeSanitizeAttributes",t,null);var u=t.attributes;if(u){var a={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:U};for(i=u.length;i--;){var c=e=u[i],s=c.name,l=c.namespaceURI;if(r="value"===s?e.value:wp(e.value),o=M(s),a.attrName=o,a.attrValue=r,a.keepAttr=!0,a.forceKeepAttr=void 0,zt("uponSanitizeAttribute",t,a),r=a.attrValue,!a.forceKeepAttr&&(Dt(s,t),a.keepAttr))if(xp(/\/>/i,r))Dt(s,t);else{Y&&(r=bp(r,z," "),r=bp(r,R," "));var f=M(t.nodeName);if(Bt(f,o,r))try{l?t.setAttributeNS(l,s,r):t.setAttribute(s,r),gp(n.removed)}catch(t){}}}zt("afterSanitizeAttributes",t,null)}},Ht=function t(e){var n,r=Nt(e);for(zt("beforeSanitizeShadowDOM",e,null);n=r.nextNode();)zt("uponSanitizeShadowNode",n,null),Rt(n)||(n.content instanceof i&&t(n.content),Pt(n));zt("afterSanitizeShadowDOM",e,null)};return n.sanitize=function(t,o){var u,c,s,l,f;if((vt=!t)&&(t="\x3c!--\x3e"),"string"!=typeof t&&!Mt(t)){if("function"!=typeof t.toString)throw Cp("toString is not a function");if("string"!=typeof(t=t.toString()))throw Cp("dirty is not a string, aborting")}if(!n.isSupported){if("object"===Yh(e.toStaticHTML)||"function"==typeof e.toStaticHTML){if("string"==typeof t)return e.toStaticHTML(t);if(Mt(t))return e.toStaticHTML(t.outerHTML)}return t}if(Q||Ct(o),n.removed=[],"string"==typeof t&&(it=!1),it){if(t.nodeName){var d=M(t.nodeName);if(!F[d]||q[d])throw Cp("root node is forbidden and cannot be sanitized in-place")}}else if(t instanceof a)1===(c=(u=At("\x3c!----\x3e")).ownerDocument.importNode(t,!0)).nodeType&&"BODY"===c.nodeName?u=c:"HTML"===c.nodeName?u=c:u.appendChild(c);else{if(!tt&&!Y&&!J&&-1===t.indexOf("<"))return x&&nt?x.createHTML(t):t;if(!(u=At(t)))return tt?null:nt?C:""}u&&Z&&Et(u.firstChild);for(var m=Nt(it?t:u);s=m.nextNode();)3===s.nodeType&&s===l||Rt(s)||(s.content instanceof i&&Ht(s.content),Pt(s),l=s);if(l=null,it)return t;if(tt){if(et)for(f=T.call(u.ownerDocument);u.firstChild;)f.appendChild(u.firstChild);else f=u;return U.shadowroot&&(f=E.call(r,f,!0)),f}var g=J?u.outerHTML:u.innerHTML;return J&&F["!doctype"]&&u.ownerDocument&&u.ownerDocument.doctype&&u.ownerDocument.doctype.name&&xp(qp,u.ownerDocument.doctype.name)&&(g="<!DOCTYPE "+u.ownerDocument.doctype.name+">\n"+g),Y&&(g=bp(g,z," "),g=bp(g,R," ")),x&&nt?x.createHTML(g):g},n.setConfig=function(t){Ct(t),Q=!0},n.clearConfig=function(){yt=null,Q=!1},n.isValidAttribute=function(t,e,n){yt||Ct({});var r=M(t),o=M(e);return Bt(r,o,n)},n.addHook=function(t,e){"function"==typeof e&&(A[t]=A[t]||[],hp(A[t],e))},n.removeHook=function(t){if(A[t])return gp(A[t])},n.removeHooks=function(t){A[t]&&(A[t]=[])},n.removeAllHooks=function(){A={}},n}(),Xp=function(t){return Kp().sanitize(t)},Yp=tinymce.util.Tools.resolve("tinymce.util.I18n"),Jp={indent:!0,outdent:!0,"table-insert-column-after":!0,"table-insert-column-before":!0,"paste-column-after":!0,"paste-column-before":!0,"unordered-list":!0,"list-bull-circle":!0,"list-bull-default":!0,"list-bull-square":!0},Qp=function(t){return function(){return wt(t,"temporary-placeholder").getOr("!not found!")}},Zp=function(t,e){var n,r,o=t.toLowerCase();if(Yp.isRtl()){var i=At(n=o,r="-rtl")?n:function(t,e){return t+e}(n,r);return xt(e,i)?i:o}return o},tv=function(t,e){return wt(e,Zp(t,e))},ev=function(t,e){var n=e();return tv(t,n).getOrThunk(Qp(n))},nv=function(){return Vg("add-focusable",[Ri(function(t){Xu(t.element,"svg").each(function(t){return Re(t,"focusable","false")})})])},rv=function(t,e,n,r){var o,i,u=function(t){return!!Yp.isRtl()&&xt(Jp,t)}(e)?["tox-icon--flip"]:[],a=wt(n,Zp(e,n)).or(r).getOrThunk(Qp(n));return{dom:{tag:t.tag,attributes:null!==(o=t.attributes)&&void 0!==o?o:{},classes:t.classes.concat(u),innerHtml:a},behaviours:uc(E(E([],null!==(i=t.behaviours)&&void 0!==i?i:[],!0),[nv()],!1))}},ov=function(t,e,n,r){return void 0===r&&(r=R.none()),rv(e,t,n(),r)},iv={success:"checkmark",error:"warning",err:"error",warning:"warning",warn:"warning",info:"info"},uv=ld({name:"Notification",factory:function(t){var e,n,r,o,i,u=Xh({dom:Kh("<p>"+Xp(t.translationProvider(t.text))+"</p>"),behaviours:uc([Fg.config({})])}),a=function(t){return{dom:{tag:"div",classes:["tox-bar"],attributes:{style:"width: "+t+"%"}}}},c=function(t){return{dom:{tag:"div",classes:["tox-text"],innerHtml:t+"%"}}},s=Xh({dom:{tag:"div",classes:t.progress?["tox-progress-bar","tox-progress-indicator"]:["tox-progress-bar"]},components:[{dom:{tag:"div",classes:["tox-bar-container"]},components:[a(0)]},c(0)],behaviours:uc([Fg.config({})])}),l={updateProgress:function(t,e){t.getSystem().isConnected()&&s.getOpt(t).each(function(t){Fg.set(t,[{dom:{tag:"div",classes:["tox-bar-container"]},components:[a(e)]},c(e)])})},updateText:function(t,e){if(t.getSystem().isConnected()){var n=u.get(t);Fg.set(n,[Hu(e)])}}},f=Q([t.icon.toArray(),t.level.toArray(),t.level.bind(function(t){return R.from(iv[t])}).toArray()]),d=Xh(Gh.sketch({dom:{tag:"button",classes:["tox-notification__dismiss","tox-button","tox-button--naked","tox-button--icon"]},components:[ov("close",{tag:"div",classes:["tox-icon"],attributes:{"aria-label":t.translationProvider("Close")}},t.iconProvider)],action:function(e){t.onAction(e)}})),m=[(e=f,n={tag:"div",classes:["tox-notification__icon"]},r=t.iconProvider,o=r(),i=Y(e,function(t){return xt(o,Zp(t,o))}),rv(n,i.getOr("temporary-placeholder"),o,R.none())),{dom:{tag:"div",classes:["tox-notification__body"]},components:[u.asSpec()],behaviours:uc([Fg.config({})])}];return{uid:t.uid,dom:{tag:"div",attributes:{role:"alert"},classes:t.level.map(function(t){return["tox-notification","tox-notification--in","tox-notification--"+t]}).getOr(["tox-notification","tox-notification--in"])},behaviours:uc([$g.config({}),Vg("notification-events",[_i(Ro(),function(t){d.getOpt(t).each($g.focus)})])]),components:m.concat(t.progress?[s.asSpec()]:[]).concat(t.closeButton?[d.asSpec()]:[]),apis:l}},configFields:[Gr("level"),Ir("progress"),Ir("icon"),Ir("onAction"),Ir("text"),Ir("iconProvider"),Ir("translationProvider"),io("closeButton",!0)],apis:{updateProgress:function(t,e,n){t.updateProgress(e,n)},updateText:function(t,e,n){t.updateText(e,n)}}});function av(t,e,n){var r=e.backstage.shared;return{open:function(e,o){var i=!e.closeButton&&e.timeout&&(e.timeout>0||e.timeout<0),u=function(){o(),_h.hide(c)},a=Vu(uv.sketch({text:e.text,level:F(["success","error","warning","warn","info"],e.type)?e.type:void 0,progress:!0===e.progressBar,icon:R.from(e.icon),closeButton:!i,onAction:u,iconProvider:r.providers.icons,translationProvider:r.providers.translate})),c=Vu(_h.sketch(T({dom:{tag:"div",classes:["tox-notifications-container"]},lazySink:r.getSink,fireDismissalEventInstead:{}},r.header.isPositionedAtTop()?{}:{fireRepositionEventInstead:{}})));n.add(c),e.timeout>0&&$h.setTimeout(function(){u()},e.timeout);var s=function(){var e=Dn(Bt.fromDom(t.getContentAreaContainer())),n=Nn(),r=Na(n.x,e.x,e.right),o=Na(n.y,e.y,e.bottom),i=Math.max(e.right,n.right),u=Math.max(e.bottom,n.bottom);return R.some(En(r,o,i-r,u-o))};return{close:u,moveTo:function(t,e){_h.showAt(c,Uu(a),{anchor:{type:"makeshift",x:t,y:e}})},moveRel:function(t,e){var n=Uu(a),o={maxHeightFunction:Jc()};if("banner"!==e&&f(t)){var i=function(t){switch(t){case"bc-bc":return Ih;case"tc-tc":return Hh;case"tc-bc":return ja;case"bc-tc":default:return Wa}}(e),u={type:"node",root:Ne(),node:R.some(Bt.fromDom(t)),overrides:o,layouts:{onRtl:function(){return[i]},onLtr:function(){return[i]}}};_h.showWithinBounds(c,n,{anchor:u},s)}else{var l=T(T({},r.anchors.banner()),{overrides:o});_h.showWithinBounds(c,n,{anchor:l},s)}},text:function(t){uv.updateText(a,t)},settings:e,getEl:function(){return a.element.dom},progressBar:{value:function(t){uv.updateProgress(a,t)}}}},close:function(t){t.close()},reposition:function(t){t.length>0&&q(t,function(e,n){0===n?e.moveRel(null,"banner"):e.moveRel(t[n-1].getEl(),"bc-tc")})},getArgs:function(t){return t.settings}}}var cv,sv=function(t,e){var n=null,r=function(){a(n)||(clearTimeout(n),n=null)};return{cancel:r,throttle:function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];r(),n=setTimeout(function(){n=null,t.apply(null,o)},e)}}},lv=tinymce.util.Tools.resolve("tinymce.dom.TextSeeker"),fv=function(t,e,n,r,o){var i=lv(t,function(e){return function(t,e){return t.isBlock(e)||F(["BR","IMG","HR","INPUT"],e.nodeName)||"false"===t.getContentEditable(e)}(t,e)});return R.from(i.backwards(e,n,r,o))},dv=function(t,e){return mv(Bt.fromDom(t.selection.getNode())).getOrThunk(function(){var n,r=Bt.fromHtml('<span data-mce-autocompleter="1" data-mce-bogus="1"></span>',t.getDoc());return pn(r,Bt.fromDom(e.extractContents())),e.insertNode(r.dom),pe(r).each(function(t){return t.dom.normalize()}),(n=r,Vs(n,Fs)).map(function(e){var n;t.selection.setCursorLocation(e.dom,"img"===Pt(n=e)?1:Hs(n).fold(function(){return be(n).length},function(t){return t.length}))}),r})},mv=function(t){return Ju(t,"[data-mce-autocompleter]")},gv=function(t){return t.toString().replace(/\u00A0/g," ").replace(/\uFEFF/g,"")},hv=function(t){return""!==t&&-1!==" \f\n\r\t\v".indexOf(t)},pv=function(t,e){return t.substring(e.length)},vv=function(t,e,n,r){if(void 0===r&&(r=0),!(o=e).collapsed||3!==o.startContainer.nodeType)return R.none();var o,i=t.getParent(e.startContainer,t.isBlock)||t.getRoot();return fv(t,e.startContainer,e.startOffset,function(t,e,r){return function(t,e,n){var r;for(r=e-1;r>=0;r--){var o=t.charAt(r);if(hv(o))return R.none();if(o===n)break}return R.some(r)}(r,e,n).getOr(e)},i).bind(function(t){var o=e.cloneRange();if(o.setStart(t.container,t.offset),o.setEnd(e.endContainer,e.endOffset),o.collapsed)return R.none();var i=gv(o);return 0!==i.lastIndexOf(n)||pv(i,n).length<r?R.none():R.some({text:pv(i,n),range:o,triggerChar:n})})},bv=function(t,e,n,r){return void 0===r&&(r=0),mv(Bt.fromDom(e.startContainer)).fold(function(){return vv(t,e,n,r)},function(e){var r=t.createRng();r.selectNode(e.dom);var o=gv(r);return R.some({range:r,text:pv(o,n),triggerChar:n})})},yv=function(t,e){e.on("keypress compositionend",t.onKeypress.throttle),e.on("remove",t.onKeypress.cancel);var n=function(t,e){yi(t,Lo(),{raw:e})};e.on("keydown",function(e){var r=function(){return t.getView().bind(Fd.getHighlighted)};8===e.which&&t.onKeypress.throttle(e),t.isActive()&&(27===e.which&&t.cancelIfNecessary(),t.isMenuOpen()?13===e.which?(r().each(wi),e.preventDefault()):40===e.which?(r().fold(function(){t.getView().each(Fd.highlightFirst)},function(t){n(t,e)}),e.preventDefault(),e.stopImmediatePropagation()):37!==e.which&&38!==e.which&&39!==e.which||r().each(function(t){n(t,e),e.preventDefault(),e.stopImmediatePropagation()}):13!==e.which&&38!==e.which&&40!==e.which||t.cancelIfNecessary())}),e.on("NodeChange",function(e){t.isActive()&&!t.isProcessingAction()&&mv(Bt.fromDom(e.element)).isNone()&&t.cancelIfNecessary()})},wv=tinymce.util.Tools.resolve("tinymce.util.Promise"),xv=function(t,e){return{container:t,offset:e}},Cv=function(t){if(function(t){return 3===t.nodeType}(t))return xv(t,t.data.length);var e=t.childNodes;return e.length>0?Cv(e[e.length-1]):xv(t,e.length)},Sv=function(t,e){var n=t.childNodes;return n.length>0&&e<n.length?Sv(n[e],0):n.length>0&&function(t){return 1===t.nodeType}(t)&&n.length===e?Cv(n[n.length-1]):xv(t,e)},kv=function(t){return function(e){var n=Sv(e.startContainer,e.startOffset);return!function(t,e){return fv(t,e.container,e.offset,function(t,e){return 0===e?-1:e},t.getRoot()).filter(function(t){var e=t.container.data.charAt(t.offset-1);return!hv(e)}).isSome()}(t,n)}},Ov=function(t,e){var n=e(),r=t.selection.getRng();return function(t,e,n){return lt(n.triggerChars,function(n){return bv(t,e,n)})}(t.dom,r,n).bind(function(n){return Tv(t,e,n)})},Tv=function(t,e,n,r){void 0===r&&(r={});var o=e(),i=t.selection.getRng().startContainer.nodeValue,u=G(o.lookupByChar(n.triggerChar),function(e){return n.text.length>=e.minChars&&e.matches.getOrThunk(function(){return kv(t.dom)})(n.range,i,n.text)});if(0===u.length)return R.none();var a=wv.all(W(u,function(t){return t.fetch(n.text,t.maxResults,r).then(function(e){return{matchText:n.text,items:e,columns:t.columns,onAction:t.onAction,highlightOn:t.highlightOn}})}));return R.some({lookupData:a,context:n})},_v=gr([Vr("type"),Yr("text")]),Ev=gr([to("type","autocompleteitem"),to("active",!1),to("disabled",!1),to("meta",{}),Vr("value"),Yr("text"),Yr("icon")]),Dv=gr([Vr("type"),Vr("ch"),no("minChars",1),to("columns",1),no("maxResults",10),Jr("matches"),jr("fetch"),jr("onAction"),ao("highlightOn",[],Cr)]),Av=[io("disabled",!1),Yr("tooltip"),Yr("icon"),Yr("text"),uo("onSetup",function(){return h})],Nv=gr([Vr("type"),jr("onAction")].concat(Av)),Mv=function(t){return Nr("toolbarbutton",Nv,t)},zv=[io("active",!1)].concat(Av),Rv=gr(zv.concat([Vr("type"),jr("onAction")])),Bv=function(t){return Nr("ToggleButton",Rv,t)},Lv=[uo("predicate",S),oo("scope","node",["node","editor"]),oo("position","selection",["node","selection","line"])],Pv=Av.concat([to("type","contextformbutton"),to("primary",!1),jr("onAction"),Pr("original",b)]),Hv=zv.concat([to("type","contextformbutton"),to("primary",!1),jr("onAction"),Pr("original",b)]),Iv=Av.concat([to("type","contextformbutton")]),Fv=zv.concat([to("type","contextformtogglebutton")]),Vv=Br("type",{contextformbutton:Pv,contextformtogglebutton:Hv}),Uv=gr([to("type","contextform"),uo("initValue",v("")),Yr("label"),$r("commands",Vv),Kr("launch",Br("type",{contextformbutton:Iv,contextformtogglebutton:Fv}))].concat(Lv)),jv=gr([to("type","contexttoolbar"),Vr("items")].concat(Lv)),Wv=function(t){var e,n,r=t.ui.registry.getAll().popups,o=gt(r,function(t){return(e=t,Nr("Autocompleter",Dv,e)).fold(function(t){throw new Error(Rr(t))},b);var e}),i=(e=vt(o,function(t){return t.ch}),n={},q(e,function(t){n[t]={}}),ft(n)),u=yt(o);return{dataset:o,triggerChars:i,lookupByChar:function(t){return G(u,function(e){return e.ch===t})}}};!function(t){t[t.CLOSE_ON_EXECUTE=0]="CLOSE_ON_EXECUTE",t[t.BUBBLE_TO_SANDBOX=1]="BUBBLE_TO_SANDBOX"}(cv||(cv={}));var qv,$v=cv,Gv="tox-menu-nav__js",Kv={normal:Gv,color:"tox-swatch"},Xv="tox-collection__item-label",Yv="tox-collection__item--active",Jv=function(t){return wt(Kv,t).getOr(Gv)},Qv=function(t){return{backgroundMenu:"tox-background-menu",selectedMenu:"tox-selected-menu",selectedItem:"tox-collection__item--active",hasIcons:"tox-menu--has-icons",menu:function(t){return"color"===t?"tox-swatches":"tox-menu"}(t),tieredMenu:"tox-tiered-menu"}},Zv=function(t){var e=Qv(t);return{backgroundMenu:e.backgroundMenu,selectedMenu:e.selectedMenu,menu:e.menu,selectedItem:e.selectedItem,item:Jv(t)}},tb=[wh.parts.items({})],eb=function(t,e,n){var r=Qv(n);return{dom:{tag:"div",classes:Q([[r.tieredMenu]])},markers:Zv(n)}},nb=function(t,e){return function(n){var r=j(n,e);return W(r,function(e){return{dom:t,components:e}})}},rb=function(t,e){var n=[],r=[];return q(t,function(t,o){e(t,o)?(r.length>0&&n.push(r),r=[],xt(t.dom,"innerHtml")&&r.push(t)):r.push(t)}),r.length>0&&n.push(r),W(n,function(t){return{dom:{tag:"div",classes:["tox-collection__group"]},components:t}})},ob=function(t,e,n){return{dom:{tag:"div",classes:["tox-menu","tox-collection"].concat(1===t?["tox-collection--list"]:["tox-collection--grid"])},components:[wh.parts.items({preprocess:function(n){return"auto"!==t&&t>1?nb({tag:"div",classes:["tox-collection__group"]},t)(n):rb(n,function(t,n){return"separator"===e[n].type})}})]}},ib=function(t){return V(t,function(t){return"icon"in t&&void 0!==t.icon})},ub=function(t){return console.error(Rr(t)),console.log(t),R.none()},ab=function(t,e,n,r,o){var i,u=(i=n,{dom:{tag:"div",classes:["tox-collection","tox-collection--horizontal"]},components:[wh.parts.items({preprocess:function(t){return rb(t,function(t,e){return"separator"===i[e].type})}})]});return{value:t,dom:u.dom,components:u.components,items:n}},cb=function(t,e,n,r,o){var i;return"color"===o?{value:t,dom:(i=function(t){return{dom:{tag:"div",classes:["tox-menu","tox-swatches-menu"]},components:[{dom:{tag:"div",classes:["tox-swatches"]},components:[wh.parts.items({preprocess:"auto"!==t?nb({tag:"div",classes:["tox-swatches__row"]},t):b})]}]}}(r)).dom,components:i.components,items:n}:"normal"===o&&"auto"===r?{value:t,dom:(i=ob(r,n)).dom,components:i.components,items:n}:"normal"===o&&1===r?{value:t,dom:(i=ob(1,n)).dom,components:i.components,items:n}:"normal"===o?{value:t,dom:(i=ob(r,n)).dom,components:i.components,items:n}:"listpreview"===o&&"auto"!==r?{value:t,dom:(i=function(t){return{dom:{tag:"div",classes:["tox-menu","tox-collection","tox-collection--toolbar","tox-collection--toolbar-lg"]},components:[wh.parts.items({preprocess:nb({tag:"div",classes:["tox-collection__group"]},t)})]}}(r)).dom,components:i.components,items:n}:{value:t,dom:function(t,e,n){var r=Qv(n);return{tag:"div",classes:Q([[r.menu,"tox-menu-"+e+"-column"],t?[r.hasIcons]:[]])}}(e,r,o),components:tb,items:n}},sb=[Vr("type"),Vr("src"),Yr("alt"),ao("classes",[],Cr)],lb=gr(sb),fb=[Vr("type"),Vr("text"),Yr("name"),ao("classes",["tox-collection__item-label"],Cr)],db=gr(fb),mb=fr(function(){return Er("type",{cardimage:lb,cardtext:db,cardcontainer:gb})}),gb=gr([Vr("type"),ro("direction","horizontal"),ro("align","left"),ro("valign","middle"),$r("items",mb)]),hb=[io("disabled",!1),Yr("text"),Yr("shortcut"),Lr("value","value",Zn(function(){return $i("menuitem-value")}),yr()),to("meta",{})],pb=gr([Vr("type"),Yr("label"),$r("items",mb),uo("onSetup",function(){return h}),uo("onAction",h)].concat(hb)),vb=gr([Vr("type"),io("active",!1),Yr("icon")].concat(hb)),bb=[Vr("type"),Vr("fancytype"),uo("onAction",h)],yb=[to("initData",{})].concat(bb),wb=[co("initData",{},[io("allowCustomColors",!0),Qr("colors",yr())])].concat(bb),xb=Br("fancytype",{inserttable:yb,colorswatch:wb}),Cb=gr([Vr("type"),uo("onSetup",function(){return h}),uo("onAction",h),Yr("icon")].concat(hb)),Sb=gr([Vr("type"),jr("getSubmenuItems"),uo("onSetup",function(){return h}),Yr("icon")].concat(hb)),kb=gr([Vr("type"),Yr("icon"),io("active",!1),uo("onSetup",function(){return h}),jr("onAction")].concat(hb)),Ob=function(t,e,n){var r=Us(t.element,"."+n);if(r.length>0){var o=J(r,function(t){var n=t.dom.getBoundingClientRect().top,o=r[0].dom.getBoundingClientRect().top;return Math.abs(n-o)>e}).getOr(r.length);return R.some({numColumns:o,numRows:Math.ceil(r.length/o)})}return R.none()},Tb=function(t,e){return uc([Vg(t,e)])},_b=function(t){return Tb($i("unnamed-events"),t)},Eb=$i("tooltip.exclusive"),Db=$i("tooltip.show"),Ab=$i("tooltip.hide"),Nb=function(t,e,n){t.getSystem().broadcastOn([Eb],{})},Mb=Object.freeze({__proto__:null,hideAllExclusive:Nb,setComponents:function(t,e,n,r){n.getTooltip().each(function(t){t.getSystem().isConnected()&&Fg.set(t,r)})}}),zb=Object.freeze({__proto__:null,events:function(t,e){var n=function(n){e.getTooltip().each(function(r){Tl(r),t.onHide(n,r),e.clearTooltip()}),e.clearTimer()};return ki(Q([[_i(Db,function(n){e.resetTimer(function(){!function(n){if(!e.isShowing()){Nb(n);var r=t.lazySink(n).getOrDie(),o=n.getSystem().build({dom:t.tooltipDom,components:t.tooltipComponents,events:ki("normal"===t.mode?[_i(zo(),function(t){bi(n,Db)}),_i(No(),function(t){bi(n,Ab)})]:[]),behaviours:uc([Fg.config({})])});e.setTooltip(o),Sl(r,o),t.onShow(n,o),bl.position(r,o,{anchor:t.anchor(n)})}}(n)},t.delay)}),_i(Ab,function(r){e.resetTimer(function(){n(r)},t.delay)}),_i(Yo(),function(t,e){var r=e;r.universal||F(r.channels,Eb)&&n(t)}),Bi(function(t){n(t)})],"normal"===t.mode?[_i(Ro(),function(t){bi(t,Db)}),_i(Ko(),function(t){bi(t,Ab)}),_i(zo(),function(t){bi(t,Db)}),_i(No(),function(t){bi(t,Ab)})]:[_i(pi(),function(t,e){bi(t,Db)}),_i(vi(),function(t){bi(t,Ab)})]]))}}),Rb=[Ir("lazySink"),Ir("tooltipDom"),to("exclusive",!0),to("tooltipComponents",[]),to("delay",300),oo("mode","normal",["normal","follow-highlight"]),to("anchor",function(t){return{type:"hotspot",hotspot:t,layouts:{onLtr:v([Wa,ja,Ia,Va,Fa,Ua]),onRtl:v([Wa,ja,Ia,Va,Fa,Ua])}}}),ma("onHide"),ma("onShow")],Bb=cc({fields:Rb,name:"tooltipping",active:zb,state:Object.freeze({__proto__:null,init:function(){var t=Lc(),e=Lc(),n=function(){t.on(clearTimeout)},r=v("not-implemented");return su({getTooltip:e.get,isShowing:e.isSet,setTooltip:e.set,clearTooltip:e.clear,clearTimer:n,resetTimer:function(e,r){n(),t.set(setTimeout(e,r))},readState:r})}}),apis:Mb}),Lb=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),Pb=tinymce.util.Tools.resolve("tinymce.EditorManager"),Hb=function(t){return t.getParam("height",Math.max(t.getElement().offsetHeight,200))},Ib=function(t){return t.getParam("width",Lb.DOM.getStyle(t.getElement(),"width"))},Fb=function(t){return R.from(t.getParam("min_width")).filter(m)},Vb=function(t){return R.from(t.getParam("min_height")).filter(m)},Ub=function(t){return R.from(t.getParam("max_width")).filter(m)},jb=function(t){return R.from(t.getParam("max_height")).filter(m)},Wb=function(t){return!1!==t.getParam("menubar",!0,"boolean")},qb=function(t){var e=t.getParam("toolbar",!0),n=!0===e,r=o(e),i=u(e)&&e.length>0;return!Gb(t)&&(i||r||n)},$b=function(t){var e=U(9,function(e){return t.getParam("toolbar"+(e+1),!1,"string")}),n=G(e,function(t){return"string"==typeof t});return n.length>0?R.some(n):R.none()},Gb=function(t){return $b(t).fold(function(){return t.getParam("toolbar",[],"string[]").length>0},k)};!function(t){t.default="wrap",t.floating="floating",t.sliding="sliding",t.scrolling="scrolling"}(qv||(qv={}));var Kb,Xb=function(t){return t.getParam("toolbar_mode","","string")};!function(t){t.auto="auto",t.top="top",t.bottom="bottom"}(Kb||(Kb={}));var Yb,Jb,Qb=function(t){return t.getParam("toolbar_location",Kb.auto,"string")},Zb=function(t){return Qb(t)===Kb.bottom},ty=function(t){if(!t.inline)return R.none();var e=function(t){return t.getParam("fixed_toolbar_container","","string")}(t);if(e.length>0)return Yu(Ne(),e);var n=function(t){return t.getParam("fixed_toolbar_container_target")}(t);return f(n)?R.some(Bt.fromDom(n)):R.none()},ey=function(t){return t.inline&&ty(t).isSome()},ny=function(t){return ty(t).getOrThunk(function(){return Te(Oe(Bt.fromDom(t.getElement())))})},ry=function(t){return t.inline&&!Wb(t)&&!qb(t)&&!Gb(t)},oy=function(t){return(t.getParam("toolbar_sticky",!1,"boolean")||t.inline)&&!ey(t)&&!ry(t)},iy=gr([(Yb="readonly",Fr(Yb,Sr))]),uy=function(t,e){var n=t.outerContainer.element;e&&(t.mothership.broadcastOn([Vl()],{target:n}),t.uiMothership.broadcastOn([Vl()],{target:n})),t.mothership.broadcastOn(["silver.readonly"],{readonly:e}),t.uiMothership.broadcastOn(["silver.readonly"],{readonly:e})},ay=function(t,e){t.on("init",function(){t.mode.isReadOnly()&&uy(e,!0)}),t.on("SwitchMode",function(){return uy(e,t.mode.isReadOnly())}),function(t){return t.getParam("readonly",!1,"boolean")}(t)&&t.setMode("readonly")},cy=function(){var t;return dc.config({channels:(t={},t["silver.readonly"]={schema:iy,onReceive:function(t,e){Dd.set(t,e.readonly)}},t)})},sy=function(t){return Dd.config({disabled:t,disableClass:"tox-collection__item--state-disabled"})},ly=function(t){return Dd.config({disabled:t})},fy=function(t){return Dd.config({disabled:t,disableClass:"tox-tbtn--disabled"})},dy=function(t){return Dd.config({disabled:t,disableClass:"tox-tbtn--disabled",useNative:!1})},my=function(t,e){var n=t.getApi(e);return function(t){t(n)}},gy=function(t,e){return Ri(function(n){my(t,n)(function(n){var r=t.onSetup(n);d(r)&&e.set(r)})})},hy=function(t,e){return Bi(function(n){return my(t,n)(e.get())})},py=((Jb={})[Jo()]=["disabling","alloy.base.behaviour","toggling","item-events"],Jb),vy=kt,by=function(t,e,n,r){var o=so(h);return{type:"item",dom:e.dom,components:vy(e.optComponents),data:t.data,eventOrder:py,hasSubmenu:t.triggersSubmenu,itemBehaviours:uc([Vg("item-events",[function(t,e){return Pi(function(n,r){my(t,n)(t.onAction),t.triggersSubmenu||e!==$v.CLOSE_ON_EXECUTE||(bi(n,ei()),r.stop())})}(t,n),gy(t,o),hy(t,o)]),sy(function(){return t.disabled||r.isDisabled()}),cy(),Fg.config({})].concat(t.itemBehaviours))}},yy=function(t){return{value:t.value,meta:T({text:t.text.getOr("")},t.meta)}},wy=tinymce.util.Tools.resolve("tinymce.Env"),xy=function(t,e,n){return void 0===n&&(n=["tox-collection__item-icon"]),ov(t,{tag:"div",classes:n},e)},Cy=function(t){return{dom:{tag:"div",classes:[Xv]},components:[Hu(Yp.translate(t))]}},Sy=function(t,e){return{dom:{tag:"div",classes:e,innerHtml:t}}},ky=function(t,e){return{dom:{tag:"div",classes:[Xv]},components:[{dom:{tag:t.tag,styles:t.styles},components:[Hu(Yp.translate(e))]}]}},Oy=function(t){return{dom:{tag:"div",classes:["tox-collection__item-accessory"],innerHtml:function(t){var e=wy.mac?{alt:"⌥",ctrl:"⌃",shift:"⇧",meta:"⌘",access:"⌃⌥"}:{meta:"Ctrl",access:"Shift+Alt"},n=t.split("+"),r=W(n,function(t){var n=t.toLowerCase().trim();return xt(e,n)?e[n]:t});return wy.mac?r.join(""):r.join("+")}(t)}}},Ty=function(t){return xy("checkmark",t,["tox-collection__item-checkmark"])},_y=function(t,e,n){var r,o,i=t.ariaLabel,u=t.value,a=t.iconContent.map(function(t){return function(t,e,n){var r=e();return tv(t,r).or(n).getOrThunk(Qp(r))}(t,e.icons,n)});return{dom:(r=a.getOr(""),o={tag:"div",attributes:i.map(function(t){return{title:e.translate(t)}}).getOr({}),classes:["tox-swatch"]},T(T({},o),"custom"===u?{tag:"button",classes:E(E([],o.classes,!0),["tox-swatches__picker-btn"],!1),innerHtml:r}:"remove"===u?{classes:E(E([],o.classes,!0),["tox-swatch--remove"],!1),innerHtml:r}:{attributes:T(T({},o.attributes),{"data-mce-color":u}),styles:{"background-color":u}})),optComponents:[]}},Ey=function(t){var e=t.map(function(t){return{attributes:{title:Yp.translate(t)}}}).getOr({});return T({tag:"div",classes:[Gv,"tox-collection__item"]},e)},Dy=function(t,e,n,r){return void 0===r&&(r=R.none()),"color"===t.presets?_y(t,e,r):function(t,e,n,r){var o={tag:"div",classes:["tox-collection__item-icon"]},i=n?t.iconContent.map(function(t){return ov(t,o,e.icons,r)}).orThunk(function(){return R.some({dom:o})}):R.none(),u=t.checkMark,a=R.from(t.meta).fold(function(){return Cy},function(t){return xt(t,"style")?w(ky,t.style):Cy}),c=t.htmlContent.fold(function(){return t.textContent.map(a)},function(t){return R.some(Sy(t,[Xv]))});return{dom:Ey(t.ariaLabel),optComponents:[i,c,t.shortcutContent.map(Oy),u,t.caret]}}(t,e,n,r)},Ay=function(t,e){return wt(t,"tooltipWorker").map(function(t){return[Bb.config({lazySink:e.getSink,tooltipDom:{tag:"div",classes:["tox-tooltip-worker-container"]},tooltipComponents:[],anchor:function(t){return{type:"submenu",item:t,overrides:{maxHeightFunction:Jc}}},mode:"follow-highlight",onShow:function(e,n){t(function(t){Bb.setComponents(e,[Iu({element:Bt.fromDom(t)})])})}})]}).getOr([])},Ny=function(t,e){var n=function(t){return Lb.DOM.encode(t)}(Yp.translate(t));if(e.length>0){var r=new RegExp(function(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(e),"gi");return n.replace(r,function(t){return'<span class="tox-autocompleter-highlight">'+t+"</span>"})}return n},My=function(t,e){return W(t,function(t){switch(t.type){case"cardcontainer":return u=t,a=My(t.items,e),{dom:{tag:"div",classes:["tox-collection__item-container","vertical"===u.direction?"tox-collection__item-container--column":"tox-collection__item-container--row","left"===u.align?"tox-collection__item-container--align-left":"tox-collection__item-container--align-right",function(){switch(u.valign){case"top":return"tox-collection__item-container--valign-top";case"middle":return"tox-collection__item-container--valign-middle";case"bottom":return"tox-collection__item-container--valign-bottom"}}()]},components:a};case"cardimage":return r=t.src,o=t.classes,i=t.alt,{dom:{tag:"img",classes:o,attributes:{src:r,alt:i.getOr("")}}};case"cardtext":var n=t.name.exists(function(t){return F(e.cardText.highlightOn,t)})?R.from(e.cardText.matchText).getOr(""):"";return Sy(Ny(t.text,n),t.classes)}var r,o,i,u,a})},zy=jf(mh(),gh()),Ry=function(t){return{value:t}},By=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,Ly=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,Py=function(t){return By.test(t)||Ly.test(t)},Hy=function(t){return(e=t,n="#",Dt(e,n)?function(t,e){return t.substring(e)}(e,n.length):e).toUpperCase();var e,n},Iy=function(t){var e=function(t){return{value:t.value.replace(By,function(t,e,n,r){return e+e+n+n+r+r})}}(t),n=Ly.exec(e.value);return null===n?["FFFFFF","FF","FF","FF"]:n},Fy=function(t){var e=t.toString(16);return(1===e.length?"0"+e:e).toUpperCase()},Vy=function(t){var e=Fy(t.red)+Fy(t.green)+Fy(t.blue);return Ry(e)},Uy=Math.min,jy=Math.max,Wy=Math.round,qy=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)/,$y=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d?(?:\.\d+)?)\)/,Gy=function(t,e,n,r){return{red:t,green:e,blue:n,alpha:r}},Ky=function(t){var e=parseInt(t,10);return e.toString()===t&&e>=0&&e<=255},Xy=function(t){var e,n,r,o=(t.hue||0)%360,i=t.saturation/100,u=t.value/100;if(i=jy(0,Uy(i,1)),u=jy(0,Uy(u,1)),0===i)return e=n=r=Wy(255*u),Gy(e,n,r,1);var a=o/60,c=u*i,s=c*(1-Math.abs(a%2-1)),l=u-c;switch(Math.floor(a)){case 0:e=c,n=s,r=0;break;case 1:e=s,n=c,r=0;break;case 2:e=0,n=c,r=s;break;case 3:e=0,n=s,r=c;break;case 4:e=s,n=0,r=c;break;case 5:e=c,n=0,r=s;break;default:e=n=r=0}return e=Wy(255*(e+l)),n=Wy(255*(n+l)),r=Wy(255*(r+l)),Gy(e,n,r,1)},Yy=function(t){var e=Iy(t),n=parseInt(e[1],16),r=parseInt(e[2],16),o=parseInt(e[3],16);return Gy(n,r,o,1)},Jy=function(t,e,n,r){var o=parseInt(t,10),i=parseInt(e,10),u=parseInt(n,10),a=parseFloat(r);return Gy(o,i,u,a)},Qy=function(t){if("transparent"===t)return R.some(Gy(0,0,0,0));var e=qy.exec(t);if(null!==e)return R.some(Jy(e[1],e[2],e[3],"1"));var n=$y.exec(t);return null!==n?R.some(Jy(n[1],n[2],n[3],n[4])):R.none()},Zy=function(t){return"rgba("+t.red+","+t.green+","+t.blue+","+t.alpha+")"},tw=Gy(255,0,0,1),ew=function(t,e){return t.fire("ResizeContent",e)},nw=function(t,e,n){return{hue:t,saturation:e,value:n}},rw=function(t){var e,n=0,r=0,o=t.red/255,i=t.green/255,u=t.blue/255,a=Math.min(o,Math.min(i,u)),c=Math.max(o,Math.max(i,u));return a===c?nw(0,0,100*(r=a)):(n=60*((n=o===a?3:u===a?1:5)-(o===a?i-u:u===a?o-i:u-o)/(c-a)),e=(c-a)/c,r=c,nw(Math.round(n),Math.round(100*e),Math.round(100*r)))},ow=function(t){return Vy(Xy(t))},iw=function(t){return(e=t,Py(e)?R.some({value:Hy(e)}):R.none()).orThunk(function(){return Qy(t).map(Vy)}).getOrThunk(function(){var e=document.createElement("canvas");e.height=1,e.width=1;var n=e.getContext("2d");n.clearRect(0,0,e.width,e.height),n.fillStyle="#FFFFFF",n.fillStyle=t,n.fillRect(0,0,1,1);var r=n.getImageData(0,0,1,1).data,o=r[0],i=r[1],u=r[2],a=r[3];return Vy(Gy(o,i,u,a))});var e},uw=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),aw="tinymce-custom-colors";var cw,sw="choiceitem",lw=[{type:sw,text:"Light Green",value:"#BFEDD2"},{type:sw,text:"Light Yellow",value:"#FBEEB8"},{type:sw,text:"Light Red",value:"#F8CAC6"},{type:sw,text:"Light Purple",value:"#ECCAFA"},{type:sw,text:"Light Blue",value:"#C2E0F4"},{type:sw,text:"Green",value:"#2DC26B"},{type:sw,text:"Yellow",value:"#F1C40F"},{type:sw,text:"Red",value:"#E03E2D"},{type:sw,text:"Purple",value:"#B96AD9"},{type:sw,text:"Blue",value:"#3598DB"},{type:sw,text:"Dark Turquoise",value:"#169179"},{type:sw,text:"Orange",value:"#E67E23"},{type:sw,text:"Dark Red",value:"#BA372A"},{type:sw,text:"Dark Purple",value:"#843FA1"},{type:sw,text:"Dark Blue",value:"#236FA1"},{type:sw,text:"Light Gray",value:"#ECF0F1"},{type:sw,text:"Medium Gray",value:"#CED4D9"},{type:sw,text:"Gray",value:"#95A5A6"},{type:sw,text:"Dark Gray",value:"#7E8C8D"},{type:sw,text:"Navy Blue",value:"#34495E"},{type:sw,text:"Black",value:"#000000"},{type:sw,text:"White",value:"#ffffff"}],fw=function(t){void 0===t&&(t=10);var e,n=uw.getItem(aw),r=o(n)?JSON.parse(n):[],i=t-(e=r).length<0?e.slice(0,t):e,u=function(t){i.splice(t,1)};return{add:function(e){I(i,e).each(u),i.unshift(e),i.length>t&&i.pop(),uw.setItem(aw,JSON.stringify(i))},state:function(){return i.slice(0)}}}(10),dw=function(t){return!1!==t.getParam("custom_colors")},mw=function(t){var e=function(t){return t.getParam("color_map")}(t);return void 0!==e?function(t){for(var e=[],n=0;n<t.length;n+=2)e.push({text:t[n+1],value:"#"+iw(t[n]).value,type:"choiceitem"});return e}(e):lw},gw=function(t){fw.add(t)},hw=function(t){return function(t,e){return t.getParam("color_cols",e,"number")}(t,function(t){return Math.max(5,Math.ceil(Math.sqrt(t)))}(mw(t).length))},pw=function(t){var e={type:"choiceitem",text:"Remove color",icon:"color-swatch-remove-color",value:"remove"};return t?[e,{type:"choiceitem",text:"Custom color",icon:"color-picker",value:"custom"}]:[e]},vw=function(t,e,n,r){"custom"===n?Sw(t)(function(n){n.each(function(n){gw(n),t.execCommand("mceApplyTextcolor",e,n),r(n)})},"#000000"):"remove"===n?(r(""),t.execCommand("mceRemoveTextcolor",e)):(r(n),t.execCommand("mceApplyTextcolor",e,n))},bw=function(t,e){return t.concat(W(fw.state(),function(t){return{type:sw,text:t,value:t}}).concat(pw(e)))},yw=function(t,e){return function(n){n(bw(t,e))}},ww=function(t,e,n){var r="forecolor"===e?"tox-icon-text-color__color":"tox-icon-highlight-bg-color__color";t.setIconFill(r,n)},xw=function(t,e,n,r,o){t.ui.registry.addSplitButton(e,{tooltip:r,presets:"color",icon:"forecolor"===e?"text-color":"highlight-bg-color",select:function(e){return function(t,e){var n;return t.dom.getParents(t.selection.getStart(),function(t){var r;(r=t.style["forecolor"===e?"color":"background-color"])&&(n=n||r)}),R.from(n)}(t,n).bind(function(t){return Qy(t).map(function(t){var n=Vy(t).value;return Et(e.toLowerCase(),n)})}).getOr(!1)},columns:hw(t),fetch:yw(mw(t),dw(t)),onAction:function(e){vw(t,n,o.get(),h)},onItemAction:function(r,i){vw(t,n,i,function(n){o.set(n),function(t,e){t.fire("TextColorChange",e)}(t,{name:e,color:n})})},onSetup:function(n){ww(n,e,o.get());var r=function(t){t.name===e&&ww(n,t.name,t.color)};return t.on("TextColorChange",r),function(){t.off("TextColorChange",r)}}})},Cw=function(t,e,n,r){t.ui.registry.addNestedMenuItem(e,{text:r,icon:"forecolor"===e?"text-color":"highlight-bg-color",getSubmenuItems:function(){return[{type:"fancymenuitem",fancytype:"colorswatch",onAction:function(e){vw(t,n,e.value,h)}}]}})},Sw=function(t){return function(e,n){var r=!1,o={colorpicker:n};t.windowManager.open({title:"Color Picker",size:"normal",body:{type:"panel",items:[{type:"colorpicker",name:"colorpicker",label:"Color"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:o,onAction:function(t,e){"hex-valid"===e.name&&(r=e.value)},onSubmit:function(n){var o=n.getData().colorpicker;r?(e(R.from(o)),n.close()):t.windowManager.alert(t.translate(["Invalid hex color code: {0}",o]))},onClose:h,onCancel:function(){e(R.none())}})}},kw=function(t,e,n,r,o,i,u,a){var c=ib(e),s=Ow(e,n,r,"color"!==o?"normal":"color",i,u,a);return cb(t,c,s,r,o)},Ow=function(t,e,n,r,o,i,u){return kt(W(t,function(a){return"choiceitem"===a.type?(c=a,Nr("choicemenuitem",vb,c)).fold(ub,function(c){return R.some(function(t,e,n,r,o,i,u,a){void 0===a&&(a=!0);var c=Dy({presets:n,textContent:e?t.text:R.none(),htmlContent:R.none(),ariaLabel:t.text,iconContent:t.icon,shortcutContent:e?t.shortcut:R.none(),checkMark:e?R.some(Ty(u.icons)):R.none(),caret:R.none(),value:t.value},u,a);return Jn(by({data:yy(t),disabled:t.disabled,getApi:function(t){return{setActive:function(e){oh.set(t,e)},isActive:function(){return oh.isOn(t)},isDisabled:function(){return Dd.isDisabled(t)},setDisabled:function(e){return Dd.set(t,e)}}},onAction:function(e){return r(t.value)},onSetup:function(t){return t.setActive(o),h},triggersSubmenu:!1,itemBehaviours:[]},c,i,u),{toggling:{toggleClass:"tox-collection__item--enabled",toggleOnExecute:!1,selected:t.active}})}(c,1===n,r,e,i(a.value),o,u,ib(t)))}):R.none();var c}))},Tw=function(t,e){var n=Zv(e);return 1===t?{mode:"menu",moveOnTab:!0}:"auto"===t?{mode:"grid",selector:"."+n.item,initSize:{numColumns:1,numRows:1}}:{mode:"matrix",rowSelector:"."+("color"===e?"tox-swatches__row":"tox-collection__group")}},_w=function(t,e){var n=t.initData.allowCustomColors&&e.colorinput.hasCustomColors();return t.initData.colors.fold(function(){return bw(e.colorinput.getColors(),n)},function(t){return t.concat(pw(n))})},Ew=$i("cell-over"),Dw=$i("cell-execute"),Aw=function(t,e,n){var r,o=function(n){return yi(n,Dw,{row:t,col:e})},i=function(t,e){e.stop(),o(t)};return Vu({dom:{tag:"div",attributes:(r={role:"button"},r["aria-labelledby"]=n,r)},behaviours:uc([Vg("insert-table-picker-cell",[_i(zo(),$g.focus),_i(Jo(),o),_i(Fo(),i),_i(Zo(),i)]),oh.config({toggleClass:"tox-insert-table-picker__selected",toggleOnExecute:!1}),$g.config({onFocus:function(n){return yi(n,Ew,{row:t,col:e})}})])})},Nw=function(t,e){return Hu(e+"x"+t)},Mw={inserttable:function(t){var e=$i("size-label"),n=function(t,e,n){for(var r=[],o=0;o<e;o++){for(var i=[],u=0;u<n;u++)i.push(Aw(o,u,t));r.push(i)}return r}(e,10,10),r=Nw(0,0),o=Xh({dom:{tag:"span",classes:["tox-insert-table-picker__label"],attributes:{id:e}},components:[r],behaviours:uc([Fg.config({})])});return{type:"widget",data:{value:$i("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[zy.widget({dom:{tag:"div",classes:["tox-insert-table-picker"]},components:function(t){return Z(t,function(t){return W(t,Uu)})}(n).concat(o.asSpec()),behaviours:uc([Vg("insert-table-picker",[Ri(function(t){Fg.set(o.get(t),[r])}),Ni(Ew,function(t,e,r){var i=r.event,u=i.row,a=i.col;!function(t,e,n,r,o){for(var i=0;i<r;i++)for(var u=0;u<o;u++)oh.set(t[i][u],i<=e&&u<=n)}(n,u,a,10,10),Fg.set(o.get(t),[Nw(u+1,a+1)])}),Ni(Dw,function(e,n,r){var o=r.event,i=o.row,u=o.col;t.onAction({numRows:i+1,numColumns:u+1}),bi(e,ei())})]),Bg.config({initSize:{numRows:10,numColumns:10},mode:"flatgrid",selector:'[role="button"]'})])})]}},colorswatch:function(t,e){var n=_w(t,e),r=e.colorinput.getColorCols(),o=kw($i("menu-value"),n,function(e){t.onAction({value:e})},r,"color",$v.CLOSE_ON_EXECUTE,S,e.shared.providers),i=T(T({},o),{markers:Zv("color"),movement:Tw(r,"color")});return{type:"widget",data:{value:$i("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[zy.widget(wh.sketch(i))]}}},zw=function(t,e,n,r,o,i,u,a){void 0===a&&(a=!0);var c=Dy({presets:r,textContent:R.none(),htmlContent:n?t.text.map(function(t){return Ny(t,e)}):R.none(),ariaLabel:t.text,iconContent:t.icon,shortcutContent:R.none(),checkMark:R.none(),caret:R.none(),value:t.value},u.providers,a,t.icon);return by({data:yy(t),disabled:t.disabled,getApi:v({}),onAction:function(e){return o(t.value,t.meta)},onSetup:v(h),triggersSubmenu:!1,itemBehaviours:Ay(t.meta,u)},c,i,u.providers)},Rw=function(t){var e=t.text.fold(function(){return{}},function(t){return{innerHtml:t}});return{type:"separator",dom:T({tag:"div",classes:["tox-collection__item","tox-collection__group-heading"]},e),components:[]}},Bw=function(t,e,n,r){void 0===r&&(r=!0);var o=Dy({presets:"normal",iconContent:t.icon,textContent:t.text,htmlContent:R.none(),ariaLabel:t.text,caret:R.none(),checkMark:R.none(),shortcutContent:t.shortcut},n,r);return by({data:yy(t),getApi:function(t){return{isDisabled:function(){return Dd.isDisabled(t)},setDisabled:function(e){return Dd.set(t,e)}}},disabled:t.disabled,onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:[]},o,e,n)},Lw=function(t,e,n,r,o){void 0===r&&(r=!0),void 0===o&&(o=!1);var i,u=o?(i=n.icons,xy("chevron-down",i,["tox-collection__item-caret"])):function(t){return xy("chevron-right",t,["tox-collection__item-caret"])}(n.icons),a=Dy({presets:"normal",iconContent:t.icon,textContent:t.text,htmlContent:R.none(),ariaLabel:t.text,caret:R.some(u),checkMark:R.none(),shortcutContent:t.shortcut},n,r);return by({data:yy(t),getApi:function(t){return{isDisabled:function(){return Dd.isDisabled(t)},setDisabled:function(e){return Dd.set(t,e)}}},disabled:t.disabled,onAction:h,onSetup:t.onSetup,triggersSubmenu:!0,itemBehaviours:[]},a,e,n)},Pw=function(t,e,n,r){void 0===r&&(r=!0);var o=Dy({iconContent:t.icon,textContent:t.text,htmlContent:R.none(),ariaLabel:t.text,checkMark:R.some(Ty(n.icons)),caret:R.none(),shortcutContent:t.shortcut,presets:"normal",meta:t.meta},n,r);return Jn(by({data:yy(t),disabled:t.disabled,getApi:function(t){return{setActive:function(e){oh.set(t,e)},isActive:function(){return oh.isOn(t)},isDisabled:function(){return Dd.isDisabled(t)},setDisabled:function(e){return Dd.set(t,e)}}},onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:[]},o,e,n),{toggling:{toggleClass:"tox-collection__item--enabled",toggleOnExecute:!1,selected:t.active}})},Hw=function(t,e){return wt(Mw,t.fancytype).map(function(n){return n(t,e)})},Iw=function(t,e,n,r){var o={dom:Ey(t.label),optComponents:[R.some({dom:{tag:"div",classes:["tox-collection__item-container","tox-collection__item-container--row"]},components:My(t.items,r)})]};return by({data:yy(T({text:R.none()},t)),disabled:t.disabled,getApi:function(t){return{isDisabled:function(){return Dd.isDisabled(t)},setDisabled:function(e){Dd.set(t,e),q(Us(t.element,"*"),function(n){t.getSystem().getByDom(n).each(function(t){t.hasConfigured(Dd)&&Dd.set(t,e)})})}}},onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:R.from(r.itemBehaviours).getOr([])},o,e,n.providers)};!function(t){t[t.ContentFocus=0]="ContentFocus",t[t.UiFocus=1]="UiFocus"}(cw||(cw={}));var Fw=function(t,e,n,r,o){var i,u=n.shared.providers,a=function(t){return o?T(T({},t),{shortcut:R.none(),icon:t.text.isSome()?R.none():t.icon}):t};switch(t.type){case"menuitem":return(i=t,Nr("menuitem",Cb,i)).fold(ub,function(t){return R.some(Bw(a(t),e,u,r))});case"nestedmenuitem":return function(t){return Nr("nestedmenuitem",Sb,t)}(t).fold(ub,function(t){return R.some(Lw(a(t),e,u,r,o))});case"togglemenuitem":return function(t){return Nr("togglemenuitem",kb,t)}(t).fold(ub,function(t){return R.some(Pw(a(t),e,u,r))});case"separator":return function(t){return Nr("separatormenuitem",_v,t)}(t).fold(ub,function(t){return R.some(Rw(t))});case"fancymenuitem":return function(t){return Nr("fancymenuitem",xb,t)}(t).fold(ub,function(t){return Hw(a(t),n)});default:return console.error("Unknown item in general menu",t),R.none()}},Vw=function(t,e,n,r,o,i,u){var a=1===r,c=!a||ib(t);return kt(W(t,function(t){switch(t.type){case"separator":return(r=t,Nr("Autocompleter.Separator",_v,r)).fold(ub,function(t){return R.some(Rw(t))});case"cardmenuitem":return function(t){return Nr("cardmenuitem",pb,t)}(t).fold(ub,function(t){return R.some(Iw(T(T({},t),{onAction:function(e){t.onAction(e),n(t.value,t.meta)}}),o,i,{itemBehaviours:Ay(t.meta,i),cardText:{matchText:e,highlightOn:u}}))});case"autocompleteitem":default:return function(t){return Nr("Autocompleter.Item",Ev,t)}(t).fold(ub,function(t){return R.some(zw(t,e,a,"normal",n,o,i,c))})}var r}))},Uw=function(t,e,n,r,o){var i=ib(e),u=kt(W(e,function(t){var e=function(t){return Fw(t,n,r,function(t){return o?!xt(t,"text"):i}(t),o)};return"nestedmenuitem"===t.type&&t.getSubmenuItems().length<=0?e(T(T({},t),{disabled:!0})):e(t)}));return(o?ab:cb)(t,i,u,1,"normal")},jw=function(t){return Th.singleData(t.value,t)},Ww={register:function(t,e){var n=Lc(),r=so(!1),o=Vu(_h.sketch({dom:{tag:"div",classes:["tox-autocompleter"]},components:[],fireDismissalEventInstead:{},inlineBehaviours:uc([Vg("dismissAutocompleter",[_i(li(),function(){return a()})])]),lazySink:e.getSink})),i=function(){return n.get().isSome()},u=function(){i()&&_h.hide(o)},a=function(){if(i()){var e=n.get().map(function(t){return t.element});mv(e.getOr(Bt.fromDom(t.selection.getNode()))).each(wn),u(),n.clear(),r.set(!1)}},c=jt(function(){return Wv(t)}),s=function(e,n,r,i){e.matchLength=n.text.length;var u=lt(r,function(t){return R.from(t.columns)}).getOr(1);_h.showAt(o,wh.sketch(function(t,e,n,r){var o=n===cw.ContentFocus?cm():am(),i=Tw(e,r),u=Zv(r);return{dom:t.dom,components:t.components,items:t.items,value:t.value,markers:{selectedItem:u.selectedItem,item:u.item},movement:i,fakeFocus:n===cw.ContentFocus,focusManager:o,menuBehaviours:_b("auto"!==e?[]:[Ri(function(t,e){Ob(t,4,u.item).each(function(e){var n=e.numColumns,r=e.numRows;Bg.setGridSize(t,r,n)})})])}}(cb("autocompleter-value",!0,i,u,"normal"),u,cw.ContentFocus,"normal")),{anchor:{type:"node",root:Bt.fromDom(t.getBody()),node:R.from(e.element)}}),_h.getContent(o).each(Fd.highlightFirst)},l=function(o){(function(e){return n.get().map(function(n){return bv(t.dom,t.selection.getRng(),n.triggerChar).bind(function(n){return Tv(t,c,n,e)})}).getOrThunk(function(){return Ov(t,c)})})(o).fold(a,function(o){!function(e){if(!i()){var o=dv(t,e.range);n.set({triggerChar:e.triggerChar,element:o,matchLength:e.text.length}),r.set(!1)}}(o.context),o.lookupData.then(function(i){n.get().map(function(n){var c,f,d,m=o.context;if(n.triggerChar===m.triggerChar){var g=(c=m.triggerChar,d=lt(f=i,function(t){return R.from(t.columns)}).getOr(1),Z(f,function(n){var o=n.items;return Vw(o,n.matchText,function(e,o){var i=t.selection.getRng();bv(t.dom,i,c).fold(function(){return console.error("Lost context. Cursor probably moved")},function(t){var i=t.range,c={hide:function(){a()},reload:function(t){u(),l(t)}};r.set(!0),n.onAction(c,i,e,o),r.set(!1)})},d,$v.BUBBLE_TO_SANDBOX,e,n.highlightOn)}));g.length>0?s(n,m,i,g):m.text.length-n.matchLength>=10?a():u()}})})})},f={onKeypress:sv(function(t){27!==t.which&&l()},50),cancelIfNecessary:a,isMenuOpen:function(){return _h.isOpen(o)},isActive:i,isProcessingAction:r.get,getView:function(){return _h.getContent(o)}};!1===t.hasPlugin("rtc")&&yv(f,t)}},qw=function(t,e,n){return Ju(t,e,n).isSome()},$w=function(t,e){var n=null;return{cancel:function(){null!==n&&(clearTimeout(n),n=null)},schedule:function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];n=setTimeout(function(){t.apply(null,r),n=null},e)}}},Gw=function(t){var e=t.raw;return void 0===e.touches||1!==e.touches.length?R.none():R.some(e.touches[0])},Kw=function(t){var e=Lc(),n=so(!1),r=$w(function(e){t.triggerEvent(ti(),e),n.set(!0)},400),o=ho([{key:Oo(),value:function(t){return Gw(t).each(function(o){r.cancel();var i={x:o.clientX,y:o.clientY,target:t.target};r.schedule(t),n.set(!1),e.set(i)}),R.none()}},{key:To(),value:function(t){return r.cancel(),Gw(t).each(function(t){e.on(function(n){(function(t,e){var n=Math.abs(t.clientX-e.x),r=Math.abs(t.clientY-e.y);return n>5||r>5})(t,n)&&e.clear()})}),R.none()}},{key:_o(),value:function(o){r.cancel();return e.get().filter(function(t){return se(t.target,o.target)}).map(function(e){return n.get()?(o.prevent(),!1):t.triggerEvent(Zo(),o)})}}]);return{fireIfReady:function(t,e){return wt(o,e).bind(function(e){return e(t)})}}},Xw=function(){return ue().browser.isFirefox()},Yw=function(t,e){var n=T({stopBackspace:!0},e),r=Kw(n),o=W(["touchstart","touchmove","touchend","touchcancel","gesturestart","mousedown","mouseup","mouseover","mousemove","mouseout","click"].concat(["selectstart","input","contextmenu","change","transitionend","transitioncancel","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","keyup"]),function(e){return Hc(t,e,function(t){r.fireIfReady(t,e).each(function(e){e&&t.kill()}),n.triggerEvent(e,t)&&t.kill()})}),i=Lc(),u=Hc(t,"paste",function(t){r.fireIfReady(t,"paste").each(function(e){e&&t.kill()}),n.triggerEvent("paste",t)&&t.kill(),i.set(setTimeout(function(){n.triggerEvent(Xo(),t)},0))}),a=Hc(t,"keydown",function(t){n.triggerEvent("keydown",t)?t.kill():n.stopBackspace&&function(t){return t.raw.which===Vd[0]&&!F(["input","textarea"],Pt(t.target))&&!qw(t.target,'[contenteditable="true"]')}(t)&&t.prevent()}),c=function(t,e){return Xw()?Ic(t,"focus",e):Hc(t,"focusin",e)}(t,function(t){n.triggerEvent("focusin",t)&&t.kill()}),s=Lc(),l=function(t,e){return Xw()?Ic(t,"blur",e):Hc(t,"focusout",e)}(t,function(t){n.triggerEvent("focusout",t)&&t.kill(),s.set(setTimeout(function(){n.triggerEvent(Ko(),t)},0))});return{unbind:function(){q(o,function(t){t.unbind()}),a.unbind(),c.unbind(),l.unbind(),u.unbind(),i.on(clearTimeout),s.on(clearTimeout)}}},Jw=function(t,e){var n=wt(t,"target").getOr(e);return so(n)},Qw=lo([{stopped:[]},{resume:["element"]},{complete:[]}]),Zw=function(t,e,n,r,o,i){var u=t(e,r),a=function(t,e){var n=so(!1),r=so(!1);return{stop:function(){n.set(!0)},cut:function(){r.set(!0)},isStopped:n.get,isCut:r.get,event:t,setSource:e.set,getSource:e.get}}(n,o);return u.fold(function(){return i.logEventNoHandlers(e,r),Qw.complete()},function(t){var n=t.descHandler;return du(n)(a),a.isStopped()?(i.logEventStopped(e,t.element,n.purpose),Qw.stopped()):a.isCut()?(i.logEventCut(e,t.element,n.purpose),Qw.complete()):pe(t.element).fold(function(){return i.logNoParent(e,t.element,n.purpose),Qw.complete()},function(r){return i.logEventResponse(e,t.element,n.purpose),Qw.resume(r)})})},tx=function(t,e,n,r,o,i){return Zw(t,e,n,r,o,i).fold(k,function(r){return tx(t,e,n,r,o,i)},S)},ex=function(t,e,n){var r,o,i=(r=e,o=so(!1),{stop:function(){o.set(!0)},cut:h,isStopped:o.get,isCut:S,event:r,setSource:C("Cannot set source of a broadcasted event"),getSource:C("Cannot get source of a broadcasted event")});return q(t,function(t){var e=t.descHandler;du(e)(i)}),i.isStopped()},nx=function(t,e,n,r,o){var i=Jw(n,r);return tx(t,e,n,r,i,o)},rx=function(){var t={};return{registerId:function(e,n,r){mt(r,function(r,o){var i=void 0!==t[o]?t[o]:{};i[n]=function(t,e){return n=w.apply(void 0,[t.handler].concat(e)),r=t.purpose,{cHandler:n,purpose:r};var n,r}(r,e),t[o]=i})},unregisterId:function(e){mt(t,function(t,n){xt(t,e)&&delete t[e]})},filterByType:function(e){return wt(t,e).map(function(t){return vt(t,function(t,e){return function(t,e){return{id:t,descHandler:e}}(e,t)})}).getOr([])},find:function(e,n,r){return wt(t,n).bind(function(t){return yo(r,function(e){return function(t,e){return Qi(e).bind(function(e){return wt(t,e)}).map(function(t){return function(t,e){return{element:t,descHandler:e}}(e,t)})}(t,e)},e)})}}},ox=function(){var t=rx(),e={},n=function(t){var e=t.element;return Qi(e).getOrThunk(function(){return e="uid-",n=t.element,r=$i(Xi+e),Ji(n,r),r;var e,n,r})},r=function(n){Qi(n.element).each(function(n){delete e[n],t.unregisterId(n)})};return{find:function(e,n,r){return t.find(e,n,r)},filter:function(e){return t.filterByType(e)},register:function(o){var i=n(o);Ct(e,i)&&function(t,n){var o=e[n];if(o!==t)throw new Error('The tagId "'+n+'" is already used by: '+Ui(o.element)+"\nCannot use it for: "+Ui(t.element)+"\nThe conflicting element is"+(Ae(o.element)?" ":" not ")+"already in the DOM");r(t)}(o,i);var u=[o];t.registerId(u,i,o.events),e[i]=o},unregister:r,getById:function(t){return wt(e,t)}}},ix=ld({name:"Container",factory:function(t){var e=t.dom,n=e.attributes,r=_(e,["attributes"]);return{uid:t.uid,dom:T({tag:"div",attributes:T({role:"presentation"},n)},r),components:t.components,behaviours:sf(t.containerBehaviours),events:t.events,domModification:t.domModification,eventOrder:t.eventOrder}},configFields:[to("components",[]),cf("containerBehaviours",[]),to("events",{}),to("domModification",{}),to("eventOrder",{})]}),ux=function(t){var e=function(e){return pe(t.element).fold(k,function(t){return se(e,t)})},n=ox(),r=function(t,r){return n.find(e,t,r)},o=Yw(t.element,{triggerEvent:function(t,e){return oa(t,e.target,function(n){return function(t,e,n,r){return nx(t,e,n,n.target,r)}(r,t,e,n)})}}),i={debugInfo:v("real"),triggerEvent:function(t,e,n){oa(t,e,function(o){return nx(r,t,n,e,o)})},triggerFocus:function(t,e){Qi(t).fold(function(){hc(t)},function(n){oa(Go(),t,function(n){return function(t,e,n,r,o){var i=Jw(n,r);Zw(t,e,n,r,i,o)}(r,Go(),{originator:e,kill:h,prevent:h,target:t},t,n),!1})})},triggerEscape:function(t,e){i.triggerEvent("keydown",t.element,e.event)},getByUid:function(t){return g(t)},getByDom:function(t){return p(t)},build:Vu,addToGui:function(t){c(t)},removeFromGui:function(t){s(t)},addToWorld:function(t){u(t)},removeFromWorld:function(t){a(t)},broadcast:function(t){f(t)},broadcastOn:function(t,e){d(t,e)},broadcastEvent:function(t,e){m(t,e)},isConnected:k},u=function(t){t.connect(i),Ft(t.element)||(n.register(t),q(t.components(),u),i.triggerEvent(ri(),t.element,{target:t.element}))},a=function(t){Ft(t.element)||(q(t.components(),a),n.unregister(t)),t.disconnect()},c=function(e){Sl(t,e)},s=function(t){Tl(t)},l=function(t){var e=n.filter(Yo());q(e,function(e){var n=e.descHandler;du(n)(t)})},f=function(t){l({universal:!0,data:t})},d=function(t,e){l({universal:!1,channels:t,data:e})},m=function(t,e){var r=n.filter(t);return ex(r,e)},g=function(t){return n.getById(t).fold(function(){return Rn.error(new Error('Could not find component with uid: "'+t+'" in system.'))},Rn.value)},p=function(t){var e=Qi(t).getOr("not found");return g(e)};return u(t),{root:t,element:t.element,destroy:function(){o.unbind(),yn(t.element)},add:c,remove:s,getByUid:g,getByDom:p,addToWorld:u,removeFromWorld:a,broadcast:f,broadcastOn:d,broadcastEvent:m}},ax=v([to("prefix","form-field"),cf("fieldBehaviours",[hd,af])]),cx=v([Hf({schema:[Ir("dom")],name:"label"}),Hf({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:t.text}}}},schema:[Ir("text")],name:"aria-descriptor"}),Lf({factory:{sketch:function(t){var e=mo(t,["factory"]);return t.factory.sketch(e)}},schema:[Ir("factory")],name:"field"})]),sx=fd({name:"FormField",configFields:ax(),partFields:cx(),factory:function(t,e,n,r){var o=lf(t.fieldBehaviours,[hd.config({find:function(e){return Yf(e,t,"field")}}),af.config({store:{mode:"manual",getValue:function(t){return hd.getCurrent(t).bind(af.getValue)},setValue:function(t,e){hd.getCurrent(t).each(function(t){af.setValue(t,e)})}}})]),i=ki([Ri(function(e,n){var r=Qf(e,t,["label","field","aria-descriptor"]);r.field().each(function(e){var n=$i(t.prefix);r.label().each(function(t){Re(t.element,"for",n),Re(e.element,"id",n)}),r["aria-descriptor"]().each(function(n){var r=$i(t.prefix);Re(n.element,"id",r),Re(e.element,"aria-describedby",r)})})})]),u={getField:function(e){return Yf(e,t,"field")},getLabel:function(e){return Yf(e,t,"label")}};return{uid:t.uid,dom:t.dom,components:e,behaviours:o,events:i,apis:u}},apis:{getField:function(t,e){return t.getField(e)},getLabel:function(t,e){return t.getLabel(e)}}}),lx=Object.freeze({__proto__:null,exhibit:function(t,e){return fu({attributes:ho([{key:e.tabAttr,value:"true"}])})}}),fx=[to("tabAttr","data-alloy-tabstop")],dx=cc({fields:fx,name:"tabstopping",active:lx}),mx=tinymce.util.Tools.resolve("tinymce.html.Entities"),gx=function(t,e,n,r){var o=hx(t,e,n,r);return sx.sketch(o)},hx=function(t,e,n,r){return{dom:px(n),components:t.toArray().concat([e]),fieldBehaviours:uc(r)}},px=function(t){return{tag:"div",classes:["tox-form__group"].concat(t)}},vx=function(t,e){return sx.parts.label({dom:{tag:"label",classes:["tox-label"],innerHtml:e.translate(t)}})},bx=$i("form-component-change"),yx=$i("form-close"),wx=$i("form-cancel"),xx=$i("form-action"),Cx=$i("form-submit"),Sx=$i("form-block"),kx=$i("form-unblock"),Ox=$i("form-tabchange"),Tx=$i("form-resize"),_x=function(t,e){var n,r,o,i=t.label.map(function(t){return vx(t,e)}),u=function(t){return function(e,n){Ju(n.event.target,"[data-collection-item-value]").each(function(r){t(e,n,r,Le(r,"data-collection-item-value"))})}},a=u(function(n,r,o,i){r.stop(),e.isDisabled()||yi(n,xx,{name:t.name,value:i})}),c=[_i(zo(),u(function(t,e,n){hc(n)})),_i(Fo(),a),_i(Zo(),a),_i(Ro(),u(function(t,e,n){Yu(t.element,"."+Yv).each(function(t){Tu(t,Yv)}),ku(n,Yv)})),_i(Bo(),u(function(t){Yu(t.element,"."+Yv).each(function(t){Tu(t,Yv)})})),Pi(u(function(e,n,r,o){yi(e,xx,{name:t.name,value:o})}))],s=function(t,e){return W(Us(t.element,".tox-collection__item"),e)},l=sx.parts.field({dom:{tag:"div",classes:["tox-collection"].concat(1!==t.columns?["tox-collection--grid"]:["tox-collection--list"])},components:[],factory:{sketch:b},behaviours:uc([Dd.config({disabled:e.isDisabled,onDisabled:function(t){s(t,function(t){ku(t,"tox-collection__item--state-disabled"),Re(t,"aria-disabled",!0)})},onEnabled:function(t){s(t,function(t){Tu(t,"tox-collection__item--state-disabled"),Ie(t,"aria-disabled")})}}),cy(),Fg.config({}),af.config({store:{mode:"memory",initialValue:[]},onSetValue:function(n,r){!function(n,r){var o=W(r,function(n){var r=Yp.translate(n.text),o=1===t.columns?'<div class="tox-collection__item-label">'+r+"</div>":"",i='<div class="tox-collection__item-icon">'+n.icon+"</div>",u={_:" "," - ":" ","-":" "},a=r.replace(/\_| \- |\-/g,function(t){return u[t]});return'<div class="tox-collection__item'+(e.isDisabled()?" tox-collection__item--state-disabled":"")+'" tabindex="-1" data-collection-item-value="'+mx.encodeAllRaw(n.value)+'" title="'+a+'" aria-label="'+a+'">'+i+o+"</div>"}),i="auto"!==t.columns&&t.columns>1?j(o,t.columns):[o],u=W(i,function(t){return'<div class="tox-collection__group">'+t.join("")+"</div>"});Ii(n.element,u.join(""))}(n,r),"auto"===t.columns&&Ob(n,5,"tox-collection__item").each(function(t){var e=t.numRows,r=t.numColumns;Bg.setGridSize(n,e,r)}),bi(n,Tx)}}),dx.config({}),Bg.config((r=t.columns,o="normal",1===r?{mode:"menu",moveOnTab:!1,selector:".tox-collection__item"}:"auto"===r?{mode:"flatgrid",selector:".tox-collection__item",initSize:{numColumns:1,numRows:1}}:{mode:"matrix",selectors:{row:"color"===o?".tox-swatches__row":".tox-collection__group",cell:"color"===o?".tox-swatch":".tox-collection__item"}})),Vg("collection-events",c)]),eventOrder:(n={},n[Jo()]=["disabling","alloy.base.behaviour","collection-events"],n)});return gx(i,l,["tox-form__group--collection"],[])},Ex=v([Gr("data"),to("inputAttributes",{}),to("inputStyles",{}),to("tag","input"),to("inputClasses",[]),ma("onSetValue"),to("styles",{}),to("eventOrder",{}),cf("inputBehaviours",[af,$g]),to("selectOnFocus",!0)]),Dx=function(t){return uc([$g.config({onFocus:t.selectOnFocus?function(t){var e=t.element,n=Au(e);e.dom.setSelectionRange(0,n.length)}:h})])},Ax=function(t){return{tag:t.tag,attributes:T({type:"text"},t.inputAttributes),styles:t.inputStyles,classes:t.inputClasses}},Nx=ld({name:"Input",configFields:Ex(),factory:function(t,e){return{uid:t.uid,dom:Ax(t),components:[],behaviours:function(t){return T(T({},Dx(t)),lf(t.inputBehaviours,[af.config({store:T(T({mode:"manual"},t.data.map(function(t){return{initialValue:t}}).getOr({})),{getValue:function(t){return Au(t.element)},setValue:function(t,e){Au(t.element)!==e&&Nu(t.element,e)}}),onSetValue:t.onSetValue})]))}(t),eventOrder:t.eventOrder}}}),Mx={},zx={exports:Mx};!function(e,n,r,o){!function(t,o){"object"==typeof n&&void 0!==r?r.exports=o():"function"==typeof e&&e.amd?e(o):(t="undefined"!=typeof globalThis?globalThis:t||self).EphoxContactWrapper=o()}(this,function(){var e,n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:{},r={exports:{}};e=r,function(t){var n=setTimeout;function r(){}function o(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],s(t,this)}function i(t,e){for(;3===t._state;)t=t._value;0!==t._state?(t._handled=!0,o._immediateFn(function(){var n=1===t._state?e.onFulfilled:e.onRejected;if(null!==n){var r;try{r=n(t._value)}catch(t){return void a(e.promise,t)}u(e.promise,r)}else(1===t._state?u:a)(e.promise,t._value)})):t._deferreds.push(e)}function u(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if(e instanceof o)return t._state=3,t._value=e,void c(t);if("function"==typeof n)return void s((r=n,i=e,function(){r.apply(i,arguments)}),t)}t._state=1,t._value=e,c(t)}catch(e){a(t,e)}var r,i}function a(t,e){t._state=2,t._value=e,c(t)}function c(t){2===t._state&&0===t._deferreds.length&&o._immediateFn(function(){t._handled||o._unhandledRejectionFn(t._value)});for(var e=0,n=t._deferreds.length;e<n;e++)i(t,t._deferreds[e]);t._deferreds=null}function s(t,e){var n=!1;try{t(function(t){n||(n=!0,u(e,t))},function(t){n||(n=!0,a(e,t))})}catch(t){if(n)return;n=!0,a(e,t)}}o.prototype.catch=function(t){return this.then(null,t)},o.prototype.then=function(t,e){var n=new this.constructor(r);return i(this,new function(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}(t,e,n)),n},o.all=function(t){var e=Array.prototype.slice.call(t);return new o(function(t,n){if(0===e.length)return t([]);var r=e.length;function o(i,u){try{if(u&&("object"==typeof u||"function"==typeof u)){var a=u.then;if("function"==typeof a)return void a.call(u,function(t){o(i,t)},n)}e[i]=u,0==--r&&t(e)}catch(t){n(t)}}for(var i=0;i<e.length;i++)o(i,e[i])})},o.resolve=function(t){return t&&"object"==typeof t&&t.constructor===o?t:new o(function(e){e(t)})},o.reject=function(t){return new o(function(e,n){n(t)})},o.race=function(t){return new o(function(e,n){for(var r=0,o=t.length;r<o;r++)t[r].then(e,n)})},o._immediateFn="function"==typeof setImmediate?function(t){setImmediate(t)}:function(t){n(t,0)},o._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)},o._setImmediateFn=function(t){o._immediateFn=t},o._setUnhandledRejectionFn=function(t){o._unhandledRejectionFn=t},e.exports?e.exports=o:t.Promise||(t.Promise=o)}(n);var o=r.exports;return{boltExport:("undefined"!=typeof window?window:Function("return this;")()).Promise||o}})}(void 0,Mx,zx);var Rx,Bx=zx.exports.boltExport,Lx=function(t){var e=R.none(),n=[],r=function(t){o()?u(t):n.push(t)},o=function(){return e.isSome()},i=function(t){q(t,u)},u=function(t){e.each(function(e){setTimeout(function(){t(e)},0)})};return t(function(t){o()||(e=R.some(t),i(n),n=[])}),{get:r,map:function(t){return Lx(function(e){r(function(n){e(t(n))})})},isReady:o}},Px={nu:Lx,pure:function(t){return Lx(function(e){e(t)})}},Hx=function(t){setTimeout(function(){throw t},0)},Ix=function(t){var e=function(e){t().then(e,Hx)};return{map:function(e){return Ix(function(){return t().then(e)})},bind:function(e){return Ix(function(){return t().then(function(t){return e(t).toPromise()})})},anonBind:function(e){return Ix(function(){return t().then(function(){return e.toPromise()})})},toLazy:function(){return Px.nu(e)},toCached:function(){var e=null;return Ix(function(){return null===e&&(e=t()),e})},toPromise:t,get:e}},Fx=function(t){return Ix(function(){return new Bx(t)})},Vx=function(t){return Ix(function(){return Bx.resolve(t)})},Ux=["input","textarea"],jx=function(t){var e=Pt(t);return F(Ux,e)},Wx=function(t,e){var n=e.getRoot(t).getOr(t.element);Tu(n,e.invalidClass),e.notify.each(function(e){jx(t.element)&&Re(t.element,"aria-invalid",!1),e.getContainer(t).each(function(t){Ii(t,e.validHtml)}),e.onValid(t)})},qx=function(t,e,n,r){var o=e.getRoot(t).getOr(t.element);ku(o,e.invalidClass),e.notify.each(function(e){jx(t.element)&&Re(t.element,"aria-invalid",!0),e.getContainer(t).each(function(t){Ii(t,r)}),e.onInvalid(t,r)})},$x=function(t,e,n){return e.validator.fold(function(){return Vx(Rn.value(!0))},function(e){return e.validate(t)})},Gx=function(t,e,n){return e.notify.each(function(e){e.onValidate(t)}),$x(t,e).map(function(n){return t.getSystem().isConnected()?n.fold(function(n){return qx(t,e,0,n),Rn.error(n)},function(n){return Wx(t,e),Rn.value(n)}):Rn.error("No longer in system")})},Kx=Object.freeze({__proto__:null,markValid:Wx,markInvalid:qx,query:$x,run:Gx,isInvalid:function(t,e){var n=e.getRoot(t).getOr(t.element);return _u(n,e.invalidClass)}}),Xx=Object.freeze({__proto__:null,events:function(t,e){return t.validator.map(function(e){return ki([_i(e.onEvent,function(e){Gx(e,t).get(b)})].concat(e.validateOnLoad?[Ri(function(e){Gx(e,t).get(h)})]:[]))}).getOr({})}}),Yx=[Ir("invalidClass"),to("getRoot",R.none),Zr("notify",[to("aria","alert"),to("getContainer",R.none),to("validHtml",""),ma("onValid"),ma("onInvalid"),ma("onValidate")]),Zr("validator",[Ir("validate"),to("onEvent","input"),to("validateOnLoad",!0)])],Jx=cc({fields:Yx,name:"invalidating",active:Xx,apis:Kx,extra:{validation:function(t){return function(e){var n=af.getValue(e);return Vx(t(n))}}}}),Qx=Object.freeze({__proto__:null,getCoupled:function(t,e,n,r){return n.getOrCreate(t,e,r)}}),Zx=[Fr("others",Ar(Rn.value,yr()))],tC=cc({fields:Zx,name:"coupling",apis:Qx,state:Object.freeze({__proto__:null,init:function(){var t={},e=v({});return su({readState:e,getOrCreate:function(e,n,r){var o=ft(n.others);if(o)return wt(t,r).getOrThunk(function(){var o=wt(n.others,r).getOrDie("No information found for coupled component: "+r)(e),i=e.getSystem().build(o);return t[r]=i,i});throw new Error("Cannot find coupled component: "+r+". Known coupled components: "+JSON.stringify(o,null,2))}})}})}),eC=v("sink"),nC=v(Hf({name:eC(),overrides:v({dom:{tag:"div"},behaviours:uc([bl.config({useFixed:k})]),events:ki([Mi(Lo()),Mi(Do()),Mi(Fo())])})}));!function(t){t[t.HighlightFirst=0]="HighlightFirst",t[t.HighlightNone=1]="HighlightNone"}(Rx||(Rx={}));var rC,oC,iC,uC=function(t,e){var n=t.getHotspot(e).getOr(e),r=t.getAnchorOverrides();return t.layouts.fold(function(){return{type:"hotspot",hotspot:n,overrides:r}},function(t){return{type:"hotspot",hotspot:n,overrides:r,layouts:t}})},aC=function(t,e,n,r,o,i,u){return function(t,e,n,r,o,i,u){var a=function(t,e,n){return(0,t.fetch)(n).map(e)}(t,e,r),c=fC(r,t);return a.map(function(t){return t.bind(function(t){return R.from(Th.sketch(T(T({},i.menu()),{uid:Zi(""),data:t,highlightImmediately:u===Rx.HighlightFirst,onOpenMenu:function(t,e){var r=c().getOrDie();bl.position(r,e,{anchor:n}),Fl.decloak(o)},onOpenSubmenu:function(t,e,n){var r=c().getOrDie();bl.position(r,n,{anchor:{type:"submenu",item:e}}),Fl.decloak(o)},onRepositionMenu:function(t,e,r){var o=c().getOrDie();bl.position(o,e,{anchor:n}),q(r,function(t){bl.position(o,t.triggeredMenu,{anchor:{type:"submenu",item:t.triggeringItem}})})},onEscape:function(){return $g.focus(r),Fl.close(o),R.some(!0)}})))})})}(t,e,uC(t,n),n,r,o,u).map(function(t){return t.fold(function(){Fl.isOpen(r)&&Fl.close(r)},function(t){Fl.cloak(r),Fl.open(r,t),i(r)}),r})},cC=function(t,e,n,r,o,i,u){return Fl.close(r),Vx(r)},sC=function(t,e,n,r,o,i){var u=tC.getCoupled(n,"sandbox");return(Fl.isOpen(u)?cC:aC)(t,e,n,u,r,o,i)},lC=function(t,e,n){var r,o,i=hd.getCurrent(e).getOr(e),u=cn(t.element);n?Ue(i.element,"min-width",u+"px"):(r=i.element,o=u,an.set(r,o))},fC=function(t,e){return t.getSystem().getByUid(e.uid+"-"+eC()).map(function(t){return function(){return Rn.value(t)}}).getOrThunk(function(){return e.lazySink.fold(function(){return function(){return Rn.error(new Error("No internal sink is specified, nor could an external sink be found"))}},function(e){return function(){return e(t)}})})},dC=function(t){Fl.getState(t).each(function(t){Th.repositionMenus(t)})},mC=function(t,e,n){var r=Qu(),o=fC(e,t);return{dom:{tag:"div",classes:t.sandboxClasses,attributes:{id:r.id,role:"listbox"}},behaviours:df(t.sandboxBehaviours,[af.config({store:{mode:"memory",initialValue:e}}),Fl.config({onOpen:function(o,i){var u=uC(t,e);r.link(e.element),t.matchWidth&&lC(u.hotspot,i,t.useMinWidth),t.onOpen(u,o,i),void 0!==n&&void 0!==n.onOpen&&n.onOpen(o,i)},onClose:function(t,o){r.unlink(e.element),void 0!==n&&void 0!==n.onClose&&n.onClose(t,o)},isPartOf:function(t,n,r){return ta(n,r)||ta(e,r)},getAttachPoint:function(){return o().getOrDie()}}),hd.config({find:function(t){return Fl.getState(t).bind(function(t){return hd.getCurrent(t)})}}),dc.config({channels:T(T({},ql({isExtraPart:S})),Gl({doReposition:dC}))})])}},gC=function(t){var e=tC.getCoupled(t,"sandbox");dC(e)},hC=function(){return[to("sandboxClasses",[]),ff("sandboxBehaviours",[hd,dc,Fl,af])]},pC=v([Ir("dom"),Ir("fetch"),ma("onOpen"),ga("onExecute"),to("getHotspot",R.some),to("getAnchorOverrides",v({})),ss(),cf("dropdownBehaviours",[oh,tC,Bg,$g]),Ir("toggleClass"),to("eventOrder",{}),Gr("lazySink"),to("matchWidth",!1),to("useMinWidth",!1),Gr("role")].concat(hC())),vC=v([Pf({schema:[la()],name:"menu",defaults:function(t){return{onExecute:t.onExecute}}}),nC()]),bC=fd({name:"Dropdown",configFields:pC(),partFields:vC(),factory:function(t,e,n,r){var o,i,u=function(t){Fl.getState(t).each(function(t){Th.highlightPrimary(t)})},a={expand:function(e){oh.isOn(e)||sC(t,b,e,r,h,Rx.HighlightNone).get(h)},open:function(e){oh.isOn(e)||sC(t,b,e,r,h,Rx.HighlightFirst).get(h)},isOpen:oh.isOn,close:function(e){oh.isOn(e)&&sC(t,b,e,r,h,Rx.HighlightFirst).get(h)},repositionMenus:function(t){oh.isOn(t)&&gC(t)}},c=function(t,e){return wi(t),R.some(!0)};return{uid:t.uid,dom:t.dom,components:e,behaviours:lf(t.dropdownBehaviours,[oh.config({toggleClass:t.toggleClass,aria:{mode:"expanded"}}),tC.config({others:{sandbox:function(e){return mC(t,e,{onOpen:function(){return oh.on(e)},onClose:function(){return oh.off(e)}})}}}),Bg.config({mode:"special",onSpace:c,onEnter:c,onDown:function(t,e){if(bC.isOpen(t)){var n=tC.getCoupled(t,"sandbox");u(n)}else bC.open(t);return R.some(!0)},onEscape:function(t,e){return bC.isOpen(t)?(bC.close(t),R.some(!0)):R.none()}}),$g.config({})]),events:uh(R.some(function(e){sC(t,b,e,r,u,Rx.HighlightFirst).get(h)})),eventOrder:T(T({},t.eventOrder),(o={},o[Jo()]=["disabling","toggling","alloy.base.behaviour"],o)),apis:a,domModification:{attributes:T(T({"aria-haspopup":"true"},t.role.fold(function(){return{}},function(t){return{role:t}})),"button"===t.dom.tag?{type:(i="type",wt(t.dom,"attributes").bind(function(t){return wt(t,i)})).getOr("button")}:{})}}},apis:{open:function(t,e){return t.open(e)},expand:function(t,e){return t.expand(e)},close:function(t,e){return t.close(e)},isOpen:function(t,e){return t.isOpen(e)},repositionMenus:function(t,e){return t.repositionMenus(e)}}}),yC=cc({fields:[],name:"unselecting",active:Object.freeze({__proto__:null,events:function(){return ki([Oi(Wo(),k)])},exhibit:function(){return fu({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})}})}),wC=$i("color-input-change"),xC=$i("color-swatch-change"),CC=$i("color-picker-cancel"),SC=function(t,e,n){var r=sx.parts.field({factory:Nx,inputClasses:["tox-textfield"],onSetValue:function(t){return Jx.run(t).get(h)},inputBehaviours:uc([Dd.config({disabled:e.providers.isDisabled}),cy(),dx.config({}),Jx.config({invalidClass:"tox-textbox-field-invalid",getRoot:function(t){return pe(t.element)},notify:{onValid:function(t){var e=af.getValue(t);yi(t,wC,{color:e})}},validator:{validateOnLoad:!1,validate:function(t){var e=af.getValue(t);if(0===e.length)return Vx(Rn.value(!0));var n=Bt.fromTag("span");Ue(n,"background-color",e);var r=Ge(n,"background-color").fold(function(){return Rn.error("blah")},function(t){return Rn.value(e)});return Vx(r)}}})]),selectOnFocus:!1}),o=t.label.map(function(t){return vx(t,e.providers)}),i=function(t,e){yi(t,xC,{value:e})},u=Xh(function(t,e){return bC.sketch({dom:t.dom,components:t.components,toggleClass:"mce-active",dropdownBehaviours:uc([ly(e.providers.isDisabled),cy(),yC.config({}),dx.config({})]),layouts:t.layouts,sandboxClasses:["tox-dialog__popups"],lazySink:e.getSink,fetch:function(n){return Fx(function(e){return t.fetch(e)}).map(function(r){return R.from(jw(Jn(kw($i("menu-value"),r,function(e){t.onItemAction(n,e)},t.columns,t.presets,$v.CLOSE_ON_EXECUTE,S,e.providers),{movement:Tw(t.columns,t.presets)})))})},parts:{menu:eb(0,0,t.presets)}})}({dom:{tag:"span",attributes:{"aria-label":e.providers.translate("Color swatch")}},layouts:{onRtl:function(){return[Fa,Ia,Wa]},onLtr:function(){return[Ia,Fa,Wa]}},components:[],fetch:yw(n.getColors(),n.hasCustomColors()),columns:n.getColorCols(),presets:"color",onItemAction:function(t,e){u.getOpt(t).each(function(t){"custom"===e?n.colorPicker(function(e){e.fold(function(){return bi(t,CC)},function(e){i(t,e),gw(e)})},"#ffffff"):i(t,"remove"===e?"":e)})}},e));return sx.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:o.toArray().concat([{dom:{tag:"div",classes:["tox-color-input"]},components:[r,u.asSpec()]}]),fieldBehaviours:uc([Vg("form-field-events",[_i(wC,function(e,n){u.getOpt(e).each(function(t){Ue(t.element,"background-color",n.event.color)}),yi(e,bx,{name:t.name})}),_i(xC,function(t,e){sx.getField(t).each(function(n){af.setValue(n,e.event.value),hd.getCurrent(t).each($g.focus)})}),_i(CC,function(t,e){sx.getField(t).each(function(e){hd.getCurrent(t).each($g.focus)})})])])})},kC=Hf({schema:[Ir("dom")],name:"label"}),OC=function(t){return Hf({name:t+"-edge",overrides:function(e){return e.model.manager.edgeActions[t].fold(function(){return{}},function(t){return{events:ki([Ei(Oo(),function(e,n,r){return t(e,r)},[e]),Ei(Do(),function(e,n,r){return t(e,r)},[e]),Ei(Ao(),function(e,n,r){r.mouseIsDown.get()&&t(e,r)},[e])])}})}})},TC=OC("top-left"),_C=OC("top"),EC=OC("top-right"),DC=OC("right"),AC=OC("bottom-right"),NC=OC("bottom"),MC=OC("bottom-left"),zC=[kC,OC("left"),DC,_C,NC,TC,EC,MC,AC,Lf({name:"thumb",defaults:v({dom:{styles:{position:"absolute"}}}),overrides:function(t){return{events:ki([Ai(Oo(),t,"spectrum"),Ai(To(),t,"spectrum"),Ai(_o(),t,"spectrum"),Ai(Do(),t,"spectrum"),Ai(Ao(),t,"spectrum"),Ai(Mo(),t,"spectrum")])}}}),Lf({schema:[Pr("mouseIsDown",function(){return so(!1)})],name:"spectrum",overrides:function(t){var e=t.model.manager,n=function(n,r){return e.getValueFromEvent(r).map(function(r){return e.setValueFrom(n,t,r)})};return{behaviours:uc([Bg.config({mode:"special",onLeft:function(n){return e.onLeft(n,t)},onRight:function(n){return e.onRight(n,t)},onUp:function(n){return e.onUp(n,t)},onDown:function(n){return e.onDown(n,t)}}),$g.config({})]),events:ki([_i(Oo(),n),_i(To(),n),_i(Do(),n),_i(Ao(),function(e,r){t.mouseIsDown.get()&&n(e,r)})])}}})],RC=v("slider.change.value"),BC=function(t){var e=t.event.raw;if(function(t){return-1!==t.type.indexOf("touch")}(e)){var n=e;return void 0!==n.touches&&1===n.touches.length?R.some(n.touches[0]).map(function(t){return nn(t.clientX,t.clientY)}):R.none()}var r=e;return void 0!==r.clientX?R.some(r).map(function(t){return nn(t.clientX,t.clientY)}):R.none()},LC=function(t){return t.model.minX},PC=function(t){return t.model.minY},HC=function(t){return t.model.minX-1},IC=function(t){return t.model.minY-1},FC=function(t){return t.model.maxX},VC=function(t){return t.model.maxY},UC=function(t){return t.model.maxX+1},jC=function(t){return t.model.maxY+1},WC=function(t,e,n){return e(t)-n(t)},qC=function(t){return WC(t,FC,LC)},$C=function(t){return WC(t,VC,PC)},GC=function(t){return qC(t)/2},KC=function(t){return $C(t)/2},XC=function(t){return t.stepSize},YC=function(t){return t.snapToGrid},JC=function(t){return t.snapStart},QC=function(t){return t.rounded},ZC=function(t,e){return void 0!==t[e+"-edge"]},tS=function(t){return ZC(t,"left")},eS=function(t){return ZC(t,"right")},nS=function(t){return ZC(t,"top")},rS=function(t){return ZC(t,"bottom")},oS=function(t){return t.model.value.get()},iS=function(t){return{x:t}},uS=function(t){return{y:t}},aS=function(t,e){return{x:t,y:e}},cS=function(t,e){yi(t,RC(),{value:e})},sS=function(t,e,n,r){return t<e?t:t>n?n:t===e?e-1:Math.max(e,t-r)},lS=function(t,e,n,r){return t>n?t:t<e?e:t===n?n+1:Math.min(n,t+r)},fS=function(t,e,n){return Math.max(e,Math.min(n,t))},dS=function(t){var e=t.min,n=t.max,r=t.range,o=t.value,i=t.step,u=t.snap,a=t.snapStart,c=t.rounded,s=t.hasMinEdge,l=t.hasMaxEdge,f=t.minBound,d=t.maxBound,m=t.screenRange,g=s?e-1:e,h=l?n+1:n;if(o<f)return g;if(o>d)return h;var p=function(t,e,n){return Math.min(n,Math.max(t,e))-e}(o,f,d),v=fS(p/m*r+e,g,h);return u&&v>=e&&v<=n?function(t,e,n,r,o){return o.fold(function(){var o=t-e,i=Math.round(o/r)*r;return fS(e+i,e-1,n+1)},function(e){var o=(t-e)%r,i=Math.round(o/r),u=Math.floor((t-e)/r),a=Math.floor((n-e)/r),c=e+Math.min(a,u+i)*r;return Math.max(e,c)})}(v,e,n,i,a):c?Math.round(v):v},mS=function(t){var e=t.min,n=t.max,r=t.range,o=t.value,i=t.hasMinEdge,u=t.hasMaxEdge,a=t.maxBound,c=t.maxOffset,s=t.centerMinEdge,l=t.centerMaxEdge;return o<e?i?0:s:o>n?u?a:l:(o-e)/r*c},gS=function(t){return t.element.dom.getBoundingClientRect()},hS=function(t,e){return t[e]},pS=function(t){var e=gS(t);return hS(e,"left")},vS=function(t){var e=gS(t);return hS(e,"right")},bS=function(t){var e=gS(t);return hS(e,"top")},yS=function(t){var e=gS(t);return hS(e,"bottom")},wS=function(t){var e=gS(t);return hS(e,"width")},xS=function(t){var e=gS(t);return hS(e,"height")},CS=function(t,e,n){return(t+e)/2-n},SS=function(t,e){var n=gS(t),r=gS(e),o=hS(n,"left"),i=hS(n,"right"),u=hS(r,"left");return CS(o,i,u)},kS=function(t,e){var n=gS(t),r=gS(e),o=hS(n,"top"),i=hS(n,"bottom"),u=hS(r,"top");return CS(o,i,u)},OS=function(t,e){yi(t,RC(),{value:e})},TS=function(t){return{x:t}},_S=function(t,e,n){var r={min:LC(e),max:FC(e),range:qC(e),value:n,step:XC(e),snap:YC(e),snapStart:JC(e),rounded:QC(e),hasMinEdge:tS(e),hasMaxEdge:eS(e),minBound:pS(t),maxBound:vS(t),screenRange:wS(t)};return dS(r)},ES=function(t){return function(e,n){return function(t,e,n){var r=(t>0?lS:sS)(oS(n).x,LC(n),FC(n),XC(n));return OS(e,TS(r)),R.some(r)}(t,e,n).map(k)}},DS=function(t,e,n,r,o,i){var u=function(t,e,n,r,o){var i=wS(t),u=r.bind(function(e){return R.some(SS(e,t))}).getOr(0),a=o.bind(function(e){return R.some(SS(e,t))}).getOr(i),c={min:LC(e),max:FC(e),range:qC(e),value:n,hasMinEdge:tS(e),hasMaxEdge:eS(e),minBound:pS(t),minOffset:0,maxBound:vS(t),maxOffset:i,centerMinEdge:u,centerMaxEdge:a};return mS(c)}(e,i,n,r,o);return pS(e)-pS(t)+u},AS=ES(-1),NS=ES(1),MS=R.none,zS=R.none,RS={"top-left":R.none(),top:R.none(),"top-right":R.none(),right:R.some(function(t,e){cS(t,iS(UC(e)))}),"bottom-right":R.none(),bottom:R.none(),"bottom-left":R.none(),left:R.some(function(t,e){cS(t,iS(HC(e)))})},BS=Object.freeze({__proto__:null,setValueFrom:function(t,e,n){var r=_S(t,e,n),o=TS(r);return OS(t,o),r},setToMin:function(t,e){var n=LC(e);OS(t,TS(n))},setToMax:function(t,e){var n=FC(e);OS(t,TS(n))},findValueOfOffset:_S,getValueFromEvent:function(t){return BC(t).map(function(t){return t.left})},findPositionOfValue:DS,setPositionFromValue:function(t,e,n,r){var o=oS(n),i=DS(t,r.getSpectrum(t),o.x,r.getLeftEdge(t),r.getRightEdge(t),n),u=cn(e.element)/2;Ue(e.element,"left",i-u+"px")},onLeft:AS,onRight:NS,onUp:MS,onDown:zS,edgeActions:RS}),LS=function(t,e){yi(t,RC(),{value:e})},PS=function(t){return{y:t}},HS=function(t,e,n){var r={min:PC(e),max:VC(e),range:$C(e),value:n,step:XC(e),snap:YC(e),snapStart:JC(e),rounded:QC(e),hasMinEdge:nS(e),hasMaxEdge:rS(e),minBound:bS(t),maxBound:yS(t),screenRange:xS(t)};return dS(r)},IS=function(t){return function(e,n){return function(t,e,n){var r=(t>0?lS:sS)(oS(n).y,PC(n),VC(n),XC(n));return LS(e,PS(r)),R.some(r)}(t,e,n).map(k)}},FS=function(t,e,n,r,o,i){var u=function(t,e,n,r,o){var i=xS(t),u=r.bind(function(e){return R.some(kS(e,t))}).getOr(0),a=o.bind(function(e){return R.some(kS(e,t))}).getOr(i),c={min:PC(e),max:VC(e),range:$C(e),value:n,hasMinEdge:nS(e),hasMaxEdge:rS(e),minBound:bS(t),minOffset:0,maxBound:yS(t),maxOffset:i,centerMinEdge:u,centerMaxEdge:a};return mS(c)}(e,i,n,r,o);return bS(e)-bS(t)+u},VS=R.none,US=R.none,jS=IS(-1),WS=IS(1),qS={"top-left":R.none(),top:R.some(function(t,e){cS(t,uS(IC(e)))}),"top-right":R.none(),right:R.none(),"bottom-right":R.none(),bottom:R.some(function(t,e){cS(t,uS(jC(e)))}),"bottom-left":R.none(),left:R.none()},$S=Object.freeze({__proto__:null,setValueFrom:function(t,e,n){var r=HS(t,e,n),o=PS(r);return LS(t,o),r},setToMin:function(t,e){var n=PC(e);LS(t,PS(n))},setToMax:function(t,e){var n=VC(e);LS(t,PS(n))},findValueOfOffset:HS,getValueFromEvent:function(t){return BC(t).map(function(t){return t.top})},findPositionOfValue:FS,setPositionFromValue:function(t,e,n,r){var o=oS(n),i=FS(t,r.getSpectrum(t),o.y,r.getTopEdge(t),r.getBottomEdge(t),n),u=Ze(e.element)/2;Ue(e.element,"top",i-u+"px")},onLeft:VS,onRight:US,onUp:jS,onDown:WS,edgeActions:qS}),GS=function(t,e){yi(t,RC(),{value:e})},KS=function(t,e){return{x:t,y:e}},XS=function(t,e){return function(n,r){return function(t,e,n,r){var o=t>0?lS:sS,i=e?oS(r).x:o(oS(r).x,LC(r),FC(r),XC(r)),u=e?o(oS(r).y,PC(r),VC(r),XC(r)):oS(r).y;return GS(n,KS(i,u)),R.some(i)}(t,e,n,r).map(k)}},YS=XS(-1,!1),JS=XS(1,!1),QS=XS(-1,!0),ZS=XS(1,!0),tk={"top-left":R.some(function(t,e){cS(t,aS(HC(e),IC(e)))}),top:R.some(function(t,e){cS(t,aS(GC(e),IC(e)))}),"top-right":R.some(function(t,e){cS(t,aS(UC(e),IC(e)))}),right:R.some(function(t,e){cS(t,aS(UC(e),KC(e)))}),"bottom-right":R.some(function(t,e){cS(t,aS(UC(e),jC(e)))}),bottom:R.some(function(t,e){cS(t,aS(GC(e),jC(e)))}),"bottom-left":R.some(function(t,e){cS(t,aS(HC(e),jC(e)))}),left:R.some(function(t,e){cS(t,aS(HC(e),KC(e)))})},ek=Object.freeze({__proto__:null,setValueFrom:function(t,e,n){var r=_S(t,e,n.left),o=HS(t,e,n.top),i=KS(r,o);return GS(t,i),i},setToMin:function(t,e){var n=LC(e),r=PC(e);GS(t,KS(n,r))},setToMax:function(t,e){var n=FC(e),r=VC(e);GS(t,KS(n,r))},getValueFromEvent:function(t){return BC(t)},setPositionFromValue:function(t,e,n,r){var o=oS(n),i=DS(t,r.getSpectrum(t),o.x,r.getLeftEdge(t),r.getRightEdge(t),n),u=FS(t,r.getSpectrum(t),o.y,r.getTopEdge(t),r.getBottomEdge(t),n),a=cn(e.element)/2,c=Ze(e.element)/2;Ue(e.element,"left",i-a+"px"),Ue(e.element,"top",u-c+"px")},onLeft:YS,onRight:JS,onUp:QS,onDown:ZS,edgeActions:tk}),nk=fd({name:"Slider",configFields:[to("stepSize",1),to("onChange",h),to("onChoose",h),to("onInit",h),to("onDragStart",h),to("onDragEnd",h),to("snapToGrid",!1),to("rounded",!0),Gr("snapStart"),Fr("model",Br("mode",{x:[to("minX",0),to("maxX",100),Pr("value",function(t){return so(t.mode.minX)}),Ir("getInitialValue"),va("manager",BS)],y:[to("minY",0),to("maxY",100),Pr("value",function(t){return so(t.mode.minY)}),Ir("getInitialValue"),va("manager",$S)],xy:[to("minX",0),to("maxX",100),to("minY",0),to("maxY",100),Pr("value",function(t){return so({x:t.mode.minX,y:t.mode.minY})}),Ir("getInitialValue"),va("manager",ek)]})),cf("sliderBehaviours",[Bg,af]),Pr("mouseIsDown",function(){return so(!1)})],partFields:zC,factory:function(t,e,n,r){var o,i=function(e){return Jf(e,t,"thumb")},u=function(e){return Jf(e,t,"spectrum")},a=function(e){return Yf(e,t,"left-edge")},c=function(e){return Yf(e,t,"right-edge")},s=function(e){return Yf(e,t,"top-edge")},l=function(e){return Yf(e,t,"bottom-edge")},f=t.model,d=f.manager,m=function(e,n){d.setPositionFromValue(e,n,t,{getLeftEdge:a,getRightEdge:c,getTopEdge:s,getBottomEdge:l,getSpectrum:u})},g=function(t,e){f.value.set(e);var n=i(t);m(t,n)},h=function(e){var n=t.mouseIsDown.get();t.mouseIsDown.set(!1),n&&Yf(e,t,"thumb").each(function(n){var r=f.value.get();t.onChoose(e,n,r)})},p=function(e,n){n.stop(),t.mouseIsDown.set(!0),t.onDragStart(e,i(e))},v=function(e,n){n.stop(),t.onDragEnd(e,i(e)),h(e)};return{uid:t.uid,dom:t.dom,components:e,behaviours:lf(t.sliderBehaviours,[Bg.config({mode:"special",focusIn:function(e){return Yf(e,t,"spectrum").map(Bg.focusIn).map(k)}}),af.config({store:{mode:"manual",getValue:function(t){return f.value.get()}}}),dc.config({channels:(o={},o[jl()]={onReceive:h},o)})]),events:ki([_i(RC(),function(e,n){!function(e,n){g(e,n);var r=i(e);t.onChange(e,r,n),R.some(!0)}(e,n.event.value)}),Ri(function(e,n){var r=f.getInitialValue();f.value.set(r);var o=i(e);m(e,o);var a=u(e);t.onInit(e,o,a,f.value.get())}),_i(Oo(),p),_i(_o(),v),_i(Do(),p),_i(Mo(),v)]),apis:{resetToMin:function(e){d.setToMin(e,t)},resetToMax:function(e){d.setToMax(e,t)},setValue:g,refresh:m},domModification:{styles:{position:"relative"}}}},apis:{setValue:function(t,e,n){t.setValue(e,n)},resetToMin:function(t,e){t.resetToMin(e)},resetToMax:function(t,e){t.resetToMax(e)},refresh:function(t,e){t.refresh(e)}}}),rk=$i("rgb-hex-update"),ok=$i("slider-update"),ik=$i("palette-update"),uk=[cf("formBehaviours",[af])],ak=function(t){return"<alloy.field."+t+">"},ck=function(t,e){return{uid:t.uid,dom:t.dom,components:e,behaviours:lf(t.formBehaviours,[af.config({store:{mode:"manual",getValue:function(e){var n=Zf(e,t);return gt(n,function(t,e){return t().bind(function(t){var n,r,o=hd.getCurrent(t);return n=o,r=new Error("Cannot find a current component to extract the value from for form part '"+e+"': "+Ui(t.element)),n.fold(function(){return Rn.error(r)},Rn.value)}).map(af.getValue)})},setValue:function(e,n){mt(n,function(n,r){Yf(e,t,r).each(function(t){hd.getCurrent(t).each(function(t){af.setValue(t,n)})})})}}})]),apis:{getField:function(e,n){return Yf(e,t,n).bind(hd.getCurrent)}}}},sk={getField:au(function(t,e,n){return t.getField(e,n)}),sketch:function(t){var e,n={field:function(t,n){return e.push(t),qf("form",ak(t),n)},record:v(e=[])},r=t(n),o=n.record(),i=W(o,function(t){return Lf({name:t,pname:ak(t)})});return ud("form",uk,i,ck,r)}},lk=$i("valid-input"),fk=$i("invalid-input"),dk=$i("validating-input"),mk=function(t,e,n,r){var o=function(n,r,o,i,u){var a=t("colorcustom.rgb.range"),c=[sx.parts.label({dom:{tag:"label",innerHtml:o,attributes:{"aria-label":i}}}),sx.parts.field({data:u,factory:Nx,inputAttributes:T({type:"text"},"hex"===r?{"aria-live":"polite"}:{}),inputClasses:[e("textfield")],inputBehaviours:uc([function(n,r){return Jx.config({invalidClass:e("invalid"),notify:{onValidate:function(t){yi(t,dk,{type:n})},onValid:function(t){yi(t,lk,{type:n,value:af.getValue(t)})},onInvalid:function(t){yi(t,fk,{type:n,value:af.getValue(t)})}},validator:{validate:function(e){var n=af.getValue(e),o=r(n)?Rn.value(!0):Rn.error(t("aria.input.invalid"));return Vx(o)},validateOnLoad:!1}})}(r,n),dx.config({})]),onSetValue:function(t){Jx.isInvalid(t)&&Jx.run(t).get(h)}})],s="hex"!==r?[sx.parts["aria-descriptor"]({text:a})]:[];return{dom:{tag:"div",attributes:{role:"presentation"}},components:c.concat(s)}},i=function(t,e){var n=e.red,r=e.green,o=e.blue;af.setValue(t,{red:n,green:r,blue:o})},u=Xh({dom:{tag:"div",classes:[e("rgba-preview")],styles:{"background-color":"white"},attributes:{role:"presentation"}}}),a=function(t,e){u.getOpt(t).each(function(t){Ue(t.element,"background-color","#"+e.value)})};return ld({factory:function(){var c={red:so(R.some(255)),green:so(R.some(255)),blue:so(R.some(255)),hex:so(R.some("ffffff"))},s=function(t){return c[t].get()},l=function(t,e){c[t].set(e)},f=function(t){var e=t.red,n=t.green,r=t.blue;l("red",R.some(e)),l("green",R.some(n)),l("blue",R.some(r))},d=function(t,e){var n=e.event;"hex"!==n.type?l(n.type,R.none()):r(t)},m=function(t,e,n){var r=parseInt(n,10);l(e,R.some(r)),s("red").bind(function(t){return s("green").bind(function(e){return s("blue").map(function(n){return Gy(t,e,n,1)})})}).each(function(e){var n=function(t,e){var n=Vy(e);return sk.getField(t,"hex").each(function(e){$g.isFocused(e)||af.setValue(t,{hex:n.value})}),n}(t,e);yi(t,rk,{hex:n}),a(t,n)})},g=function(t,e){var r=e.event;!function(t){return"hex"===t.type}(r)?m(t,r.type,r.value):function(t,e){n(t);var r=Ry(e);l("hex",R.some(e));var o=Yy(r);i(t,o),f(o),yi(t,rk,{hex:r}),a(t,r)}(t,r.value)},h=function(e){return{label:t("colorcustom.rgb."+e+".label"),description:t("colorcustom.rgb."+e+".description")}},p=h("red"),v=h("green"),b=h("blue"),y=h("hex");return Jn(sk.sketch(function(n){return{dom:{tag:"form",classes:[e("rgb-form")],attributes:{"aria-label":t("aria.color.picker")}},components:[n.field("red",sx.sketch(o(Ky,"red",p.label,p.description,255))),n.field("green",sx.sketch(o(Ky,"green",v.label,v.description,255))),n.field("blue",sx.sketch(o(Ky,"blue",b.label,b.description,255))),n.field("hex",sx.sketch(o(Py,"hex",y.label,y.description,"ffffff"))),u.asSpec()],formBehaviours:uc([Jx.config({invalidClass:e("form-invalid")}),Vg("rgb-form-events",[_i(lk,g),_i(fk,d),_i(dk,d)])])}}),{apis:{updateHex:function(t,e){af.setValue(t,{hex:e.value}),function(t,e){var n=Yy(e);i(t,n),f(n)}(t,e),a(t,e)}}})},name:"RgbForm",configFields:[],apis:{updateHex:function(t,e,n){t.updateHex(e,n)}},extraApis:{}})},gk=function(t,e){var n=nk.parts.spectrum({dom:{tag:"canvas",attributes:{role:"presentation"},classes:[e("sv-palette-spectrum")]}}),r=nk.parts.thumb({dom:{tag:"div",attributes:{role:"presentation"},classes:[e("sv-palette-thumb")],innerHtml:"<div class="+e("sv-palette-inner-thumb")+' role="presentation"></div>'}}),o=function(t,e){var n=t.width,r=t.height,o=t.getContext("2d");if(null!==o){o.fillStyle=e,o.fillRect(0,0,n,r);var i=o.createLinearGradient(0,0,n,0);i.addColorStop(0,"rgba(255,255,255,1)"),i.addColorStop(1,"rgba(255,255,255,0)"),o.fillStyle=i,o.fillRect(0,0,n,r);var u=o.createLinearGradient(0,0,0,r);u.addColorStop(0,"rgba(0,0,0,0)"),u.addColorStop(1,"rgba(0,0,0,1)"),o.fillStyle=u,o.fillRect(0,0,n,r)}};return ld({factory:function(t){var i=v({x:0,y:0}),u=uc([hd.config({find:R.some}),$g.config({})]);return nk.sketch({dom:{tag:"div",attributes:{role:"presentation"},classes:[e("sv-palette")]},model:{mode:"xy",getInitialValue:i},rounded:!1,components:[n,r],onChange:function(t,e,n){yi(t,ik,{value:n})},onInit:function(t,e,n,r){o(n.element.dom,Zy(tw))},sliderBehaviours:u})},name:"SaturationBrightnessPalette",configFields:[],apis:{setHue:function(t,e,n){!function(t,e){var n=t.components()[0].element.dom,r=nw(e,100,100),i=Xy(r);o(n,Zy(i))}(e,n)},setThumb:function(t,e,n){!function(t,e){var n=rw(Yy(e));nk.setValue(t,{x:n.saturation,y:100-n.value})}(e,n)}},extraApis:{}})},hk=function(t,e){return ld({name:"ColourPicker",configFields:[Ir("dom"),to("onValidHex",h),to("onInvalidHex",h)],factory:function(n){var r,o=mk(t,e,n.onValidHex,n.onInvalidHex),i=gk(0,e),u={paletteRgba:so(tw),paletteHue:so(0)},a=Xh(function(t,e){var n=nk.parts.spectrum({dom:{tag:"div",classes:[e("hue-slider-spectrum")],attributes:{role:"presentation"}}}),r=nk.parts.thumb({dom:{tag:"div",classes:[e("hue-slider-thumb")],attributes:{role:"presentation"}}});return nk.sketch({dom:{tag:"div",classes:[e("hue-slider")],attributes:{role:"presentation"}},rounded:!1,model:{mode:"y",getInitialValue:v({y:0})},components:[n,r],sliderBehaviours:uc([$g.config({})]),onChange:function(t,e,n){yi(t,ok,{value:n})}})}(0,e)),c=Xh(i.sketch({})),s=Xh(o.sketch({})),l=function(t,e,n){c.getOpt(t).each(function(t){i.setHue(t,n)})},f=function(t,e){s.getOpt(t).each(function(t){o.updateHex(t,e)})},d=function(t,e,n){a.getOpt(t).each(function(t){nk.setValue(t,{y:function(t){return 100-t/360*100}(n)})})},m=function(t,e){c.getOpt(t).each(function(t){i.setThumb(t,e)})},g=function(t,e,n,r){!function(t,e){var n=Yy(t);u.paletteRgba.set(n),u.paletteHue.set(e)}(e,n),q(r,function(r){r(t,e,n)})};return{uid:n.uid,dom:n.dom,components:[c.asSpec(),a.asSpec(),s.asSpec()],behaviours:uc([Vg("colour-picker-events",[_i(rk,(r=[l,d,m],function(t,e){var n=e.event.hex,o=function(t){return rw(Yy(t))}(n);g(t,n,o.hue,r)})),_i(ik,function(){var t=[f];return function(e,n){var r=n.event.value,o=u.paletteHue.get(),i=nw(o,r.x,100-r.y),a=ow(i);g(e,a,o,t)}}()),_i(ok,function(){var t=[l,f];return function(e,n){var r=function(t){return(100-t)/100*360}(n.event.value.y),o=u.paletteRgba.get(),i=rw(o),a=nw(r,i.saturation,i.value),c=ow(a);g(e,c,r,t)}}())]),hd.config({find:function(t){return s.getOpt(t)}}),Bg.config({mode:"acyclic"})])}}})},pk=function(){return hd.config({find:R.some})},vk=function(t){return hd.config({find:t.getOpt})},bk=function(t){return hd.config({find:function(e){return ye(e.element,t).bind(function(t){return e.getSystem().getByDom(t).toOptional()})}})},yk={"colorcustom.rgb.red.label":"R","colorcustom.rgb.red.description":"Red component","colorcustom.rgb.green.label":"G","colorcustom.rgb.green.description":"Green component","colorcustom.rgb.blue.label":"B","colorcustom.rgb.blue.description":"Blue component","colorcustom.rgb.hex.label":"#","colorcustom.rgb.hex.description":"Hex color code","colorcustom.rgb.range":"Range 0 to 255","colorcustom.sb.saturation":"Saturation","colorcustom.sb.brightness":"Brightness","colorcustom.sb.picker":"Saturation and Brightness Picker","colorcustom.sb.palette":"Saturation and Brightness Palette","colorcustom.sb.instructions":"Use arrow keys to select saturation and brightness, on x and y axes","colorcustom.hue.hue":"Hue","colorcustom.hue.slider":"Hue Slider","colorcustom.hue.palette":"Hue Palette","colorcustom.hue.instructions":"Use arrow keys to select a hue","aria.color.picker":"Color Picker","aria.input.invalid":"Invalid input"},wk=function(t){return function(t){return yk[t]}(t)},xk=tinymce.util.Tools.resolve("tinymce.Resource"),Ck=tinymce.util.Tools.resolve("tinymce.util.Tools"),Sk=gr([to("preprocess",b),to("postprocess",b)]),kk=function(t,e,n){return af.config(Jn({store:{mode:"manual",getValue:e,setValue:n}},t.map(function(t){return{store:{initialValue:t}}}).getOr({})))},Ok=function(t,e,n){return kk(t,function(t){return e(t.element)},function(t,e){return n(t.element,e)})},Tk=function(t,e){var n=zr("RepresentingConfigs.memento processors",Sk,e);return af.config({store:{mode:"manual",getValue:function(e){var r=t.get(e),o=af.getValue(r);return n.postprocess(o)},setValue:function(e,r){var o=n.preprocess(r),i=t.get(e);af.setValue(i,o)}}})},_k=kk,Ek=function(t){return Ok(t,Hi,Ii)},Dk=function(t){return af.config({store:{mode:"memory",initialValue:t}})},Ak=function(t,e){var n=function(t,e){e.stop()},r=function(t){return function(e,n){q(t,function(t){t(e,n)})}},o=function(t,e){if(!Dd.isDisabled(t)){var n=e.event.raw;u(t,n.dataTransfer.files)}},i=function(t,e){var n=e.event.raw.target;u(t,n.files)},u=function(n,r){af.setValue(n,function(t,e){var n=Ck.explode(e.getSetting("images_file_types","jpeg,jpg,jpe,jfi,jif,jfif,png,gif,bmp,webp","string"));return G(st(t),function(t){return V(n,function(e){return At(t.name.toLowerCase(),"."+e.toLowerCase())})})}(r,e)),yi(n,bx,{name:t.name})},a=Xh({dom:{tag:"input",attributes:{type:"file",accept:"image/*"},styles:{display:"none"}},behaviours:uc([Vg("input-file-events",[Mi(Fo()),Mi(Zo())])])}),c=t.label.map(function(t){return vx(t,e)}),s=sx.parts.field({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-dropzone-container"]},behaviours:uc([Dk([]),pk(),Dd.config({}),oh.config({toggleClass:"dragenter",toggleOnExecute:!1}),Vg("dropzone-events",[_i("dragenter",r([n,oh.toggle])),_i("dragleave",r([n,oh.toggle])),_i("dragover",n),_i("drop",r([n,o])),_i(Io(),i)])]),components:[{dom:{tag:"div",classes:["tox-dropzone"],styles:{}},components:[{dom:{tag:"p",innerHtml:e.translate("Drop an image here")}},Gh.sketch({dom:{tag:"button",innerHtml:e.translate("Browse for an image"),styles:{position:"relative"},classes:["tox-button","tox-button--secondary"]},components:[a.asSpec()],action:function(t){a.get(t).element.dom.click()},buttonBehaviours:uc([dx.config({}),ly(e.isDisabled),cy()])})]}]}}}});return gx(c,s,["tox-form__group--stretched"],[])},Nk=$i("alloy-fake-before-tabstop"),Mk=$i("alloy-fake-after-tabstop"),zk=function(t){return{dom:{tag:"div",styles:{width:"1px",height:"1px",outline:"none"},attributes:{tabindex:"0"},classes:t},behaviours:uc([$g.config({ignore:!0}),dx.config({})])}},Rk=function(t){return{dom:{tag:"div",classes:["tox-navobj"]},components:[zk([Nk]),t,zk([Mk])],behaviours:uc([bk(1)])}},Bk=function(t,e){yi(t,Lo(),{raw:{which:9,shiftKey:e}})},Lk=function(t,e){var n=e.element;_u(n,Nk)?Bk(t,!0):_u(n,Mk)&&Bk(t,!1)},Pk=function(t){return qw(t,["."+Nk,"."+Mk].join(","),S)},Hk=!(ue().browser.isIE()||ue().browser.isEdge()),Ik=function(t,e){var n=Hk&&t.sandboxed,r=T(T({},t.label.map(function(t){return{title:t}}).getOr({})),n?{sandbox:"allow-scripts allow-same-origin"}:{}),o=function(t){var e=so("");return{getValue:function(t){return e.get()},setValue:function(n,r){if(t)Re(n.element,"srcdoc",r);else{Re(n.element,"src","javascript:''");var o=n.element.dom.contentWindow.document;o.open(),o.write(r),o.close()}e.set(r)}}}(n),i=t.label.map(function(t){return vx(t,e)}),u=sx.parts.field({factory:{sketch:function(t){return Rk({uid:t.uid,dom:{tag:"iframe",attributes:r},behaviours:uc([dx.config({}),$g.config({}),_k(R.none(),o.getValue,o.setValue)])})}}});return gx(i,u,["tox-form__group--stretched"],[])},Fk=function(t,e){return jk(document.createElement("canvas"),t,e)},Vk=function(t){var e=Fk(t.width,t.height);return Uk(e).drawImage(t,0,0),e},Uk=function(t){return t.getContext("2d")},jk=function(t,e,n){return t.width=e,t.height=n,t},Wk=function(t){return t.naturalWidth||t.width},qk=function(t){return t.naturalHeight||t.height},$k=function(t){return new Bx(function(e,n){(function(t){var e=t.split(","),n=/data:([^;]+)/.exec(e[0]);if(!n)return R.none();for(var r=n[1],o=e[1],i=atob(o),u=i.length,a=Math.ceil(u/1024),c=new Array(a),s=0;s<a;++s){for(var l=1024*s,f=Math.min(l+1024,u),d=new Array(f-l),m=l,g=0;m<f;++g,++m)d[g]=i[m].charCodeAt(0);c[s]=new Uint8Array(d)}return R.some(new Blob(c,{type:r}))})(t).fold(function(){n("uri is not base64: "+t)},e)})},Gk=function(t,e,n){return e=e||"image/png",d(HTMLCanvasElement.prototype.toBlob)?new Bx(function(r,o){t.toBlob(function(t){t?r(t):o()},e,n)}):$k(t.toDataURL(e,n))},Kk=function(t){return function(t){return new Bx(function(e,n){var r=URL.createObjectURL(t),o=new Image,i=function(){o.removeEventListener("load",u),o.removeEventListener("error",a)},u=function(){i(),e(o)},a=function(){i(),n("Unable to load data of type "+t.type+": "+r)};o.addEventListener("load",u),o.addEventListener("error",a),o.src=r,o.complete&&setTimeout(u,0)})}(t).then(function(t){Xk(t);var e=Fk(Wk(t),qk(t));return Uk(e).drawImage(t,0,0),e})},Xk=function(t){URL.revokeObjectURL(t.src)},Yk=function(t,e,n){var r=e.type,o=function(e,n){return t.then(function(t){return function(t,e,n){return e=e||"image/png",t.toDataURL(e,n)}(t,e,n)})};return{getType:v(r),toBlob:function(){return Bx.resolve(e)},toDataURL:v(n),toBase64:function(){return n.split(",")[1]},toAdjustedBlob:function(e,n){return t.then(function(t){return Gk(t,e,n)})},toAdjustedDataURL:o,toAdjustedBase64:function(t,e){return o(t,e).then(function(t){return t.split(",")[1]})},toCanvas:function(){return t.then(Vk)}}},Jk=function(t){return function(t){return new Bx(function(e){var n=new FileReader;n.onloadend=function(){e(n.result)},n.readAsDataURL(t)})}(t).then(function(e){return Yk(Kk(t),t,e)})},Qk=function(t,e){return Gk(t,e).then(function(e){return Yk(Bx.resolve(t),e,t.toDataURL())})},Zk=function(t,e,n){var r="string"==typeof t?parseFloat(t):t;return r>n?r=n:r<e&&(r=e),r},tO=[0,.01,.02,.04,.05,.06,.07,.08,.1,.11,.12,.14,.15,.16,.17,.18,.2,.21,.22,.24,.25,.27,.28,.3,.32,.34,.36,.38,.4,.42,.44,.46,.48,.5,.53,.56,.59,.62,.65,.68,.71,.74,.77,.8,.83,.86,.89,.92,.95,.98,1,1.06,1.12,1.18,1.24,1.3,1.36,1.42,1.48,1.54,1.6,1.66,1.72,1.78,1.84,1.9,1.96,2,2.12,2.25,2.37,2.5,2.62,2.75,2.87,3,3.2,3.4,3.6,3.8,4,4.3,4.7,4.9,5,5.5,6,6.5,6.8,7,7.3,7.5,7.8,8,8.4,8.7,9,9.4,9.6,9.8,10],eO=function(t,e){for(var n,r=[],o=new Array(25),i=0;i<5;i++){for(var u=0;u<5;u++)r[u]=e[u+5*i];for(u=0;u<5;u++){n=0;for(var a=0;a<5;a++)n+=t[u+5*a]*r[a];o[u+5*i]=n}}return o},nO=function(t,e){return t.toCanvas().then(function(n){return rO(n,t.getType(),e)})},rO=function(t,e,n){var r=Uk(t),o=function(t,e){for(var n,r,o,i,u=t.data,a=e[0],c=e[1],s=e[2],l=e[3],f=e[4],d=e[5],m=e[6],g=e[7],h=e[8],p=e[9],v=e[10],b=e[11],y=e[12],w=e[13],x=e[14],C=e[15],S=e[16],k=e[17],O=e[18],T=e[19],_=0;_<u.length;_+=4)n=u[_],r=u[_+1],o=u[_+2],i=u[_+3],u[_]=n*a+r*c+o*s+i*l+f,u[_+1]=n*d+r*m+o*g+i*h+p,u[_+2]=n*v+r*b+o*y+i*w+x,u[_+3]=n*C+r*S+o*k+i*O+T;return t}(r.getImageData(0,0,t.width,t.height),n);return r.putImageData(o,0,0),Qk(t,e)},oO=function(t,e,n){var r=Uk(t),o=r.getImageData(0,0,t.width,t.height),i=r.getImageData(0,0,t.width,t.height);return i=function(t,e,n){for(var r=function(t,e,n){return t>n?t=n:t<e&&(t=e),t},o=Math.round(Math.sqrt(n.length)),i=Math.floor(o/2),u=t.data,a=e.data,c=t.width,s=t.height,l=0;l<s;l++)for(var f=0;f<c;f++){for(var d=0,m=0,g=0,h=0;h<o;h++)for(var p=0;p<o;p++){var v=r(f+p-i,0,c-1),b=4*(r(l+h-i,0,s-1)*c+v),y=n[h*o+p];d+=u[b]*y,m+=u[b+1]*y,g+=u[b+2]*y}var w=4*(l*c+f);a[w]=r(d,0,255),a[w+1]=r(m,0,255),a[w+2]=r(g,0,255)}return e}(o,i,n),r.putImageData(i,0,0),Qk(t,e)},iO=function(t){return function(e,n){return nO(e,t([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1],n))}},uO=function(t){return function(e){return nO(e,t)}}([-1,0,0,0,255,0,-1,0,0,255,0,0,-1,0,255,0,0,0,1,0,0,0,0,0,1]),aO=iO(function(t,e){return e=Zk(255*e,-255,255),eO(t,[1,0,0,0,e,0,1,0,0,e,0,0,1,0,e,0,0,0,1,0,0,0,0,0,1])}),cO=iO(function(t,e){var n;return e=Zk(e,-1,1),n=(e*=100)<0?127+e/100*127:127*(n=0==(n=e%1)?tO[e]:tO[Math.floor(e)]*(1-n)+tO[Math.floor(e)+1]*n)+127,eO(t,[n/127,0,0,0,.5*(127-n),0,n/127,0,0,.5*(127-n),0,0,n/127,0,.5*(127-n),0,0,0,1,0,0,0,0,0,1])}),sO=function(t,e,n,r){return nO(t,function(t,e,n,r){return e=Zk(e,0,2),n=Zk(n,0,2),r=Zk(r,0,2),eO(t,[e,0,0,0,0,0,n,0,0,0,0,0,r,0,0,0,0,0,1,0,0,0,0,0,1])}([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1],e,n,r))},lO=(rC=[0,-1,0,-1,5,-1,0,-1,0],function(t){return function(t,e){return t.toCanvas().then(function(n){return oO(n,t.getType(),e)})}(t,rC)}),fO=(oC=function(t,e){return 255*Math.pow(t/255,1-e)},function(t,e){return t.toCanvas().then(function(n){return function(t,e,n){for(var r=Uk(t),o=new Array(256),i=0;i<o.length;i++)o[i]=oC(i,n);var u=function(t,e){for(var n=t.data,r=0;r<n.length;r+=4)n[r]=e[n[r]],n[r+1]=e[n[r+1]],n[r+2]=e[n[r+2]];return t}(r.getImageData(0,0,t.width,t.height),o);return r.putImageData(u,0,0),Qk(t,e)}(n,t.getType(),e)})}),dO=function(t,e,n){var r=Wk(t),o=qk(t),i=e/r,u=n/o,a=!1;(i<.5||i>2)&&(i=i<.5?.5:2,a=!0),(u<.5||u>2)&&(u=u<.5?.5:2,a=!0);var c=mO(t,i,u);return a?c.then(function(t){return dO(t,e,n)}):c},mO=function(t,e,n){return new Bx(function(r){var o=Wk(t),i=qk(t),u=Math.floor(o*e),a=Math.floor(i*n),c=Fk(u,a);Uk(c).drawImage(t,0,0,o,i,0,0,u,a),r(c)})},gO=function(t,e){void 0===e&&(e=2);var n=Math.pow(10,e),r=Math.round(t*n);return Math.ceil(r/n)},hO=function(t,e,n){var r=(n<0?360+n:n)*Math.PI/180,o=t.width,i=t.height,u=Math.sin(r),a=Math.cos(r),c=gO(Math.abs(o*a)+Math.abs(i*u)),s=gO(Math.abs(o*u)+Math.abs(i*a)),l=Fk(c,s),f=Uk(l);return f.translate(c/2,s/2),f.rotate(r),f.drawImage(t,-o/2,-i/2),Qk(l,e)},pO=function(t,e,n){var r=Fk(t.width,t.height),o=Uk(r);return"v"===n?(o.scale(1,-1),o.drawImage(t,0,-r.height)):(o.scale(-1,1),o.drawImage(t,-r.width,0)),Qk(r,e)},vO=function(t,e,n,r,o,i){var u=Fk(o,i);return Uk(u).drawImage(t,-n,-r),Qk(u,e)},bO=function(t){return uO(t)},yO=function(t){return lO(t)},wO=function(t,e){return fO(t,e)},xO=function(t,e){return aO(t,e)},CO=function(t,e){return cO(t,e)},SO=function(t,e){return function(t,e){return t.toCanvas().then(function(n){return pO(n,t.getType(),e)})}(t,e)},kO=function(t,e,n,r,o){return function(t,e,n,r,o){return t.toCanvas().then(function(i){return vO(i,t.getType(),e,n,r,o)})}(t,e,n,r,o)},OO=function(t,e,n){return function(t,e,n){return t.toCanvas().then(function(r){return dO(r,e,n).then(function(e){return Qk(e,t.getType())})})}(t,e,n)},TO=function(t,e){return function(t,e){return t.toCanvas().then(function(n){return hO(n,t.getType(),e)})}(t,e)},_O=function(t,e,n){return ov(t,{tag:"span",classes:["tox-icon","tox-tbtn__icon-wrap"],behaviours:n},e)},EO=function(t,e){return _O(t,e,[])},DO=function(t,e){return _O(t,e,[Fg.config({})])},AO=function(t,e,n){return{dom:{tag:"span",innerHtml:n.translate(t),classes:[e+"__select-label"]},behaviours:uc([Fg.config({})])}},NO=$i("toolbar.button.execute"),MO=((iC={})[Jo()]=["disabling","alloy.base.behaviour","toggling","toolbar-button-events"],iC),zO=$i("update-menu-text"),RO=$i("update-menu-icon"),BO=function(t,e,n){var r=so(h),o=t.text.map(function(t){return Xh(AO(t,e,n.providers))}),i=t.icon.map(function(t){return Xh(DO(t,n.providers.icons))}),u=function(t,e){var n=af.getValue(t);return $g.focus(n),yi(n,"keydown",{raw:e.event.raw}),bC.close(n),R.some(!0)},a=t.role.fold(function(){return{}},function(t){return{role:t}}),c=t.tooltip.fold(function(){return{}},function(t){var e=n.providers.translate(t);return{title:e,"aria-label":e}}),s=ov("chevron-down",{tag:"div",classes:[e+"__select-chevron"]},n.providers.icons);return Xh(bC.sketch(T(T(T({},t.uid?{uid:t.uid}:{}),a),{dom:{tag:"button",classes:[e,e+"--select"].concat(W(t.classes,function(t){return e+"--"+t})),attributes:T({},c)},components:vy([i.map(function(t){return t.asSpec()}),o.map(function(t){return t.asSpec()}),R.some(s)]),matchWidth:!0,useMinWidth:!0,dropdownBehaviours:uc(E(E([],t.dropdownBehaviours,!0),[ly(function(){return t.disabled||n.providers.isDisabled()}),cy(),yC.config({}),Fg.config({}),Vg("dropdown-events",[gy(t,r),hy(t,r)]),Vg("menubutton-update-display-text",[_i(zO,function(t,e){o.bind(function(e){return e.getOpt(t)}).each(function(t){Fg.set(t,[Hu(n.providers.translate(e.event.text))])})}),_i(RO,function(t,e){i.bind(function(e){return e.getOpt(t)}).each(function(t){Fg.set(t,[DO(e.event.icon,n.providers.icons)])})})])],!1)),eventOrder:Jn(MO,{mousedown:["focusing","alloy.base.behaviour","item-type-events","normal-dropdown-events"]}),sandboxBehaviours:uc([Bg.config({mode:"special",onLeft:u,onRight:u})]),lazySink:n.getSink,toggleClass:e+"--active",parts:{menu:eb(0,t.columns,t.presets)},fetch:function(e){return Fx(w(t.fetch,e))}}))).asSpec()},LO=function(t){return"separator"===t.type},PO={type:"separator"},HO=function(t,e){var n=X(t,function(t,n){return function(t){return o(t)}(n)?""===n?t:"|"===n?t.length>0&&!LO(t[t.length-1])?t.concat([PO]):t:xt(e,n.toLowerCase())?t.concat([e[n.toLowerCase()]]):t:t.concat([n])},[]);return n.length>0&&LO(n[n.length-1])&&n.pop(),n},IO=function(t,e){return function(t){return xt(t,"getSubmenuItems")}(t)?function(t,e){var n=t.getSubmenuItems(),r=FO(n,e);return{item:t,menus:Jn(r.menus,go(t.value,r.items)),expansions:Jn(r.expansions,go(t.value,t.value))}}(t,e):{item:t,menus:{},expansions:{}}},FO=function(t,e){var n=HO(o(t)?t.split(" "):t,e);return K(n,function(t,n){var r=function(t){if(LO(t))return t;var e=wt(t,"value").getOrThunk(function(){return $i("generated-menu-item")});return Jn({value:e},t)}(n),o=IO(r,e);return{menus:Jn(t.menus,o.menus),items:[o.item].concat(t.items),expansions:Jn(t.expansions,o.expansions)}},{menus:{},expansions:{},items:[]})},VO=function(t,e,n,r){var o=$i("primary-menu"),i=FO(t,n.shared.providers.menuItems());if(0===i.items.length)return R.none();var u=Uw(o,i.items,e,n,r),a=gt(i.menus,function(t,r){return Uw(r,t,e,n,!1)}),c=Jn(a,go(o,u));return R.from(Th.tieredData(o,c,i.expansions))},UO=function(t){return{isDisabled:function(){return Dd.isDisabled(t)},setDisabled:function(e){return Dd.set(t,e)},setActive:function(e){var n=t.element;e?(ku(n,"tox-tbtn--enabled"),Re(n,"aria-pressed",!0)):(Tu(n,"tox-tbtn--enabled"),Ie(n,"aria-pressed"))},isActive:function(){return _u(t.element,"tox-tbtn--enabled")}}},jO=function(t,e,n,r){return BO({text:t.text,icon:t.icon,tooltip:t.tooltip,role:r,fetch:function(e,r){t.fetch(function(t){r(VO(t,$v.CLOSE_ON_EXECUTE,n,!1))})},onSetup:t.onSetup,getApi:UO,columns:1,presets:"normal",classes:[],dropdownBehaviours:[dx.config({})]},e,n.shared)},WO=function(t,e,n){return function(r){r(W(t,function(t){var r=t.text.fold(function(){return{}},function(t){return{text:t}});return T(T({type:t.type,active:!1},r),{onAction:function(t){return function(r){var o=!r.isActive();r.setActive(o),t.storage.set(o),n.shared.getSink().each(function(n){e().getOpt(n).each(function(e){hc(e.element),yi(e,xx,{name:t.name,value:t.storage.get()})})})}}(t),onSetup:function(t){return function(e){e.setActive(t.storage.get())}}(t)})}))}},qO=function(t,e,n,r,o,i){void 0===n&&(n=[]);var u=e.fold(function(){return{}},function(t){return{action:t}}),a=T({buttonBehaviours:uc([ly(function(){return t.disabled||i.isDisabled()}),cy(),dx.config({}),Vg("button press",[Ti("click"),Ti("mousedown")])].concat(n)),eventOrder:{click:["button press","alloy.base.behaviour"],mousedown:["button press","alloy.base.behaviour"]}},u),c=Jn(a,{dom:r});return Jn(c,{components:o})},$O=function(t,e,n,r){void 0===r&&(r=[]);var o={tag:"button",classes:["tox-tbtn"],attributes:t.tooltip.map(function(t){return{"aria-label":n.translate(t),title:n.translate(t)}}).getOr({})},i=t.icon.map(function(t){return EO(t,n.icons)}),u=vy([i]);return qO(t,e,r,o,u,n)},GO=function(t,e,n,r){void 0===r&&(r=[]);var o=$O(t,R.some(e),n,r);return Gh.sketch(o)},KO=function(t,e,n,r,o){void 0===r&&(r=[]),void 0===o&&(o=[]);var i=n.translate(t.text),u=t.icon?t.icon.map(function(t){return EO(t,n.icons)}):R.none(),a=u.isSome()?vy([u]):[],c=u.isSome()?{}:{innerHtml:i},s=E(E(E(E([],t.primary||t.borderless?["tox-button"]:["tox-button","tox-button--secondary"],!0),u.isSome()?["tox-button--icon"]:[],!0),t.borderless?["tox-button--naked"]:[],!0),o,!0),l=T(T({tag:"button",classes:s},c),{attributes:{title:i}});return qO(t,e,r,l,a,n)},XO=function(t,e,n,r,o){void 0===r&&(r=[]),void 0===o&&(o=[]);var i=KO(t,R.some(e),n,r,o);return Gh.sketch(i)},YO=function(t,e){return function(n){"custom"===e?yi(n,xx,{name:t,value:{}}):"submit"===e?bi(n,Cx):"cancel"===e?bi(n,wx):console.error("Unknown button type: ",e)}},JO=function(t,e,n){if(function(t,e){return"menu"===e}(0,e)){var r=t,o=T(T({},t),{onSetup:function(e){return e.setDisabled(t.disabled),h},fetch:WO(r.items,function(){return i},n)}),i=Xh(jO(o,"tox-tbtn",n,R.none()));return i.asSpec()}if(function(t,e){return"custom"===e||"cancel"===e||"submit"===e}(0,e)){var u=YO(t.name,e),a=T(T({},t),{borderless:!1});return XO(a,u,n.shared.providers,[])}console.error("Unknown footer button type: ",e)},QO=function(t,e){var n,r,o=YO(t.name,"custom");return n=R.none(),r=sx.parts.field(T({factory:Gh},KO(t,R.some(o),e,[Dk(""),pk()]))),gx(n,r,[],[])},ZO=v([to("field1Name","field1"),to("field2Name","field2"),ha("onLockedChange"),fa(["lockClass"]),to("locked",!1),ff("coupledFieldBehaviours",[hd,af])]),tT=function(t,e){return Lf({factory:sx,name:t,overrides:function(t){return{fieldBehaviours:uc([Vg("coupled-input-behaviour",[_i(Ho(),function(n){(function(t,e,n){return Yf(t,e,n).bind(hd.getCurrent)})(n,t,e).each(function(e){Yf(n,t,"lock").each(function(r){oh.isOn(r)&&t.onLockedChange(n,e,r)})})})])])}}})},eT=v([tT("field1","field2"),tT("field2","field1"),Lf({factory:Gh,schema:[Ir("dom")],name:"lock",overrides:function(t){return{buttonBehaviours:uc([oh.config({selected:t.locked,toggleClass:t.markers.lockClass,aria:{mode:"pressed"}})])}}})]),nT=fd({name:"FormCoupledInputs",configFields:ZO(),partFields:eT(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,behaviours:df(t.coupledFieldBehaviours,[hd.config({find:R.some}),af.config({store:{mode:"manual",getValue:function(e){var n,r=ed(e,t,["field1","field2"]);return(n={})[t.field1Name]=af.getValue(r.field1()),n[t.field2Name]=af.getValue(r.field2()),n},setValue:function(e,n){var r=ed(e,t,["field1","field2"]);Ct(n,t.field1Name)&&af.setValue(r.field1(),n[t.field1Name]),Ct(n,t.field2Name)&&af.setValue(r.field2(),n[t.field2Name])}}})]),apis:{getField1:function(e){return Yf(e,t,"field1")},getField2:function(e){return Yf(e,t,"field2")},getLock:function(e){return Yf(e,t,"lock")}}}},apis:{getField1:function(t,e){return t.getField1(e)},getField2:function(t,e){return t.getField2(e)},getLock:function(t,e){return t.getLock(e)}}}),rT=function(t){var e=/^\s*(\d+(?:\.\d+)?)\s*(|cm|mm|in|px|pt|pc|em|ex|ch|rem|vw|vh|vmin|vmax|%)\s*$/.exec(t);if(null!==e){var n=parseFloat(e[1]),r=e[2];return Rn.value({value:n,unit:r})}return Rn.error(t)},oT=function(t,e){var n={"":96,px:96,pt:72,cm:2.54,pc:12,mm:25.4,in:1},r=function(t){return xt(n,t)};return t.unit===e?R.some(t.value):r(t.unit)&&r(e)?n[t.unit]===n[e]?R.some(t.value):R.some(t.value/n[t.unit]*n[e]):R.none()},iT=function(t){return R.none()},uT=function(t,e){var n=rT(t).toOptional(),r=rT(e).toOptional();return Ot(n,r,function(t,e){return oT(t,e.unit).map(function(t){return e.value/t}).map(function(t){return n=t,r=e.unit,function(t){return oT(t,r).map(function(t){return{value:t*n,unit:r}})};var n,r}).getOr(iT)}).getOr(iT)},aT=function(t,e){var n=iT,r=$i("ratio-event"),o=function(t){return ov(t,{tag:"span",classes:["tox-icon","tox-lock-icon__"+t]},e.icons)},i=nT.parts.lock({dom:{tag:"button",classes:["tox-lock","tox-button","tox-button--naked","tox-button--icon"],attributes:{title:e.translate(t.label.getOr("Constrain proportions"))}},components:[o("lock"),o("unlock")],buttonBehaviours:uc([Dd.config({disabled:function(){return t.disabled||e.isDisabled()}}),cy(),dx.config({})])}),u=function(t){return{dom:{tag:"div",classes:["tox-form__group"]},components:t}},a=function(n){return sx.parts.field({factory:Nx,inputClasses:["tox-textfield"],inputBehaviours:uc([Dd.config({disabled:function(){return t.disabled||e.isDisabled()}}),cy(),dx.config({}),Vg("size-input-events",[_i(Ro(),function(t,e){yi(t,r,{isField1:n})}),_i(Io(),function(e,n){yi(e,bx,{name:t.name})})])]),selectOnFocus:!1})},c=function(t){return{dom:{tag:"label",classes:["tox-label"],innerHtml:e.translate(t)}}},s=nT.parts.field1(u([sx.parts.label(c("Width")),a(!0)])),l=nT.parts.field2(u([sx.parts.label(c("Height")),a(!1)]));return nT.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:[{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:[s,l,u([c(" "),i])]}],field1Name:"width",field2Name:"height",locked:!0,markers:{lockClass:"tox-locked"},onLockedChange:function(t,e,r){rT(af.getValue(t)).each(function(t){n(t).each(function(t){var n,r,o,i;af.setValue(e,(o={"":0,px:0,pt:1,mm:1,pc:2,ex:2,em:2,ch:2,rem:2,cm:3,in:4,"%":4},-1!==(i=(n=t).value.toFixed((r=n.unit)in o?o[r]:1)).indexOf(".")&&(i=i.replace(/\.?0*$/,"")),i+n.unit))})})},coupledFieldBehaviours:uc([Dd.config({disabled:function(){return t.disabled||e.isDisabled()},onDisabled:function(t){nT.getField1(t).bind(sx.getField).each(Dd.disable),nT.getField2(t).bind(sx.getField).each(Dd.disable),nT.getLock(t).each(Dd.disable)},onEnabled:function(t){nT.getField1(t).bind(sx.getField).each(Dd.enable),nT.getField2(t).bind(sx.getField).each(Dd.enable),nT.getLock(t).each(Dd.enable)}}),cy(),Vg("size-input-events2",[_i(r,function(t,e){var r=e.event.isField1,o=r?nT.getField1(t):nT.getField2(t),i=r?nT.getField2(t):nT.getField1(t),u=o.map(af.getValue).getOr(""),a=i.map(af.getValue).getOr("");n=uT(u,a)})])])})},cT={undo:v($i("undo")),redo:v($i("redo")),zoom:v($i("zoom")),back:v($i("back")),apply:v($i("apply")),swap:v($i("swap")),transform:v($i("transform")),tempTransform:v($i("temp-transform")),transformApply:v($i("transform-apply"))},sT=v("save-state"),lT=v("disable"),fT=v("enable"),dT={formActionEvent:xx,saveState:sT,disable:lT,enable:fT},mT=function(t,e){var n=function(t,n,r,o){return Xh(XO({name:t,text:t,disabled:r,primary:o,icon:R.none(),borderless:!1},n,e))},r=function(t,n,r,o){return Xh(GO({name:t,icon:R.some(t),tooltip:R.some(n),disabled:o,primary:!1,borderless:!1},r,e))},o=function(t,e){t.map(function(t){var n=t.get(e);n.hasConfigured(Dd)&&Dd.disable(n)})},i=function(t,e){t.map(function(t){var n=t.get(e);n.hasConfigured(Dd)&&Dd.enable(n)})},u={tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools-edit-panel"]},a=h,c=function(t,e,n){yi(t,e,n)},s=function(t){return bi(t,dT.disable())},l=function(t){return bi(t,dT.enable())},f=function(t,e){s(t),c(t,cT.transform(),{transform:e}),l(t)},d=function(t){return function(){tt.getOpt(t).each(function(t){Fg.set(t,[Q])})}},m=function(t,e){s(t),c(t,cT.transformApply(),{transform:e,swap:d(t)}),l(t)},g=function(){return n("Back",function(t){return c(t,cT.back(),{swap:d(t)})},!1,!1)},p=function(){return Xh({dom:{tag:"div",classes:["tox-spacer"]},behaviours:uc([Dd.config({})])})},b=function(){return n("Apply",function(t){return c(t,cT.apply(),{swap:d(t)})},!0,!0)},y=[g(),p(),n("Apply",function(e){m(e,function(e){var n=t.getRect();return kO(e,n.x,n.y,n.w,n.h)}),t.hideCrop()},!1,!0)],w=ix.sketch({dom:u,components:y.map(function(t){return t.asSpec()}),containerBehaviours:uc([Vg("image-tools-crop-buttons-events",[_i(dT.disable(),function(t,e){o(y,t)}),_i(dT.enable(),function(t,e){i(y,t)})])])}),x=Xh(aT({name:"size",label:R.none(),constrain:!0,disabled:!1},e)),C=[g(),p(),x,p(),n("Apply",function(t){x.getOpt(t).each(function(e){var n=af.getValue(e),r=function(t,e){return function(n){return OO(n,t,e)}}(parseInt(n.width,10),parseInt(n.height,10));m(t,r)})},!1,!0)],S=ix.sketch({dom:u,components:C.map(function(t){return t.asSpec()}),containerBehaviours:uc([Vg("image-tools-resize-buttons-events",[_i(dT.disable(),function(t,e){o(C,t)}),_i(dT.enable(),function(t,e){i(C,t)})])])}),k=function(t,e){return function(n){return t(n,e)}},O=k(SO,"h"),T=k(SO,"v"),_=k(TO,-90),E=k(TO,90),D=function(t,e){!function(t,e){s(t),c(t,cT.tempTransform(),{transform:e}),l(t)}(t,e)},A=[g(),p(),r("flip-horizontally","Flip horizontally",function(t){D(t,O)},!1),r("flip-vertically","Flip vertically",function(t){D(t,T)},!1),r("rotate-left","Rotate counterclockwise",function(t){D(t,_)},!1),r("rotate-right","Rotate clockwise",function(t){D(t,E)},!1),p(),b()],N=ix.sketch({dom:u,components:A.map(function(t){return t.asSpec()}),containerBehaviours:uc([Vg("image-tools-fliprotate-buttons-events",[_i(dT.disable(),function(t,e){o(A,t)}),_i(dT.enable(),function(t,e){i(A,t)})])])}),M=function(t,n,r,o,i){var u=nk.parts.label({dom:{tag:"label",classes:["tox-label"],innerHtml:e.translate(t)}}),a=nk.parts.spectrum({dom:{tag:"div",classes:["tox-slider__rail"],attributes:{role:"presentation"}}}),c=nk.parts.thumb({dom:{tag:"div",classes:["tox-slider__handle"],attributes:{role:"presentation"}}});return Xh(nk.sketch({dom:{tag:"div",classes:["tox-slider"],attributes:{role:"presentation"}},model:{mode:"x",minX:r,maxX:i,getInitialValue:v({x:o})},components:[u,a,c],sliderBehaviours:uc([$g.config({})]),onChoose:n}))},z=function(t,e,n,r,o){return[g(),function(t,e,n,r,o){return M(t,function(t,n,r){var o=k(e,r.x/100);f(t,o)},n,r,o)}(t,e,n,r,o),b()]},B=function(t,e,n,r,a){var c=z(t,e,n,r,a);return ix.sketch({dom:u,components:c.map(function(t){return t.asSpec()}),containerBehaviours:uc([Vg("image-tools-filter-panel-buttons-events",[_i(dT.disable(),function(t,e){o(c,t)}),_i(dT.enable(),function(t,e){i(c,t)})])])})},L=[g(),p(),b()],P=ix.sketch({dom:u,components:L.map(function(t){return t.asSpec()})}),H=B("Brightness",xO,-100,0,100),I=B("Contrast",CO,-100,0,100),F=B("Gamma",wO,-100,0,100),V=function(t,e,n){return function(r){return function(t,e,n,r){return sO(t,e,n,r)}(r,t,e,n)}},U=function(t){return M(t,function(t,e,n){var r=j.getOpt(t),o=q.getOpt(t),i=W.getOpt(t);r.each(function(e){o.each(function(n){i.each(function(r){var o=af.getValue(e).x/100,i=af.getValue(r).x/100,u=af.getValue(n).x/100,a=V(o,i,u);f(t,a)})})})},0,100,200)},j=U("R"),W=U("G"),q=U("B"),$=[g(),j,W,q,b()],G=ix.sketch({dom:u,components:$.map(function(t){return t.asSpec()})}),K=function(t,e,n){return function(r){c(r,cT.swap(),{transform:e,swap:function(){tt.getOpt(r).each(function(e){Fg.set(e,[t]),n(e)})}})}},X=R.some(yO),Y=R.some(bO),J=[r("crop","Crop",K(w,R.none(),function(e){t.showCrop()}),!1),r("resize","Resize",K(S,R.none(),function(e){x.getOpt(e).each(function(e){var n=t.getMeasurements(),r=n.width,o=n.height;af.setValue(e,{width:r,height:o})})}),!1),r("orientation","Orientation",K(N,R.none(),a),!1),r("brightness","Brightness",K(H,R.none(),a),!1),r("sharpen","Sharpen",K(P,X,a),!1),r("contrast","Contrast",K(I,R.none(),a),!1),r("color-levels","Color levels",K(G,R.none(),a),!1),r("gamma","Gamma",K(F,R.none(),a),!1),r("invert","Invert",K(P,Y,a),!1)],Q=ix.sketch({dom:u,components:J.map(function(t){return t.asSpec()})}),Z=ix.sketch({dom:{tag:"div"},components:[Q],containerBehaviours:uc([Fg.config({})])}),tt=Xh(Z);return{memContainer:tt,getApplyButton:function(t){return tt.getOpt(t).map(function(t){var e=t.components()[0];return e.components()[e.components().length-1]})}}},gT=tinymce.util.Tools.resolve("tinymce.geom.Rect"),hT=tinymce.util.Tools.resolve("tinymce.util.Observable"),pT=tinymce.util.Tools.resolve("tinymce.util.VK"),vT=function(t){var e=Math.max,n=t.documentElement,r=t.body,o=e(n.scrollWidth,r.scrollWidth),i=e(n.clientWidth,r.clientWidth),u=e(n.offsetWidth,r.offsetWidth),a=e(n.scrollHeight,r.scrollHeight),c=e(n.clientHeight,r.clientHeight),s=e(n.offsetHeight,r.offsetHeight);return{width:o<u?i:o,height:a<s?c:a}},bT=function(t){if(function(t){return f(t.changedTouches)}(t))for(var e="screenX screenY pageX pageY clientX clientY".split(" "),n=0;n<e.length;n++)t[e[n]]=t.changedTouches[0][e[n]]};var yT=0,wT=function(t,e,n,r,o){var i,u=[],a="tox-crid-"+yT++,c=Bt.fromDom(r),s=[{name:"move",xMul:0,yMul:0,deltaX:1,deltaY:1,deltaW:0,deltaH:0,label:"Crop Mask"},{name:"nw",xMul:0,yMul:0,deltaX:1,deltaY:1,deltaW:-1,deltaH:-1,label:"Top Left Crop Handle"},{name:"ne",xMul:1,yMul:0,deltaX:0,deltaY:1,deltaW:1,deltaH:-1,label:"Top Right Crop Handle"},{name:"sw",xMul:0,yMul:1,deltaX:1,deltaY:0,deltaW:-1,deltaH:1,label:"Bottom Left Crop Handle"},{name:"se",xMul:1,yMul:1,deltaX:0,deltaY:0,deltaW:1,deltaH:1,label:"Bottom Right Crop Handle"}],l=["top","right","bottom","left"],d=function(t,e){return{x:e.x-t.x,y:e.y-t.y,w:e.w,h:e.h}},m=function(e,r,o,i){var u=r.x+o*e.deltaX,a=r.y+i*e.deltaY,c=Math.max(20,r.w+o*e.deltaW),s=Math.max(20,r.h+i*e.deltaH),l=t=gT.clamp({x:u,y:a,w:c,h:s},n,"move"===e.name);l=d(n,l),v.fire("updateRect",{rect:l}),p(l)},g=function(t){var n=function(t,e){Yu(c,"#"+a+"-"+t).each(function(t){je(t,{left:e.x+"px",top:e.y+"px",width:Math.max(0,e.w)+"px",height:Math.max(0,e.h)+"px"})})};q(s,function(e){Yu(c,"#"+a+"-"+e.name).each(function(n){je(n,{left:t.w*e.xMul+t.x+"px",top:t.h*e.yMul+t.y+"px"})})}),n("top",{x:e.x,y:e.y,w:e.w,h:t.y-e.y}),n("right",{x:t.x+t.w,y:t.y,w:e.w-t.x-t.w+e.x,h:t.h}),n("bottom",{x:e.x,y:t.y+t.h,w:e.w,h:e.h-t.y-t.h+e.y}),n("left",{x:e.x,y:t.y,w:t.x-e.x,h:t.h}),n("move",t)},h=function(e){g(t=e)},p=function(t){var e,r;h((e=n,{x:(r=t).x+e.x,y:r.y+e.y,w:r.w,h:r.h}))};!function(){var e=Bt.fromTag("div");Be(e,{id:a,class:"tox-croprect-container",role:"grid","aria-dropeffect":"execute"}),pn(c,e),q(l,function(t){Yu(c,"#"+a).each(function(e){var n=Bt.fromTag("div");Be(n,{id:a+"-"+t,class:"tox-croprect-block","data-mce-bogus":"all"}),Ue(n,"display","none"),pn(e,n)})}),q(s,function(t){Yu(c,"#"+a).each(function(e){var n=Bt.fromTag("div");Be(n,{id:a+"-"+t.name,"aria-label":t.label,"aria-grabbed":"false","data-mce-bogus":"all",role:"gridcell",tabindex:"-1",title:t.label}),Eu(n,["tox-croprect-handle","tox-croprect-handle-"+t.name]),Ue(n,"display","none"),pn(e,n)})}),i=W(s,function(e){var n;return function(t,e){var n,r,o,i,u,a,c,s=[],l=[],d=null!==(n=e.document)&&void 0!==n?n:document,m=null!==(r=e.root)&&void 0!==r?r:d,g=Bt.fromDom(d),h=Bt.fromDom(m.getElementById(null!==(o=e.handle)&&void 0!==o?o:t)),p=function(t){var n=t.raw,r=vT(d);bT(n),t.prevent(),u=n.button,a=n.screenX,c=n.screenY;var o=qe(h,"cursor");i=Bt.fromTag("div",d),je(i,{position:"absolute",top:"0",left:"0",width:r.width+"px",height:r.height+"px","z-index":"2147483647",opacity:"0.0001",cursor:o}),pn(Me(g),i),l.push(Hc(g,"mousemove",v),Hc(g,"touchmove",v),Hc(g,"mouseup",b),Hc(g,"touchend",b)),e.start(n)},v=function(t){var n=t.raw;if(bT(n),n.button!==u)return b(t);n.deltaX=n.screenX-a,n.deltaY=n.screenY-c,t.prevent(),e.drag(n)},b=function(t){bT(t.raw),q(l,function(t){return t.unbind()}),l=[],yn(i),e.stop&&e.stop(t.raw)};return s.push(Hc(h,"mousedown",p),Hc(h,"touchstart",p)),{destroy:function(){q(l.concat(s),function(t){return t.unbind()}),l=[],s=[],f(i)&&yn(i)}}}(a,{document:r.ownerDocument,root:Oe(c).dom,handle:a+"-"+e.name,start:function(){n=t},drag:function(t){m(e,n,t.deltaX,t.deltaY)}})}),g(t);var n=function(t){Re(t.target,"aria-grabbed","focus"===t.raw.type?"true":"false")};u.push(Hc(c,"focusin",n),Hc(c,"focusout",n),Hc(c,"keydown",function(e){var n;q(s,function(t){if(Le(e.target,"id")===a+"-"+t.name)return n=t,!1});var r=function(t,e,r,o,i){t.stopPropagation(),t.preventDefault(),m(n,r,o,i)};switch(e.raw.keyCode){case pT.LEFT:r(e,0,t,-10,0);break;case pT.RIGHT:r(e,0,t,10,0);break;case pT.UP:r(e,0,t,0,-10);break;case pT.DOWN:r(e,0,t,0,10);break;case pT.ENTER:case pT.SPACEBAR:e.prevent(),o()}}))}();var v=T(T({},hT),{toggleVisibility:function(t){var e=E(E([],W(s,function(t){return"#"+a+"-"+t.name}),!0),W(l,function(t){return"#"+a+"-"+t}),!0).join(","),n=Us(c,e);q(n,t?function(t){return Xe(t,"display")}:function(t){return Ue(t,"display","none")})},setClampRect:function(e){n=e,g(t)},setRect:h,getInnerRect:function(){return d(n,t)},setInnerRect:p,setViewPortRect:function(n){e=n,g(t)},destroy:function(){q(i,function(t){return t.destroy()}),i=[],q(u,function(t){return t.unbind()}),u=[]}});return v},xT=function(t){var e,n=Xh({dom:{tag:"div",classes:["tox-image-tools__image-bg"],attributes:{role:"presentation"}}}),r=so(1),o=(e=Rc(),T(T({},e),{run:function(t){return e.get().each(t)}})),i=so({x:0,y:0,w:1,h:1}),u=so({x:0,y:0,w:1,h:1}),a=function(t,e){l.getOpt(t).each(function(t){var u=r.get(),a=cn(t.element),c=Ze(t.element),s=e.dom.naturalWidth*u,l=e.dom.naturalHeight*u,f=Math.max(0,a/2-s/2),d=Math.max(0,c/2-l/2),m={left:f.toString()+"px",top:d.toString()+"px",width:s.toString()+"px",height:l.toString()+"px",position:"absolute"};je(e,m),n.getOpt(t).each(function(t){je(t.element,m)}),o.run(function(t){var e=i.get();t.setRect({x:e.x*u+f,y:e.y*u+d,w:e.w*u,h:e.h*u}),t.setClampRect({x:f,y:d,w:s,h:l}),t.setViewPortRect({x:0,y:0,w:a,h:c})})})},c=function(t,e){var n,o=Bt.fromTag("img");return Re(o,"src",e),(n=o.dom,new wv(function(t){var e=function(){n.removeEventListener("load",e),t(n)};n.complete?t(n):n.addEventListener("load",e)})).then(function(){t.getSystem().isConnected()&&l.getOpt(t).map(function(t){var e=Iu({element:o});Fg.replaceAt(t,1,R.some(e));var n=u.get(),c={x:0,y:0,w:o.dom.naturalWidth,h:o.dom.naturalHeight};u.set(c);var s=gT.inflate(c,-20,-20);i.set(s),n.w===c.w&&n.h===c.h||function(t,e){l.getOpt(t).each(function(t){var n=cn(t.element),o=Ze(t.element),i=e.dom.naturalWidth,u=e.dom.naturalHeight,a=Math.min(n/i,o/u);a>=1?r.set(1):r.set(a)})}(t,o),a(t,o)})})},s=ix.sketch({dom:{tag:"div",classes:["tox-image-tools__image"]},components:[n.asSpec(),{dom:{tag:"img",attributes:{src:t}}},{dom:{tag:"div"},behaviours:uc([Vg("image-panel-crop-events",[Ri(function(t){l.getOpt(t).each(function(t){var e=t.element.dom,n=wT({x:10,y:10,w:100,h:100},{x:0,y:0,w:200,h:200},{x:0,y:0,w:200,h:200},e,h);n.toggleVisibility(!1),n.on("updateRect",function(t){var e=t.rect,n=r.get(),o={x:Math.round(e.x/n),y:Math.round(e.y/n),w:Math.round(e.w/n),h:Math.round(e.h/n)};i.set(o)}),o.set(n)})}),Bi(function(){o.clear()})])])}],containerBehaviours:uc([Fg.config({}),Vg("image-panel-events",[Ri(function(e){c(e,t)})])])}),l=Xh(s);return{memContainer:l,updateSrc:c,zoom:function(t,e){var n=r.get(),o=e>0?Math.min(2,n+.1):Math.max(.1,n-.1);r.set(o),l.getOpt(t).each(function(t){var e=t.components()[1].element;a(t,e)})},showCrop:function(){o.run(function(t){t.toggleVisibility(!0)})},hideCrop:function(){o.run(function(t){t.toggleVisibility(!1)})},getRect:function(){return i.get()},getMeasurements:function(){var t=u.get();return{width:t.w,height:t.h}}}},CT=function(t,e,n,r,o){return GO({name:t,icon:R.some(e),disabled:n,tooltip:R.some(t),primary:!1,borderless:!1},r,o)},ST=function(t,e){e?Dd.enable(t):Dd.disable(t)};var kT,OT=function(t){var e,n,r,o,i=so(t),u=Lc(),a=(n=-1,{data:e=[],add:function(t){var r=e.splice(++n);return e.push(t),{state:t,removed:r}},undo:function(){if(r())return e[--n]},redo:function(){if(o())return e[++n]},canUndo:r=function(){return n>0},canRedo:o=function(){return-1!==n&&n<e.length-1}});a.add(t);var c=function(t){i.set(t)},s=function(t){return{blob:t,url:URL.createObjectURL(t)}},l=function(t){URL.revokeObjectURL(t.url)},f=function(){u.on(l),u.clear()},d=function(t){var e=s(t);c(e);var n,r=a.add(e).removed;return n=r,Ck.each(n,l),e.url};return{getBlobState:function(){return i.get()},setBlobState:c,addBlobState:d,getTempState:function(){return u.get().getOrThunk(i.get)},updateTempState:function(t){var e=s(t);return f(),u.set(e),e.url},addTempState:function(t){var e=s(t);return u.set(e),e.url},applyTempState:function(t){return u.get().fold(h,function(e){d(e.blob),t()})},destroyTempState:f,undo:function(){var t=a.undo();return c(t),t.url},redo:function(){var t=a.redo();return c(t),t.url},getHistoryStates:function(){return{undoEnabled:a.canUndo(),redoEnabled:a.canRedo()}}}},TT=function(t,e){var n=OT(t.currentState),r=function(t){var e=n.getHistoryStates();d.updateButtonUndoStates(t,e.undoEnabled,e.redoEnabled),yi(t,dT.formActionEvent,{name:dT.saveState(),value:e.undoEnabled})},o=function(t){return t.toBlob()},i=function(t){yi(t,dT.formActionEvent,{name:dT.disable(),value:{}})},u=function(t){m.getApplyButton(t).each(function(t){Dd.enable(t)}),yi(t,dT.formActionEvent,{name:dT.enable(),value:{}})},a=function(t,e){return i(t),f.updateSrc(t,e)},c=function(t,e,n,c,s){i(t),function(t){return Jk(t)}(e).then(n).then(o).then(c).then(function(e){return a(t,e)}).then(function(){r(t),s(),u(t)}).catch(function(e){console.log(e),t.getSystem().isConnected()&&u(t)})},s=function(t,e,r){var o=n.getBlobState().blob;c(t,o,e,function(t){return n.updateTempState(t)},r)},l=function(t){var e=n.getBlobState().url;return n.destroyTempState(),r(t),e},f=xT(t.currentState.url),d=function(t){var e=Xh(CT("Undo","undo",!0,function(t){yi(t,cT.undo(),{direction:1})},t)),n=Xh(CT("Redo","redo",!0,function(t){yi(t,cT.redo(),{direction:1})},t));return{container:ix.sketch({dom:{tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools__sidebar"]},components:[e.asSpec(),n.asSpec(),CT("Zoom in","zoom-in",!1,function(t){yi(t,cT.zoom(),{direction:1})},t),CT("Zoom out","zoom-out",!1,function(t){yi(t,cT.zoom(),{direction:-1})},t)]}),updateButtonUndoStates:function(t,r,o){e.getOpt(t).each(function(t){ST(t,r)}),n.getOpt(t).each(function(t){ST(t,o)})}}}(e),m=mT(f,e);return{dom:{tag:"div",attributes:{role:"presentation"}},components:[m.memContainer.asSpec(),f.memContainer.asSpec(),d.container],behaviours:uc([af.config({store:{mode:"manual",getValue:function(){return n.getBlobState()}}}),Vg("image-tools-events",[_i(cT.undo(),function(t,e){var o=n.undo();a(t,o).then(function(e){u(t),r(t)})}),_i(cT.redo(),function(t,e){var o=n.redo();a(t,o).then(function(e){u(t),r(t)})}),_i(cT.zoom(),function(t,e){var n=e.event.direction;f.zoom(t,n)}),_i(cT.back(),function(t,e){!function(t){var e=l(t);a(t,e).then(function(e){u(t)})}(t),(0,e.event.swap)(),f.hideCrop()}),_i(cT.apply(),function(t,e){n.applyTempState(function(){l(t),(0,e.event.swap)()})}),_i(cT.transform(),function(t,e){return s(t,e.event.transform,h)}),_i(cT.tempTransform(),function(t,e){return function(t,e){var r=n.getTempState().blob;c(t,r,e,function(t){return n.addTempState(t)},h)}(t,e.event.transform)}),_i(cT.transformApply(),function(t,e){return function(t,e,r){var o=n.getBlobState().blob;c(t,o,e,function(e){var r=n.addBlobState(e);return l(t),r},r)}(t,e.event.transform,e.event.swap)}),_i(cT.swap(),function(t,e){!function(t){d.updateButtonUndoStates(t,!1,!1)}(t);var n=e.event.transform,r=e.event.swap;n.fold(function(){r()},function(e){s(t,e,r)})})]),pk()])}},_T=function(t){return!xt(t,"items")},ET=function(t,e,n,r){return W(n,function(n){return _T(n)?{type:"togglemenuitem",text:n.text,value:n.value,active:n.value===r,onAction:function(){af.setValue(t,n.value),yi(t,bx,{name:e}),$g.focus(t)}}:{type:"nestedmenuitem",text:n.text,getSubmenuItems:function(){return ET(t,e,n.items,r)}}})},DT=function(t,e){return lt(t,function(t){return _T(t)?Tt(t.value===e,t):DT(t.items,e)})},AT=ld({name:"HtmlSelect",configFields:[Ir("options"),cf("selectBehaviours",[$g,af]),to("selectClasses",[]),to("selectAttributes",{}),Gr("data")],factory:function(t,e){var n=W(t.options,function(t){return{dom:{tag:"option",value:t.value,innerHtml:t.text}}}),r=t.data.map(function(t){return go("initialValue",t)}).getOr({});return{uid:t.uid,dom:{tag:"select",classes:t.selectClasses,attributes:t.selectAttributes},components:n,behaviours:lf(t.selectBehaviours,[$g.config({}),af.config({store:T({mode:"manual",getValue:function(t){return Au(t.element)},setValue:function(e,n){Y(t.options,function(t){return t.value===n}).isSome()&&Nu(e.element,n)}},r)})])}}}),NT=function(t,e){var n=t.label.map(function(t){return vx(t,e)}),r=[Dd.config({disabled:function(){return t.disabled||e.isDisabled()}}),cy(),Bg.config({mode:"execution",useEnter:!0!==t.multiline,useControlEnter:!0===t.multiline,execute:function(t){return bi(t,Cx),R.some(!0)}}),Vg("textfield-change",[_i(Ho(),function(e,n){yi(e,bx,{name:t.name})}),_i(Xo(),function(e,n){yi(e,bx,{name:t.name})})]),dx.config({})],o=t.validation.map(function(t){return Jx.config({getRoot:function(t){return pe(t.element)},invalidClass:"tox-invalid",validator:{validate:function(e){var n=af.getValue(e),r=t.validator(n);return Vx(!0===r?Rn.value(n):Rn.error(r))},validateOnLoad:t.validateOnLoad}})}).toArray(),i=t.placeholder.fold(v({}),function(t){return{placeholder:e.translate(t)}}),u=t.inputMode.fold(v({}),function(t){return{inputmode:t}}),a=T(T({},i),u),c=sx.parts.field({tag:!0===t.multiline?"textarea":"input",inputAttributes:a,inputClasses:[t.classname],inputBehaviours:uc(Q([r,o])),selectOnFocus:!1,factory:Nx}),s=(t.flex?["tox-form__group--stretched"]:[]).concat(t.maximized?["tox-form-group--maximize"]:[]),l=[Dd.config({disabled:function(){return t.disabled||e.isDisabled()},onDisabled:function(t){sx.getField(t).each(Dd.disable)},onEnabled:function(t){sx.getField(t).each(Dd.enable)}}),cy()];return gx(n,c,s,l)},MT=Object.freeze({__proto__:null,events:function(t,e){var n=t.stream.streams.setup(t,e);return ki([_i(t.event,n),Bi(function(){return e.cancel()})].concat(t.cancelEvent.map(function(t){return[_i(t,function(){return e.cancel()})]}).getOr([])))}}),zT=function(t){var e=so(null);return su({readState:function(){return{timer:null!==e.get()?"set":"unset"}},setTimer:function(t){e.set(t)},cancel:function(){var t=e.get();null!==t&&t.cancel()}})},RT=Object.freeze({__proto__:null,throttle:zT,init:function(t){return t.stream.streams.state(t)}}),BT=[Fr("stream",Br("mode",{throttle:[Ir("delay"),to("stopEvent",!0),va("streams",{setup:function(t,e){var n=t.stream,r=sv(t.onStream,n.delay);return e.setTimer(r),function(t,e){r.throttle(t,e),n.stopEvent&&e.stop()}},state:zT})]})),to("event","input"),Gr("cancelEvent"),ha("onStream")],LT=cc({fields:BT,name:"streaming",active:MT,state:RT}),PT=function(t,e,n){var r=af.getValue(n);af.setValue(e,r),IT(e)},HT=function(t,e){var n=t.element,r=Au(n),o=n.dom;"number"!==Le(n,"type")&&e(o,r)},IT=function(t){HT(t,function(t,e){return t.setSelectionRange(e.length,e.length)})},FT=function(t,e,n){if(t.selectsOver){var r=af.getValue(e),o=t.getDisplayText(r),i=af.getValue(n);return 0===t.getDisplayText(i).indexOf(o)?R.some(function(){PT(0,e,n),function(t,e){HT(t,function(t,n){return t.setSelectionRange(e,n.length)})}(e,o.length)}):R.none()}return R.none()},VT=v("alloy.typeahead.itemexecute"),UT=v([Gr("lazySink"),Ir("fetch"),to("minChars",5),to("responseTime",1e3),ma("onOpen"),to("getHotspot",R.some),to("getAnchorOverrides",v({})),to("layouts",R.none()),to("eventOrder",{}),co("model",{},[to("getDisplayText",function(t){return void 0!==t.meta&&void 0!==t.meta.text?t.meta.text:t.value}),to("selectsOver",!0),to("populateFromBrowse",!0)]),ma("onSetValue"),ga("onExecute"),ma("onItemExecute"),to("inputClasses",[]),to("inputAttributes",{}),to("inputStyles",{}),to("matchWidth",!0),to("useMinWidth",!1),to("dismissOnBlur",!0),fa(["openClass"]),Gr("initialData"),cf("typeaheadBehaviours",[$g,af,LT,Bg,oh,tC]),Pr("previewing",function(){return so(!0)})].concat(Ex()).concat(hC())),jT=v([Pf({schema:[la()],name:"menu",overrides:function(t){return{fakeFocus:!0,onHighlight:function(e,n){t.previewing.get()?e.getSystem().getByUid(t.uid).each(function(r){FT(t.model,r,n).fold(function(){return Fd.dehighlight(e,n)},function(t){return t()})}):e.getSystem().getByUid(t.uid).each(function(e){t.model.populateFromBrowse&&PT(t.model,e,n)}),t.previewing.set(!1)},onExecute:function(e,n){return e.getSystem().getByUid(t.uid).toOptional().map(function(t){return yi(t,VT(),{item:n}),!0})},onHover:function(e,n){t.previewing.set(!1),e.getSystem().getByUid(t.uid).each(function(e){t.model.populateFromBrowse&&PT(t.model,e,n)})}}}})]),WT=fd({name:"Typeahead",configFields:UT(),partFields:jT(),factory:function(t,e,n,r){var o=function(e,n,o){t.previewing.set(!1);var i=tC.getCoupled(e,"sandbox");Fl.isOpen(i)?hd.getCurrent(i).each(function(t){Fd.getHighlighted(t).fold(function(){o(t)},function(){Si(i,t.element,"keydown",n)})}):aC(t,u(e),e,i,r,function(t){hd.getCurrent(t).each(o)},Rx.HighlightFirst).get(h)},i=Dx(t),u=function(t){return function(e){return e.map(function(e){var n=yt(e.menus),r=Z(n,function(t){return G(t.items,function(t){return"item"===t.type})});return af.getState(t).update(W(r,function(t){return t.data})),e})}},a=[$g.config({}),af.config({onSetValue:t.onSetValue,store:T({mode:"dataset",getDataKey:function(t){return Au(t.element)},getFallbackEntry:function(t){return{value:t,meta:{}}},setValue:function(e,n){Nu(e.element,t.model.getDisplayText(n))}},t.initialData.map(function(t){return go("initialValue",t)}).getOr({}))}),LT.config({stream:{mode:"throttle",delay:t.responseTime,stopEvent:!1},onStream:function(e,n){var o=tC.getCoupled(e,"sandbox");if($g.isFocused(e)&&Au(e.element).length>=t.minChars){var i=hd.getCurrent(o).bind(function(t){return Fd.getHighlighted(t).map(af.getValue)});t.previewing.set(!0),aC(t,u(e),e,o,r,function(e){hd.getCurrent(o).each(function(e){i.fold(function(){t.model.selectsOver&&Fd.highlightFirst(e)},function(t){Fd.highlightBy(e,function(e){return af.getValue(e).value===t.value}),Fd.getHighlighted(e).orThunk(function(){return Fd.highlightFirst(e),R.none()})})})},Rx.HighlightFirst).get(h)}},cancelEvent:ni()}),Bg.config({mode:"special",onDown:function(t,e){return o(t,e,Fd.highlightFirst),R.some(!0)},onEscape:function(t){var e=tC.getCoupled(t,"sandbox");return Fl.isOpen(e)?(Fl.close(e),R.some(!0)):R.none()},onUp:function(t,e){return o(t,e,Fd.highlightLast),R.some(!0)},onEnter:function(e){var n=tC.getCoupled(e,"sandbox"),r=Fl.isOpen(n);if(r&&!t.previewing.get())return hd.getCurrent(n).bind(function(t){return Fd.getHighlighted(t)}).map(function(t){return yi(e,VT(),{item:t}),!0});var o=af.getValue(e);return bi(e,ni()),t.onExecute(n,e,o),r&&Fl.close(n),R.some(!0)}}),oh.config({toggleClass:t.markers.openClass,aria:{mode:"expanded"}}),tC.config({others:{sandbox:function(e){return mC(t,e,{onOpen:function(){return oh.on(e)},onClose:function(){return oh.off(e)}})}}}),Vg("typeaheadevents",[Pi(function(e){var n=h;sC(t,u(e),e,r,n,Rx.HighlightFirst).get(h)}),_i(VT(),function(e,n){var r=tC.getCoupled(e,"sandbox");PT(t.model,e,n.event.item),bi(e,ni()),t.onItemExecute(e,r,n.event.item,af.getValue(e)),Fl.close(r),IT(e)})].concat(t.dismissOnBlur?[_i(Ko(),function(t){var e=tC.getCoupled(t,"sandbox");bc(e.element).isNone()&&Fl.close(e)})]:[]))];return{uid:t.uid,dom:Ax(Jn(t,{inputAttributes:{role:"combobox","aria-autocomplete":"list","aria-haspopup":"true"}})),behaviours:T(T({},i),lf(t.typeaheadBehaviours,a)),eventOrder:t.eventOrder}}}),qT=function(t){return T(T({},t),{toCached:function(){return qT(t.toCached())},bindFuture:function(e){return qT(t.bind(function(t){return t.fold(function(t){return Vx(Rn.error(t))},function(t){return e(t)})}))},bindResult:function(e){return qT(t.map(function(t){return t.bind(e)}))},mapResult:function(e){return qT(t.map(function(t){return t.map(e)}))},mapError:function(e){return qT(t.map(function(t){return t.mapError(e)}))},foldResult:function(e,n){return t.map(function(t){return t.fold(e,n)})},withTimeout:function(e,n){return qT(Fx(function(r){var o=!1,i=setTimeout(function(){o=!0,r(Rn.error(n()))},e);t.get(function(t){o||(clearTimeout(i),r(t))})}))}})},$T=function(t){return qT(Fx(t))},GT=$T,KT={type:"separator"},XT=function(t){return{type:"menuitem",value:t.url,text:t.title,meta:{attach:t.attach},onAction:h}},YT=function(t,e){return{type:"menuitem",value:e,text:t,meta:{attach:void 0},onAction:h}},JT=function(t,e){return function(t){return W(t,XT)}(function(t,e){return G(e,function(e){return e.type===t})}(t,e))},QT=function(t,e){var n=t.toLowerCase();return G(e,function(t){var e=void 0!==t.meta&&void 0!==t.meta.text?t.meta.text:t.text;return Et(e.toLowerCase(),n)||Et(t.value.toLowerCase(),n)})},ZT=function(t,e,n){var r=af.getValue(e),o=void 0!==r.meta.text?r.meta.text:r.value;return n.getLinkInformation().fold(function(){return[]},function(e){var r,i=QT(o,function(t){return W(t,function(t){return YT(t,t)})}(n.getHistory(t)));return"file"===t?(r=[i,QT(o,function(t){return JT("header",t.targets)}(e)),QT(o,Q([function(t){return R.from(t.anchorTop).map(function(t){return YT("<top>",t)}).toArray()}(e),function(t){return JT("anchor",t.targets)}(e),function(t){return R.from(t.anchorBottom).map(function(t){return YT("<bottom>",t)}).toArray()}(e)]))],X(r,function(t,e){return 0===t.length||0===e.length?t.concat(e):t.concat(KT,e)},[])):i})},t_=$i("aria-invalid"),e_=function(t,e,n){var r,o,i,u,a,c=e.shared.providers,s=function(e){var r=af.getValue(e);n.addToHistory(r.value,t.filetype)},l=sx.parts.field({factory:WT,dismissOnBlur:!0,inputClasses:["tox-textfield"],sandboxClasses:["tox-dialog__popups"],inputAttributes:{"aria-errormessage":t_,type:"url"},minChars:0,responseTime:0,fetch:function(r){var o=ZT(t.filetype,r,n),i=VO(o,$v.BUBBLE_TO_SANDBOX,e,!1);return Vx(i)},getHotspot:function(t){return v.getOpt(t)},onSetValue:function(t,e){t.hasConfigured(Jx)&&Jx.run(t).get(h)},typeaheadBehaviours:uc(Q([n.getValidationHandler().map(function(e){return Jx.config({getRoot:function(t){return pe(t.element)},invalidClass:"tox-control-wrap--status-invalid",notify:{onInvalid:function(t,e){d.getOpt(t).each(function(t){Re(t.element,"title",c.translate(e))})}},validator:{validate:function(n){var r=af.getValue(n);return GT(function(n){e({type:t.filetype,url:r.value},function(t){if("invalid"===t.status){var e=Rn.error(t.message);n(e)}else{var r=Rn.value(t.message);n(r)}})})},validateOnLoad:!1}})}).toArray(),[Dd.config({disabled:function(){return t.disabled||c.isDisabled()}}),dx.config({}),Vg("urlinput-events",Q(["file"===t.filetype?[_i(Ho(),function(e){yi(e,bx,{name:t.name})})]:[],[_i(Io(),function(e){yi(e,bx,{name:t.name}),s(e)}),_i(Xo(),function(e){yi(e,bx,{name:t.name}),s(e)})]]))]])),eventOrder:(r={},r[Ho()]=["streaming","urlinput-events","invalidating"],r),model:{getDisplayText:function(t){return t.value},selectsOver:!1,populateFromBrowse:!1},markers:{openClass:"tox-textfield--popup-open"},lazySink:e.shared.getSink,parts:{menu:eb(0,0,"normal")},onExecute:function(t,e,n){yi(e,Cx,{})},onItemExecute:function(e,n,r,o){s(e),yi(e,bx,{name:t.name})}}),f=t.label.map(function(t){return vx(t,c)}),d=Xh((o="invalid",i=R.some(t_),void 0===(u="warning")&&(u=o),void 0===a&&(a=o),ov(u,{tag:"div",classes:["tox-icon","tox-control-wrap__status-icon-"+o],attributes:T({title:c.translate(a),"aria-live":"polite"},i.fold(function(){return{}},function(t){return{id:t}}))},c.icons))),m=Xh({dom:{tag:"div",classes:["tox-control-wrap__status-icon-wrap"]},components:[d.asSpec()]}),g=n.getUrlPicker(t.filetype),p=$i("browser.url.event"),v=Xh({dom:{tag:"div",classes:["tox-control-wrap"]},components:[l,m.asSpec()],behaviours:uc([Dd.config({disabled:function(){return t.disabled||c.isDisabled()}})])}),b=Xh(XO({name:t.name,icon:R.some("browse"),text:t.label.getOr(""),disabled:t.disabled,primary:!1,borderless:!0},function(t){return bi(t,p)},c,[],["tox-browse-url"]));return sx.sketch({dom:px([]),components:f.toArray().concat([{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:Q([[v.asSpec()],g.map(function(){return b.asSpec()}).toArray()])}]),fieldBehaviours:uc([Dd.config({disabled:function(){return t.disabled||c.isDisabled()},onDisabled:function(t){sx.getField(t).each(Dd.disable),b.getOpt(t).each(Dd.disable)},onEnabled:function(t){sx.getField(t).each(Dd.enable),b.getOpt(t).each(Dd.enable)}}),cy(),Vg("url-input-events",[_i(p,function(e){hd.getCurrent(e).each(function(n){var r=af.getValue(n),o=T({fieldname:t.name},r);g.each(function(r){r(o).get(function(r){af.setValue(n,r),yi(e,bx,{name:t.name})})})})})])])})},n_=function(t){return function(e,n,r){return wt(n,"name").fold(function(){return t(n,r)},function(o){return e.field(o,t(n,r))})}},r_={bar:n_(function(t,e){return function(t,e){return{dom:{tag:"div",classes:["tox-bar","tox-form__controls-h-stack"]},components:W(t.items,e.interpreter)}}(t,e.shared)}),collection:n_(function(t,e){return _x(t,e.shared.providers)}),alertbanner:n_(function(t,e){return function(t,e){return ix.sketch({dom:{tag:"div",attributes:{role:"alert"},classes:["tox-notification","tox-notification--in","tox-notification--"+t.level]},components:[{dom:{tag:"div",classes:["tox-notification__icon"]},components:[Gh.sketch({dom:{tag:"button",classes:["tox-button","tox-button--naked","tox-button--icon"],innerHtml:ev(t.icon,e.icons),attributes:{title:e.translate(t.iconTooltip)}},action:function(e){yi(e,xx,{name:"alert-banner",value:t.url})},buttonBehaviours:uc([nv()])})]},{dom:{tag:"div",classes:["tox-notification__body"],innerHtml:e.translate(t.text)}}]})}(t,e.shared.providers)}),input:n_(function(t,e){return function(t,e){return NT({name:t.name,multiline:!1,label:t.label,inputMode:t.inputMode,placeholder:t.placeholder,flex:!1,disabled:t.disabled,classname:"tox-textfield",validation:R.none(),maximized:t.maximized},e)}(t,e.shared.providers)}),textarea:n_(function(t,e){return function(t,e){return NT({name:t.name,multiline:!0,label:t.label,inputMode:R.none(),placeholder:t.placeholder,flex:!0,disabled:t.disabled,classname:"tox-textarea",validation:R.none(),maximized:t.maximized},e)}(t,e.shared.providers)}),label:n_(function(t,e){return function(t,e){var n={dom:{tag:"label",innerHtml:e.providers.translate(t.label),classes:["tox-label"]}},r=W(t.items,e.interpreter);return{dom:{tag:"div",classes:["tox-form__group"]},components:[n].concat(r),behaviours:uc([pk(),Fg.config({}),Ek(R.none()),Bg.config({mode:"acyclic"})])}}(t,e.shared)}),iframe:function(t){return function(e,n,r){var o=Jn(n,{source:"dynamic"});return n_(t)(e,o,r)}}(function(t,e){return Ik(t,e.shared.providers)}),button:n_(function(t,e){return QO(t,e.shared.providers)}),checkbox:n_(function(t,e){return function(t,e){var n=af.config({store:{mode:"manual",getValue:function(t){return t.element.dom.checked},setValue:function(t,e){t.element.dom.checked=e}}}),r=function(t){return t.element.dom.click(),R.some(!0)},o=sx.parts.field({factory:{sketch:b},dom:{tag:"input",classes:["tox-checkbox__input"],attributes:{type:"checkbox"}},behaviours:uc([pk(),Dd.config({disabled:function(){return t.disabled||e.isDisabled()}}),dx.config({}),$g.config({}),n,Bg.config({mode:"special",onEnter:r,onSpace:r,stopSpaceKeyup:!0}),Vg("checkbox-events",[_i(Io(),function(e,n){yi(e,bx,{name:t.name})})])])}),i=sx.parts.label({dom:{tag:"span",classes:["tox-checkbox__label"],innerHtml:e.translate(t.label)},behaviours:uc([yC.config({})])}),u=function(t){return ov("checked"===t?"selected":"unselected",{tag:"span",classes:["tox-icon","tox-checkbox-icon__"+t]},e.icons)},a=Xh({dom:{tag:"div",classes:["tox-checkbox__icons"]},components:[u("checked"),u("unchecked")]});return sx.sketch({dom:{tag:"label",classes:["tox-checkbox"]},components:[o,a.asSpec(),i],fieldBehaviours:uc([Dd.config({disabled:function(){return t.disabled||e.isDisabled()},disableClass:"tox-checkbox--disabled",onDisabled:function(t){sx.getField(t).each(Dd.disable)},onEnabled:function(t){sx.getField(t).each(Dd.enable)}}),cy()])})}(t,e.shared.providers)}),colorinput:n_(function(t,e){return SC(t,e.shared,e.colorinput)}),colorpicker:n_(function(t){var e=function(t){return"tox-"+t},n=hk(wk,e),r=Xh(n.sketch({dom:{tag:"div",classes:[e("color-picker-container")],attributes:{role:"presentation"}},onValidHex:function(t){yi(t,xx,{name:"hex-valid",value:!0})},onInvalidHex:function(t){yi(t,xx,{name:"hex-valid",value:!1})}}));return{dom:{tag:"div"},components:[r.asSpec()],behaviours:uc([af.config({store:{mode:"manual",getValue:function(t){var e=r.get(t);return hd.getCurrent(e).bind(function(t){return af.getValue(t).hex}).map(function(t){return"#"+t}).getOr("")},setValue:function(t,e){var n=/^#([a-fA-F0-9]{3}(?:[a-fA-F0-9]{3})?)/.exec(e),o=r.get(t);hd.getCurrent(o).fold(function(){console.log("Can not find form")},function(t){af.setValue(t,{hex:R.from(n[1]).getOr("")}),sk.getField(t,"hex").each(function(t){bi(t,Ho())})})}}}),pk()])}}),dropzone:n_(function(t,e){return Ak(t,e.shared.providers)}),grid:n_(function(t,e){return function(t,e){return{dom:{tag:"div",classes:["tox-form__grid","tox-form__grid--"+t.columns+"col"]},components:W(t.items,e.interpreter)}}(t,e.shared)}),listbox:n_(function(t,e){return function(t,e){var n=e.shared.providers,r=at(t.items).filter(_T),o=t.label.map(function(t){return vx(t,n)}),i={dom:{tag:"div",classes:["tox-listboxfield"]},components:[sx.parts.field({dom:{},factory:{sketch:function(n){return BO({uid:n.uid,text:r.map(function(t){return t.text}),icon:R.none(),tooltip:t.label,role:R.none(),fetch:function(n,r){var o=ET(n,t.name,t.items,af.getValue(n));r(VO(o,$v.CLOSE_ON_EXECUTE,e,!1))},onSetup:v(h),getApi:v({}),columns:1,presets:"normal",classes:[],dropdownBehaviours:[dx.config({}),af.config({store:{mode:"manual",initialValue:r.map(function(t){return t.value}).getOr(""),getValue:function(t){return Le(t.element,"data-value")},setValue:function(e,n){DT(t.items,n).each(function(t){Re(e.element,"data-value",t.value),yi(e,zO,{text:t.text})})}}})]},"tox-listbox",e.shared)}}})]};return sx.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:Q([o.toArray(),[i]]),fieldBehaviours:uc([Dd.config({disabled:v(t.disabled),onDisabled:function(t){sx.getField(t).each(Dd.disable)},onEnabled:function(t){sx.getField(t).each(Dd.enable)}})])})}(t,e)}),selectbox:n_(function(t,e){return function(t,e){var n=W(t.items,function(t){return{text:e.translate(t.text),value:t.value}}),r=t.label.map(function(t){return vx(t,e)}),o=sx.parts.field({dom:{},selectAttributes:{size:t.size},options:n,factory:AT,selectBehaviours:uc([Dd.config({disabled:function(){return t.disabled||e.isDisabled()}}),dx.config({}),Vg("selectbox-change",[_i(Io(),function(e,n){yi(e,bx,{name:t.name})})])])}),i=t.size>1?R.none():R.some(ov("chevron-down",{tag:"div",classes:["tox-selectfield__icon-js"]},e.icons)),u={dom:{tag:"div",classes:["tox-selectfield"]},components:Q([[o],i.toArray()])};return sx.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:Q([r.toArray(),[u]]),fieldBehaviours:uc([Dd.config({disabled:function(){return t.disabled||e.isDisabled()},onDisabled:function(t){sx.getField(t).each(Dd.disable)},onEnabled:function(t){sx.getField(t).each(Dd.enable)}}),cy()])})}(t,e.shared.providers)}),sizeinput:n_(function(t,e){return aT(t,e.shared.providers)}),urlinput:n_(function(t,e){return e_(t,e,e.urlinput)}),customeditor:n_(function(t){var e=Lc(),n=Xh({dom:{tag:t.tag}}),r=Lc();return{dom:{tag:"div",classes:["tox-custom-editor"]},behaviours:uc([Vg("custom-editor-events",[Ri(function(o){n.getOpt(o).each(function(n){(!function(t){return xt(t,"init")}(t)?xk.load(t.scriptId,t.scriptUrl).then(function(e){return e(n.element.dom,t.settings)}):t.init(n.element.dom)).then(function(t){r.on(function(e){t.setValue(e)}),r.clear(),e.set(t)})})})]),af.config({store:{mode:"manual",getValue:function(){return e.get().fold(function(){return r.get().getOr("")},function(t){return t.getValue()})},setValue:function(t,n){e.get().fold(function(){r.set(n)},function(t){return t.setValue(n)})}}}),pk()]),components:[n.asSpec()]}}),htmlpanel:n_(function(t){return"presentation"===t.presets?ix.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:t.html}}):ix.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:t.html,attributes:{role:"document"}},containerBehaviours:uc([dx.config({}),$g.config({})])})}),imagetools:n_(function(t,e){return TT(t,e.shared.providers)}),table:n_(function(t,e){return function(t,e){var n,r,o=function(t){return{dom:{tag:"th",innerHtml:e.translate(t)}}},i=function(t){return{dom:{tag:"td",innerHtml:e.translate(t)}}},u=function(t){return{dom:{tag:"tr"},components:W(t,i)}};return{dom:{tag:"table",classes:["tox-dialog__table"]},components:[(r=t.header,{dom:{tag:"thead"},components:[{dom:{tag:"tr"},components:W(r,o)}]}),(n=t.cells,{dom:{tag:"tbody"},components:W(n,u)})],behaviours:uc([dx.config({}),$g.config({})])}}(t,e.shared.providers)}),panel:n_(function(t,e){return function(t,e){return{dom:{tag:"div",classes:t.classes},components:W(t.items,e.shared.interpreter)}}(t,e)})},o_={field:function(t,e){return e}},i_=function(t,e,n){var r=Jn(n,{shared:{interpreter:function(e){return u_(t,e,r)}}});return u_(t,e,r)},u_=function(t,e,n){return wt(r_,e.type).fold(function(){return console.error('Unknown factory type "'+e.type+'", defaulting to container: ',e),e},function(r){return r(t,e,n)})},a_={valignCentre:[],alignCentre:[],alignLeft:[],alignRight:[],right:[],left:[],bottom:[],top:[]},c_=function(t,e,n){var r={maxHeightFunction:Jc()};return function(){return n()?{type:"node",root:Te(t()),node:R.from(t()),bubble:ns(12,12,a_),layouts:{onRtl:function(){return[Ph]},onLtr:function(){return[Lh]}},overrides:r}:{type:"hotspot",hotspot:e(),bubble:ns(-12,12,a_),layouts:{onRtl:function(){return[Ia]},onLtr:function(){return[Fa]}},overrides:r}}},s_=function(t,e,n){return function(){return n()?{type:"node",root:Te(t()),node:R.from(t()),layouts:{onRtl:function(){return[Hh]},onLtr:function(){return[Hh]}}}:{type:"hotspot",hotspot:e(),layouts:{onRtl:function(){return[Wa]},onLtr:function(){return[Wa]}}}}},l_=function(t,e,n){var r=ey(t),o=function(){return Bt.fromDom(t.getBody())},i=function(){return Bt.fromDom(t.getContentAreaContainer())},u=function(){return r||!n()};return{inlineDialog:c_(i,e,u),banner:s_(i,e,u),cursor:function(t,e){return function(){return{type:"selection",root:e(),getSelection:function(){var e=t.selection.getRng();return R.some(Es.range(Bt.fromDom(e.startContainer),e.startOffset,Bt.fromDom(e.endContainer),e.endOffset))}}}}(t,o),node:function(t){return function(e){return{type:"node",root:t(),node:e}}}(o)}},f_=function(t){return{colorPicker:function(t){return function(e,n){Sw(t)(e,n)}}(t),hasCustomColors:function(t){return function(){return dw(t)}}(t),getColors:function(t){return function(){return mw(t)}}(t),getColorCols:function(t){return function(){return hw(t)}}(t)}},d_=[{title:"Headings",items:[{title:"Heading 1",format:"h1"},{title:"Heading 2",format:"h2"},{title:"Heading 3",format:"h3"},{title:"Heading 4",format:"h4"},{title:"Heading 5",format:"h5"},{title:"Heading 6",format:"h6"}]},{title:"Inline",items:[{title:"Bold",format:"bold"},{title:"Italic",format:"italic"},{title:"Underline",format:"underline"},{title:"Strikethrough",format:"strikethrough"},{title:"Superscript",format:"superscript"},{title:"Subscript",format:"subscript"},{title:"Code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Align",items:[{title:"Left",format:"alignleft"},{title:"Center",format:"aligncenter"},{title:"Right",format:"alignright"},{title:"Justify",format:"alignjustify"}]}],m_=function(t){return X(t,function(t,e){if(xt(e,"items")){var n=m_(e.items);return{customFormats:t.customFormats.concat(n.customFormats),formats:t.formats.concat([{title:e.title,items:n.formats}])}}if(function(t){return xt(t,"inline")}(e)||function(t){return xt(t,"block")}(e)||function(t){return xt(t,"selector")}(e)){var r="custom-"+(o(e.name)?e.name:e.title.toLowerCase());return{customFormats:t.customFormats.concat([{name:r,format:e}]),formats:t.formats.concat([{title:e.title,format:r,icon:e.icon}])}}return T(T({},t),{formats:t.formats.concat(e)})},{customFormats:[],formats:[]})},g_=function(t){return function(t){return R.from(t.getParam("style_formats")).filter(u)}(t).map(function(e){var n=function(t,e){var n=m_(e),r=function(e){q(e,function(e){t.formatter.has(e.name)||t.formatter.register(e.name,e.format)})};return t.formatter?r(n.customFormats):t.on("init",function(){r(n.customFormats)}),n.formats}(t,e);return function(t){return t.getParam("style_formats_merge",!1,"boolean")}(t)?d_.concat(n):n}).getOr(d_)},h_=function(t,e,n){var r={type:"formatter",isSelected:e(t.format),getStylePreview:n(t.format)};return Jn(t,r)},p_=function(t,e,n,r){var i=function(e){return W(e,function(e){var u=ft(e);if(Ct(e,"items")){var a=i(e.items);return Jn(function(t){return Jn(t,{type:"submenu"})}(e),{getStyleItems:v(a)})}return Ct(e,"format")?function(t){return h_(t,n,r)}(e):1===u.length&&F(u,"title")?Jn(e,{type:"separator"}):function(e){var i=o(e.name)?e.name:$i(e.title),u="custom-"+i,a={type:"formatter",format:u,isSelected:n(u),getStylePreview:r(u)},c=Jn(e,a);return t.formatter.register(i,c),c}(e)})};return i(e)},v_=Ck.trim,b_=function(t){return function(e){if(function(t){return f(t)&&1===t.nodeType}(e)){if(e.contentEditable===t)return!0;if(e.getAttribute("data-mce-contenteditable")===t)return!0}return!1}},y_=b_("true"),w_=b_("false"),x_=function(t,e,n,r,o){return{type:t,title:e,url:n,level:r,attach:o}},C_=function(t){return t.innerText||t.textContent},S_=function(t){return function(t){return t&&"A"===t.nodeName&&void 0!==(t.id||t.name)}(t)&&O_(t)},k_=function(t){return t&&/^(H[1-6])$/.test(t.nodeName)},O_=function(t){return function(t){for(;t=t.parentNode;){var e=t.contentEditable;if(e&&"inherit"!==e)return y_(t)}return!1}(t)&&!w_(t)},T_=function(t){return k_(t)&&O_(t)},__=function(t){var e=function(t){return t.id?t.id:$i("h")}(t);return x_("header",C_(t),"#"+e,function(t){return k_(t)?parseInt(t.nodeName.substr(1),10):0}(t),function(){t.id=e})},E_=function(t){var e=t.id||t.name,n=C_(t);return x_("anchor",n||"#"+e,"#"+e,0,h)},D_=function(t){var e,n;return e="h1,h2,h3,h4,h5,h6,a:not([href])",n=t,W(Us(Bt.fromDom(n),e),function(t){return t.dom})},A_=function(t){return v_(t.title).length>0},N_=function(t){var e=D_(t);return G(function(t){return W(G(t,T_),__)}(e).concat(function(t){return W(G(t,S_),E_)}(e)),A_)},M_="tinymce-url-history",z_=function(t){return o(t)&&/^https?/.test(t)},R_=function(t){return i(t)&&bt(t,function(t){return!(u(e=t)&&e.length<=5&&tt(e,z_));var e}).isNone()},B_=function(){var t,e=uw.getItem(M_);if(null===e)return{};try{t=JSON.parse(e)}catch(t){if(t instanceof SyntaxError)return console.log("Local storage "+M_+" was not valid JSON",t),{};throw t}return R_(t)?t:(console.log("Local storage "+M_+" was not valid format",t),{})},L_=function(t){var e=B_();return wt(e,t).getOr([])},P_=function(t,e){if(z_(t)){var n=B_(),r=wt(n,e).getOr([]),o=G(r,function(e){return e!==t});n[e]=[t].concat(o).slice(0,5),function(t){if(!R_(t))throw new Error("Bad format for history:\n"+JSON.stringify(t));uw.setItem(M_,JSON.stringify(t))}(n)}},H_=function(t){return!!t},I_=function(t){return gt(Ck.makeMap(t,/[, ]/),H_)},F_=function(t){return R.from(function(t){return t.getParam("file_picker_callback")}(t)).filter(d)},V_=function(t,e){var n=function(t){var e=R.some(function(t){return t.getParam("file_picker_types")}(t)).filter(H_),n=R.some(function(t){return t.getParam("file_browser_callback_types")}(t)).filter(H_),r=e.or(n).map(I_);return F_(t).fold(S,function(t){return r.fold(k,function(t){return ft(t).length>0&&t})})}(t);return c(n)?n?F_(t):R.none():n[e]?F_(t):R.none()},U_=function(t){return R.from(t).filter(o).getOrUndefined()},j_=function(t){return{getHistory:L_,addToHistory:P_,getLinkInformation:function(){return function(t){return function(t){return!1===t.getParam("typeahead_urls")}(t)?R.none():R.some({targets:N_(t.getBody()),anchorTop:U_(function(t){return t.getParam("anchor_top","#top")}(t)),anchorBottom:U_(function(t){return t.getParam("anchor_bottom","#bottom")}(t))})}(t)},getValidationHandler:function(){return function(t){return R.from(function(t){var e=t.getParam("file_picker_validator_handler",void 0,"function");return void 0===e?t.getParam("filepicker_validator_handler",void 0,"function"):e}(t))}(t)},getUrlPicker:function(e){return function(t,e){return V_(t,e).map(function(n){return function(r){return Fx(function(u){var a=T({filetype:e,fieldname:r.fieldname},R.from(r.meta).getOr({}));n.call(t,function(t,e){if(!o(t))throw new Error("Expected value to be string");if(void 0!==e&&!i(e))throw new Error("Expected meta to be a object");u({value:t,meta:e})},r.value,a)})}})}(t,e)}}},W_=function(t,e,n){var r=so(!1),o=function(t){var e=so(Zb(t)?"bottom":"top");return{isPositionedAtTop:function(){return"top"===e.get()},getDockingMode:e.get,setDockingMode:e.set}}(e),i={shared:{providers:{icons:function(){return e.ui.registry.getAll().icons},menuItems:function(){return e.ui.registry.getAll().menuItems},translate:Yp.translate,isDisabled:function(){return e.mode.isReadOnly()||e.ui.isDisabled()},getSetting:e.getParam.bind(e)},interpreter:function(t){return function(t,e){return u_(o_,t,e)}(t,i)},anchors:l_(e,n,o.isPositionedAtTop),header:o,getSink:function(){return Rn.value(t)}},urlinput:j_(e),styleselect:function(t){var e=function(e){return function(){return t.formatter.match(e)}},n=function(e){return function(){var n=t.formatter.get(e);return void 0!==n?R.some({tag:n.length>0&&(n[0].inline||n[0].block)||"div",styles:t.dom.parseStyle(t.formatter.getCssText(e))}):R.none()}},r=function(t){var e=t.items;return void 0!==e&&e.length>0?Z(e,r):[t.format]},o=so([]),i=so([]),u=so([]),a=so([]),c=so(!1);t.on("PreInit",function(u){var a=g_(t),c=p_(t,a,e,n);o.set(c),i.set(Z(c,r))}),t.on("addStyleModifications",function(o){var i=p_(t,o.items,e,n);u.set(i),c.set(o.replace),a.set(Z(i,r))});return{getData:function(){var t=c.get()?[]:o.get(),e=u.get();return t.concat(e)},getFlattenedKeys:function(){var t=c.get()?[]:i.get(),e=a.get();return t.concat(e)}}}(e),colorinput:f_(e),dialog:function(t){return{isDraggableModal:function(t){return function(){return function(t){return t.getParam("draggable_modal",!1,"boolean")}(t)}}(t)}}(e),isContextMenuOpen:function(){return r.get()},setContextMenuState:function(t){return r.set(t)}};return i},q_=od,$_=Vf,G_=v([to("shell",!1),Ir("makeItem"),to("setupItem",h),ff("listBehaviours",[Fg])]),K_=Hf({name:"items",overrides:function(){return{behaviours:uc([Fg.config({})])}}}),X_=v([K_]),Y_=fd({name:v("CustomList")(),configFields:G_(),partFields:X_(),factory:function(t,e,n,r){var o=t.shell?{behaviours:[Fg.config({})],components:[]}:{behaviours:[],components:e},i=function(e){return t.shell?R.some(e):Yf(e,t,"items")};return{uid:t.uid,dom:t.dom,components:o.components,behaviours:lf(t.listBehaviours,o.behaviours),apis:{setItems:function(e,n){i(e).fold(function(){throw console.error("Custom List was defined to not be a shell, but no item container was specified in components"),new Error("Custom List was defined to not be a shell, but no item container was specified in components")},function(r){var o=Fg.contents(r),i=n.length,u=i-o.length,a=u>0?U(u,function(){return t.makeItem()}):[],c=o.slice(i);q(c,function(t){return Fg.remove(r,t)}),q(a,function(t){return Fg.append(r,t)});var s=Fg.contents(r);q(s,function(r,o){t.setupItem(e,r,n[o],o)})})}}}},apis:{setItems:function(t,e,n){t.setItems(e,n)}}}),J_=v([Ir("dom"),to("shell",!0),cf("toolbarBehaviours",[Fg])]),Q_=v([Hf({name:"groups",overrides:function(){return{behaviours:uc([Fg.config({})])}}})]),Z_=fd({name:"Toolbar",configFields:J_(),partFields:Q_(),factory:function(t,e,n,r){var o=function(e){return t.shell?R.some(e):Yf(e,t,"groups")},i=t.shell?{behaviours:[Fg.config({})],components:[]}:{behaviours:[],components:e};return{uid:t.uid,dom:t.dom,components:i.components,behaviours:lf(t.toolbarBehaviours,i.behaviours),apis:{setGroups:function(t,e){o(t).fold(function(){throw console.error("Toolbar was defined to not be a shell, but no groups container was specified in components"),new Error("Toolbar was defined to not be a shell, but no groups container was specified in components")},function(t){Fg.set(t,e)})}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,e,n){t.setGroups(e,n)}}}),tE=h,eE=S,nE=v([]),rE=Object.freeze({__proto__:null,setup:tE,isDocked:eE,getBehaviours:nE}),oE=function(t){return(St(Ge(t,"position"),"fixed")?R.none():ve(t)).orThunk(function(){var e=Bt.fromTag("span");return pe(t).bind(function(t){pn(t,e);var n=ve(e);return yn(e),n})})},iE=function(t){return oE(t).map(on).getOrThunk(function(){return nn(0,0)})},uE=lo([{static:[]},{absolute:["positionCss"]},{fixed:["positionCss"]}]),aE=function(t,e){var n=t.element;ku(n,e.transitionClass),Tu(n,e.fadeOutClass),ku(n,e.fadeInClass),e.onShow(t)},cE=function(t,e){var n=t.element;ku(n,e.transitionClass),Tu(n,e.fadeInClass),ku(n,e.fadeOutClass),e.onHide(t)},sE=function(t,e,n){return tt(t,function(t){switch(t){case"bottom":return function(t,e){return t.bottom<=e.bottom}(e,n);case"top":return function(t,e){return t.y>=e.y}(e,n)}})},lE=function(t,e){return e.getInitialPos().map(function(e){return En(e.bounds.x,e.bounds.y,cn(t),Ze(t))})},fE=function(t,e,n){n.setInitialPos({style:function(t){var e={},n=t.dom;if(zt(n))for(var r=0;r<n.style.length;r++){var o=n.style.item(r);e[o]=n.style[o]}return e}(t),position:qe(t,"position")||"static",bounds:e})},dE=function(t,e,n){return n.getInitialPos().bind(function(r){switch(n.clearInitialPos(),r.position){case"static":return R.some(uE.static());case"absolute":var o=oE(t).map(Dn).getOrThunk(function(){return Dn(Ne())});return R.some(uE.absolute(wc("absolute",wt(r.style,"left").map(function(t){return e.x-o.x}),wt(r.style,"top").map(function(t){return e.y-o.y}),wt(r.style,"right").map(function(t){return o.right-e.right}),wt(r.style,"bottom").map(function(t){return o.bottom-e.bottom}))));default:return R.none()}})},mE=function(t,e,n){var r=t.element;return St(Ge(r,"position"),"fixed")?function(t,e,n){return lE(t,n).filter(function(t){return sE(n.getModes(),t,e)}).bind(function(e){return dE(t,e,n)})}(r,e,n):function(t,e,n){var r=Dn(t);if(sE(n.getModes(),r,e))return R.none();fE(t,r,n);var o=Nn(),i=r.x-o.x,u=e.y-o.y,a=o.bottom-e.bottom,c=r.y<=e.y;return R.some(uE.fixed(wc("fixed",R.some(i),c?R.some(u):R.none(),R.none(),c?R.none():R.some(a))))}(r,e,n)},gE=function(t,e,n){n.setDocked(!1),q(["left","right","top","bottom","position"],function(e){return Xe(t.element,e)}),e.onUndocked(t)},hE=function(t,e,n,r){var o="fixed"===r.position;n.setDocked(o),xc(t.element,r),(o?e.onDocked:e.onUndocked)(t)},pE=function(t,e,n,r,o){void 0===o&&(o=!1),e.contextual.each(function(e){e.lazyContext(t).each(function(i){var u=function(t,e){return t.y<e.bottom&&t.bottom>e.y}(i,r);u!==n.isVisible()&&(n.setVisible(u),o&&!u?(Eu(t.element,[e.fadeOutClass]),e.onHide(t)):(u?aE:cE)(t,e))})})},vE=function(t,e,n){var r=t.element;n.setDocked(!1),function(t,e){var n=t.element;return lE(n,e).bind(function(t){return dE(n,t,e)})}(t,n).each(function(r){r.fold(function(){return gE(t,e,n)},function(r){return hE(t,e,n,r)},h)}),n.setVisible(!0),e.contextual.each(function(e){Du(r,[e.fadeInClass,e.fadeOutClass,e.transitionClass]),e.onShow(t)}),bE(t,e,n)},bE=function(t,e,n){t.getSystem().isConnected()&&function(t,e,n){var r=e.lazyViewport(t);n.isDocked()&&pE(t,e,n,r),mE(t,r,n).each(function(o){o.fold(function(){return gE(t,e,n)},function(r){return hE(t,e,n,r)},function(o){pE(t,e,n,r,!0),hE(t,e,n,o)})})}(t,e,n)},yE=function(t,e,n){n.isDocked()&&vE(t,e,n)},wE=Object.freeze({__proto__:null,refresh:bE,reset:yE,isDocked:function(t,e,n){return n.isDocked()},getModes:function(t,e,n){return n.getModes()},setModes:function(t,e,n,r){return n.setModes(r)}}),xE=Object.freeze({__proto__:null,events:function(t,e){return ki([zi(Uo(),function(n,r){t.contextual.each(function(t){_u(n.element,t.transitionClass)&&(Du(n.element,[t.transitionClass,t.fadeInClass]),(e.isVisible()?t.onShown:t.onHidden)(n)),r.stop()})}),_i(ui(),function(n,r){bE(n,t,e)}),_i(ai(),function(n,r){yE(n,t,e)})])}}),CE=[Zr("contextual",[Vr("fadeInClass"),Vr("fadeOutClass"),Vr("transitionClass"),jr("lazyContext"),ma("onShow"),ma("onShown"),ma("onHide"),ma("onHidden")]),uo("lazyViewport",Nn),ao("modes",["top","bottom"],Cr),ma("onDocked"),ma("onUndocked")],SE=cc({fields:CE,name:"docking",active:xE,apis:wE,state:Object.freeze({__proto__:null,init:function(t){var e=so(!1),n=so(!0),r=Lc(),o=so(t.modes);return su({isDocked:e.get,setDocked:e.set,getInitialPos:r.get,setInitialPos:r.set,clearInitialPos:r.clear,isVisible:n.get,setVisible:n.set,getModes:o.get,setModes:o.set,readState:function(){return"docked: "+e.get()+", visible: "+n.get()+", modes: "+o.get().join(",")}})}})}),kE=v($i("toolbar-height-change")),OE={fadeInClass:"tox-editor-dock-fadein",fadeOutClass:"tox-editor-dock-fadeout",transitionClass:"tox-editor-dock-transition"},TE=function(t,e){return F(SE.getModes(t),e)},_E=function(t){var e=t.element;pe(e).each(function(n){var r="padding-"+SE.getModes(t)[0];if(SE.isDocked(t)){var o=cn(n);Ue(e,"width",o+"px"),Ue(n,r,function(t){return tn(t)+(parseInt(qe(t,"margin-top"),10)||0)+(parseInt(qe(t,"margin-bottom"),10)||0)}(e)+"px")}else Xe(e,"width"),Xe(n,r)})},EE=function(t,e){e?(Tu(t,OE.fadeOutClass),Eu(t,[OE.transitionClass,OE.fadeInClass])):(Tu(t,OE.fadeInClass),Eu(t,[OE.fadeOutClass,OE.transitionClass]))},DE=function(t,e){var n=Bt.fromDom(t.getContainer());e?(ku(n,"tox-tinymce--toolbar-sticky-on"),Tu(n,"tox-tinymce--toolbar-sticky-off")):(ku(n,"tox-tinymce--toolbar-sticky-off"),Tu(n,"tox-tinymce--toolbar-sticky-on"))},AE=function(t,e){var n,r=Lc(),o=e.getSink,i=function(t){o().each(function(e){return t(e.element)})},u=function(e){t.inline||_E(e),DE(t,SE.isDocked(e)),e.getSystem().broadcastOn([Ul()],{}),o().each(function(t){return t.getSystem().broadcastOn([Ul()],{})})},a=t.inline?[]:[dc.config({channels:(n={},n[kE()]={onReceive:_E},n)})];return E([$g.config({}),SE.config({contextual:T({lazyContext:function(e){var n=tn(e.element),r=t.inline?t.getContentAreaContainer():t.getContainer(),o=Dn(Bt.fromDom(r)),i=o.height-n,u=o.y+(TE(e,"top")?0:n);return R.some(En(o.x,u,o.width,i))},onShow:function(){i(function(t){return EE(t,!0)})},onShown:function(t){i(function(t){return Du(t,[OE.transitionClass,OE.fadeInClass])}),r.get().each(function(e){var n,o,i;n=t.element,i=de(o=e),vc(i).filter(function(t){return!se(o,t)}).filter(function(t){return se(t,Bt.fromDom(i.dom.body))||fe(n,t)}).each(function(){return hc(o)}),r.clear()})},onHide:function(t){(function(t,e){return bc(t).orThunk(function(){return e().toOptional().bind(function(t){return bc(t.element)})})})(t.element,o).fold(r.clear,r.set),i(function(t){return EE(t,!1)})},onHidden:function(){i(function(t){return Du(t,[OE.transitionClass])})}},OE),lazyViewport:function(e){var n=Nn(),r=function(t){return t.getParam("toolbar_sticky_offset",0,"number")}(t),o=n.y+(TE(e,"top")?r:0),i=n.height-(TE(e,"bottom")?r:0);return En(n.x,o,n.width,i)},modes:[e.header.getDockingMode()],onDocked:u,onUndocked:u})],a,!0)},NE=Object.freeze({__proto__:null,setup:function(t,e,n){t.inline||(e.header.isPositionedAtTop()||t.on("ResizeEditor",function(){n().each(SE.reset)}),t.on("ResizeWindow ResizeEditor",function(){n().each(_E)}),t.on("SkinLoaded",function(){n().each(function(t){SE.isDocked(t)?SE.reset(t):SE.refresh(t)})}),t.on("FullscreenStateChanged",function(){n().each(SE.reset)})),t.on("AfterScrollIntoView",function(t){n().each(function(e){SE.refresh(e);var n=e.element;Dm(n)&&function(t,e){var n=de(e),r=n.dom.defaultView.innerHeight,o=xn(n),i=Bt.fromDom(t.elm),u=An(i),a=Ze(i),c=u.y,s=c+a,l=on(e),f=Ze(e),d=l.top,m=d+f,g=Math.abs(d-o.top)<2,h=Math.abs(m-(o.top+r))<2;if(g&&c<m)Cn(o.left,c-f,n);else if(h&&s>d){var p=c-r+a+f;Cn(o.left,p,n)}}(t,n)})}),t.on("PostRender",function(){DE(t,!1)})},isDocked:function(t){return t().map(SE.isDocked).getOr(!1)},getBehaviours:AE}),ME=gr([Vr("type"),Fr("items",pr([br([Vr("name"),$r("items",Cr)]),Cr]))].concat(Av)),zE=[Yr("text"),Yr("tooltip"),Yr("icon"),jr("fetch"),uo("onSetup",function(){return h})],RE=gr(E([Vr("type")],zE,!0)),BE=function(t){return Nr("menubutton",RE,t)},LE=gr([Vr("type"),Yr("tooltip"),Yr("icon"),Yr("text"),Jr("select"),jr("fetch"),uo("onSetup",function(){return h}),oo("presets","normal",["normal","color","listpreview"]),to("columns",1),jr("onAction"),jr("onItemAction")]),PE=ld({factory:function(t,e){var n={focus:Bg.focusIn,setMenus:function(t,n){var r=W(n,function(t){var n={type:"menubutton",text:t.text,fetch:function(e){e(t.getItems())}},r=BE(n).mapError(function(t){return Rr(t)}).getOrDie();return jO(r,"tox-mbtn",e.backstage,R.some("menuitem"))});Fg.set(t,r)}};return{uid:t.uid,dom:t.dom,components:[],behaviours:uc([Fg.config({}),Vg("menubar-events",[Ri(function(e){t.onSetup(e)}),_i(zo(),function(t,e){Yu(t.element,".tox-mbtn--active").each(function(n){Ju(e.event.target,".tox-mbtn").each(function(e){se(n,e)||t.getSystem().getByDom(n).each(function(n){t.getSystem().getByDom(e).each(function(t){bC.expand(t),bC.close(n),$g.focus(t)})})})})}),_i(di(),function(t,e){e.event.prevFocus.bind(function(e){return t.getSystem().getByDom(e).toOptional()}).each(function(n){e.event.newFocus.bind(function(e){return t.getSystem().getByDom(e).toOptional()}).each(function(t){bC.isOpen(n)&&(bC.expand(t),bC.close(n))})})})]),Bg.config({mode:"flow",selector:".tox-mbtn",onEscape:function(e){return t.onEscape(e),R.some(!0)}}),dx.config({})]),apis:n,domModification:{attributes:{role:"menubar"}}}},name:"silver.Menubar",configFields:[Ir("dom"),Ir("uid"),Ir("onEscape"),Ir("backstage"),to("onSetup",h)],apis:{focus:function(t,e){t.focus(e)},setMenus:function(t,e,n){t.setMenus(e,n)}}}),HE=function(t,e){return e.getAnimationRoot.fold(function(){return t.element},function(e){return e(t)})},IE=function(t){return t.dimension.property},FE=function(t,e){return t.dimension.getDimension(e)},VE=function(t,e){var n=HE(t,e);Du(n,[e.shrinkingClass,e.growingClass])},UE=function(t,e){Tu(t.element,e.openClass),ku(t.element,e.closedClass),Ue(t.element,IE(e),"0px"),Ye(t.element)},jE=function(t,e){Tu(t.element,e.closedClass),ku(t.element,e.openClass),Xe(t.element,IE(e))},WE=function(t,e,n,r){n.setCollapsed(),Ue(t.element,IE(e),FE(e,t.element)),Ye(t.element),VE(t,e),UE(t,e),e.onStartShrink(t),e.onShrunk(t)},qE=function(t,e,n,r){var o=r.getOrThunk(function(){return FE(e,t.element)});n.setCollapsed(),Ue(t.element,IE(e),o),Ye(t.element);var i=HE(t,e);Tu(i,e.growingClass),ku(i,e.shrinkingClass),UE(t,e),e.onStartShrink(t)},$E=function(t,e,n){var r=FE(e,t.element);("0px"===r?WE:qE)(t,e,n,R.some(r))},GE=function(t,e,n){var r=HE(t,e),o=_u(r,e.shrinkingClass),i=FE(e,t.element);jE(t,e);var u=FE(e,t.element);(o?function(){Ue(t.element,IE(e),i),Ye(t.element)}:function(){UE(t,e)})(),Tu(r,e.shrinkingClass),ku(r,e.growingClass),jE(t,e),Ue(t.element,IE(e),u),n.setExpanded(),e.onStartGrow(t)},KE=function(t,e,n){var r=HE(t,e);return!0===_u(r,e.growingClass)},XE=function(t,e,n){var r=HE(t,e);return!0===_u(r,e.shrinkingClass)},YE=Object.freeze({__proto__:null,refresh:function(t,e,n){if(n.isExpanded()){Xe(t.element,IE(e));var r=FE(e,t.element);Ue(t.element,IE(e),r)}},grow:function(t,e,n){n.isExpanded()||GE(t,e,n)},shrink:function(t,e,n){n.isExpanded()&&$E(t,e,n)},immediateShrink:function(t,e,n){n.isExpanded()&&WE(t,e,n)},hasGrown:function(t,e,n){return n.isExpanded()},hasShrunk:function(t,e,n){return n.isCollapsed()},isGrowing:KE,isShrinking:XE,isTransitioning:function(t,e,n){return KE(t,e)||XE(t,e)},toggleGrow:function(t,e,n){(n.isExpanded()?$E:GE)(t,e,n)},disableTransitions:VE}),JE=Object.freeze({__proto__:null,exhibit:function(t,e,n){var r=e.expanded;return fu(r?{classes:[e.openClass],styles:{}}:{classes:[e.closedClass],styles:go(e.dimension.property,"0px")})},events:function(t,e){return ki([zi(Uo(),function(n,r){r.event.raw.propertyName===t.dimension.property&&(VE(n,t),e.isExpanded()&&Xe(n.element,t.dimension.property),(e.isExpanded()?t.onGrown:t.onShrunk)(n))})])}}),QE=[Ir("closedClass"),Ir("openClass"),Ir("shrinkingClass"),Ir("growingClass"),Gr("getAnimationRoot"),ma("onShrunk"),ma("onStartShrink"),ma("onGrown"),ma("onStartGrow"),to("expanded",!1),Fr("dimension",Br("property",{width:[va("property","width"),va("getDimension",function(t){return cn(t)+"px"})],height:[va("property","height"),va("getDimension",function(t){return Ze(t)+"px"})]}))],ZE=cc({fields:QE,name:"sliding",active:JE,apis:YE,state:Object.freeze({__proto__:null,init:function(t){var e=so(t.expanded);return su({isExpanded:function(){return!0===e.get()},isCollapsed:function(){return!1===e.get()},setCollapsed:w(e.set,!1),setExpanded:w(e.set,!0),readState:function(){return"expanded: "+e.get()}})}})}),tD=[cf("slotBehaviours",[])],eD=function(t){return"<alloy.field."+t+">"},nD=function(t,e){var n,r=function(e){return td(t)},o=function(e,n){return function(r,o){return Yf(r,t,o).map(function(t){return e(t,o)}).getOr(n)}},i=function(t,e){return"true"!==Le(t.element,"aria-hidden")},u=o(i,!1),a=o(function(t,e){if(i(t)){var n=t.element;Ue(n,"display","none"),Re(n,"aria-hidden","true"),yi(t,mi(),{name:e,visible:!1})}}),c=(n=a,function(t,e){q(e,function(e){return n(t,e)})}),s=o(function(t,e){if(!i(t)){var n=t.element;Xe(n,"display"),Ie(n,"aria-hidden"),yi(t,mi(),{name:e,visible:!0})}}),l={getSlotNames:r,getSlot:function(e,n){return Yf(e,t,n)},isShowing:u,hideSlot:a,hideAllSlots:function(t){return c(t,r())},showSlot:s};return{uid:t.uid,dom:t.dom,components:e,behaviours:sf(t.slotBehaviours),apis:l}},rD=gt({getSlotNames:function(t,e){return t.getSlotNames(e)},getSlot:function(t,e,n){return t.getSlot(e,n)},isShowing:function(t,e,n){return t.isShowing(e,n)},hideSlot:function(t,e,n){return t.hideSlot(e,n)},hideAllSlots:function(t,e){return t.hideAllSlots(e)},showSlot:function(t,e,n){return t.showSlot(e,n)}},function(t){return au(t)}),oD=T(T({},rD),{sketch:function(t){var e,n={slot:function(t,n){return e.push(t),qf("container",eD(t),n)},record:v(e=[])},r=t(n),o=n.record(),i=W(o,function(t){return Lf({name:t,pname:eD(t)})});return ud("container",tD,i,nD,r)}}),iD=gr([Yr("icon"),Yr("tooltip"),uo("onShow",h),uo("onHide",h),uo("onSetup",function(){return h})]),uD=function(t){return{element:function(){return t.element.dom}}},aD=function(t,e){var n=W(ft(e),function(t){var n=e[t],r=Mr(function(t){return Nr("sidebar",iD,t)}(n));return{name:t,getApi:uD,onSetup:r.onSetup,onShow:r.onShow,onHide:r.onHide}});return W(n,function(e){var r=so(h);return t.slot(e.name,{dom:{tag:"div",classes:["tox-sidebar__pane"]},behaviours:_b([gy(e,r),hy(e,r),_i(mi(),function(t,e){var r=e.event;Y(n,function(t){return t.name===r.name}).each(function(e){(r.visible?e.onShow:e.onHide)(e.getApi(t))})})])})})},cD=function(t,e){hd.getCurrent(t).each(function(t){return Fg.set(t,[function(t){return oD.sketch(function(e){return{dom:{tag:"div",classes:["tox-sidebar__pane-container"]},components:aD(e,t),slotBehaviours:_b([Ri(function(t){return oD.hideAllSlots(t)})])}})}(e)])})},sD=function(t){return hd.getCurrent(t).bind(function(t){return ZE.isGrowing(t)||ZE.hasGrown(t)?hd.getCurrent(t).bind(function(t){return Y(oD.getSlotNames(t),function(e){return oD.isShowing(t,e)})}):R.none()})},lD=$i("FixSizeEvent"),fD=$i("AutoSizeEvent"),dD=Object.freeze({__proto__:null,block:function(t,e,n,r){Re(t.element,"aria-busy",!0);var o=e.getRoot(t).getOr(t),i=uc([Bg.config({mode:"special",onTab:function(){return R.some(!0)},onShiftTab:function(){return R.some(!0)}}),$g.config({})]),u=r(o,i),a=o.getSystem().build(u);Fg.append(o,Uu(a)),a.hasConfigured(Bg)&&e.focus&&Bg.focusIn(a),n.isBlocked()||e.onBlock(t),n.blockWith(function(){return Fg.remove(o,a)})},unblock:function(t,e,n){Ie(t.element,"aria-busy"),n.isBlocked()&&e.onUnblock(t),n.clear()}}),mD=[uo("getRoot",R.none),io("focus",!0),ma("onBlock"),ma("onUnblock")],gD=cc({fields:mD,name:"blocking",apis:dD,state:Object.freeze({__proto__:null,init:function(){var t=Rc();return su({readState:t.isSet,blockWith:function(e){t.set({destroy:e})},clear:t.clear,isBlocked:t.isSet})}})}),hD=function(t){return hd.getCurrent(t).each(function(t){return hc(t.element)})},pD=function(t,e,n,r){var o=e.element;if(function(t,e){R.from(t.iframeElement).map(Bt.fromDom).each(function(t){e?(Pe(t,"tabindex").each(function(e){return Re(t,"data-mce-tabindex",e)}),Re(t,"tabindex",-1)):(Ie(t,"tabindex"),Pe(t,"data-mce-tabindex").each(function(e){Re(t,"tabindex",e),Ie(t,"data-mce-tabindex")}))})}(t,n),n)gD.block(e,function(t){return function(e,n){return{dom:{tag:"div",attributes:{"aria-label":t.translate("Loading..."),tabindex:"0"},classes:["tox-throbber__busy-spinner"]},components:[{dom:Kh('<div class="tox-spinner"><div></div><div></div><div></div></div>')}]}}}(r)),Xe(o,"display"),Ie(o,"aria-hidden"),t.hasFocus()&&hD(e);else{var i=hd.getCurrent(e).exists(function(t){return pc(t.element)});gD.unblock(e),Ue(o,"display","none"),Re(o,"aria-hidden","true"),i&&t.focus()}},vD=function(t,e,n){var r=so(!1),o=Lc(),i=function(n){var o;!r.get()||function(t){return"focusin"===t.type}(o=n)&&(o.composed?at(o.composedPath()):R.from(o.target)).map(Bt.fromDom).filter(It).exists(function(t){return _u(t,"mce-pastebin")})||(n.preventDefault(),hD(e()),t.editorManager.setActive(t))};t.inline||t.on("PreInit",function(){t.dom.bind(t.getWin(),"focusin",i),t.on("BeforeExecCommand",function(t){"mcefocus"===t.command.toLowerCase()&&!0!==t.value&&i(t)})});var u=function(o){o!==r.get()&&(r.set(o),pD(t,e(),o,n.providers),t.fire("AfterProgressState",{state:o}))};t.on("ProgressState",function(e){if(o.on($h.clearTimeout),m(e.time)){var n=$h.setEditorTimeout(t,function(){return u(e.state)},e.time);o.set(n)}else u(e.state),o.clear()})},bD=function(t,e,n){return{within:t,extra:e,withinWidth:n}},yD=function(t,e,n){var r,o=(r=function(t,e){var r=n(t);return R.some({element:t,start:e,finish:e+r,width:r})},X(t,function(t,e){return r(e,t.len).fold(v(t),function(e){return{len:e.finish,list:t.list.concat([e])}})},{len:0,list:[]}).list),i=G(o,function(t){return t.finish<=e}),u=K(i,function(t,e){return t+e.width},0);return{within:i,extra:o.slice(i.length),withinWidth:u}},wD=function(t){return W(t,function(t){return t.element})},xD=function(t,e,n,r){var o=function(t,e,n){var r=yD(e,t,n);return 0===r.extra.length?R.some(r):R.none()}(t,e,n).getOrThunk(function(){return yD(e,t-n(r),n)}),i=o.within,u=o.extra,a=o.withinWidth;return 1===u.length&&u[0].width<=n(r)?function(t,e,n){var r=wD(t.concat(e));return bD(r,[],n)}(i,u,a):u.length>=1?function(t,e,n,r){var o=wD(t).concat([n]);return bD(o,wD(e),r)}(i,u,r,a):function(t,e,n){return bD(wD(t),[],n)}(i,0,a)},CD=function(t,e){var n=W(e,function(t){return Uu(t)});Z_.setGroups(t,n)},SD=function(t,e,n){var r=e.builtGroups.get();if(0!==r.length){var o=Jf(t,e,"primary"),i=tC.getCoupled(t,"overflowGroup");Ue(o.element,"visibility","hidden");var u=r.concat([i]),a=lt(u,function(t){return bc(t.element).bind(function(e){return t.getSystem().getByDom(e).toOptional()})});n([]),CD(o,u);var c=cn(o.element),s=xD(c,e.builtGroups.get(),function(t){return cn(t.element)},i);0===s.extra.length?(Fg.remove(o,i),n([])):(CD(o,s.within),n(s.extra)),Xe(o.element,"visibility"),Ye(o.element),a.each($g.focus)}},kD=v([cf("splitToolbarBehaviours",[tC]),Pr("builtGroups",function(){return so([])})]),OD=v([fa(["overflowToggledClass"]),Jr("getOverflowBounds"),Ir("lazySink"),Pr("overflowGroups",function(){return so([])})].concat(kD())),TD=v([Lf({factory:Z_,schema:J_(),name:"primary"}),Pf({schema:J_(),name:"overflow"}),Pf({name:"overflow-button"}),Pf({name:"overflow-group"})]),_D=v(function(t,e){!function(t,e){var n=an.max(t,e,["margin-left","border-left-width","padding-left","padding-right","border-right-width","margin-right"]);Ue(t,"max-width",n+"px")}(t,Math.floor(e))}),ED=v([fa(["toggledClass"]),Ir("lazySink"),jr("fetch"),Jr("getBounds"),Zr("fireDismissalEventInstead",[to("event",li())]),ss()]),DD=v([Pf({name:"button",overrides:function(t){return{dom:{attributes:{"aria-haspopup":"true"}},buttonBehaviours:uc([oh.config({toggleClass:t.markers.toggledClass,aria:{mode:"expanded"},toggleOnExecute:!1})])}}}),Pf({factory:Z_,schema:J_(),name:"toolbar",overrides:function(t){return{toolbarBehaviours:uc([Bg.config({mode:"cyclic",onEscape:function(e){return Yf(e,t,"button").each($g.focus),R.none()}})])}}})]),AD=function(t,e){var n=tC.getCoupled(t,"toolbarSandbox");Fl.isOpen(n)?Fl.close(n):Fl.open(n,e.toolbar())},ND=function(t,e,n,r){var o=n.getBounds.map(function(t){return t()}),i=n.lazySink(t).getOrDie();bl.positionWithinBounds(i,e,{anchor:{type:"hotspot",hotspot:t,layouts:r,overrides:{maxWidthFunction:_D()}}},o)},MD=function(t,e,n,r,o){Z_.setGroups(e,o),ND(t,e,n,r),oh.on(t)},zD=fd({name:"FloatingToolbarButton",factory:function(t,e,n,r){return T(T({},Gh.sketch(T(T({},r.button()),{action:function(t){AD(t,r)},buttonBehaviours:df({dump:r.button().buttonBehaviours},[tC.config({others:{toolbarSandbox:function(e){return function(t,e,n){var r=Qu();return{dom:{tag:"div",attributes:{id:r.id}},behaviours:uc([Bg.config({mode:"special",onEscape:function(t){return Fl.close(t),R.some(!0)}}),Fl.config({onOpen:function(o,i){n.fetch().get(function(o){MD(t,i,n,e.layouts,o),r.link(t.element),Bg.focusIn(i)})},onClose:function(){oh.off(t),$g.focus(t),r.unlink(t.element)},isPartOf:function(e,n,r){return ta(n,r)||ta(t,r)},getAttachPoint:function(){return n.lazySink(t).getOrDie()}}),dc.config({channels:T(T({},ql(T({isExtraPart:S},n.fireDismissalEventInstead.map(function(t){return{fireEventInstead:{event:t.event}}}).getOr({})))),Gl({doReposition:function(){Fl.getState(tC.getCoupled(t,"toolbarSandbox")).each(function(r){ND(t,r,n,e.layouts)})}}))})])}}(e,n,t)}}})])}))),{apis:{setGroups:function(e,r){Fl.getState(tC.getCoupled(e,"toolbarSandbox")).each(function(o){MD(e,o,t,n.layouts,r)})},reposition:function(e){Fl.getState(tC.getCoupled(e,"toolbarSandbox")).each(function(r){ND(e,r,t,n.layouts)})},toggle:function(t){AD(t,r)},getToolbar:function(t){return Fl.getState(tC.getCoupled(t,"toolbarSandbox"))},isOpen:function(t){return Fl.isOpen(tC.getCoupled(t,"toolbarSandbox"))}}})},configFields:ED(),partFields:DD(),apis:{setGroups:function(t,e,n){t.setGroups(e,n)},reposition:function(t,e){t.reposition(e)},toggle:function(t,e){t.toggle(e)},getToolbar:function(t,e){return t.getToolbar(e)},isOpen:function(t,e){return t.isOpen(e)}}}),RD=v([Ir("items"),fa(["itemSelector"]),cf("tgroupBehaviours",[Bg])]),BD=v([If({name:"items",unit:"item"})]),LD=fd({name:"ToolbarGroup",configFields:RD(),partFields:BD(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,behaviours:lf(t.tgroupBehaviours,[Bg.config({mode:"flow",selector:t.markers.itemSelector})]),domModification:{attributes:{role:"toolbar"}}}}}),PD=function(t){return W(t,function(t){return Uu(t)})},HD=function(t,e,n){SD(t,n,function(r){n.overflowGroups.set(r),e.getOpt(t).each(function(t){zD.setGroups(t,PD(r))})})},ID=fd({name:"SplitFloatingToolbar",configFields:OD(),partFields:TD(),factory:function(t,e,n,r){var o=Xh(zD.sketch({fetch:function(){return Fx(function(e){e(PD(t.overflowGroups.get()))})},layouts:{onLtr:function(){return[Fa,Ia]},onRtl:function(){return[Ia,Fa]},onBottomLtr:function(){return[Ua,Va]},onBottomRtl:function(){return[Va,Ua]}},getBounds:n.getOverflowBounds,lazySink:t.lazySink,fireDismissalEventInstead:{},markers:{toggledClass:t.markers.overflowToggledClass},parts:{button:r["overflow-button"](),toolbar:r.overflow()}}));return{uid:t.uid,dom:t.dom,components:e,behaviours:lf(t.splitToolbarBehaviours,[tC.config({others:{overflowGroup:function(){return LD.sketch(T(T({},r["overflow-group"]()),{items:[o.asSpec()]}))}}})]),apis:{setGroups:function(e,n){t.builtGroups.set(W(n,e.getSystem().build)),HD(e,o,t)},refresh:function(e){return HD(e,o,t)},toggle:function(t){o.getOpt(t).each(function(t){zD.toggle(t)})},isOpen:function(t){return o.getOpt(t).map(zD.isOpen).getOr(!1)},reposition:function(t){o.getOpt(t).each(function(t){zD.reposition(t)})},getOverflow:function(t){return o.getOpt(t).bind(zD.getToolbar)}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,e,n){t.setGroups(e,n)},refresh:function(t,e){t.refresh(e)},reposition:function(t,e){t.reposition(e)},toggle:function(t,e){t.toggle(e)},isOpen:function(t,e){return t.isOpen(e)},getOverflow:function(t,e){return t.getOverflow(e)}}}),FD=v([fa(["closedClass","openClass","shrinkingClass","growingClass","overflowToggledClass"]),ma("onOpened"),ma("onClosed")].concat(kD())),VD=v([Lf({factory:Z_,schema:J_(),name:"primary"}),Lf({factory:Z_,schema:J_(),name:"overflow",overrides:function(t){return{toolbarBehaviours:uc([ZE.config({dimension:{property:"height"},closedClass:t.markers.closedClass,openClass:t.markers.openClass,shrinkingClass:t.markers.shrinkingClass,growingClass:t.markers.growingClass,onShrunk:function(e){Yf(e,t,"overflow-button").each(function(t){oh.off(t),$g.focus(t)}),t.onClosed(e)},onGrown:function(e){Bg.focusIn(e),t.onOpened(e)},onStartGrow:function(e){Yf(e,t,"overflow-button").each(oh.on)}}),Bg.config({mode:"acyclic",onEscape:function(e){return Yf(e,t,"overflow-button").each($g.focus),R.some(!0)}})])}}}),Pf({name:"overflow-button",overrides:function(t){return{buttonBehaviours:uc([oh.config({toggleClass:t.markers.overflowToggledClass,aria:{mode:"pressed"},toggleOnExecute:!1})])}}}),Pf({name:"overflow-group"})]),UD=function(t,e){Yf(t,e,"overflow-button").bind(function(){return Yf(t,e,"overflow")}).each(function(n){jD(t,e),ZE.toggleGrow(n)})},jD=function(t,e){Yf(t,e,"overflow").each(function(n){SD(t,e,function(t){var e=W(t,function(t){return Uu(t)});Z_.setGroups(n,e)}),Yf(t,e,"overflow-button").each(function(t){ZE.hasGrown(n)&&oh.on(t)}),ZE.refresh(n)})},WD=fd({name:"SplitSlidingToolbar",configFields:FD(),partFields:VD(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,behaviours:lf(t.splitToolbarBehaviours,[tC.config({others:{overflowGroup:function(t){return LD.sketch(T(T({},r["overflow-group"]()),{items:[Gh.sketch(T(T({},r["overflow-button"]()),{action:function(e){bi(t,"alloy.toolbar.toggle")}}))]}))}}}),Vg("toolbar-toggle-events",[_i("alloy.toolbar.toggle",function(e){UD(e,t)})])]),apis:{setGroups:function(e,n){!function(e,n){var r=W(n,e.getSystem().build);t.builtGroups.set(r)}(e,n),jD(e,t)},refresh:function(e){return jD(e,t)},toggle:function(e){return UD(e,t)},isOpen:function(e){return function(t,e){return Yf(t,e,"overflow").map(ZE.hasGrown).getOr(!1)}(e,t)}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,e,n){t.setGroups(e,n)},refresh:function(t,e){t.refresh(e)},toggle:function(t,e){t.toggle(e)},isOpen:function(t,e){return t.isOpen(e)}}}),qD=function(t){var e=t.title.fold(function(){return{}},function(t){return{attributes:{title:t}}});return{dom:T({tag:"div",classes:["tox-toolbar__group"]},e),components:[LD.parts.items({})],items:t.items,markers:{itemSelector:"*:not(.tox-split-button) > .tox-tbtn:not([disabled]), .tox-split-button:not([disabled]), .tox-toolbar-nav-js:not([disabled])"},tgroupBehaviours:uc([dx.config({}),$g.config({})])}},$D=function(t){return LD.sketch(qD(t))},GD=function(t,e){var n=Ri(function(e){var n=W(t.initGroups,$D);Z_.setGroups(e,n)});return uc([dy(t.providers.isDisabled),cy(),Bg.config({mode:e,onEscape:t.onEscape,selector:".tox-toolbar__group"}),Vg("toolbar-events",[n])])},KD=function(t){var e=t.cyclicKeying?"cyclic":"acyclic";return{uid:t.uid,dom:{tag:"div",classes:["tox-toolbar-overlord"]},parts:{"overflow-group":qD({title:R.none(),items:[]}),"overflow-button":$O({name:"more",icon:R.some("more-drawer"),disabled:!1,tooltip:R.some("More..."),primary:!1,borderless:!1},R.none(),t.providers)},splitToolbarBehaviours:GD(t,e)}},XD=function(t){var e=KD(t),n=ID.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}});return ID.sketch(T(T({},e),{lazySink:t.getSink,getOverflowBounds:function(){var e=t.moreDrawerData.lazyHeader().element,n=An(e),r=ge(e),o=An(r),i=Math.max(r.dom.scrollHeight,o.height);return En(n.x+4,o.y,n.width-8,i)},parts:T(T({},e.parts),{overflow:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:t.attributes}}}),components:[n],markers:{overflowToggledClass:"tox-tbtn--enabled"}}))},YD=function(t){var e=WD.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}}),n=WD.parts.overflow({dom:{tag:"div",classes:["tox-toolbar__overflow"]}}),r=KD(t);return WD.sketch(T(T({},r),{components:[e,n],markers:{openClass:"tox-toolbar__overflow--open",closedClass:"tox-toolbar__overflow--closed",growingClass:"tox-toolbar__overflow--growing",shrinkingClass:"tox-toolbar__overflow--shrinking",overflowToggledClass:"tox-tbtn--enabled"},onOpened:function(t){t.getSystem().broadcastOn([kE()],{type:"opened"})},onClosed:function(t){t.getSystem().broadcastOn([kE()],{type:"closed"})}}))},JD=function(t){var e=t.cyclicKeying?"cyclic":"acyclic";return Z_.sketch({uid:t.uid,dom:{tag:"div",classes:["tox-toolbar"].concat(t.type===qv.scrolling?["tox-toolbar--scrolling"]:[])},components:[Z_.parts.groups({})],toolbarBehaviours:GD(t,e)})},QD=$_.optional({factory:PE,name:"menubar",schema:[Ir("backstage")]}),ZD=$_.optional({factory:{sketch:function(t){return Y_.sketch({uid:t.uid,dom:t.dom,listBehaviours:uc([Bg.config({mode:"acyclic",selector:".tox-toolbar"})]),makeItem:function(){return JD({type:t.type,uid:$i("multiple-toolbar-item"),cyclicKeying:!1,initGroups:[],providers:t.providers,onEscape:function(){return t.onEscape(),R.some(!0)}})},setupItem:function(t,e,n,r){Z_.setGroups(e,n)},shell:!0})}},name:"multiple-toolbar",schema:[Ir("dom"),Ir("onEscape")]}),tA=$_.optional({factory:{sketch:function(t){return function(t){return t.type===qv.sliding?YD:t.type===qv.floating?XD:JD}(t)({type:t.type,uid:t.uid,onEscape:function(){return t.onEscape(),R.some(!0)},cyclicKeying:!1,initGroups:[],getSink:t.getSink,providers:t.providers,moreDrawerData:{lazyToolbar:t.lazyToolbar,lazyMoreButton:t.lazyMoreButton,lazyHeader:t.lazyHeader},attributes:t.attributes})}},name:"toolbar",schema:[Ir("dom"),Ir("onEscape"),Ir("getSink")]}),eA=$_.optional({factory:{sketch:function(t){var e=t.editor,n=t.sticky?AE:nE;return{uid:t.uid,dom:t.dom,components:t.components,behaviours:uc(n(e,t.sharedBackstage))}}},name:"header",schema:[Ir("dom")]}),nA=$_.optional({name:"socket",schema:[Ir("dom")]}),rA=$_.optional({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-sidebar"],attributes:{role:"complementary"}},components:[{dom:{tag:"div",classes:["tox-sidebar__slider"]},components:[],behaviours:uc([dx.config({}),$g.config({}),ZE.config({dimension:{property:"width"},closedClass:"tox-sidebar--sliding-closed",openClass:"tox-sidebar--sliding-open",shrinkingClass:"tox-sidebar--sliding-shrinking",growingClass:"tox-sidebar--sliding-growing",onShrunk:function(t){hd.getCurrent(t).each(oD.hideAllSlots),bi(t,fD)},onGrown:function(t){bi(t,fD)},onStartGrow:function(t){yi(t,lD,{width:Ge(t.element,"width").getOr("")})},onStartShrink:function(t){yi(t,lD,{width:cn(t.element)+"px"})}}),Fg.config({}),hd.config({find:function(t){var e=Fg.contents(t);return at(e)}})])}],behaviours:uc([bk(0),Vg("sidebar-sliding-events",[_i(lD,function(t,e){Ue(t.element,"width",e.event.width)}),_i(fD,function(t,e){Xe(t.element,"width")})])])}}},name:"sidebar",schema:[Ir("dom")]}),oA=$_.optional({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",attributes:{"aria-hidden":"true"},classes:["tox-throbber"],styles:{display:"none"}},behaviours:uc([Fg.config({}),gD.config({focus:!1}),hd.config({find:function(t){return at(t.components())}})]),components:[]}}},name:"throbber",schema:[Ir("dom")]}),iA=fd({name:"OuterContainer",factory:function(t,e,n){var r={getSocket:function(e){return q_.getPart(e,t,"socket")},setSidebar:function(e,n){q_.getPart(e,t,"sidebar").each(function(t){return cD(t,n)})},toggleSidebar:function(e,n){q_.getPart(e,t,"sidebar").each(function(t){return function(t,e){hd.getCurrent(t).each(function(t){hd.getCurrent(t).each(function(n){ZE.hasGrown(t)?oD.isShowing(n,e)?ZE.shrink(t):(oD.hideAllSlots(n),oD.showSlot(n,e)):(oD.hideAllSlots(n),oD.showSlot(n,e),ZE.grow(t))})})}(t,n)})},whichSidebar:function(e){return q_.getPart(e,t,"sidebar").bind(sD).getOrNull()},getHeader:function(e){return q_.getPart(e,t,"header")},getToolbar:function(e){return q_.getPart(e,t,"toolbar")},setToolbar:function(e,n){q_.getPart(e,t,"toolbar").each(function(t){t.getApis().setGroups(t,n)})},setToolbars:function(e,n){q_.getPart(e,t,"multiple-toolbar").each(function(t){Y_.setItems(t,n)})},refreshToolbar:function(e){q_.getPart(e,t,"toolbar").each(function(t){return t.getApis().refresh(t)})},toggleToolbarDrawer:function(e){q_.getPart(e,t,"toolbar").each(function(t){var e,n;e=t.getApis().toggle,n=function(e){return e(t)},void 0!==e&&null!==e?R.some(n(e)):R.none()})},isToolbarDrawerToggled:function(e){return q_.getPart(e,t,"toolbar").bind(function(t){return R.from(t.getApis().isOpen).map(function(e){return e(t)})}).getOr(!1)},getThrobber:function(e){return q_.getPart(e,t,"throbber")},focusToolbar:function(e){q_.getPart(e,t,"toolbar").orThunk(function(){return q_.getPart(e,t,"multiple-toolbar")}).each(function(t){Bg.focusIn(t)})},setMenubar:function(e,n){q_.getPart(e,t,"menubar").each(function(t){PE.setMenus(t,n)})},focusMenubar:function(e){q_.getPart(e,t,"menubar").each(function(t){PE.focus(t)})}};return{uid:t.uid,dom:t.dom,components:e,apis:r,behaviours:t.behaviours}},configFields:[Ir("dom"),Ir("behaviours")],partFields:[eA,QD,tA,ZD,nA,rA,oA],apis:{getSocket:function(t,e){return t.getSocket(e)},setSidebar:function(t,e,n){t.setSidebar(e,n)},toggleSidebar:function(t,e,n){t.toggleSidebar(e,n)},whichSidebar:function(t,e){return t.whichSidebar(e)},getHeader:function(t,e){return t.getHeader(e)},getToolbar:function(t,e){return t.getToolbar(e)},setToolbar:function(t,e,n){var r=W(n,function(t){return $D(t)});t.setToolbar(e,r)},setToolbars:function(t,e,n){var r=W(n,function(t){return W(t,$D)});t.setToolbars(e,r)},refreshToolbar:function(t,e){return t.refreshToolbar(e)},toggleToolbarDrawer:function(t,e){t.toggleToolbarDrawer(e)},isToolbarDrawerToggled:function(t,e){return t.isToolbarDrawerToggled(e)},getThrobber:function(t,e){return t.getThrobber(e)},setMenubar:function(t,e,n){t.setMenubar(e,n)},focusMenubar:function(t,e){t.focusMenubar(e)},focusToolbar:function(t,e){t.focusToolbar(e)}}}),uA={file:{title:"File",items:"newdocument restoredraft | preview | export print | deleteallconversations"},edit:{title:"Edit",items:"undo redo | cut copy paste pastetext | selectall | searchreplace"},view:{title:"View",items:"code | visualaid visualchars visualblocks | spellchecker | preview fullscreen | showcomments"},insert:{title:"Insert",items:"image link media addcomment pageembed template codesample inserttable | charmap emoticons hr | pagebreak nonbreaking anchor toc | insertdatetime"},format:{title:"Format",items:"bold italic underline strikethrough superscript subscript codeformat | formats blockformats fontformats fontsizes align lineheight | forecolor backcolor | language | removeformat"},tools:{title:"Tools",items:"spellchecker spellcheckerlanguage | a11ycheck code wordcount"},table:{title:"Table",items:"inserttable | cell row column | advtablesort | tableprops deletetable"},help:{title:"Help",items:"help"}},aA=function(t){return"string"==typeof t?t.split(" "):t},cA=function(t,e){var n=T(T({},uA),e.menus),r=ft(e.menus).length>0,o=void 0===e.menubar||!0===e.menubar?aA("file edit view insert format tools table help"):aA(!1===e.menubar?"":e.menubar),i=G(o,function(t){var n=xt(uA,t);return r?n||wt(e.menus,t).exists(function(t){return xt(t,"items")}):n}),u=W(i,function(r){var o=n[r];return function(t,e,n){var r=function(t){return t.getParam("removed_menuitems","")}(n).split(/[ ,]/);return{text:t.title,getItems:function(){return Z(t.items,function(t){var n=t.toLowerCase();return 0===n.trim().length?[]:V(r,function(t){return t===n})?[]:"separator"===n||"|"===n?[{type:"separator"}]:e.menuItems[n]?[e.menuItems[n]]:[]})}}}({title:o.title,items:aA(o.items)},e,t)});return G(u,function(t){return t.getItems().length>0&&V(t.getItems(),function(t){return"separator"!==t.type})})},sA=function(t){var e=function(){t._skinLoaded=!0,function(t){t.fire("SkinLoaded")}(t)};return function(){t.initialized?e():t.on("init",e)}},lA=function(t,e,n){return new wv(function(r,o){n.load(e,r,o),t.on("remove",function(){return n.unload(e)})})},fA=function(t,e){var n;return(n=Bt.fromDom(t.getElement()),_e(n).isSome())?lA(t,e+"/skin.shadowdom.min.css",Lb.DOM.styleSheetLoader):wv.resolve()},dA=function(t,e){var n=function(t){var e=t.getParam("skin"),n=t.getParam("skin_url");if(!1!==e){var r=e||"oxide";n=n?t.documentBaseURI.toAbsolute(n):Pb.baseURL+"/skins/ui/"+r}return n}(e);n&&e.contentCSS.push(n+(t?"/content.inline":"/content")+".min.css"),!1===function(t){return!1===t.getParam("skin")}(e)&&o(n)?wv.all([function(t,e){return lA(t,e+"/skin.min.css",t.ui.styleSheetLoader)}(e,n),fA(e,n)]).then(sA(e),function(t,e){return function(){return function(t,e){return t.fire("SkinLoadError",e)}(t,{message:e})}}(e,"Skin could not be loaded")):sA(e)()},mA=w(dA,!1),gA=w(dA,!0),hA=function(t,e){return function(n){var r=Bc(),o=function(){n.setActive(t.formatter.match(e));var o=t.formatter.formatChanged(e,n.setActive);r.set(o)};return t.initialized?o():t.once("init",o),function(){t.off("init",o),r.clear()}}},pA=function(t,e,n){return function(r){var o=function(){return n(r)},i=function(){n(r),t.on(e,o)};return t.initialized?i():t.once("init",i),function(){t.off("init",i),t.off(e,o)}}},vA=function(t){return function(e){return function(){t.undoManager.transact(function(){t.focus(),t.execCommand("mceToggleFormat",!1,e.format)})}}},bA=function(t,e){return function(){return t.execCommand(e)}},yA=function(t,e,n){var r=n.dataset,o="basic"===r.type?function(){return W(r.data,function(t){return h_(t,n.isSelectedFor,n.getPreviewFor)})}:r.getData;return{items:function(t,e,n){var r=function(t,r,i,u){var a=e.shared.providers.translate(t.title);if("separator"===t.type)return R.some({type:"separator",text:a});if("submenu"===t.type){var c=Z(t.getStyleItems(),function(t){return o(t,r,u)});return 0===r&&c.length<=0?R.none():R.some({type:"nestedmenuitem",text:a,disabled:c.length<=0,getSubmenuItems:function(){return Z(t.getStyleItems(),function(t){return o(t,r,u)})}})}return R.some(T({type:"togglemenuitem",text:a,icon:t.icon,active:t.isSelected(u),disabled:i,onAction:n.onAction(t)},t.getStylePreview().fold(function(){return{}},function(t){return{meta:{style:t}}})))},o=function(t,e,o){var i="formatter"===t.type&&n.isInvalid(t);return 0===e?i?[]:r(t,e,!1,o).toArray():r(t,e,i,o).toArray()},i=function(t){var e=n.getCurrentValue(),r=n.shouldHide?0:1;return Z(t,function(t){return o(t,r,e)})};return{validateItems:i,getFetch:function(t,e){return function(n,r){var o=e(),u=i(o);r(VO(u,$v.CLOSE_ON_EXECUTE,t,!1))}}}}(0,e,n),getStyleItems:o}},wA=function(t,e,n){var r=yA(0,e,n),o=r.items,i=r.getStyleItems,u=pA(t,"NodeChange",function(t){var e=t.getComponent();n.updateText(e)});return BO({text:n.icon.isSome()?R.none():n.text,icon:n.icon,tooltip:R.from(n.tooltip),role:R.none(),fetch:o.getFetch(e,i),onSetup:u,getApi:function(t){return{getComponent:v(t)}},columns:1,presets:"normal",classes:n.icon.isSome()?[]:["bespoke"],dropdownBehaviours:[]},"tox-tbtn",e.shared)};!function(t){t[t.SemiColon=0]="SemiColon",t[t.Space=1]="Space"}(kT||(kT={}));var xA,CA,SA,kA=function(t,e,n,r){return{type:"basic",data:function(t){return W(t,function(t){var e=t,n=t,r=t.split("=");return r.length>1&&(e=r[0],n=r[1]),{title:e,format:n}})}(function(t,e){return e===kT.SemiColon?t.replace(/;$/,"").split(";"):t.split(" ")}(t.getParam(e,n,"string"),r))}},OA=[{title:"Left",icon:"align-left",format:"alignleft",command:"JustifyLeft"},{title:"Center",icon:"align-center",format:"aligncenter",command:"JustifyCenter"},{title:"Right",icon:"align-right",format:"alignright",command:"JustifyRight"},{title:"Justify",icon:"align-justify",format:"alignjustify",command:"JustifyFull"}],TA=function(t){var e={type:"basic",data:OA};return{tooltip:"Align",text:R.none(),icon:R.some("align-left"),isSelectedFor:function(e){return function(){return t.formatter.match(e)}},getCurrentValue:R.none,getPreviewFor:function(t){return R.none},onAction:function(e){return function(){return Y(OA,function(t){return t.format===e.format}).each(function(e){return t.execCommand(e.command)})}},updateText:function(e){var n=Y(OA,function(e){return t.formatter.match(e.format)}).fold(v("left"),function(t){return t.title.toLowerCase()});yi(e,RO,{icon:"align-"+n})},dataset:e,shouldHide:!1,isInvalid:function(e){return!t.formatter.canApply(e.format)}}},_A=["-apple-system","Segoe UI","Roboto","Helvetica Neue","sans-serif"],EA=function(t){var e=t.split(/\s*,\s*/);return W(e,function(t){return t.replace(/^['"]+|['"]+$/g,"")})},DA=function(t){var e=function(){var e=function(t){return t?EA(t)[0]:""},r=t.queryCommandValue("FontName"),o=n.data,i=r?r.toLowerCase():"";return{matchOpt:Y(o,function(t){var n=t.format;return n.toLowerCase()===i||e(n).toLowerCase()===e(i).toLowerCase()}).orThunk(function(){return Tt(0===(t=i).indexOf("-apple-system")&&(e=EA(t.toLowerCase()),tt(_A,function(t){return e.indexOf(t.toLowerCase())>-1})),{title:"System Font",format:i});var t,e}),font:r}},n=kA(t,"font_formats","Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats",kT.SemiColon);return{tooltip:"Fonts",text:R.some("System Font"),icon:R.none(),isSelectedFor:function(t){return function(e){return e.exists(function(e){return e.format===t})}},getCurrentValue:function(){return e().matchOpt},getPreviewFor:function(t){return function(){return R.some({tag:"div",styles:-1===t.indexOf("dings")?{"font-family":t}:{}})}},onAction:function(e){return function(){t.undoManager.transact(function(){t.focus(),t.execCommand("FontName",!1,e.format)})}},updateText:function(t){var n=e(),r=n.matchOpt,o=n.font,i=r.fold(v(o),function(t){return t.title});yi(t,zO,{text:i})},dataset:n,shouldHide:!1,isInvalid:S}},AA={"8pt":"1","10pt":"2","12pt":"3","14pt":"4","18pt":"5","24pt":"6","36pt":"7"},NA={"xx-small":"7pt","x-small":"8pt",small:"10pt",medium:"12pt",large:"14pt","x-large":"18pt","xx-large":"24pt"},MA=function(t,e){return/[0-9.]+px$/.test(t)?function(t,e){var n=Math.pow(10,e);return Math.round(t*n)/n}(72*parseInt(t,10)/96,e||0)+"pt":wt(NA,t).getOr(t)},zA=function(t){var e=function(){var e=R.none(),n=r.data,o=t.queryCommandValue("FontSize");if(o)for(var i=function(t){var r=MA(o,t),i=function(t){return wt(AA,t).getOr("")}(r);e=Y(n,function(t){return t.format===o||t.format===r||t.format===i})},u=3;e.isNone()&&u>=0;u--)i(u);return{matchOpt:e,size:o}},n=v(R.none),r=kA(t,"fontsize_formats","8pt 10pt 12pt 14pt 18pt 24pt 36pt",kT.Space);return{tooltip:"Font sizes",text:R.some("12pt"),icon:R.none(),isSelectedFor:function(t){return function(e){return e.exists(function(e){return e.format===t})}},getPreviewFor:n,getCurrentValue:function(){return e().matchOpt},onAction:function(e){return function(){t.undoManager.transact(function(){t.focus(),t.execCommand("FontSize",!1,e.format)})}},updateText:function(t){var n=e(),r=n.matchOpt,o=n.size,i=r.fold(v(o),function(t){return t.title});yi(t,zO,{text:i})},dataset:r,shouldHide:!1,isInvalid:S}},RA=function(t,e){var n=e(),r=W(n,function(t){return t.format});return R.from(t.formatter.closest(r)).bind(function(t){return Y(n,function(e){return e.format===t})}).orThunk(function(){return Tt(t.formatter.match("p"),{title:"Paragraph",format:"p"})})},BA=function(t){var e=kA(t,"block_formats","Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre",kT.SemiColon);return{tooltip:"Blocks",text:R.some("Paragraph"),icon:R.none(),isSelectedFor:function(e){return function(){return t.formatter.match(e)}},getCurrentValue:R.none,getPreviewFor:function(e){return function(){var n=t.formatter.get(e);return R.some({tag:n.length>0&&(n[0].inline||n[0].block)||"div",styles:t.dom.parseStyle(t.formatter.getCssText(e))})}},onAction:vA(t),updateText:function(n){var r=RA(t,function(){return e.data}).fold(v("Paragraph"),function(t){return t.title});yi(n,zO,{text:r})},dataset:e,shouldHide:!1,isInvalid:function(e){return!t.formatter.canApply(e.format)}}},LA=function(t,e){return{tooltip:"Formats",text:R.some("Paragraph"),icon:R.none(),isSelectedFor:function(e){return function(){return t.formatter.match(e)}},getCurrentValue:R.none,getPreviewFor:function(e){return function(){var n=t.formatter.get(e);return void 0!==n?R.some({tag:n.length>0&&(n[0].inline||n[0].block)||"div",styles:t.dom.parseStyle(t.formatter.getCssText(e))}):R.none()}},onAction:vA(t),updateText:function(e){var n=function(t){var e=t.items;return void 0!==e&&e.length>0?Z(e,n):[{title:t.title,format:t.format}]},r=Z(g_(t),n),o=RA(t,v(r)).fold(v("Paragraph"),function(t){return t.title});yi(e,zO,{text:o})},shouldHide:t.getParam("style_formats_autohide",!1,"boolean"),isInvalid:function(e){return!t.formatter.canApply(e.format)},dataset:e}},PA=Object.freeze({__proto__:null,events:function(t,e){var n=function(n,r){t.updateState.each(function(t){var o=t(n,r);e.set(o)}),t.renderComponents.each(function(t){var o=t(r,e.get()),i=W(o,n.getSystem().build);Cl(n,i)})};return ki([_i(Yo(),function(e,r){var o=r;if(!o.universal){var i=t.channel;F(o.channels,i)&&n(e,o.data)}}),Ri(function(e,r){t.initialData.each(function(t){n(e,t)})})])}}),HA=Object.freeze({__proto__:null,getState:function(t,e,n){return n}}),IA=[Ir("channel"),Gr("renderComponents"),Gr("updateState"),Gr("initialData")],FA=cc({fields:IA,name:"reflecting",active:PA,apis:HA,state:Object.freeze({__proto__:null,init:function(){var t=so(R.none());return{readState:function(){return t.get().getOr("none")},get:t.get,set:t.set,clear:function(){return t.set(R.none())}}}})}),VA=v([Ir("toggleClass"),Ir("fetch"),ha("onExecute"),to("getHotspot",R.some),to("getAnchorOverrides",v({})),ss(),ha("onItemExecute"),Gr("lazySink"),Ir("dom"),ma("onOpen"),cf("splitDropdownBehaviours",[tC,Bg,$g]),to("matchWidth",!1),to("useMinWidth",!1),to("eventOrder",{}),Gr("role")].concat(hC())),UA=Lf({factory:Gh,schema:[Ir("dom")],name:"arrow",defaults:function(){return{buttonBehaviours:uc([$g.revoke()])}},overrides:function(t){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(e){e.getSystem().getByUid(t.uid).each(wi)},buttonBehaviours:uc([oh.config({toggleOnExecute:!1,toggleClass:t.toggleClass})])}}}),jA=Lf({factory:Gh,schema:[Ir("dom")],name:"button",defaults:function(){return{buttonBehaviours:uc([$g.revoke()])}},overrides:function(t){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(e){e.getSystem().getByUid(t.uid).each(function(n){t.onExecute(n,e)})}}}}),WA=v([UA,jA,Hf({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:t.text}}}},schema:[Ir("text")],name:"aria-descriptor"}),Pf({schema:[la()],name:"menu",defaults:function(t){return{onExecute:function(e,n){e.getSystem().getByUid(t.uid).each(function(r){t.onItemExecute(r,e,n)})}}}}),nC()]),qA=fd({name:"SplitDropdown",configFields:VA(),partFields:WA(),factory:function(t,e,n,r){var o,i=function(t){hd.getCurrent(t).each(function(t){Fd.highlightFirst(t),Bg.focusIn(t)})},u=function(e){sC(t,b,e,r,i,Rx.HighlightFirst).get(h)},a=function(e){var n=Jf(e,t,"button");return wi(n),R.some(!0)},c=T(T({},ki([Ri(function(e,n){Yf(e,t,"aria-descriptor").each(function(t){var n=$i("aria");Re(t.element,"id",n),Re(e.element,"aria-describedby",n)})})])),uh(R.some(u))),s={repositionMenus:function(t){oh.isOn(t)&&gC(t)}};return{uid:t.uid,dom:t.dom,components:e,apis:s,eventOrder:T(T({},t.eventOrder),(o={},o[Jo()]=["disabling","toggling","alloy.base.behaviour"],o)),events:c,behaviours:lf(t.splitDropdownBehaviours,[tC.config({others:{sandbox:function(e){var n=Jf(e,t,"arrow");return mC(t,e,{onOpen:function(){oh.on(n),oh.on(e)},onClose:function(){oh.off(n),oh.off(e)}})}}}),Bg.config({mode:"special",onSpace:a,onEnter:a,onDown:function(t){return u(t),R.some(!0)}}),$g.config({}),oh.config({toggleOnExecute:!1,aria:{mode:"expanded"}})]),domModification:{attributes:{role:t.role.getOr("button"),"aria-haspopup":!0}}}},apis:{repositionMenus:function(t,e){return t.repositionMenus(e)}}}),$A=function(t){return{isDisabled:function(){return Dd.isDisabled(t)},setDisabled:function(e){return Dd.set(t,e)}}},GA=function(t){return{setActive:function(e){oh.set(t,e)},isActive:function(){return oh.isOn(t)},isDisabled:function(){return Dd.isDisabled(t)},setDisabled:function(e){return Dd.set(t,e)}}},KA=function(t,e){return t.map(function(t){return{"aria-label":e.translate(t),title:e.translate(t)}}).getOr({})},XA=$i("focus-button"),YA=function(t,e,n,r,o,i){var u;return{dom:{tag:"button",classes:["tox-tbtn"].concat(e.isSome()?["tox-tbtn--select"]:[]),attributes:KA(n,i)},components:vy([t.map(function(t){return EO(t,i.icons)}),e.map(function(t){return AO(t,"tox-tbtn",i)})]),eventOrder:(u={},u[Do()]=["focusing","alloy.base.behaviour","common-button-display-events"],u),buttonBehaviours:uc([dy(i.isDisabled),cy(),Vg("common-button-display-events",[_i(Do(),function(t,e){e.event.prevent(),bi(t,XA)})])].concat(r.map(function(n){return FA.config({channel:n,initialData:{icon:t,text:e},renderComponents:function(t,e){return vy([t.icon.map(function(t){return EO(t,i.icons)}),t.text.map(function(t){return AO(t,"tox-tbtn",i)})])}})}).toArray()).concat(o.getOr([])))}},JA=function(t,e,n){var r,o=so(h),i=YA(t.icon,t.text,t.tooltip,R.none(),R.none(),n);return Gh.sketch({dom:i.dom,components:i.components,eventOrder:MO,buttonBehaviours:uc([Vg("toolbar-button-events",[(r={onAction:t.onAction,getApi:e.getApi},Pi(function(t,e){my(r,t)(function(e){yi(t,NO,{buttonApi:e}),r.onAction(e)})})),gy(e,o),hy(e,o)]),dy(function(){return t.disabled||n.isDisabled()}),cy()].concat(e.toolbarButtonBehaviours))})},QA=function(t,e,n){return JA(t,{toolbarButtonBehaviours:[].concat(n.length>0?[Vg("toolbarButtonWith",n)]:[]),getApi:$A,onSetup:t.onSetup},e)},ZA=function(t,e,n){return Jn(JA(t,{toolbarButtonBehaviours:[Fg.config({}),oh.config({toggleClass:"tox-tbtn--enabled",aria:{mode:"pressed"},toggleOnExecute:!1})].concat(n.length>0?[Vg("toolbarToggleButtonWith",n)]:[]),getApi:GA,onSetup:t.onSetup},e))},tN=function(t,e){var n,r=$i("channel-update-split-dropdown-display"),o=function(t){return{isDisabled:function(){return Dd.isDisabled(t)},setDisabled:function(e){return Dd.set(t,e)},setIconFill:function(e,n){Yu(t.element,'svg path[id="'+e+'"], rect[id="'+e+'"]').each(function(t){Re(t,"fill",n)})},setIconStroke:function(e,n){Yu(t.element,'svg path[id="'+e+'"], rect[id="'+e+'"]').each(function(t){Re(t,"stroke",n)})},setActive:function(e){Re(t.element,"aria-pressed",e),Yu(t.element,"span").each(function(n){t.getSystem().getByDom(n).each(function(t){return oh.set(t,e)})})},isActive:function(){return Yu(t.element,"span").exists(function(e){return t.getSystem().getByDom(e).exists(oh.isOn)})}}},i=so(h),u={getApi:o,onSetup:t.onSetup};return qA.sketch({dom:{tag:"div",classes:["tox-split-button"],attributes:T({"aria-pressed":!1},KA(t.tooltip,e.providers))},onExecute:function(e){t.onAction(o(e))},onItemExecute:function(t,e,n){},splitDropdownBehaviours:uc([fy(e.providers.isDisabled),cy(),Vg("split-dropdown-events",[_i(XA,$g.focus),gy(u,i),hy(u,i)]),yC.config({})]),eventOrder:(n={},n[ci()]=["alloy.base.behaviour","split-dropdown-events"],n),toggleClass:"tox-tbtn--enabled",lazySink:e.getSink,fetch:function(t,e,n){return function(r){return Fx(function(t){return e.fetch(t)}).map(function(o){return R.from(jw(Jn(kw($i("menu-value"),o,function(n){e.onItemAction(t(r),n)},e.columns,e.presets,$v.CLOSE_ON_EXECUTE,e.select.getOr(S),n),{movement:Tw(e.columns,e.presets),menuBehaviours:_b("auto"!==e.columns?[]:[Ri(function(t,n){Ob(t,4,Jv(e.presets)).each(function(e){var n=e.numRows,r=e.numColumns;Bg.setGridSize(t,n,r)})})])})))})}}(o,t,e.providers),parts:{menu:eb(0,t.columns,t.presets)},components:[qA.parts.button(YA(t.icon,t.text,R.none(),R.some(r),R.some([oh.config({toggleClass:"tox-tbtn--enabled",toggleOnExecute:!1})]),e.providers)),qA.parts.arrow({dom:{tag:"button",classes:["tox-tbtn","tox-split-button__chevron"],innerHtml:ev("chevron-down",e.providers.icons)},buttonBehaviours:uc([fy(e.providers.isDisabled),cy(),nv()])}),qA.parts["aria-descriptor"]({text:e.providers.translate("To open the popup, press Shift+Enter")})]})},eN=[{name:"history",items:["undo","redo"]},{name:"styles",items:["styleselect"]},{name:"formatting",items:["bold","italic"]},{name:"alignment",items:["alignleft","aligncenter","alignright","alignjustify"]},{name:"indentation",items:["outdent","indent"]},{name:"permanent pen",items:["permanentpen"]},{name:"comments",items:["addcomment"]}],nN=function(t,e){return function(n,r,o){var i=t(n).mapError(function(t){return Rr(t)}).getOrDie();return e(i,r,o)}},rN={button:nN(Mv,function(t,e){return n=t,r=e.backstage.shared.providers,QA(n,r,[]);var n,r}),togglebutton:nN(Bv,function(t,e){return n=t,r=e.backstage.shared.providers,ZA(n,r,[]);var n,r}),menubutton:nN(BE,function(t,e){return jO(t,"tox-tbtn",e.backstage,R.none())}),splitbutton:nN(function(t){return Nr("SplitButton",LE,t)},function(t,e){return tN(t,e.backstage.shared)}),grouptoolbarbutton:nN(function(t){return Nr("GroupToolbarButton",ME,t)},function(t,e,n){var r,o=n.ui.registry.getAll().buttons,i=((r={})[as]=e.backstage.shared.header.isPositionedAtTop()?_c.TopToBottom:_c.BottomToTop,r);switch(Xb(n)){case qv.floating:return function(t,e,n,r){var o=e.shared;return zD.sketch({lazySink:o.getSink,fetch:function(){return Fx(function(e){e(W(n(t.items),$D))})},markers:{toggledClass:"tox-tbtn--enabled"},parts:{button:YA(t.icon,t.text,t.tooltip,R.none(),R.none(),o.providers),toolbar:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:r}}}})}(t,e.backstage,function(t){return aN(n,{buttons:o,toolbar:t,allowToolbarGroups:!1},e,R.none())},i);default:throw new Error("Toolbar groups are only supported when using floating toolbar mode")}}),styleSelectButton:function(t,e){return function(t,e){var n=T({type:"advanced"},e.styleselect);return wA(t,e,LA(t,n))}(t,e.backstage)},fontsizeSelectButton:function(t,e){return function(t,e){return wA(t,e,zA(t))}(t,e.backstage)},fontSelectButton:function(t,e){return function(t,e){return wA(t,e,DA(t))}(t,e.backstage)},formatButton:function(t,e){return function(t,e){return wA(t,e,BA(t))}(t,e.backstage)},alignMenuButton:function(t,e){return function(t,e){return wA(t,e,TA(t))}(t,e.backstage)}},oN={styleselect:rN.styleSelectButton,fontsizeselect:rN.fontsizeSelectButton,fontselect:rN.fontSelectButton,formatselect:rN.formatButton,align:rN.alignMenuButton},iN=function(t){var e,n=t.toolbar,r=t.buttons;return!1===n?[]:void 0===n||!0===n?function(t){var e=W(eN,function(e){var n=G(e.items,function(e){return xt(t,e)||xt(oN,e)});return{name:e.name,items:n}});return G(e,function(t){return t.items.length>0})}(r):o(n)?(e=n.split("|"),W(e,function(t){return{items:t.trim().split(" ")}})):function(t){return g(t,function(t){return xt(t,"name")&&xt(t,"items")})}(n)?n:(console.error("Toolbar type should be string, string[], boolean or ToolbarGroup[]"),[])},uN=function(t,e,n,r,o,i){return wt(e,n.toLowerCase()).orThunk(function(){return i.bind(function(t){return lt(t,function(t){return wt(e,t+n.toLowerCase())})})}).fold(function(){return wt(oN,n.toLowerCase()).map(function(e){return e(t,o)}).orThunk(function(){return R.none()})},function(e){return"grouptoolbarbutton"!==e.type||r?function(t,e,n){return wt(rN,t.type).fold(function(){return console.error("skipping button defined by",t),R.none()},function(r){return R.some(r(t,e,n))})}(e,o,t):(console.warn("Ignoring the '"+n+"' toolbar button. Group toolbar buttons are only supported when using floating toolbar mode and cannot be nested."),R.none())})},aN=function(t,e,n,r){var o=iN(e),i=W(o,function(o){var i=Z(o.items,function(o){return 0===o.trim().length?[]:uN(t,e.buttons,o,e.allowToolbarGroups,n,r).toArray()});return{title:R.from(t.translate(o.name)),items:i}});return G(i,function(t){return t.items.length>0})},cN=function(t,e,n,r){var i=e.outerContainer,u=n.toolbar,a=n.buttons;if(g(u,o)){var c=u.map(function(e){var o={toolbar:e,buttons:a,allowToolbarGroups:n.allowToolbarGroups};return aN(t,o,{backstage:r},R.none())});iA.setToolbars(i,c)}else iA.setToolbar(i,aN(t,n,{backstage:r},R.none()))},sN=ue(),lN=sN.os.isiOS()&&sN.os.version.major<=12,fN=Object.freeze({__proto__:null,render:function(t,e,n,r,o){var i=so(0),u=e.outerContainer;mA(t);var c,s,l=Bt.fromDom(o.targetNode),f=Te(Oe(l));c=l,s=e.mothership,Dl(c,s,gn),El(f,e.uiMothership),t.on("PostRender",function(){cN(t,e,n,r),i.set(t.getWin().innerWidth),iA.setMenubar(u,cA(t,n)),iA.setSidebar(u,n.sidebar),function(t,e){var n=t.dom,r=t.getWin(),o=t.getDoc().documentElement,i=so(nn(r.innerWidth,r.innerHeight)),u=so(nn(o.offsetWidth,o.offsetHeight)),a=function(){var e=i.get();e.left===r.innerWidth&&e.top===r.innerHeight||(i.set(nn(r.innerWidth,r.innerHeight)),ew(t))},c=function(){var e=t.getDoc().documentElement,n=u.get();n.left===e.offsetWidth&&n.top===e.offsetHeight||(u.set(nn(e.offsetWidth,e.offsetHeight)),ew(t))},s=function(e){return function(t,e){return t.fire("ScrollContent",e)}(t,e)};n.bind(r,"resize",a),n.bind(r,"scroll",s);var l=Ic(Bt.fromDom(t.getBody()),"load",c),f=e.uiMothership.element;t.on("hide",function(){Ue(f,"display","none")}),t.on("show",function(){Xe(f,"display")}),t.on("NodeChange",c),t.on("remove",function(){l.unbind(),n.unbind(r,"resize",a),n.unbind(r,"scroll",s),r=null})}(t,e)});var d,m,g,h=iA.getSocket(u).getOrDie("Could not find expected socket element");if(lN){je(h.element,{overflow:"scroll","-webkit-overflow-scrolling":"touch"});var p=(d=function(){t.fire("ScrollContent")},m=20,g=null,{cancel:function(){a(g)||(clearTimeout(g),g=null)},throttle:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];a(g)&&(g=setTimeout(function(){g=null,d.apply(null,t)},m))}}),v=Hc(h.element,"scroll",p.throttle);t.on("remove",v.unbind)}ay(t,e),t.addCommand("ToggleSidebar",function(e,n){iA.toggleSidebar(u,n),t.fire("ToggleSidebar")}),t.addQueryValueHandler("ToggleSidebar",function(){return iA.whichSidebar(u)});var b=Xb(t);b!==qv.sliding&&b!==qv.floating||t.on("ResizeWindow ResizeEditor ResizeContent",function(){var n=t.getWin().innerWidth;n!==i.get()&&(iA.refreshToolbar(e.outerContainer),i.set(n))});var y={enable:function(){uy(e,!1)},disable:function(){uy(e,!0)},isDisabled:function(){return Dd.isDisabled(u)}};return{iframeContainer:h.element.dom,editorContainer:u.element.dom,api:y}}}),dN=function(t){return/^[0-9\.]+(|px)$/i.test(""+t)?R.some(parseInt(""+t,10)):R.none()},mN=function(t){return m(t)?t+"px":t},gN=function(t,e,n){var r=e.filter(function(e){return t<e}),o=n.filter(function(e){return t>e});return r.or(o).getOr(t)},hN=function(t){return function(t){var e=Hb(t),n=Vb(t),r=jb(t);return dN(e).map(function(t){return gN(t,n,r)})}(t).getOr(Hb(t))},pN=function(t){var e=Ib(t),n=Fb(t),r=Ub(t);return dN(e).map(function(t){return gN(t,n,r)})},vN=function(t,e,n,r,o){var i=n.uiMothership,u=n.outerContainer,a=Lb.DOM,c=ey(t),s=oy(t),l=Ub(t).or(pN(t)),f=r.shared.header,d=f.isPositionedAtTop,m=Xb(t),g=m===qv.sliding||m===qv.floating,h=so(!1),p=function(){return h.get()&&!t.removed},b=function(t){return g?t.fold(v(0),function(t){return t.components().length>1?Ze(t.components()[1].element):0}):0},y=function(){i.broadcastOn([Ul()],{})},w=function(t){if(void 0===t&&(t=!1),p()){var n,r,i,a,f;if(c||(n=l.getOrThunk(function(){var t=dN(qe(Ne(),"margin-left")).getOr(0);return cn(Ne())-on(e).left+t}),Ue(o.get().element,"max-width",n+"px")),g&&iA.refreshToolbar(u),c||(r=iA.getToolbar(u),i=b(r),a=Dn(e),f=d()?Math.max(a.y-Ze(o.get().element)+i,0):a.bottom,je(u.element,{position:"absolute",top:Math.round(f)+"px",left:Math.round(a.x)+"px"})),s){var m=o.get();t?SE.reset(m):SE.refresh(m)}y()}},x=function(n){if(void 0===n&&(n=!0),!c&&s&&p()){var r=f.getDockingMode(),i=function(n){switch(Qb(t)){case Kb.auto:var r=iA.getToolbar(u),o=b(r),i=Ze(n.element)-o,a=Dn(e);if(a.y>i)return"top";var c=ge(e),s=Math.max(c.dom.scrollHeight,Ze(c));return a.bottom<s-i?"bottom":Nn().bottom<a.bottom-i?"bottom":"top";case Kb.bottom:return"bottom";case Kb.top:default:return"top"}}(o.get());i!==r&&(!function(t){var e=o.get();SE.setModes(e,[t]),f.setDockingMode(t);var n=d()?_c.TopToBottom:_c.BottomToTop;Re(e.element,as,n)}(i),n&&w(!0))}};return{isVisible:p,isPositionedAtTop:d,show:function(){h.set(!0),Ue(u.element,"display","flex"),a.addClass(t.getBody(),"mce-edit-focus"),Xe(i.element,"display"),x(!1),w()},hide:function(){h.set(!1),n.outerContainer&&(Ue(u.element,"display","none"),a.removeClass(t.getBody(),"mce-edit-focus")),Ue(i.element,"display","none")},update:w,updateMode:x,repositionPopups:y}},bN=function(t,e){var n=Dn(t);return{pos:e?n.y:n.bottom,bounds:n}},yN=Object.freeze({__proto__:null,render:function(t,e,n,r,o){var i=e.mothership,u=e.uiMothership,a=e.outerContainer,c=so(null),s=Bt.fromDom(o.targetNode),l=vN(t,s,e,r,c),f=function(t){return t.getParam("toolbar_persist",!1,"boolean")}(t);gA(t);var d=function(){if(c.get())l.show();else{c.set(iA.getHeader(a).getOrDie());var o=ny(t);El(o,i),El(o,u),cN(t,e,n,r),iA.setMenubar(a,cA(t,n)),l.show(),function(t,e,n,r){var o=so(bN(e,n.isPositionedAtTop())),i=function(r){var i=bN(e,n.isPositionedAtTop()),u=i.pos,a=i.bounds,c=o.get(),s=c.pos,l=c.bounds,f=a.height!==l.height||a.width!==l.width;o.set({pos:u,bounds:a}),f&&ew(t,r),n.isVisible()&&(s!==u?n.update(!0):f&&(n.updateMode(),n.repositionPopups()))};r||(t.on("activate",n.show),t.on("deactivate",n.hide)),t.on("SkinLoaded ResizeWindow",function(){return n.update(!0)}),t.on("NodeChange keydown",function(t){$h.requestAnimationFrame(function(){return i(t)})}),t.on("ScrollWindow",function(){return n.updateMode()});var u=Bc();u.set(Ic(Bt.fromDom(t.getBody()),"load",i)),t.on("remove",function(){u.clear()})}(t,s,l,f),t.nodeChanged()}};t.on("show",d),t.on("hide",l.hide),f||(t.on("focus",d),t.on("blur",l.hide)),t.on("init",function(){(t.hasFocus()||f)&&d()}),ay(t,e);var m={show:function(){l.show()},hide:function(){l.hide()},enable:function(){uy(e,!1)},disable:function(){uy(e,!0)},isDisabled:function(){return Dd.isDisabled(a)}};return{editorContainer:a.element.dom,api:m}}}),wN=function(t,e){return _i(NO,function(n,r){var o=function(t){return{hide:function(){return bi(t,ei())},getValue:function(){return af.getValue(t)}}}(t.get(n));e.onAction(o,r.event.buttonApi)})},xN=function(t,e,n){var r={backstage:{shared:{providers:n}}};return"contextformtogglebutton"===e.type?function(t,e,n){var r=e.original;r.primary;var o=_(r,["primary"]),i=Mr(Bv(T(T({},o),{type:"togglebutton",onAction:h})));return ZA(i,n.backstage.shared.providers,[wN(t,e)])}(t,e,r):function(t,e,n){var r=e.original;r.primary;var o=_(r,["primary"]),i=Mr(Mv(T(T({},o),{type:"button",onAction:h})));return QA(i,n.backstage.shared.providers,[wN(t,e)])}(t,e,r)},CN=function(t,e){var n=t.label.fold(function(){return{}},function(t){return{"aria-label":t}}),r=Xh(Nx.sketch({inputClasses:["tox-toolbar-textfield","tox-toolbar-nav-js"],data:t.initValue(),inputAttributes:n,selectOnFocus:!0,inputBehaviours:uc([Bg.config({mode:"special",onEnter:function(t){return o.findPrimary(t).map(function(t){return wi(t),!0})},onLeft:function(t,e){return e.cut(),R.none()},onRight:function(t,e){return e.cut(),R.none()}})])})),o=function(t,e,n){var r=W(e,function(e){return Xh(xN(t,e,n))});return{asSpecs:function(){return W(r,function(t){return t.asSpec()})},findPrimary:function(t){return lt(e,function(e,n){return e.primary?R.from(r[n]).bind(function(e){return e.getOpt(t)}).filter(x(Dd.isDisabled)):R.none()})}}}(r,t.commands,e);return[{title:R.none(),items:[r.asSpec()]},{title:R.none(),items:o.asSpecs()}]},SN=CN,kN=function(t,e,n){return void 0===n&&(n=.01),e.bottom-t.y>=n&&t.bottom-e.y>=n},ON=function(t){var e=function(t){var e=t.getBoundingClientRect();if(e.height<=0&&e.width<=0){var n=xe(Bt.fromDom(t.startContainer),t.startOffset).element;return(Ft(n)?pe(n):R.some(n)).filter(It).map(function(t){return t.dom.getBoundingClientRect()}).getOr(e)}return e}(t.selection.getRng());if(t.inline){var n=xn();return En(n.left+e.left,n.top+e.top,e.width,e.height)}var r=An(Bt.fromDom(t.getBody()));return En(r.x+e.left,r.y+e.top,e.width,e.height)},TN=function(t,e,n,r){void 0===r&&(r=0);var o=kn(window),i=Dn(Bt.fromDom(t.getContentAreaContainer())),u=Wb(t)||qb(t)||Gb(t),a=function(t,e,n){var r=Math.max(t.x+n,e.x);return{x:r,width:Math.min(t.right-n,e.right)-r}}(i,o,r),c=a.x,s=a.width;if(t.inline&&!u)return En(c,o.y,s,o.height);var l=function(t,e,n,r,o,i){var u=Bt.fromDom(t.getContainer()),a=Yu(u,".tox-editor-header").getOr(u),c=Dn(a),s=c.y>=e.bottom,l=r&&!s;if(t.inline&&l)return{y:Math.max(c.bottom+i,n.y),bottom:n.bottom};if(t.inline&&!l)return{y:n.y,bottom:Math.min(c.y-i,n.bottom)};var f="line"===o?Dn(u):e;return l?{y:Math.max(c.bottom+i,n.y),bottom:Math.min(f.bottom-i,n.bottom)}:{y:Math.max(f.y+i,n.y),bottom:Math.min(c.y-i,n.bottom)}}(t,i,o,e.header.isPositionedAtTop(),n,r),f=l.y,d=l.bottom;return En(c,f,s,d-f)},_N={valignCentre:[],alignCentre:[],alignLeft:["tox-pop--align-left"],alignRight:["tox-pop--align-right"],right:["tox-pop--right"],left:["tox-pop--left"],bottom:["tox-pop--bottom"],top:["tox-pop--top"],inset:["tox-pop--inset"]},EN={maxHeightFunction:Jc(),maxWidthFunction:_D()},DN=function(t){return"node"===t},AN=function(t,e,n,r,o){var i=ON(t),u=r.lastElement().exists(function(t){return se(n,t)});return function(t,e){var n=t.selection.getRng(),r=xe(Bt.fromDom(n.startContainer),n.startOffset);return n.startContainer===n.endContainer&&n.startOffset===n.endOffset-1&&se(r.element,e)}(t,n)?u?jh:Hh:u?function(t,e,n){var r=Ge(t,"position");Ue(t,"position",e);var o=n(t);return r.each(function(e){return Ue(t,"position",e)}),o}(e,r.getMode(),function(){return kN(i,Dn(e))&&!r.isReposition()?qh:jh}):("fixed"===r.getMode()?o.y+xn().top:o.y)+(Ze(e)+12)<=i.y?Hh:Ih},NN=function(t,e,n,r){var o=function(e){return DN(r)?[function(e){return function(r,o,i,u,a){var c=AN(t,u,e,n,a),s=T(T({},r),{y:a.y,height:a.height});return T(T({},c(s,o,i,u,a)),{alwaysFit:!0})}}(e)]:[]};return e?{onLtr:function(t){return[Wa,Ia,Fa,Va,Ua,ja].concat(o(t))},onRtl:function(t){return[Wa,Fa,Ia,Ua,Va,ja].concat(o(t))}}:{onLtr:function(t){return[ja,Wa,Va,Ia,Ua,Fa].concat(o(t))},onRtl:function(t){return[ja,Wa,Ua,Fa,Va,Ia].concat(o(t))}}},MN=function(t,e){var n=G(e,function(e){return e.predicate(t.dom)}),r=$(n,function(t){return"contexttoolbar"===t.type});return{contextToolbars:r.pass,contextForms:r.fail}},zN=function(t,e,n){var r=MN(t,e);if(r.contextForms.length>0)return R.some({elem:t,toolbars:[r.contextForms[0]]});var o=MN(t,n);if(o.contextForms.length>0)return R.some({elem:t,toolbars:[o.contextForms[0]]});if(r.contextToolbars.length>0||o.contextToolbars.length>0){var i=function(t){if(t.length<=1)return t;var e=function(e){return V(t,function(t){return t.position===e})},n=function(e){return G(t,function(t){return t.position===e})},r=e("selection"),o=e("node");if(r||o){if(o&&r){var i=n("node"),u=W(n("selection"),function(t){return T(T({},t),{position:"node"})});return i.concat(u)}return n(r?"selection":"node")}return n("line")}(r.contextToolbars.concat(o.contextToolbars));return R.some({elem:t,toolbars:i})}return R.none()},RN=function(t,e,n){return t(e)?R.none():bo(e,function(t){if(It(t)){var e=MN(t,n.inNodeScope),r=e.contextToolbars,o=e.contextForms,i=o.length>0?o:function(t){if(t.length<=1)return t;var e=function(e){return Y(t,function(t){return t.position===e})};return e("selection").orThunk(function(){return e("node")}).orThunk(function(){return e("line")}).map(function(t){return t.position}).fold(function(){return[]},function(e){return G(t,function(t){return t.position===e})})}(r);return i.length>0?R.some({elem:t,toolbars:i}):R.none()}return R.none()},t)},BN=function(t,e){var n={},r=[],o=[],i={},u={},a=function(t,a){var c=Mr(Nr("ContextForm",Uv,a));n[t]=c,c.launch.map(function(n){i["form:"+t]=T(T({},a.launch),{type:"contextformtogglebutton"===n.type?"togglebutton":"button",onAction:function(){e(c)}})}),"editor"===c.scope?o.push(c):r.push(c),u[t]=c},c=function(t,e){var n;(n=e,Nr("ContextToolbar",jv,n)).each(function(n){"editor"===e.scope?o.push(n):r.push(n),u[t]=n})},s=ft(t);return q(s,function(e){var n=t[e];"contextform"===n.type?a(e,n):"contexttoolbar"===n.type&&c(e,n)}),{forms:n,inNodeScope:r,inEditorScope:o,lookupTable:u,formNavigators:i}},LN=$i("forward-slide"),PN=$i("backward-slide"),HN=$i("change-slide-event"),IN=function(t,e,n,r){var o,i,u=r.backstage,a=u.shared,c=ue().deviceType.isTouch,s=Lc(),l=Lc(),f=Lc(),d=Vu((o={sink:n,onEscape:function(){return t.focus(),R.some(!0)}},i=so([]),_h.sketch({dom:{tag:"div",classes:["tox-pop"]},fireDismissalEventInstead:{event:"doNotDismissYet"},onShow:function(t){i.set([]),_h.getContent(t).each(function(t){Xe(t.element,"visibility")}),Tu(t.element,"tox-pop--resizing"),Xe(t.element,"width")},inlineBehaviours:uc([Vg("context-toolbar-events",[zi(Uo(),function(t,e){"width"===e.event.raw.propertyName&&(Tu(t.element,"tox-pop--resizing"),Xe(t.element,"width"))}),_i(HN,function(t,e){var n=t.element;Xe(n,"width");var r=cn(n);_h.setContent(t,e.event.contents),ku(n,"tox-pop--resizing");var o=cn(n);Ue(n,"width",r+"px"),_h.getContent(t).each(function(t){e.event.focus.bind(function(t){return hc(t),bc(n)}).orThunk(function(){return Bg.focusIn(t),vc(Oe(n))})}),$h.setTimeout(function(){Ue(t.element,"width",o+"px")},0)}),_i(LN,function(t,e){_h.getContent(t).each(function(e){i.set(i.get().concat([{bar:e,focus:vc(Oe(t.element))}]))}),yi(t,HN,{contents:e.event.forwardContents,focus:R.none()})}),_i(PN,function(t,e){ct(i.get()).each(function(e){i.set(i.get().slice(0,i.get().length-1)),yi(t,HN,{contents:Uu(e.bar),focus:e.focus})})})]),Bg.config({mode:"special",onEscape:function(t){return ct(i.get()).fold(function(){return o.onEscape()},function(e){return bi(t,PN),R.some(!0)})}})]),lazySink:function(){return Rn.value(o.sink)}}))),m=function(){var e=f.get().getOr("node"),n=DN(e)?1:0;return TN(t,a,e,n)},g=function(){return!(t.removed||c()&&u.isContextMenuOpen())},p=function(){if(g()){var e=m(),n=St(f.get(),"node")?function(t,e){return e.filter(Ae).map(An).getOrThunk(function(){return ON(t)})}(t,s.get()):ON(t);return e.height<=0||!kN(n,e)}return!0},v=function(){s.clear(),l.clear(),f.clear(),_h.hide(d)},b=function(){if(_h.isOpen(d)){var t=d.element;Xe(t,"display"),p()?Ue(t,"display","none"):(l.set(0),_h.reposition(d))}},y=function(e){return{dom:{tag:"div",classes:["tox-pop__dialog"]},components:[e],behaviours:uc([Bg.config({mode:"acyclic"}),Vg("pop-dialog-wrap-events",[Ri(function(e){t.shortcuts.add("ctrl+F9","focus statusbar",function(){return Bg.focusIn(e)})}),Bi(function(e){t.shortcuts.remove("ctrl+F9")})])])}},w=jt(function(){return BN(e,function(t){var e=x([t]);yi(d,LN,{forwardContents:y(e)})})}),x=function(e){var n=t.ui.registry.getAll().buttons,o=w(),i=T(T({},n),o.formNavigators),u=Xb(t)===qv.scrolling?qv.scrolling:qv.default,c=Q(W(e,function(e){return"contexttoolbar"===e.type?function(e,n){return aN(t,{buttons:e,toolbar:n.items,allowToolbarGroups:!1},r,R.some(["form:"]))}(i,e):function(t,e){return SN(t,e)}(e,a.providers)}));return JD({type:u,uid:$i("context-toolbar"),initGroups:c,onEscape:R.none,cyclicKeying:!0,providers:a.providers})},C=function(e,r){var o="node"===e?a.anchors.node(r):a.anchors.cursor(),i=function(t,e,n,r){return"line"===e?{bubble:ns(12,0,_N),layouts:{onLtr:function(){return[qa]},onRtl:function(){return[$a]}},overrides:EN}:{bubble:ns(0,12,_N,1/12),layouts:NN(t,n,r,e),overrides:EN}}(t,e,c(),{lastElement:s.get,isReposition:function(){return St(l.get(),0)},getMode:function(){return bl.getMode(n)}});return Jn(o,i)},S=function(t,e){if(k.cancel(),g()){var r=x(t),o=t[0].position,i=C(o,e);f.set(o),l.set(1);var u=d.element;Xe(u,"display"),function(t){return St(Ot(t,s.get(),se),!0)}(e)||(Tu(u,"tox-pop--transition"),bl.reset(n,d)),_h.showWithinBounds(d,y(r),{anchor:i,transition:{classes:["tox-pop--transition"],mode:"placement"}},function(){return R.some(m())}),e.fold(s.clear,s.set),p()&&Ue(u,"display","none")}},k=sv(function(){t.hasFocus()&&!t.removed&&(_u(d.element,"tox-pop--transition")?k.throttle():function(t,e){var n=Bt.fromDom(e.getBody()),r=function(t){return se(t,n)},o=Bt.fromDom(e.selection.getNode());return function(t){return!r(t)&&!fe(n,t)}(o)?R.none():zN(o,t.inNodeScope,t.inEditorScope).orThunk(function(){return RN(r,o,t)})}(w(),t).fold(v,function(t){S(t.toolbars,R.some(t.elem))}))},17);t.on("init",function(){t.on("remove",v),t.on("ScrollContent ScrollWindow ObjectResized ResizeEditor longpress",b),t.on("click keyup focus SetContent",k.throttle),t.on("contexttoolbar-hide",v),t.on("contexttoolbar-show",function(e){var n=w();wt(n.lookupTable,e.toolbarKey).each(function(n){S([n],Tt(e.target!==t,e.target)),_h.getContent(d).each(Bg.focusIn)})}),t.on("focusout",function(e){$h.setEditorTimeout(t,function(){bc(n.element).isNone()&&bc(d.element).isNone()&&v()},0)}),t.on("SwitchMode",function(){t.mode.isReadOnly()&&v()}),t.on("AfterProgressState",function(e){e.state?v():t.hasFocus()&&k.throttle()}),t.on("NodeChange",function(t){bc(d.element).fold(k.throttle,h)})})},FN={unsupportedLength:["em","ex","cap","ch","ic","rem","lh","rlh","vw","vh","vi","vb","vmin","vmax","cm","mm","Q","in","pc","pt","px"],fixed:["px","pt"],relative:["%"],empty:[""]},VN=(CA=["Infinity","[0-9]+\\."+(xA=function(t){return"(?:"+t+")?"})("[0-9]+")+xA("[eE][+-]?[0-9]+"),"\\.[0-9]+"+xA("[eE][+-]?[0-9]+"),"[0-9]+"+xA("[eE][+-]?[0-9]+")].join("|"),new RegExp("^([+-]?(?:"+CA+"))(.*)$")),UN=function(t,e){return R.from(VN.exec(t)).bind(function(t){var n=Number(t[1]),r=t[2];return function(t,e){return V(e,function(e){return V(FN[e],function(e){return t===e})})}(r,e)?R.some({value:n,unit:r}):R.none()})},jN=function(t,e){var n=function(){var n=e.getOptions(t),r=e.getCurrent(t).map(e.hash),o=Lc();return W(n,function(n){return{type:"togglemenuitem",text:e.display(n),onSetup:function(i){var u=function(t){t&&(o.on(function(t){return t.setActive(!1)}),o.set(i)),i.setActive(t)};u(St(r,e.hash(n)));var a=e.watcher(t,n,u);return function(){o.clear(),a()}},onAction:function(){return e.setCurrent(t,n)}}})};t.ui.registry.addMenuButton(e.name,{tooltip:e.text,icon:e.icon,fetch:function(t){return t(n())},onSetup:e.onToolbarSetup}),t.ui.registry.addNestedMenuItem(e.name,{type:"nestedmenuitem",text:e.text,getSubmenuItems:n,onSetup:e.onMenuSetup})},WN={name:"lineheight",text:"Line height",icon:"line-height",getOptions:function(t){return t.getParam("lineheight_formats","1 1.1 1.2 1.3 1.4 1.5 2","string").split(" ")},hash:function(t){return function(t,e){return UN(t,e).map(function(t){return t.value+t.unit})}(t,["fixed","relative","empty"]).getOr(t)},display:b,watcher:function(t,e,n){return t.formatter.formatChanged("lineheight",n,!1,{value:e}).unbind},getCurrent:function(t){return R.from(t.queryCommandValue("LineHeight"))},setCurrent:function(t,e){return t.execCommand("LineHeight",!1,e)}},qN=function(t){jN(t,WN),function(t){return R.from(function(t){return t.getParam("content_langs",void 0,"array")}(t)).map(function(e){return{name:"language",text:"Language",icon:"language",getOptions:v(e),hash:function(t){return s(t.customCode)?t.code:t.code+"/"+t.customCode},display:function(t){return t.title},watcher:function(t,e,n){return t.formatter.formatChanged("lang",n,!1,{value:e.code,customValue:e.customCode}).unbind},getCurrent:function(t){var e=Bt.fromDom(t.selection.getNode());return yo(e,function(t){return R.some(t).filter(It).bind(function(t){return Pe(t,"lang").map(function(e){return{code:e,customCode:Pe(t,"data-mce-lang").getOrUndefined(),title:""}})})})},setCurrent:function(t,e){return t.execCommand("Lang",!1,e)},onToolbarSetup:function(e){var n=Bc();return e.setActive(t.formatter.match("lang",{},void 0,!0)),n.set(t.formatter.formatChanged("lang",e.setActive,!0)),n.clear}}})}(t).each(function(e){return jN(t,e)})},$N=function(t,e){!function(t,e){var n=yA(0,e,TA(t));t.ui.registry.addNestedMenuItem("align",{text:e.shared.providers.translate("Align"),getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})}(t,e),function(t,e){var n=yA(0,e,DA(t));t.ui.registry.addNestedMenuItem("fontformats",{text:e.shared.providers.translate("Fonts"),getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})}(t,e),function(t,e){var n=T({type:"advanced"},e.styleselect),r=yA(0,e,LA(t,n));t.ui.registry.addNestedMenuItem("formats",{text:"Formats",getSubmenuItems:function(){return r.items.validateItems(r.getStyleItems())}})}(t,e),function(t,e){var n=yA(0,e,BA(t));t.ui.registry.addNestedMenuItem("blockformats",{text:"Blocks",getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})}(t,e),function(t,e){var n=yA(0,e,zA(t));t.ui.registry.addNestedMenuItem("fontsizes",{text:"Font sizes",getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})}(t,e)},GN=function(t){t.ui.registry.addButton("outdent",{tooltip:"Decrease indent",icon:"outdent",onSetup:function(t){return pA(t,"NodeChange",function(e){e.setDisabled(!t.queryCommandState("outdent"))})}(t),onAction:bA(t,"outdent")}),t.ui.registry.addButton("indent",{tooltip:"Increase indent",icon:"indent",onAction:bA(t,"indent")})},KN=function(t,e){return function(){t.execCommand("mceToggleFormat",!1,e)}},XN=function(t){!function(t){Ck.each([{name:"bold",text:"Bold",icon:"bold"},{name:"italic",text:"Italic",icon:"italic"},{name:"underline",text:"Underline",icon:"underline"},{name:"strikethrough",text:"Strikethrough",icon:"strike-through"},{name:"subscript",text:"Subscript",icon:"subscript"},{name:"superscript",text:"Superscript",icon:"superscript"}],function(e,n){t.ui.registry.addToggleButton(e.name,{tooltip:e.text,icon:e.icon,onSetup:hA(t,e.name),onAction:KN(t,e.name)})});for(var e=1;e<=6;e++){var n="h"+e;t.ui.registry.addToggleButton(n,{text:n.toUpperCase(),tooltip:"Heading "+e,onSetup:hA(t,n),onAction:KN(t,n)})}}(t),function(t){Ck.each([{name:"cut",text:"Cut",action:"Cut",icon:"cut"},{name:"copy",text:"Copy",action:"Copy",icon:"copy"},{name:"paste",text:"Paste",action:"Paste",icon:"paste"},{name:"help",text:"Help",action:"mceHelp",icon:"help"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all"},{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document"},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting"},{name:"remove",text:"Remove",action:"Delete",icon:"remove"}],function(e){t.ui.registry.addButton(e.name,{tooltip:e.text,icon:e.icon,onAction:bA(t,e.action)})})}(t),function(t){Ck.each([{name:"blockquote",text:"Blockquote",action:"mceBlockQuote",icon:"quote"}],function(e){t.ui.registry.addToggleButton(e.name,{tooltip:e.text,icon:e.icon,onAction:bA(t,e.action),onSetup:hA(t,e.name)})})}(t)},YN=function(t){XN(t),function(t){Ck.each([{name:"bold",text:"Bold",action:"Bold",icon:"bold",shortcut:"Meta+B"},{name:"italic",text:"Italic",action:"Italic",icon:"italic",shortcut:"Meta+I"},{name:"underline",text:"Underline",action:"Underline",icon:"underline",shortcut:"Meta+U"},{name:"strikethrough",text:"Strikethrough",action:"Strikethrough",icon:"strike-through",shortcut:""},{name:"subscript",text:"Subscript",action:"Subscript",icon:"subscript",shortcut:""},{name:"superscript",text:"Superscript",action:"Superscript",icon:"superscript",shortcut:""},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting",shortcut:""},{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document",shortcut:""},{name:"cut",text:"Cut",action:"Cut",icon:"cut",shortcut:"Meta+X"},{name:"copy",text:"Copy",action:"Copy",icon:"copy",shortcut:"Meta+C"},{name:"paste",text:"Paste",action:"Paste",icon:"paste",shortcut:"Meta+V"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all",shortcut:"Meta+A"}],function(e){t.ui.registry.addMenuItem(e.name,{text:e.text,icon:e.icon,shortcut:e.shortcut,onAction:bA(t,e.action)})}),t.ui.registry.addMenuItem("codeformat",{text:"Code",icon:"sourcecode",onAction:KN(t,"code")})}(t)},JN=function(t,e){return pA(t,"Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",function(n){n.setDisabled(t.mode.isReadOnly()||!t.undoManager[e]())})},QN=function(t){!function(t){t.ui.registry.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onSetup:JN(t,"hasUndo"),onAction:bA(t,"undo")}),t.ui.registry.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onSetup:JN(t,"hasRedo"),onAction:bA(t,"redo")})}(t),function(t){t.ui.registry.addButton("undo",{tooltip:"Undo",icon:"undo",disabled:!0,onSetup:JN(t,"hasUndo"),onAction:bA(t,"undo")}),t.ui.registry.addButton("redo",{tooltip:"Redo",icon:"redo",disabled:!0,onSetup:JN(t,"hasRedo"),onAction:bA(t,"redo")})}(t)},ZN=function(t){t.ui.registry.addToggleMenuItem("visualaid",{text:"Visual aids",onSetup:function(t){return pA(t,"VisualAid",function(e){e.setActive(t.hasVisual)})}(t),onAction:bA(t,"mceToggleVisualAid")})},tM=function(t){!function(t){t.ui.registry.addButton("visualaid",{tooltip:"Visual aids",text:"Visual aids",onAction:bA(t,"mceToggleVisualAid")})}(t),ZN(t)},eM=function(t,e){!function(t){q([{name:"alignleft",text:"Align left",cmd:"JustifyLeft",icon:"align-left"},{name:"aligncenter",text:"Align center",cmd:"JustifyCenter",icon:"align-center"},{name:"alignright",text:"Align right",cmd:"JustifyRight",icon:"align-right"},{name:"alignjustify",text:"Justify",cmd:"JustifyFull",icon:"align-justify"}],function(e){t.ui.registry.addToggleButton(e.name,{tooltip:e.text,icon:e.icon,onAction:bA(t,e.cmd),onSetup:hA(t,e.name)})}),t.ui.registry.addButton("alignnone",{tooltip:"No alignment",icon:"align-none",onAction:bA(t,"JustifyNone")})}(t),YN(t),$N(t,e),QN(t),function(t){!function(t){t.addCommand("mceApplyTextcolor",function(e,n){!function(t,e,n){t.undoManager.transact(function(){t.focus(),t.formatter.apply(e,{value:n}),t.nodeChanged()})}(t,e,n)}),t.addCommand("mceRemoveTextcolor",function(e){!function(t,e){t.undoManager.transact(function(){t.focus(),t.formatter.remove(e,{value:null},null,!0),t.nodeChanged()})}(t,e)})}(t);var e=so("#000000"),n=so("#000000");xw(t,"forecolor","forecolor","Text color",e),xw(t,"backcolor","hilitecolor","Background color",n),Cw(t,"forecolor","forecolor","Text color"),Cw(t,"backcolor","hilitecolor","Background color")}(t),tM(t),function(t){GN(t)}(t),qN(t)},nM=function(t,e){return{type:"makeshift",x:t,y:e}},rM=function(t){return"longpress"===t.type||0===t.type.indexOf("touch")},oM=function(t,e){var n=Lb.DOM.getPos(t);return function(t,e,n){return nM(t.x+e,t.y+n)}(e,n.x,n.y)},iM=function(t,e){return"contextmenu"===e.type||"longpress"===e.type?t.inline?function(t){if(rM(t)){var e=t.touches[0];return nM(e.pageX,e.pageY)}return nM(t.pageX,t.pageY)}(e):oM(t.getContentAreaContainer(),function(t){if(rM(t)){var e=t.touches[0];return nM(e.clientX,e.clientY)}return nM(t.clientX,t.clientY)}(e)):uM(t)},uM=function(t){return{type:"selection",root:Bt.fromDom(t.selection.getNode())}},aM=function(t,e,n){switch(n){case"node":return function(t){return{type:"node",node:R.some(Bt.fromDom(t.selection.getNode())),root:Bt.fromDom(t.getBody())}}(t);case"point":return iM(t,e);case"selection":return uM(t)}},cM=function(t,e,n,r,o,i){var u=n(),a=aM(t,e,i);VO(u,$v.CLOSE_ON_EXECUTE,r,!1).map(function(t){e.preventDefault(),_h.showMenuAt(o,{anchor:a},{menu:{markers:Zv("normal")},data:t})})},sM={onLtr:function(){return[Wa,Ia,Fa,Va,Ua,ja,Hh,Ih,Ph,Bh,Lh,Rh]},onRtl:function(){return[Wa,Fa,Ia,Ua,Va,ja,Hh,Ih,Lh,Rh,Ph,Bh]}},lM={valignCentre:[],alignCentre:[],alignLeft:["tox-pop--align-left"],alignRight:["tox-pop--align-right"],right:["tox-pop--right"],left:["tox-pop--left"],bottom:["tox-pop--bottom"],top:["tox-pop--top"]},fM=function(t,e,n,r,o,i,u){var a=function(t,e,n){var r=aM(t,e,n);return T({bubble:ns(0,"point"===n?12:0,lM),layouts:sM,overrides:{maxWidthFunction:_D(),maxHeightFunction:Jc()}},r)}(t,e,i);VO(n,$v.CLOSE_ON_EXECUTE,r,!0).map(function(n){e.preventDefault(),_h.showMenuWithinBounds(o,{anchor:a},{menu:{markers:Zv("normal"),highlightImmediately:u},data:n,type:"horizontal"},function(){return R.some(TN(t,r.shared,"node"===i?"node":"selection"))}),t.fire("contexttoolbar-hide")})},dM=function(t,e,n,r,o,i){var u=ue(),a=u.os.isiOS(),c=u.os.isOSX(),s=u.os.isAndroid(),l=u.deviceType.isTouch(),f=function(){var u=n();fM(t,e,u,r,o,i,!(s||a||c&&l))};if((c||a)&&"node"!==i){var d=function(){!function(t){var e=t.selection.getRng(),n=function(){$h.setEditorTimeout(t,function(){t.selection.setRng(e)},10),i()};t.once("touchend",n);var r=function(t){t.preventDefault(),t.stopImmediatePropagation()};t.on("mousedown",r,!0);var o=function(){return i()};t.once("longpresscancel",o);var i=function(){t.off("touchend",n),t.off("longpresscancel",o),t.off("mousedown",r)}}(t),f()};!function(t,e){var n=t.selection;if(n.isCollapsed()||e.touches.length<1)return!1;var r=e.touches[0],o=n.getRng();return Gs(t.getWin(),Es.domRange(o)).exists(function(t){return t.left<=r.clientX&&t.right>=r.clientX&&t.top<=r.clientY&&t.bottom>=r.clientY})}(t,e)?(t.once("selectionchange",d),t.once("touchend",function(){return t.off("selectionchange",d)})):d()}else f()},mM=function(t){return"string"==typeof t?t.split(/[ ,]/):t},gM=function(t){return t.getParam("contextmenu_never_use_native",!1,"boolean")},hM=function(t){return function(t,e,n){var r=t.ui.registry.getAll().contextMenus;return R.from(t.getParam(e)).map(mM).getOrThunk(function(){return G(mM(n),function(t){return xt(r,t)})})}(t,"contextmenu","link linkchecker image imagetools table spellchecker configurepermanentpen")},pM=function(t){return o(t)?"|"===t:"separator"===t.type},vM={type:"separator"},bM=function(t){var e,n=function(t){return{text:t.text,icon:t.icon,disabled:t.disabled,shortcut:t.shortcut}};if(o(t))return t;switch(t.type){case"separator":return vM;case"submenu":return T(T({type:"nestedmenuitem"},n(t)),{getSubmenuItems:function(){var e=t.getSubmenuItems();return o(e)?e:W(e,bM)}});default:return T(T({type:"menuitem"},n(t)),{onAction:(e=t.onAction,function(){return e()})})}},yM=function(t,e){if(0===e.length)return t;var n=ct(t).filter(function(t){return!pM(t)}).fold(function(){return[]},function(t){return[vM]});return t.concat(n).concat(e).concat([vM])},wM=function(t,e){return"longpress"!==e.type&&(2!==e.button||e.target===t.getBody()&&""===e.pointerType)},xM=function(t,e){return wM(t,e)?t.selection.getStart(!0):e.target},CM=function(t,e,n){var r=ue().deviceType.isTouch,i=Vu(_h.sketch({dom:{tag:"div"},lazySink:e,onEscape:function(){return t.focus()},onShow:function(){return n.setContextMenuState(!0)},onHide:function(){return n.setContextMenuState(!1)},fireDismissalEventInstead:{},inlineBehaviours:uc([Vg("dismissContextMenu",[_i(li(),function(e,n){Fl.close(e),t.focus()})])])})),u=function(t){return _h.hide(i)},a=function(e){if(gM(t)&&e.preventDefault(),!function(t,e){return e.ctrlKey&&!gM(t)}(t,e)&&!function(t){return!1===t.getParam("contextmenu")}(t)){var u=function(t,e){var n=function(t){return t.getParam("contextmenu_avoid_overlap","","string")}(t),r=wM(t,e)?"selection":"point";if(Mt(n)){var o=xM(t,e);return qw(Bt.fromDom(o),n)?"node":r}return r}(t,e);(r()?dM:cM)(t,e,function(){var n=xM(t,e),r=t.ui.registry.getAll(),i=hM(t);return function(t,e,n){var r=X(e,function(e,r){return wt(t,r.toLowerCase()).map(function(t){var r=t.update(n);if(o(r))return yM(e,r.split(" "));if(r.length>0){var i=W(r,bM);return yM(e,i)}return e}).getOrThunk(function(){return e.concat([r])})},[]);return r.length>0&&pM(r[r.length-1])&&r.pop(),r}(r.contextMenus,i,n)},n,i,u)}};t.on("init",function(){var e="ResizeEditor ScrollContent ScrollWindow longpresscancel"+(r()?"":" ResizeWindow");t.on(e,u),t.on("longpress contextmenu",a)})},SM=lo([{offset:["x","y"]},{absolute:["x","y"]},{fixed:["x","y"]}]),kM=function(t){return function(e){return e.translate(-t.left,-t.top)}},OM=function(t){return function(e){return e.translate(t.left,t.top)}},TM=function(t){return function(e,n){return X(t,function(t,e){return e(t)},nn(e,n))}},_M=function(t,e,n){return t.fold(TM([OM(n),kM(e)]),TM([kM(e)]),TM([]))},EM=function(t,e,n){return t.fold(TM([OM(n)]),TM([]),TM([OM(e)]))},DM=function(t,e,n){return t.fold(TM([]),TM([kM(n)]),TM([OM(e),kM(n)]))},AM=function(t,e,n){var r=t.fold(function(t,e){return{position:R.some("absolute"),left:R.some(t+"px"),top:R.some(e+"px")}},function(t,e){return{position:R.some("absolute"),left:R.some(t-n.left+"px"),top:R.some(e-n.top+"px")}},function(t,e){return{position:R.some("fixed"),left:R.some(t+"px"),top:R.some(e+"px")}});return T({right:R.none(),bottom:R.none()},r)},NM=function(t,e,n,r){var o=function(t,o){return function(i,u){var a=t(e,n,r);return o(i.getOr(a.left),u.getOr(a.top))}};return t.fold(o(DM,MM),o(EM,zM),o(_M,RM))},MM=SM.offset,zM=SM.absolute,RM=SM.fixed,BM=function(t,e){var n=Le(t,e);return s(n)?NaN:parseInt(n,10)},LM=function(t,e,n,r){return function(t,e){var n=t.element,r=BM(n,e.leftAttr),o=BM(n,e.topAttr);return isNaN(r)||isNaN(o)?R.none():R.some(nn(r,o))}(t,e).fold(function(){return n},function(t){return RM(t.left+r.left,t.top+r.top)})},PM=function(t,e,n,r,o,i){var u=LM(t,e,n,r),a=e.mustSnap?FM(t,e,u,o,i):VM(t,e,u,o,i),c=_M(u,o,i);return function(t,e,n){var r=t.element;Re(r,e.leftAttr,n.left+"px"),Re(r,e.topAttr,n.top+"px")}(t,e,c),a.fold(function(){return{coord:RM(c.left,c.top),extra:R.none()}},function(t){return{coord:t.output,extra:t.extra}})},HM=function(t,e){!function(t,e){var n=t.element;Ie(n,e.leftAttr),Ie(n,e.topAttr)}(t,e)},IM=function(t,e,n,r){return lt(t,function(t){var o=t.sensor;return function(t,e,n,r,o,i){var u=EM(t,o,i),a=EM(e,o,i);return Math.abs(u.left-a.left)<=n&&Math.abs(u.top-a.top)<=r}(e,o,t.range.left,t.range.top,n,r)?R.some({output:NM(t.output,e,n,r),extra:t.extra}):R.none()})},FM=function(t,e,n,r,o){var i=e.getSnapPoints(t);return IM(i,n,r,o).orThunk(function(){return X(i,function(t,e){var i=e.sensor,u=function(t,e,n,r,o,i){var u=EM(t,o,i),a=EM(e,o,i),c=Math.abs(u.left-a.left),s=Math.abs(u.top-a.top);return nn(c,s)}(n,i,e.range.left,e.range.top,r,o);return t.deltas.fold(function(){return{deltas:R.some(u),snap:R.some(e)}},function(n){return(u.left+u.top)/2<=(n.left+n.top)/2?{deltas:R.some(u),snap:R.some(e)}:t})},{deltas:R.none(),snap:R.none()}).snap.map(function(t){return{output:NM(t.output,n,r,o),extra:t.extra}})})},VM=function(t,e,n,r,o){var i=e.getSnapPoints(t);return IM(i,n,r,o)},UM=Object.freeze({__proto__:null,snapTo:function(t,e,n,r){var o=e.getTarget(t.element);if(e.repositionTarget){var i=de(t.element),u=xn(i),a=iE(o),c=function(t,e,n){return{coord:NM(t.output,t.output,e,n),extra:t.extra}}(r,u,a),s=AM(c.coord,0,a);We(o,s)}}}),jM=function(t,e){t.getSystem().addToGui(e),function(t){pe(t.element).filter(It).each(function(e){Ge(e,"z-index").each(function(t){Re(e,"data-initial-z-index",t)}),Ue(e,"z-index",qe(t.element,"z-index"))})}(e)},WM=function(t){!function(t){pe(t.element).filter(It).each(function(t){Pe(t,"data-initial-z-index").fold(function(){return Xe(t,"z-index")},function(e){return Ue(t,"z-index",e)}),Ie(t,"data-initial-z-index")})}(t),t.getSystem().removeFromGui(t)},qM=function(t,e,n){return t.getSystem().build(ix.sketch({dom:{styles:{left:"0px",top:"0px",width:"100%",height:"100%",position:"fixed","z-index":"1000000000000000"},classes:[e]},events:n}))},$M=Zr("snaps",[Ir("getSnapPoints"),ma("onSensor"),Ir("leftAttr"),Ir("topAttr"),to("lazyViewport",Nn),to("mustSnap",!1)]),GM=[to("useFixed",S),Ir("blockerClass"),to("getTarget",b),to("onDrag",h),to("repositionTarget",!0),to("onDrop",h),uo("getBounds",Nn),$M],KM=function(t){return(e=Ge(t,"left"),n=Ge(t,"top"),r=Ge(t,"position"),o=function(t,e,n){return("fixed"===n?RM:MM)(parseInt(t,10),parseInt(e,10))},e.isSome()&&n.isSome()&&r.isSome()?R.some(o(e.getOrDie(),n.getOrDie(),r.getOrDie())):R.none()).getOrThunk(function(){var e=on(t);return zM(e.left,e.top)});var e,n,r,o},XM=function(t,e,n,r,o,i,u){return function(t,e,n,r,o){var i=o.bounds,u=EM(e,n,r),a=Na(u.left,i.x,i.x+i.width-o.width),c=Na(u.top,i.y,i.y+i.height-o.height),s=zM(a,c);return e.fold(function(){var t=DM(s,n,r);return MM(t.left,t.top)},v(s),function(){var t=_M(s,n,r);return RM(t.left,t.top)})}(0,e.fold(function(){var t,e,u,a=(t=n,e=i.left,u=i.top,t.fold(function(t,n){return MM(t+e,n+u)},function(t,n){return zM(t+e,n+u)},function(t,n){return RM(t+e,n+u)})),c=_M(a,r,o);return RM(c.left,c.top)},function(e){var u=PM(t,e,n,i,r,o);return u.extra.each(function(n){e.onSensor(t,n)}),u.coord}),r,o,u)},YM=function(t,e){return{bounds:t.getBounds(),height:tn(e.element),width:sn(e.element)}},JM=function(t,e,n,r,o){var i=n.update(r,o),u=n.getStartData().getOrThunk(function(){return YM(e,t)});i.each(function(n){!function(t,e,n,r){var o=e.getTarget(t.element);if(e.repositionTarget){var i=de(t.element),u=xn(i),a=iE(o),c=KM(o),s=XM(t,e.snaps,c,u,a,r,n),l=AM(s,0,a);We(o,l)}e.onDrag(t,o,r)}(t,e,u,n)})},QM=function(t,e,n,r){e.each(WM),n.snaps.each(function(e){HM(t,e)});var o=n.getTarget(t.element);r.reset(),n.onDrop(t,o)},ZM=function(t){return function(e,n){var r=function(t){n.setStartData(YM(e,t))};return ki(E([_i(ui(),function(t){n.getStartData().each(function(){return r(t)})})],t(e,n,r),!0))}},tz=Object.freeze({__proto__:null,getData:function(t){return R.from(nn(t.x,t.y))},getDelta:function(t,e){return nn(e.left-t.left,e.top-t.top)}}),ez=function(t,e,n){return[_i(Do(),function(r,o){if(0===o.event.raw.button){o.stop();var i=function(){return QM(r,R.some(c),t,e)},u=$w(i,200),a={drop:i,delayDrop:u.schedule,forceDrop:i,move:function(n){u.cancel(),JM(r,t,e,tz,n)}},c=qM(r,t.blockerClass,function(t){return ki([_i(Do(),t.forceDrop),_i(Mo(),t.drop),_i(Ao(),function(e,n){t.move(n.event)}),_i(No(),t.delayDrop)])}(a));n(r),jM(r,c)}})]},nz=E(E([],GM,!0),[va("dragger",{handlers:ZM(ez)})],!1),rz=Object.freeze({__proto__:null,getData:function(t){var e=t.raw.touches;return 1===e.length?function(t){var e=t[0];return R.some(nn(e.clientX,e.clientY))}(e):R.none()},getDelta:function(t,e){return nn(e.left-t.left,e.top-t.top)}}),oz=function(t,e,n){var r=Lc(),o=function(n){QM(n,r.get(),t,e),r.clear()};return[_i(Oo(),function(i,u){u.stop();var a=function(){return o(i)},c={drop:a,delayDrop:h,forceDrop:a,move:function(n){JM(i,t,e,rz,n)}},s=qM(i,t.blockerClass,function(t){return ki([_i(Oo(),t.forceDrop),_i(_o(),t.drop),_i(Eo(),t.drop),_i(To(),function(e,n){t.move(n.event)})])}(c));r.set(s);n(i),jM(i,s)}),_i(To(),function(n,r){r.stop(),JM(n,t,e,rz,r.event)}),_i(_o(),function(t,e){e.stop(),o(t)}),_i(Eo(),o)]},iz=nz,uz=E(E([],GM,!0),[va("dragger",{handlers:ZM(oz)})],!1),az=E(E([],GM,!0),[va("dragger",{handlers:ZM(function(t,e,n){return E(E([],ez(t,e,n),!0),oz(t,e,n),!0)})})],!1),cz=lc({branchKey:"mode",branches:Object.freeze({__proto__:null,mouse:iz,touch:uz,mouseOrTouch:az}),name:"dragging",active:{events:function(t,e){return t.dragger.handlers(t,e)}},extra:{snap:function(t){return{sensor:t.sensor,range:t.range,output:t.output,extra:R.from(t.extra)}}},state:Object.freeze({__proto__:null,init:function(){var t=R.none(),e=R.none(),n=v({});return su({readState:n,reset:function(){t=R.none(),e=R.none()},update:function(e,n){return e.getData(n).bind(function(n){return function(e,n){var r=t.map(function(t){return e.getDelta(t,n)});return t=R.some(n),r}(e,n)})},getStartData:function(){return e},setStartData:function(t){e=R.some(t)}})}}),apis:UM}),sz=function(t,e,n,r,o,i){return t.fold(function(){return cz.snap({sensor:zM(n-20,r-20),range:nn(o,i),output:zM(R.some(n),R.some(r)),extra:{td:e}})},function(t){var o=n-20,i=r-20,u=t.element.dom.getBoundingClientRect();return cz.snap({sensor:zM(o,i),range:nn(40,40),output:zM(R.some(n-u.width/2),R.some(r-u.height/2)),extra:{td:e}})})},lz=function(t,e,n){return{getSnapPoints:t,leftAttr:"data-drag-left",topAttr:"data-drag-top",onSensor:function(t,r){var o=r.td;(function(t,e){return t.exists(function(t){return se(t,e)})})(e.get(),o)||(e.set(o),n(o))},mustSnap:!0}},fz=function(t){return Xh(Gh.sketch({dom:{tag:"div",classes:["tox-selector"]},buttonBehaviours:uc([cz.config({mode:"mouseOrTouch",blockerClass:"blocker",snaps:t}),yC.config({})]),eventOrder:{mousedown:["dragging","alloy.base.behaviour"],touchstart:["dragging","alloy.base.behaviour"]}}))},dz=function(t,e){var n=so([]),r=so([]),o=so(!1),i=Lc(),u=Lc(),a=function(t){var n=An(t);return sz(f.getOpt(e),t,n.x,n.y,n.width,n.height)},c=function(t){var n=An(t);return sz(d.getOpt(e),t,n.right,n.bottom,n.width,n.height)},s=lz(function(){return W(n.get(),function(t){return a(t)})},i,function(e){u.get().each(function(n){t.fire("TableSelectorChange",{start:e,finish:n})})}),l=lz(function(){return W(r.get(),function(t){return c(t)})},u,function(e){i.get().each(function(n){t.fire("TableSelectorChange",{start:n,finish:e})})}),f=fz(s),d=fz(l),m=Vu(f.asSpec()),g=Vu(d.asSpec()),h=function(e,n,r,o){var i=r(n);cz.snapTo(e,i);!function(e,n,r,o){var i=n.dom.getBoundingClientRect();Xe(e.element,"display");var u=he(Bt.fromDom(t.getBody())).dom.innerHeight,a=r(i),c=o(i,u);(a||c)&&Ue(e.element,"display","none")}(e,n,function(t){return t[o]<0},function(t,e){return t[o]>e})},p=function(t){return h(m,t,a,"top")},v=function(t){return h(g,t,c,"bottom")};ue().deviceType.isTouch()&&(t.on("TableSelectionChange",function(t){o.get()||(Sl(e,m),Sl(e,g),o.set(!0)),i.set(t.start),u.set(t.finish),t.otherCells.each(function(e){n.set(e.upOrLeftCells),r.set(e.downOrRightCells),p(t.start),v(t.finish)})}),t.on("ResizeEditor ResizeWindow ScrollContent",function(){i.get().each(p),u.get().each(v)}),t.on("TableSelectionClear",function(){o.get()&&(Tl(m),Tl(g),o.set(!1)),i.clear(),u.clear()}))},mz=function(t){if(1===t.nodeType){if("BR"===t.nodeName||t.getAttribute("data-mce-bogus"))return!0;if("bookmark"===t.getAttribute("data-mce-type"))return!0}return!1},gz=function(t,e,n){e.delimiter||(e.delimiter="»");return{dom:{tag:"div",classes:["tox-statusbar__path"],attributes:{role:"navigation"}},behaviours:uc([Bg.config({mode:"flow",selector:"div[role=button]"}),Dd.config({disabled:n.isDisabled}),cy(),dx.config({}),Fg.config({}),Vg("elementPathEvents",[Ri(function(r,o){t.shortcuts.add("alt+F11","focus statusbar elementpath",function(){return Bg.focusIn(r)}),t.on("NodeChange",function(o){var i,u,a=function(e){for(var n=[],r=e.length;r-- >0;){var o=e[r];if(1===o.nodeType&&!mz(o)){var i=t.fire("ResolveName",{name:o.nodeName.toLowerCase(),target:o});if(i.isDefaultPrevented()||n.push({name:i.name,element:o}),i.isPropagationStopped())break}}return n}(o.parents);a.length>0?Fg.set(r,(i=W(a||[],function(e,r){return Gh.sketch({dom:{tag:"div",classes:["tox-statusbar__path-item"],attributes:{role:"button","data-index":r,"tab-index":-1,"aria-level":r+1},innerHtml:e.name},action:function(n){t.focus(),t.selection.select(e.element),t.nodeChanged()},buttonBehaviours:uc([ly(n.isDisabled),cy()])})}),u={dom:{tag:"div",classes:["tox-statusbar__path-divider"],attributes:{"aria-hidden":!0},innerHtml:" "+e.delimiter+" "}},X(i.slice(1),function(t,e){var n=t;return n.push(u),n.push(e),n},[i[0]]))):Fg.set(r,[])})})])]),components:[]}};!function(t){t[t.None=0]="None",t[t.Both=1]="Both",t[t.Vertical=2]="Vertical"}(SA||(SA={}));var hz=function(t,e,n){var r=Bt.fromDom(t.getContainer()),o=function(t,e,n,r,o){var i={};return i.height=gN(r+e.top,Vb(t),jb(t)),n===SA.Both&&(i.width=gN(o+e.left,Fb(t),Ub(t))),i}(t,e,n,Ze(r),cn(r));mt(o,function(t,e){return Ue(r,e,mN(t))}),function(t){t.fire("ResizeEditor")}(t)},pz=function(t,e,n,r){var o=nn(20*n,20*r);return hz(t,o,e),R.some(!0)},vz=function(t,e){var n=function(t){var e=!t.hasPlugin("autoresize"),n=t.getParam("resize",e);return!1===n?SA.None:"both"===n?SA.Both:SA.Vertical}(t);return n===SA.None?R.none():R.some(ov("resize-handle",{tag:"div",classes:["tox-statusbar__resize-handle"],attributes:{title:e.translate("Resize")},behaviours:[cz.config({mode:"mouse",repositionTarget:!1,onDrag:function(e,r,o){return hz(t,o,n)},blockerClass:"tox-blocker"}),Bg.config({mode:"special",onLeft:function(){return pz(t,n,-1,0)},onRight:function(){return pz(t,n,1,0)},onUp:function(){return pz(t,n,0,-1)},onDown:function(){return pz(t,n,0,1)}}),dx.config({}),$g.config({})]},e.icons))},bz=function(t,e){var n,r;return{dom:{tag:"div",classes:["tox-statusbar"]},components:(n=function(){var n,r=[];return t.getParam("elementpath",!0,"boolean")&&r.push(gz(t,{},e)),t.hasPlugin("wordcount")&&r.push(function(t,e){var n,r=function(t,n,r){return Fg.set(t,[Hu(e.translate(["{0} "+r,n[r]]))])};return Gh.sketch({dom:{tag:"button",classes:["tox-statusbar__wordcount"]},components:[],buttonBehaviours:uc([ly(e.isDisabled),cy(),dx.config({}),Fg.config({}),af.config({store:{mode:"memory",initialValue:{mode:"words",count:{words:0,characters:0}}}}),Vg("wordcount-events",[Pi(function(t){var e=af.getValue(t),n="words"===e.mode?"characters":"words";af.setValue(t,{mode:n,count:e.count}),r(t,e.count,n)}),Ri(function(e){t.on("wordCountUpdate",function(t){var n=af.getValue(e).mode;af.setValue(e,{mode:n,count:t.wordCount}),r(e,t.wordCount,n)})})])]),eventOrder:(n={},n[Jo()]=["disabling","alloy.base.behaviour","wordcount-events"],n)})}(t,e)),t.getParam("branding",!0,"boolean")&&r.push({dom:{tag:"span",classes:["tox-statusbar__branding"],innerHtml:'<a href="https://www.tiny.cloud/?utm_campaign=editor_referral&utm_medium=poweredby&utm_source=tinymce&utm_content=v5" rel="noopener" target="_blank" tabindex="-1" aria-label="'+(n=Yp.translate(["Powered by {0}","Tiny"]))+'">'+n+"</a>"}}),r.length>0?[{dom:{tag:"div",classes:["tox-statusbar__text-container"]},components:r}]:[]}(),r=vz(t,e),n.concat(r.toArray()))}},yz=function(t){var e,n,r,o,i=t.inline,u=i?yN:fN,a=oy(t)?NE:rE,c=R.none(),s=ue(),l=s.browser.isIE()?["tox-platform-ie"]:[],f=s.deviceType.isTouch()?["tox-platform-touch"]:[],d=Zb(t),m=ny(t),g=Yp.isRtl()?{attributes:{dir:"rtl"}}:{},p={attributes:(e={},e[as]=d?_c.BottomToTop:_c.TopToBottom,e)},v=function(){return c.bind(iA.getHeader)},b=function(){Ue($.element,"width",document.body.clientWidth+"px")},y=Vu((n=se(Ne(),m)&&"grid"===qe(m,"display"),r={dom:T({tag:"div",classes:["tox","tox-silver-sink","tox-tinymce-aux"].concat(l).concat(f)},g),behaviours:uc([bl.config({useFixed:function(){return a.isDocked(v)}})])},o={dom:{styles:{width:document.body.clientWidth+"px"}},events:ki([_i(ai(),b)])},Jn(r,n?o:{}))),w=function(){return Rn.value(y)},x=Xh({dom:{tag:"div",classes:["tox-anchorbar"]}}),C=function(){return c.bind(function(t){return iA.getThrobber(t)}).getOrDie("Could not find throbber element")},S=W_(y,t,function(){return c.bind(function(t){return x.getOpt(t)}).getOrDie("Could not find a anchor bar element")}),k=iA.parts.menubar({dom:{tag:"div",classes:["tox-menubar"]},backstage:S,onEscape:function(){t.focus()}}),O=Xb(t),_=iA.parts.toolbar(T({dom:{tag:"div",classes:["tox-toolbar"]},getSink:w,providers:S.shared.providers,onEscape:function(){t.focus()},type:O,lazyToolbar:function(){return c.bind(function(t){return iA.getToolbar(t)}).getOrDie("Could not find more toolbar element")},lazyHeader:function(){return v().getOrDie("Could not find header element")}},p)),E=iA.parts["multiple-toolbar"]({dom:{tag:"div",classes:["tox-toolbar-overlord"]},providers:S.shared.providers,onEscape:function(){t.focus()},type:O}),D=iA.parts.socket({dom:{tag:"div",classes:["tox-edit-area"]}}),A=iA.parts.sidebar({dom:{tag:"div",classes:["tox-sidebar"]}}),N=iA.parts.throbber({dom:{tag:"div",classes:["tox-throbber"]},backstage:S}),M=t.getParam("statusbar",!0,"boolean")&&!i?R.some(bz(t,S.shared.providers)):R.none(),z={dom:{tag:"div",classes:["tox-sidebar-wrap"]},components:[D,A]},B=Gb(t),L=qb(t),P=Wb(t),H=iA.parts.header({dom:T({tag:"div",classes:["tox-editor-header"]},p),components:Q([P?[k]:[],B?[E]:L?[_]:[],ey(t)?[]:[x.asSpec()]]),sticky:oy(t),editor:t,sharedBackstage:S.shared}),I=Q([d?[]:[H],i?[]:[z],d?[H]:[]]),F=Q([[{dom:{tag:"div",classes:["tox-editor-container"]},components:I}],i?[]:M.toArray(),[N]]),V=ry(t),U=T(T({role:"application"},Yp.isRtl()?{dir:"rtl"}:{}),V?{"aria-hidden":"true"}:{}),j=Vu(iA.sketch({dom:{tag:"div",classes:["tox","tox-tinymce"].concat(i?["tox-tinymce-inline"]:[]).concat(d?["tox-tinymce--toolbar-bottom"]:[]).concat(f).concat(l),styles:T({visibility:"hidden"},V?{opacity:"0",border:"0"}:{}),attributes:U},components:F,behaviours:uc([cy(),Dd.config({disableClass:"tox-tinymce--disabled"}),Bg.config({mode:"cyclic",selector:".tox-menubar, .tox-toolbar, .tox-toolbar__primary, .tox-toolbar__overflow--open, .tox-sidebar__overflow--open, .tox-statusbar__path, .tox-statusbar__wordcount, .tox-statusbar__branding a, .tox-statusbar__resize-handle"})])}));c=R.some(j),t.shortcuts.add("alt+F9","focus menubar",function(){iA.focusMenubar(j)}),t.shortcuts.add("alt+F10","focus toolbar",function(){iA.focusToolbar(j)}),t.addCommand("ToggleToolbarDrawer",function(){iA.toggleToolbarDrawer(j)}),t.addQueryStateHandler("ToggleToolbarDrawer",function(){return iA.isToolbarDrawerToggled(j)});var W=ux(j),$=ux(y);!function(t,e,n){var r=function(t,r){q([e,n],function(e){e.broadcastEvent(t,r)})},o=function(t,r){q([e,n],function(e){e.broadcastOn([t],r)})},i=function(t){return o(Vl(),{target:t.target})},u=gc(),a=Hc(u,"touchstart",i),c=Hc(u,"touchmove",function(t){return r(oi(),t)}),s=Hc(u,"touchend",function(t){return r(ii(),t)}),l=Hc(u,"mousedown",i),f=Hc(u,"mouseup",function(t){0===t.raw.button&&o(jl(),{target:t.target})}),d=function(t){return o(Vl(),{target:Bt.fromDom(t.target)})},m=function(t){0===t.button&&o(jl(),{target:Bt.fromDom(t.target)})},g=function(){q(t.editorManager.get(),function(e){t!==e&&e.fire("DismissPopups",{relatedTarget:t})})},h=function(t){return r(ui(),Fc(t))},p=function(t){o(Ul(),{}),r(ai(),Fc(t))},v=function(){return o(Ul(),{})},b=function(e){e.state&&o(Vl(),{target:Bt.fromDom(t.getContainer())})},y=function(t){o(Vl(),{target:Bt.fromDom(t.relatedTarget.getContainer())})};t.on("PostRender",function(){t.on("click",d),t.on("tap",d),t.on("mouseup",m),t.on("mousedown",g),t.on("ScrollWindow",h),t.on("ResizeWindow",p),t.on("ResizeEditor",v),t.on("AfterProgressState",b),t.on("DismissPopups",y)}),t.on("remove",function(){t.off("click",d),t.off("tap",d),t.off("mouseup",m),t.off("mousedown",g),t.off("ScrollWindow",h),t.off("ResizeWindow",p),t.off("ResizeEditor",v),t.off("AfterProgressState",b),t.off("DismissPopups",y),l.unbind(),a.unbind(),c.unbind(),s.unbind(),f.unbind()}),t.on("detach",function(){Al(e),Al(n),e.destroy(),n.destroy()})}(t,W,$);var G=function(){var e=mN(hN(t)),n=mN(function(t){return pN(t).getOr(Ib(t))}(t));return t.inline||(Ke("div","width",n)&&Ue(j.element,"width",n),Ke("div","height",e)?Ue(j.element,"height",e):Ue(j.element,"height","200px")),e};return{mothership:W,uiMothership:$,backstage:S,renderUI:function(){a.setup(t,S.shared,v),eM(t,S),CM(t,w,S),function(t){var e=t.ui.registry.getAll().sidebars;q(ft(e),function(n){var r=e[n],o=function(){return St(R.from(t.queryCommandValue("ToggleSidebar")),n)};t.ui.registry.addToggleButton(n,{icon:r.icon,tooltip:r.tooltip,onAction:function(e){t.execCommand("ToggleSidebar",!1,n),e.setActive(o())},onSetup:function(e){var n=function(){return e.setActive(o())};return t.on("ToggleSidebar",n),function(){t.off("ToggleSidebar",n)}}})})}(t),vD(t,C,S.shared),gt(function(t){return t.getParam("toolbar_groups",{},"object")}(t),function(e,n){t.ui.registry.addGroupToolbarButton(n,e)});var e=t.ui.registry.getAll(),n=e.buttons,r=e.menuItems,o=e.contextToolbars,i=e.sidebars,c=$b(t),s={menuItems:r,menus:function(t){var e=t.getParam("menu");return e?gt(e,function(t){return T(T({},t),{items:t.items})}):{}}(t),menubar:function(t){return t.getParam("menubar")}(t),toolbar:c.getOrThunk(function(){return function(t){return t.getParam("toolbar",!0)}(t)}),allowToolbarGroups:O===qv.floating,buttons:n,sidebar:i};IN(t,o,y,{backstage:S}),dz(t,y);var l=t.getElement(),f=G(),d={mothership:W,uiMothership:$,outerContainer:j},m={targetNode:l,height:f};return u.render(t,d,s,S,m)},getUi:function(){return{channels:{broadcastAll:$.broadcast,broadcastOn:$.broadcastOn,register:h}}}}},wz=v([Ir("lazySink"),Gr("dragBlockClass"),uo("getBounds",Nn),to("useTabstopAt",k),to("eventOrder",{}),cf("modalBehaviours",[Bg]),ga("onExecute"),pa("onEscape")]),xz={sketch:b},Cz=v([Hf({name:"draghandle",overrides:function(t,e){return{behaviours:uc([cz.config({mode:"mouse",getTarget:function(t){return Ku(t,'[role="dialog"]').getOr(t)},blockerClass:t.dragBlockClass.getOrDie(new Error("The drag blocker class was not specified for a dialog with a drag handle: \n"+JSON.stringify(e,null,2)).message),getBounds:t.getDragBounds})])}}}),Lf({schema:[Ir("dom")],name:"title"}),Lf({factory:xz,schema:[Ir("dom")],name:"close"}),Lf({factory:xz,schema:[Ir("dom")],name:"body"}),Hf({factory:xz,schema:[Ir("dom")],name:"footer"}),Pf({factory:{sketch:function(t,e){return T(T({},t),{dom:e.dom,components:e.components})}},schema:[to("dom",{tag:"div",styles:{position:"fixed",left:"0px",top:"0px",right:"0px",bottom:"0px"}}),to("components",[])],name:"blocker"})]),Sz=fd({name:"ModalDialog",configFields:wz(),partFields:Cz(),factory:function(t,e,n,r){var o,i=Lc(),u=$i("modal-events"),a=T(T({},t.eventOrder),((o={})[ci()]=[u].concat(t.eventOrder["alloy.system.attached"]||[]),o));return{uid:t.uid,dom:t.dom,components:e,apis:{show:function(e){i.set(e);var n=t.lazySink(e).getOrDie(),o=r.blocker(),u=n.getSystem().build(T(T({},o),{components:o.components.concat([Uu(e)]),behaviours:uc([$g.config({}),Vg("dialog-blocker-events",[zi(Ro(),function(){Bg.focusIn(e)})])])}));Sl(n,u),Bg.focusIn(e)},hide:function(t){i.clear(),pe(t.element).each(function(e){t.getSystem().getByDom(e).each(function(t){Tl(t)})})},getBody:function(e){return Jf(e,t,"body")},getFooter:function(e){return Jf(e,t,"footer")},setIdle:function(t){gD.unblock(t)},setBusy:function(t,e){gD.block(t,e)}},eventOrder:a,domModification:{attributes:{role:"dialog","aria-modal":"true"}},behaviours:lf(t.modalBehaviours,[Fg.config({}),Bg.config({mode:"cyclic",onEnter:t.onExecute,onEscape:t.onEscape,useTabstopAt:t.useTabstopAt}),gD.config({getRoot:i.get}),Vg(u,[Ri(function(e){var n,r,o,i,u,a;n=e.element,r=Jf(e,t,"title").element,o=Pe(n,"id").fold(function(){var t=$i("dialog-label");return Re(r,"id",t),t},b),Re(n,"aria-labelledby",o),i=e.element,u=Jf(e,t,"body").element,a=R.from(Le(i,"id")).fold(function(){var t=$i("dialog-describe");return Re(u,"id",t),t},b),Re(i,"aria-describedby",a)})])])}},apis:{show:function(t,e){t.show(e)},hide:function(t,e){t.hide(e)},getBody:function(t,e){return t.getBody(e)},getFooter:function(t,e){return t.getFooter(e)},setBusy:function(t,e,n){t.setBusy(e,n)},setIdle:function(t,e){t.setIdle(e)}}}),kz=gr([Vr("type"),Vr("name")].concat(hb)),Oz=Sr,Tz=[Lr("name","name",Zn(function(){return $i("button-name")}),Cr),Yr("icon"),oo("align","end",["start","end"]),io("primary",!1),io("disabled",!1)],_z=E(E([],Tz,!0),[Vr("text")],!1),Ez=E([Ur("type",["submit","cancel","custom"])],_z,!0),Dz=E([Ur("type",["menu"]),Yr("text"),Yr("tooltip"),Yr("icon"),$r("items",kz)],Tz,!0),Az=Br("type",{submit:Ez,cancel:Ez,custom:Ez,menu:Dz}),Nz=[Vr("type"),Vr("text"),Ur("level",["info","warn","error","success"]),Vr("icon"),to("url","")],Mz=gr(Nz),zz=[Vr("type"),Vr("text"),io("disabled",!1),io("primary",!1),Lr("name","name",Zn(function(){return $i("button-name")}),Cr),Yr("icon"),io("borderless",!1)],Rz=gr(zz),Bz=[Vr("type"),Vr("name"),Vr("label"),io("disabled",!1)],Lz=gr(Bz),Pz=Sr,Hz=[Vr("type"),Vr("name")],Iz=Hz.concat([Yr("label")]),Fz=Iz.concat([to("columns","auto")]),Vz=gr(Fz),Uz=br([Vr("value"),Vr("text"),Vr("icon")]),jz=gr(Iz),Wz=Cr,qz=gr(Iz),$z=Cr,Gz=Hz.concat([ro("tag","textarea"),Vr("scriptId"),Vr("scriptUrl"),function(t,e){return eo(t,e,Tr)}("settings",void 0)]),Kz=Hz.concat([ro("tag","textarea"),jr("init")]),Xz=Dr(function(t){return Nr("customeditor.old",mr(Kz),t).orThunk(function(){return Nr("customeditor.new",mr(Gz),t)})}),Yz=Cr,Jz=gr(Iz),Qz=hr(ar),Zz=function(t){return[Vr("type"),(e="columns",Fr(e,xr)),t];var e},tR=[Vr("type"),Vr("html"),oo("presets","presentation",["presentation","document"])],eR=gr(tR),nR=Iz.concat([io("sandboxed",!0)]),rR=gr(nR),oR=Cr,iR=Iz.concat([Fr("currentState",gr([Ir("blob"),Vr("url")]))]),uR=gr(iR),aR=Iz.concat([Yr("inputMode"),Yr("placeholder"),io("maximized",!1),io("disabled",!1)]),cR=gr(aR),sR=Cr,lR=[Vr("text"),Vr("value")],fR=[Vr("text"),$r("items",function(t,e){return n=jt(e),{extract:function(t,e){return n().extract(t,e)},toString:function(){return n().toString()}};var n}(0,function(){return dR}))],dR=pr([gr(lR),gr(fR)]),mR=Iz.concat([$r("items",dR),io("disabled",!1)]),gR=gr(mR),hR=Cr,pR=Iz.concat([qr("items",[Vr("text"),Vr("value")]),no("size",1),io("disabled",!1)]),vR=gr(pR),bR=Cr,yR=Iz.concat([io("constrain",!0),io("disabled",!1)]),wR=gr(yR),xR=gr([Vr("width"),Vr("height")]),CR=[Vr("type"),$r("header",Cr),$r("cells",hr(Cr))],SR=gr(CR),kR=Iz.concat([Yr("placeholder"),io("maximized",!1),io("disabled",!1)]),OR=gr(kR),TR=Cr,_R=Iz.concat([oo("filetype","file",["image","media","file"]),to("disabled",!1)]),ER=gr(_R),DR=gr([Vr("value"),to("meta",{})]),AR=function(t){return Lr("items","items",{tag:"required",process:{}},hr(Dr(function(e){return Nr("Checking item of "+t,NR,e).fold(function(t){return Rn.error(Rr(t))},function(t){return Rn.value(t)})})))},NR=fr(function(){return Er("type",{alertbanner:Mz,bar:gr((t=AR("bar"),[Vr("type"),t])),button:Rz,checkbox:Lz,colorinput:jz,colorpicker:qz,dropzone:Jz,grid:gr(Zz(AR("grid"))),iframe:rR,input:cR,listbox:gR,selectbox:vR,sizeinput:wR,textarea:OR,urlinput:ER,customeditor:Xz,htmlpanel:eR,imagetools:uR,collection:Vz,label:gr(function(t){return[Vr("type"),Vr("label"),t]}(AR("label"))),table:SR,panel:zR});var t}),MR=[Vr("type"),to("classes",[]),$r("items",NR)],zR=gr(MR),RR=[Lr("name","name",Zn(function(){return $i("tab-name")}),Cr),Vr("title"),$r("items",NR)],BR=[Vr("type"),qr("tabs",RR)],LR=gr(BR),PR=_z,HR=Az,IR=gr([Vr("title"),Fr("body",Er("type",{panel:zR,tabpanel:LR})),ro("size","normal"),$r("buttons",HR),to("initialData",{}),uo("onAction",h),uo("onChange",h),uo("onSubmit",h),uo("onClose",h),uo("onCancel",h),to("onTabChange",h)]),FR=gr(E([Ur("type",["cancel","custom"])],PR,!0)),VR=gr([Vr("title"),Vr("url"),Xr("height"),Xr("width"),Qr("buttons",FR),uo("onAction",h),uo("onCancel",h),uo("onClose",h),uo("onMessage",h)]),UR=function(t){return i(t)?[t].concat(Z(yt(t),UR)):u(t)?Z(t,UR):[]},jR=function(t){return o(t.type)&&o(t.name)},WR={checkbox:Pz,colorinput:Wz,colorpicker:$z,dropzone:Qz,input:sR,iframe:oR,sizeinput:xR,selectbox:bR,listbox:hR,size:xR,textarea:TR,urlinput:DR,customeditor:Yz,collection:Uz,togglemenuitem:Oz},qR=function(t){var e=function(t){return G(UR(t),jR)}(t),n=Z(e,function(t){return function(t){return R.from(WR[t.type])}(t).fold(function(){return[]},function(e){return[Fr(t.name,e)]})});return gr(n)},$R=function(t){return{internalDialog:Mr(Nr("dialog",IR,t)),dataValidator:qR(t),initialData:t.initialData}},GR={open:function(t,e){var n=$R(e);return t(n.internalDialog,n.initialData,n.dataValidator)},openUrl:function(t,e){return t(Mr(Nr("dialog",VR,e)))},redial:function(t){return $R(t)}},KR=function(t){var e=[],n={};return mt(t,function(t,r){t.fold(function(){e.push(r)},function(t){n[r]=t})}),e.length>0?Rn.error(e):Rn.value(n)},XR=ld({name:"TabButton",configFields:[to("uid",void 0),Ir("value"),Lr("dom","dom",er(function(){return{attributes:{role:"tab",id:$i("aria"),"aria-selected":"false"}}}),yr()),Gr("action"),to("domModification",{}),cf("tabButtonBehaviours",[$g,Bg,af]),Ir("view")],factory:function(t,e){return{uid:t.uid,dom:t.dom,components:t.components,events:uh(t.action),behaviours:lf(t.tabButtonBehaviours,[$g.config({}),Bg.config({mode:"execution",useSpace:!0,useEnter:!0}),af.config({store:{mode:"memory",initialValue:t.value}})]),domModification:t.domModification}}}),YR=v([Ir("tabs"),Ir("dom"),to("clickToDismiss",!1),cf("tabbarBehaviours",[Fd,Bg]),fa(["tabClass","selectedClass"])]),JR=If({factory:XR,name:"tabs",unit:"tab",overrides:function(t){var e=function(t,e){Fd.dehighlight(t,e),yi(t,hi(),{tabbar:t,button:e})},n=function(t,e){Fd.highlight(t,e),yi(t,gi(),{tabbar:t,button:e})};return{action:function(r){var o=r.getSystem().getByUid(t.uid).getOrDie(),i=Fd.isHighlighted(o,r);(i&&t.clickToDismiss?e:i?h:n)(o,r)},domModification:{classes:[t.markers.tabClass]}}}}),QR=v([JR]),ZR=fd({name:"Tabbar",configFields:YR(),partFields:QR(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,"debug.sketcher":"Tabbar",domModification:{attributes:{role:"tablist"}},behaviours:lf(t.tabbarBehaviours,[Fd.config({highlightClass:t.markers.selectedClass,itemClass:t.markers.tabClass,onHighlight:function(t,e){Re(e.element,"aria-selected","true")},onDehighlight:function(t,e){Re(e.element,"aria-selected","false")}}),Bg.config({mode:"flow",getInitial:function(t){return Fd.getHighlighted(t).map(function(t){return t.element})},selector:"."+t.markers.tabClass,executeOnMove:!0})])}}}),tB=ld({name:"Tabview",configFields:[cf("tabviewBehaviours",[Fg])],factory:function(t,e){return{uid:t.uid,dom:t.dom,behaviours:lf(t.tabviewBehaviours,[Fg.config({})]),domModification:{attributes:{role:"tabpanel"}}}}}),eB=v([to("selectFirst",!0),ma("onChangeTab"),ma("onDismissTab"),to("tabs",[]),cf("tabSectionBehaviours",[])]),nB=Lf({factory:ZR,schema:[Ir("dom"),Wr("markers",[Ir("tabClass"),Ir("selectedClass")])],name:"tabbar",defaults:function(t){return{tabs:t.tabs}}}),rB=Lf({factory:tB,name:"tabview"}),oB=v([nB,rB]),iB=fd({name:"TabSection",configFields:eB(),partFields:oB(),factory:function(t,e,n,r){var o=function(e,n){Yf(e,t,"tabbar").each(function(t){n(t).each(wi)})};return{uid:t.uid,dom:t.dom,components:e,behaviours:sf(t.tabSectionBehaviours),events:ki(Q([t.selectFirst?[Ri(function(t,e){o(t,Fd.getFirst)})]:[],[_i(gi(),function(e,n){!function(e){var n=af.getValue(e);Yf(e,t,"tabview").each(function(r){Y(t.tabs,function(t){return t.value===n}).each(function(n){var o=n.view();Pe(e.element,"id").each(function(t){Re(r.element,"aria-labelledby",t)}),Fg.set(r,o),t.onChangeTab(r,e,o)})})}(n.event.button)}),_i(hi(),function(e,n){var r=n.event.button;t.onDismissTab(e,r)})]])),apis:{getViewItems:function(e){return Yf(e,t,"tabview").map(function(t){return Fg.contents(t)}).getOr([])},showTab:function(t,e){o(t,function(t){var n=Fd.getCandidates(t);return Y(n,function(t){return af.getValue(t)===e}).filter(function(e){return!Fd.isHighlighted(t,e)})})}}}},apis:{getViewItems:function(t,e){return t.getViewItems(e)},showTab:function(t,e,n){t.showTab(e,n)}}}),uB=function(t,e){Ue(t,"height",e+"px"),ue().browser.isIE()?Xe(t,"flex-basis"):Ue(t,"flex-basis",e+"px")},aB=function(t,e,n){Ku(t,'[role="dialog"]').each(function(t){Yu(t,'[role="tablist"]').each(function(r){n.get().map(function(n){return Ue(e,"height","0"),Ue(e,"flex-basis","0"),Math.min(n,function(t,e,n){var r,o=ge(t).dom,i=Ku(t,".tox-dialog-wrap").getOr(t);r="fixed"===qe(i,"position")?Math.max(o.clientHeight,window.innerHeight):Math.max(o.offsetHeight,o.scrollHeight);var u=Ze(e),a=e.dom.offsetLeft>=n.dom.offsetLeft+cn(n)?Math.max(Ze(n),u):u,c=parseInt(qe(t,"margin-top"),10)||0,s=parseInt(qe(t,"margin-bottom"),10)||0;return r-(Ze(t)+c+s-a)}(t,e,r))}).each(function(t){uB(e,t)})})})},cB=function(t){return Yu(t,'[role="tabpanel"]')},sB=function(t){var e;return{smartTabHeight:(e=Lc(),{extraEvents:[Ri(function(n){var r=n.element;cB(r).each(function(o){Ue(o,"visibility","hidden"),n.getSystem().getByDom(o).toOptional().each(function(n){(function(t){return at(it(t,function(t,e){return t>e?-1:t<e?1:0}))})(function(t,e,n){return W(t,function(r,o){Fg.set(n,t[o].view());var i=e.dom.getBoundingClientRect();return Fg.set(n,[]),i.height})}(t,o,n)).fold(e.clear,e.set)}),aB(r,o,e),Xe(o,"visibility"),function(t,e){at(t).each(function(t){return iB.showTab(e,t.value)})}(t,n),$h.requestAnimationFrame(function(){aB(r,o,e)})})}),_i(ai(),function(t){var n=t.element;cB(n).each(function(t){aB(n,t,e)})}),_i(Tx,function(t,n){var r=t.element;cB(r).each(function(t){var n=vc(Oe(t));Ue(t,"visibility","hidden");var o=Ge(t,"height").map(function(t){return parseInt(t,10)});Xe(t,"height"),Xe(t,"flex-basis");var i=t.dom.getBoundingClientRect().height;o.forall(function(t){return i>t})?(e.set(i),aB(r,t,e)):o.each(function(e){uB(t,e)}),Xe(t,"visibility"),n.each(hc)})})],selectFirst:!1}),naiveTabHeight:{extraEvents:[],selectFirst:!0}}},lB=$i("update-dialog"),fB=$i("update-title"),dB=$i("update-body"),mB=$i("update-footer"),gB=$i("body-send-message"),hB=function(t,e,n,r){return{dom:{tag:"div",classes:["tox-dialog__content-js"],attributes:T(T({},e.map(function(t){return{id:t}}).getOr({})),r?{"aria-live":"polite"}:{})},components:[],behaviours:uc([bk(0),FA.config({channel:dB,updateState:function(t,e){return R.some({isTabPanel:function(){return"tabpanel"===e.body.type}})},renderComponents:function(t){switch(t.body.type){case"tabpanel":return[function(t,e){var n=so({}),r=function(t){var e=af.getValue(t),r=KR(e).getOr({}),o=n.get(),i=Jn(o,r);n.set(i)},o=function(t){var e=n.get();af.setValue(t,e)},i=so(null),u=W(t.tabs,function(t){return{value:t.name,dom:{tag:"div",classes:["tox-dialog__body-nav-item"],innerHtml:e.shared.providers.translate(t.title)},view:function(){return[sk.sketch(function(n){return{dom:{tag:"div",classes:["tox-form"]},components:W(t.items,function(t){return i_(n,t,e)}),formBehaviours:uc([Bg.config({mode:"acyclic",useTabstopAt:x(Pk)}),Vg("TabView.form.events",[Ri(o),Bi(r)]),dc.config({channels:ho([{key:"send-data-to-section",value:{onReceive:r}},{key:"send-data-to-view",value:{onReceive:o}}])})])}})]}}}),a=sB(u).smartTabHeight;return iB.sketch({dom:{tag:"div",classes:["tox-dialog__body"]},onChangeTab:function(t,e,n){var r=af.getValue(e);yi(t,Ox,{name:r,oldName:i.get()}),i.set(r)},tabs:u,components:[iB.parts.tabbar({dom:{tag:"div",classes:["tox-dialog__body-nav"]},components:[ZR.parts.tabs({})],markers:{tabClass:"tox-tab",selectedClass:"tox-dialog__body-nav-item--active"},tabbarBehaviours:uc([dx.config({})])}),iB.parts.tabview({dom:{tag:"div",classes:["tox-dialog__body-content"]}})],selectFirst:a.selectFirst,tabSectionBehaviours:uc([Vg("tabpanel",a.extraEvents),Bg.config({mode:"acyclic"}),hd.config({find:function(t){return at(iB.getViewItems(t))}}),af.config({store:{mode:"manual",getValue:function(t){return t.getSystem().broadcastOn(["send-data-to-section"],{}),n.get()},setValue:function(t,e){n.set(e),t.getSystem().broadcastOn(["send-data-to-view"],{})}}})])})}(t.body,n)];default:return[function(t,e){var n=Xh(sk.sketch(function(n){return{dom:{tag:"div",classes:["tox-form"].concat(t.classes)},components:W(t.items,function(t){return i_(n,t,e)})}}));return{dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[n.asSpec()]}],behaviours:uc([Bg.config({mode:"acyclic",useTabstopAt:x(Pk)}),vk(n),Tk(n,{postprocess:function(t){return KR(t).fold(function(t){return console.error(t),{}},b)}})])}}(t.body,n)]}},initialData:t})])}},pB=wy.deviceType.isTouch(),vB=function(t,e){return{dom:{tag:"div",styles:{display:"none"},classes:["tox-dialog__header"]},components:[t,e]}},bB=function(t,e){return Sz.parts.close(Gh.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":e.translate("Close")}},action:t,buttonBehaviours:uc([dx.config({})])}))},yB=function(){return Sz.parts.title({dom:{tag:"div",classes:["tox-dialog__title"],innerHtml:"",styles:{display:"none"}}})},wB=function(t,e){return Sz.parts.body({dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[{dom:Kh("<p>"+Xp(e.translate(t))+"</p>")}]}]})},xB=function(t){return Sz.parts.footer({dom:{tag:"div",classes:["tox-dialog__footer"]},components:t})},CB=function(t,e){return[ix.sketch({dom:{tag:"div",classes:["tox-dialog__footer-start"]},components:t}),ix.sketch({dom:{tag:"div",classes:["tox-dialog__footer-end"]},components:e})]},SB=function(t){var e,n="tox-dialog",r=n+"-wrap",o=r+"__backdrop",i=n+"__disable-scroll";return Sz.sketch({lazySink:t.lazySink,onEscape:function(e){return t.onEscape(e),R.some(!0)},useTabstopAt:function(t){return!Pk(t)},dom:{tag:"div",classes:[n].concat(t.extraClasses),styles:T({position:"relative"},t.extraStyles)},components:E([t.header,t.body],t.footer.toArray(),!0),parts:{blocker:{dom:Kh('<div class="'+r+'"></div>'),components:[{dom:{tag:"div",classes:pB?[o,o+"--opaque"]:[o]}}]}},dragBlockClass:r,modalBehaviours:uc(E([$g.config({}),Vg("dialog-events",t.dialogEvents.concat([zi(Ro(),function(t,e){Bg.focusIn(t)})])),Vg("scroll-lock",[Ri(function(){ku(Ne(),i)}),Bi(function(){Tu(Ne(),i)})])],t.extraBehaviours,!0)),eventOrder:T((e={},e[Jo()]=["dialog-events"],e[ci()]=["scroll-lock","dialog-events","alloy.base.behaviour"],e[si()]=["alloy.base.behaviour","dialog-events","scroll-lock"],e),t.eventOrder)})},kB=function(t){return Gh.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":t.translate("Close"),title:t.translate("Close")}},components:[ov("close",{tag:"div",classes:["tox-icon"]},t.icons)],action:function(t){bi(t,wx)}})},OB=function(t,e,n){var r=function(t){return[Hu(n.translate(t.title))]};return{dom:{tag:"div",classes:["tox-dialog__title"],attributes:T({},e.map(function(t){return{id:t}}).getOr({}))},components:r(t),behaviours:uc([FA.config({channel:fB,renderComponents:r})])}},TB=function(){return{dom:Kh('<div class="tox-dialog__draghandle"></div>')}},_B=function(t,e){return n={title:e.shared.providers.translate(t),draggable:e.dialog.isDraggableModal()},r=e.shared.providers,o=Sz.parts.title(OB(n,R.none(),r)),i=Sz.parts.draghandle(TB()),u=Sz.parts.close(kB(r)),a=[o].concat(n.draggable?[i]:[]).concat([u]),ix.sketch({dom:Kh('<div class="tox-dialog__header"></div>'),components:a});var n,r,o,i,u,a},EB=function(t,e,n){return{dom:{tag:"div",classes:["tox-dialog__busy-spinner"],attributes:{"aria-label":n.translate(t)},styles:{left:"0px",right:"0px",bottom:"0px",top:"0px",position:"absolute"}},behaviours:e,components:[{dom:Kh('<div class="tox-spinner"><div></div><div></div><div></div></div>')}]}},DB=function(t,e,n){return{onClose:function(){return n.closeWindow()},onBlock:function(n){Sz.setBusy(t(),function(t,r){return EB(n.message,r,e)})},onUnblock:function(){Sz.setIdle(t())}}},AB=function(t,e,n,r){var o;return Vu(SB(T(T({},t),{lazySink:r.shared.getSink,extraBehaviours:E([FA.config({channel:lB,updateState:function(t,e){return R.some(e)},initialData:e}),Dk({})],t.extraBehaviours,!0),onEscape:function(t){bi(t,wx)},dialogEvents:n,eventOrder:(o={},o[Yo()]=[FA.name(),dc.name()],o[ci()]=["scroll-lock",FA.name(),"messages","dialog-events","alloy.base.behaviour"],o[si()]=["alloy.base.behaviour","dialog-events","messages",FA.name(),"scroll-lock"],o)})))},NB=function(t){return W(t,function(t){return"menu"===t.type?function(t){var e=W(t.items,function(t){var e=so(!1);return T(T({},t),{storage:e})});return T(T({},t),{items:e})}(t):t})},MB=function(t){return X(t,function(t,e){return"menu"===e.type?X(e.items,function(t,e){return t[e.name]=e.storage,t},t):t},{})},zB=function(t,e){return[Ni(Ro(),Lk),t(yx,function(t,n){e.onClose(),n.onClose()}),t(wx,function(t,e,n,r){e.onCancel(t),bi(r,yx)}),_i(kx,function(t,n){return e.onUnblock()}),_i(Sx,function(t,n){return e.onBlock(n.event)})]},RB=function(t,e){var n=function(e,n){return _i(e,function(e,o){r(e,function(r,i){n(t(),r,o.event,e)})})},r=function(t,e){FA.getState(t).get().each(function(n){e(n,t)})};return E(E([],zB(n,e),!0),[n(xx,function(t,e,n){e.onAction(t,{name:n.name})})],!1)},BB=function(t,e,n){var r=function(e,n){return _i(e,function(e,r){o(e,function(o,i){n(t(),o,r.event,e)})})},o=function(t,e){FA.getState(t).get().each(function(n){e(n.internalDialog,t)})};return E(E([],zB(r,e),!0),[r(Cx,function(t,e){return e.onSubmit(t)}),r(bx,function(t,e,n){e.onChange(t,{name:n.name})}),r(xx,function(t,e,r,o){var i=function(){return Bg.focusIn(o)},u=function(t){return He(t,"disabled")||Pe(t,"aria-disabled").exists(function(t){return"true"===t})},a=Oe(o.element),c=vc(a);e.onAction(t,{name:r.name,value:r.value}),vc(a).fold(i,function(t){u(t)?i():c.exists(function(e){return fe(t,e)&&u(e)})?i():n().toOptional().filter(function(e){return!fe(e.element,t)}).each(i)})}),r(Ox,function(t,e,n){e.onTabChange(t,{newTabName:n.name,oldTabName:n.oldName})}),Bi(function(e){var n=t();af.setValue(e,n.getData())})],!1)},LB=function(t,e){var n=e.map(function(t){return t.footerButtons}).getOr([]),r=$(n,function(t){return"start"===t.align}),o=function(t,e){return ix.sketch({dom:{tag:"div",classes:["tox-dialog__footer-"+t]},components:W(e,function(t){return t.memento.asSpec()})})};return[o("start",r.pass),o("end",r.fail)]},PB=function(t,e){return{dom:Kh('<div class="tox-dialog__footer"></div>'),components:[],behaviours:uc([FA.config({channel:mB,initialData:t,updateState:function(t,n){var r=W(n.buttons,function(t){var n=Xh(function(t,e){return JO(t,t.type,e)}(t,e));return{name:t.name,align:t.align,memento:n}});return R.some({lookupByName:function(t,e){return function(t,e,n){return Y(e,function(t){return t.name===n}).bind(function(e){return e.memento.getOpt(t)})}(t,r,e)},footerButtons:r})},renderComponents:LB})])}},HB=function(t,e){return Sz.parts.footer(PB(t,e))},IB=function(t,e){if(t.getRoot().getSystem().isConnected()){var n=hd.getCurrent(t.getFormWrapper()).getOr(t.getFormWrapper());return sk.getField(n,e).fold(function(){var r=t.getFooter();return FA.getState(r).get().bind(function(t){return t.lookupByName(n,e)})},function(t){return R.some(t)})}return R.none()},FB=function(t,e,n){var r=function(e){var n=t.getRoot();n.getSystem().isConnected()&&e(n)},i={getData:function(){var e=t.getRoot(),r=e.getSystem().isConnected()?t.getFormWrapper():e,o=af.getValue(r),i=gt(n,function(t){return t.get()});return T(T({},o),i)},setData:function(e){r(function(r){var o=i.getData(),u=T(T({},o),e),a=function(t,e){var n=t.getRoot();return FA.getState(n).get().map(function(t){return Mr(Nr("data",t.dataValidator,e))}).getOr(e)}(t,u),c=t.getFormWrapper();af.setValue(c,a),mt(n,function(t,e){xt(u,e)&&t.set(u[e])})})},disable:function(e){IB(t,e).each(Dd.disable)},enable:function(e){IB(t,e).each(Dd.enable)},focus:function(e){IB(t,e).each($g.focus)},block:function(t){if(!o(t))throw new Error("The dialogInstanceAPI.block function should be passed a blocking message of type string as an argument");r(function(e){yi(e,Sx,{message:t})})},unblock:function(){r(function(t){bi(t,kx)})},showTab:function(e){r(function(n){var r=t.getBody();FA.getState(r).get().exists(function(t){return t.isTabPanel()})&&hd.getCurrent(r).each(function(t){iB.showTab(t,e)})})},redial:function(t){r(function(n){var r=e(t);n.getSystem().broadcastOn([lB],r),n.getSystem().broadcastOn([fB],r.internalDialog),n.getSystem().broadcastOn([dB],r.internalDialog),n.getSystem().broadcastOn([mB],r.internalDialog),i.setData(r.initialData)})},close:function(){r(function(t){bi(t,yx)})}};return i},VB=function(t,e,n){var r=_B(t.internalDialog.title,n),o=function(t,e){var n=hB(t,R.none(),e,!1);return Sz.parts.body(n)}({body:t.internalDialog.body},n),i=NB(t.internalDialog.buttons),u=MB(i),a=HB({buttons:i},n),c=BB(function(){return m},DB(function(){return f},n.shared.providers,e),n.shared.getSink),s=function(t){switch(t){case"large":return["tox-dialog--width-lg"];case"medium":return["tox-dialog--width-md"];default:return[]}}(t.internalDialog.size),l={header:r,body:o,footer:R.some(a),extraClasses:s,extraBehaviours:[],extraStyles:{}},f=AB(l,t,c,n),d={getRoot:v(f),getBody:function(){return Sz.getBody(f)},getFooter:function(){return Sz.getFooter(f)},getFormWrapper:function(){var t=Sz.getBody(f);return hd.getCurrent(t).getOr(t)}},m=FB(d,e.redial,u);return{dialog:f,instanceApi:m}},UB=function(t,e,n,r){var o,i,u,a,c,s=$i("dialog-label"),l=$i("dialog-content"),f=Xh((u={title:t.internalDialog.title,draggable:!0},a=s,c=n.shared.providers,ix.sketch({dom:Kh('<div class="tox-dialog__header"></div>'),components:[OB(u,R.some(a),c),TB(),kB(c)],containerBehaviours:uc([cz.config({mode:"mouse",blockerClass:"blocker",getTarget:function(t){return Ju(t,'[role="dialog"]').getOrDie()},snaps:{getSnapPoints:function(){return[]},leftAttr:"data-drag-left",topAttr:"data-drag-top"}})])}))),d=Xh(function(t,e,n,r){return hB(t,R.some(e),n,r)}({body:t.internalDialog.body},l,n,r)),m=NB(t.internalDialog.buttons),g=MB(m),h=Xh(function(t,e){return PB(t,e)}({buttons:m},n)),p=BB(function(){return y},{onBlock:function(t){gD.block(b,function(e,r){return EB(t.message,r,n.shared.providers)})},onUnblock:function(){gD.unblock(b)},onClose:function(){return e.closeWindow()}},n.shared.getSink),b=Vu({dom:{tag:"div",classes:["tox-dialog","tox-dialog-inline"],attributes:(o={role:"dialog"},o["aria-labelledby"]=s,o["aria-describedby"]=l,o)},eventOrder:(i={},i[Yo()]=[FA.name(),dc.name()],i[Jo()]=["execute-on-form"],i[ci()]=["reflecting","execute-on-form"],i),behaviours:uc([Bg.config({mode:"cyclic",onEscape:function(t){return bi(t,yx),R.some(!0)},useTabstopAt:function(t){return!Pk(t)&&("button"!==Pt(t)||"disabled"!==Le(t,"disabled"))}}),FA.config({channel:lB,updateState:function(t,e){return R.some(e)},initialData:t}),$g.config({}),Vg("execute-on-form",p.concat([zi(Ro(),function(t,e){Bg.focusIn(t)})])),gD.config({getRoot:function(){return R.some(b)}}),Fg.config({}),Dk({})]),components:[f.asSpec(),d.asSpec(),h.asSpec()]}),y=FB({getRoot:v(b),getFooter:function(){return h.get(b)},getBody:function(){return d.get(b)},getFormWrapper:function(){var t=d.get(b);return hd.getCurrent(t).getOr(t)}},e.redial,g);return{dialog:b,instanceApi:y}},jB=tinymce.util.Tools.resolve("tinymce.util.URI"),WB=["insertContent","setContent","execCommand","close","block","unblock"],qB=function(t){return i(t)&&-1!==WB.indexOf(t.mceAction)},$B=function(t,e,n,r){var u,a,s,l=_B(t.title,r),f=function(t){var e={dom:{tag:"div",classes:["tox-dialog__content-js"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-iframe"]},components:[Rk({dom:{tag:"iframe",attributes:{src:t.url}},behaviours:uc([dx.config({}),$g.config({})])})]}],behaviours:uc([Bg.config({mode:"acyclic",useTabstopAt:x(Pk)})])};return Sz.parts.body(e)}(t),d=t.buttons.bind(function(t){return 0===t.length?R.none():R.some(HB({buttons:t},r))}),m=RB(function(){return C},DB(function(){return w},r.shared.providers,e)),g=T(T({},t.height.fold(function(){return{}},function(t){return{height:t+"px","max-height":t+"px"}})),t.width.fold(function(){return{}},function(t){return{width:t+"px","max-width":t+"px"}})),h=t.width.isNone()&&t.height.isNone()?["tox-dialog--width-lg"]:[],p=new jB(t.url,{base_uri:new jB(window.location.href)}),v=p.protocol+"://"+p.host+(p.port?":"+p.port:""),b=Bc(),y=[Vg("messages",[Ri(function(){var e=Hc(Bt.fromDom(window),"message",function(e){if(p.isSameOrigin(new jB(e.raw.origin))){var r=e.raw.data;qB(r)?function(t,e,n){switch(n.mceAction){case"insertContent":t.insertContent(n.content);break;case"setContent":t.setContent(n.content);break;case"execCommand":var r=!!c(n.ui)&&n.ui;t.execCommand(n.cmd,r,n.value);break;case"close":e.close();break;case"block":e.block(n.message);break;case"unblock":e.unblock()}}(n,C,r):function(t){return!qB(t)&&i(t)&&xt(t,"mceAction")}(r)&&t.onMessage(C,r)}});b.set(e)}),Bi(b.clear)]),dc.config({channels:(u={},u[gB]={onReceive:function(t,e){Yu(t.element,"iframe").each(function(t){t.dom.contentWindow.postMessage(e,v)})}},u)})],w=AB({header:l,body:f,footer:d,extraClasses:h,extraBehaviours:y,extraStyles:g},t,m,r),C=(a=w,s=function(t){a.getSystem().isConnected()&&t(a)},{block:function(t){if(!o(t))throw new Error("The urlDialogInstanceAPI.block function should be passed a blocking message of type string as an argument");s(function(e){yi(e,Sx,{message:t})})},unblock:function(){s(function(t){bi(t,kx)})},close:function(){s(function(t){bi(t,yx)})},sendMessage:function(t){s(function(e){e.getSystem().broadcastOn([gB],t)})}});return{dialog:w,instanceApi:C}},GB=function(t){var e=t.backstage,n=t.editor,r=oy(n),o=function(t){var e=t.backstage.shared;return{open:function(n,r){var o=function(){Sz.hide(c),r()},i=Xh(JO({name:"close-alert",text:"OK",primary:!0,align:"end",disabled:!1,icon:R.none()},"cancel",t.backstage)),u=yB(),a=bB(o,e.providers),c=Vu(SB({lazySink:function(){return e.getSink()},header:vB(u,a),body:wB(n,e.providers),footer:R.some(xB(CB([],[i.asSpec()]))),onEscape:o,extraClasses:["tox-alert-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[_i(wx,o)],eventOrder:{}}));Sz.show(c);var s=i.get(c);$g.focus(s)}}}(t),i=function(t){var e=t.backstage.shared;return{open:function(n,r){var o=function(t){Sz.hide(s),r(t)},i=Xh(JO({name:"yes",text:"Yes",primary:!0,align:"end",disabled:!1,icon:R.none()},"submit",t.backstage)),u=JO({name:"no",text:"No",primary:!1,align:"end",disabled:!1,icon:R.none()},"cancel",t.backstage),a=yB(),c=bB(function(){return o(!1)},e.providers),s=Vu(SB({lazySink:function(){return e.getSink()},header:vB(a,c),body:wB(n,e.providers),footer:R.some(xB(CB([],[u,i.asSpec()]))),onEscape:function(){return o(!1)},extraClasses:["tox-confirm-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[_i(wx,function(){return o(!1)}),_i(Cx,function(){return o(!0)})],eventOrder:{}}));Sz.show(s);var l=i.get(s);$g.focus(l)}}}(t),u=function(t,r){return GR.openUrl(function(t){var o=$B(t,{closeWindow:function(){Sz.hide(o.dialog),r(o.instanceApi)}},n,e);return Sz.show(o.dialog),o.instanceApi},t)},a=function(t,n){return GR.open(function(t,r,o){var i=r,u=VB({dataValidator:o,initialData:i,internalDialog:t},{redial:GR.redial,closeWindow:function(){Sz.hide(u.dialog),n(u.instanceApi)}},e);return Sz.show(u.dialog),u.instanceApi.setData(i),u.instanceApi},t)},c=function(t,o,i,u){return GR.open(function(t,a,c){var s=Mr(Nr("data",c,a)),l=Lc(),f=e.shared.header.isPositionedAtTop(),d=function(){return l.on(function(t){_h.reposition(t),SE.refresh(t)})},m=UB({dataValidator:c,initialData:s,internalDialog:t},{redial:GR.redial,closeWindow:function(){l.on(_h.hide),n.off("ResizeEditor",d),l.clear(),i(m.instanceApi)}},e,u),g=Vu(_h.sketch(T(T({lazySink:e.shared.getSink,dom:{tag:"div",classes:[]},fireDismissalEventInstead:{}},f?{}:{fireRepositionEventInstead:{}}),{inlineBehaviours:uc(E([Vg("window-manager-inline-events",[_i(li(),function(t,e){bi(m.dialog,wx)})])],function(t,e,n){return e&&n?[]:[SE.config({contextual:{lazyContext:function(){return R.some(Dn(Bt.fromDom(t.getContentAreaContainer())))},fadeInClass:"tox-dialog-dock-fadein",fadeOutClass:"tox-dialog-dock-fadeout",transitionClass:"tox-dialog-dock-transition"},modes:["top"]})]}(n,r,f),!0)),isExtraPart:function(t,e){return function(t){return qw(t,".tox-alert-dialog")||qw(t,".tox-confirm-dialog")}(e)}})));return l.set(g),_h.showWithin(g,Uu(m.dialog),{anchor:o},R.some(Ne())),r&&f||(SE.refresh(g),n.on("ResizeEditor",d)),m.instanceApi.setData(s),Bg.focusIn(m.dialog),m.instanceApi},t)};return{open:function(t,n,r){return void 0!==n&&"toolbar"===n.inline?c(t,e.shared.anchors.inlineDialog(),r,n.ariaAttrs):void 0!==n&&"cursor"===n.inline?c(t,e.shared.anchors.cursor(),r,n.ariaAttrs):a(t,r)},openUrl:function(t,e){return u(t,e)},alert:function(t,e){o.open(t,function(){e()})},close:function(t){t.close()},confirm:function(t,e){i.open(t,function(t){e(t)})}}};O.add("silver",function(t){var e=yz(t),n=e.uiMothership,r=e.backstage,o=e.renderUI,i=e.getUi;Ww.register(t,r.shared);var u=GB({editor:t,backstage:r});return{renderUI:o,getWindowManagerImpl:v(u),getNotificationManagerImpl:function(){return av(t,{backstage:r},n)},ui:i()}})}()}).call(e,n("DuR2"))},BzBW:function(t,e){!function(){"use strict";var t=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},e=function(t){return function(e){return typeof e===t}},n=function(t){return function(e){return t===e}},r=t("string"),o=t("object"),i=t("array"),u=n(null),a=e("boolean"),c=n(void 0),s=function(t){return!function(t){return null===t||void 0===t}(t)},l=e("function"),f=e("number"),d=function(){},m=function(t){return function(){return t}},g=function(t){return t},h=function(t,e){return t===e};function p(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=e.concat(n);return t.apply(null,o)}}var v,b,y=function(t){return function(e){return!t(e)}},w=m(!1),x=m(!0),C=function(){return S},S={fold:function(t,e){return t()},isSome:w,isNone:x,getOr:b=g,getOrThunk:v=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:m(null),getOrUndefined:m(void 0),or:b,orThunk:v,map:C,each:d,bind:C,exists:w,forall:x,filter:function(){return C()},toArray:function(){return[]},toString:m("none()")},k=function(t){var e=m(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},isSome:x,isNone:w,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return k(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:S},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},O={some:k,none:C,from:function(t){return null===t||void 0===t?S:k(t)}},T=Array.prototype.slice,_=Array.prototype.indexOf,E=Array.prototype.push,D=function(t,e){return n=t,r=e,_.call(n,r)>-1;var n,r},A=function(t,e){for(var n=0,r=t.length;n<r;n++){if(e(t[n],n))return!0}return!1},N=function(t,e){for(var n=[],r=0;r<t;r++)n.push(e(r));return n},M=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},z=function(t,e){for(var n=0,r=t.length;n<r;n++){e(t[n],n)}},R=function(t,e){for(var n=[],r=[],o=0,i=t.length;o<i;o++){var u=t[o];(e(u,o)?n:r).push(u)}return{pass:n,fail:r}},B=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n},L=function(t,e,n){return function(t,e){for(var n=t.length-1;n>=0;n--)e(t[n],n)}(t,function(t,r){n=e(n,t,r)}),n},P=function(t,e,n){return z(t,function(t,r){n=e(n,t,r)}),n},H=function(t,e){return function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return O.some(i);if(n(i,r))break}return O.none()}(t,e,w)},I=function(t,e){for(var n=0,r=t.length;n<r;n++){if(e(t[n],n))return O.some(n)}return O.none()},F=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!i(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);E.apply(e,t[n])}return e},V=function(t,e){return F(M(t,e))},U=function(t,e){for(var n=0,r=t.length;n<r;++n){if(!0!==e(t[n],n))return!1}return!0},j=function(t,e){for(var n={},r=0,o=t.length;r<o;r++){var i=t[r];n[String(i)]=e(i,r)}return n},W=function(t){return[t]},q=function(t,e){return e>=0&&e<t.length?O.some(t[e]):O.none()},$=function(t){return q(t,0)},G=function(t){return q(t,t.length-1)},K=function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return O.none()},X=function(){return(X=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function Y(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}var J=function(t){var e,n=!1;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=!0,e=t.apply(null,r)),e}},Q=function(){return Z(0,0)},Z=function(t,e){return{major:t,minor:e}},tt={nu:Z,detect:function(t,e){var n=String(e).toLowerCase();return 0===t.length?Q():function(t,e){var n=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(r.test(e))return r}}(t,e);if(!n)return{major:0,minor:0};var r=function(t){return Number(e.replace(n,"$"+t))};return Z(r(1),r(2))}(t,n)},unknown:Q},et=function(t,e){var n=String(e).toLowerCase();return H(t,function(t){return t.search(n)})},nt=function(t,e,n){return""===e||t.length>=e.length&&t.substr(n,n+e.length)===e},rt=function(t,e){return-1!==t.indexOf(e)},ot=function(t,e){return nt(t,e,0)},it=function(t,e){return nt(t,e,t.length-e.length)},ut=function(t){return function(e){return e.replace(t,"")}}(/^\s+|\s+$/g),at=function(t){return t.length>0},ct=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,st=function(t){return function(e){return rt(e,t)}},lt=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return rt(t,"edge/")&&rt(t,"chrome")&&rt(t,"safari")&&rt(t,"applewebkit")}},{name:"Chrome",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,ct],search:function(t){return rt(t,"chrome")&&!rt(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return rt(t,"msie")||rt(t,"trident")}},{name:"Opera",versionRegexes:[ct,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:st("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:st("firefox")},{name:"Safari",versionRegexes:[ct,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(rt(t,"safari")||rt(t,"mobile/"))&&rt(t,"applewebkit")}}],ft=[{name:"Windows",search:st("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return rt(t,"iphone")||rt(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:st("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:st("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:st("linux"),versionRegexes:[]},{name:"Solaris",search:st("sunos"),versionRegexes:[]},{name:"FreeBSD",search:st("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:st("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],dt={browsers:m(lt),oses:m(ft)},mt=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isEdge:r("Edge"),isChrome:r("Chrome"),isIE:r("IE"),isOpera:r("Opera"),isFirefox:r("Firefox"),isSafari:r("Safari")}},gt={unknown:function(){return mt({current:void 0,version:tt.unknown()})},nu:mt,edge:m("Edge"),chrome:m("Chrome"),ie:m("IE"),opera:m("Opera"),firefox:m("Firefox"),safari:m("Safari")},ht=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isWindows:r("Windows"),isiOS:r("iOS"),isAndroid:r("Android"),isOSX:r("OSX"),isLinux:r("Linux"),isSolaris:r("Solaris"),isFreeBSD:r("FreeBSD"),isChromeOS:r("ChromeOS")}},pt={unknown:function(){return ht({current:void 0,version:tt.unknown()})},nu:ht,windows:m("Windows"),ios:m("iOS"),android:m("Android"),linux:m("Linux"),osx:m("OSX"),solaris:m("Solaris"),freebsd:m("FreeBSD"),chromeos:m("ChromeOS")},vt=function(t,e,n){var r=dt.browsers(),o=dt.oses(),i=e.bind(function(t){return function(t,e){return K(e.brands,function(e){var n=e.brand.toLowerCase();return H(t,function(t){var e;return n===(null===(e=t.brand)||void 0===e?void 0:e.toLowerCase())}).map(function(t){return{current:t.name,version:tt.nu(parseInt(e.version,10),0)}})})}(r,t)}).orThunk(function(){return function(t,e){return et(t,e).map(function(t){var n=tt.detect(t.versionRegexes,e);return{current:t.name,version:n}})}(r,t)}).fold(gt.unknown,gt.nu),u=function(t,e){return et(t,e).map(function(t){var n=tt.detect(t.versionRegexes,e);return{current:t.name,version:n}})}(o,t).fold(pt.unknown,pt.nu);return{browser:i,os:u,deviceType:function(t,e,n,r){var o=t.isiOS()&&!0===/ipad/i.test(n),i=t.isiOS()&&!o,u=t.isiOS()||t.isAndroid(),a=u||r("(pointer:coarse)"),c=o||!i&&u&&r("(min-device-width:768px)"),s=i||u&&!c,l=e.isSafari()&&t.isiOS()&&!1===/safari/i.test(n),f=!s&&!c&&!l;return{isiPad:m(o),isiPhone:m(i),isTablet:m(c),isPhone:m(s),isTouch:m(a),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:m(l),isDesktop:m(f)}}(u,i,t,n)}},bt=function(t){return window.matchMedia(t).matches},yt=J(function(){return vt(navigator.userAgent,O.from(navigator.userAgentData),bt)}),wt=function(){return yt()},xt=function(t){if(null===t||void 0===t)throw new Error("Node cannot be null or undefined");return{dom:t}},Ct={fromHtml:function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return xt(n.childNodes[0])},fromTag:function(t,e){var n=(e||document).createElement(t);return xt(n)},fromText:function(t,e){var n=(e||document).createTextNode(t);return xt(n)},fromDom:xt,fromPoint:function(t,e,n){return O.from(t.dom.elementFromPoint(e,n)).map(xt)}},St=function(t,e){var n=t.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},kt=function(t){return 1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType||0===t.childElementCount},Ot=function(t,e){var n=void 0===e?document:e.dom;return kt(n)?O.none():O.from(n.querySelector(t)).map(Ct.fromDom)},Tt=function(t,e){return t.dom===e.dom},_t=function(t,e){return n=t.dom,r=e.dom,function(t,e,n){return 0!=(t.compareDocumentPosition(e)&n)}(n,r,Node.DOCUMENT_POSITION_CONTAINED_BY);var n,r},Et=function(t,e){return wt().browser.isIE()?_t(t,e):function(t,e){var n=t.dom,r=e.dom;return n!==r&&n.contains(r)}(t,e)},Dt=St,At=Object.keys,Nt=Object.hasOwnProperty,Mt=function(t,e){for(var n=At(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}},zt=function(t,e){return Rt(t,function(t,n){return{k:n,v:e(t,n)}})},Rt=function(t,e){var n={};return Mt(t,function(t,r){var o=e(t,r);n[o.k]=o.v}),n},Bt=function(t,e){var n,r={};return function(t,e,n,r){Mt(t,function(t,o){(e(t,o)?n:r)(t,o)})}(t,e,(n=r,function(t,e){n[e]=t}),d),r},Lt=function(t,e){var n=[];return Mt(t,function(t,r){n.push(e(t,r))}),n},Pt=function(t){return Lt(t,g)},Ht=function(t){return At(t).length},It=function(t,e){return Ft(t,e)?O.from(t[e]):O.none()},Ft=function(t,e){return Nt.call(t,e)},Vt=function(t,e){return Ft(t,e)&&void 0!==t[e]&&null!==t[e]},Ut=["tfoot","thead","tbody","colgroup"],jt=function(t,e,n){return{element:t,rowspan:e,colspan:n}},Wt=function(t,e,n){return{element:t,cells:e,section:n}},qt=function(t,e,n){return{element:t,isNew:e,isLocked:n}},$t=function(t,e,n,r){return{element:t,cells:e,section:n,isNew:r}};"undefined"!=typeof window?window:Function("return this;")();var Gt=function(t){return t.dom.nodeName.toLowerCase()},Kt=function(t){return t.dom.nodeType},Xt=function(t){return function(e){return Kt(e)===t}},Yt=function(t){return 8===Kt(t)||"#comment"===Gt(t)},Jt=Xt(1),Qt=Xt(3),Zt=Xt(9),te=Xt(11),ee=function(t){return function(e){return Jt(e)&&Gt(e)===t}},ne=function(t){return Ct.fromDom(t.dom.ownerDocument)},re=function(t){return Zt(t)?t:ne(t)},oe=function(t){return O.from(t.dom.parentNode).map(Ct.fromDom)},ie=function(t,e){for(var n=l(e)?e:w,r=t.dom,o=[];null!==r.parentNode&&void 0!==r.parentNode;){var i=r.parentNode,u=Ct.fromDom(i);if(o.push(u),!0===n(u))break;r=i}return o},ue=function(t){return O.from(t.dom.previousSibling).map(Ct.fromDom)},ae=function(t){return O.from(t.dom.nextSibling).map(Ct.fromDom)},ce=function(t){return M(t.dom.childNodes,Ct.fromDom)},se=function(t,e){var n=t.dom.childNodes;return O.from(n[e]).map(Ct.fromDom)},le=l(Element.prototype.attachShadow)&&l(Node.prototype.getRootNode),fe=m(le),de=le?function(t){return Ct.fromDom(t.dom.getRootNode())}:re,me=function(t){var e,n=de(t);return te(e=n)&&s(e.dom.host)?O.some(n):O.none()},ge=function(t){return Ct.fromDom(t.dom.host)},he=function(t){return s(t.dom.shadowRoot)},pe=function(t){var e=Qt(t)?t.dom.parentNode:t.dom;if(void 0===e||null===e||null===e.ownerDocument)return!1;var n,r,o=e.ownerDocument;return me(Ct.fromDom(e)).fold(function(){return o.body.contains(e)},(n=pe,r=ge,function(t){return n(r(t))}))},ve=function(t){var e=t.dom.body;if(null===e||void 0===e)throw new Error("Body is not available yet");return Ct.fromDom(e)},be=function(t,e){var n=[];return z(ce(t),function(t){e(t)&&(n=n.concat([t])),n=n.concat(be(t,e))}),n},ye=function(t,e,n){return function(t,e,n){return B(ie(t,n),e)}(t,function(t){return St(t,e)},n)},we=function(t,e){return function(t,e){return B(ce(t),e)}(t,function(t){return St(t,e)})},xe=function(t,e){return function(t,e){var n=void 0===e?document:e.dom;return kt(n)?[]:M(n.querySelectorAll(t),Ct.fromDom)}(e,t)};function Ce(t,e,n,r,o){return t(n,r)?O.some(n):l(o)&&o(n)?O.none():e(n,r,o)}var Se=function(t,e,n){for(var r=t.dom,o=l(n)?n:w;r.parentNode;){r=r.parentNode;var i=Ct.fromDom(r);if(e(i))return O.some(i);if(o(i))break}return O.none()},ke=function(t,e,n){return Se(t,function(t){return St(t,e)},n)},Oe=function(t,e){return function(t,e){return H(t.dom.childNodes,function(t){return e(Ct.fromDom(t))}).map(Ct.fromDom)}(t,function(t){return St(t,e)})},Te=function(t,e){return Ot(e,t)},_e=function(t,e,n){return Ce(function(t,e){return St(t,e)},ke,t,e,n)},Ee=function(t,e,n){if(!(r(n)||a(n)||f(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")},De=function(t,e,n){Ee(t.dom,e,n)},Ae=function(t,e){var n=t.dom;Mt(e,function(t,e){Ee(n,e,t)})},Ne=function(t,e){var n=t.dom.getAttribute(e);return null===n?void 0:n},Me=function(t,e){return O.from(Ne(t,e))},ze=function(t,e){t.dom.removeAttribute(e)},Re=function(t){return P(t.dom.attributes,function(t,e){return t[e.name]=e.value,t},{})},Be=function(t,e,n){return void 0===n&&(n=h),t.exists(function(t){return n(t,e)})},Le=function(t){for(var e=[],n=function(t){e.push(t)},r=0;r<t.length;r++)t[r].each(n);return e},Pe=function(t,e,n){return t.isSome()&&e.isSome()?O.some(n(t.getOrDie(),e.getOrDie())):O.none()},He=function(t,e){return t?O.some(e):O.none()},Ie=function(t){return void 0!==t.style&&l(t.style.getPropertyValue)},Fe=function(t,e,n){if(!r(n))throw console.error("Invalid call to CSS.set. Property ",e,":: Value ",n,":: Element ",t),new Error("CSS value must be a string: "+n);Ie(t)&&t.style.setProperty(e,n)},Ve=function(t,e,n){var r=t.dom;Fe(r,e,n)},Ue=function(t,e){var n=t.dom;Mt(e,function(t,e){Fe(n,e,t)})},je=function(t,e){var n=t.dom,r=window.getComputedStyle(n).getPropertyValue(e);return""!==r||pe(t)?r:We(n,e)},We=function(t,e){return Ie(t)?t.style.getPropertyValue(e):""},qe=function(t,e){var n=t.dom,r=We(n,e);return O.from(r).filter(function(t){return t.length>0})},$e=function(t,e){!function(t,e){Ie(t)&&t.style.removeProperty(e)}(t.dom,e),Be(Me(t,"style").map(ut),"")&&ze(t,"style")},Ge=function(t,e,n){return void 0===n&&(n=0),Me(t,e).map(function(t){return parseInt(t,10)}).getOr(n)},Ke=function(t,e){return Ge(t,e,1)},Xe=function(t){return ee("col")(t)?Ge(t,"span",1)>1:Ke(t,"colspan")>1},Ye=function(t){return Ke(t,"rowspan")>1},Je=function(t,e){return parseInt(je(t,e),10)},Qe=m(10),Ze=m(10),tn=function(t,e){return en(t,e,x)},en=function(t,e,n){return V(ce(t),function(t){return St(t,e)?n(t)?[t]:[]:en(t,e,n)})},nn=function(t,e){return function(t,e,n){if(void 0===n&&(n=w),n(e))return O.none();if(D(t,Gt(e)))return O.some(e);return ke(e,t.join(","),function(t){return St(t,"table")||n(t)})}(["td","th"],t,e)},rn=function(t){return tn(t,"th,td")},on=function(t){return St(t,"colgroup")?we(t,"col"):V(cn(t),function(t){return we(t,"col")})},un=function(t,e){return _e(t,"table",e)},an=function(t){return tn(t,"tr")},cn=function(t){return un(t).fold(m([]),function(t){return we(t,"colgroup")})},sn=function(t,e){return M(t,function(t){if("colgroup"===Gt(t)){var n=M(on(t),function(t){var e=Ge(t,"span",1);return jt(t,1,e)});return Wt(t,n,"colgroup")}n=M(rn(t),function(t){var e=Ge(t,"rowspan",1),n=Ge(t,"colspan",1);return jt(t,e,n)});return Wt(t,n,e(t))})},ln=function(t){return oe(t).map(function(t){var e=Gt(t);return function(t){return D(Ut,t)}(e)?e:"tbody"}).getOr("tbody")},fn=function(t){var e=an(t),n=Y(Y([],cn(t),!0),e,!0);return sn(n,ln)},dn=function(t,e,n){var r=t.cells,o=r.slice(0,e),i=r.slice(e),u=o.concat(n).concat(i);return hn(t,u)},mn=function(t,e,n){return dn(t,e,[n])},gn=function(t,e,n){t.cells[e]=n},hn=function(t,e){return $t(t.element,e,t.section,t.isNew)},pn=function(t,e){return t.cells[e]},vn=function(t,e){return pn(t,e).element},bn=function(t){return t.cells.length},yn=function(t){var e=R(t,function(t){return"colgroup"===t.section});return{rows:e.fail,cols:e.pass}},wn=function(t,e,n){var r=M(t.cells,n);return $t(e(t.element),r,t.section,!0)},xn="data-snooker-locked-cols",Cn=function(t){return Me(t,xn).bind(function(t){return O.from(t.match(/\d+/g))}).map(function(t){return j(t,x)})},Sn=function(t){var e,n,r,o=P(yn(t).rows,function(t,e){return z(e.cells,function(e,n){e.isLocked&&(t[n]=!0)}),t},{}),i=Lt(o,function(t,e){return parseInt(e,10)});return e=i,(r=T.call(e,0)).sort(n),r},kn=function(t,e){return t+","+e},On=function(t,e){var n=V(t.all,function(t){return t.cells});return B(n,e)},Tn=function(t){var e={},n=[],r=$(t).map(function(t){return t.element}).bind(un).bind(Cn).getOr({}),o=0,i=0,u=0,a=R(t,function(t){return"colgroup"===t.section}),c=a.pass,s=a.fail;z(s,function(t){var a=[];z(t.cells,function(t){for(var n=0;void 0!==e[kn(u,n)];)n++;for(var o=Vt(r,n.toString()),c=function(t,e,n,r,o,i){return{element:t,rowspan:e,colspan:n,row:r,column:o,isLocked:i}}(t.element,t.rowspan,t.colspan,u,n,o),s=0;s<t.colspan;s++)for(var l=0;l<t.rowspan;l++){var f=n+s,d=kn(u+l,f);e[d]=c,i=Math.max(i,f+1)}a.push(c)}),o++,n.push(Wt(t.element,a,t.section)),u++});var l=G(c).map(function(t){var e=function(t){var e={},n=0;return z(t.cells,function(t){var r=t.colspan;N(r,function(o){var i=n+o;e[i]=function(t,e,n){return{element:t,colspan:e,column:n}}(t.element,r,i)}),n+=r}),e}(t);return{colgroups:[function(t,e){return{element:t,columns:e}}(t.element,Pt(e))],columns:e}}).getOrThunk(function(){return{colgroups:[],columns:{}}}),f=l.columns,d=l.colgroups;return{grid:function(t,e){return{rows:t,columns:e}}(o,i),access:e,all:n,columns:f,colgroups:d}},_n={fromTable:function(t){var e=fn(t);return Tn(e)},generate:Tn,getAt:function(t,e,n){return O.from(t.access[kn(e,n)])},findItem:function(t,e,n){var r=On(t,function(t){return n(e,t.element)});return r.length>0?O.some(r[0]):O.none()},filterItems:On,justCells:function(t){return V(t.all,function(t){return t.cells})},justColumns:function(t){return Pt(t.columns)},hasColumns:function(t){return At(t.columns).length>0},getColumnAt:function(t,e){return O.from(t.columns[e])}},En=function(t,e){var n=e.column,r=e.column+e.colspan-1,o=e.row,i=e.row+e.rowspan-1;return n<=t.finishCol&&r>=t.startCol&&o<=t.finishRow&&i>=t.startRow},Dn=function(t,e){return e.column>=t.startCol&&e.column+e.colspan-1<=t.finishCol&&e.row>=t.startRow&&e.row+e.rowspan-1<=t.finishRow},An=function(t,e,n){var r=_n.findItem(t,e,Tt),o=_n.findItem(t,n,Tt);return r.bind(function(t){return o.map(function(e){return n=t,r=e,o=Math.min(n.row,r.row),i=Math.min(n.column,r.column),u=Math.max(n.row+n.rowspan-1,r.row+r.rowspan-1),a=Math.max(n.column+n.colspan-1,r.column+r.colspan-1),{startRow:o,startCol:i,finishRow:u,finishCol:a};var n,r,o,i,u,a})})},Nn=function(t,e,n){return An(t,e,n).bind(function(e){return function(t,e){for(var n=!0,r=p(Dn,e),o=e.startRow;o<=e.finishRow;o++)for(var i=e.startCol;i<=e.finishCol;i++)n=n&&_n.getAt(t,o,i).exists(r);return n?O.some(e):O.none()}(t,e)})},Mn=function(t,e,n){return An(t,e,n).map(function(e){var n=_n.filterItems(t,p(En,e));return M(n,function(t){return t.element})})},zn=function(t,e){return _n.findItem(t,e,function(t,e){return Et(e,t)}).map(function(t){return t.element})},Rn=function(t,e,n){return un(t).bind(function(r){return function(t,e,n,r){return _n.findItem(t,e,Tt).bind(function(e){var o=n>0?e.row+e.rowspan-1:e.row,i=r>0?e.column+e.colspan-1:e.column;return _n.getAt(t,o+n,i+r).map(function(t){return t.element})})}(Ln(r),t,e,n)})},Bn=function(t,e,n,r,o){var i=Ln(t),u=Tt(t,n)?O.some(e):zn(i,e),a=Tt(t,o)?O.some(r):zn(i,r);return u.bind(function(t){return a.bind(function(e){return Mn(i,t,e)})})},Ln=_n.fromTable,Pn=function(t,e){oe(t).each(function(n){n.dom.insertBefore(e.dom,t.dom)})},Hn=function(t,e){ae(t).fold(function(){oe(t).each(function(t){Fn(t,e)})},function(t){Pn(t,e)})},In=function(t,e){(function(t){return se(t,0)})(t).fold(function(){Fn(t,e)},function(n){t.dom.insertBefore(e.dom,n.dom)})},Fn=function(t,e){t.dom.appendChild(e.dom)},Vn=function(t,e){Pn(t,e),Fn(e,t)},Un=function(t,e){z(e,function(n,r){var o=0===r?t:e[r-1];Hn(o,n)})},jn=function(t,e){z(e,function(e){Fn(t,e)})},Wn=function(t){t.dom.textContent="",z(ce(t),function(t){qn(t)})},qn=function(t){var e=t.dom;null!==e.parentNode&&e.parentNode.removeChild(e)},$n=function(t){var e,n=ce(t);n.length>0&&(e=t,z(n,function(t){Pn(e,t)})),qn(t)},Gn=function(t,e){var n=function(e){return t(e)?O.from(e.dom.nodeValue):O.none()};return{get:function(r){if(!t(r))throw new Error("Can only get "+e+" value of a "+e+" node");return n(r).getOr("")},getOption:n,set:function(n,r){if(!t(n))throw new Error("Can only set raw "+e+" value of a "+e+" node");n.dom.nodeValue=r}}}(Qt,"text"),Kn=function(t){return Gn.get(t)},Xn=function(t){return Gn.getOption(t)},Yn=function(t,e){return Gn.set(t,e)},Jn=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","li","table","thead","tbody","tfoot","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"];function Qn(){return{up:m({selector:ke,closest:_e,predicate:Se,all:ie}),down:m({selector:xe,predicate:be}),styles:m({get:je,getRaw:qe,set:Ve,remove:$e}),attrs:m({get:Ne,set:De,remove:ze,copyTo:function(t,e){var n=Re(t);Ae(e,n)}}),insert:m({before:Pn,after:Hn,afterAll:Un,append:Fn,appendAll:jn,prepend:In,wrap:Vn}),remove:m({unwrap:$n,remove:qn}),create:m({nu:Ct.fromTag,clone:function(t){return Ct.fromDom(t.dom.cloneNode(!1))},text:Ct.fromText}),query:m({comparePosition:function(t,e){return t.dom.compareDocumentPosition(e.dom)},prevSibling:ue,nextSibling:ae}),property:m({children:ce,name:Gt,parent:oe,document:function(t){return re(t).dom},isText:Qt,isComment:Yt,isElement:Jt,isSpecial:function(t){var e=Gt(t);return D(["script","noscript","iframe","noframes","noembed","title","style","textarea","xmp"],e)},getLanguage:function(t){return Jt(t)?Me(t,"lang"):O.none()},getText:Kn,setText:Yn,isBoundary:function(t){return!!Jt(t)&&("body"===Gt(t)||D(Jn,Gt(t)))},isEmptyTag:function(t){return!!Jt(t)&&D(["br","img","hr","input"],Gt(t))},isNonEditable:function(t){return Jt(t)&&"false"===Ne(t,"contenteditable")}}),eq:Tt,is:Dt}}var Zn,tr,er=function(t,e,n,r){var o=e(t,n);return L(r,function(n,r){var o=e(t,r);return nr(t,n,o)},o)},nr=function(t,e,n){return e.bind(function(e){return n.filter(p(t.eq,e))})},rr=function(t,e,n){return n.length>0?function(t,e,n,r){return r(t,e,n[0],n.slice(1))}(t,e,n,er):O.none()},or=function(t,e,n,r){void 0===r&&(r=w);var o=[e].concat(t.up().all(e)),i=[n].concat(t.up().all(n)),u=function(t){return I(t,r).fold(function(){return t},function(e){return t.slice(0,e+1)})},a=u(o),c=u(i),s=H(a,function(e){return A(c,function(t,e){return p(t.eq,e)}(t,e))});return{firstpath:a,secondpath:c,shared:s}},ir=Qn(),ur=function(t,e){return rr(ir,function(e,n){return t(n)},e)},ar=function(t){return ke(t,"table")},cr=function(t,e,n){var r=function(t){return function(e){return void 0!==n&&n(e)||Tt(e,t)}};return Tt(t,e)?O.some({boxes:O.some([t]),start:t,finish:e}):ar(t).bind(function(o){return ar(e).bind(function(i){if(Tt(o,i))return O.some({boxes:(s=o,l=t,f=e,d=Ln(s),Mn(d,l,f)),start:t,finish:e});if(Et(o,i)){var u=(a=ye(e,"td,th",r(o))).length>0?a[a.length-1]:e;return O.some({boxes:Bn(o,t,o,e,i),start:t,finish:u})}if(Et(i,o)){var a,c=(a=ye(t,"td,th",r(i))).length>0?a[a.length-1]:t;return O.some({boxes:Bn(i,t,o,e,i),start:t,finish:c})}return function(t,e,n){return or(ir,t,e,n)}(t,e).shared.bind(function(u){return _e(u,"table",n).bind(function(n){var u=ye(e,"td,th",r(n)),a=u.length>0?u[u.length-1]:e,c=ye(t,"td,th",r(n)),s=c.length>0?c[c.length-1]:t;return O.some({boxes:Bn(n,t,o,e,i),start:s,finish:a})})});var s,l,f,d})})},sr=function(t,e){var n=xe(t,e);return n.length>0?O.some(n):O.none()},lr=function(t,e,n){return Te(t,e).bind(function(e){return Te(t,n).bind(function(t){return ur(ar,[e,t]).map(function(n){return{first:e,last:t,table:n}})})})},fr=function(t,e,n,r,o){return function(t,e){return H(t,function(t){return St(t,e)})}(t,o).bind(function(t){return Rn(t,e,n).bind(function(t){return function(t,e){return ke(t,"table").bind(function(n){return Te(n,e).bind(function(e){return cr(e,t).bind(function(t){return t.boxes.map(function(e){return{boxes:e,start:t.start,finish:t.finish}})})})})}(t,r)})})},dr=function(t,e){return sr(t,e)},mr=function(t,e,n){return lr(t,e,n).bind(function(e){var n=function(e){return Tt(t,e)},r=ke(e.first,"thead,tfoot,tbody,table",n),o=ke(e.last,"thead,tfoot,tbody,table",n);return r.bind(function(t){return o.bind(function(n){return Tt(t,n)?(r=e.table,o=e.first,i=e.last,u=Ln(r),Nn(u,o,i)):O.none();var r,o,i,u})})})},gr=function(t){if(!i(t))throw new Error("cases must be an array");if(0===t.length)throw new Error("there must be at least one case");var e=[],n={};return z(t,function(r,o){var u=At(r);if(1!==u.length)throw new Error("one and only one name per case");var a=u[0],c=r[a];if(void 0!==n[a])throw new Error("duplicate key detected:"+a);if("cata"===a)throw new Error("cannot have a case named cata (sorry)");if(!i(c))throw new Error("case arguments must be an array");e.push(a),n[a]=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=n.length;if(i!==c.length)throw new Error("Wrong number of arguments to case "+a+". Expected "+c.length+" ("+c+"), got "+i);return{fold:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];if(e.length!==t.length)throw new Error("Wrong number of arguments to fold. Expected "+t.length+", got "+e.length);return e[o].apply(null,n)},match:function(t){var r=At(t);if(e.length!==r.length)throw new Error("Wrong number of arguments to match. Expected: "+e.join(",")+"\nActual: "+r.join(","));if(!U(e,function(t){return D(r,t)}))throw new Error("Not all branches were specified when using match. Specified: "+r.join(", ")+"\nRequired: "+e.join(", "));return t[a].apply(null,n)},log:function(t){console.log(t,{constructors:e,constructor:a,params:n})}}}}),n},hr=gr([{none:[]},{multiple:["elements"]},{single:["element"]}]),pr=function(t,e,n,r){return t.fold(e,n,r)},vr=hr.none,br=hr.multiple,yr=hr.single,wr=tinymce.util.Tools.resolve("tinymce.PluginManager"),xr=function(t,e){return Ct.fromDom(t.dom.cloneNode(e))},Cr=function(t){return xr(t,!1)},Sr=function(t){return xr(t,!0)},kr=function(t,e){var n=Ct.fromTag(e),r=Re(t);return Ae(n,r),n},Or=function(t,e){var n=function(n){var r=e(n);if(r<=0||null===r){var o=je(n,t);return parseFloat(o)||0}return r},r=function(t,e){return P(e,function(e,n){var r=je(t,n),o=void 0===r?0:parseInt(r,10);return isNaN(o)?e:e+o},0)};return{set:function(e,n){if(!f(n)&&!n.match(/^[0-9]+$/))throw new Error(t+".set accepts only positive integer values. Value was "+n);var r=e.dom;Ie(r)&&(r.style[t]=n+"px")},get:n,getOuter:n,aggregate:r,max:function(t,e,n){var o=r(t,n);return e>o?e-o:0}}},Tr=function(){var t=wt().browser;return t.isIE()||t.isEdge()},_r=function(t,e){return(n=t,r=parseFloat(n),isNaN(r)?O.none():O.some(r)).getOr(e);var n,r},Er=function(t,e,n){return _r(je(t,e),n)},Dr=function(t){return je(t,"box-sizing")},Ar=function(t,e,n,r){return e-Er(t,"padding-"+n,0)-Er(t,"padding-"+r,0)-Er(t,"border-"+n+"-width",0)-Er(t,"border-"+r+"-width",0)},Nr=function(t,e){var n=t.dom,r=n.getBoundingClientRect().width||n.offsetWidth;return"border-box"===e?r:Ar(t,r,"left","right")},Mr=Or("width",function(t){return t.dom.offsetWidth}),zr=function(t){return Mr.get(t)},Rr=function(t){return Mr.getOuter(t)},Br=function(t){return Nr(t,"content-box")},Lr=function(t){return Tr()?Nr(t,Dr(t)):Er(t,"width",t.dom.offsetWidth)},Pr=function(t,e){void 0===e&&(e=x);var n=t.grid,r=N(n.columns,g),o=N(n.rows,g);return M(r,function(n){return Hr(function(){return V(o,function(e){return _n.getAt(t,e,n).filter(function(t){return t.column===n}).toArray()})},function(t){return 1===t.colspan&&e(t.element)},function(){return _n.getAt(t,0,n)})})},Hr=function(t,e,n){var r=t();return H(r,e).orThunk(function(){return O.from(r[0]).orThunk(n)}).map(function(t){return t.element})},Ir=function(t){var e=t.grid,n=N(e.rows,g),r=N(e.columns,g);return M(n,function(e){return Hr(function(){return V(r,function(n){return _n.getAt(t,e,n).filter(function(t){return t.row===e}).fold(m([]),function(t){return[t]})})},function(t){return 1===t.rowspan},function(){return _n.getAt(t,e,0)})})},Fr=function(t,e){if(e<0||e>=t.length-1)return O.none();var n=t[e].fold(function(){var n=function(t){var e=T.call(t,0);return e.reverse(),e}(t.slice(0,e));return K(n,function(t,e){return t.map(function(t){return{value:t,delta:e+1}})})},function(t){return O.some({value:t,delta:0})}),r=t[e+1].fold(function(){var n=t.slice(e+1);return K(n,function(t,e){return t.map(function(t){return{value:t,delta:e+1}})})},function(t){return O.some({value:t,delta:1})});return n.bind(function(t){return r.map(function(e){var n=e.delta+t.delta;return Math.abs(e.value-t.value)/n})})},Vr=function(t,e){return function(n){return"rtl"===Ur(n)?e:t}},Ur=function(t){return"rtl"===je(t,"direction")?"rtl":"ltr"},jr=Or("height",function(t){var e=t.dom;return pe(t)?e.getBoundingClientRect().height:e.offsetHeight}),Wr=function(t){return jr.get(t)},qr=function(t){return jr.getOuter(t)},$r=function(t){return Tr()?function(t,e){var n=t.dom,r=n.getBoundingClientRect().height||n.offsetHeight;return"border-box"===e?r:Ar(t,r,"top","bottom")}(t,Dr(t)):Er(t,"height",t.dom.offsetHeight)},Gr=function(t,e){return{left:t,top:e,translate:function(n,r){return Gr(t+n,e+r)}}},Kr=Gr,Xr=function(t,e){return void 0!==t?t:void 0!==e?e:0},Yr=function(t){var e=t.dom.ownerDocument,n=e.body,r=e.defaultView,o=e.documentElement;if(n===t.dom)return Kr(n.offsetLeft,n.offsetTop);var i=Xr(null===r||void 0===r?void 0:r.pageYOffset,o.scrollTop),u=Xr(null===r||void 0===r?void 0:r.pageXOffset,o.scrollLeft),a=Xr(o.clientTop,n.clientTop),c=Xr(o.clientLeft,n.clientLeft);return Jr(t).translate(u-c,i-a)},Jr=function(t){var e=t.dom,n=e.ownerDocument.body;return n===e?Kr(n.offsetLeft,n.offsetTop):pe(t)?function(t){var e=t.getBoundingClientRect();return Kr(e.left,e.top)}(e):Kr(0,0)},Qr=function(t,e){return{row:t,y:e}},Zr=function(t,e){return{col:t,x:e}},to=function(t){return Yr(t).left+Rr(t)},eo=function(t){return Yr(t).left},no=function(t,e){return Zr(t,eo(e))},ro=function(t,e){return Zr(t,to(e))},oo=function(t){return Yr(t).top},io=function(t,e){return Qr(t,oo(e))},uo=function(t,e){return Qr(t,oo(e)+qr(e))},ao=function(t,e,n){if(0===n.length)return[];var r=M(n.slice(1),function(e,n){return e.map(function(e){return t(n,e)})}),o=n[n.length-1].map(function(t){return e(n.length-1,t)});return r.concat([o])},co={delta:g,positions:function(t){return ao(io,uo,t)},edge:oo},so=Vr({delta:g,edge:eo,positions:function(t){return ao(no,ro,t)}},{delta:function(t){return-t},edge:to,positions:function(t){return ao(ro,no,t)}}),lo={delta:function(t,e){return so(e).delta(t,e)},positions:function(t,e){return so(e).positions(t,e)},edge:function(t){return so(t).edge(t)}},fo={unsupportedLength:["em","ex","cap","ch","ic","rem","lh","rlh","vw","vh","vi","vb","vmin","vmax","cm","mm","Q","in","pc","pt","px"],fixed:["px","pt"],relative:["%"],empty:[""]},mo=(tr=["Infinity","[0-9]+\\."+(Zn=function(t){return"(?:"+t+")?"})("[0-9]+")+Zn("[eE][+-]?[0-9]+"),"\\.[0-9]+"+Zn("[eE][+-]?[0-9]+"),"[0-9]+"+Zn("[eE][+-]?[0-9]+")].join("|"),new RegExp("^([+-]?(?:"+tr+"))(.*)$")),go=function(t,e){return O.from(mo.exec(t)).bind(function(t){var n=Number(t[1]),r=t[2];return function(t,e){return A(e,function(e){return A(fo[e],function(e){return t===e})})}(r,e)?O.some({value:n,unit:r}):O.none()})},ho=/(\d+(\.\d+)?)%/,po=/(\d+(\.\d+)?)px|em/,vo=ee("col"),bo=function(t,e,n){var r,o=(r=t,O.from(r.dom.parentElement).map(Ct.fromDom)).getOrThunk(function(){return ve(ne(t))});return e(t)/n(o)*100},yo=function(t,e){Ve(t,"width",e+"px")},wo=function(t,e){Ve(t,"width",e+"%")},xo=function(t,e){Ve(t,"height",e+"px")},Co=function(t,e,n,r){var o=parseFloat(t);return it(t,"%")&&"table"!==Gt(e)?function(t,e,n,r){var o=un(t).map(function(t){var r=n(t);return Math.floor(e/100*r)}).getOr(e);return r(t,o),o}(e,o,n,r):o},So=function(t){var e=function(t){return $r(t)+"px"}(t);return e?Co(e,t,Wr,xo):Wr(t)},ko=function(t,e){return qe(t,e).orThunk(function(){return Me(t,e).map(function(t){return t+"px"})})},Oo=function(t){return ko(t,"width")},To=function(t){return bo(t,zr,Br)},_o=function(t){return vo(t)?zr(t):Lr(t)},Eo=function(t){return function(t,e,n){return n(t)/Ke(t,e)}(t,"rowspan",So)},Do=function(t,e,n){Ve(t,"width",e+n)},Ao=function(t){return bo(t,zr,Br)+"%"},No=m(ho),Mo=ee("col"),zo=function(t){return Oo(t).getOrThunk(function(){return _o(t)+"px"})},Ro=function(t){return(e=t,ko(e,"height")).getOrThunk(function(){return Eo(t)+"px"});var e},Bo=function(t,e,n,r,o,i){return t.filter(r).fold(function(){return i(Fr(n,e))},function(t){return o(t)})},Lo=function(t,e,n,r){var o=Pr(t),i=_n.hasColumns(t)?function(t){return M(_n.justColumns(t),function(t){return O.from(t.element)})}(t):o,u=[O.some(lo.edge(e))].concat(M(lo.positions(o,e),function(t){return t.map(function(t){return t.x})})),a=y(Xe);return M(i,function(t,e){return Bo(t,e,u,a,function(t){if(function(t){var e=wt().browser,n=e.isChrome()||e.isFirefox();return!Mo(t)||n}(t))return n(t);var i,c=void 0!==(i=o[e])&&null!==i?g(i):O.none();return Bo(c,e,u,a,function(t){return r(O.some(zr(t)))},r)},r)})},Po=function(t){return t.map(function(t){return t+"px"}).getOr("")},Ho=function(t,e,n){return Lo(t,e,_o,function(t){return t.getOrThunk(n.minCellWidth)})},Io=function(t,e,n,r,o){var i=Ir(t),u=[O.some(n.edge(e))].concat(M(n.positions(i,e),function(t){return t.map(function(t){return t.y})}));return M(i,function(t,e){return Bo(t,e,u,y(Ye),r,o)})},Fo=function(t,e){return function(){return pe(t)?e(t):parseFloat(qe(t,"width").getOr("0"))}},Vo=function(t){var e=Fo(t,zr),n=m(0);return{width:e,pixelWidth:e,getWidths:function(e,n){return Ho(e,t,n)},getCellDelta:n,singleColumnWidth:m([0]),minCellWidth:n,setElementWidth:d,adjustTableWidth:d,isRelative:!0,label:"none"}},Uo=function(t){var e=Fo(t,function(t){return parseFloat(Ao(t))}),n=Fo(t,zr);return{width:e,pixelWidth:n,getWidths:function(e,n){return function(t,e,n){return Lo(t,e,To,function(t){return t.fold(function(){return n.minCellWidth()},function(t){return t/n.pixelWidth()*100})})}(e,t,n)},getCellDelta:function(t){return t/n()*100},singleColumnWidth:function(t,e){return[100-t]},minCellWidth:function(){return Qe()/n()*100},setElementWidth:wo,adjustTableWidth:function(n){var r=e();wo(t,r+n/100*r)},isRelative:!0,label:"percent"}},jo=function(t){var e=Fo(t,zr);return{width:e,pixelWidth:e,getWidths:function(e,n){return Ho(e,t,n)},getCellDelta:g,singleColumnWidth:function(t,e){return[Math.max(Qe(),t+e)-t]},minCellWidth:Qe,setElementWidth:yo,adjustTableWidth:function(n){var r=e()+n;yo(t,r)},isRelative:!1,label:"pixel"}},Wo=function(t){return Oo(t).fold(function(){return Vo(t)},function(e){return n=t,r=e,null!==No().exec(r)?Uo(n):jo(n);var n,r})},qo=jo,$o=Uo,Go=function(t,e,n){var r=t[n].element,o=Ct.fromTag("td");Fn(o,Ct.fromTag("br")),(e?Fn:In)(r,o)},Ko=function(t,e){var n=function(t){return St(t.element,e)},r=Sr(t),o=fn(r),i=Wo(t),u=_n.generate(o),a=function(t,e){var n=t.grid.columns,r=t.grid.rows,o=n,i=0,u=0,a=[],c=[];return Mt(t.access,function(t){if(a.push(t),e(t)){c.push(t);var n=t.row,s=n+t.rowspan-1,l=t.column,f=l+t.colspan-1;n<r?r=n:s>i&&(i=s),l<o?o=l:f>u&&(u=f)}}),function(t,e,n,r,o,i){return{minRow:t,minCol:e,maxRow:n,maxCol:r,allCells:o,selectedCells:i}}(r,o,i,u,a,c)}(u,n),c="th:not("+e+"),td:not("+e+")",s=en(r,"th,td",function(t){return St(t,c)});return z(s,qn),function(t,e,n,r){for(var o=e.grid.columns,i=e.grid.rows,u=0;u<i;u++)for(var a=!1,c=0;c<o;c++)u<n.minRow||u>n.maxRow||c<n.minCol||c>n.maxCol||(_n.getAt(e,u,c).filter(r).isNone()?Go(t,a,u):a=!0)}(o,u,a,n),function(t,e,n,r){Mt(n.columns,function(t){(t.column<e.minCol||t.column>e.maxCol)&&qn(t.element)});var o=B(tn(t,"tr"),function(t){return 0===t.dom.childElementCount});z(o,qn),e.minCol!==e.maxCol&&e.minRow!==e.maxRow||z(tn(t,"th,td"),function(t){ze(t,"rowspan"),ze(t,"colspan")}),ze(t,xn),ze(t,"data-snooker-col-series"),Wo(t).adjustTableWidth(r)}(r,a,u,function(t,e,n,r){if(0===r.minCol&&e.grid.columns===r.maxCol+1)return 0;var o=Ho(e,t,n),i=P(o,function(t,e){return t+e},0),u=P(o.slice(r.minCol,r.maxCol+1),function(t,e){return t+e},0)/i*n.pixelWidth()-n.pixelWidth();return n.getCellDelta(u)}(t,_n.fromTable(t),i,a)),r},Xo=function(t){return"img"===Gt(t)?1:Xn(t).fold(function(){return ce(t).length},function(t){return t.length})},Yo=["img","br"],Jo=function(t){return Xn(t).filter(function(t){return 0!==t.trim().length||t.indexOf(" ")>-1}).isSome()||D(Yo,Gt(t))},Qo=function(t){return e=Jo,(n=function(t){for(var r=0;r<t.childNodes.length;r++){var o=Ct.fromDom(t.childNodes[r]);if(e(o))return O.some(o);var i=n(t.childNodes[r]);if(i.isSome())return i}return O.none()})(t.dom);var e,n},Zo=function(t){return ti(t,Jo)},ti=function(t,e){var n=function(t){for(var r=ce(t),o=r.length-1;o>=0;o--){var i=r[o];if(e(i))return O.some(i);var u=n(i);if(u.isSome())return u}return O.none()};return n(t)},ei={scope:["row","col"]},ni=function(t){return function(){var e=Ct.fromTag("td",t.dom);return Fn(e,Ct.fromTag("br",t.dom)),e}},ri=function(t){return function(){return Ct.fromTag("col",t.dom)}},oi=function(t){return function(){return Ct.fromTag("colgroup",t.dom)}},ii=function(t){return function(){return Ct.fromTag("tr",t.dom)}},ui=function(t,e,n){var r=function(t,e){var n=kr(t,e),r=ce(Sr(t));return jn(n,r),n}(t,e);return Mt(n,function(t,e){null===t?ze(r,e):De(r,e,t)}),r},ai=function(t){return t},ci=function(t,e,n){var r=function(t,e){var n,r,o,i;n=t.element,r=e,o=n.dom,i=r.dom,Ie(o)&&Ie(i)&&(i.style.cssText=o.style.cssText),$e(e,"height"),1!==t.colspan&&$e(e,"width")};return{col:function(n){var o=Ct.fromTag(Gt(n.element),e.dom);return r(n,o),t(n.element,o),o},colgroup:oi(e),row:ii(e),cell:function(o){var i,u,a=Ct.fromTag(Gt(o.element),e.dom),c=n.getOr(["strong","em","b","i","span","font","h1","h2","h3","h4","h5","h6","p","div"]),s=c.length>0?function(t,e,n){return Qo(t).map(function(r){var o=n.join(","),i=ye(r,o,function(e){return Tt(e,t)});return L(i,function(t,e){var n=Cr(e);return ze(n,"contenteditable"),Fn(t,n),n},e)}).getOr(e)}(o.element,a,c):a;return Fn(s,Ct.fromTag("br")),r(o,a),i=o.element,u=a,Mt(ei,function(t,e){return Me(i,e).filter(function(e){return D(t,e)}).each(function(t){return De(u,e,t)})}),t(o.element,a),a},replace:ui,colGap:ri(e),gap:ni(e)}},si=function(t){return{col:ri(t),colgroup:oi(t),row:ii(t),cell:ni(t),replace:ai,colGap:ri(t),gap:ni(t)}},li=function(t){return M(t,Ct.fromDom)},fi=function(t){return Ct.fromDom(t.getBody())},di=function(t){return t.getBoundingClientRect().width},mi=function(t){return t.getBoundingClientRect().height},gi=function(t){return function(e){return Tt(e,fi(t))}},hi=function(t){return/^\d+(\.\d+)?$/.test(t)?t+"px":t},pi=function(t){ze(t,"data-mce-style");var e=function(t){return ze(t,"data-mce-style")};z(rn(t),e),z(on(t),e),z(an(t),e)},vi=function(t){return Ct.fromDom(t.selection.getStart())},bi=function(t){return pr(t.get(),m([]),g,W)},yi={selected:"data-mce-selected",selectedSelector:"td[data-mce-selected],th[data-mce-selected]",firstSelected:"data-mce-first-selected",firstSelectedSelector:"td[data-mce-first-selected],th[data-mce-first-selected]",lastSelected:"data-mce-last-selected",lastSelectedSelector:"td[data-mce-last-selected],th[data-mce-last-selected]"},wi=function(t,e,n){return{element:n,mergable:function(t,e,n){return pr(e.get(),O.none,function(e){return e.length<=1?O.none():mr(t,n.firstSelectedSelector,n.lastSelectedSelector).map(function(t){return{bounds:t,cells:e}})},O.none)}(e,t,yi),unmergable:function(t){var e=function(t,e){return Me(t,e).exists(function(t){return parseInt(t,10)>1})},n=bi(t);return n.length>0&&U(n,function(t){return e(t,"rowspan")||e(t,"colspan")})?O.some(n):O.none()}(t),selection:bi(t)}},xi=function(t){return function(e,n){var r,o=Gt(e),i="col"===o||"colgroup"===o?un(r=e).bind(function(t){return dr(t,yi.firstSelectedSelector)}).fold(m(r),function(t){return t[0]}):e;return _e(i,t,n)}},Ci=xi("th,td,caption"),Si=xi("th,td"),ki=function(t){return bi(t)},Oi=function(t,e,n){t.on("BeforeGetContent",function(n){!0===n.selection&&pr(e.get(),d,function(e){n.preventDefault(),function(t){return un(t[0]).map(function(t){var e=Ko(t,"[data-mce-selected]");return pi(e),[e]})}(e).each(function(e){n.content="text"===n.format?function(t){return M(t,function(t){return t.dom.innerText}).join("")}(e):function(t,e){return M(e,function(e){return t.selection.serializer.serialize(e.dom,{})}).join("")}(t,e)})},d)}),t.on("BeforeSetContent",function(r){if(!0===r.selection&&!0===r.paste){var o=ki(e);$(o).each(function(e){un(e).each(function(o){var i,u,a,c=B((i=r.content,(a=(u||document).createElement("div")).innerHTML=i,ce(Ct.fromDom(a))),function(t){return"meta"!==Gt(t)}),s=ee("table");if(1===c.length&&s(c[0])){r.preventDefault();var l=Ct.fromDom(t.getDoc()),f=si(l),d=function(t,e,n){return{element:t,clipboard:e,generators:n}}(e,c[0],f);n.pasteCells(o,d).each(function(){t.focus()})}})})}})},Ti=gr([{none:[]},{only:["index"]},{left:["index","next"]},{middle:["prev","index","next"]},{right:["prev","index"]}]),_i=X({},Ti),Ei=function(t,e,n,r,o){var i=t.slice(0),u=function(t,e){return 0===t.length?_i.none():1===t.length?_i.only(0):0===e?_i.left(0,1):e===t.length-1?_i.right(e-1,e):e>0&&e<t.length-1?_i.middle(e-1,e,e+1):_i.none()}(t,e),a=m(M(i,m(0)));return u.fold(a,function(t){return r.singleColumnWidth(i[t],n)},function(t,e){return o.calcLeftEdgeDeltas(i,t,e,n,r.minCellWidth(),r.isRelative)},function(t,e,u){return o.calcMiddleDeltas(i,t,e,u,n,r.minCellWidth(),r.isRelative)},function(t,e){return o.calcRightEdgeDeltas(i,t,e,n,r.minCellWidth(),r.isRelative)})},Di=function(t,e,n){for(var r=0,o=t;o<e;o++)r+=void 0!==n[o]?n[o]:0;return r},Ai=function(t,e){var n=_n.justCells(t);return M(n,function(t){var n=Di(t.row,t.row+t.rowspan,e);return{element:t.element,height:n,rowspan:t.rowspan}})},Ni=function(t,e){return _n.hasColumns(t)?function(t,e){var n=_n.justColumns(t);return M(n,function(t,n){return{element:t.element,width:e[n],colspan:t.colspan}})}(t,e):function(t,e){var n=_n.justCells(t);return M(n,function(t){var n=Di(t.column,t.column+t.colspan,e);return{element:t.element,width:n,colspan:t.colspan}})}(t,e)},Mi=function(t,e,n){var r=Ni(t,e);z(r,function(t){n.setElementWidth(t.element,t.width)})},zi=function(t,e,n,r,o){var i=_n.fromTable(t),u=o.getCellDelta(e),a=o.getWidths(i,o),c=n===i.grid.columns-1,s=r.clampTableDelta(a,n,u,o.minCellWidth(),c),l=Ei(a,n,s,o,r),f=M(l,function(t,e){return t+a[e]});Mi(i,f,o),r.resizeTable(o.adjustTableWidth,s,c)},Ri=function(t,e,n,r){var o=_n.fromTable(t),i=function(t,e,n){return Io(t,e,n,Eo,function(t){return t.getOrThunk(Ze)})}(o,t,r),u=M(i,function(t,r){return n===r?Math.max(e+t,Ze()):t}),a=Ai(o,u),c=function(t,e){return M(t.all,function(t,n){return{element:t.element,height:e[n]}})}(o,u);z(c,function(t){xo(t.element,t.height)}),z(a,function(t){xo(t.element,t.height)});var s=L(u,function(t,e){return t+e},0);xo(t,s)},Bi=function(t){return M(t,m(0))},Li=function(t,e,n,r,o){return o(t.slice(0,e)).concat(r).concat(o(t.slice(n)))},Pi=function(t){return function(e,n,r,o){if(t(r)){var i=Math.max(o,e[n]-Math.abs(r)),u=Math.abs(i-e[n]);return r>=0?u:-u}return r}},Hi=Pi(function(t){return t<0}),Ii=Pi(x),Fi=function(){var t=function(t,e,n,r){var o=(100+n)/100,i=Math.max(r,(t[e]+n)/o);return M(t,function(t,n){return(n===e?i:t/o)-t})},e=function(e,n,r,o,i,u){return u?t(e,n,o,i):function(t,e,n,r,o){var i=Hi(t,e,r,o);return Li(t,e,n+1,[i,0],Bi)}(e,n,r,o,i)};return{resizeTable:function(t,e){return t(e)},clampTableDelta:Hi,calcLeftEdgeDeltas:e,calcMiddleDeltas:function(t,n,r,o,i,u,a){return e(t,r,o,i,u,a)},calcRightEdgeDeltas:function(e,n,r,o,i,u){if(u)return t(e,r,o,i);var a=Hi(e,r,o,i);return Bi(e.slice(0,r)).concat([a])},calcRedestributedWidths:function(t,e,n,r){if(r){var o=(e+n)/e,i=M(t,function(t){return t/o});return{delta:100*o-100,newSizes:i}}return{delta:n,newSizes:t}}}},Vi=function(){var t=function(t,e,n,r,o){var i=Ii(t,r>=0?n:e,r,o);return Li(t,e,n+1,[i,-i],Bi)};return{resizeTable:function(t,e,n){n&&t(e)},clampTableDelta:function(t,e,n,r,o){if(o){if(n>=0)return n;var i=P(t,function(t,e){return t+e-r},0);return Math.max(-i,n)}return Hi(t,e,n,r)},calcLeftEdgeDeltas:t,calcMiddleDeltas:function(e,n,r,o,i,u){return t(e,r,o,i,u)},calcRightEdgeDeltas:function(t,e,n,r,o,i){if(i)return Bi(t);var u=r/t.length;return M(t,m(u))},calcRedestributedWidths:function(t,e,n,r){return{delta:0,newSizes:t}}}},Ui=function(t,e){var n=O.from(t.dom.documentElement).map(Ct.fromDom).getOr(t);return{parent:m(n),view:m(t),origin:m(Kr(0,0)),isResizable:e}},ji=function(t,e,n){return{parent:m(e),view:m(t),origin:m(Kr(0,0)),isResizable:n}},Wi=gr([{invalid:["raw"]},{pixels:["value"]},{percent:["value"]}]),qi=function(t,e,n){var r=n.substring(0,n.length-t.length),o=parseFloat(r);return r===o.toString()?e(o):Wi.invalid(n)},$i=X(X({},Wi),{from:function(t){return it(t,"%")?qi("%",Wi.percent,t):it(t,"px")?qi("px",Wi.pixels,t):Wi.invalid(t)}}),Gi=function(t,e,n){return t.fold(function(){return e},function(t){return function(t,e,n){var r=n/e;return M(t,function(t){return $i.from(t).fold(function(){return t},function(t){return t*r+"px"},function(t){return t/100*n+"px"})})}(e,n,t)},function(t){return function(t,e){return M(t,function(t){return $i.from(t).fold(function(){return t},function(t){return t/e*100+"%"},function(t){return t+"%"})})}(e,n)})},Ki=function(t,e,n){var r,o,i,u=$i.from(n),a=U(t,function(t){return"0px"===t})?(r=u,o=t.length,i=r.fold(function(){return m("")},function(t){return m(t/o+"px")},function(){return m(100/o+"%")}),N(o,i)):Gi(u,t,e);return Yi(a)},Xi=function(t,e){return 0===t.length?e:L(t,function(t,e){return $i.from(e).fold(m(0),g,g)+t},0)},Yi=function(t){if(0===t.length)return t;var e,n,r=L(t,function(t,e){var n=$i.from(e).fold(function(){return{value:e,remainder:0}},function(t){return function(t,e){var n=Math.floor(t);return{value:n+e,remainder:t-n}}(t,"px")},function(t){return{value:t+"%",remainder:0}});return{output:[n.value].concat(t.output),remainder:t.remainder+n.remainder}},{output:[],remainder:0}),o=r.output;return o.slice(0,o.length-1).concat([(e=o[o.length-1],n=Math.round(r.remainder),$i.from(e).fold(m(e),function(t){return t+n+"px"},function(t){return t+n+"%"}))])},Ji=$i.from,Qi=function(t){return Ji(t).fold(m("px"),m("px"),m("%"))},Zi=function(t,e,n){var r=_n.fromTable(t),o=r.all,i=_n.justCells(r),u=_n.justColumns(r);e.each(function(e){var n=Qi(e),o=zr(t),a=function(t,e){return Lo(t,e,zo,Po)}(r,t),c=Ki(a,o,e);_n.hasColumns(r)?function(t,e,n){z(e,function(e,r){var o=Xi([t[r]],Qe());Ve(e.element,"width",o+n)})}(c,u,n):function(t,e,n){z(e,function(e){var r=t.slice(e.column,e.colspan+e.column),o=Xi(r,Qe());Ve(e.element,"width",o+n)})}(c,i,n),Ve(t,"width",e)}),n.each(function(e){var n=Qi(e),u=Wr(t),a=function(t,e,n){return Io(t,e,n,Ro,Po)}(r,t,co);!function(t,e,n,r){z(n,function(e){var n=t.slice(e.row,e.rowspan+e.row),o=Xi(n,Ze());Ve(e.element,"height",o+r)}),z(e,function(e,n){Ve(e.element,"height",t[n])})}(Ki(a,u,e),o,i,n),Ve(t,"height",e)})},tu=function(t){return Oo(t).exists(function(t){return ho.test(t)})},eu=function(t){return Oo(t).exists(function(t){return po.test(t)})},nu=function(t){return Oo(t).isNone()},ru=function(t){return _n.fromTable(t).grid},ou=function(t){var e=[];return{bind:function(t){if(void 0===t)throw new Error("Event bind error: undefined handler");e.push(t)},unbind:function(t){e=B(e,function(e){return e!==t})},trigger:function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o={};z(t,function(t,e){o[t]=n[e]}),z(e,function(t){t(o)})}}},iu=function(t){return{registry:zt(t,function(t){return{bind:t.bind,unbind:t.unbind}}),trigger:zt(t,function(t){return t.trigger})}},uu=function(t){return t.slice(0).sort()},au=function(t,e,n){if(0===e.length)throw new Error("You must specify at least one required field.");var o;return function(t,e){if(!i(e))throw new Error("The "+t+" fields must be an array. Was: "+e+".");z(e,function(e){if(!r(e))throw new Error("The value "+e+" in the "+t+" fields was not a string.")})}("required",e),o=uu(e),H(o,function(t,e){return e<o.length-1&&t===o[e+1]}).each(function(t){throw new Error("The field: "+t+" occurs more than once in the combined fields: ["+o.join(", ")+"].")}),function(r){var o=At(r);U(e,function(t){return D(o,t)})||function(t,e){throw new Error("All required keys ("+uu(t).join(", ")+") were not specified. Specified keys were: "+uu(e).join(", ")+".")}(e,o),t(e,o);var i=B(e,function(t){return!n.validate(r[t],t)});return i.length>0&&function(t,e){throw new Error("All values need to be of type: "+e+". Keys ("+uu(t).join(", ")+") were not.")}(i,n.label),r}},cu=function(t,e){var n=B(e,function(e){return!D(t,e)});n.length>0&&function(t){throw new Error("Unsupported keys for object: "+uu(t).join(", "))}(n)},su=function(t){return function(t,e){return au(t,e,{validate:l,label:"function"})}(cu,t)},lu=su(["compare","extract","mutate","sink"]),fu=su(["element","start","stop","destroy"]),du=su(["forceDrop","drop","move","delayDrop"]),mu=function(){var t=O.none(),e=iu({move:ou(["info"])});return{onEvent:function(n,r){r.extract(n).each(function(n){(function(e,n){var r=t.map(function(t){return e.compare(t,n)});return t=O.some(n),r})(r,n).each(function(t){e.trigger.move(t)})})},reset:function(){t=O.none()},events:e.registry}},gu=function(){var t,e=(t=iu({move:ou(["info"])}),{onEvent:d,reset:d,events:t.registry}),n=mu(),r=e;return{on:function(){r.reset(),r=n},off:function(){r.reset(),r=e},isOn:function(){return r===n},onEvent:function(t,e){r.onEvent(t,e)},events:n.events}},hu=function(t,e,n){var r,o,i,a,c=!1,s=iu({start:ou([]),stop:ou([])}),l=gu(),f=function(){g.stop(),l.isOn()&&(l.off(),s.trigger.stop())},d=(r=f,o=200,i=null,{cancel:a=function(){u(i)||(clearTimeout(i),i=null)},throttle:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];a(),i=setTimeout(function(){i=null,r.apply(null,t)},o)}});l.events.move.bind(function(n){e.mutate(t,n.info)});var m=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];c&&t.apply(null,e)}},g=e.sink(du({forceDrop:f,drop:m(f),move:m(function(t){d.cancel(),l.onEvent(t,e)}),delayDrop:m(d.throttle)}),n);return{element:g.element,go:function(t){g.start(t),l.on(),s.trigger.start()},on:function(){c=!0},off:function(){c=!1},destroy:function(){g.destroy()},events:s.registry}},pu=function(t){var e,n,r=Ct.fromDom(function(t){if(fe()&&s(t.target)){var e=Ct.fromDom(t.target);if(Jt(e)&&he(e)&&t.composed&&t.composedPath){var n=t.composedPath();if(n)return $(n)}}return O.from(t.target)}(t).getOr(t.target)),o=function(){return t.stopPropagation()},i=function(){return t.preventDefault()},u=(e=i,n=o,function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e(n.apply(null,t))});return function(t,e,n,r,o,i,u){return{target:t,x:e,y:n,stop:r,prevent:o,kill:i,raw:u}}(r,t.clientX,t.clientY,o,i,u,t)},vu=function(t,e,n,r,o){var i=function(t,e){return function(n){t(n)&&e(pu(n))}}(n,r);return t.dom.addEventListener(e,i,o),{unbind:p(bu,t,e,i,o)}},bu=function(t,e,n,r){t.dom.removeEventListener(e,n,r)},yu=x,wu=function(t,e,n){return function(t,e,n,r){return vu(t,e,n,r,!1)}(t,e,yu,n)},xu=pu,Cu=function(t,e){var n=Ne(t,e);return void 0===n||""===n?[]:n.split(" ")},Su=function(t){return void 0!==t.dom.classList},ku=function(t,e){return function(t,e,n){var r=Cu(t,e).concat([n]);return De(t,e,r.join(" ")),!0}(t,"class",e)},Ou=function(t,e){return function(t,e,n){var r=B(Cu(t,e),function(t){return t!==n});return r.length>0?De(t,e,r.join(" ")):ze(t,e),!1}(t,"class",e)},Tu=function(t,e){Su(t)?t.dom.classList.add(e):ku(t,e)},_u=function(t){0===(Su(t)?t.dom.classList:function(t){return Cu(t,"class")}(t)).length&&ze(t,"class")},Eu=function(t,e){return Su(t)&&t.dom.classList.contains(e)},Du=function(t){var e=t.replace(/\./g,"-");return{resolve:function(t){return e+"-"+t}}},Au=Du("ephox-dragster").resolve,Nu=lu({compare:function(t,e){return Kr(e.left-t.left,e.top-t.top)},extract:function(t){return O.some(Kr(t.x,t.y))},sink:function(t,e){var n=function(t){var e=X({layerClass:Au("blocker")},t),n=Ct.fromTag("div");return De(n,"role","presentation"),Ue(n,{position:"fixed",left:"0px",top:"0px",width:"100%",height:"100%"}),Tu(n,Au("blocker")),Tu(n,e.layerClass),{element:m(n),destroy:function(){qn(n)}}}(e),r=wu(n.element(),"mousedown",t.forceDrop),o=wu(n.element(),"mouseup",t.drop),i=wu(n.element(),"mousemove",t.move),u=wu(n.element(),"mouseout",t.delayDrop);return fu({element:n.element,start:function(t){Fn(t,n.element())},stop:function(){qn(n.element())},destroy:function(){n.destroy(),o.unbind(),i.unbind(),u.unbind(),r.unbind()}})},mutate:function(t,e){t.mutate(e.left,e.top)}}),Mu=function(t){return _e(t,"[contenteditable]")},zu=function(t,e){return void 0===e&&(e=!1),!wt().browser.isIE()&&pe(t)?t.dom.isContentEditable:Mu(t).fold(m(e),function(t){return"true"===Ru(t)})},Ru=function(t){return t.dom.contentEditable},Bu=Du("ephox-snooker").resolve,Lu=function(){var t=iu({drag:ou(["xDelta","yDelta","target"])}),e=O.none(),n=function(){var t=iu({drag:ou(["xDelta","yDelta"])});return{mutate:function(e,n){t.trigger.drag(e,n)},events:t.registry}}();n.events.drag.bind(function(n){e.each(function(e){t.trigger.drag(n.xDelta,n.yDelta,e)})});return{assign:function(t){e=O.some(t)},get:function(){return e},mutate:n.mutate,events:t.registry}},Pu=Bu("resizer-bar"),Hu=Bu("resizer-rows"),Iu=Bu("resizer-cols"),Fu=function(t){var e=xe(t.parent(),"."+Pu);z(e,qn)},Vu=function(t,e,n){var r=t.origin();z(e,function(e){e.each(function(e){var o=n(r,e);Tu(o,Pu),Fn(t.parent(),o)})})},Uu=function(t,e,n,r){Vu(t,e,function(t,e){var o,i,u,a,c,s,l=(o=e.col,i=e.x-t.left,u=n.top-t.top,a=7,c=r,s=Ct.fromTag("div"),Ue(s,{position:"absolute",left:i-a/2+"px",top:u+"px",height:c+"px",width:a+"px"}),Ae(s,{"data-column":o,role:"presentation"}),s);return Tu(l,Iu),l})},ju=function(t,e,n,r){Vu(t,e,function(t,e){var o,i,u,a,c,s,l=(o=e.row,i=n.left-t.left,u=e.y-t.top,a=r,c=7,s=Ct.fromTag("div"),Ue(s,{position:"absolute",left:i+"px",top:u-c/2+"px",height:c+"px",width:a+"px"}),Ae(s,{"data-row":o,role:"presentation"}),s);return Tu(l,Hu),l})},Wu=function(t,e,n,r,o){var i=Yr(n),u=e.isResizable,a=r.length>0?co.positions(r,n):[],c=a.length>0?function(t,e){return V(t.all,function(t,n){return e(t.element)?[n]:[]})}(t,u):[],s=B(a,function(t,e){return A(c,function(t){return e===t})});ju(e,s,i,Rr(n));var l=o.length>0?lo.positions(o,n):[],f=l.length>0?function(t,e){var n=[];return N(t.grid.columns,function(r){_n.getColumnAt(t,r).map(function(t){return t.element}).forall(e)&&n.push(r)}),B(n,function(n){var r=_n.filterItems(t,function(t){return t.column===n});return U(r,function(t){return e(t.element)})})}(t,u):[],d=B(l,function(t,e){return A(f,function(t){return e===t})});Uu(e,d,i,qr(n))},qu=function(t,e){if(Fu(t),t.isResizable(e)){var n=_n.fromTable(e),r=Ir(n),o=Pr(n);Wu(n,t,e,r,o)}},$u=function(t,e){var n=xe(t.parent(),"."+Pu);z(n,e)},Gu=function(t){$u(t,function(t){Ve(t,"display","none")})},Ku=function(t){$u(t,function(t){Ve(t,"display","block")})},Xu=Bu("resizer-bar-dragging"),Yu=function(t){var e=Lu(),n=function(t,e){void 0===e&&(e={});var n=void 0!==e.mode?e.mode:Nu;return hu(t,n,e)}(e,{}),r=O.none(),o=function(t,e){return O.from(Ne(t,e))};e.events.drag.bind(function(t){o(t.target,"data-row").each(function(e){var n=Je(t.target,"top");Ve(t.target,"top",n+t.yDelta+"px")}),o(t.target,"data-column").each(function(e){var n=Je(t.target,"left");Ve(t.target,"left",n+t.xDelta+"px")})});var i=function(t,e){return Je(t,e)-Ge(t,"data-initial-"+e,0)};n.events.stop.bind(function(){e.get().each(function(e){r.each(function(n){o(e,"data-row").each(function(t){var r=i(e,"top");ze(e,"data-initial-top"),l.trigger.adjustHeight(n,r,parseInt(t,10))}),o(e,"data-column").each(function(t){var r=i(e,"left");ze(e,"data-initial-left"),l.trigger.adjustWidth(n,r,parseInt(t,10))}),qu(t,n)})})});var u=function(r,o){l.trigger.startAdjust(),e.assign(r),De(r,"data-initial-"+o,Je(r,o)),Tu(r,Xu),Ve(r,"opacity","0.2"),n.go(t.parent())},a=wu(t.parent(),"mousedown",function(t){var e;e=t.target,Eu(e,Hu)&&u(t.target,"top"),function(t){return Eu(t,Iu)}(t.target)&&u(t.target,"left")}),c=function(e){return Tt(e,t.view())},s=wu(t.view(),"mouseover",function(e){var n;(n=e.target,_e(n,"table",c).filter(zu)).fold(function(){pe(e.target)&&Fu(t)},function(e){r=O.some(e),qu(t,e)})}),l=iu({adjustHeight:ou(["table","delta","row"]),adjustWidth:ou(["table","delta","column"]),startAdjust:ou([])});return{destroy:function(){a.unbind(),s.unbind(),n.destroy(),Fu(t)},refresh:function(e){qu(t,e)},on:n.on,off:n.off,hideBars:p(Gu,t),showBars:p(Ku,t),events:l.registry}},Ju=function(t,e,n){var r=co,o=lo,i=Yu(t),u=iu({beforeResize:ou(["table","type"]),afterResize:ou(["table","type"]),startDrag:ou([])});return i.events.adjustHeight.bind(function(t){var e=t.table;u.trigger.beforeResize(e,"row");var n=r.delta(t.delta,e);Ri(e,n,t.row,r),u.trigger.afterResize(e,"row")}),i.events.startAdjust.bind(function(t){u.trigger.startDrag()}),i.events.adjustWidth.bind(function(t){var r=t.table;u.trigger.beforeResize(r,"col");var i=o.delta(t.delta,r),a=n(r);zi(r,i,t.column,e,a),u.trigger.afterResize(r,"col")}),{on:i.on,off:i.off,hideBars:i.hideBars,showBars:i.showBars,destroy:i.destroy,events:u.registry}},Qu=function(t,e){return t.fire("newrow",{node:e})},Zu=function(t,e){return t.fire("newcell",{node:e})},ta=function(t,e,n,r,o){t.fire("TableSelectionChange",{cells:e,start:n,finish:r,otherCells:o})},ea=function(t){t.fire("TableSelectionClear")},na=function(t,e,n){t.fire("TableModified",X(X({},n),{table:e}))},ra={structure:!1,style:!0},oa={structure:!0,style:!1},ia={structure:!0,style:!0},ua={"border-collapse":"collapse",width:"100%"},aa=N(5,function(t){var e=t+1+"px";return{title:e,value:e}}),ca=M(["Solid","Dotted","Dashed","Double","Groove","Ridge","Inset","Outset","None","Hidden"],function(t){return{title:t,value:t.toLowerCase()}}),sa={border:"1"},la=function(t){return t.getParam("table_sizing_mode","auto")},fa=function(t){return t.getParam("table_responsive_width")},da=function(t){return t.getParam("table_border_widths",aa,"array")},ma=function(t){return t.getParam("table_border_styles",ca,"array")},ga=function(t){return t.getParam("table_default_attributes",sa,"object")},ha=function(t){return t.getParam("table_default_styles",function(t){var e;if(Sa(t)){var n=t.dom,r=null!==(e=n.getParent(t.selection.getStart(),n.isBlock))&&void 0!==e?e:t.getBody(),o=Br(Ct.fromDom(r));return X(X({},ua),{width:o+"px"})}return ka(t)?Bt(ua,function(t,e){return"width"!==e}):ua}(t),"object")},pa=function(t){return t.getParam("table_cell_advtab",!0,"boolean")},va=function(t){return t.getParam("table_row_advtab",!0,"boolean")},ba=function(t){return t.getParam("table_advtab",!0,"boolean")},ya=function(t){return t.getParam("table_style_by_css",!1,"boolean")},wa=function(t){return t.getParam("table_cell_class_list",[],"array")},xa=function(t){return t.getParam("table_class_list",[],"array")},Ca=function(t){return"relative"===la(t)||!0===fa(t)},Sa=function(t){return"fixed"===la(t)||!1===fa(t)},ka=function(t){return"responsive"===la(t)},Oa=function(t){var e=t.getParam("table_header_type","section","string");return D(["section","cells","sectionCells","auto"],e)?e:"section"},Ta=function(t){var e=t.getParam("table_column_resizing","preservetable","string");return H(["preservetable","resizetable"],function(t){return t===e}).getOr("preservetable")},_a=function(t){return"preservetable"===Ta(t)},Ea=function(t){return"resizetable"===Ta(t)},Da=function(t){var e=t.getParam("table_clone_elements");return r(e)?O.some(e.split(/[ ,]/)):Array.isArray(e)?O.some(e):O.none()},Aa=function(t){return t.getParam("table_background_color_map",[],"array")},Na=function(t){return t.getParam("table_border_color_map",[],"array")},Ma=function(t,e){return Ca(t)?$o(e):Sa(t)?qo(e):Wo(e)},za=function(t){ze(t,"width")},Ra=function(t){var e=Ao(t);Zi(t,O.some(e),O.none()),za(t)},Ba=function(t){var e=function(t){return zr(t)+"px"}(t);Zi(t,O.some(e),O.none()),za(t)},La=function(t){$e(t,"width");var e=on(t),n=e.length>0?e:rn(t);z(n,function(t){$e(t,"width"),za(t)}),za(t)},Pa=function(){var t=Ct.fromTag("div");return Ue(t,{position:"static",height:"0",width:"0",padding:"0",margin:"0",border:"0"}),Fn(ve(Ct.fromDom(document)),t),t},Ha=function(t){return"false"!==Ne(t,"data-mce-resize")},Ia=function(t){var e,n,o=O.none(),i=O.none(),u=O.none(),a=function(t){return"TABLE"===t.nodeName},c=function(){return i},s=function(e){return Ma(t,e)},l=function(){return _a(t)?Vi():Fi()},f=function(r,o,i){var u=it(o,"e");if(""===n&&Ra(r),i!==e&&""!==n){Ve(r,"width",n);var a=l(),c=s(r),f=_a(t)||u?function(t){return ru(t).columns}(r)-1:0;zi(r,i-e,f,a,c)}else if(/^(\d+(\.\d+)?)%$/.test(n)){var d=parseFloat(n.replace("%",""));Ve(r,"width",i*d/e+"%")}(function(t){return/^(\d+(\.\d+)?)px$/.test(t)})(n)&&function(t){var e=_n.fromTable(t);_n.hasColumns(e)||z(rn(t),function(t){var e=je(t,"width");Ve(t,"width",e),ze(t,"width")})}(r)};return t.on("init",function(){var e=function(t,e){return t.inline?ji(fi(t),Pa(),e):Ui(Ct.fromDom(t.getDoc()),e)}(t,Ha);if(u=O.some(e),function(t){var e=t.getParam("object_resizing",!0);return r(e)?"table"===e:e}(t)&&function(t){return t.getParam("table_resize_bars",!0,"boolean")}(t)){var n=l(),a=Ju(e,n,s);a.on(),a.events.startDrag.bind(function(e){o=O.some(t.selection.getRng())}),a.events.beforeResize.bind(function(e){var n=e.table.dom;!function(t,e,n,r,o){t.fire("ObjectResizeStart",{target:e,width:n,height:r,origin:o})}(t,n,di(n),mi(n),"bar-"+e.type)}),a.events.afterResize.bind(function(e){var n=e.table,r=n.dom;pi(n),o.each(function(e){t.selection.setRng(e),t.focus()}),function(t,e,n,r,o){t.fire("ObjectResized",{target:e,width:n,height:r,origin:o})}(t,r,di(r),mi(r),"bar-"+e.type),t.undoManager.add()}),i=O.some(a)}}),t.on("ObjectResizeStart",function(r){var o=r.target;if(a(o)){var i=Ct.fromDom(o);z(t.dom.select(".mce-clonedresizable"),function(e){t.dom.addClass(e,"mce-"+Ta(t)+"-columns")}),!eu(i)&&Sa(t)?Ba(i):!tu(i)&&Ca(t)&&Ra(i),nu(i)&&ot(r.origin,"bar-")&&Ra(i),e=r.width,n=ka(t)?"":function(t,e){var n=t.dom.getStyle(e,"width")||t.dom.getAttrib(e,"width");return O.from(n).filter(at)}(t,o).getOr("")}}),t.on("ObjectResized",function(e){var n=e.target;if(a(n)){var r=Ct.fromDom(n),o=e.origin;ot(o,"corner-")&&f(r,o,e.width),pi(r),na(t,r.dom,ra)}}),t.on("SwitchMode",function(){c().each(function(e){t.mode.isReadOnly()?e.hideBars():e.showBars()})}),{lazyResize:c,lazyWire:function(){return u.getOr(Ui(Ct.fromDom(t.getBody()),Ha))},destroy:function(){i.each(function(t){t.destroy()}),u.each(function(e){!function(t,e){t.inline&&qn(e.parent())}(t,e)})}}},Fa=function(t,e){return{element:t,offset:e}},Va=function(t,e,n){return t.property().isText(e)&&0===t.property().getText(e).trim().length||t.property().isComment(e)?n(e).bind(function(e){return Va(t,e,n).orThunk(function(){return O.some(e)})}):O.none()},Ua=function(t,e){return t.property().isText(e)?t.property().getText(e).length:t.property().children(e).length},ja=function(t,e){var n=Va(t,e,t.query().prevSibling).getOr(e);if(t.property().isText(n))return Fa(n,Ua(t,n));var r=t.property().children(n);return r.length>0?ja(t,r[r.length-1]):Fa(n,Ua(t,n))},Wa=ja,qa=Qn(),$a=function(t,e){1===Ke(t,"colspan")&&Oo(t).bind(function(t){return go(t,["fixed","relative","empty"])}).each(function(n){var r=n.value/2;Do(t,r,n.unit),Do(e,r,n.unit)})},Ga=ee("th"),Ka=function(t){return U(t,function(t){return Ga(t.element)})},Xa=function(t){var e="thead"===t.section,n=Be(Ya(t.cells),"th");return e||n?{type:"header",subType:function(t,e){return t&&e?"sectionCells":t?"section":"cells"}(e,n)}:"tfoot"===t.section?{type:"footer"}:{type:"body"}},Ya=function(t){var e=B(t,function(t){return Ga(t.element)});return 0===e.length?O.some("td"):e.length===t.length?O.some("th"):O.none()},Ja=function(t,e,n){return qt(n(t.element,e),!0,t.isLocked)},Qa=function(t,e){return t.section!==e?$t(t.element,t.cells,e,t.isNew):t},Za=function(){return{transformRow:Qa,transformCell:function(t,e,n){var r=n(t.element,e),o="td"!==Gt(r)?function(t,e){var n=kr(t,e);Pn(t,n);var r=ce(t);return jn(n,r),qn(t),n}(r,"td"):r;return qt(o,t.isNew,t.isLocked)}}},tc=function(){return{transformRow:Qa,transformCell:Ja}},ec=function(){return{transformRow:function(t,e){return Qa(t,"thead"===e?"tbody":e)},transformCell:Ja}},nc=function(t,e){switch(function(t){return K(t.all,function(t){var e=Xa(t);return"header"===e.type?O.from(e.subType):O.none()})}(_n.fromTable(t)).getOr(e)){case"section":return Za();case"sectionCells":return tc();case"cells":return ec()}},rc=Za,oc=tc,ic=ec,uc=function(){return{transformRow:g,transformCell:Ja}},ac=function(t,e,n,r){n===r?ze(t,e):De(t,e,n)},cc=function(t,e,n){G(we(t,e)).fold(function(){return In(t,n)},function(t){return Hn(t,n)})},sc=function(t,e){var n=[],r=[],o=function(t){return M(t,function(t){t.isNew&&n.push(t.element);var e=t.element;return Wn(e),z(t.cells,function(t){t.isNew&&r.push(t.element),ac(t.element,"colspan",t.colspan,1),ac(t.element,"rowspan",t.rowspan,1),Fn(e,t.element)}),e})},i=function(t){return V(t,function(t){return M(t.cells,function(t){return ac(t.element,"span",t.colspan,1),t.element})})},u=function(e,n){var r=function(t,e){var n=Oe(t,e).getOrThunk(function(){var n=Ct.fromTag(e,ne(t).dom);return"thead"===e?cc(t,"caption,colgroup",n):"colgroup"===e?cc(t,"caption",n):Fn(t,n),n});return Wn(n),n}(t,n),u=("colgroup"===n?i:o)(e);jn(r,u)},a=function(e,n){e.length>0?u(e,n):function(e){Oe(t,e).each(qn)}(n)},c=[],s=[],l=[],f=[];return z(e,function(t){switch(t.section){case"thead":c.push(t);break;case"tbody":s.push(t);break;case"tfoot":l.push(t);break;case"colgroup":f.push(t)}}),a(f,"colgroup"),a(c,"thead"),a(s,"tbody"),a(l,"tfoot"),{newRows:n,newCells:r}},lc=function(t,e){if(0===t.length)return 0;var n=t[0];return I(t,function(t){return!e(n.element,t.element)}).getOr(t.length)},fc=function(t,e,n,r){var o=function(t,e){return t[e]}(t,e),i="colgroup"===o.section;return{colspan:lc(o.cells.slice(n),r),rowspan:i?1:lc(function(t,e){return M(t,function(t){return pn(t,e)})}(t.slice(e),n),r)}},dc=function(t,e){var n=M(t,function(t){return M(t.cells,w)});return M(t,function(r,o){var i,u,a,c,s=V(r.cells,function(r,i){if(!1===n[o][i]){var u=fc(t,o,i,e);return function(t,e,r,o){for(var i=t;i<t+r;i++)for(var u=e;u<e+o;u++)n[i][u]=!0}(o,i,u.rowspan,u.colspan),[(a=r.element,c=u.rowspan,s=u.colspan,l=r.isNew,{element:a,rowspan:c,colspan:s,isNew:l})]}return[];var a,c,s,l});return i=r.element,u=s,a=r.section,c=r.isNew,{element:i,cells:u,section:a,isNew:c}})},mc=function(t,e,n){var r=[];z(t.colgroups,function(o){for(var i=[],u=0;u<t.grid.columns;u++){var a=_n.getColumnAt(t,u).map(function(t){return qt(t.element,n,!1)}).getOrThunk(function(){return qt(e.colGap(),!0,!1)});i.push(a)}r.push($t(o.element,i,"colgroup",n))});for(var o=0;o<t.grid.rows;o++){for(var i=[],u=0;u<t.grid.columns;u++){var a=_n.getAt(t,o,u).map(function(t){return qt(t.element,n,t.isLocked)}).getOrThunk(function(){return qt(e.gap(),!0,!1)});i.push(a)}var c=t.all[o],s=$t(c.element,i,c.section,n);r.push(s)}return r},gc=function(t){return dc(t,Tt)},hc=function(t,e){return K(t.all,function(t){return H(t.cells,function(t){return Tt(e,t.element)})})},pc=function(t,e,n){var r=M(e.selection,function(e){return nn(e).bind(function(e){return hc(t,e)}).filter(n)}),o=Le(r);return He(o.length>0,o)},vc=function(t,e,n,r,o){return function(i,u,a,c,s){var l=_n.fromTable(u),f=O.from(null===s||void 0===s?void 0:s.section).getOrThunk(uc);return e(l,a).map(function(e){var n=function(t,e){return mc(t,e,!1)}(l,c),r=t(n,e,Tt,o(c),f),i=Sn(r.grid);return{info:e,grid:gc(r.grid),cursor:r.cursor,lockedColumns:i}}).bind(function(t){var e=sc(u,t.grid),o=O.from(null===s||void 0===s?void 0:s.sizing).getOrThunk(function(){return Wo(u)}),a=O.from(null===s||void 0===s?void 0:s.resize).getOrThunk(Vi);return n(u,t.grid,t.info,{sizing:o,resize:a,section:f}),r(u),qu(i,u),ze(u,xn),t.lockedColumns.length>0&&De(u,xn,t.lockedColumns.join(",")),O.some({cursor:t.cursor,newRows:e.newRows,newCells:e.newCells})})}},bc=function(t,e){return pc(t,e,x).map(function(t){return{cells:t,generators:e.generators,clipboard:e.clipboard}})},yc=function(t,e){return pc(t,e,x)},wc=function(t,e){return pc(t,e,function(t){return!t.isLocked})},xc=function(t,e){return U(e,function(e){return function(t,e){return hc(t,e).exists(function(t){return!t.isLocked})}(t,e)})},Cc=function(t,e){return function(t,e){return e.mergable}(0,e).filter(function(e){return xc(t,e.cells)})},Sc=function(t,e){return function(t,e){return e.unmergable}(0,e).filter(function(e){return xc(t,e)})},kc=function(t,e,n,r){for(var o=yn(t).rows,i=!0,u=0;u<o.length;u++)for(var a=0;a<bn(o[0]);a++){var c=o[u],s=pn(c,a),l=n(s.element,e);!0===l&&!1===i?gn(c,a,qt(r(),!0,s.isLocked)):!0===l&&(i=!1)}return t},Oc=function(t,e,n,r){var o=yn(t).rows;if(e>0&&e<o.length){var i=function(t,e){return P(t,function(t,n){return A(t,function(t){return e(t.element,n.element)})?t:t.concat([n])},[])}(o[e-1].cells,n);z(i,function(t){for(var i=O.none(),u=e;u<o.length;u++)for(var a=function(e){var a=o[u],c=pn(a,e);n(c.element,t.element)&&(i.isNone()&&(i=O.some(r())),i.each(function(t){gn(a,e,qt(t,!0,c.isLocked))}))},c=0;c<bn(o[0]);c++)a(c)})}return t},Tc=function(t){return{isValue:x,isError:w,getOr:m(t),getOrThunk:m(t),getOrDie:m(t),or:function(e){return Tc(t)},orThunk:function(e){return Tc(t)},fold:function(e,n){return n(t)},map:function(e){return Tc(e(t))},mapError:function(e){return Tc(t)},each:function(e){e(t)},bind:function(e){return e(t)},exists:function(e){return e(t)},forall:function(e){return e(t)},toOptional:function(){return O.some(t)}}},_c=function(t){return{isValue:w,isError:x,getOr:g,getOrThunk:function(t){return t()},getOrDie:function(){return(e=String(t),function(){throw new Error(e)})();var e},or:g,orThunk:function(t){return t()},fold:function(e,n){return e(t)},map:function(e){return _c(t)},mapError:function(e){return _c(e(t))},each:d,bind:function(e){return _c(t)},exists:w,forall:x,toOptional:O.none}},Ec={value:Tc,error:_c,fromOption:function(t,e){return t.fold(function(){return _c(e)},Tc)}},Dc=function(t,e){return{rowDelta:0,colDelta:bn(t[0])-bn(e[0])}},Ac=function(t,e){return{rowDelta:t.length-e.length,colDelta:0}},Nc=function(t,e,n,r){var o="colgroup"===e.section?n.col:n.cell;return N(t,function(t){return qt(o(),!0,r(t))})},Mc=function(t,e,n,r){var o=t[t.length-1];return t.concat(N(e,function(){var t="colgroup"===o.section?n.colgroup:n.row,e=wn(o,t,g),i=Nc(e.cells.length,e,n,function(t){return Ft(r,t.toString())});return hn(e,i)}))},zc=function(t,e,n,r){return M(t,function(t){var o=Nc(e,t,n,w);return dn(t,r,o)})},Rc=function(t,e,n){var r=e.colDelta<0?zc:g,o=e.rowDelta<0?Mc:g,i=Sn(t),u=bn(t[0]),a=A(i,function(t){return t===u-1}),c=r(t,Math.abs(e.colDelta),n,a?u-1:u),s=Sn(c);return o(c,Math.abs(e.rowDelta),n,j(s,x))},Bc=function(t,e,n,r){var o=p(r,pn(t[e],n).element),i=t[e];return t.length>1&&bn(i)>1&&(n>0&&o(vn(i,n-1))||n<i.cells.length-1&&o(vn(i,n+1))||e>0&&o(vn(t[e-1],n))||e<t.length-1&&o(vn(t[e+1],n)))},Lc=function(t,e,n){return B(n,function(n){return n>=t.column&&n<=bn(e[0])+t.column})},Pc=function(t,e,n,r,o){var i=Sn(e),u=function(t,e,n){var r=bn(e[0]),o=yn(e).cols.length+t.row,i=N(r-t.column,function(e){return e+t.column});return{row:o,column:H(i,function(t){return U(n,function(e){return e!==t})}).getOr(r-1)}}(t,e,i),a=yn(n).rows,c=Lc(u,a,i);return function(t,e,n){if(t.row>=e.length||t.column>bn(e[0]))return Ec.error("invalid start address out of table bounds, row: "+t.row+", column: "+t.column);var r=e.slice(t.row),o=r[0].cells.slice(t.column),i=bn(n[0]),u=n.length;return Ec.value({rowDelta:r.length-u,colDelta:o.length-i})}(u,e,a).map(function(t){var n=X(X({},t),{colDelta:t.colDelta-c.length}),i=Rc(e,n,r),s=Sn(i),l=Lc(u,a,s);return function(t,e,n,r,o,i){for(var u=t.row,a=t.column,c=u+n.length,s=a+bn(n[0])+i.length,l=j(i,x),f=u;f<c;f++)for(var d=0,m=a;m<s;m++)if(l[m])d++;else{Bc(e,f,m,o)&&kc(e,vn(e[f],m),o,r.cell);var g=m-a-d,h=pn(n[f-u],g),p=h.element,v=r.replace(p);gn(e[f],m,qt(v,!0,h.isLocked))}return e}(u,i,a,r,o,l)})},Hc=function(t,e,n,r,o){!function(t,e,n,r){e>0&&e<t[0].cells.length&&z(t,function(t){var o=t.cells[e-1],i=t.cells[e];n(i.element,o.element)&&gn(t,e,qt(r(),!0,i.isLocked))})}(e,t,o,r.cell);var i=Ac(n,e),u=Rc(n,i,r),a=Ac(e,u),c=Rc(e,a,r);return M(c,function(e,n){return dn(e,t,u[n].cells)})},Ic=function(t,e,n,r,o){Oc(e,t,o,r.cell);var i,u,a=Sn(e),c=Dc(e,n),s=X(X({},c),{colDelta:c.colDelta-a.length}),l=Rc(e,s,r),f=yn(l),d=f.cols,m=f.rows,g=Sn(l),h=Dc(n,e),p=X(X({},h),{colDelta:h.colDelta+g.length}),v=(i=r,u=g,M(n,function(t){return P(u,function(e,n){var r=Nc(1,t,i,x)[0];return mn(e,n,r)},t)})),b=Rc(v,p,r);return d.concat(m.slice(0,t)).concat(b).concat(m.slice(t,m.length))},Fc=function(t,e,n,r,o){var i=yn(t),u=i.rows,a=i.cols,c=u.slice(0,e),s=u.slice(e),l=function(t,e,n,r){return wn(t,function(t){return r(t,n)},e)}(u[n],function(t,n){return e>0&&e<u.length&&r(vn(u[e-1],n),vn(u[e],n))?pn(u[e],n):qt(o(t.element,r),!0,t.isLocked)},r,o);return a.concat(c).concat([l]).concat(s)},Vc=function(t,e,n,r,o){return M(t,function(t){var i=e>0&&e<bn(t)&&r(vn(t,e-1),vn(t,e)),u=function(t,e,n,r,o,i,u){if("colgroup"!==n&&r)return pn(t,e);var a=pn(t,o);return qt(u(a.element,i),!0,!1)}(t,e,t.section,i,n,r,o);return mn(t,e,u)})},Uc=function(t,e,n,r){return function(t,e,n,r){return void 0!==vn(t[e],n)&&e>0&&r(vn(t[e-1],n),vn(t[e],n))}(t,e,n,r)||function(t,e,n){return e>0&&n(vn(t,e-1),vn(t,e))}(t[e],n,r)},jc=function(t,e,n,r){var o=function(t){return function(t){return"row"===t?Ye(e):Xe(e)}(t)?t+"group":t};return t?Ga(e)?o(n):null:r&&Ga(e)?o("row"===n?"col":"row"):null},Wc=function(t,e,n){return qt(n(t.element,e),!0,t.isLocked)},qc=function(t,e,n,r,o,i,u){return M(t,function(t,a){return s=function(t,c){if(function(t){return A(e,function(e){return n(t.element,e.element)})}(t)){var s=u(t,a,c)?o(t,n,r):t;return i(s,a,c).each(function(t){var e,n;e=s.element,n={scope:O.from(t)},Mt(n,function(t,n){t.fold(function(){ze(e,n)},function(t){Ee(e.dom,n,t)})})}),s}return t},l=(c=t).cells,f=M(l,s),$t(c.element,f,c.section,c.isNew);var c,s,l,f})},$c=function(t,e,n){return V(t,function(r,o){return Uc(t,o,e,n)?[]:[pn(r,e)]})},Gc=function(t,e,n,r,o){var i=yn(t).rows,u=V(e,function(t){return $c(i,t,r)}),a=M(t,function(t){return Ka(t.cells)}),c=function(t,e){return U(e,g)&&Ka(t)?x:function(t,n,r){return!("th"===Gt(t.element)&&e[n])}}(u,a),s=function(t,e){return function(n,r){return O.some(jc(t,n.element,"row",e[r]))}}(n,a);return qc(t,u,r,o,Wc,s,c)},Kc=function(t,e,n,r,o,i,u){var a=yn(t),c=a.cols,s=a.rows,l=s[e[0]],f=V(e,function(t){return function(t,e,n){var r=t[e];return V(r.cells,function(r,o){return Uc(t,e,o,n)?[]:[r]})}(s,t,o)}),d=M(l.cells,function(t,e){return Ka($c(s,e,o))}),m=Y([],s,!0);z(e,function(t){m[t]=u.transformRow(s[t],n)});var h=c.concat(m),p=function(t,e){return U(e,g)&&Ka(t.cells)?x:function(t,n,r){return!("th"===Gt(t.element)&&e[r])}}(l,d),v=function(t,e){return function(n,r,o){return O.some(jc(t,n.element,"col",e[o]))}}(r,d);return qc(h,f,o,i,u.transformCell,v,p)},Xc=function(t,e,n,r){var o=yn(t).rows,i=M(e,function(t){return pn(o[t.row],t.column)});return qc(t,i,n,r,Wc,O.none,x)},Yc=function(t){return P(t,function(t,e){return A(t,function(t){return t.column===e.column})?t:t.concat([e])},[]).sort(function(t,e){return t.column-e.column})},Jc=ee("col"),Qc=ee("colgroup"),Zc=function(t){return"tr"===Gt(t)||Qc(t)},ts=function(t){return{element:t,colspan:Ge(t,"colspan",1),rowspan:Ge(t,"rowspan",1)}},es=function(t){return Me(t,"scope").map(function(t){return t.substr(0,3)})},ns=function(t,e){void 0===e&&(e=ts);var n=function(n){if(Zc(n))return Qc((o={element:n}).element)?t.colgroup(o):t.row(o);var o,i=function(e){return Jc(e.element)?t.col(e):t.cell(e)}(e(n));return r=O.some({item:n,replacement:i}),i},r=O.none();return{getOrInit:function(t,e){return r.fold(function(){return n(t)},function(r){return e(t,r.item)?r.replacement:n(t)})}}},rs=function(t){return function(e){var n=[],r=function(r){var o="td"===t?{scope:null}:{},i=e.replace(r,t,o);return n.push({item:r,sub:i}),i};return{replaceOrInit:function(t,e){return Zc(t)||Jc(t)?t:function(t,e){return H(n,function(n){return e(n.item,t)})}(t,e).fold(function(){return r(t)},function(n){return e(t,n.item)?n.sub:r(t)})}}}},os=function(t){return{unmerge:function(e){var n=es(e);return n.each(function(t){return De(e,"scope",t)}),function(){var r=t.cell({element:e,colspan:1,rowspan:1});return $e(r,"width"),$e(e,"width"),n.each(function(t){return De(r,"scope",t)}),r}},merge:function(t){return $e(t[0],"width"),function(){var e=Le(M(t,es));if(0===e.length)return O.none();var n=e[0],r=["row","col"];return A(e,function(t){return t!==n&&D(r,t)})?O.none():O.from(n)}().fold(function(){return ze(t[0],"scope")},function(e){return De(t[0],"scope",e+"group")}),m(t[0])}}},is=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","table","thead","tfoot","tbody","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"],us=Qn(),as=function(t){return e=t,n=us.property().name(e),D(is,n);var e,n},cs=function(t){return e=t,n=us.property().name(e),D(["ol","ul"],n);var e,n},ss=function(t){return e=t,D(["br","img","hr","input"],us.property().name(e));var e},ls=function(t){var e,n=function(t){return"br"===Gt(t)},r=function(t){return Zo(t).bind(function(e){var r=ae(e).map(function(t){return!!as(t)||!!ss(t)&&"img"!==Gt(t)}).getOr(!1);return oe(e).map(function(o){return!0===r||("li"===Gt(i=o)||Se(i,cs).isSome())||n(e)||as(o)&&!Tt(t,o)?[]:[Ct.fromTag("br")];var i})}).getOr([])},o=0===(e=V(t,function(t){var e=ce(t);return function(t){return U(t,function(t){return n(t)||Qt(t)&&0===Kn(t).trim().length})}(e)?[]:e.concat(r(t))})).length?[Ct.fromTag("br")]:e;Wn(t[0]),jn(t[0],o)},fs=function(t){return zu(t,!0)},ds=function(t){0===rn(t).length&&qn(t)},ms=function(t,e){return{grid:t,cursor:e}},gs=function(t,e,n){var r,o,i=yn(t).rows;return O.from(null===(o=null===(r=i[e])||void 0===r?void 0:r.cells[n])||void 0===o?void 0:o.element).filter(fs).orThunk(function(){return function(t){return K(t,function(t){return K(t.cells,function(t){var e=t.element;return He(fs(e),e)})})}(i)})},hs=function(t,e,n){var r=gs(t,e,n);return ms(t,r)},ps=function(t){return P(t,function(t,e){return A(t,function(t){return t.row===e.row})?t:t.concat([e])},[]).sort(function(t,e){return t.row-e.row})},vs=function(t,e){return function(n,r,o,i,u){var a=ps(r),c=M(a,function(t){return t.row}),s=Kc(n,c,t,e,o,i.replaceOrInit,u);return hs(s,r[0].row,r[0].column)}},bs=vs("thead",!0),ys=vs("tbody",!1),ws=vs("tfoot",!1),xs=function(t,e,n){var r,o,i=(r=t,o=n.section,sn(r,function(){return o})),u=_n.generate(i);return mc(u,e,!0)},Cs=function(t,e,n,r){return function(t,e,n,r){var o=_n.generate(e),i=r.getWidths(o,r);Mi(o,i,r)}(0,e,0,r.sizing)},Ss=function(t,e,n,r){return function(t,e,n,r,o){var i=_n.generate(e),u=r.getWidths(i,r),a=r.pixelWidth(),c=o.calcRedestributedWidths(u,a,n.pixelDelta,r.isRelative),s=c.newSizes,l=c.delta;Mi(i,s,r),r.adjustTableWidth(l)}(0,e,n,r.sizing,r.resize)},ks=function(t,e){return A(e,function(t){return 0===t.column&&t.isLocked})},Os=function(t,e){return A(e,function(e){return e.column+e.colspan>=t.grid.columns&&e.isLocked})},Ts=function(t,e){var n=Pr(t),r=Yc(e);return P(r,function(t,e){return t+n[e.column].map(Rr).getOr(0)},0)},_s=function(t){return function(e,n){return yc(e,n).filter(function(n){return!(t?ks:Os)(e,n)}).map(function(t){return{details:t,pixelDelta:Ts(e,t)}})}},Es=function(t){return function(e,n){return bc(e,n).filter(function(n){return!(t?ks:Os)(e,n.cells)})}},Ds=rs("th"),As=rs("td"),Ns=vc(function(t,e,n,r){var o=e[0].row,i=ps(e),u=L(i,function(t,e){return{grid:Fc(t.grid,o,e.row+t.delta,n,r.getOrInit),delta:t.delta+1}},{grid:t,delta:0}).grid;return hs(u,o,e[0].column)},yc,d,d,ns),Ms=vc(function(t,e,n,r){var o=ps(e),i=o[o.length-1],u=i.row+i.rowspan,a=L(o,function(t,e){return Fc(t,u,e.row,n,r.getOrInit)},t);return hs(a,u,e[0].column)},yc,d,d,ns),zs=vc(function(t,e,n,r){var o=e.details,i=Yc(o),u=i[0].column,a=L(i,function(t,e){return{grid:Vc(t.grid,u,e.column+t.delta,n,r.getOrInit),delta:t.delta+1}},{grid:t,delta:0}).grid;return hs(a,o[0].row,u)},_s(!0),Ss,d,ns),Rs=vc(function(t,e,n,r){var o=e.details,i=o[o.length-1],u=i.column+i.colspan,a=Yc(o),c=L(a,function(t,e){return Vc(t,u,e.column,n,r.getOrInit)},t);return hs(c,o[0].row,u)},_s(!1),Ss,d,ns),Bs=vc(function(t,e,n,r){var o=Yc(e.details),i=function(t,e){return V(t,function(t){var n=t.cells,r=L(e,function(t,e){return e>=0&&e<t.length?t.slice(0,e).concat(t.slice(e+1)):t},n);return r.length>0?[$t(t.element,r,t.section,t.isNew)]:[]})}(t,M(o,function(t){return t.column})),u=i.length>0?i[0].cells.length-1:0;return hs(i,o[0].row,Math.min(o[0].column,u))},function(t,e){return wc(t,e).map(function(e){return{details:e,pixelDelta:-Ts(t,e)}})},Ss,ds,ns),Ls=vc(function(t,e,n,r){var o=ps(e),i=function(t,e,n){var r=yn(t),o=r.rows;return r.cols.concat(o.slice(0,e)).concat(o.slice(n+1))}(t,o[0].row,o[o.length-1].row),u=i.length>0?i.length-1:0;return hs(i,Math.min(e[0].row,u),e[0].column)},yc,d,ds,ns),Ps=vc(function(t,e,n,r){var o=Yc(e),i=M(o,function(t){return t.column}),u=Gc(t,i,!0,n,r.replaceOrInit);return hs(u,e[0].row,e[0].column)},wc,d,d,Ds),Hs=vc(function(t,e,n,r){var o=Yc(e),i=M(o,function(t){return t.column}),u=Gc(t,i,!1,n,r.replaceOrInit);return hs(u,e[0].row,e[0].column)},wc,d,d,As),Is=vc(bs,wc,d,d,Ds),Fs=vc(ys,wc,d,d,As),Vs=vc(ws,wc,d,d,As),Us=vc(function(t,e,n,r){var o=Xc(t,e,n,r.replaceOrInit);return hs(o,e[0].row,e[0].column)},wc,d,d,Ds),js=vc(function(t,e,n,r){var o=Xc(t,e,n,r.replaceOrInit);return hs(o,e[0].row,e[0].column)},wc,d,d,As),Ws=vc(function(t,e,n,r){var o=e.cells;ls(o);var i=function(t,e,n,r){var o=yn(t).rows;if(0===o.length)return t;for(var i=e.startRow;i<=e.finishRow;i++)for(var u=e.startCol;u<=e.finishCol;u++){var a=o[i],c=pn(a,u).isLocked;gn(a,u,qt(r(),!1,c))}return t}(t,e.bounds,0,r.merge(o));return ms(i,O.from(o[0]))},Cc,Cs,d,os),qs=vc(function(t,e,n,r){var o=L(e,function(t,e){return kc(t,e,n,r.unmerge(e))},t);return ms(o,O.from(e[0]))},Sc,Cs,d,os),$s=vc(function(t,e,n,r){var o,i,u,a,c,s=(o=e.clipboard,i=e.generators,u=_n.fromTable(o),mc(u,i,!0)),l=(a=e.row,c=e.column,{row:a,column:c});return Pc(l,t,s,e.generators,n).fold(function(){return ms(t,O.some(e.element))},function(t){return hs(t,e.row,e.column)})},function(t,e){return nn(e.element).bind(function(n){return hc(t,n).map(function(t){return X(X({},t),{generators:e.generators,clipboard:e.clipboard})})})},Cs,d,ns),Gs=vc(function(t,e,n,r){var o=yn(t).rows,i=e.cells[0].column,u=o[e.cells[0].row],a=xs(e.clipboard,e.generators,u),c=Hc(i,t,a,e.generators,n);return hs(c,e.cells[0].row,e.cells[0].column)},Es(!0),d,d,ns),Ks=vc(function(t,e,n,r){var o=yn(t).rows,i=e.cells[e.cells.length-1].column+e.cells[e.cells.length-1].colspan,u=o[e.cells[0].row],a=xs(e.clipboard,e.generators,u),c=Hc(i,t,a,e.generators,n);return hs(c,e.cells[0].row,e.cells[0].column)},Es(!1),d,d,ns),Xs=vc(function(t,e,n,r){var o=yn(t).rows,i=e.cells[0].row,u=o[i],a=xs(e.clipboard,e.generators,u),c=Ic(i,t,a,e.generators,n);return hs(c,e.cells[0].row,e.cells[0].column)},bc,d,d,ns),Ys=vc(function(t,e,n,r){var o=yn(t).rows,i=e.cells[e.cells.length-1].row+e.cells[e.cells.length-1].rowspan,u=o[e.cells[0].row],a=xs(e.clipboard,e.generators,u),c=Ic(i,t,a,e.generators,n);return hs(c,e.cells[0].row,e.cells[0].column)},bc,d,d,ns),Js=function(t,e){var n=_n.fromTable(t);return yc(n,e).bind(function(t){var e=t[t.length-1],r=t[0].column,o=e.column+e.colspan,i=F(M(n.all,function(t){return B(t.cells,function(t){return t.column>=r&&t.column<o})}));return Ya(i)}).getOr("")},Qs=function(t,e){var n=_n.fromTable(t);return yc(n,e).bind(Ya).getOr("")},Zs=function(t,e){var n=_n.fromTable(t);return yc(n,e).bind(function(t){var e=t[t.length-1],r=t[0].row,o=e.row+e.rowspan;return function(t){var e=M(t,function(t){return Xa(t).type}),n=D(e,"header"),r=D(e,"footer");if(n||r){var o=D(e,"body");return!n||o||r?n||o||!r?O.none():O.some("footer"):O.some("header")}return O.some("body")}(n.all.slice(r,o))}).getOr("")},tl=function(t,e,n){var r=function(t){return"table"===Gt(fi(t))},o=Da(t),i=Ea(t)?d:$a,u=function(n,r){return r.cursor.fold(function(){var r=rn(n);return $(r).filter(pe).map(function(r){e.clear(n);var o=t.dom.createRng();return o.selectNode(r.dom),t.selection.setRng(o),De(r,"data-mce-selected","1"),o})},function(r){var o=Wa(qa,r),i=t.dom.createRng();return i.setStart(o.element.dom,o.offset),i.setEnd(o.element.dom,o.offset),t.selection.setRng(i),e.clear(n),O.some(i)})},a=function(e,n,r,i,a){return function(c,s,l){void 0===l&&(l=!1),pi(c);var f=i(),d=Ct.fromDom(t.getDoc()),m=ci(r,d,o),g={sizing:Ma(t,c),resize:Ea(t)?Fi():Vi(),section:function(e){switch(Oa(t)){case"section":return rc();case"sectionCells":return oc();case"cells":return ic();default:return nc(e,"section")}}(c)};return n(c)?e(f,c,s,m,g).bind(function(e){z(e.newRows,function(e){Qu(t,e.dom)}),z(e.newCells,function(e){Zu(t,e.dom)});var n=u(c,e);return pe(c)&&(pi(c),l||na(t,c.dom,a)),n.map(function(t){return{rng:t,effect:a}})}):O.none()}};return{deleteRow:a(Ls,function(e){return!1===r(t)||ru(e).rows>1},d,n,oa),deleteColumn:a(Bs,function(e){return!1===r(t)||ru(e).columns>1},d,n,oa),insertRowsBefore:a(Ns,x,d,n,oa),insertRowsAfter:a(Ms,x,d,n,oa),insertColumnsBefore:a(zs,x,i,n,oa),insertColumnsAfter:a(Rs,x,i,n,oa),mergeCells:a(Ws,x,d,n,oa),unmergeCells:a(qs,x,d,n,oa),pasteColsBefore:a(Gs,x,d,n,oa),pasteColsAfter:a(Ks,x,d,n,oa),pasteRowsBefore:a(Xs,x,d,n,oa),pasteRowsAfter:a(Ys,x,d,n,oa),pasteCells:a($s,x,d,n,ia),makeCellsHeader:a(Us,x,d,n,oa),unmakeCellsHeader:a(js,x,d,n,oa),makeColumnsHeader:a(Ps,x,d,n,oa),unmakeColumnsHeader:a(Hs,x,d,n,oa),makeRowsHeader:a(Is,x,d,n,oa),makeRowsBody:a(Fs,x,d,n,oa),makeRowsFooter:a(Vs,x,d,n,oa),getTableRowType:Zs,getTableCellType:Qs,getTableColType:Js}},el={styles:{"border-collapse":"collapse",width:"100%"},attributes:{border:"1"},colGroups:!1},nl=function(t){var e=Ct.fromTag("colgroup");return N(t,function(){return Fn(e,Ct.fromTag("col"))}),e},rl=function(t,e,n,r){return N(t,function(t){return function(t,e,n,r){for(var o=Ct.fromTag("tr"),i=0;i<t;i++){var u=r<e||i<n?Ct.fromTag("th"):Ct.fromTag("td");i<n&&De(u,"scope","row"),r<e&&De(u,"scope","col"),Fn(u,Ct.fromTag("br")),Fn(o,u)}return o}(e,n,r,t)})},ol=function(t,e){t.selection.select(e.dom,!0),t.selection.collapse(!0)},il=function(t,e,n,o,i){var u=ha(t),a={styles:u,attributes:ga(t),colGroups:function(t){return t.getParam("table_use_colgroups",!1,"boolean")}(t)};return t.undoManager.ignore(function(){var r=function(t,e,n,r,o,i){void 0===i&&(i=el);var u=Ct.fromTag("table"),a="cells"!==o;Ue(u,i.styles),Ae(u,i.attributes),i.colGroups&&Fn(u,nl(e));var c=Math.min(t,n);if(a&&n>0){var s=Ct.fromTag("thead");Fn(u,s);var l=rl(n,e,"sectionCells"===o?c:0,r);jn(s,l)}var f=Ct.fromTag("tbody");Fn(u,f);var d=rl(a?t-c:t,e,a?0:n,r);return jn(f,d),u}(n,e,i,o,Oa(t),a);De(r,"data-mce-id","__mce");var u,c,s,l=(u=r,c=Ct.fromTag("div"),s=Ct.fromDom(u.dom.cloneNode(!0)),Fn(c,s),function(t){return t.dom.innerHTML}(c));t.insertContent(l),t.addVisual()}),Te(fi(t),'table[data-mce-id="__mce"]').map(function(e){var n;return Sa(t)?Ba(e):ka(t)?La(e):(Ca(t)||(n=u.width,r(n)&&-1!==n.indexOf("%")))&&Ra(e),pi(e),ze(e,"data-mce-id"),function(t,e){z(xe(e,"tr"),function(e){Qu(t,e.dom),z(xe(e,"th,td"),function(e){Zu(t,e.dom)})})}(t,e),function(t,e){Te(e,"td,th").each(p(ol,t))}(t,e),e.dom}).getOr(null)},ul=function(t,e,n,r,o){void 0===r&&(r={});var i=function(t){return f(t)&&t>0};if(i(e)&&i(n)){var u=r.headerRows||0,a=r.headerColumns||0;return il(t,n,e,a,u)}return console.error(o),null},al=function(t){return function(){return t().fold(function(){return[]},function(t){return M(t,function(t){return t.dom})})}},cl=function(t){return function(e){var n=e.length>0?O.some(li(e)):O.none();t(n)}},sl=function(t,e,n,r){return{insertTable:function(t){return function(e,n,r){void 0===r&&(r={});var o=ul(t,n,e,r,"Invalid values for insertTable - rows and columns values are required to insert a table.");return t.undoManager.add(),o}}(t),setClipboardRows:cl(e.setRows),getClipboardRows:al(e.getRows),setClipboardCols:cl(e.setColumns),getClipboardCols:al(e.getColumns),resizeHandler:n,selectionTargets:r}},ll=function(t,e,n){var r=Ge(t,e,1);1===n||r<=1?ze(t,e):De(t,e,Math.min(n,r))},fl=function(t,e){var n=_n.fromTable(t);return wc(n,e).map(function(t){var e=t[t.length-1],r=t[0].column,o=e.column+e.colspan,i=function(t,e,n){if(_n.hasColumns(t)){var r=B(_n.justColumns(t),function(t){return t.column>=e&&t.column<n}),o=M(r,function(t){var r=Sr(t.element);return ll(r,"span",n-e),r}),i=Ct.fromTag("colgroup");return jn(i,o),[i]}return[]}(n,r,o),u=function(t,e,n){return M(t.all,function(t){var r=B(t.cells,function(t){return t.column>=e&&t.column<n}),o=M(r,function(t){var r=Sr(t.element);return ll(r,"colspan",n-e),r}),i=Ct.fromTag("tr");return jn(i,o),i})}(n,r,o);return Y(Y([],i,!0),u,!0)})},dl=function(t,e,n){var r=_n.fromTable(t);return yc(r,e).bind(function(t){var e=mc(r,n,!1),o=yn(e).rows.slice(t[0].row,t[t.length-1].row+t[t.length-1].rowspan),i=V(o,function(t){var e=B(t.cells,function(t){return!t.isLocked});return e.length>0?[X(X({},t),{cells:e})]:[]}),u=gc(i);return He(u.length>0,u)}).map(function(t){return M(t,function(t){var e=Cr(t.element);return z(t.cells,function(t){var n=Sr(t.element);ac(n,"colspan",t.colspan,1),ac(n,"rowspan",t.rowspan,1),Fn(e,n)}),e})})},ml=tinymce.util.Tools.resolve("tinymce.util.Tools"),gl=function(t,e,n){return function(e,r){for(var o=0;o<r.length;o++){var i=t.getStyle(r[o],n);if(void 0===e&&(e=i),e!==i)return""}return e}(void 0,t.select("td,th",e))},hl=function(t,e,n){n&&t.formatter.apply("align"+n,{},e)},pl=function(t,e){ml.each("left center right".split(" "),function(n){t.formatter.remove("align"+n,{},e)})},vl=[{text:"None",value:""},{text:"Top",value:"top"},{text:"Middle",value:"middle"},{text:"Bottom",value:"bottom"}],bl=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,yl=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,wl=function(t){return(e=t,n="#",ot(e,n)?function(t,e){return t.substring(e)}(e,n.length):e).toUpperCase();var e,n},xl=function(t){return function(t){return bl.test(t)||yl.test(t)}(t)?O.some({value:wl(t)}):O.none()},Cl=function(t){var e=t.toString(16);return(1===e.length?"0"+e:e).toUpperCase()},Sl=function(t){return function(t){return{value:t}}(Cl(t.red)+Cl(t.green)+Cl(t.blue))},kl=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)/,Ol=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d?(?:\.\d+)?)\)/,Tl=function(t,e,n,r){return{red:t,green:e,blue:n,alpha:r}},_l=function(t,e,n,r){var o=parseInt(t,10),i=parseInt(e,10),u=parseInt(n,10),a=parseFloat(r);return Tl(o,i,u,a)},El=function(t){return xl(t).orThunk(function(){return function(t){if("transparent"===t)return O.some(Tl(0,0,0,0));var e=kl.exec(t);if(null!==e)return O.some(_l(e[1],e[2],e[3],"1"));var n=Ol.exec(t);return null!==n?O.some(_l(n[1],n[2],n[3],n[4])):O.none()}(t).map(Sl)}).getOrThunk(function(){var e=document.createElement("canvas");e.height=1,e.width=1;var n=e.getContext("2d");n.clearRect(0,0,e.width,e.height),n.fillStyle="#FFFFFF",n.fillStyle=t,n.fillRect(0,0,1,1);var r=n.getImageData(0,0,1,1).data,o=r[0],i=r[1],u=r[2],a=r[3];return Sl(Tl(o,i,u,a))})},Dl=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},Al=function(t){var e=Dl(O.none()),n=function(){return e.get().each(t)};return{clear:function(){n(),e.set(O.none())},isSet:function(){return e.get().isSome()},get:function(){return e.get()},set:function(t){n(),e.set(O.some(t))}}},Nl=function(){var t=Al(d);return X(X({},t),{on:function(e){return t.get().each(e)}})},Ml=function(t,e,n,r){return function(o){var i=Al(function(t){return t.unbind()}),u=!at(r),a=function(){var a=ki(e),c=function(e){return t.formatter.match(n,{value:r},e.dom,u)};u?(o.setActive(!A(a,c)),i.set(t.formatter.formatChanged(n,function(t){return o.setActive(!t)},!0))):(o.setActive(U(a,c)),i.set(t.formatter.formatChanged(n,o.setActive,!1,{value:r})))};return t.initialized?a():t.on("init",a),i.clear}},zl=function(t){return Vt(t,"menu")},Rl=function(t){return M(t,function(t){var e=t.text||t.title;return zl(t)?{text:e,items:Rl(t.menu)}:{text:e,value:t.value}})},Bl=function(t,e,n,r,o){return M(n,function(n){var i=n.text||n.title;return zl(n)?{type:"nestedmenuitem",text:i,getSubmenuItems:function(){return Bl(t,e,n.menu,r,o)}}:{text:i,type:"togglemenuitem",onAction:function(){return o(n.value)},onSetup:Ml(t,e,r,n.value)}})},Ll=function(t,e){return function(n){var r;t.execCommand("mceTableApplyCellStyle",!1,((r={})[e]=n,r))}},Pl=function(t){return V(t,function(t){return zl(t)?[X(X({},t),{menu:Pl(t.menu)})]:at(t.value)?[t]:[]})},Hl=function(t,e,n,r,o){return function(i){return i(Bl(t,e,n,r,o))}},Il=function(t,e,n){var r=M(e,function(t){return{text:t.title,value:"#"+El(t.value).value,type:"choiceitem"}});return[{type:"fancymenuitem",fancytype:"colorswatch",initData:{colors:r.length>0?r:void 0,allowCustomColors:!1},onAction:function(e){var r,o="remove"===e.value?"":e.value;t.execCommand("mceTableApplyCellStyle",!1,((r={})[n]=o,r))}}]},Fl=function(t){return function(){var e="header"===t.queryCommandValue("mceTableRowType")?"body":"header";t.execCommand("mceTableRowType",!1,{type:e})}},Vl=function(t){return function(){var e="th"===t.queryCommandValue("mceTableColType")?"td":"th";t.execCommand("mceTableColType",!1,{type:e})}},Ul=[{name:"width",type:"input",label:"Width"},{name:"height",type:"input",label:"Height"},{name:"celltype",type:"listbox",label:"Cell type",items:[{text:"Cell",value:"td"},{text:"Header cell",value:"th"}]},{name:"scope",type:"listbox",label:"Scope",items:[{text:"None",value:""},{text:"Row",value:"row"},{text:"Column",value:"col"},{text:"Row group",value:"rowgroup"},{text:"Column group",value:"colgroup"}]},{name:"halign",type:"listbox",label:"Horizontal align",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{name:"valign",type:"listbox",label:"Vertical align",items:vl}],jl=function(t){return Ul.concat(function(t){var e=Rl(wa(t));return e.length>0?O.some({name:"class",type:"listbox",label:"Class",items:e}):O.none()}(t).toArray())},Wl=function(t,e){var n=[{name:"borderstyle",type:"listbox",label:"Border style",items:[{text:"Select...",value:""}].concat(Rl(ma(t)))},{name:"bordercolor",type:"colorinput",label:"Border color"},{name:"backgroundcolor",type:"colorinput",label:"Background color"}];return{title:"Advanced",name:"advanced",items:"cell"===e?[{name:"borderwidth",type:"input",label:"Border width"}].concat(n):n}},ql=function(t){return function(e,n){var r=e.dom;return{setAttrib:function(e,o){t&&!o||r.setAttrib(n,e,o)},setStyle:function(e,o){t&&!o||r.setStyle(n,e,o)},setFormat:function(r,o){t&&!o||(""===o?e.formatter.remove(r,{value:null},n,!0):e.formatter.apply(r,{value:o},n))}}}},$l={normal:ql(!1),ifTruthy:ql(!0)},Gl=function(t){return function(e){return ot(e,"rgb")?t.toHex(e):e}},Kl=function(t,e){var n=Ct.fromDom(e);return{borderwidth:qe(n,"border-width").getOr(""),borderstyle:qe(n,"border-style").getOr(""),bordercolor:qe(n,"border-color").map(Gl(t)).getOr(""),backgroundcolor:qe(n,"background-color").map(Gl(t)).getOr("")}},Xl=function(t){var e=t[0],n=t.slice(1);return z(n,function(t){z(At(e),function(n){Mt(t,function(t,r){var o=e[n];""!==o&&n===r&&o!==t&&(e[n]="")})})}),e},Yl=function(t,e,n,r){return H(t,function(t){return!c(n.formatter.matchNode(r,e+t))}).getOr("")},Jl=p(Yl,["left","center","right"],"align"),Ql=p(Yl,["top","middle","bottom"],"valign"),Zl=function(t,e,n){var r=t.dom;return X({height:r.getStyle(e,"height")||r.getAttrib(e,"height"),class:r.getAttrib(e,"class",""),type:function(t){return un(Ct.fromDom(t)).map(function(e){var n={selection:li(t.cells)};return Zs(e,n)}).getOr("")}(e),align:Jl(t,e)},n?Kl(r,e):{})},tf=function(t,e){var n=_n.fromTable(t),r=_n.justCells(n),o=B(r,function(t){return A(e,function(e){return Tt(t.element,e)})});return M(o,function(t){return{element:t.element.dom,column:_n.getColumnAt(n,t.column).map(function(t){return t.element.dom})}})},ef=function(t,e,n){var r=1===e.length;z(e,function(e){var o=e.element,i=r?$l.normal(t,o):$l.ifTruthy(t,o);!function(t,e,n){t.setAttrib("scope",n.scope),t.setAttrib("class",n.class),t.setStyle("height",hi(n.height)),e.setStyle("width",hi(n.width))}(i,e.column.map(function(e){return r?$l.normal(t,e):$l.ifTruthy(t,e)}).getOr(i),n),pa(t)&&function(t,e){t.setFormat("tablecellbackgroundcolor",e.backgroundcolor),t.setFormat("tablecellbordercolor",e.bordercolor),t.setFormat("tablecellborderstyle",e.borderstyle),t.setFormat("tablecellborderwidth",hi(e.borderwidth))}(i,n),r&&(pl(t,o),function(t,e){ml.each("top middle bottom".split(" "),function(n){t.formatter.remove("valign"+n,{},e)})}(t,o)),n.halign&&hl(t,o,n.halign),n.valign&&function(t,e,n){n&&t.formatter.apply("valign"+n,{},e)}(t,o,n.valign)})},nf=function(t,e,n,r){var o=r.getData();r.close(),t.undoManager.transact(function(){!function(t,e,n,r){var o=Bt(r,function(t,e){return n[e]!==t});Ht(o)>0&&e.length>=1&&un(e[0]).each(function(n){var i=tf(n,e),u=Ht(Bt(o,function(t,e){return"scope"!==e&&"celltype"!==e}))>0,a=Ft(o,"celltype");(u||Ft(o,"scope"))&&ef(t,i,r),a&&function(t,e){t.execCommand("mceTableCellType",!1,{type:e.celltype,no_events:!0})}(t,r),na(t,n.dom,{structure:a,style:u})})}(t,e,n,o),t.focus()})},rf=function(t,e){var n=un(e[0]).map(function(n){return M(tf(n,e),function(e){return function(t,e,n,r){var o,i=t.dom,u=r.getOr(e),a=function(t,e){return i.getStyle(t,e)||i.getAttrib(t,e)};return X({width:a(u,"width"),height:a(e,"height"),scope:i.getAttrib(e,"scope"),celltype:(o=e,o.nodeName.toLowerCase()),class:i.getAttrib(e,"class",""),halign:Jl(t,e),valign:Ql(t,e)},n?Kl(i,e):{})}(t,e.element,pa(t),e.column)})});return Xl(n.getOrDie())},of=function(t,e){var n=ki(e);if(0!==n.length){var r=rf(t,n),o={type:"tabpanel",tabs:[{title:"General",name:"general",items:jl(t)},Wl(t,"cell")]},i={type:"panel",items:[{type:"grid",columns:2,items:jl(t)}]};t.windowManager.open({title:"Cell Properties",size:"normal",body:pa(t)?o:i,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:r,onSubmit:p(nf,t,n,r)})}},uf=[{type:"listbox",name:"type",label:"Row type",items:[{text:"Header",value:"header"},{text:"Body",value:"body"},{text:"Footer",value:"footer"}]},{type:"listbox",name:"align",label:"Alignment",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{label:"Height",name:"height",type:"input"}],af=function(t){return uf.concat(function(t){var e=Rl(function(t){return t.getParam("table_row_class_list",[],"array")}(t));return e.length>0?O.some({name:"class",type:"listbox",label:"Class",items:e}):O.none()}(t).toArray())},cf=function(t,e,n,r){var o=1===e.length;z(e,function(e){var i=o?$l.normal(t,e):$l.ifTruthy(t,e);!function(t,e){t.setAttrib("class",e.class),t.setStyle("height",hi(e.height))}(i,n),va(t)&&function(t,e){t.setStyle("background-color",e.backgroundcolor),t.setStyle("border-color",e.bordercolor),t.setStyle("border-style",e.borderstyle)}(i,n),n.align!==r.align&&(pl(t,e),hl(t,e,n.align))})},sf=function(t,e,n,r){var o=r.getData();r.close(),t.undoManager.transact(function(){!function(t,e,n,r){var o=Bt(r,function(t,e){return n[e]!==t});if(Ht(o)>0){var i=Ft(o,"type"),u=!i||Ht(o)>1;u&&cf(t,e,r,n),i&&function(t,e){t.execCommand("mceTableRowType",!1,{type:e.type,no_events:!0})}(t,r),un(Ct.fromDom(e[0])).each(function(e){return na(t,e.dom,{structure:i,style:u})})}}(t,e,n,o),t.focus()})},lf=function(t){var e,n,r,o,i=(e=vi(t),n=yi.selected,r=Si(e),o=r.bind(function(t){return un(t)}).map(function(t){return an(t)}),Pe(r,o,function(t,e){return B(e,function(e){return A(li(e.dom.cells),function(e){return"1"===Ne(e,n)||Tt(e,t)})})}).getOr([]));if(0!==i.length){var u=M(i,function(e){return Zl(t,e.dom,va(t))}),a=Xl(u),c={type:"tabpanel",tabs:[{title:"General",name:"general",items:af(t)},Wl(t,"row")]},s={type:"panel",items:[{type:"grid",columns:2,items:af(t)}]};t.windowManager.open({title:"Row Properties",size:"normal",body:va(t)?c:s,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:a,onSubmit:p(sf,t,M(i,function(t){return t.dom}),a)})}},ff=function(t,e,n,o){if("TD"===e.tagName||"TH"===e.tagName)r(n)?t.setStyle(e,n,o):t.setStyle(e,n);else if(e.children)for(var i=0;i<e.children.length;i++)ff(t,e.children[i],n,o)},df=function(t,e,n,r){var o=t.dom,i=r.getData(),u=Bt(i,function(t,e){return n[e]!==t});r.close(),""===i.class&&delete i.class,t.undoManager.transact(function(){if(!e){var n=parseInt(i.cols,10)||1,r=parseInt(i.rows,10)||1;e=il(t,n,r,0,0)}if(Ht(u)>0){!function(t,e,n){var r,o=t.dom,i={},u={};if(i.class=n.class,u.height=hi(n.height),o.getAttrib(e,"width")&&!ya(t)?i.width=(r=n.width)?r.replace(/px$/,""):"":u.width=hi(n.width),ya(t)?(u["border-width"]=hi(n.border),u["border-spacing"]=hi(n.cellspacing)):(i.border=n.border,i.cellpadding=n.cellpadding,i.cellspacing=n.cellspacing),ya(t)&&e.children)for(var a=0;a<e.children.length;a++)ff(o,e.children[a],{"border-width":hi(n.border),padding:hi(n.cellpadding)}),ba(t)&&ff(o,e.children[a],{"border-color":n.bordercolor});ba(t)&&(u["background-color"]=n.backgroundcolor,u["border-color"]=n.bordercolor,u["border-style"]=n.borderstyle),i.style=o.serializeStyle(X(X({},ha(t)),u)),o.setAttribs(e,X(X({},ga(t)),i))}(t,e,i);var a=o.select("caption",e)[0];(a&&!i.caption||!a&&i.caption)&&t.execCommand("mceTableToggleCaption"),""===i.align?pl(t,e):hl(t,e,i.align)}if(t.focus(),t.addVisual(),Ht(u)>0){var c=Ft(u,"caption"),s=!c||Ht(u)>1;na(t,e,{structure:c,style:s})}})},mf=function(t,e){var n,r=t.dom,o=function(t,e){var n,r,o,i,u=ha(t),a=ga(t),c=e?(n=t.dom,{borderstyle:It(u,"border-style").getOr(""),bordercolor:Gl(n)(It(u,"border-color").getOr("")),backgroundcolor:Gl(n)(It(u,"background-color").getOr(""))}):{};return X(X(X(X(X(X({},{height:"",width:"100%",cellspacing:"",cellpadding:"",caption:!1,class:"",align:"",border:""}),u),a),c),(i=u["border-width"],ya(t)&&i?{border:i}:It(a,"border").fold(function(){return{}},function(t){return{border:t}}))),(r=It(u,"border-spacing").or(It(a,"cellspacing")).fold(function(){return{}},function(t){return{cellspacing:t}}),o=It(u,"border-padding").or(It(a,"cellpadding")).fold(function(){return{}},function(t){return{cellpadding:t}}),X(X({},r),o)))}(t,ba(t));!1===e?(n=r.getParent(t.selection.getStart(),"table",t.getBody()))?o=function(t,e,n){var r=t.dom,o=ya(t)?r.getStyle(e,"border-spacing")||r.getAttrib(e,"cellspacing"):r.getAttrib(e,"cellspacing")||r.getStyle(e,"border-spacing"),i=ya(t)?gl(r,e,"padding")||r.getAttrib(e,"cellpadding"):r.getAttrib(e,"cellpadding")||gl(r,e,"padding");return X({width:r.getStyle(e,"width")||r.getAttrib(e,"width"),height:r.getStyle(e,"height")||r.getAttrib(e,"height"),cellspacing:o,cellpadding:i,border:function(e,n){var r=qe(Ct.fromDom(n),"border-width");return ya(t)&&r.isSome()?r.getOr(""):e.getAttrib(n,"border")||gl(t.dom,n,"border-width")||gl(t.dom,n,"border")}(r,e),caption:!!r.select("caption",e)[0],class:r.getAttrib(e,"class",""),align:Jl(t,e)},n?Kl(r,e):{})}(t,n,ba(t)):ba(t)&&(o.borderstyle="",o.bordercolor="",o.backgroundcolor=""):(o.cols="1",o.rows="1",ba(t)&&(o.borderstyle="",o.bordercolor="",o.backgroundcolor=""));var i=Rl(xa(t));i.length>0&&o.class&&(o.class=o.class.replace(/\s*mce\-item\-table\s*/g,""));var u={type:"grid",columns:2,items:function(t,e,n){var r=n?[{type:"input",name:"cols",label:"Cols",inputMode:"numeric"},{type:"input",name:"rows",label:"Rows",inputMode:"numeric"}]:[],o=function(t){return t.getParam("table_appearance_options",!0,"boolean")}(t)?[{type:"input",name:"cellspacing",label:"Cell spacing",inputMode:"numeric"},{type:"input",name:"cellpadding",label:"Cell padding",inputMode:"numeric"},{type:"input",name:"border",label:"Border width"},{type:"label",label:"Caption",items:[{type:"checkbox",name:"caption",label:"Show caption"}]}]:[],i=e.length>0?[{type:"listbox",name:"class",label:"Class",items:e}]:[];return r.concat([{type:"input",name:"width",label:"Width"},{type:"input",name:"height",label:"Height"}]).concat(o).concat([{type:"listbox",name:"align",label:"Alignment",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]}]).concat(i)}(t,i,e)},a=ba(t)?{type:"tabpanel",tabs:[{title:"General",name:"general",items:[u]},Wl(t,"table")]}:{type:"panel",items:[u]};t.windowManager.open({title:"Table Properties",size:"normal",body:a,onSubmit:p(df,t,n,o),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:o})},gf=function(t){return Ci(vi(t),gi(t))},hf=function(t,e,n,i,u){var a=gi(t),c=function(t){return un(t,a)},s=function(e){return function(t){return Si(vi(t),gi(t))}(t).bind(function(t){return c(t).map(function(n){return e(n,t)})})},l=function(e){t.focus()},f=function(t,e){return void 0===e&&(e=!1),s(function(n,r){var o=wi(i,n,r);t(n,o,e).each(l)})},m=function(){return s(function(e,n){var r=wi(i,e,n),o=ci(d,Ct.fromDom(t.getDoc()),O.none());return dl(e,r,o)})},g=function(){return s(function(t,e){var n=wi(i,t,e);return fl(t,n)})},h=function(e,n){return n().each(function(n){var r=M(n,function(t){return Sr(t)});s(function(n,o){var u=si(Ct.fromDom(t.getDoc())),a=function(t,e,n,r){return{selection:bi(t),clipboard:n,generators:r}}(i,0,r,u);e(n,a).each(l)})})},v=function(t){return function(e,n){return It(n,"type").each(function(e){f(t(e),n.no_events)})}};Mt({mceTableSplitCells:function(){return f(e.unmergeCells)},mceTableMergeCells:function(){return f(e.mergeCells)},mceTableInsertRowBefore:function(){return f(e.insertRowsBefore)},mceTableInsertRowAfter:function(){return f(e.insertRowsAfter)},mceTableInsertColBefore:function(){return f(e.insertColumnsBefore)},mceTableInsertColAfter:function(){return f(e.insertColumnsAfter)},mceTableDeleteCol:function(){return f(e.deleteColumn)},mceTableDeleteRow:function(){return f(e.deleteRow)},mceTableCutCol:function(){return g().each(function(t){u.setColumns(t),f(e.deleteColumn)})},mceTableCutRow:function(){return m().each(function(t){u.setRows(t),f(e.deleteRow)})},mceTableCopyCol:function(){return g().each(function(t){return u.setColumns(t)})},mceTableCopyRow:function(){return m().each(function(t){return u.setRows(t)})},mceTablePasteColBefore:function(){return h(e.pasteColsBefore,u.getColumns)},mceTablePasteColAfter:function(){return h(e.pasteColsAfter,u.getColumns)},mceTablePasteRowBefore:function(){return h(e.pasteRowsBefore,u.getRows)},mceTablePasteRowAfter:function(){return h(e.pasteRowsAfter,u.getRows)},mceTableDelete:function(){return gf(t).each(function(e){un(e,a).filter(y(a)).each(function(e){var n=Ct.fromText("");if(Hn(e,n),qn(e),t.dom.isEmpty(t.getBody()))t.setContent(""),t.selection.setCursorLocation();else{var r=t.dom.createRng();r.setStart(n.dom,0),r.setEnd(n.dom,0),t.selection.setRng(r),t.nodeChanged()}})})},mceTableCellToggleClass:function(e,n){s(function(e){var r=ki(i),o=U(r,function(e){return t.formatter.match("tablecellclass",{value:n},e.dom)})?t.formatter.remove:t.formatter.apply;z(r,function(t){return o("tablecellclass",{value:n},t.dom)}),na(t,e.dom,ra)})},mceTableToggleClass:function(e,n){s(function(e){t.formatter.toggle("tableclass",{value:n},e.dom),na(t,e.dom,ra)})},mceTableToggleCaption:function(){gf(t).each(function(e){un(e,a).each(function(n){Oe(n,"caption").fold(function(){var e,r,o=Ct.fromTag("caption");Fn(o,Ct.fromText("Caption")),r=o,se(e=n,0).fold(function(){Fn(e,r)},function(t){Pn(t,r)}),t.selection.setCursorLocation(o.dom,0)},function(r){ee("caption")(e)&&Ot("td",n).each(function(e){return t.selection.setCursorLocation(e.dom,0)}),qn(r)}),na(t,n.dom,oa)})})},mceTableSizingMode:function(e,n){return function(e){return gf(t).each(function(n){ka(t)||Sa(t)||Ca(t)||un(n,a).each(function(n){"relative"!==e||tu(n)?"fixed"!==e||eu(n)?"responsive"!==e||nu(n)||La(n):Ba(n):Ra(n),pi(n),na(t,n.dom,oa)})})}(n)},mceTableCellType:v(function(t){return"th"===t?e.makeCellsHeader:e.unmakeCellsHeader}),mceTableColType:v(function(t){return"th"===t?e.makeColumnsHeader:e.unmakeColumnsHeader}),mceTableRowType:v(function(t){switch(t){case"header":return e.makeRowsHeader;case"footer":return e.makeRowsFooter;default:return e.makeRowsBody}})},function(e,n){return t.addCommand(n,e)}),Mt({mceTableProps:p(mf,t,!1),mceTableRowProps:p(lf,t),mceTableCellProps:p(of,t,i)},function(e,n){return t.addCommand(n,function(){return e()})}),t.addCommand("mceInsertTable",function(e,n){o(n)&&At(n).length>0?ul(t,n.rows,n.columns,n.options,"Invalid values for mceInsertTable - rows and columns values are required to insert a table."):mf(t,!0)}),t.addCommand("mceTableApplyCellStyle",function(e,n){var u=function(t){return"tablecell"+t.toLowerCase().replace("-","")};if(o(n)){var a=ki(i);if(0!==a.length){var s=Bt(n,function(e,n){return t.formatter.has(u(n))&&r(e)});(function(t){for(var e in t)if(Nt.call(t,e))return!1;return!0})(s)||(Mt(s,function(e,n){z(a,function(r){$l.normal(t,r.dom).setFormat(u(n),e)})}),c(a[0]).each(function(e){return na(t,e.dom,ra)}))}}})},pf={remove_similar:!0,inherit:!1},vf=X({selector:"td,th"},pf),bf={tablecellbackgroundcolor:X({styles:{backgroundColor:"%value"}},vf),tablecellverticalalign:X({styles:{"vertical-align":"%value"}},vf),tablecellbordercolor:X({styles:{borderColor:"%value"}},vf),tablecellclass:X({classes:["%value"]},vf),tableclass:X({selector:"table",classes:["%value"]},pf),tablecellborderstyle:X({styles:{borderStyle:"%value"}},vf),tablecellborderwidth:X({styles:{borderWidth:"%value"}},vf)},yf=gr([{none:["current"]},{first:["current"]},{middle:["current","target"]},{last:["current"]}]),wf=X(X({},yf),{none:function(t){return void 0===t&&(t=void 0),yf.none(t)}}),xf=function(t,e,n,r,o){void 0===o&&(o=x);var i=1===r;if(!i&&n<=0)return wf.first(t[0]);if(i&&n>=t.length-1)return wf.last(t[t.length-1]);var u=n+r,a=t[u];return o(a)?wf.middle(e,a):xf(t,e,u,r,o)},Cf=function(t,e){return un(t,e).bind(function(e){var n=rn(e);return I(n,function(e){return Tt(t,e)}).map(function(t){return{index:t,all:n}})})},Sf=function(t,e,n,r){return{start:t,soffset:e,finish:n,foffset:r}},kf=gr([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Of={before:kf.before,on:kf.on,after:kf.after,cata:function(t,e,n,r){return t.fold(e,n,r)},getStart:function(t){return t.fold(g,g,g)}},Tf=gr([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),_f={domRange:Tf.domRange,relative:Tf.relative,exact:Tf.exact,exactFromRange:function(t){return Tf.exact(t.start,t.soffset,t.finish,t.foffset)},getWin:function(t){var e,n=function(t){return t.match({domRange:function(t){return Ct.fromDom(t.startContainer)},relative:function(t,e){return Of.getStart(t)},exact:function(t,e,n,r){return t}})}(t);return e=n,Ct.fromDom(re(e).dom.defaultView)},range:Sf},Ef=function(t,e){var n=t.document.createRange();return n.selectNode(e.dom),n},Df=function(t,e){var n=t.document.createRange();return Af(n,e),n},Af=function(t,e){return t.selectNodeContents(e.dom)},Nf=function(t,e,n){var r,o=t.document.createRange();return r=o,e.fold(function(t){r.setStartBefore(t.dom)},function(t,e){r.setStart(t.dom,e)},function(t){r.setStartAfter(t.dom)}),function(t,e){e.fold(function(e){t.setEndBefore(e.dom)},function(e,n){t.setEnd(e.dom,n)},function(e){t.setEndAfter(e.dom)})}(o,n),o},Mf=function(t,e,n,r,o){var i=t.document.createRange();return i.setStart(e.dom,n),i.setEnd(r.dom,o),i},zf=function(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom,width:t.width,height:t.height}},Rf=gr([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),Bf=function(t,e,n){return e(Ct.fromDom(n.startContainer),n.startOffset,Ct.fromDom(n.endContainer),n.endOffset)},Lf=function(t,e){return function(t,e){var n=e.ltr();return n.collapsed?e.rtl().filter(function(t){return!1===t.collapsed}).map(function(t){return Rf.rtl(Ct.fromDom(t.endContainer),t.endOffset,Ct.fromDom(t.startContainer),t.startOffset)}).getOrThunk(function(){return Bf(0,Rf.ltr,n)}):Bf(0,Rf.ltr,n)}(0,function(t,e){return e.match({domRange:function(t){return{ltr:m(t),rtl:O.none}},relative:function(e,n){return{ltr:J(function(){return Nf(t,e,n)}),rtl:J(function(){return O.some(Nf(t,n,e))})}},exact:function(e,n,r,o){return{ltr:J(function(){return Mf(t,e,n,r,o)}),rtl:J(function(){return O.some(Mf(t,r,o,e,n))})}}})}(t,e))},Pf=function(t,e){return Lf(t,e).match({ltr:function(e,n,r,o){var i=t.document.createRange();return i.setStart(e.dom,n),i.setEnd(r.dom,o),i},rtl:function(e,n,r,o){var i=t.document.createRange();return i.setStart(r.dom,o),i.setEnd(e.dom,n),i}})};Rf.ltr,Rf.rtl;var Hf=function(t,e,n){return e>=t.left&&e<=t.right&&n>=t.top&&n<=t.bottom},If=function(t,e,n,r,o){var i=function(n){var r=t.dom.createRange();return r.setStart(e.dom,n),r.collapse(!0),r},u=Kn(e).length,a=function(t,e,n,r,o){if(0===o)return 0;if(e===r)return o-1;for(var i=r,u=1;u<o;u++){var a=t(u),c=Math.abs(e-a.left);if(n<=a.bottom){if(n<a.top||c>i)return u-1;i=c}}return 0}(function(t){return i(t).getBoundingClientRect()},n,r,o.right,u);return i(a)},Ff=function(t,e,n,r){return Qt(e)?function(t,e,n,r){var o=t.dom.createRange();o.selectNode(e.dom);var i=o.getClientRects();return K(i,function(t){return Hf(t,n,r)?O.some(t):O.none()}).map(function(o){return If(t,e,n,r,o)})}(t,e,n,r):function(t,e,n,r){var o=t.dom.createRange(),i=ce(e);return K(i,function(e){return o.selectNode(e.dom),Hf(o.getBoundingClientRect(),n,r)?Ff(t,e,n,r):O.none()})}(t,e,n,r)},Vf=function(t,e){return e-t.left<t.right-e},Uf=function(t,e,n){var r=t.dom.createRange();return r.selectNode(e.dom),r.collapse(n),r},jf=function(t,e,n){var r=t.dom.createRange();r.selectNode(e.dom);var o=r.getBoundingClientRect(),i=Vf(o,n);return(!0===i?Qo:Zo)(e).map(function(e){return Uf(t,e,i)})},Wf=function(t,e,n){var r=e.dom.getBoundingClientRect(),o=Vf(r,n);return O.some(Uf(t,e,o))},qf=function(t,e,n){var r,o;return O.from(null===(o=(r=t.dom).caretPositionFromPoint)||void 0===o?void 0:o.call(r,e,n)).bind(function(e){if(null===e.offsetNode)return O.none();var n=t.dom.createRange();return n.setStart(e.offsetNode,e.offset),n.collapse(),O.some(n)})},$f=function(t,e,n){var r,o;return O.from(null===(o=(r=t.dom).caretRangeFromPoint)||void 0===o?void 0:o.call(r,e,n))},Gf=function(t,e,n,r){var o=t.dom.createRange();o.selectNode(e.dom);var i=o.getBoundingClientRect();return function(t,e,n,r){var o=t.dom.createRange();o.selectNode(e.dom);var i=o.getBoundingClientRect(),u=Math.max(i.left,Math.min(i.right,n)),a=Math.max(i.top,Math.min(i.bottom,r));return Ff(t,e,u,a)}(t,e,Math.max(i.left,Math.min(i.right,n)),Math.max(i.top,Math.min(i.bottom,r)))},Kf=function(t,e,n){return Ct.fromPoint(t,e,n).bind(function(r){var o=function(){return function(t,e,n){return(0===ce(e).length?Wf:jf)(t,e,n)}(t,r,e)};return 0===ce(r).length?o():Gf(t,r,e,n).orThunk(o)})},Xf=document.caretPositionFromPoint?qf:document.caretRangeFromPoint?$f:Kf,Yf=function(t,e){var n=Gt(t);return"input"===n?Of.after(t):D(["br","img"],n)?0===e?Of.before(t):Of.after(t):Of.on(t,e)},Jf=function(t,e){var n=t.fold(Of.before,Yf,Of.after),r=e.fold(Of.before,Yf,Of.after);return _f.relative(n,r)},Qf=function(t,e,n,r){var o=Yf(t,e),i=Yf(n,r);return _f.relative(o,i)},Zf=function(t,e,n,r){var o=function(t,e,n,r){var o=ne(t).dom.createRange();return o.setStart(t.dom,e),o.setEnd(n.dom,r),o}(t,e,n,r),i=Tt(t,n)&&e===r;return o.collapsed&&!i},td=function(t){return O.from(t.getSelection())},ed=function(t,e){td(t).each(function(t){t.removeAllRanges(),t.addRange(e)})},nd=function(t,e,n,r,o){var i=Mf(t,e,n,r,o);ed(t,i)},rd=function(t,e){return Lf(t,e).match({ltr:function(e,n,r,o){nd(t,e,n,r,o)},rtl:function(e,n,r,o){td(t).each(function(i){if(i.setBaseAndExtent)i.setBaseAndExtent(e.dom,n,r.dom,o);else if(i.extend)try{!function(t,e,n,r,o,i){e.collapse(n.dom,r),e.extend(o.dom,i)}(0,i,e,n,r,o)}catch(i){nd(t,r,o,e,n)}else nd(t,r,o,e,n)})}})},od=function(t,e,n,r,o){var i=Qf(e,n,r,o);rd(t,i)},id=function(t,e,n){var r=Jf(e,n);rd(t,r)},ud=function(t){var e=_f.getWin(t).dom,n=function(t,n,r,o){return Mf(e,t,n,r,o)},r=function(t){return t.match({domRange:function(t){var e=Ct.fromDom(t.startContainer),n=Ct.fromDom(t.endContainer);return Qf(e,t.startOffset,n,t.endOffset)},relative:Jf,exact:Qf})}(t);return Lf(e,r).match({ltr:n,rtl:n})},ad=function(t){if(t.rangeCount>0){var e=t.getRangeAt(0),n=t.getRangeAt(t.rangeCount-1);return O.some(Sf(Ct.fromDom(e.startContainer),e.startOffset,Ct.fromDom(n.endContainer),n.endOffset))}return O.none()},cd=function(t){if(null===t.anchorNode||null===t.focusNode)return ad(t);var e=Ct.fromDom(t.anchorNode),n=Ct.fromDom(t.focusNode);return Zf(e,t.anchorOffset,n,t.focusOffset)?O.some(Sf(e,t.anchorOffset,n,t.focusOffset)):ad(t)},sd=function(t,e,n){void 0===n&&(n=!0);var r=(n?Df:Ef)(t,e);ed(t,r)},ld=function(t){return function(t){return td(t).filter(function(t){return t.rangeCount>0}).bind(cd)}(t).map(function(t){return _f.exact(t.start,t.soffset,t.finish,t.foffset)})},fd=function(t,e){return function(t){var e=t.getClientRects(),n=e.length>0?e[0]:t.getBoundingClientRect();return n.width>0||n.height>0?O.some(n).map(zf):O.none()}(Pf(t,e))},dd=function(t,e,n){return function(t,e,n){var r=Ct.fromDom(t.document);return Xf(r,e,n).map(function(t){return Sf(Ct.fromDom(t.startContainer),t.startOffset,Ct.fromDom(t.endContainer),t.endOffset)})}(t,e,n)},md=tinymce.util.Tools.resolve("tinymce.util.VK"),gd=function(t,e,n){return pd(t,e,function(t,e,n){return Cf(t,n).fold(function(){return wf.none(t)},function(n){return xf(n.all,t,n.index,1,e)})}(n,zu))},hd=function(t,e,n){return pd(t,e,function(t,e,n){return Cf(t,n).fold(function(){return wf.none()},function(n){return xf(n.all,t,n.index,-1,e)})}(n,zu))},pd=function(t,e,n){return n.fold(O.none,O.none,function(t,e){return Qo(e).map(function(t){return function(t,e){var n=_f.exact(e,0,e,0);return ud(n)}(0,t)})},function(n){return t.execCommand("mceTableInsertRowAfter"),gd(t,e,n)})},vd=["table","li","dl"],bd=function(t,e){return{selection:t,kill:e}},yd=function(t,e,n,r){return{start:Of.on(t,e),finish:Of.on(n,r)}},wd=function(t,e){var n=Pf(t,e);return Sf(Ct.fromDom(n.startContainer),n.startOffset,Ct.fromDom(n.endContainer),n.endOffset)},xd=yd,Cd=function(t,e,n,r,o){return Tt(n,r)?O.none():cr(n,r,e).bind(function(e){var r=e.boxes.getOr([]);return r.length>1?(o(t,r,e.start,e.finish),O.some(bd(O.some(xd(n,0,n,Xo(n))),!0))):O.none()})},Sd=function(t,e){return{item:t,mode:e}},kd=function(t,e,n,r){return void 0===r&&(r=Od),t.property().parent(e).map(function(t){return Sd(t,r)})},Od=function(t,e,n,r){return void 0===r&&(r=Td),n.sibling(t,e).map(function(t){return Sd(t,r)})},Td=function(t,e,n,r){void 0===r&&(r=Td);var o=t.property().children(e);return n.first(o).map(function(t){return Sd(t,r)})},_d=[{current:kd,next:Od,fallback:O.none()},{current:Od,next:Td,fallback:O.some(kd)},{current:Td,next:Td,fallback:O.some(Od)}],Ed=function(t,e,n,r,o){return void 0===o&&(o=_d),H(o,function(t){return t.current===n}).bind(function(n){return n.current(t,e,r,n.next).orThunk(function(){return n.fallback.bind(function(n){return Ed(t,e,n,r)})})})},Dd=function(){return{sibling:function(t,e){return t.query().prevSibling(e)},first:function(t){return t.length>0?O.some(t[t.length-1]):O.none()}}},Ad=function(){return{sibling:function(t,e){return t.query().nextSibling(e)},first:function(t){return t.length>0?O.some(t[0]):O.none()}}},Nd=function(t,e,n,r,o,i){return Ed(t,e,r,o).bind(function(e){return i(e.item)?O.none():n(e.item)?O.some(e.item):Nd(t,e.item,n,e.mode,o,i)})},Md=function(t){return function(e){return 0===t.property().children(e).length}},zd=function(t,e,n,r){return Nd(t,e,n,Od,Dd(),r)},Rd=function(t,e,n,r){return Nd(t,e,n,Od,Ad(),r)},Bd=Qn(),Ld=function(t,e){return function(t,e,n){return zd(t,e,Md(t),n)}(Bd,t,e)},Pd=function(t,e){return function(t,e,n){return Rd(t,e,Md(t),n)}(Bd,t,e)},Hd=gr([{none:["message"]},{success:[]},{failedUp:["cell"]},{failedDown:["cell"]}]),Id=function(t){return _e(t,"tr")},Fd=X(X({},Hd),{verify:function(t,e,n,r,o,i,u){return _e(r,"td,th",u).bind(function(n){return _e(e,"td,th",u).map(function(e){return Tt(n,e)?Tt(r,n)&&Xo(n)===o?i(e):Hd.none("in same cell"):ur(Id,[n,e]).fold(function(){return function(t,e,n){var r=t.getRect(e),o=t.getRect(n);return o.right>r.left&&o.left<r.right}(t,e,n)?Hd.success():i(e)},function(t){return i(e)})})}).getOr(Hd.none("default"))},cata:function(t,e,n,r,o){return t.fold(e,n,r,o)}}),Vd=function(t,e){return I(t,p(Tt,e))},Ud=function(t){return"br"===Gt(t)},jd=function(t,e,n){return e(t,n).bind(function(t){return Qt(t)&&0===Kn(t).trim().length?jd(t,e,n):O.some(t)})},Wd=function(t,e,n,r){return function(t,e){return se(t,e).filter(Ud).orThunk(function(){return se(t,e-1).filter(Ud)})}(e,n).bind(function(e){return r.traverse(e).fold(function(){return jd(e,r.gather,t).map(r.relative)},function(t){return(e=t,oe(e).bind(function(t){var n=ce(t);return Vd(n,e).map(function(r){return function(t,e,n,r){return{parent:t,children:e,element:n,index:r}}(t,n,e,r)})})).map(function(t){return Of.on(t.parent,t.index)});var e})})},qd=function(t,e,n,r){return(Ud(e)?function(t,e,n){return n.traverse(e).orThunk(function(){return jd(e,n.gather,t)}).map(n.relative)}(t,e,r):Wd(t,e,n,r)).map(function(t){return{start:t,finish:t}})},$d=function(t,e){return{left:t.left,top:t.top+e,right:t.right,bottom:t.bottom+e}},Gd=function(t,e){return{left:t.left,top:t.top-e,right:t.right,bottom:t.bottom-e}},Kd=function(t,e,n){return{left:t.left+e,top:t.top+n,right:t.right+e,bottom:t.bottom+n}},Xd=function(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom}},Yd=function(t,e){return O.some(t.getRect(e))},Jd=function(t,e,n){return Jt(e)?Yd(t,e).map(Xd):Qt(e)?function(t,e,n){return n>=0&&n<Xo(e)?t.getRangedRect(e,n,e,n+1):n>0?t.getRangedRect(e,n-1,e,n):O.none()}(t,e,n).map(Xd):O.none()},Qd=function(t,e){return Jt(e)?Yd(t,e).map(Xd):Qt(e)?t.getRangedRect(e,0,e,Xo(e)).map(Xd):O.none()},Zd=gr([{none:[]},{retry:["caret"]}]),tm=function(t,e,n){return(r=e,o=as,Ce(function(t,e){return e(t)},Se,r,o,i)).fold(w,function(e){return Qd(t,e).exists(function(t){return function(t,e){return t.left<e.left||Math.abs(e.right-t.left)<1||t.left>e.right}(n,t)})});var r,o,i},em={point:function(t){return t.bottom},adjuster:function(t,e,n,r,o){var i=$d(o,5);return Math.abs(n.bottom-r.bottom)<1?Zd.retry(i):n.top>o.bottom?Zd.retry(i):n.top===o.bottom?Zd.retry($d(o,1)):tm(t,e,o)?Zd.retry(Kd(i,5,0)):Zd.none()},move:$d,gather:Pd},nm=function(t,e,n,r,o){return 0===o?O.some(r):function(t,e,n){return t.elementFromPoint(e,n).filter(function(t){return"table"===Gt(t)}).isSome()}(t,r.left,e.point(r))?function(t,e,n,r,o){return nm(t,e,n,e.move(r,5),o)}(t,e,n,r,o-1):t.situsFromPoint(r.left,e.point(r)).bind(function(i){return i.start.fold(O.none,function(i){return Qd(t,i).bind(function(u){return e.adjuster(t,i,u,n,r).fold(O.none,function(r){return nm(t,e,n,r,o-1)})}).orThunk(function(){return O.some(r)})},O.none)})},rm=function(t,e,n){var r=t.move(n,5),o=nm(e,t,n,r,100).getOr(r);return function(t,e,n){return t.point(e)>n.getInnerHeight()?O.some(t.point(e)-n.getInnerHeight()):t.point(e)<0?O.some(-t.point(e)):O.none()}(t,o,e).fold(function(){return e.situsFromPoint(o.left,t.point(o))},function(n){return e.scrollBy(0,n),e.situsFromPoint(o.left,t.point(o)-n)})},om={tryUp:p(rm,{point:function(t){return t.top},adjuster:function(t,e,n,r,o){var i=Gd(o,5);return Math.abs(n.top-r.top)<1?Zd.retry(i):n.bottom<o.top?Zd.retry(i):n.bottom===o.top?Zd.retry(Gd(o,1)):tm(t,e,o)?Zd.retry(Kd(i,5,0)):Zd.none()},move:Gd,gather:Ld}),tryDown:p(rm,em),ieTryUp:function(t,e){return t.situsFromPoint(e.left,e.top-5)},ieTryDown:function(t,e){return t.situsFromPoint(e.left,e.bottom+5)},getJumpSize:m(5)},im=function(t,e,n){return t.getSelection().bind(function(r){return qd(e,r.finish,r.foffset,n).fold(function(){return O.some(Fa(r.finish,r.foffset))},function(o){var i=t.fromSitus(o);return function(t){return Fd.cata(t,function(t){return O.none()},function(){return O.none()},function(t){return O.some(Fa(t,0))},function(t){return O.some(Fa(t,Xo(t)))})}(Fd.verify(t,r.finish,r.foffset,i.finish,i.foffset,n.failure,e))})})},um=function(t,e,n,r,o,i){return 0===i?O.none():sm(t,e,n,r,o).bind(function(u){var a=t.fromSitus(u),c=Fd.verify(t,n,r,a.finish,a.foffset,o.failure,e);return Fd.cata(c,function(){return O.none()},function(){return O.some(u)},function(u){return Tt(n,u)&&0===r?am(t,n,r,Gd,o):um(t,e,u,0,o,i-1)},function(u){return Tt(n,u)&&r===Xo(u)?am(t,n,r,$d,o):um(t,e,u,Xo(u),o,i-1)})})},am=function(t,e,n,r,o){return Jd(t,e,n).bind(function(e){return cm(t,o,r(e,om.getJumpSize()))})},cm=function(t,e,n){var r=wt().browser;return r.isChrome()||r.isSafari()||r.isFirefox()||r.isEdge()?e.otherRetry(t,n):r.isIE()?e.ieRetry(t,n):O.none()},sm=function(t,e,n,r,o){return Jd(t,n,r).bind(function(e){return cm(t,o,e)})},lm=function(t,e){return Se(t,function(t){return oe(t).exists(function(t){return Tt(t,e)})},n).isSome();var n},fm=function(t,e,n,r,o){return _e(r,"td,th",e).bind(function(r){return _e(r,"table",e).bind(function(i){return lm(o,i)?function(t,e,n){return im(t,e,n).bind(function(r){return um(t,e,r.element,r.offset,n,20).map(t.fromSitus)})}(t,e,n).bind(function(t){return _e(t.finish,"td,th",e).map(function(e){return{start:r,finish:e,range:t}})}):O.none()})})},dm=function(t,e,n,r,o,i){return wt().browser.isIE()?O.none():i(r,e).orThunk(function(){return fm(t,e,n,r,o).map(function(t){var e=t.range;return bd(O.some(xd(e.start,e.soffset,e.finish,e.foffset)),!0)})})},mm=function(t,e){return _e(t,"tr",e).bind(function(t){return _e(t,"table",e).bind(function(n){var r=xe(n,"tr");return Tt(t,r[0])?function(t,e,n){return zd(Bd,t,e,n)}(n,function(t){return Zo(t).isSome()},e).map(function(t){var e=Xo(t);return bd(O.some(xd(t,e,t,e)),!0)}):O.none()})})},gm=function(t,e){return _e(t,"tr",e).bind(function(t){return _e(t,"table",e).bind(function(n){var r=xe(n,"tr");return Tt(t,r[r.length-1])?function(t,e,n){return Rd(Bd,t,e,n)}(n,function(t){return Qo(t).isSome()},e).map(function(t){return bd(O.some(xd(t,0,t,0)),!0)}):O.none()})})},hm=function(t,e,n,r,o,i,u){return fm(t,n,r,o,i).bind(function(t){return Cd(e,n,t.start,t.finish,u)})},pm=function(t,e){return _e(t,"td,th",e)},vm={traverse:ae,gather:Pd,relative:Of.before,otherRetry:om.tryDown,ieRetry:om.ieTryDown,failure:Fd.failedDown},bm={traverse:ue,gather:Ld,relative:Of.before,otherRetry:om.tryUp,ieRetry:om.ieTryUp,failure:Fd.failedUp},ym=function(t){return function(e){return e===t}},wm=ym(38),xm=ym(40),Cm=function(t){return t>=37&&t<=40},Sm={isBackward:ym(37),isForward:ym(39)},km={isBackward:ym(39),isForward:ym(37)},Om=function(t){return{elementFromPoint:function(e,n){return Ct.fromPoint(Ct.fromDom(t.document),e,n)},getRect:function(t){return t.dom.getBoundingClientRect()},getRangedRect:function(e,n,r,o){var i=_f.exact(e,n,r,o);return fd(t,i)},getSelection:function(){return ld(t).map(function(e){return wd(t,e)})},fromSitus:function(e){var n=_f.relative(e.start,e.finish);return wd(t,n)},situsFromPoint:function(e,n){return dd(t,e,n).map(function(t){return yd(t.start,t.soffset,t.finish,t.foffset)})},clearSelection:function(){!function(t){td(t).each(function(t){return t.removeAllRanges()})}(t)},collapseSelection:function(e){void 0===e&&(e=!1),ld(t).each(function(n){return n.fold(function(t){return t.collapse(e)},function(n,r){var o=e?n:r;id(t,o,o)},function(n,r,o,i){var u=e?n:o,a=e?r:i;od(t,u,a,u,a)})})},setSelection:function(e){od(t,e.start,e.soffset,e.finish,e.foffset)},setRelativeSelection:function(e,n){id(t,e,n)},selectNode:function(e){sd(t,e,!1)},selectContents:function(e){sd(t,e)},getInnerHeight:function(){return t.innerHeight},getScrollY:function(){var e,n,r,o;return(e=Ct.fromDom(t.document),n=void 0!==e?e.dom:document,r=n.body.scrollLeft||n.documentElement.scrollLeft,o=n.body.scrollTop||n.documentElement.scrollTop,Kr(r,o)).top},scrollBy:function(e,n){!function(t,e,n){var r=(void 0!==n?n.dom:document).defaultView;r&&r.scrollBy(t,e)}(e,n,Ct.fromDom(t.document))}}},Tm=function(t,e){return{rows:t,cols:e}},_m=function(t,e,n,r){var o=function(t,e,n,r){var o=Nl(),i=o.clear,u=function(i){o.on(function(o){r.clearBeforeUpdate(e),pm(i.target,n).each(function(u){cr(o,u,n).each(function(n){var o=n.boxes.getOr([]);if(1===o.length){var a=o[0],c="false"===Ru(a),s=Be(Mu(i.target),a,Tt);c&&s&&(r.selectRange(e,o,a,a),t.selectContents(a))}else o.length>1&&(r.selectRange(e,o,n.start,n.finish),t.selectContents(u))})})})};return{clearstate:i,mousedown:function(t){r.clear(e),pm(t.target,n).each(o.set)},mouseover:function(t){u(t)},mouseup:function(t){u(t),i()}}}(Om(t),e,n,r);return{clearstate:o.clearstate,mousedown:o.mousedown,mouseover:o.mouseover,mouseup:o.mouseup}},Em=function(t,e,n,r){var o=Om(t),i=function(){return r.clear(e),O.none()};return{keydown:function(t,u,a,c,s,l){var f=t.raw,d=f.which,m=!0===f.shiftKey;return sr(e,r.selectedSelector).fold(function(){return Cm(d)&&!m&&r.clearBeforeUpdate(e),xm(d)&&m?p(hm,o,e,n,vm,c,u,r.selectRange):wm(d)&&m?p(hm,o,e,n,bm,c,u,r.selectRange):xm(d)?p(dm,o,n,vm,c,u,gm):wm(d)?p(dm,o,n,bm,c,u,mm):O.none},function(t){var n=function(n){return function(){return K(n,function(n){return function(t,e,n,r,o){return fr(r,t,e,o.firstSelectedSelector,o.lastSelectedSelector).map(function(t){return o.clearBeforeUpdate(n),o.selectRange(n,t.boxes,t.start,t.finish),t.boxes})}(n.rows,n.cols,e,t,r)}).fold(function(){return lr(e,r.firstSelectedSelector,r.lastSelectedSelector).map(function(t){var n=xm(d)||l.isForward(d)?Of.after:Of.before;return o.setRelativeSelection(Of.on(t.first,0),n(t.table)),r.clear(e),bd(O.none(),!0)})},function(t){return O.some(bd(O.none(),!0))})}};return xm(d)&&m?n([Tm(1,0)]):wm(d)&&m?n([Tm(-1,0)]):l.isBackward(d)&&m?n([Tm(0,-1),Tm(-1,0)]):l.isForward(d)&&m?n([Tm(0,1),Tm(1,0)]):Cm(d)&&!m?i:O.none})()},keyup:function(t,o,i,u,a){return sr(e,r.selectedSelector).fold(function(){var c=t.raw,s=c.which;return!0===c.shiftKey&&Cm(s)?function(t,e,n,r,o,i,u){return Tt(n,o)&&r===i?O.none():_e(n,"td,th",e).bind(function(n){return _e(o,"td,th",e).bind(function(r){return Cd(t,e,n,r,u)})})}(e,n,o,i,u,a,r.selectRange):O.none()},O.none)}}},Dm=function(t,e,n,r){var o=Om(t);return function(t,i){r.clearBeforeUpdate(e),cr(t,i,n).each(function(t){var n=t.boxes.getOr([]);r.selectRange(e,n,t.start,t.finish),o.selectContents(i),o.collapseSelection()})}},Am=function(t,e){z(e,function(e){!function(t,e){Su(t)?t.dom.classList.remove(e):Ou(t,e);_u(t)}(t,e)})},Nm={byClass:function(t){var e,n,r=(e=t.selected,function(t){Tu(t,e)}),o=(n=[t.selected,t.lastSelected,t.firstSelected],function(t){Am(t,n)}),i=function(e){var n=xe(e,t.selectedSelector);z(n,o)};return{clearBeforeUpdate:i,clear:i,selectRange:function(e,n,o,u){i(e),z(n,r),Tu(o,t.firstSelected),Tu(u,t.lastSelected)},selectedSelector:t.selectedSelector,firstSelectedSelector:t.firstSelectedSelector,lastSelectedSelector:t.lastSelectedSelector}},byAttr:function(t,e,n){var r=function(e){ze(e,t.selected),ze(e,t.firstSelected),ze(e,t.lastSelected)},o=function(e){De(e,t.selected,"1")},i=function(t){u(t),n()},u=function(e){var n=xe(e,t.selectedSelector+","+t.firstSelectedSelector+","+t.lastSelectedSelector);z(n,r)};return{clearBeforeUpdate:u,clear:i,selectRange:function(n,r,u,a){i(n),z(r,o),De(u,t.firstSelected,"1"),De(a,t.lastSelected,"1"),e(r,u,a)},selectedSelector:t.selectedSelector,firstSelectedSelector:t.firstSelectedSelector,lastSelectedSelector:t.lastSelectedSelector}}},Mm=function(t,e,n){var r=_n.fromTable(t);return yc(r,e).map(function(t){var e=mc(r,n,!1);return{upOrLeftCells:function(t,e){var n=t.slice(0,e[e.length-1].row+1),r=gc(n);return V(r,function(t){var n=t.cells.slice(0,e[e.length-1].column+1);return M(n,function(t){return t.element})})}(e,t),downOrRightCells:function(t,e){var n=t.slice(e[0].row+e[0].rowspan-1,t.length),r=gc(n);return V(r,function(t){var n=t.cells.slice(e[0].column+e[0].colspan-1,t.cells.length);return M(n,function(t){return t.element})})}(e,t)}})},zm=tinymce.util.Tools.resolve("tinymce.Env"),Rm=function(t){return!1===Eu(Ct.fromDom(t.target),"ephox-snooker-resizer-bar")};function Bm(t,e,n){var r=Nm.byAttr(yi,function(e,r,o){n.targets().each(function(n){un(r).each(function(i){var u=Da(t),a=ci(d,Ct.fromDom(t.getDoc()),u),c=Mm(i,n,a);ta(t,e,r,o,c)})})},function(){return ea(t)});return t.on("init",function(n){var o=t.getWin(),i=fi(t),u=gi(t),a=_m(o,i,u,r),c=Em(o,i,u,r),s=Dm(o,i,u,r);t.on("TableSelectorChange",function(t){return s(t.start,t.finish)});var l,f,m=function(e,n){(function(t){return!0===t.raw.shiftKey})(e)&&(n.kill&&e.kill(),n.selection.each(function(e){var n=_f.relative(e.start,e.finish),r=Pf(o,n);t.selection.setRng(r)}))},g=function(t){return 0===t.button},h=(l=Dl(Ct.fromDom(i)),f=Dl(0),{touchEnd:function(t){var e=Ct.fromDom(t.target);if("td"===Gt(e)||"th"===Gt(e)){var n=l.get(),r=f.get();Tt(n,e)&&t.timeStamp-r<300&&(t.preventDefault(),s(e,e))}l.set(e),f.set(t.timeStamp)}});t.on("dragstart",function(t){a.clearstate()}),t.on("mousedown",function(t){g(t)&&Rm(t)&&a.mousedown(xu(t))}),t.on("mouseover",function(t){var e;(void 0===(e=t).buttons||zm.browser.isEdge()&&0===e.buttons||0!=(1&e.buttons))&&Rm(t)&&a.mouseover(xu(t))}),t.on("mouseup",function(t){g(t)&&Rm(t)&&a.mouseup(xu(t))}),t.on("touchend",h.touchEnd),t.on("keyup",function(e){var n=xu(e);if(n.raw.shiftKey&&Cm(n.raw.which)){var r=t.selection.getRng(),o=Ct.fromDom(r.startContainer),i=Ct.fromDom(r.endContainer);c.keyup(n,o,r.startOffset,i,r.endOffset).each(function(t){m(n,t)})}}),t.on("keydown",function(n){var r=xu(n);e().each(function(t){return t.hideBars()});var o=t.selection.getRng(),i=Ct.fromDom(o.startContainer),u=Ct.fromDom(o.endContainer),a=Vr(Sm,km)(Ct.fromDom(t.selection.getStart()));c.keydown(r,i,o.startOffset,u,o.endOffset,a).each(function(t){m(r,t)}),e().each(function(t){return t.showBars()})}),t.on("NodeChange",function(){var e=t.selection,n=Ct.fromDom(e.getStart()),o=Ct.fromDom(e.getEnd());ur(un,[n,o]).fold(function(){return r.clear(i)},d)})}),{clear:r.clear}}var Lm=function(t,e){var n=Dl(O.none()),r=Dl([]),o=O.none(),i=ee("caption"),u=function(t){return o.forall(function(e){return!e[t]})},a=function(){return Ci(function(t){return Ct.fromDom(t.selection.getEnd())}(t),gi(t))},c=function(){return Ci(vi(t),gi(t)).bind(function(t){return Pe(un(t),a().bind(un),function(n,r){return Tt(n,r)?i(t)?O.some({element:o=t,mergable:O.none(),unmergable:O.none(),selection:[o]}):O.some(wi(e,n,t)):O.none();var o}).bind(g)})},s=function(t){return un(t.element).map(function(e){var n=_n.fromTable(e),r=yc(n,t).getOr([]),o=P(r,function(t,e){return e.isLocked&&(t.onAny=!0,0===e.column?t.onFirst=!0:e.column+e.colspan>=n.grid.columns&&(t.onLast=!0)),t},{onAny:!1,onFirst:!1,onLast:!1});return{mergeable:Cc(n,t).isSome(),unmergeable:Sc(n,t).isSome(),locked:o}})},l=function(){n.set(J(c)()),o=n.get().bind(s),z(r.get(),function(t){return t()})},f=function(t){return t(),r.set(r.get().concat([t])),function(){r.set(B(r.get(),function(e){return e!==t}))}},d=function(t,e){return f(function(){return n.get().fold(function(){t.setDisabled(!0)},function(n){t.setDisabled(e(n))})})},m=function(t,e,r){return f(function(){return n.get().fold(function(){t.setDisabled(!0),t.setActive(!1)},function(n){t.setDisabled(e(n)),t.setActive(r(n))})})},h=function(t){return o.exists(function(e){return e.locked[t]})},p=function(e,n){return function(r){return m(r,function(t){return i(t.element)},function(){return t.queryCommandValue(e)===n})}},v=p("mceTableRowType","header"),b=p("mceTableColType","th");return t.on("NodeChange ExecCommand TableSelectorChange",l),{onSetupTable:function(t){return d(t,function(t){return!1})},onSetupCellOrRow:function(t){return d(t,function(t){return i(t.element)})},onSetupColumn:function(t){return function(e){return d(e,function(e){return i(e.element)||h(t)})}},onSetupPasteable:function(t){return function(e){return d(e,function(e){return i(e.element)||t().isNone()})}},onSetupPasteableColumn:function(t,e){return function(n){return d(n,function(n){return i(n.element)||t().isNone()||h(e)})}},onSetupMergeable:function(t){return d(t,function(t){return u("mergeable")})},onSetupUnmergeable:function(t){return d(t,function(t){return u("unmergeable")})},resetTargets:l,onSetupTableWithCaption:function(e){return m(e,w,function(e){return un(e.element,gi(t)).exists(function(t){return Oe(t,"caption").isSome()})})},onSetupTableRowHeaders:v,onSetupTableColumnHeaders:b,targets:n.get}},Pm=function(t){var e,n,r,o,i,u=(e=function(){return fi(t)},n=function(){return Si(vi(t),gi(t))},r=yi.selectedSelector,{get:function(){return dr(e(),r).fold(function(){return n().fold(vr,yr)},function(t){return br(t)})}}),a=Lm(t,u),c=Ia(t),s=Bm(t,c.lazyResize,a),l=tl(t,s,c.lazyWire),f=(o=Nl(),i=Nl(),{getRows:o.get,setRows:function(t){t.fold(o.clear,o.set),i.clear()},clearRows:o.clear,getColumns:i.get,setColumns:function(t){t.fold(i.clear,i.set),o.clear()},clearColumns:i.clear});return hf(t,l,0,u,f),function(t,e,n){var r=gi(t),o=function(e){return Si(vi(t)).bind(function(t){return un(t,r).map(function(r){var o=wi(n,r,t);return e(r,o)})}).getOr("")};Mt({mceTableRowType:function(){return o(e.getTableRowType)},mceTableCellType:function(){return o(e.getTableCellType)},mceTableColType:function(){return o(e.getTableColType)}},function(e,n){return t.addQueryValueHandler(n,e)})}(t,l,u),Oi(t,u,l),function(t,e,n,r){var o=function(e){return function(){return t.execCommand(e)}},i=function(e){t.execCommand("mceInsertTable",!1,{rows:e.numRows,columns:e.numColumns})},u={text:"Table properties",onSetup:n.onSetupTable,onAction:o("mceTableProps")},a={text:"Delete table",icon:"table-delete-table",onSetup:n.onSetupTable,onAction:o("mceTableDelete")};t.ui.registry.addMenuItem("tableinsertrowbefore",{text:"Insert row before",icon:"table-insert-row-above",onAction:o("mceTableInsertRowBefore"),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuItem("tableinsertrowafter",{text:"Insert row after",icon:"table-insert-row-after",onAction:o("mceTableInsertRowAfter"),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuItem("tabledeleterow",{text:"Delete row",icon:"table-delete-row",onAction:o("mceTableDeleteRow"),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablerowprops",{text:"Row properties",icon:"table-row-properties",onAction:o("mceTableRowProps"),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablecutrow",{text:"Cut row",icon:"cut-row",onAction:o("mceTableCutRow"),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablecopyrow",{text:"Copy row",icon:"duplicate-row",onAction:o("mceTableCopyRow"),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablepasterowbefore",{text:"Paste row before",icon:"paste-row-before",onAction:o("mceTablePasteRowBefore"),onSetup:n.onSetupPasteable(r.getRows)}),t.ui.registry.addMenuItem("tablepasterowafter",{text:"Paste row after",icon:"paste-row-after",onAction:o("mceTablePasteRowAfter"),onSetup:n.onSetupPasteable(r.getRows)});var c={type:"nestedmenuitem",text:"Row",getSubmenuItems:m("tableinsertrowbefore tableinsertrowafter tabledeleterow tablerowprops | tablecutrow tablecopyrow tablepasterowbefore tablepasterowafter")};t.ui.registry.addMenuItem("tableinsertcolumnbefore",{text:"Insert column before",icon:"table-insert-column-before",onAction:o("mceTableInsertColBefore"),onSetup:n.onSetupColumn("onFirst")}),t.ui.registry.addMenuItem("tableinsertcolumnafter",{text:"Insert column after",icon:"table-insert-column-after",onAction:o("mceTableInsertColAfter"),onSetup:n.onSetupColumn("onLast")}),t.ui.registry.addMenuItem("tabledeletecolumn",{text:"Delete column",icon:"table-delete-column",onAction:o("mceTableDeleteCol"),onSetup:n.onSetupColumn("onAny")}),t.ui.registry.addMenuItem("tablecutcolumn",{text:"Cut column",icon:"cut-column",onAction:o("mceTableCutCol"),onSetup:n.onSetupColumn("onAny")}),t.ui.registry.addMenuItem("tablecopycolumn",{text:"Copy column",icon:"duplicate-column",onAction:o("mceTableCopyCol"),onSetup:n.onSetupColumn("onAny")}),t.ui.registry.addMenuItem("tablepastecolumnbefore",{text:"Paste column before",icon:"paste-column-before",onAction:o("mceTablePasteColBefore"),onSetup:n.onSetupPasteableColumn(r.getColumns,"onFirst")}),t.ui.registry.addMenuItem("tablepastecolumnafter",{text:"Paste column after",icon:"paste-column-after",onAction:o("mceTablePasteColAfter"),onSetup:n.onSetupPasteableColumn(r.getColumns,"onLast")});var s={type:"nestedmenuitem",text:"Column",getSubmenuItems:m("tableinsertcolumnbefore tableinsertcolumnafter tabledeletecolumn | tablecutcolumn tablecopycolumn tablepastecolumnbefore tablepastecolumnafter")};t.ui.registry.addMenuItem("tablecellprops",{text:"Cell properties",icon:"table-cell-properties",onAction:o("mceTableCellProps"),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablemergecells",{text:"Merge cells",icon:"table-merge-cells",onAction:o("mceTableMergeCells"),onSetup:n.onSetupMergeable}),t.ui.registry.addMenuItem("tablesplitcells",{text:"Split cell",icon:"table-split-cells",onAction:o("mceTableSplitCells"),onSetup:n.onSetupUnmergeable});var l={type:"nestedmenuitem",text:"Cell",getSubmenuItems:m("tablecellprops tablemergecells tablesplitcells")};!1===function(t){return t.getParam("table_grid",!0,"boolean")}(t)?t.ui.registry.addMenuItem("inserttable",{text:"Table",icon:"table",onAction:o("mceInsertTable")}):t.ui.registry.addNestedMenuItem("inserttable",{text:"Table",icon:"table",getSubmenuItems:function(){return[{type:"fancymenuitem",fancytype:"inserttable",onAction:i}]}}),t.ui.registry.addMenuItem("inserttabledialog",{text:"Insert table",icon:"table",onAction:o("mceInsertTable")}),t.ui.registry.addMenuItem("tableprops",u),t.ui.registry.addMenuItem("deletetable",a),t.ui.registry.addNestedMenuItem("row",c),t.ui.registry.addNestedMenuItem("column",s),t.ui.registry.addNestedMenuItem("cell",l),t.ui.registry.addContextMenu("table",{update:function(){return n.resetTargets(),n.targets().fold(m(""),function(t){return"caption"===Gt(t.element)?"tableprops deletetable":"cell row column | advtablesort | tableprops deletetable"})}});var f=Pl(xa(t));0!==f.length&&t.ui.registry.addNestedMenuItem("tableclass",{icon:"table-classes",text:"Table styles",getSubmenuItems:function(){return Bl(t,e,f,"tableclass",function(e){return t.execCommand("mceTableToggleClass",!1,e)})},onSetup:n.onSetupTable});var d=Pl(wa(t));0!==d.length&&t.ui.registry.addNestedMenuItem("tablecellclass",{icon:"table-cell-classes",text:"Cell styles",getSubmenuItems:function(){return Bl(t,e,d,"tablecellclass",function(e){return t.execCommand("mceTableCellToggleClass",!1,e)})},onSetup:n.onSetupCellOrRow}),t.ui.registry.addNestedMenuItem("tablecellvalign",{icon:"vertical-align",text:"Vertical align",getSubmenuItems:function(){return Bl(t,e,vl,"tablecellverticalalign",Ll(t,"vertical-align"))},onSetup:n.onSetupCellOrRow}),t.ui.registry.addNestedMenuItem("tablecellborderwidth",{icon:"border-width",text:"Border width",getSubmenuItems:function(){return Bl(t,e,da(t),"tablecellborderwidth",Ll(t,"border-width"))},onSetup:n.onSetupCellOrRow}),t.ui.registry.addNestedMenuItem("tablecellborderstyle",{icon:"border-style",text:"Border style",getSubmenuItems:function(){return Bl(t,e,ma(t),"tablecellborderstyle",Ll(t,"border-style"))},onSetup:n.onSetupCellOrRow}),t.ui.registry.addToggleMenuItem("tablecaption",{icon:"table-caption",text:"Table caption",onAction:o("mceTableToggleCaption"),onSetup:n.onSetupTableWithCaption}),t.ui.registry.addNestedMenuItem("tablecellbackgroundcolor",{icon:"cell-background-color",text:"Background color",getSubmenuItems:function(){return Il(t,Aa(t),"background-color")},onSetup:n.onSetupCellOrRow}),t.ui.registry.addNestedMenuItem("tablecellbordercolor",{icon:"cell-border-color",text:"Border color",getSubmenuItems:function(){return Il(t,Na(t),"border-color")},onSetup:n.onSetupCellOrRow}),t.ui.registry.addToggleMenuItem("tablerowheader",{text:"Row header",icon:"table-top-header",onAction:Fl(t),onSetup:n.onSetupTableRowHeaders}),t.ui.registry.addToggleMenuItem("tablecolheader",{text:"Column header",icon:"table-left-header",onAction:Vl(t),onSetup:n.onSetupTableColumnHeaders})}(t,u,a,f),function(t,e,n,r){t.ui.registry.addMenuButton("table",{tooltip:"Table",icon:"table",fetch:function(t){return t("inserttable | cell row column | advtablesort | tableprops deletetable")}});var o=function(e){return function(){return t.execCommand(e)}};t.ui.registry.addButton("tableprops",{tooltip:"Table properties",onAction:o("mceTableProps"),icon:"table",onSetup:n.onSetupTable}),t.ui.registry.addButton("tabledelete",{tooltip:"Delete table",onAction:o("mceTableDelete"),icon:"table-delete-table",onSetup:n.onSetupTable}),t.ui.registry.addButton("tablecellprops",{tooltip:"Cell properties",onAction:o("mceTableCellProps"),icon:"table-cell-properties",onSetup:n.onSetupCellOrRow}),t.ui.registry.addButton("tablemergecells",{tooltip:"Merge cells",onAction:o("mceTableMergeCells"),icon:"table-merge-cells",onSetup:n.onSetupMergeable}),t.ui.registry.addButton("tablesplitcells",{tooltip:"Split cell",onAction:o("mceTableSplitCells"),icon:"table-split-cells",onSetup:n.onSetupUnmergeable}),t.ui.registry.addButton("tableinsertrowbefore",{tooltip:"Insert row before",onAction:o("mceTableInsertRowBefore"),icon:"table-insert-row-above",onSetup:n.onSetupCellOrRow}),t.ui.registry.addButton("tableinsertrowafter",{tooltip:"Insert row after",onAction:o("mceTableInsertRowAfter"),icon:"table-insert-row-after",onSetup:n.onSetupCellOrRow}),t.ui.registry.addButton("tabledeleterow",{tooltip:"Delete row",onAction:o("mceTableDeleteRow"),icon:"table-delete-row",onSetup:n.onSetupCellOrRow}),t.ui.registry.addButton("tablerowprops",{tooltip:"Row properties",onAction:o("mceTableRowProps"),icon:"table-row-properties",onSetup:n.onSetupCellOrRow}),t.ui.registry.addButton("tableinsertcolbefore",{tooltip:"Insert column before",onAction:o("mceTableInsertColBefore"),icon:"table-insert-column-before",onSetup:n.onSetupColumn("onFirst")}),t.ui.registry.addButton("tableinsertcolafter",{tooltip:"Insert column after",onAction:o("mceTableInsertColAfter"),icon:"table-insert-column-after",onSetup:n.onSetupColumn("onLast")}),t.ui.registry.addButton("tabledeletecol",{tooltip:"Delete column",onAction:o("mceTableDeleteCol"),icon:"table-delete-column",onSetup:n.onSetupColumn("onAny")}),t.ui.registry.addButton("tablecutrow",{tooltip:"Cut row",icon:"cut-row",onAction:o("mceTableCutRow"),onSetup:n.onSetupCellOrRow}),t.ui.registry.addButton("tablecopyrow",{tooltip:"Copy row",icon:"duplicate-row",onAction:o("mceTableCopyRow"),onSetup:n.onSetupCellOrRow}),t.ui.registry.addButton("tablepasterowbefore",{tooltip:"Paste row before",icon:"paste-row-before",onAction:o("mceTablePasteRowBefore"),onSetup:n.onSetupPasteable(r.getRows)}),t.ui.registry.addButton("tablepasterowafter",{tooltip:"Paste row after",icon:"paste-row-after",onAction:o("mceTablePasteRowAfter"),onSetup:n.onSetupPasteable(r.getRows)}),t.ui.registry.addButton("tablecutcol",{tooltip:"Cut column",icon:"cut-column",onAction:o("mceTableCutCol"),onSetup:n.onSetupColumn("onAny")}),t.ui.registry.addButton("tablecopycol",{tooltip:"Copy column",icon:"duplicate-column",onAction:o("mceTableCopyCol"),onSetup:n.onSetupColumn("onAny")}),t.ui.registry.addButton("tablepastecolbefore",{tooltip:"Paste column before",icon:"paste-column-before",onAction:o("mceTablePasteColBefore"),onSetup:n.onSetupPasteableColumn(r.getColumns,"onFirst")}),t.ui.registry.addButton("tablepastecolafter",{tooltip:"Paste column after",icon:"paste-column-after",onAction:o("mceTablePasteColAfter"),onSetup:n.onSetupPasteableColumn(r.getColumns,"onLast")}),t.ui.registry.addButton("tableinsertdialog",{tooltip:"Insert table",onAction:o("mceInsertTable"),icon:"table"});var i=Pl(xa(t));0!==i.length&&t.ui.registry.addMenuButton("tableclass",{icon:"table-classes",tooltip:"Table styles",fetch:Hl(t,e,i,"tableclass",function(e){return t.execCommand("mceTableToggleClass",!1,e)}),onSetup:n.onSetupTable});var u=Pl(wa(t));0!==u.length&&t.ui.registry.addMenuButton("tablecellclass",{icon:"table-cell-classes",tooltip:"Cell styles",fetch:Hl(t,e,u,"tablecellclass",function(e){return t.execCommand("mceTableCellToggleClass",!1,e)}),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuButton("tablecellvalign",{icon:"vertical-align",tooltip:"Vertical align",fetch:Hl(t,e,vl,"tablecellverticalalign",Ll(t,"vertical-align")),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuButton("tablecellborderwidth",{icon:"border-width",tooltip:"Border width",fetch:Hl(t,e,da(t),"tablecellborderwidth",Ll(t,"border-width")),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuButton("tablecellborderstyle",{icon:"border-style",tooltip:"Border style",fetch:Hl(t,e,ma(t),"tablecellborderstyle",Ll(t,"border-style")),onSetup:n.onSetupCellOrRow}),t.ui.registry.addToggleButton("tablecaption",{tooltip:"Table caption",onAction:o("mceTableToggleCaption"),icon:"table-caption",onSetup:n.onSetupTableWithCaption}),t.ui.registry.addMenuButton("tablecellbackgroundcolor",{icon:"cell-background-color",tooltip:"Background color",fetch:function(e){return e(Il(t,Aa(t),"background-color"))},onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuButton("tablecellbordercolor",{icon:"cell-border-color",tooltip:"Border color",fetch:function(e){return e(Il(t,Na(t),"border-color"))},onSetup:n.onSetupCellOrRow}),t.ui.registry.addToggleButton("tablerowheader",{tooltip:"Row header",icon:"table-top-header",onAction:Fl(t),onSetup:n.onSetupTableRowHeaders}),t.ui.registry.addToggleButton("tablecolheader",{tooltip:"Column header",icon:"table-left-header",onAction:Vl(t),onSetup:n.onSetupTableColumnHeaders})}(t,u,a,f),function(t){var e=function(t){return t.getParam("table_toolbar","tableprops tabledelete | tableinsertrowbefore tableinsertrowafter tabledeleterow | tableinsertcolbefore tableinsertcolafter tabledeletecol")}(t);e.length>0&&t.ui.registry.addContextToolbar("table",{predicate:function(e){return t.dom.is(e,"table")&&t.getBody().contains(e)},items:e,scope:"node",position:"node"})}(t),t.on("PreInit",function(){t.serializer.addTempAttr(yi.firstSelected),t.serializer.addTempAttr(yi.lastSelected),function(t){t.formatter.register(bf)}(t)}),function(t){return t.getParam("table_tab_navigation",!0,"boolean")}(t)&&t.on("keydown",function(e){!function(t,e,n){if(t.keyCode===md.TAB){var r=fi(e),o=function(t){var e=Gt(t);return Tt(t,r)||D(vd,e)},i=e.selection.getRng(),u=Ct.fromDom(t.shiftKey?i.startContainer:i.endContainer);nn(u,o).each(function(r){t.preventDefault(),un(r,o).each(n.clear),e.selection.collapse(t.shiftKey),(t.shiftKey?hd:gd)(e,o,r).each(function(t){e.selection.setRng(t)})})}}(e,t,s)}),t.on("remove",function(){c.destroy()}),sl(t,f,c,a)};wr.add("table",Pm)}()},HaK5:function(t,e,n){n("I7le")},I7le:function(t,e){!function(){"use strict";var t,e,n,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=function(){return(o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},i=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},u=function(t){return function(e){return typeof e===t}},a=i("string"),c=i("object"),s=i("array"),l=(t=null,function(e){return t===e}),f=u("boolean"),d=function(t){return!function(t){return null===t||void 0===t}(t)},m=u("function"),g=u("number"),h=function(){},p=function(t){return function(){return t}},v=function(t){return t},b=p(!1),y=p(!0),w=function(){return x},x={fold:function(t,e){return t()},isSome:b,isNone:y,getOr:n=v,getOrThunk:e=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:p(null),getOrUndefined:p(void 0),or:n,orThunk:e,map:w,each:h,bind:w,exists:b,forall:y,filter:function(){return w()},toArray:function(){return[]},toString:p("none()")},C=function(t){var e=p(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},isSome:y,isNone:b,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return C(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:x},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},S={some:C,none:w,from:function(t){return null===t||void 0===t?x:C(t)}},k=Object.keys,O=Object.hasOwnProperty,T=function(t,e,n,r){return function(t,e){for(var n=k(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}}(t,function(t,o){(e(t,o)?n:r)(t,o)}),{}},_=function(t,e){return O.call(t,e)},E=Array.prototype.push,D=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!s(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);E.apply(e,t[n])}return e},A=function(t){return function(t,e){return e>=0&&e<t.length?S.some(t[e]):S.none()}(t,0)};"undefined"!=typeof window?window:Function("return this;")();var N,M=function(t,e,n){!function(t,e,n){if(!(a(n)||f(n)||g(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")}(t.dom,e,n)},z=function(t){if(null===t||void 0===t)throw new Error("Node cannot be null or undefined");return{dom:t}},R={fromHtml:function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return z(n.childNodes[0])},fromTag:function(t,e){var n=(e||document).createElement(t);return z(n)},fromText:function(t,e){var n=(e||document).createTextNode(t);return z(n)},fromDom:z,fromPoint:function(t,e,n){return S.from(t.dom.elementFromPoint(e,n)).map(z)}},B=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),L=tinymce.util.Tools.resolve("tinymce.util.Promise"),P=tinymce.util.Tools.resolve("tinymce.util.URI"),H=tinymce.util.Tools.resolve("tinymce.util.XHR"),I=function(t){return t.getParam("image_dimensions",!0,"boolean")},F=function(t,e){return Math.max(parseInt(t,10),parseInt(e,10))},V=function(t){return t&&(t=t.replace(/px$/,"")),t},U=function(t){return t.length>0&&/^[0-9]+$/.test(t)&&(t+="px"),t},j=function(t){if(t.margin){var e=String(t.margin).split(" ");switch(e.length){case 1:t["margin-top"]=t["margin-top"]||e[0],t["margin-right"]=t["margin-right"]||e[0],t["margin-bottom"]=t["margin-bottom"]||e[0],t["margin-left"]=t["margin-left"]||e[0];break;case 2:t["margin-top"]=t["margin-top"]||e[0],t["margin-right"]=t["margin-right"]||e[1],t["margin-bottom"]=t["margin-bottom"]||e[0],t["margin-left"]=t["margin-left"]||e[1];break;case 3:t["margin-top"]=t["margin-top"]||e[0],t["margin-right"]=t["margin-right"]||e[1],t["margin-bottom"]=t["margin-bottom"]||e[2],t["margin-left"]=t["margin-left"]||e[1];break;case 4:t["margin-top"]=t["margin-top"]||e[0],t["margin-right"]=t["margin-right"]||e[1],t["margin-bottom"]=t["margin-bottom"]||e[2],t["margin-left"]=t["margin-left"]||e[3]}delete t.margin}return t},W=function(t){return"IMG"===t.nodeName&&(t.hasAttribute("data-mce-object")||t.hasAttribute("data-mce-placeholder"))},q=function(t,e){return P.isDomSafe(e,"img",t.settings)},$=B.DOM,G=function(t){return t.style.marginLeft&&t.style.marginRight&&t.style.marginLeft===t.style.marginRight?V(t.style.marginLeft):""},K=function(t){return t.style.marginTop&&t.style.marginBottom&&t.style.marginTop===t.style.marginBottom?V(t.style.marginTop):""},X=function(t){return t.style.borderWidth?V(t.style.borderWidth):""},Y=function(t,e){return t.hasAttribute(e)?t.getAttribute(e):""},J=function(t,e){return t.style[e]?t.style[e]:""},Q=function(t){return null!==t.parentNode&&"FIGURE"===t.parentNode.nodeName},Z=function(t,e,n){""===n?t.removeAttribute(e):t.setAttribute(e,n)},tt=function(t){Q(t)?function(t){var e=t.parentNode;$.insertAfter(t,e),$.remove(e)}(t):function(t){var e=$.create("figure",{class:"image"});$.insertAfter(e,t),e.appendChild(t),e.appendChild($.create("figcaption",{contentEditable:"true"},"Caption")),e.contentEditable="false"}(t)},et=function(t,e){var n=t.getAttribute("style"),r=e(null!==n?n:"");r.length>0?(t.setAttribute("style",r),t.setAttribute("data-mce-style",r)):t.removeAttribute("style")},nt=function(t,e){return function(t,n,r){t.style[n]?(t.style[n]=U(r),et(t,e)):Z(t,n,r)}},rt=function(t,e){return t.style[e]?V(t.style[e]):Y(t,e)},ot=function(t,e){var n=U(e);t.style.marginLeft=n,t.style.marginRight=n},it=function(t,e){var n=U(e);t.style.marginTop=n,t.style.marginBottom=n},ut=function(t,e){var n=U(e);t.style.borderWidth=n},at=function(t,e){t.style.borderStyle=e},ct=function(t){return"FIGURE"===t.nodeName},st=function(t){return 0===$.getAttrib(t,"alt").length&&"presentation"===$.getAttrib(t,"role")},lt=function(t,e){var n=document.createElement("img");return Z(n,"style",e.style),(G(n)||""!==e.hspace)&&ot(n,e.hspace),(K(n)||""!==e.vspace)&&it(n,e.vspace),(X(n)||""!==e.border)&&ut(n,e.border),(function(t){return J(t,"borderStyle")}(n)||""!==e.borderStyle)&&at(n,e.borderStyle),t(n.getAttribute("style"))},ft=function(t,e){return{src:Y(e,"src"),alt:function(t){return st(t)?"":Y(t,"alt")}(e),title:Y(e,"title"),width:rt(e,"width"),height:rt(e,"height"),class:Y(e,"class"),style:t(Y(e,"style")),caption:Q(e),hspace:G(e),vspace:K(e),border:X(e),borderStyle:J(e,"borderStyle"),isDecorative:st(e)}},dt=function(t,e,n,r,o){n[r]!==e[r]&&o(t,r,n[r])},mt=function(t,e,n){if(n){$.setAttrib(t,"role","presentation");var r=R.fromDom(t);M(r,"alt","")}else{if(l(e)){r=R.fromDom(t);o="alt",r.dom.removeAttribute(o)}else{r=R.fromDom(t);M(r,"alt",e)}"presentation"===$.getAttrib(t,"role")&&$.setAttrib(t,"role","")}var o},gt=function(t,e){return function(n,r,o){t(n,o),et(n,e)}},ht=function(t,e,n){var r=ft(t,n);dt(n,r,e,"caption",function(t,e,n){return tt(t)}),dt(n,r,e,"src",Z),dt(n,r,e,"title",Z),dt(n,r,e,"width",nt(0,t)),dt(n,r,e,"height",nt(0,t)),dt(n,r,e,"class",Z),dt(n,r,e,"style",gt(function(t,e){return Z(t,"style",e)},t)),dt(n,r,e,"hspace",gt(ot,t)),dt(n,r,e,"vspace",gt(it,t)),dt(n,r,e,"border",gt(ut,t)),dt(n,r,e,"borderStyle",gt(at,t)),function(t,e,n){n.alt===e.alt&&n.isDecorative===e.isDecorative||mt(t,n.alt,n.isDecorative)}(n,r,e)},pt=function(t,e){var n=t.dom.styles.parse(e),r=j(n),o=t.dom.styles.parse(t.dom.styles.serialize(r));return t.dom.styles.serialize(o)},vt=function(t){var e=t.selection.getNode(),n=t.dom.getParent(e,"figure.image");return n?t.dom.select("img",n)[0]:e&&("IMG"!==e.nodeName||W(e))?null:e},bt=function(t,e){var n,r,o,i=t.dom,u=(n=t.schema.getTextBlockElements(),T(n,function(e,n){return!t.schema.isValidChild(n,"figure")},(r=o={},function(t,e){r[e]=t}),h),o),a=i.getParent(e.parentNode,function(t){return e=u,n=t.nodeName,_(e,n)&&void 0!==e[n]&&null!==e[n];var e,n},t.getBody());return a?i.split(a,e):e},yt=function(t,e){var n=function(t,e){var n=document.createElement("img");if(ht(t,o(o({},e),{caption:!1}),n),mt(n,e.alt,e.isDecorative),e.caption){var r=$.create("figure",{class:"image"});return r.appendChild(n),r.appendChild($.create("figcaption",{contentEditable:"true"},"Caption")),r.contentEditable="false",r}return n}(function(e){return pt(t,e)},e);t.dom.setAttrib(n,"data-mce-id","__mcenew"),t.focus(),t.selection.setContent(n.outerHTML);var r=t.dom.select('*[data-mce-id="__mcenew"]')[0];if(t.dom.setAttrib(r,"data-mce-id",null),ct(r)){var i=bt(t,r);t.selection.select(i)}else t.selection.select(r)},wt=function(t,e){var n=vt(t);if(ht(function(e){return pt(t,e)},e,n),function(t,e){t.dom.setAttrib(e,"src",e.getAttribute("src"))}(t,n),ct(n.parentNode)){var r=n.parentNode;bt(t,r),t.selection.select(n.parentNode)}else t.selection.select(n),function(t,e,n){var r=function(){n.onload=n.onerror=null,t.selection&&(t.selection.select(n),t.nodeChanged())};n.onload=function(){e.width||e.height||!I(t)||t.dom.setAttribs(n,{width:String(n.clientWidth),height:String(n.clientHeight)}),r()},n.onerror=r}(t,e,n)},xt=function(t,e){var n=vt(t);if(n){var r=ft(function(e){return pt(t,e)},n),i=o(o({},r),e),u=function(t,e){var n=e.src;return o(o({},e),{src:q(t,n)?n:""})}(t,i);i.src?wt(t,u):function(t,e){if(e){var n=t.dom.is(e.parentNode,"figure.image")?e.parentNode:e;t.dom.remove(n),t.focus(),t.nodeChanged(),t.dom.isEmpty(t.getBody())&&(t.setContent(""),t.selection.setCursorLocation())}}(t,n)}else e.src&&yt(t,o(o({},{src:"",alt:"",title:"",width:"",height:"",class:"",style:"",caption:!1,hspace:"",vspace:"",border:"",borderStyle:"",isDecorative:!1}),e))},Ct=(N=function(t,e){return c(t)&&c(e)?Ct(t,e):e},function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(0===t.length)throw new Error("Can't merge zero objects");for(var n={},r=0;r<t.length;r++){var o=t[r];for(var i in o)_(o,i)&&(n[i]=N(n[i],o[i]))}return n}),St=tinymce.util.Tools.resolve("tinymce.util.ImageUploader"),kt=tinymce.util.Tools.resolve("tinymce.util.Tools"),Ot=function(t){return a(t.value)?t.value:""},Tt=function(t,e){var n=[];return kt.each(t,function(t){var r=function(t){return a(t.text)?t.text:a(t.title)?t.title:""}(t);if(void 0!==t.menu){var o=Tt(t.menu,e);n.push({text:r,items:o})}else{var i=e(t);n.push({text:r,value:i})}}),n},_t=function(t){return void 0===t&&(t=Ot),function(e){return e?S.from(e).map(function(e){return Tt(e,t)}):S.none()}},Et=function(t,e){return function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return S.none()}(t,function(t){return function(t){return _(t,"items")}(t)?Et(t.items,e):t.value===e?S.some(t):S.none()})},Dt=_t,At=function(t){return _t(Ot)(t)},Nt=function(t,e){return t.bind(function(t){return Et(t,e)})},Mt=function(t){return{title:"Advanced",name:"advanced",items:[{type:"input",label:"Style",name:"style"},{type:"grid",columns:2,items:[{type:"input",label:"Vertical space",name:"vspace",inputMode:"numeric"},{type:"input",label:"Horizontal space",name:"hspace",inputMode:"numeric"},{type:"input",label:"Border width",name:"border",inputMode:"numeric"},{type:"listbox",name:"borderstyle",label:"Border style",items:[{text:"Select...",value:""},{text:"Solid",value:"solid"},{text:"Dotted",value:"dotted"},{text:"Dashed",value:"dashed"},{text:"Double",value:"double"},{text:"Groove",value:"groove"},{text:"Ridge",value:"ridge"},{text:"Inset",value:"inset"},{text:"Outset",value:"outset"},{text:"None",value:"none"},{text:"Hidden",value:"hidden"}]}]}]}},zt=function(t){var e=Dt(function(e){return t.convertURL(e.value||e.url,"src")}),n=new L(function(n){!function(t,e){var n=function(t){return t.getParam("image_list",!1)}(t);a(n)?H.send({url:n,success:function(t){e(JSON.parse(t))}}):m(n)?n(e):e(n)}(t,function(t){n(e(t).map(function(t){return D([[{text:"None",value:""}],t])}))})}),r=At(function(t){return t.getParam("image_class_list")}(t)),o=function(t){return t.getParam("image_advtab",!1,"boolean")}(t),i=function(t){return t.getParam("image_uploadtab",!0,"boolean")}(t),u=function(t){return d(t.getParam("images_upload_url"))}(t),c=function(t){return d(t.getParam("images_upload_handler"))}(t),s=function(t){var e=vt(t);return e?ft(function(e){return pt(t,e)},e):{src:"",alt:"",title:"",width:"",height:"",class:"",style:"",caption:!1,hspace:"",vspace:"",border:"",borderStyle:"",isDecorative:!1}}(t),l=function(t){return t.getParam("image_description",!0,"boolean")}(t),f=function(t){return t.getParam("image_title",!1,"boolean")}(t),g=I(t),h=function(t){return t.getParam("image_caption",!1,"boolean")}(t),p=function(t){return t.getParam("a11y_advanced_options",!1,"boolean")}(t),v=function(t){return t.getParam("automatic_uploads",!0,"boolean")}(t),b=S.some(function(t){return t.getParam("image_prepend_url","","string")}(t)).filter(function(t){return a(t)&&t.length>0});return n.then(function(t){return{image:s,imageList:t,classList:r,hasAdvTab:o,hasUploadTab:i,hasUploadUrl:u,hasUploadHandler:c,hasDescription:l,hasImageTitle:f,hasDimensions:g,hasImageCaption:h,prependURL:b,hasAccessibilityOptions:p,automaticUploads:v}})},Rt=function(t){var e,n=t.imageList.map(function(t){return{name:"images",type:"listbox",label:"Image list",items:t}}),r={name:"alt",type:"input",label:"Alternative description",disabled:t.hasAccessibilityOptions&&t.image.isDecorative},i=t.classList.map(function(t){return{name:"classes",type:"listbox",label:"Class",items:t}});return D([[{name:"src",type:"urlinput",filetype:"image",label:"Source"}],n.toArray(),t.hasAccessibilityOptions&&t.hasDescription?[{type:"label",label:"Accessibility",items:[{name:"isDecorative",type:"checkbox",label:"Image is decorative"}]}]:[],t.hasDescription?[r]:[],t.hasImageTitle?[{name:"title",type:"input",label:"Image title"}]:[],t.hasDimensions?[{name:"dimensions",type:"sizeinput"}]:[],[o(o({},(e=t.classList.isSome()&&t.hasImageCaption,e?{type:"grid",columns:2}:{type:"panel"})),{items:D([i.toArray(),t.hasImageCaption?[{type:"label",label:"Caption",items:[{type:"checkbox",name:"caption",label:"Show caption"}]}]:[]])})]])},Bt=function(t){return{title:"General",name:"general",items:Rt(t)}},Lt=Rt,Pt=function(t){return{title:"Upload",name:"upload",items:[{type:"dropzone",name:"fileinput"}]}},Ht=function(t){return{src:{value:t.src,meta:{}},images:t.src,alt:t.alt,title:t.title,dimensions:{width:t.width,height:t.height},classes:t.class,caption:t.caption,style:t.style,vspace:t.vspace,border:t.border,hspace:t.hspace,borderstyle:t.borderStyle,fileinput:[],isDecorative:t.isDecorative}},It=function(t,e){return{src:t.src.value,alt:0===t.alt.length&&e?null:t.alt,title:t.title,width:t.dimensions.width,height:t.dimensions.height,class:t.classes,style:t.style,caption:t.caption,hspace:t.hspace,vspace:t.vspace,border:t.border,borderStyle:t.borderstyle,isDecorative:t.isDecorative}},Ft=function(t,e){var n=e.getData();(function(t,e){return/^(?:[a-zA-Z]+:)?\/\//.test(e)?S.none():t.prependURL.bind(function(t){return e.substring(0,t.length)!==t?S.some(t+e):S.none()})})(t,n.src.value).each(function(t){e.setData({src:{value:t,meta:n.src.meta}})})},Vt=function(t,e){var n=e.getData(),r=n.src.meta;if(void 0!==r){var o=Ct({},n);!function(t,e,n){t.hasDescription&&a(n.alt)&&(e.alt=n.alt),t.hasAccessibilityOptions&&(e.isDecorative=n.isDecorative||e.isDecorative||!1),t.hasImageTitle&&a(n.title)&&(e.title=n.title),t.hasDimensions&&(a(n.width)&&(e.dimensions.width=n.width),a(n.height)&&(e.dimensions.height=n.height)),a(n.class)&&Nt(t.classList,n.class).each(function(t){e.classes=t.value}),t.hasImageCaption&&f(n.caption)&&(e.caption=n.caption),t.hasAdvTab&&(a(n.style)&&(e.style=n.style),a(n.vspace)&&(e.vspace=n.vspace),a(n.border)&&(e.border=n.border),a(n.hspace)&&(e.hspace=n.hspace),a(n.borderstyle)&&(e.borderstyle=n.borderstyle))}(t,o,r),e.setData(o)}},Ut=function(t,e,n,r){Ft(e,r),Vt(e,r),function(t,e,n,r){var o=r.getData(),i=o.src.value,u=o.src.meta||{};u.width||u.height||!e.hasDimensions||(i.length>0?t.imageSize(i).then(function(t){n.open&&r.setData({dimensions:t})}).catch(function(t){return console.error(t)}):r.setData({dimensions:{width:"",height:""}}))}(t,e,n,r),function(t,e,n){var r=n.getData(),o=Nt(t.imageList,r.src.value);e.prevImage=o,n.setData({images:o.map(function(t){return t.value}).getOr("")})}(e,n,r)},jt=function(t,e,n){var r=j(t(n.style)),o=Ct({},n);return o.vspace=function(t){return t["margin-top"]&&t["margin-bottom"]&&t["margin-top"]===t["margin-bottom"]?V(String(t["margin-top"])):""}(r),o.hspace=function(t){return t["margin-right"]&&t["margin-left"]&&t["margin-right"]===t["margin-left"]?V(String(t["margin-right"])):""}(r),o.border=function(t){return t["border-width"]?V(String(t["border-width"])):""}(r),o.borderstyle=function(t){return t["border-style"]?String(t["border-style"]):""}(r),o.style=function(t,e,n){return e(t(e(n)))}(t,e,r),o},Wt=function(t,e,n,r){var o=r.getData();r.block("Uploading image"),A(o.fileinput).fold(function(){r.unblock()},function(o){var i,u=URL.createObjectURL(o),a=function(){r.unblock(),URL.revokeObjectURL(u)},c=function(o){r.setData({src:{value:o,meta:{}}}),r.showTab("general"),Ut(t,e,n,r)};(i=o,new L(function(t,e){var n=new FileReader;n.onload=function(){t(n.result)},n.onerror=function(){e(n.error.message)},n.readAsDataURL(i)})).then(function(n){var i=t.createBlobCache(o,u,n);e.automaticUploads?t.uploadImage(i).then(function(t){c(t.url),a()}).catch(function(e){a(),t.alertErr(e)}):(t.addToBlobCache(i),c(i.blobUri()),r.unblock())})})},qt=function(t,e,n){return function(r,o){"src"===o.name?Ut(t,e,n,r):"images"===o.name?function(t,e,n,r){var o=r.getData(),i=Nt(e.imageList,o.images);i.each(function(t){""===o.alt||n.prevImage.map(function(t){return t.text===o.alt}).getOr(!1)?""===t.value?r.setData({src:t,alt:n.prevAlt}):r.setData({src:t,alt:t.text}):r.setData({src:t})}),n.prevImage=i,Ut(t,e,n,r)}(t,e,n,r):"alt"===o.name?n.prevAlt=r.getData().alt:"style"===o.name?function(t,e){var n=e.getData(),r=jt(t.parseStyle,t.serializeStyle,n);e.setData(r)}(t,r):"vspace"===o.name||"hspace"===o.name||"border"===o.name||"borderstyle"===o.name?function(t,e,n){var r=Ct(Ht(e.image),n.getData()),o=lt(t.normalizeCss,It(r,!1));n.setData({style:o})}(t,e,r):"fileinput"===o.name?Wt(t,e,n,r):"isDecorative"===o.name&&(r.getData().isDecorative?r.disable("alt"):r.enable("alt"))}},$t=function(t){return function(e){var n=function(t){return{prevImage:Nt(t.imageList,t.image.src),prevAlt:t.image.alt,open:!0}}(e);return{title:"Insert/Edit Image",size:"normal",body:function(t){return t.hasAdvTab||t.hasUploadUrl||t.hasUploadHandler?{type:"tabpanel",tabs:D([[Bt(t)],t.hasAdvTab?[Mt(t)]:[],t.hasUploadTab&&(t.hasUploadUrl||t.hasUploadHandler)?[Pt(t)]:[]])}:{type:"panel",items:Lt(t)}}(e),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:Ht(e.image),onSubmit:t.onSubmit(e),onChange:qt(t,e,n),onClose:function(t){return function(){t.open=!1}}(n)}}},Gt=function(t){return function(e){return q(t,e)?function(t){return new L(function(e){var n=document.createElement("img"),r=function(t){n.onload=n.onerror=null,n.parentNode&&n.parentNode.removeChild(n),e(t)};n.onload=function(){var t={width:F(n.width,n.clientWidth),height:F(n.height,n.clientHeight)};r(L.resolve(t))},n.onerror=function(){r(L.reject("Failed to get image dimensions for: "+t))};var o=n.style;o.visibility="hidden",o.position="fixed",o.bottom=o.left="0px",o.width=o.height="auto",document.body.appendChild(n),n.src=t})}(t.documentBaseURI.toAbsolute(e)).then(function(t){return{width:String(t.width),height:String(t.height)}}):L.resolve({width:"",height:""})}},Kt=function(t){var e={onSubmit:function(t){return function(e){return function(n){var r=Ct(Ht(e.image),n.getData());t.execCommand("mceUpdateImage",!1,It(r,e.hasAccessibilityOptions)),t.editorUpload.uploadImagesAuto(),n.close()}}}(t),imageSize:Gt(t),addToBlobCache:function(t){return function(e){t.editorUpload.blobCache.add(e)}}(t),createBlobCache:function(t){return function(e,n,r){return t.editorUpload.blobCache.create({blob:e,blobUri:n,name:e.name?e.name.replace(/\.[^\.]+$/,""):null,filename:e.name,base64:r.split(",")[1]})}}(t),alertErr:function(t){return function(e){t.windowManager.alert(e)}}(t),normalizeCss:function(t){return function(e){return pt(t,e)}}(t),parseStyle:function(t){return function(e){return t.dom.parseStyle(e)}}(t),serializeStyle:function(t){return function(e,n){return t.dom.serializeStyle(e,n)}}(t),uploadImage:function(t){return function(e){return St(t).upload([e],!1).then(function(t){return 0===t.length?L.reject("Failed to upload image"):!1===t[0].status?L.reject(t[0].error.message):t[0]})}}(t)};return{open:function(){zt(t).then($t(e)).then(t.windowManager.open)}}},Xt=function(t){t.addCommand("mceImage",Kt(t).open),t.addCommand("mceUpdateImage",function(e,n){t.undoManager.transact(function(){return xt(t,n)})})},Yt=function(t){var e=t.attr("class");return e&&/\bimage\b/.test(e)},Jt=function(t){return function(e){for(var n=e.length,r=function(e){e.attr("contenteditable",t?"true":null)};n--;){var o=e[n];Yt(o)&&(o.attr("contenteditable",t?"false":null),kt.each(o.getAll("figcaption"),r))}}},Qt=function(t){t.on("PreInit",function(){t.parser.addNodeFilter("figure",Jt(!0)),t.serializer.addNodeFilter("figure",Jt(!1))})},Zt=function(t){t.ui.registry.addToggleButton("image",{icon:"image",tooltip:"Insert/edit image",onAction:Kt(t).open,onSetup:function(e){return e.setActive(d(vt(t))),t.selection.selectorChangedWithUnbind("img:not([data-mce-object],[data-mce-placeholder]),figure.image",e.setActive).unbind}}),t.ui.registry.addMenuItem("image",{icon:"image",text:"Image...",onAction:Kt(t).open}),t.ui.registry.addContextMenu("image",{update:function(t){return ct(t)||"IMG"===t.nodeName&&!W(t)?["image"]:[]}})};r.add("image",function(t){Qt(t),Zt(t),Xt(t)})}()},L8UZ:function(t,e){!function(){"use strict";var t,e=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=function(t){return t},r=function(){return(r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},o="[-'\\.‘’․﹒'.]",i="[:··״‧︓﹕:]",u="[±+*/,;;։،؍٬߸⁄︐︔﹐﹔,;]",a="[0-9٠-٩٫۰-۹߀-߉०-९০-৯੦-੯૦-૯୦-୯௦-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩၀-၉႐-႙០-៩᠐-᠙᥆-᥏᧐-᧙᪀-᪉᪐-᪙᭐-᭙᮰-᮹᱀-᱉᱐-᱙꘠-꘩꣐-꣙꤀-꤉꧐-꧙꩐-꩙꯰-꯹]",c="\\r",s="\\n",l="[\v\f
\u2028\u2029]",f="[̀-ͯ҃-҉֑-ׇֽֿׁׂׅׄؐ-ًؚ-ٰٟۖ-ۜ۟-۪ۤۧۨ-ܑۭܰ-݊ަ-ް߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ऀ-ःऺ-़ा-ॏ॑-ॗॢॣঁ-ঃ়া-ৄেৈো-্ৗৢৣਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑੰੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୢୣஂா-ூெ-ைொ-்ௗఁ-ఃా-ౄె-ైొ-్ౕౖౢౣಂಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣംഃാ-ൄെ-ൈൊ-്ൗൢൣංඃ්ා-ුූෘ-ෟෲෳัิ-ฺ็-๎ັິ-ູົຼ່-ໍ༹༘༙༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏႚ-ႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳា-៓៝᠋-᠍ᢩᤠ-ᤫᤰ-᤻ᦰ-ᧀᧈᧉᨗ-ᨛᩕ-ᩞ᩠-᩿᩼ᬀ-ᬄ᬴-᭄᭫-᭳ᮀ-ᮂᮡ-᯦᮪-᯳ᰤ-᰷᳐-᳔᳒-᳨᳭ᳲ᷀-ᷦ᷼-᷿⃐-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꙯-꙲꙼꙽꛰꛱ꠂ꠆ꠋꠣ-ꠧꢀꢁꢴ-꣄꣠-꣱ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀ꨩ-ꨶꩃꩌꩍꩻꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꯣ-ꯪ꯬꯭ﬞ︀-️︠-゙゚︦]",d="[-឴឵---\ufeff-]",m="[〱-〵゛゜゠-ヺー-ヿㇰ-ㇿ㋐-㋾㌀-㍗ヲ-ン]",g="[=_‿⁀⁔︳︴﹍-﹏_∀-⋿<>]",h="[!-#%-*,-\\/:;?@\\[-\\]_{}¡«·»¿;·՚-՟։֊־׀׃׆׳״؉؊،؍؛؞؟٪-٭۔܀-܍߷-߹࠰-࠾࡞।॥॰෴๏๚๛༄-༒༺-༽྅࿐-࿔࿙࿚၊-၏჻፡-፨᐀᙭᙮᚛᚜᛫-᛭᜵᜶។-៖៘-៚᠀-᠊᥄᥅᨞᨟᪠-᪦᪨-᪭᭚-᭠᯼-᯿᰻-᰿᱾᱿᳓‐-‧‰-⁃⁅-⁑⁓-⁞⁽⁾₍₎〈〉❨-❵⟅⟆⟦-⟯⦃-⦘⧘-⧛⧼⧽⳹-⳼⳾⳿⵰⸀-⸮⸰⸱、-〃〈-】〔-〟〰〽゠・꓾꓿꘍-꘏꙳꙾꛲-꛷꡴-꡷꣎꣏꣸-꣺꤮꤯꥟꧁-꧍꧞꧟꩜-꩟꫞꫟꯫﴾﴿︐-︙︰-﹒﹔-﹡﹣﹨﹪﹫!-#%-*,-/:;?@[-]_{}⦅-・]",p=0,v=1,b=2,y=3,w=4,x=5,C=6,S=7,k=8,O=9,T=10,_=11,E=12,D=13,A=[new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-׳ؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆༀཀ-ཇཉ-ཬྈ-ྌႠ-Ⴥა-ჺჼᄀ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᨀ-ᨖᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᯀ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⒶ-ⓩⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⴀ-ⴥⴰ-ⵥⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々〻〼ㄅ-ㄭㄱ-ㆎㆠ-ㆺꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐꞑꞠ-ꞩꟺ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zᅠ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]"),new RegExp(o),new RegExp(i),new RegExp(u),new RegExp(a),new RegExp(c),new RegExp(s),new RegExp(l),new RegExp(f),new RegExp(d),new RegExp(m),new RegExp(g),new RegExp("@")],N=D,M=function(t){for(var e=N,n=A.length,r=0;r<n;++r){var o=A[r];if(o&&o.test(t)){e=r;break}}return e},z=function(t){var e,n;return function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r}(t,(e=M,n={},function(t){if(n[t])return n[t];var r=e(t);return n[t]=r,r}))},R=function(t,e){var n=t[e],r=t[e+1];if(e<0||e>t.length-1&&0!==e)return!1;if(n===p&&r===p)return!1;var o=t[e+2];if(n===p&&(r===b||r===v||r===E)&&o===p)return!1;var i=t[e-1];return(n!==b&&n!==v&&r!==E||r!==p||i!==p)&&((n!==w&&n!==p||r!==w&&r!==p)&&((n!==y&&n!==v||r!==w||i!==w)&&((n!==w||r!==y&&r!==v||o!==w)&&(n!==k&&n!==O&&i!==k&&i!==O&&r!==k&&r!==O&&((n!==x||r!==C)&&(n===S||n===x||n===C||(r===S||r===x||r===C||(n!==T||r!==T)&&((r!==_||n!==p&&n!==w&&n!==T&&n!==_)&&((n!==_||r!==p&&r!==w&&r!==T)&&n!==E)))))))))},B=/^\s+$/,L=new RegExp("^"+h+"$"),P=function(t){return"http"===t||"https"===t},H=function(t,e){var n=function(t,e){var n;for(n=e;n<t.length&&!B.test(t[n]);n++);return n}(t,e+1);return"://"===t.slice(e+1,n).join("").substr(0,3)?n:e},I=function(t,e,n){n=r(r({},{includeWhitespace:!1,includePunctuation:!1}),n);for(var o=[],i=[],u=0;u<t.length;u++){var a=e(t[u]);"\ufeff"!==a&&(o.push(t[u]),i.push(a))}return function(t,e,n,r){for(var o=[],i=[],u=0;u<n.length;++u)if(i.push(t[u]),R(n,u)){var a=e[u];if((r.includeWhitespace||!B.test(a))&&(r.includePunctuation||!L.test(a))){var c=u-i.length+1,s=u+1,l=e.slice(c,s).join("");if(P(l)){var f=H(e,u),d=t.slice(s,f);Array.prototype.push.apply(i,d),u=f}o.push(i)}i=[]}return o}(o,i,z(i),n)},F=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),V=function(t,e){for(var n=e.getBlockElements(),r=e.getShortEndedElements(),o=function(t){return n[t.nodeName]||r[t.nodeName]},i=[],u="",a=new F(t,t);t=a.next();)3===t.nodeType?u+=t.data.replace(/\uFEFF/g,""):o(t)&&u.length&&(i.push(u),u="");return u.length&&i.push(u),i},U=function(t){return t.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"_").length},j=function(t,e){var r=function(t){return t.replace(/\u200B/g,"")}(V(t,e).join("\n"));return I(r.split(""),n).length},W=function(t,e){var n=V(t,e).join("");return U(n)},q=function(t,e){var n=V(t,e).join("").replace(/\s/g,"");return U(n)},$=function(t,e){return function(){return e(t.getBody(),t.schema)}},G=function(t,e){return function(){return e(t.selection.getRng().cloneContents(),t.schema)}},K=function(t){return $(t,j)},X=function(t){return{body:{getWordCount:K(t),getCharacterCount:$(t,W),getCharacterCountWithoutSpaces:$(t,q)},selection:{getWordCount:G(t,j),getCharacterCount:G(t,W),getCharacterCountWithoutSpaces:G(t,q)},getCount:K(t)}},Y=function(t,e){t.addCommand("mceWordCount",function(){return function(t,e){t.windowManager.open({title:"Word Count",body:{type:"panel",items:[{type:"table",header:["Count","Document","Selection"],cells:[["Words",String(e.body.getWordCount()),String(e.selection.getWordCount())],["Characters (no spaces)",String(e.body.getCharacterCountWithoutSpaces()),String(e.selection.getCharacterCountWithoutSpaces())],["Characters",String(e.body.getCharacterCount()),String(e.selection.getCharacterCount())]]}]},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}]})}(t,e)})},J=tinymce.util.Tools.resolve("tinymce.util.Delay"),Q=function(t,e){!function(t,e){t.fire("wordCountUpdate",{wordCount:{words:e.body.getWordCount(),characters:e.body.getCharacterCount(),charactersWithoutSpaces:e.body.getCharacterCountWithoutSpaces()}})}(t,e)},Z=function(t,e,n){var r=J.debounce(function(){return Q(t,e)},n);t.on("init",function(){Q(t,e),J.setEditorTimeout(t,function(){t.on("SetContent BeforeAddUndo Undo Redo ViewUpdate keyup",r)},0)})},tt=function(t){var e=function(){return t.execCommand("mceWordCount")};t.ui.registry.addButton("wordcount",{tooltip:"Word count",icon:"character-count",onAction:e}),t.ui.registry.addMenuItem("wordcount",{text:"Word count",icon:"character-count",onAction:e})};void 0===t&&(t=300),e.add("wordcount",function(e){var n=X(e);return Y(e,n),tt(e),Z(e,n,t),n})}()},NBEC:function(t,e,n){n("m/OW")},"Q/P+":function(t,e,n){n("BzBW")},Rv7z:function(t,e,n){n("iTxg")},V9zC:function(t,e){!function(){"use strict";tinymce.util.Tools.resolve("tinymce.PluginManager").add("textcolor",function(){})}()},Vphg:function(t,e){tinymce.IconManager.add("default",{icons:{"accessibility-check":'<svg width="24" height="24"><path d="M12 2a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2c0-1.1.9-2 2-2zm8 7h-5v12c0 .6-.4 1-1 1a1 1 0 01-1-1v-5c0-.6-.4-1-1-1a1 1 0 00-1 1v5c0 .6-.4 1-1 1a1 1 0 01-1-1V9H4a1 1 0 110-2h16c.6 0 1 .4 1 1s-.4 1-1 1z" fill-rule="nonzero"/></svg>',"action-next":'<svg width="24" height="24"><path fill-rule="nonzero" d="M5.7 7.3a1 1 0 00-1.4 1.4l7.7 7.7 7.7-7.7a1 1 0 10-1.4-1.4L12 13.6 5.7 7.3z"/></svg>',"action-prev":'<svg width="24" height="24"><path fill-rule="nonzero" d="M18.3 15.7a1 1 0 001.4-1.4L12 6.6l-7.7 7.7a1 1 0 001.4 1.4L12 9.4l6.3 6.3z"/></svg>',"align-center":'<svg width="24" height="24"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 110-2zm3 4h8c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 110-2zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 010-2zm-3-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2z" fill-rule="evenodd"/></svg>',"align-justify":'<svg width="24" height="24"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 110-2zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 110-2zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2z" fill-rule="evenodd"/></svg>',"align-left":'<svg width="24" height="24"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 110-2zm0 4h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 110-2zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2zm0-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2z" fill-rule="evenodd"/></svg>',"align-none":'<svg width="24" height="24"><path d="M14.2 5L13 7H5a1 1 0 110-2h9.2zm4 0h.8a1 1 0 010 2h-2l1.2-2zm-6.4 4l-1.2 2H5a1 1 0 010-2h6.8zm4 0H19a1 1 0 010 2h-4.4l1.2-2zm-6.4 4l-1.2 2H5a1 1 0 010-2h4.4zm4 0H19a1 1 0 010 2h-6.8l1.2-2zM7 17l-1.2 2H5a1 1 0 010-2h2zm4 0h8a1 1 0 010 2H9.8l1.2-2zm5.2-13.5l1.3.7-9.7 16.3-1.3-.7 9.7-16.3z" fill-rule="evenodd"/></svg>',"align-right":'<svg width="24" height="24"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 110-2zm6 4h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm-6-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2z" fill-rule="evenodd"/></svg>',"arrow-left":'<svg width="24" height="24"><path d="M5.6 13l12 6a1 1 0 001.4-1V6a1 1 0 00-1.4-.9l-12 6a1 1 0 000 1.8z" fill-rule="evenodd"/></svg>',"arrow-right":'<svg width="24" height="24"><path d="M18.5 13l-12 6A1 1 0 015 18V6a1 1 0 011.4-.9l12 6a1 1 0 010 1.8z" fill-rule="evenodd"/></svg>',bold:'<svg width="24" height="24"><path d="M7.8 19c-.3 0-.5 0-.6-.2l-.2-.5V5.7c0-.2 0-.4.2-.5l.6-.2h5c1.5 0 2.7.3 3.5 1 .7.6 1.1 1.4 1.1 2.5a3 3 0 01-.6 1.9c-.4.6-1 1-1.6 1.2.4.1.9.3 1.3.6s.8.7 1 1.2c.4.4.5 1 .5 1.6 0 1.3-.4 2.3-1.3 3-.8.7-2.1 1-3.8 1H7.8zm5-8.3c.6 0 1.2-.1 1.6-.5.4-.3.6-.7.6-1.3 0-1.1-.8-1.7-2.3-1.7H9.3v3.5h3.4zm.5 6c.7 0 1.3-.1 1.7-.4.4-.4.6-.9.6-1.5s-.2-1-.7-1.4c-.4-.3-1-.4-2-.4H9.4v3.8h4z" fill-rule="evenodd"/></svg>',bookmark:'<svg width="24" height="24"><path d="M6 4v17l6-4 6 4V4c0-.6-.4-1-1-1H7a1 1 0 00-1 1z" fill-rule="nonzero"/></svg>',"border-style":'<svg width="24" height="24"><g fill-rule="evenodd"><rect width="18" height="2" x="3" y="6" rx="1"/><rect width="2.8" height="2" x="3" y="16" rx="1"/><rect width="2.8" height="2" x="6.8" y="16" rx="1"/><rect width="2.8" height="2" x="10.6" y="16" rx="1"/><rect width="2.8" height="2" x="14.4" y="16" rx="1"/><rect width="2.8" height="2" x="18.2" y="16" rx="1"/><rect width="8" height="2" x="3" y="11" rx="1"/><rect width="8" height="2" x="13" y="11" rx="1"/></g></svg>',"border-width":'<svg width="24" height="24"><g fill-rule="evenodd"><rect width="18" height="5" x="3" y="5" rx="1"/><rect width="18" height="3.5" x="3" y="11.5" rx="1"/><rect width="18" height="2" x="3" y="17" rx="1"/></g></svg>',brightness:'<svg width="24" height="24"><path d="M12 17c.3 0 .5.1.7.3.2.2.3.4.3.7v1c0 .3-.1.5-.3.7a1 1 0 01-.7.3 1 1 0 01-.7-.3 1 1 0 01-.3-.7v-1c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3zm0-10a1 1 0 01-.7-.3A1 1 0 0111 6V5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3.3 0 .5.1.7.3.2.2.3.4.3.7v1c0 .3-.1.5-.3.7a1 1 0 01-.7.3zm7 4c.3 0 .5.1.7.3.2.2.3.4.3.7 0 .3-.1.5-.3.7a1 1 0 01-.7.3h-1a1 1 0 01-.7-.3 1 1 0 01-.3-.7c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h1zM7 12c0 .3-.1.5-.3.7a1 1 0 01-.7.3H5a1 1 0 01-.7-.3A1 1 0 014 12c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h1c.3 0 .5.1.7.3.2.2.3.4.3.7zm10 3.5l.7.8c.2.1.3.4.3.6 0 .3-.1.6-.3.8a1 1 0 01-.8.3 1 1 0 01-.6-.3l-.8-.7a1 1 0 01-.3-.8c0-.2.1-.5.3-.7a1 1 0 011.4 0zm-10-7l-.7-.8a1 1 0 01-.3-.6c0-.3.1-.6.3-.8.2-.2.5-.3.8-.3.2 0 .5.1.7.3l.7.7c.2.2.3.5.3.8 0 .2-.1.5-.3.7a1 1 0 01-.7.3 1 1 0 01-.8-.3zm10 0a1 1 0 01-.8.3 1 1 0 01-.7-.3 1 1 0 01-.3-.7c0-.3.1-.6.3-.8l.8-.7c.1-.2.4-.3.6-.3.3 0 .6.1.8.3.2.2.3.5.3.8 0 .2-.1.5-.3.7l-.7.7zm-10 7c.2-.2.5-.3.8-.3.2 0 .5.1.7.3a1 1 0 010 1.4l-.8.8a1 1 0 01-.6.3 1 1 0 01-.8-.3 1 1 0 01-.3-.8c0-.2.1-.5.3-.6l.7-.8zM12 8a4 4 0 013.7 2.4 4 4 0 010 3.2A4 4 0 0112 16a4 4 0 01-3.7-2.4 4 4 0 010-3.2A4 4 0 0112 8zm0 6.5c.7 0 1.3-.2 1.8-.7.5-.5.7-1.1.7-1.8s-.2-1.3-.7-1.8c-.5-.5-1.1-.7-1.8-.7s-1.3.2-1.8.7c-.5.5-.7 1.1-.7 1.8s.2 1.3.7 1.8c.5.5 1.1.7 1.8.7z" fill-rule="evenodd"/></svg>',browse:'<svg width="24" height="24"><path d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2h-4v-2h4V8H5v10h4v2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm-8 9.4l-2.3 2.3a1 1 0 11-1.4-1.4l4-4a1 1 0 011.4 0l4 4a1 1 0 01-1.4 1.4L13 13.4V20a1 1 0 01-2 0v-6.6z" fill-rule="nonzero"/></svg>',cancel:'<svg width="24" height="24"><path d="M12 4.6a7.4 7.4 0 110 14.8 7.4 7.4 0 010-14.8zM12 3a9 9 0 100 18 9 9 0 000-18zm0 8L14.8 8l1 1.1-2.7 2.8 2.7 2.7-1.1 1.1-2.7-2.7-2.7 2.7-1-1.1 2.6-2.7-2.7-2.7 1-1.1 2.8 2.7z" fill-rule="nonzero"/></svg>',"cell-background-color":'<svg width="24" height="24"><path d="M15.7 2l1.6 1.6-2.7 2.6 5.9 5.8c.7.7.7 1.7 0 2.4l-6.3 6.1a1.7 1.7 0 01-2.4 0l-6.3-6.1c-.7-.7-.7-1.7 0-2.4L15.7 2zM18 12l-4.5-4L9 12h9zM4 16s2 2.4 2 3.8C6 21 5.1 22 4 22s-2-1-2-2.2C2 18.4 4 16 4 16z"/></svg>',"cell-border-color":'<svg width="24" height="24"><g fill-rule="evenodd"><path fill-rule="nonzero" d="M5 13v5h2v2H5a2 2 0 01-2-2v-5h2zm8-7V4h6a2 2 0 012 2h-8z" opacity=".2"/><path fill-rule="nonzero" d="M13 4v2H5v7H3V6c0-1.1.9-2 2-2h8zm-2.6 14.1l.1-.1.1.1.2.3.2.2.2.2c.4.6.8 1.2.8 1.7 0 .8-.7 1.5-1.5 1.5S9 21.3 9 20.5c0-.5.4-1.1.8-1.7l.2-.2.2-.2.2-.3z"/><path d="M13 11l-2 2H5v-2h6V6h2z"/><path fill-rule="nonzero" d="M18.4 8l1 1-1.8 1.9 4 4c.5.4.5 1.1 0 1.6l-4.3 4.2a1.2 1.2 0 01-1.6 0l-4.4-4.2c-.4-.5-.4-1.2 0-1.7l7-6.8zm1.6 7l-3-3-3 3h6z"/></g></svg>',"change-case":'<svg width="24" height="24"><path d="M18.4 18.2v-.6c-.5.8-1.3 1.2-2.4 1.2-2.2 0-3.3-1.6-3.3-4.8 0-3.1 1-4.7 3.3-4.7 1.1 0 1.8.3 2.4 1.1v-.6c0-.5.4-.8.8-.8s.8.3.8.8v8.4c0 .5-.4.8-.8.8a.8.8 0 01-.8-.8zm-2-7.4c-1.3 0-1.8.9-1.8 3.2 0 2.4.5 3.3 1.7 3.3 1.3 0 1.8-.9 1.8-3.2 0-2.4-.5-3.3-1.7-3.3zM10 15.7H5.5l-.8 2.6a1 1 0 01-1 .7h-.2a.7.7 0 01-.7-1l4-12a1 1 0 012 0l4 12a.7.7 0 01-.8 1h-.2a1 1 0 01-1-.7l-.8-2.6zm-.3-1.5l-2-6.5-1.9 6.5h3.9z" fill-rule="evenodd"/></svg>',"character-count":'<svg width="24" height="24"><path d="M4 11.5h16v1H4v-1zm4.8-6.8V10H7.7V5.8h-1v-1h2zM11 8.3V9h2v1h-3V7.7l2-1v-.9h-2v-1h3v2.4l-2 1zm6.3-3.4V10h-3.1V9h2.1V8h-2.1V6.8h2.1v-1h-2.1v-1h3.1zM5.8 16.4c0-.5.2-.8.5-1 .2-.2.6-.3 1.2-.3l.8.1c.2 0 .4.2.5.3l.4.4v2.8l.2.3H8.2v-.1-.2l-.6.3H7c-.4 0-.7 0-1-.2a1 1 0 01-.3-.9c0-.3 0-.6.3-.8.3-.2.7-.4 1.2-.4l.6-.2h.3v-.2l-.1-.2a.8.8 0 00-.5-.1 1 1 0 00-.4 0l-.3.4h-1zm2.3.8h-.2l-.2.1-.4.1a1 1 0 00-.4.2l-.2.2.1.3.5.1h.4l.4-.4v-.6zm2-3.4h1.2v1.7l.5-.3h.5c.5 0 .9.1 1.2.5.3.4.5.8.5 1.4 0 .6-.2 1.1-.5 1.5-.3.4-.7.6-1.3.6l-.6-.1-.4-.4v.4h-1.1v-5.4zm1.1 3.3c0 .3 0 .6.2.8a.7.7 0 001.2 0l.2-.8c0-.4 0-.6-.2-.8a.7.7 0 00-.6-.3l-.6.3-.2.8zm6.1-.5c0-.2 0-.3-.2-.4a.8.8 0 00-.5-.2c-.3 0-.5.1-.6.3l-.2.9c0 .3 0 .6.2.8.1.2.3.3.6.3.2 0 .4 0 .5-.2l.2-.4h1.1c0 .5-.3.8-.6 1.1a2 2 0 01-1.3.4c-.5 0-1-.2-1.3-.6a2 2 0 01-.5-1.4c0-.6.1-1.1.5-1.5.3-.4.8-.5 1.4-.5.5 0 1 0 1.2.3.4.3.5.7.5 1.2h-1v-.1z" fill-rule="evenodd"/></svg>',"checklist-rtl":'<svg width="24" height="24"><path d="M5 17h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 110-2zm14.2 11c.2-.4.6-.5.9-.3.3.2.4.6.2 1L18 20c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 010-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8zm0-6c.2-.4.6-.5.9-.3.3.2.4.6.2 1L18 14c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 010-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8zm0-6c.2-.4.6-.5.9-.3.3.2.4.6.2 1L18 8c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 010-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8z" fill-rule="evenodd"/></svg>',checklist:'<svg width="24" height="24"><path d="M11 17h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0-6h8a1 1 0 010 2h-8a1 1 0 010-2zM7.2 16c.2-.4.6-.5.9-.3.3.2.4.6.2 1L6 20c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 010-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8zm0-6c.2-.4.6-.5.9-.3.3.2.4.6.2 1L6 14c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 010-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8zm0-6c.2-.4.6-.5.9-.3.3.2.4.6.2 1L6 8c-.2.3-.7.4-1 0L3.8 6.9a.7.7 0 010-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8z" fill-rule="evenodd"/></svg>',checkmark:'<svg width="24" height="24"><path d="M18.2 5.4a1 1 0 011.6 1.2l-8 12a1 1 0 01-1.5.1l-5-5a1 1 0 111.4-1.4l4.1 4.1 7.4-11z" fill-rule="nonzero"/></svg>',"chevron-down":'<svg width="10" height="10"><path d="M8.7 2.2c.3-.3.8-.3 1 0 .4.4.4.9 0 1.2L5.7 7.8c-.3.3-.9.3-1.2 0L.2 3.4a.8.8 0 010-1.2c.3-.3.8-.3 1.1 0L5 6l3.7-3.8z" fill-rule="nonzero"/></svg>',"chevron-left":'<svg width="10" height="10"><path d="M7.8 1.3L4 5l3.8 3.7c.3.3.3.8 0 1-.4.4-.9.4-1.2 0L2.2 5.7a.8.8 0 010-1.2L6.6.2C7 0 7.4 0 7.8.2c.3.3.3.8 0 1.1z" fill-rule="nonzero"/></svg>',"chevron-right":'<svg width="10" height="10"><path d="M2.2 1.3a.8.8 0 010-1c.4-.4.9-.4 1.2 0l4.4 4.1c.3.4.3.9 0 1.2L3.4 9.8c-.3.3-.8.3-1.2 0a.8.8 0 010-1.1L6 5 2.2 1.3z" fill-rule="nonzero"/></svg>',"chevron-up":'<svg width="10" height="10"><path d="M8.7 7.8L5 4 1.3 7.8c-.3.3-.8.3-1 0a.8.8 0 010-1.2l4.1-4.4c.3-.3.9-.3 1.2 0l4.2 4.4c.3.3.3.9 0 1.2-.3.3-.8.3-1.1 0z" fill-rule="nonzero"/></svg>',close:'<svg width="24" height="24"><path d="M17.3 8.2L13.4 12l3.9 3.8a1 1 0 01-1.5 1.5L12 13.4l-3.8 3.9a1 1 0 01-1.5-1.5l3.9-3.8-3.9-3.8a1 1 0 011.5-1.5l3.8 3.9 3.8-3.9a1 1 0 011.5 1.5z" fill-rule="evenodd"/></svg>',"code-sample":'<svg width="24" height="26"><path d="M7.1 11a2.8 2.8 0 01-.8 2 2.8 2.8 0 01.8 2v1.7c0 .3.1.6.4.8.2.3.5.4.8.4.3 0 .4.2.4.4v.8c0 .2-.1.4-.4.4-.7 0-1.4-.3-2-.8-.5-.6-.8-1.3-.8-2V15c0-.3-.1-.6-.4-.8-.2-.3-.5-.4-.8-.4a.4.4 0 01-.4-.4v-.8c0-.2.2-.4.4-.4.3 0 .6-.1.8-.4.3-.2.4-.5.4-.8V9.3c0-.7.3-1.4.8-2 .6-.5 1.3-.8 2-.8.3 0 .4.2.4.4v.8c0 .2-.1.4-.4.4-.3 0-.6.1-.8.4-.3.2-.4.5-.4.8V11zm9.8 0V9.3c0-.3-.1-.6-.4-.8-.2-.3-.5-.4-.8-.4a.4.4 0 01-.4-.4V7c0-.2.1-.4.4-.4.7 0 1.4.3 2 .8.5.6.8 1.3.8 2V11c0 .3.1.6.4.8.2.3.5.4.8.4.2 0 .4.2.4.4v.8c0 .2-.2.4-.4.4-.3 0-.6.1-.8.4-.3.2-.4.5-.4.8v1.7c0 .7-.3 1.4-.8 2-.6.5-1.3.8-2 .8a.4.4 0 01-.4-.4v-.8c0-.2.1-.4.4-.4.3 0 .6-.1.8-.4.3-.2.4-.5.4-.8V15a2.8 2.8 0 01.8-2 2.8 2.8 0 01-.8-2zm-3.3-.4c0 .4-.1.8-.5 1.1-.3.3-.7.5-1.1.5-.4 0-.8-.2-1.1-.5-.4-.3-.5-.7-.5-1.1 0-.5.1-.9.5-1.2.3-.3.7-.4 1.1-.4.4 0 .8.1 1.1.4.4.3.5.7.5 1.2zM12 13c.4 0 .8.1 1.1.5.4.3.5.7.5 1.1 0 1-.1 1.6-.5 2a3 3 0 01-1.1 1c-.4.3-.8.4-1.1.4a.5.5 0 01-.5-.5V17a3 3 0 001-.2l.6-.6c-.6 0-1-.2-1.3-.5-.2-.3-.3-.7-.3-1 0-.5.1-1 .5-1.2.3-.4.7-.5 1.1-.5z" fill-rule="evenodd"/></svg>',"color-levels":'<svg width="24" height="24"><path d="M17.5 11.4A9 9 0 0118 14c0 .5 0 1-.2 1.4 0 .4-.3.9-.5 1.3a6.2 6.2 0 01-3.7 3 5.7 5.7 0 01-3.2 0A5.9 5.9 0 017.6 18a6.2 6.2 0 01-1.4-2.6 6.7 6.7 0 010-2.8c0-.4.1-.9.3-1.3a13.6 13.6 0 012.3-4A20 20 0 0112 4a26.4 26.4 0 013.2 3.4 18.2 18.2 0 012.3 4zm-2 4.5c.4-.7.5-1.4.5-2a7.3 7.3 0 00-1-3.2c.2.6.2 1.2.2 1.9a4.5 4.5 0 01-1.3 3 5.3 5.3 0 01-2.3 1.5 4.9 4.9 0 01-2 .1 4.3 4.3 0 002.4.8 4 4 0 002-.6 4 4 0 001.5-1.5z" fill-rule="evenodd"/></svg>',"color-picker":'<svg width="24" height="24"><path d="M12 3a9 9 0 000 18 1.5 1.5 0 001.1-2.5c-.2-.3-.4-.6-.4-1 0-.8.7-1.5 1.5-1.5H16a5 5 0 005-5c0-4.4-4-8-9-8zm-5.5 9a1.5 1.5 0 110-3 1.5 1.5 0 010 3zm3-4a1.5 1.5 0 110-3 1.5 1.5 0 010 3zm5 0a1.5 1.5 0 110-3 1.5 1.5 0 010 3zm3 4a1.5 1.5 0 110-3 1.5 1.5 0 010 3z" fill-rule="nonzero"/></svg>',"color-swatch-remove-color":'<svg width="24" height="24"><path stroke="#000" stroke-width="2" d="M21 3L3 21" fill-rule="evenodd"/></svg>',"color-swatch":'<svg width="24" height="24"><rect x="3" y="3" width="18" height="18" rx="1" fill-rule="evenodd"/></svg>',"comment-add":'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M9 19l3-2h7c.6 0 1-.4 1-1V6c0-.6-.4-1-1-1H5a1 1 0 00-1 1v10c0 .6.4 1 1 1h4v2zm-2 4v-4H5a3 3 0 01-3-3V6a3 3 0 013-3h14a3 3 0 013 3v10a3 3 0 01-3 3h-6.4L7 23z"/><path d="M13 10h2a1 1 0 010 2h-2v2a1 1 0 01-2 0v-2H9a1 1 0 010-2h2V8a1 1 0 012 0v2z"/></g></svg>',comment:'<svg width="24" height="24"><path fill-rule="nonzero" d="M9 19l3-2h7c.6 0 1-.4 1-1V6c0-.6-.4-1-1-1H5a1 1 0 00-1 1v10c0 .6.4 1 1 1h4v2zm-2 4v-4H5a3 3 0 01-3-3V6a3 3 0 013-3h14a3 3 0 013 3v10a3 3 0 01-3 3h-6.4L7 23z"/></svg>',contrast:'<svg width="24" height="24"><path d="M12 4a7.8 7.8 0 015.7 2.3A8 8 0 1112 4zm-6 8a6 6 0 006 6V6a6 6 0 00-6 6z" fill-rule="evenodd"/></svg>',copy:'<svg width="24" height="24"><path d="M16 3H6a2 2 0 00-2 2v11h2V5h10V3zm1 4a2 2 0 012 2v10a2 2 0 01-2 2h-7a2 2 0 01-2-2V9c0-1.2.9-2 2-2h7zm0 12V9h-7v10h7z" fill-rule="nonzero"/></svg>',crop:'<svg width="24" height="24"><path d="M17 8v7h2c.6 0 1 .4 1 1s-.4 1-1 1h-2v2c0 .6-.4 1-1 1a1 1 0 01-1-1v-2H7V9H5a1 1 0 110-2h2V5c0-.6.4-1 1-1s1 .4 1 1v2h7l3-3 1 1-3 3zM9 9v5l5-5H9zm1 6h5v-5l-5 5z" fill-rule="evenodd"/></svg>',"cut-column":'<svg width="24" height="24"><path fill-rule="evenodd" d="M7.2 4.5c.9 0 1.6.4 2.2 1A3.7 3.7 0 0110.5 8v.5l1 1 4-4 1-.5a3.3 3.3 0 012 0c.4 0 .7.3 1 .5L17 8h4v13h-6V10l-1.5 1.5.5.5v4l-2.5-2.5-1 1v.5c0 .4 0 .8-.3 1.2-.2.5-.4.9-.8 1.2-.6.7-1.3 1-2.2 1-.8.2-1.5 0-2-.6l-.5-.8-.2-1c0-.4 0-.8.3-1.2A3.9 3.9 0 017 12.7c.5-.2 1-.3 1.5-.2l1-1-1-1c-.5 0-1 0-1.5-.2-.5-.1-1-.4-1.4-.9-.4-.3-.6-.7-.8-1.2L4.5 7c0-.4 0-.7.2-1 0-.3.3-.6.5-.8.5-.5 1.2-.8 2-.7zm12.3 5h-3v10h3v-10zM8 13.8h-.3l-.4.2a2.8 2.8 0 00-.7.4v.1a2.8 2.8 0 00-.6.8l-.1.4v.7l.2.5.5.2h.7a2.6 2.6 0 00.8-.3 2.4 2.4 0 00.7-.7 2.5 2.5 0 00.3-.8 1.5 1.5 0 000-.8 1 1 0 00-.2-.4 1 1 0 00-.5-.2H8zm3.5-3.7c-.4 0-.7.1-1 .4-.3.3-.4.6-.4 1s.1.7.4 1c.3.3.6.4 1 .4s.7-.1 1-.4c.3-.3.4-.6.4-1s-.1-.7-.4-1c-.3-.3-.6-.4-1-.4zM7 5.8h-.4a1 1 0 00-.5.3 1 1 0 00-.2.5v.7a2.5 2.5 0 00.3.8l.2.3h.1l.4.4.4.2.4.1h.7L9 9l.2-.4a1.6 1.6 0 000-.8 2.6 2.6 0 00-.3-.8A2.5 2.5 0 007.7 6l-.4-.1H7z"/></svg>',"cut-row":'<svg width="24" height="24"><path fill-rule="evenodd" d="M22 3v5H9l3 3 2-2h4l-4 4 1 1h.5c.4 0 .8 0 1.2.3.5.2.9.4 1.2.8.7.6 1 1.3 1 2.2.2.8 0 1.5-.6 2l-.8.5-1 .2c-.4 0-.8 0-1.2-.3a3.9 3.9 0 01-2.1-2.2c-.2-.5-.3-1-.2-1.5l-1-1-1 1c0 .5 0 1-.2 1.5-.1.5-.4 1-.9 1.4-.3.4-.7.6-1.2.8l-1.2.3c-.4 0-.7 0-1-.2-.3 0-.6-.3-.8-.5-.5-.5-.8-1.2-.7-2 0-.9.4-1.6 1-2.2A3.7 3.7 0 018.6 14H9l1-1-4-4-.5-1a3.3 3.3 0 010-2c0-.4.3-.7.5-1l2 2V3h14zM8.5 15.3h-.3a2.6 2.6 0 00-.8.4 2.5 2.5 0 00-.9 1.1l-.1.4v.7l.2.5.5.2h.7a2.5 2.5 0 00.8-.3L9 18V18l.4-.4.2-.4.1-.4v-.3-.4a1 1 0 00-.2-.5 1 1 0 00-.4-.2h-.5zm7 0H15a1 1 0 00-.4.3 1 1 0 00-.2.5 1.5 1.5 0 000 .7v.4a2.8 2.8 0 00.5.7h.1a2.8 2.8 0 00.8.6l.4.1h.7l.5-.2.2-.5v-.4-.3a2.6 2.6 0 00-.3-.8 2.4 2.4 0 00-.7-.7 2.5 2.5 0 00-.8-.3h-.3zM12 11.6c-.4 0-.7.1-1 .4-.3.3-.4.6-.4 1s.1.7.4 1c.3.3.6.4 1 .4s.7-.1 1-.4c.3-.3.4-.6.4-1s-.1-.7-.4-1c-.3-.3-.6-.4-1-.4zm8.5-7.1h-11v2h11v-2z"/></svg>',cut:'<svg width="24" height="24"><path d="M18 15c.6.7 1 1.4 1 2.3 0 .8-.2 1.5-.7 2l-.8.5-1 .2c-.4 0-.8 0-1.2-.3a3.9 3.9 0 01-2.1-2.2c-.2-.5-.3-1-.2-1.5l-1-1-1 1c0 .5 0 1-.2 1.5-.1.5-.4 1-.9 1.4-.3.4-.7.6-1.2.8l-1.2.3c-.4 0-.7 0-1-.2-.3 0-.6-.3-.8-.5-.5-.5-.8-1.2-.7-2 0-.9.4-1.6 1-2.2A3.7 3.7 0 018.6 14H9l1-1-4-4-.5-1a3.3 3.3 0 010-2c0-.4.3-.7.5-1l6 6 6-6 .5 1a3.3 3.3 0 010 2c0 .4-.3.7-.5 1l-4 4 1 1h.5c.4 0 .8 0 1.2.3.5.2.9.4 1.2.8zm-8.5 2.2l.1-.4v-.3-.4a1 1 0 00-.2-.5 1 1 0 00-.4-.2 1.6 1.6 0 00-.8 0 2.6 2.6 0 00-.8.3 2.5 2.5 0 00-.9 1.1l-.1.4v.7l.2.5.5.2h.7a2.5 2.5 0 00.8-.3 2.8 2.8 0 001-1zm2.5-2.8c.4 0 .7-.1 1-.4.3-.3.4-.6.4-1s-.1-.7-.4-1c-.3-.3-.6-.4-1-.4s-.7.1-1 .4c-.3.3-.4.6-.4 1s.1.7.4 1c.3.3.6.4 1 .4zm5.4 4l.2-.5v-.4-.3a2.6 2.6 0 00-.3-.8 2.4 2.4 0 00-.7-.7 2.5 2.5 0 00-.8-.3 1.5 1.5 0 00-.8 0 1 1 0 00-.4.2 1 1 0 00-.2.5 1.5 1.5 0 000 .7v.4l.3.4.3.4a2.8 2.8 0 00.8.5l.4.1h.7l.5-.2z" fill-rule="evenodd"/></svg>',"document-properties":'<svg width="24" height="24"><path d="M14.4 3H7a2 2 0 00-2 2v14c0 1.1.9 2 2 2h10a2 2 0 002-2V7.6L14.4 3zM17 19H7V5h6v4h4v10z" fill-rule="nonzero"/></svg>',drag:'<svg width="24" height="24"><path d="M13 5h2v2h-2V5zm0 4h2v2h-2V9zM9 9h2v2H9V9zm4 4h2v2h-2v-2zm-4 0h2v2H9v-2zm0 4h2v2H9v-2zm4 0h2v2h-2v-2zM9 5h2v2H9V5z" fill-rule="evenodd"/></svg>',"duplicate-column":'<svg width="24" height="24"><path d="M17 6v16h-7V6h7zm-2 2h-3v12h3V8zm-2-6v2H8v15H6V2h7z"/></svg>',"duplicate-row":'<svg width="24" height="24"><path d="M22 11v7H6v-7h16zm-2 2H8v3h12v-3zm-1-6v2H4v5H2V7h17z"/></svg>',duplicate:'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M16 3v2H6v11H4V5c0-1.1.9-2 2-2h10zm3 8h-2V9h-7v10h9a2 2 0 01-2 2h-7a2 2 0 01-2-2V9c0-1.2.9-2 2-2h7a2 2 0 012 2v2z"/><path d="M17 14h1a1 1 0 010 2h-1v1a1 1 0 01-2 0v-1h-1a1 1 0 010-2h1v-1a1 1 0 012 0v1z"/></g></svg>',"edit-block":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19.8 8.8l-9.4 9.4c-.2.2-.5.4-.9.4l-5.4 1.2 1.2-5.4.5-.8 9.4-9.4c.7-.7 1.8-.7 2.5 0l2.1 2.1c.7.7.7 1.8 0 2.5zm-2-.2l1-.9v-.3l-2.2-2.2a.3.3 0 00-.3 0l-1 1L18 8.5zm-1 1l-2.5-2.4-6 6 2.5 2.5 6-6zm-7 7.1l-2.6-2.4-.3.3-.1.2-.7 3 3.1-.6h.1l.4-.5z"/></svg>',"edit-image":'<svg width="24" height="24"><path d="M18 16h2V7a2 2 0 00-2-2H7v2h11v9zM6 17h15a1 1 0 010 2h-1v1a1 1 0 01-2 0v-1H6a2 2 0 01-2-2V7H3a1 1 0 110-2h1V4a1 1 0 112 0v13zm3-5.3l1.3 2 3-4.7 3.7 6H7l2-3.3z" fill-rule="nonzero"/></svg>',"embed-page":'<svg width="24" height="24"><path d="M19 6V5H5v14h2A13 13 0 0119 6zm0 1.4c-.8.8-1.6 2.4-2.2 4.6H19V7.4zm0 5.6h-2.4c-.4 1.8-.6 3.8-.6 6h3v-6zm-4 6c0-2.2.2-4.2.6-6H13c-.7 1.8-1.1 3.8-1.1 6h3zm-4 0c0-2.2.4-4.2 1-6H9.6A12 12 0 008 19h3zM4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 01-1-1V4c0-.6.4-1 1-1zm11.8 9c.4-1.9 1-3.4 1.8-4.5a9.2 9.2 0 00-4 4.5h2.2zm-3.4 0a12 12 0 012.8-4 12 12 0 00-5 4h2.2z" fill-rule="nonzero"/></svg>',embed:'<svg width="24" height="24"><path d="M4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 01-1-1V4c0-.6.4-1 1-1zm1 2v14h14V5H5zm4.8 2.6l5.6 4a.5.5 0 010 .8l-5.6 4A.5.5 0 019 16V8a.5.5 0 01.8-.4z" fill-rule="nonzero"/></svg>',emoji:'<svg width="24" height="24"><path d="M9 11c.6 0 1-.4 1-1s-.4-1-1-1a1 1 0 00-1 1c0 .6.4 1 1 1zm6 0c.6 0 1-.4 1-1s-.4-1-1-1a1 1 0 00-1 1c0 .6.4 1 1 1zm-3 5.5c2.1 0 4-1.5 4.4-3.5H7.6c.5 2 2.3 3.5 4.4 3.5zM12 4a8 8 0 100 16 8 8 0 000-16zm0 14.5a6.5 6.5 0 110-13 6.5 6.5 0 010 13z" fill-rule="nonzero"/></svg>',export:'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M14.4 3L18 7v1h-5V5H7v14h9a1 1 0 012 0c0 1-.8 2-1.9 2H7c-1 0-2-.8-2-1.9V5c0-1 .8-2 1.9-2h7.5z"/><path d="M18.1 12c.5 0 .9.4.9 1 0 .5-.3 1-.8 1h-7.3c-.5 0-.9-.4-.9-1 0-.5.3-1 .8-1h7.3z"/><path d="M16.4 9.2a1 1 0 011.4.2l2.4 3.6-2.4 3.6a1 1 0 01-1.7-1v-.2l1.7-2.4-1.6-2.4a1 1 0 01.2-1.4z"/></g></svg>',fill:'<svg width="24" height="26"><path d="M16.6 12l-9-9-1.4 1.4 2.4 2.4-5.2 5.1c-.5.6-.5 1.6 0 2.2L9 19.6a1.5 1.5 0 002.2 0l5.5-5.5c.5-.6.5-1.6 0-2.2zM5.2 13L10 8.2l4.8 4.8H5.2zM19 14.5s-2 2.2-2 3.5c0 1.1.9 2 2 2a2 2 0 002-2c0-1.3-2-3.5-2-3.5z" fill-rule="nonzero"/></svg>',"flip-horizontally":'<svg width="24" height="24"><path d="M14 19h2v-2h-2v2zm4-8h2V9h-2v2zM4 7v10c0 1.1.9 2 2 2h3v-2H6V7h3V5H6a2 2 0 00-2 2zm14-2v2h2a2 2 0 00-2-2zm-7 16h2V3h-2v18zm7-6h2v-2h-2v2zm-4-8h2V5h-2v2zm4 12a2 2 0 002-2h-2v2z" fill-rule="nonzero"/></svg>',"flip-vertically":'<svg width="24" height="24"><path d="M5 14v2h2v-2H5zm8 4v2h2v-2h-2zm4-14H7a2 2 0 00-2 2v3h2V6h10v3h2V6a2 2 0 00-2-2zm2 14h-2v2a2 2 0 002-2zM3 11v2h18v-2H3zm6 7v2h2v-2H9zm8-4v2h2v-2h-2zM5 18c0 1.1.9 2 2 2v-2H5z" fill-rule="nonzero"/></svg>',"format-painter":'<svg width="24" height="24"><path d="M18 5V4c0-.5-.4-1-1-1H5a1 1 0 00-1 1v4c0 .6.5 1 1 1h12c.6 0 1-.4 1-1V7h1v4H9v9c0 .6.4 1 1 1h2c.6 0 1-.4 1-1v-7h8V5h-3z" fill-rule="nonzero"/></svg>',format:'<svg width="24" height="24"><path fill-rule="evenodd" d="M17 5a1 1 0 010 2h-4v11a1 1 0 01-2 0V7H7a1 1 0 110-2h10z"/></svg>',fullscreen:'<svg width="24" height="24"><path d="M15.3 10l-1.2-1.3 2.9-3h-2.3a.9.9 0 110-1.7H19c.5 0 .9.4.9.9v4.4a.9.9 0 11-1.8 0V7l-2.9 3zm0 4l3 3v-2.3a.9.9 0 111.7 0V19c0 .5-.4.9-.9.9h-4.4a.9.9 0 110-1.8H17l-3-2.9 1.3-1.2zM10 15.4l-2.9 3h2.3a.9.9 0 110 1.7H5a.9.9 0 01-.9-.9v-4.4a.9.9 0 111.8 0V17l2.9-3 1.2 1.3zM8.7 10L5.7 7v2.3a.9.9 0 01-1.7 0V5c0-.5.4-.9.9-.9h4.4a.9.9 0 010 1.8H7l3 2.9-1.3 1.2z" fill-rule="nonzero"/></svg>',gallery:'<svg width="24" height="24"><path fill-rule="nonzero" d="M5 15.7l2.3-2.2c.3-.3.7-.3 1 0L11 16l5.1-5c.3-.4.8-.4 1 0l2 1.9V8H5v7.7zM5 18V19h3l1.8-1.9-2-2L5 17.9zm14-3l-2.5-2.4-6.4 6.5H19v-4zM4 6h16c.6 0 1 .4 1 1v13c0 .6-.4 1-1 1H4a1 1 0 01-1-1V7c0-.6.4-1 1-1zm6 7a2 2 0 110-4 2 2 0 010 4zM4.5 4h15a.5.5 0 110 1h-15a.5.5 0 010-1zm2-2h11a.5.5 0 110 1h-11a.5.5 0 010-1z"/></svg>',gamma:'<svg width="24" height="24"><path d="M4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 01-1-1V4c0-.6.4-1 1-1zm1 2v14h14V5H5zm6.5 11.8V14L9.2 8.7a5.1 5.1 0 00-.4-.8l-.1-.2H8 8v-1l.3-.1.3-.1h.7a1 1 0 01.6.5l.1.3a8.5 8.5 0 01.3.6l1.9 4.6 2-5.2a1 1 0 011-.6.5.5 0 01.5.6L13 14v2.8a.7.7 0 01-1.4 0z" fill-rule="nonzero"/></svg>',help:'<svg width="24" height="24"><g fill-rule="evenodd"><path d="M12 5.5a6.5 6.5 0 00-6 9 6.3 6.3 0 001.4 2l1 1a6.3 6.3 0 003.6 1 6.5 6.5 0 006-9 6.3 6.3 0 00-1.4-2l-1-1a6.3 6.3 0 00-3.6-1zM12 4a7.8 7.8 0 015.7 2.3A8 8 0 1112 4z"/><path d="M9.6 9.7a.7.7 0 01-.7-.8c0-1.1 1.5-1.8 3.2-1.8 1.8 0 3.2.8 3.2 2.4 0 1.4-.4 2.1-1.5 2.8-.2 0-.3.1-.3.2a2 2 0 00-.8.8.8.8 0 01-1.4-.6c.3-.7.8-1 1.3-1.5l.4-.2c.7-.4.8-.6.8-1.5 0-.5-.6-.9-1.7-.9-.5 0-1 .1-1.4.3-.2 0-.3.1-.3.2v-.2c0 .4-.4.8-.8.8z" fill-rule="nonzero"/><circle cx="12" cy="16" r="1"/></g></svg>',"highlight-bg-color":'<svg width="24" height="24"><g fill-rule="evenodd"><path id="tox-icon-highlight-bg-color__color" d="M3 18h18v3H3z"/><path fill-rule="nonzero" d="M7.7 16.7H3l3.3-3.3-.7-.8L10.2 8l4 4.1-4 4.2c-.2.2-.6.2-.8 0l-.6-.7-1.1 1.1zm5-7.5L11 7.4l3-2.9a2 2 0 012.6 0L18 6c.7.7.7 2 0 2.7l-2.9 2.9-1.8-1.8-.5-.6"/></g></svg>',home:'<svg width="24" height="24"><path fill-rule="nonzero" d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/></svg>',"horizontal-rule":'<svg width="24" height="24"><path d="M4 11h16v2H4z" fill-rule="evenodd"/></svg>',"image-options":'<svg width="24" height="24"><path d="M6 10a2 2 0 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2zm12 0a2 2 0 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2zm-6 0a2 2 0 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2z" fill-rule="nonzero"/></svg>',image:'<svg width="24" height="24"><path d="M5 15.7l3.3-3.2c.3-.3.7-.3 1 0L12 15l4.1-4c.3-.4.8-.4 1 0l2 1.9V5H5v10.7zM5 18V19h3l2.8-2.9-2-2L5 17.9zm14-3l-2.5-2.4-6.4 6.5H19v-4zM4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 01-1-1V4c0-.6.4-1 1-1zm6 8a2 2 0 100-4 2 2 0 000 4z" fill-rule="nonzero"/></svg>',indent:'<svg width="24" height="24"><path d="M7 5h12c.6 0 1 .4 1 1s-.4 1-1 1H7a1 1 0 110-2zm5 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 010-2zm0 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 010-2zm-5 4h12a1 1 0 010 2H7a1 1 0 010-2zm-2.6-3.8L6.2 12l-1.8-1.2a1 1 0 011.2-1.6l3 2a1 1 0 010 1.6l-3 2a1 1 0 11-1.2-1.6z" fill-rule="evenodd"/></svg>',info:'<svg width="24" height="24"><path d="M12 4a7.8 7.8 0 015.7 2.3A8 8 0 1112 4zm-1 3v2h2V7h-2zm3 10v-1h-1v-5h-3v1h1v4h-1v1h4z" fill-rule="evenodd"/></svg>',"insert-character":'<svg width="24" height="24"><path d="M15 18h4l1-2v4h-6v-3.3l1.4-1a6 6 0 001.8-2.9 6.3 6.3 0 00-.1-4.1 5.8 5.8 0 00-3-3.2c-.6-.3-1.3-.5-2.1-.5a5.1 5.1 0 00-3.9 1.8 6.3 6.3 0 00-1.3 6 6.2 6.2 0 001.8 3l1.4.9V20H4v-4l1 2h4v-.5l-2-1L5.4 15A6.5 6.5 0 014 11c0-1 .2-1.9.6-2.7A7 7 0 016.3 6C7.1 5.4 8 5 9 4.5c1-.3 2-.5 3.1-.5a8.8 8.8 0 015.7 2 7 7 0 011.7 2.3 6 6 0 01.2 4.8c-.2.7-.6 1.3-1 1.9a7.6 7.6 0 01-3.6 2.5v.5z" fill-rule="evenodd"/></svg>',"insert-time":'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M12 19a7 7 0 100-14 7 7 0 000 14zm0 2a9 9 0 110-18 9 9 0 010 18z"/><path d="M16 12h-3V7c0-.6-.4-1-1-1a1 1 0 00-1 1v7h5c.6 0 1-.4 1-1s-.4-1-1-1z"/></g></svg>',invert:'<svg width="24" height="24"><path d="M18 19.3L16.5 18a5.8 5.8 0 01-3.1 1.9 6.1 6.1 0 01-5.5-1.6A5.8 5.8 0 016 14v-.3l.1-1.2A13.9 13.9 0 017.7 9l-3-3 .7-.8 2.8 2.9 9 8.9 1.5 1.6-.7.6zm0-5.5v.3l-.1 1.1-.4 1-1.2-1.2a4.3 4.3 0 00.2-1v-.2c0-.4 0-.8-.2-1.3l-.5-1.4a14.8 14.8 0 00-3-4.2L12 6a26.1 26.1 0 00-2.2 2.5l-1-1a20.9 20.9 0 012.9-3.3L12 4l1 .8a22.2 22.2 0 014 5.4c.6 1.2 1 2.4 1 3.6z" fill-rule="evenodd"/></svg>',italic:'<svg width="24" height="24"><path d="M16.7 4.7l-.1.9h-.3c-.6 0-1 0-1.4.3-.3.3-.4.6-.5 1.1l-2.1 9.8v.6c0 .5.4.8 1.4.8h.2l-.2.8H8l.2-.8h.2c1.1 0 1.8-.5 2-1.5l2-9.8.1-.5c0-.6-.4-.8-1.4-.8h-.3l.2-.9h5.8z" fill-rule="evenodd"/></svg>',language:'<svg width="24" height="24"><path d="M12 3a9 9 0 110 18 9 9 0 010-18zm4.3 13.3c-.5 1-1.2 2-2 2.9a7.5 7.5 0 003.2-2.1l-.2-.2a6 6 0 00-1-.6zm-8.6 0c-.5.2-.9.5-1.2.8.9 1 2 1.7 3.2 2a10 10 0 01-2-2.8zm3.6-.8c-.8 0-1.6.1-2.2.3.5 1 1.2 1.9 2.1 2.7zm1.5 0v3c.9-.8 1.6-1.7 2.1-2.7-.6-.2-1.4-.3-2.1-.3zm-6-2.7H4.5c.2 1 .5 2.1 1 3h.3l1.3-1a10 10 0 01-.3-2zm12.7 0h-2.3c0 .7-.1 1.4-.3 2l1.6 1.1c.5-1 .9-2 1-3.1zm-3.8 0h-3V14c1 0 2 .1 2.7.4.2-.5.3-1 .3-1.6zm-4.4 0h-3l.3 1.6c.8-.3 1.7-.4 2.7-.4v-1.3zm-5.5-5c-.7 1-1.1 2.2-1.3 3.5h2.3c0-1 .2-1.8.5-2.6l-1.5-1zm2.9 1.4v.1c-.2.6-.4 1.3-.4 2h3V9.4c-1 0-1.8-.1-2.6-.3zm6.6 0h-.1l-2.4.3v1.8h3l-.5-2.1zm3-1.4l-.3.1-1.3.8c.3.8.5 1.6.5 2.6h2.3a7.5 7.5 0 00-1.3-3.5zm-9 0l2 .2V5.5a9 9 0 00-2 2.2zm3.5-2.3V8c.6 0 1.3 0 1.9-.2a9 9 0 00-2-2.3zm-3-.7h-.1c-1.1.4-2.1 1-3 1.8l1.2.7a10 10 0 011.9-2.5zm4.4 0l.1.1a10 10 0 011.8 2.4l1.1-.7a7.5 7.5 0 00-3-1.8z"/></svg>',"line-height":'<svg width="24" height="24"><path d="M21 5a1 1 0 01.1 2H13a1 1 0 01-.1-2H21zm0 4a1 1 0 01.1 2H13a1 1 0 01-.1-2H21zm0 4a1 1 0 01.1 2H13a1 1 0 01-.1-2H21zm0 4a1 1 0 01.1 2H13a1 1 0 01-.1-2H21zM7 3.6l3.7 3.7a1 1 0 01-1.3 1.5h-.1L8 7.3v9.2l1.3-1.3a1 1 0 011.3 0h.1c.4.4.4 1 0 1.3v.1L7 20.4l-3.7-3.7a1 1 0 011.3-1.5h.1L6 16.7V7.4L4.7 8.7a1 1 0 01-1.3 0h-.1a1 1 0 010-1.3v-.1L7 3.6z"/></svg>',line:'<svg width="24" height="24"><path d="M15 9l-8 8H4v-3l8-8 3 3zm1-1l-3-3 1-1h1c-.2 0 0 0 0 0l2 2s0 .2 0 0v1l-1 1zM4 18h16v2H4v-2z" fill-rule="evenodd"/></svg>',link:'<svg width="24" height="24"><path d="M6.2 12.3a1 1 0 011.4 1.4l-2.1 2a2 2 0 102.7 2.8l4.8-4.8a1 1 0 000-1.4 1 1 0 111.4-1.3 2.9 2.9 0 010 4L9.6 20a3.9 3.9 0 01-5.5-5.5l2-2zm11.6-.6a1 1 0 01-1.4-1.4l2-2a2 2 0 10-2.6-2.8L11 10.3a1 1 0 000 1.4A1 1 0 119.6 13a2.9 2.9 0 010-4L14.4 4a3.9 3.9 0 015.5 5.5l-2 2z" fill-rule="nonzero"/></svg>',"list-bull-circle":'<svg width="48" height="48"><g fill-rule="evenodd"><path d="M11 16a2 2 0 100-4 2 2 0 000 4zm0 1a3 3 0 110-6 3 3 0 010 6zM11 26a2 2 0 100-4 2 2 0 000 4zm0 1a3 3 0 110-6 3 3 0 010 6zM11 36a2 2 0 100-4 2 2 0 000 4zm0 1a3 3 0 110-6 3 3 0 010 6z" fill-rule="nonzero"/><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/></g></svg>',"list-bull-default":'<svg width="48" height="48"><g fill-rule="evenodd"><circle cx="11" cy="14" r="3"/><circle cx="11" cy="24" r="3"/><circle cx="11" cy="34" r="3"/><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/></g></svg>',"list-bull-square":'<svg width="48" height="48"><g fill-rule="evenodd"><path d="M8 11h6v6H8zM8 21h6v6H8zM8 31h6v6H8z"/><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/></g></svg>',"list-num-default-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M37.4 17v-4.8l-1.6 1v-1.1l1.6-1h1.2V17zM33.3 17.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zm1.7 5.7c0-1.2 1-2 2.2-2 1.3 0 2.1.8 2.1 1.8 0 .7-.3 1.2-1.3 2.2l-1.2 1v.2h2.6v1h-4.3v-.9l2-1.9c.8-.8 1-1.1 1-1.5 0-.5-.4-.8-1-.8-.5 0-.9.3-.9.9H35zm-1.7 4.3c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zm3.2 7.3v-1h.7c.6 0 1-.3 1-.8 0-.4-.4-.7-1-.7s-1 .3-1 .8H35c0-1.1 1-1.8 2.2-1.8 1.2 0 2.1.6 2.1 1.6 0 .7-.4 1.2-1 1.3v.1c.7.1 1.3.7 1.3 1.4 0 1-1 1.9-2.4 1.9-1.3 0-2.2-.8-2.3-2h1.2c0 .6.5 1 1.1 1 .6 0 1-.4 1-1 0-.5-.3-.8-1-.8h-.7zm-3.3 2.7c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .8.3.8.7 0 .4-.3.7-.8.7z"/></g></svg>',"list-num-default":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M10 17v-4.8l-1.5 1v-1.1l1.6-1h1.2V17h-1.2zm3.6.1c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .7.3.7.7 0 .4-.2.7-.7.7zm-5 5.7c0-1.2.8-2 2.1-2s2.1.8 2.1 1.8c0 .7-.3 1.2-1.4 2.2l-1.1 1v.2h2.6v1H8.6v-.9l2-1.9c.8-.8 1-1.1 1-1.5 0-.5-.4-.8-1-.8-.5 0-.9.3-.9.9H8.5zm6.3 4.3c-.5 0-.7-.3-.7-.7 0-.4.2-.7.7-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zM10 34.4v-1h.7c.6 0 1-.3 1-.8 0-.4-.4-.7-1-.7s-1 .3-1 .8H8.6c0-1.1 1-1.8 2.2-1.8 1.3 0 2.1.6 2.1 1.6 0 .7-.4 1.2-1 1.3v.1c.8.1 1.3.7 1.3 1.4 0 1-1 1.9-2.4 1.9-1.3 0-2.2-.8-2.3-2h1.2c0 .6.5 1 1.1 1 .7 0 1-.4 1-1 0-.5-.3-.8-1-.8h-.7zm4.7 2.7c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .8.3.8.7 0 .4-.3.7-.8.7z"/></g></svg>',"list-num-lower-alpha-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M36.5 16c-.9 0-1.5-.5-1.5-1.3s.6-1.3 1.8-1.4h1v-.4c0-.4-.2-.6-.7-.6-.4 0-.7.1-.8.4h-1.1c0-.8.8-1.4 2-1.4S39 12 39 13V16h-1.2v-.6c-.3.4-.8.7-1.4.7zm.4-.8c.6 0 1-.4 1-.9V14h-1c-.5.1-.7.3-.7.6 0 .4.3.6.7.6zM33.1 16.1c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .8.3.8.7 0 .4-.3.7-.8.7zM37.7 26c-.7 0-1.2-.2-1.5-.7v.7H35v-6.3h1.2v2.5c.3-.5.8-.9 1.5-.9 1.1 0 1.8 1 1.8 2.4 0 1.5-.7 2.4-1.8 2.4zm-.5-3.6c-.6 0-1 .5-1 1.3s.4 1.4 1 1.4c.7 0 1-.6 1-1.4 0-.8-.3-1.3-1-1.3zM33.2 26.1c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .8.3.8.7 0 .4-.3.7-.8.7zm6 7h-1c-.1-.5-.4-.8-1-.8s-1 .5-1 1.4c0 1 .4 1.4 1 1.4.5 0 .9-.2 1-.7h1c0 1-.8 1.7-2 1.7-1.4 0-2.2-.9-2.2-2.4s.8-2.4 2.2-2.4c1.2 0 2 .7 2 1.7zm-6.1 3c-.5 0-.7-.3-.7-.7 0-.4.2-.7.7-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7z"/></g></svg>',"list-num-lower-alpha":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M10.3 15.2c.5 0 1-.4 1-.9V14h-1c-.5.1-.8.3-.8.6 0 .4.3.6.8.6zm-.4.9c-1 0-1.5-.6-1.5-1.4 0-.8.6-1.3 1.7-1.4h1.1v-.4c0-.4-.2-.6-.7-.6-.5 0-.8.1-.9.4h-1c0-.8.8-1.4 2-1.4 1.1 0 1.8.6 1.8 1.6V16h-1.1v-.6h-.1c-.2.4-.7.7-1.3.7zm4.6 0c-.5 0-.7-.3-.7-.7 0-.4.2-.7.7-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zm-3.2 10c-.6 0-1.2-.3-1.4-.8v.7H8.5v-6.3H10v2.5c.3-.5.8-.9 1.4-.9 1.2 0 1.9 1 1.9 2.4 0 1.5-.7 2.4-1.9 2.4zm-.4-3.7c-.7 0-1 .5-1 1.3s.3 1.4 1 1.4c.6 0 1-.6 1-1.4 0-.8-.4-1.3-1-1.3zm4 3.7c-.5 0-.7-.3-.7-.7 0-.4.2-.7.7-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zm-2.2 7h-1.2c0-.5-.4-.8-.9-.8-.6 0-1 .5-1 1.4 0 1 .4 1.4 1 1.4.5 0 .8-.2 1-.7h1c0 1-.8 1.7-2 1.7-1.4 0-2.2-.9-2.2-2.4s.8-2.4 2.2-2.4c1.2 0 2 .7 2 1.7zm1.8 3c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7z"/></g></svg>',"list-num-lower-greek-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M37.4 16c-1.2 0-2-.8-2-2.3 0-1.5.8-2.4 2-2.4.6 0 1 .4 1.3 1v-.9H40v3.2c0 .4.1.5.4.5h.2v.9h-.6c-.6 0-1-.2-1-.7h-.2c-.2.4-.7.8-1.3.8zm.3-1c.6 0 1-.5 1-1.3s-.4-1.3-1-1.3-1 .5-1 1.3.4 1.4 1 1.4zM33.3 16.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zM36 21.9c0-1.5.8-2.3 2.1-2.3 1.2 0 2 .6 2 1.6 0 .6-.3 1-.9 1.3.9.3 1.3.8 1.3 1.7 0 1.2-.7 1.9-1.8 1.9-.6 0-1.1-.3-1.4-.8v2.2H36V22zm1.8 1.2v-1h.3c.5 0 .9-.2.9-.7 0-.5-.3-.8-.9-.8-.5 0-.8.3-.8 1v2.2c0 .8.4 1.3 1 1.3s1-.4 1-1-.4-1-1.2-1h-.3zM33.3 26.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zM37.1 34.6L34.8 30h1.4l1.7 3.5 1.7-3.5h1.1l-2.2 4.6v.1c.5.8.7 1.4.7 1.8 0 .4-.2.8-.4 1-.2.2-.6.3-1 .3-.9 0-1.3-.4-1.3-1.2 0-.5.2-1 .5-1.7l.1-.2zm.7 1a2 2 0 00-.4.9c0 .3.1.4.4.4.3 0 .4-.1.4-.4 0-.2-.1-.6-.4-1zM33.3 36.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7z"/></g></svg>',"list-num-lower-greek":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M10.5 15c.7 0 1-.5 1-1.3s-.3-1.3-1-1.3c-.5 0-.9.5-.9 1.3s.4 1.4 1 1.4zm-.3 1c-1.1 0-1.8-.8-1.8-2.3 0-1.5.7-2.4 1.8-2.4.7 0 1.1.4 1.3 1h.1v-.9h1.2v3.2c0 .4.1.5.4.5h.2v.9h-.6c-.6 0-1-.2-1.1-.7h-.1c-.2.4-.7.8-1.4.8zm5 .1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.7-.7.5 0 .8.3.8.7 0 .4-.3.7-.8.7zm-4.9 7v-1h.3c.6 0 1-.2 1-.7 0-.5-.4-.8-1-.8-.5 0-.8.3-.8 1v2.2c0 .8.4 1.3 1.1 1.3.6 0 1-.4 1-1s-.5-1-1.3-1h-.3zM8.6 22c0-1.5.7-2.3 2-2.3 1.2 0 2 .6 2 1.6 0 .6-.3 1-.8 1.3.8.3 1.3.8 1.3 1.7 0 1.2-.8 1.9-1.9 1.9-.6 0-1.1-.3-1.3-.8v2.2H8.5V22zm6.2 4.2c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .7.3.7.7 0 .4-.2.7-.7.7zm-4.5 8.5L8 30h1.4l1.7 3.5 1.7-3.5h1.1l-2.2 4.6v.1c.5.8.7 1.4.7 1.8 0 .4-.1.8-.4 1-.2.2-.6.3-1 .3-.9 0-1.3-.4-1.3-1.2 0-.5.2-1 .5-1.7l.1-.2zm.7 1a2 2 0 00-.4.9c0 .3.1.4.4.4.3 0 .4-.1.4-.4 0-.2-.1-.6-.4-1zm4.5.5c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7z"/></g></svg>',"list-num-lower-roman-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M32.9 16v-1.2h-1.3V16H33zm0 10v-1.2h-1.3V26H33zm0 10v-1.2h-1.3V36H33z"/><path fill-rule="nonzero" d="M36 21h-1.5v5H36zM36 31h-1.5v5H36zM39 21h-1.5v5H39zM39 31h-1.5v5H39zM42 31h-1.5v5H42zM36 11h-1.5v5H36zM36 19h-1.5v1H36zM36 29h-1.5v1H36zM39 19h-1.5v1H39zM39 29h-1.5v1H39zM42 29h-1.5v1H42zM36 9h-1.5v1H36z"/></g></svg>',"list-num-lower-roman":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M15.1 16v-1.2h1.3V16H15zm0 10v-1.2h1.3V26H15zm0 10v-1.2h1.3V36H15z"/><path fill-rule="nonzero" d="M12 21h1.5v5H12zM12 31h1.5v5H12zM9 21h1.5v5H9zM9 31h1.5v5H9zM6 31h1.5v5H6zM12 11h1.5v5H12zM12 19h1.5v1H12zM12 29h1.5v1H12zM9 19h1.5v1H9zM9 29h1.5v1H9zM6 29h1.5v1H6zM12 9h1.5v1H12z"/></g></svg>',"list-num-upper-alpha-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M39.3 17l-.5-1.4h-2l-.5 1.4H35l2-6h1.6l2 6h-1.3zm-1.6-4.7l-.7 2.3h1.6l-.8-2.3zM33.4 17c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .7.3.7.7 0 .4-.2.7-.7.7zm4.7 9.9h-2.7v-6H38c1.2 0 1.9.6 1.9 1.5 0 .6-.5 1.2-1 1.3.7.1 1.3.7 1.3 1.5 0 1-.8 1.7-2 1.7zm-1.4-5v1.5h1c.6 0 1-.3 1-.8 0-.4-.4-.7-1-.7h-1zm0 4h1.1c.7 0 1.1-.3 1.1-.8 0-.6-.4-.9-1.1-.9h-1.1V26zM33 27.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zm4.9 10c-1.8 0-2.8-1.1-2.8-3.1s1-3.1 2.8-3.1c1.4 0 2.5.9 2.6 2.2h-1.3c0-.7-.6-1.1-1.3-1.1-1 0-1.6.7-1.6 2s.6 2 1.6 2c.7 0 1.2-.4 1.4-1h1.2c-.1 1.3-1.2 2.2-2.6 2.2zm-4.5 0c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7z"/></g></svg>',"list-num-upper-alpha":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M12.6 17l-.5-1.4h-2L9.5 17H8.3l2-6H12l2 6h-1.3zM11 12.3l-.7 2.3h1.6l-.8-2.3zm4.7 4.8c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .7.3.7.7 0 .4-.2.7-.7.7zM11.4 27H8.7v-6h2.6c1.2 0 1.9.6 1.9 1.5 0 .6-.5 1.2-1 1.3.7.1 1.3.7 1.3 1.5 0 1-.8 1.7-2 1.7zM10 22v1.5h1c.6 0 1-.3 1-.8 0-.4-.4-.7-1-.7h-1zm0 4H11c.7 0 1.1-.3 1.1-.8 0-.6-.4-.9-1.1-.9H10V26zm5.4 1.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zm-4.1 10c-1.8 0-2.8-1.1-2.8-3.1s1-3.1 2.8-3.1c1.4 0 2.5.9 2.6 2.2h-1.3c0-.7-.6-1.1-1.3-1.1-1 0-1.6.7-1.6 2s.6 2 1.6 2c.7 0 1.2-.4 1.4-1h1.2c-.1 1.3-1.2 2.2-2.6 2.2zm4.5 0c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7z"/></g></svg>',"list-num-upper-roman-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M31.6 17v-1.2H33V17h-1.3zm0 10v-1.2H33V27h-1.3zm0 10v-1.2H33V37h-1.3z"/><path fill-rule="nonzero" d="M34.5 20H36v7h-1.5zM34.5 30H36v7h-1.5zM37.5 20H39v7h-1.5zM37.5 30H39v7h-1.5zM40.5 30H42v7h-1.5zM34.5 10H36v7h-1.5z"/></g></svg>',"list-num-upper-roman":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M15.1 17v-1.2h1.3V17H15zm0 10v-1.2h1.3V27H15zm0 10v-1.2h1.3V37H15z"/><path fill-rule="nonzero" d="M12 20h1.5v7H12zM12 30h1.5v7H12zM9 20h1.5v7H9zM9 30h1.5v7H9zM6 30h1.5v7H6zM12 10h1.5v7H12z"/></g></svg>',lock:'<svg width="24" height="24"><path d="M16.3 11c.2 0 .3 0 .5.2l.2.6v7.4c0 .3 0 .4-.2.6l-.6.2H7.8c-.3 0-.4 0-.6-.2a.7.7 0 01-.2-.6v-7.4c0-.3 0-.4.2-.6l.5-.2H8V8c0-.8.3-1.5.9-2.1.6-.6 1.3-.9 2.1-.9h2c.8 0 1.5.3 2.1.9.6.6.9 1.3.9 2.1v3h.3zM10 8v3h4V8a1 1 0 00-.3-.7A1 1 0 0013 7h-2a1 1 0 00-.7.3 1 1 0 00-.3.7z" fill-rule="evenodd"/></svg>',ltr:'<svg width="24" height="24"><path d="M11 5h7a1 1 0 010 2h-1v11a1 1 0 01-2 0V7h-2v11a1 1 0 01-2 0v-6c-.5 0-1 0-1.4-.3A3.4 3.4 0 017.8 10a3.3 3.3 0 010-2.8 3.4 3.4 0 011.8-1.8L11 5zM4.4 16.2L6.2 15l-1.8-1.2a1 1 0 011.2-1.6l3 2a1 1 0 010 1.6l-3 2a1 1 0 11-1.2-1.6z" fill-rule="evenodd"/></svg>',"more-drawer":'<svg width="24" height="24"><path d="M6 10a2 2 0 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2zm12 0a2 2 0 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2zm-6 0a2 2 0 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2z" fill-rule="nonzero"/></svg>',"new-document":'<svg width="24" height="24"><path d="M14.4 3H7a2 2 0 00-2 2v14c0 1.1.9 2 2 2h10a2 2 0 002-2V7.6L14.4 3zM17 19H7V5h6v4h4v10z" fill-rule="nonzero"/></svg>',"new-tab":'<svg width="24" height="24"><path d="M15 13l2-2v8H5V7h8l-2 2H7v8h8v-4zm4-8v5.5l-2-2-5.6 5.5H10v-1.4L15.5 7l-2-2H19z" fill-rule="evenodd"/></svg>',"non-breaking":'<svg width="24" height="24"><path d="M11 11H8a1 1 0 110-2h3V6c0-.6.4-1 1-1s1 .4 1 1v3h3c.6 0 1 .4 1 1s-.4 1-1 1h-3v3c0 .6-.4 1-1 1a1 1 0 01-1-1v-3zm10 4v5H3v-5c0-.6.4-1 1-1s1 .4 1 1v3h14v-3c0-.6.4-1 1-1s1 .4 1 1z" fill-rule="evenodd"/></svg>',notice:'<svg width="24" height="24"><path d="M17.8 9.8L15.4 4 20 8.5v7L15.5 20h-7L4 15.5v-7L8.5 4h7l2.3 5.8zm0 0l2.2 5.7-2.3-5.8zM13 17v-2h-2v2h2zm0-4V7h-2v6h2z" fill-rule="evenodd"/></svg>',"ordered-list-rtl":'<svg width="24" height="24"><path d="M6 17h8a1 1 0 010 2H6a1 1 0 010-2zm0-6h8a1 1 0 010 2H6a1 1 0 010-2zm0-6h8a1 1 0 010 2H6a1 1 0 110-2zm13-1v3.5a.5.5 0 11-1 0V5h-.5a.5.5 0 110-1H19zm-1 8.8l.2.2h1.3a.5.5 0 110 1h-1.6a1 1 0 01-.9-1V13c0-.4.3-.8.6-1l1.2-.4.2-.3a.2.2 0 00-.2-.2h-1.3a.5.5 0 01-.5-.5c0-.3.2-.5.5-.5h1.6c.5 0 .9.4.9 1v.1c0 .4-.3.8-.6 1l-1.2.4-.2.3zm2 4.2v2c0 .6-.4 1-1 1h-1.5a.5.5 0 010-1h1.2a.3.3 0 100-.6h-1.3a.4.4 0 110-.8h1.3a.3.3 0 000-.6h-1.2a.5.5 0 110-1H19c.6 0 1 .4 1 1z" fill-rule="evenodd"/></svg>',"ordered-list":'<svg width="24" height="24"><path d="M10 17h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 110-2zM6 4v3.5c0 .3-.2.5-.5.5a.5.5 0 01-.5-.5V5h-.5a.5.5 0 010-1H6zm-1 8.8l.2.2h1.3c.3 0 .5.2.5.5s-.2.5-.5.5H4.9a1 1 0 01-.9-1V13c0-.4.3-.8.6-1l1.2-.4.2-.3a.2.2 0 00-.2-.2H4.5a.5.5 0 01-.5-.5c0-.3.2-.5.5-.5h1.6c.5 0 .9.4.9 1v.1c0 .4-.3.8-.6 1l-1.2.4-.2.3zM7 17v2c0 .6-.4 1-1 1H4.5a.5.5 0 010-1h1.2c.2 0 .3-.1.3-.3 0-.2-.1-.3-.3-.3H4.4a.4.4 0 110-.8h1.3c.2 0 .3-.1.3-.3 0-.2-.1-.3-.3-.3H4.5a.5.5 0 110-1H6c.6 0 1 .4 1 1z" fill-rule="evenodd"/></svg>',orientation:'<svg width="24" height="24"><path d="M7.3 6.4L1 13l6.4 6.5 6.5-6.5-6.5-6.5zM3.7 13l3.6-3.7L11 13l-3.7 3.7-3.6-3.7zM12 6l2.8 2.7c.3.3.3.8 0 1-.3.4-.9.4-1.2 0L9.2 5.7a.8.8 0 010-1.2L13.6.2c.3-.3.9-.3 1.2 0 .3.3.3.8 0 1.1L12 4h1a9 9 0 11-4.3 16.9l1.5-1.5A7 7 0 1013 6h-1z" fill-rule="nonzero"/></svg>',outdent:'<svg width="24" height="24"><path d="M7 5h12c.6 0 1 .4 1 1s-.4 1-1 1H7a1 1 0 110-2zm5 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 010-2zm0 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 010-2zm-5 4h12a1 1 0 010 2H7a1 1 0 010-2zm1.6-3.8a1 1 0 01-1.2 1.6l-3-2a1 1 0 010-1.6l3-2a1 1 0 011.2 1.6L6.8 12l1.8 1.2z" fill-rule="evenodd"/></svg>',"page-break":'<svg width="24" height="24"><g fill-rule="evenodd"><path d="M5 11c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 010-2zm3 0h1c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 010-2zm4 0c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 010-2zm3 0h1c.6 0 1 .4 1 1s-.4 1-1 1h-1a1 1 0 010-2zm4 0c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 010-2zM7 3v5h10V3c0-.6.4-1 1-1s1 .4 1 1v7H5V3c0-.6.4-1 1-1s1 .4 1 1zM6 22a1 1 0 01-1-1v-7h14v7c0 .6-.4 1-1 1a1 1 0 01-1-1v-5H7v5c0 .6-.4 1-1 1z"/></g></svg>',paragraph:'<svg width="24" height="24"><path fill-rule="evenodd" d="M10 5h7a1 1 0 010 2h-1v11a1 1 0 01-2 0V7h-2v11a1 1 0 01-2 0v-6c-.5 0-1 0-1.4-.3A3.4 3.4 0 016.8 10a3.3 3.3 0 010-2.8 3.4 3.4 0 011.8-1.8L10 5z"/></svg>',"paste-column-after":'<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 012.8 2H18c1 0 2 .8 2 1.9V7h-2V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-1-1V5H6v13h7v2H6c-1 0-2-.8-2-1.9V5c0-1 .8-2 1.9-2H9.2A3 3 0 0112 1zm8 7v12h-6V8h6zm-1.5 1.5h-3v9h3v-9zM12 3a1 1 0 100 2 1 1 0 000-2z"/></svg>',"paste-column-before":'<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 012.8 2H18c1 0 2 .8 2 1.9V18c0 1-.8 2-1.9 2H11v-2h7V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-1-1V5H6v2H4V5c0-1 .8-2 1.9-2H9.2A3 3 0 0112 1zm-2 7v12H4V8h6zM8.5 9.5h-3v9h3v-9zM12 3a1 1 0 100 2 1 1 0 000-2z"/></svg>',"paste-row-after":'<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 012.8 2H18c1 0 2 .8 2 1.9V11h-2V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-1-1V5H6v13h14c0 1-.8 2-1.9 2H6c-1 0-2-.8-2-1.9V5c0-1 .8-2 1.9-2H9.2A3 3 0 0112 1zm10 11v5H8v-5h14zm-1.5 1.5h-11v2h11v-2zM12 3a1 1 0 100 2 1 1 0 000-2z"/></svg>',"paste-row-before":'<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 012.8 2H18c1 0 2 .8 2 1.9V7h-2V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-1-1V5H6v13h12v-4h2v4c0 1-.8 2-1.9 2H6c-1 0-2-.8-2-1.9V5c0-1 .8-2 1.9-2H9.2A3 3 0 0112 1zm10 7v5H8V8h14zm-1.5 1.5h-11v2h11v-2zM12 3a1 1 0 100 2 1 1 0 000-2z"/></svg>',"paste-text":'<svg width="24" height="24"><path d="M18 9V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-1-1V5H6v13h3V9h9zM9 20H6a2 2 0 01-2-2V5c0-1.1.9-2 2-2h3.2A3 3 0 0112 1a3 3 0 012.8 2H18a2 2 0 012 2v4h1v12H9v-1zm1.5-9.5v9h9v-9h-9zM12 3a1 1 0 00-1 1c0 .5.4 1 1 1s1-.5 1-1-.4-1-1-1zm0 9h6v2h-.5l-.5-1h-1v4h.8v1h-3.6v-1h.8v-4h-1l-.5 1H12v-2z" fill-rule="nonzero"/></svg>',paste:'<svg width="24" height="24"><path d="M18 9V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-1-1V5H6v13h3V9h9zM9 20H6a2 2 0 01-2-2V5c0-1.1.9-2 2-2h3.2A3 3 0 0112 1a3 3 0 012.8 2H18a2 2 0 012 2v4h1v12H9v-1zm1.5-9.5v9h9v-9h-9zM12 3a1 1 0 00-1 1c0 .5.4 1 1 1s1-.5 1-1-.4-1-1-1z" fill-rule="nonzero"/></svg>',"permanent-pen":'<svg width="24" height="24"><path d="M10.5 17.5L8 20H3v-3l3.5-3.5a2 2 0 010-3L14 3l1 1-7.3 7.3a1 1 0 000 1.4l3.6 3.6c.4.4 1 .4 1.4 0L20 9l1 1-7.6 7.6a2 2 0 01-2.8 0l-.1-.1z" fill-rule="nonzero"/></svg>',plus:'<svg width="24" height="24"><path d="M12 4c.5 0 1 .4 1 .9V11h6a1 1 0 01.1 2H13v6a1 1 0 01-2 .1V13H5a1 1 0 01-.1-2H11V5c0-.6.4-1 1-1z"/></svg>',preferences:'<svg width="24" height="24"><path d="M20.1 13.5l-1.9.2a5.8 5.8 0 01-.6 1.5l1.2 1.5c.4.4.3 1 0 1.4l-.7.7a1 1 0 01-1.4 0l-1.5-1.2a6.2 6.2 0 01-1.5.6l-.2 1.9c0 .5-.5.9-1 .9h-1a1 1 0 01-1-.9l-.2-1.9a5.8 5.8 0 01-1.5-.6l-1.5 1.2a1 1 0 01-1.4 0l-.7-.7a1 1 0 010-1.4l1.2-1.5a6.2 6.2 0 01-.6-1.5l-1.9-.2a1 1 0 01-.9-1v-1c0-.5.4-1 .9-1l1.9-.2a5.8 5.8 0 01.6-1.5L5.2 7.3a1 1 0 010-1.4l.7-.7a1 1 0 011.4 0l1.5 1.2a6.2 6.2 0 011.5-.6l.2-1.9c0-.5.5-.9 1-.9h1c.5 0 1 .4 1 .9l.2 1.9a5.8 5.8 0 011.5.6l1.5-1.2a1 1 0 011.4 0l.7.7c.3.4.4 1 0 1.4l-1.2 1.5a6.2 6.2 0 01.6 1.5l1.9.2c.5 0 .9.5.9 1v1c0 .5-.4 1-.9 1zM12 15a3 3 0 100-6 3 3 0 000 6z" fill-rule="evenodd"/></svg>',preview:'<svg width="24" height="24"><path d="M3.5 12.5c.5.8 1.1 1.6 1.8 2.3 2 2 4.2 3.2 6.7 3.2s4.7-1.2 6.7-3.2a16.2 16.2 0 002.1-2.8 15.7 15.7 0 00-2.1-2.8c-2-2-4.2-3.2-6.7-3.2a9.3 9.3 0 00-6.7 3.2A16.2 16.2 0 003.2 12c0 .2.2.3.3.5zm-2.4-1l.7-1.2L4 7.8C6.2 5.4 8.9 4 12 4c3 0 5.8 1.4 8.1 3.8a18.2 18.2 0 012.8 3.7v1l-.7 1.2-2.1 2.5c-2.3 2.4-5 3.8-8.1 3.8-3 0-5.8-1.4-8.1-3.8a18.2 18.2 0 01-2.8-3.7 1 1 0 010-1zm12-3.3a2 2 0 102.7 2.6 4 4 0 11-2.6-2.6z" fill-rule="nonzero"/></svg>',print:'<svg width="24" height="24"><path d="M18 8H6a3 3 0 00-3 3v6h2v3h14v-3h2v-6a3 3 0 00-3-3zm-1 10H7v-4h10v4zm.5-5c-.8 0-1.5-.7-1.5-1.5s.7-1.5 1.5-1.5 1.5.7 1.5 1.5-.7 1.5-1.5 1.5zm.5-8H6v2h12V5z" fill-rule="nonzero"/></svg>',quote:'<svg width="24" height="24"><path d="M7.5 17h.9c.4 0 .7-.2.9-.6L11 13V8c0-.6-.4-1-1-1H6a1 1 0 00-1 1v4c0 .6.4 1 1 1h2l-1.3 2.7a1 1 0 00.8 1.3zm8 0h.9c.4 0 .7-.2.9-.6L19 13V8c0-.6-.4-1-1-1h-4a1 1 0 00-1 1v4c0 .6.4 1 1 1h2l-1.3 2.7a1 1 0 00.8 1.3z" fill-rule="nonzero"/></svg>',redo:'<svg width="24" height="24"><path d="M17.6 10H12c-2.8 0-4.4 1.4-4.9 3.5-.4 2 .3 4 1.4 4.6a1 1 0 11-1 1.8c-2-1.2-2.9-4.1-2.3-6.8.6-3 3-5.1 6.8-5.1h5.6l-3.3-3.3a1 1 0 111.4-1.4l5 5a1 1 0 010 1.4l-5 5a1 1 0 01-1.4-1.4l3.3-3.3z" fill-rule="nonzero"/></svg>',reload:'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M5 22.1l-1.2-4.7v-.2a1 1 0 011-1l5 .4a1 1 0 11-.2 2l-2.2-.2a7.8 7.8 0 008.4.2 7.5 7.5 0 003.5-6.4 1 1 0 112 0 9.5 9.5 0 01-4.5 8 9.9 9.9 0 01-10.2 0l.4 1.4a1 1 0 11-2 .5zM13.6 7.4c0-.5.5-1 1-.9l2.8.2a8 8 0 00-9.5-1 7.5 7.5 0 00-3.6 7 1 1 0 01-2 0 9.5 9.5 0 014.5-8.6 10 10 0 0110.9.3l-.3-1a1 1 0 012-.5l1.1 4.8a1 1 0 01-1 1.2l-5-.4a1 1 0 01-.9-1z"/></g></svg>',"remove-formatting":'<svg width="24" height="24"><path d="M13.2 6a1 1 0 010 .2l-2.6 10a1 1 0 01-1 .8h-.2a.8.8 0 01-.8-1l2.6-10H8a1 1 0 110-2h9a1 1 0 010 2h-3.8zM5 18h7a1 1 0 010 2H5a1 1 0 010-2zm13 1.5L16.5 18 15 19.5a.7.7 0 01-1-1l1.5-1.5-1.5-1.5a.7.7 0 011-1l1.5 1.5 1.5-1.5a.7.7 0 011 1L17.5 17l1.5 1.5a.7.7 0 01-1 1z" fill-rule="evenodd"/></svg>',remove:'<svg width="24" height="24"><path d="M16 7h3a1 1 0 010 2h-1v9a3 3 0 01-3 3H9a3 3 0 01-3-3V9H5a1 1 0 110-2h3V6a3 3 0 013-3h2a3 3 0 013 3v1zm-2 0V6c0-.6-.4-1-1-1h-2a1 1 0 00-1 1v1h4zm2 2H8v9c0 .6.4 1 1 1h6c.6 0 1-.4 1-1V9zm-7 3a1 1 0 012 0v4a1 1 0 01-2 0v-4zm4 0a1 1 0 012 0v4a1 1 0 01-2 0v-4z" fill-rule="nonzero"/></svg>',"resize-handle":'<svg width="10" height="10"><g fill-rule="nonzero"><path d="M8.1 1.1A.5.5 0 119 2l-7 7A.5.5 0 111 8l7-7zM8.1 5.1A.5.5 0 119 6l-3 3A.5.5 0 115 8l3-3z"/></g></svg>',resize:'<svg width="24" height="24"><path d="M4 5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h6c.3 0 .5.1.7.3.2.2.3.4.3.7 0 .3-.1.5-.3.7a1 1 0 01-.7.3H7.4L18 16.6V13c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3.3 0 .5.1.7.3.2.2.3.4.3.7v6c0 .3-.1.5-.3.7a1 1 0 01-.7.3h-6a1 1 0 01-.7-.3 1 1 0 01-.3-.7c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h3.6L6 7.4V11c0 .3-.1.5-.3.7a1 1 0 01-.7.3 1 1 0 01-.7-.3A1 1 0 014 11V5z" fill-rule="evenodd"/></svg>',"restore-draft":'<svg width="24" height="24"><g fill-rule="evenodd"><path d="M17 13c0 .6-.4 1-1 1h-4V8c0-.6.4-1 1-1s1 .4 1 1v4h2c.6 0 1 .4 1 1z"/><path d="M4.7 10H9a1 1 0 010 2H3a1 1 0 01-1-1V5a1 1 0 112 0v3l2.5-2.4a9.2 9.2 0 0110.8-1.5A9 9 0 0113.4 21c-2.4.1-4.7-.7-6.5-2.2a1 1 0 111.3-1.5 7.2 7.2 0 0011.6-3.7 7 7 0 00-3.5-7.7A7.2 7.2 0 008 7L4.7 10z" fill-rule="nonzero"/></g></svg>',"rotate-left":'<svg width="24" height="24"><path d="M4.7 10H9a1 1 0 010 2H3a1 1 0 01-1-1V5a1 1 0 112 0v3l2.5-2.4a9.2 9.2 0 0110.8-1.5A9 9 0 0113.4 21c-2.4.1-4.7-.7-6.5-2.2a1 1 0 111.3-1.5 7.2 7.2 0 0011.6-3.7 7 7 0 00-3.5-7.7A7.2 7.2 0 008 7L4.7 10z" fill-rule="nonzero"/></svg>',"rotate-right":'<svg width="24" height="24"><path d="M20 8V5a1 1 0 012 0v6c0 .6-.4 1-1 1h-6a1 1 0 010-2h4.3L16 7A7.2 7.2 0 007.7 6a7 7 0 003 13.1c1.9.1 3.7-.5 5-1.7a1 1 0 011.4 1.5A9.2 9.2 0 012.2 14c-.9-3.9 1-8 4.5-9.9 3.5-1.9 8-1.3 10.8 1.5L20 8z" fill-rule="nonzero"/></svg>',rtl:'<svg width="24" height="24"><path d="M8 5h8v2h-2v12h-2V7h-2v12H8v-7c-.5 0-1 0-1.4-.3A3.4 3.4 0 014.8 10a3.3 3.3 0 010-2.8 3.4 3.4 0 011.8-1.8L8 5zm12 11.2a1 1 0 11-1 1.6l-3-2a1 1 0 010-1.6l3-2a1 1 0 111 1.6L18.4 15l1.8 1.2z" fill-rule="evenodd"/></svg>',save:'<svg width="24" height="24"><path d="M5 16h14a2 2 0 012 2v2a2 2 0 01-2 2H5a2 2 0 01-2-2v-2c0-1.1.9-2 2-2zm0 2v2h14v-2H5zm10 0h2v2h-2v-2zm-4-6.4L8.7 9.3a1 1 0 10-1.4 1.4l4 4c.4.4 1 .4 1.4 0l4-4a1 1 0 10-1.4-1.4L13 11.6V4a1 1 0 00-2 0v7.6z" fill-rule="nonzero"/></svg>',search:'<svg width="24" height="24"><path d="M16 17.3a8 8 0 111.4-1.4l4.3 4.4a1 1 0 01-1.4 1.4l-4.4-4.3zm-5-.3a6 6 0 100-12 6 6 0 000 12z" fill-rule="nonzero"/></svg>',"select-all":'<svg width="24" height="24"><path d="M3 5h2V3a2 2 0 00-2 2zm0 8h2v-2H3v2zm4 8h2v-2H7v2zM3 9h2V7H3v2zm10-6h-2v2h2V3zm6 0v2h2a2 2 0 00-2-2zM5 21v-2H3c0 1.1.9 2 2 2zm-2-4h2v-2H3v2zM9 3H7v2h2V3zm2 18h2v-2h-2v2zm8-8h2v-2h-2v2zm0 8a2 2 0 002-2h-2v2zm0-12h2V7h-2v2zm0 8h2v-2h-2v2zm-4 4h2v-2h-2v2zm0-16h2V3h-2v2zM7 17h10V7H7v10zm2-8h6v6H9V9z" fill-rule="nonzero"/></svg>',selected:'<svg width="24" height="24"><path fill-rule="nonzero" d="M6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6c0-1.1.9-2 2-2zm3.6 10.9L7 12.3a.7.7 0 00-1 1L9.6 17 18 8.6a.7.7 0 000-1 .7.7 0 00-1 0l-7.4 7.3z"/></svg>',settings:'<svg width="24" height="24"><path d="M11 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8v.3c0 .2 0 .3-.2.5l-.6.2H7.8c-.3 0-.4 0-.6-.2a.7.7 0 01-.2-.6V8H5a1 1 0 110-2h2v-.3c0-.2 0-.3.2-.5l.5-.2h2.5c.3 0 .4 0 .6.2l.2.5V6zM8 8h2V6H8v2zm9 2.8v.2h2c.6 0 1 .4 1 1s-.4 1-1 1h-2v.3c0 .2 0 .3-.2.5l-.6.2h-2.4c-.3 0-.4 0-.6-.2a.7.7 0 01-.2-.6V13H5a1 1 0 010-2h8v-.3c0-.2 0-.3.2-.5l.6-.2h2.4c.3 0 .4 0 .6.2l.2.6zM14 13h2v-2h-2v2zm-3 2.8v.2h8c.6 0 1 .4 1 1s-.4 1-1 1h-8v.3c0 .2 0 .3-.2.5l-.6.2H7.8c-.3 0-.4 0-.6-.2a.7.7 0 01-.2-.6V18H5a1 1 0 010-2h2v-.3c0-.2 0-.3.2-.5l.5-.2h2.5c.3 0 .4 0 .6.2l.2.6zM8 18h2v-2H8v2z" fill-rule="evenodd"/></svg>',sharpen:'<svg width="24" height="24"><path d="M16 6l4 4-8 9-8-9 4-4h8zm-4 10.2l5.5-6.2-.1-.1H12v-.3h5.1l-.2-.2H12V9h4.6l-.2-.2H12v-.3h4.1l-.2-.2H12V8h3.6l-.2-.2H8.7L6.5 10l.1.1H12v.3H6.9l.2.2H12v.3H7.3l.2.2H12v.3H7.7l.3.2h4v.3H8.2l.2.2H12v.3H8.6l.3.2H12v.3H9l.3.2H12v.3H9.5l.2.2H12v.3h-2l.2.2H12v.3h-1.6l.2.2H12v.3h-1.1l.2.2h.9v.3h-.7l.2.2h.5v.3h-.3l.3.2z" fill-rule="evenodd"/></svg>',sourcecode:'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M9.8 15.7c.3.3.3.8 0 1-.3.4-.9.4-1.2 0l-4.4-4.1a.8.8 0 010-1.2l4.4-4.2c.3-.3.9-.3 1.2 0 .3.3.3.8 0 1.1L6 12l3.8 3.7zM14.2 15.7c-.3.3-.3.8 0 1 .4.4.9.4 1.2 0l4.4-4.1c.3-.3.3-.9 0-1.2l-4.4-4.2a.8.8 0 00-1.2 0c-.3.3-.3.8 0 1.1L18 12l-3.8 3.7z"/></g></svg>',"spell-check":'<svg width="24" height="24"><path d="M6 8v3H5V5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h2c.3 0 .5.1.7.3.2.2.3.4.3.7v6H8V8H6zm0-3v2h2V5H6zm13 0h-3v5h3v1h-3a1 1 0 01-.7-.3 1 1 0 01-.3-.7V5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h3v1zm-5 1.5l-.1.7c-.1.2-.3.3-.6.3.3 0 .5.1.6.3l.1.7V10c0 .3-.1.5-.3.7a1 1 0 01-.7.3h-3V4h3c.3 0 .5.1.7.3.2.2.3.4.3.7v1.5zM13 10V8h-2v2h2zm0-3V5h-2v2h2zm3 5l1 1-6.5 7L7 15.5l1.3-1 2.2 2.2L16 12z" fill-rule="evenodd"/></svg>',"strike-through":'<svg width="24" height="24"><g fill-rule="evenodd"><path d="M15.6 8.5c-.5-.7-1-1.1-1.3-1.3-.6-.4-1.3-.6-2-.6-2.7 0-2.8 1.7-2.8 2.1 0 1.6 1.8 2 3.2 2.3 4.4.9 4.6 2.8 4.6 3.9 0 1.4-.7 4.1-5 4.1A6.2 6.2 0 017 16.4l1.5-1.1c.4.6 1.6 2 3.7 2 1.6 0 2.5-.4 3-1.2.4-.8.3-2-.8-2.6-.7-.4-1.6-.7-2.9-1-1-.2-3.9-.8-3.9-3.6C7.6 6 10.3 5 12.4 5c2.9 0 4.2 1.6 4.7 2.4l-1.5 1.1z"/><path d="M5 11h14a1 1 0 010 2H5a1 1 0 010-2z" fill-rule="nonzero"/></g></svg>',subscript:'<svg width="24" height="24"><path d="M10.4 10l4.6 4.6-1.4 1.4L9 11.4 4.4 16 3 14.6 7.6 10 3 5.4 4.4 4 9 8.6 13.6 4 15 5.4 10.4 10zM21 19h-5v-1l1-.8 1.7-1.6c.3-.4.5-.8.5-1.2 0-.3 0-.6-.2-.7-.2-.2-.5-.3-.9-.3a2 2 0 00-.8.2l-.7.3-.4-1.1 1-.6 1.2-.2c.8 0 1.4.3 1.8.7.4.4.6.9.6 1.5s-.2 1.1-.5 1.6a8 8 0 01-1.3 1.3l-.6.6h2.6V19z" fill-rule="nonzero"/></svg>',superscript:'<svg width="24" height="24"><path d="M15 9.4L10.4 14l4.6 4.6-1.4 1.4L9 15.4 4.4 20 3 18.6 7.6 14 3 9.4 4.4 8 9 12.6 13.6 8 15 9.4zm5.9 1.6h-5v-1l1-.8 1.7-1.6c.3-.5.5-.9.5-1.3 0-.3 0-.5-.2-.7-.2-.2-.5-.3-.9-.3l-.8.2-.7.4-.4-1.2c.2-.2.5-.4 1-.5.3-.2.8-.2 1.2-.2.8 0 1.4.2 1.8.6.4.4.6 1 .6 1.6 0 .5-.2 1-.5 1.5l-1.3 1.4-.6.5h2.6V11z" fill-rule="nonzero"/></svg>',"table-caption":'<svg width="24" height="24"><g fill-rule="nonzero"><rect width="12" height="2" x="3" y="4" rx="1"/><path d="M19 8a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2v-8c0-1.1.9-2 2-2h14zM5 15v3h6v-3H5zm14 0h-6v3h6v-3zm0-5h-6v3h6v-3zM5 13h6v-3H5v3z"/></g></svg>',"table-cell-classes":'<svg width="24" height="24"><g fill-rule="evenodd"><path fill-rule="nonzero" d="M13 4v9H3V6c0-1.1.9-2 2-2h8zm-2 2H5v5h6V6z"/><path fill-rule="nonzero" d="M13 4h6a2 2 0 012 2v7h-8v-2h6V6h-6V4z" opacity=".2"/><path d="M18 20l-2.6 1.6.7-3-2.4-2 3.1-.2 1.2-2.9 1.2 2.9 3 .2-2.3 2 .7 3z"/><path fill-rule="nonzero" d="M3 13v5c0 1.1.9 2 2 2h8v-7h-2v5H5v-5H3z" opacity=".2"/></g></svg>',"table-cell-properties":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm-8 9H5v5h6v-5zm8 0h-6v5h6v-5zm-8-7H5v5h6V6z"/></svg>',"table-cell-select-all":'<svg width="24" height="24"><g fill-rule="evenodd"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm0 2H5v12h14V6z"/><path d="M13 6v5h6v2h-6v5h-2v-5H5v-2h6V6h2z" opacity=".2"/></g></svg>',"table-cell-select-inner":'<svg width="24" height="24"><g fill-rule="evenodd"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm0 2H5v12h14V6z" opacity=".2"/><path d="M13 6v5h6v2h-6v5h-2v-5H5v-2h6V6h2z"/></g></svg>',"table-classes":'<svg width="24" height="24"><g fill-rule="evenodd"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v7h-8v7H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm-8 9H5v5h6v-5zm8-7h-6v5h6V6zm-8 0H5v5h6V6z"/><path d="M18 20l-2.6 1.6.7-3-2.4-2 3.1-.2 1.2-2.9 1.2 2.9 3 .2-2.3 2 .7 3z"/></g></svg>',"table-delete-column":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm-4 4h-2V6h-2v2H9V6H5v12h4v-2h2v2h2v-2h2v2h4V6h-4v2zm.3.5l1 1.2-3 2.3 3 2.3-1 1.2L12 13l-3.3 2.6-1-1.2 3-2.3-3-2.3 1-1.2L12 11l3.3-2.5z"/></svg>',"table-delete-row":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm0 2H5v3h2.5v2H5v2h2.5v2H5v3h14v-3h-2.5v-2H19v-2h-2.5V9H19V6zm-4.7 1.8l1.2 1L13 12l2.6 3.3-1.2 1-2.3-3-2.3 3-1.2-1L11 12 8.5 8.7l1.2-1 2.3 3 2.3-3z"/></svg>',"table-delete-table":'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zM5 6v12h14V6H5z"/><path d="M14.4 8.6l1 1-2.3 2.4 2.3 2.4-1 1-2.4-2.3-2.4 2.3-1-1 2.3-2.4-2.3-2.4 1-1 2.4 2.3z"/></g></svg>',"table-insert-column-after":'<svg width="24" height="24"><path fill-rule="nonzero" d="M20 4c.6 0 1 .4 1 1v2a1 1 0 01-2 0V6h-8v12h8v-1a1 1 0 012 0v2c0 .5-.4 1-.9 1H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h15zM9 13H5v5h4v-5zm7-5c.5 0 1 .4 1 .9V11h2a1 1 0 01.1 2H17v2a1 1 0 01-2 .1V13h-2a1 1 0 01-.1-2H15V9c0-.6.4-1 1-1zM9 6H5v5h4V6z"/></svg>',"table-insert-column-before":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H4a1 1 0 01-1-1v-2a1 1 0 012 0v1h8V6H5v1a1 1 0 11-2 0V5c0-.6.4-1 1-1h15zm0 9h-4v5h4v-5zM8 8c.5 0 1 .4 1 .9V11h2a1 1 0 01.1 2H9v2a1 1 0 01-2 .1V13H5a1 1 0 01-.1-2H7V9c0-.6.4-1 1-1zm11-2h-4v5h4V6z"/></svg>',"table-insert-row-above":'<svg width="24" height="24"><path fill-rule="nonzero" d="M6 4a1 1 0 110 2H5v6h14V6h-1a1 1 0 010-2h2c.6 0 1 .4 1 1v13a2 2 0 01-2 2H5a2 2 0 01-2-2V5c0-.6.4-1 1-1h2zm5 10H5v4h6v-4zm8 0h-6v4h6v-4zM12 3c.5 0 1 .4 1 .9V6h2a1 1 0 010 2h-2v2a1 1 0 01-2 .1V8H9a1 1 0 010-2h2V4c0-.6.4-1 1-1z"/></svg>',"table-insert-row-after":'<svg width="24" height="24"><path fill-rule="nonzero" d="M12 13c.5 0 1 .4 1 .9V16h2a1 1 0 01.1 2H13v2a1 1 0 01-2 .1V18H9a1 1 0 01-.1-2H11v-2c0-.6.4-1 1-1zm6 7a1 1 0 010-2h1v-6H5v6h1a1 1 0 010 2H4a1 1 0 01-1-1V6c0-1.1.9-2 2-2h14a2 2 0 012 2v13c0 .5-.4 1-.9 1H18zM11 6H5v4h6V6zm8 0h-6v4h6V6z"/></svg>',"table-left-header":'<svg width="24" height="24"><path d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm0 9h-4v5h4v-5zm-6 0H9v5h4v-5zm0-7H9v5h4V6zm6 0h-4v5h4V6z"/></svg>',"table-merge-cells":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zM5 15.5V18h3v-2.5H5zm14-5h-9V18h9v-7.5zM19 6h-4v2.5h4V6zM8 6H5v2.5h3V6zm5 0h-3v2.5h3V6zm-8 7.5h3v-3H5v3z"/></svg>',"table-row-numbering-rtl":'<svg width="24" height="24"><path d="M6 4a2 2 0 00-2 2v13c0 1.1.9 2 2 2h12a2 2 0 002-2V6a2 2 0 00-2-2H6zm0 12h8v3H6v-3zm11 0c.6 0 1 .4 1 1v1a1 1 0 01-2 0v-1c0-.6.4-1 1-1zM6 11h8v3H6v-3zm11 0c.6 0 1 .4 1 1v1a1 1 0 01-2 0v-1c0-.6.4-1 1-1zM6 6h8v3H6V6zm11 0c.6 0 1 .4 1 1v1a1 1 0 11-2 0V7c0-.6.4-1 1-1z"/></svg>',"table-row-numbering":'<svg width="24" height="24"><path d="M18 4a2 2 0 012 2v13a2 2 0 01-2 2H6a2 2 0 01-2-2V6c0-1.1.9-2 2-2h12zm0 12h-8v3h8v-3zM7 16a1 1 0 00-1 1v1a1 1 0 002 0v-1c0-.6-.4-1-1-1zm11-5h-8v3h8v-3zM7 11a1 1 0 00-1 1v1a1 1 0 002 0v-1c0-.6-.4-1-1-1zm11-5h-8v3h8V6zM7 6a1 1 0 00-1 1v1a1 1 0 102 0V7c0-.6-.4-1-1-1z"/></svg>',"table-row-properties":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zM5 15v3h6v-3H5zm14 0h-6v3h6v-3zm0-9h-6v3h6V6zM5 9h6V6H5v3z"/></svg>',"table-split-cells":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zM8 15.5H5V18h3v-2.5zm11-5h-9V18h9v-7.5zm-2.5 1l1 1-2 2 2 2-1 1-2-2-2 2-1-1 2-2-2-2 1-1 2 2 2-2zm-8.5-1H5v3h3v-3zM19 6h-4v2.5h4V6zM8 6H5v2.5h3V6zm5 0h-3v2.5h3V6z"/></svg>',"table-top-header":'<svg width="24" height="24"><path d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm-8 11H5v3h6v-3zm8 0h-6v3h6v-3zm0-5h-6v3h6v-3zM5 13h6v-3H5v3z"/></svg>',table:'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zM5 14v4h6v-4H5zm14 0h-6v4h6v-4zm0-6h-6v4h6V8zM5 12h6V8H5v4z"/></svg>',template:'<svg width="24" height="24"><path d="M19 19v-1H5v1h14zM9 16v-4a5 5 0 116 0v4h4a2 2 0 012 2v3H3v-3c0-1.1.9-2 2-2h4zm4 0v-5l.8-.6a3 3 0 10-3.6 0l.8.6v5h2z" fill-rule="nonzero"/></svg>',"temporary-placeholder":'<svg width="24" height="24"><g fill-rule="evenodd"><path d="M9 7.6V6h2.5V4.5a.5.5 0 111 0V6H15v1.6a8 8 0 11-6 0zm-2.6 5.3a.5.5 0 00.3.6c.3 0 .6 0 .6-.3l.1-.2a5 5 0 013.3-2.8c.3-.1.4-.4.4-.6-.1-.3-.4-.5-.6-.4a6 6 0 00-4.1 3.7z"/><circle cx="14" cy="4" r="1"/><circle cx="12" cy="2" r="1"/><circle cx="10" cy="4" r="1"/></g></svg>',"text-color":'<svg width="24" height="24"><g fill-rule="evenodd"><path id="tox-icon-text-color__color" d="M3 18h18v3H3z"/><path d="M8.7 16h-.8a.5.5 0 01-.5-.6l2.7-9c.1-.3.3-.4.5-.4h2.8c.2 0 .4.1.5.4l2.7 9a.5.5 0 01-.5.6h-.8a.5.5 0 01-.4-.4l-.7-2.2c0-.3-.3-.4-.5-.4h-3.4c-.2 0-.4.1-.5.4l-.7 2.2c0 .3-.2.4-.4.4zm2.6-7.6l-.6 2a.5.5 0 00.5.6h1.6a.5.5 0 00.5-.6l-.6-2c0-.3-.3-.4-.5-.4h-.4c-.2 0-.4.1-.5.4z"/></g></svg>',toc:'<svg width="24" height="24"><path d="M5 5c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 110-2zm3 0h11c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 110-2zm-3 8c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 010-2zm3 0h11c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 010-2zm0-4c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 110-2zm3 0h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm-3 8c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 010-2zm3 0h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2z" fill-rule="evenodd"/></svg>',translate:'<svg width="24" height="24"><path d="M12.7 14.3l-.3.7-.4.7-2.2-2.2-3.1 3c-.3.4-.8.4-1 0a.7.7 0 010-1l3.1-3A12.4 12.4 0 016.7 9H8a10.1 10.1 0 001.7 2.4c.5-.5 1-1.1 1.4-1.8l.9-2H4.7a.7.7 0 110-1.5h4.4v-.7c0-.4.3-.8.7-.8.4 0 .7.4.7.8v.7H15c.4 0 .8.3.8.7 0 .4-.4.8-.8.8h-1.4a12.3 12.3 0 01-1 2.4 13.5 13.5 0 01-1.7 2.3l1.9 1.8zm4.3-3l2.7 7.3a.5.5 0 01-.4.7 1 1 0 01-1-.7l-.6-1.5h-3.4l-.6 1.5a1 1 0 01-1 .7.5.5 0 01-.4-.7l2.7-7.4a1 1 0 012 0zm-2.2 4.4h2.4L16 12.5l-1.2 3.2z" fill-rule="evenodd"/></svg>',underline:'<svg width="24" height="24"><path d="M16 5c.6 0 1 .4 1 1v5.5a4 4 0 01-.4 1.8l-1 1.4a5.3 5.3 0 01-5.5 1 5 5 0 01-1.6-1c-.5-.4-.8-.9-1.1-1.4a4 4 0 01-.4-1.8V6c0-.6.4-1 1-1s1 .4 1 1v5.5c0 .3 0 .6.2 1l.6.7a3.3 3.3 0 002.2.8 3.4 3.4 0 002.2-.8c.3-.2.4-.5.6-.8l.2-.9V6c0-.6.4-1 1-1zM8 17h8c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 010-2z" fill-rule="evenodd"/></svg>',undo:'<svg width="24" height="24"><path d="M6.4 8H12c3.7 0 6.2 2 6.8 5.1.6 2.7-.4 5.6-2.3 6.8a1 1 0 01-1-1.8c1.1-.6 1.8-2.7 1.4-4.6-.5-2.1-2.1-3.5-4.9-3.5H6.4l3.3 3.3a1 1 0 11-1.4 1.4l-5-5a1 1 0 010-1.4l5-5a1 1 0 011.4 1.4L6.4 8z" fill-rule="nonzero"/></svg>',unlink:'<svg width="24" height="24"><path d="M6.2 12.3a1 1 0 011.4 1.4l-2 2a2 2 0 102.6 2.8l4.8-4.8a1 1 0 000-1.4 1 1 0 111.4-1.3 2.9 2.9 0 010 4L9.6 20a3.9 3.9 0 01-5.5-5.5l2-2zm11.6-.6a1 1 0 01-1.4-1.4l2.1-2a2 2 0 10-2.7-2.8L11 10.3a1 1 0 000 1.4A1 1 0 119.6 13a2.9 2.9 0 010-4L14.4 4a3.9 3.9 0 015.5 5.5l-2 2zM7.6 6.3a.8.8 0 01-1 1.1L3.3 4.2a.7.7 0 111-1l3.2 3.1zM5.1 8.6a.8.8 0 010 1.5H3a.8.8 0 010-1.5H5zm5-3.5a.8.8 0 01-1.5 0V3a.8.8 0 011.5 0V5zm6 11.8a.8.8 0 011-1l3.2 3.2a.8.8 0 01-1 1L16 17zm-2.2 2a.8.8 0 011.5 0V21a.8.8 0 01-1.5 0V19zm5-3.5a.7.7 0 110-1.5H21a.8.8 0 010 1.5H19z" fill-rule="nonzero"/></svg>',unlock:'<svg width="24" height="24"><path d="M16 5c.8 0 1.5.3 2.1.9.6.6.9 1.3.9 2.1v3h-2V8a1 1 0 00-.3-.7A1 1 0 0016 7h-2a1 1 0 00-.7.3 1 1 0 00-.3.7v3h.3c.2 0 .3 0 .5.2l.2.6v7.4c0 .3 0 .4-.2.6l-.6.2H4.8c-.3 0-.4 0-.6-.2a.7.7 0 01-.2-.6v-7.4c0-.3 0-.4.2-.6l.5-.2H11V8c0-.8.3-1.5.9-2.1.6-.6 1.3-.9 2.1-.9h2z" fill-rule="evenodd"/></svg>',"unordered-list":'<svg width="24" height="24"><path d="M11 5h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zM4.5 6c0-.4.1-.8.4-1 .3-.4.7-.5 1.1-.5.4 0 .8.1 1 .4.4.3.5.7.5 1.1 0 .4-.1.8-.4 1-.3.4-.7.5-1.1.5-.4 0-.8-.1-1-.4-.4-.3-.5-.7-.5-1.1zm0 6c0-.4.1-.8.4-1 .3-.4.7-.5 1.1-.5.4 0 .8.1 1 .4.4.3.5.7.5 1.1 0 .4-.1.8-.4 1-.3.4-.7.5-1.1.5-.4 0-.8-.1-1-.4-.4-.3-.5-.7-.5-1.1zm0 6c0-.4.1-.8.4-1 .3-.4.7-.5 1.1-.5.4 0 .8.1 1 .4.4.3.5.7.5 1.1 0 .4-.1.8-.4 1-.3.4-.7.5-1.1.5-.4 0-.8-.1-1-.4-.4-.3-.5-.7-.5-1.1z" fill-rule="evenodd"/></svg>',unselected:'<svg width="24" height="24"><path fill-rule="nonzero" d="M6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6c0-1.1.9-2 2-2zm0 1a1 1 0 00-1 1v12c0 .6.4 1 1 1h12c.6 0 1-.4 1-1V6c0-.6-.4-1-1-1H6z"/></svg>',upload:'<svg width="24" height="24"><path d="M18 19v-2a1 1 0 012 0v3c0 .6-.4 1-1 1H5a1 1 0 01-1-1v-3a1 1 0 012 0v2h12zM11 6.4L8.7 8.7a1 1 0 01-1.4-1.4l4-4a1 1 0 011.4 0l4 4a1 1 0 11-1.4 1.4L13 6.4V16a1 1 0 01-2 0V6.4z" fill-rule="nonzero"/></svg>',user:'<svg width="24" height="24"><path d="M12 24a12 12 0 110-24 12 12 0 010 24zm-8.7-5.3a11 11 0 0017.4 0C19.4 16.3 14.6 15 12 15c-2.6 0-7.4 1.3-8.7 3.7zM12 13c2.2 0 4-2 4-4.5S14.2 4 12 4 8 6 8 8.5 9.8 13 12 13z" fill-rule="nonzero"/></svg>',"vertical-align":'<svg width="24" height="24"><g fill-rule="nonzero"><rect width="18" height="2" x="3" y="11" rx="1"/><path d="M12 2c.6 0 1 .4 1 1v4l2-1.3a1 1 0 011.2 1.5l-.1.1-4.1 3-4-3a1 1 0 011-1.7l2 1.5V3c0-.6.4-1 1-1zm0 11.8l4 2.9a1 1 0 01-1 1.7l-2-1.5V21c0 .5-.4 1-.9 1H12a1 1 0 01-1-1v-4l-2 1.3a1 1 0 01-1.2-.1l-.1-.1a1 1 0 01.1-1.3l.1-.1 4.1-3z"/></g></svg>',visualblocks:'<svg width="24" height="24"><path d="M9 19v2H7v-2h2zm-4 0v2a2 2 0 01-2-2h2zm8 0v2h-2v-2h2zm8 0a2 2 0 01-2 2v-2h2zm-4 0v2h-2v-2h2zM15 7a1 1 0 010 2v7a1 1 0 01-2 0V9h-1v7a1 1 0 01-2 0v-4a2.5 2.5 0 01-.2-5H15zM5 15v2H3v-2h2zm16 0v2h-2v-2h2zM5 11v2H3v-2h2zm16 0v2h-2v-2h2zM5 7v2H3V7h2zm16 0v2h-2V7h2zM5 3v2H3c0-1.1.9-2 2-2zm8 0v2h-2V3h2zm6 0a2 2 0 012 2h-2V3zM9 3v2H7V3h2zm8 0v2h-2V3h2z" fill-rule="evenodd"/></svg>',visualchars:'<svg width="24" height="24"><path d="M10 5h7a1 1 0 010 2h-1v11a1 1 0 01-2 0V7h-2v11a1 1 0 01-2 0v-6c-.5 0-1 0-1.4-.3A3.4 3.4 0 016.8 10a3.3 3.3 0 010-2.8 3.4 3.4 0 011.8-1.8L10 5z" fill-rule="evenodd"/></svg>',warning:'<svg width="24" height="24"><path d="M19.8 18.3c.2.5.3.9 0 1.2-.1.3-.5.5-1 .5H5.2c-.5 0-.9-.2-1-.5-.3-.3-.2-.7 0-1.2L11 4.7l.5-.5.5-.2c.2 0 .3 0 .5.2.2 0 .3.3.5.5l6.8 13.6zM12 18c.3 0 .5-.1.7-.3.2-.2.3-.4.3-.7a1 1 0 00-.3-.7 1 1 0 00-.7-.3 1 1 0 00-.7.3 1 1 0 00-.3.7c0 .3.1.5.3.7.2.2.4.3.7.3zm.7-3l.3-4a1 1 0 00-.3-.7 1 1 0 00-.7-.3 1 1 0 00-.7.3 1 1 0 00-.3.7l.3 4h1.4z" fill-rule="evenodd"/></svg>',"zoom-in":'<svg width="24" height="24"><path d="M16 17.3a8 8 0 111.4-1.4l4.3 4.4a1 1 0 01-1.4 1.4l-4.4-4.3zm-5-.3a6 6 0 100-12 6 6 0 000 12zm-1-9a1 1 0 012 0v6a1 1 0 01-2 0V8zm-2 4a1 1 0 010-2h6a1 1 0 010 2H8z" fill-rule="nonzero"/></svg>',"zoom-out":'<svg width="24" height="24"><path d="M16 17.3a8 8 0 111.4-1.4l4.3 4.4a1 1 0 01-1.4 1.4l-4.4-4.3zm-5-.3a6 6 0 100-12 6 6 0 000 12zm-3-5a1 1 0 010-2h6a1 1 0 010 2H8z" fill-rule="nonzero"/></svg>'}})},Wlyy:function(t,e){!function(){"use strict";tinymce.util.Tools.resolve("tinymce.PluginManager").add("contextmenu",function(){})}()},Z3om:function(t,e){!function(){"use strict";var t,e,n=tinymce.util.Tools.resolve("tinymce.PluginManager"),r=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},o=function(t){return function(e){return typeof e===t}},i=r("string"),u=r("object"),a=r("array"),c=o("boolean"),s=o("function"),l=o("number"),f=function(){},d=function(t){return function(){return t}},m=function(t){return t},g=function(t,e){return t===e},h=function(t){return function(e){return!t(e)}},p=d(!1),v=d(!0),b=function(){return y},y={fold:function(t,e){return t()},isSome:p,isNone:v,getOr:e=m,getOrThunk:t=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:d(null),getOrUndefined:d(void 0),or:e,orThunk:t,map:b,each:f,bind:b,exists:p,forall:v,filter:function(){return b()},toArray:function(){return[]},toString:d("none()")},w=function(t){var e=d(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},isSome:v,isNone:p,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return w(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:y},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},x={some:w,none:b,from:function(t){return null===t||void 0===t?y:w(t)}},C=Array.prototype.slice,S=Array.prototype.push,k=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},O=function(t,e){for(var n=0,r=t.length;n<r;n++){e(t[n],n)}},T=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n},_=function(t,e,n){return O(t,function(t,r){n=e(n,t,r)}),n},E=function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return x.some(i);if(n(i,r))break}return x.none()},D=function(t,e){return E(t,e,p)},A=function(t,e){return function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!a(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);S.apply(e,t[n])}return e}(k(t,e))},N=function(t){var e=C.call(t,0);return e.reverse(),e},M=function(t,e){return e>=0&&e<t.length?x.some(t[e]):x.none()},z=function(t){return M(t,0)},R=function(t){return M(t,t.length-1)},B=function(){return(B=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};var L,P=function(){return H(0,0)},H=function(t,e){return{major:t,minor:e}},I={nu:H,detect:function(t,e){var n=String(e).toLowerCase();return 0===t.length?P():function(t,e){var n=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(r.test(e))return r}}(t,e);if(!n)return{major:0,minor:0};var r=function(t){return Number(e.replace(n,"$"+t))};return H(r(1),r(2))}(t,n)},unknown:P},F=function(t,e){return function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return x.none()}(e.brands,function(e){var n=e.brand.toLowerCase();return D(t,function(t){var e;return n===(null===(e=t.brand)||void 0===e?void 0:e.toLowerCase())}).map(function(t){return{current:t.name,version:I.nu(parseInt(e.version,10),0)}})})},V=function(t,e){var n=String(e).toLowerCase();return D(t,function(t){return t.search(n)})},U=function(t,e){return-1!==t.indexOf(e)},j=(L=/^\s+|\s+$/g,function(t){return t.replace(L,"")}),W=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,q=function(t){return function(e){return U(e,t)}},$=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return U(t,"edge/")&&U(t,"chrome")&&U(t,"safari")&&U(t,"applewebkit")}},{name:"Chrome",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,W],search:function(t){return U(t,"chrome")&&!U(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return U(t,"msie")||U(t,"trident")}},{name:"Opera",versionRegexes:[W,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:q("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:q("firefox")},{name:"Safari",versionRegexes:[W,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(U(t,"safari")||U(t,"mobile/"))&&U(t,"applewebkit")}}],G=[{name:"Windows",search:q("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return U(t,"iphone")||U(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:q("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:q("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:q("linux"),versionRegexes:[]},{name:"Solaris",search:q("sunos"),versionRegexes:[]},{name:"FreeBSD",search:q("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:q("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],K={browsers:d($),oses:d(G)},X=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isEdge:r("Edge"),isChrome:r("Chrome"),isIE:r("IE"),isOpera:r("Opera"),isFirefox:r("Firefox"),isSafari:r("Safari")}},Y={unknown:function(){return X({current:void 0,version:I.unknown()})},nu:X,edge:d("Edge"),chrome:d("Chrome"),ie:d("IE"),opera:d("Opera"),firefox:d("Firefox"),safari:d("Safari")},J=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isWindows:r("Windows"),isiOS:r("iOS"),isAndroid:r("Android"),isOSX:r("OSX"),isLinux:r("Linux"),isSolaris:r("Solaris"),isFreeBSD:r("FreeBSD"),isChromeOS:r("ChromeOS")}},Q={unknown:function(){return J({current:void 0,version:I.unknown()})},nu:J,windows:d("Windows"),ios:d("iOS"),android:d("Android"),linux:d("Linux"),osx:d("OSX"),solaris:d("Solaris"),freebsd:d("FreeBSD"),chromeos:d("ChromeOS")},Z=function(t,e,n){var r=K.browsers(),o=K.oses(),i=e.bind(function(t){return F(r,t)}).orThunk(function(){return function(t,e){return V(t,e).map(function(t){var n=I.detect(t.versionRegexes,e);return{current:t.name,version:n}})}(r,t)}).fold(Y.unknown,Y.nu),u=function(t,e){return V(t,e).map(function(t){var n=I.detect(t.versionRegexes,e);return{current:t.name,version:n}})}(o,t).fold(Q.unknown,Q.nu);return{browser:i,os:u,deviceType:function(t,e,n,r){var o=t.isiOS()&&!0===/ipad/i.test(n),i=t.isiOS()&&!o,u=t.isiOS()||t.isAndroid(),a=u||r("(pointer:coarse)"),c=o||!i&&u&&r("(min-device-width:768px)"),s=i||u&&!c,l=e.isSafari()&&t.isiOS()&&!1===/safari/i.test(n),f=!s&&!c&&!l;return{isiPad:d(o),isiPhone:d(i),isTablet:d(c),isPhone:d(s),isTouch:d(a),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:d(l),isDesktop:d(f)}}(u,i,t,n)}},tt=function(t){return window.matchMedia(t).matches},et=function(t){var e,n=!1;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=!0,e=t.apply(null,r)),e}}(function(){return Z(navigator.userAgent,x.from(navigator.userAgentData),tt)}),nt=function(t){if(null===t||void 0===t)throw new Error("Node cannot be null or undefined");return{dom:t}},rt={fromHtml:function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return nt(n.childNodes[0])},fromTag:function(t,e){var n=(e||document).createElement(t);return nt(n)},fromText:function(t,e){var n=(e||document).createTextNode(t);return nt(n)},fromDom:nt,fromPoint:function(t,e,n){return x.from(t.dom.elementFromPoint(e,n)).map(nt)}},ot=function(t,e){return t.dom===e.dom},it=function(t,e){return n=t.dom,r=e.dom,function(t,e,n){return 0!=(t.compareDocumentPosition(e)&n)}(n,r,Node.DOCUMENT_POSITION_CONTAINED_BY);var n,r},ut=function(t,e){return et().browser.isIE()?it(t,e):function(t,e){var n=t.dom,r=e.dom;return n!==r&&n.contains(r)}(t,e)},at=function(t,e){var n=t.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},ct=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),st=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),lt=tinymce.util.Tools.resolve("tinymce.util.VK"),ft=Object.keys,dt=function(t,e){for(var n=ft(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}},mt=function(t,e){var n,r={};return function(t,e,n,r){dt(t,function(t,o){(e(t,o)?n:r)(t,o)})}(t,e,(n=r,function(t,e){n[e]=t}),f),r};"undefined"!=typeof window?window:Function("return this;")();var gt,ht=function(t){return t.dom.nodeName.toLowerCase()},pt=(gt=1,function(t){return function(t){return t.dom.nodeType}(t)===gt}),vt=function(t){return function(e){return pt(e)&&ht(e)===t}},bt=function(t,e){var n=t.dom;dt(e,function(t,e){!function(t,e,n){if(!(i(n)||c(n)||l(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")}(n,e,t)})},yt=function(t){return _(t.dom.attributes,function(t,e){return t[e.name]=e.value,t},{})},wt=function(t){return x.from(t.dom.parentNode).map(rt.fromDom)},xt=function(t){return k(t.dom.childNodes,rt.fromDom)},Ct=function(t,e){var n=t.dom.childNodes;return x.from(n[e]).map(rt.fromDom)},St=function(t){return Ct(t,0)},kt=function(t){return Ct(t,t.dom.childNodes.length-1)},Ot=function(t,e){wt(t).each(function(n){n.dom.insertBefore(e.dom,t.dom)})},Tt=function(t,e){t.dom.appendChild(e.dom)},_t=function(t,e){O(e,function(e){Tt(t,e)})},Et=function(t){var e=t.dom;null!==e.parentNode&&e.parentNode.removeChild(e)},Dt=function(t){return function(t,e){return rt.fromDom(t.dom.cloneNode(e))}(t,!0)},At=function(t,e){var n=function(t,e){var n=rt.fromTag(e),r=yt(t);return bt(n,r),n}(t,e);Ot(t,n);var r=xt(t);return _t(n,r),Et(t),n},Nt=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),Mt=tinymce.util.Tools.resolve("tinymce.util.Tools"),zt=function(t){return function(e){return e&&e.nodeName.toLowerCase()===t}},Rt=function(t){return function(e){return e&&t.test(e.nodeName)}},Bt=function(t){return t&&3===t.nodeType},Lt=Rt(/^(OL|UL|DL)$/),Pt=Rt(/^(OL|UL)$/),Ht=zt("ol"),It=Rt(/^(LI|DT|DD)$/),Ft=Rt(/^(DT|DD)$/),Vt=Rt(/^(TH|TD)$/),Ut=zt("br"),jt=function(t,e){return e&&!!t.schema.getTextBlockElements()[e.nodeName]},Wt=function(t,e){return t&&t.nodeName in e},qt=function(t,e,n){var r=t.isEmpty(e);return!(n&&t.select("span[data-mce-type=bookmark]",e).length>0)&&r},$t=function(t,e){return t.isChildOf(e,t.getRoot())},Gt=function(t,e){var n,r,o,i=t.dom,u=t.schema.getBlockElements(),a=i.createFragment(),c=function(t){var e=t.getParam("forced_root_block","p");return!1===e?"":!0===e?"p":e}(t);if(c&&((r=i.create(c)).tagName===c.toUpperCase()&&i.setAttribs(r,function(t){return t.getParam("forced_root_block_attrs",{})}(t)),Wt(e.firstChild,u)||a.appendChild(r)),e)for(;n=e.firstChild;){var s=n.nodeName;o||"SPAN"===s&&"bookmark"===n.getAttribute("data-mce-type")||(o=!0),Wt(n,u)?(a.appendChild(n),r=null):c?(r||(r=i.create(c),a.appendChild(r)),r.appendChild(n)):a.appendChild(n)}return c?o||r.appendChild(i.create("br",{"data-mce-bogus":"1"})):a.appendChild(i.create("br")),a},Kt=Nt.DOM,Xt=vt("dd"),Yt=vt("dt"),Jt=function(t,e){Xt(e)?At(e,"dt"):Yt(e)&&wt(e).each(function(n){return function(t,e,n){var r=Kt.select('span[data-mce-type="bookmark"]',e),o=Gt(t,n),i=Kt.createRng();i.setStartAfter(n),i.setEndAfter(e);for(var u,a=i.extractContents(),c=a.firstChild;c;c=c.firstChild)if("LI"===c.nodeName&&t.dom.isEmpty(c)){Kt.remove(c);break}t.dom.isEmpty(a)||Kt.insertAfter(a,e),Kt.insertAfter(o,e),qt(t.dom,n.parentNode)&&(u=n.parentNode,Mt.each(r,function(t){u.parentNode.insertBefore(t,n.parentNode)}),Kt.remove(u)),Kt.remove(n),qt(t.dom,e)&&Kt.remove(e)}(t,n.dom,e.dom)})},Qt=function(t){Yt(t)&&At(t,"dd")},Zt=function(t,e){if(Bt(t))return{container:t,offset:e};var n=ct.getNode(t,e);return Bt(n)?{container:n,offset:e>=t.childNodes.length?n.data.length:0}:n.previousSibling&&Bt(n.previousSibling)?{container:n.previousSibling,offset:n.previousSibling.data.length}:n.nextSibling&&Bt(n.nextSibling)?{container:n.nextSibling,offset:0}:{container:t,offset:e}},te=function(t){var e=t.cloneRange(),n=Zt(t.startContainer,t.startOffset);e.setStart(n.container,n.offset);var r=Zt(t.endContainer,t.endOffset);return e.setEnd(r.container,r.offset),e},ee=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),ne=function(t,e){var n=e||t.selection.getStart(!0);return t.dom.getParent(n,"OL,UL,DL",ie(t,n))},re=function(t){var e=ne(t),n=t.selection.getSelectedBlocks();return function(t,e){return t&&1===e.length&&e[0]===t}(e,n)?function(t){return T(t.querySelectorAll("ol,ul,dl"),Lt)}(e):T(n,function(t){return Lt(t)&&e!==t})},oe=function(t){var e=t.selection.getSelectedBlocks();return T(function(t,e){var n=Mt.map(e,function(e){var n=t.dom.getParent(e,"li,dd,dt",ie(t,e));return n||e});return ee.unique(n)}(t,e),It)},ie=function(t,e){var n=t.dom.getParents(e,"TD,TH");return n.length>0?n[0]:t.getBody()},ue=function(t,e){var n=t.dom.getParents(e,"ol,ul",ie(t,e));return R(n)},ae=function(t){var e=function(t){var e=ue(t,t.selection.getStart()),n=T(t.selection.getSelectedBlocks(),Pt);return e.toArray().concat(n)}(t);return ce(t,e)},ce=function(t,e){var n=k(e,function(e){return ue(t,e).getOr(e)});return ee.unique(n)},se=function(t,e,n){return void 0===n&&(n=g),t.exists(function(t){return n(t,e)})},le=function(t,e,n){return t.isSome()&&e.isSome()?x.some(n(t.getOrDie(),e.getOrDie())):x.none()},fe=function(t,e,n){return t.fire("ListMutation",{action:e,element:n})},de=function(t,e,n){if(!i(n))throw console.error("Invalid call to CSS.set. Property ",e,":: Value ",n,":: Element ",t),new Error("CSS value must be a string: "+n);(function(t){return void 0!==t.style&&s(t.style.getPropertyValue)})(t)&&t.style.setProperty(e,n)},me=function(t,e){Tt(t.item,e.list)},ge=function(t,e){var n={list:rt.fromTag(e,t),item:rt.fromTag("li",t)};return Tt(n.list,n.item),n},he=function(t,e,n){var r=e.slice(0,n.depth);return R(r).each(function(e){!function(t,e){Tt(t.list,e),t.item=e}(e,function(t,e,n){var r=rt.fromTag("li",t);return bt(r,e),_t(r,n),r}(t,n.itemAttributes,n.content)),function(t,e){ht(t.list)!==e.listType&&(t.list=At(t.list,e.listType)),bt(t.list,e.listAttributes)}(e,n)}),r},pe=function(t,e,n){var r,o=function(t,e,n){for(var r=[],o=0;o<n;o++)r.push(ge(t,e.listType));return r}(t,n,n.depth-e.length);return function(t){for(var e=1;e<t.length;e++)me(t[e-1],t[e])}(o),function(t,e){for(var n=0;n<t.length-1;n++)r=t[n].item,o="list-style-type",i="none",u=r.dom,de(u,o,i);var r,o,i,u;R(t).each(function(t){bt(t.list,e.listAttributes),bt(t.item,e.itemAttributes),_t(t.item,e.content)})}(o,n),r=o,le(R(e),z(r),me),e.concat(o)},ve=function(t){return at(t,"OL,UL")},be=function(t){return St(t).exists(ve)},ye=function(t){return t.depth>0},we=function(t){return t.isSelected},xe=function(t){var e=xt(t),n=kt(t).exists(ve)?e.slice(0,-1):e;return k(n,Dt)},Ce=function(t){return O(t,function(e,n){(function(t,e){var n=t[e].depth,r=function(t){return t.depth===n&&!t.dirty},o=function(t){return t.depth<n};return E(N(t.slice(0,e)),r,o).orThunk(function(){return E(t.slice(e+1),r,o)})})(t,n).fold(function(){e.dirty&&function(t){t.listAttributes=mt(t.listAttributes,function(t,e){return"start"!==e})}(e)},function(t){return r=t,(n=e).listType=r.listType,void(n.listAttributes=B({},r.listAttributes));var n,r})}),t},Se=function(t,e,n,r){return St(r).filter(ve).fold(function(){e.each(function(t){ot(t.start,r)&&n.set(!0)});var o=function(t,e,n){return wt(t).filter(pt).map(function(r){return{depth:e,dirty:!1,isSelected:n,content:xe(t),itemAttributes:yt(t),listAttributes:yt(r),listType:ht(r)}})}(r,t,n.get());e.each(function(t){ot(t.end,r)&&n.set(!1)});var i=kt(r).filter(ve).map(function(r){return ke(t,e,n,r)}).getOr([]);return o.toArray().concat(i)},function(r){return ke(t,e,n,r)})},ke=function(t,e,n,r){return A(xt(r),function(r){return(ve(r)?ke:Se)(t+1,e,n,r)})},Oe=function(t,e){var n=Ce(e);return k(n,function(e){var n,r,o,i=(n=e.content,o=(r||document).createDocumentFragment(),O(n,function(t){o.appendChild(t.dom)}),rt.fromDom(o));return rt.fromDom(Gt(t,i.dom))})},Te=function(t,e){var n=Ce(e);return function(t,e){var n=_(e,function(e,n){return n.depth>e.length?pe(t,e,n):he(t,e,n)},[]);return z(n).map(function(t){return t.list})}(t.contentDocument,n).toArray()},_e=function(t,e,n){var r=function(t,e){var n,r=(n=!1,{get:function(){return n},set:function(t){n=t}});return k(t,function(t){return{sourceList:t,entries:ke(0,e,r,t)}})}(e,function(t){var e=k(oe(t),rt.fromDom);return le(D(e,h(be)),D(N(e),h(be)),function(t,e){return{start:t,end:e}})}(t));O(r,function(e){!function(t,e){O(T(t,we),function(t){return function(t,e){switch(t){case"Indent":e.depth++;break;case"Outdent":e.depth--;break;case"Flatten":e.depth=0}e.dirty=!0}(e,t)})}(e.entries,n);var r,o=function(t,e){return A(function(t,e){if(0===t.length)return[];for(var n=e(t[0]),r=[],o=[],i=0,u=t.length;i<u;i++){var a=t[i],c=e(a);c!==n&&(r.push(o),o=[]),n=c,o.push(a)}return 0!==o.length&&r.push(o),r}(e,ye),function(e){return z(e).exists(ye)?Te(t,e):Oe(t,e)})}(t,e.entries);O(o,function(e){fe(t,"Indent"===n?"IndentList":"OutdentList",e.dom)}),r=e.sourceList,O(o,function(t){Ot(r,t)}),Et(e.sourceList)})},Ee=function(t,e){var n=k(ae(t),rt.fromDom),r=k(function(t){return T(oe(t),Ft)}(t),rt.fromDom),o=!1;if(n.length||r.length){var i=t.selection.getBookmark();_e(t,n,e),function(t,e,n){O(n,"Indent"===e?Qt:function(e){return Jt(t,e)})}(t,e,r),t.selection.moveToBookmark(i),t.selection.setRng(te(t.selection.getRng())),t.nodeChanged(),o=!0}return o},De=function(t){return Ee(t,"Indent")},Ae=function(t){return Ee(t,"Outdent")},Ne=function(t){return Ee(t,"Flatten")},Me=tinymce.util.Tools.resolve("tinymce.dom.BookmarkManager"),ze=Nt.DOM,Re=function(t){var e={},n=function(n){var r=t[n?"startContainer":"endContainer"],o=t[n?"startOffset":"endOffset"];if(1===r.nodeType){var i=ze.create("span",{"data-mce-type":"bookmark"});r.hasChildNodes()?(o=Math.min(o,r.childNodes.length-1),n?r.insertBefore(i,r.childNodes[o]):ze.insertAfter(i,r.childNodes[o])):r.appendChild(i),r=i,o=0}e[n?"startContainer":"endContainer"]=r,e[n?"startOffset":"endOffset"]=o};return n(!0),t.collapsed||n(),e},Be=function(t){var e=function(e){var n,r=n=t[e?"startContainer":"endContainer"],o=t[e?"startOffset":"endOffset"];r&&(1===r.nodeType&&(o=function(t){for(var e=t.parentNode.firstChild,n=0;e;){if(e===t)return n;1===e.nodeType&&"bookmark"===e.getAttribute("data-mce-type")||n++,e=e.nextSibling}return-1}(r),r=r.parentNode,ze.remove(n),!r.hasChildNodes()&&ze.isBlock(r)&&r.appendChild(ze.create("br"))),t[e?"startContainer":"endContainer"]=r,t[e?"startOffset":"endOffset"]=o)};e(!0),e();var n=ze.createRng();return n.setStart(t.startContainer,t.startOffset),t.endContainer&&n.setEnd(t.endContainer,t.endOffset),te(n)},Le=function(t){switch(t){case"UL":return"ToggleUlList";case"OL":return"ToggleOlList";case"DL":return"ToggleDLList"}},Pe=function(t){return/\btox\-/.test(t.className)},He=function(t,e,n){var r=function(t){var r=E(t.parents,Lt,Vt).filter(function(t){return t.nodeName===e&&!Pe(t)}).isSome();n(r)},o=t.dom.getParents(t.selection.getNode());return r({parents:o}),t.on("NodeChange",r),function(){return t.off("NodeChange",r)}},Ie=function(t,e){Mt.each(e,function(e,n){t.setAttribute(n,e)})},Fe=function(t,e,n){!function(t,e,n){var r=n["list-style-type"]?n["list-style-type"]:null;t.setStyle(e,"list-style-type",r)}(t,e,n),function(t,e,n){Ie(e,n["list-attributes"]),Mt.each(t.select("li",e),function(t){Ie(t,n["list-item-attributes"])})}(t,e,n)},Ve=function(t,e,n,r){var o=e[n?"startContainer":"endContainer"],i=e[n?"startOffset":"endOffset"];for(1===o.nodeType&&(o=o.childNodes[Math.min(i,o.childNodes.length-1)]||o),!n&&Ut(o.nextSibling)&&(o=o.nextSibling);o.parentNode!==r;){if(jt(t,o))return o;if(/^(TD|TH)$/.test(o.parentNode.nodeName))return o;o=o.parentNode}return o},Ue=function(t,e,n){var r=t.selection.getRng(),o="LI",i=ie(t,t.selection.getStart(!0)),u=t.dom;if("false"!==u.getContentEditable(t.selection.getNode())){"DL"===(e=e.toUpperCase())&&(o="DT");var a=Re(r),c=function(t,e,n){for(var r,o=[],i=t.dom,u=Ve(t,e,!0,n),a=Ve(t,e,!1,n),c=[],s=u;s&&(c.push(s),s!==a);s=s.nextSibling);return Mt.each(c,function(e){if(jt(t,e))return o.push(e),void(r=null);if(i.isBlock(e)||Ut(e))return Ut(e)&&i.remove(e),void(r=null);var u=e.nextSibling;Me.isBookmarkNode(e)&&(Lt(u)||jt(t,u)||!u&&e.parentNode===n)?r=null:(r||(r=i.create("p"),e.parentNode.insertBefore(r,e),o.push(r)),r.appendChild(e))}),o}(t,r,i);Mt.each(c,function(r){var i,a=r.previousSibling,c=r.parentNode;It(c)||(a&&Lt(a)&&a.nodeName===e&&function(t,e,n){var r=t.getStyle(e,"list-style-type"),o=n?n["list-style-type"]:"";return r===(o=null===o?"":o)}(u,a,n)?(i=a,r=u.rename(r,o),a.appendChild(r)):(i=u.create(e),r.parentNode.insertBefore(i,r),i.appendChild(r),r=u.rename(r,o)),function(t,e,n){Mt.each(n,function(n){var r;return t.setStyle(e,((r={})[n]="",r))})}(u,r,["margin","margin-right","margin-bottom","margin-left","margin-top","padding","padding-right","padding-bottom","padding-left","padding-top"]),Fe(u,i,n),We(t.dom,i))}),t.selection.setRng(Be(a))}},je=function(t,e,n){return function(t,e){return t&&e&&Lt(t)&&t.nodeName===e.nodeName}(e,n)&&function(t,e,n){return t.getStyle(e,"list-style-type",!0)===t.getStyle(n,"list-style-type",!0)}(t,e,n)&&(r=n,e.className===r.className);var r},We=function(t,e){var n,r;if(n=e.nextSibling,je(t,e,n)){for(;r=n.firstChild;)e.appendChild(r);t.remove(n)}if(n=e.previousSibling,je(t,e,n)){for(;r=n.lastChild;)e.insertBefore(r,e.firstChild);t.remove(n)}},qe=function(t,e,n,r,o){var i=Lt(e);if(i&&e.nodeName===r&&!$e(o))Ne(t);else{Ue(t,r,o);var u=Re(t.selection.getRng()),a=i?function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}([e],n,!0):n;Mt.each(a,function(e){!function(t,e,n,r){if(e.nodeName!==n){var o=t.dom.rename(e,n);Fe(t.dom,o,r),fe(t,Le(n),o)}else Fe(t.dom,e,r),fe(t,Le(n),e)}(t,e,r,o)}),t.selection.setRng(Be(u))}},$e=function(t){return"list-style-type"in t},Ge=function(t,e,n){var r=ne(t),o=re(t),i=u(n)?n:{};o.length>0?qe(t,r,o,e,i):function(t,e,n,r){if(e!==t.getBody())if(e)if(e.nodeName!==n||$e(r)||Pe(e)){var o=Re(t.selection.getRng());Fe(t.dom,e,r);var i=t.dom.rename(e,n);We(t.dom,i),t.selection.setRng(Be(o)),Ue(t,n,r),fe(t,Le(n),i)}else Ne(t);else Ue(t,n,r),fe(t,Le(n),e)}(t,r,e,i)},Ke=Nt.DOM,Xe=function(t,e){var n=Mt.grep(t.select("ol,ul",e));Mt.each(n,function(e){!function(t,e){var n,r=e.parentNode;"LI"===r.nodeName&&r.firstChild===e&&((n=r.previousSibling)&&"LI"===n.nodeName?(n.appendChild(e),qt(t,r)&&Ke.remove(r)):Ke.setStyle(r,"listStyleType","none"));Lt(r)&&(n=r.previousSibling)&&"LI"===n.nodeName&&n.appendChild(e)}(t,e)})},Ye=function(t,e,n,r){var o=e.startContainer,i=e.startOffset;if(Bt(o)&&(n?i<o.data.length:i>0))return o;var u=t.schema.getNonEmptyElements();1===o.nodeType&&(o=ct.getNode(o,i));var a=new st(o,r);for(n&&function(t,e){return!!Ut(e)&&t.isBlock(e.nextSibling)&&!Ut(e.previousSibling)}(t.dom,o)&&a.next();o=a[n?"next":"prev2"]();){if("LI"===o.nodeName&&!o.hasChildNodes())return o;if(u[o.nodeName])return o;if(Bt(o)&&o.data.length>0)return o}},Je=function(t,e){var n=e.childNodes;return 1===n.length&&!Lt(n[0])&&t.isBlock(n[0])},Qe=function(t,e,n){var r,o=Je(t,n)?n.firstChild:n;if(function(t,e){Je(t,e)&&t.remove(e.firstChild,!0)}(t,e),!qt(t,e,!0))for(;r=e.firstChild;)o.appendChild(r)},Ze=function(t,e,n){var r,o=e.parentNode;if($t(t,e)&&$t(t,n)){Lt(n.lastChild)&&(r=n.lastChild),o===n.lastChild&&Ut(o.previousSibling)&&t.remove(o.previousSibling);var i=n.lastChild;i&&Ut(i)&&e.hasChildNodes()&&t.remove(i),qt(t,n,!0)&&t.$(n).empty(),Qe(t,e,n),r&&n.appendChild(r);var u=ut(rt.fromDom(n),rt.fromDom(e))?t.getParents(e,Lt,n):[];t.remove(e),O(u,function(e){qt(t,e)&&e!==t.getRoot()&&t.remove(e)})}},tn=function(t,e,n,r){var o=t.dom;if(o.isEmpty(r))!function(t,e,n){t.dom.$(n).empty(),Ze(t.dom,e,n),t.selection.setCursorLocation(n,0)}(t,n,r);else{var i=Re(e);Ze(o,n,r),t.selection.setRng(Be(i))}},en=function(t,e){var n=t.dom,r=t.selection,o=r.getStart(),i=ie(t,o),u=n.getParent(r.getStart(),"LI",i);if(u){var a=u.parentNode;if(a===t.getBody()&&qt(n,a))return!0;var c=te(r.getRng()),s=n.getParent(Ye(t,c,e,i),"LI",i);if(s&&s!==u)return t.undoManager.transact(function(){var n;e?tn(t,c,s,u):(n=u).parentNode.firstChild===n?Ae(t):function(t,e,n,r){var o=Re(e);Ze(t.dom,n,r);var i=Be(o);t.selection.setRng(i)}(t,c,u,s)}),!0;if(!s&&!e&&0===c.startOffset&&0===c.endOffset)return t.undoManager.transact(function(){Ne(t)}),!0}return!1},nn=function(t,e){return en(t,e)||function(t,e){var n=t.dom,r=t.selection.getStart(),o=ie(t,r),i=n.getParent(r,n.isBlock,o);if(i&&n.isEmpty(i)){var u=te(t.selection.getRng()),a=n.getParent(Ye(t,u,e,o),"LI",o);if(a)return t.undoManager.transact(function(){!function(t,e,n){var r=t.getParent(e.parentNode,t.isBlock,n);t.remove(e),r&&t.isEmpty(r)&&t.remove(r)}(n,i,o),We(n,a.parentNode),t.selection.select(a,!0),t.selection.collapse(e)}),!0}return!1}(t,e)},rn=function(t,e){return t.selection.isCollapsed()?nn(t,e):function(t){var e=t.selection.getStart(),n=ie(t,e);return!!(t.dom.getParent(e,"LI,DT,DD",n)||oe(t).length>0)&&(t.undoManager.transact(function(){t.execCommand("Delete"),Xe(t.dom,t.getBody())}),!0)}(t)},on=function(t){return{backspaceDelete:function(e){rn(t,e)}}},un=function(t){var e=N(j(t).split("")),n=k(e,function(t,e){var n=t.toUpperCase().charCodeAt(0)-"A".charCodeAt(0)+1;return Math.pow(26,e)*n});return _(n,function(t,e){return t+e},0)},an=function(t){if(--t<0)return"";var e=t%26,n=Math.floor(t/26);return an(n)+String.fromCharCode("A".charCodeAt(0)+e)},cn=function(t){var e,n,r=ne(t);Ht(r)&&t.windowManager.open({title:"List Properties",body:{type:"panel",items:[{type:"input",name:"start",label:"Start list at number",inputMode:"numeric"}]},initialData:{start:(e={start:t.dom.getAttrib(r,"start","1"),listStyleType:x.some(t.dom.getStyle(r,"list-style-type"))},n=parseInt(e.start,10),se(e.listStyleType,"upper-alpha")?an(n):se(e.listStyleType,"lower-alpha")?an(n).toLowerCase():e.start)},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:function(e){(function(t){switch(function(t){return/^[0-9]+$/.test(t)?2:function(t){return/^[A-Z]+$/.test(t)}(t)?0:function(t){return/^[a-z]+$/.test(t)}(t)?1:function(t){return t.length>0}(t)?4:3}(t)){case 2:return x.some({listStyleType:x.none(),start:t});case 0:return x.some({listStyleType:x.some("upper-alpha"),start:un(t).toString()});case 1:return x.some({listStyleType:x.some("lower-alpha"),start:un(t).toString()});case 3:return x.some({listStyleType:x.none(),start:""});case 4:return x.none()}})(e.getData().start).each(function(e){t.execCommand("mceListUpdate",!1,{attrs:{start:"1"===e.start?"":e.start},styles:{"list-style-type":e.listStyleType.getOr("")}})}),e.close()}})},sn=function(t,e){return function(){var n=ne(t);return n&&n.nodeName===e}},ln=function(t){t.addCommand("mceListProps",function(){cn(t)})},fn=function(t){t.on("BeforeExecCommand",function(e){var n=e.command.toLowerCase();"indent"===n?De(t):"outdent"===n&&Ae(t)}),t.addCommand("InsertUnorderedList",function(e,n){Ge(t,"UL",n)}),t.addCommand("InsertOrderedList",function(e,n){Ge(t,"OL",n)}),t.addCommand("InsertDefinitionList",function(e,n){Ge(t,"DL",n)}),t.addCommand("RemoveList",function(){Ne(t)}),ln(t),t.addCommand("mceListUpdate",function(e,n){u(n)&&function(t,e){var n=ne(t);t.undoManager.transact(function(){u(e.styles)&&t.dom.setStyles(n,e.styles),u(e.attrs)&&dt(e.attrs,function(e,r){return t.dom.setAttrib(n,r,e)})})}(t,n)}),t.addQueryStateHandler("InsertUnorderedList",sn(t,"UL")),t.addQueryStateHandler("InsertOrderedList",sn(t,"OL")),t.addQueryStateHandler("InsertDefinitionList",sn(t,"DL"))},dn=function(t){(function(t){return t.getParam("lists_indent_on_tab",!0)})(t)&&function(t){t.on("keydown",function(e){e.keyCode!==lt.TAB||lt.metaKeyPressed(e)||t.undoManager.transact(function(){(e.shiftKey?Ae(t):De(t))&&e.preventDefault()})})}(t),function(t){t.on("keydown",function(e){e.keyCode===lt.BACKSPACE?rn(t,!1)&&e.preventDefault():e.keyCode===lt.DELETE&&rn(t,!0)&&e.preventDefault()})}(t)},mn=function(t){var e=function(e){return function(){return t.execCommand(e)}};t.hasPlugin("advlist")||(t.ui.registry.addToggleButton("numlist",{icon:"ordered-list",active:!1,tooltip:"Numbered list",onAction:e("InsertOrderedList"),onSetup:function(e){return He(t,"OL",e.setActive)}}),t.ui.registry.addToggleButton("bullist",{icon:"unordered-list",active:!1,tooltip:"Bullet list",onAction:e("InsertUnorderedList"),onSetup:function(e){return He(t,"UL",e.setActive)}}))},gn=function(t){var e={text:"List properties...",icon:"ordered-list",onAction:function(){return t.execCommand("mceListProps")},onSetup:function(e){return He(t,"OL",function(t){return e.setDisabled(!t)})}};t.ui.registry.addMenuItem("listprops",e),t.ui.registry.addContextMenu("lists",{update:function(e){var n=ne(t,e);return Ht(n)?["listprops"]:[]}})};n.add("lists",function(t){return!1===t.hasPlugin("rtc",!0)?(dn(t),fn(t)):ln(t),mn(t),gn(t),on(t)})}()},"bPR+":function(t,e){!function(){"use strict";var t=function(t){t.addCommand("mceCodeEditor",function(){!function(t){var e=function(t){return t.getContent({source_view:!0})}(t);t.windowManager.open({title:"Source Code",size:"large",body:{type:"panel",items:[{type:"textarea",name:"code"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{code:e},onSubmit:function(e){!function(t,e){t.focus(),t.undoManager.transact(function(){t.setContent(e)}),t.selection.setCursorLocation(),t.nodeChanged()}(t,e.getData().code),e.close()}})}(t)})},e=function(t){var e=function(){return t.execCommand("mceCodeEditor")};t.ui.registry.addButton("code",{icon:"sourcecode",tooltip:"Source code",onAction:e}),t.ui.registry.addMenuItem("code",{icon:"sourcecode",text:"Source code",onAction:e})};tinymce.util.Tools.resolve("tinymce.PluginManager").add("code",function(n){return t(n),e(n),{}})}()},"c/6r":function(t,e,n){n("V9zC")},f85y:function(t,e,n){n("Z3om")},gBhd:function(t,e,n){n("bPR+")},iTxg:function(t,e){!function(){"use strict";tinymce.util.Tools.resolve("tinymce.PluginManager").add("colorpicker",function(){})}()},"m/OW":function(t,e){!function(){"use strict";var t,e,n,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=tinymce.util.Tools.resolve("tinymce.util.VK"),i=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},u=function(t){return function(e){return typeof e===t}},a=i("string"),c=i("array"),s=(t=null,function(e){return t===e}),l=u("boolean"),f=u("function"),d=function(){},m=function(t){return function(){return t}},g=function(t){return t},h=function(t,e){return t===e},p=m(!1),v=m(!0),b=function(){return y},y={fold:function(t,e){return t()},isSome:p,isNone:v,getOr:n=g,getOrThunk:e=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:m(null),getOrUndefined:m(void 0),or:n,orThunk:e,map:b,each:d,bind:b,exists:p,forall:v,filter:function(){return b()},toArray:function(){return[]},toString:m("none()")},w=function(t){var e=m(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},isSome:v,isNone:p,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return w(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:y},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},x={some:w,none:b,from:function(t){return null===t||void 0===t?y:w(t)}},C=Array.prototype.indexOf,S=Array.prototype.push,k=function(t,e){return n=t,r=e,C.call(n,r)>-1;var n,r},O=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!c(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);S.apply(e,t[n])}return e},T=function(t,e){return O(function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r}(t,e))},_=function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return x.none()},E=function(t,e,n){return void 0===n&&(n=h),t.exists(function(t){return n(t,e)})},D=function(t,e){return t?x.some(e):x.none()},A=function(t){var e=t.getParam("link_assume_external_targets",!1);return l(e)&&e?1:!a(e)||"http"!==e&&"https"!==e?0:e},N=function(t){return t.getParam("default_link_target")},M=function(t){return t.getParam("target_list",!0)},z=function(t){return t.getParam("rel_list",[],"array")},R=function(t){return t.getParam("allow_unsafe_link_target",!1,"boolean")},B=tinymce.util.Tools.resolve("tinymce.util.Tools"),L=function(t){return a(t.value)?t.value:""},P=function(t,e){var n=[];return B.each(t,function(t){var r=function(t){return a(t.text)?t.text:a(t.title)?t.title:""}(t);if(void 0!==t.menu){var o=P(t.menu,e);n.push({text:r,items:o})}else{var i=e(t);n.push({text:r,value:i})}}),n},H=function(t){return void 0===t&&(t=L),function(e){return x.from(e).map(function(e){return P(e,t)})}},I={sanitize:function(t){return H(L)(t)},sanitizeWith:H,createUi:function(t,e){return function(n){return{name:t,type:"listbox",label:e,items:n}}},getValue:L},F=function(){return(F=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},V=Object.keys,U=Object.hasOwnProperty,j=function(t,e,n,r){return function(t,e){for(var n=V(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}}(t,function(t,o){(e(t,o)?n:r)(t,o)}),{}},W=function(t,e){return U.call(t,e)},q=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),$=tinymce.util.Tools.resolve("tinymce.util.URI"),G=function(t){return t&&"a"===t.nodeName.toLowerCase()},K=function(t){return G(t)&&!!J(t)},X=function(t,e){if(t.collapsed)return[];var n=t.cloneContents(),r=new q(n.firstChild,n),o=[],i=n.firstChild;do{e(i)&&o.push(i)}while(i=r.next());return o},Y=function(t){return/^\w+:/i.test(t)},J=function(t){var e=t.getAttribute("data-mce-href");return e||t.getAttribute("href")},Q=function(t,e){var n=["noopener"],r=t?t.split(/\s+/):[],o=function(t){return t.filter(function(t){return-1===B.inArray(n,t)})},i=e?function(t){return(t=o(t)).length>0?t.concat(n):n}(r):o(r);return i.length>0?function(t){return B.trim(t.sort().join(" "))}(i):""},Z=function(t,e){return e=e||t.selection.getNode(),rt(e)?t.dom.select("a[href]",e)[0]:t.dom.getParent(e,"a[href]")},tt=function(t,e){return function(t){return t.replace(/\uFEFF/g,"")}(e?e.innerText||e.textContent:t.getContent({format:"text"}))},et=function(t){return B.grep(t,K).length>0},nt=function(t){var e=t.schema.getTextInlineElements();return 0===X(t.selection.getRng(),function(t){return 1===t.nodeType&&!G(t)&&!W(e,t.nodeName.toLowerCase())}).length},rt=function(t){return t&&"FIGURE"===t.nodeName&&/\bimage\b/i.test(t.className)},ot=function(t,e){var n=F({},e);if(!(z(t).length>0)&&!1===R(t)){var r=Q(n.rel,"_blank"===n.target);n.rel=r||null}return x.from(n.target).isNone()&&!1===M(t)&&(n.target=N(t)),n.href=function(t,e){return"http"!==e&&"https"!==e||Y(t)?t:e+"://"+t}(n.href,A(t)),n},it=function(t,e,n){var r=t.selection.getNode(),o=Z(t,r),i=ot(t,function(t){var e,n,r;return e=["title","rel","class","target"],n=function(e,n){return t[n].each(function(t){e[n]=t.length>0?t:null}),e},r={href:t.href},function(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n],n)}(e,function(t,e){r=n(r,t,e)}),r}(n));t.undoManager.transact(function(){n.href===e.href&&e.attach(),o?(t.focus(),function(t,e,n,r){n.each(function(t){W(e,"innerText")?e.innerText=t:e.textContent=t}),t.dom.setAttribs(e,r),t.selection.select(e)}(t,o,n.text,i)):function(t,e,n,r){rt(e)?lt(t,e,r):n.fold(function(){t.execCommand("mceInsertLink",!1,r)},function(e){t.insertContent(t.dom.createHTML("a",r,t.dom.encode(e)))})}(t,r,n.text,i)})},ut=function(t){var e,n,r,o=t.class,i=t.href,u=t.rel,a=t.target,c=t.text,l=t.title;return e={class:o.getOrNull(),href:i,rel:u.getOrNull(),target:a.getOrNull(),text:c.getOrNull(),title:l.getOrNull()},j(e,function(t,e){return!1===s(t)},(n=r={},function(t,e){n[e]=t}),d),r},at=function(t,e,n){var r=function(t,e){var n=e.href;return F(F({},e),{href:$.isDomSafe(n,"a",t.settings)?n:""})}(t,n);t.hasPlugin("rtc",!0)?t.execCommand("createlink",!1,ut(r)):it(t,e,r)},ct=function(t){t.hasPlugin("rtc",!0)?t.execCommand("unlink"):function(t){t.undoManager.transact(function(){var e=t.selection.getNode();rt(e)?st(t,e):function(t){var e=t.dom,n=t.selection,r=n.getBookmark(),o=n.getRng().cloneRange(),i=e.getParent(o.startContainer,"a[href]",t.getBody()),u=e.getParent(o.endContainer,"a[href]",t.getBody());i&&o.setStartBefore(i),u&&o.setEndAfter(u),n.setRng(o),t.execCommand("unlink"),n.moveToBookmark(r)}(t),t.focus()})}(t)},st=function(t,e){var n=t.dom.select("img",e)[0];if(n){var r=t.dom.getParents(n,"a[href]",e)[0];r&&(r.parentNode.insertBefore(n,r),t.dom.remove(r))}},lt=function(t,e,n){var r=t.dom.select("img",e)[0];if(r){var o=t.dom.create("a",n);r.parentNode.insertBefore(o,r),o.appendChild(r)}},ft=function(t){return W(e=t,n="items")&&void 0!==e[n]&&null!==e[n];var e,n},dt=function(t,e){return _(e,function(e){return ft(e)?dt(t,e.items):D(e.value===t,e)})},mt=function(t,e,n,r){var o=r[e],i=t.length>0;return void 0!==o?dt(o,n).map(function(e){return{url:{value:e.value,meta:{text:i?t:e.text,attach:d}},text:i?t:e.text}}):x.none()},gt=function(t,e){var n={text:t.text,title:t.title},r=function(t){var e,r=(e=t.url,D(n.text.length<=0,x.from(e.meta.text).getOr(e.value))),o=function(t){return D(n.title.length<=0,x.from(t.meta.title).getOr(""))}(t.url);return r.isSome()||o.isSome()?x.some(F(F({},r.map(function(t){return{text:t}}).getOr({})),o.map(function(t){return{title:t}}).getOr({}))):x.none()},o=function(t,r){var o,i,u=(o=e,i=r.name,"link"===i?o.link:"anchor"===i?o.anchor:x.none()).getOr([]);return mt(n.text,r.name,u,t)};return{onChange:function(t,e){var i=e.name;return"url"===i?r(t()):k(["anchor","link"],i)?o(t(),e):"text"===i||"title"===i?(n[i]=t()[i],x.none()):x.none()}}},ht=tinymce.util.Tools.resolve("tinymce.util.Delay"),pt=tinymce.util.Tools.resolve("tinymce.util.Promise"),vt=function(t){var e=t.href;return e.indexOf("@")>0&&-1===e.indexOf("/")&&-1===e.indexOf("mailto:")?x.some({message:"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",preprocess:function(t){return F(F({},t),{href:"mailto:"+e})}}):x.none()},bt=function(t,e){return _([vt,function(t,e){return function(n){var r=n.href;return 1===t&&!Y(r)||0===t&&/^\s*www(\.|\d\.)/i.test(r)?x.some({message:"The URL you entered seems to be an external link. Do you want to add the required "+e+":// prefix?",preprocess:function(t){return F(F({},t),{href:e+"://"+r})}}):x.none()}}(A(t),function(t){return t.getParam("link_default_protocol","http","string")}(t))],function(t){return t(e)}).fold(function(){return pt.resolve(e)},function(n){return new pt(function(r){!function(t,e,n){var r=t.selection.getRng();ht.setEditorTimeout(t,function(){t.windowManager.confirm(e,function(e){t.selection.setRng(r),n(e)})})}(t,n.message,function(t){r(t?n.preprocess(e):e)})})})},yt=function(t){var e=t.dom.select("a:not([href])"),n=T(e,function(t){var e=t.name||t.id;return e?[{text:e,value:"#"+e}]:[]});return n.length>0?x.some([{text:"None",value:""}].concat(n)):x.none()},wt=function(t){var e=function(t){return t.getParam("link_class_list",[],"array")}(t);return e.length>0?I.sanitize(e):x.none()},xt=tinymce.util.Tools.resolve("tinymce.util.XHR"),Ct=function(t){var e=function(e){return t.convertURL(e.value||e.url,"href")},n=function(t){return t.getParam("link_list")}(t);return new pt(function(t){a(n)?xt.send({url:n,success:function(e){return t(function(t){try{return x.some(JSON.parse(t))}catch(t){return x.none()}}(e))},error:function(e){return t(x.none())}}):f(n)?n(function(e){return t(x.some(e))}):t(x.from(n))}).then(function(t){return t.bind(I.sanitizeWith(e)).map(function(t){return t.length>0?[{text:"None",value:""}].concat(t):t})})},St=function(t,e){var n=z(t);if(n.length>0){var r=E(e,"_blank");return(!1===R(t)?I.sanitizeWith(function(t){return Q(I.getValue(t),r)}):I.sanitize)(n)}return x.none()},kt=[{text:"Current window",value:""},{text:"New window",value:"_blank"}],Ot=function(t){var e=M(t);return c(e)?I.sanitize(e).orThunk(function(){return x.some(kt)}):!1===e?x.none():x.some(kt)},Tt=function(t,e,n){var r=t.getAttrib(e,n);return null!==r&&r.length>0?x.some(r):x.none()},_t=function(t,e){return Ct(t).then(function(n){var r=function(t,e){var n=t.dom,r=nt(t)?x.some(tt(t.selection,e)):x.none(),o=e?x.some(n.getAttrib(e,"href")):x.none(),i=e?x.from(n.getAttrib(e,"target")):x.none(),u=Tt(n,e,"rel"),a=Tt(n,e,"class");return{url:o,text:r,title:Tt(n,e,"title"),target:i,rel:u,linkClass:a}}(t,e);return{anchor:r,catalogs:{targets:Ot(t),rels:St(t,r.target),classes:wt(t),anchor:yt(t),link:n},optNode:x.from(e),flags:{titleEnabled:function(t){return t.getParam("link_title",!0,"boolean")}(t)}}})},Et=function(t){(function(t){var e=Z(t);return _t(t,e)})(t).then(function(e){return function(t,e,n){var r=t.anchor.text.map(function(){return{name:"text",type:"input",label:"Text to display"}}).toArray(),o=t.flags.titleEnabled?[{name:"title",type:"input",label:"Title"}]:[],i=function(t,e){var n=t.anchor,r=n.url.getOr("");return{url:{value:r,meta:{original:{value:r}}},text:n.text.getOr(""),title:n.title.getOr(""),anchor:r,link:r,rel:n.rel.getOr(""),target:n.target.or(e).getOr(""),linkClass:n.linkClass.getOr("")}}(t,x.from(N(n))),u=t.catalogs,a=gt(i,u);return{title:"Insert/Edit Link",size:"normal",body:{type:"panel",items:O([[{name:"url",type:"urlinput",filetype:"file",label:"URL"}],r,o,function(t){for(var e=[],n=function(t){e.push(t)},r=0;r<t.length;r++)t[r].each(n);return e}([u.anchor.map(I.createUi("anchor","Anchors")),u.rels.map(I.createUi("rel","Rel")),u.targets.map(I.createUi("target","Open link in...")),u.link.map(I.createUi("link","Link list")),u.classes.map(I.createUi("linkClass","Class"))])])},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:i,onChange:function(t,e){var n=e.name;a.onChange(t.getData,{name:n}).each(function(e){t.setData(e)})},onSubmit:e}}(e,function(t,e){return function(n){var r=n.getData();if(!r.url.value)return ct(t),void n.close();var o=function(t){return x.from(r[t]).filter(function(n){return!E(e.anchor[t],n)})},i={href:r.url.value,text:o("text"),target:o("target"),rel:o("rel"),class:o("linkClass"),title:o("title")},u={href:r.url.value,attach:void 0!==r.url.meta&&r.url.meta.attach?r.url.meta.attach:d};bt(t,i).then(function(e){at(t,u,e)}),n.close()}}(t,e),t)}).then(function(e){t.windowManager.open(e)})},Dt=function(t){var e=document.createElement("a");e.target="_blank",e.href=t,e.rel="noreferrer noopener";var n=document.createEvent("MouseEvents");n.initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),function(t,e){document.body.appendChild(t),t.dispatchEvent(e),document.body.removeChild(t)}(e,n)},At=function(t,e){return t.dom.getParent(e,"a[href]")},Nt=function(t){return At(t,t.selection.getStart())},Mt=function(t,e){if(e){var n=J(e);if(/^#/.test(n)){var r=t.$(n);r.length&&t.selection.scrollIntoView(r[0],!0)}else Dt(e.href)}},zt=function(t){return function(){Et(t)}},Rt=function(t){return function(){Mt(t,Nt(t))}},Bt=function(t){t.on("click",function(e){var n=At(t,e.target);n&&o.metaKeyPressed(e)&&(e.preventDefault(),Mt(t,n))}),t.on("keydown",function(e){var n=Nt(t);n&&13===e.keyCode&&function(t){return!0===t.altKey&&!1===t.shiftKey&&!1===t.ctrlKey&&!1===t.metaKey}(e)&&(e.preventDefault(),Mt(t,n))})},Lt=function(t,e){return t.on("NodeChange",e),function(){return t.off("NodeChange",e)}},Pt=function(t){return function(e){var n=function(){return e.setActive(!t.mode.isReadOnly()&&null!==Z(t,t.selection.getNode()))};return n(),Lt(t,n)}},Ht=function(t){return function(e){var n=function(){return e.setDisabled(null===Z(t,t.selection.getNode()))};return n(),Lt(t,n)}},It=function(t){return function(e){var n=function(e){return et(e)||(n=t.selection.getRng(),X(n,K).length>0);var n},r=t.dom.getParents(t.selection.getStart());return e.setDisabled(!n(r)),Lt(t,function(t){return e.setDisabled(!n(t.parents))})}},Ft=function(t){t.addCommand("mceLink",function(){!function(t){return t.getParam("link_quicklink",!1,"boolean")}(t)?zt(t)():t.fire("contexttoolbar-show",{toolbarKey:"quicklink"})})},Vt=function(t){t.addShortcut("Meta+K","",function(){t.execCommand("mceLink")})},Ut=function(t){t.ui.registry.addToggleButton("link",{icon:"link",tooltip:"Insert/edit link",onAction:zt(t),onSetup:Pt(t)}),t.ui.registry.addButton("openlink",{icon:"new-tab",tooltip:"Open link",onAction:Rt(t),onSetup:Ht(t)}),t.ui.registry.addButton("unlink",{icon:"unlink",tooltip:"Remove link",onAction:function(){return ct(t)},onSetup:It(t)})},jt=function(t){t.ui.registry.addMenuItem("openlink",{text:"Open link",icon:"new-tab",onAction:Rt(t),onSetup:Ht(t)}),t.ui.registry.addMenuItem("link",{icon:"link",text:"Link...",shortcut:"Meta+K",onAction:zt(t)}),t.ui.registry.addMenuItem("unlink",{icon:"unlink",text:"Remove link",onAction:function(){return ct(t)},onSetup:It(t)})},Wt=function(t){t.ui.registry.addContextMenu("link",{update:function(e){return et(t.dom.getParents(e,"a"))?"link unlink openlink":"link"}})},qt=function(t){var e=function(e){var n=t.selection.getNode();return e.setDisabled(!Z(t,n)),d};t.ui.registry.addContextForm("quicklink",{launch:{type:"contextformtogglebutton",icon:"link",tooltip:"Link",onSetup:Pt(t)},label:"Link",predicate:function(e){return!!Z(t,e)&&function(t){return t.getParam("link_context_toolbar",!1,"boolean")}(t)},initValue:function(){var e=Z(t);return e?J(e):""},commands:[{type:"contextformtogglebutton",icon:"link",tooltip:"Link",primary:!0,onSetup:function(e){var n=t.selection.getNode();return e.setActive(!!Z(t,n)),Pt(t)(e)},onAction:function(e){var n=e.getValue(),r=function(e){var n=Z(t),r=nt(t);if(!n&&r){var o=tt(t.selection,n);return x.some(o.length>0?o:e)}return x.none()}(n);at(t,{href:n,attach:d},{href:n,text:r,title:x.none(),rel:x.none(),target:x.none(),class:x.none()}),function(t){t.selection.collapse(!1)}(t),e.hide()}},{type:"contextformbutton",icon:"unlink",tooltip:"Remove link",onSetup:e,onAction:function(e){ct(t),e.hide()}},{type:"contextformbutton",icon:"new-tab",tooltip:"Open link",onSetup:e,onAction:function(e){Rt(t)(),e.hide()}}]})};r.add("link",function(t){Ut(t),jt(t),Wt(t),qt(t),Bt(t),Ft(t),Vt(t)})}()},ode7:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,o=n("mvHQ"),i=n.n(o),u=n("woOf"),a=n.n(u),c=n("Dd8w"),s=n.n(c),l=n("NYxO"),f=n("HeHh"),d=n("5eDb"),m=n.n(d),g=(n("Aenb"),["onActivate","onAddUndo","onBeforeAddUndo","onBeforeExecCommand","onBeforeGetContent","onBeforeRenderUI","onBeforeSetContent","onBeforePaste","onBlur","onChange","onClearUndos","onClick","onContextMenu","onCopy","onCut","onDblclick","onDeactivate","onDirty","onDrag","onDragDrop","onDragEnd","onDragGesture","onDragOver","onDrop","onExecCommand","onFocus","onFocusIn","onFocusOut","onGetContent","onHide","onInit","onKeyDown","onKeyPress","onKeyUp","onLoadContent","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp","onNodeChange","onObjectResizeStart","onObjectResized","onObjectSelected","onPaste","onPostProcess","onPostRender","onPreProcess","onProgressState","onRedo","onRemove","onReset","onSaveContent","onSelectionChange","onSetAttrib","onSetContent","onShow","onSubmit","onUndo","onVisualAid"]),h=function(t){return-1!==g.map(function(t){return t.toLowerCase()}).indexOf(t.toLowerCase())},p=function(t,e,n){var r=e.$props.value?e.$props.value:"",o=e.$props.initialValue?e.$props.initialValue:"";n.setContent(r||(e.initialized?e.cache:o)),e.$watch("value",function(t,r){n&&"string"==typeof t&&t!==r&&t!==n.getContent({format:e.$props.outputFormat})&&n.setContent(t)}),e.$listeners.input&&function(t,e){var n=t.$props.modelEvents?t.$props.modelEvents:null,r=Array.isArray(n)?n.join(" "):n;e.on(r||"change input undo redo",function(){t.$emit("input",e.getContent({format:t.$props.outputFormat}))})}(e,n),function(t,e,n){Object.keys(e).filter(h).forEach(function(r){var o=e[r];"function"==typeof o&&("onInit"===r?o(t,n):n.on(r.substring(2),function(t){return o(t,n)}))})}(t,e.$listeners,n),e.initialized=!0},v=0,b=function(t){var e=Date.now();return t+"_"+Math.floor(1e9*Math.random())+ ++v+String(e)},y=function(t){return void 0===t||""===t?[]:Array.isArray(t)?t:t.split(" ")},w=function(){return{listeners:[],scriptId:b("tiny-script"),scriptLoaded:!1}},x=(r=w(),{load:function(t,e,n){r.scriptLoaded?n():(r.listeners.push(n),t.getElementById(r.scriptId)||function(t,e,n,r){var o=e.createElement("script");o.referrerPolicy="origin",o.type="application/javascript",o.id=t,o.src=n;var i=function(){o.removeEventListener("load",i),r()};o.addEventListener("load",i),e.head&&e.head.appendChild(o)}(r.scriptId,t,e,function(){r.listeners.forEach(function(t){return t()}),r.scriptLoaded=!0}))},reinitialize:function(){r=w()}}),C=n("wjO9"),S={apiKey:String,cloudChannel:String,id:String,init:Object,initialValue:String,inline:Boolean,modelEvents:[String,Array],plugins:[String,Array],tagName:String,toolbar:[String,Array],value:String,disabled:Boolean,tinymceScriptSrc:String,outputFormat:{type:String,validator:function(t){return"html"===t||"text"===t}}},k=this&&this.__assign||function(){return(k=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},O=function(t){return function(){var e,n,r,o=k(k({},t.$props.init),{readonly:t.$props.disabled,selector:"#"+t.elementId,plugins:(e=t.$props.init&&t.$props.init.plugins,n=t.$props.plugins,y(e).concat(y(n))),toolbar:t.$props.toolbar||t.$props.init&&t.$props.init.toolbar,inline:t.inlineEditor,setup:function(e){t.editor=e,e.on("init",function(n){return p(n,t,e)}),t.$props.init&&"function"==typeof t.$props.init.setup&&t.$props.init.setup(e)}});null!==(r=t.element)&&"textarea"===r.tagName.toLowerCase()&&(t.element.style.visibility="",t.element.style.display=""),Object(C.a)().init(o)}},T={props:S,created:function(){this.elementId=this.$props.id||b("tiny-vue"),this.inlineEditor=this.$props.init&&this.$props.init.inline||this.$props.inline,this.initialized=!1},watch:{disabled:function(){this.editor.setMode(this.disabled?"readonly":"design")}},mounted:function(){if(this.element=this.$el,null!==Object(C.a)())O(this)();else if(this.element&&this.element.ownerDocument){var t=this.$props.cloudChannel?this.$props.cloudChannel:"5",e=this.$props.apiKey?this.$props.apiKey:"no-api-key",n=null===(r=this.$props.tinymceScriptSrc)||void 0===r?"https://cdn.tiny.cloud/1/"+e+"/tinymce/"+t+"/tinymce.min.js":this.$props.tinymceScriptSrc;x.load(this.element.ownerDocument,n,O(this))}var r},beforeDestroy:function(){null!==Object(C.a)()&&Object(C.a)().remove(this.editor)},deactivated:function(){var t;this.inlineEditor||(this.cache=this.editor.getContent(),null===(t=Object(C.a)())||void 0===t||t.remove(this.editor))},activated:function(){!this.inlineEditor&&this.initialized&&O(this)()},render:function(t){return this.inlineEditor?function(t,e,n){return t(n||"div",{attrs:{id:e}})}(t,this.elementId,this.$props.tagName):function(t,e){return t("textarea",{attrs:{id:e},style:{visibility:"hidden"}})}(t,this.elementId)}},_=(n("HaK5"),n("NBEC"),n("gBhd"),n("Q/P+"),n("f85y"),n("q/hF"),n("yXOt"),n("Rv7z"),n("c/6r"),n("Vphg"),n("Xnfr")),E=n("bzuE"),D=n("lbHh"),A=n.n(D),N=n("Dod7"),M=(n("zL8q"),{name:"schedule_news_add",components:{Editor:T,SearchMulitUsers:f.a},data:function(){return{fullscreenLoading:!1,isDisabled:!1,auto_upload:!1,userInfo:"",show_save:"",config:E.a,uploadUrl:N.a.uploadUrl,ftpPrefix:N.a.ftpPrefix,formData:{},ruleForm:{title:[{required:!0,message:"请填写标题",trigger:"blur"}],type:[{required:!0,message:"请选择类型",trigger:"change"}]},fileOFNameAndPath:[],fileDocList:[],typeList:[],loading:!1,tinymceId:"tinymceId",tinymceHtml:"",DefaultInit:{disabled:!0,language_url:"/static/tinymce/zh_CN.js",language:"zh_CN",skin_url:"/static/tinymce/skins/ui/oxide",height:400,menubar:!1,images_upload_url:N.a.uploadUrl,images_upload_base_path:"",images_upload_credentials:!0,plugins:"link lists image code table colorpicker textcolor wordcount contextmenu",toolbar:"bold italic underline strikethrough | fontsizeselect | forecolor backcolor | alignleft aligncenter alignright alignjustify | bullist numlist | outdent indent blockquote | undo redo | link unlink image code | removeformat",branding:!1,images_upload_handler:function(t,e,n,r){var o="",i="";(o=new XMLHttpRequest).withCredentials=!1,o.open("POST",N.a.uploadUrl),o.onload=function(){var t;if(200===o.status)if(0===(t=JSON.parse(o.responseText)).code){var r=N.a.ftpPrefix+t.filePath;e(r)}else n("上次失败!");else n("请求错误: ",o.status)},(i=new FormData).append("file",t.blob()),o.send(i)}}}},mounted:function(){this.userInfo=JSON.parse(A.a.get("userInfo")),m.a.init({}),this.initialize(),this.$route.query.id?(this.formData.id=this.$route.query.id,this.getDetail(),this.show_save=!1):this.show_save=!0},methods:s()({},Object(l.d)({removeTagNav:"tagNav/removeTagNav"}),{changeCurLists:function(t){},initialize:function(){var t=this;this.$api.dictAPI.getDictsByType("document_type").then(function(e){0===e.code&&(t.typeList=e.datas)})},getDetail:function(){var t=this;this.loading=!0,this.$api.newsAPI.detail({id:this.formData.id}).then(function(e){if(t.loading=!1,0===e.code&&(t.userInfo.userId==e.newsHead.createBy&&(t.show_save=!0),t.formData=a()({},t.formData,e.newsHead),e.newsHead.text&&(t.tinymceHtml=e.newsHead.text),e.initFileList&&e.initFileList.length>0)){t.fileDocList=[];for(var n=0;n<e.initFileList.length;n++){var r={name:e.initFileList[n].fileName,url:t.ftpPrefix+e.initFileList[n].filePath},o={fileName:e.initFileList[n].fileName,filePath:e.initFileList[n].filePath};t.fileDocList.push(r),t.fileOFNameAndPath.push(o)}}})},back:function(){this.removeTagNav({path:this.$route.path,title:this.$route.meta.name}),this.$router.push({path:"/schedule/news",query:{t:Date.now()}})},save:function(t){var e=this;this.$refs[t].validate(function(t){if(!t)return!1;if(e.tinymceHtml&&(e.formData.text=e.tinymceHtml),null!=e.fileOFNameAndPath&&e.fileOFNameAndPath.length>0){var n=[];e.fileOFNameAndPath.forEach(function(t){var e={fileName:t.fileName,filePath:t.filePath};n.push(e)}),e.formData.fileOFNameAndPath=i()(n)}if(e.formData.delFlag="",e.formData.id){if(e.isDisabled)return;e.isDisabled=!0,e.$api.newsAPI.update(e.formData).then(function(t){e.isDisabled=!1,0===t.code?(e.$message({message:t.msg,type:"success"}),e.back()):e.$message({message:t.msg,type:"error"})})}else{if(e.isDisabled)return;e.isDisabled=!0,e.$api.newsAPI.save(e.formData).then(function(t){e.isDisabled=!1,0===t.code?(e.$message({message:t.msg,type:"success"}),e.back()):e.$message({message:t.msg,type:"error"})})}})},httpRequest:function(t,e,n){var r=this,o=new FormData;o.append("file",t,e),this.$api.commonAPI.uploadUrl(o).then(function(e){r.fullscreenLoading=!1,0==e.code?(r.$message({message:"上传成功",type:"success",duration:2e3}),n?n.filePath=e.filePath:t.filePath=e.filePath,r.fileOFNameAndPath.push({filePath:e.filePath,fileName:e.fileName})):(r.fullscreenLoading=!1,r.$message.error("上传失败"),r.$refs.upload.uploadFiles.splice(r.$refs.upload.uploadFiles.length-1,1))})},onChange:function(t,e){if(t.size>1e8)return this.$message.error("上传文件不能超过100M!"),this.$refs.upload.fileList=this.$refs.upload.fileList,this.$refs.upload.uploadFiles.splice(this.$refs.upload.uploadFiles.length-1,1),!1;t=t.raw;var n=this;/image\/\w+/.test(t.type)?(this.fullscreenLoading=!0,_.a.compressAccurately(t,400).then(function(e){e.size?n.httpRequest(e,t.name,t):(n.$message.error("压缩图片失败"),n.fullscreenLoading=!1,n.$refs.upload.uploadFiles.splice(n.$refs.upload.uploadFiles.length-1,1))}).catch(function(e){n.httpRequest(t,t.name)})):(this.fullscreenLoading=!0,this.httpRequest(t,t.name))},handleRemove:function(t,e){if(t.raw){for(var n=void 0,r=0;r<this.fileOFNameAndPath.length;r++)this.fileOFNameAndPath[r].filePath==t.raw.filePath&&(n=r);this.fileOFNameAndPath.splice(n,1)}else{for(var o=void 0,i=0;i<this.fileOFNameAndPath.length;i++)this.fileOFNameAndPath[i].filePath==t.url.substr(1)&&(o=i);this.fileOFNameAndPath.splice(o,1)}},onPreview:function(t){t.url?window.open(t.url):t.raw&&window.open(this.ftpPrefix+t.raw.filePath)},uploadSuccess:function(t,e){"操作成功"===t.msg&&this.fileOFNameAndPath.push({filePath:t.filePath,fileName:t.fileName})},resetFields:function(){this.$refs.form&&this.$refs.form.resetFields()}})}),z={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"sys-box plan-box"},[n("div",{staticClass:"sys-operate"},[n("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.back()}}},[t._v(t._s(t.config.cancelText))]),t._v(" "),t.show_save?n("el-button",{attrs:{type:"primary",disabled:t.isDisabled},on:{click:function(e){return t.save("form")}}},[t._v("保存")]):t._e()],1),t._v(" "),n("div",{staticClass:"sys-form"},[n("el-form",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],ref:"form",attrs:{"label-width":"80px",model:t.formData,rules:t.ruleForm,"inline-message":!0}},[n("el-form-item",{attrs:{label:"标题",prop:"title"}},[n("el-input",{attrs:{maxlength:"20",readonly:!t.show_save},model:{value:t.formData.title,callback:function(e){t.$set(t.formData,"title",e)},expression:"formData.title"}})],1),t._v(" "),n("el-form-item",{directives:[{name:"show",rawName:"v-show",value:t.show_save,expression:"show_save"}],attrs:{label:"内容"}},[n("Editor",{staticClass:"tinymceId",attrs:{init:t.DefaultInit,disabled:!1},model:{value:t.tinymceHtml,callback:function(e){t.tinymceHtml=e},expression:"tinymceHtml"}})],1),t._v(" "),n("el-form-item",{directives:[{name:"show",rawName:"v-show",value:!t.show_save,expression:"!show_save"}],attrs:{label:"内容"}},[n("Editor",{staticClass:"tinymceId",attrs:{init:t.DefaultInit,disabled:!0},model:{value:t.tinymceHtml,callback:function(e){t.tinymceHtml=e},expression:"tinymceHtml"}})],1),t._v(" "),n("el-form-item",{attrs:{label:"附件上传"}},[n("el-upload",{directives:[{name:"loading",rawName:"v-loading.lock",value:t.fullscreenLoading,expression:"fullscreenLoading",modifiers:{lock:!0}}],ref:"upload",attrs:{disabled:!t.show_save,action:t.uploadUrl,"on-success":t.uploadSuccess,"on-remove":t.handleRemove,"file-list":t.fileDocList,"on-preview":t.onPreview,"auto-upload":t.auto_upload,"on-change":t.onChange,accept:".pdf,.doc,.docx,.xls,.xlsx,.txt,.bmp,.gif,.rar,.zip,.png,.jpg,.jpeg"}},[n("el-button",{attrs:{size:"small",type:"primary",disabled:!t.show_save}},[t._v("点击上传")]),t._v(" "),n("div",{staticClass:"el-upload__tip",attrs:{slot:"tip"},slot:"tip"},[t._v("附件最大100M,支持格式:PDF、Word、Excel、Txt、JPG、PNG、BMP、GIF、RAR)")])],1)],1)],1)],1)])},staticRenderFns:[]};var R=n("VU/8")(M,z,!1,function(t){n("2ef/"),n("sgQE")},"data-v-1301d466",null);e.default=R.exports},"q/hF":function(t,e,n){n("Wlyy")},sgQE:function(t,e){},wjO9:function(t,e,n){"use strict";(function(t){n.d(e,"a",function(){return o});var r=function(){return"undefined"!=typeof window?window:t},o=function(){var t=r();return t&&t.tinymce?t.tinymce:null}}).call(e,n("DuR2"))},yXOt:function(t,e,n){n("L8UZ")}}); |