NG1NDEX
Server IP : 150.95.80.236  /  Your IP : 13.59.114.228
Web Server : Apache
System : Linux host-150-95-80-236 3.10.0-1160.105.1.el7.x86_64 #1 SMP Thu Dec 7 15:39:45 UTC 2023 x86_64
User : social-telecare ( 10000)
PHP Version : 7.4.33
Disable Function : opcache_get_status
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /var/www/vhosts/pcu.in.th/uat.pcu.in.th/demo15/dist/assets/plugins/custom/tinymce/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /var/www/vhosts/pcu.in.th/uat.pcu.in.th/demo15/dist/assets/plugins/custom/tinymce//tinymce.bundle.js
!function(){"use strict";function e(e){if(null===e)return"null";if(void 0===e)return"undefined";var t=typeof e;return"object"==t&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"==t&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":t}function t(e){return g((function(t,n){if(t.length!==n.length)return!1;for(var r=t.length,o=0;o<r;o++)if(!e.eq(t[o],n[o]))return!1;return!0}))}function n(e){return g((function(n,r){var o,i,a=Object.keys(n),u=Object.keys(r);if(o=t(p),i=function(e){return undefined,Array.prototype.slice.call(e).sort(undefined)},!g((function(e,t){return o.eq(i(e),i(t))})).eq(a,u))return!1;for(var c=a.length,s=0;s<c;s++){var l=a[s];if(!e.eq(n[l],r[l]))return!1}return!0}))}function r(e){return function(t){return r=typeof(n=t),(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)===e;var n,r}}function o(e){return function(t){return typeof t===e}}function i(e){return function(t){return e===t}}function a(e){return null==e}function u(e){return!a(e)}function c(){}function s(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return e(t.apply(null,n))}}function l(e,t){return function(n){return e(t(n))}}function f(e){return function(){return e}}function d(e){return e}function m(e,t){return e===t}var g=function(e){return{eq:e}},p=g((function(e,t){return e===t})),h=g((function(r,o){if(r===o)return!0;var i=e(r);return i===e(o)&&(-1!==["undefined","boolean","number","string","function","xml","null"].indexOf(i)?r===o:"array"===i?t(h).eq(r,o):"object"===i&&n(h).eq(r,o))})),v=r("string"),b=r("object"),y=r("array"),w=i(null),x=o("boolean"),C=i(void 0),S=o("function"),k=o("number");function T(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=t.concat(n);return e.apply(null,o)}}function O(e){return function(t){return!e(t)}}function _(e){return e()}function E(e){e()}function A(){return N}var D=f(!1),M=f(!0),N={fold:function(e,t){return e()},isSome:D,isNone:M,getOr:d,getOrThunk:R,getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:f(null),getOrUndefined:f(void 0),or:d,orThunk:R,map:A,each:c,bind:A,exists:D,forall:M,filter:function(){return N},toArray:function(){return[]},toString:f("none()")};function R(e){return e()}function z(e,t){return ye.call(e,t)}function B(e,t){return-1<z(e,t)}function P(e,t){for(var n=0,r=e.length;n<r;n++)if(t(e[n],n))return!0;return!1}function I(e,t){for(var n=e.length,r=new Array(n),o=0;o<n;o++){var i=e[o];r[o]=t(i,o)}return r}function F(e,t){for(var n=0,r=e.length;n<r;n++)t(e[n],n)}function L(e,t){for(var n=e.length-1;0<=n;n--)t(e[n],n)}function H(e,t){for(var n=[],r=[],o=0,i=e.length;o<i;o++){var a=e[o];(t(a,o)?n:r).push(a)}return{pass:n,fail:r}}function V(e,t){for(var n=[],r=0,o=e.length;r<o;r++){var i=e[r];t(i,r)&&n.push(i)}return n}function j(e,t,n){return L(e,(function(e,r){n=t(n,e,r)})),n}function U(e,t,n){return F(e,(function(e,r){n=t(n,e,r)})),n}function W(e,t,n){for(var r=0,o=e.length;r<o;r++){var i=e[r];if(t(i,r))return ve.some(i);if(n(i,r))break}return ve.none()}function $(e,t){return W(e,t,D)}function q(e,t){for(var n=0,r=e.length;n<r;n++)if(t(e[n],n))return ve.some(n);return ve.none()}function G(e,t){return function(e){for(var t=[],n=0,r=e.length;n<r;++n){if(!y(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);we.apply(t,e[n])}return t}(I(e,t))}function K(e,t){for(var n=0,r=e.length;n<r;++n)if(!0!==t(e[n],n))return!1;return!0}function X(e){var t=be.call(e,0);return t.reverse(),t}function Y(e,t){return V(e,(function(e){return!B(t,e)}))}function J(e,t){var n=be.call(e,0);return n.sort(t),n}function Z(e,t){return 0<=t&&t<e.length?ve.some(e[t]):ve.none()}function Q(e){return Z(e,0)}function ee(e){return Z(e,e.length-1)}function te(e,t){for(var n=0;n<e.length;n++){var r=t(e[n],n);if(r.isSome())return r}return ve.none()}function ne(e,t){for(var n=Ce(e),r=0,o=n.length;r<o;r++){var i=n[r];t(e[i],i)}}function re(e,t){return ke(e,(function(e,n){return{k:n,v:t(e,n)}}))}function oe(e){return function(t,n){e[n]=t}}function ie(e,t,n,r){return ne(e,(function(e,o){(t(e,o)?n:r)(e,o)})),1}function ae(e,t){var n={};return ie(e,t,oe(n),c),n}function ue(e,t){return Te(e,t)?ve.from(e[t]):ve.none()}function ce(e,t){return Te(e,t)&&void 0!==e[t]&&null!==e[t]}function se(e,t,n){var r,o;if(!e)return!1;if(n=n||e,void 0!==e.length){for(r=0,o=e.length;r<o;r++)if(!1===t.call(n,e[r],r,e))return!1}else for(r in e)if(Te(e,r)&&!1===t.call(n,e[r],r,e))return!1;return!0}function le(e,t){var n=[];return se(e,(function(r,o){n.push(t(r,o,e))})),n}function fe(e,t){var n=[];return se(e,(function(r,o){t&&!t(r,o,e)||n.push(r)})),n}function de(e,t){if(e)for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}function me(e,t,n,r){for(var o=C(n)?e[0]:n,i=0;i<e.length;i++)o=t.call(r,o,e[i],i);return o}function ge(e,t,n){for(var r=0,o=e.length;r<o;r++)if(t.call(n,e[r],r,e))return r;return-1}function pe(e){return e[e.length-1]}var he=function(e){function t(){return o}function n(t){return t(e)}var r=f(e),o={fold:function(t,n){return n(e)},isSome:M,isNone:D,getOr:r,getOrThunk:r,getOrDie:r,getOrNull:r,getOrUndefined:r,or:t,orThunk:t,map:function(t){return he(t(e))},each:function(t){t(e)},bind:n,exists:n,forall:n,filter:function(t){return t(e)?o:N},toArray:function(){return[e]},toString:function(){return"some("+e+")"}};return o},ve={some:he,none:A,from:function(e){return null==e?N:he(e)}},be=Array.prototype.slice,ye=Array.prototype.indexOf,we=Array.prototype.push,xe=S(Array.from)?Array.from:function(e){return be.call(e)},Ce=Object.keys,Se=Object.hasOwnProperty,ke=function(e,t){var n={};return ne(e,(function(e,r){var o=t(e,r);n[o.k]=o.v})),n},Te=function(e,t){return Se.call(e,t)},Oe=Array.isArray,_e=function(){return(_e=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function Ee(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||((r=r||Array.prototype.slice.call(t,0,o))[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}function Ae(e){var t,n=!1;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=!0,t=e.apply(null,r)),t}}function De(e,t){var n=String(t).toLowerCase();return $(e,(function(e){return e.search(n)}))}function Me(e,t){return-1!==e.indexOf(t)}function Ne(e){return function(t){return t.replace(e,"")}}function Re(e){return 0<e.length}function ze(e){return!Re(e)}function Be(e){return function(t){return Me(t,e)}}function Pe(e){return window.matchMedia(e).matches}function Ie(e){return null==e?"":(""+e).replace(Ct,"")}function Fe(e,t){return t?!("array"!==t||!Oe(e))||typeof e===t:void 0!==e}function Le(e,t){for(var n=[],r=function(e){return n.push(e),t(e)},o=t(e);(o=o.bind(r)).isSome(););return n}function He(e,t){var n=e.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(t);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(t);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(t);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")}function Ve(e){return 1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType||0===e.childElementCount}function je(e,t){return e.dom===t.dom}function Ue(e,t){return dt().browser.isIE()?(n=e.dom,r=t.dom,o=Node.DOCUMENT_POSITION_CONTAINED_BY,0!=(n.compareDocumentPosition(r)&o)):(i=e.dom)!==(a=t.dom)&&i.contains(a);var n,r,o,i,a}function We(){return Ke(0,0)}function $e(e){function t(e){return function(){return n===e}}var n=e.current,r=e.version;return{current:n,version:r,isEdge:t("Edge"),isChrome:t("Chrome"),isIE:t("IE"),isOpera:t("Opera"),isFirefox:t(nt),isSafari:t("Safari")}}function qe(e){function t(e){return function(){return n===e}}var n=e.current,r=e.version;return{current:n,version:r,isWindows:t(it),isiOS:t("iOS"),isAndroid:t(at),isOSX:t("OSX"),isLinux:t("Linux"),isSolaris:t(ut),isFreeBSD:t(ct),isChromeOS:t(st)}}function Ge(e){if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}}var Ke=function(e,t){return{major:e,minor:t}},Xe={nu:Ke,detect:function(e,t){var n,r,o=String(t).toLowerCase();return 0===e.length?We():(r=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(r.test(t))return r}}(e,n=o))?Ke(i(1),i(2)):{major:0,minor:0};function i(e){return Number(n.replace(r,"$"+e))}},unknown:We},Ye=function(e,t){return""===(n=t)||e.length>=n.length&&e.substr(0,0+n.length)===n;var n},Je=Ne(/^\s+|\s+$/g),Ze=Ne(/^\s+/g),Qe=Ne(/\s+$/g),et=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,tt={browsers:f([{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return Me(e,"edge/")&&Me(e,"chrome")&&Me(e,"safari")&&Me(e,"applewebkit")}},{name:"Chrome",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,et],search:function(e){return Me(e,"chrome")&&!Me(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return Me(e,"msie")||Me(e,"trident")}},{name:"Opera",versionRegexes:[et,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Be("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Be("firefox")},{name:"Safari",versionRegexes:[et,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(Me(e,"safari")||Me(e,"mobile/"))&&Me(e,"applewebkit")}}]),oses:f([{name:"Windows",search:Be("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return Me(e,"iphone")||Me(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Be("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:Be("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Be("linux"),versionRegexes:[]},{name:"Solaris",search:Be("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Be("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:Be("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}])},nt="Firefox",rt=function(){return $e({current:void 0,version:Xe.unknown()})},ot=$e,it=(f("Edge"),f("Chrome"),f("IE"),f("Opera"),f(nt),f("Safari"),"Windows"),at="Android",ut="Solaris",ct="FreeBSD",st="ChromeOS",lt=function(){return qe({current:void 0,version:Xe.unknown()})},ft=qe,dt=(f(it),f("iOS"),f(at),f("Linux"),f("OSX"),f(ut),f(ct),f(st),Ae((function(){return e=navigator.userAgent,t=ve.from(navigator.userAgentData),n=Pe,h=tt.browsers(),v=tt.oses(),b=t.bind((function(e){return t=h,te(e.brands,(function(e){var n=e.brand.toLowerCase();return $(t,(function(e){var t;return n===(null===(t=e.brand)||void 0===t?void 0:t.toLowerCase())})).map((function(t){return{current:t.name,version:Xe.nu(parseInt(e.version,10),0)}}))}));var t})).orThunk((function(){return De(h,t=e).map((function(e){var n=Xe.detect(e.versionRegexes,t);return{current:e.name,version:n}}));var t})).fold(rt,ot),y=De(v,r=e).map((function(e){var t=Xe.detect(e.versionRegexes,r);return{current:e.name,version:t}})).fold(lt,ft),{browser:b,os:y,deviceType:(i=b,a=e,u=n,c=(o=y).isiOS()&&!0===/ipad/i.test(a),s=o.isiOS()&&!c,d=(l=o.isiOS()||o.isAndroid())||u("(pointer:coarse)"),m=c||!s&&l&&u("(min-device-width:768px)"),g=s||l&&!m,p=i.isSafari()&&o.isiOS()&&!1===/safari/i.test(a),{isiPad:f(c),isiPhone:f(s),isTablet:f(m),isPhone:f(g),isTouch:f(d),isAndroid:o.isAndroid,isiOS:o.isiOS,isWebView:f(p),isDesktop:f(!g&&!m&&!p)})};var e,t,n,r,o,i,a,u,c,s,l,d,m,g,p,h,v,b,y}))),mt=navigator.userAgent,gt=dt(),pt=gt.browser,ht=gt.os,vt=gt.deviceType,bt=/WebKit/.test(mt)&&!pt.isEdge(),yt="FormData"in window&&"FileReader"in window&&"URL"in window&&!!URL.createObjectURL,wt=-1!==mt.indexOf("Windows Phone"),xt={opera:pt.isOpera(),webkit:bt,ie:!(!pt.isIE()&&!pt.isEdge())&&pt.version.major,gecko:pt.isFirefox(),mac:ht.isOSX()||ht.isiOS(),iOS:vt.isiPad()||vt.isiPhone(),android:ht.isAndroid(),contentEditable:!0,transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",caretAfter:!0,range:window.getSelection&&"Range"in window,documentMode:pt.isIE()?document.documentMode||7:10,fileApi:yt,ceFalse:!0,cacheSuffix:null,container:null,experimentalShadowDom:!1,canHaveCSP:!pt.isIE(),desktop:vt.isDesktop(),windowsPhone:wt,browser:{current:pt.current,version:pt.version,isChrome:pt.isChrome,isEdge:pt.isEdge,isFirefox:pt.isFirefox,isIE:pt.isIE,isOpera:pt.isOpera,isSafari:pt.isSafari},os:{current:ht.current,version:ht.version,isAndroid:ht.isAndroid,isChromeOS:ht.isChromeOS,isFreeBSD:ht.isFreeBSD,isiOS:ht.isiOS,isLinux:ht.isLinux,isOSX:ht.isOSX,isSolaris:ht.isSolaris,isWindows:ht.isWindows},deviceType:{isDesktop:vt.isDesktop,isiPad:vt.isiPad,isiPhone:vt.isiPhone,isPhone:vt.isPhone,isTablet:vt.isTablet,isTouch:vt.isTouch,isWebView:vt.isWebView}},Ct=/^\s*|\s*$/g,St=function(e,t,n,r){r=r||this,e&&se(e=n?e[n]:e,(function(e,o){return!1!==t.call(r,e,o,n)&&void St(e,t,n,r)}))},kt={trim:Ie,isArray:Oe,is:Fe,toArray:function(e){if(Oe(e))return e;for(var t=[],n=0,r=e.length;n<r;n++)t[n]=e[n];return t},makeMap:function(e,t,n){var r;for(t=t||",",n=n||{},r=(e="string"==typeof(e=e||[])?e.split(t):e).length;r--;)n[e[r]]={};return n},each:se,map:le,grep:fe,inArray:de,hasOwn:Te,extend:function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=0;r<t.length;r++){var o,i,a=t[r];for(o in a)!Te(a,o)||void 0!==(i=a[o])&&(e[o]=i)}return e},create:function(e,t,n){var r,o,i,a=this,u=0,c=(e=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(e))[3].match(/(^|\.)(\w+)$/i)[2],s=a.createNS(e[3].replace(/\.\w+$/,""),n);if(!s[c]){if("static"===e[2])return s[c]=t,void(this.onCreate&&this.onCreate(e[2],e[3],s[c]));t[c]||(t[c]=function(){},u=1),s[c]=t[c],a.extend(s[c].prototype,t),e[5]&&(r=a.resolve(e[5]).prototype,o=e[5].match(/\.(\w+)$/i)[1],i=s[c],s[c]=u?function(){return r[o].apply(this,arguments)}:function(){return this.parent=r[o],i.apply(this,arguments)},s[c].prototype[c]=s[c],a.each(r,(function(e,t){s[c].prototype[t]=r[t]})),a.each(t,(function(e,t){r[t]?s[c].prototype[t]=function(){return this.parent=r[t],e.apply(this,arguments)}:t!==c&&(s[c].prototype[t]=e)}))),a.each(t.static,(function(e,t){s[c][t]=e}))}},walk:St,createNS:function(e,t){var n,r;for(t=t||window,e=e.split("."),n=0;n<e.length;n++)t[r=e[n]]||(t[r]={}),t=t[r];return t},resolve:function(e,t){var n,r;for(t=t||window,n=0,r=(e=e.split(".")).length;n<r&&(t=t[e[n]]);n++);return t},explode:function(e,t){return!e||Fe(e,"array")?e:le(e.split(t||","),Ie)},_addCacheSuffix:function(e){var t=xt.cacheSuffix;return t&&(e+=(-1===e.indexOf("?")?"?":"&")+t),e}},Tt={fromHtml:function(e,t){var n=(t||document).createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||1<n.childNodes.length)throw console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return Ge(n.childNodes[0])},fromTag:function(e,t){return Ge((t||document).createElement(e))},fromText:function(e,t){return Ge((t||document).createTextNode(e))},fromDom:Ge,fromPoint:function(e,t,n){return ve.from(e.dom.elementFromPoint(t,n)).map(Ge)}};function Ot(e){return e.dom.nodeName.toLowerCase()}function _t(e){return e.dom.nodeType}function Et(e){return function(t){return _t(t)===e}}function At(e){return Tt.fromDom(e.dom.ownerDocument)}function Dt(e){return _n(e)?e:At(e)}function Mt(e){return Tt.fromDom(Dt(e).dom.defaultView)}function Nt(e){return ve.from(e.dom.parentNode).map(Tt.fromDom)}function Rt(e){return ve.from(e.dom.previousSibling).map(Tt.fromDom)}function zt(e){return ve.from(e.dom.nextSibling).map(Tt.fromDom)}function Bt(e){return X(Le(e,Rt))}function Pt(e){return Le(e,zt)}function It(e,t){var n=e.dom.childNodes;return ve.from(n[t]).map(Tt.fromDom)}function Ft(e){return It(e,0)}function Lt(e){return It(e,e.dom.childNodes.length-1)}function Ht(e){return e.dom.childNodes.length}function Vt(e){return En(e)&&u(e.dom.host)}function jt(e){return Vt(e)?e:function(){var t=Dt(e).dom.head;if(null==t)throw new Error("Head is not available yet");return Tt.fromDom(t)}()}function Ut(e){return Tt.fromDom(e.dom.host)}function Wt(e,t){Nt(e).each((function(n){n.dom.insertBefore(t.dom,e.dom)}))}function $t(e,t){zt(e).fold((function(){Nt(e).each((function(e){Rn(e,t)}))}),(function(e){Wt(e,t)}))}function qt(e,t){Ft(e).fold((function(){Rn(e,t)}),(function(n){e.dom.insertBefore(t.dom,n.dom)}))}function Gt(e,t){F(t,(function(t){Rn(e,t)}))}function Kt(e){e.dom.textContent="",F(An(e),(function(e){zn(e)}))}function Xt(e){var t,n=An(e);0<n.length&&(t=e,F(n,(function(e){Wt(t,e)}))),zn(e)}function Yt(e,t){return void 0!==e?e:void 0!==t?t:0}function Jt(e){var t=void 0!==e?e.dom:document,n=t.body.scrollLeft||t.documentElement.scrollLeft,r=t.body.scrollTop||t.documentElement.scrollTop;return In(n,r)}function Zt(e,t,n){var r=(void 0!==n?n.dom:document).defaultView;r&&r.scrollTo(e,t)}function Qt(e,t){dt().browser.isSafari()&&S(e.dom.scrollIntoViewIfNeeded)?e.dom.scrollIntoViewIfNeeded(!1):e.dom.scrollIntoView(t)}function en(e,t,n,r){return{x:e,y:t,width:n,height:r,right:e+n,bottom:t+r}}function tn(e){var t=void 0===e?window:e,n=t.document,r=Jt(Tt.fromDom(n)),o=void 0===t?window:t;return(dt().browser.isFirefox()?ve.none():ve.from(o.visualViewport)).fold((function(){var e=t.document.documentElement,n=e.clientWidth,o=e.clientHeight;return en(r.left,r.top,n,o)}),(function(e){return en(Math.max(e.pageLeft,r.left),Math.max(e.pageTop,r.top),e.width,e.height)}))}function nn(e){return function(t){return!!t&&t.nodeType===e}}function rn(e){return e&&!Object.getPrototypeOf(e)}function on(e){var t=e.map((function(e){return e.toLowerCase()}));return function(e){if(e&&e.nodeName){var n=e.nodeName.toLowerCase();return B(t,n)}return!1}}function an(e,t){var n=t.toLowerCase().split(" ");return function(t){if(Ln(t))for(var r=0;r<n.length;r++){var o=t.ownerDocument.defaultView.getComputedStyle(t,null);if((o?o.getPropertyValue(e):null)===n[r])return!0}return!1}}function un(e){return function(t){return Ln(t)&&t.hasAttribute(e)}}function cn(e){return Ln(e)&&e.hasAttribute("data-mce-bogus")}function sn(e){return Ln(e)&&"TABLE"===e.tagName}function ln(e){return function(t){if(Ln(t)){if(t.contentEditable===e)return!0;if(t.getAttribute("data-mce-contenteditable")===e)return!0}return!1}}function fn(e,t,n){return void 0===n&&(n=m),e.exists((function(e){return n(e,t)}))}function dn(e,t,n){return e.isSome()&&t.isSome()?ve.some(n(e.getOrDie(),t.getOrDie())):ve.none()}function mn(e){return void 0!==e.style&&S(e.style.getPropertyValue)}function gn(e,t,n){if(!(v(n)||x(n)||k(n)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",n,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,n+"")}function pn(e,t,n){gn(e.dom,t,n)}function hn(e,t){var n=e.dom;ne(t,(function(e,t){gn(n,t,e)}))}function vn(e,t){var n=e.dom.getAttribute(t);return null===n?void 0:n}function bn(e,t){return ve.from(vn(e,t))}function yn(e,t){e.dom.removeAttribute(t)}function wn(e,t){var n=e.dom,r=window.getComputedStyle(n).getPropertyValue(t);return""!==r||Bn(e)?r:Jn(n,t)}function xn(e,t){var n=e.dom,r=Jn(n,t);return ve.from(r).filter((function(e){return 0<e.length}))}function Cn(e){var t={},n=e.dom;if(mn(n))for(var r=0;r<n.style.length;r++){var o=n.style.item(r);t[o]=n.style[o]}return t}function Sn(e){return $(e,Tn)}function kn(e,t){return e.children&&B(e.children,t)}"undefined"!=typeof window||Function("return this;")();var Tn=Et(1),On=Et(3),_n=Et(9),En=Et(11),An=function(e){return I(e.dom.childNodes,Tt.fromDom)},Dn=S(Element.prototype.attachShadow)&&S(Node.prototype.getRootNode),Mn=f(Dn),Nn=Dn?function(e){return Tt.fromDom(e.dom.getRootNode())}:Dt,Rn=function(e,t){e.dom.appendChild(t.dom)},zn=function(e){var t=e.dom;null!==t.parentNode&&t.parentNode.removeChild(t)},Bn=function(e){var t=On(e)?e.dom.parentNode:e.dom;if(null==t||null===t.ownerDocument)return!1;var n=t.ownerDocument,r=Tt.fromDom(t),o=Nn(r);return(Vt(o)?ve.some(o):ve.none()).fold((function(){return n.body.contains(t)}),l(Bn,Ut))},Pn=function(e,t){return{left:e,top:t,translate:function(n,r){return Pn(e+n,t+r)}}},In=Pn,Fn=function(e){var t,n=e.dom,r=n.ownerDocument.body;return r===n?In(r.offsetLeft,r.offsetTop):Bn(e)?(t=n.getBoundingClientRect(),In(t.left,t.top)):In(0,0)},Ln=nn(1),Hn=on(["textarea","input"]),Vn=nn(3),jn=nn(8),Un=nn(9),Wn=nn(11),$n=on(["br"]),qn=on(["img"]),Gn=ln("true"),Kn=ln("false"),Xn=on(["td","th"]),Yn=on(["video","audio","object","embed"]),Jn=function(e,t){return mn(e)?e.style.getPropertyValue(t):""},Zn=dt().browser,Qn={},er={exports:Qn};function tr(e){setTimeout((function(){throw e}),0)}function nr(e){return ur((function(){return new or(e)}))}function rr(e){if(!y(e))throw new Error("cases must be an array");if(0===e.length)throw new Error("there must be at least one case");var t=[],n={};return F(e,(function(r,o){var i=Ce(r);if(1!==i.length)throw new Error("one and only one name per case");var a=i[0],u=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(!y(u))throw new Error("case arguments must be an array");t.push(a),n[a]=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=n.length;if(i!==u.length)throw new Error("Wrong number of arguments to case "+a+". Expected "+u.length+" ("+u+"), got "+i);return{fold:function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];if(t.length!==e.length)throw new Error("Wrong number of arguments to fold. Expected "+e.length+", got "+t.length);return t[o].apply(null,n)},match:function(e){var r=Ce(e);if(t.length!==r.length)throw new Error("Wrong number of arguments to match. Expected: "+t.join(",")+"\nActual: "+r.join(","));if(!K(t,(function(e){return B(r,e)})))throw new Error("Not all branches were specified when using match. Specified: "+r.join(", ")+"\nRequired: "+t.join(", "));return e[a].apply(null,n)},log:function(e){console.log(e,{constructors:t,constructor:a,params:n})}}}})),n}!function(){var e=this,t=function(){var e,t,n,r={exports:{}};function o(){}function i(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],f(e,this)}function a(e,t){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,i._immediateFn((function(){var n,r=1===e._state?t.onFulfilled:t.onRejected;if(null!==r){try{n=r(e._value)}catch(n){return void c(t.promise,n)}u(t.promise,n)}else(1===e._state?u:c)(t.promise,e._value)}))):e._deferreds.push(t)}function u(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if(t instanceof i)return e._state=3,e._value=t,void s(e);if("function"==typeof n)return void f((r=n,o=t,function(){r.apply(o,arguments)}),e)}e._state=1,e._value=t,s(e)}catch(t){c(e,t)}var r,o}function c(e,t){e._state=2,e._value=t,s(e)}function s(e){2===e._state&&0===e._deferreds.length&&i._immediateFn((function(){e._handled||i._unhandledRejectionFn(e._value)}));for(var t=0,n=e._deferreds.length;t<n;t++)a(e,e._deferreds[t]);e._deferreds=null}function l(e,t,n){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=n}function f(e,t){var n=!1;try{e((function(e){n||(n=!0,u(t,e))}),(function(e){n||(n=!0,c(t,e))}))}catch(e){if(n)return;n=!0,c(t,e)}}e=r,t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=setTimeout,i.prototype.catch=function(e){return this.then(null,e)},i.prototype.then=function(e,t){var n=new this.constructor(o);return a(this,new l(e,t,n)),n},i.all=function(e){var t=Array.prototype.slice.call(e);return new i((function(e,n){if(0===t.length)return e([]);for(var r=t.length,o=0;o<t.length;o++)!function o(i,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var u=a.then;if("function"==typeof u)return u.call(a,(function(e){o(i,e)}),n),0}t[i]=a,0==--r&&e(t)}catch(a){n(a)}}(o,t[o])}))},i.resolve=function(e){return e&&"object"==typeof e&&e.constructor===i?e:new i((function(t){t(e)}))},i.reject=function(e){return new i((function(t,n){n(e)}))},i.race=function(e){return new i((function(t,n){for(var r=0,o=e.length;r<o;r++)e[r].then(t,n)}))},i._immediateFn="function"==typeof setImmediate?function(e){setImmediate(e)}:function(e){n(e,0)},i._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)},i._setImmediateFn=function(e){i._immediateFn=e},i._setUnhandledRejectionFn=function(e){i._unhandledRejectionFn=e},e.exports?e.exports=i:t.Promise||(t.Promise=i);var d=r.exports;return{boltExport:("undefined"!=typeof window?window:Function("return this;")()).Promise||d}};"object"==typeof Qn&&void 0!==er?er.exports=t():(e="undefined"!=typeof globalThis?globalThis:e||self).EphoxContactWrapper=t()}();var or=er.exports.boltExport,ir=function(e){function t(e){o()?i(e):r.push(e)}var n=ve.none(),r=[],o=function(){return n.isSome()},i=function(e){n.each((function(t){setTimeout((function(){e(t)}),0)}))};return e((function(e){o()||(n=ve.some(e),F(r,i),r=[])})),{get:t,map:function(e){return ir((function(n){t((function(t){n(e(t))}))}))},isReady:o}},ar={nu:ir,pure:function(e){return ir((function(t){t(e)}))}},ur=function(e){function t(t){e().then(t,tr)}return{map:function(t){return ur((function(){return e().then(t)}))},bind:function(t){return ur((function(){return e().then((function(e){return t(e).toPromise()}))}))},anonBind:function(t){return ur((function(){return e().then((function(){return t.toPromise()}))}))},toLazy:function(){return ar.nu(t)},toCached:function(){var t=null;return ur((function(){return t=null===t?e():t}))},toPromise:e,get:t}},cr=function(e){return{isValue:M,isError:D,getOr:f(e),getOrThunk:f(e),getOrDie:f(e),or:function(t){return cr(e)},orThunk:function(t){return cr(e)},fold:function(t,n){return n(e)},map:function(t){return cr(t(e))},mapError:function(t){return cr(e)},each:function(t){t(e)},bind:function(t){return t(e)},exists:function(t){return t(e)},forall:function(t){return t(e)},toOptional:function(){return ve.some(e)}}},sr=function(e){return{isValue:D,isError:M,getOr:d,getOrThunk:function(e){return e()},getOrDie:function(){return t=String(e),function(){throw new Error(t)}();var t},or:d,orThunk:function(e){return e()},fold:function(t,n){return t(e)},map:function(t){return sr(e)},mapError:function(t){return sr(t(e))},each:c,bind:function(t){return sr(e)},exists:D,forall:M,toOptional:ve.none}},lr={value:cr,error:sr,fromOption:function(e,t){return e.fold((function(){return sr(t)}),cr)}};function fr(e){return e.fold(d,d)}function dr(e,t,n,r,o){return e(n,r)?ve.some(n):S(o)&&o(n)?ve.none():t(n,r,o)}function mr(e,t,n){for(var r=e.dom,o=S(n)?n:D;r.parentNode;){r=r.parentNode;var i=Tt.fromDom(r);if(t(i))return ve.some(i);if(o(i))break}return ve.none()}function gr(e,t,n){return dr((function(e,t){return t(e)}),mr,e,t,n)}function pr(e,t,n){return mr(e,(function(e){return He(e,t)}),n)}function hr(e,t){return n=t,Ve(r=void 0===e?document:e.dom)?ve.none():ve.from(r.querySelector(n)).map(Tt.fromDom);var n,r}function vr(e,t,n){return dr(He,pr,e,t,n)}function br(e,t){return"number"!=typeof t&&(t=0),setTimeout(e,t)}function yr(e,t){return"number"!=typeof t&&(t=1),setInterval(e,t)}function wr(e,t){function n(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];clearTimeout(r),r=br((function(){e.apply(this,n)}),t)}var r;return n.stop=function(){clearTimeout(r)},n}function xr(e,t){function n(n,r,o){var s,f=kt._addCacheSuffix(n),d=ue(a,f).getOrThunk((function(){return{id:"mce-u"+i++,passed:[],failed:[],count:0}}));function m(e,t){for(var n=e.length;n--;)e[n]();d.status=t,d.passed=[],d.failed=[],s&&(s.onload=null,s.onerror=null,s=null)}function g(){return m(d.passed,2),0}function p(){return m(d.failed,3)}(a[f]=d).count++;var h,v,b,y=function(){var t=y;!function(){for(var t=e.styleSheets,n=t.length;n--;){var r=t[n].ownerNode;if(r&&r.id===s.id)return g(),1}}()&&(Date.now()-v<l?Tr.setTimeout(t):p())};r&&d.passed.push(r),o&&d.failed.push(o),1!==d.status&&(2!==d.status?3!==d.status?(d.status=1,hn(h=Tt.fromTag("link",c.dom),{rel:"stylesheet",type:"text/css",id:d.id}),v=Date.now(),t.contentCssCors&&pn(h,"crossOrigin","anonymous"),t.referrerPolicy&&pn(h,"referrerpolicy",t.referrerPolicy),(s=h.dom).onload=y,s.onerror=p,b=h,Rn(jt(u),b),pn(h,"href",f)):p():g())}function r(e){return nr((function(t){n(e,s(t,f(lr.value(e))),s(t,f(lr.error(e))))}))}function o(e){var t=kt._addCacheSuffix(e);ue(a,t).each((function(e){var n;0==--e.count&&(delete a[t],n=e.id,hr(jt(u),"#"+n).each(zn))}))}void 0===t&&(t={});var i=0,a={},u=Tt.fromDom(e),c=Dt(u),l=t.maxLoadTime||5e3;return{load:n,loadAll:function(e,t,n){var o,i=I(e,r);o=i,nr((function(e){var t=[],n=0;0===o.length?e([]):F(o,(function(r,i){var a;r.get((a=i,function(r){t[a]=r,++n>=o.length&&e(t)}))}))})).get((function(e){var r=H(e,(function(e){return e.isValue()}));0<r.fail.length?n(r.fail.map(fr)):t(r.pass.map(fr))}))},unload:o,unloadAll:function(e){F(e,(function(e){o(e)}))},_setReferrerPolicy:function(e){t.referrerPolicy=e}}}rr([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);var Cr,Sr,kr=window.Promise||or,Tr={requestAnimationFrame:function(e,t){Cr?Cr.then(e):Cr=new kr((function(e){!function(e,t){for(var n=window.requestAnimationFrame,r=["ms","moz","webkit"],o=0;o<r.length&&!n;o++)n=window[r[o]+"RequestAnimationFrame"];(n=n||function(e){window.setTimeout(e,0)})(e,t)}(e,t=t||document.body)})).then(e)},setTimeout:br,setInterval:yr,setEditorTimeout:function(e,t,n){return br((function(){e.removed||t()}),n)},setEditorInterval:function(e,t,n){var r=yr((function(){e.removed?clearInterval(r):t()}),n);return r},debounce:wr,throttle:wr,clearInterval:function(e){return clearInterval(e)},clearTimeout:function(e){return clearTimeout(e)}},Or=(Sr=new WeakMap,{forElement:function(e,t){var n=Nn(e).dom;return ve.from(Sr.get(n)).getOrThunk((function(){var e=xr(n,t);return Sr.set(n,e),e}))}}),_r=(Er.prototype.current=function(){return this.node},Er.prototype.next=function(e){return this.node=this.findSibling(this.node,"firstChild","nextSibling",e),this.node},Er.prototype.prev=function(e){return this.node=this.findSibling(this.node,"lastChild","previousSibling",e),this.node},Er.prototype.prev2=function(e){return this.node=this.findPreviousNode(this.node,"lastChild","previousSibling",e),this.node},Er.prototype.findSibling=function(e,t,n,r){var o,i;if(e){if(!r&&e[t])return e[t];if(e!==this.rootNode){if(o=e[n])return o;for(i=e.parentNode;i&&i!==this.rootNode;i=i.parentNode)if(o=i[n])return o}}},Er.prototype.findPreviousNode=function(e,t,n,r){var o,i,a;if(e&&(o=e[n],!this.rootNode||o!==this.rootNode)){if(o){if(!r)for(a=o[t];a;a=a[t])if(!a[t])return a;return o}return(i=e.parentNode)&&i!==this.rootNode?i:void 0}},Er);function Er(e,t){this.node=e,this.rootNode=t,this.current=this.current.bind(this),this.next=this.next.bind(this),this.prev=this.prev.bind(this),this.prev2=this.prev2.bind(this)}function Ar(e){var t;return function(n){return t=t||function(e,t){for(var n={},r=0,o=e.length;r<o;r++){var i=e[r];n[String(i)]=t(i,r)}return n}(e,M),Te(t,Ot(n))}}function Dr(e){return Tn(e)&&!co(e)}function Mr(e){return Tn(e)&&"br"===Ot(e)}function Nr(e){return Co(e)&&(e=e.parentNode),xo(e)&&e.hasAttribute("data-mce-caret")}function Rr(e){return Co(e)&&yo(e.data)}function zr(e){return Nr(e)||Rr(e)}function Br(e){return e.firstChild!==e.lastChild||!$n(e.firstChild)}function Pr(e){var t=e.container();return!!Vn(t)&&(t.data.charAt(e.offset())===bo||e.isAtStart()&&Rr(t.previousSibling))}function Ir(e){var t=e.container();return!!Vn(t)&&(t.data.charAt(e.offset()-1)===bo||e.isAtEnd()&&Rr(t.nextSibling))}function Fr(e){return e&&e.hasAttribute("data-mce-caret")?(cn(n=(t=e.getElementsByTagName("br"))[t.length-1])&&n.parentNode.removeChild(n),e.removeAttribute("data-mce-caret"),e.removeAttribute("data-mce-bogus"),e.removeAttribute("style"),e.removeAttribute("_moz_abspos"),e):null;var t,n}function Lr(e){return Nr(e.startContainer)}function Hr(e){return!No(e)&&(Eo(e)?!Ao(e.parentNode):Do(e)||_o(e)||Mo(e)||Ro(e))}function Vr(e,t){return Hr(e)&&function(e,t){for(e=e.parentNode;e&&e!==t;e=e.parentNode){if(Ro(e))return!1;if(To(e))return!0}return!0}(e,t)}function jr(e){return zo.test(e)}function Ur(e,t){return Hr(e)&&!1===(a=t,Vn(i=e)&&jr(i.data)&&!1===(n=i,r=Tt.fromDom(a),pr(Tt.fromDom(n),"pre,code",T(je,r)).isSome()))||Ln(o=e)&&"A"===o.nodeName&&!o.hasAttribute("href")&&(o.hasAttribute("name")||o.hasAttribute("id"))||Bo(e);var n,r,o,i,a}function Wr(e,t){return function(e,t){var n=0;if(Ur(e,e))return!1;var r=e.firstChild;if(!r)return!0;var o=new _r(r,e);do{if(t){if(Io(r)){r=o.next(!0);continue}if(Po(r)){r=o.next();continue}}if($n(r))n++,r=o.next();else{if(Ur(r,e))return!1;r=o.next()}}while(r);return n<=1}(e.dom,t=void 0===t||t)}function $r(e,t){return u(e)&&(Ur(e,t)||Dr(Tt.fromDom(e)))}function qr(e){return"span"===e.nodeName.toLowerCase()&&"bookmark"===e.getAttribute("data-mce-type")}function Gr(e,t){var n,r,o,i={};if(e){for(e=e.split(","),t=t||10,n=0;n<e.length;n+=2)r=String.fromCharCode(parseInt(e[n],t)),$o[r]||(o="&"+e[n+1]+";",i[r]=o,i[o]=r);return i}}function Kr(e,t){return e.replace(t?Ho:Vo,(function(e){return $o[e]||e}))}function Xr(e,t){return e.replace(t?Ho:Vo,(function(e){return 1<e.length?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":$o[e]||"&#"+e.charCodeAt(0)+";"}))}function Yr(e,t,n){return n=n||Go,e.replace(t?Ho:Vo,(function(e){return $o[e]||n[e]||e}))}function Jr(e,t){return(e=kt.trim(e))?e.split(t||" "):[]}function Zr(e,t){var n;return e&&(n={},Zo(e="string"==typeof e?{"*":e}:e,(function(e,r){n[r]=n[r.toUpperCase()]=("map"===t?Jo:ei)(e,/[, ]/)}))),n}function Qr(e){function t(t,n,r){var o=e[t];return o?o=Jo(o,/[, ]/,Jo(o.toUpperCase(),/[, ]/)):(o=Xo[t])||(o=Jo(n," ",Jo(n.toUpperCase()," ")),o=Qo(o,r),Xo[t]=o),o}var n,r,o,i,a,u,c,s,l={},d={},m=[],g={},p={},h=(n=(e=e||{}).schema,s={},Xo[n]||(r="id accesskey class dir lang style tabindex title role",o="address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul",i="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"!==n&&(r+=" contenteditable contextmenu draggable dropzone hidden spellcheck translate",o+=" article aside details dialog figure main header footer hgroup section nav",i+=" audio canvas command datalist mark meter output picture progress time wbr video ruby bdi keygen"),"html5-strict"!==n&&(r+=" xml:lang",i=[i,c="acronym applet basefont big font strike tt"].join(" "),Zo(Jr(c),(function(e){v(e,"",i)})),o=[o,u="center dir isindex noframes"].join(" "),a=[o,i].join(" "),Zo(Jr(u),(function(e){v(e,"",a)}))),a=a||[o,i].join(" "),v("html","manifest","head body"),v("head","","base command link meta noscript script style title"),v("title hr noscript br"),v("base","href target"),v("link","href rel media hreflang type sizes hreflang"),v("meta","name http-equiv content charset"),v("style","media type scoped"),v("script","src async defer type charset"),v("body","onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload onmessage onoffline ononline onpagehide onpageshow onpopstate onresize onscroll onstorage onunload",a),v("address dt dd div caption","",a),v("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","",i),v("blockquote","cite",a),v("ol","reversed start type","li"),v("ul","","li"),v("li","value",a),v("dl","","dt dd"),v("a","href target rel media hreflang type",i),v("q","cite",i),v("ins del","cite datetime",a),v("img","src sizes srcset alt usemap ismap width height"),v("iframe","src name width height",a),v("embed","src type width height"),v("object","data type typemustmatch name usemap form width height",[a,"param"].join(" ")),v("param","name value"),v("map","name",[a,"area"].join(" ")),v("area","alt coords shape href target rel media hreflang type"),v("table","border","caption colgroup thead tfoot tbody tr"+("html4"===n?" col":"")),v("colgroup","span","col"),v("col","span"),v("tbody thead tfoot","","tr"),v("tr","","td th"),v("td","colspan rowspan headers",a),v("th","colspan rowspan headers scope abbr",a),v("form","accept-charset action autocomplete enctype method name novalidate target",a),v("fieldset","disabled form name",[a,"legend"].join(" ")),v("label","form for",i),v("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"),v("button","disabled form formaction formenctype formmethod formnovalidate formtarget name type value","html4"===n?a:i),v("select","disabled form multiple name required size","option optgroup"),v("optgroup","disabled label","option"),v("option","disabled label selected value"),v("textarea","cols dirname disabled form maxlength name readonly required rows wrap"),v("menu","type label",[a,"li"].join(" ")),v("noscript","",a),"html4"!==n&&(v("wbr"),v("ruby","",[i,"rt rp"].join(" ")),v("figcaption","",a),v("mark rt rp summary bdi","",i),v("canvas","width height",a),v("video","src crossorigin poster preload autoplay mediagroup loop muted controls width height buffered",[a,"track source"].join(" ")),v("audio","src crossorigin preload autoplay mediagroup loop muted controls buffered volume",[a,"track source"].join(" ")),v("picture","","img source"),v("source","src srcset type media sizes"),v("track","kind src srclang label default"),v("datalist","",[i,"option"].join(" ")),v("article section nav aside main header footer","",a),v("hgroup","","h1 h2 h3 h4 h5 h6"),v("figure","",[a,"figcaption"].join(" ")),v("time","datetime",i),v("dialog","open",a),v("command","type label icon disabled checked radiogroup command"),v("output","for form name",i),v("progress","value max",i),v("meter","value min max low high optimum",i),v("details","open",[a,"summary"].join(" ")),v("keygen","autofocus challenge disabled form keytype name")),"html5-strict"!==n&&(b("script","language xml:space"),b("style","xml:space"),b("object","declare classid code codebase codetype archive standby align border hspace vspace"),b("embed","align name hspace vspace"),b("param","valuetype type"),b("a","charset name rev shape coords"),b("br","clear"),b("applet","codebase archive code object alt name width height align hspace vspace"),b("img","name longdesc align border hspace vspace"),b("iframe","longdesc frameborder marginwidth marginheight scrolling align"),b("font basefont","size color face"),b("input","usemap align"),b("select"),b("textarea"),b("h1 h2 h3 h4 h5 h6 div p legend caption","align"),b("ul","type compact"),b("li","type"),b("ol dl menu dir","compact"),b("pre","width xml:space"),b("hr","align noshade size width"),b("isindex","prompt"),b("table","summary width frame rules cellspacing cellpadding align bgcolor"),b("col","width align char charoff valign"),b("colgroup","width align char charoff valign"),b("thead","align char charoff valign"),b("tr","align char charoff valign bgcolor"),b("th","axis align char charoff valign nowrap bgcolor width height"),b("form","accept"),b("td","abbr axis scope align char charoff valign nowrap bgcolor width height"),b("tfoot","align char charoff valign"),b("tbody","align char charoff valign"),b("area","nohref"),b("body","background bgcolor text link vlink alink")),"html4"!==n&&(b("input button select textarea","autofocus"),b("input textarea","placeholder"),b("a","download"),b("link script img","crossorigin"),b("img","loading"),b("iframe","sandbox seamless allowfullscreen loading")),Zo(Jr("a form meter progress dfn"),(function(e){s[e]&&delete s[e].children[e]})),delete s.caption.children.table,delete s.script,Xo[n]=s));function v(e,t,n){function o(e,t){for(var n={},r=0,o=e.length;r<o;r++)n[e[r]]=t||{};return n}var i,a;t=t||"","string"==typeof(n=n||[])&&(n=Jr(n));for(var u=Jr(e),c=u.length;c--;)a={attributes:o(i=Jr([r,t].join(" "))),attributesOrder:i,children:o(n,Yo)},s[u[c]]=a}function b(e,t){for(var n,r,o,i=Jr(e),a=i.length,u=Jr(t);a--;)for(n=s[i[a]],r=0,o=u.length;r<o;r++)n.attributes[u[r]]={},n.attributesOrder.push(u[r])}!1===e.verify_html&&(e.valid_elements="*[*]");var y=Zr(e.valid_styles),w=Zr(e.invalid_styles,"map"),x=Zr(e.valid_classes,"map"),C=t("whitespace_elements","pre script noscript style textarea video audio iframe object code"),S=t("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),k=t("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),T=t("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls"),O="td th iframe video audio object script code",_=t("non_empty_elements",O+" pre",k),E=t("move_caret_before_on_enter_elements",O+" table",k),A=t("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=t("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",A),M=t("text_inline_elements","span strong b em i font strike u var cite dfn code mark q sup sub samp");function N(e){return new RegExp("^"+e.replace(/([?+*])/g,".$1")+"$")}function R(e){var t,n,r,o,i,a,u,c,s,f,d,g,p,h,v,b,y,w,x=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)])?$/,C=/^([!\-])?(\w+[\\:]:\w+|[^=:<]+)?(?:([=:<])(.*))?$/,S=/[*?+]/;if(e){var k=Jr(e,",");for(l["@"]&&(b=l["@"].attributes,y=l["@"].attributesOrder),t=0,n=k.length;t<n;t++)if(i=x.exec(k[t])){if(h=i[1],s=i[2],v=i[3],c=i[5],a={attributes:g={},attributesOrder:p=[]},"#"===h&&(a.paddEmpty=!0),"-"===h&&(a.removeEmpty=!0),"!"===i[4]&&(a.removeEmptyAttrs=!0),b&&(ne(b,(function(e,t){g[t]=e})),p.push.apply(p,y)),c)for(r=0,o=(c=Jr(c,"|")).length;r<o;r++)(i=C.exec(c[r]))&&(u={},d=i[1],f=i[2].replace(/[\\:]:/g,":"),h=i[3],w=i[4],"!"===d&&(a.attributesRequired=a.attributesRequired||[],a.attributesRequired.push(f),u.required=!0),"-"!==d?(h&&("="===h&&(a.attributesDefault=a.attributesDefault||[],a.attributesDefault.push({name:f,value:w}),u.defaultValue=w),":"===h&&(a.attributesForced=a.attributesForced||[],a.attributesForced.push({name:f,value:w}),u.forcedValue=w),"<"===h&&(u.validValues=Jo(w,"?"))),S.test(f)?(a.attributePatterns=a.attributePatterns||[],u.pattern=N(f),a.attributePatterns.push(u)):(g[f]||p.push(f),g[f]=u)):(delete g[f],p.splice(ti(p,f),1)));b||"@"!==s||(b=g,y=p),v&&(a.outputName=s,l[v]=a),S.test(s)?(a.pattern=N(s),m.push(a)):l[s]=a}}}function z(e){l={},m=[],R(e),Zo(h,(function(e,t){d[t]=e.children}))}function B(e){var t=/^(~)?(.+)$/;e&&(Xo.text_block_elements=Xo.block_elements=null,Zo(Jr(e,","),(function(e){var n,r=t.exec(e),o="~"===r[1],i=o?"span":"div",a=r[2];d[a]=d[i],g[a]=i,o||(D[a.toUpperCase()]={},D[a]={}),l[a]||(n=l[i],delete(n=Qo({},n)).removeEmptyAttrs,delete n.removeEmpty,l[a]=n),Zo(d,(function(e,t){e[i]&&(d[t]=e=Qo({},d[t]),e[a]=e[i])}))})))}function P(t){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]+)\[([^\]]+)]$/;Xo[e.schema]=null,t&&Zo(Jr(t,","),(function(e){var t,r,o=n.exec(e);o&&(r=o[1],t=r?d[o[2]]:d[o[2]]={"#comment":{}},t=d[o[2]],Zo(Jr(o[3],"|"),(function(e){"-"===r?delete t[e]:t[e]={}})))}))}function I(e){var t,n=l[e];if(n)return n;for(t=m.length;t--;)if((n=m[t]).pattern.test(e))return n}Zo((e.special||"script noscript iframe noframes noembed title style textarea xmp").split(" "),(function(e){p[e]=new RegExp("</"+e+"[^>]*>","gi")})),e.valid_elements?z(e.valid_elements):(Zo(h,(function(e,t){l[t]={attributes:e.attributes,attributesOrder:e.attributesOrder},d[t]=e.children})),"html5"!==e.schema&&Zo(Jr("strong/b em/i"),(function(e){var t=Jr(e,"/");l[t[1]].outputName=t[0]})),Zo(Jr("ol ul sub sup blockquote span font a table tbody strong em b i"),(function(e){l[e]&&(l[e].removeEmpty=!0)})),Zo(Jr("p h1 h2 h3 h4 h5 h6 th td pre div address caption li"),(function(e){l[e].paddEmpty=!0})),Zo(Jr("span"),(function(e){l[e].removeEmptyAttrs=!0}))),B(e.custom_elements),P(e.valid_children),R(e.extended_valid_elements),P("+ol[ul|ol],+ul[ul|ol]"),Zo({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(e,t){l[t]&&(l[t].parentsRequired=Jr(e))})),e.invalid_elements&&Zo(ei(e.invalid_elements),(function(e){l[e]&&delete l[e]})),I("span")||R("span[!data-mce-type|*]");var F=f(y),L=f(w),H=f(x),V=f(T),j=f(D),U=f(A),W=f(M),$=f(k),q=f(S),G=f(_),K=f(E),X=f(C),Y=f(p),J=f(g);return{children:d,elements:l,getValidStyles:F,getValidClasses:H,getBlockElements:j,getInvalidStyles:L,getShortEndedElements:$,getTextBlockElements:U,getTextInlineElements:W,getBoolAttrs:V,getElementRule:I,getSelfClosingElements:q,getNonEmptyElements:G,getMoveCaretBeforeOnEnterElements:K,getWhiteSpaceElements:X,getSpecialElements:Y,isValidChild:function(e,t){var n=d[e.toLowerCase()];return!(!n||!n[t.toLowerCase()])},isValid:function(e,t){var n,r,o=I(e);if(o){if(!t)return!0;if(o.attributes[t])return!0;if(n=o.attributePatterns)for(r=n.length;r--;)if(n[r].pattern.test(e))return!0}return!1},getCustomElements:J,addValidElements:R,setValidElements:z,addCustomElements:B,addValidChildren:P}}function eo(e,t,n,r){function o(e){return 1<(e=parseInt(e,10).toString(16)).length?e:"0"+e}return"#"+o(t)+o(n)+o(r)}function to(e,t){var n,r,o=this,i=/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,u=/\s*([^:]+):\s*([^;]+);?/g,c=/\s+$/,s={},l=ho;e=e||{},t&&(n=t.getValidStyles(),r=t.getInvalidStyles());for(var f=("\\\" \\' \\; \\: ; : "+l).split(" "),d=0;d<f.length;d++)s[f[d]]=l+d,s[l+d]=f[d];return{toHex:function(e){return e.replace(i,eo)},parse:function(t){function n(e,t,n){var r=k[e+"-top"+t];if(r){var o=k[e+"-right"+t];if(o){var i=k[e+"-bottom"+t];if(i){var a=k[e+"-left"+t];if(a){var u=[r,o,i,a];for(d=u.length-1;d--&&u[d]===u[d+1];);-1<d&&n||(k[e+t]=-1===d?u[0]:u.join(" "),delete k[e+"-top"+t],delete k[e+"-right"+t],delete k[e+"-bottom"+t],delete k[e+"-left"+t])}}}}}function r(e){var t,n=k[e];if(n){for(t=(n=n.split(" ")).length;t--;)if(n[t]!==n[0])return;return k[e]=n[0],1}}function f(e){return w=!0,s[e]}function m(e,t){return w&&(e=e.replace(/\uFEFF[0-9]/g,(function(e){return s[e]}))),t?e:e.replace(/\\([\'\";:])/g,"$1")}function g(e){return String.fromCharCode(parseInt(e.slice(1),16))}function p(e){return e.replace(/\\[0-9a-f]+/gi,g)}function h(t,n,r,o,i,a){if(i=i||a)return"'"+(i=m(i)).replace(/\'/g,"\\'")+"'";if(n=m(n||r||o),!e.allow_script_urls){var u=n.replace(/[\s\r\n]+/g,"");if(/(java|vb)script:/i.test(u))return"";if(!e.allow_svg_data_urls&&/^data:image\/svg/i.test(u))return""}return"url('"+(n=T?T.call(O,n,"style"):n).replace(/\'/g,"\\'")+"')"}var v,b,y,w,x,C,S,k={},T=e.url_converter,O=e.url_converter_scope||o;if(t){for(t=(t=t.replace(/[\u0000-\u001F]/g,"")).replace(/\\[\"\';:\uFEFF]/g,f).replace(/\"[^\"]+\"|\'[^\']+\'/g,(function(e){return e.replace(/[;:]/g,f)}));v=u.exec(t);)u.lastIndex=v.index+v[0].length,b=v[1].replace(c,"").toLowerCase(),y=v[2].replace(c,""),b&&y&&(b=p(b),y=p(y),-1===b.indexOf(l)&&-1===b.indexOf('"')&&(e.allow_script_urls||"behavior"!==b&&!/expression\s*\(|\/\*|\*\//.test(y))&&("font-weight"===b&&"700"===y?y="bold":"color"!==b&&"background-color"!==b||(y=y.toLowerCase()),y=(y=y.replace(i,eo)).replace(a,h),k[b]=w?m(y,!0):y));n("border","",!0),n("border","-width"),n("border","-color"),n("border","-style"),n("padding",""),n("margin",""),C="border-style",S="border-color",r(x="border-width")&&r(C)&&r(S)&&(k.border=k[x]+" "+k[C]+" "+k[S],delete k[x],delete k[C],delete k[S]),"medium none"===k.border&&delete k.border,"none"===k["border-image"]&&delete k["border-image"]}return k},serialize:function(e,t){function o(t){var r,o=n[t];if(o)for(var a=0,u=o.length;a<u;a++)t=o[a],(r=e[t])&&(i+=(0<i.length?" ":"")+t+": "+r+";")}var i="";return t&&n?(o("*"),o(t)):ne(e,(function(e,n){var o;!e||r&&((o=r["*"])&&o[n]||(o=r[t])&&o[n])||(i+=(0<i.length?" ":"")+n+": "+e+";")})),i}}}function no(e){return e instanceof Event||S(e.initEvent)}function ro(e,t,n,r){var o,i,c=function(e){var t,n=null!=r?r:{};for(t in e)Te(ni,t)||(n[t]=e[t]);return u(n.composedPath)&&(n.composedPath=function(){return e.composedPath()}),n}(t);return c.type=e,a(c.target)&&(c.target=null!==(o=c.srcElement)&&void 0!==o?o:n),(a((i=t).preventDefault)||no(i))&&(c.preventDefault=function(){c.defaultPrevented=!0,c.isDefaultPrevented=M,S(t.preventDefault)?t.preventDefault():no(t)&&(t.returnValue=!1)},c.stopPropagation=function(){c.cancelBubble=!0,c.isPropagationStopped=M,S(t.stopPropagation)?t.stopPropagation():no(t)&&(t.cancelBubble=!0)},c.stopImmediatePropagation=function(){c.isImmediatePropagationStopped=M,c.stopPropagation()},c.isDefaultPrevented!==M&&c.isDefaultPrevented!==D&&(c.isDefaultPrevented=!0===c.defaultPrevented?M:D,c.isPropagationStopped=!0===c.cancelBubble?M:D,c.isImmediatePropagationStopped=D)),c}function oo(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r||!1):e.attachEvent&&e.attachEvent("on"+t,n)}function io(e,t,n,r){e.removeEventListener?e.removeEventListener(t,n,r||!1):e.detachEvent&&e.detachEvent("on"+t,n)}function ao(e,t){var n,r,o,i,a=ro(e.type,e,document,t);return u(i=e)&&ri.test(i.type)&&C(e.pageX)&&!C(e.clientX)&&(r=(n=a.target.ownerDocument||document).documentElement,o=n.body,a.pageX=e.clientX+(r&&r.scrollLeft||o&&o.scrollLeft||0)-(r&&r.clientLeft||o&&o.clientLeft||0),a.pageY=e.clientY+(r&&r.scrollTop||o&&o.scrollTop||0)-(r&&r.clientTop||o&&o.clientTop||0)),C(a.metaKey)&&(a.metaKey=!1),a}var uo=Ar(["h1","h2","h3","h4","h5","h6"]),co=Ar(["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"]),so=Ar(["h1","h2","h3","h4","h5","h6","p","div","address","pre","form","blockquote","center","dir","fieldset","header","footer","article","section","hgroup","aside","nav","figure"]),lo=Ar(["ul","ol","dl"]),fo=Ar(["li","dd","dt"]),mo=Ar(["thead","tbody","tfoot"]),go=Ar(["td","th"]),po=Ar(["pre","script","textarea","style"]),ho="\ufeff",vo=" ",bo=ho,yo=function(e){return e===ho},wo=function(e){return e.replace(/\uFEFF/g,"")},xo=Ln,Co=Vn,So=function(e){return Co(e)&&e.data[0]===bo},ko=function(e){return Co(e)&&e.data[e.data.length-1]===bo},To=Gn,Oo=Kn,_o=$n,Eo=Vn,Ao=on(["script","style","textarea"]),Do=on(["img","input","textarea","hr","iframe","video","audio","object","embed"]),Mo=on(["table"]),No=zr,Ro=function(e){return!1===(Ln(t=e)&&"true"===t.getAttribute("unselectable"))&&Oo(e);var t},zo=/^[ \t\r\n]*$/,Bo=un("data-mce-bookmark"),Po=un("data-mce-bogus"),Io=function(e){return Ln(e)&&"all"===e.getAttribute("data-mce-bogus")},Fo=function(e,t,n){var r=n||t;if(Ln(t)&&qr(t))return t;for(var o,i,a,u,c,s,l,f,d,m,g,p=t.childNodes,h=p.length-1;0<=h;h--)Fo(e,p[h],r);return!Ln(t)||1===(o=t.childNodes).length&&qr(o[0])&&t.parentNode.insertBefore(o[0],t),Wn(a=t)||Un(a)||Ur(t,r)||Ln(i=t)&&0<i.childNodes.length||(c=r,Vn(u=t)&&0<u.data.length&&(f=new _r(s=u,l=c).prev(!1),d=new _r(s,l).next(!1),m=C(f)||$r(f,l),g=C(d)||$r(d,l),m&&g))||e.remove(t),t},Lo=kt.makeMap,Ho=/[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Vo=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,jo=/[<>&\"\']/g,Uo=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,Wo={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:"Ÿ"},$o={'"':"&quot;","'":"&#39;","<":"&lt;",">":"&gt;","&":"&amp;","`":"&#96;"},qo={"&lt;":"<","&gt;":">","&amp;":"&","&quot;":'"',"&apos;":"'"},Go=Gr("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),Ko={encodeRaw:Kr,encodeAllRaw:function(e){return(""+e).replace(jo,(function(e){return $o[e]||e}))},encodeNumeric:Xr,encodeNamed:Yr,getEncodeFunc:function(e,t){var n=Gr(t)||Go,r=Lo(e.replace(/\+/g,","));return r.named&&r.numeric?function(e,t){return e.replace(t?Ho:Vo,(function(e){return void 0!==$o[e]?$o[e]:void 0!==n[e]?n[e]:1<e.length?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":"&#"+e.charCodeAt(0)+";"}))}:r.named?t?function(e,t){return Yr(e,t,n)}:Yr:r.numeric?Xr:Kr},decode:function(e){return e.replace(Uo,(function(e,t){return t?65535<(t="x"===t.charAt(0).toLowerCase()?parseInt(t.substr(1),16):parseInt(t,10))?(t-=65536,String.fromCharCode(55296+(t>>10),56320+(1023&t))):Wo[t]||String.fromCharCode(t):qo[e]||Go[e]||(n=e,(r=Tt.fromTag("div").dom).innerHTML=n,r.textContent||r.innerText||n);var n,r}))}},Xo={},Yo={},Jo=kt.makeMap,Zo=kt.each,Qo=kt.extend,ei=kt.explode,ti=kt.inArray,ni={keyLocation:!0,layerX:!0,layerY:!0,returnValue:!0,webkitMovementX:!0,webkitMovementY:!0,keyIdentifier:!0,mozPressure:!0},ri=/^(?:mouse|contextmenu)|click/,oi=(ii.prototype.bind=function(e,t,n,r){function o(e){f.executeHandlers(ao(e||d.event),i)}var i,a,u,c,s,l,f=this,d=window;if(e&&3!==e.nodeType&&8!==e.nodeType){e[f.expando]?i=e[f.expando]:(i=f.count++,e[f.expando]=i,f.events[i]={}),r=r||e;for(var m=t.split(" "),g=m.length;g--;)s=o,c=l=!1,"DOMContentLoaded"===(u=m[g])&&(u="ready"),f.domLoaded&&"ready"===u&&"complete"===e.readyState?n.call(r,ao({type:u})):(f.hasMouseEnterLeave||(c=f.mouseEnterLeave[u])&&(s=function(e){var t=e.currentTarget,n=e.relatedTarget;if(n&&t.contains)n=t.contains(n);else for(;n&&n!==t;)n=n.parentNode;n||((e=ao(e||d.event)).type="mouseout"===e.type?"mouseleave":"mouseenter",e.target=t,f.executeHandlers(e,i))}),f.hasFocusIn||"focusin"!==u&&"focusout"!==u||(l=!0,c="focusin"===u?"focus":"blur",s=function(e){(e=ao(e||d.event)).type="focus"===e.type?"focusin":"focusout",f.executeHandlers(e,i)}),(a=f.events[i][u])?"ready"===u&&f.domLoaded?n(ao({type:u})):a.push({func:n,scope:r}):(f.events[i][u]=a=[{func:n,scope:r}],a.fakeName=c,a.capture=l,a.nativeHandler=s,"ready"===u?function(e,t,n){var r,o=e.document,i={type:"ready"};n.domLoaded?t(i):(r=function(){io(e,"DOMContentLoaded",r),io(e,"load",r),n.domLoaded||(n.domLoaded=!0,t(i)),e=null},"complete"===o.readyState||"interactive"===o.readyState&&o.body?r():oo(e,"DOMContentLoaded",r),n.domLoaded||oo(e,"load",r))}(e,s,f):oo(e,c||u,s,l)));return e=a=null,n}},ii.prototype.unbind=function(e,t,n){var r,o,i;if(!e||3===e.nodeType||8===e.nodeType)return this;var a=e[this.expando];if(a){if(i=this.events[a],t){for(var u,c,s,l,f=t.split(" "),d=f.length;d--;)if(l=i[o=f[d]]){if(n)for(r=l.length;r--;)l[r].func===n&&(u=l.nativeHandler,c=l.fakeName,s=l.capture,(l=l.slice(0,r).concat(l.slice(r+1))).nativeHandler=u,l.fakeName=c,l.capture=s,i[o]=l);n&&0!==l.length||(delete i[o],io(e,l.fakeName||o,l.nativeHandler,l.capture))}}else ne(i,(function(t,n){io(e,t.fakeName||n,t.nativeHandler,t.capture)})),i={};for(o in i)if(Te(i,o))return this;delete this.events[a];try{delete e[this.expando]}catch(t){e[this.expando]=null}}return this},ii.prototype.fire=function(e,t,n){var r;if(!e||3===e.nodeType||8===e.nodeType)return this;for(var o=ao({type:t,target:e},n);(r=e[this.expando])&&this.executeHandlers(o,r),(e=e.parentNode||e.ownerDocument||e.defaultView||e.parentWindow)&&!o.isPropagationStopped(););return this},ii.prototype.clean=function(e){var t,n;if(!e||3===e.nodeType||8===e.nodeType)return this;if(e[this.expando]&&this.unbind(e),(e=e.getElementsByTagName?e:e.document)&&e.getElementsByTagName)for(this.unbind(e),t=(n=e.getElementsByTagName("*")).length;t--;)(e=n[t])[this.expando]&&this.unbind(e);return this},ii.prototype.destroy=function(){this.events={}},ii.prototype.cancel=function(e){return e&&(e.preventDefault(),e.stopImmediatePropagation()),!1},ii.prototype.executeHandlers=function(e,t){var n=this.events[t],r=n&&n[e.type];if(r)for(var o=0,i=r.length;o<i;o++){var a=r[o];if(a&&!1===a.func.call(a.scope,e)&&e.preventDefault(),e.isImmediatePropagationStopped())return}},ii.Event=new ii,ii);function ii(){this.domLoaded=!1,this.events={},this.count=1,this.expando="mce-data-"+(+new Date).toString(32),this.hasMouseEnterLeave="onmouseenter"in document.documentElement,this.hasFocusIn="onfocusin"in document.documentElement,this.count=1}function ai(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(65536+r):String.fromCharCode(r>>10|55296,1023&r|56320)}var ui,ci,si,li,fi,di,mi,gi,pi,hi,vi,bi,yi,wi,xi,Ci,Si,ki="sizzle"+-new Date,Ti=window.document,Oi=0,_i=0,Ei=ia(),Ai=ia(),Di=ia(),Mi=function(e,t){return e===t&&(hi=!0),0},Ni="undefined",Ri={}.hasOwnProperty,zi=[],Bi=zi.pop,Pi=zi.push,Ii=zi.push,Fi=zi.slice,Li=zi.indexOf||function(e){for(var t=0,n=this.length;t<n;t++)if(this[t]===e)return t;return-1},Hi="[\\x20\\t\\r\\n\\f]",Vi="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",ji="\\["+Hi+"*("+Vi+")(?:"+Hi+"*([*^$|!~]?=)"+Hi+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+Vi+"))|)"+Hi+"*\\]",Ui=":("+Vi+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+ji+")*)|.*)\\)|)",Wi=new RegExp("^"+Hi+"+|((?:^|[^\\\\])(?:\\\\.)*)"+Hi+"+$","g"),$i=new RegExp("^"+Hi+"*,"+Hi+"*"),qi=new RegExp("^"+Hi+"*([>+~]|"+Hi+")"+Hi+"*"),Gi=new RegExp("="+Hi+"*([^\\]'\"]*?)"+Hi+"*\\]","g"),Ki=new RegExp(Ui),Xi=new RegExp("^"+Vi+"$"),Yi={ID:new RegExp("^#("+Vi+")"),CLASS:new RegExp("^\\.("+Vi+")"),TAG:new RegExp("^("+Vi+"|[*])"),ATTR:new RegExp("^"+ji),PSEUDO:new RegExp("^"+Ui),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+Hi+"*(even|odd|(([+-]|)(\\d*)n|)"+Hi+"*(?:([+-]|)"+Hi+"*(\\d+)|))"+Hi+"*\\)|)","i"),bool:new RegExp("^(?:checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)$","i"),needsContext:new RegExp("^"+Hi+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+Hi+"*((?:-\\d)?\\d*)"+Hi+"*\\)|)(?=[^-]|$)","i")},Ji=/^(?:input|select|textarea|button)$/i,Zi=/^h\d$/i,Qi=/^[^{]+\{\s*\[native \w/,ea=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ta=/[+~]/,na=/'|\\/g,ra=new RegExp("\\\\([\\da-f]{1,6}"+Hi+"?|("+Hi+")|.)","ig");try{Ii.apply(zi=Fi.call(Ti.childNodes),Ti.childNodes),zi[Ti.childNodes.length].nodeType}catch(r){Ii={apply:zi.length?function(e,t){Pi.apply(e,Fi.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}var oa=function(e,t,n,r){var o,i,a,u,c,s,l,f,d,m;if((t?t.ownerDocument||t:Ti)!==bi&&vi(t),n=n||[],!e||"string"!=typeof e)return n;if(1!==(u=(t=t||bi).nodeType)&&9!==u)return[];if(wi&&!r){if(o=ea.exec(e))if(a=o[1]){if(9===u){if(!(i=t.getElementById(a))||!i.parentNode)return n;if(i.id===a)return n.push(i),n}else if(t.ownerDocument&&(i=t.ownerDocument.getElementById(a))&&Si(t,i)&&i.id===a)return n.push(i),n}else{if(o[2])return Ii.apply(n,t.getElementsByTagName(e)),n;if((a=o[3])&&ui.getElementsByClassName)return Ii.apply(n,t.getElementsByClassName(a)),n}if(ui.qsa&&(!xi||!xi.test(e))){if(f=l=ki,d=t,m=9===u&&e,1===u&&"object"!==t.nodeName.toLowerCase()){for(s=fi(e),(l=t.getAttribute("id"))?f=l.replace(na,"\\$&"):t.setAttribute("id",f),f="[id='"+f+"'] ",c=s.length;c--;)s[c]=f+fa(s[c]);d=ta.test(e)&&sa(t.parentNode)||t,m=s.join(",")}if(m)try{return Ii.apply(n,d.querySelectorAll(m)),n}catch(e){}finally{l||t.removeAttribute("id")}}}return mi(e.replace(Wi,"$1"),t,n,r)};function ia(){var e=[];return function t(n,r){return e.push(n+" ")>ci.cacheLength&&delete t[e.shift()],t[n+" "]=r}}function aa(e){return e[ki]=!0,e}function ua(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||1<<31)-(~e.sourceIndex||1<<31);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function ca(e){return aa((function(t){return t=+t,aa((function(n,r){for(var o,i=e([],n.length,t),a=i.length;a--;)n[o=i[a]]&&(n[o]=!(r[o]=n[o]))}))}))}function sa(e){return e&&typeof e.getElementsByTagName!=Ni&&e}function la(){}function fa(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function da(e,t,n){var r=t.dir,o=n&&"parentNode"===r,i=_i++;return t.first?function(t,n,i){for(;t=t[r];)if(1===t.nodeType||o)return e(t,n,i)}:function(t,n,a){var u,c,s=[Oi,i];if(a){for(;t=t[r];)if((1===t.nodeType||o)&&e(t,n,a))return!0}else for(;t=t[r];)if(1===t.nodeType||o){if((u=(c=t[ki]||(t[ki]={}))[r])&&u[0]===Oi&&u[1]===i)return s[2]=u[2];if((c[r]=s)[2]=e(t,n,a))return!0}}}function ma(e){return 1<e.length?function(t,n,r){for(var o=e.length;o--;)if(!e[o](t,n,r))return!1;return!0}:e[0]}function ga(e,t,n,r,o){for(var i,a=[],u=0,c=e.length,s=null!=t;u<c;u++)(i=e[u])&&(n&&!n(i,r,o)||(a.push(i),s&&t.push(u)));return a}function pa(e){return void 0!==e}function ha(e){return"string"==typeof e}function va(e,t){var n,r=(t=t||ka).createElement("div"),o=t.createDocumentFragment();for(r.innerHTML=e;n=r.firstChild;)o.appendChild(n);return o}function ba(e,t){return e&&t&&-1!==(" "+e.className+" ").indexOf(" "+t+" ")}function ya(e,t,n){var r,o;return t=Wa(t)[0],e.each((function(){n&&r===this.parentNode||(r=this.parentNode,o=t.cloneNode(!1),this.parentNode.insertBefore(o,this)),o.appendChild(this)})),e}function wa(e,t){return new Wa.fn.init(e,t)}function xa(e){return null==e?"":(""+e).replace(Ia,"")}function Ca(e,t){var n,r,o,i;if(e)if(void 0===(n=e.length)){for(r in e)if(e.hasOwnProperty(r)&&(i=e[r],!1===t.call(i,r,i)))break}else for(o=0;o<n&&(i=e[o],!1!==t.call(i,o,i));o++);return e}function Sa(e,t){var n=[];return Ca(e,(function(e,r){t(r,e)&&n.push(r)})),n}ui=oa.support={},li=oa.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},vi=oa.setDocument=function(e){var t,n=e?e.ownerDocument||e:Ti,r=n.defaultView;return n!==bi&&9===n.nodeType&&n.documentElement?(yi=(bi=n).documentElement,wi=!li(n),r&&r!==function(e){try{return e.top}catch(e){}return null}(r)&&(r.addEventListener?r.addEventListener("unload",(function(){vi()}),!1):r.attachEvent&&r.attachEvent("onunload",(function(){vi()}))),ui.attributes=!0,ui.getElementsByTagName=!0,ui.getElementsByClassName=Qi.test(n.getElementsByClassName),ui.getById=!0,ci.find.ID=function(e,t){if(typeof t.getElementById!=Ni&&wi){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},ci.filter.ID=function(e){var t=e.replace(ra,ai);return function(e){return e.getAttribute("id")===t}},ci.find.TAG=ui.getElementsByTagName?function(e,t){if(typeof t.getElementsByTagName!=Ni)return t.getElementsByTagName(e)}:function(e,t){var n,r=[],o=0,i=t.getElementsByTagName(e);if("*"!==e)return i;for(;n=i[o++];)1===n.nodeType&&r.push(n);return r},ci.find.CLASS=ui.getElementsByClassName&&function(e,t){if(wi)return t.getElementsByClassName(e)},Ci=[],xi=[],ui.disconnectedMatch=!0,xi=xi.length&&new RegExp(xi.join("|")),Ci=Ci.length&&new RegExp(Ci.join("|")),t=Qi.test(yi.compareDocumentPosition),Si=t||Qi.test(yi.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},Mi=t?function(e,t){return e===t?(hi=!0,0):(r=!e.compareDocumentPosition-!t.compareDocumentPosition)||(1&(r=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!ui.sortDetached&&t.compareDocumentPosition(e)===r?e===n||e.ownerDocument===Ti&&Si(Ti,e)?-1:t===n||t.ownerDocument===Ti&&Si(Ti,t)?1:pi?Li.call(pi,e)-Li.call(pi,t):0:4&r?-1:1);var r}:function(e,t){if(e===t)return hi=!0,0;var r,o=0,i=e.parentNode,a=t.parentNode,u=[e],c=[t];if(!i||!a)return e===n?-1:t===n?1:i?-1:a?1:pi?Li.call(pi,e)-Li.call(pi,t):0;if(i===a)return ua(e,t);for(r=e;r=r.parentNode;)u.unshift(r);for(r=t;r=r.parentNode;)c.unshift(r);for(;u[o]===c[o];)o++;return o?ua(u[o],c[o]):u[o]===Ti?-1:c[o]===Ti?1:0},n):bi},oa.matches=function(e,t){return oa(e,null,null,t)},oa.matchesSelector=function(e,t){if((e.ownerDocument||e)!==bi&&vi(e),t=t.replace(Gi,"='$1']"),ui.matchesSelector&&wi&&(!Ci||!Ci.test(t))&&(!xi||!xi.test(t)))try{var n=(void 0).call(e,t);if(n||ui.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){}return 0<oa(t,bi,null,[e]).length},oa.contains=function(e,t){return(e.ownerDocument||e)!==bi&&vi(e),Si(e,t)},oa.attr=function(e,t){(e.ownerDocument||e)!==bi&&vi(e);var n=ci.attrHandle[t.toLowerCase()],r=n&&Ri.call(ci.attrHandle,t.toLowerCase())?n(e,t,!wi):void 0;return void 0!==r?r:ui.attributes||!wi?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},oa.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},oa.uniqueSort=function(e){var t,n=[],r=0,o=0;if(hi=!ui.detectDuplicates,pi=!ui.sortStable&&e.slice(0),e.sort(Mi),hi){for(;t=e[o++];)t===e[o]&&(r=n.push(o));for(;r--;)e.splice(n[r],1)}return pi=null,e},si=oa.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=si(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[r++];)n+=si(t);return n},(ci=oa.selectors={cacheLength:50,createPseudo:aa,match:Yi,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(ra,ai),e[3]=(e[3]||e[4]||e[5]||"").replace(ra,ai),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||oa.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&oa.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return Yi.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&Ki.test(n)&&(t=fi(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(ra,ai).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=Ei[e+" "];return t||(t=new RegExp("(^|"+Hi+")"+e+"("+Hi+"|$)"))&&Ei(e,(function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!=Ni&&e.getAttribute("class")||"")}))},ATTR:function(e,t,n){return function(r){var o=oa.attr(r,e);return null==o?"!="===t:!t||(o+="","="===t?o===n:"!="===t?o!==n:"^="===t?n&&0===o.indexOf(n):"*="===t?n&&-1<o.indexOf(n):"$="===t?n&&o.slice(-n.length)===n:"~="===t?-1<(" "+o+" ").indexOf(n):"|="===t&&(o===n||o.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,o){var i="nth"!==e.slice(0,3),a="last"!==e.slice(-4),u="of-type"===t;return 1===r&&0===o?function(e){return!!e.parentNode}:function(t,n,c){var s,l,f,d,m,g,p=i!=a?"nextSibling":"previousSibling",h=t.parentNode,v=u&&t.nodeName.toLowerCase(),b=!c&&!u;if(h){if(i){for(;p;){for(f=t;f=f[p];)if(u?f.nodeName.toLowerCase()===v:1===f.nodeType)return!1;g=p="only"===e&&!g&&"nextSibling"}return!0}if(g=[a?h.firstChild:h.lastChild],a&&b){for(m=(s=(l=h[ki]||(h[ki]={}))[e]||[])[0]===Oi&&s[1],d=s[0]===Oi&&s[2],f=m&&h.childNodes[m];f=++m&&f&&f[p]||(d=m=0)||g.pop();)if(1===f.nodeType&&++d&&f===t){l[e]=[Oi,m,d];break}}else if(b&&(s=(t[ki]||(t[ki]={}))[e])&&s[0]===Oi)d=s[1];else for(;(f=++m&&f&&f[p]||(d=m=0)||g.pop())&&((u?f.nodeName.toLowerCase()!==v:1!==f.nodeType)||!++d||(b&&((f[ki]||(f[ki]={}))[e]=[Oi,d]),f!==t)););return(d-=o)===r||d%r==0&&0<=d/r}}},PSEUDO:function(e,t){var n,r=ci.pseudos[e]||ci.setFilters[e.toLowerCase()]||oa.error("unsupported pseudo: "+e);return r[ki]?r(t):1<r.length?(n=[e,e,"",t],ci.setFilters.hasOwnProperty(e.toLowerCase())?aa((function(e,n){for(var o,i=r(e,t),a=i.length;a--;)e[o=Li.call(e,i[a])]=!(n[o]=i[a])})):function(e){return r(e,0,n)}):r}},pseudos:{not:aa((function(e){var t=[],n=[],r=di(e.replace(Wi,"$1"));return r[ki]?aa((function(e,t,n,o){for(var i,a=r(e,null,o,[]),u=e.length;u--;)(i=a[u])&&(e[u]=!(t[u]=i))})):function(e,o,i){return t[0]=e,r(t,null,i,n),t[0]=null,!n.pop()}})),has:aa((function(e){return function(t){return 0<oa(e,t).length}})),contains:aa((function(e){return e=e.replace(ra,ai),function(t){return-1<(t.textContent||t.innerText||si(t)).indexOf(e)}})),lang:aa((function(e){return Xi.test(e||"")||oa.error("unsupported lang: "+e),e=e.replace(ra,ai).toLowerCase(),function(t){var n;do{if(n=wi?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}})),target:function(e){var t=window.location&&window.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===yi},focus:function(e){return e===bi.activeElement&&(!bi.hasFocus||bi.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return!1===e.disabled},disabled:function(e){return!0===e.disabled},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!ci.pseudos.empty(e)},header:function(e){return Zi.test(e.nodeName)},input:function(e){return Ji.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:ca((function(){return[0]})),last:ca((function(e,t){return[t-1]})),eq:ca((function(e,t,n){return[n<0?n+t:n]})),even:ca((function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e})),odd:ca((function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e})),lt:ca((function(e,t,n){for(var r=n<0?n+t:n;0<=--r;)e.push(r);return e})),gt:ca((function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e}))}}).pseudos.nth=ci.pseudos.eq,F(["radio","checkbox","file","password","image"],(function(e){var t;ci.pseudos[e]=(t=e,function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t})})),F(["submit","reset"],(function(e){var t;ci.pseudos[e]=(t=e,function(e){var n=e.nodeName.toLowerCase();return("input"===n||"button"===n)&&e.type===t})})),la.prototype=ci.filters=ci.pseudos,ci.setFilters=new la,fi=oa.tokenize=function(e,t){var n,r,o,i,a,u,c,s=Ai[e+" "];if(s)return t?0:s.slice(0);for(a=e,u=[],c=ci.preFilter;a;){for(i in n&&!(r=$i.exec(a))||(r&&(a=a.slice(r[0].length)||a),u.push(o=[])),n=!1,(r=qi.exec(a))&&(n=r.shift(),o.push({value:n,type:r[0].replace(Wi," ")}),a=a.slice(n.length)),ci.filter)ci.filter.hasOwnProperty(i)&&(!(r=Yi[i].exec(a))||c[i]&&!(r=c[i](r))||(n=r.shift(),o.push({value:n,type:i,matches:r}),a=a.slice(n.length)));if(!n)break}return t?a.length:a?oa.error(e):Ai(e,u).slice(0)},di=oa.compile=function(e,t){var n,r,o,i,a,u=[],c=[],s=Di[e+" "];if(!s){for(n=(t=t||fi(e)).length;n--;)((s=function e(t){for(var n,r,o,i=t.length,a=ci.relative[t[0].type],u=a||ci.relative[" "],c=a?1:0,s=da((function(e){return e===n}),u,!0),l=da((function(e){return-1<Li.call(n,e)}),u,!0),f=[function(e,t,r){var o=!a&&(r||t!==gi)||((n=t).nodeType?s:l)(e,t,r);return n=null,o}];c<i;c++)if(r=ci.relative[t[c].type])f=[da(ma(f),r)];else{if((r=ci.filter[t[c].type].apply(null,t[c].matches))[ki]){for(o=++c;o<i&&!ci.relative[t[o].type];o++);return function e(t,n,r,o,i,a){return o&&!o[ki]&&(o=e(o)),i&&!i[ki]&&(i=e(i,a)),aa((function(e,a,u,c){var s,l,f,d=[],m=[],g=a.length,p=e||function(e,t,n){for(var r=0,o=t.length;r<o;r++)oa(e,t[r],n);return n}(n||"*",u.nodeType?[u]:u,[]),h=!t||!e&&n?p:ga(p,d,t,u,c),v=r?i||(e?t:g||o)?[]:a:h;if(r&&r(h,v,u,c),o)for(s=ga(v,m),o(s,[],u,c),l=s.length;l--;)(f=s[l])&&(v[m[l]]=!(h[m[l]]=f));if(e){if(i||t){if(i){for(s=[],l=v.length;l--;)(f=v[l])&&s.push(h[l]=f);i(null,v=[],s,c)}for(l=v.length;l--;)(f=v[l])&&-1<(s=i?Li.call(e,f):d[l])&&(e[s]=!(a[s]=f))}}else v=ga(v===a?v.splice(g,v.length):v),i?i(null,a,v,c):Ii.apply(a,v)}))}(1<c&&ma(f),1<c&&fa(t.slice(0,c-1).concat({value:" "===t[c-2].type?"*":""})).replace(Wi,"$1"),r,c<o&&e(t.slice(c,o)),o<i&&e(t=t.slice(o)),o<i&&fa(t))}f.push(r)}return ma(f)}(t[n]))[ki]?u:c).push(s);(s=Di(e,(r=c,i=0<(o=u).length,a=0<r.length,i?aa(l):l))).selector=e}function l(e,t,n,u,c){var s,l,f,d=0,m="0",g=e&&[],p=[],h=gi,v=e||a&&ci.find.TAG("*",c),b=Oi+=null==h?1:Math.random()||.1,y=v.length;for(c&&(gi=t!==bi&&t);m!==y&&null!=(s=v[m]);m++){if(a&&s){for(l=0;f=r[l++];)if(f(s,t,n)){u.push(s);break}c&&(Oi=b)}i&&((s=!f&&s)&&d--,e&&g.push(s))}if(d+=m,i&&m!==d){for(l=0;f=o[l++];)f(g,p,t,n);if(e){if(0<d)for(;m--;)g[m]||p[m]||(p[m]=Bi.call(u));p=ga(p)}Ii.apply(u,p),c&&!e&&0<p.length&&1<d+o.length&&oa.uniqueSort(u)}return c&&(Oi=b,gi=h),g}return s},mi=oa.select=function(e,t,n,r){var o,i,a,u,c,s="function"==typeof e&&e,l=!r&&fi(e=s.selector||e);if(n=n||[],1===l.length){if(2<(i=l[0]=l[0].slice(0)).length&&"ID"===(a=i[0]).type&&ui.getById&&9===t.nodeType&&wi&&ci.relative[i[1].type]){if(!(t=(ci.find.ID(a.matches[0].replace(ra,ai),t)||[])[0]))return n;s&&(t=t.parentNode),e=e.slice(i.shift().value.length)}for(o=Yi.needsContext.test(e)?0:i.length;o--&&(a=i[o],!ci.relative[u=a.type]);)if((c=ci.find[u])&&(r=c(a.matches[0].replace(ra,ai),ta.test(i[0].type)&&sa(t.parentNode)||t))){if(i.splice(o,1),!(e=r.length&&fa(i)))return Ii.apply(n,r),n;break}}return(s||di(e,l))(r,t,!wi,n,ta.test(e)&&sa(t.parentNode)||t),n},ui.sortStable=ki.split("").sort(Mi).join("")===ki,ui.detectDuplicates=!!hi,vi(),ui.sortDetached=!0;var ka=document,Ta=Array.prototype.push,Oa=Array.prototype.slice,_a=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,Ea=oi.Event,Aa=kt.makeMap("children,contents,next,prev"),Da=function(e,t,n,r){var o;if(ha(t))t=va(t,Fa(e[0]));else if(t.length&&!t.nodeType){if(t=Wa.makeArray(t),r)for(o=t.length-1;0<=o;o--)Da(e,t[o],n,r);else for(o=0;o<t.length;o++)Da(e,t[o],n,r);return e}if(t.nodeType)for(o=e.length;o--;)n.call(e[o],t);return e},Ma=kt.makeMap("fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom"," "),Na=kt.makeMap("checked compact declare defer disabled ismap multiple nohref noshade nowrap readonly selected"," "),Ra={for:"htmlFor",class:"className",readonly:"readOnly"},za={float:"cssFloat"},Ba={},Pa={},Ia=/^\s*|\s*$/g,Fa=function(e){return e?9===e.nodeType?e:e.ownerDocument:ka};function La(e,t,n){var r=[],o=e[t];for("string"!=typeof n&&n instanceof Wa&&(n=n[0]);o&&9!==o.nodeType;){if(void 0!==n){if(o===n)break;if("string"==typeof n&&Wa(o).is(n))break}1===o.nodeType&&r.push(o),o=o[t]}return r}function Ha(e,t,n,r){var o=[];for(r instanceof Wa&&(r=r[0]);e;e=e[t])if(!n||e.nodeType===n){if(void 0!==r){if(e===r)break;if("string"==typeof r&&Wa(e).is(r))break}o.push(e)}return o}function Va(e,t,n){for(e=e[t];e;e=e[t])if(e.nodeType===n)return e;return null}function ja(e,t){var n=t.attr("style"),r=e.serialize(e.parse(n),t[0].nodeName)||null;t.attr("data-mce-style",r)}function Ua(e,t){var n,r,o=0;if(e)for(n=e.nodeType,e=e.previousSibling;e;e=e.previousSibling)r=e.nodeType,(!t||3!==r||r!==n&&e.nodeValue.length)&&(o++,n=r);return o}wa.fn=wa.prototype={constructor:wa,selector:"",context:null,length:0,init:function(e,t){var n,r,o=this;if(!e)return o;if(e.nodeType)return o.context=o[0]=e,o.length=1,o;if(t&&t.nodeType)o.context=t;else{if(t)return Wa(e).attr(t);o.context=t=document}if(ha(e)){if(!(n="<"===(o.selector=e).charAt(0)&&">"===e.charAt(e.length-1)&&3<=e.length?[null,e,null]:_a.exec(e)))return Wa(t).find(e);if(n[1])for(r=va(e,Fa(t)).firstChild;r;)Ta.call(o,r),r=r.nextSibling;else{if(!(r=Fa(t).getElementById(n[2])))return o;if(r.id!==n[2])return o.find(e);o.length=1,o[0]=r}}else this.add(e,!1);return o},toArray:function(){return kt.toArray(this)},add:function(e,t){var n,r;if(ha(e))return this.add(Wa(e));if(!1!==t)for(n=Wa.unique(this.toArray().concat(Wa.makeArray(e))),this.length=n.length,r=0;r<n.length;r++)this[r]=n[r];else Ta.apply(this,Wa.makeArray(e));return this},attr:function(e,t){var n,r=this;if("object"==typeof e)Ca(e,(function(e,t){r.attr(e,t)}));else{if(!pa(t)){if(r[0]&&1===r[0].nodeType){if((n=Ba[e])&&n.get)return n.get(r[0],e);if(Na[e])return r.prop(e)?e:void 0;null===(t=r[0].getAttribute(e,2))&&(t=void 0)}return t}this.each((function(){var n;1===this.nodeType&&((n=Ba[e])&&n.set?n.set(this,t):null===t?this.removeAttribute(e,2):this.setAttribute(e,t,2))}))}return r},removeAttr:function(e){return this.attr(e,null)},prop:function(e,t){var n=this;if("object"==typeof(e=Ra[e]||e))Ca(e,(function(e,t){n.prop(e,t)}));else{if(!pa(t))return n[0]&&n[0].nodeType&&e in n[0]?n[0][e]:t;this.each((function(){1===this.nodeType&&(this[e]=t)}))}return n},css:function(e,t){function n(e){return e.replace(/-(\D)/g,(function(e,t){return t.toUpperCase()}))}function r(e){return e.replace(/[A-Z]/g,(function(e){return"-"+e}))}var o,i,a=this;if("object"==typeof e)Ca(e,(function(e,t){a.css(e,t)}));else if(pa(t))e=n(e),"number"!=typeof t||Ma[e]||(t=t.toString()+"px"),a.each((function(){var n=this.style;if((i=Pa[e])&&i.set)i.set(this,t);else{try{this.style[za[e]||e]=t}catch(n){}null!==t&&""!==t||(n.removeProperty?n.removeProperty(r(e)):n.removeAttribute(e))}}));else{if(o=a[0],(i=Pa[e])&&i.get)return i.get(o);if(!o.ownerDocument.defaultView)return o.currentStyle?o.currentStyle[n(e)]:"";try{return o.ownerDocument.defaultView.getComputedStyle(o,null).getPropertyValue(r(e))}catch(n){return}}return a},remove:function(){for(var e,t=this.length;t--;)e=this[t],Ea.clean(e),e.parentNode&&e.parentNode.removeChild(e);return this},empty:function(){for(var e,t=this.length;t--;)for(e=this[t];e.firstChild;)e.removeChild(e.firstChild);return this},html:function(e){var t;if(pa(e)){t=this.length;try{for(;t--;)this[t].innerHTML=e}catch(n){Wa(this[t]).empty().append(e)}return this}return this[0]?this[0].innerHTML:""},text:function(e){var t;if(pa(e)){for(t=this.length;t--;)"innerText"in this[t]?this[t].innerText=e:this[0].textContent=e;return this}return this[0]?this[0].innerText||this[0].textContent:""},append:function(){return Da(this,arguments,(function(e){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.appendChild(e)}))},prepend:function(){return Da(this,arguments,(function(e){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.insertBefore(e,this.firstChild)}),!0)},before:function(){return this[0]&&this[0].parentNode?Da(this,arguments,(function(e){this.parentNode.insertBefore(e,this)})):this},after:function(){return this[0]&&this[0].parentNode?Da(this,arguments,(function(e){this.parentNode.insertBefore(e,this.nextSibling)}),!0):this},appendTo:function(e){return Wa(e).append(this),this},prependTo:function(e){return Wa(e).prepend(this),this},replaceWith:function(e){return this.before(e).remove()},wrap:function(e){return ya(this,e)},wrapAll:function(e){return ya(this,e,!0)},wrapInner:function(e){return this.each((function(){Wa(this).contents().wrapAll(e)})),this},unwrap:function(){return this.parent().each((function(){Wa(this).replaceWith(this.childNodes)}))},clone:function(){var e=[];return this.each((function(){e.push(this.cloneNode(!0))})),Wa(e)},addClass:function(e){return this.toggleClass(e,!0)},removeClass:function(e){return this.toggleClass(e,!1)},toggleClass:function(e,t){var n=this;return"string"!=typeof e||(-1!==e.indexOf(" ")?Ca(e.split(" "),(function(){n.toggleClass(this,t)})):n.each((function(n,r){var o,i=ba(r,e);i!==t&&(o=r.className,i?r.className=xa((" "+o+" ").replace(" "+e+" "," ")):r.className+=o?" "+e:e)}))),n},hasClass:function(e){return ba(this[0],e)},each:function(e){return Ca(this,e)},on:function(e,t){return this.each((function(){Ea.bind(this,e,t)}))},off:function(e,t){return this.each((function(){Ea.unbind(this,e,t)}))},trigger:function(e){return this.each((function(){"object"==typeof e?Ea.fire(this,e.type,e):Ea.fire(this,e)}))},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},slice:function(){return Wa(Oa.apply(this,arguments))},eq:function(e){return-1===e?this.slice(e):this.slice(e,+e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},find:function(e){for(var t=[],n=0,r=this.length;n<r;n++)Wa.find(e,this[n],t);return Wa(t)},filter:function(e){return Wa("function"==typeof e?Sa(this.toArray(),(function(t,n){return e(n,t)})):Wa.filter(e,this.toArray()))},closest:function(e){var t=[];return e instanceof Wa&&(e=e[0]),this.each((function(n,r){for(;r;){if("string"==typeof e&&Wa(r).is(e)){t.push(r);break}if(r===e){t.push(r);break}r=r.parentNode}})),Wa(t)},offset:function(e){var t,n,r,o,i=0,a=0;return e?this.css(e):((t=this[0])&&(r=(n=t.ownerDocument).documentElement,t.getBoundingClientRect&&(i=(o=t.getBoundingClientRect()).left+(r.scrollLeft||n.body.scrollLeft)-r.clientLeft,a=o.top+(r.scrollTop||n.body.scrollTop)-r.clientTop)),{left:i,top:a})},push:Ta,sort:Array.prototype.sort,splice:Array.prototype.splice},kt.extend(wa,{extend:kt.extend,makeArray:function(e){return e&&e===e.window||e.nodeType?[e]:kt.toArray(e)},inArray:function(e,t){var n;if(t.indexOf)return t.indexOf(e);for(n=t.length;n--;)if(t[n]===e)return n;return-1},isArray:kt.isArray,each:Ca,trim:xa,grep:Sa,find:oa,expr:oa.selectors,unique:oa.uniqueSort,text:oa.getText,contains:oa.contains,filter:function(e,t,n){var r=t.length;for(n&&(e=":not("+e+")");r--;)1!==t[r].nodeType&&t.splice(r,1);return 1===t.length?Wa.find.matchesSelector(t[0],e)?[t[0]]:[]:Wa.find.matches(e,t)}}),Ca({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return La(e,"parentNode")},next:function(e){return Va(e,"nextSibling",1)},prev:function(e){return Va(e,"previousSibling",1)},children:function(e){return Ha(e.firstChild,"nextSibling",1)},contents:function(e){return kt.toArray(("iframe"===e.nodeName?e.contentDocument||e.contentWindow.document:e).childNodes)}},(function(e,t){wa.fn[e]=function(n){var r=[];this.each((function(){var e=t.call(r,this,n,r);e&&(Wa.isArray(e)?r.push.apply(r,e):r.push(e))})),1<this.length&&(Aa[e]||(r=Wa.unique(r)),0===e.indexOf("parents")&&(r=r.reverse()));var o=Wa(r);return n?o.filter(n):o}})),Ca({parentsUntil:function(e,t){return La(e,"parentNode",t)},nextUntil:function(e,t){return Ha(e,"nextSibling",1,t).slice(1)},prevUntil:function(e,t){return Ha(e,"previousSibling",1,t).slice(1)}},(function(e,t){wa.fn[e]=function(n,r){var o=[];this.each((function(){var e=t.call(o,this,n,o);e&&(Wa.isArray(e)?o.push.apply(o,e):o.push(e))})),1<this.length&&(o=Wa.unique(o),0!==e.indexOf("parents")&&"prevUntil"!==e||(o=o.reverse()));var i=Wa(o);return r?i.filter(r):i}})),wa.fn.is=function(e){return!!e&&0<this.filter(e).length},wa.fn.init.prototype=wa.fn,wa.overrideDefaults=function(e){var t,n=function(r,o){return t=t||e(),0===arguments.length&&(r=t.element),o=o||t.context,new n.fn.init(r,o)};return Wa.extend(n,this),n},wa.attrHooks=Ba,wa.cssHooks=Pa;var Wa=wa,$a=kt.each,qa=kt.grep,Ga=xt.ie,Ka=/^([a-z0-9],?)+$/i,Xa=function(e,t){function n(t){return t&&e&&v(t)?e.getElementById(t):t}function r(e){return q("string"==typeof e?n(e):e)}function o(e,t,n){var o,i,a=r(e);return void 0===(i=a.length?(o=J[t])&&o.get?o.get(a,t):a.attr(t):i)?n||"":i}function i(e){var t=n(e);return t?t.attributes:[]}function u(e,n,o){""===o&&(o=null);var i,a=r(e),u=a.attr(n);a.length&&((i=J[n])&&i.set?i.set(a,o,n):a.attr(n,o),u!==o&&t.onSetAttrib&&t.onSetAttrib({attrElm:a,attrName:n,attrValue:o}))}function s(){return t.root_element||e.body}function l(t,r){return function(e,t,n){var r,o=0,i=0,a=e.ownerDocument;if(n=n||e,t){if(n===e&&t.getBoundingClientRect&&"static"===wn(Tt.fromDom(e),"position")){var u=t.getBoundingClientRect();return{x:o=u.left+(a.documentElement.scrollLeft||e.scrollLeft)-a.documentElement.clientLeft,y:i=u.top+(a.documentElement.scrollTop||e.scrollTop)-a.documentElement.clientTop}}for(var c=t;c&&c!==n&&c.nodeType&&!kn(c,n);){var s=c;o+=s.offsetLeft||0,i+=s.offsetTop||0,c=s.offsetParent}for(c=t.parentNode;c&&c!==n&&c.nodeType&&!kn(c,n);)o-=c.scrollLeft||0,i-=c.scrollTop||0,c=c.parentNode;i+=(r=Tt.fromDom(t),Zn.isFirefox()&&"table"===Ot(r)?Sn(An(r)).filter((function(e){return"caption"===Ot(e)})).bind((function(e){return Sn(Pt(e)).map((function(t){var n=t.dom.offsetTop,r=e.dom.offsetTop,o=e.dom.offsetHeight;return n<=r?-o:0}))})).getOr(0):0)}return{x:o,y:i}}(e.body,n(t),r)}function d(e,t,n){var o=r(e);return n?o.css(t):("float"===(t=t.replace(/-(\D)/g,(function(e,t){return t.toUpperCase()})))&&(t=xt.browser.isIE()?"styleFloat":"cssFloat"),o[0]&&o[0].style?o[0].style[t]:void 0)}function m(e){var t=d(e=n(e),"width"),r=d(e,"height");return-1===t.indexOf("px")&&(t=0),-1===r.indexOf("px")&&(r=0),{w:parseInt(t,10)||e.offsetWidth||e.clientWidth,h:parseInt(r,10)||e.offsetHeight||e.clientHeight}}function g(e,t){if(!e)return!1;if(!Array.isArray(e)){if("*"===t)return 1===e.nodeType;if(Ka.test(t)){for(var n=t.toLowerCase().split(/,/),r=e.nodeName.toLowerCase(),o=n.length-1;0<=o;o--)if(n[o]===r)return!0;return!1}if(e.nodeType&&1!==e.nodeType)return!1}var i=Array.isArray(e)?e:[e];return 0<oa(t,i[0].ownerDocument||i[0],null,i).length}function p(e,t,r,o){var i,u=[],c=n(e);for(o=void 0===o,r=r||("BODY"!==s().nodeName?s().parentNode:null),kt.is(t,"string")&&(t="*"===(i=t)?function(e){return 1===e.nodeType}:function(e){return g(e,i)});c&&!(c===r||a(c.nodeType)||Un(c)||Wn(c));){if(!t||"function"==typeof t&&t(c)){if(!o)return[c];u.push(c)}c=c.parentNode}return o?u:null}function h(e,t,n){var r=t;if(e)for("string"==typeof t&&(r=function(e){return g(e,t)}),e=e[n];e;e=e[n])if("function"==typeof r&&r(e))return e;return null}function b(e,t,r){var o,i="string"==typeof e?n(e):e;return!!i&&(kt.isArray(i)&&(i.length||0===i.length)?(o=[],$a(i,(function(e,i){e&&o.push(t.call(r,"string"==typeof e?n(e):e,i))})),o):t.call(r||this,i))}function y(e,t){r(e).each((function(e,n){$a(t,(function(e,t){u(n,t,e)}))}))}function w(e,t){var n=r(e);Ga?n.each((function(e,n){if(!1!==n.canHaveHTML){for(;n.firstChild;)n.removeChild(n.firstChild);try{n.innerHTML="<br>"+t,n.removeChild(n.firstChild)}catch(e){Wa("<div></div>").html("<br>"+t).contents().slice(1).appendTo(n)}return t}})):n.html(t)}function x(t,n,r,o,i){return b(t,(function(t){var a="string"==typeof n?e.createElement(n):n;return y(a,r),o&&("string"!=typeof o&&o.nodeType?a.appendChild(o):"string"==typeof o&&w(a,o)),i?a:t.appendChild(a)}))}function C(t,n,r){return x(e.createElement(t),t,n,r,!0)}function S(e,t){var n=r(e);return(t?n.each((function(){for(var e;e=this.firstChild;)3===e.nodeType&&0===e.data.length?this.removeChild(e):this.parentNode.insertBefore(e,this)})):n).remove(),1<n.length?n.toArray():n[0]}function k(e,t,n){r(e).toggleClass(t,n).each((function(){""===this.className&&Wa(this).attr("class",null)}))}function T(e,t,n){return b(t,(function(t){return kt.is(t,"array")&&(e=e.cloneNode(!0)),n&&$a(qa(t.childNodes),(function(t){e.appendChild(t)})),t.parentNode.replaceChild(e,t)}))}function O(e){if(Ln(e)){var t="a"===e.nodeName.toLowerCase()&&!o(e,"href")&&o(e,"id");return o(e,"name")||o(e,"data-mce-bookmark")||t?1:void 0}}function _(){return e.createRange()}function E(e){if(e&&Ln(e)){var t=e.getAttribute("data-mce-contenteditable");return t&&"inherit"!==t?t:"inherit"!==e.contentEditable?e.contentEditable:null}return null}void 0===t&&(t={});var A,D,M,N,R,z,B={},P=window,I={},L=0,H=Or.forElement(Tt.fromDom(e),{contentCssCors:t.contentCssCors,referrerPolicy:t.referrerPolicy}),V=[],j=t.schema||Qr({}),U=to({url_converter:t.url_converter,url_converter_scope:t.url_converter_scope},t.schema),W=t.ownEvents?new oi:oi.Event,$=j.getBlockElements(),q=Wa.overrideDefaults((function(){return{context:e,element:Y.getRoot()}})),G=Ko.encodeAllRaw,K=function(n,r,o,i){if(kt.isArray(n)){for(var a=n.length,u=[];a--;)u[a]=K(n[a],r,o,i);return u}return!t.collect||n!==e&&n!==P||V.push([n,r,o,i]),W.bind(n,r,o,i||Y)},X=function(t,n,r){if(kt.isArray(t)){for(var o=t.length,i=[];o--;)i[o]=X(t[o],n,r);return i}if(0<V.length&&(t===e||t===P))for(o=V.length;o--;){var a=V[o];t!==a[0]||n&&n!==a[1]||r&&r!==a[2]||W.unbind(a[0],a[1],a[2])}return W.unbind(t,n,r)},Y={doc:e,settings:t,win:P,files:I,stdMode:!0,boxModel:!0,styleSheetLoader:H,boundEvents:V,styles:U,schema:j,events:W,isBlock:function(e){if("string"==typeof e)return!!$[e];if(e){var t=e.nodeType;if(t)return!(1!==t||!$[e.nodeName])}return!1},$:q,$$:r,root:null,clone:function(t,n){if(!Ga||1!==t.nodeType||n)return t.cloneNode(n);var r=e.createElement(t.nodeName);return $a(i(t),(function(e){u(r,e.nodeName,o(t,e.nodeName))})),r},getRoot:s,getViewPort:function(e){var t=tn(e);return{x:t.x,y:t.y,w:t.width,h:t.height}},getRect:function(e){var t=l(e=n(e)),r=m(e);return{x:t.x,y:t.y,w:r.w,h:r.h}},getSize:m,getParent:function(e,t,n){var r=p(e,t,n,!1);return r&&0<r.length?r[0]:null},getParents:p,get:n,getNext:function(e,t){return h(e,t,"nextSibling")},getPrev:function(e,t){return h(e,t,"previousSibling")},select:function(r,o){return oa(r,n(o)||t.root_element||e,[])},is:g,add:x,create:C,createHTML:function(e,t,n){var r,o="";for(r in o+="<"+e,t)ce(t,r)&&(o+=" "+r+'="'+G(t[r])+'"');return void 0!==n?o+">"+n+"</"+e+">":o+" />"},createFragment:function(t){var n,r=e.createElement("div"),o=e.createDocumentFragment();for(o.appendChild(r),t&&(r.innerHTML=t);n=r.firstChild;)o.appendChild(n);return o.removeChild(r),o},remove:S,setStyle:function(e,n,o){var i=v(n)?r(e).css(n,o):r(e).css(n);t.update_styles&&ja(U,i)},getStyle:d,setStyles:function(e,n){var o=r(e).css(n);t.update_styles&&ja(U,o)},removeAllAttribs:function(e){return b(e,(function(e){for(var t=e.attributes,n=t.length-1;0<=n;n--)e.removeAttributeNode(t.item(n))}))},setAttrib:u,setAttribs:y,getAttrib:o,getPos:l,parseStyle:function(e){return U.parse(e)},serializeStyle:function(e,t){return U.serialize(e,t)},addStyle:function(t){var n,r;if(Y!==Xa.DOM&&e===document){if(B[t])return;B[t]=!0}(r=e.getElementById("mceDefaultStyles"))||((r=e.createElement("style")).id="mceDefaultStyles",r.type="text/css",(n=e.getElementsByTagName("head")[0]).firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r)),r.styleSheet?r.styleSheet.cssText+=t:r.appendChild(e.createTextNode(t))},loadCSS:function(e){F((e=e||"").split(","),(function(e){I[e]=!0,H.load(e,c)}))},addClass:function(e,t){r(e).addClass(t)},removeClass:function(e,t){k(e,t,!1)},hasClass:function(e,t){return r(e).hasClass(t)},toggleClass:k,show:function(e){r(e).show()},hide:function(e){r(e).hide()},isHidden:function(e){return"none"===r(e).css("display")},uniqueId:function(e){return(e||"mce_")+L++},setHTML:w,getOuterHTML:function(e){var t="string"==typeof e?n(e):e;return Ln(t)?t.outerHTML:Wa("<div></div>").append(Wa(t).clone()).html()},setOuterHTML:function(e,t){r(e).each((function(){try{if("outerHTML"in this)return void(this.outerHTML=t)}catch(e){}S(Wa(this).html(t),!0)}))},decode:Ko.decode,encode:G,insertAfter:function(e,t){var r=n(t);return b(e,(function(e){var t=r.parentNode,n=r.nextSibling;return n?t.insertBefore(e,n):t.appendChild(e),e}))},replace:T,rename:function(e,t){var n;return e.nodeName!==t.toUpperCase()&&(n=C(t),$a(i(e),(function(t){u(n,t.nodeName,o(e,t.nodeName))})),T(n,e,!0)),n||e},findCommonAncestor:function(e,t){for(var n,r=e;r;){for(n=t;n&&r!==n;)n=n.parentNode;if(r===n)break;r=r.parentNode}return!r&&e.ownerDocument?e.ownerDocument.documentElement:r},toHex:function(e){return U.toHex(kt.trim(e))},run:b,getAttribs:i,isEmpty:function(e,t){var n,r,o=0;if(O(e))return!1;if(e=e.firstChild){var i=new _r(e,e.parentNode),a=j?j.getWhiteSpaceElements():{};t=t||(j?j.getNonEmptyElements():null);do{if(n=e.nodeType,Ln(e)){var u=e.getAttribute("data-mce-bogus");if(u){e=i.next("all"===u);continue}if(r=e.nodeName.toLowerCase(),t&&t[r]){if("br"!==r)return!1;o++,e=i.next();continue}if(O(e))return!1}if(8===n)return!1;if(3===n&&!jr(e.nodeValue))return!1;if(3===n&&e.parentNode&&a[e.parentNode.nodeName]&&jr(e.nodeValue))return!1;e=i.next()}while(e)}return o<=1},createRng:_,nodeIndex:Ua,split:function(e,t,n){var r,o,i,a=_();if(e&&t)return a.setStart(e.parentNode,Ua(e)),a.setEnd(t.parentNode,Ua(t)),r=a.extractContents(),(a=_()).setStart(t.parentNode,Ua(t)+1),a.setEnd(e.parentNode,Ua(e)+1),o=a.extractContents(),(i=e.parentNode).insertBefore(Fo(Y,r),e),n?i.insertBefore(n,e):i.insertBefore(t,e),i.insertBefore(Fo(Y,o),e),S(e),n||t},bind:K,unbind:X,fire:function(e,t,n){return W.fire(e,t,n)},getContentEditable:E,getContentEditableParent:function(e){for(var t=s(),n=null;e&&e!==t&&null===(n=E(e));e=e.parentNode);return n},destroy:function(){if(0<V.length)for(var e=V.length;e--;){var t=V[e];W.unbind(t[0],t[1],t[2])}ne(I,(function(e,t){H.unload(t),delete I[t]})),oa.setDocument&&oa.setDocument()},isChildOf:function(e,t){if(Ga){for(;e;){if(t===e)return!0;e=e.parentNode}return!1}return e===t||t.contains(e)},dumpRng:function(e){return"startContainer: "+e.startContainer.nodeName+", startOffset: "+e.startOffset+", endContainer: "+e.endContainer.nodeName+", endOffset: "+e.endOffset}},J=(A=U,M=f(Y),R={set:function(e,t,n){D.url_converter&&null!==t&&(t=D.url_converter.call(D.url_converter_scope||M(),t,n,e[0])),e.attr("data-mce-"+n,t).attr(n,t)},get:function(e,t){return e.attr("data-mce-"+t)||e.attr(t)}},z={style:{set:function(e,t){null===t||"object"!=typeof t?(N&&e.attr("data-mce-style",t),null!==t&&"string"==typeof t?(e.removeAttr("style"),e.css(A.parse(t))):e.attr("style",t)):e.css(t)},get:function(e){var t=e.attr("data-mce-style")||e.attr("style");return A.serialize(A.parse(t),e[0].nodeName)}}},(N=(D=t).keep_values)&&(z.href=z.src=R),z);return Y};Xa.DOM=Xa(document),Xa.nodeIndex=Ua;var Ya=Xa.DOM,Ja=kt.each,Za=kt.grep,Qa=(eu.prototype._setReferrerPolicy=function(e){this.settings.referrerPolicy=e},eu.prototype.loadScript=function(e,t,n){function r(){o.remove(i),a&&(a.onerror=a.onload=a=null)}var o=Ya,i=o.uniqueId(),a=document.createElement("script");a.id=i,a.type="text/javascript",a.src=kt._addCacheSuffix(e),this.settings.referrerPolicy&&o.setAttrib(a,"referrerpolicy",this.settings.referrerPolicy),a.onload=function(){r(),t()},a.onerror=function(){r(),S(n)?n():"undefined"!=typeof console&&console.log&&console.log("Failed to load script: "+e)},(document.getElementsByTagName("head")[0]||document.body).appendChild(a)},eu.prototype.isDone=function(e){return 2===this.states[e]},eu.prototype.markDone=function(e){this.states[e]=2},eu.prototype.add=function(e,t,n,r){var o=this.states[e];this.queue.push(e),void 0===o&&(this.states[e]=0),t&&(this.scriptLoadedCallbacks[e]||(this.scriptLoadedCallbacks[e]=[]),this.scriptLoadedCallbacks[e].push({success:t,failure:r,scope:n||this}))},eu.prototype.load=function(e,t,n,r){return this.add(e,t,n,r)},eu.prototype.remove=function(e){delete this.states[e],delete this.scriptLoadedCallbacks[e]},eu.prototype.loadQueue=function(e,t,n){this.loadScripts(this.queue,e,t,n)},eu.prototype.loadScripts=function(e,t,n,r){function o(e,t){Ja(i.scriptLoadedCallbacks[t],(function(t){S(t[e])&&t[e].call(t.scope)})),i.scriptLoadedCallbacks[t]=void 0}var i=this,a=[];i.queueLoadedCallbacks.push({success:t,failure:r,scope:n||this});var u=function(){var t,n=Za(e);e.length=0,Ja(n,(function(e){2!==i.states[e]?3!==i.states[e]?1!==i.states[e]&&(i.states[e]=1,i.loading++,i.loadScript(e,(function(){i.states[e]=2,i.loading--,o("success",e),u()}),(function(){i.states[e]=3,i.loading--,a.push(e),o("failure",e),u()}))):o("failure",e):o("success",e)})),i.loading||(t=i.queueLoadedCallbacks.slice(0),i.queueLoadedCallbacks.length=0,Ja(t,(function(e){0===a.length?S(e.success)&&e.success.call(e.scope):S(e.failure)&&e.failure.call(e.scope,a)})))};u()},eu.ScriptLoader=new eu,eu);function eu(e){void 0===e&&(e={}),this.states={},this.queue=[],this.scriptLoadedCallbacks={},this.queueLoadedCallbacks=[],this.loading=0,this.settings=e}function tu(e){var t=e;return{get:function(){return t},set:function(e){t=e}}}function nu(){return ue(ru,ou.get())}var ru={},ou=tu("en"),iu={getData:function(){return re(ru,(function(e){return _e({},e)}))},setCode:function(e){e&&ou.set(e)},getCode:function(){return ou.get()},add:function(e,t){var n=ru[e];n||(ru[e]=n={}),ne(t,(function(e,t){n[t.toLowerCase()]=e}))},translate:function(e){function t(e){return S(e)?Object.prototype.toString.call(e):u(e)?"":""+e}function n(e){var n=t(e);return ue(a,n.toLowerCase()).map(t).getOr(n)}function r(e){return e.replace(/{context:\w+}$/,"")}var o,i,a=nu().getOr({}),u=function(e){return""===e||null==e};if(u(e))return"";if(b(o=e)&&Te(o,"raw"))return t(e.raw);if(y(i=e)&&1<i.length){var c=e.slice(1);return r(n(e[0]).replace(/\{([0-9]+)\}/g,(function(e,n){return Te(c,n)?t(c[n]):e})))}return r(n(e))},isRtl:function(){return nu().bind((function(e){return ue(e,"_dir")})).exists((function(e){return"rtl"===e}))},hasCode:function(e){return Te(ru,e)}},au=function(){function e(e,t){F(V(u,(function(n){return n.name===e&&n.state===t})),(function(e){return e.callback()}))}function t(e){return(a[e]?a[e].dependencies:undefined)||[]}function n(e,t){return"object"==typeof t?t:"string"==typeof e?{prefix:"",resource:t,suffix:""}:{prefix:e.prefix,resource:t,suffix:e.suffix}}function r(e,t,n){void 0===n&&(n="added"),Te(a,e)&&"added"===n||Te(i,e)&&"loaded"===n?t():u.push({name:e,state:n,callback:t})}var o=[],i={},a={},u=[],c=function(r,o,u,s,l){var f,d;i[r]||(0!==(f="string"==typeof o?o:o.prefix+o.resource+o.suffix).indexOf("/")&&-1===f.indexOf("://")&&(f=au.baseURL+"/"+f),i[r]=f.substring(0,f.lastIndexOf("/")),d=function(){var i,a,l;e(r,"loaded"),i=o,a=u,l=s,F(t(r),(function(e){var t=n(i,e);c(t.resource,t,void 0,void 0)})),a&&(l?a.call(l):a.call(Qa))},a[r]?d():Qa.ScriptLoader.add(f,d,s,l))};return{items:o,urls:i,lookup:a,_listeners:u,get:function(e){if(a[e])return a[e].instance},dependencies:t,requireLangPack:function(e,t){!1!==au.languageLoad&&r(e,(function(){var n=iu.getCode();!n||t&&-1===(","+(t||"")+",").indexOf(","+n+",")||Qa.ScriptLoader.add(i[e]+"/langs/"+n+".js")}),"loaded")},add:function(t,n,r){var i=n;return o.push(i),a[t]={instance:i,dependencies:r},e(t,"added"),i},remove:function(e){delete i[e],delete a[e]},createUrl:n,addComponents:function(e,t){var n=i[e];F(t,(function(e){Qa.ScriptLoader.add(n+"/"+e)}))},load:c,waitFor:r}};function uu(){var e,t,n=(e=c,t=tu(ve.none()),{clear:function(){r(),t.set(ve.none())},isSet:function(){return t.get().isSome()},get:function(){return t.get()},set:function(e){r(),t.set(ve.some(e))}});function r(){return t.get().each(e)}return _e(_e({},n),{on:function(e){return n.get().each(e)}})}function cu(e,t){var n=null;return{cancel:function(){w(n)||(clearTimeout(n),n=null)},throttle:function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];w(n)&&(n=setTimeout((function(){n=null,e.apply(null,r)}),t))}}}function su(e,t){function n(){w(r)||(clearTimeout(r),r=null)}var r=null;return{cancel:n,throttle:function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];n(),r=setTimeout((function(){r=null,e.apply(null,o)}),t)}}}function lu(e,t){var n=vn(e,t);return void 0===n||""===n?[]:n.split(" ")}function fu(e){return void 0!==e.dom.classList}function du(e,t){var n,r,o;fu(e)?e.dom.classList.add(t):(r=t,o=lu(n=e,"class").concat([r]),pn(n,"class",o.join(" ")))}function mu(e,t){return fu(e)&&e.dom.classList.contains(t)}function gu(e,t){return Ve(n=void 0===e?document:e.dom)?[]:I(n.querySelectorAll(t),Tt.fromDom);var n}function pu(e,t){function n(e,t){return(n=e.dom)&&n.hasAttribute&&n.hasAttribute(t)?ve.some(vn(e,t)):ve.none();var n}var r=e.selection.getRng(),o=Tt.fromDom(r.startContainer),i=Tt.fromDom(e.getBody()),a=t.fold((function(){return"."+Lu()}),(function(e){return"["+Hu()+'="'+e+'"]'}));return vr(It(o,r.startOffset).getOr(o),a,(function(e){return je(e,i)})).bind((function(t){return n(t,""+Vu()).bind((function(r){return n(t,""+Hu()).map((function(t){var n=ju(e,r);return{uid:r,name:t,elements:n}}))}))}))}function hu(e){var t=(new Date).getTime();return e+"_"+Math.floor(1e9*Math.random())+ ++Uu+String(t)}function vu(e,t){var n,r,o=At(e).dom,i=Tt.fromDom(o.createDocumentFragment());Gt(i,(n=t,(r=(o||document).createElement("div")).innerHTML=n,An(Tt.fromDom(r)))),Kt(e),Rn(e,i)}function bu(e,t){return Tt.fromDom(e.dom.cloneNode(t))}function yu(e){return bu(e,!1)}function wu(e){return bu(e,!0)}function xu(e,t,n){function r(e){for(var t;(t=o[e]())&&!Vn(t)&&!n(t););return ve.from(t).filter(Vn)}void 0===n&&(n=D);var o=new _r(e,t);return{current:function(){return ve.from(o.current()).filter(Vn)},next:function(){return r("next")},prev:function(){return r("prev")},prev2:function(){return r("prev2")}}}function Cu(e,t){var n=t||function(t){return e.isBlock(t)||$n(t)||Kn(t)},r=function(e,t,n,o){if(Vn(e)){var i=o(e,t,e.data);if(-1!==i)return ve.some({container:e,offset:i})}return n().bind((function(e){return r(e.container,e.offset,n,o)}))};return{backwards:function(e,t,o,i){var a=xu(e,i,n);return r(e,t,(function(){return a.prev().map((function(e){return{container:e,offset:e.length}}))}),o).getOrNull()},forwards:function(e,t,o,i){var a=xu(e,i,n);return r(e,t,(function(){return a.next().map((function(e){return{container:e,offset:0}}))}),o).getOrNull()}}}function Su(e){return e?{left:Wu(e.left),top:Wu(e.top),bottom:Wu(e.bottom),right:Wu(e.right),width:Wu(e.width),height:Wu(e.height)}:{left:0,top:0,bottom:0,right:0,width:0,height:0}}function ku(e,t){return e=Su(e),t||(e.left=e.left+e.width),e.right=e.left,e.width=0,e}function Tu(e,t,n){return 0<=e&&e<=Math.min(t.height,n.height)/2}function Ou(e,t){var n=Math.min(t.height/2,e.height/2);return e.bottom-n<t.top||!(e.top>t.bottom)&&Tu(t.top-e.bottom,e,t)}function _u(e,t){return e.top>t.bottom||!(e.bottom<t.top)&&Tu(t.bottom-e.top,e,t)}function Eu(e,t,n){return t>=e.left&&t<=e.right&&n>=e.top&&n<=e.bottom}function Au(e){var t=e.startContainer,n=e.startOffset;return t.hasChildNodes()&&e.endOffset===n+1?t.childNodes[n]:null}function Du(e,t){if(Ln(e)&&e.hasChildNodes()){var n=e.childNodes;return n[(r=n.length-1,Math.min(Math.max(t,0),r))]}return e;var r}function Mu(e){return"string"==typeof e&&768<=e.charCodeAt(0)&&$u.test(e)}function Nu(e){return"createRange"in e?e.createRange():Xa.DOM.createRng()}function Ru(e){return e&&/[\r\n\t ]/.test(e)}function zu(e){return e.setStart&&e.setEnd}function Bu(e){var t=e.startContainer,n=e.startOffset;if(Ru(e.toString())&&Ju(t.parentNode)&&Vn(t)){var r=t.data;return Ru(r[n-1])||Ru(r[n+1])?1:void 0}}function Pu(e){return 0===e.left&&0===e.right&&0===e.top&&0===e.bottom}function Iu(e,t){var n=ku(e,t);return n.width=1,n.right=n.left+1,n}au.languageLoad=!0,au.baseURL="",au.PluginManager=au(),au.ThemeManager=au();var Fu=function(e,t){var n=[];return F(An(e),(function(e){n=(n=t(e)?n.concat([e]):n).concat(Fu(e,t))})),n},Lu=f("mce-annotation"),Hu=f("data-mce-annotation"),Vu=f("data-mce-annotation-uid"),ju=function(e,t){return gu(Tt.fromDom(e.getBody()),"["+Vu()+'="'+t+'"]')},Uu=0,Wu=Math.round,$u=new RegExp("[̀-ͯ҃-҇҈-҉֑-ֽֿׁ-ׂׄ-ׇׅؐ-ًؚ-ٰٟۖ-ۜ۟-ۤۧ-۪ۨ-ܑۭܰ-݊ަ-ް߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣣ-ंऺ़ु-ै्॑-ॗॢ-ॣঁ়াু-ৄ্ৗৢ-ৣਁ-ਂ਼ੁ-ੂੇ-ੈੋ-੍ੑੰ-ੱੵઁ-ં઼ુ-ૅે-ૈ્ૢ-ૣଁ଼ାିୁ-ୄ୍ୖୗୢ-ୣஂாீ்ௗఀా-ీె-ైొ-్ౕ-ౖౢ-ౣಁ಼ಿೂೆೌ-್ೕ-ೖೢ-ೣഁാു-ൄ്ൗൢ-ൣ්ාි-ුූෟัิ-ฺ็-๎ັິ-ູົ-ຼ່-ໍ༘-ཱ༹༙༵༷-ཾྀ-྄྆-྇ྍ-ྗྙ-ྼ࿆ိ-ူဲ-့္-်ွ-ှၘ-ၙၞ-ၠၱ-ၴႂႅ-ႆႍႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒ-ᝓᝲ-ᝳ឴-឵ិ-ួំ៉-៓៝᠋-᠍ᢩᤠ-ᤢᤧ-ᤨᤲ᤹-᤻ᨗ-ᨘᨛᩖᩘ-ᩞ᩠ᩢᩥ-ᩬᩳ-᩿᩼᪰-᪽᪾ᬀ-ᬃ᬴ᬶ-ᬺᬼᭂ᭫-᭳ᮀ-ᮁᮢ-ᮥᮨ-ᮩ᮫-ᮭ᯦ᯨ-ᯩᯭᯯ-ᯱᰬ-ᰳᰶ-᰷᳐-᳔᳒-᳢᳠-᳨᳭᳴᳸-᳹᷀-᷵᷼-᷿‌-‍⃐-⃜⃝-⃠⃡⃢-⃤⃥-⃰⳯-⵿⳱ⷠ-〪ⷿ-〭〮-゙〯-゚꙯꙰-꙲ꙴ-꙽ꚞ-ꚟ꛰-꛱ꠂ꠆ꠋꠥ-ꠦ꣄꣠-꣱ꤦ-꤭ꥇ-ꥑꦀ-ꦂ꦳ꦶ-ꦹꦼꧥꨩ-ꨮꨱ-ꨲꨵ-ꨶꩃꩌꩼꪰꪲ-ꪴꪷ-ꪸꪾ-꪿꫁ꫬ-ꫭ꫶ꯥꯨ꯭ﬞ︀-️︠-゙︯-゚]"),qu=Ln,Gu=Hr,Ku=an("display","block table"),Xu=an("float","left right"),Yu=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){for(var n=0;n<e.length;n++)if(!e[n](t))return!1;return!0}}(qu,Gu,O(Xu)),Ju=O(an("white-space","pre pre-line pre-wrap")),Zu=Vn,Qu=$n,ec=Xa.nodeIndex,tc=function(e,t){if(!(t<0&&Ln(e)&&e.hasChildNodes()))return Du(e,t)},nc=function(e){var t=e.getClientRects(),n=0<t.length?Su(t[0]):Su(e.getBoundingClientRect());return!zu(e)&&Qu(e)&&Pu(n)?function(e){var t=e.ownerDocument,n=Nu(t),r=t.createTextNode(vo),o=e.parentNode;o.insertBefore(r,e),n.setStart(r,0),n.setEnd(r,1);var i=Su(n.getBoundingClientRect());return o.removeChild(r),i}(e):Pu(n)&&zu(e)?function(e){var t=e.startContainer,n=e.endContainer,r=e.startOffset,o=e.endOffset;if(t===n&&Vn(n)&&0===r&&1===o){var i=e.cloneRange();return i.setEndAfter(n),nc(i)}return null}(e):n},rc=function(e,t,n){function r(){return n=n||function(e){function t(e){var t;0!==e.height&&(0<r.length&&(t=r[r.length-1],e.left===t.left&&e.top===t.top&&e.bottom===t.bottom&&e.right===t.right)||r.push(e))}function n(e,n){var o=Nu(e.ownerDocument);if(n<e.data.length){if(Mu(e.data[n]))return r;if(Mu(e.data[n-1])&&(o.setStart(e,n),o.setEnd(e,n+1),!Bu(o)))return t(Iu(nc(o),!1)),r}0<n&&(o.setStart(e,n-1),o.setEnd(e,n),Bu(o)||t(Iu(nc(o),!1))),n<e.data.length&&(o.setStart(e,n),o.setEnd(e,n+1),Bu(o)||t(Iu(nc(o),!0)))}var r=[],o=e.container(),i=e.offset();if(Zu(o))return n(o,i),r;if(qu(o))if(e.isAtEnd()){var a=tc(o,i);Zu(a)&&n(a,a.data.length),Yu(a)&&!Qu(a)&&t(Iu(nc(a),!1))}else{if(a=tc(o,i),Zu(a)&&n(a,0),Yu(a)&&e.isAtEnd())return t(Iu(nc(a),!1)),r;var u=tc(e.container(),e.offset()-1);Yu(u)&&!Qu(u)&&(!Ku(u)&&!Ku(a)&&Yu(a)||t(Iu(nc(u),!1))),Yu(a)&&t(Iu(nc(a),!0))}return r}(rc(e,t))}return{container:f(e),offset:f(t),toRange:function(){var n=Nu(e.ownerDocument);return n.setStart(e,t),n.setEnd(e,t),n},getClientRects:r,isVisible:function(){return 0<r().length},isAtStart:function(){return Zu(e),0===t},isAtEnd:function(){return Zu(e)?t>=e.data.length:t>=e.childNodes.length},isEqual:function(n){return n&&e===n.container()&&t===n.offset()},getNode:function(n){return tc(e,n?t-1:t)}}};function oc(e,t){Vn(t)&&0===t.data.length&&e.remove(t)}function ic(e,t,n){var r,o,i,a,u,c,s;Wn(n)?(i=e,a=t,c=ve.from((u=n).firstChild),s=ve.from(u.lastChild),a.insertNode(u),c.each((function(e){return oc(i,e.previousSibling)})),s.each((function(e){return oc(i,e.nextSibling)}))):(r=e,t.insertNode(o=n),oc(r,o.previousSibling),oc(r,o.nextSibling))}function ac(e){return function(t){return e===t}}function uc(e){var t,n,r,o;return(rs(e)?"text()":e.nodeName.toLowerCase())+"["+(r=ge(n=us(as(t=e)),ac(t),t),o=me(n=n.slice(0,r+1),(function(e,t,r){return rs(t)&&rs(n[r-1])&&e++,e}),0),ge(n=fe(n,on([t.nodeName])),ac(t),t)-o+"]")}function cc(e,t){var n,r,o,i=[],a=t.container(),u=t.offset();return rs(a)?n=function(e,t){for(;(e=e.previousSibling)&&rs(e);)t+=e.data.length;return t}(a,u):(u>=(r=a.childNodes).length?(n="after",u=r.length-1):n="before",a=r[u]),i.push(uc(a)),o=fe(function(e,t){var n=[];for(t=t.parentNode;t!==e;t=t.parentNode)n.push(t);return n}(e,a),O(cn)),(i=i.concat(le(o,uc))).reverse().join("/")+","+n}function sc(e,t){if(!t)return null;var n=t.split(","),r=n[0].split("/"),o=1<n.length?n[1]:"before",i=me(r,(function(e,t){var n,r,o,i,a=/([\w\-\(\)]+)\[([0-9]+)\]/.exec(t);return a?("text()"===a[1]&&(a[1]="#text"),n=e,r=a[1],o=parseInt(a[2],10),i=fe(i=us(n),(function(e,t){return!rs(e)||!rs(i[t-1])})),(i=fe(i,on([r])))[o]):null}),e);return i?rs(i)?function(e,t){for(var n,r=e,o=0;rs(r);){if(n=r.data.length,o<=t&&t<=o+n){e=r,t-=o;break}if(!rs(r.nextSibling)){e=r,t=n;break}o+=n,r=r.nextSibling}return rs(e)&&t>e.data.length&&(t=e.data.length),rc(e,t)}(i,parseInt(o,10)):(o="after"===o?is(i)+1:is(i),rc(i.parentNode,o)):null}function lc(e,t,n,r,o){var i,a=r[o?"startContainer":"endContainer"],u=r[o?"startOffset":"endOffset"],c=[],s=0,l=e.getRoot();for(Vn(a)?c.push(n?function(e,t,n){for(var r=e(t.data.slice(0,n)).length,o=t.previousSibling;o&&Vn(o);o=o.previousSibling)r+=e(o.data).length;return r}(t,a,u):u):(u>=(i=a.childNodes).length&&i.length&&(s=1,u=Math.max(0,i.length-1)),c.push(e.nodeIndex(i[u],n)+s));a&&a!==l;a=a.parentNode)c.push(e.nodeIndex(a,n));return c}function fc(e,t,n){var r=0;return kt.each(e.select(t),(function(e){if("all"!==e.getAttribute("data-mce-bogus"))return e!==n&&void r++})),r}function dc(e,t){var n,r=t?"start":"end",o=e[r+"Container"],i=e[r+"Offset"];Ln(o)&&"TR"===o.nodeName&&(o=(n=o.childNodes)[Math.min(t?i:i-1,n.length-1)])&&(i=t?0:o.childNodes.length,e["set"+(t?"Start":"End")](o,i))}function mc(e){return dc(e,!0),dc(e,!1),e}function gc(e,t){var n;return Ln(e)&&(e=Du(e,t),cs(e))?e:zr(e)?(n=(e=Vn(e)&&Nr(e)?e.parentNode:e).previousSibling,cs(n)?n:(n=e.nextSibling,cs(n)?n:void 0)):void 0}function pc(e,t,n){var r=n.getNode(),o=r?r.nodeName:null,i=n.getRng();if(cs(r)||"IMG"===o)return{name:o,index:fc(n.dom,o,r)};var a,u,c,s,l,f,d,m=gc((a=i).startContainer,a.startOffset)||gc(a.endContainer,a.endOffset);return m?{name:o=m.tagName,index:fc(n.dom,o,m)}:(f=(c=n).dom,(d={}).start=lc(f,u=e,s=t,l=i,!0),c.isCollapsed()||(d.end=lc(f,u,s,l,!1)),Lr(l)&&(d.isFakeCaret=!0),d)}function hc(e,t,n){var r={"data-mce-type":"bookmark",id:t,style:"overflow:hidden;line-height:0px"};return n?e.create("span",r,"&#xFEFF;"):e.create("span",r)}function vc(e,t){var n=e.dom,r=e.getRng(),o=n.uniqueId(),i=e.isCollapsed(),a=e.getNode(),u=a.nodeName;if("IMG"===u)return{name:u,index:fc(n,u,a)};var c=mc(r.cloneRange());return i||(c.collapse(!1),ic(n,c,hc(n,o+"_end",t))),(r=mc(r)).collapse(!0),ic(n,r,hc(n,o+"_start",t)),e.moveToBookmark({id:o,keep:!0}),{id:o}}function bc(e,t,n){var r=e.getParam(t,n);return-1===r.indexOf("=")?r:ue(e.getParam(t,"","hash"),e.id).getOr(n)}function yc(e){return e.getParam("content_security_policy","")}function wc(e){if(e.getParam("force_p_newlines",!1))return"p";var t=e.getParam("forced_root_block","p");return!1===t?"":!0===t?"p":t}function xc(e){return e.getParam("forced_root_block_attrs",{})}function Cc(e){return e.getParam("automatic_uploads",!0,"boolean")}function Sc(e){return e.getParam("icons","","string")}function kc(e){return e.getParam("referrer_policy","","string")}function Tc(e){return e.getParam("language","en","string")}function Oc(e){return e.getParam("indent_use_margin",!1)}function _c(e){var t=e.getParam("font_css",[]);return y(t)?t:I(t.split(","),Je)}function Ec(e){var t=e.getParam("object_resizing");return!1!==t&&!xt.iOS&&(v(t)?t:"table,img,figure.image,div,video,iframe")}function Ac(e){return e.getParam("event_root")}function Dc(e){return e.getParam("theme")}function Mc(e){return!1!==e.getParam("inline_boundaries")}function Nc(e){return e.getParam("plugins","","string")}function Rc(e){var t=e.parentNode;t&&t.removeChild(e)}function zc(e){var t=wo(e);return{count:e.length-t.length,text:t}}function Bc(e){for(var t;-1!==(t=e.data.lastIndexOf(bo));)e.deleteData(t,1)}function Pc(e,t){return ms(e),t}function Ic(e,t){var n,r=t.container(),o=(-1===(n=z(xe(r.childNodes),e))?ve.none():ve.some(n)).map((function(e){return e<t.offset()?rc(r,t.offset()-1):t})).getOr(t);return ms(e),o}function Fc(e,t){return rc.isTextPosition(t)?(r=t,ds(n=e)&&r.container()===n?(a=zc((o=n).data.substr(0,(i=r).offset())),u=zc(o.data.substr(i.offset())),0<(a.text+u.text).length?(Bc(o),rc(o,i.offset()-a.count)):i):Pc(n,r)):(c=e,((s=t).container()===c.parentNode?Ic:Pc)(c,s));var n,r,o,i,a,u,c,s}function Lc(e,t,n){var r,o,i,a=ku(t.getBoundingClientRect(),n),u="BODY"===e.tagName?(r=e.ownerDocument.documentElement,o=e.scrollLeft||r.scrollLeft,e.scrollTop||r.scrollTop):(i=e.getBoundingClientRect(),o=e.scrollLeft-i.left,e.scrollTop-i.top);a.left+=o,a.right+=o,a.top+=u,a.bottom+=u,a.width=1;var c=t.offsetWidth-t.clientWidth;return 0<c&&(n&&(c*=-1),a.left+=c,a.right+=c),a}function Hc(){return gs.isIE()||gs.isEdge()||gs.isFirefox()}function Vc(e){return bs(e)||sn(e)&&Hc()}function jc(e,t){for(var n;n=e(t);)if(!Ss(n))return n;return null}function Uc(e,t,n,r,o){var i=new _r(e,r),a=ys(e)||Ss(e);if(t<0){if(a&&n(e=jc(i.prev.bind(i),!0)))return e;for(;e=jc(i.prev.bind(i),o);)if(n(e))return e}if(0<t){if(a&&n(e=jc(i.next.bind(i),!0)))return e;for(;e=jc(i.next.bind(i),o);)if(n(e))return e}return null}function Wc(e,t){for(;e&&e!==t;){if(xs(e))return e;e=e.parentNode}return null}function $c(e,t,n){return Wc(e.container(),n)===Wc(t.container(),n)}function qc(e,t){if(!t)return null;var n=t.container(),r=t.offset();return ks(n)?n.childNodes[r+e]:null}function Gc(e,t){var n=t.ownerDocument.createRange();return e?(n.setStartBefore(t),n.setEndBefore(t)):(n.setStartAfter(t),n.setEndAfter(t)),n}function Kc(e,t,n){for(var r,o,i=e?"previousSibling":"nextSibling";n&&n!==t;){var a=n[i];if(Cs(a)&&(a=a[i]),ys(a)||ws(a)){if(o=n,Wc(a,r=t)===Wc(o,r))return a;break}if(Ts(a))break;n=n.parentNode}return null}function Xc(e,t,n){var r,o=T(Kc,!0,t),i=T(Kc,!1,t),a=n.startContainer,u=n.startOffset;if(Nr(a)){var c=(a=ks(a)?a:a.parentNode).getAttribute("data-mce-caret");if("before"===c&&Vc(r=a.nextSibling))return Os(r);if("after"===c&&Vc(r=a.previousSibling))return _s(r)}if(!n.collapsed)return n;if(Vn(a)){if(Cs(a)){if(1===e){if(r=i(a))return Os(r);if(r=o(a))return _s(r)}if(-1===e){if(r=o(a))return _s(r);if(r=i(a))return Os(r)}return n}if(ko(a)&&u>=a.data.length-1)return 1===e&&(r=i(a))?Os(r):n;if(So(a)&&u<=1)return-1===e&&(r=o(a))?_s(r):n;if(u===a.data.length)return(r=i(a))?Os(r):n;if(0===u)return(r=o(a))?_s(r):n}return n}function Yc(e,t){return ve.from(qc(e?0:-1,t)).filter(ys)}function Jc(e,t,n){var r=Xc(e,t,n);return-1===e?rc.fromRangeStart(r):rc.fromRangeEnd(r)}function Zc(e){return ve.from(e.getNode()).map(Tt.fromDom)}function Qc(e,t){for(;t=e(t);)if(t.isVisible())return t;return t}function es(e,t){var n=$c(e,t);return!(n||!$n(e.getNode()))||n}rc.fromRangeStart=function(e){return rc(e.startContainer,e.startOffset)},rc.fromRangeEnd=function(e){return rc(e.endContainer,e.endOffset)},rc.after=function(e){return rc(e.parentNode,ec(e)+1)},rc.before=function(e){return rc(e.parentNode,ec(e))},rc.isAbove=function(e,t){return dn(Q(t.getClientRects()),ee(e.getClientRects()),Ou).getOr(!1)},rc.isBelow=function(e,t){return dn(ee(t.getClientRects()),Q(e.getClientRects()),_u).getOr(!1)},rc.isAtStart=function(e){return!!e&&e.isAtStart()},rc.isAtEnd=function(e){return!!e&&e.isAtEnd()},rc.isTextPosition=function(e){return!!e&&Vn(e.container())},rc.isElementPosition=function(e){return!1===rc.isTextPosition(e)};var ts,ns,rs=Vn,os=cn,is=Xa.nodeIndex,as=function(e){var t=e.parentNode;return os(t)?as(t):t},us=function(e){return e?me(e.childNodes,(function(e,t){return os(t)&&"BR"!==t.nodeName?e=e.concat(us(t)):e.push(t),e}),[]):[]},cs=Kn,ss=T(pc,d,!0),ls=Xa.DOM,fs=Ln,ds=Vn,ms=function(e){fs(e)&&zr(e)&&(Br(e)?e.removeAttribute("data-mce-caret"):Rc(e)),ds(e)&&(Bc(e),0===e.data.length&&Rc(e))},gs=dt().browser,ps=Kn,hs=Yn,vs=Xn,bs=function(e){return ps(e)||hs(e)},ys=Kn,ws=Yn,xs=an("display","block table table-cell table-caption list-item"),Cs=zr,Ss=Nr,ks=Ln,Ts=Hr,Os=T(Gc,!0),_s=T(Gc,!1);function Es(e,t){return e.hasChildNodes()&&t<e.childNodes.length?e.childNodes[t]:null}function As(e,t){if(0<e){if(Vl(t.previousSibling)&&!Fl(t.previousSibling))return rc.before(t);if(Fl(t))return rc(t,0)}if(e<0){if(Vl(t.nextSibling)&&!Fl(t.nextSibling))return rc.after(t);if(Fl(t))return rc(t,t.data.length)}return e<0&&!Hl(t)?rc.after(t):rc.before(t)}function Ds(e){return{next:function(t){return Ul(ts.Forwards,t,e)},prev:function(t){return Ul(ts.Backwards,t,e)}}}function Ms(e){return rc.isTextPosition(e)?0===e.offset():Hr(e.getNode())}function Ns(e){if(rc.isTextPosition(e)){var t=e.container();return e.offset()===t.data.length}return Hr(e.getNode(!0))}function Rs(e,t){return!rc.isTextPosition(e)&&!rc.isTextPosition(t)&&e.getNode()===t.getNode(!0)}function zs(e,t,n){return Wl(e,t,n).bind((function(r){return $c(n,r,t)&&(o=n,i=r,e?!Rs(o,i)&&(rc.isTextPosition(a=o)||!$n(a.getNode()))&&Ns(o)&&Ms(i):!Rs(i,o)&&Ms(o)&&Ns(i))?Wl(e,t,r):ve.some(r);var o,i,a}))}function Bs(e,t){var n,r,o,i,a,u=e?t.firstChild:t.lastChild;return Vn(u)?ve.some(rc(u,e?0:u.data.length)):u?Hr(u)?ve.some(e?rc.before(u):$n(a=u)?rc.before(a):rc.after(a)):(r=t,o=u,i=(n=e)?rc.before(o):rc.after(o),Wl(n,r,i)):ve.none()}function Ps(e){return Ln(e)&&e.id===Yl}function Is(e,t){for(;t&&t!==e;){if(t.id===Yl)return t;t=t.parentNode}return null}function Fs(e){return kt.isArray(e.start)}function Ls(e,t){return Ln(t)&&e.isBlock(t)&&!t.innerHTML&&!xt.ie&&(t.innerHTML='<br data-mce-bogus="1" />'),t}function Hs(e,t,n){return!1===t.hasChildNodes()&&Is(e,t)&&(o=n,i=(r=t).ownerDocument.createTextNode(bo),r.appendChild(i),o.setStart(i,0),o.setEnd(i,0),1);var r,o,i}function Vs(e,t,n,r){var o,i,a,u,c=n[t?"start":"end"],s=e.getRoot();if(c){for(a=c[0],i=s,o=c.length-1;1<=o;o--){if(u=i.childNodes,Hs(s,i,r))return 1;if(c[o]>u.length-1)return Hs(s,i,r)||function(e){return Xl(i).fold(D,(function(t){return e.setStart(t.container(),t.offset()),e.setEnd(t.container(),t.offset()),!0}))}(r);i=u[c[o]]}3===i.nodeType&&(a=Math.min(c[0],i.nodeValue.length)),1===i.nodeType&&(a=Math.min(c[0],i.childNodes.length)),t?r.setStart(i,a):r.setEnd(i,a)}return 1}function js(e){return Vn(e)&&0<e.data.length}function Us(e,t,n){var r,o,i,a,u,c,s=e.get(n.id+"_"+t),l=n.keep;if(s){if(r=s.parentNode,o="start"===t?l?s.hasChildNodes()?(r=s.firstChild,1):js(s.nextSibling)?(r=s.nextSibling,0):js(s.previousSibling)?(r=s.previousSibling,s.previousSibling.data.length):(r=s.parentNode,e.nodeIndex(s)+1):e.nodeIndex(s):l?s.hasChildNodes()?(r=s.firstChild,1):js(s.previousSibling)?(r=s.previousSibling,s.previousSibling.data.length):(r=s.parentNode,e.nodeIndex(s)):e.nodeIndex(s),u=r,c=o,!l){for(a=s.previousSibling,i=s.nextSibling,kt.each(kt.grep(s.childNodes),(function(e){Vn(e)&&(e.nodeValue=e.nodeValue.replace(/\uFEFF/g,""))}));s=e.get(n.id+"_"+t);)e.remove(s,!0);a&&i&&a.nodeType===i.nodeType&&Vn(a)&&!xt.opera&&(o=a.nodeValue.length,a.appendData(i.nodeValue),e.remove(i),u=a,c=o)}return ve.some(rc(u,c))}return ve.none()}function Ws(e,t){(function(e,t){var n,r,o,i,a,u,c,s,l,f,d,m,g=e.dom;if(t){if(Fs(t))return d=t,m=(f=g).createRng(),Vs(f,!0,d,m)&&Vs(f,!1,d,m)?ve.some(m):ve.none();if(v(t.start))return ve.some((c=t,s=(u=g).createRng(),l=sc(u.getRoot(),c.start),s.setStart(l.container(),l.offset()),l=sc(u.getRoot(),c.end),s.setEnd(l.container(),l.offset()),s));if(Te(t,"id"))return dn(a=Us(o=g,"start",i=t),Us(o,"end",i).or(a),(function(e,t){var n=o.createRng();return n.setStart(Ls(o,e.container()),e.offset()),n.setEnd(Ls(o,t.container()),t.offset()),n}));if(Te(t,"name"))return n=g,ve.from(n.select((r=t).name)[r.index]).map((function(e){var t=n.createRng();return t.selectNode(e),t}));if(Te(t,"rng"))return ve.some(t.rng)}return ve.none()})(e,t).each((function(t){e.setRng(t)}))}function $s(e){return Ln(e)&&"SPAN"===e.tagName&&"bookmark"===e.getAttribute("data-mce-type")}function qs(e){return""!==e&&-1!==" \f\n\r\t\v".indexOf(e)}function Gs(e){return!qs(e)&&!Zl(e)}function Ks(e){return e.nodeType}function Xs(e,t,n){var r,o=n.startOffset,i=n.startContainer;if((i!==n.endContainer||!(r=i.childNodes[o])||!/^(IMG)$/.test(r.nodeName))&&Ln(i)){var a=i.childNodes,u=void 0;o<a.length?(i=a[o],u=new _r(i,e.getParent(i,e.isBlock))):(i=a[a.length-1],(u=new _r(i,e.getParent(i,e.isBlock))).next(!0));for(var c=u.current();c;c=u.next())if(Vn(c)&&!Ql(c))return n.setStart(c,0),t.setRng(n),0}}function Ys(e,t,n){if(e){var r=t?"nextSibling":"previousSibling";for(e=n?e:e[r];e;e=e[r])if(Ln(e)||!Ql(e))return e}}function Js(e,t){return Ks(t)&&(t=t.nodeName),!!e.schema.getTextBlockElements()[t.toLowerCase()]}function Zs(e,t,n){return e.schema.isValidChild(t,n)}function Qs(e,t){return S(e)?e=e(t):u(t)&&(e=e.replace(/%(\w+)/g,(function(e,n){return t[n]||e}))),e}function el(e,t){return e=""+((e=e||"").nodeName||e),t=""+((t=t||"").nodeName||t),e.toLowerCase()===t.toLowerCase()}function tl(e,t,n){return"color"!==n&&"backgroundColor"!==n||(t=e.toHex(t)),"fontWeight"===n&&700===t&&(t="bold"),""+("fontFamily"===n?t.replace(/[\'\"]/g,"").replace(/,\s+/g,","):t)}function nl(e,t,n){return tl(e,e.getStyle(t,n),n)}function rl(e,t){var n;return e.getParent(t,(function(t){return(n=e.getStyle(t,"text-decoration"))&&"none"!==n})),n}function ol(e,t,n){return e.getParents(t,n,e.getRoot())}function il(e,t){return P(e.formatter.get(t),(function(e){function t(e){return 1<e.length&&"%"===e.charAt(0)}return P(["styles","attributes"],(function(n){return ue(e,n).exists((function(e){var n,r;return P(y(e)?e:(n=d,r=[],ne(e,(function(e,t){r.push(n(e,t))})),r),t)}))}))}))}function al(e){return ce(e,"block")}function ul(e){return ce(e,"selector")}function cl(e){return ce(e,"inline")}function sl(e){return ul(e)&&!1!==e.expand&&!cl(e)}function ll(e,t){for(var n=t;n;){if(Ln(n)&&e.getContentEditable(n))return"false"===e.getContentEditable(n)?n:t;n=n.parentNode}return t}function fl(e,t,n,r){for(var o=t.data,i=n;e?0<=i:i<o.length;e?i--:i++)if(r(o.charAt(i)))return e?i+1:i;return-1}function dl(e,t,n){return fl(e,t,n,(function(e){return Zl(e)||qs(e)}))}function ml(e,t,n){return fl(e,t,n,Gs)}function gl(e,t,n,r,o,i){function a(t,n,r){var i=Cu(e),a=o?i.backwards:i.forwards;return ve.from(a(t,n,(function(e,t){return ef(e.parentNode)?-1:r(o,u=e,t)}),c))}var u,c=e.getParent(n,e.isBlock)||t;return a(n,r,dl).bind((function(e){return i?a(e.container,e.offset+(o?-1:0),ml):ve.some(e)})).orThunk((function(){return u?ve.some({container:u,offset:o?0:u.length}):ve.none()}))}function pl(e,t,n,r,o){Vn(r)&&ze(r.data)&&r[o]&&(r=r[o]);for(var i=tf(e,r),a=0;a<i.length;a++)for(var c=0;c<t.length;c++){var s=t[c];if((!u(s.collapsed)||s.collapsed===n.collapsed)&&ul(s)&&e.is(i[a],s.selector))return i[a]}return r}function hl(e,t,n,r){var o,i=n,a=e.dom,u=a.getRoot(),c=t[0];if((i=al(c)?c.wrapper?null:a.getParent(n,c.block,u):i)||(o=a.getParent(n,"LI,TD,TH"),i=a.getParent(Vn(n)?n.parentNode:n,(function(t){return t!==u&&rf(e,t)}),o)),!(i=i&&al(c)&&c.wrapper&&tf(a,i,"ul,ol").reverse()[0]||i))for(i=n;i[r]&&!a.isBlock(i[r])&&!el(i=i[r],"br"););return i||n}function vl(e,t,n,r,o){var i,a=n,u=o?"previousSibling":"nextSibling",c=e.getRoot();if(Vn(n)&&!nf(n)&&(o?0<r:r<n.data.length))return n;for(;;){if(!t[0].block_expand&&e.isBlock(a))return a;for(var s=a[u];s;s=s[u]){var l=Vn(s)&&!of(e,c,s,u);if(!ef(s)&&(!$n(i=s)||!i.getAttribute("data-mce-bogus")||i.nextSibling)&&!nf(s,l))return a}if(a===c||a.parentNode===c){n=a;break}a=a.parentNode}return n}function bl(e){return ef(e.parentNode)||ef(e)}function yl(e,t,n,r){void 0===r&&(r=!1);var o=t.startContainer,i=t.startOffset,a=t.endContainer,u=t.endOffset,c=e.dom,s=n[0];return Ln(o)&&o.hasChildNodes()&&(o=Du(o,i),Vn(o)&&(i=0)),Ln(a)&&a.hasChildNodes()&&(a=Du(a,t.collapsed?u:u-1),Vn(a)&&(u=a.nodeValue.length)),o=ll(c,o),a=ll(c,a),bl(o)&&(o=ef(o)?o:o.parentNode,o=t.collapsed?o.previousSibling||o:o.nextSibling||o,Vn(o)&&(i=t.collapsed?o.length:0)),bl(a)&&(a=ef(a)?a:a.parentNode,a=t.collapsed?a.nextSibling||a:a.previousSibling||a,Vn(a)&&(u=t.collapsed?0:a.length)),t.collapsed&&(gl(c,e.getBody(),o,i,!0,r).each((function(e){var t=e.container,n=e.offset;o=t,i=n})),gl(c,e.getBody(),a,u,!1,r).each((function(e){var t=e.container,n=e.offset;a=t,u=n}))),(cl(s)||s.block_expand)&&(cl(s)&&Vn(o)&&0!==i||(o=vl(c,n,o,i,!0)),cl(s)&&Vn(a)&&u!==a.nodeValue.length||(a=vl(c,n,a,u,!1))),sl(s)&&(o=pl(c,n,t,o,"previousSibling"),a=pl(c,n,t,a,"nextSibling")),(al(s)||ul(s))&&(o=hl(e,n,o,"previousSibling"),a=hl(e,n,a,"nextSibling"),al(s)&&(c.isBlock(o)||(o=vl(c,n,o,i,!0)),c.isBlock(a)||(a=vl(c,n,a,u,!1)))),Ln(o)&&(i=c.nodeIndex(o),o=o.parentNode),Ln(a)&&(u=c.nodeIndex(a)+1,a=a.parentNode),{startContainer:o,startOffset:i,endContainer:a,endOffset:u}}function wl(e,t,n){function r(e){var t=e[0];Vn(t)&&t===c&&u>=t.data.length&&e.splice(0,1);var n=e[e.length-1];return 0===s&&0<e.length&&n===l&&Vn(n)&&e.splice(e.length-1,1),e}function o(e,t,n){for(var r=[];e&&e!==n;e=e[t])r.push(e);return r}function i(t,n){return e.getParent(t,(function(e){return e.parentNode===n}),n)}function a(e,t,i){var a=i?"nextSibling":"previousSibling",u=e;for(u.parentNode;u&&u!==t;u=c){var c=u.parentNode,s=o(u===e?u:u[a],a);s.length&&(i||s.reverse(),n(r(s)))}}var u=t.startOffset,c=Du(t.startContainer,u),s=t.endOffset,l=Du(t.endContainer,s-1);if(c===l)return n(r([c]));var f=e.findCommonAncestor(c,l);if(e.isChildOf(c,l))return a(c,f,!0);if(e.isChildOf(l,c))return a(l,f);var d=i(c,f)||c,m=i(l,f)||l;a(c,d,!0);var g=o(d===c?d:d.nextSibling,"nextSibling",m===l?m.nextSibling:m);g.length&&n(r(g)),a(l,m)}function xl(e){var t=[];if(e)for(var n=0;n<e.rangeCount;n++)t.push(e.getRangeAt(n));return t}function Cl(e,t){var n=gu(t,"td[data-mce-selected],th[data-mce-selected]");return 0<n.length?n:V(G(e,(function(e){var t=Au(e);return t?[Tt.fromDom(t)]:[]})),go)}function Sl(e){return Cl(xl(e.selection.getSel()),Tt.fromDom(e.getBody()))}function kl(e,t){return pr(e,"table",t)}function Tl(e,t){return dn((o=t.startContainer,i=t.startOffset,Vn(o)?0===i?ve.some(Tt.fromDom(o)):ve.none():ve.from(o.childNodes[i]).map(Tt.fromDom)),(n=t.endContainer,r=t.endOffset,Vn(n)?r===n.data.length?ve.some(Tt.fromDom(n)):ve.none():ve.from(n.childNodes[r-1]).map(Tt.fromDom)),(function(t,n){var r=$(af(e),T(je,t)),o=$(uf(e),T(je,n));return r.isSome()&&o.isSome()})).getOr(!1);var n,r,o,i}function Ol(e,t,n,r){var o=n,i=new _r(n,o),a=ae(e.schema.getMoveCaretBeforeOnEnterElements(),(function(e,t){return!B(["td","th","table"],t.toLowerCase())}));do{if(Vn(n)&&0!==kt.trim(n.nodeValue).length)return r?t.setStart(n,0):t.setEnd(n,n.nodeValue.length),0;if(a[n.nodeName])return r?t.setStartBefore(n):"BR"===n.nodeName?t.setEndBefore(n):t.setEndAfter(n),0}while(n=r?i.next():i.prev());"BODY"===o.nodeName&&(r?t.setStart(o,0):t.setEnd(o,o.childNodes.length))}function _l(e){var t=e.selection.getSel();return t&&0<t.rangeCount}function El(e,t){var n=Sl(e);0<n.length?F(n,(function(n){var r=n.dom,o=e.dom.createRng();o.setStartBefore(r),o.setEndAfter(r),t(o,!0)})):t(e.selection.getRng(),!1)}function Al(e,t,n){var r=vc(e,t);n(r),e.moveToBookmark(r)}function Dl(e){return cf.get(e)}function Ml(e,t,n,r){var o=t.uid,i=void 0===o?hu("mce-annotation"):o,a=function(e,t){var n={};for(o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n}(t,["uid"]),u=Tt.fromTag("span",e);du(u,Lu()),pn(u,""+Vu(),i),pn(u,""+Hu(),n);var c,s=r(i,a),l=s.attributes,f=s.classes,d=void 0===f?[]:f;return hn(u,void 0===l?{}:l),c=u,F(d,(function(e){du(c,e)})),u}function Nl(e){var t,n,r,o=(t={},{register:function(e,n){t[e]={name:e,settings:n}},lookup:function(e){return ue(t,e).map((function(e){return e.settings}))}});r=o,(n=e).on("init",(function(){n.serializer.addNodeFilter("span",(function(e){F(e,(function(e){ve.from(e.attr(Hu())).bind(r.lookup).each((function(t){!1===t.persistent&&e.unwrap()}))}))}))}));var i=function(e){function t(){return{listeners:[],previous:uu()}}function n(e,t){r(e,(function(e){return t(e),e}))}function r(e,n){var r=o.get(),i=n(ue(r,e).getOrThunk(t));r[e]=i,o.set(r)}var o=tu({}),i=su((function(){var t=o.get();F(J(Ce(t)),(function(t){r(t,(function(r){var o=r.previous.get();return pu(e,ve.some(t)).fold((function(){var e;o.isSome()&&(n(e=t,(function(t){F(t.listeners,(function(t){return t(!1,e)}))})),r.previous.clear())}),(function(e){var t,i,a,u=e.uid,c=e.name,s=e.elements;fn(o,u)||(i=u,a=s,n(t=c,(function(e){F(e.listeners,(function(e){return e(!0,t,{uid:i,nodes:I(a,(function(e){return e.dom}))})}))})),r.previous.set(u))})),{previous:r.previous,listeners:r.listeners}}))}))}),30);return e.on("remove",(function(){i.cancel()})),e.on("NodeChange",(function(){i.throttle()})),{addListener:function(e,t){r(e,(function(e){return{previous:e.previous,listeners:e.listeners.concat([t])}}))}}}(e);return{register:function(e,t){o.register(e,t)},annotate:function(t,n){o.lookup(t).each((function(r){var o,i,a,u;i=t,a=r,u=n,(o=e).undoManager.transact((function(){var e,t,n,r,c=o.selection,s=c.getRng(),l=0<Sl(o).length;s.collapsed&&!l&&(n=yl(e=o,t=s,[{inline:"span"}]),t.setStart(n.startContainer,n.startOffset),t.setEnd(n.endContainer,n.endOffset),e.selection.setRng(t)),c.getRng().collapsed&&!l?(vu(r=Ml(o.getDoc(),u,i,a.decorate),vo),c.getRng().insertNode(r.dom),c.select(r.dom)):Al(c,!1,(function(){El(o,(function(e){!function(e,t,n,r,o){function i(){s.clear()}function a(e){F(e,l)}var u=[],c=Ml(e.getDoc(),o,n,r),s=uu(),l=function(t){var n,r,o,l,f,d;switch(o=e,f="span",d=Ot(l=t),Nt(l).fold((function(){return"skipping"}),(function(e){return"br"===d||On(n=l)&&Dl(n)===bo?"valid":Tn(t=l)&&mu(t,Lu())?"existing":Ps(l.dom)?"caret":Zs(o,f,d)&&Zs(o,Ot(e),f)?"valid":"invalid-child";var t,n}))){case"invalid-child":i(),a(An(t)),i();break;case"valid":Wt(n=t,r=s.get().getOrThunk((function(){var e=yu(c);return u.push(e),s.set(e),e}))),Rn(r,n)}};wl(e.dom,t,(function(e){i(),a(I(e,Tt.fromDom))}))}(o,e,i,a.decorate,u)}))}))}))}))},annotationChanged:function(e,t){i.addListener(e,t)},remove:function(t){pu(e,ve.some(t)).each((function(e){F(e.elements,Xt)}))},getAll:function(t){var n,r,o;return re((n=t,r=gu(Tt.fromDom(e.getBody()),"["+Hu()+'="'+n+'"]'),o={},F(r,(function(e){var t=vn(e,Vu()),n=ue(o,t).getOr([]);o[t]=n.concat([e])})),o),(function(e){return I(e,(function(e){return e.dom}))}))}}}function Rl(e){return{getBookmark:T(Jl,e),moveToBookmark:T(Ws,e)}}function zl(e){return Do(e)||!!Ro(t=e)&&!0!==U(xe(t.getElementsByTagName("*")),(function(e,t){return e||To(t)}),!1);var t}(ns=ts=ts||{})[ns.Backwards=-1]="Backwards",ns[ns.Forwards=1]="Forwards";var Bl,Pl,Il=Kn,Fl=Vn,Ll=Ln,Hl=$n,Vl=Hr,jl=Vr,Ul=function(e,t,n){var r,o,i;if(!Ll(n)||!t)return null;if(t.isEqual(rc.after(n))&&n.lastChild){if(i=rc.after(n.lastChild),e<0&&Vl(n.lastChild)&&Ll(n.lastChild))return Hl(n.lastChild)?rc.before(n.lastChild):i}else i=t;var a,u,c,s=i.container(),l=i.offset();if(Fl(s)){if(e<0&&0<l)return rc(s,--l);if(0<e&&l<s.length)return rc(s,++l);r=s}else{if(e<0&&0<l&&(f=Es(s,l-1),Vl(f)))return!zl(f)&&(o=Uc(f,e,jl,f))?Fl(o)?rc(o,o.data.length):rc.after(o):Fl(f)?rc(f,f.data.length):rc.before(f);if(0<e&&l<s.childNodes.length&&(f=Es(s,l),Vl(f)))return Hl(f)?(a=n,(c=(u=f).nextSibling)&&Vl(c)?Fl(c)?rc(c,0):rc.before(c):Ul(ts.Forwards,rc.after(u),a)):!zl(f)&&(o=Uc(f,e,jl,f))?Fl(o)?rc(o,0):rc.before(o):Fl(f)?rc(f,0):rc.after(f);r=f||i.getNode()}if((0<e&&i.isAtEnd()||e<0&&i.isAtStart())&&(r=Uc(r,e,M,n,!0),jl(r,n)))return As(e,r);var f=Uc(r,e,jl,n),d=pe(V(function(e,t){for(var n=[];e&&e!==t;)n.push(e),e=e.parentNode;return n}(s,n),Il));return!d||f&&d.contains(f)?f?As(e,f):null:0<e?rc.after(d):rc.before(d)},Wl=function(e,t,n){var r=Ds(t);return ve.from(e?r.next(n):r.prev(n))},$l=function(e,t,n,r){return zs(e,t,n).bind((function(n){return r(n)?$l(e,t,n,r):ve.some(n)}))},ql=T(Wl,!0),Gl=T(Wl,!1),Kl=T(Bs,!0),Xl=T(Bs,!1),Yl="_mce_caret",Jl=function(e,t,n){return 2===t?pc(wo,n,e):3===t?(o=(r=e).getRng(),{start:cc(r.dom.getRoot(),rc.fromRangeStart(o)),end:cc(r.dom.getRoot(),rc.fromRangeEnd(o))}):t?{rng:e.getRng()}:vc(e,!1);var r,o},Zl=(vo,function(e){return" "===e}),Ql=function(e,t){return void 0===t&&(t=!1),!(!u(e)||!Vn(e))&&jr(t?e.data.replace(/ /g," "):e.data)},ef=$s,tf=ol,nf=Ql,rf=Js,of=function(e,t,n,r){var o=n.parentNode;return!u(n[r])&&(!(o!==t&&!a(o)&&!e.isBlock(o))||of(e,t,o,r))},af=function(e){return Ft(e).fold(f([e]),(function(t){return[e].concat(af(t))}))},uf=function(e){return Lt(e).fold(f([e]),(function(t){return"br"===Ot(t)?Rt(t).map((function(t){return[e].concat(uf(t))})).getOr([]):[e].concat(uf(t))}))},cf=(Bl=On,{get:function(e){if(!Bl(e))throw new Error("Can only get text value of a text node");return Pl(e).getOr("")},getOption:Pl=function(e){return Bl(e)?ve.from(e.dom.nodeValue):ve.none()},set:function(e,t){if(!Bl(e))throw new Error("Can only set raw text value of a text node");e.dom.nodeValue=t}});function sf(e,t){for(;t&&t!==e;){if(Gn(t)||Kn(t))return t;t=t.parentNode}return null}function lf(e,t,n){if(!n.collapsed){if(xt.browser.isIE()&&n.startOffset===n.endOffset-1&&n.startContainer===n.endContainer){var r=n.startContainer.childNodes[n.startOffset];if(Ln(r))return P(r.getClientRects(),(function(n){return Eu(n,e,t)}))}return P(n.getClientRects(),(function(n){return Eu(n,e,t)}))}}function ff(e,t,n){return e.fire(t,n)}function df(e,t,n,r){return e.fire("FormatApply",{format:t,node:n,vars:r})}function mf(e,t,n,r){return e.fire("FormatRemove",{format:t,node:n,vars:r})}function gf(e,t){function n(e){return e&&("IMG"===e.nodeName||t.dom.is(e,"figure.image"))}function r(e){return Yn(e)||D.hasClass(e,"mce-preview-object")}function o(e){var r=e.target;!function(e,t){if("longpress"!==e.type&&0!==e.type.indexOf("touch"))return n(e.target)&&!lf(e.clientX,e.clientY,t);var r=e.touches[0];return n(e.target)&&!lf(r.clientX,r.clientY,t)}(e,t.selection.getRng())||e.isDefaultPrevented()||t.selection.select(r)}function i(e){return D.is(e,"figure.image")?[e.querySelector("img")]:D.hasClass(e,"mce-preview-object")&&u(e.firstElementChild)?[e,e.firstElementChild]:[e]}function a(e){var n=Ec(t);return!!n&&"false"!==e.getAttribute("data-mce-resize")&&e!==t.getBody()&&(D.hasClass(e,"mce-preview-object")?He(Tt.fromDom(e.firstElementChild),n):He(Tt.fromDom(e),n))}function c(e,n,r){u(r)&&F(i(e),(function(e){e.style[n]||!t.schema.isValid(e.nodeName.toLowerCase(),n)?D.setStyle(e,n,r):D.setAttrib(e,n,""+r)}))}function s(e,t,n){c(e,"width",t),c(e,"height",n)}function l(e){var o,i,a,u,c,l,f=e.screenX-y,d=e.screenY-w;T=f*v[2]+x,O=d*v[3]+C,T=T<5?5:T,O=O<5?5:O,((n(g)||r(g))&&!1!==t.getParam("resize_img_proportional",!0,"boolean")?!_f.modifierPressed(e):_f.modifierPressed(e))&&(z(f)>z(d)?(O=B(T*S),T=B(O/S)):(T=B(O/S),O=B(T*S))),s(p,T,O),o=v.startPos.x+f,i=v.startPos.y+d,D.setStyles(h,{left:o=0<o?o:0,top:i=0<i?i:0,display:"block"}),h.innerHTML=T+" &times; "+O,v[2]<0&&p.clientWidth<=T&&D.setStyle(p,"left",void 0+(x-T)),v[3]<0&&p.clientHeight<=O&&D.setStyle(p,"top",void 0+(C-O)),(f=P.scrollWidth-_)+(d=P.scrollHeight-E)!=0&&D.setStyles(h,{left:o-f,top:i-d}),k||(a=g,u=x,c=C,l="corner-"+v.name,t.fire("ObjectResizeStart",{target:a,width:u,height:c,origin:l}),k=!0)}function f(n){function r(e,t){if(e)do{if(e===t)return 1}while(e=e.parentNode)}var o;k||t.removed||(M(D.select("img[data-mce-selected],hr[data-mce-selected]"),(function(e){e.removeAttribute(A)})),o="mousedown"===n.type?n.target:e.getNode(),r(o=D.$(o).closest("table,img,figure.image,hr,video,span.mce-preview-object")[0],P)&&(m(),r(e.getStart(!0),o)&&r(e.getEnd(!0),o))?H(o):V())}function d(e){return Ef(sf(t.getBody(),e))}function m(){try{t.getDoc().execCommand("enableObjectResizing",!1,"false")}catch(e){}}var g,p,h,v,b,y,w,x,C,S,k,T,O,_,E,A="data-mce-selected",D=t.dom,M=kt.each,N=t.getDoc(),R=document,z=Math.abs,B=Math.round,P=t.getBody(),I={nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]},L=function(){var e,n,r,o,i=k;k=!1,i&&(c(g,"width",T),c(g,"height",O)),D.unbind(N,"mousemove",l),D.unbind(N,"mouseup",L),R!==N&&(D.unbind(R,"mousemove",l),D.unbind(R,"mouseup",L)),D.remove(p),D.remove(h),D.remove(b),H(g),i&&(e=g,n=T,r=O,o="corner-"+v.name,t.fire("ObjectResized",{target:e,width:n,height:r,origin:o}),D.setAttrib(g,"style",D.getAttrib(g,"style"))),t.nodeChanged()},H=function(e){j();var n=D.getPos(e,P),o=n.x,u=n.y,c=e.getBoundingClientRect(),f=c.width||c.right-c.left,d=c.height||c.bottom-c.top;g!==e&&(V(),g=e,T=O=0);var m=t.fire("ObjectSelected",{target:e}),k=D.getAttrib(g,A,"1");a(e)&&!m.isDefaultPrevented()?M(I,(function(e,t){var n=D.get("mceResizeHandle"+t);n&&D.remove(n),n=D.add(P,"div",{id:"mceResizeHandle"+t,"data-mce-bogus":"all",class:"mce-resizehandle",unselectable:!0,style:"cursor:"+t+"-resize; margin:0; padding:0"}),11===xt.ie&&(n.contentEditable=!1),D.bind(n,"mousedown",(function(n){var a,c,m;n.stopImmediatePropagation(),n.preventDefault(),a=n,m=i(g)[0],y=a.screenX,w=a.screenY,x=m.clientWidth,C=m.clientHeight,S=C/x,(v=e).name=t,v.startPos={x:f*e[0]+o,y:d*e[1]+u},_=P.scrollWidth,E=P.scrollHeight,b=D.add(P,"div",{class:"mce-resize-backdrop","data-mce-bogus":"all"}),D.setStyles(b,{position:"fixed",left:"0",top:"0",width:"100%",height:"100%"}),p=r(c=g)?D.create("img",{src:xt.transparentSrc}):c.cloneNode(!0),D.addClass(p,"mce-clonedresizable"),D.setAttrib(p,"data-mce-bogus","all"),p.contentEditable="false",D.setStyles(p,{left:o,top:u,margin:0}),s(p,f,d),p.removeAttribute(A),P.appendChild(p),D.bind(N,"mousemove",l),D.bind(N,"mouseup",L),R!==N&&(D.bind(R,"mousemove",l),D.bind(R,"mouseup",L)),h=D.add(P,"div",{class:"mce-resize-helper","data-mce-bogus":"all"},x+" &times; "+C)})),e.elm=n,D.setStyles(n,{left:f*e[0]+o-n.offsetWidth/2,top:d*e[1]+u-n.offsetHeight/2})})):V(),D.getAttrib(g,A)||g.setAttribute(A,k)},V=function(){j(),g&&g.removeAttribute(A),ne(I,(function(e,t){var n=D.get("mceResizeHandle"+t);n&&(D.unbind(n),D.remove(n))}))},j=function(){ne(I,(function(e){e.elm&&(D.unbind(e.elm),delete e.elm)}))};return t.on("init",(function(){var e;m(),(xt.browser.isIE()||xt.browser.isEdge())&&(t.on("mousedown click",(function(e){var n=e.target,r=n.nodeName;k||!/^(TABLE|IMG|HR)$/.test(r)||d(n)||(2!==e.button&&t.selection.select(n,"TABLE"===r),"mousedown"===e.type&&t.nodeChanged())})),D.bind(P,"mscontrolselect",e=function(e){function n(e){Tr.setEditorTimeout(t,(function(){return t.selection.select(e)}))}if(d(e.target)||Yn(e.target))return e.preventDefault(),void n(e.target);/^(TABLE|IMG|HR)$/.test(e.target.nodeName)&&(e.preventDefault(),"IMG"===e.target.tagName&&n(e.target))}),t.on("remove",(function(){return D.unbind(P,"mscontrolselect",e)})));var n=Tr.throttle((function(e){t.composing||f(e)}));t.on("nodechange ResizeEditor ResizeWindow ResizeContent drop FullscreenStateChanged",n),t.on("keyup compositionend",(function(e){g&&"TABLE"===g.nodeName&&n(e)})),t.on("hide blur",V),t.on("contextmenu longpress",o,!0)})),t.on("remove",j),{isResizable:a,showResizeRect:H,hideResizeRect:V,updateResizeRect:f,destroy:function(){g=p=b=null}}}function pf(e){return Gn(e)||Kn(e)}function hf(e,t,n){var r,o,i,a,u,c=n;if(c.caretPositionFromPoint)(o=c.caretPositionFromPoint(e,t))&&((r=n.createRange()).setStart(o.offsetNode,o.offset),r.collapse(!0));else if(c.caretRangeFromPoint)r=c.caretRangeFromPoint(e,t);else if(c.body.createTextRange){r=c.body.createTextRange();try{r.moveToPoint(e,t),r.collapse(!0)}catch(o){r=function(e,t,n){var r,o=n.elementFromPoint(e,t),i=n.body.createTextRange();if(o&&"HTML"!==o.tagName||(o=n.body),i.moveToElementText(o),0<(r=(r=kt.toArray(i.getClientRects())).sort((function(e,n){return(e=Math.abs(Math.max(e.top-t,e.bottom-t)))-Math.abs(Math.max(n.top-t,n.bottom-t))}))).length){t=(r[0].bottom+r[0].top)/2;try{return i.moveToPoint(e,t),i.collapse(!0),i}catch(e){}}return null}(e,t,n)}return i=r,a=n.body,u=i&&i.parentElement?i.parentElement():null,Kn(function(e,t,n){for(;e&&e!==t;){if(n(e))return e;e=e.parentNode}return null}(u,a,pf))?null:i}return r}function vf(e,t){return e&&t&&e.startContainer===t.startContainer&&e.startOffset===t.startOffset&&e.endContainer===t.endContainer&&e.endOffset===t.endOffset}function bf(e,t,n){return null!==function(e,t,n){for(;e&&e!==t;){if(n(e))return e;e=e.parentNode}return null}(e,t,n)}function yf(e){return e&&"TABLE"===e.nodeName}function wf(e,t,n){for(var r=new _r(t,e.getParent(t.parentNode,e.isBlock)||e.getRoot());t=r[n?"prev":"next"]();)if($n(t))return 1}function xf(e,t,n,r,o){var i,a,u=e.getRoot(),c=e.schema.getNonEmptyElements(),s=e.getParent(o.parentNode,e.isBlock)||u;if(r&&$n(o)&&t&&e.isEmpty(s))return ve.some(rc(o.parentNode,e.nodeIndex(o)));for(var l,f,d=new _r(o,s);a=d[r?"prev":"next"]();){if("false"===e.getContentEditableParent(a)||(f=u,zr(l=a)&&!1===bf(l,f,Ps)))return ve.none();if(Vn(a)&&0<a.nodeValue.length)return!1===bf(a,u,(function(e){return"A"===e.nodeName}))?ve.some(rc(a,r?a.nodeValue.length:0)):ve.none();if(e.isBlock(a)||c[a.nodeName.toLowerCase()])return ve.none();i=a}return n&&i?ve.some(rc(i,0)):ve.none()}function Cf(e,t,n,r){var o,i=e.getRoot(),a=!1,u=r[(n?"start":"end")+"Container"],c=r[(n?"start":"end")+"Offset"],s=Ln(u)&&c===u.childNodes.length,l=e.schema.getNonEmptyElements(),f=n;if(zr(u))return ve.none();if(Ln(u)&&c>u.childNodes.length-1&&(f=!1),Un(u)&&(u=i,c=0),u===i){if(f&&(d=u.childNodes[0<c?c-1:0])){if(zr(d))return ve.none();if(l[d.nodeName]||yf(d))return ve.none()}if(u.hasChildNodes()){if(c=Math.min(!f&&0<c?c-1:c,u.childNodes.length-1),u=u.childNodes[c],c=Vn(u)&&s?u.data.length:0,!t&&u===i.lastChild&&yf(u))return ve.none();if(function(e,t){for(;t&&t!==e;){if(Kn(t))return 1;t=t.parentNode}}(i,u)||zr(u))return ve.none();if(u.hasChildNodes()&&!1===yf(u)){var d=u,m=new _r(u,i);do{if(Kn(d)||zr(d)){a=!1;break}if(Vn(d)&&0<d.nodeValue.length){c=f?0:d.nodeValue.length,u=d,a=!0;break}if(l[d.nodeName.toLowerCase()]&&(!(o=d)||!/^(TD|TH|CAPTION)$/.test(o.nodeName))){c=e.nodeIndex(d),u=d.parentNode,f||c++,a=!0;break}}while(d=f?m.next():m.prev())}}}return t&&(Vn(u)&&0===c&&xf(e,s,t,!0,u).each((function(e){u=e.container(),c=e.offset(),a=!0})),Ln(u)&&(!(d=(d=u.childNodes[c])||u.childNodes[c-1])||!$n(d)||d.previousSibling&&"A"===d.previousSibling.nodeName||wf(e,d,!1)||wf(e,d,!0)||xf(e,s,t,!0,d).each((function(e){u=e.container(),c=e.offset(),a=!0})))),f&&!t&&Vn(u)&&c===u.nodeValue.length&&xf(e,s,t,!1,u).each((function(e){u=e.container(),c=e.offset(),a=!0})),a?ve.some(rc(u,c)):ve.none()}function Sf(e,t){var n=t.collapsed,r=t.cloneRange(),o=rc.fromRangeStart(t);return Cf(e,n,!0,r).each((function(e){n&&rc.isAbove(o,e)||r.setStart(e.container(),e.offset())})),n||Cf(e,n,!1,r).each((function(e){r.setEnd(e.container(),e.offset())})),n&&r.collapse(!0),vf(t,r)?ve.none():ve.some(r)}function kf(e,t){return e.splitText(t)}function Tf(e){var t=e.startContainer,n=e.startOffset,r=e.endContainer,o=e.endOffset;return t===r&&Vn(t)?0<n&&n<t.nodeValue.length&&(t=(r=kf(t,n)).previousSibling,n<o?(t=r=kf(r,o-=n).previousSibling,o=r.nodeValue.length,n=0):o=0):(Vn(t)&&0<n&&n<t.nodeValue.length&&(t=kf(t,n),n=0),Vn(r)&&0<o&&o<r.nodeValue.length&&(o=(r=kf(r,o).previousSibling).nodeValue.length)),{startContainer:t,startOffset:n,endContainer:r,endOffset:o}}function Of(e){return{walk:function(t,n){return wl(e,t,n)},split:Tf,normalize:function(t){return Sf(e,t).fold(D,(function(e){return t.setStart(e.startContainer,e.startOffset),t.setEnd(e.endContainer,e.endOffset),!0}))}}}Rl.isBookmarkNode=$s;var _f={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(e){return e.shiftKey||e.ctrlKey||e.altKey||_f.metaKeyPressed(e)},metaKeyPressed:function(e){return xt.mac?e.metaKey:e.ctrlKey&&!e.altKey}},Ef=Kn;Of.compareRanges=vf,Of.getCaretRangeFromPoint=hf,Of.getSelectedNode=Au,Of.getNode=Du;var Af,Df,Mf=(Af="height",Df=function(e){var t=e.dom;return Bn(e)?t.getBoundingClientRect().height:t.offsetHeight},{set:function(e,t){if(!k(t)&&!t.match(/^[0-9]+$/))throw new Error(Af+".set accepts only positive integer values. Value was "+t);var n=e.dom;mn(n)&&(n.style[Af]=t+"px")},get:Nf,getOuter:Nf,aggregate:Rf,max:function(e,t,n){var r=Rf(e,n);return r<t?t-r:0}});function Nf(e){var t=Df(e);if(t<=0||null===t){var n=wn(e,Af);return parseFloat(n)||0}return t}function Rf(e,t){return U(t,(function(t,n){var r=wn(e,n),o=void 0===r?0:parseInt(r,10);return isNaN(o)?t:t+o}),0)}function zf(e){return"textarea"===Ot(e)}function Bf(e,t){var n=function(e){var t=e.dom.ownerDocument,n=t.body,r=t.defaultView,o=t.documentElement;if(n===e.dom)return In(n.offsetLeft,n.offsetTop);var i=Yt(null==r?void 0:r.pageYOffset,o.scrollTop),a=Yt(null==r?void 0:r.pageXOffset,o.scrollLeft),u=Yt(o.clientTop,n.clientTop),c=Yt(o.clientLeft,n.clientLeft);return Fn(e).translate(a-c,i-u)}(e),r=Mf.get(e);return{element:e,bottom:n.top+r,height:r,pos:n,cleanup:t}}function Pf(e,t,n,r){Cd(e,(function(o,i){return xd(e,t,n,r)}),n)}function If(e,t,n,r,o){var i={elm:r.element.dom,alignToTop:o};e.fire("ScrollIntoView",i).isDefaultPrevented()||(n(t,Jt(t).top,r,o),e.fire("AfterScrollIntoView",i))}function Ff(e,t,n,r){var o=Tt.fromDom(e.getDoc());If(e,o,n,Bf(Tt.fromDom(t),c),r)}function Lf(e,t,n,r){var o,i=e.pos;n?Zt(i.left,i.top,r):(o=i.top-t+e.height,Zt(i.left,o,r))}function Hf(e,t,n,r,o){var i=n+t,a=r.pos.top,u=r.bottom,c=n<=u-a;a<t?Lf(r,n,!1!==o,e):i<a?Lf(r,n,c?!1!==o:!0===o,e):i<u&&!c&&Lf(r,n,!0===o,e)}function Vf(e,t,n,r){Hf(e,t,e.dom.defaultView.innerHeight,n,r)}function jf(e,t,n,r){Hf(e,t,e.dom.defaultView.innerHeight,n,r);var o,i,a,u,c,s,l,f=(o=n.element,u=Jt(Tt.fromDom(document)),a=(i=wd).owner(o),c=yd(i,a),s=Fn(o),l=j(c,(function(e,t){var n=Fn(t);return{left:e.left+n.left,top:e.top+n.top}}),{left:0,top:0}),In(l.left+s.left+u.left,l.top+s.top+u.top)),d=tn(window);f.top<d.y?Qt(n.element,!1!==r):f.top>d.bottom&&Qt(n.element,!0===r)}function Uf(e,t,n){return Pf(e,Vf,t,n)}function Wf(e,t,n){return Ff(e,t,Vf,n)}function $f(e,t,n){return Pf(e,jf,t,n)}function qf(e,t,n){return Ff(e,t,jf,n)}function Gf(e,t,n){(e.inline?Uf:$f)(e,t,n)}function Kf(e){var t=Nn(e).dom;return e.dom===t.activeElement}function Xf(e){return void 0===e&&(e=Tt.fromDom(document)),ve.from(e.dom.activeElement).map(Tt.fromDom)}function Yf(e,t){var n=On(t)?Dl(t).length:An(t).length+1;return n<e?n:e<0?0:e}function Jf(e){return Od.range(e.start,Yf(e.soffset,e.start),e.finish,Yf(e.foffset,e.finish))}function Zf(e,t){return!rn(t.dom)&&(Ue(e,t)||je(e,t))}function Qf(e){return function(t){return Zf(e,t.start)&&Zf(e,t.finish)}}function ed(e){return!0===e.inline||_d.isIE()}function td(e){return Od.range(Tt.fromDom(e.startContainer),e.startOffset,Tt.fromDom(e.endContainer),e.endOffset)}function nd(e){var t=document.createRange();try{return t.setStart(e.start.dom,e.soffset),t.setEnd(e.finish.dom,e.foffset),ve.some(t)}catch(e){return ve.none()}}function rd(e){var t,n,r=ed(e)?((n=Mt(t=Tt.fromDom(e.getBody())).dom.getSelection())&&0!==n.rangeCount?ve.from(n.getRangeAt(0)):ve.none()).map(td).filter(Qf(t)):ve.none();e.bookmark=r.isSome()?r:e.bookmark}function od(e){return(e.bookmark||ve.none()).bind((function(t){return n=Tt.fromDom(e.getBody()),ve.from(t).filter(Qf(n)).map(Jf);var n})).bind(nd)}function id(e,t){var n=e.getParam("custom_ui_selector","","string");return null!==Ad.getParent(t,(function(t){return Ed.isEditorUIElement(t)||!!n&&e.dom.is(t,n)}))}function ad(e,t){var n=t.editor;(function(e){var t=cu((function(){rd(e)}),0);e.on("init",(function(){function n(){o.throttle()}var r,o,i,a,u,c;e.inline&&(r=e,o=t,Xa.DOM.bind(document,"mouseup",n),r.on("remove",(function(){Xa.DOM.unbind(document,"mouseup",n)}))),i=e,a=t,dt().browser.isIE()?(c=i).on("focusout",(function(){rd(c)})):(u=a,i.on("mouseup touchend",(function(e){u.throttle()}))),i.on("keyup NodeChange",(function(e){"nodechange"===e.type&&e.selectionChange||rd(i)}))})),e.on("remove",(function(){t.cancel()}))})(n),n.on("focusin",(function(){var t=e.focusedEditor;t!==n&&(t&&t.fire("blur",{focusedEditor:n}),e.setActive(n),(e.focusedEditor=n).fire("focus",{blurredEditor:t}),n.focus(!0))})),n.on("focusout",(function(){Tr.setEditorTimeout(n,(function(){var t=e.focusedEditor;id(n,function(e){try{return Xf(Nn(Tt.fromDom(e.getElement()))).fold((function(){return document.body}),(function(e){return e.dom}))}catch(e){return document.body}}(n))||t!==n||(n.fire("blur",{focusedEditor:null}),e.focusedEditor=null)}))})),bd||(bd=function(t){var n=e.activeEditor;n&&function(e){if(Mn()&&u(e.target)){var t=Tt.fromDom(e.target);if(Tn(t)&&u(t.dom.shadowRoot)&&e.composed&&e.composedPath){var n=e.composedPath();if(n)return Q(n)}}return ve.from(e.target)}(t).each((function(t){t.ownerDocument===document&&(t===document.body||id(n,t)||e.focusedEditor!==n||(n.fire("blur",{focusedEditor:null}),e.focusedEditor=null))}))},Ad.bind(document,"focusin",bd))}function ud(e,t){e.focusedEditor===t.editor&&(e.focusedEditor=null),e.activeEditor||(Ad.unbind(document,"focusin",bd),bd=null)}function cd(e,t){var n,r;n=Tt.fromDom(e.getBody()),((r=t).collapsed?ve.from(Du(r.startContainer,r.startOffset)).map(Tt.fromDom):ve.none()).bind((function(e){return mo(e)?ve.some(e):!1===Ue(n,e)?ve.some(n):ve.none()})).bind((function(e){return Kl(e.dom)})).fold((function(){e.selection.normalize()}),(function(t){return e.selection.setRng(t.toRange())}))}function sd(e){if(e.setActive)try{e.setActive()}catch(t){e.focus()}else e.focus()}function ld(e){return e.inline?(r=e.getBody())&&(Kf(t=Tt.fromDom(r))||Xf(Nn(n=t)).filter((function(e){return n.dom.contains(e.dom)})).isSome()):e.iframeElement&&Kf(Tt.fromDom(e.iframeElement));var t,n,r}function fd(e,t,n,r,o){var i=n?t.startContainer:t.endContainer,a=n?t.startOffset:t.endOffset;return ve.from(i).map(Tt.fromDom).map((function(e){return r&&t.collapsed?e:It(e,o(e,a)).getOr(e)})).bind((function(e){return Tn(e)?ve.some(e):Nt(e).filter(Tn)})).map((function(e){return e.dom})).getOr(e)}function dd(e,t,n){return fd(e,t,!0,n,(function(e,t){return Math.min(Ht(e),t)}))}function md(e,t,n){return fd(e,t,!1,n,(function(e,t){return 0<t?t-1:t}))}function gd(e,t){for(var n=e;e&&Vn(e)&&0===e.length;)e=t?e.nextSibling:e.previousSibling;return e||n}function pd(e,t){return I(t,(function(t){var n=e.fire("GetSelectionRange",{range:t});return n.range!==t?n.range:t}))}function hd(e,t,n){var r=n?"lastChild":"firstChild",o=n?"prev":"next";if(e[r])return e[r];if(e!==t){var i=e[o];if(i)return i;for(var a=e.parent;a&&a!==t;a=a.parent)if(i=a[o])return i}}function vd(e){var t="a"===e.name&&!e.attr("href")&&e.attr("id");return e.attr("name")||e.attr("id")&&!e.firstChild||e.attr("data-mce-bookmark")||t}var bd,yd=function(e,t){return e.view(t).fold(f([]),(function(t){var n=e.owner(t),r=yd(e,n);return[t].concat(r)}))},wd=Object.freeze({__proto__:null,view:function(e){var t;return(e.dom===document?ve.none():ve.from(null===(t=e.dom.defaultView)||void 0===t?void 0:t.frameElement)).map(Tt.fromDom)},owner:Dt}),xd=function(e,t,n,r){var o=Tt.fromDom(e.getBody()),i=Tt.fromDom(e.getDoc());o.dom.offsetWidth;var a,u,c=(a=function(e,t){var n=An(e);if(0===n.length||zf(e))return{element:e,offset:t};if(t<n.length&&!zf(n[t]))return{element:n[t],offset:0};var r=n[n.length-1];return zf(r)?{element:e,offset:t}:"img"===Ot(r)?{element:r,offset:1}:On(r)?{element:r,offset:Dl(r).length}:{element:r,offset:An(r).length}}(Tt.fromDom(n.startContainer),n.startOffset),u=Tt.fromHtml('<span data-mce-bogus="all" style="display: inline-block;">\ufeff</span>'),Wt(a.element,u),Bf(u,(function(){return zn(u)})));If(e,i,t,c,r),c.cleanup()},Cd=function(e,t,n){var r=n.startContainer,o=n.startOffset,i=n.endContainer,a=n.endOffset;t(Tt.fromDom(r),Tt.fromDom(i));var u=e.dom.createRng();u.setStart(r,o),u.setEnd(i,a),e.selection.setRng(n)},Sd=rr([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),kd=(Sd.before,Sd.on,Sd.after,function(e){return e.fold(d,d,d)}),Td=rr([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Od={domRange:Td.domRange,relative:Td.relative,exact:Td.exact,exactFromRange:function(e){return Td.exact(e.start,e.soffset,e.finish,e.foffset)},getWin:function(e){return Mt(e.match({domRange:function(e){return Tt.fromDom(e.startContainer)},relative:function(e,t){return kd(e)},exact:function(e,t,n,r){return e}}))},range:function(e,t,n,r){return{start:e,soffset:t,finish:n,foffset:r}}},_d=dt().browser,Ed={isEditorUIElement:function(e){var t=e.className.toString();return-1!==t.indexOf("tox-")||-1!==t.indexOf("mce-")}},Ad=Xa.DOM,Dd=function(e){return e.editorManager.setActive(e)},Md={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11},Nd=(Rd.create=function(e,t){var n=new Rd(e,Md[e]||1);return t&&ne(t,(function(e,t){n.attr(t,e)})),n},Rd.prototype.replace=function(e){return e.parent&&e.remove(),this.insert(e,this),this.remove(),this},Rd.prototype.attr=function(e,t){var n,r=this;if("string"!=typeof e)return null!=e&&ne(e,(function(e,t){r.attr(t,e)})),r;if(n=r.attributes){if(void 0===t)return n.map[e];if(null===t){if(e in n.map){delete n.map[e];for(var o=n.length;o--;)if(n[o].name===e)return n.splice(o,1),r}return r}if(e in n.map){for(o=n.length;o--;)if(n[o].name===e){n[o].value=t;break}}else n.push({name:e,value:t});return n.map[e]=t,r}},Rd.prototype.clone=function(){var e,t=new Rd(this.name,this.type);if(e=this.attributes){var n=[];n.map={};for(var r=0,o=e.length;r<o;r++){var i=e[r];"id"!==i.name&&(n[n.length]={name:i.name,value:i.value},n.map[i.name]=i.value)}t.attributes=n}return t.value=this.value,t.shortEnded=this.shortEnded,t},Rd.prototype.wrap=function(e){return this.parent.insert(e,this),e.append(this),this},Rd.prototype.unwrap=function(){for(var e=this.firstChild;e;){var t=e.next;this.insert(e,this,!0),e=t}this.remove()},Rd.prototype.remove=function(){var e=this.parent,t=this.next,n=this.prev;return e&&(e.firstChild===this?(e.firstChild=t)&&(t.prev=null):n.next=t,e.lastChild===this?(e.lastChild=n)&&(n.next=null):t.prev=n,this.parent=this.next=this.prev=null),this},Rd.prototype.append=function(e){e.parent&&e.remove();var t=this.lastChild;return t?((t.next=e).prev=t,this.lastChild=e):this.lastChild=this.firstChild=e,e.parent=this,e},Rd.prototype.insert=function(e,t,n){e.parent&&e.remove();var r=t.parent||this;return n?(t===r.firstChild?r.firstChild=e:t.prev.next=e,e.prev=t.prev,(e.next=t).prev=e):(t===r.lastChild?r.lastChild=e:t.next.prev=e,e.next=t.next,(e.prev=t).next=e),e.parent=r,e},Rd.prototype.getAll=function(e){for(var t=[],n=this.firstChild;n;n=hd(n,this))n.name===e&&t.push(n);return t},Rd.prototype.children=function(){for(var e=[],t=this.firstChild;t;t=t.next)e.push(t);return e},Rd.prototype.empty=function(){if(this.firstChild){for(var e=[],t=this.firstChild;t;t=hd(t,this))e.push(t);for(var n=e.length;n--;)(t=e[n]).parent=t.firstChild=t.lastChild=t.next=t.prev=null}return this.firstChild=this.lastChild=null,this},Rd.prototype.isEmpty=function(e,t,n){void 0===t&&(t={});var r=this.firstChild;if(vd(this))return!1;if(r)do{if(1===r.type){if(r.attr("data-mce-bogus"))continue;if(e[r.name])return!1;if(vd(r))return!1}if(8===r.type)return!1;if(3===r.type&&!function(e){if(jr(e.value)){var t=e.parent;return!t||"span"===t.name&&!t.attr("style")||!/^[ ]+$/.test(e.value)}}(r))return!1;if(3===r.type&&r.parent&&t[r.parent.name]&&jr(r.value))return!1;if(n&&n(r))return!1}while(r=hd(r,this));return!0},Rd.prototype.walk=function(e){return hd(this,null,e)},Rd);function Rd(e,t){this.name=e,1===(this.type=t)&&(this.attributes=[],this.attributes.map={})}function zd(e,t){return e.replace(t.re,(function(e){return ue(t.uris,e).getOr(e)}))}var Bd=kt.each,Pd=kt.trim,Id="source protocol authority userInfo user password host port relative path directory file query anchor".split(" "),Fd={ftp:21,http:80,https:443,mailto:25},Ld=["img","video"],Hd=(Vd.parseDataUri=function(e){var t,n=decodeURIComponent(e).split(","),r=/data:([^;]+)/.exec(n[0]);return{type:t=r?r[1]:t,data:n[1]}},Vd.isDomSafe=function(e,t,n){if((n=void 0===n?{}:n).allow_script_urls)return!0;var r,o,i,a,c=Ko.decode(e).replace(/[\s\u0000-\u001F]+/g,"");try{c=decodeURIComponent(c)}catch(e){c=unescape(c)}return!(/((java|vb)script|mhtml):/i.test(c)||(o=c,i=t,!(r=n).allow_html_data_urls&&(/^data:image\//i.test(o)?(u(a=r.allow_svg_data_urls)?!a:!u(i)||!B(Ld,i))&&/^data:image\/svg\+xml/i.test(o):/^data:/i.test(o))))},Vd.getDocumentBaseUrl=function(e){var t=0!==e.protocol.indexOf("http")&&"file:"!==e.protocol?e.href:e.protocol+"//"+e.host+e.pathname;return/^[^:]+:\/\/\/?[^\/]+\//.test(t)&&(t=t.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(t)||(t+="/")),t},Vd.prototype.setPath=function(e){var t=/^(.*?)\/?(\w+)?$/.exec(e);this.path=t[0],this.directory=t[1],this.file=t[2],this.source="",this.getURI()},Vd.prototype.toRelative=function(e){var t;if("./"===e)return e;var n=new Vd(e,{base_uri:this});if("mce_host"!==n.host&&this.host!==n.host&&n.host||this.port!==n.port||this.protocol!==n.protocol&&""!==n.protocol)return n.getURI();var r=this.getURI(),o=n.getURI();return r===o||"/"===r.charAt(r.length-1)&&r.substr(0,r.length-1)===o?r:(t=this.toRelPath(this.path,n.path),n.query&&(t+="?"+n.query),n.anchor&&(t+="#"+n.anchor),t)},Vd.prototype.toAbsolute=function(e,t){var n=new Vd(e,{base_uri:this});return n.getURI(t&&this.isSameOrigin(n))},Vd.prototype.isSameOrigin=function(e){if(this.host==e.host&&this.protocol==e.protocol){if(this.port==e.port)return!0;var t=Fd[this.protocol];if(t&&(this.port||t)==(e.port||t))return!0}return!1},Vd.prototype.toRelPath=function(e,t){var n,r,o=0,i="",a=e.substring(0,e.lastIndexOf("/")).split("/"),u=t.split("/");if(a.length>=u.length)for(n=0,r=a.length;n<r;n++)if(n>=u.length||a[n]!==u[n]){o=n+1;break}if(a.length<u.length)for(n=0,r=u.length;n<r;n++)if(n>=a.length||a[n]!==u[n]){o=n+1;break}if(1===o)return t;for(n=0,r=a.length-(o-1);n<r;n++)i+="../";for(n=o-1,r=u.length;n<r;n++)i+=n!==o-1?"/"+u[n]:u[n];return i},Vd.prototype.toAbsPath=function(e,t){var n,r,o=0,i=[],a=/\/$/.test(t)?"/":"",u=e.split("/"),c=t.split("/");for(Bd(u,(function(e){e&&i.push(e)})),u=i,n=c.length-1,i=[];0<=n;n--)0!==c[n].length&&"."!==c[n]&&(".."!==c[n]?0<o?o--:i.push(c[n]):o++);return 0!==(r=(n=u.length-o)<=0?X(i).join("/"):u.slice(0,n).join("/")+"/"+X(i).join("/")).indexOf("/")&&(r="/"+r),a&&r.lastIndexOf("/")!==r.length-1&&(r+=a),r},Vd.prototype.getURI=function(e){var t;return void 0===e&&(e=!1),this.source&&!e||(t="",e||(this.protocol?t+=this.protocol+"://":t+="//",this.userInfo&&(t+=this.userInfo+"@"),this.host&&(t+=this.host),this.port&&(t+=":"+this.port)),this.path&&(t+=this.path),this.query&&(t+="?"+this.query),this.anchor&&(t+="#"+this.anchor),this.source=t),this.source},Vd);function Vd(e,t){e=Pd(e),this.settings=t||{};var n,r,o,i,a=this.settings.base_uri,u=this;/^([\w\-]+):([^\/]{2})/i.test(e)||/^\s*#/.test(e)?u.source=e:(n=0===e.indexOf("//"),0!==e.indexOf("/")||n||(e=(a&&a.protocol||"http")+"://mce_host"+e),/^[\w\-]*:?\/\//.test(e)||(r=this.settings.base_uri?this.settings.base_uri.path:new Vd(document.location.href).directory,e=this.settings.base_uri&&""==this.settings.base_uri.protocol?"//mce_host"+u.toAbsPath(r,e):(o=/([^#?]*)([#?]?.*)/.exec(e),(a&&a.protocol||"http")+"://mce_host"+u.toAbsPath(r,o[1])+o[2])),e=e.replace(/@@/g,"(mce_at)"),i=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?(\[[a-zA-Z0-9:.%]+\]|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e),Bd(Id,(function(e,t){var n=(n=i[t])&&n.replace(/\(mce_at\)/g,"@@");u[e]=n})),a&&(u.protocol||(u.protocol=a.protocol),u.userInfo||(u.userInfo=a.userInfo),u.port||"mce_host"!==u.host||(u.port=a.port),u.host&&"mce_host"!==u.host||(u.host=a.host),u.source=""),n&&(u.protocol=""))}function jd(e,t,n){for(var r=/<([!?\/])?([A-Za-z0-9\-_:.]+)/g,o=/(?:\s(?:[^'">]+(?:"[^"]*"|'[^']*'))*[^"'>]*(?:"[^">]*|'[^'>]*)?|\s*|\/)>/g,i=e.getShortEndedElements(),a=1,u=n;0!==a;)for(r.lastIndex=u;;){var c=r.exec(t);if(null===c)return u;if("!"===c[1]){u=Ye(c[2],"--")?$d(t,!1,c.index+"!--".length):$d(t,!0,c.index+1);break}o.lastIndex=r.lastIndex;var s=o.exec(t);if(!w(s)&&s.index===r.lastIndex){"/"===c[1]?--a:Te(i,c[2])||(a+=1),u=r.lastIndex+s[0].length;break}}return u}function Ud(e,t){var n;void 0===t&&(t=Qr());var r=null!==(n=(e=e||{}).document)&&void 0!==n?n:document,o=r.createElement("form");!1!==e.fix_self_closing&&(e.fix_self_closing=!0);var i=e.comment||c,a=e.cdata||c,u=e.text||c,s=e.start||c,l=e.end||c,f=e.pi||c,d=e.doctype||c;return{parse:function(n,c){void 0===c&&(c="html"),function(n,c){void 0===c&&(c="html");for(var m,g,p,h,v,b,y,w,x,C,S,k,T,O,_,E,A,D,M,N=n.html,R=0,z=[],B=0,P=Ko.decode,I=kt.makeMap("src,href,data,background,action,formaction,poster,xlink:href"),F="html"===c?0:1,L=function(e){for(var t,n=z.length;n--&&z[n].name!==e;);if(0<=n){for(t=z.length-1;n<=t;t--)(e=z[t]).valid&&l(e.name);z.length=n}},H=function(e,t){return u(zd(e,n),t)},V=function(t){""!==t&&(">"===t.charAt(0)&&(t=" "+t),e.allow_conditional_comments||"[if"!==t.substr(0,3).toLowerCase()||(t=" "+t),i(zd(t,n)))},j=function(e,t){var n=e||"",r=!Ye(n,"--"),o=$d(N,r,t);return e=N.substr(t,o-t),V(r?n+e:e),o+1},U=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"),W=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g,$=t.getShortEndedElements(),q=e.self_closing_elements||t.getSelfClosingElements(),G=t.getBoolAttrs(),K=e.validate,X=e.remove_internals,Y=e.fix_self_closing,J=t.getSpecialElements(),Z=N+">";m=U.exec(Z);){var Q=m[0];if(R<m.index&&H(P(N.substr(R,m.index-R))),g=m[7])L(g=":"===(g=g.toLowerCase()).charAt(0)?g.substr(1):g);else if(g=m[8]){if(m.index+Q.length>N.length){H(P(N.substr(m.index))),R=m.index+Q.length;continue}x=(g=":"===(g=g.toLowerCase()).charAt(0)?g.substr(1):g)in $,Y&&q[g]&&0<z.length&&z[z.length-1].name===g&&L(g);var ee=function(e,t){var n=e.exec(t);if(n){var r=n[1],o=n[2];return"string"==typeof r&&"data-mce-bogus"===r.toLowerCase()?o:null}return null}(W,m[9]);if(null!==ee){if("all"===ee){R=jd(t,N,U.lastIndex),U.lastIndex=R;continue}S=!1}if(!K||(C=t.getElementRule(g))){if(S=!0,K&&(O=C.attributes,_=C.attributePatterns),(T=m[9])?((w=-1!==T.indexOf("data-mce-type"))&&X&&(S=!1),(h=[]).map={},T.replace(W,(function(t,i,a,u,c){return function(t,i,a,u,c){var s;if(a=zd((i=i.toLowerCase())in G?i:P(a||u||c||""),n),K&&!w&&0==(0===(s=i).indexOf("data-")||0===s.indexOf("aria-"))){var l=O[i];if(!l&&_){for(var f=_.length;f--&&!(l=_[f]).pattern.test(i););-1===f&&(l=null)}if(!l)return;if(l.validValues&&!(a in l.validValues))return}("name"===i||"id"===i)&&t in Wd&&(a in r||a in o)||I[i]&&!Hd.isDomSafe(a,t,e)||w&&(i in I||0===i.indexOf("on"))||(h.map[i]=a,h.push({name:i,value:a}))}(g,i,a,u,c),""}))):(h=[]).map={},K&&!w){if(E=C.attributesRequired,A=C.attributesDefault,D=C.attributesForced,C.removeEmptyAttrs&&!h.length&&(S=!1),D)for(v=D.length;v--;)y=(k=D[v]).name,"{$uid}"===(M=k.value)&&(M="mce_"+B++),h.map[y]=M,h.push({name:y,value:M});if(A)for(v=A.length;v--;)(y=(k=A[v]).name)in h.map||("{$uid}"===(M=k.value)&&(M="mce_"+B++),h.map[y]=M,h.push({name:y,value:M}));if(E){for(v=E.length;v--&&!(E[v]in h.map););-1===v&&(S=!1)}if(k=h.map["data-mce-bogus"]){if("all"===k){R=jd(t,N,U.lastIndex),U.lastIndex=R;continue}S=!1}}S&&s(g,h,x)}else S=!1;if(p=J[g]){p.lastIndex=R=m.index+Q.length,R=(m=p.exec(N))?(S&&(b=N.substr(R,m.index-R)),m.index+m[0].length):(b=N.substr(R),N.length),S&&(0<b.length&&H(b,!0),l(g)),U.lastIndex=R;continue}x||(T&&T.indexOf("/")===T.length-1?S&&l(g):z.push({name:g,valid:S}))}else if(g=m[1])V(g);else if(g=m[2]){if(!(1==F||e.preserve_cdata||0<z.length&&t.isValidChild(z[z.length-1].name,"#cdata"))){R=j("",m.index+2),U.lastIndex=R;continue}a(g)}else if(g=m[3])d(g);else{if((g=m[4])||"<!"===Q){R=j(g,m.index+Q.length),U.lastIndex=R;continue}if(g=m[5]){if(1!=F){R=j("?",m.index+2),U.lastIndex=R;continue}f(g,m[6])}}R=m.index+Q.length}for(R<N.length&&H(P(N.substr(R))),v=z.length-1;0<=v;v--)(g=z[v]).valid&&l(g.name)}(function(e){for(var t,n=/data:[^;]+;base64,([a-z0-9\+\/=\s]+)/gi,r=[],o={},i=hu("img"),a=0,u=0;t=n.exec(e);){var c=t[0],s=i+"_"+u++;o[s]=c,a<t.index&&r.push(e.substr(a,t.index-a)),r.push(s),a=t.index+c.length}var l=new RegExp(i+"_[0-9]+","g");return 0===a?{prefix:i,uris:o,html:e,re:l}:(a<e.length&&r.push(e.substr(a)),{prefix:i,uris:o,html:r.join(""),re:l})}(n),c)}}}var Wd=kt.makeMap("button,fieldset,form,iframe,img,image,input,object,output,select,textarea"),$d=function(e,t,n){void 0===n&&(n=0);var r=e.toLowerCase();if(-1!==r.indexOf("[if ",n)&&(u=n,/^\s*\[if [\w\W]+\]>.*<!\[endif\](--!?)?>/.test(r.substr(u)))){var o=r.indexOf("[endif]",n);return r.indexOf(">",o)}if(t){var i=r.indexOf(">",n);return-1!==i?i:r.length}var a=/--!?>/g;a.lastIndex=n;var u,c=a.exec(e);return c?c.index+c[0].length:r.length};function qd(e,t){for(var n,r,o,i,a=/<(\w+) [^>]*data-mce-bogus="all"[^>]*>/g,u=e.schema,c=(n=e.getTempAttrs(),r=t,o=new RegExp(["\\s?("+n.join("|")+')="[^"]+"'].join("|"),"gi"),r.replace(o,"")),s=u.getShortEndedElements();i=a.exec(c);){var l=a.lastIndex,f=i[0].length,d=s[i[1]]?l:Ud.findEndTag(u,c,l);c=c.substring(0,l-f)+c.substring(d);a.lastIndex=l-f}return wo(c)}function Gd(e){return{compare:function(t,n){return t.nodeName===n.nodeName&&!(!o(r(t),r(n))||!o(e.parseStyle(e.getAttrib(t,"style")),e.parseStyle(e.getAttrib(n,"style")))||$s(t)||$s(n));function r(t){var n={};return Jd(e.getAttribs(t),(function(r){var o=r.nodeName.toLowerCase();0!==o.indexOf("_")&&"style"!==o&&0!==o.indexOf("data-")&&(n[o]=e.getAttrib(t,o))})),n}function o(e,t){var n,r;for(r in e)if(Te(e,r)){if(void 0===(n=t[r]))return;if(e[r]!==n)return;delete t[r]}for(r in t)if(Te(t,r))return;return 1}}}}function Kd(e){var t=[],n=(e=e||{}).indent,r=Zd(e.indent_before||""),o=Zd(e.indent_after||""),i=Ko.getEncodeFunc(e.entity_encoding||"raw",e.entities),a="html"===e.element_format;return{start:function(e,u,c){var s,l,f,d;if(n&&r[e]&&0<t.length&&0<(d=t[t.length-1]).length&&"\n"!==d&&t.push("\n"),t.push("<",e),u)for(s=0,l=u.length;s<l;s++)f=u[s],t.push(" ",f.name,'="',i(f.value,!0),'"');t[t.length]=!c||a?">":" />",c&&n&&o[e]&&0<t.length&&0<(d=t[t.length-1]).length&&"\n"!==d&&t.push("\n")},end:function(e){var r;t.push("</",e,">"),n&&o[e]&&0<t.length&&0<(r=t[t.length-1]).length&&"\n"!==r&&t.push("\n")},text:function(e,n){0<e.length&&(t[t.length]=n?e:i(e))},cdata:function(e){t.push("<![CDATA[",e,"]]>")},comment:function(e){t.push("\x3c!--",e,"--\x3e")},pi:function(e,r){r?t.push("<?",e," ",i(r),"?>"):t.push("<?",e,"?>"),n&&t.push("\n")},doctype:function(e){t.push("<!DOCTYPE",e,">",n?"\n":"")},reset:function(){t.length=0},getContent:function(){return t.join("").replace(/\n$/,"")}}}function Xd(e,t){void 0===t&&(t=Qr());var n=Kd(e);return(e=e||{}).validate=!("validate"in e)||e.validate,{serialize:function(r){var o=e.validate,i={3:function(e){n.text(e.value,e.raw)},8:function(e){n.comment(e.value)},7:function(e){n.pi(e.name,e.value)},10:function(e){n.doctype(e.value)},4:function(e){n.cdata(e.value)},11:function(e){if(e=e.firstChild)for(;a(e),e=e.next;);}};n.reset();var a=function(e){var r=i[e.type];if(r)r(e);else{var u=e.name,c=e.shortEnded,s=e.attributes;if(o&&s&&1<s.length){var l=[];l.map={};var f=t.getElementRule(e.name);if(f){for(var d=0,m=f.attributesOrder.length;d<m;d++)(g=f.attributesOrder[d])in s.map&&(p=s.map[g],l.map[g]=p,l.push({name:g,value:p}));var g,p;for(d=0,m=s.length;d<m;d++)(g=s[d].name)in l.map||(p=s.map[g],l.map[g]=p,l.push({name:g,value:p}));s=l}}if(n.start(e.name,s,c),!c){if(e=e.firstChild)for(;a(e),e=e.next;);n.end(u)}}};return 1!==r.type||e.inner?i[11](r):a(r),n.getContent()}}}Ud.findEndTag=jd;var Yd=qd,Jd=kt.each,Zd=kt.makeMap,Qd=new Set;function em(e,t){return Ce(e.parseStyle(e.getAttrib(t,"style")))}function tm(e,t,n){return ve.from(n.container()).filter(Vn).exists((function(r){var o=e?0:-1;return t(r.data.charAt(n.offset()+o))}))}function nm(e){var t=e.container();return Vn(t)&&(0===t.data.length||yo(t.data)&&Rl.isBookmarkNode(t.parentNode))}function rm(e,t){return function(n){return ve.from(qc(e?0:-1,n)).filter(t).isSome()}}function om(e){return qn(e)&&"block"===wn(Tt.fromDom(e),"display")}function im(e){return Kn(e)&&!(Ln(t=e)&&"all"===t.getAttribute("data-mce-bogus"));var t}function am(e){Kt(e),Rn(e,Tt.fromHtml('<br data-mce-bogus="1">'))}function um(e){Lt(e).each((function(t){Rt(t).each((function(n){co(e)&&Mr(t)&&co(n)&&zn(t)}))}))}function cm(e,t){return o=D,Ue(r=t,n=e)?function(e,t){for(var n=S(t)?t:D,r=e.dom,o=[];null!==r.parentNode&&void 0!==r.parentNode;){var i=r.parentNode,a=Tt.fromDom(i);if(o.push(a),!0===n(a))break;r=i}return o}(n,(function(e){return o(e)||je(e,r)})).slice(0,-1):[];var n,r,o}function sm(e,t){return[e].concat(cm(e,t))}function lm(e,t,n){return $l(e,t,n,nm)}function fm(e,t){return $(sm(Tt.fromDom(t.container()),e),co)}function dm(e,t,n){return lm(e,t.dom,n).forall((function(e){return fm(t,n).fold((function(){return!1===$c(e,n,t.dom)}),(function(r){return!1===$c(e,n,t.dom)&&Ue(r,Tt.fromDom(e.container()))}))}))}function mm(e,t,n){return fm(t,n).fold((function(){return lm(e,t.dom,n).forall((function(e){return!1===$c(e,n,t.dom)}))}),(function(t){return lm(e,t.dom,n).isNone()}))}function gm(e){return Zc(e).exists(Mr)}function pm(e,t,n){var r=Q(V(sm(Tt.fromDom(n.container()),t),co)).getOr(t);return Wl(e,r.dom,n).filter(gm)}function hm(e,t){return Zc(t).exists(Mr)||pm(!0,e,t).isSome()}function vm(e,t){return ve.from(t.getNode(!0)).map(Tt.fromDom).exists(Mr)||pm(!1,e,t).isSome()}function bm(e){return rc.isTextPosition(e)&&!e.isAtStart()&&!e.isAtEnd()}function ym(e,t){return Q(V(sm(Tt.fromDom(t.container()),e),co)).getOr(e)}function wm(e,t){return bm(t)?Rg(t):Rg(t)||Gl(ym(e,t).dom,t).exists(Rg)}function xm(e,t){return bm(t)?Ng(t):Ng(t)||ql(ym(e,t).dom,t).exists(Ng)}function Cm(e){return Zc(e).bind((function(e){return gr(e,Tn)})).exists((function(e){return B(["pre","pre-wrap"],wn(e,"white-space"))}))}function Sm(e,t){return!Cm(t)&&(jg(e,t)||Wg(e,t)||vm(e,t)||wm(e,t))}function km(e,t){return!Cm(t)&&(Ug(e,t)||$g(e,t)||hm(e,t)||xm(e,t))}function Tm(e,t){return Sm(e,t)||km(e,(r=(n=t).container(),o=n.offset(),Vn(r)&&o<r.data.length?rc(r,o+1):n));var n,r,o}function Om(e,t){return Zl(e.charAt(t))}function _m(e){var t=e.container();return Vn(t)&&Me(t.data,vo)}function Em(e){var t=Tt.fromDom(e.getBody());e.selection.isCollapsed()&&function(e,t){return ve.some(t).filter(_m).bind((function(t){var n,r,o,i,a,u,c,s,l,f=t.container(),d=e,m=(a=f).data,g=rc(a,0);return(!Om(m,0)||Tm(d,g)?(s=(u=f).data,(l=I(c=s.split(""),(function(e,t){return Zl(e)&&0<t&&t<c.length-1&&Gs(c[t-1])&&Gs(c[t+1])?" ":e})).join(""))!==s&&(u.data=l,1)):(a.data=" "+m.slice(1),1))||(n=e,o=(r=f).data,i=rc(r,o.length-1),Om(o,o.length-1)&&!Tm(n,i)&&(r.data=o.slice(0,-1)+" ",1))?ve.some(t):ve.none()}))}(t,rc.fromRangeStart(e.selection.getRng())).each((function(t){e.selection.setRng(t.toRange())}))}function Am(e,t,n){var r,o,i,a,u,c,s,l;0!==n&&(o=mr(r=Tt.fromDom(e),co).getOr(r),i=e.data.slice(t,t+n),a=t+n>=e.data.length&&km(o,rc(e,e.data.length)),u=0===t&&Sm(o,rc(e,0)),e.replaceData(t,n,(s=u,l=a,U(c=i,(function(e,t){return qs(t)||Zl(t)?e.previousCharIsSpace||""===e.str&&s||e.str.length===c.length-1&&l?{previousCharIsSpace:!1,str:e.str+vo}:{previousCharIsSpace:!0,str:e.str+" "}:{previousCharIsSpace:!1,str:e.str+t}}),{previousCharIsSpace:!1,str:""}).str)))}function Dm(e,t){var n=e.data.slice(t);Am(e,t,n.length-Ze(n).length)}function Mm(e,t){var n=e.data.slice(0,t),r=n.length-Qe(n).length;Am(e,t-r,r)}function Nm(e,t,n,r){void 0===r&&(r=!0);var o=Qe(e.data).length,i=r?e:t,a=r?t:e;return r?i.appendData(a.data):i.insertData(0,a.data),zn(Tt.fromDom(a)),n&&Dm(i,o),i}function Rm(e,t){return r=e,o=(n=t).container(),i=n.offset(),!1===rc.isTextPosition(n)&&o===r.parentNode&&i>rc.before(r).offset()?rc(t.container(),t.offset()-1):t;var n,r,o,i}function zm(e){return Hr(e.previousSibling)?ve.some((t=e.previousSibling,Vn(t)?rc(t,t.data.length):rc.after(t))):e.previousSibling?Xl(e.previousSibling):ve.none();var t}function Bm(e){return Hr(e.nextSibling)?ve.some((t=e.nextSibling,Vn(t)?rc(t,0):rc.before(t))):e.nextSibling?Kl(e.nextSibling):ve.none();var t}function Pm(e,t){return zm(t).orThunk((function(){return Bm(t)})).orThunk((function(){return n=e,o=rc.before((r=t).previousSibling||r.parentNode),Gl(n,o).fold((function(){return ql(n,rc.after(r))}),ve.some);var n,r,o}))}function Im(e,t){return Bm(t).orThunk((function(){return zm(t)})).orThunk((function(){return ql(n=e,rc.after(r=t)).fold((function(){return Gl(n,rc.before(r))}),ve.some);var n,r}))}function Fm(e,t,n){n.fold((function(){e.focus()}),(function(n){e.selection.setRng(n.toRange(),t)}))}function Lm(e,t){return t&&Te(e.schema.getBlockElements(),Ot(t))}function Hm(e){if(Wr(e)){var t=Tt.fromHtml('<br data-mce-bogus="1">');return Kt(e),Rn(e,t),ve.some(rc.before(t.dom))}return ve.none()}function Vm(e,t,n,r){void 0===r&&(r=!0);var o,i,a,u,c,s,l,f,d,m,g,p,h=(t?Im:Pm)(e.getBody(),p=n.dom).map(T(Rm,p)),v=mr(n,T(Lm,e),(o=e.getBody(),function(e){return e.dom===o})),b=(u=h,i=a=n,c=Te(e.schema.getTextInlineElements(),Ot(i)),m=Rt(a).filter(On),g=zt(a).filter(On),zn(a),l=g,f=u,d=function(e,t,n){var r=e.dom,o=t.dom,i=r.data.length;return Nm(r,o,c),n.container()===o?rc(r,i):n},((s=m).isSome()&&l.isSome()&&f.isSome()?ve.some(d(s.getOrDie(),l.getOrDie(),f.getOrDie())):ve.none()).orThunk((function(){return c&&(m.each((function(e){return Mm(e.dom,e.dom.length)})),g.each((function(e){return Dm(e.dom,0)}))),u})));e.dom.isEmpty(e.getBody())?(e.setContent(""),e.selection.setCursorLocation()):v.bind(Hm).fold((function(){r&&Fm(e,t,b)}),(function(n){r&&Fm(e,t,ve.some(n))}))}function jm(e){return gu(e,"td,th")}function Um(e,t){return{start:e,end:t}}function Wm(e,t){return vr(Tt.fromDom(e),"td,th",t)}function $m(e){return!je(e.start,e.end)}function qm(e,t){return kl(e.start,t).bind((function(n){return kl(e.end,t).bind((function(e){return je(n,e)?ve.some(n):ve.none()}))}))}function Gm(e){return function(t){return qm(t,e).map((function(e){return{rng:t,table:e,cells:jm(e)}}))}}function Km(e,t,n,r){if(n.collapsed||!e.forall($m))return ve.none();if(t.isSameTable){var o=e.bind(Gm(r));return ve.some({start:o,end:o})}var i,a,u=Wm(n.startContainer,r),c=Wm(n.endContainer,r),s=u.bind((a=r,function(e){return kl(e,a).bind((function(t){return ee(jm(t)).map((function(t){return Um(e,t)}))}))})).bind(Gm(r)),l=c.bind((i=r,function(e){return kl(e,i).bind((function(t){return Q(jm(t)).map((function(t){return Um(t,e)}))}))})).bind(Gm(r));return ve.some({start:s,end:l})}function Xm(e,t){return q(e,(function(e){return je(e,t)}))}function Ym(e){return dn(Xm(e.cells,e.rng.start),Xm(e.cells,e.rng.end),(function(t,n){return e.cells.slice(t,n+1)}))}function Jm(e,t){var n=t.startTable,r=t.endTable,o=e.cloneRange();return n.each((function(e){return o.setStartAfter(e.dom)})),r.each((function(e){return o.setEndBefore(e.dom)})),o}function Zm(e){return F(e,(function(e){yn(e,"contenteditable"),am(e)})),0}function Qm(e,t,n,r){var o=n.cloneRange();r?(o.setStart(n.startContainer,n.startOffset),o.setEndAfter(t.dom.lastChild)):(o.setStartBefore(t.dom.firstChild),o.setEnd(n.endContainer,n.endOffset)),Yg(e,o,t,!1)}function eg(e){var t=Sl(e),n=Tt.fromDom(e.selection.getNode());Xn(n.dom)&&Wr(n)?e.selection.setCursorLocation(n.dom,0):e.selection.collapse(!0),1<t.length&&P(t,(function(e){return je(e,n)}))&&pn(n,"data-mce-selected","1")}function tg(e,t,n){var r=e.selection.getRng();return Zm(n.bind((function(n){var o,i,a,u=n.rng,c=n.isStartInTable,s=(o=c?u.endContainer:u.startContainer,ve.from(e.dom.getParent(o,e.dom.isBlock)).map(Tt.fromDom));u.deleteContents(),i=e,a=c,s.filter(Wr).each((function(e){a?zn(e):(am(e),i.selection.setCursorLocation(e.dom,0))}));var l=c?t[0]:t[t.length-1];return Qm(e,l,r,c),Wr(l)?ve.none():ve.some(c?t.slice(1):t.slice(0,-1))})).getOr(t)),eg(e),!0}function ng(e,t,n,r){var o=e.selection.getRng(),i=t[0],a=n[n.length-1];Qm(e,i,o,!0),Qm(e,a,o,!1);var u=Wr(i)?t:t.slice(1),c=Wr(a)?n:n.slice(0,-1);return Zm(u.concat(c)),r.deleteContents(),eg(e),!0}function rg(e,t){return Vm(e,!1,t),!0}function og(e,t){return $(sm(t,e),go)}function ig(e,t){return(e?Fg:Lg)(t)}function ag(e,t){var n,r,o,i,a,u,c,s,l=Tt.fromDom(e.selection.getStart(!0)),f=Sl(e);return e.selection.isCollapsed()&&0===f.length?function(e,t,n){var r=Tt.fromDom(e.getBody());return Jg(r,n).fold((function(){return o=e,i=t,a=r,u=n,c=rc.fromRangeStart(o.selection.getRng()),og(a,u).bind((function(e){return Wr(e)?Zg(o,e):(t=a,n=e,r=c,zs(i,o.getBody(),r).bind((function(e){return og(t,Tt.fromDom(e.getNode())).map((function(e){return!1===je(e,n)}))})));var t,n,r})).getOr(!1)||(l=t,f=rc.fromRangeStart((s=e).selection.getRng()),ig(l,f)||Wl(l,s.getBody(),f).exists((function(e){return ig(l,e)})));var o,i,a,u,c,s,l,f}),(function(n){return l=t,f=r,d=n,m=rc.fromRangeStart((s=e).selection.getRng()),(Wr(d)?Zg(s,d):(i=f,u=d,c=m,zs(a=l,(o=s).getBody(),c).bind((function(e){return r=a,s=c,l=e,Kl((n=u).dom).bind((function(e){return Xl(n.dom).map((function(t){return r?s.isEqual(e)&&l.isEqual(t):s.isEqual(t)&&l.isEqual(e)}))})).getOr(!0)?Zg(o,u):(t=u,Jg(i,Tt.fromDom(e.getNode())).map((function(e){return!1===je(e,t)})));var t,n,r,s,l})).or(ve.some(!0)))).getOr(!1);var o,i,a,u,c,s,l,f,d,m}))}(e,t,l):(r=l,o=f,i=Tt.fromDom((n=e).getBody()),a=n.selection.getRng(),0!==o.length?tg(n,o,ve.none()):(u=n,s=a,Jg(c=i,r).fold((function(){return e=u,function(e,t){var n,r,o,i,a,u,c,s,l,f,d,m,g,p,h,v,b=(n=e,function(e){return je(n,e)}),y=dn(Wm((r=t).startContainer,o=b),Wm(r.endContainer,o),Um),w=(l=b,f=x((s=t).startContainer),d=x(s.endContainer),m=f.isSome(),g=d.isSome(),{startTable:f,endTable:d,isStartInTable:m,isEndInTable:g,isSameTable:p=dn(f,d,je).getOr(!1),isMultiTable:!p&&m&&g});function x(e){return kl(Tt.fromDom(e),l)}return h=t,v=b,y.exists((function(e){return!$m(t=e)&&qm(t,v).exists((function(e){var t=e.dom.rows;return 1===t.length&&1===t[0].cells.length}))&&Tl(e.start,h);var t}))?y.map((function(e){return Kg.singleCellTable(t,e.start)})):w.isMultiTable?Km(y,u=w,c=t,b).bind((function(e){var t=e.start,n=e.end,r=t.bind(Ym).getOr([]),o=n.bind(Ym).getOr([]);if(0<r.length&&0<o.length){var i=Jm(c,u);return ve.some(Kg.multiTable(r,o,i))}return ve.none()})):Km(y,i=w,a=t,b).bind((function(e){var t=e.start,n=e.end;return t.or(n)})).bind((function(e){var t=i.isSameTable,n=Ym(e).getOr([]);if(t&&e.cells.length===n.length)return ve.some(Kg.fullTable(e.table));if(0<n.length){if(t)return ve.some(Kg.partialTable(n,ve.none()));var r=Jm(a,i);return ve.some(Kg.partialTable(n,ve.some(_e(_e({},i),{rng:r}))))}return ve.none()}))}(c,s).map((function(t){return t.fold(T(Yg,e),T(rg,e),T(tg,e),T(ng,e))}));var e}),(function(e){return Zg(u,e)})).getOr(!1)))}function ug(e){return e.collapsed?e:(t=e,n=rc.fromRangeStart(t),r=rc.fromRangeEnd(t),o=t.commonAncestorContainer,Wl(!1,o,r).map((function(e){return!$c(n,r,o)&&$c(n,e,o)?(i=n.container(),a=n.offset(),u=e.container(),c=e.offset(),(s=document.createRange()).setStart(i,a),s.setEnd(u,c),s):t;var i,a,u,c,s})).getOr(t));var t,n,r,o}function cg(e,t){var n=e.getParent(t,e.isBlock);return n&&"LI"===n.nodeName?n:null}function sg(e,t){var n=rc.after(e),r=Ds(t).prev(n);return r?r.toRange():null}function lg(e,t,n,r){function o(e){var r=rc.fromRangeStart(n),o=Ds(t.getRoot()),i=1===e?o.prev(r):o.next(r);return!i||cg(t,i.getNode())!==A}var i,a,u,c,s,l,f,d,m,g,p,h,v,b,y,w,x,C,S,k,T,O,_,E=(i=t,s=e.serialize(r),u=(a=i.createFragment(s)).firstChild,c=a.lastChild,u&&"META"===u.nodeName&&u.parentNode.removeChild(u),c&&"mce_marker"===c.id&&c.parentNode.removeChild(c),a),A=cg(t,n.startContainer),D=function(e){return 0<e.length&&(!(r=e[e.length-1]).firstChild||(t=r)&&t.firstChild&&t.firstChild===t.lastChild&&((n=t.firstChild).data===vo||$n(n)))?e.slice(0,-1):e;var t,n,r}(V(E.firstChild.childNodes,(function(e){return"LI"===e.nodeName}))),M=t.getRoot();return o(1)?(S=M,_=(C=A).parentNode,kt.each(D,(function(e){_.insertBefore(e,C)})),k=S,T=rc.before(C),(O=Ds(k).next(T))?O.toRange():null):o(2)?(l=A,d=M,t.insertAfter((f=D).reverse(),l),sg(f[0],d)):(g=D,p=M,h=m=A,b=(v=n).cloneRange(),y=v.cloneRange(),b.setStartBefore(h),y.setEndAfter(h),w=[b.cloneContents(),y.cloneContents()],(x=m.parentNode).insertBefore(w[0],m),kt.each(g,(function(e){x.insertBefore(e,m)})),x.insertBefore(w[1],m),x.removeChild(m),sg(g[g.length-1],p))}function fg(e,t,n){var r,o,i,a,c=e.selection,s=e.dom;/^ | $/.test(t)&&(r=s,o=c.getRng(),i=t,i=Sm(a=Tt.fromDom(r.getRoot()),rc.fromRangeStart(o))?i.replace(/^ /,"&nbsp;"):i.replace(/^&nbsp;/," "),t=i=km(a,rc.fromRangeEnd(o))?i.replace(/(&nbsp;| )(<br( \/)>)?$/,"&nbsp;"):i.replace(/&nbsp;(<br( \/)?>)?$/," "));var l=e.parser,f=n.merge,d=Xd({validate:e.getParam("validate")},e.schema),m='<span id="mce_marker" data-mce-type="bookmark">&#xFEFF;</span>',g=e.fire("BeforeSetContent",{content:t,format:"html",selection:!0,paste:n.paste});if(g.isDefaultPrevented())e.fire("SetContent",{content:g.content,format:"html",selection:!0,paste:n.paste});else{-1===(t=g.content).indexOf("{$caret}")&&(t+="{$caret}"),t=t.replace(/\{\$caret\}/,m);var p,h,v=(p=c.getRng()).startContainer||(p.parentElement?p.parentElement():null),b=e.getBody();v===b&&c.isCollapsed()&&s.isBlock(b.firstChild)&&(h=b.firstChild)&&!e.schema.getShortEndedElements()[h.nodeName]&&s.isEmpty(b.firstChild)&&((p=s.createRng()).setStart(b.firstChild,0),p.setEnd(b.firstChild,0),c.setRng(p)),c.isCollapsed()||function(e){var t=e.dom,n=ug(e.selection.getRng());e.selection.setRng(n);var r,o=t.getParent(n.startContainer,Qg),i=n;null!==(r=o)&&r===t.getParent(i.endContainer,Qg)&&Tl(Tt.fromDom(r),i)?Yg(e,n,Tt.fromDom(o)):e.getDoc().execCommand("Delete",!1,null)}(e);var y,w,x,C,S,k,T,O,_,E,A,D,M,N,R={context:(F=c.getNode()).nodeName.toLowerCase(),data:n.data,insert:!0},z=l.parse(t,R);if(!0===n.paste&&function(e,t){var n,r,o,i,a,u=t.firstChild,c=t.lastChild;return u&&"meta"===u.name&&(u=u.next),r=c=c&&"mce_marker"===c.attr("id")?c.prev:c,o=(n=e).getNonEmptyElements(),r&&(r.isEmpty(o)||(i=r,n.getBlockElements()[i.name]&&i.firstChild&&i.firstChild===i.lastChild&&("br"===(a=i.firstChild).name||a.value===vo)))&&(c=c.prev),u&&u===c&&("ul"===u.name||"ol"===u.name)}(e.schema,z)&&cg(s,F))return p=lg(d,s,c.getRng(),z),c.setRng(p),void e.fire("SetContent",g);if(function(){for(var e=z;e=e.walk();)1===e.type&&e.attr("data-mce-fragment","1")}(),"mce_marker"===(I=z.lastChild).attr("id"))for(var B=I,I=I.prev;I;I=I.walk(!0))if(3===I.type||!s.isBlock(I.name)){e.schema.isValidChild(I.parent.name,"span")&&I.parent.insert(B,I,"br"===I.name);break}if(e._selectionOverrides.showBlockCaretContainer(F),R.invalid){e.selection.setContent(m);var F=c.getNode(),L=e.getBody();for(9===F.nodeType?F=I=L:I=F;I!==L;)I=(F=I).parentNode;t=F===L?L.innerHTML:s.getOuterHTML(F),t=d.serialize(l.parse(t.replace(/<span (id="mce_marker"|id=mce_marker).+?<\/span>/i,(function(){return d.serialize(z)})))),F===L?s.setHTML(L,t):s.setOuterHTML(F,t)}else y=e,w=t=d.serialize(z),"all"===(x=F).getAttribute("data-mce-bogus")?x.parentNode.insertBefore(y.dom.createFragment(w),x):(C=x.firstChild,S=x.lastChild,!C||C===S&&"BR"===C.nodeName?y.dom.setHTML(x,w):y.selection.setContent(w));T=f,E=(k=e).schema.getTextInlineElements(),A=k.dom,T&&(O=k.getBody(),_=Gd(A),kt.each(A.select("*[data-mce-fragment]"),(function(e){if(u(E[e.nodeName.toLowerCase()])&&K(em(A,e),(function(e){return!Qd.has(e)})))for(var t=e.parentNode;u(t)&&t!==O&&!function(e,t,n){function r(r){var o=e.getStyle(t,r),i=e.getStyle(n,r);return Re(o)&&Re(i)&&o!==i}var o=em(e,t),i=em(e,n);return P(o,(function(e){function t(t){return P(t,(function(t){return t===e}))}if(t(i)||!t(Mg))return r(e);var n=V(i,(function(e){return P(Mg,(function(t){return Ye(e,t)}))}));return P(n,r)}))}(A,e,t);t=t.parentNode)if(_.compare(t,e)){A.remove(e,!0);break}}))),function(e,t){var n,r=e.dom,o=e.selection;if(t){o.scrollIntoView(t);var i=sf(e.getBody(),t);if("false"===r.getContentEditable(i))return r.remove(t),o.select(i);var a,u=r.createRng(),c=t.previousSibling;Vn(c)?(u.setStart(c,c.nodeValue.length),xt.ie||(a=t.nextSibling,Vn(a)&&(c.appendData(a.data),a.parentNode.removeChild(a)))):(u.setStartBefore(t),u.setEndBefore(t));var s=r.getParent(t,r.isBlock);r.remove(t),s&&r.isEmpty(s)&&(e.$(s).empty(),u.setStart(s,0),u.setEnd(s,0),Qg(s)||s.getAttribute("data-mce-fragment")||!(n=function(t){var n=rc.fromRangeStart(t);if(n=Ds(e.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)}}(e,s.get("mce_marker")),D=e.getBody(),kt.each(D.getElementsByTagName("*"),(function(e){e.removeAttribute("data-mce-fragment")})),M=s,N=c.getStart(),ve.from(M.getParent(N,"td,th")).map(Tt.fromDom).each(um),e.fire("SetContent",g),e.addVisual()}}function dg(e){return e instanceof Nd}function mg(e,t,n){var r;e.dom.setHTML(e.getBody(),t),!0!==n&&ld(r=e)&&Kl(r.getBody()).each((function(e){var t=e.getNode(),n=sn(t)?Kl(t).getOr(e):e;r.selection.setRng(n.toRange())}))}function gg(e){return S(e)?e:D}function pg(e,t,n){var r=t(e),o=gg(n);return r.orThunk((function(){return o(e)?ve.none():function(t){for(var n=e.dom,r=gg(o);n.parentNode;){n=n.parentNode;var i=Tt.fromDom(n),a=t(i);if(a.isSome())return a;if(r(i))break}return ve.none()}(t)}))}function hg(e,t,n){var r=e.formatter.get(n);if(r)for(var o=0;o<r.length;o++){var i=r[o];if(ul(i)&&!1===i.inherit&&e.dom.is(t,i.selector))return 1}}function vg(e,t,n,r,o){var i=e.dom.getRoot();return t!==i&&(t=e.dom.getParent(t,(function(t){return!!hg(e,t,n)||t.parentNode===i||!!np(e,t,n,r,!0)})),!!np(e,t,n,r,o))}function bg(e,t,n){return!!tp(t,n.inline)||!!tp(t,n.block)||(n.selector?1===t.nodeType&&e.is(t,n.selector):void 0)}function yg(e,t,n,r,o,i){var u=n[r];if(S(n.onmatch))return n.onmatch(t,n,r);if(u)if(C(u.length)){for(var c in u)if(Te(u,c)){var s="attributes"===r?e.getAttrib(t,c):nl(e,t,c),l=Qs(u[c],i),f=a(s)||ze(s);if(!f||!a(l)){if(o&&f&&!n.exact)return;if((!o||n.exact)&&!tp(s,tl(e,l,c)))return}}}else for(var d=0;d<u.length;d++)if("attributes"===r?e.getAttrib(t,u[d]):nl(e,t,u[d]))return 1;return 1}function wg(e,t,n,r,o){if(r)return vg(e,r,t,n,o);if(r=e.selection.getNode(),vg(e,r,t,n,o))return!0;var i=e.selection.getStart();return!(i===r||!vg(e,i,t,n,o))}function xg(e){return 0<function(e){for(var t=[];e;){if(3===e.nodeType&&e.nodeValue!==rp||1<e.childNodes.length)return[];1===e.nodeType&&t.push(e),e=e.firstChild}return t}(e).length}function Cg(e){if(e){var t=new _r(e,e);for(e=t.current();e;e=t.next())if(Vn(e))return e}return null}function Sg(e){var t=Tt.fromTag("span");return hn(t,{id:op,"data-mce-bogus":"1","data-mce-type":"format-caret"}),e&&Rn(t,Tt.fromText(rp)),t}function kg(e,t,n){void 0===n&&(n=!0);var r,o,i,a,u,c,s,l,f=e.dom,d=e.selection;xg(t)?Vm(e,!1,Tt.fromDom(t),n):(r=d.getRng(),o=f.getParent(t,f.isBlock),i=r.startContainer,a=r.startOffset,u=r.endContainer,c=r.endOffset,(l=Cg(t))&&l.nodeValue.charAt(0)===rp&&l.deleteData(0,1),s=l,f.remove(t,!0),i===s&&0<a&&r.setStart(s,a-1),u===s&&0<c&&r.setEnd(s,c-1),o&&f.isEmpty(o)&&am(Tt.fromDom(o)),d.setRng(r))}function Tg(e,t,n){void 0===n&&(n=!0);var r=e.dom,o=e.selection;if(t)kg(e,t,n);else if(!(t=Is(e.getBody(),o.getStart())))for(;t=r.get(op);)kg(e,t,!1)}function Og(e,t){return e.appendChild(t),t}function _g(e,t){var n=j(e,(function(e,t){return Og(e,t.cloneNode(!1))}),t);return Og(n,n.ownerDocument.createTextNode(rp))}function Eg(e,t,r,o,i,a){var u,c,s=e.formatter,l=e.dom,f=V(Ce(s.get()),(function(e){return e!==o&&!Me(e,"removeformat")}));if(0<V((u=e,c=r,U(f,(function(e,t){var n=il(u,t);return u.formatter.matchNode(c,t,{},n)?e.concat([t]):e}),[])),(function(t){return a=o,u=["inline","block","selector","attributes","styles","classes"],!P((i=e).formatter.get(t),(function(e){var t=r(e);return P(i.formatter.get(a),(function(e){var o,i=r(e),a=t,u=i;return n(o=void 0===o?h:o).eq(a,u)}))}));function r(e){return ae(e,(function(e,t){return P(u,(function(e){return e===t}))}))}var i,a,u})).length){var d=r.cloneNode(!1);return l.add(t,d),s.remove(o,i,d,a),l.remove(d),ve.some(d)}return ve.none()}function Ag(e,t){var n=e.schema.getTextInlineElements();return Te(n,Ot(t))&&!Ps(t.dom)&&!cn(t.dom)}F(["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(e){Qd.add(e)}));var Dg,Mg=["font","text-decoration","text-emphasis"],Ng=T(tm,!0,qs),Rg=T(tm,!1,qs),zg=rm(!0,om),Bg=rm(!1,om),Pg=rm(!0,Yn),Ig=rm(!1,Yn),Fg=rm(!0,sn),Lg=rm(!1,sn),Hg=rm(!0,im),Vg=rm(!1,im),jg=T(mm,!1),Ug=T(mm,!0),Wg=T(dm,!1),$g=T(dm,!0),qg=T(pm,!1),Gg=T(pm,!0),Kg=rr([{singleCellTable:["rng","cell"]},{fullTable:["table"]},{partialTable:["cells","outsideDetails"]},{multiTable:["startTableCells","endTableCells","betweenRng"]}]),Xg=function(e){var t;return(8===_t(t=e)||"#comment"===Ot(t)?Rt:Lt)(e).bind(Xg).orThunk((function(){return ve.some(e)}))},Yg=function(e,t,n,r){void 0===r&&(r=!0),t.deleteContents();var o,i=Xg(n).getOr(n),a=Tt.fromDom(e.dom.getParent(i.dom,e.dom.isBlock));return Wr(a)&&(am(a),r&&e.selection.setCursorLocation(a.dom,0)),je(n,a)||F((fn(Nt(a),n)?[]:Nt(o=a).map(An).map((function(e){return V(e,(function(e){return!je(o,e)}))})).getOr([])).concat(An(n)),(function(e){je(e,a)||Ue(e,a)||!Wr(e)||zn(e)})),!0},Jg=function(e,t){return $(sm(t,e),(function(e){return Tn(e)&&"caption"===Ot(e)}))},Zg=function(e,t){return am(t),e.selection.setCursorLocation(t.dom,0),ve.some(!0)},Qg=Xn,ep=function(e,t){t(e),e.firstChild&&ep(e.firstChild,t),e.next&&ep(e.next,t)},tp=el,np=function(e,t,n,r,o){var i=e.formatter.get(n),a=e.dom;if(i&&t)for(var u=0;u<i.length;u++){var c=i[u];if(bg(e.dom,t,c)&&yg(a,t,c,"attributes",o,r)&&yg(a,t,c,"styles",o,r)){var s=c.classes;if(s)for(var l=0;l<s.length;l++)if(!e.dom.hasClass(t,Qs(s[l],r)))return;return c}}},rp=bo,op="_mce_caret",ip={},ap=fe,up=se;function cp(e){return Ln(e)&&!$s(e)&&!Ps(e)&&!cn(e)}function sp(e,t){for(var n=e;n;n=n[t]){if(Vn(n)&&Re(n.data))return e;if(Ln(n)&&!$s(n))return n}return e}function lp(e,t,n){var r=Gd(e);if(t&&n&&(t=sp(t,"previousSibling"),n=sp(n,"nextSibling"),r.compare(t,n))){for(var o=t.nextSibling;o&&o!==n;){var i=o;o=o.nextSibling;t.appendChild(i)}return e.remove(n),kt.each(kt.grep(n.childNodes),(function(e){t.appendChild(e)})),t}return n}function fp(e,t,n,r){var o;r&&!1!==t.merge_siblings&&(o=lp(e,Ys(r),r),lp(e,o,Ys(o,!0)))}function dp(e,t){return function(n){return!(!n||!nl(e,n,t))}}function mp(e,t,n){return function(r){var o,i;e.setStyle(r,t,n),""===r.getAttribute("style")&&r.removeAttribute("style"),o=e,"SPAN"===(i=r).nodeName&&0===o.getAttribs(i).length&&o.remove(i,!0)}}function gp(e,t,n){return e.isChildOf(t,n)&&t!==n&&!e.isBlock(n)}function pp(e,t,n){var r,o=t[n?"startContainer":"endContainer"],i=t[n?"startOffset":"endOffset"];return Ln(o)&&(r=o.childNodes.length-1,!n&&i&&i--,o=o.childNodes[r<i?r:i]),Vn(o)&&n&&i>=o.nodeValue.length&&(o=new _r(o,e.getBody()).next()||o),Vn(o)&&!n&&0===i&&new _r(o,e.getBody()).prev()||o}function hp(e,t){var n=t?"firstChild":"lastChild";if(/^(TR|TH|TD)$/.test(e.nodeName)&&e[n]){var r=e[n];return"TR"===e.nodeName&&r[n]||r}return e}function vp(e,t,n,r){var o=e.create(n,r);return t.parentNode.insertBefore(o,t),o.appendChild(t),o}function bp(e,t,n,r,o){var i=Tt.fromDom(t),a=Tt.fromDom(e.create(r,o));return Gt(a,(n?Pt:Bt)(i)),n?(Wt(i,a),qt(a,i)):($t(i,a),Rn(a,i)),a.dom}function yp(e,t,n,r){var o=Ys(t,n,r);return a(o)||"BR"===o.nodeName||e.isBlock(o)}function wp(e,t,n,r,o){var i,a,u=e.dom,c=u,s=r;if(!(cl(a=t)&&uh(s,a.inline)||al(a)&&uh(s,a.block)||ul(a)&&Ln(s)&&c.is(s,a.selector)||t.links&&"A"===r.nodeName))return oh.keep();var l,f,d,m,g,p,h,v,b=r;if(cl(t)&&"all"===t.remove&&y(t.preserve_attributes)){var w=V(u.getAttribs(b),(function(e){return B(t.preserve_attributes,e.name.toLowerCase())}));if(u.removeAllAttribs(b),F(w,(function(e){return u.setAttrib(b,e.name,e.value)})),0<w.length)return oh.rename("span")}if("all"!==t.remove){ah(t.styles,(function(e,r){e=tl(u,Qs(e,n),r+""),k(r)&&(r=e,o=null),!t.remove_similar&&o&&!uh(nl(u,o,r),e)||u.setStyle(b,r,""),i=!0})),i&&""===u.getAttrib(b,"style")&&(b.removeAttribute("style"),b.removeAttribute("data-mce-style")),ah(t.attributes,(function(e,r){var i;if(e=Qs(e,n),k(r)&&(r=e,o=null),t.remove_similar||!o||uh(u.getAttrib(o,r),e))if("class"===r&&(e=u.getAttrib(b,r))&&(i="",F(e.split(/\s+/),(function(e){/mce\-\w+/.test(e)&&(i+=(i?" ":"")+e)})),i))u.setAttrib(b,r,i);else{if(ih.test(r)&&b.removeAttribute("data-mce-"+r),"style"===r&&on(["li"])(b)&&"none"===u.getStyle(b,"list-style-type"))return b.removeAttribute(r),void u.setStyle(b,"list-style-type","none");"class"===r&&b.removeAttribute("className"),b.removeAttribute(r)}})),ah(t.classes,(function(e){e=Qs(e,n),o&&!u.hasClass(o,e)||u.removeClass(b,e)}));for(var x=u.getAttribs(b),C=0;C<x.length;C++){var S=x[C].nodeName;if(0!==S.indexOf("_")&&0!==S.indexOf("data-"))return oh.keep()}}return"none"!==t.remove?(l=e,d=t,p=(f=b).parentNode,h=l.dom,v=wc(l),al(d)&&(v?p===h.getRoot()&&(d.list_block&&uh(f,d.list_block)||F(xe(f.childNodes),(function(e){Zs(l,v,e.nodeName.toLowerCase())?m?m.appendChild(e):(m=vp(h,e,v),h.setAttribs(m,l.settings.forced_root_block_attrs)):m=null}))):h.isBlock(f)&&!h.isBlock(p)&&(yp(h,f,!1)||yp(h,f.firstChild,!0,!0)||f.insertBefore(h.create("br"),f.firstChild),yp(h,f,!0)||yp(h,f.lastChild,!1,!0)||f.appendChild(h.create("br")))),ul(g=d)&&cl(g)&&fn(ue(g,"mixed"),!0)&&!uh(d.inline,f)||h.remove(f,!0),oh.removed()):oh.keep()}function xp(e,t,n,r,o){return wp(e,t,n,r,o).fold(D,(function(t){return e.dom.rename(r,t),!0}),M)}function Cp(e,t,n,r,o){function i(r){var i,a,u,c,s,l=(a=t,u=n,c=o,F(ol((i=e).dom,r.parentNode).reverse(),(function(e){var t;s||"_start"===e.id||"_end"===e.id||(t=np(i,e,a,u,c))&&!1!==t.split&&(s=e)})),s);return function(e,t,n,r,o,i,a,u){var c,s,l=e.dom;if(n){for(var d=n.parentNode,m=r.parentNode;m&&m!==d;m=m.parentNode){for(var g=l.clone(m,!1),p=0;p<t.length&&null!==(g=function(e,t,n){return wp(e,t,u,n,n).fold(f(n),(function(t){return e.dom.createFragment().appendChild(n),e.dom.rename(n,t)}),f(null))}(e,t[p],g));p++);g&&(c&&g.appendChild(c),s=s||g,c=g)}a.mixed&&l.isBlock(n)||(r=l.split(n,r)),c&&(o.parentNode.insertBefore(c,o),s.appendChild(o),cl(a)&&fp(l,a,0,c))}return r}(e,d,l,r,r,0,m,n)}function a(t){return P(d,(function(r){return xp(e,r,n,t,t)}))}function c(e){var t,n=p.get(e?"_start":"_end"),r=n[e?"firstChild":"lastChild"];return $s(t=r)&&Ln(t)&&("_start"===t.id||"_end"===t.id)&&(r=r[e?"firstChild":"lastChild"]),Vn(r)&&0===r.data.length&&(r=e?n.previousSibling||n.nextSibling:n.nextSibling||n.previousSibling),p.remove(n,!0),r}function s(t){var n=yl(e,t,d,t.collapsed);if(m.split){if(n=Tf(n),(o=pp(e,n,!0))!==(a=pp(e,n))){if(o=hp(o,!0),a=hp(a,!1),gp(p,o,a)){var r=ve.from(o.firstChild).getOr(o);return i(bp(p,r,!0,"span",{id:"_start","data-mce-type":"bookmark"})),void c(!0)}if(gp(p,a,o))return r=ve.from(a.lastChild).getOr(a),i(bp(p,r,!1,"span",{id:"_end","data-mce-type":"bookmark"})),void c(!1);var o=vp(p,o,"span",{id:"_start","data-mce-type":"bookmark"}),a=vp(p,a,"span",{id:"_end","data-mce-type":"bookmark"}),u=p.createRng();u.setStartAfter(o),u.setEndBefore(a),wl(p,u,(function(e){F(e,(function(e){$s(e)||$s(e.parentNode)||i(e)}))})),i(o),i(a),o=c(!0),a=c()}else o=a=i(o);n.startContainer=o.parentNode||o,n.startOffset=p.nodeIndex(o),n.endContainer=a.parentNode||a,n.endOffset=p.nodeIndex(a)+1}wl(p,n,(function(e){F(e,v)}))}var l,d=e.formatter.get(t),m=d[0],g=!0,p=e.dom,h=e.selection,v=function(t){var n=!0,r=!1;Ln(t)&&p.getContentEditable(t)&&(n=g,g="true"===p.getContentEditable(t),r=!0);var o,i,c=xe(t.childNodes);if(g&&!r&&(o=a(t),i=t.parentNode,!o&&u(i)&&sl(m)&&a(i)),m.deep&&c.length){for(var s=0;s<c.length;s++)v(c[s]);r&&(g=n)}F(["underline","line-through","overline"],(function(n){Ln(t)&&e.dom.getStyle(t,"text-decoration")===n&&t.parentNode&&rl(p,t.parentNode)===n&&xp(e,{deep:!1,exact:!0,inline:"span",styles:{textDecoration:n}},null,t)}))};if(r)return Ks(r)?((l=p.createRng()).setStartBefore(r),l.setEndAfter(r),s(l)):s(r),void mf(e,t,r,n);if("false"!==p.getContentEditable(h.getNode()))h.isCollapsed()&&cl(m)&&!Sl(e).length?function(e,t,n,r){var o,i,a,u,c,s,l,f,d,m,g,p,h,v,b,y=e.dom,w=e.selection,x=[],C=w.getRng(),S=C.startContainer,k=C.startOffset,O=S;for(3===S.nodeType&&(k!==S.nodeValue.length&&(o=!0),O=O.parentNode);O;){if(np(e,O,t,n,r)){i=O;break}O.nextSibling&&(o=!0),x.push(O),O=O.parentNode}i&&(o?(a=w.getBookmark(),C.collapse(!0),u=Tf(yl(e,C,e.formatter.get(t),!0)),e.formatter.remove(t,n,u,r),w.moveToBookmark(a)):(c=Is(e.getBody(),i),d=s=Sg(!1).dom,(p=(g=e.dom).getParent(m=null!==c?c:i,T(Js,e)))&&g.isEmpty(p)?m.parentNode.replaceChild(d,m):(v=gu(h=Tt.fromDom(m),"br"),b=V(function(){for(var e=[],t=h.dom;t;)e.push(Tt.fromDom(t)),t=t.lastChild;return e}().slice(-1),Mr),v.length===b.length&&F(b,zn),g.isEmpty(m)?m.parentNode.replaceChild(d,m):g.insertAfter(d,m)),l=Eg(e,s,i,t,n,r),f=_g(x.concat(l.toArray()),s),kg(e,c,!1),w.setCursorLocation(f,1),y.isEmpty(i)&&y.remove(i)))}(e,t,n,o):(Al(h,!0,(function(){El(e,s)})),cl(m)&&wg(e,t,n,h.getStart())&&Xs(p,h,h.getRng()),e.nodeChanged()),mf(e,t,r,n);else{r=h.getNode();for(var b=0;b<d.length&&(!d[b].ceFalseOverride||!xp(e,d[b],n,r,r));b++);mf(e,t,r,n)}}function Sp(e){return Ln(e)&&!$s(e)&&!Ps(e)&&!cn(e)}function kp(e){return Te(e,"vars")}function Tp(e,t,n,r,o){return W(t,(function(t){var i=e.formatter.matchNode(t,n,null!=o?o:{},r);return!C(i)}),(function(t){return hg(e,t,n)||!r&&u(e.formatter.matchNode(t,n,o,!0))}))}function Op(e,t){var n=null!=t?t:fh(e);return V(ol(e.dom,n),(function(e){return Ln(e)&&!cn(e)}))}function _p(e,t){var n=(t||document).createDocumentFragment();return F(e,(function(e){n.appendChild(e.dom)})),Tt.fromDom(n)}function Ep(e,t,n){return{element:e,width:t,rows:n}}function Ap(e,t){return{element:e,cells:t}}function Dp(e,t){var n=parseInt(vn(e,t),10);return isNaN(n)?1:n}function Mp(e){return U(e,(function(e,t){return t.cells.length>e?t.cells.length:e}),0)}function Np(e,t){for(var n=e.rows,r=0;r<n.length;r++)for(var o=n[r].cells,i=0;i<o.length;i++)if(je(o[i],t))return ve.some({x:i,y:r});return ve.none()}function Rp(e,t,n,r,o){for(var i=[],a=e.rows,u=n;u<=o;u++){var c=a[u].cells,s=t<r?c.slice(t,r+1):c.slice(r,t+1);i.push(Ap(a[u].element,s))}return i}function zp(e,t){var n,r,o,i=Tt.fromDom(t.commonAncestorContainer),a=sm(i,e),u=V(a,(function(e){return Dr(e)||uo(e)})),c=(o=t,$(r=a,(function(e){return"li"===Ot(e)&&Tl(e,o)})).fold(f([]),(function(e){return $(r,(function(e){return"ul"===Ot(e)||"ol"===Ot(e)})).map((function(e){var t=Tt.fromTag(Ot(e));return function(e,t){var n=e.dom;ne(t,(function(e,t){!function(e,t,n){if(!v(n))throw console.error("Invalid call to CSS.set. Property ",t,":: Value ",n,":: Element ",e),new Error("CSS value must be a string: "+n);mn(e)&&e.style.setProperty(t,n)}(n,t,e)}))}(t,ae(Cn(e),(function(e,t){return Ye(t,"list-style")}))),[Tt.fromTag("li"),t]})).getOr([])})));return I(u.concat(c.length?c:fo(n=i)?Nt(n).filter(lo).fold(f([]),(function(e){return[n,e]})):lo(n)?[n]:[]),yu)}function Bp(){return _p([])}function Pp(e,t){return pr(t[0],"table",T(je,e)).bind((function(e){var n,r,o=t[0],i=t[t.length-1],a=function(e){var t=Ep(yu(e),0,[]);return F(gu(e,"tr"),(function(e,n){F(gu(e,"td,th"),(function(r,o){!function(e,t,n,r,o){for(var i=Dp(o,"rowspan"),a=Dp(o,"colspan"),u=e.rows,c=n;c<n+i;c++){u[c]||(u[c]=Ap(wu(r),[]));for(var s=t;s<t+a;s++)u[c].cells[s]=c===n&&s===t?o:yu(o)}}(t,function(e,t,n){for(;r=t,((o=e.rows)[n]?o[n].cells:[])[r];)t++;var r,o;return t}(t,o,n),n,e,r)}))})),Ep(t.element,Mp(t.rows),t.rows)}(e);return r=i,Np(n=a,o).bind((function(e){return Np(n,r).map((function(t){return r=n,o=e.x,i=e.y,a=t.x,c=i<(u=t.y)?Rp(r,o,i,a,u):Rp(r,o,u,a,i),Ep(r.element,Mp(c),c);var r,o,i,a,u,c}))})).map((function(e){return _p([(n=I((t=e).rows,(function(e){var t=I(e.cells,(function(e){var t=wu(e);return yn(t,"colspan"),yn(t,"rowspan"),t})),n=yu(e.element);return Gt(n,t),n})),r=yu(t.element),Gt(o=Tt.fromTag("tbody"),n),Rn(r,o),r)]);var t,n,r,o}))})).getOrThunk(Bp)}function Ip(e,t){return 0<=t&&t<e.length&&qs(e.charAt(t))}function Fp(e,t){var n=wo(e.innerText);return t?n.replace(/^[ \f\n\r\t\v]+/,""):n}function Lp(e){return Ln(e)?e.outerHTML:Vn(e)?Ko.encodeRaw(e.data,!1):jn(e)?"\x3c!--"+e.data+"--\x3e":""}function Hp(e){var t,n=G((t=e.getBody(),V(I(xe(t.childNodes),Lp),(function(e){return 0<e.length}))),(function(t){var n=qd(e.serializer,t);return 0<n.length?[n]:[]})),r=n.join("");return-1!==r.indexOf("</iframe>")?{type:"fragmented",fragments:n,content:"",bookmark:null,beforeBookmark:null}:{type:"complete",fragments:null,content:r,bookmark:null,beforeBookmark:null}}function Vp(e,t,n){var r,o,i,a,c,s,l,f,d,m,g,p=n?t.beforeBookmark:t.bookmark;function h(e,t,n,r){for(var o=e;o-t<r&&o<n&&a[o]===c[o-t];)++o;return{start:e,end:o,diag:t}}"fragmented"===t.type?(r=t.fragments,o=e.getBody(),i=I(xe(o.childNodes),Lp),function(e,t){var n=0;F(e,(function(e){var r,o,i,a,u,c,s,l;0===e[0]?n++:1===e[0]?(a=t,u=e[1],c=n,l=function(e){var t,n=document.createElement("div"),r=document.createDocumentFragment();for(e&&(n.innerHTML=e);t=n.firstChild;)r.appendChild(t);return r}(u),a.hasChildNodes()&&c<a.childNodes.length?(s=a.childNodes[c]).parentNode.insertBefore(l,s):a.appendChild(l),n++):2===e[0]&&(o=n,(r=t).hasChildNodes()&&o<r.childNodes.length&&(i=r.childNodes[o]).parentNode.removeChild(i))}))}((c=r,s=(a=i).length+c.length+2,l=new Array(s),f=new Array(s),d=function(e,t,n,r,o){var i=m(e,t,n,r);if(null===i||i.start===t&&i.diag===t-r||i.end===e&&i.diag===e-n)for(var u=e,s=n;u<t||s<r;)u<t&&s<r&&a[u]===c[s]?(o.push([0,a[u]]),++u,++s):r-n<t-e?(o.push([2,a[u]]),++u):(o.push([1,c[s]]),++s);else{d(e,i.start,n,i.start-i.diag,o);for(var l=i.start;l<i.end;++l)o.push([0,a[l]]);d(i.end,t,i.end-i.diag,r,o)}},m=function(e,t,n,r){var o=t-e,i=r-n;if(0==o||0==i)return null;var u,s,d,m,g,p=o-i,v=i+o,b=(v%2==0?v:1+v)/2;for(l[1+b]=e,f[1+b]=t+1,u=0;u<=b;++u){for(s=-u;s<=u;s+=2){for(d=s+b,s===-u||s!==u&&l[d-1]<l[d+1]?l[d]=l[d+1]:l[d]=l[d-1]+1,g=(m=l[d])-e+n-s;m<t&&g<r&&a[m]===c[g];)l[d]=++m,++g;if(p%2!=0&&p-u<=s&&s<=p+u&&f[d-p]<=l[d])return h(f[d-p],s+e-n,t,r)}for(s=p-u;s<=p+u;s+=2){for(d=s+b-p,s===p-u||s!==p+u&&f[d+1]<=f[d-1]?f[d]=f[d+1]-1:f[d]=f[d-1],g=(m=f[d]-1)-e+n-s;e<=m&&n<=g&&a[m]===c[g];)f[d]=m--,g--;if(p%2==0&&-u<=s&&s<=u&&f[d]<=l[d+p])return h(f[d],s+e-n,t,r)}}},g=[],d(0,a.length,0,c.length,g),g),o)):e.setContent(t.content,{format:"raw",no_selection:!u(p)||!Fs(p)||!p.isFakeCaret}),e.selection.moveToBookmark(p)}function jp(e){return"fragmented"===e.type?e.fragments.join(""):e.content}function Up(e){var t=Tt.fromTag("body",mh());return vu(t,jp(e)),F(gu(t,"*[data-mce-bogus]"),Xt),t.dom.innerHTML}function Wp(e,t){return!(!e||!t)&&(r=t,jp(e)===jp(r)||(n=t,Up(e)===Up(n)));var n,r}function $p(e){return 0===e.get()}function qp(e,t,n){$p(n)&&(e.typing=t)}function Gp(e,t){e.typing&&(qp(e,!1,t),e.add())}function Kp(e){return{undoManager:{beforeChange:function(t,n){var r=e,o=n;$p(t)&&o.set(ss(r.selection))},add:function(t,n,r,o,i,a){return function(e,t,n,r,o,i,a){var u=Hp(e);if(i=kt.extend(i=i||{},u),!1===$p(r)||e.removed)return null;var c=t.data[n.get()];if(e.fire("BeforeAddUndo",{level:i,lastLevel:c,originalEvent:a}).isDefaultPrevented())return null;if(c&&Wp(c,i))return null;t.data[n.get()]&&o.get().each((function(e){t.data[n.get()].beforeBookmark=e}));var s=e.getParam("custom_undo_redo_levels",0,"number");if(s&&t.data.length>s){for(var l=0;l<t.data.length-1;l++)t.data[l]=t.data[l+1];t.data.length--,n.set(t.data.length)}i.bookmark=ss(e.selection),n.get()<t.data.length-1&&(t.data.length=n.get()+1),t.data.push(i),n.set(t.data.length-1);var f={level:i,lastLevel:c,originalEvent:a};return 0<n.get()?(e.setDirty(!0),e.fire("AddUndo",f),e.fire("change",f)):e.fire("AddUndo",f),i}(e,t,n,r,o,i,a)},undo:function(t,n,r){return o=e,a=n,u=r,(i=t).typing&&(i.add(),i.typing=!1,qp(i,!1,a)),0<u.get()&&(u.set(u.get()-1),Vp(o,c=i.data[u.get()],!0),o.setDirty(!0),o.fire("Undo",{level:c})),c;var o,i,a,u,c},redo:function(t,n){return r=e,i=n,(o=t).get()<i.length-1&&(o.set(o.get()+1),Vp(r,a=i[o.get()],!1),r.setDirty(!0),r.fire("Redo",{level:a})),a;var r,o,i,a},clear:function(t,n){var r,o=e,i=n;(r=t).data=[],i.set(0),r.typing=!1,o.fire("ClearUndos")},reset:function(e){var t;(t=e).clear(),t.add()},hasUndo:function(t,n){return r=e,o=t,0<n.get()||o.typing&&o.data[0]&&!Wp(Hp(r),o.data[0]);var r,o},hasRedo:function(e,t){return n=e,t.get()<n.data.length-1&&!n.typing;var n},transact:function(e,t,n){return o=n,Gp(r=e,t),r.beforeChange(),r.ignore(o),r.add();var r,o},ignore:function(e,t){try{e.set(e.get()+1),t()}finally{e.set(e.get()-1)}},extra:function(t,n,r,o){var i,a,u=e,c=n,s=o;(i=t).transact(r)&&(a=i.data[c.get()].bookmark,Vp(u,i.data[c.get()-1],!0),i.transact(s)&&(i.data[c.get()-1].beforeBookmark=a))}},formatter:{match:function(t,n,r,o){return wg(e,t,n,r,o)},matchAll:function(t,n){return o=t,i=n,a=[],u={},c=(r=e).selection.getStart(),r.dom.getParent(c,(function(e){for(var t=0;t<o.length;t++){var n=o[t];!u[n]&&np(r,e,n,i)&&(u[n]=!0,a.push(n))}}),r.dom.getRoot()),a;var r,o,i,a,u,c},matchNode:function(t,n,r,o){return np(e,t,n,r,o)},canApply:function(t){return function(e){var n=e.formatter.get(t),r=e.dom;if(n)for(var o=ol(r,e.selection.getStart()),i=n.length-1;0<=i;i--){var a=n[i];if(!ul(a)||u(a.defaultBlock))return!0;for(var c=o.length-1;0<=c;c--)if(r.is(o[c],a.selector))return!0}return!1}(e)},closest:function(t){return r=e,o=t,ve.from(r.selection.getStart(!0)).bind((function(e){return pg(Tt.fromDom(e),(function(e){return te(o,(function(t){return np(r,e.dom,n=t)?ve.some(n):ve.none();var n}))}),n)})).getOrNull();function n(e){return je(e,Tt.fromDom(r.getBody()))}var r,o},apply:function(t,n,r){return lh(e,t,n,r)},remove:function(t,n,r,o){return Cp(e,t,n,r,o)},toggle:function(t,n,r){var o,i=t,a=n,u=r,c=(o=e).formatter.get(i);(!wg(o,i,a,u)||"toggle"in c[0]&&!c[0].toggle?lh:Cp)(o,i,a,u)},formatChanged:function(t,n,r,o,i){return function(e,t,n,r,o,i){var a,u,c,s,l,f,d,m,g;return null===t.get()&&(u=e,(a=t).set({}),u.on("NodeChange",(function(e){dh(u,e.element,a.get())})),u.on("FormatApply FormatRemove",(function(e){var t=ve.from(e.node).map((function(e){return Ks(e)?e:e.startContainer})).bind((function(e){return Ln(e)?ve.some(e):ve.from(e.parentElement)})).getOrThunk((function(){return fh(u)}));dh(u,t,a.get())}))),c=e,l=n,f=r,d=o,m=i,g=(s=t).get(),F(l.split(","),(function(e){function t(){var t=Op(c);return Tp(c,t,e,d,m).isSome()}var n,r=ue(g,e).getOrThunk((function(){var t={withSimilar:{state:tu(!1),similar:!0,callbacks:[]},withoutSimilar:{state:tu(!1),similar:!1,callbacks:[]},withVars:[]};return g[e]=t}));C(m)?((n=d?r.withSimilar:r.withoutSimilar).callbacks.push(f),1===n.callbacks.length&&n.state.set(t())):r.withVars.push({state:tu(t()),similar:d,vars:m,callback:f})})),s.set(g),{unbind:function(){var e,o=n,i=r,a=(e=t).get();F(o.split(","),(function(e){return ue(a,e).each((function(t){a[e]={withSimilar:_e(_e({},t.withSimilar),{callbacks:V(t.withSimilar.callbacks,(function(e){return e!==i}))}),withoutSimilar:_e(_e({},t.withoutSimilar),{callbacks:V(t.withoutSimilar.callbacks,(function(e){return e!==i}))}),withVars:V(t.withVars,(function(e){return e.callback!==i}))}}))})),e.set(a)}}}(e,t,n,r,o,i)}},editor:{getContent:function(t,n){return r=e,o=t,i=n,ve.from(r.getBody()).fold(f("tree"===o.format?new Nd("body",11):""),(function(e){return t=r,a=e,u=i,d=_e(_e({},n=o),{format:u,get:!0,getInner:!0}),g="raw"===(m=n.no_events?d:t.fire("BeforeGetContent",d)).format?kt.trim(Yd(t.serializer,a.innerHTML)):"text"===m.format?t.dom.isEmpty(a)?"":wo(a.innerText||a.textContent):"tree"===m.format?t.serializer.serialize(a,m):(s=(c=t).serializer.serialize(a,m),l=wc(c),f=new RegExp("^(<"+l+"[^>]*>(&nbsp;|&#160;|\\s| |<br \\/>|)<\\/"+l+">[\r\n]*|<br \\/>[\r\n]*)$"),s.replace(f,"")),B(["text","tree"],m.format)||po(Tt.fromDom(a))?m.content=g:m.content=kt.trim(g),(m.no_events?m:t.fire("GetContent",m)).content;var t,n,a,u,c,s,l,f,d,m,g}));var r,o,i},setContent:function(t,n){return function(e,t,n){var r,o=(r=t,_e(_e({format:"html"},n),{set:!0,content:dg(r)?"":r})),i=n.no_events?o:e.fire("BeforeSetContent",o);return dg(t)||(t=i.content),ve.from(e.getBody()).fold(f(t),(function(n){return dg(t)?function(e,t,n,r){var o,i,a,u;o=e.parser.getNodeFilters(),i=e.parser.getAttributeFilters(),a=n,u=function(e,t){var n,r,o={},i={},u=[];for(n in a.firstChild&&ep(a.firstChild,(function(n){F(e,(function(e){e.name===n.name&&(o[e.name]?o[e.name].nodes.push(n):o[e.name]={filter:e,nodes:[n]})})),F(t,(function(e){"string"==typeof n.attr(e.name)&&(i[e.name]?i[e.name].nodes.push(n):i[e.name]={filter:e,nodes:[n]})}))})),o)Te(o,n)&&u.push(o[n]);for(r in i)Te(i,r)&&u.push(i[r]);return u}(o,i),F(u,(function(e){F(e.filter.callbacks,(function(t){t(e.nodes,e.filter.name,{})}))}));var c=Xd({validate:e.validate},e.schema).serialize(n);return r.content=po(Tt.fromDom(t))?c:kt.trim(c),mg(e,r.content,r.no_selection),r.no_events||e.fire("SetContent",r),n}(e,n,t,i):(r=e,o=n,u=i,0===(a=t).length||/^\s+$/.test(a)?(c='<br data-mce-bogus="1">',"TABLE"===o.nodeName?a="<tr><td>"+c+"</td></tr>":/^(UL|OL)$/.test(o.nodeName)&&(a="<li>"+c+"</li>"),a=(s=wc(r))&&r.schema.isValidChild(o.nodeName.toLowerCase(),s.toLowerCase())?(a=c,r.dom.createHTML(s,xc(r),a)):a||'<br data-mce-bogus="1">',mg(r,a,u.no_selection),r.fire("SetContent",u)):("raw"!==u.format&&(a=Xd({validate:r.validate},r.schema).serialize(r.parser.parse(a,{isRootContent:!0,insert:!0}))),u.content=po(Tt.fromDom(o))?a:kt.trim(a),mg(r,u.content,u.no_selection),u.no_events||r.fire("SetContent",u)),u.content);var r,o,a,u,c,s}))}(e,t,n)},insertContent:function(t,n){return fg(e,t,n)},addVisual:function(t){var n,r=t,o=(n=e).dom,i=u(r)?r:n.getBody();C(n.hasVisual)&&(n.hasVisual=n.getParam("visual",!0,"boolean")),F(o.select("table,a",i),(function(e){switch(e.nodeName){case"TABLE":var t=n.getParam("visual_table_class","mce-item-table","string"),r=o.getAttrib(e,"border");r&&"0"!==r||!n.hasVisual?o.removeClass(e,t):o.addClass(e,t);break;case"A":var i,a;o.getAttrib(e,"href")||(i=o.getAttrib(e,"name")||e.id,a=n.getParam("visual_anchor_class","mce-item-anchor","string"),i&&n.hasVisual?o.addClass(e,a):o.removeClass(e,a))}})),n.fire("VisualAid",{element:r,hasVisual:n.hasVisual})}},selection:{getContent:function(t,n){return function(e,t,n){var r,o=(r=t,_e(_e({},n=void 0===n?{}:n),{format:r,get:!0,selection:!0})),i=e.fire("BeforeGetContent",o);if(i.isDefaultPrevented())return e.fire("GetContent",i),i.content;if("text"===i.format)return m=e,ve.from(m.selection.getRng()).map((function(e){var t=ve.from(m.dom.getParent(e.commonAncestorContainer,m.dom.isBlock)),n=m.getBody(),r=t.map((function(e){return e.nodeName})).getOr("div").toLowerCase(),o=xt.browser.isIE()&&"pre"!==r,i=m.dom.add(n,r,{"data-mce-bogus":"all",style:"overflow: hidden; opacity: 0;"},e.cloneContents()),a=Fp(i,o),u=wo(i.textContent);if(m.dom.remove(i),Ip(u,0)||Ip(u,u.length-1)){var c=Fp(t.getOr(n),o),s=c.indexOf(a);return-1===s?a:(Ip(c,s-1)?" ":"")+a+(Ip(c,s+a.length)?" ":"")}return a})).getOr("");i.getInner=!0;var a,u,c,s,l,f,d,m,g=(u=i,c=(a=e).selection.getRng(),s=a.dom.create("body"),l=a.selection.getSel(),f=pd(a,xl(l)),(d=u.contextual?function(e,t){var n,r,o,i,a,u,c,s=Cl(t,e);return 0<s.length?Pp(e,s):(n=e,0<(r=t).length&&r[0].collapsed?Bp():(o=n,i=r[0],a=Tt.fromDom(i.cloneContents()),c=U(u=zp(o,i),(function(e,t){return Rn(t,e),t}),a),0<u.length?_p([c]):c))}(Tt.fromDom(a.getBody()),f).dom:c.cloneContents())&&s.appendChild(d),a.selection.serializer.serialize(s,u));return"tree"===i.format?g:(i.content=e.selection.isCollapsed()?"":g,e.fire("GetContent",i),i.content)}(e,t,n)}},raw:{getModel:function(){return ve.none()}}}}function Xp(e){return Te(e.plugins,"rtc")}function Yp(e){var t=e;return ue(e.plugins,"rtc").bind((function(e){return ve.from(e.setup)})).fold((function(){return t.rtcInstance=Kp(e),ve.none()}),(function(e){var n,r;return t.rtcInstance=(n=f(null),r=f(""),{undoManager:{beforeChange:c,add:n,undo:n,redo:n,clear:c,reset:c,hasUndo:D,hasRedo:D,transact:n,ignore:c,extra:c},formatter:{match:D,matchAll:f([]),matchNode:f(void 0),canApply:D,closest:r,apply:c,remove:c,toggle:c,formatChanged:f({unbind:c})},editor:{getContent:r,setContent:r,insertContent:c,addVisual:c},selection:{getContent:r},raw:{getModel:f(ve.none())}}),ve.some((function(){return e().then((function(e){return t.rtcInstance=(r=e.undoManager,o=e.formatter,i=e.editor,a=e.selection,u=e.raw,{undoManager:{beforeChange:r.beforeChange,add:r.add,undo:r.undo,redo:r.redo,clear:r.clear,reset:r.reset,hasUndo:r.hasUndo,hasRedo:r.hasRedo,transact:function(e,t,n){return r.transact(n)},ignore:function(e,t){return r.ignore(t)},extra:function(e,t,n,o){return r.extra(n,o)}},formatter:{match:function(e,t,r,i){return o.match(e,n(t),i)},matchAll:o.matchAll,matchNode:o.matchNode,canApply:function(e){return o.canApply(e)},closest:function(e){return o.closest(e)},apply:function(e,t,r){return o.apply(e,n(t))},remove:function(e,t,r,i){return o.remove(e,n(t))},toggle:function(e,t,r){return o.toggle(e,n(t))},formatChanged:function(e,t,n,r,i){return o.formatChanged(t,n,r,i)}},editor:{getContent:function(e,t){return i.getContent(e)},setContent:function(e,t){return i.setContent(e,t)},insertContent:function(e,t){return i.insertContent(e)},addVisual:i.addVisual},selection:{getContent:function(e,t){return a.getContent(t)}},raw:{getModel:function(){return ve.some(u.getRawModel())}}}),e.rtc.isRemote;function n(e){return b(e)?e:{}}var r,o,i,a,u}))}))}))}function Jp(e){return e.rtcInstance||Kp(e)}function Zp(e){var t=e.rtcInstance;if(t)return t;throw new Error("Failed to get RTC instance not yet initialized.")}function Qp(e){return 0===e.dom.length?(zn(e),ve.none()):ve.some(e)}function eh(e,t,n,r){e.bind((function(e){return(r?Mm:Dm)(e.dom,r?e.dom.length:0),t.filter(On).map((function(t){var o=n,i=r,a=e.dom,u=t.dom,c=(i?a:u).length;i?(Nm(a,u,!1,!i),o.setStart(u,c)):(Nm(u,a,!1,!i),o.setEnd(u,c))}))})).orThunk((function(){var e=r;return t.filter((function(e){return Rl.isBookmarkNode(e.dom)})).bind(e?zt:Rt).or(t).filter(On).map((function(e){var t,n=r;Nt(t=e).each((function(e){var r=t.dom;n&&Sm(e,rc(r,0))?Dm(r,0):!n&&km(e,rc(r,r.length))&&Mm(r,r.length)}))}))}))}function th(e,t,n){var r;e&&Te(e,t)&&(0===(r=V(e[t],(function(e){return e!==n}))).length?delete e[t]:e[t]=r)}Dg=function(e){var t,n=e.selection.getRng(),r=on(["pre"]);n.collapsed||(t=e.selection.getSelectedBlocks(),up(ap(ap(t,r),(function(e){return r(e.previousSibling)&&-1!==de(t,e.previousSibling)})),(function(e){var t,n=e.previousSibling;Wa(t=e).remove(),Wa(n).append("<br><br>").append(t.childNodes)})))},ip.pre||(ip.pre=[]),ip.pre.push(Dg);var nh=kt.each,rh=function(e,t,n){nh(e.childNodes,(function(e){cp(e)&&(t(e)&&n(e),e.hasChildNodes()&&rh(e,t,n))}))},oh=rr([{keep:[]},{rename:["name"]},{removed:[]}]),ih=/^(src|href|style)$/,ah=kt.each,uh=el,ch=kt.each,sh=kt.each,lh=function(e,t,n,r){function o(e,t){var o;S((t=void 0===t?m:t).onformat)&&t.onformat(e,t,n,r),sh(t.styles,(function(t,r){p.setStyle(e,r,Qs(t,n))})),!t.styles||(o=p.getAttrib(e,"style"))&&p.setAttrib(e,"data-mce-style",o),sh(t.attributes,(function(t,r){p.setAttrib(e,r,Qs(t,n))})),sh(t.classes,(function(t){t=Qs(t,n),p.hasClass(e,t)||p.addClass(e,t)}))}function i(e,t){var n=!1;return sh(e,(function(e){return!!ul(e)&&(u(e.collapsed)&&e.collapsed!==g||!p.is(t,e.selector)||Ps(t)?void 0:(o(t,e),!(n=!0)))})),n}function a(r,a,c){var s=[],l=!0,f=m.inline||m.block,g=function(e){if(v(e)){var t=p.create(e);return o(t),t}return null}(f);wl(r,a,(function(a){var p,h=function(a){var v=!1,b=l,y=a.nodeName.toLowerCase(),w=a.parentNode,x=w.nodeName.toLowerCase();if(Ln(a)&&r.getContentEditable(a)&&(b=l,l="true"===r.getContentEditable(a),v=!0),$n(a)&&!function(e,t,n,r){if(e.getParam("format_empty_lines",!1,"boolean")&&cl(t)){var o=_e(_e({},e.schema.getTextBlockElements()),{td:{},th:{},li:{},dt:{},dd:{},figcaption:{},caption:{},details:{},summary:{}}),i=(a=Tt.fromDom(n),c=function(e){return Ps(e.dom)},((s=(u=a).dom).parentNode?function(e,t){return $(e.dom.childNodes,(function(e){return t(Tt.fromDom(e))})).map(Tt.fromDom)}(Tt.fromDom(s.parentNode),(function(e){return!je(u,e)&&c(e)})):ve.none()).isSome());return ce(o,r)&&Wr(Tt.fromDom(n.parentNode),!1)&&!i}var a,u,c,s}(e,m,a,x))return p=null,void(al(m)&&r.remove(a));if(al(m)&&m.wrapper&&np(e,a,t,n))p=null;else{if(l&&!v&&al(m)&&!m.wrapper&&Js(e,y)&&Zs(e,x,f)){var C=r.rename(a,f);return o(C),s.push(C),void(p=null)}if(ul(m)){var S=i(d,a);if(!S&&u(w)&&sl(m)&&(S=i(d,w)),!cl(m)||S)return void(p=null)}!l||v||!Zs(e,f,y)||!Zs(e,x,f)||!c&&Vn(a)&&yo(a.data)||Ps(a)||cl(m)&&r.isBlock(a)?(p=null,F(xe(a.childNodes),h),v&&(l=b),p=null):(p||(p=r.clone(g,!1),a.parentNode.insertBefore(p,a),s.push(p)),p.appendChild(a))}};F(a,h)})),!0===m.links&&F(s,(function(e){var t=function(e){"A"===e.nodeName&&o(e,m),F(xe(e.childNodes),t)};t(e)})),F(s,(function(i){var a,c,l,f,g,p,h,v,b,y,w,x,C,S,k,T,O,_,E=(a=0,F(i.childNodes,(function(e){var t;u(t=e)&&Vn(t)&&0===t.length||$s(e)||a++})),a);function A(e){var t;1===e.nodeType&&e.parentNode&&1===e.parentNode.nodeType&&(t=rl(C,e.parentNode),C.getStyle(e,"color")&&t?C.setStyle(e,"text-decoration",t):C.getStyle(e,"text-decoration")===t&&C.setStyle(e,"text-decoration",null))}!(1<s.length)&&r.isBlock(i)||0!==E?(cl(m)||al(m)&&m.wrapper)&&(m.exact||1!==E||(i=$((x=i).childNodes,Sp).filter((function(e){return bg(r,e,m)})).map((function(e){var t=r.clone(e,!1);return o(t),r.replace(t,x,!0),r.remove(e,!0),t})).getOr(x)),T=e,O=n,_=i,ch(d,(function(e){var t,n,r;cl(e)&&ch(T.dom.select(e.inline,_),(function(t){cp(t)&&xp(T,e,O,t,e.exact?t:null)})),t=T.dom,(n=e).clear_child_styles&&(r=n.links?"*:not(a)":"*",nh(t.select(r,_),(function(e){cp(e)&&nh(n.styles,(function(n,r){t.setStyle(e,r,"")}))})))})),v=m,np(h=e,(w=i).parentNode,b=t,y=n)&&xp(h,v,y,w)||v.merge_with_parents&&h.dom.getParent(w.parentNode,(function(e){if(np(h,e,b,y))return xp(h,v,y,w),!0})),p=i,(g=m).styles&&g.styles.backgroundColor&&rh(p,dp(r,"fontSize"),mp(r,"backgroundColor",Qs(g.styles.backgroundColor,n))),C=r,k=i,(S=m).styles&&(S.styles.color||S.styles.textDecoration)&&(kt.walk(k,A,"childNodes"),A(k)),c=r,f=i,!cl(l=m)||"sub"!==l.inline&&"sup"!==l.inline||(rh(f,dp(c,"fontSize"),mp(c,"fontSize","")),c.remove(c.select("sup"===l.inline?"sub":"sup",f),!0)),fp(r,m,0,i)):r.remove(i,!0)}))}var c,s,l,f,d=e.formatter.get(t),m=d[0],g=!r&&e.selection.isCollapsed(),p=e.dom,h=e.selection;if("false"!==p.getContentEditable(h.getNode()))m&&(r?Ks(r)?i(d,r)||((c=p.createRng()).setStartBefore(r),c.setEndAfter(r),a(p,yl(e,c,d),!0)):a(p,r,!0):g&&cl(m)&&!Sl(e).length?function(e,t,n){var r,o=e.selection,i=o.getRng(),a=i.startOffset,u=i.startContainer.nodeValue,c=Is(e.getBody(),o.getStart());c&&(r=Cg(c));var s,l,f,d,m=/[^\s\u00a0\u00ad\u200b\ufeff]/;u&&0<a&&a<u.length&&m.test(u.charAt(a))&&m.test(u.charAt(a-1))?(s=o.getBookmark(),i.collapse(!0),l=Tf(yl(e,i,e.formatter.get(t))),e.formatter.apply(t,n,l),o.moveToBookmark(s)):(c&&r.nodeValue===rp||(f=e.getDoc(),d=Sg(!0).dom,r=(c=f.importNode(d,!0)).firstChild,i.insertNode(c),a=1),e.formatter.apply(t,n,c),o.setCursorLocation(r,a))}(e,t,n):(s=h.getNode(),l=d[0],e.settings.forced_root_block||!l.defaultBlock||p.getParent(s,p.isBlock)||lh(e,l.defaultBlock),h.setRng(ug(h.getRng())),Al(h,!0,(function(){El(e,(function(t,n){var r=n?t:yl(e,t,d);a(p,r,!1)}))})),Xs(p,h,h.getRng()),e.nodeChanged()),f=e,up(ip[t],(function(e){e(f)}))),df(e,t,r,n);else{r=h.getNode();for(var b=0,y=d.length;b<y;b++){var w=d[b];if(w.ceFalseOverride&&ul(w)&&p.is(r,w.selector)){o(r,w);break}}df(e,t,r,n)}},fh=function(e){return e.selection.getStart()},dh=function(e,t,n){var r=Op(e,t);ne(n,(function(n,o){function i(n){var i,a=Tp(e,r,o,n.similar,kp(n)?n.vars:void 0),u=a.isSome();n.state.get()!==u&&(n.state.set(u),i=a.getOr(t),kp(n)?n.callback(u,{node:i,format:o,parents:r}):F(n.callbacks,(function(e){return e(u,{node:i,format:o,parents:r})})))}F([n.withSimilar,n.withoutSimilar],i),F(n.withVars,i)}))},mh=Ae((function(){return document.implementation.createHTMLDocument("undo")}));function gh(e){return e.select}function ph(e){return e&&e.ownerDocument&&Ue(Tt.fromDom(e.ownerDocument),Tt.fromDom(e))}function hh(e,t,n,r){function o(e,t){return function(e,t,n){var r,o=(r=t,_e(_e({format:"html"},n=void 0===n?{}:n),{set:!0,selection:!0,content:r})),i=o;if(!o.no_events){var a=e.fire("BeforeSetContent",o);if(a.isDefaultPrevented())return void e.fire("SetContent",a);i=a}i.content=function(e,t){if("raw"===t.format)return t.content;var n=e.selection.getRng(),r=e.dom.getParent(n.commonAncestorContainer,e.dom.isBlock),o=r?{context:r.nodeName.toLowerCase()}:{},i=e.parser.parse(t.content,_e(_e({isRootContent:!0,forced_root_block:!1},o),t));return Xd({validate:e.validate},e.schema).serialize(i)}(e,i);var u=e.selection.getRng();!function(e,t){var n=ve.from(t.firstChild).map(Tt.fromDom),r=ve.from(t.lastChild).map(Tt.fromDom);e.deleteContents(),e.insertNode(t);var o=n.bind(Rt).filter(On).bind(Qp),i=r.bind(zt).filter(On).bind(Qp);eh(o,n,e,!0),eh(i,r,e,!1),e.collapse(!1)}(u,u.createContextualFragment(i.content)),e.selection.setRng(u),Gf(e,u),i.no_events||e.fire("SetContent",i)}(r,e,t)}function i(){var t=c(),n=null==t?void 0:t.anchorNode,r=null==t?void 0:t.focusNode;if(!t||!n||!r||rn(n)||rn(r))return!0;var o=e.createRng();o.setStart(n,t.anchorOffset),o.collapse(!0);var i=e.createRng();return i.setStart(r,t.focusOffset),i.collapse(!0),o.compareBoundaryPoints(o.START_TO_START,i)<=0}function a(e){var t=h();t.collapse(!!e),v(t)}function c(){return t.getSelection?t.getSelection():t.document.selection}var s,l,f,d,m,g,p=function(e,t){return m||(m={},g={},d.on("NodeChange",(function(e){var t=e.element,n=C(t),r={};kt.each(m,(function(e,t){x(t,n).each((function(o){g[t]||(F(e,(function(e){e(!0,{node:o,selector:t,parents:n})})),g[t]=e),r[t]=e}))})),kt.each(g,(function(e,o){r[o]||(delete g[o],kt.each(e,(function(e){e(!1,{node:t,selector:o,parents:n})})))}))}))),m[e]||(m[e]=[]),m[e].push(t),x(e,C(d.selection.getStart())).each((function(){g[e]=m[e]})),{unbind:function(){th(m,e,t),th(g,e,t)}}},h=function(){function n(e,t,n){try{return t.compareBoundaryPoints(e,n)}catch(e){return-1}}var o,i,a,u=t.document;if(void 0!==r.bookmark&&!1===ld(r)){var f=od(r);if(f.isSome())return f.map((function(e){return pd(r,[e])[0]})).getOr(u.createRange())}try{(o=c())&&!rn(o.anchorNode)&&(i=0<o.rangeCount?o.getRangeAt(0):(o.createRange?o:u).createRange(),i=pd(r,[i])[0])}catch(n){}return(i=i||(u.createRange?u.createRange():u.body.createTextRange())).setStart&&9===i.startContainer.nodeType&&i.collapsed&&(a=e.getRoot(),i.setStart(a,0),i.setEnd(a,0)),s&&l&&(0===n(i.START_TO_START,i,s)&&0===n(i.END_TO_END,i,s)?i=l:l=s=null),i},v=function(e,t){var n;if((o=e)&&(gh(o)||ph(o.startContainer)&&ph(o.endContainer))){var o,i=gh(e)?e:null;if(i){l=null;try{i.select()}catch(e){}}else{var a=c();if(e=r.fire("SetSelectionRange",{range:e,forward:t}).range,a){l=e;try{a.removeAllRanges(),a.addRange(e)}catch(e){}!1===t&&a.extend&&(a.collapse(e.endContainer,e.endOffset),a.extend(e.startContainer,e.startOffset)),s=0<a.rangeCount?a.getRangeAt(0):null}e.collapsed||e.startContainer!==e.endContainer||!a.setBaseAndExtent||xt.ie||e.endOffset-e.startOffset<2&&e.startContainer.hasChildNodes()&&(n=e.startContainer.childNodes[e.startOffset])&&"IMG"===n.tagName&&(a.setBaseAndExtent(e.startContainer,e.startOffset,e.endContainer,e.endOffset),a.anchorNode===e.startContainer&&a.focusNode===e.endContainer||a.setBaseAndExtent(n,0,n,1)),r.fire("AfterSetSelectionRange",{range:e,forward:t})}}},b={bookmarkManager:null,controlSelection:null,dom:f=e,win:t,serializer:n,editor:d=r,collapse:a,setCursorLocation:function(t,n){var o=e.createRng();u(t)&&u(n)?(o.setStart(t,n),o.setEnd(t,n),v(o),a(!1)):(Ol(e,o,r.getBody(),!0),v(o))},getContent:function(e){return n=(t=void 0===(t=e)?{}:t).format||"html",o=t,Zp(r).selection.getContent(n,o);var t,n,o},setContent:o,getBookmark:function(e,t){return y.getBookmark(e,t)},moveToBookmark:function(e){return y.moveToBookmark(e)},select:function(t,n){var r=e,o=n;return ve.from(t).map((function(e){var t=r.nodeIndex(e),n=r.createRng();return n.setStart(e.parentNode,t),n.setEnd(e.parentNode,t+1),o&&(Ol(r,n,e,!0),Ol(r,n,e,!1)),n})).each(v),t},isCollapsed:function(){var e=h(),t=c();return!(!e||e.item)&&(e.compareEndPoints?0===e.compareEndPoints("StartToEnd",e):!t||e.collapsed)},isForward:i,setNode:function(t){return o(e.getOuterHTML(t)),t},getNode:function(){return function(e,t){if(!t)return e;var n=t.startContainer,r=t.endContainer,o=t.startOffset,i=t.endOffset,a=t.commonAncestorContainer;return!t.collapsed&&(n===r&&i-o<2&&n.hasChildNodes()&&(a=n.childNodes[o]),3===n.nodeType&&3===r.nodeType&&(n=n.length===o?gd(n.nextSibling,!0):n.parentNode,r=0===i?gd(r.previousSibling,!1):r.parentNode,n&&n===r))?n:a&&3===a.nodeType?a.parentNode:a}(r.getBody(),h())},getSel:c,setRng:v,getRng:h,getStart:function(e){return dd(r.getBody(),h(),e)},getEnd:function(e){return md(r.getBody(),h(),e)},getSelectedBlocks:function(t,n){return function(e,t,n,r){var o=[],i=e.getRoot();if(n=e.getParent(n||dd(i,t,t.collapsed),e.isBlock),r=e.getParent(r||md(i,t,t.collapsed),e.isBlock),n&&n!==i&&o.push(n),n&&r&&n!==r)for(var a,u=new _r(n,i);(a=u.next())&&a!==r;)e.isBlock(a)&&o.push(a);return r&&n!==r&&r!==i&&o.push(r),o}(e,h(),t,n)},normalize:function(){var t=h();if(1<xl(c()).length||!_l(r))return t;var n=Sf(e,t);return n.each((function(e){v(e,i())})),n.getOr(t)},selectorChanged:function(e,t){return p(e,t),b},selectorChangedWithUnbind:p,getScrollContainer:function(){for(var t,n=e.getRoot();n&&"BODY"!==n.nodeName;){if(n.scrollHeight>n.clientHeight){t=n;break}n=n.parentNode}return t},scrollIntoView:function(e,t){u(e)?(r.inline?Wf:qf)(r,e,t):Gf(r,h(),t)},placeCaretAt:function(e,t){return v(hf(e,t,r.getDoc()))},getBoundingClientRect:function(){var e=h();return e.collapsed?rc.fromRangeStart(e).getClientRects()[0]:e.getBoundingClientRect()},destroy:function(){t=s=l=null,w.destroy()}},y=Rl(b),w=gf(b,r);function x(e,t){return $(t,(function(t){return f.is(t,e)}))}function C(e){return f.getParents(e,null,f.getRoot())}return b.bookmarkManager=y,b.controlSelection=w,b}function vh(e){var t,n=decodeURIComponent(e).split(","),r=/data:([^;]+)/.exec(n[0]);return{type:t=r?r[1]:t,data:n[1]}}function bh(e,t){var n;try{n=atob(t)}catch(e){return ve.none()}for(var r=new Uint8Array(n.length),o=0;o<r.length;o++)r[o]=n.charCodeAt(o);return ve.some(new Blob([r],{type:e}))}function yh(e){return 0===e.indexOf("blob:")?(t=e,new kr((function(e,n){function r(){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(e){r()}}))):0===e.indexOf("data:")?(n=e,new kr((function(e){var t=vh(n);bh(t.type,t.data).fold((function(){return e(new Blob([]))}),e)}))):null;var t,n}function wh(e){return(e||"blobid")+Lh++}function xh(e,t,n,r){(e.padd_empty_with_br||t.insert)&&n[r.name]?r.empty().append(new Nd("br",1)).shortEnded=!0:r.empty().append(new Nd("#text",3)).value=vo}function Ch(e,t,n,r){return r.isEmpty(t,n,(function(t){return(n=e.getElementRule(t.name))&&n.paddEmpty;var n}))}function Sh(e,t){void 0===t&&(t=Qr());var n={},r=[],o={},i={};function a(e){var t=e.name;t in n&&((u=o[t])?u.push(e):o[t]=[e]);for(var a=r.length;a--;){var u,c=r[a].name;c in e.attributes.map&&((u=i[c])?u.push(e):i[c]=[e])}return e}(e=e||{}).validate=!("validate"in e)||e.validate,e.root_name=e.root_name||"body";var c={schema:t,addAttributeFilter:function(e,t){jh(Uh(e),(function(e){for(var n=0;n<r.length;n++)if(r[n].name===e)return void r[n].callbacks.push(t);r.push({name:e,callbacks:[t]})}))},getAttributeFilters:function(){return[].concat(r)},addNodeFilter:function(e,t){jh(Uh(e),(function(e){var r=n[e];r||(n[e]=r=[]),r.push(t)}))},getNodeFilters:function(){var e,t=[];for(e in n)Te(n,e)&&t.push({name:e,callbacks:n[e]});return t},filterNode:a,parse:function(u,c){var s,l,f,d,m,g,p,h,v=[];function b(e){for(var n=t.getBlockElements(),r=e.prev;r&&3===r.type;){var o=r.value.replace(E,"");if(0<o.length)return r.value=o,0;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 a=r.prev;r.remove(),r=a}}function y(e,t){var r,i=new Nd(e,t);return e in n&&((r=o[e])?r.push(i):o[e]=[i]),i}c=c||{},o={},i={};var w=Wh(Vh("script,style,head,html,body,title,meta,param"),t.getBlockElements()),x=t.getNonEmptyElements(),C=t.children,S=e.validate,k=("forced_root_block"in c?c:e).forced_root_block,T=!1===k?"":!0===k?"p":k,O=t.getWhiteSpaceElements(),_=/^[ \t\r\n]+/,E=/[ \t\r\n]+$/,A=/[ \t\r\n]+/g,D=/^[ \t\r\n]+$/,M=Te(O,c.context)||Te(O,e.root_name),N=Ud({validate:S,document:e.document,allow_html_data_urls:e.allow_html_data_urls,allow_svg_data_urls:e.allow_svg_data_urls,allow_script_urls:e.allow_script_urls,allow_conditional_comments:e.allow_conditional_comments,preserve_cdata:e.preserve_cdata,self_closing_elements:function(e){var t,n={};for(t in e)"li"!==t&&"p"!==t&&(n[t]=e[t]);return n}(t.getSelfClosingElements()),cdata:function(e){h.append(y("#cdata",4)).value=e},text:function(e,t){var n,r;M||(e=e.replace(A," "),(r=h.lastChild)&&(Te(w,r.name)||"br"===r.name)&&(e=e.replace(_,""))),0!==e.length&&((n=y("#text",3)).raw=!!t,h.append(n).value=e)},comment:function(e){h.append(y("#comment",8)).value=e},pi:function(e,t){h.append(y(e,7)).value=t,b(h)},doctype:function(e){h.append(y("#doctype",10)).value=e,b(h)},start:function(e,n,o){var a=S?t.getElementRule(e):{};if(a){var u=y(a.outputName||e,1);u.attributes=n,u.shortEnded=o,h.append(u);var c=C[h.name];c&&C[u.name]&&!c[u.name]&&v.push(u);for(var s=r.length;s--;){var l=r[s].name;l in n.map&&((g=i[l])?g.push(u):i[l]=[u])}w[e]&&b(u),o||(h=u),!M&&O[e]&&(M=!0)}},end:function(n){var r,o,i,a,u,s=S?t.getElementRule(n):{};if(s){if(w[n]&&!M){if((r=h.firstChild)&&3===r.type)if(0<(o=r.value.replace(_,"")).length)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=h.lastChild)&&3===r.type)if(0<(o=r.value.replace(E,"")).length)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}if(M&&O[n]&&(M=!1),s.removeEmpty&&Ch(t,x,O,h))return a=h.parent,w[h.name]?h.empty().remove():h.unwrap(),void(h=a);s.paddEmpty&&(Hh(u=h,"#text")&&u.firstChild.value===vo||Ch(t,x,O,h))&&xh(e,c,w,h),h=h.parent}}},t),R=h=new Nd(c.context||e.root_name,11);if(N.parse(u,c.format),S&&v.length&&(c.context?c.invalid=!0:function(e){for(var n=Vh("tr,td,th,tbody,thead,tfoot,table"),r=t.getNonEmptyElements(),o=t.getWhiteSpaceElements(),i=t.getTextBlockElements(),u=t.getSpecialElements(),c=function(e,n){if(void 0===n&&(n=e.parent),u[e.name])e.empty().remove();else{for(var r=0,o=e.children();r<o.length;r++){var i=o[r];t.isValidChild(n.name,i.name)||c(i,n)}e.unwrap()}},s=0;s<e.length;s++){var l,f=e[s],d=void 0,m=void 0;if(f.parent&&!f.fixed)if(i[f.name]&&"li"===f.parent.name){for(var g=f.next;g&&i[g.name];)g.name="li",g.fixed=!0,f.parent.insert(g,f.parent),g=g.next;f.unwrap()}else{var p=[f];for(d=f.parent;d&&!t.isValidChild(d.name,f.name)&&!n[d.name];d=d.parent)p.push(d);if(d&&1<p.length)if(t.isValidChild(d.name,f.name)){p.reverse();for(var h=l=a(p[0].clone()),v=0;v<p.length-1;v++){t.isValidChild(h.name,p[v].name)?(m=a(p[v].clone()),h.append(m)):m=h;for(var b=p[v].firstChild;b&&b!==p[v+1];){var y=b.next;m.append(b),b=y}h=m}Ch(t,r,o,l)?d.insert(f,p[0],!0):(d.insert(l,p[0],!0),d.insert(f,l)),d=p[0],(Ch(t,r,o,d)||Hh(d,"br"))&&d.empty().remove()}else c(f);else f.parent&&("li"!==f.name?t.isValidChild(f.parent.name,"div")&&t.isValidChild("div",f.name)?f.wrap(a(new Nd("div",1))):c(f):!(g=f.prev)||"ul"!==g.name&&"ol"!==g.name?!(g=f.next)||"ul"!==g.name&&"ol"!==g.name?f.wrap(a(new Nd("ul",1))):g.insert(f,g.firstChild,!0):g.append(f))}}}(v)),T&&("body"===R.name||c.isRootContent)&&function(){function n(e){e&&((r=e.firstChild)&&3===r.type&&(r.value=r.value.replace(_,"")),(r=e.lastChild)&&3===r.type&&(r.value=r.value.replace(E,"")))}var r=R.firstChild,o=null;if(t.isValidChild(R.name,T.toLowerCase())){for(;r;){var i=r.next;3===r.type||1===r.type&&"p"!==r.name&&!w[r.name]&&!r.attr("data-mce-type")?(o||((o=y(T,1)).attr(e.forced_root_block_attrs),R.insert(o,r)),o.append(r)):(n(o),o=null),r=i}n(o)}}(),!c.invalid){for(p in o)if(Te(o,p)){for(g=n[p],d=(s=o[p]).length;d--;)s[d].parent||s.splice(d,1);for(l=0,f=g.length;l<f;l++)g[l](s,p,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(e,t){var n,r,o,i=e.schema;function a(e){var t,n,i=e.attr("src");(t=e).attr("src")===xt.transparentSrc||u(t.attr("data-mce-placeholder"))||u(e.attr("data-mce-bogus"))||((n=/data:([^;]+);base64,([a-z0-9\+\/=\s]+)/i.exec(i))?ve.some({type:n[1],data:decodeURIComponent(n[2])}):ve.none()).filter((function(){return function(e,t){if(t.images_dataimg_filter){var n=new Image;return n.src=e.attr("src"),ne(e.attributes.map,(function(e,t){n.setAttribute(t,e)})),t.images_dataimg_filter(n)}return!0}(e,r)})).bind((function(e){var t=e.type,n=e.data;return ve.from(o.getByData(n,t)).orThunk((function(){return bh(t,n).map((function(e){var t=o.create(wh(),e,n);return o.add(t),t}))}))})).each((function(t){e.attr("src",t.blobUri())}))}t.remove_trailing_brs&&e.addNodeFilter("br",(function(e,n,r){var o,a,u,c,s,l,f,d,m=e.length,g=kt.extend({},i.getBlockElements()),p=i.getNonEmptyElements(),h=i.getWhiteSpaceElements();for(g.body=1,o=0;o<m;o++)if(u=(a=e[o]).parent,g[a.parent.name]&&a===u.lastChild){for(s=a.prev;s;){if("span"!==(l=s.name)||"bookmark"!==s.attr("data-mce-type")){"br"===l&&(a=null);break}s=s.prev}a&&(a.remove(),Ch(i,p,h,u)&&(f=i.getElementRule(u.name))&&(f.removeEmpty?u.remove():f.paddEmpty&&xh(t,r,g,u)))}else{for(c=a;u&&u.firstChild===c&&u.lastChild===c&&!g[(c=u).name];)u=u.parent;c===u&&!0!==t.padd_empty_with_br&&((d=new Nd("#text",3)).value=vo,a.replace(d))}})),e.addAttributeFilter("href",(function(e){var n,r,o=e.length;if(!t.allow_unsafe_link_target)for(;o--;){var i=e[o];"a"===i.name&&"_blank"===i.attr("target")&&i.attr("rel",(r=void 0,r=(n=i.attr("rel"))?kt.trim(n):"",/\b(noopener)\b/g.test(r)?r:r.split(" ").filter((function(e){return 0<e.length})).concat(["noopener"]).sort().join(" ")))}})),t.allow_html_in_named_anchor||e.addAttributeFilter("id,name",(function(e){for(var t,n,r,o,i=e.length;i--;)if("a"===(o=e[i]).name&&o.firstChild&&!o.attr("href"))for(r=o.parent,t=o.lastChild;n=t.prev,r.insert(t,o),t=n;);})),t.fix_list_elements&&e.addNodeFilter("ul,ol",(function(e){for(var t,n,r,o=e.length;o--;)"ul"!==(r=(n=e[o]).parent).name&&"ol"!==r.name||(n.prev&&"li"===n.prev.name?n.prev.append(n):((t=new Nd("li",1)).attr("style","list-style-type: none"),n.wrap(t)))})),t.validate&&i.getValidClasses()&&e.addAttributeFilter("class",(function(e){for(var t=i.getValidClasses(),n=e.length;n--;){for(var r=e[n],o=r.attr("class").split(" "),a="",u=0;u<o.length;u++){var c=o[u],s=!1,l=t["*"];l&&l[c]&&(s=!0),l=t[r.name],(s=!(s||!l||!l[c])||s)&&(a&&(a+=" "),a+=c)}a.length||(a=null),r.attr("class",a)}})),n=e,(o=(r=t).blob_cache)&&n.addAttributeFilter("src",(function(e){return F(e,a)}))}(c,e),e.inline_styles&&function(e,t){var n,r,o,i,a=to();t.convert_fonts_to_spans&&(r=e,o=a,i=kt.explode(t.font_size_legacy_values),r.addNodeFilter("font",(function(e){F(e,(function(e){var t,n=o.parse(e.attr("style")),r=e.attr("color"),a=e.attr("face"),u=e.attr("size");r&&(n.color=r),a&&(n["font-family"]=a),u&&(n["font-size"]=i[parseInt(e.attr("size"),10)-1]),e.name="span",e.attr("style",o.serialize(n)),t=e,F(["color","face","size"],(function(e){t.attr(e,null)}))}))}))),n=a,e.addNodeFilter("strike",(function(e){F(e,(function(e){var t=n.parse(e.attr("style"));t["text-decoration"]="line-through",e.name="span",e.attr("style",n.serialize(t))}))}))}(c,e),c}function kh(e,t,n){-1===kt.inArray(t,n)&&(e.addAttributeFilter(n,(function(e,t){for(var n=e.length;n--;)e[n].attr(t,null)})),t.push(n))}function Th(e,t){var n=function(e,t){var n=["data-mce-selected"],r=t&&t.dom?t.dom:Xa.DOM,o=t&&t.schema?t.schema:Qr(e);e.entity_encoding=e.entity_encoding||"named",e.remove_trailing_brs=!("remove_trailing_brs"in e)||e.remove_trailing_brs;var i,a=Sh(e,o),u=e,c=r;return(i=a).addAttributeFilter("data-mce-tabindex",(function(e,t){for(var n=e.length;n--;){var r=e[n];r.attr("tabindex",r.attr("data-mce-tabindex")),r.attr(t,null)}})),i.addAttributeFilter("src,href,style",(function(e,t){for(var n="data-mce-"+t,r=u.url_converter,o=u.url_converter_scope,i=e.length;i--;){var a=e[i],s=a.attr(n);void 0!==s?(a.attr(t,0<s.length?s:null),a.attr(n,null)):(s=a.attr(t),"style"===t?s=c.serializeStyle(c.parseStyle(s),a.name):r&&(s=r.call(o,s,t,a.name)),a.attr(t,0<s.length?s:null))}})),i.addAttributeFilter("class",(function(e){for(var t=e.length;t--;){var n,r=e[t];r.attr("class")&&(n=r.attr("class").replace(/(?:^|\s)mce-item-\w+(?!\S)/g,""),r.attr("class",0<n.length?n:null))}})),i.addAttributeFilter("data-mce-type",(function(e,t,n){for(var r=e.length;r--;){var o=e[r];"bookmark"!==o.attr("data-mce-type")||n.cleanup||(ve.from(o.firstChild).exists((function(e){return!yo(e.value)}))?o.unwrap():o.remove())}})),i.addNodeFilter("noscript",(function(e){for(var t=e.length;t--;){var n=e[t].firstChild;n&&(n.value=Ko.decode(n.value))}})),i.addNodeFilter("script,style",(function(e,t){for(var n=function(e){return e.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,"")},r=e.length;r--;){var o,i=e[r],a=i.firstChild?i.firstChild.value:"";"script"===t?((o=i.attr("type"))&&i.attr("type","mce-no/type"===o?null:o.replace(/^mce\-/,"")),"xhtml"===u.element_format&&0<a.length&&(i.firstChild.value="// <![CDATA[\n"+n(a)+"\n// ]]>")):"xhtml"===u.element_format&&0<a.length&&(i.firstChild.value="\x3c!--\n"+n(a)+"\n--\x3e")}})),i.addNodeFilter("#comment",(function(e){for(var t=e.length;t--;){var n=e[t];u.preserve_cdata&&0===n.value.indexOf("[CDATA[")?(n.name="#cdata",n.type=4,n.value=c.decode(n.value.replace(/^\[CDATA\[|\]\]$/g,""))):0===n.value.indexOf("mce:protected ")&&(n.name="#text",n.type=3,n.raw=!0,n.value=unescape(n.value).substr(14))}})),i.addNodeFilter("xml:namespace,input",(function(e,t){for(var n=e.length;n--;){var r=e[n];7===r.type?r.remove():1===r.type&&("input"!==t||r.attr("type")||r.attr("type","text"))}})),i.addAttributeFilter("data-mce-type",(function(e){F(e,(function(e){"format-caret"===e.attr("data-mce-type")&&(e.isEmpty(i.schema.getNonEmptyElements())?e.remove():e.unwrap())}))})),i.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(e,t){for(var n=e.length;n--;)e[n].attr(t,null)})),{schema:o,addNodeFilter:a.addNodeFilter,addAttributeFilter:a.addAttributeFilter,serialize:function(n,i){var u,c,s,l,f,d,m,g,p,h,v,b,y,w,x,C,S,k,T,O,_,E,A,D,M,N,R,z,B,P=_e({format:"html"},i=void 0===i?{}:i),I=(b=n,A=y=P,u=(v=t)&&v.hasEventListeners("PreProcess")&&!A.no_events?(x=y,O=(w=v).dom,_=b.cloneNode(!0),(E=document.implementation).createHTMLDocument&&(S=E.createHTMLDocument(""),kt.each("BODY"===_.nodeName?_.childNodes:[_],(function(e){S.body.appendChild(S.importNode(e,!0))})),_="BODY"!==_.nodeName?S.body.firstChild:S.body,C=O.doc,O.doc=S),k=w,T=_e(_e({},x),{node:_}),k.fire("PreProcess",T),C&&(O.doc=C),_):b,s=wo((c=P).getInner?u.innerHTML:r.getOuterHTML(u)),c.selection||po(Tt.fromDom(u))?s:kt.trim(s)),F=(l=a,f=I,m=(d=P).selection?_e({forced_root_block:!1},d):d,!L(h=(g=l.parse(f,m)).lastChild)||L(p=h.prev)&&(h.remove(),p.remove()),g);function L(e){return e&&"br"===e.name}return"tree"===P.format?F:(D=t,M=P,N=F,B=Xd(e,o).serialize(N),M.no_events||!D?B:(R=D,z=_e(_e({},M),{content:B}),R.fire("PostProcess",z).content))},addRules:o.addValidElements,setRules:o.setValidElements,addTempAttr:T(kh,a,n),getTempAttrs:f(n),getNodeFilters:a.getNodeFilters,getAttributeFilters:a.getAttributeFilters}}(e,t);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}}function Oh(e,t,n){return r=n=void 0===n?{}:n,Jp(e).editor.setContent(t,r);var r}function _h(e){return ve.from(e).each((function(e){return e.destroy()}))}function Eh(e){var t=y(e)?e.join(" "):e;return V(I(v(t)?t.split(" "):[],Je),(function(e){return 0<e.length}))}function Ah(e,t){return Te(e.sections(),t)}function Dh(e,t){return ue(e,"toolbar_mode").orThunk((function(){return ue(e,"toolbar_drawer").map((function(e){return!1===e?"wrap":e}))})).getOr(t)}function Mh(e,t,n,r,o){var i,a,u,c,s,l,d,m,g=e?{mobile:(i=t,a={resize:!1,toolbar_mode:Dh(o.mobile||{},"scrolling"),toolbar_sticky:!1},_e(_e(_e({},tv),a),i?{menubar:!1}:{}))}:{},p=(s=["mobile"],ie(qh(g,o),(function(e,t){return B(s,t)}),oe(l={}),oe(d={})),{sections:f((m={t:l,f:d}).t),settings:f(m.f)}),h=kt.extend(n,r,p.settings(),e&&Ah(p,"mobile")?function(e){void 0===e&&(e={});var t=ue(p.sections(),"mobile").getOr({});return kt.extend({},e,t)}():{},{validate:!0,external_plugins:(u=r,c=p.settings().external_plugins||{},u&&u.external_plugins?kt.extend({},u.external_plugins,c):c)});return function(e,t,n,r){var o,i,a,u,c,s,l,f,d=Eh(n.forced_plugins),m=Eh(r.plugins),g=Ah(o=t,"mobile")?o.sections().mobile:{},p=(u=t,c=m,s=g.plugins?Eh(g.plugins):m,i=(a=e)&&(f=(l=u).sections(),Ah(l,"mobile")&&"mobile"===f.mobile.theme)?V(s,T(B,ev)):a&&Ah(u,"mobile")?s:c,[].concat(Eh(d)).concat(Eh(i)));if(xt.browser.isIE()&&B(p,"rtc"))throw new Error("RTC plugin is not supported on IE 11.");return kt.extend(r,{plugins:p.join(" ")})}(e,p,r,h)}function Nh(e,t,n){return ve.from(t.settings[n]).filter(e)}function Rh(e,t){return t.dom[e]}function zh(e,t){return parseInt(wn(t,e),10)}function Bh(e,t,n){var r,o,i,a,u,c,s=Tt.fromDom(e.getBody()),l=e.inline?s:Tt.fromDom(Dt(s).dom.documentElement),f=(r=e.inline,i=t,a=n,u=(o=l).dom.getBoundingClientRect(),{x:i-(r?u.left+o.dom.clientLeft+av(o):0),y:a-(r?u.top+o.dom.clientTop+iv(o):0)}),d=f.x,m=f.y,g=rv(c=l),p=ov(c);return 0<=d&&0<=m&&d<=g&&m<=p}function Ph(e){function t(){var t=e.theme;return t&&t.getNotificationManagerImpl?t.getNotificationManagerImpl():{open:n,close:n,reposition:n,getArgs:n};function n(){throw new Error("Theme did not provide a NotificationManager implementation.")}}function n(){return ve.from(u[0])}function r(){0<u.length&&t().reposition(u)}function o(e){q(u,(function(t){return t===e})).each((function(e){u.splice(e,1)}))}function i(i,a){if(void 0===a&&(a=!0),!e.removed&&(s=(c=e).inline?c.getBody():c.getContentAreaContainer(),ve.from(s).map(Tt.fromDom).map(Bn).getOr(!1)))return a&&e.fire("BeforeOpenNotification",{notification:i}),$(u,(function(e){return!((n=t().getArgs(e)).type!==i.type||n.text!==i.text||n.progressBar||n.timeout||i.progressBar||i.timeout);var n})).getOrThunk((function(){e.editorManager.setActive(e);var a=t().open(i,(function(){o(a),r(),n().fold((function(){return e.focus()}),(function(e){return Tt.fromDom(e.getEl()).dom.focus()}))}));return u.push(a),r(),e.fire("OpenNotification",{notification:_e({},a)}),a}));var c,s}var a,u=[],c=f(u);return(a=e).on("SkinLoaded",(function(){var e=a.getParam("service_message");e&&i({text:e,type:"warning",timeout:0},!1),r()})),a.on("show ResizeEditor ResizeWindow NodeChange",(function(){Tr.requestAnimationFrame(r)})),a.on("remove",(function(){F(u.slice(),(function(e){t().close(e)}))})),{open:i,close:function(){n().each((function(e){t().close(e),o(e),r()}))},getNotifications:c}}var Ih,Fh,Lh=0,Hh=function(e,t){return e&&e.firstChild&&e.firstChild===e.lastChild&&e.firstChild.name===t},Vh=kt.makeMap,jh=kt.each,Uh=kt.explode,Wh=kt.extend,$h=Xa.DOM,qh=(Ih=function(e,t){return b(e)&&b(t)?qh(e,t):t},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(0===e.length)throw new Error("Can't merge zero objects");for(var n={},r=0;r<e.length;r++){var o,i=e[r];for(o in i)Te(i,o)&&(n[o]=Ih(n[o],i[o]))}return n}),Gh="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(","),Kh="bbcode,colorpicker,contextmenu,fullpage,legacyoutput,spellchecker,textcolor".split(","),Xh="imagetools,toc".split(","),Yh=dt().deviceType,Jh=Yh.isTouch(),Zh=Yh.isPhone(),Qh=Yh.isTablet(),ev=["lists","autolink","autosave"],tv={table_grid:!1,object_resizing:!1,resize:!1},nv=(Fh={},{add:function(e,t){Fh[e]=t},get:function(e){return Fh[e]||{icons:{}}},has:function(e){return Te(Fh,e)}}),rv=T(Rh,"clientWidth"),ov=T(Rh,"clientHeight"),iv=T(zh,"margin-top"),av=T(zh,"margin-left"),uv=au.PluginManager,cv=au.ThemeManager;function sv(e){function t(){var t=e.theme;return t&&t.getWindowManagerImpl?t.getWindowManagerImpl():{open:n,openUrl:n,alert:n,confirm:n,close:n,getParams:n,setParams:n};function n(){throw new Error("Theme did not provide a WindowManager implementation.")}}function n(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t?t.apply(e,n):void 0}}function r(t){e.fire("CloseWindow",{dialog:t}),0===(i=V(i,(function(e){return e!==t}))).length&&e.focus()}function o(t){e.editorManager.setActive(e),rd(e);var n,r=t();return n=r,i.push(n),e.fire("OpenWindow",{dialog:n}),r}var i=[];return e.on("remove",(function(){F(i,(function(e){t().close(e)}))})),{open:function(e,n){return o((function(){return t().open(e,n,r)}))},openUrl:function(e){return o((function(){return t().openUrl(e,r)}))},alert:function(e,r,o){var i=t();i.alert(e,n(o||i,r))},confirm:function(e,r,o){var i=t();i.confirm(e,n(o||i,r))},close:function(){ve.from(i[i.length-1]).each((function(e){t().close(e),r(e)}))}}}function lv(e,t){e.notificationManager.open({type:"error",text:t})}function fv(e,t){e._skinLoaded?lv(e,t):e.on("SkinLoaded",(function(){lv(e,t)}))}function dv(e,t,n){ff(e,t,{message:n}),console.error(n)}function mv(e,t,n){return n?"Failed to load "+e+": "+n+" from url "+t:"Failed to load "+e+" url: "+t}function gv(e,t,n){dv(e,"PluginLoadError",mv("plugin",t,n))}function pv(){function e(e,t){return{status:e,resultUri:t}}function t(e){return e in n}var n={};return{hasBlobUri:t,getResultUri:function(e){var t=n[e];return t?t.resultUri:null},isPending:function(e){return!!t(e)&&1===n[e].status},isUploaded:function(e){return!!t(e)&&2===n[e].status},markPending:function(t){n[t]=e(1,null)},markUploaded:function(t,r){n[t]=e(2,r)},removeFailed:function(e){delete n[e]},destroy:function(){n={}}}}function hv(e){return e+Pb+++"s"+(new Date).getTime().toString(36)+t()+t()+t();function t(){return Math.round(4294967295*Math.random()).toString(36)}}function vv(){function e(e){return $(r,e).getOrUndefined()}function t(e){if(!e.blob||!e.base64)throw new Error("blob and base64 representations of the image are required for BlobInfo to be created");var t=e.id||hv("blobid"),n=e.name||t,r=e.blob;return{id:f(t),name:f(n),filename:f(e.filename||n+"."+({"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"}[r.type.toLowerCase()]||"dat")),blob:f(r),base64:f(e.base64),blobUri:f(e.blobUri||URL.createObjectURL(r)),uri:f(e.uri)}}function n(t){return e((function(e){return e.id()===t}))}var r=[];return{create:function(e,n,r,o,i){if(v(e))return t({id:e,name:o,filename:i,blob:n,base64:r});if(b(e))return t(e);throw new Error("Unknown input type")},add:function(e){n(e.id())||r.push(e)},get:n,getByUri:function(t){return e((function(e){return e.blobUri()===t}))},getByData:function(t,n){return e((function(e){return e.base64()===t&&e.blob().type===n}))},findFirst:e,removeByUri:function(e){r=V(r,(function(t){return t.blobUri()!==e||void URL.revokeObjectURL(t.blobUri())}))},destroy:function(){F(r,(function(e){URL.revokeObjectURL(e.blobUri())})),r=[]}}}function bv(e){return function(){return e.notificationManager.open({text:e.translate("Image uploading..."),type:"info",timeout:-1,progressBar:!0})}}function yv(e,t){return function(e,t){function n(e,n,r,o){var i=new XMLHttpRequest;i.open("POST",t.url),i.withCredentials=t.credentials,i.upload.onprogress=function(e){o(e.loaded/e.total*100)},i.onerror=function(){r("Image upload failed due to a XHR Transport error. Code: "+i.status)},i.onload=function(){var e,o,a;i.status<200||300<=i.status?r("HTTP Error: "+i.status):(e=JSON.parse(i.responseText))&&"string"==typeof e.location?n((o=t.basePath,a=e.location,o?o.replace(/\/$/,"")+"/"+a.replace(/^\//,""):a)):r("Invalid JSON: "+i.responseText)};var a=new FormData;a.append("file",e.blob(),e.filename()),i.send(a)}function r(e,t){return{url:t,blobInfo:e,status:!0}}function o(e,t,n){return{url:"",blobInfo:e,status:!1,error:{message:t,options:n}}}function i(e,t){kt.each(a[e],(function(e){e(t)})),delete a[e]}var a={};return!1===S(t.handler)&&(t.handler=n),{upload:function(u,c){return t.url||t.handler!==n?(l=c,s=kt.grep(u,(function(t){return!e.isUploaded(t.blobUri())})),kr.all(kt.map(s,(function(n){return e.isPending(n.blobUri())?(f=n.blobUri(),new kr((function(e){a[f]=a[f]||[],a[f].push(e)}))):(u=n,c=t.handler,s=l,e.markPending(u.blobUri()),new kr((function(t){var n;try{var a=function(){n&&n.close()};c(u,(function(n){a(),e.markUploaded(u.blobUri(),n),i(u.blobUri(),r(u,n)),t(r(u,n))}),(function(n,r){var c=r||{};a(),e.removeFailed(u.blobUri()),i(u.blobUri(),o(u,n,c)),t(o(u,n,c))}),(function(e){e<0||100<e||ve.from(n).orThunk((function(){return ve.from(s).map(_)})).each((function(t){(n=t).progressBar.value(e)}))}))}catch(e){t(o(u,e.message,{}))}})));var u,c,s,f})))):new kr((function(e){e([])}));var s,l}}}(t,{url:e.getParam("images_upload_url","","string"),basePath:e.getParam("images_upload_base_path","","string"),credentials:e.getParam("images_upload_credentials",!1,"boolean"),handler:e.getParam("images_upload_handler",null,"function")})}function wv(e){function t(t){return function(n){return e.selection?t(n):[]}}function n(e,t,n){for(var r=0;-1!==(r=e.indexOf(t,r))&&(e=e.substring(0,r)+n+e.substr(r+t.length),r+=n.length-t.length+1),-1!==r;);return e}function r(e,t,r){return e=n(e,'src="'+t+'"','src="'+r+'"'+(r===xt.transparentSrc?' data-mce-placeholder="1"':"")),n(e,'data-mce-src="'+t+'"','data-mce-src="'+r+'"')}function o(t,n){F(e.undoManager.data,(function(e){"fragmented"===e.type?e.fragments=I(e.fragments,(function(e){return r(e,t,n)})):e.content=r(e.content,t,n)}))}function i(n){return s=s||yv(e,g),v().then(t((function(r){var i=I(r,(function(e){return e.blobInfo}));return s.upload(i,bv(e)).then(t((function(t){var i=[],a=I(t,(function(t,n){var a,u,c,s,l=r[n].blobInfo,f=r[n].image;return t.status&&e.getParam("images_replace_blob_uris",!0,"boolean")?(m.removeByUri(f.src),Xp(e)||(u=f,c=t.url,s=e.convertURL(c,"src"),o(u.src,c),e.$(u).attr({src:e.getParam("images_reuse_filename",!1,"boolean")?c+(-1===c.indexOf("?")?"?":"&")+(new Date).getTime():c,"data-mce-src":s}))):t.error&&(t.error.options.remove&&(o(f.getAttribute("src"),xt.transparentSrc),i.push(f)),a=t.error.message,fv(e,iu.translate(["Failed to upload image: {0}",a]))),{element:f,status:t.status,uploadUri:t.url,blobInfo:l}}));return 0<a.length&&h.fireIfChanged(),0<i.length&&(Xp(e)?console.error("Removing images on failed uploads is currently unsupported for RTC"):e.undoManager.transact((function(){F(i,(function(t){e.dom.remove(t),m.removeByUri(t.src)}))}))),n&&n(a),a})))})))}function a(t){if(Cc(e))return i(t)}function u(t){return!1!==K(p,(function(e){return e(t)}))&&(0!==t.getAttribute("src").indexOf("data:")||e.getParam("images_dataimg_filter",M,"function")(t))}function c(t){return t.replace(/src="(blob:[^"]+)"/g,(function(t,n){var r=g.getResultUri(n);if(r)return'src="'+r+'"';var o=(o=m.getByUri(n))||U(e.editorManager.get(),(function(e,t){return e||t.editorUpload&&t.editorUpload.blobCache.getByUri(n)}),null);return o?'src="data:'+o.blob().type+";base64,"+o.base64()+'"':t}))}var s,l,f,d,m=vv(),g=pv(),p=[],h=(d=tu(null),(f=e).on("change AddUndo",(function(e){d.set(_e({},e.level))})),{fireIfChanged:function(){var e=f.undoManager.data;ee(e).filter((function(e){return!Wp(d.get(),e)})).each((function(t){f.setDirty(!0),f.fire("change",{level:t,lastLevel:Z(e,e.length-2).getOrNull()})}))}}),v=function(){return(l=l||function(e,t){var n={};return{findAll:function(r,o){o=o||M;var i=I(V(r?xe(r.getElementsByTagName("img")):[],(function(t){var n=t.src;return xt.fileApi&&!t.hasAttribute("data-mce-bogus")&&!t.hasAttribute("data-mce-placeholder")&&n&&n!==xt.transparentSrc&&(0===n.indexOf("blob:")?!e.isUploaded(n)&&o(t):0===n.indexOf("data:")&&o(t))})),(function(e){if(void 0!==n[e.src])return new kr((function(t){n[e.src].then((function(n){return"string"==typeof n?n:void t({image:e,blobInfo:n.blobInfo})}))}));var r=new kr((function(n,r){var o,i,a,u,c,s,l,f,d;o=t,a=n,u=r,0!==(i=e).src.indexOf("blob:")?(s=(c=vh(i.src)).data,l=c.type,f=s,(d=o.getByData(f,l))?a({image:i,blobInfo:d}):yh(i.src).then((function(e){d=o.create(wh(),e,f),o.add(d),a({image:i,blobInfo:d})}),(function(e){u(e)}))):(d=o.getByUri(i.src))?a({image:i,blobInfo:d}):yh(i.src).then((function(e){var t=e;new kr((function(e){var n=new FileReader;n.onloadend=function(){e(n.result)},n.readAsDataURL(t)})).then((function(t){f=vh(t).data,d=o.create(wh(),e,f),o.add(d),a({image:i,blobInfo:d})}))}),(function(e){u(e)}))})).then((function(e){return delete n[e.image.src],e})).catch((function(t){return delete n[e.src],t}));return n[e.src]=r}));return kr.all(i)}}}(g,m)).findAll(e.getBody(),u).then(t((function(t){return t=V(t,(function(t){return"string"!=typeof t||void fv(e,t)})),Xp(e)||F(t,(function(e){o(e.image.src,e.blobInfo.blobUri()),e.image.src=e.blobInfo.blobUri(),e.image.removeAttribute("data-mce-src")})),t})))};return e.on("SetContent",(function(){(Cc(e)?a:v)()})),e.on("RawSaveContent",(function(e){e.content=c(e.content)})),e.on("GetContent",(function(e){e.source_view||"raw"===e.format||"tree"===e.format||(e.content=c(e.content))})),e.on("PostRender",(function(){e.parser.addNodeFilter("img",(function(e){F(e,(function(e){var t,n=e.attr("src");m.getByUri(n)||(t=g.getResultUri(n))&&e.attr("src",t)}))}))})),{blobCache:m,addFilter:function(e){p.push(e)},uploadImages:i,uploadImagesAuto:a,scanForImages:v,destroy:function(){m.destroy(),g.destroy(),l=s=null}}}function xv(e,t){function n(e){o="string"==typeof e?{name:e,classes:[],attrs:{}}:e;var t,n=Fb.create(o.name),r=n;return(t=o).classes.length&&Fb.addClass(r,t.classes.join(" ")),Fb.setAttribs(r,t.attrs),n}var r,o,i,a=t&&t.schema||Qr({}),u=function(e,t,r){var o,i,c,s,l,f,d,m=0<t.length&&t[0],g=m&&m.name,p=(s=g,l="string"!=typeof(c=e)?c.nodeName.toLowerCase():c,!(!(d=(f=a.getElementRule(l))&&f.parentsRequired)||!d.length)&&(s&&-1!==kt.inArray(d,s)?s:d[0]));if(p)g===p?(i=t[0],t=t.slice(1)):i=p;else if(m)i=t[0],t=t.slice(1);else if(!r)return e;return i&&(o=n(i)).appendChild(e),r&&(o||(o=Fb.create("div")).appendChild(e),kt.each(r,(function(t){var r=n(t);o.insertBefore(r,e)}))),u(o,t,i&&i.siblings)};return e&&e.length?(r=n(o=e[0]),(i=Fb.create("div")).appendChild(u(r,e.slice(1),o.siblings)),i):""}function Cv(e){var t,n={classes:[],attrs:{}};return"*"!==(e=n.selector=kt.trim(e))&&(t=e.replace(/(?:([#\.]|::?)([\w\-]+)|(\[)([^\]]+)\]?)/g,(function(e,t,r,o,i){switch(t){case"#":n.attrs.id=r;break;case".":n.classes.push(r);break;case":":-1!==kt.inArray("checked disabled enabled read-only required".split(" "),r)&&(n.attrs[r]=r)}var a;return"["!==o||(a=i.match(/([\w\-]+)(?:\=\"([^\"]+))?/))&&(n.attrs[a[1]]=a[2]),""}))),n.name=t||"div",n}function Sv(e,t){var n,r,o="",i=(r=e.getParam("preview_styles","font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius outline text-shadow"),v(r)?r:"");if(""===i)return"";function a(e){return e.replace(/%(\w+)/g,"")}if("string"==typeof t){if(!(t=e.formatter.get(t)))return;t=t[0]}if("preview"in t){var u=ue(t,"preview");if(fn(u,!1))return"";i=u.getOr(i)}var c,s=t.block||t.inline||"span",l=(c=t.selector)&&"string"==typeof c?(c=(c=c.split(/\s*,\s*/)[0]).replace(/\s*(~\+|~|\+|>)\s*/g,"$1"),kt.map(c.split(/(?:>|\s+(?![^\[\]]+\]))/),(function(e){var t=kt.map(e.split(/(?:~\+|~|\+)/),Cv),n=t.pop();return t.length&&(n.siblings=t),n})).reverse()):[],f=l.length?(l[0].name||(l[0].name=s),s=t.selector,xv(l,e)):xv([s],e),d=Fb.select(s,f)[0]||f.firstChild;return Ib(t.styles,(function(e,t){var n=a(e);n&&Fb.setStyle(d,t,n)})),Ib(t.attributes,(function(e,t){var n=a(e);n&&Fb.setAttrib(d,t,n)})),Ib(t.classes,(function(e){var t=a(e);Fb.hasClass(d,t)||Fb.addClass(d,t)})),e.fire("PreviewFormats"),Fb.setStyles(f,{position:"absolute",left:-65535}),e.getBody().appendChild(f),n=Fb.getStyle(e.getBody(),"fontSize",!0),n=/px$/.test(n)?parseInt(n,10):0,Ib(i.split(" "),(function(t){var r=Fb.getStyle(d,t,!0);if(!("background-color"===t&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(r)&&(r=Fb.getStyle(e.getBody(),t,!0),"#ffffff"===Fb.toHex(r).toLowerCase())||"color"===t&&"#000000"===Fb.toHex(r).toLowerCase())){if("font-size"===t&&/em|%$/.test(r)){if(0===n)return;r=parseFloat(r)/(/%$/.test(r)?100:1)*n+"px"}"border"===t&&r&&(o+="padding:0 2px;"),o+=t+":"+r+";"}})),e.fire("AfterPreviewFormats"),Fb.remove(f),o}function kv(e){var t,n,r,o,i,a,c=(o={},(i=function(e,t){e&&(v(e)?(F(t=y(t)?t:[t],(function(e){C(e.deep)&&(e.deep=!ul(e)),C(e.split)&&(e.split=!ul(e)||cl(e)),C(e.remove)&&ul(e)&&!cl(e)&&(e.remove="none"),ul(e)&&cl(e)&&(e.mixed=!0,e.block_expand=!0),v(e.classes)&&(e.classes=e.classes.split(/\s+/))})),o[e]=t):ne(e,(function(e,t){i(t,e)})))})((n=(t=e).dom,r={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(e,t,n){return Ln(e)&&e.hasAttribute("href")},onformat:function(e,t,r){kt.each(r,(function(t,r){n.setAttrib(e,r,t)}))}},lang:{inline:"span",clear_child_styles:!0,remove_similar:!0,attributes:{lang:"%value","data-mce-lang":function(e){var t;return null!==(t=null==e?void 0:e.customValue)&&void 0!==t?t: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}]},kt.each("p h1 h2 h3 h4 h5 h6 div address pre dt dd samp".split(/\s/),(function(e){r[e]={block:e,remove:"all"}})),r)),i(t.getParam("formats")),{get:function(e){return u(e)?o[e]:o},has:function(e){return Te(o,e)},register:i,unregister:function(e){return e&&o[e]&&delete o[e],o}}),s=tu(null);return function(e){e.addShortcut("meta+b","","Bold"),e.addShortcut("meta+i","","Italic"),e.addShortcut("meta+u","","Underline");for(var t=1;t<=6;t++)e.addShortcut("access+"+t,"",["FormatBlock",!1,"h"+t]);e.addShortcut("access+7","",["FormatBlock",!1,"p"]),e.addShortcut("access+8","",["FormatBlock",!1,"div"]),e.addShortcut("access+9","",["FormatBlock",!1,"address"])}(e),(a=e).on("mouseup keydown",(function(e){var t=a,n=e.keyCode,r=t.selection,o=t.getBody();Tg(t,null,!1),8!==n&&46!==n||!r.isCollapsed()||r.getStart().innerHTML!==rp||Tg(t,Is(o,r.getStart())),37!==n&&39!==n||Tg(t,Is(o,r.getStart()))})),{get:c.get,has:c.has,register:c.register,unregister:c.unregister,apply:function(t,n,r){var o=t,i=n,a=r;Zp(e).formatter.apply(o,i,a)},remove:function(t,n,r,o){var i=t,a=n,u=r,c=o;Zp(e).formatter.remove(i,a,u,c)},toggle:function(t,n,r){var o=t,i=n,a=r;Zp(e).formatter.toggle(o,i,a)},match:function(t,n,r,o){return i=t,a=n,u=r,c=o,Zp(e).formatter.match(i,a,u,c);var i,a,u,c},closest:function(t){return n=t,Zp(e).formatter.closest(n);var n},matchAll:function(t,n){return r=t,o=n,Zp(e).formatter.matchAll(r,o);var r,o},matchNode:function(t,n,r,o){return i=t,a=n,u=r,c=o,Zp(e).formatter.matchNode(i,a,u,c);var i,a,u,c},canApply:function(t){return n=t,Zp(e).formatter.canApply(n);var n},formatChanged:function(t,n,r,o){return i=s,a=t,u=n,c=r,l=o,Zp(e).formatter.formatChanged(i,a,u,c,l);var i,a,u,c,l},getCssText:T(Sv,e)}}function Tv(e){switch(e.toLowerCase()){case"undo":case"redo":case"mcerepaint":case"mcefocus":return 1;default:return}}function Ov(e){var t,n,r,o,i,a=uu(),u=tu(0),c=tu(0),s={data:[],typing:!1,beforeChange:function(){var t=u,n=a;Zp(e).undoManager.beforeChange(t,n)},add:function(t,n){return r=s,o=c,i=u,l=a,f=t,d=n,Zp(e).undoManager.add(r,o,i,l,f,d);var r,o,i,l,f,d},undo:function(){return t=s,n=u,r=c,Zp(e).undoManager.undo(t,n,r);var t,n,r},redo:function(){return t=c,n=s.data,Zp(e).undoManager.redo(t,n);var t,n},clear:function(){var t=s,n=c;Zp(e).undoManager.clear(t,n)},reset:function(){var t=s;Zp(e).undoManager.reset(t)},hasUndo:function(){return t=s,n=c,Zp(e).undoManager.hasUndo(t,n);var t,n},hasRedo:function(){return t=s,n=c,Zp(e).undoManager.hasRedo(t,n);var t,n},transact:function(t){return n=s,r=u,o=t,Zp(e).undoManager.transact(n,r,o);var n,r,o},ignore:function(t){var n=u,r=t;Zp(e).undoManager.ignore(n,r)},extra:function(t,n){var r=s,o=c,i=t,a=n;Zp(e).undoManager.extra(r,o,i,a)}};return Xp(e)||(r=s,o=u,i=tu(!1),(n=e).on("init",(function(){r.add()})),n.on("BeforeExecCommand",(function(e){Tv(e.command)||(Gp(r,o),r.beforeChange())})),n.on("ExecCommand",(function(e){Tv(e.command)||l(e)})),n.on("ObjectResizeStart cut",(function(){r.beforeChange()})),n.on("SaveContent ObjectResized blur",l),n.on("dragend",l),n.on("keyup",(function(e){var t=e.keyCode;e.isDefaultPrevented()||((33<=t&&t<=36||37<=t&&t<=40||45===t||e.ctrlKey)&&(l(),n.nodeChanged()),46!==t&&8!==t||n.nodeChanged(),i.get()&&r.typing&&!1===Wp(Hp(n),r.data[0])&&(!1===n.isDirty()&&(n.setDirty(!0),n.fire("change",{level:r.data[0],lastLevel:null})),n.fire("TypingUndo"),i.set(!1),n.nodeChanged()))})),n.on("keydown",(function(e){var t,n=e.keyCode;e.isDefaultPrevented()||(33<=n&&n<=36||37<=n&&n<=40||45===n?r.typing&&l(e):(t=e.ctrlKey&&!e.altKey||e.metaKey,!(n<16||20<n)||224===n||91===n||r.typing||t||(r.beforeChange(),qp(r,!0,o),r.add({},e),i.set(!0))))})),n.on("mousedown",(function(e){r.typing&&l(e)})),n.on("input",(function(e){e.inputType&&("insertReplacementText"===e.inputType||"insertText"===e.inputType&&null===e.data||"insertFromPaste"===e.inputType||"insertFromDrop"===e.inputType)&&l(e)})),n.on("AddUndo Undo Redo ClearUndos",(function(e){e.isDefaultPrevented()||n.nodeChanged()}))),(t=e).addShortcut("meta+z","","Undo"),t.addShortcut("meta+y,meta+shift+z","","Redo"),s;function l(e){qp(r,!1,o),r.add({},e)}}function _v(e){return"keydown"===e.type||"keyup"===e.type}function Ev(e){var t=e.keyCode;return t===_f.BACKSPACE||t===_f.DELETE}function Av(e,t){return He(Tt.fromDom(t),e.getParam("inline_boundaries_selector","a[href],code,.mce-annotation","string"))}function Dv(e,t,n){var r,o,i=(r=e,o=t,V(Xa.DOM.getParents(n.container(),"*",o),r));return ve.from(i[i.length-1])}function Mv(e,t){if(!t)return t;var n=t.container(),r=t.offset();return e?Rr(n)?Vn(n.nextSibling)?rc(n.nextSibling,0):rc.after(n):Pr(t)?rc(n,r+1):t:Rr(n)?Vn(n.previousSibling)?rc(n.previousSibling,n.previousSibling.data.length):rc.before(n):Ir(t)?rc(n,r-1):t}function Nv(e){return so(e)||fo(e)}function Rv(e,t){return Ue(e,t)?gr(t,Nv,(n=e,function(e){return je(n,Tt.fromDom(e.dom.parentNode))})):ve.none();var n}function zv(e){var t,n,r;e.dom.isEmpty(e.getBody())&&(e.setContent(""),r=(n=(t=e).getBody()).firstChild&&t.dom.isBlock(n.firstChild)?n.firstChild:n,t.selection.setCursorLocation(r,0))}function Bv(e,t){return{from:e,to:t}}function Pv(e,t){return Rv(Tt.fromDom(e),Tt.fromDom(t.container())).map((function(e){return{block:e,position:t}}))}function Iv(e){var t,n=q(t=An(e),co).fold(f(t),(function(e){return t.slice(0,e)}));return F(n,zn),n}function Fv(e,t){return $(sm(t,e).reverse(),(function(e){return Wr(e)})).each(zn)}function Lv(e,t,n,r){if(Wr(n))return am(n),Kl(n.dom);0===V(Bt(r),(function(e){return!Wr(e)})).length&&Wr(t)&&Wt(r,Tt.fromTag("br"));var o=Gl(n.dom,rc.before(r.dom));return F(Iv(t),(function(e){Wt(r,e)})),Fv(e,t),o}function Hv(e,t,n){if(Wr(n))return zn(n),Wr(t)&&am(t),Kl(t.dom);var r=Xl(n.dom);return F(Iv(t),(function(e){Rn(n,e)})),Fv(e,t),r}function Vv(e,t){Bs(e,t.dom).map((function(e){return e.getNode()})).map(Tt.fromDom).filter(Mr).each(zn)}function jv(e,t,n){return Vv(!0,t),Vv(!1,n),(Ue(o=n,r=t)?(i=sm(r,o),ve.from(i[i.length-1])):ve.none()).fold(T(Hv,e,t,n),T(Lv,e,t,n));var r,o,i}function Uv(e,t,n,r){return t?jv(e,r,n):jv(e,n,r)}function Wv(e,t){var n,r,o,i,a,u,c,s=Tt.fromDom(e.getBody()),l=(n=s.dom,r=t,((o=e.selection.getRng()).collapsed?(a=r,u=Pv(i=n,rc.fromRangeStart(o)),c=u.bind((function(e){return Wl(a,i,e.position).bind((function(e){return Pv(i,e).map((function(e){return t=i,n=a,$n((r=e).position.getNode())&&!1===Wr(r.block)?Bs(!1,r.block.dom).bind((function(e){return e.isEqual(r.position)?Wl(n,t,e).bind((function(e){return Pv(t,e)})):ve.some(r)})).getOr(r):r;var t,n,r}))}))})),dn(u,c,Bv).filter((function(e){return!1===je(e.from.block,e.to.block)&&Nt((n=e).from.block).bind((function(e){return Nt(n.to.block).filter((function(t){return je(e,t)}))})).isSome()&&!1===Kn((t=e).from.block.dom)&&!1===Kn(t.to.block.dom);var t,n}))):ve.none()).bind((function(e){return Uv(s,t,e.from.block,e.to.block)})));return l.each((function(t){e.selection.setRng(t.toRange())})),l.isSome()}function $v(e,t){var n=Tt.fromDom(t),r=T(je,e);return mr(n,go,r).isSome()}function qv(e,t){return!e.selection.isCollapsed()&&function(e){var t,n,r,o,i,a,u,c,s,l,f=Tt.fromDom(e.getBody());return a=e.selection.getRng(),s=Gl((i=f).dom,rc.fromRangeStart(a)).isNone(),l=ql(i.dom,rc.fromRangeEnd(a)).isNone(),!$v(u=i,(c=a).startContainer)&&!$v(u,c.endContainer)&&s&&l?((o=e).setContent(""),o.selection.setCursorLocation(),!0):(t=f,n=e.selection,r=n.getRng(),dn(Rv(t,Tt.fromDom(r.startContainer)),Rv(t,Tt.fromDom(r.endContainer)),(function(e,o){return!1===je(e,o)&&(r.deleteContents(),Uv(t,!0,e,o).each((function(e){n.setRng(e.toRange())})),!0)})).getOr(!1))}(e)}function Gv(e,t,n,r,o){return ve.from(t._selectionOverrides.showCaret(e,n,r,o))}function Kv(e,t){var n,r;return e.fire("BeforeObjectSelected",{target:t}).isDefaultPrevented()?ve.none():ve.some(((r=(n=t).ownerDocument.createRange()).selectNode(n),r))}function Xv(e,t,n){var r=Xc(1,e.getBody(),t),o=rc.fromRangeStart(r),i=o.getNode();if(bs(i))return Gv(1,e,i,!o.isAtEnd(),!1);var a=o.getNode(!0);if(bs(a))return Gv(1,e,a,!1,!1);var u=e.dom.getParent(o.getNode(),(function(e){return $b(e)||Wb(e)}));return bs(u)?Gv(1,e,u,!1,n):ve.none()}function Yv(e,t,n){return t.collapsed?Xv(e,t,n).getOr(t):t}function Jv(e){return Hg(e)||Pg(e)}function Zv(e){return Vg(e)||Ig(e)}function Qv(e,t,n,r,o,i){var a,u;return Gv(r,e,i.getNode(!o),o,!0).each((function(n){var r;t.collapsed?(r=t.cloneRange(),o?r.setEnd(n.startContainer,n.startOffset):r.setStart(n.endContainer,n.endOffset),r.deleteContents()):t.deleteContents(),e.selection.setRng(n)})),a=e.dom,Vn(u=n)&&0===u.data.length&&a.remove(u),!0}function eb(e,t){var n=e.selection.getRng();if(!Vn(n.commonAncestorContainer))return!1;var r=t?ts.Forwards:ts.Backwards,o=Ds(e.getBody()),i=T(Qc,t?o.next:o.prev),a=t?Jv:Zv,u=Jc(r,e.getBody(),n),c=Mv(t,i(u));if(!c||!es(u,c))return!1;if(a(c))return Qv(e,n,u.getNode(),r,t,c);var s=i(c);return!!(s&&a(s)&&es(c,s))&&Qv(e,n,u.getNode(),r,t,s)}function tb(e,t,n){return Wl(t,e,n).bind((function(r){return f=r.getNode(),go(Tt.fromDom(f))||fo(Tt.fromDom(f))||(u=e,l=r,Yc(!(c=t),s=n).fold((function(){return Yc(c,l).fold(D,d)}),d))?ve.none():t&&Kn(r.getNode())||!1===t&&Kn(r.getNode(!0))?(o=e,i=n,a=r.getNode(!1===t),Rv(Tt.fromDom(o),Tt.fromDom(i.getNode())).map((function(e){return Wr(e)?qb.remove(e.dom):qb.moveToElement(a)})).orThunk((function(){return ve.some(qb.moveToElement(a))}))):t&&Vg(n)||!1===t&&Hg(n)?ve.some(qb.moveToPosition(r)):ve.none();var o,i,a,u,c,s,l,f;function d(e){return Dr(Tt.fromDom(e))&&!$c(s,l,u)}}))}function nb(e,t){return ve.from(sf(e.getBody(),t))}function rb(e,t){var n=e.selection.getNode();return nb(e,n).filter(Kn).fold((function(){return l=e.getBody(),d=Xc((f=t)?1:-1,l,e.selection.getRng()),m=rc.fromRangeStart(d),g=Tt.fromDom(l),(!1===f&&Vg(m)?ve.some(qb.remove(m.getNode(!0))):f&&Hg(m)?ve.some(qb.remove(m.getNode())):!1===f&&Hg(m)&&vm(g,m)?qg(g,m).map((function(e){return qb.remove(e.getNode())})):f&&Vg(m)&&hm(g,m)?Gg(g,m).map((function(e){return qb.remove(e.getNode())})):(n=l,r=f,c=(o=m).getNode(!1===(u=r)),s=u?"after":"before",Ln(c)&&c.getAttribute("data-mce-caret")===s?(a=o.getNode(!1===(i=r)),(i&&Kn(a.nextSibling)?ve.some(qb.moveToElement(a.nextSibling)):!1===i&&Kn(a.previousSibling)?ve.some(qb.moveToElement(a.previousSibling)):ve.none()).fold((function(){return tb(n,r,o)}),ve.some)):tb(n,r,o).bind((function(e){return t=n,r=o,e.fold((function(e){return ve.some(qb.remove(e))}),(function(e){return ve.some(qb.moveToElement(e))}),(function(e){return $c(r,e,t)?ve.none():ve.some(qb.moveToPosition(e))}));var t,r})))).exists((function(n){return n.fold((function(e){return a._selectionOverrides.hideFakeCaret(),Vm(a,u,Tt.fromDom(e)),!0}),(i=u=t,function(e){var t=i?rc.before(e):rc.after(e);return o.selection.setRng(t.toRange()),!0}),(r=o=a=e,function(e){return r.selection.setRng(e.toRange()),!0}));var r,o,i,a,u}));var n,r,o,i,a,u,c,s,l,f,d,m,g}),M)}function ob(e,t){var n=e.selection.getNode();return!(!Kn(n)||Xn(n))&&nb(e,n.parentNode).filter(Kn).fold((function(){return F(gu(Tt.fromDom(e.getBody()),".mce-offscreen-selection"),zn),Vm(e,t,Tt.fromDom(e.selection.getNode())),zv(e),!0}),M)}function ib(e){var t,n=e.dom,r=e.selection,o=sf(e.getBody(),r.getNode());return Gn(o)&&n.isBlock(o)&&n.isEmpty(o)&&(t=n.create("br",{"data-mce-bogus":"1"}),n.setHTML(o,""),o.appendChild(t),r.setRng(rc.before(t).toRange())),!0}function ab(e,t){return(e.selection.isCollapsed()?rb:ob)(e,t)}function ub(e,t){return!!e.selection.isCollapsed()&&(n=e,r=t,o=rc.fromRangeStart(n.selection.getRng()),Wl(r,n.getBody(),o).filter((function(e){return(r?zg:Bg)(e)})).bind((function(e){return ve.from(qc(r?0:-1,e))})).exists((function(e){return n.selection.select(e),!0})));var n,r,o}function cb(e){return Gb(e)&&e.data[0]===bo}function sb(e){return Gb(e)&&e.data[e.data.length-1]===bo}function lb(e){return e.ownerDocument.createTextNode(bo)}function fb(e,t){return(e?function(e){if(Gb(e.previousSibling))return sb(e.previousSibling)||e.previousSibling.appendData(bo),e.previousSibling;if(Gb(e))return cb(e)||e.insertData(0,bo),e;var t=lb(e);return e.parentNode.insertBefore(t,e),t}:function(e){if(Gb(e.nextSibling))return cb(e.nextSibling)||e.nextSibling.insertData(0,bo),e.nextSibling;if(Gb(e))return sb(e)||e.appendData(bo),e;var t=lb(e);return e.nextSibling?e.parentNode.insertBefore(t,e.nextSibling):e.parentNode.appendChild(t),t})(t)}function db(e,t){return Vn(e.container())?fb(t,e.container()):fb(t,e.getNode())}function mb(e,t){var n=t.get();return n&&e.container()===n&&Rr(n)}function gb(e,t){return t.fold((function(t){ms(e.get());var n=Kb(t);return e.set(n),ve.some(rc(n,n.length-1))}),(function(t){return Kl(t).map((function(t){if(mb(t,e))return rc(e.get(),1);ms(e.get());var n=db(t,!0);return e.set(n),rc(n,1)}))}),(function(t){return Xl(t).map((function(t){if(mb(t,e))return rc(e.get(),e.get().length-1);ms(e.get());var n=db(t,!1);return e.set(n),rc(n,n.length-1)}))}),(function(t){ms(e.get());var n=Xb(t);return e.set(n),ve.some(rc(n,1))}))}function pb(e,t){for(var n=0;n<e.length;n++){var r=e[n].apply(null,t);if(r.isSome())return r}return ve.none()}function hb(e,t){return Wc(t,e)||e}function vb(e,t,n){var r=jb(n),o=hb(t,r.container());return Dv(e,o,r).fold((function(){return ql(o,r).bind(T(Dv,e,o)).map((function(e){return Yb.before(e)}))}),ve.none)}function bb(e,t){return null===Is(e,t)}function yb(e,t,n){return Dv(e,t,n).filter(T(bb,t))}function wb(e,t,n){var r=Ub(n);return yb(e,t,r).bind((function(e){return Gl(e,r).isNone()?ve.some(Yb.start(e)):ve.none()}))}function xb(e,t,n){var r=jb(n);return yb(e,t,r).bind((function(e){return ql(e,r).isNone()?ve.some(Yb.end(e)):ve.none()}))}function Cb(e,t,n){var r=Ub(n),o=hb(t,r.container());return Dv(e,o,r).fold((function(){return Gl(o,r).bind(T(Dv,e,o)).map((function(e){return Yb.after(e)}))}),ve.none)}function Sb(e){return!1===(t=Jb(e),"rtl"===Xa.DOM.getStyle(t,"direction",!0)||(n=t.textContent,Vb.test(n)));var t,n}function kb(e,t,n){return pb([vb,wb,xb,Cb],[e,t,n]).filter(Sb)}function Tb(e){return e.fold(f("before"),f("start"),f("end"),f("after"))}function Ob(e){return e.fold(Yb.before,Yb.before,Yb.after,Yb.after)}function _b(e){return e.fold(Yb.start,Yb.start,Yb.end,Yb.end)}function Eb(e,t,n,r,o,i){return dn(Dv(t,n,r),Dv(t,n,o),(function(t,r){return t!==r&&(a=r,u=Wc(t,o=n),c=Wc(a,o),u&&u===c)?Yb.after(e?t:r):i;var o,a,u,c})).getOr(i)}function Ab(e,t){return e.fold(M,(function(e){return r=t,!(Tb(n=e)===Tb(r)&&Jb(n)===Jb(r));var n,r}))}function Db(e,t){return e?t.fold(s(ve.some,Yb.start),ve.none,s(ve.some,Yb.after),ve.none):t.fold(ve.none,s(ve.some,Yb.before),ve.none,s(ve.some,Yb.end))}function Mb(e,t,n,r){var o=Mv(e,r),i=kb(t,n,o);return kb(t,n,o).bind(T(Db,e)).orThunk((function(){return a=t,u=n,c=i,s=Mv(o=e,r),Wl(o,u,s).map(T(Mv,o)).fold((function(){return c.map(Ob)}),(function(e){return kb(a,u,e).map(T(Eb,o,a,u,s,e)).filter(T(Ab,c))})).filter(Sb);var o,a,u,c,s}))}function Nb(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=window.console;r&&(r.error||r.log).apply(r,Ee([e],t,!1))}var Rb,zb,Bb=function(e,t){var n=e.editorManager.baseURL+"/skins/content",r="content"+e.editorManager.suffix+".css",o=!0===e.inline;return I(t,(function(t){return/^[a-z0-9\-]+$/i.test(t)&&!o?n+"/"+t+"/"+r:e.documentBaseURI.toAbsolute(t)}))},Pb=0,Ib=kt.each,Fb=Xa.DOM,Lb=[9,27,_f.HOME,_f.END,19,20,44,144,145,33,34,45,16,17,18,91,92,93,_f.DOWN,_f.UP,_f.LEFT,_f.RIGHT].concat(xt.browser.isFirefox()?[224]:[]),Hb="data-mce-placeholder",Vb=/[\u0591-\u07FF\uFB1D-\uFDFF\uFE70-\uFEFC]/,jb=T(Mv,!0),Ub=T(Mv,!1),Wb=Gn,$b=Kn,qb=rr([{remove:["element"]},{moveToElement:["element"]},{moveToPosition:["position"]}]),Gb=Vn,Kb=T(fb,!0),Xb=T(fb,!1),Yb=rr([{before:["element"]},{start:["element"]},{end:["element"]},{after:["element"]}]),Jb=function(e){return e.fold(d,d,d,d)};function Zb(e,t,n){var r=e?1:-1;return t.setRng(rc(n.container(),n.offset()+r).toRange()),t.getSel().modify("move",e?"forward":"backward","word"),!0}function Qb(e,t){return e===ts.Backwards?X(t):t}function ey(e,t,n,r){for(var o,i,a,u,c=Ds(n),s=r,l=[];s;){var f=(a=c,u=s,t===ts.Forwards?a.next(u):a.prev(u));if(!f)break;if($n(f.getNode(!1)))return t===ts.Forwards?{positions:Qb(t,l).concat([f]),breakType:Rb.Br,breakAt:ve.some(f)}:{positions:Qb(t,l),breakType:Rb.Br,breakAt:ve.some(f)};if(f.isVisible()){if(e(s,f)){var d=(o=s,$n((i=f).getNode(t===ts.Forwards))?Rb.Br:!1===$c(o,i)?Rb.Block:Rb.Wrap);return{positions:Qb(t,l),breakType:d,breakAt:ve.some(f)}}l.push(f),s=f}else s=f}return{positions:Qb(t,l),breakType:Rb.Eol,breakAt:ve.none()}}function ty(e,t,n,r){return t(n,r).breakAt.map((function(r){var o=t(n,r).positions;return e===ts.Backwards?o.concat(r):[r].concat(o)})).getOr([])}function ny(e,t){return U(e,(function(e,n){return e.fold((function(){return ve.some(n)}),(function(r){return dn(Q(r.getClientRects()),Q(n.getClientRects()),(function(e,o){var i=Math.abs(t-e.left);return Math.abs(t-o.left)<=i?n:r})).or(e)}))}),ve.none())}function ry(e,t){return Q(t.getClientRects()).bind((function(t){return ny(e,t.left)}))}function oy(e){function t(t){return I(t,(function(t){var n=Su(t);return n.node=e,n}))}if(Ln(e))return t(e.getClientRects());if(Vn(e)){var n=e.ownerDocument.createRange();return n.setStart(e,0),n.setEnd(e,e.data.length),t(n.getClientRects())}}function iy(e){return G(e,oy)}T(Mb,!1),T(Mb,!0),(zb=Rb={})[zb.Br=0]="Br",zb[zb.Block=1]="Block",zb[zb.Wrap=2]="Wrap",zb[zb.Eol=3]="Eol";var ay,uy,cy=T(ey,rc.isAbove,-1),sy=T(ey,rc.isBelow,1),ly=T(ty,-1,cy),fy=T(ty,1,sy);function dy(e,t,n,r,o,i){function a(r){var i=iy([r]);-1===e&&(i=i.reverse());for(var a=0;a<i.length;a++){var l=i[a];if(!n(l,s)){if(0<c.length&&t(l,pe(c))&&u++,l.line=u,o(l))return!0;c.push(l)}}}var u=0,c=[],s=pe(i.getClientRects());if(!s)return c;var l=i.getNode();return a(l),function(e,t,n,r){for(;r=Uc(r,e,Vr,t);)if(n(r))return}(e,r,a,l),c}function my(e){return function(t){return t.line>e}}function gy(e){return function(t){return t.line===e}}function py(e,t){return Math.abs(e.left-t)}function hy(e,t){return Math.abs(e.right-t)}function vy(e,t){return e>=t.left&&e<=t.right}function by(e,t){return e>=t.top&&e<=t.bottom}function yy(e,t,n){return void 0===n&&(n=M),me(e,(function(e,r){if(vy(t,r))return n(r)?r:e;if(vy(t,e))return n(e)?e:r;var o=Math.min(py(e,t),hy(e,t)),i=Math.min(py(r,t),hy(r,t));return i===o&&ce(r,"node")&&rx(r.node)||i<o?r:e}))}function wy(e,t,n,r,o){var i=ox(r,e,Vr,t,!o);do{if(!i||n(i))return}while(i=ox(i,e,Vr,t))}function xy(e,t){e.selection.setRng(t),Gf(e,e.selection.getRng())}function Cy(e,t,n){return ve.some(Yv(e,t,n))}function Sy(e,t,n,r,o,i){var a=t===ts.Forwards,u=Ds(e.getBody()),c=T(Qc,a?u.next:u.prev),s=a?r:o;if(!n.collapsed){var l=Au(n);if(i(l))return Gv(t,e,l,t===ts.Backwards,!1)}var f=Jc(t,e.getBody(),n);if(s(f))return Kv(e,f.getNode(!a));var d=Mv(a,c(f)),m=Lr(n);if(!d)return m?ve.some(n):ve.none();if(s(d))return Gv(t,e,d.getNode(!a),a,!1);var g=c(d);return g&&s(g)&&es(d,g)?Gv(t,e,g.getNode(!a),a,!1):m?Cy(e,d.toRange(),!1):ve.none()}function ky(e,t,n,r,o,i){var a=Jc(t,e.getBody(),n),u=pe(a.getClientRects()),c=t===ay.Down;if(!u)return ve.none();var s,l=V((c?nx:tx)(e.getBody(),my(1),a),gy(1)),f=u.left,d=yy(l,f);if(d&&i(d.node)){var m=Math.abs(f-d.left),g=Math.abs(f-d.right);return Gv(t,e,d.node,m<g,!1)}if(s=r(a)?a.getNode():o(a)?a.getNode(!0):Au(n)){var p=function(e,t,n,r){function o(e){return pe(e.getClientRects())}var i,a,u,c=Ds(t),s=[],l=0,f=1===e?(i=c.next,a=_u,u=Ou,rc.after(r)):(i=c.prev,a=Ou,u=_u,rc.before(r)),d=o(f);do{if(f.isVisible()){var m=o(f);if(!u(m,d)){0<s.length&&a(m,pe(s))&&l++;var g=Su(m);if(g.position=f,g.line=l,n(g))return s;s.push(g)}}}while(f=i(f));return s}(t,e.getBody(),my(1),s),h=yy(V(p,gy(1)),f);if(h)return Cy(e,h.position.toRange(),!1);if(h=pe(V(p,gy(0))))return Cy(e,h.position.toRange(),!1)}return 0===l.length?ix(e,c).filter(c?o:r).map((function(t){return Yv(e,t.toRange(),!1)})):ve.none()}function Ty(e,t,n){return ix(e,t).filter(n).exists((function(t){return e.selection.setRng(t.toRange()),!0}))}function Oy(e,t){var n=e.dom.createRng();n.setStart(t.container(),t.offset()),n.setEnd(t.container(),t.offset()),e.selection.setRng(n)}function _y(e,t){e?t.setAttribute("data-mce-selected","inline-boundary"):t.removeAttribute("data-mce-selected")}function Ey(e,t,n){return gb(t,n).map((function(t){return Oy(e,t),n}))}function Ay(e,t,n){return!!Mc(e)&&(o=t,i=n,a=(r=e).getBody(),u=rc.fromRangeStart(r.selection.getRng()),Mb(i,T(Av,r),a,u).bind((function(e){return Ey(r,o,e)})).isSome());var r,o,i,a,u}function Dy(e,t,n){return!!Mc(t)&&(r=e,i=(o=t).selection.getRng(),a=r?rc.fromRangeEnd(i):rc.fromRangeStart(i),!!S(o.selection.getSel().modify)&&(r&&Pr(a)?Zb(!0,o.selection,a):!(r||!Ir(a))&&Zb(!1,o.selection,a)));var r,o,i,a}function My(e,t,n){if(Mc(e)){var r=ix(e,t).getOrThunk((function(){var n=e.selection.getRng();return t?rc.fromRangeEnd(n):rc.fromRangeStart(n)}));return kb(T(Av,e),e.getBody(),r).exists((function(t){var r=Ob(t);return gb(n,r).exists((function(t){return Oy(e,t),!0}))}))}return!1}function Ny(e,t){return function(n){return gb(t,n).exists((function(t){return Oy(e,t),!0}))}}function Ry(e,t,n,r){var o=e.getBody(),i=T(Av,e);e.undoManager.ignore((function(){var a,u,c;e.selection.setRng((a=n,u=r,(c=document.createRange()).setStart(a.container(),a.offset()),c.setEnd(u.container(),u.offset()),c)),e.execCommand("Delete"),kb(i,o,rc.fromRangeStart(e.selection.getRng())).map(_b).map(Ny(e,t))})),e.nodeChanged()}function zy(e,t,n){if(e.selection.isCollapsed()&&Mc(e)){var r=rc.fromRangeStart(e.selection.getRng());return i=t,a=n,u=r,c=(o=e).getBody(),s=Wc(u.container(),c)||c,l=T(Av,o),(d=kb(l,s,u)).bind((function(e){return a?e.fold(f(ve.some(_b(e))),ve.none,f(ve.some(Ob(e))),ve.none):e.fold(ve.none,f(ve.some(Ob(e))),ve.none,f(ve.some(_b(e))))})).map(Ny(o,i)).getOrThunk((function(){var e=zs(a,s,u),t=e.bind((function(e){return kb(l,s,e)}));return dn(d,t,(function(){return Dv(l,s,u).exists((function(e){return!!dn(Kl(t=e),Xl(t),(function(e,n){var r=Mv(!0,e),o=Mv(!1,n);return ql(t,r).forall((function(e){return e.isEqual(o)}))})).getOr(!0)&&(Vm(o,a,Tt.fromDom(e)),!0);var t}))})).orThunk((function(){return t.bind((function(t){return e.map((function(e){return a?Ry(o,i,u,e):Ry(o,i,e,u),!0}))}))})).getOr(!1)}))}var o,i,a,u,c,s,l,d;return!1}function By(e){return 1===Ht(e)}function Py(e,t){return!!e.selection.isCollapsed()&&function(e,t){var n,r=Tt.fromDom(e.getBody()),o=Tt.fromDom(e.selection.getStart()),i=V(q(n=sm(o,r),co).fold(f(n),(function(e){return n.slice(0,e)})),By);return ee(i).exists((function(n){var r,o,a,u,c,s,l,f,d,m=rc.fromRangeStart(e.selection.getRng()),g=t,p=m,h=n.dom;return!(!dn(Kl(h),Xl(h),(function(e,t){var n=Mv(!0,e),r=Mv(!1,t),o=Mv(!1,p);return g?ql(h,o).exists((function(e){return e.isEqual(r)&&p.isEqual(n)})):Gl(h,o).exists((function(e){return e.isEqual(n)&&p.isEqual(r)}))})).getOr(!0)||Ps((r=n).dom)&&xg(r.dom)||(o=t,u=n,0===(d=I(V(i,T(Ag,a=e)),(function(e){return e.dom}))).length?Vm(a,o,u):(s=u.dom,f=_g(d,(l=Sg(!1)).dom),Wt(Tt.fromDom(s),l),zn(Tt.fromDom(s)),c=rc(f,0),a.selection.setRng(c.toRange())),0))}))}(e,t)}function Iy(e,t,n){return e._selectionOverrides.hideFakeCaret(),Vm(e,t,Tt.fromDom(n)),!0}function Fy(e,t){return e.selection.isCollapsed()?(i=e,u=(a=t)?Pg:Ig,c=a?ts.Forwards:ts.Backwards,s=Jc(c,i.getBody(),i.selection.getRng()),u(s)?Iy(i,a,s.getNode(!a)):ve.from(Mv(a,s)).filter((function(e){return u(e)&&es(s,e)})).exists((function(e){return Iy(i,a,e.getNode(!a))}))):(r=t,o=(n=e).selection.getNode(),!!Yn(o)&&Iy(n,r,o));var n,r,o,i,a,u,c,s}function Ly(e){var t=parseInt(e,10);return isNaN(t)?0:t}function Hy(e,t){return(e||"table"===Ot(t)?"margin":"padding")+("rtl"===wn(t,"direction")?"-right":"-left")}function Vy(e){var t,n=cx(e);return!e.mode.isReadOnly()&&(1<n.length||(t=e,K(n,(function(e){var n=xn(e,Hy(Oc(t),e)).map(Ly).getOr(0);return"false"!==t.dom.getContentEditable(e.dom)&&0<n}))))}function jy(e){return lo(e)||fo(e)}function Uy(e,t){var n=e.dom,r=e.selection,o=e.formatter,i=e.getParam("indentation","40px","string"),a=/[a-z%]+$/i.exec(i)[0],u=parseInt(i,10),c=Oc(e),s=wc(e);e.queryCommandState("InsertUnorderedList")||e.queryCommandState("InsertOrderedList")||""!==s||n.getParent(r.getNode(),n.isBlock)||o.apply("div"),F(cx(e),(function(e){var r,o=n,i=t,s=u,l=a,f=e.dom,d=Hy(c,Tt.fromDom(f));"outdent"===i?(r=Math.max(0,Ly(f.style[d])-s),o.setStyle(f,d,r?r+l:"")):(r=Ly(f.style[d])+s+l,o.setStyle(f,d,r))}))}function Wy(e,t){if(e.selection.isCollapsed()&&Vy(e)){var n=e.dom,r=e.selection.getRng(),o=rc.fromRangeStart(r),i=n.getParent(r.startContainer,n.isBlock);if(null!==i&&jg(Tt.fromDom(i),o))return Uy(e,"outdent"),!0}return!1}function $y(e,t){e.getDoc().execCommand(t,!1,null)}function qy(e){return void 0===e.touches||1!==e.touches.length?ve.none():ve.some(e.touches[0])}function Gy(e,t){return Te(e,t.nodeName)}function Ky(e){var t,n,r,o=e.dom,i=e.selection,a=e.schema,u=a.getBlockElements(),c=i.getStart(),s=e.getBody(),l=wc(e);if(c&&Ln(c)&&l){var f=s.nodeName.toLowerCase();if(a.isValidChild(f,l.toLowerCase())&&(d=u,m=s,g=c,!P(cm(Tt.fromDom(g),Tt.fromDom(m)),(function(e){return Gy(d,e.dom)})))){var d,m,g,p,h,v=i.getRng(),b=v.startContainer,y=v.startOffset,w=v.endContainer,x=v.endOffset,C=ld(e);for(c=s.firstChild;c;)p=u,Vn(h=c)||Ln(h)&&!Gy(p,h)&&!$s(h)?function(e,t){if(Vn(t)){if(0===t.nodeValue.length)return 1;if(/^\s+$/.test(t.nodeValue)&&(!t.nextSibling||Gy(e,t.nextSibling)))return 1}}(u,c)?(c=(n=c).nextSibling,o.remove(n)):(t||(t=o.create(l,xc(e)),c.parentNode.insertBefore(t,c),r=!0),c=(n=c).nextSibling,t.appendChild(n)):(t=null,c=c.nextSibling);r&&C&&(v.setStart(b,y),v.setEnd(w,x),i.setRng(v),e.nodeChanged())}}}function Xy(e,t){t.hasAttribute("data-mce-caret")&&(Fr(t),e.selection.setRng(e.selection.getRng()),e.selection.scrollIntoView(t))}function Yy(e,t){var n=hr(Tt.fromDom(e.getBody()),"*[data-mce-caret]").map((function(e){return e.dom})).getOrNull();if(n)return"compositionstart"===t.type?(t.preventDefault(),t.stopPropagation(),void Xy(e,n)):void(Br(n)&&(Xy(e,n),e.undoManager.add()))}function Jy(e,t,n){var r,o,i,a=Ds(e.getBody()),u=T(Qc,1===t?a.next:a.prev);!n.collapsed||""===wc(e)||(r=e.dom.getParent(n.startContainer,"PRE"))&&(u(rc.fromRangeStart(n))||(i=e.dom.create(wc(e)),(!xt.ie||11<=xt.ie)&&(i.innerHTML='<br data-mce-bogus="1">'),o=i,1===t?e.$(r).after(o):e.$(r).before(o),e.selection.select(o,!0),e.selection.collapse()))}function Zy(e,t){return n=e,r=t?ts.Forwards:ts.Backwards,o=n.selection.getRng(),Sy(n,r,o,Hg,Vg,sx).orThunk((function(){return Jy(n,r,o),ve.none()})).exists((function(t){return xy(e,t),!0}));var n,r,o}function Qy(e,t){return r=t?1:-1,o=(n=e).selection.getRng(),ky(n,r,o,(function(e){return Hg(e)||Fg(e)}),(function(e){return Vg(e)||Lg(e)}),sx).orThunk((function(){return Jy(n,r,o),ve.none()})).exists((function(t){return xy(e,t),!0}));var n,r,o}function ew(e,t){return Ty(e,t,t?Vg:Hg)}function tw(e){return B(["figcaption"],Ot(e))}function nw(e){var t=document.createRange();return t.setStartBefore(e.dom),t.setEndBefore(e.dom),t}function rw(e,t,n){(n?Rn:qt)(e,t)}function ow(e,t){return!!e.selection.isCollapsed()&&function(e,t){var n=Tt.fromDom(e.getBody()),r=rc.fromRangeStart(e.selection.getRng()),o=wc(e),i=xc(e),a=r,u=T(je,n);return gr(Tt.fromDom(a.container()),co,u).filter(tw).exists((function(){if(b=n,y=r,t?(x=b.dom,sy(x,y).breakAt.isNone()):(w=b.dom,cy(w,y).breakAt.isNone())){var a=(u=n,s=i,l=t,""===(c=o)?(h=l,rw(u,v=Tt.fromTag("br"),h),nw(v)):(f=u,d=l,m=s,g=Tt.fromTag(c),p=Tt.fromTag("br"),hn(g,m),Rn(g,p),rw(f,g,d),nw(p)));return e.selection.setRng(a),!0}var u,c,s,l,f,d,m,g,p,h,v,b,y,w,x;return!1}))}(e,t)}function iw(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return function(){return e.apply(null,t)}}function aw(e,t){return $((n=t,G(I(e,(function(e){return _e({shiftKey:!1,altKey:!1,ctrlKey:!1,metaKey:!1,keyCode:0,action:c},e)})),(function(e){return n.keyCode===e.keyCode&&n.shiftKey===e.shiftKey&&n.altKey===e.altKey&&n.ctrlKey===e.ctrlKey&&n.metaKey===e.metaKey?[e]:[]}))),(function(e){return e.action()}));var n}function uw(e,t){var n=t?ts.Forwards:ts.Backwards,r=e.selection.getRng();return Sy(e,n,r,Pg,Ig,Yn).exists((function(t){return xy(e,t),!0}))}function cw(e,t){var n=t?1:-1,r=e.selection.getRng();return ky(e,n,r,Pg,Ig,Yn).exists((function(t){return xy(e,t),!0}))}function sw(e,t){return Ty(e,t,t?Ig:Pg)}function lw(e,t,n,r,o){var i,a=gu(Tt.fromDom(n),"td,th,caption").map((function(e){return e.dom})),u=V((i=e,G(a,(function(e){var t,n={left:(t=Su(e.getBoundingClientRect())).left- -1,top:t.top- -1,right:t.right+-2,bottom:t.bottom+-2,width:t.width+-1,height:t.height+-1};return[{x:n.left,y:i(n),cell:e},{x:n.right,y:i(n),cell:e}]}))),(function(e){return t(e,o)})),c=r,s=o;return U(u,(function(e,t){return e.fold((function(){return ve.some(t)}),(function(e){var n=Math.sqrt(Math.abs(e.x-c)+Math.abs(e.y-s)),r=Math.sqrt(Math.abs(t.x-c)+Math.abs(t.y-s));return ve.some(r<n?t:e)}))}),ve.none()).map((function(e){return e.cell}))}function fw(e,t,n){var r,o,i=e(t,n);return i.breakType===Rb.Wrap&&0===i.positions.length||!$n(n.getNode())&&i.breakType===Rb.Br&&1===i.positions.length?(r=e,o=t,!i.breakAt.exists((function(e){return r(o,e).breakAt.isSome()}))):i.breakAt.isNone()}function dw(e,t,n,r){var o,i,a,u=e.selection.getRng(),c=t?1:-1;return!(!Hc()||(o=t,i=n,a=rc.fromRangeStart(u),!Bs(!o,i).exists((function(e){return e.isEqual(a)})))||(Gv(c,e,n,!t,!1).each((function(t){xy(e,t)})),0))}function mw(e,t,n){var r,o,i=(r=!!t,o=n.getNode(r),Ln(o)&&"TABLE"===o.nodeName?ve.some(o):ve.none()),a=!1===t;i.fold((function(){return xy(e,n.toRange())}),(function(r){return Bs(a,e.getBody()).filter((function(e){return e.isEqual(n)})).fold((function(){return xy(e,n.toRange())}),(function(o){var i,a,u=t,c=r,s=n;(a=wc(i=e))?i.undoManager.transact((function(){var e=Tt.fromTag(a);hn(e,xc(i)),Rn(e,Tt.fromTag("br")),(u?$t:Wt)(Tt.fromDom(c),e);var t=i.dom.createRng();t.setStart(e.dom,0),t.setEnd(e.dom,0),xy(i,t)})):xy(i,s.toRange())}))}))}function gw(e,t,n,r){var o,i,a,u,c,s,l,f,d,m,g=e.selection.getRng(),p=rc.fromRangeStart(g),h=e.getBody();if(t||!dx(r,p))return!(!t||!mx(r,p)||(o=h,d=i=n,mw(e,t,v=ee((m=a=p).getClientRects()).bind((function(e){return fx(d,e.left,e.top)})).bind((function(e){return ry(Kl(t=e).map((function(e){return[e].concat(sy(t,e).positions)})).getOr([]),m);var t})).orThunk((function(){return Q(a.getClientRects()).bind((function(e){return ny(fy(o,rc.after(i)),e.left)}))})).getOr(rc.after(i))),0));var v=(u=h,l=c=n,Q((f=s=p).getClientRects()).bind((function(e){return lx(l,e.left,e.top)})).bind((function(e){return ry(Xl(t=e).map((function(e){return cy(t,e).positions.concat(e)})).getOr([]),f);var t})).orThunk((function(){return Q(s.getClientRects()).bind((function(e){return ny(ly(u,rc.before(c)),e.left)}))})).getOr(rc.before(c)));return mw(e,t,v),!0}function pw(e,t,n){return ve.from(e.dom.getParent(e.selection.getNode(),"td,th")).bind((function(r){return ve.from(e.dom.getParent(r,"table")).map((function(o){return n(e,t,o,r)}))})).getOr(!1)}function hw(e,t){return pw(e,t,dw)}function vw(e,t){return pw(e,t,gw)}function bw(e,t){var n,r,o=t,i=e.dom,a=e.schema.getMoveCaretBeforeOnEnterElements();if(t){!/^(LI|DT|DD)$/.test(t.nodeName)||(r=function(e){for(;e;){if(1===e.nodeType||3===e.nodeType&&e.data&&/[\r\n\s]/.test(e.data))return e;e=e.nextSibling}}(t.firstChild))&&/^(UL|OL|DL)$/.test(r.nodeName)&&t.insertBefore(i.doc.createTextNode(vo),t.firstChild);var u=i.createRng();if(t.normalize(),t.hasChildNodes()){for(var c=new _r(t,t);n=c.current();){if(Vn(n)){u.setStart(n,0),u.setEnd(n,0);break}if(a[n.nodeName.toLowerCase()]){u.setStartBefore(n),u.setEndBefore(n);break}o=n,n=c.next()}n||(u.setStart(o,0),u.setEnd(o,0))}else $n(t)?t.nextSibling&&i.isBlock(t.nextSibling)?(u.setStartBefore(t),u.setEndBefore(t)):(u.setStartAfter(t),u.setEndAfter(t)):(u.setStart(t,0),u.setEnd(t,0));e.selection.setRng(u),Gf(e,u)}}function yw(e){return ve.from(e.dom.getParent(e.selection.getStart(!0),e.dom.isBlock))}function ww(e,t){return e&&e.parentNode&&e.parentNode.nodeName===t}function xw(e){return e&&/^(OL|UL|LI)$/.test(e.nodeName)}function Cw(e){var t=e.parentNode;return/^(LI|DT|DD)$/.test(t.nodeName)?t:e}function Sw(e,t,n){for(var r=e[n?"firstChild":"lastChild"];r&&!Ln(r);)r=r[n?"nextSibling":"previousSibling"];return r===t}function kw(e){e.innerHTML='<br data-mce-bogus="1">'}function Tw(e,t){return e.nodeName===t||e.previousSibling&&e.previousSibling.nodeName===t}function Ow(e,t){return t&&e.isBlock(t)&&!/^(TD|TH|CAPTION|FORM)$/.test(t.nodeName)&&!/^(fixed|absolute)/i.test(t.style.position)&&"true"!==e.getContentEditable(t)}function _w(e,t,n){return!1===Vn(t)?n:e?1===n&&t.data.charAt(n-1)===bo?0:n:n===t.data.length-1&&t.data.charAt(n)===bo?t.data.length:n}function Ew(e,t){for(var n,r=e.getRoot(),o=t;o!==r&&"false"!==e.getContentEditable(o);)"true"===e.getContentEditable(o)&&(n=o),o=o.parentNode;return o!==r?n:r}function Aw(e,t){var n=wc(e);n&&n.toLowerCase()===t.tagName.toLowerCase()&&function(e,t,n){var r=e.dom;ve.from(n.style).map(r.parseStyle).each((function(e){var n=Cn(Tt.fromDom(t)),o=_e(_e({},n),e);r.setStyles(t,o)})),dn(ve.from(n.class).map((function(e){return e.split(/\s+/)})),ve.from(t.className).map((function(e){return V(e.split(/\s+/),(function(e){return""!==e}))})),(function(e,n){var o=V(n,(function(t){return!B(e,t)})),i=Ee(Ee([],e,!0),o,!0);r.setAttrib(t,"class",i.join(" "))}));var o=["style","class"],i=ae(n,(function(e,t){return!B(o,t)}));r.setAttribs(t,i)}(e,t,xc(e))}function Dw(e,t,n){var r=e.dom.createRng();n?(r.setStartBefore(t),r.setEndBefore(t)):(r.setStartAfter(t),r.setEndAfter(t)),e.selection.setRng(r),Gf(e,r)}function Mw(e,t){var n=Tt.fromTag("br");Wt(Tt.fromDom(t),n),e.undoManager.add()}function Nw(e,t){gx(e.getBody(),t)||$t(Tt.fromDom(t),Tt.fromTag("br"));var n=Tt.fromTag("br");$t(Tt.fromDom(t),n),Dw(e,n.dom,!1),e.undoManager.add()}function Rw(e){return e&&"A"===e.nodeName&&"href"in e}function zw(e){return e.fold(D,Rw,Rw,D)}function Bw(e,t){t.fold(c,T(Mw,e),T(Nw,e),c)}function Pw(e,t){var n,r,o,i=(r=T(Av,n=e),o=rc.fromRangeStart(n.selection.getRng()),kb(r,n.getBody(),o).filter(zw));i.isSome()?i.each(T(Bw,e)):function(e,t){var n,r,o=e.selection,i=e.dom,a=o.getRng();Sf(i,a).each((function(e){a.setStart(e.startContainer,e.startOffset),a.setEnd(e.endContainer,e.endOffset)}));var u,c=a.startOffset,s=a.startContainer;1===s.nodeType&&s.hasChildNodes()&&(u=c>s.childNodes.length-1,s=s.childNodes[Math.min(c,s.childNodes.length-1)]||s,c=u&&3===s.nodeType?s.nodeValue.length:0);var l=i.getParent(s,i.isBlock),f=l?i.getParent(l.parentNode,i.isBlock):null,d=f?f.nodeName.toUpperCase():"",m=!(!t||!t.ctrlKey);"LI"!==d||m||(l=f),s&&3===s.nodeType&&c>=s.nodeValue.length&&!function(e){for(var t,n=new _r(s,l),r=e.getNonEmptyElements();t=n.next();)if(r[t.nodeName.toLowerCase()]||0<t.length)return 1}(e.schema)&&(n=i.create("br"),a.insertNode(n),a.setStartAfter(n),a.setEndAfter(n),r=!0),n=i.create("br"),ic(i,a,n),Dw(e,n,r),e.undoManager.add()}(e,t)}function Iw(e,t){return yw(e).filter((function(e){return 0<t.length&&He(Tt.fromDom(e),t)})).isSome()}function Fw(e,t){return Iw(e,e.getParam("no_newline_selector",""))}function Lw(e){return function(t,n){return""===wc(t)===e}}function Hw(e){return function(t,n){return yw(t).filter((function(e){return fo(Tt.fromDom(e))})).isSome()===e}}function Vw(e,t){return function(n,r){return yw(n).fold(f(""),(function(e){return e.nodeName.toUpperCase()}))===e.toUpperCase()===t}}function jw(e){return Vw("pre",e)}function Uw(e){return function(t,n){return t.getParam("br_in_pre",!0)===e}}function Ww(e,t){return Iw(e,e.getParam("br_newline_selector",".mce-toc h2,figcaption,caption"))}function $w(e,t){return t}function qw(e){var t=wc(e),n=function(e,t){for(var n,r=e.getRoot(),o=t;o!==r&&"false"!==e.getContentEditable(o);)"true"===e.getContentEditable(o)&&(n=o),o=o.parentNode;return o!==r?n:r}(e.dom,e.selection.getStart());return n&&e.schema.isValidChild(n.nodeName,t||"P")}function Gw(e,t){return function(n,r){return U(e,(function(e,t){return e&&t(n,r)}),!0)?ve.some(t):ve.none()}}function Kw(e,t){var n,r;n=e,r=t,pb([Gw([Fw],px.none()),Gw([Vw("summary",!0)],px.br()),Gw([jw(!0),Uw(!1),$w],px.br()),Gw([jw(!0),Uw(!1)],px.block()),Gw([jw(!0),Uw(!0),$w],px.block()),Gw([jw(!0),Uw(!0)],px.br()),Gw([Hw(!0),$w],px.br()),Gw([Hw(!0)],px.block()),Gw([Lw(!0),$w,qw],px.block()),Gw([Lw(!0)],px.br()),Gw([Ww],px.br()),Gw([Lw(!1),$w],px.br()),Gw([qw],px.block())],[n,!(!r||!r.shiftKey)]).getOr(px.none()).fold((function(){Pw(e,t)}),(function(){!function(e,t){function n(t){var n,r=m,o=l.getTextInlineElements(),i=t||"TABLE"===w||"HR"===w?s.create(t||p):b.cloneNode(!1),a=i;if(!1===e.getParam("keep_styles",!0))s.setAttrib(i,"style",null),s.setAttrib(i,"class",null);else for(;o[r.nodeName]&&(Ps(r)||$s(r)||(n=r.cloneNode(!1),s.setAttrib(n,"id",""),i.hasChildNodes()?n.appendChild(i.firstChild):a=n,i.appendChild(n))),(r=r.parentNode)&&r!==L;);return Aw(e,i),kw(a),i}function r(e){var t,n,r=_w(e,m,g);if(!Vn(m)||!(e?0<r:r<m.nodeValue.length)){if(m.parentNode===b&&c&&!e)return 1;if(e&&Ln(m)&&m===b.firstChild)return 1;if(Tw(m,"TABLE")||Tw(m,"HR"))return c&&!e||!c&&e;var o=new _r(m,b);for(Vn(m)&&(e&&0===r?o.prev():e||r!==m.nodeValue.length||o.next());t=o.current();){if(Ln(t)){if(!t.getAttribute("data-mce-bogus")&&(n=t.nodeName.toLowerCase(),f[n]&&"br"!==n))return}else if(Vn(t)&&!jr(t.nodeValue))return;e?o.prev():o.next()}return 1}}function o(){a=/^(H[1-6]|PRE|FIGURE)$/.test(w)&&"HGROUP"!==x?n(p):n(),e.getParam("end_container_on_empty_block",!1)&&Ow(s,y)&&s.isEmpty(b)?a=s.split(y,b):s.insertAfter(a,b),bw(e,a)}var i,a,u,c,s=e.dom,l=e.schema,f=l.getNonEmptyElements(),d=e.selection.getRng();Sf(s,d).each((function(e){d.setStart(e.startContainer,e.startOffset),d.setEnd(e.endContainer,e.endOffset)}));var m=d.startContainer,g=d.startOffset,p=wc(e),h=!(!t||!t.shiftKey),v=!(!t||!t.ctrlKey);Ln(m)&&m.hasChildNodes()&&(c=g>m.childNodes.length-1,m=m.childNodes[Math.min(g,m.childNodes.length-1)]||m,g=c&&Vn(m)?m.nodeValue.length:0);var b,y,w,x,C,S,k,T,O,_,E,A,D,M,N,R,z,B,P,I,L=Ew(s,m);L&&((p&&!h||!p&&h)&&(m=function(e,t,n,r){var o,i,a,u,c,s,l=p||"P",f=e.dom,d=Ew(f,n),m=f.getParent(n,f.isBlock);if(!m||!Ow(f,m)){if(c=((m=m||d)===e.getBody()||(s=m)&&/^(TD|TH|CAPTION)$/.test(s.nodeName)?m:m.parentNode).nodeName.toLowerCase(),!m.hasChildNodes())return Aw(e,o=f.create(l)),m.appendChild(o),t.setStart(o,0),t.setEnd(o,0),o;for(a=n;a.parentNode!==m;)a=a.parentNode;for(;a&&!f.isBlock(a);)a=(i=a).previousSibling;if(i&&e.schema.isValidChild(c,l.toLowerCase())){for(Aw(e,o=f.create(l)),i.parentNode.insertBefore(o,i),a=i;a&&!f.isBlock(a);)u=a.nextSibling,o.appendChild(a),a=u;t.setStart(n,r),t.setEnd(n,r)}}return n}(e,d,m,g)),y=(b=s.getParent(m,s.isBlock))?s.getParent(b.parentNode,s.isBlock):null,w=b?b.nodeName.toUpperCase():"","LI"!==(x=y?y.nodeName.toUpperCase():"")||v||(y=(b=y).parentNode,w=x),/^(LI|DT|DD)$/.test(w)&&s.isEmpty(b)?(T=n,O=y,_=b,E=p,P=(k=e).dom,I=k.selection.getRng(),O!==k.getBody()&&(D=(E=xw(A=O)&&xw(A.parentNode)?"LI":E)?T(E):P.create("BR"),Sw(O,_,!0)&&Sw(O,_,!1)?ww(O,"LI")?(M=Cw(O),P.insertAfter(D,M),(null===(B=(z=O).parentNode)||void 0===B?void 0:B.firstChild)===z?P.remove(M):P.remove(O)):P.replace(D,O):(Sw(O,_,!0)?ww(O,"LI")?(P.insertAfter(D,Cw(O)),D.appendChild(P.doc.createTextNode(" ")),D.appendChild(O)):O.parentNode.insertBefore(D,O):Sw(O,_,!1)?P.insertAfter(D,Cw(O)):(O=Cw(O),(N=I.cloneRange()).setStartAfter(_),N.setEndAfter(O),R=N.extractContents(),"LI"===E&&R.firstChild&&"LI"===R.firstChild.nodeName?(D=R.firstChild,P.insertAfter(R,O)):(P.insertAfter(R,O),P.insertAfter(D,O))),P.remove(_)),bw(k,D))):p&&b===e.getBody()||(p=p||"P",Nr(b)?(a=Fr(b),s.isEmpty(b)&&kw(b),Aw(e,a),bw(e,a)):r()?o():r(!0)?(a=b.parentNode.insertBefore(n(),b),bw(e,Tw(b,"HR")?a:b)):((S=(C=d).cloneRange()).setStart(C.startContainer,_w(!0,C.startContainer,C.startOffset)),S.setEnd(C.endContainer,_w(!1,C.endContainer,C.endOffset)),(i=S.cloneRange()).setEndAfter(b),u=i.extractContents(),F(Fu(Tt.fromDom(u),On),(function(e){var t=e.dom;t.nodeValue=wo(t.nodeValue)})),function(e){for(;Vn(e)&&(e.nodeValue=e.nodeValue.replace(/^[\r\n]+/,"")),e=e.firstChild;);}(u),a=u.firstChild,s.insertAfter(u,b),function(e,t){var n,r,o=a,i=[];if(o){for(;o=o.firstChild;){if(e.isBlock(o))return;Ln(o)&&!t[o.nodeName.toLowerCase()]&&i.push(o)}for(n=i.length;n--;)(!(o=i[n]).hasChildNodes()||o.firstChild===o.lastChild&&""===o.firstChild.nodeValue||(r=o)&&"A"===r.nodeName&&e.isEmpty(r))&&e.remove(o)}}(s,f),function(e,t){t.normalize();var n=t.lastChild;n&&!/^(left|right)$/gi.test(e.getStyle(n,"float",!0))||e.add(t,"br")}(s,b),s.isEmpty(b)&&kw(b),a.normalize(),s.isEmpty(a)?(s.remove(a),o()):(Aw(e,a),bw(e,a))),s.setAttrib(a,"id",""),e.fire("NewBlock",{newBlock:a})))}(e,t)}),c)}function Xw(e){return e.stopImmediatePropagation()}function Yw(e){return e.keyCode===_f.PAGE_UP||e.keyCode===_f.PAGE_DOWN}function Jw(e,t,n){n&&!e.get()?t.on("NodeChange",Xw,!0):!n&&e.get()&&t.off("NodeChange",Xw),e.set(n)}function Zw(e,t){var n=t.container(),r=t.offset();return Vn(n)?(n.insertData(r,e),ve.some(rc(n,r+e.length))):Zc(t).map((function(n){var r=Tt.fromText(e);return(t.isAtEnd()?$t:Wt)(n,r),rc(r.dom,e.length)}))}function Qw(e){var t,n,r=rc.fromRangeStart(e.selection.getRng()),o=Tt.fromDom(e.getBody());if(e.selection.isCollapsed()){var i=T(Av,e),a=rc.fromRangeStart(e.selection.getRng());return kb(i,e.getBody(),a).bind((n=o,function(e){return e.fold((function(e){return Gl(n.dom,rc.before(e))}),(function(e){return Kl(e)}),(function(e){return Xl(e)}),(function(e){return ql(n.dom,rc.after(e))}))})).bind(function(e,t){return function(n){return i=e,(!Cm(a=n)&&(o=a,Gl((r=i).dom,o).isNone()||ql(r.dom,o).isNone()||jg(r,o)||Ug(r,o)||vm(r,o)||hm(r,o)||wm(i,a)||xm(i,a))?bx:yx)(t);var r,o,i,a}}(o,r)).exists((t=e,function(e){return t.selection.setRng(e.toRange()),t.nodeChanged(),!0}))}return!1}function ex(e){var t,n,r,o,i,a,u,c,s,l,f,d,m,g,p=function(e){var t=tu(null),n=T(Av,e);return e.on("NodeChange",(function(r){var o,i,a,u,c,s,l,f,d,m,g,p,h;!Mc(e)||xt.browser.isIE()&&r.initial||(c=n,s=e.dom,l=r.parents,F(Y(f=V(I(gu(Tt.fromDom(s.getRoot()),'*[data-mce-selected="inline-boundary"]'),(function(e){return e.dom})),c),d=V(l,c)),T(_y,!1)),F(Y(d,f),T(_y,!0)),g=t,(m=e).selection.isCollapsed()&&!0!==m.composing&&g.get()&&(p=rc.fromRangeStart(m.selection.getRng()),rc.isTextPosition(p)&&!1===(Pr(h=p)||Ir(h))&&(Oy(m,Fc(g.get(),p)),g.set(null))),o=n,i=e,a=t,u=r.parents,i.selection.isCollapsed()&&F(V(u,o),(function(e){var t=rc.fromRangeStart(i.selection.getRng());kb(o,i.getBody(),t).bind((function(e){return Ey(i,a,e)}))})))})),t}(e);return e.on("keyup compositionstart",T(Yy,e)),g=p,(m=e).on("keydown",(function(e){var t,n,r,o;!1===e.isDefaultPrevented()&&(t=m,n=g,r=e,o=dt().os,aw([{keyCode:_f.RIGHT,action:iw(Zy,t,!0)},{keyCode:_f.LEFT,action:iw(Zy,t,!1)},{keyCode:_f.UP,action:iw(Qy,t,!1)},{keyCode:_f.DOWN,action:iw(Qy,t,!0)},{keyCode:_f.RIGHT,action:iw(hw,t,!0)},{keyCode:_f.LEFT,action:iw(hw,t,!1)},{keyCode:_f.UP,action:iw(vw,t,!1)},{keyCode:_f.DOWN,action:iw(vw,t,!0)},{keyCode:_f.RIGHT,action:iw(uw,t,!0)},{keyCode:_f.LEFT,action:iw(uw,t,!1)},{keyCode:_f.UP,action:iw(cw,t,!1)},{keyCode:_f.DOWN,action:iw(cw,t,!0)},{keyCode:_f.RIGHT,action:iw(Ay,t,n,!0)},{keyCode:_f.LEFT,action:iw(Ay,t,n,!1)},{keyCode:_f.RIGHT,ctrlKey:!o.isOSX(),altKey:o.isOSX(),action:iw(ax,t,n)},{keyCode:_f.LEFT,ctrlKey:!o.isOSX(),altKey:o.isOSX(),action:iw(ux,t,n)},{keyCode:_f.UP,action:iw(ow,t,!1)},{keyCode:_f.DOWN,action:iw(ow,t,!0)}],r).each((function(e){r.preventDefault()})))})),d=p,(f=e).on("keydown",(function(e){var t,n,r;!1===e.isDefaultPrevented()&&(n=d,r=e,aw([{keyCode:_f.BACKSPACE,action:iw(Wy,t=f,!1)},{keyCode:_f.BACKSPACE,action:iw(ab,t,!1)},{keyCode:_f.DELETE,action:iw(ab,t,!0)},{keyCode:_f.BACKSPACE,action:iw(eb,t,!1)},{keyCode:_f.DELETE,action:iw(eb,t,!0)},{keyCode:_f.BACKSPACE,action:iw(zy,t,n,!1)},{keyCode:_f.DELETE,action:iw(zy,t,n,!0)},{keyCode:_f.BACKSPACE,action:iw(ag,t,!1)},{keyCode:_f.DELETE,action:iw(ag,t,!0)},{keyCode:_f.BACKSPACE,action:iw(ub,t,!1)},{keyCode:_f.DELETE,action:iw(ub,t,!0)},{keyCode:_f.BACKSPACE,action:iw(Fy,t,!1)},{keyCode:_f.DELETE,action:iw(Fy,t,!0)},{keyCode:_f.BACKSPACE,action:iw(qv,t,!1)},{keyCode:_f.DELETE,action:iw(qv,t,!0)},{keyCode:_f.BACKSPACE,action:iw(Wv,t,!1)},{keyCode:_f.DELETE,action:iw(Wv,t,!0)},{keyCode:_f.BACKSPACE,action:iw(Py,t,!1)},{keyCode:_f.DELETE,action:iw(Py,t,!0)}],r).each((function(e){r.preventDefault()})))})),f.on("keyup",(function(e){var t,n;!1===e.isDefaultPrevented()&&(n=e,aw([{keyCode:_f.BACKSPACE,action:iw(ib,t=f)},{keyCode:_f.DELETE,action:iw(ib,t)}],n))})),(l=e).on("keydown",(function(e){var t,n,r;e.keyCode===_f.ENTER&&(t=l,(n=e).isDefaultPrevented()||(n.preventDefault(),(r=t.undoManager).typing&&(r.typing=!1,r.add()),t.undoManager.transact((function(){!1===t.selection.isCollapsed()&&t.execCommand("Delete"),Kw(t,n)}))))})),(s=e).on("keydown",(function(e){var t;!1===e.isDefaultPrevented()&&(t=e,aw([{keyCode:_f.SPACEBAR,action:iw(Qw,s)}],t).each((function(e){t.preventDefault()})))})),u=a=e,c=cu((function(){u.composing||Em(u)}),0),hx.isIE()&&(u.on("keypress",(function(e){c.throttle()})),u.on("remove",(function(e){c.cancel()}))),a.on("input",(function(e){!1===e.isComposing&&Em(a)})),i=p,(o=e).on("keydown",(function(e){var t,n,r;!1===e.isDefaultPrevented()&&(n=i,r=e,aw([{keyCode:_f.END,action:iw(ew,t=o,!0)},{keyCode:_f.HOME,action:iw(ew,t,!1)},{keyCode:_f.END,action:iw(sw,t,!0)},{keyCode:_f.HOME,action:iw(sw,t,!1)},{keyCode:_f.END,action:iw(My,t,!0,n)},{keyCode:_f.HOME,action:iw(My,t,!1,n)}],r).each((function(e){r.preventDefault()})))})),t=e,n=p,vx.os.isOSX()||(r=tu(!1),t.on("keydown",(function(e){Yw(e)&&Jw(r,t,!0)})),t.on("keyup",(function(e){var o,i,a;!1===e.isDefaultPrevented()&&(a=e,aw([{keyCode:_f.PAGE_UP,action:iw(My,o=t,!1,i=n)},{keyCode:_f.PAGE_DOWN,action:iw(My,o,!0,i)}],a)),Yw(e)&&r.get()&&(Jw(r,t,!1),t.nodeChanged())}))),p}(uy=ay=ay||{})[uy.Up=-1]="Up",uy[uy.Down=1]="Down";var tx=T(dy,ay.Up,Ou,_u),nx=T(dy,ay.Down,_u,Ou),rx=Kn,ox=Uc,ix=function(e,t){var n=e.selection.getRng(),r=e.getBody();if(t){var o=rc.fromRangeEnd(n),i=sy(r,o);return ee(i.positions)}return o=rc.fromRangeStart(n),Q((i=cy(r,o)).positions)},ax=T(Dy,!0),ux=T(Dy,!1),cx=function(e){return V(I(e.selection.getSelectedBlocks(),Tt.fromDom),(function(e){return!jy(e)&&!Nt(e).exists(jy)&&gr(e,(function(e){return Gn(e.dom)||Kn(e.dom)})).exists((function(e){return Gn(e.dom)}))}))},sx=Kn,lx=T(lw,(function(e){return e.bottom}),(function(e,t){return e.y<t})),fx=T(lw,(function(e){return e.top}),(function(e,t){return e.y>t})),dx=T(fw,cy),mx=T(fw,sy),gx=function(e,t){return n=rc.after(t),!!$n(n.getNode())||ql(e,rc.after(t)).map((function(e){return $n(e.getNode())})).getOr(!1);var n},px=rr([{br:[]},{block:[]},{none:[]}]),hx=dt().browser,vx=dt(),bx=T(Zw,vo),yx=T(Zw," "),wx=(xx.prototype.nodeChanged=function(e){var t,n,r,o=this.editor.selection;this.editor.initialized&&o&&!this.editor.getParam("disable_nodechange")&&!this.editor.mode.isReadOnly()&&(r=this.editor.getBody(),(t=o.getStart(!0)||r).ownerDocument===this.editor.getDoc()&&this.editor.dom.isChildOf(t,r)||(t=r),n=[],this.editor.dom.getParent(t,(function(e){return e===r||void n.push(e)})),(e=e||{}).element=t,e.parents=n,this.editor.fire("NodeChange",e))},xx.prototype.isSameElementPath=function(e){var t,n=this.editor.$(e).parentsUntil(this.editor.getBody()).add(e);if(n.length===this.lastPath.length){for(t=n.length;0<=t&&n[t]===this.lastPath[t];t--);if(-1===t)return this.lastPath=n,!0}return this.lastPath=n,!1},xx);function xx(e){var t;this.lastPath=[],this.editor=e;var n=this;"onselectionchange"in e.getDoc()||e.on("NodeChange click mouseup keyup focus",(function(n){var r=e.selection.getRng(),o={startContainer:r.startContainer,startOffset:r.startOffset,endContainer:r.endContainer,endOffset:r.endOffset};"nodechange"!==n.type&&vf(o,t)||e.fire("SelectionChange"),t=o})),e.on("contextmenu",(function(){e.fire("SelectionChange")})),e.on("SelectionChange",(function(){var t=e.selection.getStart(!0);!t||!xt.range&&e.selection.isCollapsed()||_l(e)&&!n.isSameElementPath(t)&&e.dom.isChildOf(t,e.getBody())&&e.nodeChanged({selectionChange:!0})})),e.on("mouseup",(function(t){!t.isDefaultPrevented()&&_l(e)&&("IMG"===e.selection.getNode().nodeName?Tr.setEditorTimeout(e,(function(){e.nodeChanged()})):e.nodeChanged())}))}function Cx(e){return Ln(e)&&so(Tt.fromDom(e))}function Sx(e){var t=e.getBoundingClientRect(),n=e.ownerDocument,r=n.documentElement,o=n.defaultView;return{top:t.top+o.pageYOffset-r.clientTop,left:t.left+o.pageXOffset-r.clientLeft}}function kx(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Tx(e){var t,n,r,o,i,a,u=uu(),c=Xa.DOM,s=document,l=function(e,t){var n=Tr.throttle((function(e,n){t._selectionOverrides.hideFakeCaret(),t.selection.placeCaretAt(e,n)}),0);return t.on("remove",n.stop),function(r){return e.on((function(e){var o,i,a,u,c,s,l,f,d,m,g,p,h,v,b,y,w,x,C,S,k=Math.max(Math.abs(r.screenX-e.screenX),Math.abs(r.screenY-e.screenY));if(!e.dragging&&10<k){if(t.fire("dragstart",{target:e.element}).isDefaultPrevented())return;e.dragging=!0,t.focus()}e.dragging&&(p=e,o={pageX:(b=r,y=(v=t).inline?Sx(v.getBody()):{left:0,top:0},S=(C=v).getBody(),w=C.inline?{left:S.scrollLeft,top:S.scrollTop}:{left:0,top:0},(h={pageX:(x=function(e,t){if(t.target.ownerDocument===e.getDoc())return{left:t.pageX,top:t.pageY};var n,r,o,i,a,u=Sx(e.getContentAreaContainer()),c=(r=(n=e).getBody(),o=n.getDoc().documentElement,i={left:r.scrollLeft,top:r.scrollTop},a={left:r.scrollLeft||o.scrollLeft,top:r.scrollTop||o.scrollTop},n.inline?i:a);return{left:t.pageX-u.left+c.left,top:t.pageY-u.top+c.top}}(v,b)).left-y.left+w.left,pageY:x.top-y.top+w.top}).pageX-p.relX),pageY:h.pageY+5},m=e.ghost,g=t.getBody(),m.parentNode!==g&&g.appendChild(m),i=e.ghost,u=e.width,c=e.height,s=e.maxX,l=e.maxY,d=f=0,i.style.left=(a=o).pageX+"px",i.style.top=a.pageY+"px",l<a.pageY+c&&(d=a.pageY+c-l),i.style.width=u-(f=s<a.pageX+u?a.pageX+u-s:f)+"px",i.style.height=c-d+"px",n(r.clientX,r.clientY))}))}}(i=u,a=e),f=(t=r=u,function(){t.on((function(e){e.dragging&&n.fire("dragend")})),$x(t)});(n=o=e).on("mousedown",(function(e){var t,n,r,o,u,c;0===e.button&&(t=$(a.dom.getParents(e.target),function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){for(var n=0;n<e.length;n++)if(e[n](t))return!0;return!1}}(Ux,Wx)).getOr(null),u=a.getBody(),Ux(c=t)&&c!==u&&(n=a.dom.getPos(t),r=a.getBody(),o=a.getDoc().documentElement,i.set({element:t,dragging:!1,screenX:e.screenX,screenY:e.screenY,maxX:(a.inline?r.scrollWidth:o.offsetWidth)-2,maxY:(a.inline?r.scrollHeight:o.offsetHeight)-2,relX:e.pageX-n.x,relY:e.pageY-n.y,width:t.offsetWidth,height:t.offsetHeight,ghost:function(e,t,n){var r=a.dom,o=e.cloneNode(!0);r.setStyles(o,{width:t,height:n}),r.setAttrib(o,"data-mce-selected",null);var i=r.create("div",{class:"mce-drag-container","data-mce-bogus":"all",unselectable:"on",contenteditable:"false"});return r.setStyles(i,{position:"absolute",opacity:.5,overflow:"hidden",border:0,padding:0,margin:0,width:t,height:n}),r.setStyles(o,{margin:0,boxSizing:"border-box"}),i.appendChild(o),i}(t,t.offsetWidth,t.offsetHeight)})))})),e.on("mousemove",l),e.on("mouseup",(function(e){r.on((function(t){var n,r,i,a,u,c;t.dragging&&((a=3===(c=(i=o).selection.getSel().getRangeAt(0).startContainer).nodeType?c.parentNode:c)===(u=t.element)||i.dom.isChildOf(a,u)||Ux(a)||((r=t.element.cloneNode(!0)).removeAttribute("data-mce-selected"),n=r,o.fire("drop",{clientX:e.clientX,clientY:e.clientY}).isDefaultPrevented()||o.undoManager.transact((function(){kx(t.element),o.insertContent(o.dom.getOuterHTML(n)),o._selectionOverrides.hideFakeCaret()}))),o.fire("dragend"))})),$x(r)})),c.bind(s,"mousemove",l),c.bind(s,"mouseup",f),e.on("remove",(function(){c.unbind(s,"mousemove",l),c.unbind(s,"mouseup",f)})),e.on("keydown",(function(e){e.keyCode===_f.ESC&&f()}))}function Ox(e,t){return sf(e.getBody(),t)}function _x(e){function t(e){return e!==v&&(Gx(e)||Yn(e))&&p.isChildOf(e,v)}function n(e){return Hg(e)||Vg(e)||Pg(e)||Ig(e)}function r(e){e&&g.setRng(e)}function o(t,n,r,o){return void 0===o&&(o=!0),e.fire("ShowCaret",{target:n,direction:t,before:r}).isDefaultPrevented()?null:(o&&g.scrollIntoView(n,-1===t),b.show(r,n))}function i(e){return zr(e)||So(e)||ko(e)}function u(e){return i(e.startContainer)||i(e.endContainer)}function c(n,r){if(!n)return null;if(n.collapsed){if(!u(n)){var i=r?1:-1,a=Jc(i,v,n),c=a.getNode(!r);if(Vc(c))return o(i,c,!!r&&!a.isAtEnd(),!1);var s=a.getNode(r);if(Vc(s))return o(i,s,!r&&!a.isAtEnd(),!1)}return null}var f=n.startContainer,d=n.startOffset,m=n.endOffset;if(3===f.nodeType&&0===d&&Gx(f.parentNode)&&(f=f.parentNode,d=p.nodeIndex(f),f=f.parentNode),1!==f.nodeType)return null;if(m===d+1&&f===n.endContainer){var h=f.childNodes[d];if(t(h))return function(t){var n=t.cloneNode(!0),r=e.fire("ObjectSelected",{target:t,targetClone:n});if(r.isDefaultPrevented())return null;var o=function(t,n,r){var o=e.$,i=hr(Tt.fromDom(e.getBody()),"#"+y).fold((function(){return o([])}),(function(e){return o([e.dom])}));0===i.length&&(i=o('<div data-mce-bogus="all" class="mce-offscreen-selection"></div>').attr("id",y)).appendTo(e.getBody());var a=p.createRng();n===r&&xt.ie?(i.empty().append('<p style="font-size: 0" data-mce-bogus="all"> </p>').append(n),a.setStartAfter(i[0].firstChild.firstChild),a.setEndAfter(n)):(i.empty().append(vo).append(n).append(vo),a.setStart(i[0].firstChild,1),a.setEnd(i[0].lastChild,0)),i.css({top:p.getPos(t,e.getBody()).y}),i[0].focus();var u=g.getSel();return u.removeAllRanges(),u.addRange(a),a}(t,r.targetClone,n),i=Tt.fromDom(t);return F(gu(Tt.fromDom(e.getBody()),"*[data-mce-selected]"),(function(e){je(i,e)||yn(e,w)})),p.getAttrib(t,w)||t.setAttribute(w,"1"),l=t,C(),o}(h)}return null}function s(){l&&l.removeAttribute(w),hr(Tt.fromDom(e.getBody()),"#"+y).each(zn),l=null}var l,f,d,m,g=e.selection,p=e.dom,h=p.isBlock,v=e.getBody(),b=function(e,t,n,r){function o(){!function(){for(var e=gu(Tt.fromDom(t),"*[contentEditable=false],video,audio,embed,object"),n=0;n<e.length;n++){var r,o=e[n].dom,i=o.previousSibling;ko(i)&&(1===(r=i.data).length?i.parentNode.removeChild(i):i.deleteData(r.length-1,1)),i=o.nextSibling,So(i)&&(1===(r=i.data).length?i.parentNode.removeChild(i):i.deleteData(0,1))}}(),a&&(ms(a),a=null),u.on((function(e){Wa(e.caret).remove(),u.clear()})),i&&(Tr.clearInterval(i),i=void 0)}var i,a,u=uu(),c=wc(e),s=0<c.length?c:"p";return{show:function(e,c){var l;if(o(),vs(c))return null;if(!n(c))return a=function(e,t){var n=e.ownerDocument.createTextNode(bo),r=e.parentNode;if(t){if(o=e.previousSibling,Co(o)){if(zr(o))return o;if(ko(o))return o.splitText(o.data.length-1)}r.insertBefore(n,e)}else{var o=e.nextSibling;if(Co(o)){if(zr(o))return o;if(So(o))return o.splitText(1),o}e.nextSibling?r.insertBefore(n,e.nextSibling):r.appendChild(n)}return n}(c,e),l=c.ownerDocument.createRange(),bs(a.nextSibling)?(l.setStart(a,0),l.setEnd(a,0)):(l.setStart(a,1),l.setEnd(a,1)),l;a=function(e,t,n){var r,o=t.ownerDocument.createElement(e);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=t.parentNode;return n?i.insertBefore(o,t):t.nextSibling?i.insertBefore(o,t.nextSibling):i.appendChild(o),o}(s,c,e);var f=Lc(t,c,e);Wa(a).css("top",f.top);var d=Wa('<div class="mce-visual-caret" data-mce-bogus="all"></div>').css(_e({},f)).appendTo(t)[0];return u.set({caret:d,element:c,before:e}),e&&Wa(d).addClass("mce-visual-caret-before"),i=Tr.setInterval((function(){r()?Wa("div.mce-visual-caret",t).toggleClass("mce-visual-caret-hidden"):Wa("div.mce-visual-caret",t).addClass("mce-visual-caret-hidden")}),500),(l=c.ownerDocument.createRange()).setStart(a,0),l.setEnd(a,0),l},hide:o,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(e){var n=Lc(t,e.element,e.before);Wa(e.caret).css(_e({},n))}))},destroy:function(){return Tr.clearInterval(i)}}}(e,v,h,(function(){return ld(e)})),y="sel-"+p.uniqueId(),w="data-mce-selected",x=g.getRng,C=function(){b.hide()};return xt.ceFalse&&!Xp(e)&&(e.on("mouseup",(function(t){var n=x();n.collapsed&&Bh(e,t.clientX,t.clientY)&&Xv(e,n,!1).each(r)})),e.on("click",(function(t){var n=Ox(e,t.target);n&&(Gx(n)&&(t.preventDefault(),e.focus()),qx(n)&&p.isChildOf(n,g.getNode())&&s())})),e.on("blur NewBlock",s),e.on("ResizeWindow FullscreenStateChanged",b.reposition),e.on("tap",(function(n){var r=n.target,o=Ox(e,r);Gx(o)?(n.preventDefault(),Kv(e,o).each(c)):t(r)&&Kv(e,r).each(c)}),!0),e.on("mousedown",(function(i){var u,l,f,d,m,b,y,w=i.target;w!==v&&"HTML"!==w.nodeName&&!p.isChildOf(w,v)||!1===Bh(e,i.clientX,i.clientY)||((u=Ox(e,w))?Gx(u)?(i.preventDefault(),Kv(e,u).each(c)):(s(),qx(u)&&i.shiftKey||lf(i.clientX,i.clientY,g.getRng())||(C(),g.placeCaretAt(i.clientX,i.clientY))):t(w)?Kv(e,w).each(c):!1===Vc(w)&&(s(),C(),(l=function(e,t,n){function r(e){return!sn(e.node)&&!Yn(e.node)}var o,i,a,u=iy(V(xe(e.getElementsByTagName("*")),Vc));return(a=yy(V(u,T(by,n)),t,r))&&(a=yy(function(e,t,n){function r(e,n){var r=V(iy([n]),(function(n){return!e(n,t)}));return o=o.concat(r),0===r.length}void 0===n&&(n=!0);var o=[];return o.push(t),wy(ay.Up,e,T(r,Ou),t.node,n),wy(ay.Down,e,T(r,_u),t.node,n),o}(e,a,r(a)),t,r))&&Vc(a.node)?{node:(o=a).node,before:py(o,i=t)<hy(o,i)}:null}(v,i.clientX,i.clientY))&&(f=w,d=l.node,b=p.getParent(f,h),y=p.getParent(d,h),!a(b)&&(f!==y&&p.isChildOf(b,y)&&!1===Gx(Ox(e,b))||!p.isChildOf(y,b)&&(m=y,p.getParent(b,h)!==p.getParent(m,h))&&function(e){var t=e.firstChild;if(!a(t)){var r=rc.before(t);if($n(r.getNode())&&1===e.childNodes.length)return!n(r);var o=Ds(e).next(r);return o&&!n(o)}}(b))||(i.preventDefault(),r(o(1,l.node,l.before,!1)),e.getBody().focus()))))})),e.on("keypress",(function(e){_f.modifierPressed(e)||Gx(g.getNode())&&e.preventDefault()})),e.on("GetSelectionRange",(function(e){var t=e.range;l&&(l.parentNode?((t=t.cloneRange()).selectNode(l),e.range=t):l=null)})),e.on("SetSelectionRange",(function(t){var n,r,o,i,a,u,s;t.range=(n=t.range,r=e.schema.getShortEndedElements(),o=p.createRng(),i=n.startContainer,a=n.startOffset,u=n.endContainer,s=n.endOffset,Te(r,i.nodeName.toLowerCase())?0===a?o.setStartBefore(i):o.setStartAfter(i):o.setStart(i,a),Te(r,u.nodeName.toLowerCase())?0===s?o.setEndBefore(u):o.setEndAfter(u):o.setEnd(u,s),o);var l=c(t.range,t.forward);l&&(t.range=l)})),e.on("AfterSetSelectionRange",(function(e){var t=e.range,n=t.startContainer.parentNode;u(t)||"mcepastebin"===n.id||C(),p.hasClass(n,"mce-offscreen-selection")||s()})),e.on("copy",(function(e){var t,n,r=e.clipboardData;e.isDefaultPrevented()||!e.clipboardData||xt.ie||(t=(n=p.get(y))&&n.getElementsByTagName("*")[0])&&(e.preventDefault(),r.clearData(),r.setData("text/html",t.outerHTML),r.setData("text/plain",t.outerText||t.innerText))})),function(e){var t,n;function r(e){var t;e.isDefaultPrevented()||(t=e.dataTransfer)&&(B(t.types,"Files")||0<t.files.length)&&(e.preventDefault(),"drop"===e.type&&fv(n,"Dropped file type is not supported"))}function o(e){id(n,e.target)&&r(e)}function i(){var e=Xa.DOM,t=n.dom,i=document,a=n.inline?n.getBody():n.getDoc(),u=["drop","dragover"];F(u,(function(n){e.bind(i,n,o),t.bind(a,n,r)})),n.on("remove",(function(){F(u,(function(n){e.unbind(i,n,o),t.unbind(a,n,r)}))}))}Tx(e),(t=e).on("drop",(function(e){var n=void 0!==e.clientX?t.getDoc().elementFromPoint(e.clientX,e.clientY):null;!Ux(n)&&"false"!==t.dom.getContentEditableParent(n)||e.preventDefault()})),e.getParam("block_unsupported_drop",!0,"boolean")&&(n=e).on("init",(function(){Tr.setEditorTimeout(n,i,0)}))}(e),d=cu((function(){var e,t;f.removed||!f.getBody().contains(document.activeElement)||(e=f.selection.getRng()).collapsed&&(t=Yv(f,e,!1),f.selection.setRng(t))}),0),(f=e).on("focus",(function(){d.throttle()})),f.on("blur",(function(){d.cancel()})),(m=e).on("init",(function(){m.on("focusin",(function(e){var t,n,r=e.target;Yn(r)&&(t=sf(m.getBody(),r),n=Kn(t)?t:r,m.selection.getNode()!==n&&Kv(m,n).each((function(e){return m.selection.setRng(e)})))}))}))),{showCaret:o,showBlockCaretContainer:function(e){e.hasAttribute("data-mce-caret")&&(Fr(e),r(x()),g.scrollIntoView(e))},hideFakeCaret:C,destroy:function(){b.destroy(),l=null}}}function Ex(e){return ae(e,(function(e){return!1===C(e)}))}function Ax(e){var t=e.settings,n=e.editorUpload.blobCache;return Ex({allow_conditional_comments:t.allow_conditional_comments,allow_html_data_urls:t.allow_html_data_urls,allow_svg_data_urls:t.allow_svg_data_urls,allow_html_in_named_anchor:t.allow_html_in_named_anchor,allow_script_urls:t.allow_script_urls,allow_unsafe_link_target:t.allow_unsafe_link_target,convert_fonts_to_spans:t.convert_fonts_to_spans,fix_list_elements:t.fix_list_elements,font_size_legacy_values:t.font_size_legacy_values,forced_root_block:t.forced_root_block,forced_root_block_attrs:t.forced_root_block_attrs,padd_empty_with_br:t.padd_empty_with_br,preserve_cdata:t.preserve_cdata,remove_trailing_brs:t.remove_trailing_brs,inline_styles:t.inline_styles,root_name:e.inline?e.getElement().nodeName.toLowerCase():void 0,validate:!0,blob_cache:n,document:e.getDoc(),images_dataimg_filter:t.images_dataimg_filter})}function Dx(e){return(e.inline?e.ui:e.dom).styleSheetLoader}function Mx(e){function t(){o.unloadAll(a),e.inline||e.ui.styleSheetLoader.unloadAll(i)}function n(){e.removed?t():e.on("remove",t)}var r,o=Dx(e),i=_c(e),a=e.contentCSS;0<e.contentStyles.length&&(r="",kt.each(e.contentStyles,(function(e){r+=e+"\r\n"})),e.dom.addStyle(r));var u,c,s,l,f,d,m,g,p,h=kr.all((u=e,c=a,s=i,l=[new kr((function(e,t){return Dx(u).loadAll(c,e,t)}))],u.inline?l:l.concat([new kr((function(e,t){return u.ui.styleSheetLoader.loadAll(s,e,t)}))]))).then(n).catch(n);return e.settings.content_style&&(d=(f=e).settings.content_style,m=Tt.fromDom(f.getBody()),g=jt(Nn(m)),pn(p=Tt.fromTag("style"),"type","text/css"),Rn(p,Tt.fromText(d)),Rn(g,p),f.on("remove",(function(){zn(p)}))),h}function Nx(e){var t;!0!==e.removed&&(Xp(t=e)||t.load({initial:!0,format:"html"}),t.startContent=t.getContent({format:"raw"}),function(e){var t,n,r;e.bindPendingEventDelegates(),e.initialized=!0,e.fire("Init"),e.focus(!0),r=(n=e).dom.getRoot(),n.inline||_l(n)&&n.selection.getStart(!0)!==r||Kl(r).each((function(e){var t,r,o,i,a=e.getNode(),u=sn(a)?Kl(a).getOr(e):e;xt.browser.isIE()?(t=n,r=u.toRange(),o=Tt.fromDom(t.getBody()),i=(ed(t)?ve.from(r):ve.none()).map(td).filter(Qf(o)),t.bookmark=i.isSome()?i:t.bookmark):n.selection.setRng(u.toRange())})),e.nodeChanged({initial:!0}),e.execCallback("init_instance_callback",e),(t=e).settings.auto_focus&&Tr.setEditorTimeout(t,(function(){var e=!0===t.settings.auto_focus?t:t.editorManager.get(t.settings.auto_focus);e.destroyed||e.focus()}),100)}(e))}function Rx(e,t){var n=e.settings,r=e.getElement(),o=e.getDoc();n.inline||(e.getElement().style.visibility=e.orgVisibility),t||e.inline||(o.open(),o.write(e.iframeHTML),o.close()),e.inline&&(Kx.addClass(r,"mce-content-body"),e.contentDocument=o=document,e.contentWindow=window,e.bodyElement=r,e.contentAreaContainer=r);var i,a,u,s,l,f,d,m,g,p,h,b=e.getBody();b.disabled=!0,e.readonly=!!n.readonly,e.readonly||(e.inline&&"static"===Kx.getStyle(b,"position",!0)&&(b.style.position="relative"),b.contentEditable=e.getParam("content_editable_state",!0)),b.disabled=!1,e.editorUpload=wv(e),e.schema=Qr(n),e.dom=Xa(o,{keep_values:!0,url_converter:e.convertURL,url_converter_scope:e,hex_colors:n.force_hex_style_colors,update_styles:!0,root_element:e.inline?e.getBody():null,collect:function(){return e.inline},schema:e.schema,contentCssCors:e.getParam("content_css_cors",!1,"boolean"),referrerPolicy:kc(e),onSetAttrib:function(t){e.fire("SetAttrib",t)}}),e.parser=((a=Sh(Ax(i=e),i.schema)).addAttributeFilter("src,href,style,tabindex",(function(e,t){for(var n,r,o=e.length,a=i.dom,u="data-mce-"+t;o--;)(r=(n=e[o]).attr(t))&&!n.attr(u)&&0!==r.indexOf("data:")&&0!==r.indexOf("blob:")&&("style"===t?((r=a.serializeStyle(a.parseStyle(r),n.name)).length||(r=null),n.attr(u,r),n.attr(t,r)):"tabindex"===t?(n.attr(u,r),n.attr(t,null)):n.attr(u,i.convertURL(r,t,n.name)))})),a.addNodeFilter("script",(function(e){for(var t=e.length;t--;){var n=e[t],r=n.attr("type")||"no/type";0!==r.indexOf("mce-")&&n.attr("type","mce-"+r)}})),i.settings.preserve_cdata&&a.addNodeFilter("#cdata",(function(e){for(var t=e.length;t--;){var n=e[t];n.type=8,n.name="#comment",n.value="[CDATA["+i.dom.encode(n.value)+"]]"}})),a.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",(function(e){for(var t=e.length,n=i.schema.getNonEmptyElements();t--;){var r=e[t];r.isEmpty(n)&&0===r.getAll("br").length&&(r.append(new Nd("br",1)).shortEnded=!0)}})),a),e.serializer=Th((u=e.settings,_e(_e({},Ax(e)),Ex({url_converter:u.url_converter,url_converter_scope:u.url_converter_scope,element_format:u.element_format,entities:u.entities,entity_encoding:u.entity_encoding,indent:u.indent,indent_after:u.indent_after,indent_before:u.indent_before,block_elements:u.block_elements,boolean_attributes:u.boolean_attributes,custom_elements:u.custom_elements,extended_valid_elements:u.extended_valid_elements,invalid_elements:u.invalid_elements,invalid_styles:u.invalid_styles,move_caret_before_on_enter_elements:u.move_caret_before_on_enter_elements,non_empty_elements:u.non_empty_elements,schema:u.schema,self_closing_elements:u.self_closing_elements,short_ended_elements:u.short_ended_elements,special:u.special,text_block_elements:u.text_block_elements,text_inline_elements:u.text_inline_elements,valid_children:u.valid_children,valid_classes:u.valid_classes,valid_elements:u.valid_elements,valid_styles:u.valid_styles,verify_html:u.verify_html,whitespace_elements:u.whitespace_elements}))),e),e.selection=hh(e.dom,e.getWin(),e.serializer,e),e.annotator=Nl(e),e.formatter=kv(e),e.undoManager=Ov(e),e._nodeChangeDispatcher=new wx(e),e._selectionOverrides=_x(e),m=e,g=uu(),p=tu(!1),h=su((function(e){m.fire("longpress",_e(_e({},e),{type:"longpress"})),p.set(!0)}),400),m.on("touchstart",(function(e){qy(e).each((function(t){h.cancel();var n={x:t.clientX,y:t.clientY,target:e.target};h.throttle(e),p.set(!1),g.set(n)}))}),!0),m.on("touchmove",(function(e){h.cancel(),qy(e).each((function(e){g.on((function(t){var n=e,r=t,o=Math.abs(n.clientX-r.x),i=Math.abs(n.clientY-r.y);(5<o||5<i)&&(g.clear(),p.set(!1),m.fire("longpresscancel"))}))}))}),!0),m.on("touchend touchcancel",(function(e){h.cancel(),"touchcancel"!==e.type&&g.get().filter((function(t){return t.target.isEqualNode(e.target)})).each((function(){p.get()?e.preventDefault():m.fire("tap",_e(_e({},e),{type:"tap"}))}))}),!0),(f=l=e).on("click",(function(e){f.dom.getParent(e.target,"details")&&e.preventDefault()})),(d=l).parser.addNodeFilter("details",(function(e){F(e,(function(e){e.attr("data-mce-open",e.attr("open")),e.attr("open","open")}))})),d.serializer.addNodeFilter("details",(function(e){F(e,(function(e){var t=e.attr("data-mce-open");e.attr("open",v(t)?t:null),e.attr("data-mce-open",null)}))})),Xp(e)||(s=e).on("click",(function(e){var t,n,r,o,i;3<=e.detail&&(r=(t=s).selection.getRng(),o=rc.fromRangeStart(r),i=rc.fromRangeEnd(r),!rc.isElementPosition(o)||Cx(n=o.container())&&Kl(n).each((function(e){return r.setStart(e.container(),e.offset())})),!rc.isElementPosition(i)||Cx(n=o.container())&&Xl(n).each((function(e){return r.setEnd(e.container(),e.offset())})),t.selection.setRng(ug(r)))}));var y,w,x,C,S,k,O,_,E,A=Xp(y=e)?tu(null):ex(y);E=A,(_=e).addCommand("delete",(function(){var e,t=E;Wy(e=_)||ab(e,!1)||eb(e,!1)||zy(e,t,!1)||Wv(e,!1)||ag(e)||ub(e,!1)||Fy(e,!1)||qv(e)||Py(e,!1)||($y(e,"Delete"),zv(e))})),_.addCommand("forwardDelete",(function(){var e,t=E;ab(e=_,!0)||eb(e,!0)||zy(e,t,!0)||Wv(e,!0)||ag(e)||ub(e,!0)||Fy(e,!0)||qv(e)||Py(e,!0)||$y(e,"ForwardDelete")})),wc(w=e)&&w.on("NodeChange",T(Ky,w)),C=(x=e).dom,S=wc(x),k=x.getParam("placeholder",ls.getAttrib(x.getElement(),"placeholder"),"string"),O=function(e,t){var n,r,o;!function(e){if(_v(e)){var t=e.keyCode;return!Ev(e)&&(_f.metaKeyPressed(e)||e.altKey||112<=t&&t<=123||B(Lb,t))}}(e)&&(n=x.getBody(),r=!(_v(o=e)&&!(Ev(o)||"keyup"===o.type&&229===o.keyCode))&&function(e,t,n){if(Wr(Tt.fromDom(t),!1)){var r=""===n,o=t.firstElementChild;return!o||!e.getStyle(t.firstElementChild,"padding-left")&&!e.getStyle(t.firstElementChild,"padding-right")&&(r?!e.isBlock(o):n===o.nodeName.toLowerCase())}return!1}(C,n,S),""!==C.getAttrib(n,Hb)===r&&!t||(C.setAttrib(n,Hb,r?k:null),C.setAttrib(n,"aria-placeholder",r?k:null),x.fire("PlaceholderToggle",{state:r}),x.on(r?"keydown":"keyup",O),x.off(r?"keyup":"keydown",O)))},k&&x.on("init",(function(e){O(e,!0),x.on("change SetContent ExecCommand",O),x.on("paste",(function(e){return Tr.setEditorTimeout(x,(function(){return O(e)}))}))}));var D=Yp(e);(function(e){var t=e.settings,n=e.getDoc(),r=e.getBody();e.fire("PreInit"),t.browser_spellcheck||t.gecko_spellcheck||(n.body.spellcheck=!1,Kx.setAttrib(r,"spellcheck","false")),e.quirks=function(e){function t(t,n){try{e.getDoc().execCommand(t,!1,n)}catch(t){}}function n(e){return e.isDefaultPrevented()}function r(){e.shortcuts.add("meta+a",null,"SelectAll")}function o(){e.inline||y.bind(e.getDoc(),"mousedown mouseup",(function(t){var n;t.target===e.getDoc().documentElement&&(n=w.getRng(),e.getBody().focus(),"mousedown"===t.type?zr(n.startContainer)||w.placeCaretAt(t.clientX,t.clientY):w.setRng(n))}))}function i(){Range.prototype.getClientRects||e.on("mousedown",(function(t){var r;n(t)||"HTML"!==t.target.nodeName||((r=e.getBody()).blur(),Tr.setEditorTimeout(e,(function(){r.focus()})))}))}function a(){e.on("click",(function(t){var n=t.target;/^(IMG|HR)$/.test(n.nodeName)&&"false"!==y.getContentEditableParent(n)&&(t.preventDefault(),e.selection.select(n),e.nodeChanged()),"A"===n.nodeName&&y.hasClass(n,"mce-item-anchor")&&(t.preventDefault(),w.select(n))}))}function u(){e.on("keydown",(function(e){if(!n(e)&&e.keyCode===v&&w.isCollapsed()&&0===w.getRng().startOffset){var t=w.getNode().previousSibling;if(t&&t.nodeName&&"table"===t.nodeName.toLowerCase())return e.preventDefault(),!1}}))}function s(){e.getParam("readonly")||e.on("BeforeExecCommand mousedown",(function(){t("StyleWithCSS",!1),t("enableInlineTableEditing",!1),Ec(e)||t("enableObjectResizing",!1)}))}function l(){e.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}")}function f(){e.inline||e.on("keydown",(function(){document.activeElement===document.body&&e.getWin().focus()}))}function d(){e.inline||(e.contentStyles.push("body {min-height: 150px}"),e.on("click",(function(t){var n;"HTML"===t.target.nodeName&&(11<xt.ie?e.getBody().focus():(n=e.selection.getRng(),e.getBody().focus(),e.selection.setRng(n),e.selection.normalize(),e.nodeChanged()))})))}function m(){xt.mac&&e.on("keydown",(function(t){!_f.metaKeyPressed(t)||t.shiftKey||37!==t.keyCode&&39!==t.keyCode||(t.preventDefault(),e.selection.getSel().modify("move",37===t.keyCode?"backward":"forward","lineboundary"))}))}function g(){e.on("click",(function(e){var t=e.target;do{if("A"===t.tagName)return void e.preventDefault()}while(t=t.parentNode)})),e.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}")}function p(){e.on("init",(function(){e.dom.bind(e.getBody(),"submit",(function(e){e.preventDefault()}))}))}var h=kt.each,v=_f.BACKSPACE,b=_f.DELETE,y=e.dom,w=e.selection,x=e.parser,C=xt.gecko,S=xt.ie,k=xt.webkit,T="data:text/mce-internal,",O=S?"Text":"URL",_=c;return Xp(e)?(k&&(o(),a(),p(),r(),xt.iOS&&(f(),d(),g())),C&&(i(),s(),l(),m())):(e.on("keydown",(function(t){if(!n(t)&&t.keyCode===_f.BACKSPACE){var r,o=(r=w.getRng()).startContainer,i=r.startOffset,a=y.getRoot(),u=o;if(r.collapsed&&0===i){for(;u&&u.parentNode&&u.parentNode.firstChild===u&&u.parentNode!==a;)u=u.parentNode;"BLOCKQUOTE"===u.tagName&&(e.formatter.toggle("blockquote",null,u),(r=y.createRng()).setStart(o,0),r.setEnd(o,0),w.setRng(r))}}})),e.on("keydown",(function(t){var r,o,i,a,u=t.keyCode;n(t)||u!==b&&u!==v||(r=e.selection.isCollapsed(),o=e.getBody(),r&&!y.isEmpty(o)||!r&&(i=D(e.selection.getRng()),(a=y.createRng()).selectNode(e.getBody()),i!==D(a))||(t.preventDefault(),e.setContent(""),o.firstChild&&y.isBlock(o.firstChild)?e.selection.setCursorLocation(o.firstChild,0):e.selection.setCursorLocation(o,0),e.nodeChanged()))})),xt.windowsPhone||e.on("keyup focusin mouseup",(function(e){_f.modifierPressed(e)||w.normalize()}),!0),k&&(o(),a(),wc(e)&&e.on("init",(function(){t("DefaultParagraphSeparator",wc(e))})),p(),u(),x.addNodeFilter("br",(function(e){for(var t=e.length;t--;)"Apple-interchange-newline"===e[t].attr("class")&&e[t].remove()})),xt.iOS?(f(),d(),g()):r()),11<=xt.ie&&(d(),u()),xt.ie&&(r(),t("AutoUrlDetect",!1),e.on("dragstart",(function(t){var n,r,o;(n=t).dataTransfer&&(e.selection.isCollapsed()&&"IMG"===n.target.tagName&&w.select(n.target),0<(r=e.selection.getContent()).length&&(o=T+escape(e.id)+","+escape(r),n.dataTransfer.setData(O,o)))})),e.on("drop",(function(t){var r,o,i,a;n(t)||(r=t.dataTransfer&&(a=t.dataTransfer.getData(O))&&0<=a.indexOf(T)?(a=a.substr(T.length).split(","),{id:unescape(a[0]),html:unescape(a[1])}):null)&&r.id!==e.id&&(t.preventDefault(),o=hf(t.x,t.y,e.getDoc()),w.setRng(o),i=r.html,e.queryCommandSupported("mceInsertClipboardContent")?e.execCommand("mceInsertClipboardContent",!1,{content:i,internal:!0}):e.execCommand("mceInsertContent",!1,i))}))),C&&(e.on("keydown",(function(t){if(!n(t)&&t.keyCode===v&&e.getBody().getElementsByTagName("hr").length&&w.isCollapsed()&&0===w.getRng().startOffset){var r=w.getNode(),o=r.previousSibling;if("HR"===r.nodeName)return y.remove(r),void t.preventDefault();o&&o.nodeName&&"hr"===o.nodeName.toLowerCase()&&(y.remove(o),t.preventDefault())}})),i(),e.on("keypress",(function(t){var r;if(!n(t)&&(8===t.keyCode||46===t.keyCode)&&A())return r=E(),e.getDoc().execCommand("delete",!1,null),r(),t.preventDefault(),!1})),y.bind(e.getDoc(),"cut",(function(t){var r;!n(t)&&A()&&(r=E(),Tr.setEditorTimeout(e,(function(){r()})))})),s(),e.on("SetContent ExecCommand",(function(e){"setcontent"!==e.type&&"mceInsertLink"!==e.command||h(y.select("a"),(function(e){var t=e.parentNode,n=y.getRoot();if(t.lastChild===e){for(;t&&!y.isBlock(t);){if(t.parentNode.lastChild!==t||t===n)return;t=t.parentNode}y.add(t,"br",{"data-mce-bogus":1})}}))})),l(),m(),u())),{refreshContentEditable:_,isHidden:function(){if(!C||e.removed)return!1;var t=e.selection.getSel();return!t||!t.rangeCount||0===t.rangeCount}};function E(){var t=y.getAttribs(w.getStart().cloneNode(!1));return function(){var n=w.getStart();n!==e.getBody()&&(y.setAttrib(n,"style",null),h(t,(function(e){n.setAttributeNode(e.cloneNode(!0))})))}}function A(){return!w.isCollapsed()&&y.getParent(w.getStart(),y.isBlock)!==y.getParent(w.getEnd(),y.isBlock)}function D(e){var t=y.create("body"),n=e.cloneContents();return t.appendChild(n),w.serializer.serialize(t,{format:"html"})}}(e),e.fire("PostRender");var o=e.getParam("directionality",iu.isRtl()?"rtl":void 0);void 0!==o&&(r.dir=o),t.protect&&e.on("BeforeSetContent",(function(e){kt.each(t.protect,(function(t){e.content=e.content.replace(t,(function(e){return"\x3c!--mce:protected "+escape(e)+"--\x3e"}))}))})),e.on("SetContent",(function(){e.addVisual(e.getBody())})),e.on("compositionstart compositionend",(function(t){e.composing="compositionstart"===t.type}))})(e),D.fold((function(){Mx(e).then((function(){return Nx(e)}))}),(function(t){e.setProgressState(!0),Mx(e).then((function(){t().then((function(t){e.setProgressState(!1),Nx(e)}),(function(t){e.notificationManager.open({type:"error",text:String(t)}),Nx(e)}))}))}))}function zx(e){return e.replace(/^\-/,"")}function Bx(e){return{editorContainer:e,iframeContainer:e,api:{}}}function Px(e){var t,n,r,o,i,a,u,s;e.fire("ScriptsLoaded"),t=e,n=kt.trim(Sc(t)),r=t.ui.registry.getAll().icons,ne(_e(_e({},nv.get("default").icons),nv.get(n).icons),(function(e,n){Te(r,n)||t.ui.registry.addIcon(n,e)})),a=Dc(o=e),v(a)?(o.settings.theme=zx(a),i=cv.get(a),o.theme=new i(o,cv.urls[a]),o.theme.init&&o.theme.init(o,cv.urls[a]||o.documentBaseUrl.replace(/\/$/,""),o.$)):o.theme={},s=[],kt.each(Nc(u=e).split(/[ ,]/),(function(e){Jx(u,s,zx(e))}));var l=function(e){var t,n,r,o,i,a,u,c=e.getElement();return e.orgDisplay=c.style.display,v(Dc(e))?e.theme.renderUI():S(Dc(e))?(n=(t=e).getElement(),(r=Dc(t)(t,n)).editorContainer.nodeType&&(r.editorContainer.id=r.editorContainer.id||t.id+"_parent"),r.iframeContainer&&r.iframeContainer.nodeType&&(r.iframeContainer.id=r.iframeContainer.id||t.id+"_iframecontainer"),r.height=r.iframeHeight||n.offsetHeight,r):(u=(o=e).getElement(),o.inline?Bx(null):(i=u,a=Yx.create("div"),Yx.insertAfter(a,i),Bx(a)))}(e),f=e,d=ve.from(l.api).getOr({}),m={show:ve.from(d.show).getOr(c),hide:ve.from(d.hide).getOr(c),disable:ve.from(d.disable).getOr(c),isDisabled:ve.from(d.isDisabled).getOr(D),enable:function(){f.mode.isReadOnly()||ve.from(d.enable).map(E)}};f.ui=_e(_e({},f.ui),m);var g,p,h,b={editorContainer:l.editorContainer,iframeContainer:l.iframeContainer};return e.editorContainer=b.editorContainer||null,function(e){var t,n;e.contentCSS=e.contentCSS.concat(Bb(e,(n=(t=e).getParam("content_css"),v(n)?I(n.split(","),Je):y(n)?n:!1===n||t.inline?[]:["default"])),Bb(e,_c(e)))}(e),e.inline?Rx(e):(h=function(e,t){var n,r,o,i,a=e.translate(e.getParam("iframe_aria_text","Rich Text Area. Press ALT-0 for help.","string")),u=(n=e.id,r=a,t.height,o=e.getParam("iframe_attrs",{}),hn(i=Tt.fromTag("iframe"),o),hn(i,{id:n+"_ifr",frameBorder:"0",allowTransparency:"true",title:r}),du(i,"tox-edit-area__iframe"),i.dom);u.onload=function(){u.onload=null,e.fire("load")};var c=function(e,t){if(document.domain!==window.location.hostname&&xt.browser.isIE()){var n=hv("mce");e[n]=function(){Rx(e)};var r='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinymce.get("'+e.id+'");document.write(ed.iframeHTML);document.close();ed.'+n+"(true);})()";return Xx.setAttrib(t,"src",r),!0}return!1}(e,u);return e.contentAreaContainer=t.iframeContainer,e.iframeElement=u,e.iframeHTML=function(e){var t=e.getParam("doctype","<!DOCTYPE html>")+"<html><head>";e.getParam("document_base_url","")!==e.documentBaseUrl&&(t+='<base href="'+e.documentBaseURI.getURI()+'" />'),t+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';var n=bc(e,"body_id","tinymce"),r=bc(e,"body_class","");return yc(e)&&(t+='<meta http-equiv="Content-Security-Policy" content="'+yc(e)+'" />'),t+'</head><body id="'+n+'" class="mce-content-body '+r+'" data-id="'+e.id+'"><br></body></html>'}(e),Xx.add(t.iframeContainer,u),c}(g=e,p=b),p.editorContainer&&(Xx.get(p.editorContainer).style.display=g.orgDisplay,g.hidden=Xx.isHidden(p.editorContainer)),g.getElement().style.display="none",Xx.setAttrib(g.id,"aria-hidden","true"),void(h||Rx(g)))}function Ix(e){return"-"===e.charAt(0)}function Fx(e,t,n){return ve.from(t).filter((function(e){return 0<e.length&&!nv.has(e)})).map((function(t){return{url:e.editorManager.baseURL+"/icons/"+t+"/icons"+n+".js",name:ve.some(t)}}))}function Lx(e){return function(t,n){return ve.from(n).map(Tt.fromDom).filter(Tn).bind((function(n){return r=e,o=t,i=n.dom,pg(Tt.fromDom(i),(function(e){return xn(t=e,r).orThunk((function(){return"font"===Ot(t)?ue(Qx,r).bind((function(e){return bn(t,e)})):ve.none()}));var t}),(function(e){return je(Tt.fromDom(o),e)})).or((a=n.dom,ve.from(Xa.DOM.getStyle(a,e,!0))));var r,o,i,a})).getOr("")}}function Hx(e){return Kl(e.getBody()).map((function(e){var t=e.container();return Vn(t)?t.parentNode:t}))}function Vx(e,t){return n=e,r=l(ve.some,t),o=n,ve.from(o.selection.getRng()).bind((function(e){var t=o.getBody();return e.startContainer===t&&0===e.startOffset?ve.none():ve.from(o.selection.getStart(!0))})).orThunk(T(Hx,n)).map(Tt.fromDom).filter(Tn).bind(r);var n,r,o}function jx(e,t){if(/^[0-9.]+$/.test(t)){var n=parseInt(t,10);if(1<=n&&n<=7){var r=kt.explode(e.getParam("font_size_style_values","xx-small,x-small,small,medium,large,x-large,xx-large")),o=kt.explode(e.getParam("font_size_classes",""));return o?o[n-1]||t:r[n-1]||t}return t}return t}var Ux=Kn,Wx=Gn,$x=function(e){e.on((function(e){kx(e.ghost)})),e.clear()},qx=Gn,Gx=Kn,Kx=Xa.DOM,Xx=Xa.DOM,Yx=Xa.DOM,Jx=function(e,t,n){var r,o,i,a=uv.get(n),u=uv.urls[n]||e.documentBaseUrl.replace(/\/$/,"");if(n=kt.trim(n),a&&-1===kt.inArray(t,n)&&(kt.each(uv.dependencies(n),(function(n){Jx(e,t,n)})),!e.plugins[n]))try{var c=new a(e,u,e.$);(e.plugins[n]=c).init&&(c.init(e,u),t.push(n))}catch(a){o=a,ff(r=e,"PluginLoadError",{message:i=iu.translate(["Failed to initialize plugin: {0}",n])}),Nb(i,o),fv(r,i)}},Zx=Xa.DOM,Qx={"font-size":"size","font-family":"face"},eC=Lx("font-size"),tC=s((function(e){return e.replace(/[\'\"\\]/g,"").replace(/,\s+/g,",")}),Lx("font-family")),nC=kt.each,rC=kt.map,oC=kt.inArray,iC=(aC.prototype.execCommand=function(e,t,n,r){var o,i,a=!1,u=this;if(!u.editor.removed){if("mcefocus"!==e.toLowerCase()&&(/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(e)||r&&r.skip_focus?od(i=u.editor).each((function(e){return i.selection.setRng(e)})):u.editor.focus()),(r=u.editor.fire("BeforeExecCommand",{command:e,ui:t,value:n})).isDefaultPrevented())return!1;var c=e.toLowerCase();if(o=u.commands.exec[c])return o(c,t,n),u.editor.fire("ExecCommand",{command:e,ui:t,value:n}),!0;if(nC(this.editor.plugins,(function(r){if(r.execCommand&&r.execCommand(e,t,n))return u.editor.fire("ExecCommand",{command:e,ui:t,value:n}),!(a=!0)})),a)return a;if(u.editor.theme&&u.editor.theme.execCommand&&u.editor.theme.execCommand(e,t,n))return u.editor.fire("ExecCommand",{command:e,ui:t,value:n}),!0;try{a=u.editor.getDoc().execCommand(e,t,n)}catch(r){}return!!a&&(u.editor.fire("ExecCommand",{command:e,ui:t,value:n}),!0)}},aC.prototype.queryCommandState=function(e){var t;if(!this.editor.quirks.isHidden()&&!this.editor.removed){if(e=e.toLowerCase(),t=this.commands.state[e])return t(e);try{return this.editor.getDoc().queryCommandState(e)}catch(e){}return!1}},aC.prototype.queryCommandValue=function(e){var t;if(!this.editor.quirks.isHidden()&&!this.editor.removed){if(e=e.toLowerCase(),t=this.commands.value[e])return t(e);try{return this.editor.getDoc().queryCommandValue(e)}catch(e){}}},aC.prototype.addCommands=function(e,t){void 0===t&&(t="exec");var n=this;nC(e,(function(e,r){nC(r.toLowerCase().split(","),(function(r){n.commands[t][r]=e}))}))},aC.prototype.addCommand=function(e,t,n){var r=this;e=e.toLowerCase(),this.commands.exec[e]=function(e,o,i,a){return t.call(n||r.editor,o,i,a)}},aC.prototype.queryCommandSupported=function(e){if(e=e.toLowerCase(),this.commands.exec[e])return!0;try{return this.editor.getDoc().queryCommandSupported(e)}catch(e){}return!1},aC.prototype.addQueryStateHandler=function(e,t,n){var r=this;e=e.toLowerCase(),this.commands.state[e]=function(){return t.call(n||r.editor)}},aC.prototype.addQueryValueHandler=function(e,t,n){var r=this;e=e.toLowerCase(),this.commands.value[e]=function(){return t.call(n||r.editor)}},aC.prototype.hasCustomCommand=function(e){return e=e.toLowerCase(),!!this.commands.exec[e]},aC.prototype.execNativeCommand=function(e,t,n){return void 0===t&&(t=!1),void 0===n&&(n=null),this.editor.getDoc().execCommand(e,t,n)},aC.prototype.isFormatMatch=function(e){return this.editor.formatter.match(e)},aC.prototype.toggleFormat=function(e,t){this.editor.formatter.toggle(e,t),this.editor.nodeChanged()},aC.prototype.storeSelection=function(e){this.selectionBookmark=this.editor.selection.getBookmark(e)},aC.prototype.restoreSelection=function(){this.editor.selection.moveToBookmark(this.selectionBookmark)},aC.prototype.setupCommands=function(e){var t=this;function n(t){return function(){var n=e.selection,r=n.isCollapsed()?[e.dom.getParent(n.getNode(),e.dom.isBlock)]:n.getSelectedBlocks(),o=rC(r,(function(n){return!!e.formatter.matchNode(n,t)}));return-1!==oC(o,!0)}}this.addCommands({"mceResetDesignMode,mceBeginUndoLevel":c,"mceEndUndoLevel,mceAddUndoLevel":function(){e.undoManager.add()},mceFocus:function(t,n,r){var o,i;i=r,(o=e).removed||(i?Dd:function(e){var t=e.selection,n=e.getBody(),r=t.getRng();e.quirks.refreshContentEditable(),void 0!==e.bookmark&&!1===ld(e)&&od(e).each((function(t){e.selection.setRng(t),r=t}));var o,i,a=(o=e,i=t.getNode(),o.dom.getParent(i,(function(e){return"true"===o.dom.getContentEditable(e)})));if(e.$.contains(n,a))return sd(a),cd(e,r),Dd(e);e.inline||(xt.opera||sd(n),e.getWin().focus()),(xt.gecko||e.inline)&&(sd(n),cd(e,r)),Dd(e)})(o)},"Cut,Copy,Paste":function(n){var r,o,i=e.getDoc();try{t.execNativeCommand(n)}catch(n){r=!0}!(r="paste"===n&&!i.queryCommandEnabled(n)||r)&&i.queryCommandSupported(n)||(o=e.translate("Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead."),xt.mac&&(o=o.replace(/Ctrl\+/g,"⌘+")),e.notificationManager.open({text:o,type:"error"}))},unlink:function(){var t;e.selection.isCollapsed()?(t=e.dom.getParent(e.selection.getStart(),"a"))&&e.dom.remove(t,!0):e.formatter.remove("link")},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull,JustifyNone":function(n){var r=n.substring(7);"full"===r&&(r="justify"),nC("left,center,right,justify".split(","),(function(t){r!==t&&e.formatter.remove("align"+t)})),"none"!==r&&t.toggleFormat("align"+r)},"InsertUnorderedList,InsertOrderedList":function(n){var r;t.execNativeCommand(n);var o=e.dom.getParent(e.selection.getNode(),"ol,ul");o&&(r=o.parentNode,/^(H[1-6]|P|ADDRESS|PRE)$/.test(r.nodeName)&&(t.storeSelection(),e.dom.split(r,o),t.restoreSelection()))},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){t.toggleFormat(e)},"ForeColor,HiliteColor":function(e,n,r){t.toggleFormat(e,{value:r})},FontName:function(t,n,r){var o,i;i=jx(o=e,r),o.formatter.toggle("fontname",{value:I(i.split(/\s*,\s*/),(function(e){return-1===e.indexOf(" ")||Ye(e,'"')||Ye(e,"'")?e:"'"+e+"'"})).join(",")}),o.nodeChanged()},FontSize:function(t,n,r){var o;(o=e).formatter.toggle("fontsize",{value:jx(o,r)}),o.nodeChanged()},LineHeight:function(t,n,r){var o;(o=e).formatter.toggle("lineheight",{value:String(r)}),o.nodeChanged()},Lang:function(e,n,r){t.toggleFormat(e,{value:r.code,customValue:r.customCode})},RemoveFormat:function(t){e.formatter.remove(t)},mceBlockQuote:function(){t.toggleFormat("blockquote")},FormatBlock:function(e,n,r){return t.toggleFormat(r||"p")},mceCleanup:function(){var t=e.selection.getBookmark();e.setContent(e.getContent()),e.selection.moveToBookmark(t)},mceRemoveNode:function(n,r,o){var i=o||e.selection.getNode();i!==e.getBody()&&(t.storeSelection(),e.dom.remove(i,!0),t.restoreSelection())},mceSelectNodeDepth:function(t,n,r){var o=0;e.dom.getParent(e.selection.getNode(),(function(t){if(1===t.nodeType&&o++===r)return e.selection.select(t),!1}),e.getBody())},mceSelectNode:function(t,n,r){e.selection.select(r)},mceInsertContent:function(t,n,r){var o,i,a,u;o=e,i=function(e){if("string"==typeof e)return{content:e,details:{}};var t=kt.extend({paste:e.paste,data:{paste:e.paste}},e);return{content:e.content,details:t}}(r),a=i.content,u=i.details,Jp(o).editor.insertContent(a,u)},mceInsertRawHTML:function(t,n,r){e.selection.setContent("tiny_mce_marker");var o=e.getContent();e.setContent(o.replace(/tiny_mce_marker/g,(function(){return r})))},mceInsertNewLine:function(t,n,r){Kw(e,r)},mceToggleFormat:function(e,n,r){t.toggleFormat(r)},mceSetContent:function(t,n,r){e.setContent(r)},"Indent,Outdent":function(t){Uy(e,t)},mceRepaint:c,InsertHorizontalRule:function(){e.execCommand("mceInsertContent",!1,"<hr />")},mceToggleVisualAid:function(){e.hasVisual=!e.hasVisual,e.addVisual()},mceReplaceContent:function(t,n,r){e.execCommand("mceInsertContent",!1,r.replace(/\{\$selection\}/g,e.selection.getContent({format:"text"})))},mceInsertLink:function(t,n,r){"string"==typeof r&&(r={href:r});var o=e.dom.getParent(e.selection.getNode(),"a");r.href=r.href.replace(/ /g,"%20"),o&&r.href||e.formatter.remove("link"),r.href&&e.formatter.apply("link",r,o)},selectAll:function(){var t,n=e.dom.getParent(e.selection.getStart(),Gn);n&&((t=e.dom.createRng()).selectNodeContents(n),e.selection.setRng(t))},mceNewDocument:function(){e.setContent("")},InsertLineBreak:function(t,n,r){return Pw(e,r),!0}}),t.addCommands({JustifyLeft:n("alignleft"),JustifyCenter:n("aligncenter"),JustifyRight:n("alignright"),JustifyFull:n("alignjustify"),"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){return t.isFormatMatch(e)},mceBlockQuote:function(){return t.isFormatMatch("blockquote")},Outdent:function(){return Vy(e)},"InsertUnorderedList,InsertOrderedList":function(t){var n=e.dom.getParent(e.selection.getNode(),"ul,ol");return n&&("insertunorderedlist"===t&&"UL"===n.tagName||"insertorderedlist"===t&&"OL"===n.tagName)}},"state"),t.addCommands({Undo:function(){e.undoManager.undo()},Redo:function(){e.undoManager.redo()}}),t.addQueryValueHandler("FontName",(function(){return Vx(t=e,(function(e){return tC(t.getBody(),e.dom)})).getOr("");var t}),this),t.addQueryValueHandler("FontSize",(function(){return Vx(t=e,(function(e){return eC(t.getBody(),e.dom)})).getOr("");var t}),this),t.addQueryValueHandler("LineHeight",(function(){return Vx(t=e,(function(e){var n=Tt.fromDom(t.getBody());return pg(e,(function(e){return xn(e,"line-height")}),T(je,n)).getOrThunk((function(){var t=parseFloat(wn(e,"line-height")),n=parseFloat(wn(e,"font-size"));return String(t/n)}))})).getOr("");var t}),this)},aC);function aC(e){this.commands={state:{},exec:{},value:{}},this.editor=e,this.setupCommands(e)}function uC(e,t,n){try{e.getDoc().execCommand(t,!1,String(n))}catch(e){}}function cC(e,t){e.dom.contentEditable=t?"true":"false"}function sC(e,t){var n,r,o=Tt.fromDom(e.getBody());(function(e,t,n){var r,o,i,a,u,c;mu(e,t)&&!1===n?(o=t,fu(r=e)?r.dom.classList.remove(o):(u=o,0<(c=V(lu(a=r,"class"),(function(e){return e!==u}))).length?pn(a,"class",c.join(" ")):yn(a,"class")),0===(fu(i=r)?i.dom.classList:lu(i,"class")).length&&yn(i,"class")):n&&du(e,t)})(o,"mce-content-readonly",t),t?(e.selection.controlSelection.hideResizeRect(),e._selectionOverrides.hideFakeCaret(),ve.from(e.selection.getNode()).each((function(e){e.removeAttribute("data-mce-selected")})),cC(o,!(e.readonly=!0)),F(gu(o,'*[contenteditable="true"]'),(function(e){pn(e,dC,"true"),cC(e,!1)}))):(cC(o,!(e.readonly=!1)),F(gu(o,"*["+dC+'="true"]'),(function(e){yn(e,dC),cC(e,!0)})),uC(e,"StyleWithCSS",!1),uC(e,"enableInlineTableEditing",!1),uC(e,"enableObjectResizing",!1),(ld(n=e)||(r=n,Xf(Nn(Tt.fromDom(r.getElement()))).filter((function(e){return!(void 0!==(t=e.dom.classList)&&(t.contains("tox-edit-area")||t.contains("tox-edit-area__iframe")||t.contains("mce-content-body")))&&id(r,e.dom);var t})).isSome()))&&e.focus(),e.selection.setRng(e.selection.getRng()),e.nodeChanged())}function lC(e){return e.readonly}function fC(e){e.parser.addAttributeFilter("contenteditable",(function(t){lC(e)&&F(t,(function(e){e.attr(dC,e.attr("contenteditable")),e.attr("contenteditable","false")}))})),e.serializer.addAttributeFilter(dC,(function(t){lC(e)&&F(t,(function(e){e.attr("contenteditable",e.attr(dC))}))})),e.serializer.addTempAttr(dC)}var dC="data-mce-contenteditable",mC=kt.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"," "),gC=(pC.isNative=function(e){return!!mC[e.toLowerCase()]},pC.prototype.fire=function(e,t){var n=e.toLowerCase(),r=ro(n,t||{},this.scope);this.settings.beforeFire&&this.settings.beforeFire(r);var o=this.bindings[n];if(o)for(var i=0,a=o.length;i<a;i++){var u=o[i];if(!u.removed){if(u.once&&this.off(n,u.func),r.isImmediatePropagationStopped())return r;if(!1===u.func.call(this.scope,r))return r.preventDefault(),r}}return r},pC.prototype.on=function(e,t,n,r){if(t=!1===t?D:t){var o={func:t,removed:!1};r&&kt.extend(o,r);for(var i=e.toLowerCase().split(" "),a=i.length;a--;){var u=i[a],c=this.bindings[u];c||(c=[],this.toggleEvent(u,!0)),c=n?Ee([o],c,!0):Ee(Ee([],c,!0),[o],!1),this.bindings[u]=c}}return this},pC.prototype.off=function(e,t){var n=this;if(e)for(var r=e.toLowerCase().split(" "),o=r.length;o--;){var i,a=r[o],u=this.bindings[a];if(!a)return ne(this.bindings,(function(e,t){n.toggleEvent(t,!1),delete n.bindings[t]})),this;u&&(t?(u=(i=H(u,(function(e){return e.func===t}))).fail,this.bindings[a]=u,F(i.pass,(function(e){e.removed=!0}))):u.length=0,u.length||(this.toggleEvent(e,!1),delete this.bindings[a]))}else ne(this.bindings,(function(e,t){n.toggleEvent(t,!1)})),this.bindings={};return this},pC.prototype.once=function(e,t,n){return this.on(e,t,n,{once:!0})},pC.prototype.has=function(e){return e=e.toLowerCase(),!(!this.bindings[e]||0===this.bindings[e].length)},pC);function pC(e){this.bindings={},this.settings=e||{},this.scope=this.settings.scope||this,this.toggleEvent=this.settings.toggleEvent||D}function hC(e){return e._eventDispatcher||(e._eventDispatcher=new gC({scope:e,toggleEvent:function(t,n){gC.isNative(t)&&e.toggleNativeEvent&&e.toggleNativeEvent(t,n)}})),e._eventDispatcher}function vC(e,t){if("selectionchange"===t)return e.getDoc();if(!e.inline&&/^mouse|touch|click|contextmenu|drop|dragover|dragend/.test(t))return e.getDoc().documentElement;var n=Ac(e);return n?(e.eventRoot||(e.eventRoot=kC.select(n)[0]),e.eventRoot):e.getBody()}function bC(e,t,n){var r,o,i,a;e.hidden||lC(e)?lC(e)&&(r=e,"click"!==(o=n).type||_f.metaKeyPressed(o)||(i=Tt.fromDom(o.target),a=r,vr(i,"a",(function(e){return je(e,Tt.fromDom(a.getBody()))})).bind((function(e){return bn(e,"href")})).each((function(e){var t,n;o.preventDefault(),/^#/.test(e)?(t=r.dom.select(e+',[name="'+(Ye(n=e,"#")?n.substring("#".length):n)+'"]')).length&&r.selection.scrollIntoView(t[0],!0):window.open(e,"_blank","rel=noopener noreferrer,menubar=yes,toolbar=yes,location=yes,status=yes,resizable=yes,scrollbars=yes")})))):e.fire(t,n)}function yC(e,t){var n,r;e.delegates||(e.delegates={}),e.delegates[t]||e.removed||(r=vC(e,t),Ac(e)?(CC||(CC={},e.editorManager.on("removeEditor",(function(){e.editorManager.activeEditor||CC&&(ne(CC,(function(t,n){e.dom.unbind(vC(e,n))})),CC=null)}))),CC[t]||(CC[t]=n=function(n){for(var r=n.target,o=e.editorManager.get(),i=o.length;i--;){var a=o[i].getBody();a!==r&&!kC.isChildOf(r,a)||bC(o[i],t,n)}},kC.bind(r,t,n))):(kC.bind(r,t,n=function(n){bC(e,t,n)}),e.delegates[t]=n))}function wC(e,t,n,r){var o=n[t.get()],i=n[r];try{i.activate()}catch(e){return void console.error("problem while activating editor mode "+r+":",e)}o.deactivate(),o.editorReadOnly!==i.editorReadOnly&&sC(e,i.editorReadOnly),t.set(r),e.fire("SwitchMode",{mode:r})}function xC(e){var t,n={};_C(EC(e.toLowerCase(),"+"),(function(e){e in DC?n[e]=!0:/^[0-9]{2,}$/.test(e)?n.keyCode=parseInt(e,10):(n.charCode=e.charCodeAt(0),n.keyCode=AC[e]||e.toUpperCase().charCodeAt(0))}));var r=[n.keyCode];for(t in DC)n[t]?r.push(t):n[t]=!1;return n.id=r.join(","),n.access&&(n.alt=!0,xt.mac?n.ctrl=!0:n.shift=!0),n.meta&&(xt.mac?n.meta=!0:(n.ctrl=!0,n.meta=!1)),n}var CC,SC={fire:function(e,t,n){if(this.removed&&"remove"!==e&&"detach"!==e)return t;var r=hC(this).fire(e,t);if(!1!==n&&this.parent)for(var o=this.parent();o&&!r.isPropagationStopped();)o.fire(e,r,!1),o=o.parent();return r},on:function(e,t,n){return hC(this).on(e,t,n)},off:function(e,t){return hC(this).off(e,t)},once:function(e,t){return hC(this).once(e,t)},hasEventListeners:function(e){return hC(this).has(e)}},kC=Xa.DOM,TC=_e(_e({},SC),{bindPendingEventDelegates:function(){var e=this;kt.each(e._pendingNativeEvents,(function(t){yC(e,t)}))},toggleNativeEvent:function(e,t){var n=this;"focus"!==e&&"blur"!==e&&(n.removed||(t?n.initialized?yC(n,e):n._pendingNativeEvents?n._pendingNativeEvents.push(e):n._pendingNativeEvents=[e]:n.initialized&&(n.dom.unbind(vC(n,e),e,n.delegates[e]),delete n.delegates[e])))},unbindAllNativeEvents:function(){var e=this,t=e.getBody(),n=e.dom;e.delegates&&(ne(e.delegates,(function(t,n){e.dom.unbind(vC(e,n),n,t)})),delete e.delegates),!e.inline&&t&&n&&(t.onload=null,n.unbind(e.getWin()),n.unbind(e.getDoc())),n&&(n.unbind(t),n.unbind(e.getContainer()))}}),OC=["design","readonly"],_C=kt.each,EC=kt.explode,AC={f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123},DC=kt.makeMap("alt,ctrl,shift,meta,access"),MC=(NC.prototype.add=function(e,t,n,r){var o=this,i=o.normalizeCommandFunc(n);return _C(EC(kt.trim(e)),(function(e){var n=o.createShortcut(e,t,i,r);o.shortcuts[n.id]=n})),!0},NC.prototype.remove=function(e){var t=this.createShortcut(e);return!!this.shortcuts[t.id]&&(delete this.shortcuts[t.id],!0)},NC.prototype.normalizeCommandFunc=function(e){var t=this,n=e;return"string"==typeof n?function(){t.editor.execCommand(n,!1,null)}:kt.isArray(n)?function(){t.editor.execCommand(n[0],n[1],n[2])}:n},NC.prototype.createShortcut=function(e,t,n,r){var o=kt.map(EC(e,">"),xC);return o[o.length-1]=kt.extend(o[o.length-1],{func:n,scope:r||this.editor}),kt.extend(o[0],{desc:this.editor.translate(t),subpatterns:o.slice(1)})},NC.prototype.hasModifier=function(e){return e.altKey||e.ctrlKey||e.metaKey},NC.prototype.isFunctionKey=function(e){return"keydown"===e.type&&112<=e.keyCode&&e.keyCode<=123},NC.prototype.matchShortcut=function(e,t){return!!t&&t.ctrl===e.ctrlKey&&t.meta===e.metaKey&&t.alt===e.altKey&&t.shift===e.shiftKey&&!!(e.keyCode===t.keyCode||e.charCode&&e.charCode===t.charCode)&&(e.preventDefault(),!0)},NC.prototype.executeShortcutAction=function(e){return e.func?e.func.call(e.scope):null},NC);function NC(e){this.shortcuts={},this.pendingPatterns=[],this.editor=e;var t=this;e.on("keyup keypress keydown",(function(e){!t.hasModifier(e)&&!t.isFunctionKey(e)||e.isDefaultPrevented()||(_C(t.shortcuts,(function(n){if(t.matchShortcut(e,n))return t.pendingPatterns=n.subpatterns.slice(0),"keydown"===e.type&&t.executeShortcutAction(n),!0})),t.matchShortcut(e,t.pendingPatterns[0])&&(1===t.pendingPatterns.length&&"keydown"===e.type&&t.executeShortcutAction(t.pendingPatterns[0]),t.pendingPatterns.shift()))}))}var RC=Xa.DOM,zC=kt.extend,BC=kt.each,PC=kt.resolve,IC=xt.ie,FC=(LC.prototype.render=function(){!function(e){var t=e.id;iu.setCode(Tc(e));var n,r,o,i,a=function(){Zx.unbind(window,"ready",a),e.render()};oi.Event.domLoaded?e.getElement()&&xt.contentEditable&&(n=Tt.fromDom(e.getElement()),r=U(n.dom.attributes,(function(e,t){return e[t.name]=t.value,e}),{}),e.on("remove",(function(){L(n.dom.attributes,(function(e){return yn(n,e.name),0})),hn(n,r)})),e.ui.styleSheetLoader=Or.forElement(n,{contentCssCors:(o=e).getParam("content_css_cors"),referrerPolicy:kc(o)}),e.getParam("inline")?e.inline=!0:(e.orgVisibility=e.getElement().style.visibility,e.getElement().style.visibility="hidden"),(i=e.getElement().form||Zx.getParent(t,"form"))&&(e.formElement=i,e.getParam("hidden_input")&&!Hn(e.getElement())&&(Zx.insertAfter(Zx.create("input",{type:"hidden",name:t}),t),e.hasHiddenInput=!0),e.formEventDelegate=function(t){e.fire(t.type,t)},Zx.bind(i,"submit reset",e.formEventDelegate),e.on("reset",(function(){e.resetContent()})),!e.getParam("submit_patch")||i.submit.nodeType||i.submit.length||i._mceOldSubmit||(i._mceOldSubmit=i.submit,i.submit=function(){return e.editorManager.triggerSave(),e.setDirty(!1),i._mceOldSubmit(i)})),e.windowManager=sv(e),e.notificationManager=Ph(e),"xml"===e.getParam("encoding")&&e.on("GetContent",(function(e){e.save&&(e.content=Zx.encode(e.content))})),e.getParam("add_form_submit_trigger")&&e.on("submit",(function(){e.initialized&&e.save()})),e.getParam("add_unload_trigger")&&(e._beforeUnload=function(){!e.initialized||e.destroyed||e.isHidden()||e.save({format:"raw",no_events:!0,set_dirty:!1})},e.editorManager.on("BeforeUnload",e._beforeUnload)),e.editorManager.add(e),function(e,t){var n,r,o=Qa.ScriptLoader,i=o,a=t,u=function(){var n,r,i,a,u,s,l,f,d;u=o,f=Tc(s=e),d=s.getParam("language_url","","string"),!1===iu.hasCode(f)&&"en"!==f&&(l=""!==d?d:s.editorManager.baseURL+"/langs/"+f+".js",u.add(l,c,void 0,(function(){dv(s,"LanguageLoadError",mv("language",l,f))}))),i=o,F(function(e){for(var t=[],n=function(e){t.push(e)},r=0;r<e.length;r++)e[r].each(n);return t}([Fx(a=e,"default",t),ve.from(a.getParam("icons_url","","string")).filter((function(e){return 0<e.length})).map((function(e){return{url:e,name:ve.none()}})).orThunk((function(){return Fx(a,Sc(a),"")}))]),(function(e){i.add(e.url,c,void 0,(function(){dv(a,"IconsLoadError",mv("icons",e.url,e.name.getOrUndefined()))}))})),n=e,r=t,kt.each(n.getParam("external_plugins"),(function(e,t){uv.load(t,e,c,void 0,(function(){gv(n,e,t)})),n.settings.plugins+=" "+t})),kt.each(Nc(n).split(/[ ,]/),(function(e){var t,o;(e=kt.trim(e))&&!uv.urls[e]&&(Ix(e)?(e=e.substr(1,e.length),t=uv.dependencies(e),kt.each(t,(function(e){var t=uv.createUrl({prefix:"plugins/",resource:e,suffix:"/plugin"+r+".js"},e);uv.load(t.resource,t,c,void 0,(function(){gv(n,t.prefix+t.resource+t.suffix,t.resource)}))}))):(o={prefix:"plugins/",resource:e,suffix:"/plugin"+r+".js"},uv.load(e,o,c,void 0,(function(){gv(n,o.prefix+o.resource+o.suffix,e)}))))})),o.loadQueue((function(){e.removed||Px(e)}),e,(function(){e.removed||Px(e)}))},s=Dc(n=e);v(s)?(Ix(s)||Te(cv.urls,s)||((r=n.getParam("theme_url"))?cv.load(s,n.documentBaseURI.toAbsolute(r)):cv.load(s,"themes/"+s+"/theme"+a+".js")),i.loadQueue((function(){cv.waitFor(s,u)}))):u()}(e,e.suffix)):Zx.bind(window,"ready",a)}(this)},LC.prototype.focus=function(e){this.execCommand("mceFocus",!1,e)},LC.prototype.hasFocus=function(){return ld(this)},LC.prototype.execCallback=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r,o=this.settings[e];if(o)return this.callbackLookup&&(r=this.callbackLookup[e])&&(o=r.func,r=r.scope),"string"==typeof o&&(r=(r=o.replace(/\.\w+$/,""))?PC(r):0,o=PC(o),this.callbackLookup=this.callbackLookup||{},this.callbackLookup[e]={func:o,scope:r}),o.apply(r||this,t)},LC.prototype.translate=function(e){return iu.translate(e)},LC.prototype.getParam=function(e,t,n){return i=t,a=n,l=(o=e)in(r=this).settings?r.settings[o]:i,"hash"===a?(s={},"string"==typeof(c=l)?F(0<c.indexOf("=")?c.split(/[;,](?![^=;,]*(?:[;,]|$))/):c.split(","),(function(e){var t=e.split("=");1<t.length?s[kt.trim(t[0])]=kt.trim(t[1]):s[kt.trim(t[0])]=kt.trim(t[0])})):s=c,s):"string"===a?Nh(v,r,o).getOr(i):"number"===a?Nh(k,r,o).getOr(i):"boolean"===a?Nh(x,r,o).getOr(i):"object"===a?Nh(b,r,o).getOr(i):"array"===a?Nh(y,r,o).getOr(i):"string[]"===a?Nh((u=v,function(e){return y(e)&&K(e,u)}),r,o).getOr(i):"function"===a?Nh(S,r,o).getOr(i):l;var r,o,i,a,u,c,s,l},LC.prototype.hasPlugin=function(e,t){return!(!B(Nc(this).split(/[ ,]/),e)||t&&void 0===uv.get(e))},LC.prototype.nodeChanged=function(e){this._nodeChangeDispatcher.nodeChanged(e)},LC.prototype.addCommand=function(e,t,n){this.editorCommands.addCommand(e,t,n)},LC.prototype.addQueryStateHandler=function(e,t,n){this.editorCommands.addQueryStateHandler(e,t,n)},LC.prototype.addQueryValueHandler=function(e,t,n){this.editorCommands.addQueryValueHandler(e,t,n)},LC.prototype.addShortcut=function(e,t,n,r){this.shortcuts.add(e,t,n,r)},LC.prototype.execCommand=function(e,t,n,r){return this.editorCommands.execCommand(e,t,n,r)},LC.prototype.queryCommandState=function(e){return this.editorCommands.queryCommandState(e)},LC.prototype.queryCommandValue=function(e){return this.editorCommands.queryCommandValue(e)},LC.prototype.queryCommandSupported=function(e){return this.editorCommands.queryCommandSupported(e)},LC.prototype.show=function(){this.hidden&&(this.hidden=!1,this.inline?this.getBody().contentEditable="true":(RC.show(this.getContainer()),RC.hide(this.id)),this.load(),this.fire("show"))},LC.prototype.hide=function(){var e=this,t=e.getDoc();e.hidden||(IC&&t&&!e.inline&&t.execCommand("SelectAll"),e.save(),e.inline?(e.getBody().contentEditable="false",e===e.editorManager.focusedEditor&&(e.editorManager.focusedEditor=null)):(RC.hide(e.getContainer()),RC.setStyle(e.id,"display",e.orgDisplay)),e.hidden=!0,e.fire("hide"))},LC.prototype.isHidden=function(){return!!this.hidden},LC.prototype.setProgressState=function(e,t){this.fire("ProgressState",{state:e,time:t})},LC.prototype.load=function(e){var t=this.getElement();if(this.removed)return"";if(t){(e=e||{}).load=!0;var n=Hn(t)?t.value:t.innerHTML,r=this.setContent(n,e);return e.element=t,e.no_events||this.fire("LoadContent",e),e.element=t=null,r}},LC.prototype.save=function(e){var t,n,r=this,o=r.getElement();if(o&&r.initialized&&!r.removed)return(e=e||{}).save=!0,e.element=o,e.content=r.getContent(e),e.no_events||r.fire("SaveContent",e),"raw"===e.format&&r.fire("RawSaveContent",e),t=e.content,Hn(o)?o.value=t:(!e.is_removing&&r.inline||(o.innerHTML=t),(n=RC.getParent(r.id,"form"))&&BC(n.elements,(function(e){if(e.name===r.id)return e.value=t,!1}))),e.element=o=null,!1!==e.set_dirty&&r.setDirty(!1),t},LC.prototype.setContent=function(e,t){return Oh(this,e,t)},LC.prototype.getContent=function(e){return this,n=(t=void 0===(t=e)?{}:t).format||"html",r=t,Jp(this).editor.getContent(r,n);var t,n,r},LC.prototype.insertContent=function(e,t){t&&(e=zC({content:e},t)),this.execCommand("mceInsertContent",!1,e)},LC.prototype.resetContent=function(e){void 0===e?Oh(this,this.startContent,{format:"raw"}):Oh(this,e),this.undoManager.reset(),this.setDirty(!1),this.nodeChanged()},LC.prototype.isDirty=function(){return!this.isNotDirty},LC.prototype.setDirty=function(e){var t=!this.isNotDirty;this.isNotDirty=!e,e&&e!==t&&this.fire("dirty")},LC.prototype.getContainer=function(){return this.container||(this.container=RC.get(this.editorContainer||this.id+"_parent")),this.container},LC.prototype.getContentAreaContainer=function(){return this.contentAreaContainer},LC.prototype.getElement=function(){return this.targetElm||(this.targetElm=RC.get(this.id)),this.targetElm},LC.prototype.getWin=function(){var e;return this.contentWindow||(e=this.iframeElement)&&(this.contentWindow=e.contentWindow),this.contentWindow},LC.prototype.getDoc=function(){var e;return this.contentDocument||(e=this.getWin())&&(this.contentDocument=e.document),this.contentDocument},LC.prototype.getBody=function(){var e=this.getDoc();return this.bodyElement||(e?e.body:null)},LC.prototype.convertURL=function(e,t,n){var r=this.settings;return r.urlconverter_callback?this.execCallback("urlconverter_callback",e,n,!0,t):!r.convert_urls||n&&"LINK"===n.nodeName||0===e.indexOf("file:")||0===e.length?e:r.relative_urls?this.documentBaseURI.toRelative(e):this.documentBaseURI.toAbsolute(e,r.remove_script_host)},LC.prototype.addVisual=function(e){var t;t=e,Zp(this).editor.addVisual(t)},LC.prototype.remove=function(){var e,t,n,r,o;(e=this).removed||(t=e._selectionOverrides,n=e.editorUpload,r=e.getBody(),o=e.getElement(),r&&e.save({is_removing:!0}),e.removed=!0,e.unbindAllNativeEvents(),e.hasHiddenInput&&o&&$h.remove(o.nextSibling),e.fire("remove"),e.editorManager.remove(e),!e.inline&&r&&$h.setStyle(e.id,"display",e.orgDisplay),e.fire("detach"),$h.remove(e.getContainer()),_h(t),_h(n),e.destroy())},LC.prototype.destroy=function(e){var t,n,r,o,i,a,u;n=e,a=(t=this).selection,u=t.dom,t.destroyed||(n||t.removed?(n||(t.editorManager.off("beforeunload",t._beforeUnload),t.theme&&t.theme.destroy&&t.theme.destroy(),_h(a),_h(u)),(o=(r=t).formElement)&&(o._mceOldSubmit&&(o.submit=o._mceOldSubmit,o._mceOldSubmit=null),$h.unbind(o,"submit reset",r.formEventDelegate)),(i=t).contentAreaContainer=i.formElement=i.container=i.editorContainer=null,i.bodyElement=i.contentDocument=i.contentWindow=null,i.iframeElement=i.targetElm=null,i.selection&&(i.selection=i.selection.win=i.selection.dom=i.selection.dom.doc=null),t.destroyed=!0):t.remove())},LC.prototype.uploadImages=function(e){return this.editorUpload.uploadImages(e)},LC.prototype._scanForImages=function(){return this.editorUpload.scanForImages()},LC.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")},LC.prototype.addSidebar=function(){throw new Error("editor.addSidebar has been removed in tinymce 5x, use editor.ui.registry.addSidebar instead")},LC.prototype.addMenuItem=function(){throw new Error("editor.addMenuItem has been removed in tinymce 5x, use editor.ui.registry.addMenuItem instead")},LC.prototype.addContextToolbar=function(){throw new Error("editor.addContextToolbar has been removed in tinymce 5x, use editor.ui.registry.addContextToolbar instead")},LC);function LC(e,t,n){var r,o,i,a,u,s,l,f,d,m,g,p,h,v,b,y,w=this;function x(e,t){return function(n,r){return e[n.toLowerCase()]=_e(_e({},r),{type:t})}}this.plugins={},this.contentCSS=[],this.contentStyles=[],this.loadedCSS={},this.isNotDirty=!1,this.editorManager=n,this.documentBaseUrl=n.documentBaseURL,zC(this,TC),this.settings=(d=this.documentBaseUrl,m=n.defaultSettings,p=d,h=Jh,this,v={id:e,theme:"silver",toolbar_mode:Dh(g=t,"floating"),plugins:"",document_base_url:p,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:this.convertURL,url_converter_scope:this},b=_e(_e({},v),h?tv:{}),!1!==(y=Mh(Zh||Qh,Zh,b,m,g)).deprecation_warnings&&function(e,t){var n,r,o,i,a,u,c,s=(n=e,r=V(Gh,(function(e){return Te(n,e)})),!1!==(o=n.forced_root_block)&&""!==o||r.push("forced_root_block (false only)"),J(r)),l=(c=kt.makeMap(t.plugins," "),J(Ee(Ee([],V(Kh,g),!0),G(Xh,(function(e){return g(e)?[e+" (moving to premium)"]:[]})),!0))),f=0<l.length,d=0<s.length,m="mobile"===t.theme;function g(e){return Te(c,e)}(f||d||m)&&(i=m?"\n\nThemes:\n- mobile":"",a=f?"\n\nPlugins:\n- "+l.join("\n- "):"",u=d?"\n\nSettings:\n- "+s.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."+i+a+u))}(g,y),y),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&&(Qa.ScriptLoader._setReferrerPolicy(this.settings.referrer_policy),Xa.DOM.styleSheetLoader._setReferrerPolicy(this.settings.referrer_policy)),au.languageLoad=this.settings.language_load,au.baseURL=n.baseURL,this.id=e,this.setDirty(!1),this.documentBaseURI=new Hd(this.settings.document_base_url,{base_uri:this.baseUri}),this.baseURI=this.baseUri,this.inline=!!this.settings.inline,this.shortcuts=new MC(this),this.editorCommands=new iC(this),this.settings.cache_suffix&&(xt.cacheSuffix=this.settings.cache_suffix.replace(/^[\?\&]+/,"")),this.ui={registry:{addAutocompleter:(u={},(r={addButton:x(o={},"button"),addGroupToolbarButton:x(o,"grouptoolbarbutton"),addToggleButton:x(o,"togglebutton"),addMenuButton:x(o,"menubutton"),addSplitButton:x(o,"splitbutton"),addMenuItem:x(i={},"menuitem"),addNestedMenuItem:x(i,"nestedmenuitem"),addToggleMenuItem:x(i,"togglemenuitem"),addAutocompleter:x(a={},"autocompleter"),addContextMenu:x(s={},"contextmenu"),addContextToolbar:x(l={},"contexttoolbar"),addContextForm:x(l,"contextform"),addSidebar:x(f={},"sidebar"),addIcon:function(e,t){return u[e.toLowerCase()]=t},getAll:function(){return{buttons:o,menuItems:i,icons:u,popups:a,contextMenus:s,contextToolbars:l,sidebars:f}}}).addAutocompleter),addButton:r.addButton,addContextForm:r.addContextForm,addContextMenu:r.addContextMenu,addContextToolbar:r.addContextToolbar,addIcon:r.addIcon,addMenuButton:r.addMenuButton,addMenuItem:r.addMenuItem,addNestedMenuItem:r.addNestedMenuItem,addSidebar:r.addSidebar,addSplitButton:r.addSplitButton,addToggleButton:r.addToggleButton,addGroupToolbarButton:r.addGroupToolbarButton,addToggleMenuItem:r.addToggleMenuItem,getAll:r.getAll},styleSheetLoader:void 0,show:c,hide:c,enable:c,disable:c,isDisabled:D};var C,S,k,T,O,_=(T=tu("design"),O=tu({design:{activate:c,deactivate:c,editorReadOnly:!1},readonly:{activate:c,deactivate:c,editorReadOnly:!0}}),(S=C=this).serializer?fC(S):S.on("PreInit",(function(){fC(S)})),(k=C).on("ShowCaret",(function(e){lC(k)&&e.preventDefault()})),k.on("ObjectSelected",(function(e){lC(k)&&e.preventDefault()})),{isReadOnly:function(){return lC(C)},set:function(e){return function(e,t,n,r){if(r!==n.get()){if(!Te(t,r))throw new Error("Editor mode '"+r+"' is invalid");e.initialized?wC(e,n,t,r):e.on("init",(function(){return wC(e,n,t,r)}))}}(C,O.get(),T,e)},get:function(){return T.get()},register:function(e,t){O.set(function(e,t,n){var r;if(B(OC,t))throw new Error("Cannot override default mode "+t);return _e(_e({},e),((r={})[t]=_e(_e({},n),{deactivate:function(){try{n.deactivate()}catch(e){console.error("problem while deactivating editor mode "+t+":",e)}}}),r))}(O.get(),e,t))}});this.mode=_,this.setMode=_.set,n.fire("SetupEditor",{editor:this}),this.execCallback("setup",this),this.$=Wa.overrideDefaults((function(){return{context:w.inline?w.getBody():w.getDoc(),element:w.getBody()}}))}function HC(e){var t=e.type;qC(QC.get(),(function(n){switch(t){case"scroll":n.fire("ScrollWindow",e);break;case"resize":n.fire("ResizeWindow",e)}}))}function VC(e){e!==XC&&(e?Wa(window).on("resize scroll",HC):Wa(window).off("resize scroll",HC),XC=e)}function jC(e){var t=JC;delete YC[e.id];for(var n=0;n<YC.length;n++)if(YC[n]===e){YC.splice(n,1);break}return JC=V(JC,(function(t){return e!==t})),QC.activeEditor===e&&(QC.activeEditor=0<JC.length?JC[0]:null),QC.focusedEditor===e&&(QC.focusedEditor=null),t.length!==JC.length}var UC,WC=Xa.DOM,$C=kt.explode,qC=kt.each,GC=kt.extend,KC=0,XC=!1,YC=[],JC=[],ZC="CSS1Compat"!==document.compatMode,QC=_e(_e({},SC),{baseURI:null,baseURL:null,defaultSettings:{},documentBaseURL:null,suffix:null,$:Wa,majorVersion:"5",minorVersion:"10.0",releaseDate:"2021-10-11",editors:YC,i18n:iu,activeEditor:null,focusedEditor:null,settings:{},setup:function(){var e,t="",n=Hd.getDocumentBaseUrl(document.location);/^[^:]+:\/\/\/?[^\/]+\//.test(n)&&(n=n.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(n)||(n+="/"));var r=window.tinymce||window.tinyMCEPreInit;if(r)e=r.base||r.baseURL,t=r.suffix;else{for(var o,i=document.getElementsByTagName("script"),a=0;a<i.length;a++)if(""!==(o=i[a].src||"")){var u=o.substring(o.lastIndexOf("/"));if(/tinymce(\.full|\.jquery|)(\.min|\.dev|)\.js/.test(o)){-1!==u.indexOf(".min")&&(t=".min"),e=o.substring(0,o.lastIndexOf("/"));break}}!e&&document.currentScript&&(-1!==(o=document.currentScript.src).indexOf(".min")&&(t=".min"),e=o.substring(0,o.lastIndexOf("/")))}this.baseURL=new Hd(n).toAbsolute(e),this.documentBaseURL=n,this.baseURI=new Hd(this.baseURL),this.suffix=t,this.on("AddEditor",T(ad,this)),this.on("RemoveEditor",T(ud,this))},overrideDefaults:function(e){var t=e.base_url;t&&this._setBaseUrl(t);var n=e.suffix;e.suffix&&(this.suffix=n);var r=(this.defaultSettings=e).plugin_base_urls;void 0!==r&&ne(r,(function(e,t){au.PluginManager.urls[t]=e}))},init:function(e){function t(e){var t=e.id;return t||(t=ue(e,"name").filter((function(e){return!WC.get(e)})).getOrThunk(WC.uniqueId),e.setAttribute("id",t)),t}function n(e,t){return t.constructor===RegExp?t.test(e.className):WC.hasClass(e,t)}var r,o=this,i=kt.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"," "),a=function(e){r=e},u=function(){function r(e,t,n){var r=new FC(e,t,o);f.push(r),r.on("init",(function(){++l===c.length&&a(f)})),r.targetElm=r.targetElm||n,r.render()}var c,s,l=0,f=[];WC.unbind(window,"ready",u),(s=e.onpageload)&&s.apply(o,[]),c=Wa.unique(function(e){var t=[];if(xt.browser.isIE()&&xt.browser.version.major<11)return Nb("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(ZC)return Nb("Failed to initialize the editor as the document is not in standards mode. TinyMCE requires standards mode."),[];if(e.types)return qC(e.types,(function(e){t=t.concat(WC.select(e.selector))})),t;if(e.selector)return WC.select(e.selector);if(e.target)return[e.target];switch(e.mode){case"exact":var r=e.elements||"";0<r.length&&qC($C(r),(function(e){var n=WC.get(e);n?t.push(n):qC(document.forms,(function(n){qC(n.elements,(function(n){n.name===e&&(e="mce_editor_"+KC++,WC.setAttrib(n,"id",e),t.push(n))}))}))}));break;case"textareas":case"specific_textareas":qC(WC.select("textarea"),(function(r){e.editor_deselector&&n(r,e.editor_deselector)||e.editor_selector&&!n(r,e.editor_selector)||t.push(r)}))}return t}(e)),e.types?qC(e.types,(function(n){kt.each(c,(function(o){return!WC.is(o,n.selector)||(r(t(o),GC({},e,n),o),!1)}))})):(kt.each(c,(function(e){var t;(t=o.get(e.id))&&t.initialized&&!(t.getContainer()||t.getBody()).parentNode&&(jC(t),t.unbindAllNativeEvents(),t.destroy(!0),t.removed=!0)})),0===(c=kt.grep(c,(function(e){return!o.get(e.id)}))).length?a([]):qC(c,(function(n){var o=n;e.inline&&o.tagName.toLowerCase()in i?Nb("Could not initialize inline editor on invalid inline target element",n):r(t(n),e,n)})))};return o.settings=e,WC.bind(window,"ready",u),new kr((function(e){r?e(r):a=function(t){e(t)}}))},get:function(e){return 0===arguments.length?JC.slice(0):v(e)?$(JC,(function(t){return t.id===e})).getOr(null):k(e)&&JC[e]||null},add:function(e){var t=this;return YC[e.id]===e||(null===t.get(e.id)&&("length"!==e.id&&(YC[e.id]=e),YC.push(e),JC.push(e)),VC(!0),t.activeEditor=e,t.fire("AddEditor",{editor:e}),UC||(UC=function(e){var n=t.fire("BeforeUnload");if(n.returnValue)return e.preventDefault(),e.returnValue=n.returnValue,n.returnValue},window.addEventListener("beforeunload",UC))),e},createEditor:function(e,t){return this.add(new FC(e,t,this))},remove:function(e){var t,n,r=this;if(e){if(!v(e))return n=e,w(r.get(n.id))?null:(jC(n)&&r.fire("RemoveEditor",{editor:n}),0===JC.length&&window.removeEventListener("beforeunload",UC),n.remove(),VC(0<JC.length),n);qC(WC.select(e),(function(e){(n=r.get(e.id))&&r.remove(n)}))}else for(t=JC.length-1;0<=t;t--)r.remove(JC[t])},execCommand:function(e,t,n){var r=this.get(n);switch(e){case"mceAddEditor":return this.get(n)||new FC(n,this.settings,this).render(),!0;case"mceRemoveEditor":return r&&r.remove(),!0;case"mceToggleEditor":return r?r.isHidden()?r.show():r.hide():this.execCommand("mceAddEditor",!1,n),!0}return!!this.activeEditor&&this.activeEditor.execCommand(e,t,n)},triggerSave:function(){qC(JC,(function(e){e.save()}))},addI18n:function(e,t){iu.add(e,t)},translate:function(e){return iu.translate(e)},setActive:function(e){var t=this.activeEditor;this.activeEditor!==e&&(t&&t.fire("deactivate",{relatedTarget:e}),e.fire("activate",{relatedTarget:t})),this.activeEditor=e},_setBaseUrl:function(e){this.baseURL=new Hd(this.documentBaseURL).toAbsolute(e.replace(/\/+$/,"")),this.baseURI=new Hd(this.baseURL)}});function eS(e,t,n){var r=t.x,o=t.y,i=e.w,a=e.h,u=t.w,c=t.h,s=(n||"").split("");return"b"===s[0]&&(o+=c),"r"===s[1]&&(r+=u),"c"===s[0]&&(o+=sS(c/2)),"c"===s[1]&&(r+=sS(u/2)),"b"===s[3]&&(o-=a),"r"===s[4]&&(r-=i),"c"===s[3]&&(o-=sS(a/2)),"c"===s[4]&&(r-=sS(i/2)),nS(r,o,i,a)}function tS(){}function nS(e,t,n,r){return{x:e,y:t,w:n,h:r}}QC.setup();var rS,oS,iS,aS,uS=Math.min,cS=Math.max,sS=Math.round,lS={inflate:function(e,t,n){return nS(e.x-t,e.y-n,e.w+2*t,e.h+2*n)},relativePosition:eS,findBestRelativePosition:function(e,t,n,r){for(var o,i=0;i<r.length;i++)if((o=eS(e,t,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(e,t){var n=cS(e.x,t.x),r=cS(e.y,t.y),o=uS(e.x+e.w,t.x+t.w),i=uS(e.y+e.h,t.y+t.h);return o-n<0||i-r<0?null:nS(n,r,o-n,i-r)},clamp:function(e,t,n){var r=e.x,o=e.y,i=e.x+e.w,a=e.y+e.h,u=t.x+t.w,c=t.y+t.h,s=cS(0,t.x-r),l=cS(0,t.y-o),f=cS(0,i-u),d=cS(0,a-c);return r+=s,o+=l,n&&(i+=s,a+=l,r-=f,o-=d),nS(r,o,(i-=f)-r,(a-=d)-o)},create:nS,fromClientRect:function(e){return nS(e.left,e.top,e.width,e.height)}},fS=(rS={},oS={},{load:function(e,t){var n='Script at URL "'+t+'" failed to load',r='Script at URL "'+t+"\" did not call `tinymce.Resource.add('"+e+"', data)` within 1 second";if(void 0!==rS[e])return rS[e];var o=new kr((function(o,i){var a=function(e,t,n){function r(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];o||(o=!0,null!==i&&(clearTimeout(i),i=null),e.apply(null,t))}}void 0===n&&(n=1e3);var o=!1,i=null,a=r(e),u=r(t);return{start:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];o||null!==i||(i=setTimeout((function(){return u.apply(null,e)}),n))},resolve:a,reject:u}}(o,i);oS[e]=a.resolve,Qa.ScriptLoader.loadScript(t,(function(){return a.start(r)}),(function(){return a.reject(n)}))}));return rS[e]=o},add:function(e,t){void 0!==oS[e]&&(oS[e](t),delete oS[e]),rS[e]=kr.resolve(t)}}),dS=kt.each,mS=kt.extend;tS.extend=iS=function(e){function t(){var e,t,n;if(!aS&&(this.init&&this.init.apply(this,arguments),t=this.Mixins))for(e=t.length;e--;)(n=t[e]).init&&n.init.apply(this,arguments)}function n(){return this}var r=this.prototype;aS=!0;var o=new this;return aS=!1,e.Mixins&&(dS(e.Mixins,(function(t){for(var n in t)"init"!==n&&(e[n]=t[n])})),r.Mixins&&(e.Mixins=r.Mixins.concat(e.Mixins))),e.Methods&&dS(e.Methods.split(","),(function(t){e[t]=n})),e.Properties&&dS(e.Properties.split(","),(function(t){var n="_"+t;e[t]=function(e){return void 0!==e?(this[n]=e,this):this[n]}})),e.Statics&&dS(e.Statics,(function(e,n){t[n]=e})),e.Defaults&&r.Defaults&&(e.Defaults=mS({},r.Defaults,e.Defaults)),ne(e,(function(e,t){var n,i;"function"==typeof e&&r[t]?o[t]=(n=t,i=e,function(){var e=this._super;this._super=r[n];var t=i.apply(this,arguments);return this._super=e,t}):o[t]=e})),t.prototype=o,(t.constructor=t).extend=iS,t};var gS,pS,hS,vS=Math.min,bS=Math.max,yS=Math.round,wS={serialize:function(e){var t=JSON.stringify(e);return v(t)?t.replace(/[\u0080-\uFFFF]/g,(function(e){var t=e.charCodeAt(0).toString(16);return"\\u"+"0000".substring(t.length)+t})):t},parse:function(e){try{return JSON.parse(e)}catch(e){}}},xS={callbacks:{},count:0,send:function(e){var t=this,n=Xa.DOM,r=(void 0!==e.count?e:t).count,o="tinymce_jsonp_"+r;t.callbacks[r]=function(i){n.remove(o),delete t.callbacks[r],e.callback(i)},n.add(n.doc.body,"script",{id:o,src:e.url,type:"text/javascript"}),t.count++}},CS=_e(_e({},SC),{send:function(e){var t,n=0,r=function(){!e.async||4===t.readyState||1e4<n++?(e.success&&n<1e4&&200===t.status?e.success.call(e.success_scope,""+t.responseText,t,e):e.error&&e.error.call(e.error_scope,1e4<n?"TIMED_OUT":"GENERAL",t,e),t=null):Tr.setTimeout(r,10)};if(e.scope=e.scope||this,e.success_scope=e.success_scope||e.scope,e.error_scope=e.error_scope||e.scope,e.async=!1!==e.async,e.data=e.data||"",CS.fire("beforeInitialize",{settings:e}),(t=new XMLHttpRequest).overrideMimeType&&t.overrideMimeType(e.content_type),t.open(e.type||(e.data?"POST":"GET"),e.url,e.async),e.crossDomain&&(t.withCredentials=!0),e.content_type&&t.setRequestHeader("Content-Type",e.content_type),e.requestheaders&&kt.each(e.requestheaders,(function(e){t.setRequestHeader(e.key,e.value)})),t.setRequestHeader("X-Requested-With","XMLHttpRequest"),(t=CS.fire("beforeSend",{xhr:t,settings:e}).xhr).send(e.data),!e.async)return r();Tr.setTimeout(r,10)}}),SS=kt.extend,kS=(TS.sendRPC=function(e){return(new TS).send(e)},TS.prototype.send=function(e){var t=e.error,n=e.success,r=SS(this.settings,e);r.success=function(e,o){(e=void 0===(e=wS.parse(e))?{error:"JSON Parse error."}:e).error?t.call(r.error_scope||r.scope,e.error,o):n.call(r.success_scope||r.scope,e.result)},r.error=function(e,n){t&&t.call(r.error_scope||r.scope,e,n)},r.data=wS.serialize({id:e.id||"c"+this.count++,method:e.method,params:e.params}),r.content_type="application/json",CS.send(r)},TS);function TS(e){this.settings=SS({},e),this.count=0}try{var OS,_S="__storage_test__";(OS=window.localStorage).setItem(_S,_S),OS.removeItem(_S)}catch(r){gS={},pS=[],hS={getItem:function(e){return gS[e]||null},setItem:function(e,t){pS.push(e),gS[e]=String(t)},key:function(e){return pS[e]},removeItem:function(e){pS=pS.filter((function(t){return t===e})),delete gS[e]},clear:function(){pS=[],gS={}},length:0},Object.defineProperty(hS,"length",{get:function(){return pS.length},configurable:!1,enumerable:!1}),OS=hS}var ES={geom:{Rect:lS},util:{Promise:kr,Delay:Tr,Tools:kt,VK:_f,URI:Hd,Class:tS,EventDispatcher:gC,Observable:SC,I18n:iu,XHR:CS,JSON:wS,JSONRequest:kS,JSONP:xS,LocalStorage:OS,Color:function(e){function t(e){var t;return"object"==typeof e?"r"in e?(r=e.r,o=e.g,i=e.b):"v"in e&&function(e,t,n){if(e=(parseInt(e,10)||0)%360,t=parseInt(t,10)/100,n=parseInt(n,10)/100,t=bS(0,vS(t,1)),n=bS(0,vS(n,1)),0!==t){var a=e/60,u=n*t,c=u*(1-Math.abs(a%2-1)),s=n-u;switch(Math.floor(a)){case 0:r=u,o=c,i=0;break;case 1:r=c,o=u,i=0;break;case 2:r=0,o=u,i=c;break;case 3:r=0,o=c,i=u;break;case 4:r=c,o=0,i=u;break;case 5:r=u,o=0,i=c;break;default:r=o=i=0}r=yS(255*(r+s)),o=yS(255*(o+s)),i=yS(255*(i+s))}else r=o=i=yS(255*n)}(e.h,e.s,e.v):(t=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)[^\)]*\)/gi.exec(e))?(r=parseInt(t[1],10),o=parseInt(t[2],10),i=parseInt(t[3],10)):(t=/#([0-F]{2})([0-F]{2})([0-F]{2})/gi.exec(e))?(r=parseInt(t[1],16),o=parseInt(t[2],16),i=parseInt(t[3],16)):(t=/#([0-F])([0-F])([0-F])/gi.exec(e))&&(r=parseInt(t[1]+t[1],16),o=parseInt(t[2]+t[2],16),i=parseInt(t[3]+t[3],16)),r=r<0?0:255<r?255:r,o=o<0?0:255<o?255:o,i=i<0?0:255<i?255:i,n}var n={},r=0,o=0,i=0;return e&&t(e),n.toRgb=function(){return{r:r,g:o,b:i}},n.toHsv=function(){return e=r,t=o,n=i,u=0,(c=vS(e/=255,vS(t/=255,n/=255)))===(s=bS(e,bS(t,n)))?{h:0,s:0,v:100*(u=c)}:(a=(s-c)/s,{h:yS(60*((e===c?3:n===c?1:5)-(e===c?t-n:n===c?e-t:n-e)/((u=s)-c))),s:yS(100*a),v:yS(100*u)});var e,t,n,a,u,c,s},n.toHex=function(){function e(e){return 1<(e=parseInt(e,10).toString(16)).length?e:"0"+e}return"#"+e(r)+e(o)+e(i)},n.parse=t,n},ImageUploader:function(e){var t=pv(),n=yv(e,t);return{upload:function(t,r){return n.upload(t,(r=void 0===r||r)?bv(e):void 0)}}}},dom:{EventUtils:oi,Sizzle:oa,DomQuery:Wa,TreeWalker:_r,TextSeeker:Cu,DOMUtils:Xa,ScriptLoader:Qa,RangeUtils:Of,Serializer:Th,StyleSheetLoader:xr,ControlSelection:gf,BookmarkManager:Rl,Selection:hh,Event:oi.Event},html:{Styles:to,Entities:Ko,Node:Nd,Schema:Qr,SaxParser:Ud,DomParser:Sh,Writer:Kd,Serializer:Xd},Env:xt,AddOnManager:au,Annotator:Nl,Formatter:kv,UndoManager:Ov,EditorCommands:iC,WindowManager:sv,NotificationManager:Ph,EditorObservable:TC,Shortcuts:MC,Editor:FC,FocusManager:Ed,EditorManager:QC,DOM:Xa.DOM,ScriptLoader:Qa.ScriptLoader,PluginManager:uv,ThemeManager:cv,IconManager:nv,Resource:fS,trim:kt.trim,isArray:kt.isArray,is:kt.is,toArray:kt.toArray,makeMap:kt.makeMap,each:kt.each,map:kt.map,grep:kt.grep,inArray:kt.inArray,extend:kt.extend,create:kt.create,walk:kt.walk,createNS:kt.createNS,resolve:kt.resolve,explode:kt.explode,_addCacheSuffix:kt._addCacheSuffix,isOpera:xt.opera,isWebKit:xt.webkit,isIE:xt.ie,isGecko:xt.gecko,isMac:xt.mac},AS=kt.extend(QC,ES),DS=AS;window.tinymce=DS,window.tinyMCE=DS,function(e){if("object"==typeof module)try{module.exports=e}catch(e){}}(AS)}(),function(){"use strict";var e=function(e){return function(t){return function(e){var t=typeof e;return null===e?"null":"object"===t&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"===t&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":t}(t)===e}},t=function(e){return function(t){return typeof t===e}},n=function(e){return function(t){return e===t}},r=e("string"),o=e("object"),i=e("array"),a=n(null),u=t("boolean"),c=n(void 0),s=function(e){return null==e},l=function(e){return!s(e)},f=t("function"),d=t("number"),m=function(e,t){if(i(e)){for(var n=0,r=e.length;n<r;++n)if(!t(e[n]))return!1;return!0}return!1},g=function(){},p=function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return e(t.apply(null,n))}},h=function(e){return function(){return e}},v=function(e){return e},b=function(e,t){return e===t};function y(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=t.concat(n);return e.apply(null,o)}}var w=function(e){return function(t){return!e(t)}},x=function(e){return function(){throw new Error(e)}},C=h(!1),S=h(!0),k=tinymce.util.Tools.resolve("tinymce.ThemeManager"),T=function(){return T=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},T.apply(this,arguments)};function O(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function _(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}var E,A,D=function(){return M},M=(E=function(e){return e()},{fold:function(e,t){return e()},isSome:C,isNone:S,getOr:A=v,getOrThunk:E,getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:h(null),getOrUndefined:h(void 0),or:A,orThunk:E,map:D,each:g,bind:D,exists:C,forall:S,filter:function(){return D()},toArray:function(){return[]},toString:h("none()")}),N=function(e){var t=h(e),n=function(){return o},r=function(t){return t(e)},o={fold:function(t,n){return n(e)},isSome:S,isNone:C,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:n,orThunk:n,map:function(t){return N(t(e))},each:function(t){t(e)},bind:r,exists:r,forall:r,filter:function(t){return t(e)?o:M},toArray:function(){return[e]},toString:function(){return"some("+e+")"}};return o},R={some:N,none:D,from:function(e){return null==e?M:N(e)}},z=Array.prototype.slice,B=Array.prototype.indexOf,P=Array.prototype.push,I=function(e,t){return B.call(e,t)},F=function(e,t){return I(e,t)>-1},L=function(e,t){for(var n=0,r=e.length;n<r;n++){if(t(e[n],n))return!0}return!1},H=function(e,t){for(var n=[],r=0;r<e;r++)n.push(t(r));return n},V=function(e,t){for(var n=[],r=0;r<e.length;r+=t){var o=z.call(e,r,r+t);n.push(o)}return n},j=function(e,t){for(var n=e.length,r=new Array(n),o=0;o<n;o++){var i=e[o];r[o]=t(i,o)}return r},U=function(e,t){for(var n=0,r=e.length;n<r;n++){t(e[n],n)}},W=function(e,t){for(var n=[],r=[],o=0,i=e.length;o<i;o++){var a=e[o];(t(a,o)?n:r).push(a)}return{pass:n,fail:r}},$=function(e,t){for(var n=[],r=0,o=e.length;r<o;r++){var i=e[r];t(i,r)&&n.push(i)}return n},q=function(e,t,n){return function(e,t){for(var n=e.length-1;n>=0;n--)t(e[n],n)}(e,(function(e,r){n=t(n,e,r)})),n},G=function(e,t,n){return U(e,(function(e,r){n=t(n,e,r)})),n},K=function(e,t){return function(e,t,n){for(var r=0,o=e.length;r<o;r++){var i=e[r];if(t(i,r))return R.some(i);if(n(i,r))break}return R.none()}(e,t,C)},X=function(e,t){for(var n=0,r=e.length;n<r;n++){if(t(e[n],n))return R.some(n)}return R.none()},Y=function(e){for(var t=[],n=0,r=e.length;n<r;++n){if(!i(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);P.apply(t,e[n])}return t},J=function(e,t){return Y(j(e,t))},Z=function(e,t){for(var n=0,r=e.length;n<r;++n){if(!0!==t(e[n],n))return!1}return!0},Q=function(e){var t=z.call(e,0);return t.reverse(),t},ee=function(e,t){return $(e,(function(e){return!F(t,e)}))},te=function(e,t){for(var n={},r=0,o=e.length;r<o;r++){var i=e[r];n[String(i)]=t(i,r)}return n},ne=function(e){return[e]},re=function(e,t){var n=z.call(e,0);return n.sort(t),n},oe=function(e,t){return t>=0&&t<e.length?R.some(e[t]):R.none()},ie=function(e){return oe(e,0)},ae=function(e){return oe(e,e.length-1)},ue=f(Array.from)?Array.from:function(e){return z.call(e)},ce=function(e,t){for(var n=0;n<e.length;n++){var r=t(e[n],n);if(r.isSome())return r}return R.none()},se=Object.keys,le=Object.hasOwnProperty,fe=function(e,t){for(var n=se(e),r=0,o=n.length;r<o;r++){var i=n[r];t(e[i],i)}},de=function(e,t){return me(e,(function(e,n){return{k:n,v:t(e,n)}}))},me=function(e,t){var n={};return fe(e,(function(e,r){var o=t(e,r);n[o.k]=o.v})),n},ge=function(e,t){var n={};return function(e,t,n,r){fe(e,(function(e,o){(t(e,o)?n:r)(e,o)}))}(e,t,function(e){return function(t,n){e[n]=t}}(n),g),n},pe=function(e,t){var n=[];return fe(e,(function(e,r){n.push(t(e,r))})),n},he=function(e,t){for(var n=se(e),r=0,o=n.length;r<o;r++){var i=n[r],a=e[i];if(t(a,i,e))return R.some(a)}return R.none()},ve=function(e){return pe(e,v)},be=function(e,t){return ye(e,t)?R.from(e[t]):R.none()},ye=function(e,t){return le.call(e,t)},we=function(e,t){return ye(e,t)&&void 0!==e[t]&&null!==e[t]},xe=function(e,t,n){return void 0===n&&(n=b),e.exists((function(e){return n(e,t)}))},Ce=function(e){for(var t=[],n=function(e){t.push(e)},r=0;r<e.length;r++)e[r].each(n);return t},Se=function(e,t,n){return e.isSome()&&t.isSome()?R.some(n(e.getOrDie(),t.getOrDie())):R.none()},ke=function(e,t){return e?R.some(t):R.none()},Te=function(e,t,n){return""===t||e.length>=t.length&&e.substr(n,n+t.length)===t},Oe=function(e,t){return-1!==e.indexOf(t)},_e=function(e,t){return Te(e,t,0)},Ee=function(e,t){return Te(e,t,e.length-t.length)},Ae=function(e){return function(t){return t.replace(e,"")}}(/^\s+|\s+$/g),De=function(e){return e.length>0},Me=function(e){return void 0!==e.style&&f(e.style.getPropertyValue)},Ne=function(e){if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}},Re={fromHtml:function(e,t){var n=(t||document).createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return Ne(n.childNodes[0])},fromTag:function(e,t){var n=(t||document).createElement(e);return Ne(n)},fromText:function(e,t){var n=(t||document).createTextNode(e);return Ne(n)},fromDom:Ne,fromPoint:function(e,t,n){return R.from(e.dom.elementFromPoint(t,n)).map(Ne)}};"undefined"!=typeof window?window:Function("return this;")();var ze,Be=function(e){return e.dom.nodeName.toLowerCase()},Pe=function(e){return function(t){return function(e){return e.dom.nodeType}(t)===e}},Ie=Pe(1),Fe=Pe(3),Le=Pe(9),He=Pe(11),Ve=function(e){var t,n=!1;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=!0,t=e.apply(null,r)),t}},je=function(){return Ue(0,0)},Ue=function(e,t){return{major:e,minor:t}},We={nu:Ue,detect:function(e,t){var n=String(t).toLowerCase();return 0===e.length?je():function(e,t){var n=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(r.test(t))return r}}(e,t);if(!n)return{major:0,minor:0};var r=function(e){return Number(t.replace(n,"$"+e))};return Ue(r(1),r(2))}(e,n)},unknown:je},$e=function(e,t){var n=String(t).toLowerCase();return K(e,(function(e){return e.search(n)}))},qe=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Ge=function(e){return function(t){return Oe(t,e)}},Ke=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return Oe(e,"edge/")&&Oe(e,"chrome")&&Oe(e,"safari")&&Oe(e,"applewebkit")}},{name:"Chrome",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,qe],search:function(e){return Oe(e,"chrome")&&!Oe(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return Oe(e,"msie")||Oe(e,"trident")}},{name:"Opera",versionRegexes:[qe,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Ge("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Ge("firefox")},{name:"Safari",versionRegexes:[qe,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(Oe(e,"safari")||Oe(e,"mobile/"))&&Oe(e,"applewebkit")}}],Xe=[{name:"Windows",search:Ge("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return Oe(e,"iphone")||Oe(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Ge("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:Ge("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Ge("linux"),versionRegexes:[]},{name:"Solaris",search:Ge("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Ge("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:Ge("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],Ye={browsers:h(Ke),oses:h(Xe)},Je="Edge",Ze="Chrome",Qe="Opera",et="Firefox",tt="Safari",nt=function(e){var t=e.current,n=e.version,r=function(e){return function(){return t===e}};return{current:t,version:n,isEdge:r(Je),isChrome:r(Ze),isIE:r("IE"),isOpera:r(Qe),isFirefox:r(et),isSafari:r(tt)}},rt={unknown:function(){return nt({current:void 0,version:We.unknown()})},nu:nt,edge:h(Je),chrome:h(Ze),ie:h("IE"),opera:h(Qe),firefox:h(et),safari:h(tt)},ot="Windows",it="Android",at="Linux",ut="Solaris",ct="FreeBSD",st="ChromeOS",lt=function(e){var t=e.current,n=e.version,r=function(e){return function(){return t===e}};return{current:t,version:n,isWindows:r(ot),isiOS:r("iOS"),isAndroid:r(it),isOSX:r("OSX"),isLinux:r(at),isSolaris:r(ut),isFreeBSD:r(ct),isChromeOS:r(st)}},ft={unknown:function(){return lt({current:void 0,version:We.unknown()})},nu:lt,windows:h(ot),ios:h("iOS"),android:h(it),linux:h(at),osx:h("OSX"),solaris:h(ut),freebsd:h(ct),chromeos:h(st)},dt=function(e,t,n){var r=Ye.browsers(),o=Ye.oses(),i=t.bind((function(e){return function(e,t){return ce(t.brands,(function(t){var n=t.brand.toLowerCase();return K(e,(function(e){var t;return n===(null===(t=e.brand)||void 0===t?void 0:t.toLowerCase())})).map((function(e){return{current:e.name,version:We.nu(parseInt(t.version,10),0)}}))}))}(r,e)})).orThunk((function(){return function(e,t){return $e(e,t).map((function(e){var n=We.detect(e.versionRegexes,t);return{current:e.name,version:n}}))}(r,e)})).fold(rt.unknown,rt.nu),a=function(e,t){return $e(e,t).map((function(e){var n=We.detect(e.versionRegexes,t);return{current:e.name,version:n}}))}(o,e).fold(ft.unknown,ft.nu),u=function(e,t,n,r){var o=e.isiOS()&&!0===/ipad/i.test(n),i=e.isiOS()&&!o,a=e.isiOS()||e.isAndroid(),u=a||r("(pointer:coarse)"),c=o||!i&&a&&r("(min-device-width:768px)"),s=i||a&&!c,l=t.isSafari()&&e.isiOS()&&!1===/safari/i.test(n),f=!s&&!c&&!l;return{isiPad:h(o),isiPhone:h(i),isTablet:h(c),isPhone:h(s),isTouch:h(u),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:h(l),isDesktop:h(f)}}(a,i,e,n);return{browser:i,os:a,deviceType:u}},mt=function(e){return window.matchMedia(e).matches},gt=Ve((function(){return dt(navigator.userAgent,R.from(navigator.userAgentData),mt)})),pt=function(){return gt()},ht=function(e,t){var n=e.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(t);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(t);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(t);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")},vt=function(e){return 1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType||0===e.childElementCount},bt=function(e,t){return e.dom===t.dom},yt=function(e,t){return function(e,t){return function(e,t,n){return 0!=(e.compareDocumentPosition(t)&n)}(e,t,Node.DOCUMENT_POSITION_CONTAINED_BY)}(e.dom,t.dom)},wt=function(e,t){return pt().browser.isIE()?yt(e,t):function(e,t){var n=e.dom,r=t.dom;return n!==r&&n.contains(r)}(e,t)},xt=function(e){return Re.fromDom(e.dom.ownerDocument)},Ct=function(e){return Le(e)?e:xt(e)},St=function(e){return Re.fromDom(Ct(e).dom.documentElement)},kt=function(e){return Re.fromDom(Ct(e).dom.defaultView)},Tt=function(e){return R.from(e.dom.parentNode).map(Re.fromDom)},Ot=function(e){return R.from(e.dom.offsetParent).map(Re.fromDom)},_t=function(e){return j(e.dom.childNodes,Re.fromDom)},Et=function(e,t){var n=e.dom.childNodes;return R.from(n[t]).map(Re.fromDom)},At=function(e,t){return{element:e,offset:t}},Dt=function(e,t){var n=_t(e);return n.length>0&&t<n.length?At(n[t],0):At(e,t)},Mt=function(e){return He(e)&&l(e.dom.host)},Nt=f(Element.prototype.attachShadow)&&f(Node.prototype.getRootNode),Rt=h(Nt),zt=Nt?function(e){return Re.fromDom(e.dom.getRootNode())}:Ct,Bt=function(e){return Mt(e)?e:Re.fromDom(Ct(e).dom.body)},Pt=function(e){var t=zt(e);return Mt(t)?R.some(t):R.none()},It=function(e){return Re.fromDom(e.dom.host)},Ft=function(e){return l(e.dom.shadowRoot)},Lt=function(e){var t=Fe(e)?e.dom.parentNode:e.dom;if(null==t||null===t.ownerDocument)return!1;var n,r,o=t.ownerDocument;return Pt(Re.fromDom(t)).fold((function(){return o.body.contains(t)}),(n=Lt,r=It,function(e){return n(r(e))}))},Ht=function(){return Vt(Re.fromDom(document))},Vt=function(e){var t=e.dom.body;if(null==t)throw new Error("Body is not available yet");return Re.fromDom(t)},jt=function(e,t,n){if(!(r(n)||u(n)||d(n)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",n,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,n+"")},Ut=function(e,t,n){jt(e.dom,t,n)},Wt=function(e,t){var n=e.dom.getAttribute(t);return null===n?void 0:n},$t=function(e,t){return R.from(Wt(e,t))},qt=function(e,t){var n=e.dom;return!(!n||!n.hasAttribute)&&n.hasAttribute(t)},Gt=function(e,t){e.dom.removeAttribute(t)},Kt=function(e,t,n){if(!r(n))throw console.error("Invalid call to CSS.set. Property ",t,":: Value ",n,":: Element ",e),new Error("CSS value must be a string: "+n);Me(e)&&e.style.setProperty(t,n)},Xt=function(e,t){Me(e)&&e.style.removeProperty(t)},Yt=function(e,t,n){var r=e.dom;Kt(r,t,n)},Jt=function(e,t){var n=e.dom;fe(t,(function(e,t){Kt(n,t,e)}))},Zt=function(e,t){var n=e.dom;fe(t,(function(e,t){e.fold((function(){Xt(n,t)}),(function(e){Kt(n,t,e)}))}))},Qt=function(e,t){var n=e.dom,r=window.getComputedStyle(n).getPropertyValue(t);return""!==r||Lt(e)?r:en(n,t)},en=function(e,t){return Me(e)?e.style.getPropertyValue(t):""},tn=function(e,t){var n=e.dom,r=en(n,t);return R.from(r).filter((function(e){return e.length>0}))},nn=function(e){var t={},n=e.dom;if(Me(n))for(var r=0;r<n.style.length;r++){var o=n.style.item(r);t[o]=n.style[o]}return t},rn=function(e,t,n){var r=Re.fromTag(e);return Yt(r,t,n),tn(r,t).isSome()},on=function(e,t){var n=e.dom;Xt(n,t),xe($t(e,"style").map(Ae),"")&&Gt(e,"style")},an=function(e){return e.dom.offsetWidth},un=function(e,t){var n=function(n){var r=t(n);if(r<=0||null===r){var o=Qt(n,e);return parseFloat(o)||0}return r},r=function(e,t){return G(t,(function(t,n){var r=Qt(e,n),o=void 0===r?0:parseInt(r,10);return isNaN(o)?t:t+o}),0)};return{set:function(t,n){if(!d(n)&&!n.match(/^[0-9]+$/))throw new Error(e+".set accepts only positive integer values. Value was "+n);var r=t.dom;Me(r)&&(r.style[e]=n+"px")},get:n,getOuter:n,aggregate:r,max:function(e,t,n){var o=r(e,n);return t>o?t-o:0}}},cn=un("height",(function(e){var t=e.dom;return Lt(e)?t.getBoundingClientRect().height:t.offsetHeight})),sn=function(e){return cn.get(e)},ln=function(e){return cn.getOuter(e)},fn=function(e,t){return{left:e,top:t,translate:function(n,r){return fn(e+n,t+r)}}},dn=fn,mn=function(e,t){return void 0!==e?e:void 0!==t?t:0},gn=function(e){var t=e.dom.ownerDocument,n=t.body,r=t.defaultView,o=t.documentElement;if(n===e.dom)return dn(n.offsetLeft,n.offsetTop);var i=mn(null==r?void 0:r.pageYOffset,o.scrollTop),a=mn(null==r?void 0:r.pageXOffset,o.scrollLeft),u=mn(o.clientTop,n.clientTop),c=mn(o.clientLeft,n.clientLeft);return pn(e).translate(a-c,i-u)},pn=function(e){var t=e.dom,n=t.ownerDocument.body;return n===t?dn(n.offsetLeft,n.offsetTop):Lt(e)?function(e){var t=e.getBoundingClientRect();return dn(t.left,t.top)}(t):dn(0,0)},hn=un("width",(function(e){return e.dom.offsetWidth})),vn=function(e){return hn.get(e)},bn=function(e){return hn.getOuter(e)},yn=function(e){var t=Re.fromDom(function(e){if(Rt()&&l(e.target)){var t=Re.fromDom(e.target);if(Ie(t)&&Ft(t)&&e.composed&&e.composedPath){var n=e.composedPath();if(n)return ie(n)}}return R.from(e.target)}(e).getOr(e.target)),n=function(){return e.stopPropagation()},r=function(){return e.preventDefault()},o=p(r,n);return function(e,t,n,r,o,i,a){return{target:e,x:t,y:n,stop:r,prevent:o,kill:i,raw:a}}(t,e.clientX,e.clientY,n,r,o,e)},wn=function(e,t,n,r,o){var i=function(e,t){return function(n){e(n)&&t(yn(n))}}(n,r);return e.dom.addEventListener(t,i,o),{unbind:y(xn,e,t,i,o)}},xn=function(e,t,n,r){e.dom.removeEventListener(t,n,r)},Cn=function(e,t){Tt(e).each((function(n){n.dom.insertBefore(t.dom,e.dom)}))},Sn=function(e,t){var n=function(e){return R.from(e.dom.nextSibling).map(Re.fromDom)}(e);n.fold((function(){Tt(e).each((function(e){Tn(e,t)}))}),(function(e){Cn(e,t)}))},kn=function(e,t){var n=function(e){return Et(e,0)}(e);n.fold((function(){Tn(e,t)}),(function(n){e.dom.insertBefore(t.dom,n.dom)}))},Tn=function(e,t){e.dom.appendChild(t.dom)},On=function(e,t){U(t,(function(t){Tn(e,t)}))},_n=function(e){e.dom.textContent="",U(_t(e),(function(e){En(e)}))},En=function(e){var t=e.dom;null!==t.parentNode&&t.parentNode.removeChild(t)},An=function(e){var t,n=_t(e);n.length>0&&(t=e,U(n,(function(e){Cn(t,e)}))),En(e)},Dn=function(e){var t=void 0!==e?e.dom:document,n=t.body.scrollLeft||t.documentElement.scrollLeft,r=t.body.scrollTop||t.documentElement.scrollTop;return dn(n,r)},Mn=function(e,t,n){var r=(void 0!==n?n.dom:document).defaultView;r&&r.scrollTo(e,t)},Nn=function(e,t,n,r){return{x:e,y:t,width:n,height:r,right:e+n,bottom:t+r}},Rn=function(e){var t=void 0===e?window:e,n=t.document,r=Dn(Re.fromDom(n));return function(e){var t=void 0===e?window:e;return pt().browser.isFirefox()?R.none():R.from(t.visualViewport)}(t).fold((function(){var e=t.document.documentElement,n=e.clientWidth,o=e.clientHeight;return Nn(r.left,r.top,n,o)}),(function(e){return Nn(Math.max(e.pageLeft,r.left),Math.max(e.pageTop,r.top),e.width,e.height)}))},zn=function(e,t){return e.view(t).fold(h([]),(function(t){var n=e.owner(t),r=zn(e,n);return[t].concat(r)}))},Bn=Object.freeze({__proto__:null,view:function(e){var t;return(e.dom===document?R.none():R.from(null===(t=e.dom.defaultView)||void 0===t?void 0:t.frameElement)).map(Re.fromDom)},owner:function(e){return xt(e)}}),Pn=function(e){var t=Re.fromDom(document),n=Dn(t),r=function(e,t){var n=t.owner(e),r=zn(t,n);return R.some(r)}(e,Bn);return r.fold(y(gn,e),(function(t){var r=pn(e),o=q(t,(function(e,t){var n=pn(t);return{left:e.left+n.left,top:e.top+n.top}}),{left:0,top:0});return dn(o.left+r.left+n.left,o.top+r.top+n.top)}))},In=function(e,t,n,r){return{x:e,y:t,width:n,height:r,right:e+n,bottom:t+r}},Fn=function(e){var t=gn(e),n=bn(e),r=ln(e);return In(t.left,t.top,n,r)},Ln=function(e){var t=Pn(e),n=bn(e),r=ln(e);return In(t.left,t.top,n,r)},Hn=function(){return Rn(window)},Vn=function(e){return{isValue:S,isError:C,getOr:h(e),getOrThunk:h(e),getOrDie:h(e),or:function(t){return Vn(e)},orThunk:function(t){return Vn(e)},fold:function(t,n){return n(e)},map:function(t){return Vn(t(e))},mapError:function(t){return Vn(e)},each:function(t){t(e)},bind:function(t){return t(e)},exists:function(t){return t(e)},forall:function(t){return t(e)},toOptional:function(){return R.some(e)}}},jn=function(e){return{isValue:C,isError:S,getOr:v,getOrThunk:function(e){return e()},getOrDie:function(){return x(String(e))()},or:v,orThunk:function(e){return e()},fold:function(t,n){return t(e)},map:function(t){return jn(e)},mapError:function(t){return jn(t(e))},each:g,bind:function(t){return jn(e)},exists:C,forall:S,toOptional:R.none}},Un={value:Vn,error:jn,fromOption:function(e,t){return e.fold((function(){return jn(t)}),Vn)}};!function(e){e[e.Error=0]="Error",e[e.Value=1]="Value"}(ze||(ze={}));var Wn=function(e,t,n){return e.stype===ze.Error?t(e.serror):n(e.svalue)},$n=function(e){return{stype:ze.Value,svalue:e}},qn=function(e){return{stype:ze.Error,serror:e}},Gn=function(e){return e.fold(qn,$n)},Kn=function(e){return Wn(e,Un.error,Un.value)},Xn=$n,Yn=function(e){var t=[],n=[];return U(e,(function(e){Wn(e,(function(e){return n.push(e)}),(function(e){return t.push(e)}))})),{values:t,errors:n}},Jn=qn,Zn=function(e,t){return e.stype===ze.Value?t(e.svalue):e},Qn=function(e,t){return e.stype===ze.Error?t(e.serror):e},er=function(e,t){return e.stype===ze.Value?{stype:ze.Value,svalue:t(e.svalue)}:e},tr=function(e,t){return e.stype===ze.Error?{stype:ze.Error,serror:t(e.serror)}:e},nr=Wn,rr=function(e,t,n,r){return{tag:"field",key:e,newKey:t,presence:n,prop:r}},or=function(e,t,n){switch(e.tag){case"field":return t(e.key,e.newKey,e.presence,e.prop);case"custom":return n(e.newKey,e.instantiator)}},ir=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(0===t.length)throw new Error("Can't merge zero objects");for(var r={},o=0;o<t.length;o++){var i=t[o];for(var a in i)ye(i,a)&&(r[a]=e(r[a],i[a]))}return r}},ar=ir((function(e,t){return o(e)&&o(t)?ar(e,t):t})),ur=ir((function(e,t){return t})),cr=function(e){return{tag:"defaultedThunk",process:e}},sr=function(e){return cr(h(e))},lr=function(e){return{tag:"mergeWithThunk",process:e}},fr=function(e){return p(Jn,Y)(e)},dr=function(e){var t=Yn(e);return t.errors.length>0?fr(t.errors):Xn(t.values)},mr=function(e){return o(e)&&se(e).length>100?" removed due to size":JSON.stringify(e,null,2)},gr=function(e,t){return Jn([{path:e,getErrorInfo:t}])},pr=function(e){return{extract:function(t,n){return Qn(e(n),(function(e){return function(e,t){return gr(e,h(t))}(t,e)}))},toString:h("val")}},hr=pr(Xn),vr=function(e,t,n,r){return be(t,n).fold((function(){return function(e,t,n){return gr(e,(function(){return'Could not find valid *required* value for "'+t+'" in '+mr(n)}))}(e,n,t)}),r)},br=function(e,t,n,r){return r(be(e,t).getOrThunk((function(){return n(e)})))},yr=function(e,t,n,r,o){var i=function(e){return o.extract(t.concat([r]),e)},a=function(e){return e.fold((function(){return Xn(R.none())}),(function(e){var n=o.extract(t.concat([r]),e);return er(n,R.some)}))};switch(e.tag){case"required":return vr(t,n,r,i);case"defaultedThunk":return br(n,r,e.process,i);case"option":return function(e,t,n){return n(be(e,t))}(n,r,a);case"defaultedOptionThunk":return function(e,t,n,r){return r(be(e,t).map((function(t){return!0===t?n(e):t})))}(n,r,e.process,a);case"mergeWithThunk":return br(n,r,h({}),(function(t){var r=ar(e.process(n),t);return i(r)}))}},wr=function(e){return{extract:function(t,n){return e().extract(t,n)},toString:function(){return e().toString()}}},xr=function(e){return se(ge(e,l))},Cr=function(e){var t=Sr(e),n=q(e,(function(e,t){return or(t,(function(t){var n;return ar(e,((n={})[t]=!0,n))}),h(e))}),{});return{extract:function(e,r){var o=u(r)?[]:xr(r),i=$(o,(function(e){return!we(n,e)}));return 0===i.length?t.extract(e,r):function(e,t){return gr(e,(function(){return"There are unsupported fields: ["+t.join(", ")+"] specified"}))}(e,i)},toString:t.toString}},Sr=function(e){return{extract:function(t,n){return function(e,t,n){for(var r={},o=[],i=0,a=n;i<a.length;i++){var u=a[i];or(u,(function(n,i,a,u){var c=yr(a,e,t,n,u);nr(c,(function(e){o.push.apply(o,e)}),(function(e){r[i]=e}))}),(function(e,n){r[e]=n(t)}))}return o.length>0?Jn(o):Xn(r)}(t,n,e)},toString:function(){var t=j(e,(function(e){return or(e,(function(e,t,n,r){return e+" -> "+r.toString()}),(function(e,t){return"state("+e+")"}))}));return"obj{\n"+t.join("\n")+"}"}}},kr=function(e){return{extract:function(t,n){var r=j(n,(function(n,r){return e.extract(t.concat(["["+r+"]"]),n)}));return dr(r)},toString:function(){return"array("+e.toString()+")"}}},Tr=function(e){return{extract:function(t,n){for(var r=[],o=0,i=e;o<i.length;o++){var a=i[o].extract(t,n);if(a.stype===ze.Value)return a;r.push(a)}return dr(r)},toString:function(){return"oneOf("+j(e,(function(e){return e.toString()})).join(", ")+")"}}},Or=function(e,t){return{extract:function(n,r){var o=se(r),i=function(t,n){return kr(pr(e)).extract(t,n)}(n,o);return Zn(i,(function(e){var o=j(e,(function(e){return rr(e,e,{tag:"required",process:{}},t)}));return Sr(o).extract(n,r)}))},toString:function(){return"setOf("+t.toString()+")"}}},_r=p(kr,Sr),Er=h(hr),Ar=function(e,t){return pr((function(n){var r=typeof n;return e(n)?Xn(n):Jn("Expected type: "+t+" but got: "+r)}))},Dr=Ar(d,"number"),Mr=Ar(r,"string"),Nr=Ar(u,"boolean"),Rr=Ar(f,"function"),zr=function(e){if(Object(e)!==e)return!0;switch({}.toString.call(e).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(e).every((function(t){return zr(e[t])}));default:return!1}},Br=pr((function(e){return zr(e)?Xn(e):Jn("Expected value to be acceptable for sending via postMessage")})),Pr=function(e,t,n,r){return be(n,r).fold((function(){return function(e,t,n){return gr(e,(function(){return'The chosen schema: "'+n+'" did not exist in branches: '+mr(t)}))}(e,n,r)}),(function(n){return n.extract(e.concat(["branch: "+r]),t)}))},Ir=function(e,t){return{extract:function(n,r){return be(r,e).fold((function(){return function(e,t){return gr(e,(function(){return'Choice schema did not contain choice key: "'+t+'"'}))}(n,e)}),(function(e){return Pr(n,r,t,e)}))},toString:function(){return"chooseOn("+e+"). Possible values: "+se(t)}}},Fr=function(e){return pr((function(t){return e(t).fold(Jn,Xn)}))},Lr=function(e,t){return Or((function(t){return Gn(e(t))}),t)},Hr=function(e,t,n){return Kn(function(e,t,n){var r=t.extract([e],n);return tr(r,(function(e){return{input:n,errors:e}}))}(e,t,n))},Vr=function(e){return e.fold((function(e){throw new Error(Ur(e))}),v)},jr=function(e,t,n){return Vr(Hr(e,t,n))},Ur=function(e){return"Errors: \n"+(t=e.errors,n=t.length>10?t.slice(0,10).concat([{path:[],getErrorInfo:h("... (only showing first ten failures)")}]):t,j(n,(function(e){return"Failed path: ("+e.path.join(" > ")+")\n"+e.getErrorInfo()}))).join("\n")+"\n\nInput object: "+mr(e.input);var t,n},Wr=function(e,t){return Ir(e,de(t,Sr))},$r=rr,qr=function(e,t){return{tag:"custom",newKey:e,instantiator:t}},Gr=function(e){return Fr((function(t){return F(e,t)?Un.value(t):Un.error('Unsupported value: "'+t+'", choose one of "'+e.join(", ")+'".')}))},Kr=function(e){return $r(e,e,{tag:"required",process:{}},Er())},Xr=function(e,t){return $r(e,e,{tag:"required",process:{}},t)},Yr=function(e){return Xr(e,Dr)},Jr=function(e){return Xr(e,Mr)},Zr=function(e,t){return $r(e,e,{tag:"required",process:{}},Gr(t))},Qr=function(e){return Xr(e,Rr)},eo=function(e,t){return $r(e,e,{tag:"required",process:{}},Sr(t))},to=function(e,t){return $r(e,e,{tag:"required",process:{}},_r(t))},no=function(e,t){return $r(e,e,{tag:"required",process:{}},kr(t))},ro=function(e){return $r(e,e,{tag:"option",process:{}},Er())},oo=function(e,t){return $r(e,e,{tag:"option",process:{}},t)},io=function(e){return oo(e,Dr)},ao=function(e){return oo(e,Mr)},uo=function(e){return oo(e,Rr)},co=function(e,t){return oo(e,kr(t))},so=function(e,t){return oo(e,Sr(t))},lo=function(e,t){return $r(e,e,sr(t),Er())},fo=function(e,t,n){return $r(e,e,sr(t),n)},mo=function(e,t){return fo(e,t,Dr)},go=function(e,t){return fo(e,t,Mr)},po=function(e,t,n){return fo(e,t,Gr(n))},ho=function(e,t){return fo(e,t,Nr)},vo=function(e,t){return fo(e,t,Rr)},bo=function(e,t,n){return fo(e,t,kr(n))},yo=function(e,t,n){return fo(e,t,Sr(n))},wo=function(e){var t=e;return{get:function(){return t},set:function(e){t=e}}},xo=function(e){if(!i(e))throw new Error("cases must be an array");if(0===e.length)throw new Error("there must be at least one case");var t=[],n={};return U(e,(function(r,o){var a=se(r);if(1!==a.length)throw new Error("one and only one name per case");var u=a[0],c=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(!i(c))throw new Error("case arguments must be an array");t.push(u),n[u]=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 "+u+". Expected "+c.length+" ("+c+"), got "+i);var a=function(e){var r=se(e);if(t.length!==r.length)throw new Error("Wrong number of arguments to match. Expected: "+t.join(",")+"\nActual: "+r.join(","));if(!Z(t,(function(e){return F(r,e)})))throw new Error("Not all branches were specified when using match. Specified: "+r.join(", ")+"\nRequired: "+t.join(", "));return e[u].apply(null,n)};return{fold:function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];if(t.length!==e.length)throw new Error("Wrong number of arguments to fold. Expected "+e.length+", got "+t.length);var i=t[o];return i.apply(null,n)},match:a,log:function(e){console.log(e,{constructors:t,constructor:u,params:n})}}}})),n};xo([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);var Co,So=function(e,t){return function(e,t){var n={};return fe(e,(function(e,r){F(t,r)||(n[r]=e)})),n}(e,t)},ko=function(e,t){return function(e,t){var n;return(n={})[e]=t,n}(e,t)},To=function(e){return function(e){var t={};return U(e,(function(e){t[e.key]=e.value})),t}(e)},Oo=function(e,t){var n,r=function(e){var t=[],n=[];return U(e,(function(e){e.fold((function(e){t.push(e)}),(function(e){n.push(e)}))})),{errors:t,values:n}}(e);return r.errors.length>0?(n=r.errors,Un.error(Y(n))):function(e,t){return 0===e.length?Un.value(t):Un.value(ar(t,ur.apply(void 0,e)))}(r.values,t)},_o=function(e){return f(e)?e:C},Eo=function(e,t,n){for(var r=e.dom,o=_o(n);r.parentNode;){r=r.parentNode;var i=Re.fromDom(r),a=t(i);if(a.isSome())return a;if(o(i))break}return R.none()},Ao=function(e,t,n){var r=t(e),o=_o(n);return r.orThunk((function(){return o(e)?R.none():Eo(e,t,o)}))},Do=function(e,t){return bt(e.element,t.event.target)},Mo={can:S,abort:C,run:g},No=function(e){if(!we(e,"can")&&!we(e,"abort")&&!we(e,"run"))throw new Error("EventHandler defined by: "+JSON.stringify(e,null,2)+" does not have can, abort, or run!");return T(T({},Mo),e)},Ro=function(e){var t=function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return G(e,(function(e,r){return e&&t(r).apply(void 0,n)}),!0)}}(e,(function(e){return e.can})),n=function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return G(e,(function(e,r){return e||t(r).apply(void 0,n)}),!1)}}(e,(function(e){return e.abort}));return{can:t,abort:n,run:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];U(e,(function(e){e.run.apply(void 0,t)}))}}},zo=h,Bo=zo("touchstart"),Po=zo("touchmove"),Io=zo("touchend"),Fo=zo("touchcancel"),Lo=zo("mousedown"),Ho=zo("mousemove"),Vo=zo("mouseout"),jo=zo("mouseup"),Uo=zo("mouseover"),Wo=zo("focusin"),$o=zo("focusout"),qo=zo("keydown"),Go=zo("keyup"),Ko=zo("input"),Xo=zo("change"),Yo=zo("click"),Jo=zo("transitioncancel"),Zo=zo("transitionend"),Qo=zo("transitionstart"),ei=zo("selectstart"),ti=function(e){return h("alloy."+e)},ni={tap:ti("tap")},ri=ti("focus"),oi=ti("blur.post"),ii=ti("paste.post"),ai=ti("receive"),ui=ti("execute"),ci=ti("focus.item"),si=ni.tap,li=ti("longpress"),fi=ti("sandbox.close"),di=ti("typeahead.cancel"),mi=ti("system.init"),gi=ti("system.touchmove"),pi=ti("system.touchend"),hi=ti("system.scroll"),vi=ti("system.resize"),bi=ti("system.attached"),yi=ti("system.detached"),wi=ti("system.dismissRequested"),xi=ti("system.repositionRequested"),Ci=ti("focusmanager.shifted"),Si=ti("slotcontainer.visibility"),ki=ti("change.tab"),Ti=ti("dismiss.tab"),Oi=ti("highlight"),_i=ti("dehighlight"),Ei=function(e,t){Ni(e,e.element,t,{})},Ai=function(e,t,n){Ni(e,e.element,t,n)},Di=function(e){Ei(e,ui())},Mi=function(e,t,n){Ni(e,t,n,{})},Ni=function(e,t,n,r){var o=T({target:t},r);e.getSystem().triggerEvent(n,t,o)},Ri=function(e,t,n,r){e.getSystem().triggerEvent(n,t,r.event)},zi=function(e){return To(e)},Bi=function(e,t){return{key:e,value:No({abort:t})}},Pi=function(e){return{key:e,value:No({run:function(e,t){t.event.prevent()}})}},Ii=function(e,t){return{key:e,value:No({run:t})}},Fi=function(e,t,n){return{key:e,value:No({run:function(e,r){t.apply(void 0,[e,r].concat(n))}})}},Li=function(e){return function(t){return{key:e,value:No({run:function(e,n){Do(e,n)&&t(e,n)}})}}},Hi=function(e,t,n){return function(e,t){return Ii(e,(function(n,r){n.getSystem().getByUid(t).each((function(t){Ri(t,t.element,e,r)}))}))}(e,t.partUids[n])},Vi=function(e,t){return Ii(e,(function(e,n){var r=n.event,o=e.getSystem().getByDom(r.target).getOrThunk((function(){return Ao(r.target,(function(t){return e.getSystem().getByDom(t).toOptional()}),C).getOr(e)}));t(e,o,n)}))},ji=function(e){return Ii(e,(function(e,t){t.cut()}))},Ui=function(e){return Ii(e,(function(e,t){t.stop()}))},Wi=function(e,t){return Li(e)(t)},$i=Li(bi()),qi=Li(yi()),Gi=Li(mi()),Ki=function(e){return function(t){return Ii(e,t)}}(ui()),Xi=function(e){return e.dom.innerHTML},Yi=function(e,t){var n,r,o=xt(e).dom,i=Re.fromDom(o.createDocumentFragment()),a=(n=t,(r=(o||document).createElement("div")).innerHTML=n,_t(Re.fromDom(r)));On(i,a),_n(e),Tn(e,i)},Ji=function(e){return function(e,t){return Re.fromDom(e.dom.cloneNode(t))}(e,!1)},Zi=function(e){return Mt(e)?"#shadow-root":function(e){var t=Re.fromTag("div"),n=Re.fromDom(e.dom.cloneNode(!0));return Tn(t,n),Xi(t)}(Ji(e))},Qi=function(e){return Zi(e)},ea=zi([function(e,t){return{key:e,value:No({can:t})}}(ri(),(function(e,t){var n=t.event,r=n.originator,o=n.target;return!function(e,t,n){return bt(t,e.element)&&!bt(t,n)}(e,r,o)||(console.warn(ri()+" did not get interpreted by the desired target. \nOriginator: "+Qi(r)+"\nTarget: "+Qi(o)+"\nCheck the "+ri()+" event handlers"),!1)}))]),ta=Object.freeze({__proto__:null,events:ea}),na=0,ra=function(e){var t=(new Date).getTime();return e+"_"+Math.floor(1e9*Math.random())+ ++na+String(t)},oa=h("alloy-id-"),ia=h("data-alloy-id"),aa=oa(),ua=ia(),ca=function(e,t){Object.defineProperty(e.dom,ua,{value:t,writable:!0})},sa=function(e){var t=Ie(e)?e.dom[ua]:null;return R.from(t)},la=function(e){return ra(e)},fa=v,da=function(e){var t=function(t){return"The component must be in a context to execute: "+t+(e?"\n"+Qi(e().element)+" is not in context.":"")},n=function(e){return function(){throw new Error(t(e))}},r=function(e){return function(){console.warn(t(e))}};return{debugInfo:h("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:C}},ma=da(),ga=function(e){return j(e,(function(e){return Ee(e,"/*")?e.substring(0,e.length-"/*".length):e}))},pa=function(e,t){var n=e.toString(),r=n.indexOf(")")+1,o=n.indexOf("("),i=n.substring(o+1,r-1).split(/,\s*/);return e.toFunctionAnnotation=function(){return{name:t,parameters:ga(i)}},e},ha=ra("alloy-premade"),va=function(e){return ko(ha,e)},ba=function(e){return function(e,t){var n=t.toString(),r=n.indexOf(")")+1,o=n.indexOf("("),i=n.substring(o+1,r-1).split(/,\s*/);return e.toFunctionAnnotation=function(){return{name:"OVERRIDE",parameters:ga(i.slice(1))}},e}((function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return e.apply(void 0,_([t.getApis(),t],n,!1))}),e)},ya={init:function(){return wa({readState:h("No State required")})}},wa=function(e){return e},xa=function(e,t){var n={};return fe(e,(function(e,r){fe(e,(function(e,o){var i=be(n,o).getOr([]);n[o]=i.concat([t(r,e)])}))})),n},Ca=function(e){return{classes:c(e.classes)?[]:e.classes,attributes:c(e.attributes)?{}:e.attributes,styles:c(e.styles)?{}:e.styles}},Sa=function(e){return e.cHandler},ka=function(e,t){return{name:e,handler:t}},Ta=function(e,t,n){var r=T(T({},n),function(e,t){var n={};return U(e,(function(e){n[e.name()]=e.handlers(t)})),n}(t,e));return xa(r,ka)},Oa=function(e){var t=function(e){return f(e)?{can:S,abort:C,run:e}:e}(e);return function(e,n){for(var r=[],o=2;o<arguments.length;o++)r[o-2]=arguments[o];var i=[e,n].concat(r);t.abort.apply(void 0,i)?n.stop():t.can.apply(void 0,i)&&t.run.apply(void 0,i)}},_a=function(e,t,n){var r=t[n];return r?function(e,t,n,r){try{var o=re(n,(function(n,o){var i=n[t],a=o[t],u=r.indexOf(i),c=r.indexOf(a);if(-1===u)throw new Error("The ordering for "+e+" does not have an entry for "+i+".\nOrder specified: "+JSON.stringify(r,null,2));if(-1===c)throw new Error("The ordering for "+e+" does not have an entry for "+a+".\nOrder specified: "+JSON.stringify(r,null,2));return u<c?-1:c<u?1:0}));return Un.value(o)}catch(e){return Un.error([e])}}("Event: "+n,"name",e,r).map((function(e){var t=j(e,(function(e){return e.handler}));return Ro(t)})):function(e,t){return Un.error(["The event ("+e+') 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(j(t,(function(e){return e.name})),null,2)])}(n,e)},Ea=function(e,t){var n=pe(e,(function(e,n){return(1===e.length?Un.value(e[0].handler):_a(e,t,n)).map((function(r){var o=Oa(r),i=e.length>1?$(t[n],(function(t){return L(e,(function(e){return e.name===t}))})).join(" > "):e[0].name;return ko(n,function(e,t){return{handler:e,purpose:t}}(o,i))}))}));return Oo(n,{})},Aa="alloy.base.behaviour",Da=Sr([$r("dom","dom",{tag:"required",process:{}},Sr([Kr("tag"),lo("styles",{}),lo("classes",[]),lo("attributes",{}),ro("value"),ro("innerHtml")])),Kr("components"),Kr("uid"),lo("events",{}),lo("apis",{}),$r("eventOrder","eventOrder",function(e){return lr(h(e))}((Co={},Co[ui()]=["disabling",Aa,"toggling","typeaheadevents"],Co[ri()]=[Aa,"focusing","keying"],Co[mi()]=[Aa,"disabling","toggling","representing"],Co[Ko()]=[Aa,"representing","streaming","invalidating"],Co[yi()]=[Aa,"representing","item-events","tooltipping"],Co[Lo()]=["focusing",Aa,"item-type-events"],Co[Bo()]=["focusing",Aa,"item-type-events"],Co[Uo()]=["item-type-events","tooltipping"],Co[ai()]=["receiving","reflecting","tooltipping"],Co)),Er()),ro("domModification")]),Ma=function(e){return e.events},Na=function(e,t){var n=Wt(e,t);return void 0===n||""===n?[]:n.split(" ")},Ra=function(e){return void 0!==e.dom.classList},za=function(e,t){return function(e,t,n){var r=Na(e,t).concat([n]);return Ut(e,t,r.join(" ")),!0}(e,"class",t)},Ba=function(e,t){return function(e,t,n){var r=$(Na(e,t),(function(e){return e!==n}));return r.length>0?Ut(e,t,r.join(" ")):Gt(e,t),!1}(e,"class",t)},Pa=function(e,t){Ra(e)?e.dom.classList.add(t):za(e,t)},Ia=function(e){var t=Ra(e)?e.dom.classList:function(e){return Na(e,"class")}(e);0===t.length&&Gt(e,"class")},Fa=function(e,t){Ra(e)?e.dom.classList.remove(t):Ba(e,t);Ia(e)},La=function(e,t){return Ra(e)&&e.dom.classList.contains(t)},Ha=function(e,t){U(t,(function(t){Pa(e,t)}))},Va=function(e,t){U(t,(function(t){Fa(e,t)}))},ja=function(e){return e.dom.value},Ua=function(e,t){if(void 0===t)throw new Error("Value.set was undefined");e.dom.value=t},Wa=function(e){var t=Re.fromTag(e.tag);!function(e,t){var n=e.dom;fe(t,(function(e,t){jt(n,t,e)}))}(t,e.attributes),Ha(t,e.classes),Jt(t,e.styles),e.innerHtml.each((function(e){return Yi(t,e)}));var n=e.domChildren;return On(t,n),e.value.each((function(e){Ua(t,e)})),e.uid,ca(t,e.uid),t},$a=function(e,t){return function(e,t){var n=j(t,(function(e){return so(e.name(),[Kr("config"),lo("state",ya)])})),r=Hr("component.behaviours",Sr(n),e.behaviours).fold((function(t){throw new Error(Ur(t)+"\nComplete spec:\n"+JSON.stringify(e,null,2))}),v);return{list:t,data:de(r,(function(e){var t=e.map((function(e){return{config:e.config,state:e.state.init(e.config)}}));return h(t)}))}}(e,t)},qa=function(e){var t=function(e){var t=be(e,"behaviours").getOr({});return J(se(t),(function(e){var n=t[e];return l(n)?[n.me]:[]}))}(e);return $a(e,t)},Ga=function(e,t,n){var r,o,i,a=T(T({},(r=e).dom),{uid:r.uid,domChildren:j(r.components,(function(e){return e.element}))}),u=function(e){return e.domModification.fold((function(){return Ca({})}),Ca)}(e),c={"alloy.base.modification":u},s=t.length>0?function(e,t,n,r){var o=T({},t);U(n,(function(t){o[t.name()]=t.exhibit(e,r)}));var i=xa(o,(function(e,t){return{name:e,modification:t}})),a=function(e){return q(e,(function(e,t){return T(T({},t.modification),e)}),{})},u=q(i.classes,(function(e,t){return t.modification.concat(e)}),[]),c=a(i.attributes),s=a(i.styles);return Ca({classes:u,attributes:c,styles:s})}(n,c,t,a):u;return i=s,T(T({},o=a),{attributes:T(T({},o.attributes),i.attributes),styles:T(T({},o.styles),i.styles),classes:o.classes.concat(i.classes)})},Ka=function(e,t,n){var r={"alloy.base.behaviour":Ma(e)};return function(e,t,n,r){var o=Ta(e,n,r);return Ea(o,t)}(n,e.eventOrder,t,r).getOrDie()},Xa=function(e){var t=function(){return d},n=wo(ma),r=Vr(function(e){return Hr("custom.definition",Da,e)}(e)),o=qa(e),i=function(e){return e.list}(o),a=function(e){return e.data}(o),u=Ga(r,i,a),c=Wa(u),s=Ka(r,i,a),l=wo(r.components),d={uid:e.uid,getSystem:n.get,config:function(t){var n=a;return(f(n[t.name()])?n[t.name()]:function(){throw new Error("Could not find "+t.name()+" in "+JSON.stringify(e,null,2))})()},hasConfigured:function(e){return f(a[e.name()])},spec:e,readState:function(e){return a[e]().map((function(e){return e.state.readState()})).getOr("not enabled")},getApis:function(){return r.apis},connect:function(e){n.set(e)},disconnect:function(){n.set(da(t))},element:c,syncComponents:function(){var e=_t(c),t=J(e,(function(e){return n.get().getByDom(e).fold((function(){return[]}),ne)}));l.set(t)},components:l.get,events:s};return d},Ya=function(e){var t=fa(e),n=t.events,r=O(t,["events"]),o=function(e){var t=be(e,"components").getOr([]);return j(t,eu)}(r),i=T(T({},r),{events:T(T({},ta),n),components:o});return Un.value(Xa(i))},Ja=function(e){var t=Re.fromText(e);return Za({element:t})},Za=function(e){var t=jr("external.component",Cr([Kr("element"),ro("uid")]),e),n=wo(da()),r=t.uid.getOrThunk((function(){return la("external")}));ca(t.element,r);var o={uid:r,getSystem:n.get,config:R.none,hasConfigured:C,connect:function(e){n.set(e)},disconnect:function(){n.set(da((function(){return o})))},getApis:function(){return{}},element:t.element,spec:e,readState:h("No state"),syncComponents:g,components:h([]),events:{}};return va(o)},Qa=la,eu=function(e){return function(e){return be(e,ha)}(e).getOrThunk((function(){var t=function(e){return ye(e,"uid")}(e)?e:T({uid:Qa("")},e);return Ya(t).getOrDie()}))},tu=va;function nu(e,t,n,r,o){return e(n,r)?R.some(n):f(o)&&o(n)?R.none():t(n,r,o)}var ru,ou=function(e,t,n){for(var r=e.dom,o=f(n)?n:C;r.parentNode;){r=r.parentNode;var i=Re.fromDom(r);if(t(i))return R.some(i);if(o(i))break}return R.none()},iu=function(e,t,n){return nu((function(e,t){return t(e)}),ou,e,t,n)},au=function(e,t,n){return iu(e,t,n).isSome()},uu=function(e,t,n){return ou(e,(function(e){return ht(e,t)}),n)},cu=function(e,t){return function(e,t){return K(e.dom.childNodes,(function(e){return t(Re.fromDom(e))})).map(Re.fromDom)}(e,(function(e){return ht(e,t)}))},su=function(e,t){return function(e,t){var n=void 0===t?document:t.dom;return vt(n)?R.none():R.from(n.querySelector(e)).map(Re.fromDom)}(t,e)},lu=function(e,t,n){return nu((function(e,t){return ht(e,t)}),uu,e,t,n)},fu=function(){var e=ra("aria-owns");return{id:e,link:function(t){Ut(t,"aria-owns",e)},unlink:function(e){Gt(e,"aria-owns")}}},du=function(e,t){return function(e){var t=iu(e,(function(e){if(!Ie(e))return!1;var t=Wt(e,"id");return void 0!==t&&t.indexOf("aria-owns")>-1}));return t.bind((function(e){var t=Wt(e,"id"),n=zt(e);return su(n,'[aria-owns="'+t+'"]')}))}(t).exists((function(t){return mu(e,t)}))},mu=function(e,t){return au(t,(function(t){return bt(t,e.element)}),C)||du(e,t)},gu="unknown";!function(e){e[e.STOP=0]="STOP",e[e.NORMAL=1]="NORMAL",e[e.LOGGING=2]="LOGGING"}(ru||(ru={}));var pu=wo({}),hu=function(e,t,n){switch(be(pu.get(),e).orThunk((function(){var t=se(pu.get());return ce(t,(function(t){return e.indexOf(t)>-1?R.some(pu.get()[t]):R.none()}))})).getOr(ru.NORMAL)){case ru.NORMAL:return n(yu());case ru.LOGGING:var r=function(e,t){var n=[],r=(new Date).getTime();return{logEventCut:function(e,t,r){n.push({outcome:"cut",target:t,purpose:r})},logEventStopped:function(e,t,r){n.push({outcome:"stopped",target:t,purpose:r})},logNoParent:function(e,t,r){n.push({outcome:"no-parent",target:t,purpose:r})},logEventNoHandlers:function(e,t){n.push({outcome:"no-handlers-left",target:t})},logEventResponse:function(e,t,r){n.push({outcome:"response",purpose:r,target:t})},write:function(){var o=(new Date).getTime();F(["mousemove","mouseover","mouseout",mi()],e)||console.log(e,{event:e,time:o-r,target:t.dom,sequence:j(n,(function(e){return F(["cut","stopped","response"],e.outcome)?"{"+e.purpose+"} "+e.outcome+" at ("+Qi(e.target)+")":e.outcome}))})}}}(e,t),o=n(r);return r.write(),o;case ru.STOP:return!0}},vu=["alloy/data/Fields","alloy/debugging/Debugging"],bu=function(e,t,n){return hu(e,t,n)},yu=h({logEventCut:g,logEventStopped:g,logNoParent:g,logEventNoHandlers:g,logEventResponse:g,write:g}),wu=h([Kr("menu"),Kr("selectedMenu")]),xu=h([Kr("item"),Kr("selectedItem")]);h(Sr(xu().concat(wu())));var Cu=h(Sr(xu())),Su=eo("initSize",[Kr("numColumns"),Kr("numRows")]),ku=function(){return eo("markers",[Kr("backgroundMenu")].concat(wu()).concat(xu()))},Tu=function(e){return eo("markers",j(e,Kr))},Ou=function(e,t,n){return function(){var e=new Error;if(void 0!==e.stack){var t=e.stack.split("\n");return K(t,(function(e){return e.indexOf("alloy")>0&&!L(vu,(function(t){return e.indexOf(t)>-1}))})).getOr(gu)}}(),$r(t,t,n,Fr((function(e){return Un.value((function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.apply(void 0,t)}))})))},_u=function(e){return Ou(0,e,sr(g))},Eu=function(e){return Ou(0,e,sr(R.none))},Au=function(e){return Ou(0,e,{tag:"required",process:{}})},Du=function(e){return Ou(0,e,{tag:"required",process:{}})},Mu=function(e,t){return qr(e,h(t))},Nu=function(e){return qr(e,v)},Ru=h(Su),zu=function(e,t,n,r,o,i,a,u){return void 0===u&&(u=!1),{x:e,y:t,bubble:n,direction:r,placement:o,restriction:i,label:a+"-"+o,alwaysFit:u}},Bu=xo([{southeast:[]},{southwest:[]},{northeast:[]},{northwest:[]},{south:[]},{north:[]},{east:[]},{west:[]}]),Pu=Bu.southeast,Iu=Bu.southwest,Fu=Bu.northeast,Lu=Bu.northwest,Hu=Bu.south,Vu=Bu.north,ju=Bu.east,Uu=Bu.west,Wu=function(e,t,n,r){var o=e+t;return o>r?n:o<n?r:o},$u=function(e,t,n){return Math.min(Math.max(e,t),n)},qu=function(e,t){return te(["left","right","top","bottom"],(function(n){return be(t,n).map((function(t){return function(e,t){switch(t){case 1:return e.x;case 0:return e.x+e.width;case 2:return e.y;case 3:return e.y+e.height}}(e,t)}))}))},Gu="layout",Ku=function(e){return e.x},Xu=function(e,t){return e.x+e.width/2-t.width/2},Yu=function(e,t){return e.x+e.width-t.width},Ju=function(e,t){return e.y-t.height},Zu=function(e){return e.y+e.height},Qu=function(e,t){return e.y+e.height/2-t.height/2},ec=function(e,t,n){return zu(Ku(e),Zu(e),n.southeast(),Pu(),"southeast",qu(e,{left:1,top:3}),Gu)},tc=function(e,t,n){return zu(Yu(e,t),Zu(e),n.southwest(),Iu(),"southwest",qu(e,{right:0,top:3}),Gu)},nc=function(e,t,n){return zu(Ku(e),Ju(e,t),n.northeast(),Fu(),"northeast",qu(e,{left:1,bottom:2}),Gu)},rc=function(e,t,n){return zu(Yu(e,t),Ju(e,t),n.northwest(),Lu(),"northwest",qu(e,{right:0,bottom:2}),Gu)},oc=function(e,t,n){return zu(Xu(e,t),Ju(e,t),n.north(),Vu(),"north",qu(e,{bottom:2}),Gu)},ic=function(e,t,n){return zu(Xu(e,t),Zu(e),n.south(),Hu(),"south",qu(e,{top:3}),Gu)},ac=function(e,t,n){return zu(function(e){return e.x+e.width}(e),Qu(e,t),n.east(),ju(),"east",qu(e,{left:0}),Gu)},uc=function(e,t,n){return zu(function(e,t){return e.x-t.width}(e,t),Qu(e,t),n.west(),Uu(),"west",qu(e,{right:1}),Gu)},cc=function(){return[ec,tc,nc,rc,ic,oc,ac,uc]},sc=function(){return[tc,ec,rc,nc,ic,oc,ac,uc]},lc=function(){return[nc,rc,ec,tc,oc,ic]},fc=function(){return[rc,nc,tc,ec,oc,ic]},dc=function(){return[ec,tc,nc,rc,ic,oc]},mc=function(){return[tc,ec,rc,nc,ic,oc]},gc=Object.freeze({__proto__:null,events:function(e){return zi([Ii(ai(),(function(t,n){var r=e.channels,o=se(r),i=n,a=function(e,t){return t.universal?e:$(e,(function(e){return F(t.channels,e)}))}(o,i);U(a,(function(e){var n=r[e],o=n.schema,a=jr("channel["+e+"] data\nReceiver: "+Qi(t.element),o,i.data);n.onReceive(t,a)}))}))])}}),pc=[Xr("channels",Lr(Un.value,Cr([Au("onReceive"),lo("schema",Er())])))],hc=function(e,t,n){return Gi((function(r,o){n(r,e,t)}))},vc=function(e,t,n){return function(e,t,n){var r=n.toString(),o=r.indexOf(")")+1,i=r.indexOf("("),a=r.substring(i+1,o-1).split(/,\s*/);return e.toFunctionAnnotation=function(){return{name:t,parameters:ga(a.slice(0,1).concat(a.slice(3)))}},e}((function(r){for(var o=[],i=1;i<arguments.length;i++)o[i-1]=arguments[i];var a=[r].concat(o);return r.config({name:h(e)}).fold((function(){throw new Error("We could not find any behaviour configuration for: "+e+". Using API: "+n)}),(function(e){var n=Array.prototype.slice.call(a,1);return t.apply(void 0,[r,e.config,e.state].concat(n))}))}),n,t)},bc=function(e){return{key:e,value:void 0}},yc=function(e,t,n,r,o,i,a){var u=function(e){return we(e,n)?e[n]():R.none()},c=de(o,(function(e,t){return vc(n,e,t)})),s=de(i,(function(e,t){return pa(e,t)})),l=T(T(T({},s),c),{revoke:y(bc,n),config:function(t){var r=jr(n+"-config",e,t);return{key:n,value:{config:r,me:l,configAsRaw:Ve((function(){return jr(n+"-config",e,t)})),initialConfig:t,state:a}}},schema:h(t),exhibit:function(e,t){return Se(u(e),be(r,"exhibit"),(function(e,n){return n(t,e.config,e.state)})).getOrThunk((function(){return Ca({})}))},name:h(n),handlers:function(e){return u(e).map((function(e){return be(r,"events").getOr((function(){return{}}))(e.config,e.state)})).getOr({})}});return l},wc=function(e){return To(e)},xc=Cr([Kr("fields"),Kr("name"),lo("active",{}),lo("apis",{}),lo("state",ya),lo("extra",{})]),Cc=function(e){var t=jr("Creating behaviour: "+e.name,xc,e);return function(e,t,n,r,o,i){var a,u,c=Cr(e),s=so(t,[(a="config",u=e,oo(a,Cr(u)))]);return yc(c,s,t,n,r,o,i)}(t.fields,t.name,t.active,t.apis,t.extra,t.state)},Sc=Cr([Kr("branchKey"),Kr("branches"),Kr("name"),lo("active",{}),lo("apis",{}),lo("state",ya),lo("extra",{})]),kc=function(e){var t=jr("Creating behaviour: "+e.name,Sc,e);return function(e,t,n,r,o,i){var a=e,u=so(t,[oo("config",e)]);return yc(a,u,t,n,r,o,i)}(Wr(t.branchKey,t.branches),t.name,t.active,t.apis,t.extra,t.state)},Tc=h(void 0),Oc=Cc({fields:pc,name:"receiving",active:gc}),_c=Object.freeze({__proto__:null,exhibit:function(e,t){return Ca({classes:[],styles:t.useFixed()?{}:{position:"relative"}})}}),Ec=function(){return Re.fromDom(document)},Ac=function(e){return e.dom.focus()},Dc=function(e){var t=zt(e).dom;return e.dom===t.activeElement},Mc=function(e){return void 0===e&&(e=Ec()),R.from(e.dom.activeElement).map(Re.fromDom)},Nc=function(e){return Mc(zt(e)).filter((function(t){return e.dom.contains(t.dom)}))},Rc=function(e,t){var n=zt(t),r=Mc(n).bind((function(e){var n,r,o=function(t){return bt(e,t)};return o(t)?R.some(t):(n=o,(r=function(e){for(var t=0;t<e.childNodes.length;t++){var o=Re.fromDom(e.childNodes[t]);if(n(o))return R.some(o);var i=r(e.childNodes[t]);if(i.isSome())return i}return R.none()})(t.dom))})),o=e(t);return r.each((function(e){Mc(n).filter((function(t){return bt(t,e)})).fold((function(){Ac(e)}),g)})),o},zc=function(e,t,n,r,o){var i=function(e){return e+"px"};return{position:e,left:t.map(i),top:n.map(i),right:r.map(i),bottom:o.map(i)}},Bc=function(e,t){Zt(e,function(e){return T(T({},e),{position:R.some(e.position)})}(t))},Pc=xo([{none:[]},{relative:["x","y","width","height"]},{fixed:["x","y","width","height"]}]),Ic=function(e,t,n,r,o,i){var a=t.rect,u=a.x-n,c=a.y-r,s=o-(u+a.width),l=i-(c+a.height),f=R.some(u),d=R.some(c),m=R.some(s),g=R.some(l),p=R.none();return function(e,t,n,r,o,i,a,u,c){return e.fold(t,n,r,o,i,a,u,c)}(t.direction,(function(){return zc(e,f,d,p,p)}),(function(){return zc(e,p,d,m,p)}),(function(){return zc(e,f,p,p,g)}),(function(){return zc(e,p,p,m,g)}),(function(){return zc(e,f,d,p,p)}),(function(){return zc(e,f,p,p,g)}),(function(){return zc(e,f,d,p,p)}),(function(){return zc(e,p,d,m,p)}))},Fc=function(e,t){return e.fold((function(){var e=t.rect;return zc("absolute",R.some(e.x),R.some(e.y),R.none(),R.none())}),(function(e,n,r,o){return Ic("absolute",t,e,n,r,o)}),(function(e,n,r,o){return Ic("fixed",t,e,n,r,o)}))},Lc=function(e,t){var n=y(Pn,t),r=e.fold(n,n,(function(){var e=Dn();return Pn(t).translate(-e.left,-e.top)})),o=bn(t),i=ln(t);return In(r.left,r.top,o,i)},Hc=function(e,t){return t.fold((function(){return e.fold(Hn,Hn,In)}),(function(t){return e.fold(t,t,(function(){var n=t(),r=Vc(e,n.x,n.y);return In(r.left,r.top,n.width,n.height)}))}))},Vc=function(e,t,n){var r=dn(t,n);return e.fold(h(r),h(r),(function(){var e=Dn();return r.translate(-e.left,-e.top)}))};Pc.none;var jc,Uc=Pc.relative,Wc=Pc.fixed,$c=function(e,t){return function(e,t){return{anchorBox:e,origin:t}}(e,t)},qc="data-alloy-placement",Gc=function(e){return $t(e,qc)},Kc=xo([{fit:["reposition"]},{nofit:["reposition","visibleW","visibleH","isVisible"]}]),Xc=function(e,t,n,r){var o=e.bubble,i=o.offset,a=function(e,t,n){var r=function(r,o){return t[r].map((function(t){var i="top"===r||"bottom"===r,a=i?n.top:n.left,u=("left"===r||"top"===r?Math.max:Math.min)(t,o)+a;return i?$u(u,e.y,e.bottom):$u(u,e.x,e.right)})).getOr(o)},o=r("left",e.x),i=r("top",e.y),a=r("right",e.right),u=r("bottom",e.bottom);return In(o,i,a-o,u-i)}(r,e.restriction,i),u=e.x+i.left,c=e.y+i.top,s=In(u,c,t,n),l=function(e,t){var n=t.x,r=t.y,o=t.right,i=t.bottom,a=e.x,u=e.y,c=e.right,s=e.bottom,l=e.width,f=e.height;return{originInBounds:a>=n&&a<=o&&u>=r&&u<=i,sizeInBounds:c<=o&&c>=n&&s<=i&&s>=r,visibleW:Math.min(l,a>=n?o-a:c-n),visibleH:Math.min(f,u>=r?i-u:s-r)}}(s,a),f=l.originInBounds,d=l.sizeInBounds,m=l.visibleW,g=l.visibleH,p=f&&d,v=p?s:function(e,t){var n=t.x,r=t.y,o=t.right,i=t.bottom,a=e.x,u=e.y,c=e.width,s=e.height,l=Math.max(n,o-c),f=Math.max(r,i-s),d=$u(a,n,l),m=$u(u,r,f),g=Math.min(d+c,o)-d,p=Math.min(m+s,i)-m;return In(d,m,g,p)}(s,a),b=v.width>0&&v.height>0,y=function(e,t,n){var r=h(t.bottom-n.y),o=h(n.bottom-t.y),i=function(e,t,n,r){return e.fold(t,t,r,r,t,r,n,n)}(e,o,o,r),a=h(t.right-n.x),u=h(n.right-t.x),c=function(e,t,n,r){return e.fold(t,r,t,r,n,n,t,r)}(e,u,u,a);return{maxWidth:c,maxHeight:i}}(e.direction,v,r),w=y.maxWidth,x={rect:v,maxHeight:y.maxHeight,maxWidth:w,direction:e.direction,placement:e.placement,classes:{on:o.classesOn,off:o.classesOff},layout:e.label,testY:c};return p||e.alwaysFit?Kc.fit(x):Kc.nofit(x,m,g,b)},Yc=function(e){var t=wo(R.none()),n=function(){return t.get().each(e)};return{clear:function(){n(),t.set(R.none())},isSet:function(){return t.get().isSome()},get:function(){return t.get()},set:function(e){n(),t.set(R.some(e))}}},Jc=function(){return Yc((function(e){return e.unbind()}))},Zc=function(){var e=Yc(g);return T(T({},e),{on:function(t){return e.get().each(t)}})},Qc=S,es=function(e,t,n){return function(e,t,n,r){return wn(e,t,n,r,!1)}(e,t,Qc,n)},ts=function(e,t,n){return function(e,t,n,r){return wn(e,t,n,r,!0)}(e,t,Qc,n)},ns=yn,rs=["top","bottom","right","left"],os="data-alloy-transition-timer",is=function(e,t){return function(e,t){return Z(t,(function(t){return La(e,t)}))}(e,t.classes)},as=function(e,t){var n=function(e){return parseFloat(e).toFixed(3)};return he(t,(function(t,r){var o,i,a,u=e[r].map(n),c=t.map(n);return void 0===a&&(a=b),!Se(o=u,i=c,a).getOr(o.isNone()&&i.isNone())})).isSome()},us=function(e,t){var n,o=Jc(),i=Jc(),a=function(t){var n,r=null!==(n=t.raw.pseudoElement)&&void 0!==n?n:"";return bt(t.target,e)&&!De(r)&&F(rs,t.raw.propertyName)},u=function(r){if(s(r)||a(r)){o.clear(),i.clear();var u=null==r?void 0:r.raw.type;(s(u)||u===Zo())&&(clearTimeout(n),Gt(e,os),Va(e,t.classes))}},c=function(){o.set(es(e,Zo(),u)),i.set(es(e,Jo(),u))};if("ontransitionstart"in e.dom)var l=es(e,Qo(),(function(e){a(e)&&(l.unbind(),c())}));else c();var f=function(e){var t=function(t){var n=Qt(e,t),o=r(n)?n.split(/\s*,\s*/):[];return $(o,De)},n=function(e){if(r(e)&&/^[\d.]+/.test(e)){var t=parseFloat(e);return Ee(e,"ms")?t:1e3*t}return 0},o=t("transition-delay"),i=t("transition-duration");return G(i,(function(e,t,r){var i=n(o[r])+n(t);return Math.max(e,i)}),0)}(e);requestAnimationFrame((function(){n=setTimeout(u,f+17),Ut(e,os,n)}))},cs=function(e,t,n,r,o,i){var a=function(e,t,n){return n.exists((function(n){var r=e.mode;return"all"===r||n[r]!==t[r]}))}(r,o,i);if(a||is(e,r)){Yt(e,"position",n.position);var u=Lc(t,e),c=Fc(t,T(T({},o),{rect:u})),s=te(rs,(function(e){return c[e]}));as(n,s)&&(Zt(e,s),a&&function(e,t){Ha(e,t.classes),$t(e,os).each((function(t){clearTimeout(parseInt(t,10)),Gt(e,os)})),us(e,t)}(e,r),an(e))}else Va(e,r.classes)},ss=function(e,t,n,r){on(t,"max-height"),on(t,"max-width");var o,i={width:bn(o=t),height:ln(o)};return function(e,t,n,r,o,i){var a=r.width,u=r.height,c=function(t,c,s,l,f){var d=t(n,r,o,e,i),m=Xc(d,a,u,i);return m.fold(h(m),(function(e,t,n,r){return(f===r?n>l||t>s:!f&&r)?m:Kc.nofit(c,s,l,f)}))},s=G(t,(function(e,t){var n=y(c,t);return e.fold(h(e),n)}),Kc.nofit({rect:n,maxHeight:r.height,maxWidth:r.width,direction:Pu(),placement:"southeast",classes:{on:[],off:[]},layout:"none",testY:n.y},-1,-1,!1));return s.fold(v,v)}(t,r.preference,e,i,n,r.bounds)},ls=function(e,t){!function(e,t){Ut(e,qc,t)}(e,t.placement)},fs=function(e,t){!function(e,t){var n=cn.max(e,t,["margin-top","border-top-width","padding-top","padding-bottom","border-bottom-width","margin-bottom"]);Yt(e,"max-height",n+"px")}(e,Math.floor(t))},ds=h((function(e,t){fs(e,t),Jt(e,{"overflow-x":"hidden","overflow-y":"auto"})})),ms=h((function(e,t){fs(e,t)})),gs=function(e,t,n){return void 0===e[t]?n:e[t]},ps=function(e,t,n,r){var o=ss(e,t,n,r);return function(e,t,n){var r=Fc(n.origin,t);n.transition.each((function(o){cs(e,n.origin,r,o,t,n.lastPlacement)})),Bc(e,r)}(t,o,r),ls(t,o),function(e,t){var n=t.classes;Va(e,n.off),Ha(e,n.on)}(t,o),function(e,t,n){(0,n.maxHeightFunction)(e,t.maxHeight)}(t,o,r),function(e,t,n){(0,n.maxWidthFunction)(e,t.maxWidth)}(t,o,r),{layout:o.layout,placement:o.placement}},hs=["valignCentre","alignLeft","alignRight","alignCentre","top","bottom","left","right","inset"],vs=function(e,t,n,r){void 0===r&&(r=1);var o=e*r,i=t*r,a=function(e){return be(n,e).getOr([])},u=function(e,t,n){var r=ee(hs,n);return{offset:dn(e,t),classesOn:J(n,a),classesOff:J(r,a)}};return{southeast:function(){return u(-e,t,["top","alignLeft"])},southwest:function(){return u(e,t,["top","alignRight"])},south:function(){return u(-e/2,t,["top","alignCentre"])},northeast:function(){return u(-e,-t,["bottom","alignLeft"])},northwest:function(){return u(e,-t,["bottom","alignRight"])},north:function(){return u(-e/2,-t,["bottom","alignCentre"])},east:function(){return u(e,-t/2,["valignCentre","left"])},west:function(){return u(-e,-t/2,["valignCentre","right"])},insetNortheast:function(){return u(o,i,["top","alignLeft","inset"])},insetNorthwest:function(){return u(-o,i,["top","alignRight","inset"])},insetNorth:function(){return u(-o/2,i,["top","alignCentre","inset"])},insetSoutheast:function(){return u(o,-i,["bottom","alignLeft","inset"])},insetSouthwest:function(){return u(-o,-i,["bottom","alignRight","inset"])},insetSouth:function(){return u(-o/2,-i,["bottom","alignCentre","inset"])},insetEast:function(){return u(-o,-i/2,["valignCentre","right","inset"])},insetWest:function(){return u(o,-i/2,["valignCentre","left","inset"])}}},bs=function(){return vs(0,0,{})},ys=v,ws=function(e,t){return function(n){return"rtl"===xs(n)?t:e}},xs=function(e){return"rtl"===Qt(e,"direction")?"rtl":"ltr"};!function(e){e.TopToBottom="toptobottom",e.BottomToTop="bottomtotop"}(jc||(jc={}));var Cs="data-alloy-vertical-dir",Ss=function(e){return au(e,(function(e){return Ie(e)&&Wt(e,"data-alloy-vertical-dir")===jc.BottomToTop}))},ks=function(){return so("layouts",[Kr("onLtr"),Kr("onRtl"),ro("onBottomLtr"),ro("onBottomRtl")])},Ts=function(e,t,n,r,o,i,a){var u=a.map(Ss).getOr(!1),c=t.layouts.map((function(t){return t.onLtr(e)})),s=t.layouts.map((function(t){return t.onRtl(e)})),l=u?t.layouts.bind((function(t){return t.onBottomLtr.map((function(t){return t(e)}))})).or(c).getOr(o):c.getOr(n),f=u?t.layouts.bind((function(t){return t.onBottomRtl.map((function(t){return t(e)}))})).or(s).getOr(i):s.getOr(r);return ws(l,f)(e)},Os=[Kr("hotspot"),ro("bubble"),lo("overrides",{}),ks(),Mu("placement",(function(e,t,n){var r=t.hotspot,o=Lc(n,r.element),i=Ts(e.element,t,dc(),mc(),lc(),fc(),R.some(t.hotspot.element));return R.some(ys({anchorBox:o,bubble:t.bubble.getOr(bs()),overrides:t.overrides,layouts:i,placer:R.none()}))}))],_s=[Kr("x"),Kr("y"),lo("height",0),lo("width",0),lo("bubble",bs()),lo("overrides",{}),ks(),Mu("placement",(function(e,t,n){var r=Vc(n,t.x,t.y),o=In(r.left,r.top,t.width,t.height),i=Ts(e.element,t,cc(),sc(),cc(),sc(),R.none());return R.some(ys({anchorBox:o,bubble:t.bubble,overrides:t.overrides,layouts:i,placer:R.none()}))}))],Es=xo([{screen:["point"]},{absolute:["point","scrollLeft","scrollTop"]}]),As=function(e){return e.fold(v,(function(e,t,n){return e.translate(-t,-n)}))},Ds=function(e){return e.fold(v,v)},Ms=function(e){return G(e,(function(e,t){return e.translate(t.left,t.top)}),dn(0,0))},Ns=function(e){var t=j(e,Ds);return Ms(t)},Rs=Es.screen,zs=Es.absolute,Bs=function(e,t,n){var r=xt(e.element),o=Dn(r),i=function(e,t,n){var r=kt(n.root).dom;return R.from(r.frameElement).map(Re.fromDom).filter((function(t){var n=xt(t),r=xt(e.element);return bt(n,r)})).map(gn)}(e,0,n).getOr(o);return zs(i,o.left,o.top)},Ps=function(e,t,n,r){var o=Rs(dn(e,t));return R.some(function(e,t,n){return{point:e,width:t,height:n}}(o,n,r))},Is=function(e,t,n,r,o){return e.map((function(e){var i,a,u,c=[t,e.point],s=(i=function(){return Ns(c)},a=function(){return Ns(c)},u=function(){return function(e){var t=j(e,As);return Ms(t)}(c)},r.fold(i,a,u)),l=function(e,t,n,r){return{x:e,y:t,width:n,height:r}}(s.left,s.top,e.width,e.height),f=n.showAbove?lc():dc(),d=n.showAbove?fc():mc(),m=Ts(o,n,f,d,f,d,R.none());return ys({anchorBox:l,bubble:n.bubble.getOr(bs()),overrides:n.overrides,layouts:m,placer:R.none()})}))},Fs=[Kr("node"),Kr("root"),ro("bubble"),ks(),lo("overrides",{}),lo("showAbove",!1),Mu("placement",(function(e,t,n){var r=Bs(e,0,t);return t.node.filter(Lt).bind((function(o){var i=o.dom.getBoundingClientRect(),a=Ps(i.left,i.top,i.width,i.height),u=t.node.getOr(e.element);return Is(a,r,t,n,u)}))}))],Ls=function(e,t,n,r){return{start:e,soffset:t,finish:n,foffset:r}},Hs=xo([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Vs=(Hs.before,Hs.on,Hs.after,function(e){return e.fold(v,v,v)}),js=xo([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Us={domRange:js.domRange,relative:js.relative,exact:js.exact,exactFromRange:function(e){return js.exact(e.start,e.soffset,e.finish,e.foffset)},getWin:function(e){var t=function(e){return e.match({domRange:function(e){return Re.fromDom(e.startContainer)},relative:function(e,t){return Vs(e)},exact:function(e,t,n,r){return e}})}(e);return kt(t)},range:Ls},Ws=function(e,t,n){var r,o=e.document.createRange();return r=o,t.fold((function(e){r.setStartBefore(e.dom)}),(function(e,t){r.setStart(e.dom,t)}),(function(e){r.setStartAfter(e.dom)})),function(e,t){t.fold((function(t){e.setEndBefore(t.dom)}),(function(t,n){e.setEnd(t.dom,n)}),(function(t){e.setEndAfter(t.dom)}))}(o,n),o},$s=function(e,t,n,r,o){var i=e.document.createRange();return i.setStart(t.dom,n),i.setEnd(r.dom,o),i},qs=function(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom,width:e.width,height:e.height}},Gs=xo([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),Ks=function(e,t,n){return t(Re.fromDom(n.startContainer),n.startOffset,Re.fromDom(n.endContainer),n.endOffset)},Xs=function(e,t){var n=function(e,t){return t.match({domRange:function(e){return{ltr:h(e),rtl:R.none}},relative:function(t,n){return{ltr:Ve((function(){return Ws(e,t,n)})),rtl:Ve((function(){return R.some(Ws(e,n,t))}))}},exact:function(t,n,r,o){return{ltr:Ve((function(){return $s(e,t,n,r,o)})),rtl:Ve((function(){return R.some($s(e,r,o,t,n))}))}}})}(e,t);return function(e,t){var n=t.ltr();return n.collapsed?t.rtl().filter((function(e){return!1===e.collapsed})).map((function(e){return Gs.rtl(Re.fromDom(e.endContainer),e.endOffset,Re.fromDom(e.startContainer),e.startOffset)})).getOrThunk((function(){return Ks(0,Gs.ltr,n)})):Ks(0,Gs.ltr,n)}(0,n)},Ys=function(e,t){return Xs(e,t).match({ltr:function(t,n,r,o){var i=e.document.createRange();return i.setStart(t.dom,n),i.setEnd(r.dom,o),i},rtl:function(t,n,r,o){var i=e.document.createRange();return i.setStart(r.dom,o),i.setEnd(t.dom,n),i}})};Gs.ltr,Gs.rtl;var Js,Zs=function(e,t){var n=function(t){return e(t)?R.from(t.dom.nodeValue):R.none()};return{get:function(r){if(!e(r))throw new Error("Can only get "+t+" value of a "+t+" node");return n(r).getOr("")},getOption:n,set:function(n,r){if(!e(n))throw new Error("Can only set raw "+t+" value of a "+t+" node");n.dom.nodeValue=r}}}(Fe,"text"),Qs=function(e){return Zs.getOption(e)},el=["img","br"],tl=function(e){var t=Qs(e).filter((function(e){return 0!==e.trim().length||e.indexOf(" ")>-1})).isSome();return t||F(el,Be(e))},nl=function(e,t){var n=function(e){for(var r=_t(e),o=r.length-1;o>=0;o--){var i=r[o];if(t(i))return R.some(i);var a=n(i);if(a.isSome())return a}return R.none()};return n(e)},rl=function(e,t){return function(e,t){var n=void 0===t?document:t.dom;return vt(n)?[]:j(n.querySelectorAll(e),Re.fromDom)}(t,e)},ol=function(e,t,n,r){var o=function(e,t,n,r){var o=xt(e).dom.createRange();return o.setStart(e.dom,t),o.setEnd(n.dom,r),o}(e,t,n,r),i=bt(e,n)&&t===r;return o.collapsed&&!i},il=function(e){if(e.rangeCount>0){var t=e.getRangeAt(0),n=e.getRangeAt(e.rangeCount-1);return R.some(Ls(Re.fromDom(t.startContainer),t.startOffset,Re.fromDom(n.endContainer),n.endOffset))}return R.none()},al=function(e){if(null===e.anchorNode||null===e.focusNode)return il(e);var t=Re.fromDom(e.anchorNode),n=Re.fromDom(e.focusNode);return ol(t,e.anchorOffset,n,e.focusOffset)?R.some(Ls(t,e.anchorOffset,n,e.focusOffset)):il(e)},ul=function(e){return function(e){return R.from(e.getSelection())}(e).filter((function(e){return e.rangeCount>0})).bind(al)},cl=function(e,t){return function(e){var t=e.getClientRects(),n=t.length>0?t[0]:e.getBoundingClientRect();return n.width>0||n.height>0?R.some(n).map(qs):R.none()}(Ys(e,t))},sl=function(e,t){return function(e){var t=e.getBoundingClientRect();return t.width>0||t.height>0?R.some(t).map(qs):R.none()}(Ys(e,t))},ll=function(e,t){return{element:e,offset:t}},fl=function(e,t){var n=_t(e);if(0===n.length)return ll(e,t);if(t<n.length)return ll(n[t],0);var r=n[n.length-1],o=Fe(r)?function(e){return Zs.get(e)}(r).length:_t(r).length;return ll(r,o)},dl=function(e,t){return Fe(e)?ll(e,t):fl(e,t)},ml=function(e,t){return t.getSelection.getOrThunk((function(){return function(){return ul(e)}}))().map((function(e){var t=dl(e.start,e.soffset),n=dl(e.finish,e.foffset);return Us.range(t.element,t.offset,n.element,n.offset)}))},gl=[ro("getSelection"),Kr("root"),ro("bubble"),ks(),lo("overrides",{}),lo("showAbove",!1),Mu("placement",(function(e,t,n){var r=kt(t.root).dom,o=Bs(e,0,t),i=ml(r,t).bind((function(e){var t=sl(r,Us.exactFromRange(e)).orThunk((function(){var t=Re.fromText("\ufeff");Cn(e.start,t);var n=cl(r,Us.exact(t,0,t,1));return En(t),n}));return t.bind((function(e){return Ps(e.left,e.top,e.width,e.height)}))})),a=ml(r,t).bind((function(e){return Ie(e.start)?R.some(e.start):function(e){return Tt(e)}(e.start)})),u=a.getOr(e.element);return Is(i,o,t,n,u)}))],pl="link-layout",hl=function(e){return e.x+e.width},vl=function(e,t){return e.x-t.width},bl=function(e,t){return e.y-t.height+e.height},yl=function(e){return e.y},wl=function(e,t,n){return zu(hl(e),yl(e),n.southeast(),Pu(),"southeast",qu(e,{left:0,top:2}),pl)},xl=function(e,t,n){return zu(vl(e,t),yl(e),n.southwest(),Iu(),"southwest",qu(e,{right:1,top:2}),pl)},Cl=function(e,t,n){return zu(hl(e),bl(e,t),n.northeast(),Fu(),"northeast",qu(e,{left:0,bottom:3}),pl)},Sl=function(e,t,n){return zu(vl(e,t),bl(e,t),n.northwest(),Lu(),"northwest",qu(e,{right:1,bottom:3}),pl)},kl=function(){return[wl,xl,Cl,Sl]},Tl=function(){return[xl,wl,Sl,Cl]},Ol=[Kr("item"),ks(),lo("overrides",{}),Mu("placement",(function(e,t,n){var r=Lc(n,t.item.element),o=Ts(e.element,t,kl(),Tl(),kl(),Tl(),R.none());return R.some(ys({anchorBox:r,bubble:bs(),overrides:t.overrides,layouts:o,placer:R.none()}))}))],_l=Wr("type",{selection:gl,node:Fs,hotspot:Os,submenu:Ol,makeshift:_s}),El=[no("classes",Mr),po("mode","all",["all","layout","placement"])],Al=[lo("useFixed",C),ro("getBounds")],Dl=[Xr("anchor",_l),so("transition",El)],Ml=function(e,t,n,r,o,i,a){return function(e,t,n,r,o,i,a,u){var c=gs(a,"maxHeightFunction",ds()),s=gs(a,"maxWidthFunction",g),l=e.anchorBox,f=e.origin,d={bounds:Hc(f,i),origin:f,preference:r,maxHeightFunction:c,maxWidthFunction:s,lastPlacement:o,transition:u};return ps(l,t,n,d)}($c(n.anchorBox,t),o.element,n.bubble,n.layouts,i,r,n.overrides,a)},Nl=function(e,t,n,r,o,i){var a=i.map(Fn);return Rl(e,t,n,r,o,a)},Rl=function(e,t,n,r,o,i){var a=jr("placement.info",Sr(Dl),o),u=a.anchor,c=r.element,s=n.get(r.uid);Rc((function(){Yt(c,"position","fixed");var o=tn(c,"visibility");Yt(c,"visibility","hidden");var l,f=t.useFixed()?(l=document.documentElement,Wc(0,0,l.clientWidth,l.clientHeight)):function(e){var t=gn(e.element),n=e.element.dom.getBoundingClientRect();return Uc(t.left,t.top,n.width,n.height)}(e),d=u.placement,m=i.map(h).or(t.getBounds);d(e,u,f).each((function(t){var o=t.placer.getOr(Ml)(e,f,t,m,r,s,a.transition);n.set(r.uid,o)})),o.fold((function(){on(c,"visibility")}),(function(e){Yt(c,"visibility",e)})),tn(c,"left").isNone()&&tn(c,"top").isNone()&&tn(c,"right").isNone()&&tn(c,"bottom").isNone()&&xe(tn(c,"position"),"fixed")&&on(c,"position")}),c)},zl=Object.freeze({__proto__:null,position:function(e,t,n,r,o){Nl(e,t,n,r,o,R.none())},positionWithin:Nl,positionWithinBounds:Rl,getMode:function(e,t,n){return t.useFixed()?"fixed":"absolute"},reset:function(e,t,n,r){var o=r.element;U(["position","left","right","top","bottom"],(function(e){return on(o,e)})),function(e){Gt(e,qc)}(o),n.clear(r.uid)}}),Bl=Object.freeze({__proto__:null,init:function(){var e={};return wa({readState:function(){return e},clear:function(t){l(t)?delete e[t]:e={}},set:function(t,n){e[t]=n},get:function(t){return be(e,t)}})}}),Pl=Cc({fields:Al,name:"positioning",active:_c,apis:zl,state:Bl}),Il=function(e){Ei(e,yi());var t=e.components();U(t,Il)},Fl=function(e){var t=e.components();U(t,Fl),Ei(e,bi())},Ll=function(e,t){Tn(e.element,t.element)},Hl=function(e,t){var n=e.components();!function(e){U(e.components(),(function(e){return En(e.element)})),_n(e.element),e.syncComponents()}(e);var r=ee(n,t);U(r,(function(t){Il(t),e.getSystem().removeFromWorld(t)})),U(t,(function(t){t.getSystem().isConnected()?Ll(e,t):(e.getSystem().addToWorld(t),Ll(e,t),Lt(e.element)&&Fl(t)),e.syncComponents()}))},Vl=function(e,t){jl(e,t,Tn)},jl=function(e,t,n){e.getSystem().addToWorld(t),n(e.element,t.element),Lt(e.element)&&Fl(t),e.syncComponents()},Ul=function(e){Il(e),En(e.element),e.getSystem().removeFromWorld(e)},Wl=function(e){var t=Tt(e.element).bind((function(t){return e.getSystem().getByDom(t).toOptional()}));Ul(e),t.each((function(e){e.syncComponents()}))},$l=function(e){var t=e.components();U(t,Ul),_n(e.element),e.syncComponents()},ql=function(e,t){Gl(e,t,Tn)},Gl=function(e,t,n){n(e,t.element);var r=_t(t.element);U(r,(function(e){t.getByDom(e).each(Fl)}))},Kl=function(e){var t=_t(e.element);U(t,(function(t){e.getByDom(t).each(Il)})),En(e.element)},Xl=function(e,t,n,r){n.get().each((function(t){$l(e)}));var o=t.getAttachPoint(e);Vl(o,e);var i=e.getSystem().build(r);return Vl(e,i),n.set(i),i},Yl=function(e,t,n,r){var o=Xl(e,t,n,r);return t.onOpen(e,o),o},Jl=function(e,t,n){n.get().each((function(r){$l(e),Wl(e),t.onClose(e,r),n.clear()}))},Zl=function(e,t,n){return n.isOpen()},Ql=function(e,t,n){var r=t.getAttachPoint(e);Yt(e.element,"position",Pl.getMode(r)),function(e,t,n,r){tn(e.element,t).fold((function(){Gt(e.element,n)}),(function(t){Ut(e.element,n,t)})),Yt(e.element,t,r)}(e,"visibility",t.cloakVisibilityAttr,"hidden")},ef=function(e,t,n){(function(e){return L(["top","left","right","bottom"],(function(t){return tn(e,t).isSome()}))})(e.element)||on(e.element,"position"),function(e,t,n){$t(e.element,n).fold((function(){return on(e.element,t)}),(function(n){return Yt(e.element,t,n)}))}(e,"visibility",t.cloakVisibilityAttr)},tf=Object.freeze({__proto__:null,cloak:Ql,decloak:ef,open:Yl,openWhileCloaked:function(e,t,n,r,o){Ql(e,t),Yl(e,t,n,r),o(),ef(e,t)},close:Jl,isOpen:Zl,isPartOf:function(e,t,n,r){return Zl(0,0,n)&&n.get().exists((function(n){return t.isPartOf(e,n,r)}))},getState:function(e,t,n){return n.get()},setContent:function(e,t,n,r){return n.get().map((function(){return Xl(e,t,n,r)}))}}),nf=Object.freeze({__proto__:null,events:function(e,t){return zi([Ii(fi(),(function(n,r){Jl(n,e,t)}))])}}),rf=[_u("onOpen"),_u("onClose"),Kr("isPartOf"),Kr("getAttachPoint"),lo("cloakVisibilityAttr","data-precloak-visibility")],of=Object.freeze({__proto__:null,init:function(){var e=Zc(),t=h("not-implemented");return wa({readState:t,isOpen:e.isSet,clear:e.clear,set:e.set,get:e.get})}}),af=Cc({fields:rf,name:"sandboxing",active:nf,apis:tf,state:of}),uf=h("dismiss.popups"),cf=h("reposition.popups"),sf=h("mouse.released"),lf=Cr([lo("isExtraPart",C),so("fireEventInstead",[lo("event",wi())])]),ff=function(e){var t,n=jr("Dismissal",lf,e);return(t={})[uf()]={schema:Cr([Kr("target")]),onReceive:function(e,t){af.isOpen(e)&&(af.isPartOf(e,t.target)||n.isExtraPart(e,t.target)||n.fireEventInstead.fold((function(){return af.close(e)}),(function(t){return Ei(e,t.event)})))}},t},df=Cr([so("fireEventInstead",[lo("event",xi())]),Qr("doReposition")]),mf=function(e){var t,n=jr("Reposition",df,e);return(t={})[cf()]={onReceive:function(e){af.isOpen(e)&&n.fireEventInstead.fold((function(){return n.doReposition(e)}),(function(t){return Ei(e,t.event)}))}},t},gf=function(e,t,n){t.store.manager.onLoad(e,t,n)},pf=function(e,t,n){t.store.manager.onUnload(e,t,n)},hf=Object.freeze({__proto__:null,onLoad:gf,onUnload:pf,setValue:function(e,t,n,r){t.store.manager.setValue(e,t,n,r)},getValue:function(e,t,n){return t.store.manager.getValue(e,t,n)},getState:function(e,t,n){return n}}),vf=Object.freeze({__proto__:null,events:function(e,t){var n=e.resetOnDom?[$i((function(n,r){gf(n,e,t)})),qi((function(n,r){pf(n,e,t)}))]:[hc(e,t,gf)];return zi(n)}}),bf=function(){var e=wo(null);return wa({set:e.set,get:e.get,isNotSet:function(){return null===e.get()},clear:function(){e.set(null)},readState:function(){return{mode:"memory",value:e.get()}}})},yf=function(){var e=wo({}),t=wo({});return wa({readState:function(){return{mode:"dataset",dataByValue:e.get(),dataByText:t.get()}},lookup:function(n){return be(e.get(),n).orThunk((function(){return be(t.get(),n)}))},update:function(n){var r=e.get(),o=t.get(),i={},a={};U(n,(function(e){i[e.value]=e,be(e,"meta").each((function(t){be(t,"text").each((function(t){a[t]=e}))}))})),e.set(T(T({},r),i)),t.set(T(T({},o),a))},clear:function(){e.set({}),t.set({})}})},wf=Object.freeze({__proto__:null,memory:bf,dataset:yf,manual:function(){return wa({readState:g})},init:function(e){return e.store.manager.state(e)}}),xf=function(e,t,n,r){var o=t.store;n.update([r]),o.setValue(e,r),t.onSetValue(e,r)},Cf=[ro("initialValue"),Kr("getFallbackEntry"),Kr("getDataKey"),Kr("setValue"),Mu("manager",{setValue:xf,getValue:function(e,t,n){var r=t.store,o=r.getDataKey(e);return n.lookup(o).getOrThunk((function(){return r.getFallbackEntry(o)}))},onLoad:function(e,t,n){t.store.initialValue.each((function(r){xf(e,t,n,r)}))},onUnload:function(e,t,n){n.clear()},state:yf})],Sf=[Kr("getValue"),lo("setValue",g),ro("initialValue"),Mu("manager",{setValue:function(e,t,n,r){t.store.setValue(e,r),t.onSetValue(e,r)},getValue:function(e,t,n){return t.store.getValue(e)},onLoad:function(e,t,n){t.store.initialValue.each((function(n){t.store.setValue(e,n)}))},onUnload:g,state:ya.init})],kf=[ro("initialValue"),Mu("manager",{setValue:function(e,t,n,r){n.set(r),t.onSetValue(e,r)},getValue:function(e,t,n){return n.get()},onLoad:function(e,t,n){t.store.initialValue.each((function(e){n.isNotSet()&&n.set(e)}))},onUnload:function(e,t,n){n.clear()},state:bf})],Tf=[fo("store",{mode:"memory"},Wr("mode",{memory:kf,manual:Sf,dataset:Cf})),_u("onSetValue"),lo("resetOnDom",!1)],Of=Cc({fields:Tf,name:"representing",active:vf,apis:hf,extra:{setValueFrom:function(e,t){var n=Of.getValue(t);Of.setValue(e,n)}},state:wf}),_f=function(e,t){return yo(e,{},j(t,(function(t){return n=t.name(),r="Cannot configure "+t.name()+" for "+e,$r(n,n,{tag:"option",process:{}},pr((function(e){return Jn("The field: "+n+" is forbidden. "+r)})));var n,r})).concat([qr("dump",v)]))},Ef=function(e){return e.dump},Af=function(e,t){return T(T({},wc(t)),e.dump)},Df=_f,Mf=Af,Nf="placeholder",Rf=xo([{single:["required","valueThunk"]},{multiple:["required","valueThunks"]}]),zf=function(e){return ye(e,"uiType")},Bf=function(e,t,n,r){return zf(n)&&n.uiType===Nf?function(e,t,n,r){return e.exists((function(e){return e!==n.owner}))?Rf.single(!0,h(n)):be(r,n.name).fold((function(){throw new Error("Unknown placeholder component: "+n.name+"\nKnown: ["+se(r)+"]\nNamespace: "+e.getOr("none")+"\nSpec: "+JSON.stringify(n,null,2))}),(function(e){return e.replace()}))}(e,0,n,r):Rf.single(!1,h(n))},Pf=function(e,t,n,r){return Bf(e,0,n,r).fold((function(o,i){var a=zf(n)?i(t,n.config,n.validated):i(t),u=be(a,"components").getOr([]),c=J(u,(function(n){return Pf(e,t,n,r)}));return[T(T({},a),{components:c})]}),(function(e,r){if(zf(n)){var o=r(t,n.config,n.validated);return n.validated.preprocess.getOr(v)(o)}return r(t)}))},If=function(e,t,n,r){var o=de(r,(function(e,t){return r=e,o=!1,{name:h(n=t),required:function(){return r.fold((function(e,t){return e}),(function(e,t){return e}))},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(e,t,n,r){return J(n,(function(n){return Pf(e,t,n,r)}))}(e,t,n,o);return fe(o,(function(n){if(!1===n.used()&&n.required())throw new Error("Placeholder: "+n.name()+" was not found in components list\nNamespace: "+e.getOr("none")+"\nComponents: "+JSON.stringify(t.components,null,2))})),i},Ff=Rf.single,Lf=Rf.multiple,Hf=h(Nf),Vf=xo([{required:["data"]},{external:["data"]},{optional:["data"]},{group:["data"]}]),jf=lo("factory",{sketch:v}),Uf=lo("schema",[]),Wf=Kr("name"),$f=$r("pname","pname",cr((function(e){return"<alloy."+ra(e.name)+">"})),Er()),qf=qr("schema",(function(){return[ro("preprocess")]})),Gf=lo("defaults",h({})),Kf=lo("overrides",h({})),Xf=Sr([jf,Uf,Wf,$f,Gf,Kf]),Yf=Sr([jf,Uf,Wf,Gf,Kf]),Jf=Sr([jf,Uf,Wf,$f,Gf,Kf]),Zf=Sr([jf,qf,Wf,Kr("unit"),$f,Gf,Kf]),Qf=function(e){return e.fold(R.some,R.none,R.some,R.some)},ed=function(e){var t=function(e){return e.name};return e.fold(t,t,t,t)},td=function(e,t){return function(n){var r=jr("Converting part type",t,n);return e(r)}},nd=td(Vf.required,Xf),rd=td(Vf.external,Yf),od=td(Vf.optional,Jf),id=td(Vf.group,Zf),ad=h("entirety"),ud=Object.freeze({__proto__:null,required:nd,external:rd,optional:od,group:id,asNamedPart:Qf,name:ed,asCommon:function(e){return e.fold(v,v,v,v)},original:ad}),cd=function(e,t,n,r){return ar(t.defaults(e,n,r),n,{uid:e.partUids[t.name]},t.overrides(e,n,r))},sd=function(e,t){var n={};return U(t,(function(t){Qf(t).each((function(t){var r=ld(e,t.pname);n[t.name]=function(n){var o=jr("Part: "+t.name+" in "+e,Sr(t.schema),n);return T(T({},r),{config:n,validated:o})}}))})),n},ld=function(e,t){return{uiType:Hf(),owner:e,name:t}},fd=function(e,t,n){return{uiType:Hf(),owner:e,name:t,config:n,validated:{}}},dd=function(e){return J(e,(function(e){return e.fold(R.none,R.some,R.none,R.none).map((function(e){return eo(e.name,e.schema.concat([Nu(ad())]))})).toArray()}))},md=function(e){return j(e,ed)},gd=function(e,t,n){return function(e,t,n){var r={},o={};return U(n,(function(e){e.fold((function(e){r[e.pname]=Ff(!0,(function(t,n,r){return e.factory.sketch(cd(t,e,n,r))}))}),(function(e){var n=t.parts[e.name];o[e.name]=h(e.factory.sketch(cd(t,e,n[ad()]),n))}),(function(e){r[e.pname]=Ff(!1,(function(t,n,r){return e.factory.sketch(cd(t,e,n,r))}))}),(function(e){r[e.pname]=Lf(!0,(function(t,n,r){var o=t[e.name];return j(o,(function(n){return e.factory.sketch(ar(e.defaults(t,n,r),n,e.overrides(t,n)))}))}))}))})),{internals:h(r),externals:h(o)}}(0,t,n)},pd=function(e,t,n){return If(R.some(e),t,t.components,n)},hd=function(e,t,n){var r=t.partUids[n];return e.getSystem().getByUid(r).toOptional()},vd=function(e,t,n){return hd(e,t,n).getOrDie("Could not find part: "+n)},bd=function(e,t,n){var r={},o=t.partUids,i=e.getSystem();return U(n,(function(e){r[e]=h(i.getByUid(o[e]))})),r},yd=function(e,t){var n=e.getSystem();return de(t.partUids,(function(e,t){return h(n.getByUid(e))}))},wd=function(e){return se(e.partUids)},xd=function(e,t,n){var r={},o=t.partUids,i=e.getSystem();return U(n,(function(e){r[e]=h(i.getByUid(o[e]).getOrDie())})),r},Cd=function(e,t){var n=md(t);return To(j(n,(function(t){return{key:t,value:e+"-"+t}})))},Sd=function(e){return $r("partUids","partUids",lr((function(t){return Cd(t.uid,e)})),Er())},kd=Object.freeze({__proto__:null,generate:sd,generateOne:fd,schemas:dd,names:md,substitutes:gd,components:pd,defaultUids:Cd,defaultUidsSchema:Sd,getAllParts:yd,getAllPartNames:wd,getPart:hd,getPartOrDie:vd,getParts:bd,getPartsOrDie:xd}),Td=function(e,t,n,r,o){var i=function(e,t){return(e.length>0?[eo("parts",e)]:[]).concat([Kr("uid"),lo("dom",{}),lo("components",[]),Nu("originalSpec"),lo("debug.sketcher",{})]).concat(t)}(r,o);return jr(e+" [SpecSchema]",Cr(i.concat(t)),n)},Od=function(e,t,n,r,o){var i=_d(o),a=dd(n),u=Sd(n),c=Td(e,t,i,a,[u]),s=gd(0,c,n);return r(c,pd(e,c,s.internals()),i,s.externals())},_d=function(e){return function(e){return ye(e,"uid")}(e)?e:T(T({},e),{uid:la("uid")})},Ed=Cr([Kr("name"),Kr("factory"),Kr("configFields"),lo("apis",{}),lo("extraApis",{})]),Ad=Cr([Kr("name"),Kr("factory"),Kr("configFields"),Kr("partFields"),lo("apis",{}),lo("extraApis",{})]),Dd=function(e){var t=jr("Sketcher for "+e.name,Ed,e),n=de(t.apis,ba),r=de(t.extraApis,(function(e,t){return pa(e,t)}));return T(T({name:t.name,configFields:t.configFields,sketch:function(e){return function(e,t,n,r){var o=_d(r);return n(Td(e,t,o,[],[]),o)}(t.name,t.configFields,t.factory,e)}},n),r)},Md=function(e){var t=jr("Sketcher for "+e.name,Ad,e),n=sd(t.name,t.partFields),r=de(t.apis,ba),o=de(t.extraApis,(function(e,t){return pa(e,t)}));return T(T({name:t.name,partFields:t.partFields,configFields:t.configFields,sketch:function(e){return Od(t.name,t.configFields,t.partFields,t.factory,e)},parts:n},r),o)},Nd=function(e){return"input"===Be(e)&&"radio"!==Wt(e,"type")||"textarea"===Be(e)},Rd=Object.freeze({__proto__:null,getCurrent:function(e,t,n){return t.find(e)}}),zd=[Kr("find")],Bd=Cc({fields:zd,name:"composing",apis:Rd}),Pd=["input","button","textarea","select"],Id=function(e,t,n){(t.disabled()?Ud:Wd)(e,t)},Fd=function(e,t){return!0===t.useNative&&F(Pd,Be(e.element))},Ld=function(e){Ut(e.element,"disabled","disabled")},Hd=function(e){Gt(e.element,"disabled")},Vd=function(e){Ut(e.element,"aria-disabled","true")},jd=function(e){Ut(e.element,"aria-disabled","false")},Ud=function(e,t,n){t.disableClass.each((function(t){Pa(e.element,t)})),(Fd(e,t)?Ld:Vd)(e),t.onDisabled(e)},Wd=function(e,t,n){t.disableClass.each((function(t){Fa(e.element,t)})),(Fd(e,t)?Hd:jd)(e),t.onEnabled(e)},$d=function(e,t){return Fd(e,t)?function(e){return qt(e.element,"disabled")}(e):function(e){return"true"===Wt(e.element,"aria-disabled")}(e)},qd=Object.freeze({__proto__:null,enable:Wd,disable:Ud,isDisabled:$d,onLoad:Id,set:function(e,t,n,r){(r?Ud:Wd)(e,t)}}),Gd=Object.freeze({__proto__:null,exhibit:function(e,t){return Ca({classes:t.disabled()?t.disableClass.toArray():[]})},events:function(e,t){return zi([Bi(ui(),(function(t,n){return $d(t,e)})),hc(e,t,Id)])}}),Kd=[vo("disabled",C),lo("useNative",!0),ro("disableClass"),_u("onDisabled"),_u("onEnabled")],Xd=Cc({fields:Kd,name:"disabling",active:Gd,apis:qd}),Yd=function(e,t,n,r){var o=rl(e.element,"."+t.highlightClass);U(o,(function(n){L(r,(function(e){return e.element===n}))||(Fa(n,t.highlightClass),e.getSystem().getByDom(n).each((function(n){t.onDehighlight(e,n),Ei(n,_i())})))}))},Jd=function(e,t,n,r){Yd(e,t,0,[r]),Zd(e,t,n,r)||(Pa(r.element,t.highlightClass),t.onHighlight(e,r),Ei(r,Oi()))},Zd=function(e,t,n,r){return La(r.element,t.highlightClass)},Qd=function(e,t,n,r){var o=rl(e.element,"."+t.itemClass);return R.from(o[r]).fold((function(){return Un.error(new Error("No element found with index "+r))}),e.getSystem().getByDom)},em=function(e,t,n){return su(e.element,"."+t.itemClass).bind((function(t){return e.getSystem().getByDom(t).toOptional()}))},tm=function(e,t,n){var r=rl(e.element,"."+t.itemClass);return(r.length>0?R.some(r[r.length-1]):R.none()).bind((function(t){return e.getSystem().getByDom(t).toOptional()}))},nm=function(e,t,n,r){var o=rl(e.element,"."+t.itemClass),i=X(o,(function(e){return La(e,t.highlightClass)}));return i.bind((function(t){var n=Wu(t,r,0,o.length-1);return e.getSystem().getByDom(o[n]).toOptional()}))},rm=function(e,t,n){var r=rl(e.element,"."+t.itemClass);return Ce(j(r,(function(t){return e.getSystem().getByDom(t).toOptional()})))},om=Object.freeze({__proto__:null,dehighlightAll:function(e,t,n){return Yd(e,t,0,[])},dehighlight:function(e,t,n,r){Zd(e,t,n,r)&&(Fa(r.element,t.highlightClass),t.onDehighlight(e,r),Ei(r,_i()))},highlight:Jd,highlightFirst:function(e,t,n){em(e,t).each((function(r){Jd(e,t,n,r)}))},highlightLast:function(e,t,n){tm(e,t).each((function(r){Jd(e,t,n,r)}))},highlightAt:function(e,t,n,r){Qd(e,t,n,r).fold((function(e){throw e}),(function(r){Jd(e,t,n,r)}))},highlightBy:function(e,t,n,r){var o=rm(e,t);K(o,r).each((function(r){Jd(e,t,n,r)}))},isHighlighted:Zd,getHighlighted:function(e,t,n){return su(e.element,"."+t.highlightClass).bind((function(t){return e.getSystem().getByDom(t).toOptional()}))},getFirst:em,getLast:tm,getPrevious:function(e,t,n){return nm(e,t,0,-1)},getNext:function(e,t,n){return nm(e,t,0,1)},getCandidates:rm}),im=[Kr("highlightClass"),Kr("itemClass"),_u("onHighlight"),_u("onDehighlight")],am=Cc({fields:im,name:"highlighting",apis:om}),um=[8],cm=[9],sm=[13],lm=[27],fm=[32],dm=[37],mm=[38],gm=[39],pm=[40],hm=function(e,t,n){var r=Q(e.slice(0,t)),o=Q(e.slice(t+1));return K(r.concat(o),n)},vm=function(e,t,n){var r=Q(e.slice(0,t));return K(r,n)},bm=function(e,t,n){var r=e.slice(0,t),o=e.slice(t+1);return K(o.concat(r),n)},ym=function(e,t,n){var r=e.slice(t+1);return K(r,n)},wm=function(e){return function(t){var n=t.raw;return F(e,n.which)}},xm=function(e){return function(t){return Z(e,(function(e){return e(t)}))}},Cm=function(e){return!0===e.raw.shiftKey},Sm=function(e){return!0===e.raw.ctrlKey},km=w(Cm),Tm=function(e,t){return{matches:e,classification:t}},Om=function(e,t,n){t.exists((function(e){return n.exists((function(t){return bt(t,e)}))}))||Ai(e,Ci(),{prevFocus:t,newFocus:n})},_m=function(){var e=function(e){return Nc(e.element)};return{get:e,set:function(t,n){var r=e(t);t.getSystem().triggerFocus(n,t.element);var o=e(t);Om(t,r,o)}}},Em=function(){var e=function(e){return am.getHighlighted(e).map((function(e){return e.element}))};return{get:e,set:function(t,n){var r=e(t);t.getSystem().getByDom(n).fold(g,(function(e){am.highlight(t,e)}));var o=e(t);Om(t,r,o)}}};!function(e){e.OnFocusMode="onFocus",e.OnEnterOrSpaceMode="onEnterOrSpace",e.OnApiMode="onApi"}(Js||(Js={}));var Am,Dm=function(e,t,n,r,o){var i=function(e,t,n,r,o){var i,a,u,c=n(e,t,r,o);return(i=c,a=t.event,u=K(i,(function(e){return e.matches(a)})),u.map((function(e){return e.classification}))).bind((function(n){return n(e,t,r,o)}))},a={schema:function(){return e.concat([lo("focusManager",_m()),fo("focusInside","onFocus",Fr((function(e){return F(["onFocus","onEnterOrSpace","onApi"],e)?Un.value(e):Un.error("Invalid value for focusInside")}))),Mu("handler",a),Mu("state",t),Mu("sendFocusIn",o)])},processKey:i,toEvents:function(e,t){var a=e.focusInside!==Js.OnFocusMode?R.none():o(e).map((function(n){return Ii(ri(),(function(r,o){n(r,e,t),o.stop()}))})),u=[Ii(qo(),(function(r,a){i(r,a,n,e,t).fold((function(){!function(n,r){var i=wm(fm.concat(sm))(r.event);e.focusInside===Js.OnEnterOrSpaceMode&&i&&Do(n,r)&&o(e).each((function(o){o(n,e,t),r.stop()}))}(r,a)}),(function(e){a.stop()}))})),Ii(Go(),(function(n,o){i(n,o,r,e,t).each((function(e){o.stop()}))}))];return zi(a.toArray().concat(u))}};return a},Mm=function(e){var t=[ro("onEscape"),ro("onEnter"),lo("selector",'[data-alloy-tabstop="true"]:not(:disabled)'),lo("firstTabstop",0),lo("useTabstopAt",S),ro("visibilitySelector")].concat([e]),n=function(e,t){var n=e.visibilitySelector.bind((function(e){return lu(t,e)})).getOr(t);return sn(n)>0},r=function(e,t,r){(function(e,t){var r=rl(e.element,t.selector),o=$(r,(function(e){return n(t,e)}));return R.from(o[t.firstTabstop])})(e,t).each((function(n){t.focusManager.set(e,n)}))},o=function(e,t,r,o,i){return i(t,r,(function(e){return function(e,t){return n(e,t)&&e.useTabstopAt(t)}(o,e)})).fold((function(){return o.cyclic?R.some(!0):R.none()}),(function(t){return o.focusManager.set(e,t),R.some(!0)}))},i=function(e,t,n,r){var i=rl(e.element,n.selector);return function(e,t){return t.focusManager.get(e).bind((function(e){return lu(e,t.selector)}))}(e,n).bind((function(t){return X(i,y(bt,t)).bind((function(t){return o(e,i,t,n,r)}))}))},a=h([Tm(xm([Cm,wm(cm)]),(function(e,t,n){var r=n.cyclic?hm:vm;return i(e,0,n,r)})),Tm(wm(cm),(function(e,t,n){var r=n.cyclic?bm:ym;return i(e,0,n,r)})),Tm(wm(lm),(function(e,t,n){return n.onEscape.bind((function(n){return n(e,t)}))})),Tm(xm([km,wm(sm)]),(function(e,t,n){return n.onEnter.bind((function(n){return n(e,t)}))}))]),u=h([]);return Dm(t,ya.init,a,u,(function(){return R.some(r)}))},Nm=Mm(qr("cyclic",C)),Rm=Mm(qr("cyclic",S)),zm=function(e,t,n){return Nd(n)&&wm(fm)(t.event)?R.none():function(e,t,n){return Mi(e,n,ui()),R.some(!0)}(e,0,n)},Bm=function(e,t){return R.some(!0)},Pm=[lo("execute",zm),lo("useSpace",!1),lo("useEnter",!0),lo("useControlEnter",!1),lo("useDown",!1)],Im=function(e,t,n){return n.execute(e,t,e.element)},Fm=Dm(Pm,ya.init,(function(e,t,n,r){var o=n.useSpace&&!Nd(e.element)?fm:[],i=n.useEnter?sm:[],a=n.useDown?pm:[],u=o.concat(i).concat(a);return[Tm(wm(u),Im)].concat(n.useControlEnter?[Tm(xm([Sm,wm(sm)]),Im)]:[])}),(function(e,t,n,r){return n.useSpace&&!Nd(e.element)?[Tm(wm(fm),Bm)]:[]}),(function(){return R.none()})),Lm=function(){var e=Zc();return wa({readState:function(){return e.get().map((function(e){return{numRows:String(e.numRows),numColumns:String(e.numColumns)}})).getOr({numRows:"?",numColumns:"?"})},setGridSize:function(t,n){e.set({numRows:t,numColumns:n})},getNumRows:function(){return e.get().map((function(e){return e.numRows}))},getNumColumns:function(){return e.get().map((function(e){return e.numColumns}))}})},Hm=Object.freeze({__proto__:null,flatgrid:Lm,init:function(e){return e.state(e)}}),Vm=function(e){return function(t,n,r,o){var i=e(t.element);return $m(i,t,n,r,o)}},jm=function(e,t){var n=ws(e,t);return Vm(n)},Um=function(e,t){var n=ws(t,e);return Vm(n)},Wm=function(e){return function(t,n,r,o){return $m(e,t,n,r,o)}},$m=function(e,t,n,r,o){return r.focusManager.get(t).bind((function(n){return e(t.element,n,r,o)})).map((function(e){return r.focusManager.set(t,e),!0}))},qm=Wm,Gm=Wm,Km=Wm,Xm=function(e){return!function(e){return e.offsetWidth<=0&&e.offsetHeight<=0}(e.dom)},Ym=function(e,t,n){var r=rl(e,n);return function(e,t){return X(e,t).map((function(t){return{index:t,candidates:e}}))}($(r,Xm),(function(e){return bt(e,t)}))},Jm=function(e,t){return X(e,(function(e){return bt(t,e)}))},Zm=function(e,t,n,r){return r(Math.floor(t/n),t%n).bind((function(t){var r=t.row*n+t.column;return r>=0&&r<e.length?R.some(e[r]):R.none()}))},Qm=function(e,t,n,r,o){return Zm(e,t,r,(function(t,i){var a=t===n-1?e.length-t*r:r,u=Wu(i,o,0,a-1);return R.some({row:t,column:u})}))},eg=function(e,t,n,r,o){return Zm(e,t,r,(function(t,i){var a=Wu(t,o,0,n-1),u=a===n-1?e.length-a*r:r,c=$u(i,0,u-1);return R.some({row:a,column:c})}))},tg=[Kr("selector"),lo("execute",zm),Eu("onEscape"),lo("captureTab",!1),Ru()],ng=function(e,t,n){su(e.element,t.selector).each((function(n){t.focusManager.set(e,n)}))},rg=function(e){return function(t,n,r,o){return Ym(t,n,r.selector).bind((function(t){return e(t.candidates,t.index,o.getNumRows().getOr(r.initSize.numRows),o.getNumColumns().getOr(r.initSize.numColumns))}))}},og=function(e,t,n){return n.captureTab?R.some(!0):R.none()},ig=rg((function(e,t,n,r){return Qm(e,t,n,r,-1)})),ag=rg((function(e,t,n,r){return Qm(e,t,n,r,1)})),ug=rg((function(e,t,n,r){return eg(e,t,n,r,-1)})),cg=rg((function(e,t,n,r){return eg(e,t,n,r,1)})),sg=h([Tm(wm(dm),jm(ig,ag)),Tm(wm(gm),Um(ig,ag)),Tm(wm(mm),qm(ug)),Tm(wm(pm),Gm(cg)),Tm(xm([Cm,wm(cm)]),og),Tm(xm([km,wm(cm)]),og),Tm(wm(lm),(function(e,t,n){return n.onEscape(e,t)})),Tm(wm(fm.concat(sm)),(function(e,t,n,r){return function(e,t){return t.focusManager.get(e).bind((function(e){return lu(e,t.selector)}))}(e,n).bind((function(r){return n.execute(e,t,r)}))}))]),lg=h([Tm(wm(fm),Bm)]),fg=Dm(tg,Lm,sg,lg,(function(){return R.some(ng)})),dg=function(e,t,n,r){var o=function(e,t,n){var i,a=Wu(t,r,0,n.length-1);return a===e?R.none():(i=n[a],"button"===Be(i)&&"disabled"===Wt(i,"disabled")?o(e,a,n):R.from(n[a]))};return Ym(e,n,t).bind((function(e){var t=e.index,n=e.candidates;return o(t,t,n)}))},mg=[Kr("selector"),lo("getInitial",R.none),lo("execute",zm),Eu("onEscape"),lo("executeOnMove",!1),lo("allowVertical",!0)],gg=function(e,t,n){return function(e,t){return t.focusManager.get(e).bind((function(e){return lu(e,t.selector)}))}(e,n).bind((function(r){return n.execute(e,t,r)}))},pg=function(e,t,n){t.getInitial(e).orThunk((function(){return su(e.element,t.selector)})).each((function(n){t.focusManager.set(e,n)}))},hg=function(e,t,n){return dg(e,n.selector,t,-1)},vg=function(e,t,n){return dg(e,n.selector,t,1)},bg=function(e){return function(t,n,r,o){return e(t,n,r,o).bind((function(){return r.executeOnMove?gg(t,n,r):R.some(!0)}))}},yg=function(e,t,n){return n.onEscape(e,t)},wg=h([Tm(wm(fm),Bm)]),xg=Dm(mg,ya.init,(function(e,t,n,r){var o=dm.concat(n.allowVertical?mm:[]),i=gm.concat(n.allowVertical?pm:[]);return[Tm(wm(o),bg(jm(hg,vg))),Tm(wm(i),bg(Um(hg,vg))),Tm(wm(sm),gg),Tm(wm(fm),gg),Tm(wm(lm),yg)]}),wg,(function(){return R.some(pg)})),Cg=function(e,t,n){return R.from(e[t]).bind((function(e){return R.from(e[n]).map((function(e){return{rowIndex:t,columnIndex:n,cell:e}}))}))},Sg=function(e,t,n,r){var o=e[t].length,i=Wu(n,r,0,o-1);return Cg(e,t,i)},kg=function(e,t,n,r){var o=Wu(n,r,0,e.length-1),i=e[o].length,a=$u(t,0,i-1);return Cg(e,o,a)},Tg=function(e,t,n,r){var o=e[t].length,i=$u(n+r,0,o-1);return Cg(e,t,i)},Og=function(e,t,n,r){var o=$u(n+r,0,e.length-1),i=e[o].length,a=$u(t,0,i-1);return Cg(e,o,a)},_g=[eo("selectors",[Kr("row"),Kr("cell")]),lo("cycles",!0),lo("previousSelector",R.none),lo("execute",zm)],Eg=function(e,t,n){t.previousSelector(e).orThunk((function(){var n=t.selectors;return su(e.element,n.cell)})).each((function(n){t.focusManager.set(e,n)}))},Ag=function(e,t){return function(n,r,o){var i=o.cycles?e:t;return lu(r,o.selectors.row).bind((function(e){var t=rl(e,o.selectors.cell);return Jm(t,r).bind((function(t){var r=rl(n,o.selectors.row);return Jm(r,e).bind((function(e){var n=function(e,t){return j(e,(function(e){return rl(e,t.selectors.cell)}))}(r,o);return i(n,e,t).map((function(e){return e.cell}))}))}))}))}},Dg=Ag((function(e,t,n){return Sg(e,t,n,-1)}),(function(e,t,n){return Tg(e,t,n,-1)})),Mg=Ag((function(e,t,n){return Sg(e,t,n,1)}),(function(e,t,n){return Tg(e,t,n,1)})),Ng=Ag((function(e,t,n){return kg(e,n,t,-1)}),(function(e,t,n){return Og(e,n,t,-1)})),Rg=Ag((function(e,t,n){return kg(e,n,t,1)}),(function(e,t,n){return Og(e,n,t,1)})),zg=h([Tm(wm(dm),jm(Dg,Mg)),Tm(wm(gm),Um(Dg,Mg)),Tm(wm(mm),qm(Ng)),Tm(wm(pm),Gm(Rg)),Tm(wm(fm.concat(sm)),(function(e,t,n){return Nc(e.element).bind((function(r){return n.execute(e,t,r)}))}))]),Bg=h([Tm(wm(fm),Bm)]),Pg=Dm(_g,ya.init,zg,Bg,(function(){return R.some(Eg)})),Ig=[Kr("selector"),lo("execute",zm),lo("moveOnTab",!1)],Fg=function(e,t,n){return n.focusManager.get(e).bind((function(r){return n.execute(e,t,r)}))},Lg=function(e,t,n){su(e.element,t.selector).each((function(n){t.focusManager.set(e,n)}))},Hg=function(e,t,n){return dg(e,n.selector,t,-1)},Vg=function(e,t,n){return dg(e,n.selector,t,1)},jg=h([Tm(wm(mm),Km(Hg)),Tm(wm(pm),Km(Vg)),Tm(xm([Cm,wm(cm)]),(function(e,t,n,r){return n.moveOnTab?Km(Hg)(e,t,n,r):R.none()})),Tm(xm([km,wm(cm)]),(function(e,t,n,r){return n.moveOnTab?Km(Vg)(e,t,n,r):R.none()})),Tm(wm(sm),Fg),Tm(wm(fm),Fg)]),Ug=h([Tm(wm(fm),Bm)]),Wg=Dm(Ig,ya.init,jg,Ug,(function(){return R.some(Lg)})),$g=[Eu("onSpace"),Eu("onEnter"),Eu("onShiftEnter"),Eu("onLeft"),Eu("onRight"),Eu("onTab"),Eu("onShiftTab"),Eu("onUp"),Eu("onDown"),Eu("onEscape"),lo("stopSpaceKeyup",!1),ro("focusIn")],qg=Dm($g,ya.init,(function(e,t,n){return[Tm(wm(fm),n.onSpace),Tm(xm([km,wm(sm)]),n.onEnter),Tm(xm([Cm,wm(sm)]),n.onShiftEnter),Tm(xm([Cm,wm(cm)]),n.onShiftTab),Tm(xm([km,wm(cm)]),n.onTab),Tm(wm(mm),n.onUp),Tm(wm(pm),n.onDown),Tm(wm(dm),n.onLeft),Tm(wm(gm),n.onRight),Tm(wm(fm),n.onSpace),Tm(wm(lm),n.onEscape)]}),(function(e,t,n){return n.stopSpaceKeyup?[Tm(wm(fm),Bm)]:[]}),(function(e){return e.focusIn})),Gg=Nm.schema(),Kg=Rm.schema(),Xg=xg.schema(),Yg=fg.schema(),Jg=Pg.schema(),Zg=Fm.schema(),Qg=Wg.schema(),ep=qg.schema(),tp=kc({branchKey:"mode",branches:Object.freeze({__proto__:null,acyclic:Gg,cyclic:Kg,flow:Xg,flatgrid:Yg,matrix:Jg,execution:Zg,menu:Qg,special:ep}),name:"keying",active:{events:function(e,t){return e.handler.toEvents(e,t)}},apis:{focusIn:function(e,t,n){t.sendFocusIn(t).fold((function(){e.getSystem().triggerFocus(e.element,e.element)}),(function(r){r(e,t,n)}))},setGridSize:function(e,t,n,r,o){!function(e){return we(e,"setGridSize")}(n)?console.error("Layout does not support setGridSize"):n.setGridSize(r,o)}},state:Hm}),np=function(e,t,n,r){var o=e.getSystem().build(r);jl(e,o,n)},rp=function(e,t,n,r){var o=op(e),i=K(o,(function(e){return bt(r.element,e.element)}));i.each(Wl)},op=function(e,t){return e.components()},ip=function(e,t,n,r,o){var i=op(e);return R.from(i[r]).map((function(t){return rp(e,0,0,t),o.each((function(t){np(e,0,(function(e,t){!function(e,t,n){Et(e,n).fold((function(){Tn(e,t)}),(function(e){Cn(e,t)}))}(e,t,r)}),t)})),t}))},ap=Object.freeze({__proto__:null,append:function(e,t,n,r){np(e,0,Tn,r)},prepend:function(e,t,n,r){np(e,0,kn,r)},remove:rp,replaceAt:ip,replaceBy:function(e,t,n,r,o){var i=op(e);return X(i,r).bind((function(t){return ip(e,0,0,t,o)}))},set:function(e,t,n,r){Rc((function(){var t=j(r,e.getSystem().build);Hl(e,t)}),e.element)},contents:op}),up=Cc({fields:[],name:"replacing",apis:ap}),cp=function(e,t){var n=function(e,t){var n=zi(t);return Cc({fields:[Kr("enabled")],name:e,active:{events:h(n)}})}(e,t);return{key:e,value:{config:{},me:n,configAsRaw:h({}),initialConfig:{},state:ya}}},sp=function(e,t){t.ignore||(Ac(e.element),t.onFocus(e))},lp=Object.freeze({__proto__:null,focus:sp,blur:function(e,t){t.ignore||function(e){e.dom.blur()}(e.element)},isFocused:function(e){return Dc(e.element)}}),fp=Object.freeze({__proto__:null,exhibit:function(e,t){var n=t.ignore?{}:{attributes:{tabindex:"-1"}};return Ca(n)},events:function(e){return zi([Ii(ri(),(function(t,n){sp(t,e),n.stop()}))].concat(e.stopMousedown?[Ii(Lo(),(function(e,t){t.event.prevent()}))]:[]))}}),dp=[_u("onFocus"),lo("stopMousedown",!1),lo("ignore",!1)],mp=Cc({fields:dp,name:"focusing",active:fp,apis:lp}),gp=function(e,t,n){var r=t.aria;r.update(e,r,n.get())},pp=function(e,t,n){t.toggleClass.each((function(t){n.get()?Pa(e.element,t):Fa(e.element,t)}))},hp=function(e,t,n){yp(e,t,n,!n.get())},vp=function(e,t,n){n.set(!0),pp(e,t,n),gp(e,t,n)},bp=function(e,t,n){n.set(!1),pp(e,t,n),gp(e,t,n)},yp=function(e,t,n,r){(r?vp:bp)(e,t,n)},wp=function(e,t,n){yp(e,t,n,t.selected)},xp=Object.freeze({__proto__:null,onLoad:wp,toggle:hp,isOn:function(e,t,n){return n.get()},on:vp,off:bp,set:yp}),Cp=Object.freeze({__proto__:null,exhibit:function(){return Ca({})},events:function(e,t){var n,r,o,i=(n=e,r=t,o=hp,Ki((function(e){o(e,n,r)}))),a=hc(e,t,wp);return zi(Y([e.toggleOnExecute?[i]:[],[a]]))}}),Sp=function(e,t,n){Ut(e.element,"aria-expanded",n)},kp=[lo("selected",!1),ro("toggleClass"),lo("toggleOnExecute",!0),fo("aria",{mode:"none"},Wr("mode",{pressed:[lo("syncWithExpanded",!1),Mu("update",(function(e,t,n){Ut(e.element,"aria-pressed",n),t.syncWithExpanded&&Sp(e,t,n)}))],checked:[Mu("update",(function(e,t,n){Ut(e.element,"aria-checked",n)}))],expanded:[Mu("update",Sp)],selected:[Mu("update",(function(e,t,n){Ut(e.element,"aria-selected",n)}))],none:[Mu("update",g)]}))],Tp=Cc({fields:kp,name:"toggling",active:Cp,apis:xp,state:(Am=!1,{init:function(){var e=wo(Am);return{get:function(){return e.get()},set:function(t){return e.set(t)},clear:function(){return e.set(Am)},readState:function(){return e.get()}}}})}),Op=function(){var e=function(e,t){t.stop(),Di(e)};return[Ii(Yo(),e),Ii(si(),e),ji(Bo()),ji(Lo())]},_p=function(e){return zi(Y([e.map((function(e){return Ki((function(t,n){e(t),n.stop()}))})).toArray(),Op()]))},Ep="alloy.item-hover",Ap="alloy.item-focus",Dp=function(e){(Nc(e.element).isNone()||mp.isFocused(e))&&(mp.isFocused(e)||mp.focus(e),Ai(e,Ep,{item:e}))},Mp=function(e){Ai(e,Ap,{item:e})},Np=h(Ep),Rp=h(Ap),zp=[Kr("data"),Kr("components"),Kr("dom"),lo("hasSubmenu",!1),ro("toggling"),Df("itemBehaviours",[Tp,mp,tp,Of]),lo("ignoreFocus",!1),lo("domModification",{}),Mu("builder",(function(e){return{dom:e.dom,domModification:T(T({},e.domModification),{attributes:T(T(T({role:e.toggling.isSome()?"menuitemcheckbox":"menuitem"},e.domModification.attributes),{"aria-haspopup":e.hasSubmenu}),e.hasSubmenu?{"aria-expanded":!1}:{})}),behaviours:Mf(e.itemBehaviours,[e.toggling.fold(Tp.revoke,(function(e){return Tp.config(T({aria:{mode:"checked"}},e))})),mp.config({ignore:e.ignoreFocus,stopMousedown:e.ignoreFocus,onFocus:function(e){Mp(e)}}),tp.config({mode:"execution"}),Of.config({store:{mode:"memory",initialValue:e.data}}),cp("item-type-events",_(_([],Op(),!0),[Ii(Uo(),Dp),Ii(ci(),mp.focus)],!1))]),components:e.components,eventOrder:e.eventOrder}})),lo("eventOrder",{})],Bp=[Kr("dom"),Kr("components"),Mu("builder",(function(e){return{dom:e.dom,components:e.components,events:zi([Ui(ci())])}}))],Pp=h("item-widget"),Ip=h([nd({name:"widget",overrides:function(e){return{behaviours:wc([Of.config({store:{mode:"manual",getValue:function(t){return e.data},setValue:g}})])}}})]),Fp=[Kr("uid"),Kr("data"),Kr("components"),Kr("dom"),lo("autofocus",!1),lo("ignoreFocus",!1),Df("widgetBehaviours",[Of,mp,tp]),lo("domModification",{}),Sd(Ip()),Mu("builder",(function(e){var t=gd(Pp(),e,Ip()),n=pd(Pp(),e,t.internals()),r=function(t){return hd(t,e,"widget").map((function(e){return tp.focusIn(e),e}))},o=function(t,n){return Nd(n.event.target)?R.none():e.autofocus?(n.setSource(t.element),R.none()):R.none()};return{dom:e.dom,components:n,domModification:e.domModification,events:zi([Ki((function(e,t){r(e).each((function(e){t.stop()}))})),Ii(Uo(),Dp),Ii(ci(),(function(t,n){e.autofocus?r(t):mp.focus(t)}))]),behaviours:Mf(e.widgetBehaviours,[Of.config({store:{mode:"memory",initialValue:e.data}}),mp.config({ignore:e.ignoreFocus,onFocus:function(e){Mp(e)}}),tp.config({mode:"special",focusIn:e.autofocus?function(e){r(e)}:Tc(),onLeft:o,onRight:o,onEscape:function(t,n){return mp.isFocused(t)||e.autofocus?e.autofocus?(n.setSource(t.element),R.none()):R.none():(mp.focus(t),R.some(!0))}})])}}))],Lp=Wr("type",{widget:Fp,item:zp,separator:Bp}),Hp=h([id({factory:{sketch:function(e){var t=jr("menu.spec item",Lp,e);return t.builder(t)}},name:"items",unit:"item",defaults:function(e,t){return ye(t,"uid")?t:T(T({},t),{uid:la("item")})},overrides:function(e,t){return{type:t.type,ignoreFocus:e.fakeFocus,domModification:{classes:[e.markers.item]}}}})]),Vp=h([Kr("value"),Kr("items"),Kr("dom"),Kr("components"),lo("eventOrder",{}),_f("menuBehaviours",[am,Of,Bd,tp]),fo("movement",{mode:"menu",moveOnTab:!0},Wr("mode",{grid:[Ru(),Mu("config",(function(e,t){return{mode:"flatgrid",selector:"."+e.markers.item,initSize:{numColumns:t.initSize.numColumns,numRows:t.initSize.numRows},focusManager:e.focusManager}}))],matrix:[Mu("config",(function(e,t){return{mode:"matrix",selectors:{row:t.rowSelector,cell:"."+e.markers.item},focusManager:e.focusManager}})),Kr("rowSelector")],menu:[lo("moveOnTab",!0),Mu("config",(function(e,t){return{mode:"menu",selector:"."+e.markers.item,moveOnTab:t.moveOnTab,focusManager:e.focusManager}}))]})),Xr("markers",Cu()),lo("fakeFocus",!1),lo("focusManager",_m()),_u("onHighlight")]),jp=h("alloy.menu-focus"),Up=Md({name:"Menu",configFields:Vp(),partFields:Hp(),factory:function(e,t,n,r){return{uid:e.uid,dom:e.dom,markers:e.markers,behaviours:Af(e.menuBehaviours,[am.config({highlightClass:e.markers.selectedItem,itemClass:e.markers.item,onHighlight:e.onHighlight}),Of.config({store:{mode:"memory",initialValue:e.value}}),Bd.config({find:R.some}),tp.config(e.movement.config(e,e.movement))]),events:zi([Ii(Rp(),(function(e,t){var n=t.event;e.getSystem().getByDom(n.target).each((function(n){am.highlight(e,n),t.stop(),Ai(e,jp(),{menu:e,item:n})}))})),Ii(Np(),(function(e,t){var n=t.event.item;am.highlight(e,n)}))]),components:t,eventOrder:e.eventOrder,domModification:{attributes:{role:"menu"}}}}}),Wp=function(e,t,n,r){return be(n,r).bind((function(r){return be(e,r).bind((function(r){var o=Wp(e,t,n,r);return R.some([r].concat(o))}))})).getOr([])},$p=function(e,t){var n={};fe(e,(function(e,t){U(e,(function(e){n[e]=t}))}));var r=t,o=me(t,(function(e,t){return{k:e,v:t}})),i=de(o,(function(e,t){return[t].concat(Wp(n,r,o,t))}));return de(n,(function(e){return be(i,e).getOr([e])}))},qp=function(e){return"prepared"===e.type?R.some(e.menu):R.none()},Gp={init:function(){var e=wo({}),t=wo({}),n=wo({}),r=Zc(),o=wo({}),i=function(t,n,r){return a(t).bind((function(o){return function(t){return he(e.get(),(function(e,n){return e===t}))}(t).bind((function(e){return n(e).map((function(e){return{triggeredMenu:o,triggeringItem:e,triggeringPath:r}}))}))}))},a=function(e){return u(e).bind(qp)},u=function(e){return be(t.get(),e)},c=function(t){return be(e.get(),t)};return{setMenuBuilt:function(e,n){var r;t.set(T(T({},t.get()),((r={})[e]={type:"prepared",menu:n},r)))},setContents:function(i,a,u,c){r.set(i),e.set(u),t.set(a),o.set(c);var s=$p(c,u);n.set(s)},expand:function(t){return be(e.get(),t).map((function(e){var r=be(n.get(),t).getOr([]);return[e].concat(r)}))},refresh:function(e){return be(n.get(),e)},collapse:function(e){return be(n.get(),e).bind((function(e){return e.length>1?R.some(e.slice(1)):R.none()}))},lookupMenu:u,lookupItem:c,otherMenus:function(e){var t=o.get();return ee(se(t),e)},getPrimary:function(){return r.get().bind(a)},getMenus:function(){return t.get()},clear:function(){e.set({}),t.set({}),n.set({}),r.clear()},isClear:function(){return r.get().isNone()},getTriggeringPath:function(e,t){var o=$(c(e).toArray(),(function(e){return a(e).isSome()}));return be(n.get(),e).bind((function(e){var n=Q(o.concat(e));return function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];if(!r.isSome())return R.none();t.push(r.getOrDie())}return R.some(t)}(J(n,(function(e,o){return i(e,t,n.slice(0,o+1)).fold((function(){return xe(r.get(),e)?[]:[R.none()]}),(function(e){return[R.some(e)]}))})))}))}}},extractPreparedMenu:qp},Kp=h("collapse-item"),Xp=Dd({name:"TieredMenu",configFields:[Du("onExecute"),Du("onEscape"),Au("onOpenMenu"),Au("onOpenSubmenu"),_u("onRepositionMenu"),_u("onCollapseMenu"),lo("highlightImmediately",!0),eo("data",[Kr("primary"),Kr("menus"),Kr("expansions")]),lo("fakeFocus",!1),_u("onHighlight"),_u("onHover"),ku(),Kr("dom"),lo("navigateOnHover",!0),lo("stayInDom",!1),_f("tmenuBehaviours",[tp,am,Bd,up]),lo("eventOrder",{})],apis:{collapseMenu:function(e,t){e.collapseMenu(t)},highlightPrimary:function(e,t){e.highlightPrimary(t)},repositionMenus:function(e,t){e.repositionMenus(t)}},factory:function(e,t){var n,r=Zc(),o=Gp.init(),i=function(t){var n=function(t,n,r){return de(r,(function(r,o){var i=function(){return Up.sketch(T(T({},r),{value:o,markers:e.markers,fakeFocus:e.fakeFocus,onHighlight:e.onHighlight,focusManager:e.fakeFocus?Em():_m()}))};return o===n?{type:"prepared",menu:t.getSystem().build(i())}:{type:"notbuilt",nbMenu:i}}))}(t,e.data.primary,e.data.menus),r=u();return o.setContents(e.data.primary,n,e.data.expansions,r),o.getPrimary()},a=function(e){return Of.getValue(e).value},u=function(t){return de(e.data.menus,(function(e,t){return J(e.items,(function(e){return"separator"===e.type?[]:[e.data.value]}))}))},c=function(e,t){am.highlight(e,t),am.getHighlighted(t).orThunk((function(){return am.getFirst(t)})).each((function(t){Mi(e,t.element,ci())}))},s=function(e,t){return Ce(j(t,(function(t){return e.lookupMenu(t).bind((function(e){return"prepared"===e.type?R.some(e.menu):R.none()}))})))},l=function(t,n,r){var o=s(n,n.otherMenus(r));U(o,(function(n){Va(n.element,[e.markers.backgroundMenu]),e.stayInDom||up.remove(t,n)}))},f=function(t,n){var o=function(t){return r.get().getOrThunk((function(){var n={},o=rl(t.element,"."+e.markers.item),i=$(o,(function(e){return"true"===Wt(e,"aria-haspopup")}));return U(i,(function(e){t.getSystem().getByDom(e).each((function(e){var t=a(e);n[t]=e}))})),r.set(n),n}))}(t);fe(o,(function(e,t){var r=F(n,t);Ut(e.element,"aria-expanded",r)}))},d=function(t,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,a=s(n,r.slice(1));return U(a,(function(t){Pa(t.element,e.markers.backgroundMenu)})),Lt(i.element)||up.append(t,tu(i)),Va(i.element,[e.markers.backgroundMenu]),c(t,i),l(t,n,r),R.some(i)}))}))};!function(e){e[e.HighlightSubmenu=0]="HighlightSubmenu",e[e.HighlightParent=1]="HighlightParent"}(n||(n={}));var m=function(t,r,i){if(void 0===i&&(i=n.HighlightSubmenu),r.hasConfigured(Xd)&&Xd.isDisabled(r))return R.some(r);var u=a(r);return o.expand(u).bind((function(a){return f(t,a),R.from(a[0]).bind((function(u){return o.lookupMenu(u).bind((function(c){var s=function(e,t,n){if("notbuilt"===n.type){var r=e.getSystem().build(n.nbMenu());return o.setMenuBuilt(t,r),r}return n.menu}(t,u,c);return Lt(s.element)||up.append(t,tu(s)),e.onOpenSubmenu(t,r,s,Q(a)),i===n.HighlightSubmenu?(am.highlightFirst(s),d(t,o,a)):(am.dehighlightAll(s),R.some(r))}))}))}))},p=function(t,n){var r=a(n);return o.collapse(r).bind((function(r){return f(t,r),d(t,o,r).map((function(r){return e.onCollapseMenu(t,n,r),r}))}))},h=function(t){return function(n,r){return lu(r.getSource(),"."+e.markers.item).bind((function(e){return n.getSystem().getByDom(e).toOptional().bind((function(e){return t(n,e).map(S)}))}))}},v=zi([Ii(jp(),(function(e,t){var n=t.event.item;o.lookupItem(a(n)).each((function(){var n=t.event.menu;am.highlight(e,n);var r=a(t.event.item);o.refresh(r).each((function(t){return l(e,o,t)}))}))})),Ki((function(t,r){var o=r.event.target;t.getSystem().getByDom(o).each((function(r){0===a(r).indexOf("collapse-item")&&p(t,r),m(t,r,n.HighlightSubmenu).fold((function(){e.onExecute(t,r)}),g)}))})),$i((function(t,n){i(t).each((function(n){up.append(t,tu(n)),e.onOpenMenu(t,n),e.highlightImmediately&&c(t,n)}))}))].concat(e.navigateOnHover?[Ii(Np(),(function(t,r){var i=r.event.item;!function(e,t){var n=a(t);o.refresh(n).bind((function(t){return f(e,t),d(e,o,t)}))}(t,i),m(t,i,n.HighlightParent),e.onHover(t,i)}))]:[])),b=function(e){return am.getHighlighted(e).bind(am.getHighlighted)},y={collapseMenu:function(e){b(e).each((function(t){p(e,t)}))},highlightPrimary:function(e){o.getPrimary().each((function(t){c(e,t)}))},repositionMenus:function(t){var n=o.getPrimary().bind((function(e){return b(t).bind((function(e){var t=a(e),n=ve(o.getMenus()),r=Ce(j(n,Gp.extractPreparedMenu));return o.getTriggeringPath(t,(function(e){return function(e,t,n){return ce(t,(function(e){if(!e.getSystem().isConnected())return R.none();var t=am.getCandidates(e);return K(t,(function(e){return a(e)===n}))}))}(0,r,e)}))})).map((function(t){return{primary:e,triggeringPath:t}}))}));n.fold((function(){(function(e){return R.from(e.components()[0]).filter((function(e){return"menu"===Wt(e.element,"role")}))})(t).each((function(n){e.onRepositionMenu(t,n,[])}))}),(function(n){var r=n.primary,o=n.triggeringPath;e.onRepositionMenu(t,r,o)}))}};return{uid:e.uid,dom:e.dom,markers:e.markers,behaviours:Af(e.tmenuBehaviours,[tp.config({mode:"special",onRight:h((function(e,t){return Nd(t.element)?R.none():m(e,t,n.HighlightSubmenu)})),onLeft:h((function(e,t){return Nd(t.element)?R.none():p(e,t)})),onEscape:h((function(t,n){return p(t,n).orThunk((function(){return e.onEscape(t,n).map((function(){return t}))}))})),focusIn:function(e,t){o.getPrimary().each((function(t){Mi(e,t.element,ci())}))}}),am.config({highlightClass:e.markers.selectedMenu,itemClass:e.markers.menu}),Bd.config({find:function(e){return am.getHighlighted(e)}}),up.config({})]),eventOrder:e.eventOrder,apis:y,events:v}},extraApis:{tieredData:function(e,t,n){return{primary:e,menus:t,expansions:n}},singleData:function(e,t){return{primary:e,menus:ko(e,t),expansions:{}}},collapseItem:function(e){return{value:ra(Kp()),meta:{text:e}}}}}),Yp=Dd({name:"InlineView",configFields:[Kr("lazySink"),_u("onShow"),_u("onHide"),uo("onEscape"),_f("inlineBehaviours",[af,Of,Oc]),so("fireDismissalEventInstead",[lo("event",wi())]),so("fireRepositionEventInstead",[lo("event",xi())]),lo("getRelated",R.none),lo("isExtraPart",C),lo("eventOrder",R.none)],factory:function(e,t){var n=function(e,t,n,o){r(e,t,n,(function(){return o.map((function(e){return Fn(e)}))}))},r=function(t,n,r,o){var i=e.lazySink(t).getOrDie();af.openWhileCloaked(t,n,(function(){return Pl.positionWithinBounds(i,t,r,o())})),Of.setValue(t,R.some({mode:"position",config:r,getBounds:o}))},o=function(t,n,r,o){var i=function(e,t,n,r,o){var i=function(){return e.lazySink(t)},a="horizontal"===r.type?{layouts:{onLtr:function(){return dc()},onRtl:function(){return mc()}}}:{},u=function(e){return function(e){return 2===e.length}(e)?a:{}};return Xp.sketch({dom:{tag:"div"},data:r.data,markers:r.menu.markers,highlightImmediately:r.menu.highlightImmediately,onEscape:function(){return af.close(t),e.onEscape.map((function(e){return e(t)})),R.some(!0)},onExecute:function(){return R.some(!0)},onOpenMenu:function(e,t){Pl.positionWithinBounds(i().getOrDie(),t,n,o())},onOpenSubmenu:function(e,t,n,r){var o=i().getOrDie();Pl.position(o,n,{anchor:T({type:"submenu",item:t},u(r))})},onRepositionMenu:function(e,t,r){var a=i().getOrDie();Pl.positionWithinBounds(a,t,n,o()),U(r,(function(e){var t=u(e.triggeringPath);Pl.position(a,e.triggeredMenu,{anchor:T({type:"submenu",item:e.triggeringItem},t)})}))}})}(e,t,n,r,o);af.open(t,i),Of.setValue(t,R.some({mode:"menu",menu:i}))},i=function(t){af.isOpen(t)&&Of.getValue(t).each((function(n){switch(n.mode){case"menu":af.getState(t).each(Xp.repositionMenus);break;case"position":var r=e.lazySink(t).getOrDie();Pl.positionWithinBounds(r,t,n.config,n.getBounds())}}))},a={setContent:function(e,t){af.setContent(e,t)},showAt:function(e,t,r){n(e,t,r,R.none())},showWithin:n,showWithinBounds:r,showMenuAt:function(e,t,n){o(e,t,n,R.none)},showMenuWithinBounds:o,hide:function(e){af.isOpen(e)&&(Of.setValue(e,R.none()),af.close(e))},getContent:function(e){return af.getState(e)},reposition:i,isOpen:af.isOpen};return{uid:e.uid,dom:e.dom,behaviours:Af(e.inlineBehaviours,[af.config({isPartOf:function(t,n,r){return mu(n,r)||function(t,n){return e.getRelated(t).exists((function(e){return mu(e,n)}))}(t,r)},getAttachPoint:function(t){return e.lazySink(t).getOrDie()},onOpen:function(t){e.onShow(t)},onClose:function(t){e.onHide(t)}}),Of.config({store:{mode:"memory",initialValue:R.none()}}),Oc.config({channels:T(T({},ff(T({isExtraPart:t.isExtraPart},e.fireDismissalEventInstead.map((function(e){return{fireEventInstead:{event:e.event}}})).getOr({})))),mf(T(T({},e.fireRepositionEventInstead.map((function(e){return{fireEventInstead:{event:e.event}}})).getOr({})),{doReposition:i})))})]),eventOrder:e.eventOrder,apis:a}},apis:{showAt:function(e,t,n,r){e.showAt(t,n,r)},showWithin:function(e,t,n,r,o){e.showWithin(t,n,r,o)},showWithinBounds:function(e,t,n,r,o){e.showWithinBounds(t,n,r,o)},showMenuAt:function(e,t,n,r){e.showMenuAt(t,n,r)},showMenuWithinBounds:function(e,t,n,r,o){e.showMenuWithinBounds(t,n,r,o)},hide:function(e,t){e.hide(t)},isOpen:function(e,t){return e.isOpen(t)},getContent:function(e,t){return e.getContent(t)},setContent:function(e,t,n){e.setContent(t,n)},reposition:function(e,t){e.reposition(t)}}}),Jp="layout-inset",Zp=function(e){return e.x},Qp=function(e,t){return e.x+e.width/2-t.width/2},eh=function(e,t){return e.x+e.width-t.width},th=function(e){return e.y},nh=function(e,t){return e.y+e.height-t.height},rh=function(e,t){return e.y+e.height/2-t.height/2},oh=function(e,t,n){return zu(eh(e,t),nh(e,t),n.insetSouthwest(),Lu(),"southwest",qu(e,{right:0,bottom:3}),Jp)},ih=function(e,t,n){return zu(Zp(e),nh(e,t),n.insetSoutheast(),Fu(),"southeast",qu(e,{left:1,bottom:3}),Jp)},ah=function(e,t,n){return zu(eh(e,t),th(e),n.insetNorthwest(),Iu(),"northwest",qu(e,{right:0,top:2}),Jp)},uh=function(e,t,n){return zu(Zp(e),th(e),n.insetNortheast(),Pu(),"northeast",qu(e,{left:1,top:2}),Jp)},ch=function(e,t,n){return zu(Qp(e,t),th(e),n.insetNorth(),Hu(),"north",qu(e,{top:2}),Jp)},sh=function(e,t,n){return zu(Qp(e,t),nh(e,t),n.insetSouth(),Vu(),"south",qu(e,{bottom:3}),Jp)},lh=function(e,t,n){return zu(eh(e,t),rh(e,t),n.insetEast(),Uu(),"east",qu(e,{right:0}),Jp)},fh=function(e,t,n){return zu(Zp(e),rh(e,t),n.insetWest(),ju(),"west",qu(e,{left:1}),Jp)},dh=function(e){switch(e){case"north":return ch;case"northeast":return uh;case"northwest":return ah;case"south":return sh;case"southeast":return ih;case"southwest":return oh;case"east":return lh;case"west":return fh}},mh=function(e,t,n,r,o){return Gc(r).map(dh).getOr(ch)(e,t,n,r,o)},gh=function(e){switch(e){case"north":return sh;case"northeast":return ih;case"northwest":return oh;case"south":return ch;case"southeast":return uh;case"southwest":return ah;case"east":return fh;case"west":return lh}},ph=function(e,t,n,r,o){return Gc(r).map(gh).getOr(ch)(e,t,n,r,o)},hh=tinymce.util.Tools.resolve("tinymce.util.Delay"),vh=Dd({name:"Button",factory:function(e){var t=_p(e.action),n=e.dom.tag,r=function(t){return be(e.dom,"attributes").bind((function(e){return be(e,t)}))};return{uid:e.uid,dom:e.dom,components:e.components,events:t,behaviours:Mf(e.buttonBehaviours,[mp.config({}),tp.config({mode:"execution",useSpace:!0,useEnter:!0})]),domModification:{attributes:function(){if("button"===n){var e=r("type").getOr("button"),t=r("role").map((function(e){return{role:e}})).getOr({});return T({type:e},t)}return{role:r("role").getOr("button")}}()},eventOrder:e.eventOrder}},configFields:[lo("uid",void 0),Kr("dom"),lo("components",[]),Df("buttonBehaviours",[mp,tp]),ro("action"),ro("role"),lo("eventOrder",{})]}),bh=function(e){var t=function(e){return void 0!==e.uid}(e)&&we(e,"uid")?e.uid:la("memento");return{get:function(e){return e.getSystem().getByUid(t).getOrDie()},getOpt:function(e){return e.getSystem().getByUid(t).toOptional()},asSpec:function(){return T(T({},e),{uid:t})}}},yh=tinymce.util.Tools.resolve("tinymce.util.I18n"),wh={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},xh="temporary-placeholder",Ch=function(e){return function(){return be(e,xh).getOr("!not found!")}},Sh=function(e,t){var n=e.toLowerCase();if(yh.isRtl()){var r=function(e,t){return Ee(e,t)?e:function(e,t){return e+t}(e,t)}(n,"-rtl");return ye(t,r)?r:n}return n},kh=function(e,t){return be(t,Sh(e,t))},Th=function(e,t){var n=t();return kh(e,n).getOrThunk(Ch(n))},Oh=function(){return cp("add-focusable",[$i((function(e){cu(e.element,"svg").each((function(e){return Ut(e,"focusable","false")}))}))])},_h=function(e,t,n,r){var o,i,a=function(e){return!!yh.isRtl()&&ye(wh,e)}(t)?["tox-icon--flip"]:[],u=be(n,Sh(t,n)).or(r).getOrThunk(Ch(n));return{dom:{tag:e.tag,attributes:null!==(o=e.attributes)&&void 0!==o?o:{},classes:e.classes.concat(a),innerHtml:u},behaviours:wc(_(_([],null!==(i=e.behaviours)&&void 0!==i?i:[],!0),[Oh()],!1))}},Eh=function(e,t,n,r){return void 0===r&&(r=R.none()),_h(t,e,n(),r)},Ah={success:"checkmark",error:"warning",err:"error",warning:"warning",warn:"warning",info:"info"},Dh=Dd({name:"Notification",factory:function(e){var t,n,r,o,i,a=bh({dom:{tag:"p",innerHtml:e.translationProvider(e.text)},behaviours:wc([up.config({})])}),u=function(e){return{dom:{tag:"div",classes:["tox-bar"],attributes:{style:"width: "+e+"%"}}}},c=function(e){return{dom:{tag:"div",classes:["tox-text"],innerHtml:e+"%"}}},s=bh({dom:{tag:"div",classes:e.progress?["tox-progress-bar","tox-progress-indicator"]:["tox-progress-bar"]},components:[{dom:{tag:"div",classes:["tox-bar-container"]},components:[u(0)]},c(0)],behaviours:wc([up.config({})])}),l={updateProgress:function(e,t){e.getSystem().isConnected()&&s.getOpt(e).each((function(e){up.set(e,[{dom:{tag:"div",classes:["tox-bar-container"]},components:[u(t)]},c(t)])}))},updateText:function(e,t){if(e.getSystem().isConnected()){var n=a.get(e);up.set(n,[Ja(t)])}}},f=Y([e.icon.toArray(),e.level.toArray(),e.level.bind((function(e){return R.from(Ah[e])})).toArray()]),d=bh(vh.sketch({dom:{tag:"button",classes:["tox-notification__dismiss","tox-button","tox-button--naked","tox-button--icon"]},components:[Eh("close",{tag:"div",classes:["tox-icon"],attributes:{"aria-label":e.translationProvider("Close")}},e.iconProvider)],action:function(t){e.onAction(t)}})),m=(t=f,n={tag:"div",classes:["tox-notification__icon"]},r=e.iconProvider,o=r(),i=K(t,(function(e){return ye(o,Sh(e,o))})),_h(n,i.getOr(xh),o,R.none())),g=[m,{dom:{tag:"div",classes:["tox-notification__body"]},components:[a.asSpec()],behaviours:wc([up.config({})])}];return{uid:e.uid,dom:{tag:"div",attributes:{role:"alert"},classes:e.level.map((function(e){return["tox-notification","tox-notification--in","tox-notification--"+e]})).getOr(["tox-notification","tox-notification--in"])},behaviours:wc([mp.config({}),cp("notification-events",[Ii(Wo(),(function(e){d.getOpt(e).each(mp.focus)}))])]),components:g.concat(e.progress?[s.asSpec()]:[]).concat(e.closeButton?[d.asSpec()]:[]),apis:l}},configFields:[ro("level"),Kr("progress"),Kr("icon"),Kr("onAction"),Kr("text"),Kr("iconProvider"),Kr("translationProvider"),ho("closeButton",!0)],apis:{updateProgress:function(e,t,n){e.updateProgress(t,n)},updateText:function(e,t,n){e.updateText(t,n)}}});function Mh(e,t,n){var r=t.backstage.shared;return{open:function(t,o){var i=!t.closeButton&&t.timeout&&(t.timeout>0||t.timeout<0),a=function(){o(),Yp.hide(c)},u=eu(Dh.sketch({text:t.text,level:F(["success","error","warning","warn","info"],t.type)?t.type:void 0,progress:!0===t.progressBar,icon:R.from(t.icon),closeButton:!i,onAction:a,iconProvider:r.providers.icons,translationProvider:r.providers.translate})),c=eu(Yp.sketch(T({dom:{tag:"div",classes:["tox-notifications-container"]},lazySink:r.getSink,fireDismissalEventInstead:{}},r.header.isPositionedAtTop()?{}:{fireRepositionEventInstead:{}})));n.add(c),t.timeout>0&&hh.setTimeout((function(){a()}),t.timeout);var s=function(){var t=Fn(Re.fromDom(e.getContentAreaContainer())),n=Hn(),r=$u(n.x,t.x,t.right),o=$u(n.y,t.y,t.bottom),i=Math.max(t.right,n.right),a=Math.max(t.bottom,n.bottom);return R.some(In(r,o,i-r,a-o))};return{close:a,moveTo:function(e,t){Yp.showAt(c,tu(u),{anchor:{type:"makeshift",x:e,y:t}})},moveRel:function(e,t){var n=tu(u),o={maxHeightFunction:ms()};if("banner"!==t&&l(e)){var i=function(e){switch(e){case"bc-bc":return sh;case"tc-tc":return ch;case"tc-bc":return oc;default:return ic}}(t),a={type:"node",root:Ht(),node:R.some(Re.fromDom(e)),overrides:o,layouts:{onRtl:function(){return[i]},onLtr:function(){return[i]}}};Yp.showWithinBounds(c,n,{anchor:a},s)}else{var f=T(T({},r.anchors.banner()),{overrides:o});Yp.showWithinBounds(c,n,{anchor:f},s)}},text:function(e){Dh.updateText(u,e)},settings:t,getEl:function(){return u.element.dom},progressBar:{value:function(e){Dh.updateProgress(u,e)}}}},close:function(e){e.close()},reposition:function(e){e.length>0&&U(e,(function(t,n){0===n?t.moveRel(null,"banner"):t.moveRel(e[n-1].getEl(),"bc-tc")}))},getArgs:function(e){return e.settings}}}var Nh,Rh=function(e,t){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,e.apply(null,o)}),t)}}},zh=tinymce.util.Tools.resolve("tinymce.dom.TextSeeker"),Bh=function(e,t,n,r,o){var i=zh(e,(function(t){return function(e,t){return e.isBlock(t)||F(["BR","IMG","HR","INPUT"],t.nodeName)||"false"===e.getContentEditable(t)}(e,t)}));return R.from(i.backwards(t,n,r,o))},Ph=function(e,t){return Ih(Re.fromDom(e.selection.getNode())).getOrThunk((function(){var n=Re.fromHtml('<span data-mce-autocompleter="1" data-mce-bogus="1"></span>',e.getDoc());return Tn(n,Re.fromDom(t.extractContents())),t.insertNode(n.dom),Tt(n).each((function(e){return e.dom.normalize()})),function(e){return nl(e,tl)}(n).map((function(t){e.selection.setCursorLocation(t.dom,function(e){return"img"===Be(e)?1:Qs(e).fold((function(){return _t(e).length}),(function(e){return e.length}))}(t))})),n}))},Ih=function(e){return lu(e,"[data-mce-autocompleter]")},Fh=function(e){return e.toString().replace(/\u00A0/g," ").replace(/\uFEFF/g,"")},Lh=function(e){return""!==e&&-1!=="  \f\n\r\t\v".indexOf(e)},Hh=function(e,t){return e.substring(t.length)},Vh=function(e,t,n,r){if(void 0===r&&(r=0),!(o=t).collapsed||3!==o.startContainer.nodeType)return R.none();var o,i=e.getParent(t.startContainer,e.isBlock)||e.getRoot();return Bh(e,t.startContainer,t.startOffset,(function(e,t,r){return function(e,t,n){var r;for(r=t-1;r>=0;r--){var o=e.charAt(r);if(Lh(o))return R.none();if(o===n)break}return R.some(r)}(r,t,n).getOr(t)}),i).bind((function(e){var o=t.cloneRange();if(o.setStart(e.container,e.offset),o.setEnd(t.endContainer,t.endOffset),o.collapsed)return R.none();var i=Fh(o);return 0!==i.lastIndexOf(n)||Hh(i,n).length<r?R.none():R.some({text:Hh(i,n),range:o,triggerChar:n})}))},jh=function(e,t,n,r){return void 0===r&&(r=0),Ih(Re.fromDom(t.startContainer)).fold((function(){return Vh(e,t,n,r)}),(function(t){var r=e.createRng();r.selectNode(t.dom);var o=Fh(r);return R.some({range:r,text:Hh(o,n),triggerChar:n})}))},Uh=function(e,t){t.on("keypress compositionend",e.onKeypress.throttle),t.on("remove",e.onKeypress.cancel);var n=function(e,t){Ai(e,qo(),{raw:t})};t.on("keydown",(function(t){var r=function(){return e.getView().bind(am.getHighlighted)};8===t.which&&e.onKeypress.throttle(t),e.isActive()&&(27===t.which&&e.cancelIfNecessary(),e.isMenuOpen()?13===t.which?(r().each(Di),t.preventDefault()):40===t.which?(r().fold((function(){e.getView().each(am.highlightFirst)}),(function(e){n(e,t)})),t.preventDefault(),t.stopImmediatePropagation()):37!==t.which&&38!==t.which&&39!==t.which||r().each((function(e){n(e,t),t.preventDefault(),t.stopImmediatePropagation()})):13!==t.which&&38!==t.which&&40!==t.which||e.cancelIfNecessary())})),t.on("NodeChange",(function(t){e.isActive()&&!e.isProcessingAction()&&Ih(Re.fromDom(t.element)).isNone()&&e.cancelIfNecessary()}))},Wh=tinymce.util.Tools.resolve("tinymce.util.Promise"),$h=function(e,t){return{container:e,offset:t}},qh=function(e){if(function(e){return 3===e.nodeType}(e))return $h(e,e.data.length);var t=e.childNodes;return t.length>0?qh(t[t.length-1]):$h(e,t.length)},Gh=function(e,t){var n=e.childNodes;return n.length>0&&t<n.length?Gh(n[t],0):n.length>0&&function(e){return 1===e.nodeType}(e)&&n.length===t?qh(n[n.length-1]):$h(e,t)},Kh=function(e){return function(t){var n=Gh(t.startContainer,t.startOffset);return!function(e,t){return Bh(e,t.container,t.offset,(function(e,t){return 0===t?-1:t}),e.getRoot()).filter((function(e){var t=e.container.data.charAt(e.offset-1);return!Lh(t)})).isSome()}(e,n)}},Xh=function(e,t){var n=t(),r=e.selection.getRng();return function(e,t,n){return ce(n.triggerChars,(function(n){return jh(e,t,n)}))}(e.dom,r,n).bind((function(n){return Yh(e,t,n)}))},Yh=function(e,t,n,r){void 0===r&&(r={});var o=t(),i=e.selection.getRng().startContainer.nodeValue,a=$(o.lookupByChar(n.triggerChar),(function(t){return n.text.length>=t.minChars&&t.matches.getOrThunk((function(){return Kh(e.dom)}))(n.range,i,n.text)}));if(0===a.length)return R.none();var u=Wh.all(j(a,(function(e){return e.fetch(n.text,e.maxResults,r).then((function(t){return{matchText:n.text,items:t,columns:e.columns,onAction:e.onAction,highlightOn:e.highlightOn}}))})));return R.some({lookupData:u,context:n})},Jh=Sr([Jr("type"),ao("text")]),Zh=Sr([lo("type","autocompleteitem"),lo("active",!1),lo("disabled",!1),lo("meta",{}),Jr("value"),ao("text"),ao("icon")]),Qh=Sr([Jr("type"),Jr("ch"),mo("minChars",1),lo("columns",1),mo("maxResults",10),uo("matches"),Qr("fetch"),Qr("onAction"),bo("highlightOn",[],Mr)]),ev=[ho("disabled",!1),ao("tooltip"),ao("icon"),ao("text"),vo("onSetup",(function(){return g}))],tv=Sr([Jr("type"),Qr("onAction")].concat(ev)),nv=function(e){return Hr("toolbarbutton",tv,e)},rv=[ho("active",!1)].concat(ev),ov=Sr(rv.concat([Jr("type"),Qr("onAction")])),iv=function(e){return Hr("ToggleButton",ov,e)},av=[vo("predicate",C),po("scope","node",["node","editor"]),po("position","selection",["node","selection","line"])],uv=ev.concat([lo("type","contextformbutton"),lo("primary",!1),Qr("onAction"),qr("original",v)]),cv=rv.concat([lo("type","contextformbutton"),lo("primary",!1),Qr("onAction"),qr("original",v)]),sv=ev.concat([lo("type","contextformbutton")]),lv=rv.concat([lo("type","contextformtogglebutton")]),fv=Wr("type",{contextformbutton:uv,contextformtogglebutton:cv}),dv=Sr([lo("type","contextform"),vo("initValue",h("")),ao("label"),no("commands",fv),oo("launch",Wr("type",{contextformbutton:sv,contextformtogglebutton:lv}))].concat(av)),mv=Sr([lo("type","contexttoolbar"),Jr("items")].concat(av)),gv=function(e){var t=e.ui.registry.getAll().popups,n=de(t,(function(e){return(t=e,Hr("Autocompleter",Qh,t)).fold((function(e){throw new Error(Ur(e))}),v);var t})),r=function(e){var t={};return U(e,(function(e){t[e]={}})),se(t)}(pe(n,(function(e){return e.ch}))),o=ve(n);return{dataset:n,triggerChars:r,lookupByChar:function(e){return $(o,(function(t){return t.ch===e}))}}};!function(e){e[e.CLOSE_ON_EXECUTE=0]="CLOSE_ON_EXECUTE",e[e.BUBBLE_TO_SANDBOX=1]="BUBBLE_TO_SANDBOX"}(Nh||(Nh={}));var pv,hv=Nh,vv="tox-menu-nav__js",bv="tox-collection__item",yv="tox-swatch",wv={normal:vv,color:yv},xv="tox-collection__item--enabled",Cv="tox-collection__item-icon",Sv="tox-collection__item-label",kv="tox-collection__item-caret",Tv="tox-collection__item--active",Ov="tox-collection__item-container",_v="tox-collection__item-container--row",Ev=function(e){return be(wv,e).getOr(vv)},Av=function(e){return"color"===e?"tox-swatches":"tox-menu"},Dv=function(e){return{backgroundMenu:"tox-background-menu",selectedMenu:"tox-selected-menu",selectedItem:"tox-collection__item--active",hasIcons:"tox-menu--has-icons",menu:Av(e),tieredMenu:"tox-tiered-menu"}},Mv=function(e){var t=Dv(e);return{backgroundMenu:t.backgroundMenu,selectedMenu:t.selectedMenu,menu:t.menu,selectedItem:t.selectedItem,item:Ev(e)}},Nv=function(e,t,n){var r=Dv(n);return{tag:"div",classes:Y([[r.menu,"tox-menu-"+t+"-column"],e?[r.hasIcons]:[]])}},Rv=[Up.parts.items({})],zv=function(e,t,n){var r=Dv(n);return{dom:{tag:"div",classes:Y([[r.tieredMenu]])},markers:Mv(n)}},Bv=function(e,t){return function(n){var r=V(n,t);return j(r,(function(t){return{dom:e,components:t}}))}},Pv=function(e,t){var n=[],r=[];return U(e,(function(e,o){t(e,o)?(r.length>0&&n.push(r),r=[],ye(e.dom,"innerHtml")&&r.push(e)):r.push(e)})),r.length>0&&n.push(r),j(n,(function(e){return{dom:{tag:"div",classes:["tox-collection__group"]},components:e}}))},Iv=function(e,t,n){return{dom:{tag:"div",classes:["tox-menu","tox-collection"].concat(1===e?["tox-collection--list"]:["tox-collection--grid"])},components:[Up.parts.items({preprocess:function(n){return"auto"!==e&&e>1?Bv({tag:"div",classes:["tox-collection__group"]},e)(n):Pv(n,(function(e,n){return"separator"===t[n].type}))}})]}},Fv=function(e){return L(e,(function(e){return"icon"in e&&void 0!==e.icon}))},Lv=function(e){return console.error(Ur(e)),console.log(e),R.none()},Hv=function(e,t,n,r,o){var i,a=(i=n,{dom:{tag:"div",classes:["tox-collection","tox-collection--horizontal"]},components:[Up.parts.items({preprocess:function(e){return Pv(e,(function(e,t){return"separator"===i[t].type}))}})]});return{value:e,dom:a.dom,components:a.components,items:n}},Vv=function(e,t,n,r,o){if("color"===o){var i=function(e){return{dom:{tag:"div",classes:["tox-menu","tox-swatches-menu"]},components:[{dom:{tag:"div",classes:["tox-swatches"]},components:[Up.parts.items({preprocess:"auto"!==e?Bv({tag:"div",classes:["tox-swatches__row"]},e):v})]}]}}(r);return{value:e,dom:i.dom,components:i.components,items:n}}if("normal"===o&&"auto"===r)return{value:e,dom:(i=Iv(r,n)).dom,components:i.components,items:n};if("normal"===o&&1===r)return{value:e,dom:(i=Iv(1,n)).dom,components:i.components,items:n};if("normal"===o)return{value:e,dom:(i=Iv(r,n)).dom,components:i.components,items:n};if("listpreview"===o&&"auto"!==r){i=function(e){return{dom:{tag:"div",classes:["tox-menu","tox-collection","tox-collection--toolbar","tox-collection--toolbar-lg"]},components:[Up.parts.items({preprocess:Bv({tag:"div",classes:["tox-collection__group"]},e)})]}}(r);return{value:e,dom:i.dom,components:i.components,items:n}}return{value:e,dom:Nv(t,r,o),components:Rv,items:n}},jv=[Jr("type"),Jr("src"),ao("alt"),bo("classes",[],Mr)],Uv=Sr(jv),Wv=[Jr("type"),Jr("text"),ao("name"),bo("classes",["tox-collection__item-label"],Mr)],$v=Sr(Wv),qv=wr((function(){return Ir("type",{cardimage:Uv,cardtext:$v,cardcontainer:Gv})})),Gv=Sr([Jr("type"),go("direction","horizontal"),go("align","left"),go("valign","middle"),no("items",qv)]),Kv=[ho("disabled",!1),ao("text"),ao("shortcut"),$r("value","value",cr((function(){return ra("menuitem-value")})),Er()),lo("meta",{})],Xv=Sr([Jr("type"),ao("label"),no("items",qv),vo("onSetup",(function(){return g})),vo("onAction",g)].concat(Kv)),Yv=Sr([Jr("type"),ho("active",!1),ao("icon")].concat(Kv)),Jv=[Jr("type"),Jr("fancytype"),vo("onAction",g)],Zv=[lo("initData",{})].concat(Jv),Qv=[yo("initData",{},[ho("allowCustomColors",!0),co("colors",Er())])].concat(Jv),eb=Wr("fancytype",{inserttable:Zv,colorswatch:Qv}),tb=Sr([Jr("type"),vo("onSetup",(function(){return g})),vo("onAction",g),ao("icon")].concat(Kv)),nb=Sr([Jr("type"),Qr("getSubmenuItems"),vo("onSetup",(function(){return g})),ao("icon")].concat(Kv)),rb=Sr([Jr("type"),ao("icon"),ho("active",!1),vo("onSetup",(function(){return g})),Qr("onAction")].concat(Kv)),ob=function(e,t,n){var r=rl(e.element,"."+n);if(r.length>0){var o=X(r,(function(e){var n=e.dom.getBoundingClientRect().top,o=r[0].dom.getBoundingClientRect().top;return Math.abs(n-o)>t})).getOr(r.length);return R.some({numColumns:o,numRows:Math.ceil(r.length/o)})}return R.none()},ib=function(e,t){return wc([cp(e,t)])},ab=function(e){return ib(ra("unnamed-events"),e)},ub=ra("tooltip.exclusive"),cb=ra("tooltip.show"),sb=ra("tooltip.hide"),lb=function(e,t,n){e.getSystem().broadcastOn([ub],{})},fb=Object.freeze({__proto__:null,hideAllExclusive:lb,setComponents:function(e,t,n,r){n.getTooltip().each((function(e){e.getSystem().isConnected()&&up.set(e,r)}))}}),db=Object.freeze({__proto__:null,events:function(e,t){var n=function(n){t.getTooltip().each((function(r){Wl(r),e.onHide(n,r),t.clearTooltip()})),t.clearTimer()};return zi(Y([[Ii(cb,(function(n){t.resetTimer((function(){!function(n){if(!t.isShowing()){lb(n);var r=e.lazySink(n).getOrDie(),o=n.getSystem().build({dom:e.tooltipDom,components:e.tooltipComponents,events:zi("normal"===e.mode?[Ii(Uo(),(function(e){Ei(n,cb)})),Ii(Vo(),(function(e){Ei(n,sb)}))]:[]),behaviours:wc([up.config({})])});t.setTooltip(o),Vl(r,o),e.onShow(n,o),Pl.position(r,o,{anchor:e.anchor(n)})}}(n)}),e.delay)})),Ii(sb,(function(r){t.resetTimer((function(){n(r)}),e.delay)})),Ii(ai(),(function(e,t){var r=t;r.universal||F(r.channels,ub)&&n(e)})),qi((function(e){n(e)}))],"normal"===e.mode?[Ii(Wo(),(function(e){Ei(e,cb)})),Ii(oi(),(function(e){Ei(e,sb)})),Ii(Uo(),(function(e){Ei(e,cb)})),Ii(Vo(),(function(e){Ei(e,sb)}))]:[Ii(Oi(),(function(e,t){Ei(e,cb)})),Ii(_i(),(function(e){Ei(e,sb)}))]]))}}),mb=[Kr("lazySink"),Kr("tooltipDom"),lo("exclusive",!0),lo("tooltipComponents",[]),lo("delay",300),po("mode","normal",["normal","follow-highlight"]),lo("anchor",(function(e){return{type:"hotspot",hotspot:e,layouts:{onLtr:h([ic,oc,ec,nc,tc,rc]),onRtl:h([ic,oc,ec,nc,tc,rc])}}})),_u("onHide"),_u("onShow")],gb=Cc({fields:mb,name:"tooltipping",active:db,state:Object.freeze({__proto__:null,init:function(){var e=Zc(),t=Zc(),n=function(){e.on(clearTimeout)},r=h("not-implemented");return wa({getTooltip:t.get,isShowing:t.isSet,setTooltip:t.set,clearTooltip:t.clear,clearTimer:n,resetTimer:function(t,r){n(),e.set(setTimeout(t,r))},readState:r})}}),apis:fb}),pb=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),hb=tinymce.util.Tools.resolve("tinymce.EditorManager"),vb=function(e){return e.getParam("height",Math.max(e.getElement().offsetHeight,200))},bb=function(e){return e.getParam("width",pb.DOM.getStyle(e.getElement(),"width"))},yb=function(e){return R.from(e.getParam("min_width")).filter(d)},wb=function(e){return R.from(e.getParam("min_height")).filter(d)},xb=function(e){return R.from(e.getParam("max_width")).filter(d)},Cb=function(e){return R.from(e.getParam("max_height")).filter(d)},Sb=function(e){return!1!==e.getParam("menubar",!0,"boolean")},kb=function(e){var t=e.getParam("toolbar",!0),n=!0===t,o=r(t),a=i(t)&&t.length>0;return!Ob(e)&&(a||o||n)},Tb=function(e){var t=H(9,(function(t){return e.getParam("toolbar"+(t+1),!1,"string")})),n=$(t,(function(e){return"string"==typeof e}));return n.length>0?R.some(n):R.none()},Ob=function(e){return Tb(e).fold((function(){return e.getParam("toolbar",[],"string[]").length>0}),S)};!function(e){e.default="wrap",e.floating="floating",e.sliding="sliding",e.scrolling="scrolling"}(pv||(pv={}));var _b,Eb=function(e){return e.getParam("toolbar_mode","","string")};!function(e){e.auto="auto",e.top="top",e.bottom="bottom"}(_b||(_b={}));var Ab,Db,Mb=function(e){return e.getParam("toolbar_location",_b.auto,"string")},Nb=function(e){return Mb(e)===_b.bottom},Rb=function(e){if(!e.inline)return R.none();var t=function(e){return e.getParam("fixed_toolbar_container","","string")}(e);if(t.length>0)return su(Ht(),t);var n=function(e){return e.getParam("fixed_toolbar_container_target")}(e);return l(n)?R.some(Re.fromDom(n)):R.none()},zb=function(e){return e.inline&&Rb(e).isSome()},Bb=function(e){return Rb(e).getOrThunk((function(){return Bt(zt(Re.fromDom(e.getElement())))}))},Pb=function(e){return e.inline&&!Sb(e)&&!kb(e)&&!Ob(e)},Ib=function(e){return(e.getParam("toolbar_sticky",!1,"boolean")||e.inline)&&!zb(e)&&!Pb(e)},Fb=function(e){var t=e.getParam("menu");return t?de(t,(function(e){return T(T({},e),{items:e.items})})):{}},Lb=function(e){return e.getParam("menubar")},Hb=function(e){return e.getParam("anchor_top","#top")},Vb=function(e){return e.getParam("anchor_bottom","#bottom")},jb="silver.readonly",Ub=Sr([(Ab="readonly",Xr(Ab,Nr))]),Wb=function(e,t){var n=e.outerContainer.element;t&&(e.mothership.broadcastOn([uf()],{target:n}),e.uiMothership.broadcastOn([uf()],{target:n})),e.mothership.broadcastOn([jb],{readonly:t}),e.uiMothership.broadcastOn([jb],{readonly:t})},$b=function(e,t){e.on("init",(function(){e.mode.isReadOnly()&&Wb(t,!0)})),e.on("SwitchMode",(function(){return Wb(t,e.mode.isReadOnly())})),function(e){return e.getParam("readonly",!1,"boolean")}(e)&&e.setMode("readonly")},qb=function(){var e;return Oc.config({channels:(e={},e[jb]={schema:Ub,onReceive:function(e,t){Xd.set(e,t.readonly)}},e)})},Gb=function(e){return Xd.config({disabled:e,disableClass:"tox-collection__item--state-disabled"})},Kb=function(e){return Xd.config({disabled:e})},Xb=function(e){return Xd.config({disabled:e,disableClass:"tox-tbtn--disabled"})},Yb=function(e){return Xd.config({disabled:e,disableClass:"tox-tbtn--disabled",useNative:!1})},Jb=function(e,t){var n=e.getApi(t);return function(e){e(n)}},Zb=function(e,t){return $i((function(n){Jb(e,n)((function(n){var r=e.onSetup(n);f(r)&&t.set(r)}))}))},Qb=function(e,t){return qi((function(n){return Jb(e,n)(t.get())}))},ey=function(e,t){return Ki((function(n,r){Jb(e,n)(e.onAction),e.triggersSubmenu||t!==hv.CLOSE_ON_EXECUTE||(Ei(n,fi()),r.stop())}))},ty=((Db={})[ui()]=["disabling","alloy.base.behaviour","toggling","item-events"],Db),ny=Ce,ry=function(e,t,n,r){var o=wo(g);return{type:"item",dom:t.dom,components:ny(t.optComponents),data:e.data,eventOrder:ty,hasSubmenu:e.triggersSubmenu,itemBehaviours:wc([cp("item-events",[ey(e,n),Zb(e,o),Qb(e,o)]),Gb((function(){return e.disabled||r.isDisabled()})),qb(),up.config({})].concat(e.itemBehaviours))}},oy=function(e){return{value:e.value,meta:T({text:e.text.getOr("")},e.meta)}},iy=tinymce.util.Tools.resolve("tinymce.Env"),ay=function(e){var t=iy.mac?{alt:"&#x2325;",ctrl:"&#x2303;",shift:"&#x21E7;",meta:"&#x2318;",access:"&#x2303;&#x2325;"}:{meta:"Ctrl",access:"Shift+Alt"},n=e.split("+"),r=j(n,(function(e){var n=e.toLowerCase().trim();return ye(t,n)?t[n]:e}));return iy.mac?r.join(""):r.join("+")},uy=function(e,t,n){return void 0===n&&(n=[Cv]),Eh(e,{tag:"div",classes:n},t)},cy=function(e){return{dom:{tag:"div",classes:[Sv]},components:[Ja(yh.translate(e))]}},sy=function(e,t){return{dom:{tag:"div",classes:t,innerHtml:e}}},ly=function(e,t){return{dom:{tag:"div",classes:[Sv]},components:[{dom:{tag:e.tag,styles:e.styles},components:[Ja(yh.translate(t))]}]}},fy=function(e){return{dom:{tag:"div",classes:["tox-collection__item-accessory"],innerHtml:ay(e)}}},dy=function(e){return uy("checkmark",e,["tox-collection__item-checkmark"])},my=function(e,t,n){var r,o,i,a=e.ariaLabel,u=e.value,c=e.iconContent.map((function(e){return function(e,t,n){var r=t();return kh(e,r).or(n).getOrThunk(Ch(r))}(e,t.icons,n)}));return{dom:(r=c.getOr(""),o=a.map((function(e){return{title:t.translate(e)}})).getOr({}),i={tag:"div",attributes:o,classes:["tox-swatch"]},T(T({},i),"custom"===u?{tag:"button",classes:_(_([],i.classes,!0),["tox-swatches__picker-btn"],!1),innerHtml:r}:"remove"===u?{classes:_(_([],i.classes,!0),["tox-swatch--remove"],!1),innerHtml:r}:{attributes:T(T({},i.attributes),{"data-mce-color":u}),styles:{"background-color":u}})),optComponents:[]}},gy=function(e){var t=e.map((function(e){return{attributes:{title:yh.translate(e)}}})).getOr({});return T({tag:"div",classes:[vv,bv]},t)},py=function(e,t,n,r){return void 0===r&&(r=R.none()),"color"===e.presets?my(e,t,r):function(e,t,n,r){var o={tag:"div",classes:[Cv]},i=n?e.iconContent.map((function(e){return Eh(e,o,t.icons,r)})).orThunk((function(){return R.some({dom:o})})):R.none(),a=e.checkMark,u=R.from(e.meta).fold((function(){return cy}),(function(e){return ye(e,"style")?y(ly,e.style):cy})),c=e.htmlContent.fold((function(){return e.textContent.map(u)}),(function(e){return R.some(sy(e,[Sv]))}));return{dom:gy(e.ariaLabel),optComponents:[i,c,e.shortcutContent.map(fy),a,e.caret]}}(e,t,n,r)},hy=function(e,t){return be(e,"tooltipWorker").map((function(e){return[gb.config({lazySink:t.getSink,tooltipDom:{tag:"div",classes:["tox-tooltip-worker-container"]},tooltipComponents:[],anchor:function(e){return{type:"submenu",item:e,overrides:{maxHeightFunction:ms}}},mode:"follow-highlight",onShow:function(t,n){e((function(e){gb.setComponents(t,[Za({element:Re.fromDom(e)})])}))}})]})).getOr([])},vy=function(e,t){var n=function(e){return pb.DOM.encode(e)}(yh.translate(e));if(t.length>0){var r=new RegExp(function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(t),"gi");return n.replace(r,(function(e){return'<span class="tox-autocompleter-highlight">'+e+"</span>"}))}return n},by=function(e,t){return j(e,(function(e){switch(e.type){case"cardcontainer":return function(e,t){var n="vertical"===e.direction?"tox-collection__item-container--column":_v,r="left"===e.align?"tox-collection__item-container--align-left":"tox-collection__item-container--align-right";return{dom:{tag:"div",classes:[Ov,n,r,function(){switch(e.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:t}}(e,by(e.items,t));case"cardimage":return function(e,t,n){return{dom:{tag:"img",classes:t,attributes:{src:e,alt:n.getOr("")}}}}(e.src,e.classes,e.alt);case"cardtext":var n=e.name.exists((function(e){return F(t.cardText.highlightOn,e)})),r=n?R.from(t.cardText.matchText).getOr(""):"";return sy(vy(e.text,r),e.classes)}}))},yy=sd(Pp(),Ip()),wy=function(e){return{value:e}},xy=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,Cy=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,Sy=function(e){return xy.test(e)||Cy.test(e)},ky=function(e){return function(e,t){return _e(e,t)?function(e,t){return e.substring(t)}(e,t.length):e}(e,"#").toUpperCase()},Ty=function(e){var t=function(e){var t=e.value.replace(xy,(function(e,t,n,r){return t+t+n+n+r+r}));return{value:t}}(e),n=Cy.exec(t.value);return null===n?["FFFFFF","FF","FF","FF"]:n},Oy=function(e){var t=e.toString(16);return(1===t.length?"0"+t:t).toUpperCase()},_y=function(e){var t=Oy(e.red)+Oy(e.green)+Oy(e.blue);return wy(t)},Ey=Math.min,Ay=Math.max,Dy=Math.round,My=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)/,Ny=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d?(?:\.\d+)?)\)/,Ry=function(e,t,n,r){return{red:e,green:t,blue:n,alpha:r}},zy=function(e){var t=parseInt(e,10);return t.toString()===e&&t>=0&&t<=255},By=function(e){var t,n,r,o=(e.hue||0)%360,i=e.saturation/100,a=e.value/100;if(i=Ay(0,Ey(i,1)),a=Ay(0,Ey(a,1)),0===i)return t=n=r=Dy(255*a),Ry(t,n,r,1);var u=o/60,c=a*i,s=c*(1-Math.abs(u%2-1)),l=a-c;switch(Math.floor(u)){case 0:t=c,n=s,r=0;break;case 1:t=s,n=c,r=0;break;case 2:t=0,n=c,r=s;break;case 3:t=0,n=s,r=c;break;case 4:t=s,n=0,r=c;break;case 5:t=c,n=0,r=s;break;default:t=n=r=0}return t=Dy(255*(t+l)),n=Dy(255*(n+l)),r=Dy(255*(r+l)),Ry(t,n,r,1)},Py=function(e){var t=Ty(e),n=parseInt(t[1],16),r=parseInt(t[2],16),o=parseInt(t[3],16);return Ry(n,r,o,1)},Iy=function(e,t,n,r){var o=parseInt(e,10),i=parseInt(t,10),a=parseInt(n,10),u=parseFloat(r);return Ry(o,i,a,u)},Fy=function(e){if("transparent"===e)return R.some(Ry(0,0,0,0));var t=My.exec(e);if(null!==t)return R.some(Iy(t[1],t[2],t[3],"1"));var n=Ny.exec(e);return null!==n?R.some(Iy(n[1],n[2],n[3],n[4])):R.none()},Ly=function(e){return"rgba("+e.red+","+e.green+","+e.blue+","+e.alpha+")"},Hy=Ry(255,0,0,1),Vy=function(e,t){return e.fire("ResizeContent",t)},jy=function(e,t,n){return{hue:e,saturation:t,value:n}},Uy=function(e){var t,n=0,r=0,o=e.red/255,i=e.green/255,a=e.blue/255,u=Math.min(o,Math.min(i,a)),c=Math.max(o,Math.max(i,a));return u===c?jy(0,0,100*(r=u)):(n=60*((n=o===u?3:a===u?1:5)-(o===u?i-a:a===u?o-i:a-o)/(c-u)),t=(c-u)/c,r=c,jy(Math.round(n),Math.round(100*t),Math.round(100*r)))},Wy=function(e){return _y(By(e))},$y=function(e){return(t=e,Sy(t)?R.some({value:ky(t)}):R.none()).orThunk((function(){return Fy(e).map(_y)})).getOrThunk((function(){var t=document.createElement("canvas");t.height=1,t.width=1;var n=t.getContext("2d");n.clearRect(0,0,t.width,t.height),n.fillStyle="#FFFFFF",n.fillStyle=e,n.fillRect(0,0,1,1);var r=n.getImageData(0,0,1,1).data,o=r[0],i=r[1],a=r[2],u=r[3];return _y(Ry(o,i,a,u))}));var t},qy=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),Gy="tinymce-custom-colors";var Ky,Xy="choiceitem",Yy=[{type:Xy,text:"Light Green",value:"#BFEDD2"},{type:Xy,text:"Light Yellow",value:"#FBEEB8"},{type:Xy,text:"Light Red",value:"#F8CAC6"},{type:Xy,text:"Light Purple",value:"#ECCAFA"},{type:Xy,text:"Light Blue",value:"#C2E0F4"},{type:Xy,text:"Green",value:"#2DC26B"},{type:Xy,text:"Yellow",value:"#F1C40F"},{type:Xy,text:"Red",value:"#E03E2D"},{type:Xy,text:"Purple",value:"#B96AD9"},{type:Xy,text:"Blue",value:"#3598DB"},{type:Xy,text:"Dark Turquoise",value:"#169179"},{type:Xy,text:"Orange",value:"#E67E23"},{type:Xy,text:"Dark Red",value:"#BA372A"},{type:Xy,text:"Dark Purple",value:"#843FA1"},{type:Xy,text:"Dark Blue",value:"#236FA1"},{type:Xy,text:"Light Gray",value:"#ECF0F1"},{type:Xy,text:"Medium Gray",value:"#CED4D9"},{type:Xy,text:"Gray",value:"#95A5A6"},{type:Xy,text:"Dark Gray",value:"#7E8C8D"},{type:Xy,text:"Navy Blue",value:"#34495E"},{type:Xy,text:"Black",value:"#000000"},{type:Xy,text:"White",value:"#ffffff"}],Jy=function(e){void 0===e&&(e=10);var t,n=qy.getItem(Gy),o=r(n)?JSON.parse(n):[],i=e-(t=o).length<0?t.slice(0,e):t,a=function(e){i.splice(e,1)};return{add:function(t){(function(e,t){var n=I(e,t);return-1===n?R.none():R.some(n)})(i,t).each(a),i.unshift(t),i.length>e&&i.pop(),qy.setItem(Gy,JSON.stringify(i))},state:function(){return i.slice(0)}}}(10),Zy=function(e){return!1!==e.getParam("custom_colors")},Qy=function(e){var t=function(e){return e.getParam("color_map")}(e);return void 0!==t?function(e){for(var t=[],n=0;n<e.length;n+=2)t.push({text:e[n+1],value:"#"+$y(e[n]).value,type:"choiceitem"});return t}(t):Yy},ew=function(e){Jy.add(e)},tw=function(e){var t=function(e){return Math.max(5,Math.ceil(Math.sqrt(e)))}(Qy(e).length);return function(e,t){return e.getParam("color_cols",t,"number")}(e,t)},nw=function(e){var t="choiceitem",n={type:t,text:"Remove color",icon:"color-swatch-remove-color",value:"remove"};return e?[n,{type:t,text:"Custom color",icon:"color-picker",value:"custom"}]:[n]},rw=function(e,t,n,r){"custom"===n?sw(e)((function(n){n.each((function(n){ew(n),e.execCommand("mceApplyTextcolor",t,n),r(n)}))}),"#000000"):"remove"===n?(r(""),e.execCommand("mceRemoveTextcolor",t)):(r(n),e.execCommand("mceApplyTextcolor",t,n))},ow=function(e,t){return e.concat(j(Jy.state(),(function(e){return{type:Xy,text:e,value:e}})).concat(nw(t)))},iw=function(e,t){return function(n){n(ow(e,t))}},aw=function(e,t,n){var r="forecolor"===t?"tox-icon-text-color__color":"tox-icon-highlight-bg-color__color";e.setIconFill(r,n)},uw=function(e,t,n,r,o){e.ui.registry.addSplitButton(t,{tooltip:r,presets:"color",icon:"forecolor"===t?"text-color":"highlight-bg-color",select:function(t){var r=R.from(function(e,t){var n;return e.dom.getParents(e.selection.getStart(),(function(e){var r;(r=e.style["forecolor"===t?"color":"background-color"])&&(n=n||r)})),n}(e,n));return r.bind((function(e){return Fy(e).map((function(e){var n=_y(e).value;return Oe(t.toLowerCase(),n)}))})).getOr(!1)},columns:tw(e),fetch:iw(Qy(e),Zy(e)),onAction:function(t){null!==o.get()&&rw(e,n,o.get(),g)},onItemAction:function(r,i){rw(e,n,i,(function(n){o.set(n),function(e,t){e.fire("TextColorChange",t)}(e,{name:t,color:n})}))},onSetup:function(n){null!==o.get()&&aw(n,t,o.get());var r=function(e){e.name===t&&aw(n,e.name,e.color)};return e.on("TextColorChange",r),function(){e.off("TextColorChange",r)}}})},cw=function(e,t,n,r){e.ui.registry.addNestedMenuItem(t,{text:r,icon:"forecolor"===t?"text-color":"highlight-bg-color",getSubmenuItems:function(){return[{type:"fancymenuitem",fancytype:"colorswatch",onAction:function(t){rw(e,n,t.value,g)}}]}})},sw=function(e){return function(t,n){var r=!1,o={colorpicker:n};e.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(e,t){"hex-valid"===t.name&&(r=t.value)},onSubmit:function(n){var o=n.getData().colorpicker;r?(t(R.from(o)),n.close()):e.windowManager.alert(e.translate(["Invalid hex color code: {0}",o]))},onClose:g,onCancel:function(){t(R.none())}})}},lw=function(e,t,n,r,o,i,a,u){var c=Fv(t),s=fw(t,n,r,"color"!==o?"normal":"color",i,a,u);return Vv(e,c,s,r,o)},fw=function(e,t,n,r,o,i,a){return Ce(j(e,(function(u){return"choiceitem"===u.type?(c=u,Hr("choicemenuitem",Yv,c)).fold(Lv,(function(c){return R.some(function(e,t,n,r,o,i,a,u){void 0===u&&(u=!0);var c=py({presets:n,textContent:t?e.text:R.none(),htmlContent:R.none(),ariaLabel:e.text,iconContent:e.icon,shortcutContent:t?e.shortcut:R.none(),checkMark:t?R.some(dy(a.icons)):R.none(),caret:R.none(),value:e.value},a,u);return ar(ry({data:oy(e),disabled:e.disabled,getApi:function(e){return{setActive:function(t){Tp.set(e,t)},isActive:function(){return Tp.isOn(e)},isDisabled:function(){return Xd.isDisabled(e)},setDisabled:function(t){return Xd.set(e,t)}}},onAction:function(t){return r(e.value)},onSetup:function(e){return e.setActive(o),g},triggersSubmenu:!1,itemBehaviours:[]},c,i,a),{toggling:{toggleClass:xv,toggleOnExecute:!1,selected:e.active}})}(c,1===n,r,t,i(u.value),o,a,Fv(e)))})):R.none();var c})))},dw=function(e,t){var n=Mv(t);return 1===e?{mode:"menu",moveOnTab:!0}:"auto"===e?{mode:"grid",selector:"."+n.item,initSize:{numColumns:1,numRows:1}}:{mode:"matrix",rowSelector:"."+("color"===t?"tox-swatches__row":"tox-collection__group")}},mw=function(e,t){var n=e.initData.allowCustomColors&&t.colorinput.hasCustomColors();return e.initData.colors.fold((function(){return ow(t.colorinput.getColors(),n)}),(function(e){return e.concat(nw(n))}))},gw=ra("cell-over"),pw=ra("cell-execute"),hw=function(e,t,n){var r,o=function(n){return Ai(n,pw,{row:e,col:t})},i=function(e,t){t.stop(),o(e)};return eu({dom:{tag:"div",attributes:(r={role:"button"},r["aria-labelledby"]=n,r)},behaviours:wc([cp("insert-table-picker-cell",[Ii(Uo(),mp.focus),Ii(ui(),o),Ii(Yo(),i),Ii(si(),i)]),Tp.config({toggleClass:"tox-insert-table-picker__selected",toggleOnExecute:!1}),mp.config({onFocus:function(n){return Ai(n,gw,{row:e,col:t})}})])})},vw=function(e){return J(e,(function(e){return j(e,tu)}))},bw=function(e,t){return Ja(t+1+"x"+(e+1))},yw={inserttable:function(e){var t=ra("size-label"),n=function(e,t,n){for(var r=[],o=0;o<t;o++){for(var i=[],a=0;a<n;a++)i.push(hw(o,a,e));r.push(i)}return r}(t,10,10),r=bh({dom:{tag:"span",classes:["tox-insert-table-picker__label"],attributes:{id:t}},components:[Ja("0x0")],behaviours:wc([up.config({})])});return{type:"widget",data:{value:ra("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[yy.widget({dom:{tag:"div",classes:["tox-insert-table-picker"]},components:vw(n).concat(r.asSpec()),behaviours:wc([cp("insert-table-picker",[Vi(gw,(function(e,t,o){var i=o.event.row,a=o.event.col;!function(e,t,n,r,o){for(var i=0;i<r;i++)for(var a=0;a<o;a++)Tp.set(e[i][a],i<=t&&a<=n)}(n,i,a,10,10),up.set(r.get(e),[bw(i,a)])})),Vi(pw,(function(t,n,r){e.onAction({numRows:r.event.row+1,numColumns:r.event.col+1}),Ei(t,fi())}))]),tp.config({initSize:{numRows:10,numColumns:10},mode:"flatgrid",selector:'[role="button"]'})])})]}},colorswatch:function(e,t){var n=mw(e,t),r=t.colorinput.getColorCols(),o="color",i=lw(ra("menu-value"),n,(function(t){e.onAction({value:t})}),r,o,hv.CLOSE_ON_EXECUTE,C,t.shared.providers),a=T(T({},i),{markers:Mv(o),movement:dw(r,o)});return{type:"widget",data:{value:ra("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[yy.widget(Up.sketch(a))]}}},ww=function(e,t,n,r,o,i,a,u){void 0===u&&(u=!0);var c=py({presets:r,textContent:R.none(),htmlContent:n?e.text.map((function(e){return vy(e,t)})):R.none(),ariaLabel:e.text,iconContent:e.icon,shortcutContent:R.none(),checkMark:R.none(),caret:R.none(),value:e.value},a.providers,u,e.icon);return ry({data:oy(e),disabled:e.disabled,getApi:h({}),onAction:function(t){return o(e.value,e.meta)},onSetup:h(g),triggersSubmenu:!1,itemBehaviours:hy(e.meta,a)},c,i,a.providers)},xw=function(e){var t=e.text.fold((function(){return{}}),(function(e){return{innerHtml:e}}));return{type:"separator",dom:T({tag:"div",classes:[bv,"tox-collection__group-heading"]},t),components:[]}},Cw=function(e,t,n,r){void 0===r&&(r=!0);var o=py({presets:"normal",iconContent:e.icon,textContent:e.text,htmlContent:R.none(),ariaLabel:e.text,caret:R.none(),checkMark:R.none(),shortcutContent:e.shortcut},n,r);return ry({data:oy(e),getApi:function(e){return{isDisabled:function(){return Xd.isDisabled(e)},setDisabled:function(t){return Xd.set(e,t)}}},disabled:e.disabled,onAction:e.onAction,onSetup:e.onSetup,triggersSubmenu:!1,itemBehaviours:[]},o,t,n)},Sw=function(e,t,n,r,o){void 0===r&&(r=!0),void 0===o&&(o=!1);var i,a=o?(i=n.icons,uy("chevron-down",i,[kv])):function(e){return uy("chevron-right",e,[kv])}(n.icons),u=py({presets:"normal",iconContent:e.icon,textContent:e.text,htmlContent:R.none(),ariaLabel:e.text,caret:R.some(a),checkMark:R.none(),shortcutContent:e.shortcut},n,r);return ry({data:oy(e),getApi:function(e){return{isDisabled:function(){return Xd.isDisabled(e)},setDisabled:function(t){return Xd.set(e,t)}}},disabled:e.disabled,onAction:g,onSetup:e.onSetup,triggersSubmenu:!0,itemBehaviours:[]},u,t,n)},kw=function(e,t,n,r){void 0===r&&(r=!0);var o=py({iconContent:e.icon,textContent:e.text,htmlContent:R.none(),ariaLabel:e.text,checkMark:R.some(dy(n.icons)),caret:R.none(),shortcutContent:e.shortcut,presets:"normal",meta:e.meta},n,r);return ar(ry({data:oy(e),disabled:e.disabled,getApi:function(e){return{setActive:function(t){Tp.set(e,t)},isActive:function(){return Tp.isOn(e)},isDisabled:function(){return Xd.isDisabled(e)},setDisabled:function(t){return Xd.set(e,t)}}},onAction:e.onAction,onSetup:e.onSetup,triggersSubmenu:!1,itemBehaviours:[]},o,t,n),{toggling:{toggleClass:xv,toggleOnExecute:!1,selected:e.active}})},Tw=function(e,t){return be(yw,e.fancytype).map((function(n){return n(e,t)}))},Ow=function(e,t,n,r){var o={dom:gy(e.label),optComponents:[R.some({dom:{tag:"div",classes:[Ov,_v]},components:by(e.items,r)})]};return ry({data:oy(T({text:R.none()},e)),disabled:e.disabled,getApi:function(e){return{isDisabled:function(){return Xd.isDisabled(e)},setDisabled:function(t){Xd.set(e,t),U(rl(e.element,"*"),(function(n){e.getSystem().getByDom(n).each((function(e){e.hasConfigured(Xd)&&Xd.set(e,t)}))}))}}},onAction:e.onAction,onSetup:e.onSetup,triggersSubmenu:!1,itemBehaviours:R.from(r.itemBehaviours).getOr([])},o,t,n.providers)};!function(e){e[e.ContentFocus=0]="ContentFocus",e[e.UiFocus=1]="UiFocus"}(Ky||(Ky={}));var _w=function(e,t,n,r,o){var i,a=n.shared.providers,u=function(e){return o?T(T({},e),{shortcut:R.none(),icon:e.text.isSome()?R.none():e.icon}):e};switch(e.type){case"menuitem":return(i=e,Hr("menuitem",tb,i)).fold(Lv,(function(e){return R.some(Cw(u(e),t,a,r))}));case"nestedmenuitem":return function(e){return Hr("nestedmenuitem",nb,e)}(e).fold(Lv,(function(e){return R.some(Sw(u(e),t,a,r,o))}));case"togglemenuitem":return function(e){return Hr("togglemenuitem",rb,e)}(e).fold(Lv,(function(e){return R.some(kw(u(e),t,a,r))}));case"separator":return function(e){return Hr("separatormenuitem",Jh,e)}(e).fold(Lv,(function(e){return R.some(xw(e))}));case"fancymenuitem":return function(e){return Hr("fancymenuitem",eb,e)}(e).fold(Lv,(function(e){return Tw(u(e),n)}));default:return console.error("Unknown item in general menu",e),R.none()}},Ew=function(e,t,n,r,o,i,a){var u=1===r,c=!u||Fv(e);return Ce(j(e,(function(e){switch(e.type){case"separator":return(r=e,Hr("Autocompleter.Separator",Jh,r)).fold(Lv,(function(e){return R.some(xw(e))}));case"cardmenuitem":return function(e){return Hr("cardmenuitem",Xv,e)}(e).fold(Lv,(function(e){return R.some(Ow(T(T({},e),{onAction:function(t){e.onAction(t),n(e.value,e.meta)}}),o,i,{itemBehaviours:hy(e.meta,i),cardText:{matchText:t,highlightOn:a}}))}));default:return function(e){return Hr("Autocompleter.Item",Zh,e)}(e).fold(Lv,(function(e){return R.some(ww(e,t,u,"normal",n,o,i,c))}))}var r})))},Aw=function(e,t,n,r,o){var i=Fv(t),a=Ce(j(t,(function(e){var t=function(e){return _w(e,n,r,function(e){return o?!ye(e,"text"):i}(e),o)};return"nestedmenuitem"===e.type&&e.getSubmenuItems().length<=0?t(T(T({},e),{disabled:!0})):t(e)})));return(o?Hv:Vv)(e,i,a,1,"normal")},Dw=function(e){return Xp.singleData(e.value,e)},Mw=function(e,t){var n=Zc(),r=wo(!1),o=eu(Yp.sketch({dom:{tag:"div",classes:["tox-autocompleter"]},components:[],fireDismissalEventInstead:{},inlineBehaviours:wc([cp("dismissAutocompleter",[Ii(wi(),(function(){return u()}))])]),lazySink:t.getSink})),i=function(){return n.get().isSome()},a=function(){i()&&Yp.hide(o)},u=function(){if(i()){var t=n.get().map((function(e){return e.element}));Ih(t.getOr(Re.fromDom(e.selection.getNode()))).each(An),a(),n.clear(),r.set(!1)}},c=Ve((function(){return gv(e)})),s=function(t,n,r,i){t.matchLength=n.text.length;var a=ce(r,(function(e){return R.from(e.columns)})).getOr(1);Yp.showAt(o,Up.sketch(function(e,t,n,r){var o=n===Ky.ContentFocus?Em():_m(),i=dw(t,r),a=Mv(r);return{dom:e.dom,components:e.components,items:e.items,value:e.value,markers:{selectedItem:a.selectedItem,item:a.item},movement:i,fakeFocus:n===Ky.ContentFocus,focusManager:o,menuBehaviours:ab("auto"!==t?[]:[$i((function(e,t){ob(e,4,a.item).each((function(t){var n=t.numColumns,r=t.numRows;tp.setGridSize(e,r,n)}))}))])}}(Vv("autocompleter-value",!0,i,a,"normal"),a,Ky.ContentFocus,"normal")),{anchor:{type:"node",root:Re.fromDom(e.getBody()),node:R.from(t.element)}}),Yp.getContent(o).each(am.highlightFirst)},l=function(o){(function(t){return n.get().map((function(n){return jh(e.dom,e.selection.getRng(),n.triggerChar).bind((function(n){return Yh(e,c,n,t)}))})).getOrThunk((function(){return Xh(e,c)}))})(o).fold(u,(function(o){!function(t){if(!i()){var o=Ph(e,t.range);n.set({triggerChar:t.triggerChar,element:o,matchLength:t.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=ce(f=i,(function(e){return R.from(e.columns)})).getOr(1),J(f,(function(n){var o=n.items;return Ew(o,n.matchText,(function(t,o){var i=e.selection.getRng();jh(e.dom,i,c).fold((function(){return console.error("Lost context. Cursor probably moved")}),(function(e){var i=e.range,c={hide:function(){u()},reload:function(e){a(),l(e)}};r.set(!0),n.onAction(c,i,t,o),r.set(!1)}))}),d,hv.BUBBLE_TO_SANDBOX,t,n.highlightOn)})));g.length>0?s(n,m,i,g):m.text.length-n.matchLength>=10?u():a()}}))}))}))},f={onKeypress:Rh((function(e){27!==e.which&&l()}),50),cancelIfNecessary:u,isMenuOpen:function(){return Yp.isOpen(o)},isActive:i,isProcessingAction:r.get,getView:function(){return Yp.getContent(o)}};!1===e.hasPlugin("rtc")&&Uh(f,e)},Nw=function(e,t,n){return lu(e,t,n).isSome()},Rw=function(e,t){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(){e.apply(null,r),n=null}),t)}}},zw=function(e){var t=e.raw;return void 0===t.touches||1!==t.touches.length?R.none():R.some(t.touches[0])},Bw=function(e){var t=Zc(),n=wo(!1),r=Rw((function(t){e.triggerEvent(li(),t),n.set(!0)}),400),o=To([{key:Bo(),value:function(e){return zw(e).each((function(o){r.cancel();var i={x:o.clientX,y:o.clientY,target:e.target};r.schedule(e),n.set(!1),t.set(i)})),R.none()}},{key:Po(),value:function(e){return r.cancel(),zw(e).each((function(e){t.on((function(n){(function(e,t){var n=Math.abs(e.clientX-t.x),r=Math.abs(e.clientY-t.y);return n>5||r>5})(e,n)&&t.clear()}))})),R.none()}},{key:Io(),value:function(o){r.cancel();return t.get().filter((function(e){return bt(e.target,o.target)})).map((function(t){return n.get()?(o.prevent(),!1):e.triggerEvent(si(),o)}))}}]);return{fireIfReady:function(e,t){return be(o,t).bind((function(t){return t(e)}))}}},Pw=function(){return pt().browser.isFirefox()},Iw=function(e,t){var n=T({stopBackspace:!0},t),r=Bw(n),o=j(["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(t){return es(e,t,(function(e){r.fireIfReady(e,t).each((function(t){t&&e.kill()})),n.triggerEvent(t,e)&&e.kill()}))})),i=Zc(),a=es(e,"paste",(function(e){r.fireIfReady(e,"paste").each((function(t){t&&e.kill()})),n.triggerEvent("paste",e)&&e.kill(),i.set(setTimeout((function(){n.triggerEvent(ii(),e)}),0))})),u=es(e,"keydown",(function(e){n.triggerEvent("keydown",e)?e.kill():n.stopBackspace&&function(e){return e.raw.which===um[0]&&!F(["input","textarea"],Be(e.target))&&!Nw(e.target,'[contenteditable="true"]')}(e)&&e.prevent()})),c=function(e,t){return Pw()?ts(e,"focus",t):es(e,"focusin",t)}(e,(function(e){n.triggerEvent("focusin",e)&&e.kill()})),s=Zc(),l=function(e,t){return Pw()?ts(e,"blur",t):es(e,"focusout",t)}(e,(function(e){n.triggerEvent("focusout",e)&&e.kill(),s.set(setTimeout((function(){n.triggerEvent(oi(),e)}),0))}));return{unbind:function(){U(o,(function(e){e.unbind()})),u.unbind(),c.unbind(),l.unbind(),a.unbind(),i.on(clearTimeout),s.on(clearTimeout)}}},Fw=function(e,t){var n=be(e,"target").getOr(t);return wo(n)},Lw=xo([{stopped:[]},{resume:["element"]},{complete:[]}]),Hw=function(e,t,n,r,o,i){var a=e(t,r),u=function(e,t){var n=wo(!1),r=wo(!1);return{stop:function(){n.set(!0)},cut:function(){r.set(!0)},isStopped:n.get,isCut:r.get,event:e,setSource:t.set,getSource:t.get}}(n,o);return a.fold((function(){return i.logEventNoHandlers(t,r),Lw.complete()}),(function(e){var n=e.descHandler;return Sa(n)(u),u.isStopped()?(i.logEventStopped(t,e.element,n.purpose),Lw.stopped()):u.isCut()?(i.logEventCut(t,e.element,n.purpose),Lw.complete()):Tt(e.element).fold((function(){return i.logNoParent(t,e.element,n.purpose),Lw.complete()}),(function(r){return i.logEventResponse(t,e.element,n.purpose),Lw.resume(r)}))}))},Vw=function(e,t,n,r,o,i){return Hw(e,t,n,r,o,i).fold(S,(function(r){return Vw(e,t,n,r,o,i)}),C)},jw=function(e,t,n){var r=function(e){var t=wo(!1);return{stop:function(){t.set(!0)},cut:g,isStopped:t.get,isCut:C,event:e,setSource:x("Cannot set source of a broadcasted event"),getSource:x("Cannot get source of a broadcasted event")}}(t);return U(e,(function(e){var t=e.descHandler;Sa(t)(r)})),r.isStopped()},Uw=function(e,t,n,r,o){var i=Fw(n,r);return Vw(e,t,n,r,i,o)},Ww=function(){var e={};return{registerId:function(t,n,r){fe(r,(function(r,o){var i=void 0!==e[o]?e[o]:{};i[n]=function(e,t){return n=y.apply(void 0,[e.handler].concat(t)),r=e.purpose,{cHandler:n,purpose:r};var n,r}(r,t),e[o]=i}))},unregisterId:function(t){fe(e,(function(e,n){ye(e,t)&&delete e[t]}))},filterByType:function(t){return be(e,t).map((function(e){return pe(e,(function(e,t){return function(e,t){return{id:e,descHandler:t}}(t,e)}))})).getOr([])},find:function(t,n,r){return be(e,n).bind((function(e){return Ao(r,(function(t){return function(e,t){return sa(t).bind((function(t){return be(e,t)})).map((function(e){return function(e,t){return{element:e,descHandler:t}}(t,e)}))}(e,t)}),t)}))}}},$w=function(){var e=Ww(),t={},n=function(e){var t=e.element;return sa(t).getOrThunk((function(){return function(e,t){var n=ra(aa+e);return ca(t,n),n}("uid-",e.element)}))},r=function(n){sa(n.element).each((function(n){delete t[n],e.unregisterId(n)}))};return{find:function(t,n,r){return e.find(t,n,r)},filter:function(t){return e.filterByType(t)},register:function(o){var i=n(o);we(t,i)&&function(e,n){var o=t[n];if(o!==e)throw new Error('The tagId "'+n+'" is already used by: '+Qi(o.element)+"\nCannot use it for: "+Qi(e.element)+"\nThe conflicting element is"+(Lt(o.element)?" ":" not ")+"already in the DOM");r(e)}(o,i);var a=[o];e.registerId(a,i,o.events),t[i]=o},unregister:r,getById:function(e){return be(t,e)}}},qw=Dd({name:"Container",factory:function(e){var t=e.dom,n=t.attributes,r=O(t,["attributes"]);return{uid:e.uid,dom:T({tag:"div",attributes:T({role:"presentation"},n)},r),components:e.components,behaviours:Ef(e.containerBehaviours),events:e.events,domModification:e.domModification,eventOrder:e.eventOrder}},configFields:[lo("components",[]),_f("containerBehaviours",[]),lo("events",{}),lo("domModification",{}),lo("eventOrder",{})]}),Gw=function(e){var t=function(t){return Tt(e.element).fold(S,(function(e){return bt(t,e)}))},n=$w(),r=function(e,r){return n.find(t,e,r)},o=Iw(e.element,{triggerEvent:function(e,t){return bu(e,t.target,(function(n){return function(e,t,n,r){return Uw(e,t,n,n.target,r)}(r,e,t,n)}))}}),i={debugInfo:h("real"),triggerEvent:function(e,t,n){bu(e,t,(function(o){return Uw(r,e,n,t,o)}))},triggerFocus:function(e,t){sa(e).fold((function(){Ac(e)}),(function(n){bu(ri(),e,(function(n){return function(e,t,n,r,o){var i=Fw(n,r);Hw(e,t,n,r,i,o)}(r,ri(),{originator:t,kill:g,prevent:g,target:e},e,n),!1}))}))},triggerEscape:function(e,t){i.triggerEvent("keydown",e.element,t.event)},getByUid:function(e){return p(e)},getByDom:function(e){return v(e)},build:eu,addToGui:function(e){c(e)},removeFromGui:function(e){s(e)},addToWorld:function(e){a(e)},removeFromWorld:function(e){u(e)},broadcast:function(e){f(e)},broadcastOn:function(e,t){d(e,t)},broadcastEvent:function(e,t){m(e,t)},isConnected:S},a=function(e){e.connect(i),Fe(e.element)||(n.register(e),U(e.components(),a),i.triggerEvent(mi(),e.element,{target:e.element}))},u=function(e){Fe(e.element)||(U(e.components(),u),n.unregister(e)),e.disconnect()},c=function(t){Vl(e,t)},s=function(e){Wl(e)},l=function(e){var t=n.filter(ai());U(t,(function(t){var n=t.descHandler;Sa(n)(e)}))},f=function(e){l({universal:!0,data:e})},d=function(e,t){l({universal:!1,channels:e,data:t})},m=function(e,t){var r=n.filter(e);return jw(r,t)},p=function(e){return n.getById(e).fold((function(){return Un.error(new Error('Could not find component with uid: "'+e+'" in system.'))}),Un.value)},v=function(e){var t=sa(e).getOr("not found");return p(t)};return a(e),{root:e,element:e.element,destroy:function(){o.unbind(),En(e.element)},add:c,remove:s,getByUid:p,getByDom:v,addToWorld:a,removeFromWorld:u,broadcast:f,broadcastOn:d,broadcastEvent:m}},Kw=h([lo("prefix","form-field"),_f("fieldBehaviours",[Bd,Of])]),Xw=h([od({schema:[Kr("dom")],name:"label"}),od({factory:{sketch:function(e){return{uid:e.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:e.text}}}},schema:[Kr("text")],name:"aria-descriptor"}),nd({factory:{sketch:function(e){var t=So(e,["factory"]);return e.factory.sketch(t)}},schema:[Kr("factory")],name:"field"})]),Yw=Md({name:"FormField",configFields:Kw(),partFields:Xw(),factory:function(e,t,n,r){var o=Af(e.fieldBehaviours,[Bd.config({find:function(t){return hd(t,e,"field")}}),Of.config({store:{mode:"manual",getValue:function(e){return Bd.getCurrent(e).bind(Of.getValue)},setValue:function(e,t){Bd.getCurrent(e).each((function(e){Of.setValue(e,t)}))}}})]),i=zi([$i((function(t,n){var r=bd(t,e,["label","field","aria-descriptor"]);r.field().each((function(t){var n=ra(e.prefix);r.label().each((function(e){Ut(e.element,"for",n),Ut(t.element,"id",n)})),r["aria-descriptor"]().each((function(n){var r=ra(e.prefix);Ut(n.element,"id",r),Ut(t.element,"aria-describedby",r)}))}))}))]),a={getField:function(t){return hd(t,e,"field")},getLabel:function(t){return hd(t,e,"label")}};return{uid:e.uid,dom:e.dom,components:t,behaviours:o,events:i,apis:a}},apis:{getField:function(e,t){return e.getField(t)},getLabel:function(e,t){return e.getLabel(t)}}}),Jw=Object.freeze({__proto__:null,exhibit:function(e,t){return Ca({attributes:To([{key:t.tabAttr,value:"true"}])})}}),Zw=[lo("tabAttr","data-alloy-tabstop")],Qw=Cc({fields:Zw,name:"tabstopping",active:Jw}),ex=tinymce.util.Tools.resolve("tinymce.html.Entities"),tx=function(e,t,n,r){var o=nx(e,t,n,r);return Yw.sketch(o)},nx=function(e,t,n,r){return{dom:rx(n),components:e.toArray().concat([t]),fieldBehaviours:wc(r)}},rx=function(e){return{tag:"div",classes:["tox-form__group"].concat(e)}},ox=function(e,t){return Yw.parts.label({dom:{tag:"label",classes:["tox-label"],innerHtml:t.translate(e)}})},ix=ra("form-component-change"),ax=ra("form-close"),ux=ra("form-cancel"),cx=ra("form-action"),sx=ra("form-submit"),lx=ra("form-block"),fx=ra("form-unblock"),dx=ra("form-tabchange"),mx=ra("form-resize"),gx=function(e,t){var n,r,o,i=e.label.map((function(e){return ox(e,t)})),a=function(e){return function(t,n){lu(n.event.target,"[data-collection-item-value]").each((function(r){e(t,n,r,Wt(r,"data-collection-item-value"))}))}},u=a((function(n,r,o,i){r.stop(),t.isDisabled()||Ai(n,cx,{name:e.name,value:i})})),c=[Ii(Uo(),a((function(e,t,n){Ac(n)}))),Ii(Yo(),u),Ii(si(),u),Ii(Wo(),a((function(e,t,n){su(e.element,"."+Tv).each((function(e){Fa(e,Tv)})),Pa(n,Tv)}))),Ii($o(),a((function(e){su(e.element,"."+Tv).each((function(e){Fa(e,Tv)}))}))),Ki(a((function(t,n,r,o){Ai(t,cx,{name:e.name,value:o})})))],s=function(e,t){return j(rl(e.element,".tox-collection__item"),t)},l=Yw.parts.field({dom:{tag:"div",classes:["tox-collection"].concat(1!==e.columns?["tox-collection--grid"]:["tox-collection--list"])},components:[],factory:{sketch:v},behaviours:wc([Xd.config({disabled:t.isDisabled,onDisabled:function(e){s(e,(function(e){Pa(e,"tox-collection__item--state-disabled"),Ut(e,"aria-disabled",!0)}))},onEnabled:function(e){s(e,(function(e){Fa(e,"tox-collection__item--state-disabled"),Gt(e,"aria-disabled")}))}}),qb(),up.config({}),Of.config({store:{mode:"memory",initialValue:[]},onSetValue:function(n,r){!function(n,r){var o=j(r,(function(n){var r=yh.translate(n.text),o=1===e.columns?'<div class="tox-collection__item-label">'+r+"</div>":"",i='<div class="tox-collection__item-icon">'+n.icon+"</div>",a={_:" "," - ":" ","-":" "},u=r.replace(/\_| \- |\-/g,(function(e){return a[e]}));return'<div class="tox-collection__item'+(t.isDisabled()?" tox-collection__item--state-disabled":"")+'" tabindex="-1" data-collection-item-value="'+ex.encodeAllRaw(n.value)+'" title="'+u+'" aria-label="'+u+'">'+i+o+"</div>"})),i="auto"!==e.columns&&e.columns>1?V(o,e.columns):[o],a=j(i,(function(e){return'<div class="tox-collection__group">'+e.join("")+"</div>"}));Yi(n.element,a.join(""))}(n,r),"auto"===e.columns&&ob(n,5,"tox-collection__item").each((function(e){var t=e.numRows,r=e.numColumns;tp.setGridSize(n,t,r)})),Ei(n,mx)}}),Qw.config({}),tp.config((r=e.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":"."+bv}})),cp("collection-events",c)]),eventOrder:(n={},n[ui()]=["disabling","alloy.base.behaviour","collection-events"],n)});return tx(i,l,["tox-form__group--collection"],[])},px=h([ro("data"),lo("inputAttributes",{}),lo("inputStyles",{}),lo("tag","input"),lo("inputClasses",[]),_u("onSetValue"),lo("styles",{}),lo("eventOrder",{}),_f("inputBehaviours",[Of,mp]),lo("selectOnFocus",!0)]),hx=function(e){return wc([mp.config({onFocus:e.selectOnFocus?function(e){var t=e.element,n=ja(t);t.dom.setSelectionRange(0,n.length)}:g})])},vx=function(e){return T(T({},hx(e)),Af(e.inputBehaviours,[Of.config({store:T(T({mode:"manual"},e.data.map((function(e){return{initialValue:e}})).getOr({})),{getValue:function(e){return ja(e.element)},setValue:function(e,t){ja(e.element)!==t&&Ua(e.element,t)}}),onSetValue:e.onSetValue})]))},bx=function(e){return{tag:e.tag,attributes:T({type:"text"},e.inputAttributes),styles:e.inputStyles,classes:e.inputClasses}},yx=Dd({name:"Input",configFields:px(),factory:function(e,t){return{uid:e.uid,dom:bx(e),components:[],behaviours:vx(e),eventOrder:e.eventOrder}}}),wx={},xx={exports:wx};!function(e,t,n,r){!function(r,o){"object"==typeof t&&void 0!==n?n.exports=o():"function"==typeof e&&e.amd?e(o):(r="undefined"!=typeof globalThis?globalThis:r||self).EphoxContactWrapper=o()}(this,(function(){var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t={exports:{}};!function(t){!function(e){var n=setTimeout;function r(){}function o(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],l(e,this)}function i(e,t){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,o._immediateFn((function(){var n=1===e._state?t.onFulfilled:t.onRejected;if(null!==n){var r;try{r=n(e._value)}catch(e){return void u(t.promise,e)}a(t.promise,r)}else(1===e._state?a:u)(t.promise,e._value)}))):e._deferreds.push(t)}function a(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if(t instanceof o)return e._state=3,e._value=t,void c(e);if("function"==typeof n)return void l((r=n,i=t,function(){r.apply(i,arguments)}),e)}e._state=1,e._value=t,c(e)}catch(t){u(e,t)}var r,i}function u(e,t){e._state=2,e._value=t,c(e)}function c(e){2===e._state&&0===e._deferreds.length&&o._immediateFn((function(){e._handled||o._unhandledRejectionFn(e._value)}));for(var t=0,n=e._deferreds.length;t<n;t++)i(e,e._deferreds[t]);e._deferreds=null}function s(e,t,n){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=n}function l(e,t){var n=!1;try{e((function(e){n||(n=!0,a(t,e))}),(function(e){n||(n=!0,u(t,e))}))}catch(e){if(n)return;n=!0,u(t,e)}}o.prototype.catch=function(e){return this.then(null,e)},o.prototype.then=function(e,t){var n=new this.constructor(r);return i(this,new s(e,t,n)),n},o.all=function(e){var t=Array.prototype.slice.call(e);return new o((function(e,n){if(0===t.length)return e([]);var r=t.length;function o(i,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var u=a.then;if("function"==typeof u)return void u.call(a,(function(e){o(i,e)}),n)}t[i]=a,0==--r&&e(t)}catch(e){n(e)}}for(var i=0;i<t.length;i++)o(i,t[i])}))},o.resolve=function(e){return e&&"object"==typeof e&&e.constructor===o?e:new o((function(t){t(e)}))},o.reject=function(e){return new o((function(t,n){n(e)}))},o.race=function(e){return new o((function(t,n){for(var r=0,o=e.length;r<o;r++)e[r].then(t,n)}))},o._immediateFn="function"==typeof setImmediate?function(e){setImmediate(e)}:function(e){n(e,0)},o._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)},o._setImmediateFn=function(e){o._immediateFn=e},o._setUnhandledRejectionFn=function(e){o._unhandledRejectionFn=e},t.exports?t.exports=o:e.Promise||(e.Promise=o)}(e)}(t);var n=t.exports;return{boltExport:("undefined"!=typeof window?window:Function("return this;")()).Promise||n}}))}(void 0,wx,xx);var Cx,Sx=xx.exports.boltExport,kx=function(e){var t=R.none(),n=[],r=function(e){o()?a(e):n.push(e)},o=function(){return t.isSome()},i=function(e){U(e,a)},a=function(e){t.each((function(t){setTimeout((function(){e(t)}),0)}))};return e((function(e){o()||(t=R.some(e),i(n),n=[])})),{get:r,map:function(e){return kx((function(t){r((function(n){t(e(n))}))}))},isReady:o}},Tx={nu:kx,pure:function(e){return kx((function(t){t(e)}))}},Ox=function(e){setTimeout((function(){throw e}),0)},_x=function(e){var t=function(t){e().then(t,Ox)};return{map:function(t){return _x((function(){return e().then(t)}))},bind:function(t){return _x((function(){return e().then((function(e){return t(e).toPromise()}))}))},anonBind:function(t){return _x((function(){return e().then((function(){return t.toPromise()}))}))},toLazy:function(){return Tx.nu(t)},toCached:function(){var t=null;return _x((function(){return null===t&&(t=e()),t}))},toPromise:e,get:t}},Ex=function(e){return _x((function(){return new Sx(e)}))},Ax=function(e){return _x((function(){return Sx.resolve(e)}))},Dx=["input","textarea"],Mx=function(e){var t=Be(e);return F(Dx,t)},Nx=function(e,t){var n=t.getRoot(e).getOr(e.element);Fa(n,t.invalidClass),t.notify.each((function(t){Mx(e.element)&&Ut(e.element,"aria-invalid",!1),t.getContainer(e).each((function(e){Yi(e,t.validHtml)})),t.onValid(e)}))},Rx=function(e,t,n,r){var o=t.getRoot(e).getOr(e.element);Pa(o,t.invalidClass),t.notify.each((function(t){Mx(e.element)&&Ut(e.element,"aria-invalid",!0),t.getContainer(e).each((function(e){Yi(e,r)})),t.onInvalid(e,r)}))},zx=function(e,t,n){return t.validator.fold((function(){return Ax(Un.value(!0))}),(function(t){return t.validate(e)}))},Bx=function(e,t,n){return t.notify.each((function(t){t.onValidate(e)})),zx(e,t).map((function(n){return e.getSystem().isConnected()?n.fold((function(n){return Rx(e,t,0,n),Un.error(n)}),(function(n){return Nx(e,t),Un.value(n)})):Un.error("No longer in system")}))},Px=Object.freeze({__proto__:null,markValid:Nx,markInvalid:Rx,query:zx,run:Bx,isInvalid:function(e,t){var n=t.getRoot(e).getOr(e.element);return La(n,t.invalidClass)}}),Ix=Object.freeze({__proto__:null,events:function(e,t){return e.validator.map((function(t){return zi([Ii(t.onEvent,(function(t){Bx(t,e).get(v)}))].concat(t.validateOnLoad?[$i((function(t){Bx(t,e).get(g)}))]:[]))})).getOr({})}}),Fx=[Kr("invalidClass"),lo("getRoot",R.none),so("notify",[lo("aria","alert"),lo("getContainer",R.none),lo("validHtml",""),_u("onValid"),_u("onInvalid"),_u("onValidate")]),so("validator",[Kr("validate"),lo("onEvent","input"),lo("validateOnLoad",!0)])],Lx=Cc({fields:Fx,name:"invalidating",active:Ix,apis:Px,extra:{validation:function(e){return function(t){var n=Of.getValue(t);return Ax(e(n))}}}}),Hx=Object.freeze({__proto__:null,getCoupled:function(e,t,n,r){return n.getOrCreate(e,t,r)}}),Vx=[Xr("others",Lr(Un.value,Er()))],jx=Object.freeze({__proto__:null,init:function(){var e={},t=h({});return wa({readState:t,getOrCreate:function(t,n,r){var o=se(n.others);if(o)return be(e,r).getOrThunk((function(){var o=be(n.others,r).getOrDie("No information found for coupled component: "+r)(t),i=t.getSystem().build(o);return e[r]=i,i}));throw new Error("Cannot find coupled component: "+r+". Known coupled components: "+JSON.stringify(o,null,2))}})}}),Ux=Cc({fields:Vx,name:"coupling",apis:Hx,state:jx}),Wx=h("sink"),$x=h(od({name:Wx(),overrides:h({dom:{tag:"div"},behaviours:wc([Pl.config({useFixed:S})]),events:zi([ji(qo()),ji(Lo()),ji(Yo())])})}));!function(e){e[e.HighlightFirst=0]="HighlightFirst",e[e.HighlightNone=1]="HighlightNone"}(Cx||(Cx={}));var qx,Gx,Kx,Xx=function(e,t){var n=e.getHotspot(t).getOr(t),r="hotspot",o=e.getAnchorOverrides();return e.layouts.fold((function(){return{type:r,hotspot:n,overrides:o}}),(function(e){return{type:r,hotspot:n,overrides:o,layouts:e}}))},Yx=function(e,t,n,r,o,i,a){var u=function(e,t,n,r,o,i,a){var u=function(e,t,n){return(0,e.fetch)(n).map(t)}(e,t,r),c=eC(r,e);return u.map((function(e){return e.bind((function(e){return R.from(Xp.sketch(T(T({},i.menu()),{uid:la(""),data:e,highlightImmediately:a===Cx.HighlightFirst,onOpenMenu:function(e,t){var r=c().getOrDie();Pl.position(r,t,{anchor:n}),af.decloak(o)},onOpenSubmenu:function(e,t,n){var r=c().getOrDie();Pl.position(r,n,{anchor:{type:"submenu",item:t}}),af.decloak(o)},onRepositionMenu:function(e,t,r){var o=c().getOrDie();Pl.position(o,t,{anchor:n}),U(r,(function(e){Pl.position(o,e.triggeredMenu,{anchor:{type:"submenu",item:e.triggeringItem}})}))},onEscape:function(){return mp.focus(r),af.close(o),R.some(!0)}})))}))}))}(e,t,Xx(e,n),n,r,o,a);return u.map((function(e){return e.fold((function(){af.isOpen(r)&&af.close(r)}),(function(e){af.cloak(r),af.open(r,e),i(r)})),r}))},Jx=function(e,t,n,r,o,i,a){return af.close(r),Ax(r)},Zx=function(e,t,n,r,o,i){var a=Ux.getCoupled(n,"sandbox");return(af.isOpen(a)?Jx:Yx)(e,t,n,a,r,o,i)},Qx=function(e,t,n){var r=Bd.getCurrent(t).getOr(t),o=vn(e.element);n?Yt(r.element,"min-width",o+"px"):function(e,t){hn.set(e,t)}(r.element,o)},eC=function(e,t){return e.getSystem().getByUid(t.uid+"-"+Wx()).map((function(e){return function(){return Un.value(e)}})).getOrThunk((function(){return t.lazySink.fold((function(){return function(){return Un.error(new Error("No internal sink is specified, nor could an external sink be found"))}}),(function(t){return function(){return t(e)}}))}))},tC=function(e){af.getState(e).each((function(e){Xp.repositionMenus(e)}))},nC=function(e,t,n){var r=fu(),o=eC(t,e);return{dom:{tag:"div",classes:e.sandboxClasses,attributes:{id:r.id,role:"listbox"}},behaviours:Mf(e.sandboxBehaviours,[Of.config({store:{mode:"memory",initialValue:t}}),af.config({onOpen:function(o,i){var a=Xx(e,t);r.link(t.element),e.matchWidth&&Qx(a.hotspot,i,e.useMinWidth),e.onOpen(a,o,i),void 0!==n&&void 0!==n.onOpen&&n.onOpen(o,i)},onClose:function(e,o){r.unlink(t.element),void 0!==n&&void 0!==n.onClose&&n.onClose(e,o)},isPartOf:function(e,n,r){return mu(n,r)||mu(t,r)},getAttachPoint:function(){return o().getOrDie()}}),Bd.config({find:function(e){return af.getState(e).bind((function(e){return Bd.getCurrent(e)}))}}),Oc.config({channels:T(T({},ff({isExtraPart:C})),mf({doReposition:tC}))})])}},rC=function(e){var t=Ux.getCoupled(e,"sandbox");tC(t)},oC=function(){return[lo("sandboxClasses",[]),Df("sandboxBehaviours",[Bd,Oc,af,Of])]},iC=h([Kr("dom"),Kr("fetch"),_u("onOpen"),Eu("onExecute"),lo("getHotspot",R.some),lo("getAnchorOverrides",h({})),ks(),_f("dropdownBehaviours",[Tp,Ux,tp,mp]),Kr("toggleClass"),lo("eventOrder",{}),ro("lazySink"),lo("matchWidth",!1),lo("useMinWidth",!1),ro("role")].concat(oC())),aC=h([rd({schema:[ku()],name:"menu",defaults:function(e){return{onExecute:e.onExecute}}}),$x()]),uC=Md({name:"Dropdown",configFields:iC(),partFields:aC(),factory:function(e,t,n,r){var o,i,a=function(e){af.getState(e).each((function(e){Xp.highlightPrimary(e)}))},u={expand:function(t){Tp.isOn(t)||Zx(e,v,t,r,g,Cx.HighlightNone).get(g)},open:function(t){Tp.isOn(t)||Zx(e,v,t,r,g,Cx.HighlightFirst).get(g)},isOpen:Tp.isOn,close:function(t){Tp.isOn(t)&&Zx(e,v,t,r,g,Cx.HighlightFirst).get(g)},repositionMenus:function(e){Tp.isOn(e)&&rC(e)}},c=function(e,t){return Di(e),R.some(!0)};return{uid:e.uid,dom:e.dom,components:t,behaviours:Af(e.dropdownBehaviours,[Tp.config({toggleClass:e.toggleClass,aria:{mode:"expanded"}}),Ux.config({others:{sandbox:function(t){return nC(e,t,{onOpen:function(){return Tp.on(t)},onClose:function(){return Tp.off(t)}})}}}),tp.config({mode:"special",onSpace:c,onEnter:c,onDown:function(e,t){if(uC.isOpen(e)){var n=Ux.getCoupled(e,"sandbox");a(n)}else uC.open(e);return R.some(!0)},onEscape:function(e,t){return uC.isOpen(e)?(uC.close(e),R.some(!0)):R.none()}}),mp.config({})]),events:_p(R.some((function(t){Zx(e,v,t,r,a,Cx.HighlightFirst).get(g)}))),eventOrder:T(T({},e.eventOrder),(o={},o[ui()]=["disabling","toggling","alloy.base.behaviour"],o)),apis:u,domModification:{attributes:T(T({"aria-haspopup":"true"},e.role.fold((function(){return{}}),(function(e){return{role:e}}))),"button"===e.dom.tag?{type:(i="type",be(e.dom,"attributes").bind((function(e){return be(e,i)}))).getOr("button")}:{})}}},apis:{open:function(e,t){return e.open(t)},expand:function(e,t){return e.expand(t)},close:function(e,t){return e.close(t)},isOpen:function(e,t){return e.isOpen(t)},repositionMenus:function(e,t){return e.repositionMenus(t)}}}),cC=Object.freeze({__proto__:null,events:function(){return zi([Bi(ei(),S)])},exhibit:function(){return Ca({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})}}),sC=Cc({fields:[],name:"unselecting",active:cC}),lC=ra("color-input-change"),fC=ra("color-swatch-change"),dC=ra("color-picker-cancel"),mC=function(e,t,n){var r=Yw.parts.field({factory:yx,inputClasses:["tox-textfield"],onSetValue:function(e){return Lx.run(e).get(g)},inputBehaviours:wc([Xd.config({disabled:t.providers.isDisabled}),qb(),Qw.config({}),Lx.config({invalidClass:"tox-textbox-field-invalid",getRoot:function(e){return Tt(e.element)},notify:{onValid:function(e){var t=Of.getValue(e);Ai(e,lC,{color:t})}},validator:{validateOnLoad:!1,validate:function(e){var t=Of.getValue(e);if(0===t.length)return Ax(Un.value(!0));var n=Re.fromTag("span");Yt(n,"background-color",t);var r=tn(n,"background-color").fold((function(){return Un.error("blah")}),(function(e){return Un.value(t)}));return Ax(r)}}})]),selectOnFocus:!1}),o=e.label.map((function(e){return ox(e,t.providers)})),i=function(e,t){Ai(e,fC,{value:t})},a=bh(function(e,t){return uC.sketch({dom:e.dom,components:e.components,toggleClass:"mce-active",dropdownBehaviours:wc([Kb(t.providers.isDisabled),qb(),sC.config({}),Qw.config({})]),layouts:e.layouts,sandboxClasses:["tox-dialog__popups"],lazySink:t.getSink,fetch:function(n){return Ex((function(t){return e.fetch(t)})).map((function(r){return R.from(Dw(ar(lw(ra("menu-value"),r,(function(t){e.onItemAction(n,t)}),e.columns,e.presets,hv.CLOSE_ON_EXECUTE,C,t.providers),{movement:dw(e.columns,e.presets)})))}))},parts:{menu:zv(0,0,e.presets)}})}({dom:{tag:"span",attributes:{"aria-label":t.providers.translate("Color swatch")}},layouts:{onRtl:function(){return[tc,ec,ic]},onLtr:function(){return[ec,tc,ic]}},components:[],fetch:iw(n.getColors(),n.hasCustomColors()),columns:n.getColorCols(),presets:"color",onItemAction:function(e,t){a.getOpt(e).each((function(e){"custom"===t?n.colorPicker((function(t){t.fold((function(){return Ei(e,dC)}),(function(t){i(e,t),ew(t)}))}),"#ffffff"):i(e,"remove"===t?"":t)}))}},t));return Yw.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:o.toArray().concat([{dom:{tag:"div",classes:["tox-color-input"]},components:[r,a.asSpec()]}]),fieldBehaviours:wc([cp("form-field-events",[Ii(lC,(function(t,n){a.getOpt(t).each((function(e){Yt(e.element,"background-color",n.event.color)})),Ai(t,ix,{name:e.name})})),Ii(fC,(function(e,t){Yw.getField(e).each((function(n){Of.setValue(n,t.event.value),Bd.getCurrent(e).each(mp.focus)}))})),Ii(dC,(function(e,t){Yw.getField(e).each((function(t){Bd.getCurrent(e).each(mp.focus)}))}))])])})},gC=od({schema:[Kr("dom")],name:"label"}),pC=function(e){return od({name:e+"-edge",overrides:function(t){return t.model.manager.edgeActions[e].fold((function(){return{}}),(function(e){return{events:zi([Fi(Bo(),(function(t,n,r){return e(t,r)}),[t]),Fi(Lo(),(function(t,n,r){return e(t,r)}),[t]),Fi(Ho(),(function(t,n,r){r.mouseIsDown.get()&&e(t,r)}),[t])])}}))}})},hC=pC("top-left"),vC=pC("top"),bC=pC("top-right"),yC=pC("right"),wC=pC("bottom-right"),xC=pC("bottom"),CC=pC("bottom-left"),SC=pC("left"),kC=nd({name:"thumb",defaults:h({dom:{styles:{position:"absolute"}}}),overrides:function(e){return{events:zi([Hi(Bo(),e,"spectrum"),Hi(Po(),e,"spectrum"),Hi(Io(),e,"spectrum"),Hi(Lo(),e,"spectrum"),Hi(Ho(),e,"spectrum"),Hi(jo(),e,"spectrum")])}}}),TC=nd({schema:[qr("mouseIsDown",(function(){return wo(!1)}))],name:"spectrum",overrides:function(e){var t=e.model.manager,n=function(n,r){return t.getValueFromEvent(r).map((function(r){return t.setValueFrom(n,e,r)}))};return{behaviours:wc([tp.config({mode:"special",onLeft:function(n){return t.onLeft(n,e)},onRight:function(n){return t.onRight(n,e)},onUp:function(n){return t.onUp(n,e)},onDown:function(n){return t.onDown(n,e)}}),mp.config({})]),events:zi([Ii(Bo(),n),Ii(Po(),n),Ii(Lo(),n),Ii(Ho(),(function(t,r){e.mouseIsDown.get()&&n(t,r)}))])}}}),OC=[gC,SC,yC,vC,xC,hC,bC,CC,wC,kC,TC],_C=h("slider.change.value"),EC=function(e){var t=e.event.raw;if(function(e){return-1!==e.type.indexOf("touch")}(t)){var n=t;return void 0!==n.touches&&1===n.touches.length?R.some(n.touches[0]).map((function(e){return dn(e.clientX,e.clientY)})):R.none()}var r=t;return void 0!==r.clientX?R.some(r).map((function(e){return dn(e.clientX,e.clientY)})):R.none()},AC=function(e){return e.model.minX},DC=function(e){return e.model.minY},MC=function(e){return e.model.minX-1},NC=function(e){return e.model.minY-1},RC=function(e){return e.model.maxX},zC=function(e){return e.model.maxY},BC=function(e){return e.model.maxX+1},PC=function(e){return e.model.maxY+1},IC=function(e,t,n){return t(e)-n(e)},FC=function(e){return IC(e,RC,AC)},LC=function(e){return IC(e,zC,DC)},HC=function(e){return FC(e)/2},VC=function(e){return LC(e)/2},jC=function(e){return e.stepSize},UC=function(e){return e.snapToGrid},WC=function(e){return e.snapStart},$C=function(e){return e.rounded},qC=function(e,t){return void 0!==e[t+"-edge"]},GC=function(e){return qC(e,"left")},KC=function(e){return qC(e,"right")},XC=function(e){return qC(e,"top")},YC=function(e){return qC(e,"bottom")},JC=function(e){return e.model.value.get()},ZC=function(e){return{x:e}},QC=function(e){return{y:e}},eS=function(e,t){return{x:e,y:t}},tS=function(e,t){Ai(e,_C(),{value:t})},nS=function(e,t,n,r){return e<t?e:e>n?n:e===t?t-1:Math.max(t,e-r)},rS=function(e,t,n,r){return e>n?e:e<t?t:e===n?n+1:Math.min(n,e+r)},oS=function(e,t,n){return Math.max(t,Math.min(n,e))},iS=function(e){var t=e.min,n=e.max,r=e.range,o=e.value,i=e.step,a=e.snap,u=e.snapStart,c=e.rounded,s=e.hasMinEdge,l=e.hasMaxEdge,f=e.minBound,d=e.maxBound,m=e.screenRange,g=s?t-1:t,p=l?n+1:n;if(o<f)return g;if(o>d)return p;var h=function(e,t,n){return Math.min(n,Math.max(e,t))-t}(o,f,d),v=oS(h/m*r+t,g,p);return a&&v>=t&&v<=n?function(e,t,n,r,o){return o.fold((function(){var o=e-t,i=Math.round(o/r)*r;return oS(t+i,t-1,n+1)}),(function(t){var o=(e-t)%r,i=Math.round(o/r),a=Math.floor((e-t)/r),u=Math.floor((n-t)/r),c=t+Math.min(u,a+i)*r;return Math.max(t,c)}))}(v,t,n,i,u):c?Math.round(v):v},aS=function(e){var t=e.min,n=e.max,r=e.range,o=e.value,i=e.hasMinEdge,a=e.hasMaxEdge,u=e.maxBound,c=e.maxOffset,s=e.centerMinEdge,l=e.centerMaxEdge;return o<t?i?0:s:o>n?a?u:l:(o-t)/r*c},uS="top",cS="right",sS="bottom",lS="left",fS=function(e){return e.element.dom.getBoundingClientRect()},dS=function(e,t){return e[t]},mS=function(e){var t=fS(e);return dS(t,lS)},gS=function(e){var t=fS(e);return dS(t,cS)},pS=function(e){var t=fS(e);return dS(t,uS)},hS=function(e){var t=fS(e);return dS(t,sS)},vS=function(e){var t=fS(e);return dS(t,"width")},bS=function(e){var t=fS(e);return dS(t,"height")},yS=function(e,t,n){return(e+t)/2-n},wS=function(e,t){var n=fS(e),r=fS(t),o=dS(n,lS),i=dS(n,cS),a=dS(r,lS);return yS(o,i,a)},xS=function(e,t){var n=fS(e),r=fS(t),o=dS(n,uS),i=dS(n,sS),a=dS(r,uS);return yS(o,i,a)},CS=function(e,t){Ai(e,_C(),{value:t})},SS=function(e){return{x:e}},kS=function(e,t,n){var r={min:AC(t),max:RC(t),range:FC(t),value:n,step:jC(t),snap:UC(t),snapStart:WC(t),rounded:$C(t),hasMinEdge:GC(t),hasMaxEdge:KC(t),minBound:mS(e),maxBound:gS(e),screenRange:vS(e)};return iS(r)},TS=function(e){return function(t,n){return function(e,t,n){var r=(e>0?rS:nS)(JC(n).x,AC(n),RC(n),jC(n));return CS(t,SS(r)),R.some(r)}(e,t,n).map(S)}},OS=function(e,t,n,r,o,i){var a=function(e,t,n,r,o){var i=vS(e),a=r.bind((function(t){return R.some(wS(t,e))})).getOr(0),u=o.bind((function(t){return R.some(wS(t,e))})).getOr(i),c={min:AC(t),max:RC(t),range:FC(t),value:n,hasMinEdge:GC(t),hasMaxEdge:KC(t),minBound:mS(e),minOffset:0,maxBound:gS(e),maxOffset:i,centerMinEdge:a,centerMaxEdge:u};return aS(c)}(t,i,n,r,o);return mS(t)-mS(e)+a},_S=TS(-1),ES=TS(1),AS=R.none,DS=R.none,MS={"top-left":R.none(),top:R.none(),"top-right":R.none(),right:R.some((function(e,t){tS(e,ZC(BC(t)))})),"bottom-right":R.none(),bottom:R.none(),"bottom-left":R.none(),left:R.some((function(e,t){tS(e,ZC(MC(t)))}))},NS=Object.freeze({__proto__:null,setValueFrom:function(e,t,n){var r=kS(e,t,n),o=SS(r);return CS(e,o),r},setToMin:function(e,t){var n=AC(t);CS(e,SS(n))},setToMax:function(e,t){var n=RC(t);CS(e,SS(n))},findValueOfOffset:kS,getValueFromEvent:function(e){return EC(e).map((function(e){return e.left}))},findPositionOfValue:OS,setPositionFromValue:function(e,t,n,r){var o=JC(n),i=OS(e,r.getSpectrum(e),o.x,r.getLeftEdge(e),r.getRightEdge(e),n),a=vn(t.element)/2;Yt(t.element,"left",i-a+"px")},onLeft:_S,onRight:ES,onUp:AS,onDown:DS,edgeActions:MS}),RS=function(e,t){Ai(e,_C(),{value:t})},zS=function(e){return{y:e}},BS=function(e,t,n){var r={min:DC(t),max:zC(t),range:LC(t),value:n,step:jC(t),snap:UC(t),snapStart:WC(t),rounded:$C(t),hasMinEdge:XC(t),hasMaxEdge:YC(t),minBound:pS(e),maxBound:hS(e),screenRange:bS(e)};return iS(r)},PS=function(e){return function(t,n){return function(e,t,n){var r=(e>0?rS:nS)(JC(n).y,DC(n),zC(n),jC(n));return RS(t,zS(r)),R.some(r)}(e,t,n).map(S)}},IS=function(e,t,n,r,o,i){var a=function(e,t,n,r,o){var i=bS(e),a=r.bind((function(t){return R.some(xS(t,e))})).getOr(0),u=o.bind((function(t){return R.some(xS(t,e))})).getOr(i),c={min:DC(t),max:zC(t),range:LC(t),value:n,hasMinEdge:XC(t),hasMaxEdge:YC(t),minBound:pS(e),minOffset:0,maxBound:hS(e),maxOffset:i,centerMinEdge:a,centerMaxEdge:u};return aS(c)}(t,i,n,r,o);return pS(t)-pS(e)+a},FS=R.none,LS=R.none,HS=PS(-1),VS=PS(1),jS={"top-left":R.none(),top:R.some((function(e,t){tS(e,QC(NC(t)))})),"top-right":R.none(),right:R.none(),"bottom-right":R.none(),bottom:R.some((function(e,t){tS(e,QC(PC(t)))})),"bottom-left":R.none(),left:R.none()},US=Object.freeze({__proto__:null,setValueFrom:function(e,t,n){var r=BS(e,t,n),o=zS(r);return RS(e,o),r},setToMin:function(e,t){var n=DC(t);RS(e,zS(n))},setToMax:function(e,t){var n=zC(t);RS(e,zS(n))},findValueOfOffset:BS,getValueFromEvent:function(e){return EC(e).map((function(e){return e.top}))},findPositionOfValue:IS,setPositionFromValue:function(e,t,n,r){var o=JC(n),i=IS(e,r.getSpectrum(e),o.y,r.getTopEdge(e),r.getBottomEdge(e),n),a=sn(t.element)/2;Yt(t.element,"top",i-a+"px")},onLeft:FS,onRight:LS,onUp:HS,onDown:VS,edgeActions:jS}),WS=function(e,t){Ai(e,_C(),{value:t})},$S=function(e,t){return{x:e,y:t}},qS=function(e,t){return function(n,r){return function(e,t,n,r){var o=e>0?rS:nS,i=t?JC(r).x:o(JC(r).x,AC(r),RC(r),jC(r)),a=t?o(JC(r).y,DC(r),zC(r),jC(r)):JC(r).y;return WS(n,$S(i,a)),R.some(i)}(e,t,n,r).map(S)}},GS=qS(-1,!1),KS=qS(1,!1),XS=qS(-1,!0),YS=qS(1,!0),JS={"top-left":R.some((function(e,t){tS(e,eS(MC(t),NC(t)))})),top:R.some((function(e,t){tS(e,eS(HC(t),NC(t)))})),"top-right":R.some((function(e,t){tS(e,eS(BC(t),NC(t)))})),right:R.some((function(e,t){tS(e,eS(BC(t),VC(t)))})),"bottom-right":R.some((function(e,t){tS(e,eS(BC(t),PC(t)))})),bottom:R.some((function(e,t){tS(e,eS(HC(t),PC(t)))})),"bottom-left":R.some((function(e,t){tS(e,eS(MC(t),PC(t)))})),left:R.some((function(e,t){tS(e,eS(MC(t),VC(t)))}))},ZS=Object.freeze({__proto__:null,setValueFrom:function(e,t,n){var r=kS(e,t,n.left),o=BS(e,t,n.top),i=$S(r,o);return WS(e,i),i},setToMin:function(e,t){var n=AC(t),r=DC(t);WS(e,$S(n,r))},setToMax:function(e,t){var n=RC(t),r=zC(t);WS(e,$S(n,r))},getValueFromEvent:function(e){return EC(e)},setPositionFromValue:function(e,t,n,r){var o=JC(n),i=OS(e,r.getSpectrum(e),o.x,r.getLeftEdge(e),r.getRightEdge(e),n),a=IS(e,r.getSpectrum(e),o.y,r.getTopEdge(e),r.getBottomEdge(e),n),u=vn(t.element)/2,c=sn(t.element)/2;Yt(t.element,"left",i-u+"px"),Yt(t.element,"top",a-c+"px")},onLeft:GS,onRight:KS,onUp:XS,onDown:YS,edgeActions:JS}),QS=Md({name:"Slider",configFields:[lo("stepSize",1),lo("onChange",g),lo("onChoose",g),lo("onInit",g),lo("onDragStart",g),lo("onDragEnd",g),lo("snapToGrid",!1),lo("rounded",!0),ro("snapStart"),Xr("model",Wr("mode",{x:[lo("minX",0),lo("maxX",100),qr("value",(function(e){return wo(e.mode.minX)})),Kr("getInitialValue"),Mu("manager",NS)],y:[lo("minY",0),lo("maxY",100),qr("value",(function(e){return wo(e.mode.minY)})),Kr("getInitialValue"),Mu("manager",US)],xy:[lo("minX",0),lo("maxX",100),lo("minY",0),lo("maxY",100),qr("value",(function(e){return wo({x:e.mode.minX,y:e.mode.minY})})),Kr("getInitialValue"),Mu("manager",ZS)]})),_f("sliderBehaviours",[tp,Of]),qr("mouseIsDown",(function(){return wo(!1)}))],partFields:OC,factory:function(e,t,n,r){var o,i=function(t){return vd(t,e,"thumb")},a=function(t){return vd(t,e,"spectrum")},u=function(t){return hd(t,e,"left-edge")},c=function(t){return hd(t,e,"right-edge")},s=function(t){return hd(t,e,"top-edge")},l=function(t){return hd(t,e,"bottom-edge")},f=e.model,d=f.manager,m=function(t,n){d.setPositionFromValue(t,n,e,{getLeftEdge:u,getRightEdge:c,getTopEdge:s,getBottomEdge:l,getSpectrum:a})},g=function(e,t){f.value.set(t);var n=i(e);m(e,n)},p=function(t){var n=e.mouseIsDown.get();e.mouseIsDown.set(!1),n&&hd(t,e,"thumb").each((function(n){var r=f.value.get();e.onChoose(t,n,r)}))},h=function(t,n){n.stop(),e.mouseIsDown.set(!0),e.onDragStart(t,i(t))},v=function(t,n){n.stop(),e.onDragEnd(t,i(t)),p(t)};return{uid:e.uid,dom:e.dom,components:t,behaviours:Af(e.sliderBehaviours,[tp.config({mode:"special",focusIn:function(t){return hd(t,e,"spectrum").map(tp.focusIn).map(S)}}),Of.config({store:{mode:"manual",getValue:function(e){return f.value.get()}}}),Oc.config({channels:(o={},o[sf()]={onReceive:p},o)})]),events:zi([Ii(_C(),(function(t,n){!function(t,n){g(t,n);var r=i(t);e.onChange(t,r,n),R.some(!0)}(t,n.event.value)})),$i((function(t,n){var r=f.getInitialValue();f.value.set(r);var o=i(t);m(t,o);var u=a(t);e.onInit(t,o,u,f.value.get())})),Ii(Bo(),h),Ii(Io(),v),Ii(Lo(),h),Ii(jo(),v)]),apis:{resetToMin:function(t){d.setToMin(t,e)},resetToMax:function(t){d.setToMax(t,e)},setValue:g,refresh:m},domModification:{styles:{position:"relative"}}}},apis:{setValue:function(e,t,n){e.setValue(t,n)},resetToMin:function(e,t){e.resetToMin(t)},resetToMax:function(e,t){e.resetToMax(t)},refresh:function(e,t){e.refresh(t)}}}),ek=ra("rgb-hex-update"),tk=ra("slider-update"),nk=ra("palette-update"),rk="form",ok=[_f("formBehaviours",[Of])],ik=function(e){return"<alloy.field."+e+">"},ak=function(e,t){return{uid:e.uid,dom:e.dom,components:t,behaviours:Af(e.formBehaviours,[Of.config({store:{mode:"manual",getValue:function(t){var n=yd(t,e);return de(n,(function(e,t){return e().bind((function(e){var n,r,o=Bd.getCurrent(e);return n=o,r=new Error("Cannot find a current component to extract the value from for form part '"+t+"': "+Qi(e.element)),n.fold((function(){return Un.error(r)}),Un.value)})).map(Of.getValue)}))},setValue:function(t,n){fe(n,(function(n,r){hd(t,e,r).each((function(e){Bd.getCurrent(e).each((function(e){Of.setValue(e,n)}))}))}))}}})]),apis:{getField:function(t,n){return hd(t,e,n).bind(Bd.getCurrent)}}}},uk={getField:ba((function(e,t,n){return e.getField(t,n)})),sketch:function(e){var t=function(){var e=[];return{field:function(t,n){return e.push(t),fd(rk,ik(t),n)},record:h(e)}}(),n=e(t),r=t.record(),o=j(r,(function(e){return nd({name:e,pname:ik(e)})}));return Od(rk,ok,o,ak,n)}},ck=ra("valid-input"),sk=ra("invalid-input"),lk=ra("validating-input"),fk="colorcustom.rgb.",dk=function(e,t,n,r){var o=function(n,r){return Lx.config({invalidClass:t("invalid"),notify:{onValidate:function(e){Ai(e,lk,{type:n})},onValid:function(e){Ai(e,ck,{type:n,value:Of.getValue(e)})},onInvalid:function(e){Ai(e,sk,{type:n,value:Of.getValue(e)})}},validator:{validate:function(t){var n=Of.getValue(t),o=r(n)?Un.value(!0):Un.error(e("aria.input.invalid"));return Ax(o)},validateOnLoad:!1}})},i=function(n,r,i,a,u){var c=e("colorcustom.rgb.range"),s=Yw.parts.label({dom:{tag:"label",innerHtml:i,attributes:{"aria-label":a}}}),l=Yw.parts.field({data:u,factory:yx,inputAttributes:T({type:"text"},"hex"===r?{"aria-live":"polite"}:{}),inputClasses:[t("textfield")],inputBehaviours:wc([o(r,n),Qw.config({})]),onSetValue:function(e){Lx.isInvalid(e)&&Lx.run(e).get(g)}}),f=[s,l],d="hex"!==r?[Yw.parts["aria-descriptor"]({text:c})]:[];return{dom:{tag:"div",attributes:{role:"presentation"}},components:f.concat(d)}},a=function(e,t){var n=t.red,r=t.green,o=t.blue;Of.setValue(e,{red:n,green:r,blue:o})},u=bh({dom:{tag:"div",classes:[t("rgba-preview")],styles:{"background-color":"white"},attributes:{role:"presentation"}}}),c=function(e,t){u.getOpt(e).each((function(e){Yt(e.element,"background-color","#"+t.value)}))},s=Dd({factory:function(){var o={red:wo(R.some(255)),green:wo(R.some(255)),blue:wo(R.some(255)),hex:wo(R.some("ffffff"))},s=function(e){return o[e].get()},l=function(e,t){o[e].set(t)},f=function(e){var t=e.red,n=e.green,r=e.blue;l("red",R.some(t)),l("green",R.some(n)),l("blue",R.some(r))},d=function(e,t){var n=t.event;"hex"!==n.type?l(n.type,R.none()):r(e)},m=function(e,t,n){var r=parseInt(n,10);l(t,R.some(r)),s("red").bind((function(e){return s("green").bind((function(t){return s("blue").map((function(n){return Ry(e,t,n,1)}))}))})).each((function(t){var n=function(e,t){var n=_y(t);return uk.getField(e,"hex").each((function(t){mp.isFocused(t)||Of.setValue(e,{hex:n.value})})),n}(e,t);Ai(e,ek,{hex:n}),c(e,n)}))},g=function(e,t){var r=t.event;!function(e){return"hex"===e.type}(r)?m(e,r.type,r.value):function(e,t){n(e);var r=wy(t);l("hex",R.some(t));var o=Py(r);a(e,o),f(o),Ai(e,ek,{hex:r}),c(e,r)}(e,r.value)},p=function(t){return{label:e(fk+t+".label"),description:e(fk+t+".description")}},h=p("red"),v=p("green"),b=p("blue"),y=p("hex");return ar(uk.sketch((function(n){return{dom:{tag:"form",classes:[t("rgb-form")],attributes:{"aria-label":e("aria.color.picker")}},components:[n.field("red",Yw.sketch(i(zy,"red",h.label,h.description,255))),n.field("green",Yw.sketch(i(zy,"green",v.label,v.description,255))),n.field("blue",Yw.sketch(i(zy,"blue",b.label,b.description,255))),n.field("hex",Yw.sketch(i(Sy,"hex",y.label,y.description,"ffffff"))),u.asSpec()],formBehaviours:wc([Lx.config({invalidClass:t("form-invalid")}),cp("rgb-form-events",[Ii(ck,g),Ii(sk,d),Ii(lk,d)])])}})),{apis:{updateHex:function(e,t){Of.setValue(e,{hex:t.value}),function(e,t){var n=Py(t);a(e,n),f(n)}(e,t),c(e,t)}}})},name:"RgbForm",configFields:[],apis:{updateHex:function(e,t,n){e.updateHex(t,n)}},extraApis:{}});return s},mk=function(e,t){var n=QS.parts.spectrum({dom:{tag:"canvas",attributes:{role:"presentation"},classes:[t("sv-palette-spectrum")]}}),r=QS.parts.thumb({dom:{tag:"div",attributes:{role:"presentation"},classes:[t("sv-palette-thumb")],innerHtml:"<div class="+t("sv-palette-inner-thumb")+' role="presentation"></div>'}}),o=function(e,t){var n=e.width,r=e.height,o=e.getContext("2d");if(null!==o){o.fillStyle=t,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 a=o.createLinearGradient(0,0,0,r);a.addColorStop(0,"rgba(0,0,0,0)"),a.addColorStop(1,"rgba(0,0,0,1)"),o.fillStyle=a,o.fillRect(0,0,n,r)}},i=Dd({factory:function(e){var i=h({x:0,y:0}),a=wc([Bd.config({find:R.some}),mp.config({})]);return QS.sketch({dom:{tag:"div",attributes:{role:"presentation"},classes:[t("sv-palette")]},model:{mode:"xy",getInitialValue:i},rounded:!1,components:[n,r],onChange:function(e,t,n){Ai(e,nk,{value:n})},onInit:function(e,t,n,r){o(n.element.dom,Ly(Hy))},sliderBehaviours:a})},name:"SaturationBrightnessPalette",configFields:[],apis:{setHue:function(e,t,n){!function(e,t){var n=e.components()[0].element.dom,r=jy(t,100,100),i=By(r);o(n,Ly(i))}(t,n)},setThumb:function(e,t,n){!function(e,t){var n=Uy(Py(t));QS.setValue(e,{x:n.saturation,y:100-n.value})}(t,n)}},extraApis:{}});return i},gk=function(e,t){var n=Dd({name:"ColourPicker",configFields:[Kr("dom"),lo("onValidHex",g),lo("onInvalidHex",g)],factory:function(n){var r,o=dk(e,t,n.onValidHex,n.onInvalidHex),i=mk(0,t),a=function(e){return 100-e/360*100},u={paletteRgba:wo(Hy),paletteHue:wo(0)},c=bh(function(e,t){var n=QS.parts.spectrum({dom:{tag:"div",classes:[t("hue-slider-spectrum")],attributes:{role:"presentation"}}}),r=QS.parts.thumb({dom:{tag:"div",classes:[t("hue-slider-thumb")],attributes:{role:"presentation"}}});return QS.sketch({dom:{tag:"div",classes:[t("hue-slider")],attributes:{role:"presentation"}},rounded:!1,model:{mode:"y",getInitialValue:h({y:0})},components:[n,r],sliderBehaviours:wc([mp.config({})]),onChange:function(e,t,n){Ai(e,tk,{value:n})}})}(0,t)),s=bh(i.sketch({})),l=bh(o.sketch({})),f=function(e,t,n){s.getOpt(e).each((function(e){i.setHue(e,n)}))},d=function(e,t){l.getOpt(e).each((function(e){o.updateHex(e,t)}))},m=function(e,t,n){c.getOpt(e).each((function(e){QS.setValue(e,{y:a(n)})}))},g=function(e,t){s.getOpt(e).each((function(e){i.setThumb(e,t)}))},p=function(e,t,n,r){!function(e,t){var n=Py(e);u.paletteRgba.set(n),u.paletteHue.set(t)}(t,n),U(r,(function(r){r(e,t,n)}))};return{uid:n.uid,dom:n.dom,components:[s.asSpec(),c.asSpec(),l.asSpec()],behaviours:wc([cp("colour-picker-events",[Ii(ek,(r=[f,m,g],function(e,t){var n=t.event.hex,o=function(e){return Uy(Py(e))}(n);p(e,n,o.hue,r)})),Ii(nk,function(){var e=[d];return function(t,n){var r=n.event.value,o=u.paletteHue.get(),i=jy(o,r.x,100-r.y),a=Wy(i);p(t,a,o,e)}}()),Ii(tk,function(){var e=[f,d];return function(t,n){var r=function(e){return(100-e)/100*360}(n.event.value.y),o=u.paletteRgba.get(),i=Uy(o),a=jy(r,i.saturation,i.value),c=Wy(a);p(t,c,r,e)}}())]),Bd.config({find:function(e){return l.getOpt(e)}}),tp.config({mode:"acyclic"})])}}});return n},pk=function(){return Bd.config({find:R.some})},hk=function(e){return Bd.config({find:e.getOpt})},vk=function(e){return Bd.config({find:function(t){return Et(t.element,e).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))}})},bk={"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"},yk=function(e){return function(e){return bk[e]}(e)},wk=tinymce.util.Tools.resolve("tinymce.Resource"),xk=tinymce.util.Tools.resolve("tinymce.util.Tools"),Ck=Sr([lo("preprocess",v),lo("postprocess",v)]),Sk=function(e,t,n){return Of.config(ar({store:{mode:"manual",getValue:t,setValue:n}},e.map((function(e){return{store:{initialValue:e}}})).getOr({})))},kk=function(e,t,n){return Sk(e,(function(e){return t(e.element)}),(function(e,t){return n(e.element,t)}))},Tk=function(e,t){var n=jr("RepresentingConfigs.memento processors",Ck,t);return Of.config({store:{mode:"manual",getValue:function(t){var r=e.get(t),o=Of.getValue(r);return n.postprocess(o)},setValue:function(t,r){var o=n.preprocess(r),i=e.get(t);Of.setValue(i,o)}}})},Ok=Sk,_k=function(e){return kk(e,Xi,Yi)},Ek=function(e){return Of.config({store:{mode:"memory",initialValue:e}})},Ak=function(e,t){var n=function(e,t){t.stop()},r=function(e){return function(t,n){U(e,(function(e){e(t,n)}))}},o=function(e,t){if(!Xd.isDisabled(e)){var n=t.event.raw;a(e,n.dataTransfer.files)}},i=function(e,t){var n=t.event.raw.target;a(e,n.files)},a=function(n,r){Of.setValue(n,function(e,t){var n=xk.explode(t.getSetting("images_file_types","jpeg,jpg,jpe,jfi,jif,jfif,png,gif,bmp,webp","string"));return $(ue(e),(function(e){return L(n,(function(t){return Ee(e.name.toLowerCase(),"."+t.toLowerCase())}))}))}(r,t)),Ai(n,ix,{name:e.name})},u=bh({dom:{tag:"input",attributes:{type:"file",accept:"image/*"},styles:{display:"none"}},behaviours:wc([cp("input-file-events",[ji(Yo()),ji(si())])])}),c=e.label.map((function(e){return ox(e,t)})),s=Yw.parts.field({factory:{sketch:function(e){return{uid:e.uid,dom:{tag:"div",classes:["tox-dropzone-container"]},behaviours:wc([Ek([]),pk(),Xd.config({}),Tp.config({toggleClass:"dragenter",toggleOnExecute:!1}),cp("dropzone-events",[Ii("dragenter",r([n,Tp.toggle])),Ii("dragleave",r([n,Tp.toggle])),Ii("dragover",n),Ii("drop",r([n,o])),Ii(Xo(),i)])]),components:[{dom:{tag:"div",classes:["tox-dropzone"],styles:{}},components:[{dom:{tag:"p",innerHtml:t.translate("Drop an image here")}},vh.sketch({dom:{tag:"button",innerHtml:t.translate("Browse for an image"),styles:{position:"relative"},classes:["tox-button","tox-button--secondary"]},components:[u.asSpec()],action:function(e){u.get(e).element.dom.click()},buttonBehaviours:wc([Qw.config({}),Kb(t.isDisabled),qb()])})]}]}}}});return tx(c,s,["tox-form__group--stretched"],[])},Dk=ra("alloy-fake-before-tabstop"),Mk=ra("alloy-fake-after-tabstop"),Nk=function(e){return{dom:{tag:"div",styles:{width:"1px",height:"1px",outline:"none"},attributes:{tabindex:"0"},classes:e},behaviours:wc([mp.config({ignore:!0}),Qw.config({})])}},Rk=function(e){return{dom:{tag:"div",classes:["tox-navobj"]},components:[Nk([Dk]),e,Nk([Mk])],behaviours:wc([vk(1)])}},zk=function(e,t){Ai(e,qo(),{raw:{which:9,shiftKey:t}})},Bk=function(e,t){var n=t.element;La(n,Dk)?zk(e,!0):La(n,Mk)&&zk(e,!1)},Pk=function(e){return Nw(e,["."+Dk,"."+Mk].join(","),C)},Ik=!(pt().browser.isIE()||pt().browser.isEdge()),Fk=function(e,t){var n=Ik&&e.sandboxed,r=T(T({},e.label.map((function(e){return{title:e}})).getOr({})),n?{sandbox:"allow-scripts allow-same-origin"}:{}),o=function(e){var t=wo("");return{getValue:function(e){return t.get()},setValue:function(n,r){if(e)Ut(n.element,"srcdoc",r);else{Ut(n.element,"src","javascript:''");var o=n.element.dom.contentWindow.document;o.open(),o.write(r),o.close()}t.set(r)}}}(n),i=e.label.map((function(e){return ox(e,t)})),a=Yw.parts.field({factory:{sketch:function(e){return Rk({uid:e.uid,dom:{tag:"iframe",attributes:r},behaviours:wc([Qw.config({}),mp.config({}),Ok(R.none(),o.getValue,o.setValue)])})}}});return tx(i,a,["tox-form__group--stretched"],[])},Lk=function(e,t){return jk(document.createElement("canvas"),e,t)},Hk=function(e){var t=Lk(e.width,e.height);return Vk(t).drawImage(e,0,0),t},Vk=function(e){return e.getContext("2d")},jk=function(e,t,n){return e.width=t,e.height=n,e},Uk=function(e){return e.naturalWidth||e.width},Wk=function(e){return e.naturalHeight||e.height},$k=function(e){return new Sx((function(t,n){(function(e){var t=e.split(","),n=/data:([^;]+)/.exec(t[0]);if(!n)return R.none();for(var r=n[1],o=t[1],i=1024,a=atob(o),u=a.length,c=Math.ceil(u/i),s=new Array(c),l=0;l<c;++l){for(var f=l*i,d=Math.min(f+i,u),m=new Array(d-f),g=f,p=0;g<d;++p,++g)m[p]=a[g].charCodeAt(0);s[l]=new Uint8Array(m)}return R.some(new Blob(s,{type:r}))})(e).fold((function(){n("uri is not base64: "+e)}),t)}))},qk=function(e,t,n){return t=t||"image/png",f(HTMLCanvasElement.prototype.toBlob)?new Sx((function(r,o){e.toBlob((function(e){e?r(e):o()}),t,n)})):$k(e.toDataURL(t,n))},Gk=function(e){return function(e){return new Sx((function(t,n){var r=URL.createObjectURL(e),o=new Image,i=function(){o.removeEventListener("load",a),o.removeEventListener("error",u)},a=function(){i(),t(o)},u=function(){i(),n("Unable to load data of type "+e.type+": "+r)};o.addEventListener("load",a),o.addEventListener("error",u),o.src=r,o.complete&&setTimeout(a,0)}))}(e).then((function(e){Kk(e);var t=Lk(Uk(e),Wk(e));return Vk(t).drawImage(e,0,0),t}))},Kk=function(e){URL.revokeObjectURL(e.src)},Xk=function(e,t,n){var r=t.type,o=h(r),i=h(n),a=function(t,n){return e.then((function(e){return function(e,t,n){return t=t||"image/png",e.toDataURL(t,n)}(e,t,n)}))};return{getType:o,toBlob:function(){return Sx.resolve(t)},toDataURL:i,toBase64:function(){return n.split(",")[1]},toAdjustedBlob:function(t,n){return e.then((function(e){return qk(e,t,n)}))},toAdjustedDataURL:a,toAdjustedBase64:function(e,t){return a(e,t).then((function(e){return e.split(",")[1]}))},toCanvas:function(){return e.then(Hk)}}},Yk=function(e){return function(e){return new Sx((function(t){var n=new FileReader;n.onloadend=function(){t(n.result)},n.readAsDataURL(e)}))}(e).then((function(t){return Xk(Gk(e),e,t)}))},Jk=function(e,t){return qk(e,t).then((function(t){return Xk(Sx.resolve(e),t,e.toDataURL())}))},Zk=function(e,t,n){var r="string"==typeof e?parseFloat(e):e;return r>n?r=n:r<t&&(r=t),r},Qk=[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],eT=function(e,t){for(var n,r=[],o=new Array(25),i=0;i<5;i++){for(var a=0;a<5;a++)r[a]=t[a+5*i];for(a=0;a<5;a++){n=0;for(var u=0;u<5;u++)n+=e[a+5*u]*r[u];o[a+5*i]=n}}return o},tT=function(e,t){return e.toCanvas().then((function(n){return nT(n,e.getType(),t)}))},nT=function(e,t,n){var r=Vk(e),o=function(e,t){for(var n,r,o,i,a=e.data,u=t[0],c=t[1],s=t[2],l=t[3],f=t[4],d=t[5],m=t[6],g=t[7],p=t[8],h=t[9],v=t[10],b=t[11],y=t[12],w=t[13],x=t[14],C=t[15],S=t[16],k=t[17],T=t[18],O=t[19],_=0;_<a.length;_+=4)n=a[_],r=a[_+1],o=a[_+2],i=a[_+3],a[_]=n*u+r*c+o*s+i*l+f,a[_+1]=n*d+r*m+o*g+i*p+h,a[_+2]=n*v+r*b+o*y+i*w+x,a[_+3]=n*C+r*S+o*k+i*T+O;return e}(r.getImageData(0,0,e.width,e.height),n);return r.putImageData(o,0,0),Jk(e,t)},rT=function(e,t,n){var r=Vk(e),o=r.getImageData(0,0,e.width,e.height),i=r.getImageData(0,0,e.width,e.height);return i=function(e,t,n){for(var r=function(e,t,n){return e>n?e=n:e<t&&(e=t),e},o=Math.round(Math.sqrt(n.length)),i=Math.floor(o/2),a=e.data,u=t.data,c=e.width,s=e.height,l=0;l<s;l++)for(var f=0;f<c;f++){for(var d=0,m=0,g=0,p=0;p<o;p++)for(var h=0;h<o;h++){var v=r(f+h-i,0,c-1),b=4*(r(l+p-i,0,s-1)*c+v),y=n[p*o+h];d+=a[b]*y,m+=a[b+1]*y,g+=a[b+2]*y}var w=4*(l*c+f);u[w]=r(d,0,255),u[w+1]=r(m,0,255),u[w+2]=r(g,0,255)}return t}(o,i,n),r.putImageData(i,0,0),Jk(e,t)},oT=function(e){return function(t,n){return tT(t,e([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))}},iT=function(e){return function(t){return tT(t,e)}}([-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]),aT=oT((function(e,t){return t=Zk(255*t,-255,255),eT(e,[1,0,0,0,t,0,1,0,0,t,0,0,1,0,t,0,0,0,1,0,0,0,0,0,1])})),uT=oT((function(e,t){var n;return t=Zk(t,-1,1),n=(t*=100)<0?127+t/100*127:127*(n=0===(n=t%1)?Qk[t]:Qk[Math.floor(t)]*(1-n)+Qk[Math.floor(t)+1]*n)+127,eT(e,[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])})),cT=function(e,t,n,r){return tT(e,function(e,t,n,r){return t=Zk(t,0,2),n=Zk(n,0,2),r=Zk(r,0,2),eT(e,[t,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],t,n,r))},sT=(qx=[0,-1,0,-1,5,-1,0,-1,0],function(e){return function(e,t){return e.toCanvas().then((function(n){return rT(n,e.getType(),t)}))}(e,qx)}),lT=(Gx=function(e,t){return 255*Math.pow(e/255,1-t)},function(e,t){return e.toCanvas().then((function(n){return function(e,t,n){for(var r=Vk(e),o=new Array(256),i=0;i<o.length;i++)o[i]=Gx(i,n);var a=function(e,t){for(var n=e.data,r=0;r<n.length;r+=4)n[r]=t[n[r]],n[r+1]=t[n[r+1]],n[r+2]=t[n[r+2]];return e}(r.getImageData(0,0,e.width,e.height),o);return r.putImageData(a,0,0),Jk(e,t)}(n,e.getType(),t)}))}),fT=function(e,t,n){var r=Uk(e),o=Wk(e),i=t/r,a=n/o,u=!1;(i<.5||i>2)&&(i=i<.5?.5:2,u=!0),(a<.5||a>2)&&(a=a<.5?.5:2,u=!0);var c=dT(e,i,a);return u?c.then((function(e){return fT(e,t,n)})):c},dT=function(e,t,n){return new Sx((function(r){var o=Uk(e),i=Wk(e),a=Math.floor(o*t),u=Math.floor(i*n),c=Lk(a,u);Vk(c).drawImage(e,0,0,o,i,0,0,a,u),r(c)}))},mT=function(e,t){void 0===t&&(t=2);var n=Math.pow(10,t),r=Math.round(e*n);return Math.ceil(r/n)},gT=function(e,t,n){var r=(n<0?360+n:n)*Math.PI/180,o=e.width,i=e.height,a=Math.sin(r),u=Math.cos(r),c=mT(Math.abs(o*u)+Math.abs(i*a)),s=mT(Math.abs(o*a)+Math.abs(i*u)),l=Lk(c,s),f=Vk(l);return f.translate(c/2,s/2),f.rotate(r),f.drawImage(e,-o/2,-i/2),Jk(l,t)},pT=function(e,t,n){var r=Lk(e.width,e.height),o=Vk(r);return"v"===n?(o.scale(1,-1),o.drawImage(e,0,-r.height)):(o.scale(-1,1),o.drawImage(e,-r.width,0)),Jk(r,t)},hT=function(e,t,n,r,o,i){var a=Lk(o,i);return Vk(a).drawImage(e,-n,-r),Jk(a,t)},vT=function(e){return iT(e)},bT=function(e){return sT(e)},yT=function(e,t){return lT(e,t)},wT=function(e,t){return aT(e,t)},xT=function(e,t){return uT(e,t)},CT=function(e,t){return function(e,t){return e.toCanvas().then((function(n){return pT(n,e.getType(),t)}))}(e,t)},ST=function(e,t,n,r,o){return function(e,t,n,r,o){return e.toCanvas().then((function(i){return hT(i,e.getType(),t,n,r,o)}))}(e,t,n,r,o)},kT=function(e,t,n){return function(e,t,n){return e.toCanvas().then((function(r){return fT(r,t,n).then((function(t){return Jk(t,e.getType())}))}))}(e,t,n)},TT=function(e,t){return function(e,t){return e.toCanvas().then((function(n){return gT(n,e.getType(),t)}))}(e,t)},OT=function(e,t,n){return Eh(e,{tag:"span",classes:["tox-icon","tox-tbtn__icon-wrap"],behaviours:n},t)},_T=function(e,t){return OT(e,t,[])},ET=function(e,t){return OT(e,t,[up.config({})])},AT=function(e,t,n){return{dom:{tag:"span",innerHtml:n.translate(e),classes:[t+"__select-label"]},behaviours:wc([up.config({})])}},DT=ra("toolbar.button.execute"),MT=((Kx={})[ui()]=["disabling","alloy.base.behaviour","toggling","toolbar-button-events"],Kx),NT=ra("update-menu-text"),RT=ra("update-menu-icon"),zT=function(e,t,n){var r=wo(g),o=e.text.map((function(e){return bh(AT(e,t,n.providers))})),i=e.icon.map((function(e){return bh(ET(e,n.providers.icons))})),a=function(e,t){var n=Of.getValue(e);return mp.focus(n),Ai(n,"keydown",{raw:t.event.raw}),uC.close(n),R.some(!0)},u=e.role.fold((function(){return{}}),(function(e){return{role:e}})),c=e.tooltip.fold((function(){return{}}),(function(e){var t=n.providers.translate(e);return{title:t,"aria-label":t}})),s=Eh("chevron-down",{tag:"div",classes:[t+"__select-chevron"]},n.providers.icons);return bh(uC.sketch(T(T(T({},e.uid?{uid:e.uid}:{}),u),{dom:{tag:"button",classes:[t,t+"--select"].concat(j(e.classes,(function(e){return t+"--"+e}))),attributes:T({},c)},components:ny([i.map((function(e){return e.asSpec()})),o.map((function(e){return e.asSpec()})),R.some(s)]),matchWidth:!0,useMinWidth:!0,dropdownBehaviours:wc(_(_([],e.dropdownBehaviours,!0),[Kb((function(){return e.disabled||n.providers.isDisabled()})),qb(),sC.config({}),up.config({}),cp("dropdown-events",[Zb(e,r),Qb(e,r)]),cp("menubutton-update-display-text",[Ii(NT,(function(e,t){o.bind((function(t){return t.getOpt(e)})).each((function(e){up.set(e,[Ja(n.providers.translate(t.event.text))])}))})),Ii(RT,(function(e,t){i.bind((function(t){return t.getOpt(e)})).each((function(e){up.set(e,[ET(t.event.icon,n.providers.icons)])}))}))])],!1)),eventOrder:ar(MT,{mousedown:["focusing","alloy.base.behaviour","item-type-events","normal-dropdown-events"]}),sandboxBehaviours:wc([tp.config({mode:"special",onLeft:a,onRight:a})]),lazySink:n.getSink,toggleClass:t+"--active",parts:{menu:zv(0,e.columns,e.presets)},fetch:function(t){return Ex(y(e.fetch,t))}}))).asSpec()},BT=function(e){return"separator"===e.type},PT={type:"separator"},IT=function(e,t){var n=G(e,(function(e,n){return function(e){return r(e)}(n)?""===n?e:"|"===n?e.length>0&&!BT(e[e.length-1])?e.concat([PT]):e:ye(t,n.toLowerCase())?e.concat([t[n.toLowerCase()]]):e:e.concat([n])}),[]);return n.length>0&&BT(n[n.length-1])&&n.pop(),n},FT=function(e,t){return function(e){return ye(e,"getSubmenuItems")}(e)?function(e,t){var n=e.getSubmenuItems(),r=LT(n,t);return{item:e,menus:ar(r.menus,ko(e.value,r.items)),expansions:ar(r.expansions,ko(e.value,e.value))}}(e,t):{item:e,menus:{},expansions:{}}},LT=function(e,t){var n=IT(r(e)?e.split(" "):e,t);return q(n,(function(e,n){var r=function(e){if(BT(e))return e;var t=be(e,"value").getOrThunk((function(){return ra("generated-menu-item")}));return ar({value:t},e)}(n),o=FT(r,t);return{menus:ar(e.menus,o.menus),items:[o.item].concat(e.items),expansions:ar(e.expansions,o.expansions)}}),{menus:{},expansions:{},items:[]})},HT=function(e,t,n,r){var o=ra("primary-menu"),i=LT(e,n.shared.providers.menuItems());if(0===i.items.length)return R.none();var a=Aw(o,i.items,t,n,r),u=de(i.menus,(function(e,r){return Aw(r,e,t,n,!1)})),c=ar(u,ko(o,a));return R.from(Xp.tieredData(o,c,i.expansions))},VT=function(e){return{isDisabled:function(){return Xd.isDisabled(e)},setDisabled:function(t){return Xd.set(e,t)},setActive:function(t){var n=e.element;t?(Pa(n,"tox-tbtn--enabled"),Ut(n,"aria-pressed",!0)):(Fa(n,"tox-tbtn--enabled"),Gt(n,"aria-pressed"))},isActive:function(){return La(e.element,"tox-tbtn--enabled")}}},jT=function(e,t,n,r){return zT({text:e.text,icon:e.icon,tooltip:e.tooltip,role:r,fetch:function(t,r){e.fetch((function(e){r(HT(e,hv.CLOSE_ON_EXECUTE,n,!1))}))},onSetup:e.onSetup,getApi:VT,columns:1,presets:"normal",classes:[],dropdownBehaviours:[Qw.config({})]},t,n.shared)},UT=function(e,t,n){var r=function(e){return function(r){var o=!r.isActive();r.setActive(o),e.storage.set(o),n.shared.getSink().each((function(n){t().getOpt(n).each((function(t){Ac(t.element),Ai(t,cx,{name:e.name,value:e.storage.get()})}))}))}},o=function(e){return function(t){t.setActive(e.storage.get())}};return function(t){t(j(e,(function(e){var t=e.text.fold((function(){return{}}),(function(e){return{text:e}}));return T(T({type:e.type,active:!1},t),{onAction:r(e),onSetup:o(e)})})))}},WT=function(e,t,n,r,o,i){void 0===n&&(n=[]);var a=t.fold((function(){return{}}),(function(e){return{action:e}})),u=T({buttonBehaviours:wc([Kb((function(){return e.disabled||i.isDisabled()})),qb(),Qw.config({}),cp("button press",[Pi("click"),Pi("mousedown")])].concat(n)),eventOrder:{click:["button press","alloy.base.behaviour"],mousedown:["button press","alloy.base.behaviour"]}},a),c=ar(u,{dom:r});return ar(c,{components:o})},$T=function(e,t,n,r){void 0===r&&(r=[]);var o={tag:"button",classes:["tox-tbtn"],attributes:e.tooltip.map((function(e){return{"aria-label":n.translate(e),title:n.translate(e)}})).getOr({})},i=e.icon.map((function(e){return _T(e,n.icons)})),a=ny([i]);return WT(e,t,r,o,a,n)},qT=function(e,t,n,r){void 0===r&&(r=[]);var o=$T(e,R.some(t),n,r);return vh.sketch(o)},GT=function(e,t,n,r,o){void 0===r&&(r=[]),void 0===o&&(o=[]);var i=n.translate(e.text),a=e.icon?e.icon.map((function(e){return _T(e,n.icons)})):R.none(),u=a.isSome()?ny([a]):[],c=a.isSome()?{}:{innerHtml:i},s=_(_(_(_([],e.primary||e.borderless?["tox-button"]:["tox-button","tox-button--secondary"],!0),a.isSome()?["tox-button--icon"]:[],!0),e.borderless?["tox-button--naked"]:[],!0),o,!0),l=T(T({tag:"button",classes:s},c),{attributes:{title:i}});return WT(e,t,r,l,u,n)},KT=function(e,t,n,r,o){void 0===r&&(r=[]),void 0===o&&(o=[]);var i=GT(e,R.some(t),n,r,o);return vh.sketch(i)},XT=function(e,t){return function(n){"custom"===t?Ai(n,cx,{name:e,value:{}}):"submit"===t?Ei(n,sx):"cancel"===t?Ei(n,ux):console.error("Unknown button type: ",t)}},YT=function(e,t,n){if(function(e,t){return"menu"===t}(0,t)){var r=e,o=T(T({},e),{onSetup:function(t){return t.setDisabled(e.disabled),g},fetch:UT(r.items,(function(){return i}),n)}),i=bh(jT(o,"tox-tbtn",n,R.none()));return i.asSpec()}if(function(e,t){return"custom"===t||"cancel"===t||"submit"===t}(0,t)){var a=XT(e.name,t),u=T(T({},e),{borderless:!1});return KT(u,a,n.shared.providers,[])}console.error("Unknown footer button type: ",t)},JT=function(e,t){var n,r,o=XT(e.name,"custom");return n=R.none(),r=Yw.parts.field(T({factory:vh},GT(e,R.some(o),t,[Ek(""),pk()]))),tx(n,r,[],[])},ZT=h([lo("field1Name","field1"),lo("field2Name","field2"),Au("onLockedChange"),Tu(["lockClass"]),lo("locked",!1),Df("coupledFieldBehaviours",[Bd,Of])]),QT=function(e,t){return nd({factory:Yw,name:e,overrides:function(e){return{fieldBehaviours:wc([cp("coupled-input-behaviour",[Ii(Ko(),(function(n){(function(e,t,n){return hd(e,t,n).bind(Bd.getCurrent)})(n,e,t).each((function(t){hd(n,e,"lock").each((function(r){Tp.isOn(r)&&e.onLockedChange(n,t,r)}))}))}))])])}}})},eO=h([QT("field1","field2"),QT("field2","field1"),nd({factory:vh,schema:[Kr("dom")],name:"lock",overrides:function(e){return{buttonBehaviours:wc([Tp.config({selected:e.locked,toggleClass:e.markers.lockClass,aria:{mode:"pressed"}})])}}})]),tO=Md({name:"FormCoupledInputs",configFields:ZT(),partFields:eO(),factory:function(e,t,n,r){return{uid:e.uid,dom:e.dom,components:t,behaviours:Mf(e.coupledFieldBehaviours,[Bd.config({find:R.some}),Of.config({store:{mode:"manual",getValue:function(t){var n,r=xd(t,e,["field1","field2"]);return(n={})[e.field1Name]=Of.getValue(r.field1()),n[e.field2Name]=Of.getValue(r.field2()),n},setValue:function(t,n){var r=xd(t,e,["field1","field2"]);we(n,e.field1Name)&&Of.setValue(r.field1(),n[e.field1Name]),we(n,e.field2Name)&&Of.setValue(r.field2(),n[e.field2Name])}}})]),apis:{getField1:function(t){return hd(t,e,"field1")},getField2:function(t){return hd(t,e,"field2")},getLock:function(t){return hd(t,e,"lock")}}}},apis:{getField1:function(e,t){return e.getField1(t)},getField2:function(e,t){return e.getField2(t)},getLock:function(e,t){return e.getLock(t)}}}),nO=function(e){var t=/^\s*(\d+(?:\.\d+)?)\s*(|cm|mm|in|px|pt|pc|em|ex|ch|rem|vw|vh|vmin|vmax|%)\s*$/.exec(e);if(null!==t){var n=parseFloat(t[1]),r=t[2];return Un.value({value:n,unit:r})}return Un.error(e)},rO=function(e,t){var n={"":96,px:96,pt:72,cm:2.54,pc:12,mm:25.4,in:1},r=function(e){return ye(n,e)};return e.unit===t?R.some(e.value):r(e.unit)&&r(t)?n[e.unit]===n[t]?R.some(e.value):R.some(e.value/n[e.unit]*n[t]):R.none()},oO=function(e){return R.none()},iO=function(e,t){var n=nO(e).toOptional(),r=nO(t).toOptional();return Se(n,r,(function(e,t){return rO(e,t.unit).map((function(e){return t.value/e})).map((function(e){return function(e,t){return function(n){return rO(n,t).map((function(n){return{value:n*e,unit:t}}))}}(e,t.unit)})).getOr(oO)})).getOr(oO)},aO=function(e,t){var n=oO,r=ra("ratio-event"),o=function(e){return Eh(e,{tag:"span",classes:["tox-icon","tox-lock-icon__"+e]},t.icons)},i=tO.parts.lock({dom:{tag:"button",classes:["tox-lock","tox-button","tox-button--naked","tox-button--icon"],attributes:{title:t.translate(e.label.getOr("Constrain proportions"))}},components:[o("lock"),o("unlock")],buttonBehaviours:wc([Xd.config({disabled:function(){return e.disabled||t.isDisabled()}}),qb(),Qw.config({})])}),a=function(e){return{dom:{tag:"div",classes:["tox-form__group"]},components:e}},u=function(n){return Yw.parts.field({factory:yx,inputClasses:["tox-textfield"],inputBehaviours:wc([Xd.config({disabled:function(){return e.disabled||t.isDisabled()}}),qb(),Qw.config({}),cp("size-input-events",[Ii(Wo(),(function(e,t){Ai(e,r,{isField1:n})})),Ii(Xo(),(function(t,n){Ai(t,ix,{name:e.name})}))])]),selectOnFocus:!1})},c=function(e){return{dom:{tag:"label",classes:["tox-label"],innerHtml:t.translate(e)}}},s=tO.parts.field1(a([Yw.parts.label(c("Width")),u(!0)])),l=tO.parts.field2(a([Yw.parts.label(c("Height")),u(!1)]));return tO.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:[{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:[s,l,a([c("&nbsp;"),i])]}],field1Name:"width",field2Name:"height",locked:!0,markers:{lockClass:"tox-locked"},onLockedChange:function(e,t,r){nO(Of.getValue(e)).each((function(e){n(e).each((function(e){Of.setValue(t,function(e){var t,n={"":0,px:0,pt:1,mm:1,pc:2,ex:2,em:2,ch:2,rem:2,cm:3,in:4,"%":4},r=e.value.toFixed((t=e.unit)in n?n[t]:1);return-1!==r.indexOf(".")&&(r=r.replace(/\.?0*$/,"")),r+e.unit}(e))}))}))},coupledFieldBehaviours:wc([Xd.config({disabled:function(){return e.disabled||t.isDisabled()},onDisabled:function(e){tO.getField1(e).bind(Yw.getField).each(Xd.disable),tO.getField2(e).bind(Yw.getField).each(Xd.disable),tO.getLock(e).each(Xd.disable)},onEnabled:function(e){tO.getField1(e).bind(Yw.getField).each(Xd.enable),tO.getField2(e).bind(Yw.getField).each(Xd.enable),tO.getLock(e).each(Xd.enable)}}),qb(),cp("size-input-events2",[Ii(r,(function(e,t){var r=t.event.isField1,o=r?tO.getField1(e):tO.getField2(e),i=r?tO.getField2(e):tO.getField1(e),a=o.map(Of.getValue).getOr(""),u=i.map(Of.getValue).getOr("");n=iO(a,u)}))])])})},uO={undo:h(ra("undo")),redo:h(ra("redo")),zoom:h(ra("zoom")),back:h(ra("back")),apply:h(ra("apply")),swap:h(ra("swap")),transform:h(ra("transform")),tempTransform:h(ra("temp-transform")),transformApply:h(ra("transform-apply"))},cO=h("save-state"),sO=h("disable"),lO=h("enable"),fO={formActionEvent:cx,saveState:cO,disable:sO,enable:lO},dO=function(e,t){var n=function(e,n,r,o){return bh(KT({name:e,text:e,disabled:r,primary:o,icon:R.none(),borderless:!1},n,t))},r=function(e,n,r,o){return bh(qT({name:e,icon:R.some(e),tooltip:R.some(n),disabled:o,primary:!1,borderless:!1},r,t))},o=function(e,t){e.map((function(e){var n=e.get(t);n.hasConfigured(Xd)&&Xd.disable(n)}))},i=function(e,t){e.map((function(e){var n=e.get(t);n.hasConfigured(Xd)&&Xd.enable(n)}))},a={tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools-edit-panel"]},u=g,c=function(e,t,n){Ai(e,t,n)},s=function(e){return Ei(e,fO.disable())},l=function(e){return Ei(e,fO.enable())},f=function(e,t){s(e),c(e,uO.transform(),{transform:t}),l(e)},d=function(e){return function(){ee.getOpt(e).each((function(e){up.set(e,[Z])}))}},m=function(e,t){s(e),c(e,uO.transformApply(),{transform:t,swap:d(e)}),l(e)},p=function(){return n("Back",(function(e){return c(e,uO.back(),{swap:d(e)})}),!1,!1)},v=function(){return bh({dom:{tag:"div",classes:["tox-spacer"]},behaviours:wc([Xd.config({})])})},b=function(){return n("Apply",(function(e){return c(e,uO.apply(),{swap:d(e)})}),!0,!0)},y=[p(),v(),n("Apply",(function(t){var n=function(t){var n=e.getRect();return ST(t,n.x,n.y,n.w,n.h)};m(t,n),e.hideCrop()}),!1,!0)],w=qw.sketch({dom:a,components:y.map((function(e){return e.asSpec()})),containerBehaviours:wc([cp("image-tools-crop-buttons-events",[Ii(fO.disable(),(function(e,t){o(y,e)})),Ii(fO.enable(),(function(e,t){i(y,e)}))])])}),x=bh(aO({name:"size",label:R.none(),constrain:!0,disabled:!1},t)),C=[p(),v(),x,v(),n("Apply",(function(e){x.getOpt(e).each((function(t){var n=Of.getValue(t),r=function(e,t){return function(n){return kT(n,e,t)}}(parseInt(n.width,10),parseInt(n.height,10));m(e,r)}))}),!1,!0)],S=qw.sketch({dom:a,components:C.map((function(e){return e.asSpec()})),containerBehaviours:wc([cp("image-tools-resize-buttons-events",[Ii(fO.disable(),(function(e,t){o(C,e)})),Ii(fO.enable(),(function(e,t){i(C,e)}))])])}),k=function(e,t){return function(n){return e(n,t)}},T=k(CT,"h"),O=k(CT,"v"),_=k(TT,-90),E=k(TT,90),A=function(e,t){!function(e,t){s(e),c(e,uO.tempTransform(),{transform:t}),l(e)}(e,t)},D=[p(),v(),r("flip-horizontally","Flip horizontally",(function(e){A(e,T)}),!1),r("flip-vertically","Flip vertically",(function(e){A(e,O)}),!1),r("rotate-left","Rotate counterclockwise",(function(e){A(e,_)}),!1),r("rotate-right","Rotate clockwise",(function(e){A(e,E)}),!1),v(),b()],M=qw.sketch({dom:a,components:D.map((function(e){return e.asSpec()})),containerBehaviours:wc([cp("image-tools-fliprotate-buttons-events",[Ii(fO.disable(),(function(e,t){o(D,e)})),Ii(fO.enable(),(function(e,t){i(D,e)}))])])}),N=function(e,n,r,o,i){var a=QS.parts.label({dom:{tag:"label",classes:["tox-label"],innerHtml:t.translate(e)}}),u=QS.parts.spectrum({dom:{tag:"div",classes:["tox-slider__rail"],attributes:{role:"presentation"}}}),c=QS.parts.thumb({dom:{tag:"div",classes:["tox-slider__handle"],attributes:{role:"presentation"}}});return bh(QS.sketch({dom:{tag:"div",classes:["tox-slider"],attributes:{role:"presentation"}},model:{mode:"x",minX:r,maxX:i,getInitialValue:h({x:o})},components:[a,u,c],sliderBehaviours:wc([mp.config({})]),onChoose:n}))},z=function(e,t,n,r,o){return N(e,(function(e,n,r){var o=k(t,r.x/100);f(e,o)}),n,r,o)},B=function(e,t,n,r,u){var c=function(e,t,n,r,o){return[p(),z(e,t,n,r,o),b()]}(e,t,n,r,u);return qw.sketch({dom:a,components:c.map((function(e){return e.asSpec()})),containerBehaviours:wc([cp("image-tools-filter-panel-buttons-events",[Ii(fO.disable(),(function(e,t){o(c,e)})),Ii(fO.enable(),(function(e,t){i(c,e)}))])])})},P=[p(),v(),b()],I=qw.sketch({dom:a,components:P.map((function(e){return e.asSpec()}))}),F=B("Brightness",wT,-100,0,100),L=B("Contrast",xT,-100,0,100),H=B("Gamma",yT,-100,0,100),V=function(e,t,n){return function(r){return function(e,t,n,r){return cT(e,t,n,r)}(r,e,t,n)}},j=function(e){return N(e,(function(e,t,n){var r=U.getOpt(e),o=$.getOpt(e),i=W.getOpt(e);r.each((function(t){o.each((function(n){i.each((function(r){var o=Of.getValue(t).x/100,i=Of.getValue(r).x/100,a=Of.getValue(n).x/100,u=V(o,i,a);f(e,u)}))}))}))}),0,100,200)},U=j("R"),W=j("G"),$=j("B"),q=[p(),U,W,$,b()],G=qw.sketch({dom:a,components:q.map((function(e){return e.asSpec()}))}),K=function(e,t,n){return function(r){c(r,uO.swap(),{transform:t,swap:function(){ee.getOpt(r).each((function(t){up.set(t,[e]),n(t)}))}})}},X=R.some(bT),Y=R.some(vT),J=[r("crop","Crop",K(w,R.none(),(function(t){e.showCrop()})),!1),r("resize","Resize",K(S,R.none(),(function(t){x.getOpt(t).each((function(t){var n=e.getMeasurements(),r=n.width,o=n.height;Of.setValue(t,{width:r,height:o})}))})),!1),r("orientation","Orientation",K(M,R.none(),u),!1),r("brightness","Brightness",K(F,R.none(),u),!1),r("sharpen","Sharpen",K(I,X,u),!1),r("contrast","Contrast",K(L,R.none(),u),!1),r("color-levels","Color levels",K(G,R.none(),u),!1),r("gamma","Gamma",K(H,R.none(),u),!1),r("invert","Invert",K(I,Y,u),!1)],Z=qw.sketch({dom:a,components:J.map((function(e){return e.asSpec()}))}),Q=qw.sketch({dom:{tag:"div"},components:[Z],containerBehaviours:wc([up.config({})])}),ee=bh(Q);return{memContainer:ee,getApplyButton:function(e){return ee.getOpt(e).map((function(e){var t=e.components()[0];return t.components()[t.components().length-1]}))}}},mO=tinymce.util.Tools.resolve("tinymce.geom.Rect"),gO=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),pO=tinymce.util.Tools.resolve("tinymce.util.Observable"),hO=tinymce.util.Tools.resolve("tinymce.util.VK"),vO=function(e){var t,n;if(e.changedTouches)for(t="screenX screenY pageX pageY clientX clientY".split(" "),n=0;n<t.length;n++)e[t[n]]=e.changedTouches[0][t[n]]};function bO(e,t){var n,r,o,i,a=t.document||document,u=a.getElementById(t.handle||e),c=function(e){if(vO(e),e.button!==r)return s(e);e.deltaX=e.screenX-o,e.deltaY=e.screenY-i,e.preventDefault(),t.drag(e)},s=function(e){vO(e),gO(a).off("mousemove touchmove",c).off("mouseup touchend",s),n.remove(),t.stop&&t.stop(e)};return gO(u).on("mousedown touchstart",(function(e){var l,f=function(e){var t=Math.max,n=e.documentElement,r=e.body,o=t(n.scrollWidth,r.scrollWidth),i=t(n.clientWidth,r.clientWidth),a=t(n.offsetWidth,r.offsetWidth),u=t(n.scrollHeight,r.scrollHeight),c=t(n.clientHeight,r.clientHeight);return{width:o<a?i:o,height:u<t(n.offsetHeight,r.offsetHeight)?c:u}}(a);vO(e),e.preventDefault(),r=e.button;var d=u;o=e.screenX,i=e.screenY,l=window.getComputedStyle?window.getComputedStyle(d,null).getPropertyValue("cursor"):d.runtimeStyle.cursor,n=gO("<div></div>").css({position:"absolute",top:0,left:0,width:f.width,height:f.height,zIndex:2147483647,opacity:1e-4,cursor:l}).appendTo(a.body),gO(a).on("mousemove touchmove",c).on("mouseup touchend",s),t.start(e)})),{destroy:function(){gO(u).off()}}}var yO=0,wO=function(e,t,n,r,o){var i,a="tox-crid-"+yO++,u=[{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"}],c=["top","right","bottom","left"],s=function(e,t){return{x:t.x-e.x,y:t.y-e.y,w:t.w,h:t.h}},l=function(t,r,o,i){var a,u,c,l,f;a=r.x,u=r.y,c=r.w,l=r.h,a+=o*t.deltaX,u+=i*t.deltaY,(c+=o*t.deltaW)<20&&(c=20),(l+=i*t.deltaH)<20&&(l=20),f=e=mO.clamp({x:a,y:u,w:c,h:l},n,"move"===t.name),f=s(n,f),g.fire("updateRect",{rect:f}),m(f)},f=function(e){var n=function(e,t){t.h<0&&(t.h=0),t.w<0&&(t.w=0),gO("#"+a+"-"+e,r).css({left:t.x,top:t.y,width:t.w,height:t.h})};xk.each(u,(function(t){gO("#"+a+"-"+t.name,r).css({left:e.w*t.xMul+e.x,top:e.h*t.yMul+e.y})})),n("top",{x:t.x,y:t.y,w:t.w,h:e.y-t.y}),n("right",{x:e.x+e.w,y:e.y,w:t.w-e.x-e.w+t.x,h:e.h}),n("bottom",{x:t.x,y:e.y+e.h,w:t.w,h:t.h-e.y-e.h+t.y}),n("left",{x:t.x,y:e.y,w:e.x-t.x,h:e.h}),n("move",e)},d=function(t){f(e=t)},m=function(e){var t,r;d((t=n,{x:(r=e).x+t.x,y:r.y+t.y,w:r.w,h:r.h}))};gO('<div id="'+a+'" class="tox-croprect-container" role="grid" aria-dropeffect="execute">').appendTo(r),xk.each(c,(function(e){gO("#"+a,r).append('<div id="'+a+"-"+e+'"class="tox-croprect-block" style="display: none" data-mce-bogus="all">')})),xk.each(u,(function(e){gO("#"+a,r).append('<div id="'+a+"-"+e.name+'" class="tox-croprect-handle tox-croprect-handle-'+e.name+'"style="display: none" data-mce-bogus="all" role="gridcell" tabindex="-1" aria-label="'+e.label+'" aria-grabbed="false" title="'+e.label+'">')})),i=xk.map(u,(function(t){var n;return bO(a,{document:r.ownerDocument,handle:a+"-"+t.name,start:function(){n=e},drag:function(e){l(t,n,e.deltaX,e.deltaY)}})})),f(e),gO(r).on("focusin focusout",(function(e){gO(e.target).attr("aria-grabbed","focus"===e.type?"true":"false")})),gO(r).on("keydown",(function(t){var n;xk.each(u,(function(e){if(t.target.id===a+"-"+e.name)return n=e,!1}));var r=function(e,t,r,o,i){e.stopPropagation(),e.preventDefault(),l(n,r,o,i)};switch(t.keyCode){case hO.LEFT:r(t,0,e,-10,0);break;case hO.RIGHT:r(t,0,e,10,0);break;case hO.UP:r(t,0,e,0,-10);break;case hO.DOWN:r(t,0,e,0,10);break;case hO.ENTER:case hO.SPACEBAR:t.preventDefault(),o()}}));var g=xk.extend({toggleVisibility:function(e){var t=xk.map(u,(function(e){return"#"+a+"-"+e.name})).concat(xk.map(c,(function(e){return"#"+a+"-"+e}))).join(",");e?gO(t,r).show():gO(t,r).hide()},setClampRect:function(t){n=t,f(e)},setRect:d,getInnerRect:function(){return s(n,e)},setInnerRect:m,setViewPortRect:function(n){t=n,f(e)},destroy:function(){xk.each(i,(function(e){e.destroy()})),i=[]}},pO);return g},xO=function(e){var t=bh({dom:{tag:"div",classes:["tox-image-tools__image-bg"],attributes:{role:"presentation"}}}),n=wo(1),r=Zc(),o=wo({x:0,y:0,w:1,h:1}),i=wo({x:0,y:0,w:1,h:1}),a=function(e,i){s.getOpt(e).each((function(e){var a=n.get(),u=vn(e.element),c=sn(e.element),s=i.dom.naturalWidth*a,l=i.dom.naturalHeight*a,f=Math.max(0,u/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"};Jt(i,m),t.getOpt(e).each((function(e){Jt(e.element,m)})),r.on((function(e){var t=o.get();e.setRect({x:t.x*a+f,y:t.y*a+d,w:t.w*a,h:t.h*a}),e.setClampRect({x:f,y:d,w:s,h:l}),e.setViewPortRect({x:0,y:0,w:u,h:c})}))}))},u=function(e,t){var r,u=Re.fromTag("img");return Ut(u,"src",t),(r=u.dom,new Wh((function(e){var t=function(){r.removeEventListener("load",t),e(r)};r.complete?e(r):r.addEventListener("load",t)}))).then((function(){e.getSystem().isConnected()&&s.getOpt(e).map((function(e){var t=Za({element:u});up.replaceAt(e,1,R.some(t));var r=i.get(),c={x:0,y:0,w:u.dom.naturalWidth,h:u.dom.naturalHeight};i.set(c);var l=mO.inflate(c,-20,-20);o.set(l),r.w===c.w&&r.h===c.h||function(e,t){s.getOpt(e).each((function(e){var r=vn(e.element),o=sn(e.element),i=t.dom.naturalWidth,a=t.dom.naturalHeight,u=Math.min(r/i,o/a);u>=1?n.set(1):n.set(u)}))}(e,u),a(e,u)}))}))},c=qw.sketch({dom:{tag:"div",classes:["tox-image-tools__image"]},components:[t.asSpec(),{dom:{tag:"img",attributes:{src:e}}},{dom:{tag:"div"},behaviours:wc([cp("image-panel-crop-events",[$i((function(e){s.getOpt(e).each((function(e){var t=e.element.dom,i=wO({x:10,y:10,w:100,h:100},{x:0,y:0,w:200,h:200},{x:0,y:0,w:200,h:200},t,g);i.toggleVisibility(!1),i.on("updateRect",(function(e){var t=e.rect,r=n.get(),i={x:Math.round(t.x/r),y:Math.round(t.y/r),w:Math.round(t.w/r),h:Math.round(t.h/r)};o.set(i)})),r.set(i)}))}))])])}],containerBehaviours:wc([up.config({}),cp("image-panel-events",[$i((function(t){u(t,e)}))])])}),s=bh(c);return{memContainer:s,updateSrc:u,zoom:function(e,t){var r=n.get(),o=t>0?Math.min(2,r+.1):Math.max(.1,r-.1);n.set(o),s.getOpt(e).each((function(e){var t=e.components()[1].element;a(e,t)}))},showCrop:function(){r.on((function(e){e.toggleVisibility(!0)}))},hideCrop:function(){r.on((function(e){e.toggleVisibility(!1)}))},getRect:function(){return o.get()},getMeasurements:function(){var e=i.get();return{width:e.w,height:e.h}}}},CO=function(e,t,n,r,o){return qT({name:e,icon:R.some(t),disabled:n,tooltip:R.some(e),primary:!1,borderless:!1},r,o)},SO=function(e,t){t?Xd.enable(e):Xd.disable(e)};var kO,TO=function(e){var t,n,r,o,i=wo(e),a=Zc(),u=(n=-1,{data:t=[],add:function(e){var r=t.splice(++n);return t.push(e),{state:e,removed:r}},undo:function(){if(r())return t[--n]},redo:function(){if(o())return t[++n]},canUndo:r=function(){return n>0},canRedo:o=function(){return-1!==n&&n<t.length-1}});u.add(e);var c=function(e){i.set(e)},s=function(e){return{blob:e,url:URL.createObjectURL(e)}},l=function(e){URL.revokeObjectURL(e.url)},f=function(){a.on(l),a.clear()},d=function(e){var t=s(e);c(t);var n,r=u.add(t).removed;return n=r,xk.each(n,l),t.url};return{getBlobState:function(){return i.get()},setBlobState:c,addBlobState:d,getTempState:function(){return a.get().getOrThunk(i.get)},updateTempState:function(e){var t=s(e);return f(),a.set(t),t.url},addTempState:function(e){var t=s(e);return a.set(t),t.url},applyTempState:function(e){return a.get().fold(g,(function(t){d(t.blob),e()}))},destroyTempState:f,undo:function(){var e=u.undo();return c(e),e.url},redo:function(){var e=u.redo();return c(e),e.url},getHistoryStates:function(){return{undoEnabled:u.canUndo(),redoEnabled:u.canRedo()}}}},OO=function(e,t){var n=TO(e.currentState),r=function(e){var t=n.getHistoryStates();d.updateButtonUndoStates(e,t.undoEnabled,t.redoEnabled),Ai(e,fO.formActionEvent,{name:fO.saveState(),value:t.undoEnabled})},o=function(e){return e.toBlob()},i=function(e){Ai(e,fO.formActionEvent,{name:fO.disable(),value:{}})},a=function(e){m.getApplyButton(e).each((function(e){Xd.enable(e)})),Ai(e,fO.formActionEvent,{name:fO.enable(),value:{}})},u=function(e,t){return i(e),f.updateSrc(e,t)},c=function(e,t,n,c,s){i(e),function(e){return Yk(e)}(t).then(n).then(o).then(c).then((function(t){return u(e,t)})).then((function(){r(e),s(),a(e)})).catch((function(t){console.log(t),e.getSystem().isConnected()&&a(e)}))},s=function(e,t,r){var o=n.getBlobState().blob;c(e,o,t,(function(e){return n.updateTempState(e)}),r)},l=function(e){var t=n.getBlobState().url;return n.destroyTempState(),r(e),t},f=xO(e.currentState.url),d=function(e){var t=bh(CO("Undo","undo",!0,(function(e){Ai(e,uO.undo(),{direction:1})}),e)),n=bh(CO("Redo","redo",!0,(function(e){Ai(e,uO.redo(),{direction:1})}),e)),r=qw.sketch({dom:{tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools__sidebar"]},components:[t.asSpec(),n.asSpec(),CO("Zoom in","zoom-in",!1,(function(e){Ai(e,uO.zoom(),{direction:1})}),e),CO("Zoom out","zoom-out",!1,(function(e){Ai(e,uO.zoom(),{direction:-1})}),e)]});return{container:r,updateButtonUndoStates:function(e,r,o){t.getOpt(e).each((function(e){SO(e,r)})),n.getOpt(e).each((function(e){SO(e,o)}))}}}(t),m=dO(f,t);return{dom:{tag:"div",attributes:{role:"presentation"}},components:[m.memContainer.asSpec(),f.memContainer.asSpec(),d.container],behaviours:wc([Of.config({store:{mode:"manual",getValue:function(){return n.getBlobState()}}}),cp("image-tools-events",[Ii(uO.undo(),(function(e,t){var o=n.undo();u(e,o).then((function(t){a(e),r(e)}))})),Ii(uO.redo(),(function(e,t){var o=n.redo();u(e,o).then((function(t){a(e),r(e)}))})),Ii(uO.zoom(),(function(e,t){var n=t.event.direction;f.zoom(e,n)})),Ii(uO.back(),(function(e,t){!function(e){var t=l(e);u(e,t).then((function(t){a(e)}))}(e),(0,t.event.swap)(),f.hideCrop()})),Ii(uO.apply(),(function(e,t){n.applyTempState((function(){l(e),(0,t.event.swap)()}))})),Ii(uO.transform(),(function(e,t){return s(e,t.event.transform,g)})),Ii(uO.tempTransform(),(function(e,t){return function(e,t){var r=n.getTempState().blob;c(e,r,t,(function(e){return n.addTempState(e)}),g)}(e,t.event.transform)})),Ii(uO.transformApply(),(function(e,t){return function(e,t,r){var o=n.getBlobState().blob;c(e,o,t,(function(t){var r=n.addBlobState(t);return l(e),r}),r)}(e,t.event.transform,t.event.swap)})),Ii(uO.swap(),(function(e,t){!function(e){d.updateButtonUndoStates(e,!1,!1)}(e);var n=t.event.transform,r=t.event.swap;n.fold((function(){r()}),(function(t){s(e,t,r)}))}))]),pk()])}},_O=function(e){return!ye(e,"items")},EO="data-value",AO=function(e,t,n,r){return j(n,(function(n){return _O(n)?{type:"togglemenuitem",text:n.text,value:n.value,active:n.value===r,onAction:function(){Of.setValue(e,n.value),Ai(e,ix,{name:t}),mp.focus(e)}}:{type:"nestedmenuitem",text:n.text,getSubmenuItems:function(){return AO(e,t,n.items,r)}}}))},DO=function(e,t){return ce(e,(function(e){return _O(e)?ke(e.value===t,e):DO(e.items,t)}))},MO=Dd({name:"HtmlSelect",configFields:[Kr("options"),_f("selectBehaviours",[mp,Of]),lo("selectClasses",[]),lo("selectAttributes",{}),ro("data")],factory:function(e,t){var n=j(e.options,(function(e){return{dom:{tag:"option",value:e.value,innerHtml:e.text}}})),r=e.data.map((function(e){return ko("initialValue",e)})).getOr({});return{uid:e.uid,dom:{tag:"select",classes:e.selectClasses,attributes:e.selectAttributes},components:n,behaviours:Af(e.selectBehaviours,[mp.config({}),Of.config({store:T({mode:"manual",getValue:function(e){return ja(e.element)},setValue:function(t,n){K(e.options,(function(e){return e.value===n})).isSome()&&Ua(t.element,n)}},r)})])}}}),NO=function(e,t){var n=e.label.map((function(e){return ox(e,t)})),r=[Xd.config({disabled:function(){return e.disabled||t.isDisabled()}}),qb(),tp.config({mode:"execution",useEnter:!0!==e.multiline,useControlEnter:!0===e.multiline,execute:function(e){return Ei(e,sx),R.some(!0)}}),cp("textfield-change",[Ii(Ko(),(function(t,n){Ai(t,ix,{name:e.name})})),Ii(ii(),(function(t,n){Ai(t,ix,{name:e.name})}))]),Qw.config({})],o=e.validation.map((function(e){return Lx.config({getRoot:function(e){return Tt(e.element)},invalidClass:"tox-invalid",validator:{validate:function(t){var n=Of.getValue(t),r=e.validator(n);return Ax(!0===r?Un.value(n):Un.error(r))},validateOnLoad:e.validateOnLoad}})})).toArray(),i=e.placeholder.fold(h({}),(function(e){return{placeholder:t.translate(e)}})),a=e.inputMode.fold(h({}),(function(e){return{inputmode:e}})),u=T(T({},i),a),c=Yw.parts.field({tag:!0===e.multiline?"textarea":"input",inputAttributes:u,inputClasses:[e.classname],inputBehaviours:wc(Y([r,o])),selectOnFocus:!1,factory:yx}),s=(e.flex?["tox-form__group--stretched"]:[]).concat(e.maximized?["tox-form-group--maximize"]:[]),l=[Xd.config({disabled:function(){return e.disabled||t.isDisabled()},onDisabled:function(e){Yw.getField(e).each(Xd.disable)},onEnabled:function(e){Yw.getField(e).each(Xd.enable)}}),qb()];return tx(n,c,s,l)},RO=Object.freeze({__proto__:null,events:function(e,t){var n=e.stream.streams.setup(e,t);return zi([Ii(e.event,n),qi((function(){return t.cancel()}))].concat(e.cancelEvent.map((function(e){return[Ii(e,(function(){return t.cancel()}))]})).getOr([])))}}),zO=function(e){var t=wo(null);return wa({readState:function(){return{timer:null!==t.get()?"set":"unset"}},setTimer:function(e){t.set(e)},cancel:function(){var e=t.get();null!==e&&e.cancel()}})},BO=Object.freeze({__proto__:null,throttle:zO,init:function(e){return e.stream.streams.state(e)}}),PO=[Xr("stream",Wr("mode",{throttle:[Kr("delay"),lo("stopEvent",!0),Mu("streams",{setup:function(e,t){var n=e.stream,r=Rh(e.onStream,n.delay);return t.setTimer(r),function(e,t){r.throttle(e,t),n.stopEvent&&t.stop()}},state:zO})]})),lo("event","input"),ro("cancelEvent"),Au("onStream")],IO=Cc({fields:PO,name:"streaming",active:RO,state:BO}),FO=function(e,t,n){var r=Of.getValue(n);Of.setValue(t,r),HO(t)},LO=function(e,t){var n=e.element,r=ja(n),o=n.dom;"number"!==Wt(n,"type")&&t(o,r)},HO=function(e){LO(e,(function(e,t){return e.setSelectionRange(t.length,t.length)}))},VO=function(e,t,n){if(e.selectsOver){var r=Of.getValue(t),o=e.getDisplayText(r),i=Of.getValue(n);return 0===e.getDisplayText(i).indexOf(o)?R.some((function(){FO(0,t,n),function(e,t){LO(e,(function(e,n){return e.setSelectionRange(t,n.length)}))}(t,o.length)})):R.none()}return R.none()},jO=h("alloy.typeahead.itemexecute"),UO=h([ro("lazySink"),Kr("fetch"),lo("minChars",5),lo("responseTime",1e3),_u("onOpen"),lo("getHotspot",R.some),lo("getAnchorOverrides",h({})),lo("layouts",R.none()),lo("eventOrder",{}),yo("model",{},[lo("getDisplayText",(function(e){return void 0!==e.meta&&void 0!==e.meta.text?e.meta.text:e.value})),lo("selectsOver",!0),lo("populateFromBrowse",!0)]),_u("onSetValue"),Eu("onExecute"),_u("onItemExecute"),lo("inputClasses",[]),lo("inputAttributes",{}),lo("inputStyles",{}),lo("matchWidth",!0),lo("useMinWidth",!1),lo("dismissOnBlur",!0),Tu(["openClass"]),ro("initialData"),_f("typeaheadBehaviours",[mp,Of,IO,tp,Tp,Ux]),qr("previewing",(function(){return wo(!0)}))].concat(px()).concat(oC())),WO=h([rd({schema:[ku()],name:"menu",overrides:function(e){return{fakeFocus:!0,onHighlight:function(t,n){e.previewing.get()?t.getSystem().getByUid(e.uid).each((function(r){VO(e.model,r,n).fold((function(){return am.dehighlight(t,n)}),(function(e){return e()}))})):t.getSystem().getByUid(e.uid).each((function(t){e.model.populateFromBrowse&&FO(e.model,t,n)})),e.previewing.set(!1)},onExecute:function(t,n){return t.getSystem().getByUid(e.uid).toOptional().map((function(e){return Ai(e,jO(),{item:n}),!0}))},onHover:function(t,n){e.previewing.set(!1),t.getSystem().getByUid(e.uid).each((function(t){e.model.populateFromBrowse&&FO(e.model,t,n)}))}}}})]),$O=Md({name:"Typeahead",configFields:UO(),partFields:WO(),factory:function(e,t,n,r){var o=function(t,n,o){e.previewing.set(!1);var i=Ux.getCoupled(t,"sandbox");if(af.isOpen(i))Bd.getCurrent(i).each((function(e){am.getHighlighted(e).fold((function(){o(e)}),(function(){Ri(i,e.element,"keydown",n)}))}));else{Yx(e,a(t),t,i,r,(function(e){Bd.getCurrent(e).each(o)}),Cx.HighlightFirst).get(g)}},i=hx(e),a=function(e){return function(t){return t.map((function(t){var n=ve(t.menus),r=J(n,(function(e){return $(e.items,(function(e){return"item"===e.type}))}));return Of.getState(e).update(j(r,(function(e){return e.data}))),t}))}},u=[mp.config({}),Of.config({onSetValue:e.onSetValue,store:T({mode:"dataset",getDataKey:function(e){return ja(e.element)},getFallbackEntry:function(e){return{value:e,meta:{}}},setValue:function(t,n){Ua(t.element,e.model.getDisplayText(n))}},e.initialData.map((function(e){return ko("initialValue",e)})).getOr({}))}),IO.config({stream:{mode:"throttle",delay:e.responseTime,stopEvent:!1},onStream:function(t,n){var o=Ux.getCoupled(t,"sandbox");if(mp.isFocused(t)&&ja(t.element).length>=e.minChars){var i=Bd.getCurrent(o).bind((function(e){return am.getHighlighted(e).map(Of.getValue)}));e.previewing.set(!0);Yx(e,a(t),t,o,r,(function(t){Bd.getCurrent(o).each((function(t){i.fold((function(){e.model.selectsOver&&am.highlightFirst(t)}),(function(e){am.highlightBy(t,(function(t){return Of.getValue(t).value===e.value})),am.getHighlighted(t).orThunk((function(){return am.highlightFirst(t),R.none()}))}))}))}),Cx.HighlightFirst).get(g)}},cancelEvent:di()}),tp.config({mode:"special",onDown:function(e,t){return o(e,t,am.highlightFirst),R.some(!0)},onEscape:function(e){var t=Ux.getCoupled(e,"sandbox");return af.isOpen(t)?(af.close(t),R.some(!0)):R.none()},onUp:function(e,t){return o(e,t,am.highlightLast),R.some(!0)},onEnter:function(t){var n=Ux.getCoupled(t,"sandbox"),r=af.isOpen(n);if(r&&!e.previewing.get())return Bd.getCurrent(n).bind((function(e){return am.getHighlighted(e)})).map((function(e){return Ai(t,jO(),{item:e}),!0}));var o=Of.getValue(t);return Ei(t,di()),e.onExecute(n,t,o),r&&af.close(n),R.some(!0)}}),Tp.config({toggleClass:e.markers.openClass,aria:{mode:"expanded"}}),Ux.config({others:{sandbox:function(t){return nC(e,t,{onOpen:function(){return Tp.on(t)},onClose:function(){return Tp.off(t)}})}}}),cp("typeaheadevents",[Ki((function(t){var n=g;Zx(e,a(t),t,r,n,Cx.HighlightFirst).get(g)})),Ii(jO(),(function(t,n){var r=Ux.getCoupled(t,"sandbox");FO(e.model,t,n.event.item),Ei(t,di()),e.onItemExecute(t,r,n.event.item,Of.getValue(t)),af.close(r),HO(t)}))].concat(e.dismissOnBlur?[Ii(oi(),(function(e){var t=Ux.getCoupled(e,"sandbox");Nc(t.element).isNone()&&af.close(t)}))]:[]))];return{uid:e.uid,dom:bx(ar(e,{inputAttributes:{role:"combobox","aria-autocomplete":"list","aria-haspopup":"true"}})),behaviours:T(T({},i),Af(e.typeaheadBehaviours,u)),eventOrder:e.eventOrder}}}),qO=function(e){return T(T({},e),{toCached:function(){return qO(e.toCached())},bindFuture:function(t){return qO(e.bind((function(e){return e.fold((function(e){return Ax(Un.error(e))}),(function(e){return t(e)}))})))},bindResult:function(t){return qO(e.map((function(e){return e.bind(t)})))},mapResult:function(t){return qO(e.map((function(e){return e.map(t)})))},mapError:function(t){return qO(e.map((function(e){return e.mapError(t)})))},foldResult:function(t,n){return e.map((function(e){return e.fold(t,n)}))},withTimeout:function(t,n){return qO(Ex((function(r){var o=!1,i=setTimeout((function(){o=!0,r(Un.error(n()))}),t);e.get((function(e){o||(clearTimeout(i),r(e))}))})))}})},GO=function(e){return qO(Ex(e))},KO=GO,XO={type:"separator"},YO=function(e){return{type:"menuitem",value:e.url,text:e.title,meta:{attach:e.attach},onAction:g}},JO=function(e,t){return{type:"menuitem",value:t,text:e,meta:{attach:void 0},onAction:g}},ZO=function(e,t){return function(e){return j(e,YO)}(function(e,t){return $(t,(function(t){return t.type===e}))}(e,t))},QO=function(e){return ZO("header",e.targets)},e_=function(e){return ZO("anchor",e.targets)},t_=function(e){return R.from(e.anchorTop).map((function(e){return JO("<top>",e)})).toArray()},n_=function(e){return R.from(e.anchorBottom).map((function(e){return JO("<bottom>",e)})).toArray()},r_=function(e,t){var n=e.toLowerCase();return $(t,(function(e){var t=void 0!==e.meta&&void 0!==e.meta.text?e.meta.text:e.text;return Oe(t.toLowerCase(),n)||Oe(e.value.toLowerCase(),n)}))},o_=function(e,t,n){var r=Of.getValue(t),o=void 0!==r.meta.text?r.meta.text:r.value;return n.getLinkInformation().fold((function(){return[]}),(function(t){var r,i=r_(o,function(e){return j(e,(function(e){return JO(e,e)}))}(n.getHistory(e)));return"file"===e?(r=[i,r_(o,QO(t)),r_(o,Y([t_(t),e_(t),n_(t)]))],G(r,(function(e,t){return 0===e.length||0===t.length?e.concat(t):e.concat(XO,t)}),[])):i}))},i_=ra("aria-invalid"),a_=function(e){return function(t,n,r){return be(n,"name").fold((function(){return e(n,r)}),(function(o){return t.field(o,e(n,r))}))}},u_={bar:a_((function(e,t){return function(e,t){return{dom:{tag:"div",classes:["tox-bar","tox-form__controls-h-stack"]},components:j(e.items,t.interpreter)}}(e,t.shared)})),collection:a_((function(e,t){return gx(e,t.shared.providers)})),alertbanner:a_((function(e,t){return function(e,t){return qw.sketch({dom:{tag:"div",attributes:{role:"alert"},classes:["tox-notification","tox-notification--in","tox-notification--"+e.level]},components:[{dom:{tag:"div",classes:["tox-notification__icon"]},components:[vh.sketch({dom:{tag:"button",classes:["tox-button","tox-button--naked","tox-button--icon"],innerHtml:Th(e.icon,t.icons),attributes:{title:t.translate(e.iconTooltip)}},action:function(t){Ai(t,cx,{name:"alert-banner",value:e.url})},buttonBehaviours:wc([Oh()])})]},{dom:{tag:"div",classes:["tox-notification__body"],innerHtml:t.translate(e.text)}}]})}(e,t.shared.providers)})),input:a_((function(e,t){return function(e,t){return NO({name:e.name,multiline:!1,label:e.label,inputMode:e.inputMode,placeholder:e.placeholder,flex:!1,disabled:e.disabled,classname:"tox-textfield",validation:R.none(),maximized:e.maximized},t)}(e,t.shared.providers)})),textarea:a_((function(e,t){return function(e,t){return NO({name:e.name,multiline:!0,label:e.label,inputMode:R.none(),placeholder:e.placeholder,flex:!0,disabled:e.disabled,classname:"tox-textarea",validation:R.none(),maximized:e.maximized},t)}(e,t.shared.providers)})),label:a_((function(e,t){return function(e,t){var n={dom:{tag:"label",innerHtml:t.providers.translate(e.label),classes:["tox-label"]}},r=j(e.items,t.interpreter);return{dom:{tag:"div",classes:["tox-form__group"]},components:[n].concat(r),behaviours:wc([pk(),up.config({}),_k(R.none()),tp.config({mode:"acyclic"})])}}(e,t.shared)})),iframe:function(e){return function(t,n,r){var o=ar(n,{source:"dynamic"});return a_(e)(t,o,r)}}((function(e,t){return Fk(e,t.shared.providers)})),button:a_((function(e,t){return JT(e,t.shared.providers)})),checkbox:a_((function(e,t){return function(e,t){var n=Of.config({store:{mode:"manual",getValue:function(e){return e.element.dom.checked},setValue:function(e,t){e.element.dom.checked=t}}}),r=function(e){return e.element.dom.click(),R.some(!0)},o=Yw.parts.field({factory:{sketch:v},dom:{tag:"input",classes:["tox-checkbox__input"],attributes:{type:"checkbox"}},behaviours:wc([pk(),Xd.config({disabled:function(){return e.disabled||t.isDisabled()}}),Qw.config({}),mp.config({}),n,tp.config({mode:"special",onEnter:r,onSpace:r,stopSpaceKeyup:!0}),cp("checkbox-events",[Ii(Xo(),(function(t,n){Ai(t,ix,{name:e.name})}))])])}),i=Yw.parts.label({dom:{tag:"span",classes:["tox-checkbox__label"],innerHtml:t.translate(e.label)},behaviours:wc([sC.config({})])}),a=function(e){return Eh("checked"===e?"selected":"unselected",{tag:"span",classes:["tox-icon","tox-checkbox-icon__"+e]},t.icons)},u=bh({dom:{tag:"div",classes:["tox-checkbox__icons"]},components:[a("checked"),a("unchecked")]});return Yw.sketch({dom:{tag:"label",classes:["tox-checkbox"]},components:[o,u.asSpec(),i],fieldBehaviours:wc([Xd.config({disabled:function(){return e.disabled||t.isDisabled()},disableClass:"tox-checkbox--disabled",onDisabled:function(e){Yw.getField(e).each(Xd.disable)},onEnabled:function(e){Yw.getField(e).each(Xd.enable)}}),qb()])})}(e,t.shared.providers)})),colorinput:a_((function(e,t){return mC(e,t.shared,t.colorinput)})),colorpicker:a_((function(e){var t=function(e){return"tox-"+e},n=gk(yk,t),r=bh(n.sketch({dom:{tag:"div",classes:[t("color-picker-container")],attributes:{role:"presentation"}},onValidHex:function(e){Ai(e,cx,{name:"hex-valid",value:!0})},onInvalidHex:function(e){Ai(e,cx,{name:"hex-valid",value:!1})}}));return{dom:{tag:"div"},components:[r.asSpec()],behaviours:wc([Of.config({store:{mode:"manual",getValue:function(e){var t=r.get(e);return Bd.getCurrent(t).bind((function(e){return Of.getValue(e).hex})).map((function(e){return"#"+e})).getOr("")},setValue:function(e,t){var n=/^#([a-fA-F0-9]{3}(?:[a-fA-F0-9]{3})?)/.exec(t),o=r.get(e);Bd.getCurrent(o).fold((function(){console.log("Can not find form")}),(function(e){Of.setValue(e,{hex:R.from(n[1]).getOr("")}),uk.getField(e,"hex").each((function(e){Ei(e,Ko())}))}))}}}),pk()])}})),dropzone:a_((function(e,t){return Ak(e,t.shared.providers)})),grid:a_((function(e,t){return function(e,t){return{dom:{tag:"div",classes:["tox-form__grid","tox-form__grid--"+e.columns+"col"]},components:j(e.items,t.interpreter)}}(e,t.shared)})),listbox:a_((function(e,t){return function(e,t){var n=t.shared.providers,r=ie(e.items).filter(_O),o=e.label.map((function(e){return ox(e,n)})),i=Yw.parts.field({dom:{},factory:{sketch:function(n){return zT({uid:n.uid,text:r.map((function(e){return e.text})),icon:R.none(),tooltip:e.label,role:R.none(),fetch:function(n,r){var o=AO(n,e.name,e.items,Of.getValue(n));r(HT(o,hv.CLOSE_ON_EXECUTE,t,!1))},onSetup:h(g),getApi:h({}),columns:1,presets:"normal",classes:[],dropdownBehaviours:[Qw.config({}),Of.config({store:{mode:"manual",initialValue:r.map((function(e){return e.value})).getOr(""),getValue:function(e){return Wt(e.element,EO)},setValue:function(t,n){DO(e.items,n).each((function(e){Ut(t.element,EO,e.value),Ai(t,NT,{text:e.text})}))}}})]},"tox-listbox",t.shared)}}}),a={dom:{tag:"div",classes:["tox-listboxfield"]},components:[i]};return Yw.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:Y([o.toArray(),[a]]),fieldBehaviours:wc([Xd.config({disabled:h(e.disabled),onDisabled:function(e){Yw.getField(e).each(Xd.disable)},onEnabled:function(e){Yw.getField(e).each(Xd.enable)}})])})}(e,t)})),selectbox:a_((function(e,t){return function(e,t){var n=j(e.items,(function(e){return{text:t.translate(e.text),value:e.value}})),r=e.label.map((function(e){return ox(e,t)})),o=Yw.parts.field({dom:{},selectAttributes:{size:e.size},options:n,factory:MO,selectBehaviours:wc([Xd.config({disabled:function(){return e.disabled||t.isDisabled()}}),Qw.config({}),cp("selectbox-change",[Ii(Xo(),(function(t,n){Ai(t,ix,{name:e.name})}))])])}),i=e.size>1?R.none():R.some(Eh("chevron-down",{tag:"div",classes:["tox-selectfield__icon-js"]},t.icons)),a={dom:{tag:"div",classes:["tox-selectfield"]},components:Y([[o],i.toArray()])};return Yw.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:Y([r.toArray(),[a]]),fieldBehaviours:wc([Xd.config({disabled:function(){return e.disabled||t.isDisabled()},onDisabled:function(e){Yw.getField(e).each(Xd.disable)},onEnabled:function(e){Yw.getField(e).each(Xd.enable)}}),qb()])})}(e,t.shared.providers)})),sizeinput:a_((function(e,t){return aO(e,t.shared.providers)})),urlinput:a_((function(e,t){return function(e,t,n){var r,o=t.shared.providers,i=function(t){var r=Of.getValue(t);n.addToHistory(r.value,e.filetype)},a=Yw.parts.field({factory:$O,dismissOnBlur:!0,inputClasses:["tox-textfield"],sandboxClasses:["tox-dialog__popups"],inputAttributes:{"aria-errormessage":i_,type:"url"},minChars:0,responseTime:0,fetch:function(r){var o=o_(e.filetype,r,n),i=HT(o,hv.BUBBLE_TO_SANDBOX,t,!1);return Ax(i)},getHotspot:function(e){return d.getOpt(e)},onSetValue:function(e,t){e.hasConfigured(Lx)&&Lx.run(e).get(g)},typeaheadBehaviours:wc(Y([n.getValidationHandler().map((function(t){return Lx.config({getRoot:function(e){return Tt(e.element)},invalidClass:"tox-control-wrap--status-invalid",notify:{onInvalid:function(e,t){c.getOpt(e).each((function(e){Ut(e.element,"title",o.translate(t))}))}},validator:{validate:function(n){var r=Of.getValue(n);return KO((function(n){t({type:e.filetype,url:r.value},(function(e){if("invalid"===e.status){var t=Un.error(e.message);n(t)}else{var r=Un.value(e.message);n(r)}}))}))},validateOnLoad:!1}})})).toArray(),[Xd.config({disabled:function(){return e.disabled||o.isDisabled()}}),Qw.config({}),cp("urlinput-events",Y(["file"===e.filetype?[Ii(Ko(),(function(t){Ai(t,ix,{name:e.name})}))]:[],[Ii(Xo(),(function(t){Ai(t,ix,{name:e.name}),i(t)})),Ii(ii(),(function(t){Ai(t,ix,{name:e.name}),i(t)}))]]))]])),eventOrder:(r={},r[Ko()]=["streaming","urlinput-events","invalidating"],r),model:{getDisplayText:function(e){return e.value},selectsOver:!1,populateFromBrowse:!1},markers:{openClass:"tox-textfield--popup-open"},lazySink:t.shared.getSink,parts:{menu:zv(0,0,"normal")},onExecute:function(e,t,n){Ai(t,sx,{})},onItemExecute:function(t,n,r,o){i(t),Ai(t,ix,{name:e.name})}}),u=e.label.map((function(e){return ox(e,o)})),c=bh(function(e,t,n,r){return void 0===n&&(n=e),void 0===r&&(r=e),Eh(n,{tag:"div",classes:["tox-icon","tox-control-wrap__status-icon-"+e],attributes:T({title:o.translate(r),"aria-live":"polite"},t.fold((function(){return{}}),(function(e){return{id:e}})))},o.icons)}("invalid",R.some(i_),"warning")),s=bh({dom:{tag:"div",classes:["tox-control-wrap__status-icon-wrap"]},components:[c.asSpec()]}),l=n.getUrlPicker(e.filetype),f=ra("browser.url.event"),d=bh({dom:{tag:"div",classes:["tox-control-wrap"]},components:[a,s.asSpec()],behaviours:wc([Xd.config({disabled:function(){return e.disabled||o.isDisabled()}})])}),m=bh(KT({name:e.name,icon:R.some("browse"),text:e.label.getOr(""),disabled:e.disabled,primary:!1,borderless:!0},(function(e){return Ei(e,f)}),o,[],["tox-browse-url"]));return Yw.sketch({dom:rx([]),components:u.toArray().concat([{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:Y([[d.asSpec()],l.map((function(){return m.asSpec()})).toArray()])}]),fieldBehaviours:wc([Xd.config({disabled:function(){return e.disabled||o.isDisabled()},onDisabled:function(e){Yw.getField(e).each(Xd.disable),m.getOpt(e).each(Xd.disable)},onEnabled:function(e){Yw.getField(e).each(Xd.enable),m.getOpt(e).each(Xd.enable)}}),qb(),cp("url-input-events",[Ii(f,(function(t){Bd.getCurrent(t).each((function(n){var r=Of.getValue(n),o=T({fieldname:e.name},r);l.each((function(r){r(o).get((function(r){Of.setValue(n,r),Ai(t,ix,{name:e.name})}))}))}))}))])])})}(e,t,t.urlinput)})),customeditor:a_((function(e){var t=Zc(),n=bh({dom:{tag:e.tag}}),r=Zc();return{dom:{tag:"div",classes:["tox-custom-editor"]},behaviours:wc([cp("custom-editor-events",[$i((function(o){n.getOpt(o).each((function(n){(!function(e){return ye(e,"init")}(e)?wk.load(e.scriptId,e.scriptUrl).then((function(t){return t(n.element.dom,e.settings)})):e.init(n.element.dom)).then((function(e){r.on((function(t){e.setValue(t)})),r.clear(),t.set(e)}))}))}))]),Of.config({store:{mode:"manual",getValue:function(){return t.get().fold((function(){return r.get().getOr("")}),(function(e){return e.getValue()}))},setValue:function(e,n){t.get().fold((function(){r.set(n)}),(function(e){return e.setValue(n)}))}}}),pk()]),components:[n.asSpec()]}})),htmlpanel:a_((function(e){return"presentation"===e.presets?qw.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:e.html}}):qw.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:e.html,attributes:{role:"document"}},containerBehaviours:wc([Qw.config({}),mp.config({})])})})),imagetools:a_((function(e,t){return OO(e,t.shared.providers)})),table:a_((function(e,t){return function(e,t){var n,r,o=function(e){return{dom:{tag:"th",innerHtml:t.translate(e)}}},i=function(e){return{dom:{tag:"td",innerHtml:t.translate(e)}}},a=function(e){return{dom:{tag:"tr"},components:j(e,i)}};return{dom:{tag:"table",classes:["tox-dialog__table"]},components:[(r=e.header,{dom:{tag:"thead"},components:[{dom:{tag:"tr"},components:j(r,o)}]}),(n=e.cells,{dom:{tag:"tbody"},components:j(n,a)})],behaviours:wc([Qw.config({}),mp.config({})])}}(e,t.shared.providers)})),panel:a_((function(e,t){return function(e,t){return{dom:{tag:"div",classes:e.classes},components:j(e.items,t.shared.interpreter)}}(e,t)}))},c_={field:function(e,t){return t}},s_=function(e,t,n){var r=ar(n,{shared:{interpreter:function(t){return l_(e,t,r)}}});return l_(e,t,r)},l_=function(e,t,n){return be(u_,t.type).fold((function(){return console.error('Unknown factory type "'+t.type+'", defaulting to container: ',t),t}),(function(r){return r(e,t,n)}))},f_={valignCentre:[],alignCentre:[],alignLeft:[],alignRight:[],right:[],left:[],bottom:[],top:[]},d_=function(e,t,n){var r={maxHeightFunction:ms()};return function(){return n()?{type:"node",root:Bt(e()),node:R.from(e()),bubble:vs(12,12,f_),layouts:{onRtl:function(){return[uh]},onLtr:function(){return[ah]}},overrides:r}:{type:"hotspot",hotspot:t(),bubble:vs(-12,12,f_),layouts:{onRtl:function(){return[ec]},onLtr:function(){return[tc]}},overrides:r}}},m_=function(e,t,n){return function(){return n()?{type:"node",root:Bt(e()),node:R.from(e()),layouts:{onRtl:function(){return[ch]},onLtr:function(){return[ch]}}}:{type:"hotspot",hotspot:t(),layouts:{onRtl:function(){return[ic]},onLtr:function(){return[ic]}}}}},g_=function(e,t){return function(){return{type:"selection",root:t(),getSelection:function(){var t=e.selection.getRng();return R.some(Us.range(Re.fromDom(t.startContainer),t.startOffset,Re.fromDom(t.endContainer),t.endOffset))}}}},p_=function(e){return function(t){return{type:"node",root:e(),node:t}}},h_=function(e,t,n){var r=zb(e),o=function(){return Re.fromDom(e.getBody())},i=function(){return Re.fromDom(e.getContentAreaContainer())},a=function(){return r||!n()};return{inlineDialog:d_(i,t,a),banner:m_(i,t,a),cursor:g_(e,o),node:p_(o)}},v_=function(e){return function(t,n){sw(e)(t,n)}},b_=function(e){return function(){return Zy(e)}},y_=function(e){return function(){return Qy(e)}},w_=function(e){return function(){return tw(e)}},x_=function(e){return{colorPicker:v_(e),hasCustomColors:b_(e),getColors:y_(e),getColorCols:w_(e)}},C_=function(e){return function(){return function(e){return e.getParam("draggable_modal",!1,"boolean")}(e)}},S_=function(e){return{isDraggableModal:C_(e)}},k_=[{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"}]}],T_=function(e){return G(e,(function(e,t){if(ye(t,"items")){var n=T_(t.items);return{customFormats:e.customFormats.concat(n.customFormats),formats:e.formats.concat([{title:t.title,items:n.formats}])}}if(function(e){return ye(e,"inline")}(t)||function(e){return ye(e,"block")}(t)||function(e){return ye(e,"selector")}(t)){var o="custom-"+(r(t.name)?t.name:t.title.toLowerCase());return{customFormats:e.customFormats.concat([{name:o,format:t}]),formats:e.formats.concat([{title:t.title,format:o,icon:t.icon}])}}return T(T({},e),{formats:e.formats.concat(t)})}),{customFormats:[],formats:[]})},O_=function(e){return function(e){return R.from(e.getParam("style_formats")).filter(i)}(e).map((function(t){var n=function(e,t){var n=T_(t),r=function(t){U(t,(function(t){e.formatter.has(t.name)||e.formatter.register(t.name,t.format)}))};return e.formatter?r(n.customFormats):e.on("init",(function(){r(n.customFormats)})),n.formats}(e,t);return function(e){return e.getParam("style_formats_merge",!1,"boolean")}(e)?k_.concat(n):n})).getOr(k_)},__=function(e,t,n){var r={type:"formatter",isSelected:t(e.format),getStylePreview:n(e.format)};return ar(e,r)},E_=function(e,t,n,o){var i=function(t){return j(t,(function(t){var a=se(t);if(we(t,"items")){var u=i(t.items);return ar(function(e){return ar(e,{type:"submenu"})}(t),{getStyleItems:h(u)})}return we(t,"format")?function(e){return __(e,n,o)}(t):1===a.length&&F(a,"title")?ar(t,{type:"separator"}):function(t){var i=r(t.name)?t.name:ra(t.title),a="custom-"+i,u={type:"formatter",format:a,isSelected:n(a),getStylePreview:o(a)},c=ar(t,u);return e.formatter.register(i,c),c}(t)}))};return i(t)},A_=function(e){var t=function(t){return function(){return e.formatter.match(t)}},n=function(t){return function(){var n=e.formatter.get(t);return void 0!==n?R.some({tag:n.length>0&&(n[0].inline||n[0].block)||"div",styles:e.dom.parseStyle(e.formatter.getCssText(t))}):R.none()}},r=function(e){var t=e.items;return void 0!==t&&t.length>0?J(t,r):[e.format]},o=wo([]),i=wo([]),a=wo([]),u=wo([]),c=wo(!1);e.on("PreInit",(function(a){var u=O_(e),c=E_(e,u,t,n);o.set(c),i.set(J(c,r))})),e.on("addStyleModifications",(function(o){var i=E_(e,o.items,t,n);a.set(i),c.set(o.replace),u.set(J(i,r))}));return{getData:function(){var e=c.get()?[]:o.get(),t=a.get();return e.concat(t)},getFlattenedKeys:function(){var e=c.get()?[]:i.get(),t=u.get();return e.concat(t)}}},D_=xk.trim,M_=function(e){return function(t){if(function(e){return l(e)&&1===e.nodeType}(t)){if(t.contentEditable===e)return!0;if(t.getAttribute("data-mce-contenteditable")===e)return!0}return!1}},N_=M_("true"),R_=M_("false"),z_=function(e,t,n,r,o){return{type:e,title:t,url:n,level:r,attach:o}},B_=function(e){return e.innerText||e.textContent},P_=function(e){return function(e){return e&&"A"===e.nodeName&&void 0!==(e.id||e.name)}(e)&&F_(e)},I_=function(e){return e&&/^(H[1-6])$/.test(e.nodeName)},F_=function(e){return function(e){for(;e=e.parentNode;){var t=e.contentEditable;if(t&&"inherit"!==t)return N_(e)}return!1}(e)&&!R_(e)},L_=function(e){return I_(e)&&F_(e)},H_=function(e){var t=function(e){return e.id?e.id:ra("h")}(e);return z_("header",B_(e),"#"+t,function(e){return I_(e)?parseInt(e.nodeName.substr(1),10):0}(e),(function(){e.id=t}))},V_=function(e){var t=e.id||e.name,n=B_(e);return z_("anchor",n||"#"+t,"#"+t,0,g)},j_=function(e){var t,n,r=(t="h1,h2,h3,h4,h5,h6,a:not([href])",n=e,j(rl(Re.fromDom(n),t),(function(e){return e.dom})));return r},U_=function(e){return D_(e.title).length>0},W_=function(e){var t=j_(e);return $(function(e){return j($(e,L_),H_)}(t).concat(function(e){return j($(e,P_),V_)}(t)),U_)},$_="tinymce-url-history",q_=function(e){return r(e)&&/^https?/.test(e)},G_=function(e){return o(e)&&he(e,(function(e){return!(i(t=e)&&t.length<=5&&Z(t,q_));var t})).isNone()},K_=function(){var e,t=qy.getItem($_);if(null===t)return{};try{e=JSON.parse(t)}catch(e){if(e instanceof SyntaxError)return console.log("Local storage "+$_+" was not valid JSON",e),{};throw e}return G_(e)?e:(console.log("Local storage "+$_+" was not valid format",e),{})},X_=function(e){var t=K_();return be(t,e).getOr([])},Y_=function(e,t){if(q_(e)){var n=K_(),r=be(n,t).getOr([]),o=$(r,(function(t){return t!==e}));n[t]=[e].concat(o).slice(0,5),function(e){if(!G_(e))throw new Error("Bad format for history:\n"+JSON.stringify(e));qy.setItem($_,JSON.stringify(e))}(n)}},J_=function(e){return!!e},Z_=function(e){return de(xk.makeMap(e,/[, ]/),J_)},Q_=function(e){return R.from(function(e){return e.getParam("file_picker_callback")}(e)).filter(f)},eE=function(e,t){var n=function(e){var t=R.some(function(e){return e.getParam("file_picker_types")}(e)).filter(J_),n=R.some(function(e){return e.getParam("file_browser_callback_types")}(e)).filter(J_),r=t.or(n).map(Z_);return Q_(e).fold(C,(function(e){return r.fold(S,(function(e){return se(e).length>0&&e}))}))}(e);return u(n)?n?Q_(e):R.none():n[t]?Q_(e):R.none()},tE=function(e){return R.from(e).filter(r).getOrUndefined()},nE=function(e){return{getHistory:X_,addToHistory:Y_,getLinkInformation:function(){return function(e){return function(e){return!1===e.getParam("typeahead_urls")}(e)?R.none():R.some({targets:W_(e.getBody()),anchorTop:tE(Hb(e)),anchorBottom:tE(Vb(e))})}(e)},getValidationHandler:function(){return function(e){return R.from(function(e){var t=e.getParam("file_picker_validator_handler",void 0,"function");return void 0===t?e.getParam("filepicker_validator_handler",void 0,"function"):t}(e))}(e)},getUrlPicker:function(t){return function(e,t){return eE(e,t).map((function(n){return function(i){return Ex((function(a){var u=T({filetype:t,fieldname:i.fieldname},R.from(i.meta).getOr({}));n.call(e,(function(e,t){if(!r(e))throw new Error("Expected value to be string");if(void 0!==t&&!o(t))throw new Error("Expected meta to be a object");a({value:e,meta:t})}),i.value,u)}))}}))}(e,t)}}},rE=function(e,t,n){var r=wo(!1),o=function(e){var t=wo(Nb(e)?"bottom":"top");return{isPositionedAtTop:function(){return"top"===t.get()},getDockingMode:t.get,setDockingMode:t.set}}(t),i={shared:{providers:{icons:function(){return t.ui.registry.getAll().icons},menuItems:function(){return t.ui.registry.getAll().menuItems},translate:yh.translate,isDisabled:function(){return t.mode.isReadOnly()||t.ui.isDisabled()},getSetting:t.getParam.bind(t)},interpreter:function(e){return function(e,t){return l_(c_,e,t)}(e,i)},anchors:h_(t,n,o.isPositionedAtTop),header:o,getSink:function(){return Un.value(e)}},urlinput:nE(t),styleselect:A_(t),colorinput:x_(t),dialog:S_(t),isContextMenuOpen:function(){return r.get()},setContextMenuState:function(e){return r.set(e)}};return i},oE=kd,iE=ud,aE=h([lo("shell",!1),Kr("makeItem"),lo("setupItem",g),Df("listBehaviours",[up])]),uE=od({name:"items",overrides:function(){return{behaviours:wc([up.config({})])}}}),cE=h([uE]),sE=h("CustomList"),lE=Md({name:sE(),configFields:aE(),partFields:cE(),factory:function(e,t,n,r){var o=e.shell?{behaviours:[up.config({})],components:[]}:{behaviours:[],components:t},i=function(t){return e.shell?R.some(t):hd(t,e,"items")};return{uid:e.uid,dom:e.dom,components:o.components,behaviours:Af(e.listBehaviours,o.behaviours),apis:{setItems:function(t,n){i(t).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=up.contents(r),i=n.length,a=i-o.length,u=a>0?H(a,(function(){return e.makeItem()})):[],c=o.slice(i);U(c,(function(e){return up.remove(r,e)})),U(u,(function(e){return up.append(r,e)}));var s=up.contents(r);U(s,(function(r,o){e.setupItem(t,r,n[o],o)}))}))}}}},apis:{setItems:function(e,t,n){e.setItems(t,n)}}}),fE=h([Kr("dom"),lo("shell",!0),_f("toolbarBehaviours",[up])]),dE=h([od({name:"groups",overrides:function(){return{behaviours:wc([up.config({})])}}})]),mE=Md({name:"Toolbar",configFields:fE(),partFields:dE(),factory:function(e,t,n,r){var o=function(t){return e.shell?R.some(t):hd(t,e,"groups")},i=e.shell?{behaviours:[up.config({})],components:[]}:{behaviours:[],components:t};return{uid:e.uid,dom:e.dom,components:i.components,behaviours:Af(e.toolbarBehaviours,i.behaviours),apis:{setGroups:function(e,t){o(e).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(e){up.set(e,t)}))}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(e,t,n){e.setGroups(t,n)}}}),gE=g,pE=C,hE=h([]),vE=Object.freeze({__proto__:null,setup:gE,isDocked:pE,getBehaviours:hE}),bE=function(e){return(xe(tn(e,"position"),"fixed")?R.none():Ot(e)).orThunk((function(){var t=Re.fromTag("span");return Tt(e).bind((function(e){Tn(e,t);var n=Ot(t);return En(t),n}))}))},yE=function(e){return bE(e).map(gn).getOrThunk((function(){return dn(0,0)}))},wE=xo([{static:[]},{absolute:["positionCss"]},{fixed:["positionCss"]}]),xE=function(e,t){var n=e.element;Pa(n,t.transitionClass),Fa(n,t.fadeOutClass),Pa(n,t.fadeInClass),t.onShow(e)},CE=function(e,t){var n=e.element;Pa(n,t.transitionClass),Fa(n,t.fadeInClass),Pa(n,t.fadeOutClass),t.onHide(e)},SE=function(e,t,n){return Z(e,(function(e){switch(e){case"bottom":return function(e,t){return e.bottom<=t.bottom}(t,n);case"top":return function(e,t){return e.y>=t.y}(t,n)}}))},kE=function(e,t){return t.getInitialPos().map((function(t){return In(t.bounds.x,t.bounds.y,vn(e),sn(e))}))},TE=function(e,t,n){return n.getInitialPos().bind((function(r){switch(n.clearInitialPos(),r.position){case"static":return R.some(wE.static());case"absolute":var o=bE(e).map(Fn).getOrThunk((function(){return Fn(Ht())}));return R.some(wE.absolute(zc("absolute",be(r.style,"left").map((function(e){return t.x-o.x})),be(r.style,"top").map((function(e){return t.y-o.y})),be(r.style,"right").map((function(e){return o.right-t.right})),be(r.style,"bottom").map((function(e){return o.bottom-t.bottom})))));default:return R.none()}}))},OE=function(e,t,n){var r=Fn(e);if(SE(n.getModes(),r,t))return R.none();!function(e,t,n){n.setInitialPos({style:nn(e),position:Qt(e,"position")||"static",bounds:t})}(e,r,n);var o=Hn(),i=r.x-o.x,a=t.y-o.y,u=o.bottom-t.bottom,c=r.y<=t.y;return R.some(wE.fixed(zc("fixed",R.some(i),c?R.some(a):R.none(),R.none(),c?R.none():R.some(u))))},_E=function(e,t,n){var r=e.element;return xe(tn(r,"position"),"fixed")?function(e,t,n){return kE(e,n).filter((function(e){return SE(n.getModes(),e,t)})).bind((function(t){return TE(e,t,n)}))}(r,t,n):OE(r,t,n)},EE=function(e,t,n){n.setDocked(!1),U(["left","right","top","bottom","position"],(function(t){return on(e.element,t)})),t.onUndocked(e)},AE=function(e,t,n,r){var o="fixed"===r.position;n.setDocked(o),Bc(e.element,r),(o?t.onDocked:t.onUndocked)(e)},DE=function(e,t,n,r,o){void 0===o&&(o=!1),t.contextual.each((function(t){t.lazyContext(e).each((function(i){var a=function(e,t){return e.y<t.bottom&&e.bottom>t.y}(i,r);a!==n.isVisible()&&(n.setVisible(a),o&&!a?(Ha(e.element,[t.fadeOutClass]),t.onHide(e)):(a?xE:CE)(e,t))}))}))},ME=function(e,t,n){var r=e.element;n.setDocked(!1),function(e,t){var n=e.element;return kE(n,t).bind((function(e){return TE(n,e,t)}))}(e,n).each((function(r){r.fold((function(){return EE(e,t,n)}),(function(r){return AE(e,t,n,r)}),g)})),n.setVisible(!0),t.contextual.each((function(t){Va(r,[t.fadeInClass,t.fadeOutClass,t.transitionClass]),t.onShow(e)})),NE(e,t,n)},NE=function(e,t,n){e.getSystem().isConnected()&&function(e,t,n){var r=t.lazyViewport(e);n.isDocked()&&DE(e,t,n,r),_E(e,r,n).each((function(o){o.fold((function(){return EE(e,t,n)}),(function(r){return AE(e,t,n,r)}),(function(o){DE(e,t,n,r,!0),AE(e,t,n,o)}))}))}(e,t,n)},RE=function(e,t,n){n.isDocked()&&ME(e,t,n)},zE=Object.freeze({__proto__:null,refresh:NE,reset:RE,isDocked:function(e,t,n){return n.isDocked()},getModes:function(e,t,n){return n.getModes()},setModes:function(e,t,n,r){return n.setModes(r)}}),BE=Object.freeze({__proto__:null,events:function(e,t){return zi([Wi(Zo(),(function(n,r){e.contextual.each((function(e){La(n.element,e.transitionClass)&&(Va(n.element,[e.transitionClass,e.fadeInClass]),(t.isVisible()?e.onShown:e.onHidden)(n));r.stop()}))})),Ii(hi(),(function(n,r){NE(n,e,t)})),Ii(vi(),(function(n,r){RE(n,e,t)}))])}}),PE=[so("contextual",[Jr("fadeInClass"),Jr("fadeOutClass"),Jr("transitionClass"),Qr("lazyContext"),_u("onShow"),_u("onShown"),_u("onHide"),_u("onHidden")]),vo("lazyViewport",Hn),bo("modes",["top","bottom"],Mr),_u("onDocked"),_u("onUndocked")],IE=Cc({fields:PE,name:"docking",active:BE,apis:zE,state:Object.freeze({__proto__:null,init:function(e){var t=wo(!1),n=wo(!0),r=Zc(),o=wo(e.modes);return wa({isDocked:t.get,setDocked:t.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:  "+t.get()+", visible: "+n.get()+", modes: "+o.get().join(",")}})}})}),FE=h(ra("toolbar-height-change")),LE={fadeInClass:"tox-editor-dock-fadein",fadeOutClass:"tox-editor-dock-fadeout",transitionClass:"tox-editor-dock-transition"},HE="tox-tinymce--toolbar-sticky-on",VE="tox-tinymce--toolbar-sticky-off",jE=function(e,t){return F(IE.getModes(e),t)},UE=function(e){var t=e.element;Tt(t).each((function(n){var r="padding-"+IE.getModes(e)[0];if(IE.isDocked(e)){var o=vn(n);Yt(t,"width",o+"px"),Yt(n,r,function(e){return ln(e)+(parseInt(Qt(e,"margin-top"),10)||0)+(parseInt(Qt(e,"margin-bottom"),10)||0)}(t)+"px")}else on(t,"width"),on(n,r)}))},WE=function(e,t){t?(Fa(e,LE.fadeOutClass),Ha(e,[LE.transitionClass,LE.fadeInClass])):(Fa(e,LE.fadeInClass),Ha(e,[LE.fadeOutClass,LE.transitionClass]))},$E=function(e,t){var n=Re.fromDom(e.getContainer());t?(Pa(n,HE),Fa(n,VE)):(Pa(n,VE),Fa(n,HE))},qE=function(e,t){var n=Zc(),r=t.getSink,o=function(e){r().each((function(t){return e(t.element)}))},i=function(t){e.inline||UE(t),$E(e,IE.isDocked(t)),t.getSystem().broadcastOn([cf()],{}),r().each((function(e){return e.getSystem().broadcastOn([cf()],{})}))},a=e.inline?[]:function(){var e;return[Oc.config({channels:(e={},e[FE()]={onReceive:UE},e)})]}();return _([mp.config({}),IE.config({contextual:T({lazyContext:function(t){var n=ln(t.element),r=e.inline?e.getContentAreaContainer():e.getContainer(),o=Fn(Re.fromDom(r)),i=o.height-n,a=o.y+(jE(t,"top")?0:n);return R.some(In(o.x,a,o.width,i))},onShow:function(){o((function(e){return WE(e,!0)}))},onShown:function(e){o((function(e){return Va(e,[LE.transitionClass,LE.fadeInClass])})),n.get().each((function(t){var r,o,i;r=e.element,i=xt(o=t),Mc(i).filter((function(e){return!bt(o,e)})).filter((function(e){return bt(e,Re.fromDom(i.dom.body))||wt(r,e)})).each((function(){return Ac(o)})),n.clear()}))},onHide:function(e){(function(e,t){return Nc(e).orThunk((function(){return t().toOptional().bind((function(e){return Nc(e.element)}))}))})(e.element,r).fold(n.clear,n.set),o((function(e){return WE(e,!1)}))},onHidden:function(){o((function(e){return Va(e,[LE.transitionClass])}))}},LE),lazyViewport:function(t){var n=Hn(),r=function(e){return e.getParam("toolbar_sticky_offset",0,"number")}(e),o=n.y+(jE(t,"top")?r:0),i=n.height-(jE(t,"bottom")?r:0);return In(n.x,o,n.width,i)},modes:[t.header.getDockingMode()],onDocked:i,onUndocked:i})],a,!0)},GE=Object.freeze({__proto__:null,setup:function(e,t,n){e.inline||(t.header.isPositionedAtTop()||e.on("ResizeEditor",(function(){n().each(IE.reset)})),e.on("ResizeWindow ResizeEditor",(function(){n().each(UE)})),e.on("SkinLoaded",(function(){n().each((function(e){IE.isDocked(e)?IE.reset(e):IE.refresh(e)}))})),e.on("FullscreenStateChanged",(function(){n().each(IE.reset)}))),e.on("AfterScrollIntoView",(function(e){n().each((function(t){IE.refresh(t);var n=t.element;Xm(n)&&function(e,t){var n=xt(t),r=n.dom.defaultView.innerHeight,o=Dn(n),i=Re.fromDom(e.elm),a=Ln(i),u=sn(i),c=a.y,s=c+u,l=gn(t),f=sn(t),d=l.top,m=d+f,g=Math.abs(d-o.top)<2,p=Math.abs(m-(o.top+r))<2;if(g&&c<m)Mn(o.left,c-f,n);else if(p&&s>d){var h=c-r+u+f;Mn(o.left,h,n)}}(e,n)}))})),e.on("PostRender",(function(){$E(e,!1)}))},isDocked:function(e){return e().map(IE.isDocked).getOr(!1)},getBehaviours:qE}),KE=Sr([Jr("type"),Xr("items",Tr([_r([Jr("name"),no("items",Mr)]),Mr]))].concat(ev)),XE=[ao("text"),ao("tooltip"),ao("icon"),Qr("fetch"),vo("onSetup",(function(){return g}))],YE=Sr(_([Jr("type")],XE,!0)),JE=function(e){return Hr("menubutton",YE,e)},ZE=Sr([Jr("type"),ao("tooltip"),ao("icon"),ao("text"),uo("select"),Qr("fetch"),vo("onSetup",(function(){return g})),po("presets","normal",["normal","color","listpreview"]),lo("columns",1),Qr("onAction"),Qr("onItemAction")]),QE=Dd({factory:function(e,t){var n={focus:tp.focusIn,setMenus:function(e,n){var r=j(n,(function(e){var n={type:"menubutton",text:e.text,fetch:function(t){t(e.getItems())}},r=JE(n).mapError((function(e){return Ur(e)})).getOrDie();return jT(r,"tox-mbtn",t.backstage,R.some("menuitem"))}));up.set(e,r)}};return{uid:e.uid,dom:e.dom,components:[],behaviours:wc([up.config({}),cp("menubar-events",[$i((function(t){e.onSetup(t)})),Ii(Uo(),(function(e,t){su(e.element,".tox-mbtn--active").each((function(n){lu(t.event.target,".tox-mbtn").each((function(t){bt(n,t)||e.getSystem().getByDom(n).each((function(n){e.getSystem().getByDom(t).each((function(e){uC.expand(e),uC.close(n),mp.focus(e)}))}))}))}))})),Ii(Ci(),(function(e,t){t.event.prevFocus.bind((function(t){return e.getSystem().getByDom(t).toOptional()})).each((function(n){t.event.newFocus.bind((function(t){return e.getSystem().getByDom(t).toOptional()})).each((function(e){uC.isOpen(n)&&(uC.expand(e),uC.close(n))}))}))}))]),tp.config({mode:"flow",selector:".tox-mbtn",onEscape:function(t){return e.onEscape(t),R.some(!0)}}),Qw.config({})]),apis:n,domModification:{attributes:{role:"menubar"}}}},name:"silver.Menubar",configFields:[Kr("dom"),Kr("uid"),Kr("onEscape"),Kr("backstage"),lo("onSetup",g)],apis:{focus:function(e,t){e.focus(t)},setMenus:function(e,t,n){e.setMenus(t,n)}}}),eA=function(e,t){return t.getAnimationRoot.fold((function(){return e.element}),(function(t){return t(e)}))},tA=function(e){return e.dimension.property},nA=function(e,t){return e.dimension.getDimension(t)},rA=function(e,t){var n=eA(e,t);Va(n,[t.shrinkingClass,t.growingClass])},oA=function(e,t){Fa(e.element,t.openClass),Pa(e.element,t.closedClass),Yt(e.element,tA(t),"0px"),an(e.element)},iA=function(e,t){Fa(e.element,t.closedClass),Pa(e.element,t.openClass),on(e.element,tA(t))},aA=function(e,t,n,r){n.setCollapsed(),Yt(e.element,tA(t),nA(t,e.element)),an(e.element),rA(e,t),oA(e,t),t.onStartShrink(e),t.onShrunk(e)},uA=function(e,t,n,r){var o=r.getOrThunk((function(){return nA(t,e.element)}));n.setCollapsed(),Yt(e.element,tA(t),o),an(e.element);var i=eA(e,t);Fa(i,t.growingClass),Pa(i,t.shrinkingClass),oA(e,t),t.onStartShrink(e)},cA=function(e,t,n){var r=nA(t,e.element);("0px"===r?aA:uA)(e,t,n,R.some(r))},sA=function(e,t,n){var r=eA(e,t),o=La(r,t.shrinkingClass),i=nA(t,e.element);iA(e,t);var a=nA(t,e.element);(o?function(){Yt(e.element,tA(t),i),an(e.element)}:function(){oA(e,t)})(),Fa(r,t.shrinkingClass),Pa(r,t.growingClass),iA(e,t),Yt(e.element,tA(t),a),n.setExpanded(),t.onStartGrow(e)},lA=function(e,t,n){var r=eA(e,t);return!0===La(r,t.growingClass)},fA=function(e,t,n){var r=eA(e,t);return!0===La(r,t.shrinkingClass)},dA=Object.freeze({__proto__:null,refresh:function(e,t,n){if(n.isExpanded()){on(e.element,tA(t));var r=nA(t,e.element);Yt(e.element,tA(t),r)}},grow:function(e,t,n){n.isExpanded()||sA(e,t,n)},shrink:function(e,t,n){n.isExpanded()&&cA(e,t,n)},immediateShrink:function(e,t,n){n.isExpanded()&&aA(e,t,n)},hasGrown:function(e,t,n){return n.isExpanded()},hasShrunk:function(e,t,n){return n.isCollapsed()},isGrowing:lA,isShrinking:fA,isTransitioning:function(e,t,n){return lA(e,t)||fA(e,t)},toggleGrow:function(e,t,n){(n.isExpanded()?cA:sA)(e,t,n)},disableTransitions:rA}),mA=Object.freeze({__proto__:null,exhibit:function(e,t,n){var r=t.expanded;return Ca(r?{classes:[t.openClass],styles:{}}:{classes:[t.closedClass],styles:ko(t.dimension.property,"0px")})},events:function(e,t){return zi([Wi(Zo(),(function(n,r){r.event.raw.propertyName===e.dimension.property&&(rA(n,e),t.isExpanded()&&on(n.element,e.dimension.property),(t.isExpanded()?e.onGrown:e.onShrunk)(n))}))])}}),gA=[Kr("closedClass"),Kr("openClass"),Kr("shrinkingClass"),Kr("growingClass"),ro("getAnimationRoot"),_u("onShrunk"),_u("onStartShrink"),_u("onGrown"),_u("onStartGrow"),lo("expanded",!1),Xr("dimension",Wr("property",{width:[Mu("property","width"),Mu("getDimension",(function(e){return vn(e)+"px"}))],height:[Mu("property","height"),Mu("getDimension",(function(e){return sn(e)+"px"}))]}))],pA=Cc({fields:gA,name:"sliding",active:mA,apis:dA,state:Object.freeze({__proto__:null,init:function(e){var t=wo(e.expanded);return wa({isExpanded:function(){return!0===t.get()},isCollapsed:function(){return!1===t.get()},setCollapsed:y(t.set,!1),setExpanded:y(t.set,!0),readState:function(){return"expanded: "+t.get()}})}})}),hA="container",vA=[_f("slotBehaviours",[])],bA=function(e){return"<alloy.field."+e+">"},yA=function(e,t){var n,r=function(t){return wd(e)},o=function(t,n){return function(r,o){return hd(r,e,o).map((function(e){return t(e,o)})).getOr(n)}},i=function(e,t){return"true"!==Wt(e.element,"aria-hidden")},a=o(i,!1),u=o((function(e,t){if(i(e)){var n=e.element;Yt(n,"display","none"),Ut(n,"aria-hidden","true"),Ai(e,Si(),{name:t,visible:!1})}})),c=(n=u,function(e,t){U(t,(function(t){return n(e,t)}))}),s=o((function(e,t){if(!i(e)){var n=e.element;on(n,"display"),Gt(n,"aria-hidden"),Ai(e,Si(),{name:t,visible:!0})}})),l={getSlotNames:r,getSlot:function(t,n){return hd(t,e,n)},isShowing:a,hideSlot:u,hideAllSlots:function(e){return c(e,r())},showSlot:s};return{uid:e.uid,dom:e.dom,components:t,behaviours:Ef(e.slotBehaviours),apis:l}},wA=de({getSlotNames:function(e,t){return e.getSlotNames(t)},getSlot:function(e,t,n){return e.getSlot(t,n)},isShowing:function(e,t,n){return e.isShowing(t,n)},hideSlot:function(e,t,n){return e.hideSlot(t,n)},hideAllSlots:function(e,t){return e.hideAllSlots(t)},showSlot:function(e,t,n){return e.showSlot(t,n)}},(function(e){return ba(e)})),xA=T(T({},wA),{sketch:function(e){var t=function(){var e=[];return{slot:function(t,n){return e.push(t),fd(hA,bA(t),n)},record:h(e)}}(),n=e(t),r=t.record(),o=j(r,(function(e){return nd({name:e,pname:bA(e)})}));return Od(hA,vA,o,yA,n)}}),CA=Sr([ao("icon"),ao("tooltip"),vo("onShow",g),vo("onHide",g),vo("onSetup",(function(){return g}))]),SA=function(e){return{element:function(){return e.element.dom}}},kA=function(e,t){var n=j(se(t),(function(e){var n=t[e],r=Vr(function(e){return Hr("sidebar",CA,e)}(n));return{name:e,getApi:SA,onSetup:r.onSetup,onShow:r.onShow,onHide:r.onHide}}));return j(n,(function(t){var r=wo(g);return e.slot(t.name,{dom:{tag:"div",classes:["tox-sidebar__pane"]},behaviours:ab([Zb(t,r),Qb(t,r),Ii(Si(),(function(e,t){var r=t.event,o=K(n,(function(e){return e.name===r.name}));o.each((function(t){(r.visible?t.onShow:t.onHide)(t.getApi(e))}))}))])})}))},TA=function(e){return xA.sketch((function(t){return{dom:{tag:"div",classes:["tox-sidebar__pane-container"]},components:kA(t,e),slotBehaviours:ab([$i((function(e){return xA.hideAllSlots(e)}))])}}))},OA=function(e){return Bd.getCurrent(e).bind((function(e){return pA.isGrowing(e)||pA.hasGrown(e)?Bd.getCurrent(e).bind((function(e){return K(xA.getSlotNames(e),(function(t){return xA.isShowing(e,t)}))})):R.none()}))},_A=ra("FixSizeEvent"),EA=ra("AutoSizeEvent"),AA=Object.freeze({__proto__:null,block:function(e,t,n,r){Ut(e.element,"aria-busy",!0);var o=t.getRoot(e).getOr(e),i=wc([tp.config({mode:"special",onTab:function(){return R.some(!0)},onShiftTab:function(){return R.some(!0)}}),mp.config({})]),a=r(o,i),u=o.getSystem().build(a);up.append(o,tu(u)),u.hasConfigured(tp)&&t.focus&&tp.focusIn(u),n.isBlocked()||t.onBlock(e),n.blockWith((function(){return up.remove(o,u)}))},unblock:function(e,t,n){Gt(e.element,"aria-busy"),n.isBlocked()&&t.onUnblock(e),n.clear()}}),DA=[vo("getRoot",R.none),ho("focus",!0),_u("onBlock"),_u("onUnblock")],MA=Cc({fields:DA,name:"blocking",apis:AA,state:Object.freeze({__proto__:null,init:function(){var e=Yc((function(e){return e.destroy()}));return wa({readState:e.isSet,blockWith:function(t){e.set({destroy:t})},clear:e.clear,isBlocked:e.isSet})}})}),NA=function(e){var t=Re.fromHtml(e),n=_t(t),r=function(e){var t=void 0!==e.dom.attributes?e.dom.attributes:[];return G(t,(function(e,t){var n;return"class"===t.name?e:T(T({},e),((n={})[t.name]=t.value,n))}),{})}(t),o=function(e){return Array.prototype.slice.call(e.dom.classList,0)}(t),i=0===n.length?{}:{innerHtml:Xi(t)};return T({tag:Be(t),classes:o,attributes:r},i)},RA=function(e){return Bd.getCurrent(e).each((function(e){return Ac(e.element)}))},zA=function(e,t,n,r){var o=t.element;if(function(e,t){var n="tabindex",r="data-mce-tabindex";R.from(e.iframeElement).map(Re.fromDom).each((function(e){t?($t(e,n).each((function(t){return Ut(e,r,t)})),Ut(e,n,-1)):(Gt(e,n),$t(e,r).each((function(t){Ut(e,n,t),Gt(e,r)})))}))}(e,n),n)MA.block(t,function(e){return function(t,n){return{dom:{tag:"div",attributes:{"aria-label":e.translate("Loading..."),tabindex:"0"},classes:["tox-throbber__busy-spinner"]},components:[{dom:NA('<div class="tox-spinner"><div></div><div></div><div></div></div>')}]}}}(r)),on(o,"display"),Gt(o,"aria-hidden"),e.hasFocus()&&RA(t);else{var i=Bd.getCurrent(t).exists((function(e){return Dc(e.element)}));MA.unblock(t),Yt(o,"display","none"),Ut(o,"aria-hidden","true"),i&&e.focus()}},BA=function(e,t,n){var r=wo(!1),o=Zc(),i=function(n){var o;!r.get()||function(e){return"focusin"===e.type}(o=n)&&(o.composed?ie(o.composedPath()):R.from(o.target)).map(Re.fromDom).filter(Ie).exists((function(e){return La(e,"mce-pastebin")}))||(n.preventDefault(),RA(t()),e.editorManager.setActive(e))};e.inline||e.on("PreInit",(function(){e.dom.bind(e.getWin(),"focusin",i),e.on("BeforeExecCommand",(function(e){"mcefocus"===e.command.toLowerCase()&&!0!==e.value&&i(e)}))}));var a=function(o){o!==r.get()&&(r.set(o),zA(e,t(),o,n.providers),e.fire("AfterProgressState",{state:o}))};e.on("ProgressState",(function(t){if(o.on(hh.clearTimeout),d(t.time)){var n=hh.setEditorTimeout(e,(function(){return a(t.state)}),t.time);o.set(n)}else a(t.state),o.clear()}))},PA=function(e,t,n){return{within:e,extra:t,withinWidth:n}},IA=function(e,t,n){var r=function(e,t){var n=G(e,(function(e,n){return t(n,e.len).fold(h(e),(function(t){return{len:t.finish,list:e.list.concat([t])}}))}),{len:0,list:[]});return n.list}(e,(function(e,t){var r=n(e);return R.some({element:e,start:t,finish:t+r,width:r})})),o=$(r,(function(e){return e.finish<=t})),i=q(o,(function(e,t){return e+t.width}),0);return{within:o,extra:r.slice(o.length),withinWidth:i}},FA=function(e){return j(e,(function(e){return e.element}))},LA=function(e,t,n,r){var o=function(e,t,n){var r=IA(t,e,n);return 0===r.extra.length?R.some(r):R.none()}(e,t,n).getOrThunk((function(){return IA(t,e-n(r),n)})),i=o.within,a=o.extra,u=o.withinWidth;return 1===a.length&&a[0].width<=n(r)?function(e,t,n){var r=FA(e.concat(t));return PA(r,[],n)}(i,a,u):a.length>=1?function(e,t,n,r){var o=FA(e).concat([n]);return PA(o,FA(t),r)}(i,a,r,u):function(e,t,n){return PA(FA(e),[],n)}(i,0,u)},HA=function(e,t){var n=j(t,(function(e){return tu(e)}));mE.setGroups(e,n)},VA=function(e,t,n){var r=t.builtGroups.get();if(0!==r.length){var o=vd(e,t,"primary"),i=Ux.getCoupled(e,"overflowGroup");Yt(o.element,"visibility","hidden");var a=r.concat([i]),u=ce(a,(function(e){return Nc(e.element).bind((function(t){return e.getSystem().getByDom(t).toOptional()}))}));n([]),HA(o,a);var c=vn(o.element),s=LA(c,t.builtGroups.get(),(function(e){return vn(e.element)}),i);0===s.extra.length?(up.remove(o,i),n([])):(HA(o,s.within),n(s.extra)),on(o.element,"visibility"),an(o.element),u.each(mp.focus)}},jA=h([_f("splitToolbarBehaviours",[Ux]),qr("builtGroups",(function(){return wo([])}))]),UA=h([Tu(["overflowToggledClass"]),uo("getOverflowBounds"),Kr("lazySink"),qr("overflowGroups",(function(){return wo([])}))].concat(jA())),WA=h([nd({factory:mE,schema:fE(),name:"primary"}),rd({schema:fE(),name:"overflow"}),rd({name:"overflow-button"}),rd({name:"overflow-group"})]),$A=h((function(e,t){!function(e,t){var n=hn.max(e,t,["margin-left","border-left-width","padding-left","padding-right","border-right-width","margin-right"]);Yt(e,"max-width",n+"px")}(e,Math.floor(t))})),qA=h([Tu(["toggledClass"]),Kr("lazySink"),Qr("fetch"),uo("getBounds"),so("fireDismissalEventInstead",[lo("event",wi())]),ks()]),GA=h([rd({name:"button",overrides:function(e){return{dom:{attributes:{"aria-haspopup":"true"}},buttonBehaviours:wc([Tp.config({toggleClass:e.markers.toggledClass,aria:{mode:"expanded"},toggleOnExecute:!1})])}}}),rd({factory:mE,schema:fE(),name:"toolbar",overrides:function(e){return{toolbarBehaviours:wc([tp.config({mode:"cyclic",onEscape:function(t){return hd(t,e,"button").each(mp.focus),R.none()}})])}}})]),KA=function(e,t){var n=Ux.getCoupled(e,"toolbarSandbox");af.isOpen(n)?af.close(n):af.open(n,t.toolbar())},XA=function(e,t,n,r){var o=n.getBounds.map((function(e){return e()})),i=n.lazySink(e).getOrDie();Pl.positionWithinBounds(i,t,{anchor:{type:"hotspot",hotspot:e,layouts:r,overrides:{maxWidthFunction:$A()}}},o)},YA=function(e,t,n,r,o){mE.setGroups(t,o),XA(e,t,n,r),Tp.on(e)},JA=Md({name:"FloatingToolbarButton",factory:function(e,t,n,r){return T(T({},vh.sketch(T(T({},r.button()),{action:function(e){KA(e,r)},buttonBehaviours:Mf({dump:r.button().buttonBehaviours},[Ux.config({others:{toolbarSandbox:function(t){return function(e,t,n){var r=fu();return{dom:{tag:"div",attributes:{id:r.id}},behaviours:wc([tp.config({mode:"special",onEscape:function(e){return af.close(e),R.some(!0)}}),af.config({onOpen:function(o,i){n.fetch().get((function(o){YA(e,i,n,t.layouts,o),r.link(e.element),tp.focusIn(i)}))},onClose:function(){Tp.off(e),mp.focus(e),r.unlink(e.element)},isPartOf:function(t,n,r){return mu(n,r)||mu(e,r)},getAttachPoint:function(){return n.lazySink(e).getOrDie()}}),Oc.config({channels:T(T({},ff(T({isExtraPart:C},n.fireDismissalEventInstead.map((function(e){return{fireEventInstead:{event:e.event}}})).getOr({})))),mf({doReposition:function(){af.getState(Ux.getCoupled(e,"toolbarSandbox")).each((function(r){XA(e,r,n,t.layouts)}))}}))})])}}(t,n,e)}}})])}))),{apis:{setGroups:function(t,r){af.getState(Ux.getCoupled(t,"toolbarSandbox")).each((function(o){YA(t,o,e,n.layouts,r)}))},reposition:function(t){af.getState(Ux.getCoupled(t,"toolbarSandbox")).each((function(r){XA(t,r,e,n.layouts)}))},toggle:function(e){KA(e,r)},getToolbar:function(e){return af.getState(Ux.getCoupled(e,"toolbarSandbox"))},isOpen:function(e){return af.isOpen(Ux.getCoupled(e,"toolbarSandbox"))}}})},configFields:qA(),partFields:GA(),apis:{setGroups:function(e,t,n){e.setGroups(t,n)},reposition:function(e,t){e.reposition(t)},toggle:function(e,t){e.toggle(t)},getToolbar:function(e,t){return e.getToolbar(t)},isOpen:function(e,t){return e.isOpen(t)}}}),ZA=h([Kr("items"),Tu(["itemSelector"]),_f("tgroupBehaviours",[tp])]),QA=h([id({name:"items",unit:"item"})]),eD=Md({name:"ToolbarGroup",configFields:ZA(),partFields:QA(),factory:function(e,t,n,r){return{uid:e.uid,dom:e.dom,components:t,behaviours:Af(e.tgroupBehaviours,[tp.config({mode:"flow",selector:e.markers.itemSelector})]),domModification:{attributes:{role:"toolbar"}}}}}),tD=function(e){return j(e,(function(e){return tu(e)}))},nD=function(e,t,n){VA(e,n,(function(r){n.overflowGroups.set(r),t.getOpt(e).each((function(e){JA.setGroups(e,tD(r))}))}))},rD=Md({name:"SplitFloatingToolbar",configFields:UA(),partFields:WA(),factory:function(e,t,n,r){var o=bh(JA.sketch({fetch:function(){return Ex((function(t){t(tD(e.overflowGroups.get()))}))},layouts:{onLtr:function(){return[tc,ec]},onRtl:function(){return[ec,tc]},onBottomLtr:function(){return[rc,nc]},onBottomRtl:function(){return[nc,rc]}},getBounds:n.getOverflowBounds,lazySink:e.lazySink,fireDismissalEventInstead:{},markers:{toggledClass:e.markers.overflowToggledClass},parts:{button:r["overflow-button"](),toolbar:r.overflow()}}));return{uid:e.uid,dom:e.dom,components:t,behaviours:Af(e.splitToolbarBehaviours,[Ux.config({others:{overflowGroup:function(){return eD.sketch(T(T({},r["overflow-group"]()),{items:[o.asSpec()]}))}}})]),apis:{setGroups:function(t,n){e.builtGroups.set(j(n,t.getSystem().build)),nD(t,o,e)},refresh:function(t){return nD(t,o,e)},toggle:function(e){o.getOpt(e).each((function(e){JA.toggle(e)}))},isOpen:function(e){return o.getOpt(e).map(JA.isOpen).getOr(!1)},reposition:function(e){o.getOpt(e).each((function(e){JA.reposition(e)}))},getOverflow:function(e){return o.getOpt(e).bind(JA.getToolbar)}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(e,t,n){e.setGroups(t,n)},refresh:function(e,t){e.refresh(t)},reposition:function(e,t){e.reposition(t)},toggle:function(e,t){e.toggle(t)},isOpen:function(e,t){return e.isOpen(t)},getOverflow:function(e,t){return e.getOverflow(t)}}}),oD=h([Tu(["closedClass","openClass","shrinkingClass","growingClass","overflowToggledClass"]),_u("onOpened"),_u("onClosed")].concat(jA())),iD=h([nd({factory:mE,schema:fE(),name:"primary"}),nd({factory:mE,schema:fE(),name:"overflow",overrides:function(e){return{toolbarBehaviours:wc([pA.config({dimension:{property:"height"},closedClass:e.markers.closedClass,openClass:e.markers.openClass,shrinkingClass:e.markers.shrinkingClass,growingClass:e.markers.growingClass,onShrunk:function(t){hd(t,e,"overflow-button").each((function(e){Tp.off(e),mp.focus(e)})),e.onClosed(t)},onGrown:function(t){tp.focusIn(t),e.onOpened(t)},onStartGrow:function(t){hd(t,e,"overflow-button").each(Tp.on)}}),tp.config({mode:"acyclic",onEscape:function(t){return hd(t,e,"overflow-button").each(mp.focus),R.some(!0)}})])}}}),rd({name:"overflow-button",overrides:function(e){return{buttonBehaviours:wc([Tp.config({toggleClass:e.markers.overflowToggledClass,aria:{mode:"pressed"},toggleOnExecute:!1})])}}}),rd({name:"overflow-group"})]),aD=function(e,t){hd(e,t,"overflow-button").bind((function(){return hd(e,t,"overflow")})).each((function(n){uD(e,t),pA.toggleGrow(n)}))},uD=function(e,t){hd(e,t,"overflow").each((function(n){VA(e,t,(function(e){var t=j(e,(function(e){return tu(e)}));mE.setGroups(n,t)})),hd(e,t,"overflow-button").each((function(e){pA.hasGrown(n)&&Tp.on(e)})),pA.refresh(n)}))},cD=Md({name:"SplitSlidingToolbar",configFields:oD(),partFields:iD(),factory:function(e,t,n,r){var o="alloy.toolbar.toggle";return{uid:e.uid,dom:e.dom,components:t,behaviours:Af(e.splitToolbarBehaviours,[Ux.config({others:{overflowGroup:function(e){return eD.sketch(T(T({},r["overflow-group"]()),{items:[vh.sketch(T(T({},r["overflow-button"]()),{action:function(t){Ei(e,o)}}))]}))}}}),cp("toolbar-toggle-events",[Ii(o,(function(t){aD(t,e)}))])]),apis:{setGroups:function(t,n){!function(t,n){var r=j(n,t.getSystem().build);e.builtGroups.set(r)}(t,n),uD(t,e)},refresh:function(t){return uD(t,e)},toggle:function(t){return aD(t,e)},isOpen:function(t){return function(e,t){return hd(e,t,"overflow").map(pA.hasGrown).getOr(!1)}(t,e)}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(e,t,n){e.setGroups(t,n)},refresh:function(e,t){e.refresh(t)},toggle:function(e,t){e.toggle(t)},isOpen:function(e,t){return e.isOpen(t)}}}),sD=function(e){var t=e.title.fold((function(){return{}}),(function(e){return{attributes:{title:e}}}));return{dom:T({tag:"div",classes:["tox-toolbar__group"]},t),components:[eD.parts.items({})],items:e.items,markers:{itemSelector:"*:not(.tox-split-button) > .tox-tbtn:not([disabled]), .tox-split-button:not([disabled]), .tox-toolbar-nav-js:not([disabled])"},tgroupBehaviours:wc([Qw.config({}),mp.config({})])}},lD=function(e){return eD.sketch(sD(e))},fD=function(e,t){var n=$i((function(t){var n=j(e.initGroups,lD);mE.setGroups(t,n)}));return wc([Yb(e.providers.isDisabled),qb(),tp.config({mode:t,onEscape:e.onEscape,selector:".tox-toolbar__group"}),cp("toolbar-events",[n])])},dD=function(e){var t=e.cyclicKeying?"cyclic":"acyclic";return{uid:e.uid,dom:{tag:"div",classes:["tox-toolbar-overlord"]},parts:{"overflow-group":sD({title:R.none(),items:[]}),"overflow-button":$T({name:"more",icon:R.some("more-drawer"),disabled:!1,tooltip:R.some("More..."),primary:!1,borderless:!1},R.none(),e.providers)},splitToolbarBehaviours:fD(e,t)}},mD=function(e){var t=dD(e),n=rD.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}});return rD.sketch(T(T({},t),{lazySink:e.getSink,getOverflowBounds:function(){var t=e.moreDrawerData.lazyHeader().element,n=Ln(t),r=St(t),o=Ln(r),i=Math.max(r.dom.scrollHeight,o.height);return In(n.x+4,o.y,n.width-8,i)},parts:T(T({},t.parts),{overflow:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:e.attributes}}}),components:[n],markers:{overflowToggledClass:"tox-tbtn--enabled"}}))},gD=function(e){var t=cD.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}}),n=cD.parts.overflow({dom:{tag:"div",classes:["tox-toolbar__overflow"]}}),r=dD(e);return cD.sketch(T(T({},r),{components:[t,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(e){e.getSystem().broadcastOn([FE()],{type:"opened"})},onClosed:function(e){e.getSystem().broadcastOn([FE()],{type:"closed"})}}))},pD=function(e){var t=e.cyclicKeying?"cyclic":"acyclic";return mE.sketch({uid:e.uid,dom:{tag:"div",classes:["tox-toolbar"].concat(e.type===pv.scrolling?["tox-toolbar--scrolling"]:[])},components:[mE.parts.groups({})],toolbarBehaviours:fD(e,t)})},hD=iE.optional({factory:QE,name:"menubar",schema:[Kr("backstage")]}),vD=iE.optional({factory:{sketch:function(e){return lE.sketch({uid:e.uid,dom:e.dom,listBehaviours:wc([tp.config({mode:"acyclic",selector:".tox-toolbar"})]),makeItem:function(){return pD({type:e.type,uid:ra("multiple-toolbar-item"),cyclicKeying:!1,initGroups:[],providers:e.providers,onEscape:function(){return e.onEscape(),R.some(!0)}})},setupItem:function(e,t,n,r){mE.setGroups(t,n)},shell:!0})}},name:"multiple-toolbar",schema:[Kr("dom"),Kr("onEscape")]}),bD=iE.optional({factory:{sketch:function(e){var t=function(e){return e.type===pv.sliding?gD:e.type===pv.floating?mD:pD}(e);return t({type:e.type,uid:e.uid,onEscape:function(){return e.onEscape(),R.some(!0)},cyclicKeying:!1,initGroups:[],getSink:e.getSink,providers:e.providers,moreDrawerData:{lazyToolbar:e.lazyToolbar,lazyMoreButton:e.lazyMoreButton,lazyHeader:e.lazyHeader},attributes:e.attributes})}},name:"toolbar",schema:[Kr("dom"),Kr("onEscape"),Kr("getSink")]}),yD=iE.optional({factory:{sketch:function(e){var t=e.editor,n=e.sticky?qE:hE;return{uid:e.uid,dom:e.dom,components:e.components,behaviours:wc(n(t,e.sharedBackstage))}}},name:"header",schema:[Kr("dom")]}),wD=iE.optional({name:"socket",schema:[Kr("dom")]}),xD=iE.optional({factory:{sketch:function(e){return{uid:e.uid,dom:{tag:"div",classes:["tox-sidebar"],attributes:{role:"complementary"}},components:[{dom:{tag:"div",classes:["tox-sidebar__slider"]},components:[],behaviours:wc([Qw.config({}),mp.config({}),pA.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(e){Bd.getCurrent(e).each(xA.hideAllSlots),Ei(e,EA)},onGrown:function(e){Ei(e,EA)},onStartGrow:function(e){Ai(e,_A,{width:tn(e.element,"width").getOr("")})},onStartShrink:function(e){Ai(e,_A,{width:vn(e.element)+"px"})}}),up.config({}),Bd.config({find:function(e){var t=up.contents(e);return ie(t)}})])}],behaviours:wc([vk(0),cp("sidebar-sliding-events",[Ii(_A,(function(e,t){Yt(e.element,"width",t.event.width)})),Ii(EA,(function(e,t){on(e.element,"width")}))])])}}},name:"sidebar",schema:[Kr("dom")]}),CD=iE.optional({factory:{sketch:function(e){return{uid:e.uid,dom:{tag:"div",attributes:{"aria-hidden":"true"},classes:["tox-throbber"],styles:{display:"none"}},behaviours:wc([up.config({}),MA.config({focus:!1}),Bd.config({find:function(e){return ie(e.components())}})]),components:[]}}},name:"throbber",schema:[Kr("dom")]}),SD=Md({name:"OuterContainer",factory:function(e,t,n){var r={getSocket:function(t){return oE.getPart(t,e,"socket")},setSidebar:function(t,n){oE.getPart(t,e,"sidebar").each((function(e){return function(e,t){Bd.getCurrent(e).each((function(e){return up.set(e,[TA(t)])}))}(e,n)}))},toggleSidebar:function(t,n){oE.getPart(t,e,"sidebar").each((function(e){return function(e,t){Bd.getCurrent(e).each((function(e){Bd.getCurrent(e).each((function(n){pA.hasGrown(e)?xA.isShowing(n,t)?pA.shrink(e):(xA.hideAllSlots(n),xA.showSlot(n,t)):(xA.hideAllSlots(n),xA.showSlot(n,t),pA.grow(e))}))}))}(e,n)}))},whichSidebar:function(t){return oE.getPart(t,e,"sidebar").bind(OA).getOrNull()},getHeader:function(t){return oE.getPart(t,e,"header")},getToolbar:function(t){return oE.getPart(t,e,"toolbar")},setToolbar:function(t,n){oE.getPart(t,e,"toolbar").each((function(e){e.getApis().setGroups(e,n)}))},setToolbars:function(t,n){oE.getPart(t,e,"multiple-toolbar").each((function(e){lE.setItems(e,n)}))},refreshToolbar:function(t){oE.getPart(t,e,"toolbar").each((function(e){return e.getApis().refresh(e)}))},toggleToolbarDrawer:function(t){oE.getPart(t,e,"toolbar").each((function(e){var t,n;t=e.getApis().toggle,n=function(t){return t(e)},null!=t?R.some(n(t)):R.none()}))},isToolbarDrawerToggled:function(t){return oE.getPart(t,e,"toolbar").bind((function(e){return R.from(e.getApis().isOpen).map((function(t){return t(e)}))})).getOr(!1)},getThrobber:function(t){return oE.getPart(t,e,"throbber")},focusToolbar:function(t){oE.getPart(t,e,"toolbar").orThunk((function(){return oE.getPart(t,e,"multiple-toolbar")})).each((function(e){tp.focusIn(e)}))},setMenubar:function(t,n){oE.getPart(t,e,"menubar").each((function(e){QE.setMenus(e,n)}))},focusMenubar:function(t){oE.getPart(t,e,"menubar").each((function(e){QE.focus(e)}))}};return{uid:e.uid,dom:e.dom,components:t,apis:r,behaviours:e.behaviours}},configFields:[Kr("dom"),Kr("behaviours")],partFields:[yD,hD,bD,vD,wD,xD,CD],apis:{getSocket:function(e,t){return e.getSocket(t)},setSidebar:function(e,t,n){e.setSidebar(t,n)},toggleSidebar:function(e,t,n){e.toggleSidebar(t,n)},whichSidebar:function(e,t){return e.whichSidebar(t)},getHeader:function(e,t){return e.getHeader(t)},getToolbar:function(e,t){return e.getToolbar(t)},setToolbar:function(e,t,n){var r=j(n,(function(e){return lD(e)}));e.setToolbar(t,r)},setToolbars:function(e,t,n){var r=j(n,(function(e){return j(e,lD)}));e.setToolbars(t,r)},refreshToolbar:function(e,t){return e.refreshToolbar(t)},toggleToolbarDrawer:function(e,t){e.toggleToolbarDrawer(t)},isToolbarDrawerToggled:function(e,t){return e.isToolbarDrawerToggled(t)},getThrobber:function(e,t){return e.getThrobber(t)},setMenubar:function(e,t,n){e.setMenubar(t,n)},focusMenubar:function(e,t){e.focusMenubar(t)},focusToolbar:function(e,t){e.focusToolbar(t)}}}),kD={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"}},TD=function(e){return"string"==typeof e?e.split(" "):e},OD=function(e,t){var n=T(T({},kD),t.menus),r=se(t.menus).length>0,o=void 0===t.menubar||!0===t.menubar?TD("file edit view insert format tools table help"):TD(!1===t.menubar?"":t.menubar),i=$(o,(function(e){var n=ye(kD,e);return r?n||be(t.menus,e).exists((function(e){return ye(e,"items")})):n})),a=j(i,(function(r){var o=n[r];return function(e,t,n){var r=function(e){return e.getParam("removed_menuitems","")}(n).split(/[ ,]/);return{text:e.title,getItems:function(){return J(e.items,(function(e){var n=e.toLowerCase();return 0===n.trim().length||L(r,(function(e){return e===n}))?[]:"separator"===n||"|"===n?[{type:"separator"}]:t.menuItems[n]?[t.menuItems[n]]:[]}))}}}({title:o.title,items:TD(o.items)},t,e)}));return $(a,(function(e){return e.getItems().length>0&&L(e.getItems(),(function(e){return"separator"!==e.type}))}))},_D=function(e){var t=function(){e._skinLoaded=!0,function(e){e.fire("SkinLoaded")}(e)};return function(){e.initialized?t():e.on("init",t)}},ED=function(e,t,n){return new Wh((function(r,o){n.load(t,r,o),e.on("remove",(function(){return n.unload(t)}))}))},AD=function(e,t){return ED(e,t+"/skin.min.css",e.ui.styleSheetLoader)},DD=function(e,t){var n;return(n=Re.fromDom(e.getElement()),Pt(n).isSome())?ED(e,t+"/skin.shadowdom.min.css",pb.DOM.styleSheetLoader):Wh.resolve()},MD=function(e,t){var n=function(e){var t=e.getParam("skin"),n=e.getParam("skin_url");if(!1!==t){var r=t||"oxide";n=n?e.documentBaseURI.toAbsolute(n):hb.baseURL+"/skins/ui/"+r}return n}(t);n&&t.contentCSS.push(n+(e?"/content.inline":"/content")+".min.css"),!1===function(e){return!1===e.getParam("skin")}(t)&&r(n)?Wh.all([AD(t,n),DD(t,n)]).then(_D(t),function(e,t){return function(){return function(e,t){return e.fire("SkinLoadError",t)}(e,{message:t})}}(t,"Skin could not be loaded")):_D(t)()},ND=y(MD,!1),RD=y(MD,!0),zD=function(e,t){return function(n){var r=Jc(),o=function(){n.setActive(e.formatter.match(t));var o=e.formatter.formatChanged(t,n.setActive);r.set(o)};return e.initialized?o():e.once("init",o),function(){e.off("init",o),r.clear()}}},BD=function(e,t,n){return function(r){var o=function(){return n(r)},i=function(){n(r),e.on(t,o)};return e.initialized?i():e.once("init",i),function(){e.off("init",i),e.off(t,o)}}},PD=function(e){return function(t){return function(){e.undoManager.transact((function(){e.focus(),e.execCommand("mceToggleFormat",!1,t.format)}))}}},ID=function(e,t){return function(){return e.execCommand(t)}},FD=function(e,t,n){var r=function(e,r,i,a){var u=t.shared.providers.translate(e.title);if("separator"===e.type)return R.some({type:"separator",text:u});if("submenu"===e.type){var c=J(e.getStyleItems(),(function(e){return o(e,r,a)}));return 0===r&&c.length<=0?R.none():R.some({type:"nestedmenuitem",text:u,disabled:c.length<=0,getSubmenuItems:function(){return J(e.getStyleItems(),(function(e){return o(e,r,a)}))}})}return R.some(T({type:"togglemenuitem",text:u,icon:e.icon,active:e.isSelected(a),disabled:i,onAction:n.onAction(e)},e.getStylePreview().fold((function(){return{}}),(function(e){return{meta:{style:e}}}))))},o=function(e,t,o){var i="formatter"===e.type&&n.isInvalid(e);return 0===t?i?[]:r(e,t,!1,o).toArray():r(e,t,i,o).toArray()},i=function(e){var t=n.getCurrentValue(),r=n.shouldHide?0:1;return J(e,(function(e){return o(e,r,t)}))};return{validateItems:i,getFetch:function(e,t){return function(n,r){var o=t(),a=i(o);r(HT(a,hv.CLOSE_ON_EXECUTE,e,!1))}}}},LD=function(e,t,n){var r=n.dataset,o="basic"===r.type?function(){return j(r.data,(function(e){return __(e,n.isSelectedFor,n.getPreviewFor)}))}:r.getData;return{items:FD(0,t,n),getStyleItems:o}},HD=function(e,t,n){var r=LD(0,t,n),o=r.items,i=r.getStyleItems,a=BD(e,"NodeChange",(function(e){var t=e.getComponent();n.updateText(t)}));return zT({text:n.icon.isSome()?R.none():n.text,icon:n.icon,tooltip:R.from(n.tooltip),role:R.none(),fetch:o.getFetch(t,i),onSetup:a,getApi:function(e){return{getComponent:h(e)}},columns:1,presets:"normal",classes:n.icon.isSome()?[]:["bespoke"],dropdownBehaviours:[]},"tox-tbtn",t.shared)};!function(e){e[e.SemiColon=0]="SemiColon",e[e.Space=1]="Space"}(kO||(kO={}));var VD,jD,UD,WD,$D,qD=function(e,t,n,r){var o=function(e){return j(e,(function(e){var t=e,n=e,r=e.split("=");return r.length>1&&(t=r[0],n=r[1]),{title:t,format:n}}))}(function(e,t){return t===kO.SemiColon?e.replace(/;$/,"").split(";"):e.split(" ")}(e.getParam(t,n,"string"),r));return{type:"basic",data:o}},GD=[{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"}],KD=function(e){var t={type:"basic",data:GD};return{tooltip:"Align",text:R.none(),icon:R.some("align-left"),isSelectedFor:function(t){return function(){return e.formatter.match(t)}},getCurrentValue:R.none,getPreviewFor:function(e){return R.none},onAction:function(t){return function(){return K(GD,(function(e){return e.format===t.format})).each((function(t){return e.execCommand(t.command)}))}},updateText:function(t){var n=K(GD,(function(t){return e.formatter.match(t.format)})),r=n.fold(h("left"),(function(e){return e.title.toLowerCase()}));Ai(t,RT,{icon:"align-"+r})},dataset:t,shouldHide:!1,isInvalid:function(t){return!e.formatter.canApply(t.format)}}},XD=["-apple-system","Segoe UI","Roboto","Helvetica Neue","sans-serif"],YD=function(e){var t=e.split(/\s*,\s*/);return j(t,(function(e){return e.replace(/^['"]+|['"]+$/g,"")}))},JD=function(e){var t="System Font",n=function(){var n=function(e){return e?YD(e)[0]:""},o=e.queryCommandValue("FontName"),i=r.data,a=o?o.toLowerCase():"",u=K(i,(function(e){var t=e.format;return t.toLowerCase()===a||n(t).toLowerCase()===n(a).toLowerCase()})).orThunk((function(){return ke(function(e){var t;return 0===e.indexOf("-apple-system")&&(t=YD(e.toLowerCase()),Z(XD,(function(e){return t.indexOf(e.toLowerCase())>-1})))}(a),{title:t,format:a})}));return{matchOpt:u,font:o}},r=qD(e,"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",kO.SemiColon);return{tooltip:"Fonts",text:R.some(t),icon:R.none(),isSelectedFor:function(e){return function(t){return t.exists((function(t){return t.format===e}))}},getCurrentValue:function(){return n().matchOpt},getPreviewFor:function(e){return function(){return R.some({tag:"div",styles:-1===e.indexOf("dings")?{"font-family":e}:{}})}},onAction:function(t){return function(){e.undoManager.transact((function(){e.focus(),e.execCommand("FontName",!1,t.format)}))}},updateText:function(e){var t=n(),r=t.matchOpt,o=t.font,i=r.fold(h(o),(function(e){return e.title}));Ai(e,NT,{text:i})},dataset:r,shouldHide:!1,isInvalid:C}},ZD={"8pt":"1","10pt":"2","12pt":"3","14pt":"4","18pt":"5","24pt":"6","36pt":"7"},QD={"xx-small":"7pt","x-small":"8pt",small:"10pt",medium:"12pt",large:"14pt","x-large":"18pt","xx-large":"24pt"},eM=function(e,t){return/[0-9.]+px$/.test(e)?function(e,t){var n=Math.pow(10,t);return Math.round(e*n)/n}(72*parseInt(e,10)/96,t||0)+"pt":be(QD,e).getOr(e)},tM=function(e){var t=function(){var t=R.none(),n=r.data,o=e.queryCommandValue("FontSize");if(o)for(var i=function(e){var r=eM(o,e),i=function(e){return be(ZD,e).getOr("")}(r);t=K(n,(function(e){return e.format===o||e.format===r||e.format===i}))},a=3;t.isNone()&&a>=0;a--)i(a);return{matchOpt:t,size:o}},n=h(R.none),r=qD(e,"fontsize_formats","8pt 10pt 12pt 14pt 18pt 24pt 36pt",kO.Space);return{tooltip:"Font sizes",text:R.some("12pt"),icon:R.none(),isSelectedFor:function(e){return function(t){return t.exists((function(t){return t.format===e}))}},getPreviewFor:n,getCurrentValue:function(){return t().matchOpt},onAction:function(t){return function(){e.undoManager.transact((function(){e.focus(),e.execCommand("FontSize",!1,t.format)}))}},updateText:function(e){var n=t(),r=n.matchOpt,o=n.size,i=r.fold(h(o),(function(e){return e.title}));Ai(e,NT,{text:i})},dataset:r,shouldHide:!1,isInvalid:C}},nM=function(e,t){var n=t(),r=j(n,(function(e){return e.format}));return R.from(e.formatter.closest(r)).bind((function(e){return K(n,(function(t){return t.format===e}))})).orThunk((function(){return ke(e.formatter.match("p"),{title:"Paragraph",format:"p"})}))},rM=function(e){var t="Paragraph",n=qD(e,"block_formats","Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre",kO.SemiColon);return{tooltip:"Blocks",text:R.some(t),icon:R.none(),isSelectedFor:function(t){return function(){return e.formatter.match(t)}},getCurrentValue:R.none,getPreviewFor:function(t){return function(){var n=e.formatter.get(t);return R.some({tag:n.length>0&&(n[0].inline||n[0].block)||"div",styles:e.dom.parseStyle(e.formatter.getCssText(t))})}},onAction:PD(e),updateText:function(r){var o=nM(e,(function(){return n.data})).fold(h(t),(function(e){return e.title}));Ai(r,NT,{text:o})},dataset:n,shouldHide:!1,isInvalid:function(t){return!e.formatter.canApply(t.format)}}},oM=function(e,t){var n="Paragraph";return{tooltip:"Formats",text:R.some(n),icon:R.none(),isSelectedFor:function(t){return function(){return e.formatter.match(t)}},getCurrentValue:R.none,getPreviewFor:function(t){return function(){var n=e.formatter.get(t);return void 0!==n?R.some({tag:n.length>0&&(n[0].inline||n[0].block)||"div",styles:e.dom.parseStyle(e.formatter.getCssText(t))}):R.none()}},onAction:PD(e),updateText:function(t){var r=function(e){var t=e.items;return void 0!==t&&t.length>0?J(t,r):[{title:e.title,format:e.format}]},o=J(O_(e),r),i=nM(e,h(o)).fold(h(n),(function(e){return e.title}));Ai(t,NT,{text:i})},shouldHide:e.getParam("style_formats_autohide",!1,"boolean"),isInvalid:function(t){return!e.formatter.canApply(t.format)},dataset:t}},iM=Object.freeze({__proto__:null,events:function(e,t){var n=function(n,r){e.updateState.each((function(e){var o=e(n,r);t.set(o)})),e.renderComponents.each((function(e){var o=e(r,t.get()),i=j(o,n.getSystem().build);Hl(n,i)}))};return zi([Ii(ai(),(function(t,r){var o=r;if(!o.universal){var i=e.channel;F(o.channels,i)&&n(t,o.data)}})),$i((function(t,r){e.initialData.each((function(e){n(t,e)}))}))])}}),aM=Object.freeze({__proto__:null,getState:function(e,t,n){return n}}),uM=[Kr("channel"),ro("renderComponents"),ro("updateState"),ro("initialData")],cM=Object.freeze({__proto__:null,init:function(){var e=wo(R.none());return{readState:function(){return e.get().getOr("none")},get:e.get,set:e.set,clear:function(){return e.set(R.none())}}}}),sM=Cc({fields:uM,name:"reflecting",active:iM,apis:aM,state:cM}),lM=h([Kr("toggleClass"),Kr("fetch"),Au("onExecute"),lo("getHotspot",R.some),lo("getAnchorOverrides",h({})),ks(),Au("onItemExecute"),ro("lazySink"),Kr("dom"),_u("onOpen"),_f("splitDropdownBehaviours",[Ux,tp,mp]),lo("matchWidth",!1),lo("useMinWidth",!1),lo("eventOrder",{}),ro("role")].concat(oC())),fM=nd({factory:vh,schema:[Kr("dom")],name:"arrow",defaults:function(){return{buttonBehaviours:wc([mp.revoke()])}},overrides:function(e){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(t){t.getSystem().getByUid(e.uid).each(Di)},buttonBehaviours:wc([Tp.config({toggleOnExecute:!1,toggleClass:e.toggleClass})])}}}),dM=nd({factory:vh,schema:[Kr("dom")],name:"button",defaults:function(){return{buttonBehaviours:wc([mp.revoke()])}},overrides:function(e){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(t){t.getSystem().getByUid(e.uid).each((function(n){e.onExecute(n,t)}))}}}}),mM=h([fM,dM,od({factory:{sketch:function(e){return{uid:e.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:e.text}}}},schema:[Kr("text")],name:"aria-descriptor"}),rd({schema:[ku()],name:"menu",defaults:function(e){return{onExecute:function(t,n){t.getSystem().getByUid(e.uid).each((function(r){e.onItemExecute(r,t,n)}))}}}}),$x()]),gM=Md({name:"SplitDropdown",configFields:lM(),partFields:mM(),factory:function(e,t,n,r){var o,i=function(e){Bd.getCurrent(e).each((function(e){am.highlightFirst(e),tp.focusIn(e)}))},a=function(t){Zx(e,v,t,r,i,Cx.HighlightFirst).get(g)},u=function(t){var n=vd(t,e,"button");return Di(n),R.some(!0)},c=T(T({},zi([$i((function(t,n){hd(t,e,"aria-descriptor").each((function(e){var n=ra("aria");Ut(e.element,"id",n),Ut(t.element,"aria-describedby",n)}))}))])),_p(R.some(a))),s={repositionMenus:function(e){Tp.isOn(e)&&rC(e)}};return{uid:e.uid,dom:e.dom,components:t,apis:s,eventOrder:T(T({},e.eventOrder),(o={},o[ui()]=["disabling","toggling","alloy.base.behaviour"],o)),events:c,behaviours:Af(e.splitDropdownBehaviours,[Ux.config({others:{sandbox:function(t){var n=vd(t,e,"arrow");return nC(e,t,{onOpen:function(){Tp.on(n),Tp.on(t)},onClose:function(){Tp.off(n),Tp.off(t)}})}}}),tp.config({mode:"special",onSpace:u,onEnter:u,onDown:function(e){return a(e),R.some(!0)}}),mp.config({}),Tp.config({toggleOnExecute:!1,aria:{mode:"expanded"}})]),domModification:{attributes:{role:e.role.getOr("button"),"aria-haspopup":!0}}}},apis:{repositionMenus:function(e,t){return e.repositionMenus(t)}}}),pM=function(e){return{isDisabled:function(){return Xd.isDisabled(e)},setDisabled:function(t){return Xd.set(e,t)}}},hM=function(e){return{setActive:function(t){Tp.set(e,t)},isActive:function(){return Tp.isOn(e)},isDisabled:function(){return Xd.isDisabled(e)},setDisabled:function(t){return Xd.set(e,t)}}},vM=function(e,t){return e.map((function(e){return{"aria-label":t.translate(e),title:t.translate(e)}})).getOr({})},bM=ra("focus-button"),yM=function(e,t,n,r,o,i){var a;return{dom:{tag:"button",classes:["tox-tbtn"].concat(t.isSome()?["tox-tbtn--select"]:[]),attributes:vM(n,i)},components:ny([e.map((function(e){return _T(e,i.icons)})),t.map((function(e){return AT(e,"tox-tbtn",i)}))]),eventOrder:(a={},a[Lo()]=["focusing","alloy.base.behaviour","common-button-display-events"],a),buttonBehaviours:wc([Yb(i.isDisabled),qb(),cp("common-button-display-events",[Ii(Lo(),(function(e,t){t.event.prevent(),Ei(e,bM)}))])].concat(r.map((function(n){return sM.config({channel:n,initialData:{icon:e,text:t},renderComponents:function(e,t){return ny([e.icon.map((function(e){return _T(e,i.icons)})),e.text.map((function(e){return AT(e,"tox-tbtn",i)}))])}})})).toArray()).concat(o.getOr([])))}},wM=function(e,t,n){var r,o=wo(g),i=yM(e.icon,e.text,e.tooltip,R.none(),R.none(),n);return vh.sketch({dom:i.dom,components:i.components,eventOrder:MT,buttonBehaviours:wc([cp("toolbar-button-events",[(r={onAction:e.onAction,getApi:t.getApi},Ki((function(e,t){Jb(r,e)((function(t){Ai(e,DT,{buttonApi:t}),r.onAction(t)}))}))),Zb(t,o),Qb(t,o)]),Yb((function(){return e.disabled||n.isDisabled()})),qb()].concat(t.toolbarButtonBehaviours))})},xM=function(e,t,n){return wM(e,{toolbarButtonBehaviours:[].concat(n.length>0?[cp("toolbarButtonWith",n)]:[]),getApi:pM,onSetup:e.onSetup},t)},CM=function(e,t,n){return ar(wM(e,{toolbarButtonBehaviours:[up.config({}),Tp.config({toggleClass:"tox-tbtn--enabled",aria:{mode:"pressed"},toggleOnExecute:!1})].concat(n.length>0?[cp("toolbarToggleButtonWith",n)]:[]),getApi:hM,onSetup:e.onSetup},t))},SM=function(e,t,n){return function(r){return Ex((function(e){return t.fetch(e)})).map((function(o){return R.from(Dw(ar(lw(ra("menu-value"),o,(function(n){t.onItemAction(e(r),n)}),t.columns,t.presets,hv.CLOSE_ON_EXECUTE,t.select.getOr(C),n),{movement:dw(t.columns,t.presets),menuBehaviours:ab("auto"!==t.columns?[]:[$i((function(e,n){ob(e,4,Ev(t.presets)).each((function(t){var n=t.numRows,r=t.numColumns;tp.setGridSize(e,n,r)}))}))])})))}))}},kM=[{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"]}],TM=function(e,t){return function(n,r,o){var i=e(n).mapError((function(e){return Ur(e)})).getOrDie();return t(i,r,o)}},OM={button:TM(nv,(function(e,t){return n=e,r=t.backstage.shared.providers,xM(n,r,[]);var n,r})),togglebutton:TM(iv,(function(e,t){return n=e,r=t.backstage.shared.providers,CM(n,r,[]);var n,r})),menubutton:TM(JE,(function(e,t){return jT(e,"tox-tbtn",t.backstage,R.none())})),splitbutton:TM((function(e){return Hr("SplitButton",ZE,e)}),(function(e,t){return function(e,t){var n,r=ra("channel-update-split-dropdown-display"),o=function(e){return{isDisabled:function(){return Xd.isDisabled(e)},setDisabled:function(t){return Xd.set(e,t)},setIconFill:function(t,n){su(e.element,'svg path[id="'+t+'"], rect[id="'+t+'"]').each((function(e){Ut(e,"fill",n)}))},setIconStroke:function(t,n){su(e.element,'svg path[id="'+t+'"], rect[id="'+t+'"]').each((function(e){Ut(e,"stroke",n)}))},setActive:function(t){Ut(e.element,"aria-pressed",t),su(e.element,"span").each((function(n){e.getSystem().getByDom(n).each((function(e){return Tp.set(e,t)}))}))},isActive:function(){return su(e.element,"span").exists((function(t){return e.getSystem().getByDom(t).exists(Tp.isOn)}))}}},i=wo(g),a={getApi:o,onSetup:e.onSetup};return gM.sketch({dom:{tag:"div",classes:["tox-split-button"],attributes:T({"aria-pressed":!1},vM(e.tooltip,t.providers))},onExecute:function(t){e.onAction(o(t))},onItemExecute:function(e,t,n){},splitDropdownBehaviours:wc([Xb(t.providers.isDisabled),qb(),cp("split-dropdown-events",[Ii(bM,mp.focus),Zb(a,i),Qb(a,i)]),sC.config({})]),eventOrder:(n={},n[bi()]=["alloy.base.behaviour","split-dropdown-events"],n),toggleClass:"tox-tbtn--enabled",lazySink:t.getSink,fetch:SM(o,e,t.providers),parts:{menu:zv(0,e.columns,e.presets)},components:[gM.parts.button(yM(e.icon,e.text,R.none(),R.some(r),R.some([Tp.config({toggleClass:"tox-tbtn--enabled",toggleOnExecute:!1})]),t.providers)),gM.parts.arrow({dom:{tag:"button",classes:["tox-tbtn","tox-split-button__chevron"],innerHtml:Th("chevron-down",t.providers.icons)},buttonBehaviours:wc([Xb(t.providers.isDisabled),qb(),Oh()])}),gM.parts["aria-descriptor"]({text:t.providers.translate("To open the popup, press Shift+Enter")})]})}(e,t.backstage.shared)})),grouptoolbarbutton:TM((function(e){return Hr("GroupToolbarButton",KE,e)}),(function(e,t,n){var r,o=n.ui.registry.getAll().buttons,i=((r={})[Cs]=t.backstage.shared.header.isPositionedAtTop()?jc.TopToBottom:jc.BottomToTop,r);if(Eb(n)===pv.floating)return function(e,t,n,r){var o=t.shared;return JA.sketch({lazySink:o.getSink,fetch:function(){return Ex((function(t){t(j(n(e.items),lD))}))},markers:{toggledClass:"tox-tbtn--enabled"},parts:{button:yM(e.icon,e.text,e.tooltip,R.none(),R.none(),o.providers),toolbar:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:r}}}})}(e,t.backstage,(function(e){return DM(n,{buttons:o,toolbar:e,allowToolbarGroups:!1},t,R.none())}),i);throw new Error("Toolbar groups are only supported when using floating toolbar mode")})),styleSelectButton:function(e,t){return function(e,t){var n=T({type:"advanced"},t.styleselect);return HD(e,t,oM(e,n))}(e,t.backstage)},fontsizeSelectButton:function(e,t){return function(e,t){return HD(e,t,tM(e))}(e,t.backstage)},fontSelectButton:function(e,t){return function(e,t){return HD(e,t,JD(e))}(e,t.backstage)},formatButton:function(e,t){return function(e,t){return HD(e,t,rM(e))}(e,t.backstage)},alignMenuButton:function(e,t){return function(e,t){return HD(e,t,KD(e))}(e,t.backstage)}},_M={styleselect:OM.styleSelectButton,fontsizeselect:OM.fontsizeSelectButton,fontselect:OM.fontSelectButton,formatselect:OM.formatButton,align:OM.alignMenuButton},EM=function(e){var t,n=e.toolbar,o=e.buttons;return!1===n?[]:void 0===n||!0===n?function(e){var t=j(kM,(function(t){var n=$(t.items,(function(t){return ye(e,t)||ye(_M,t)}));return{name:t.name,items:n}}));return $(t,(function(e){return e.items.length>0}))}(o):r(n)?(t=n.split("|"),j(t,(function(e){return{items:e.trim().split(" ")}}))):function(e){return m(e,(function(e){return ye(e,"name")&&ye(e,"items")}))}(n)?n:(console.error("Toolbar type should be string, string[], boolean or ToolbarGroup[]"),[])},AM=function(e,t,n,r,o,i){return be(t,n.toLowerCase()).orThunk((function(){return i.bind((function(e){return ce(e,(function(e){return be(t,e+n.toLowerCase())}))}))})).fold((function(){return be(_M,n.toLowerCase()).map((function(t){return t(e,o)})).orThunk((function(){return R.none()}))}),(function(t){return"grouptoolbarbutton"!==t.type||r?function(e,t,n){return be(OM,e.type).fold((function(){return console.error("skipping button defined by",e),R.none()}),(function(r){return R.some(r(e,t,n))}))}(t,o,e):(console.warn("Ignoring the '"+n+"' toolbar button. Group toolbar buttons are only supported when using floating toolbar mode and cannot be nested."),R.none())}))},DM=function(e,t,n,r){var o=EM(t),i=j(o,(function(o){var i=J(o.items,(function(o){return 0===o.trim().length?[]:AM(e,t.buttons,o,t.allowToolbarGroups,n,r).toArray()}));return{title:R.from(e.translate(o.name)),items:i}}));return $(i,(function(e){return e.items.length>0}))},MM=function(e,t,n,o){var i=t.outerContainer,a=n.toolbar,u=n.buttons;if(m(a,r)){var c=a.map((function(t){var r={toolbar:t,buttons:u,allowToolbarGroups:n.allowToolbarGroups};return DM(e,r,{backstage:o},R.none())}));SD.setToolbars(i,c)}else SD.setToolbar(i,DM(e,n,{backstage:o},R.none()))},NM=pt(),RM=NM.os.isiOS()&&NM.os.version.major<=12,zM=Object.freeze({__proto__:null,render:function(e,t,n,r,o){var i=wo(0),u=t.outerContainer;ND(e);var c=Re.fromDom(o.targetNode),s=Bt(zt(c));!function(e,t){Gl(e,t,Sn)}(c,t.mothership),ql(s,t.uiMothership),e.on("PostRender",(function(){MM(e,t,n,r),i.set(e.getWin().innerWidth),SD.setMenubar(u,OD(e,n)),SD.setSidebar(u,n.sidebar),function(e,t){var n=e.dom,r=e.getWin(),o=e.getDoc().documentElement,i=wo(dn(r.innerWidth,r.innerHeight)),a=wo(dn(o.offsetWidth,o.offsetHeight)),u=function(){var t=i.get();t.left===r.innerWidth&&t.top===r.innerHeight||(i.set(dn(r.innerWidth,r.innerHeight)),Vy(e))},c=function(){var t=e.getDoc().documentElement,n=a.get();n.left===t.offsetWidth&&n.top===t.offsetHeight||(a.set(dn(t.offsetWidth,t.offsetHeight)),Vy(e))},s=function(t){return function(e,t){return e.fire("ScrollContent",t)}(e,t)};n.bind(r,"resize",u),n.bind(r,"scroll",s);var l=ts(Re.fromDom(e.getBody()),"load",c),f=t.uiMothership.element;e.on("hide",(function(){Yt(f,"display","none")})),e.on("show",(function(){on(f,"display")})),e.on("NodeChange",c),e.on("remove",(function(){l.unbind(),n.unbind(r,"resize",u),n.unbind(r,"scroll",s),r=null}))}(e,t)}));var l,f,d,m=SD.getSocket(u).getOrDie("Could not find expected socket element");if(RM){Jt(m.element,{overflow:"scroll","-webkit-overflow-scrolling":"touch"});var g=(l=function(){e.fire("ScrollContent")},f=20,d=null,{cancel:function(){a(d)||(clearTimeout(d),d=null)},throttle:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];a(d)&&(d=setTimeout((function(){d=null,l.apply(null,e)}),f))}}),p=es(m.element,"scroll",g.throttle);e.on("remove",p.unbind)}$b(e,t),e.addCommand("ToggleSidebar",(function(t,n){SD.toggleSidebar(u,n),e.fire("ToggleSidebar")})),e.addQueryValueHandler("ToggleSidebar",(function(){return SD.whichSidebar(u)}));var h=Eb(e);h!==pv.sliding&&h!==pv.floating||e.on("ResizeWindow ResizeEditor ResizeContent",(function(){var n=e.getWin().innerWidth;n!==i.get()&&(SD.refreshToolbar(t.outerContainer),i.set(n))}));var v={enable:function(){Wb(t,!1)},disable:function(){Wb(t,!0)},isDisabled:function(){return Xd.isDisabled(u)}};return{iframeContainer:m.element.dom,editorContainer:u.element.dom,api:v}}}),BM=function(e){return/^[0-9\.]+(|px)$/i.test(""+e)?R.some(parseInt(""+e,10)):R.none()},PM=function(e){return d(e)?e+"px":e},IM=function(e,t,n){var r=t.filter((function(t){return e<t})),o=n.filter((function(t){return e>t}));return r.or(o).getOr(e)},FM=function(e){var t=function(e){var t=vb(e),n=wb(e),r=Cb(e);return BM(t).map((function(e){return IM(e,n,r)}))}(e);return t.getOr(vb(e))},LM=function(e){var t=bb(e),n=yb(e),r=xb(e);return BM(t).map((function(e){return IM(e,n,r)}))},HM=function(e,t,n,r,o){var i=n.uiMothership,a=n.outerContainer,u=pb.DOM,c=zb(e),s=Ib(e),l=xb(e).or(LM(e)),f=r.shared.header,d=f.isPositionedAtTop,m=Eb(e),g=m===pv.sliding||m===pv.floating,p=wo(!1),v=function(){return p.get()&&!e.removed},b=function(e){return g?e.fold(h(0),(function(e){return e.components().length>1?sn(e.components()[1].element):0})):0},y=function(){i.broadcastOn([cf()],{})},w=function(e){if(void 0===e&&(e=!1),v()){var n;if(c||(n=l.getOrThunk((function(){var e=BM(Qt(Ht(),"margin-left")).getOr(0);return vn(Ht())-gn(t).left+e})),Yt(o.get().element,"max-width",n+"px")),g&&SD.refreshToolbar(a),c||function(){var e=SD.getToolbar(a),n=b(e),r=Fn(t),i=d()?Math.max(r.y-sn(o.get().element)+n,0):r.bottom;Jt(a.element,{position:"absolute",top:Math.round(i)+"px",left:Math.round(r.x)+"px"})}(),s){var r=o.get();e?IE.reset(r):IE.refresh(r)}y()}},x=function(n){if(void 0===n&&(n=!0),!c&&s&&v()){var r=f.getDockingMode(),i=function(n){switch(Mb(e)){case _b.auto:var r=SD.getToolbar(a),o=b(r),i=sn(n.element)-o,u=Fn(t);if(u.y>i)return"top";var c=St(t),s=Math.max(c.dom.scrollHeight,sn(c));return u.bottom<s-i||Hn().bottom<u.bottom-i?"bottom":"top";case _b.bottom:return"bottom";case _b.top:default:return"top"}}(o.get());i!==r&&(!function(e){var t=o.get();IE.setModes(t,[e]),f.setDockingMode(e);var n=d()?jc.TopToBottom:jc.BottomToTop;Ut(t.element,Cs,n)}(i),n&&w(!0))}};return{isVisible:v,isPositionedAtTop:d,show:function(){p.set(!0),Yt(a.element,"display","flex"),u.addClass(e.getBody(),"mce-edit-focus"),on(i.element,"display"),x(!1),w()},hide:function(){p.set(!1),n.outerContainer&&(Yt(a.element,"display","none"),u.removeClass(e.getBody(),"mce-edit-focus")),Yt(i.element,"display","none")},update:w,updateMode:x,repositionPopups:y}},VM=function(e,t){var n=Fn(e);return{pos:t?n.y:n.bottom,bounds:n}},jM=Object.freeze({__proto__:null,render:function(e,t,n,r,o){var i=t.mothership,a=t.uiMothership,u=t.outerContainer,c=wo(null),s=Re.fromDom(o.targetNode),l=HM(e,s,t,r,c),f=function(e){return e.getParam("toolbar_persist",!1,"boolean")}(e);RD(e);var d=function(){if(c.get())l.show();else{c.set(SD.getHeader(u).getOrDie());var o=Bb(e);ql(o,i),ql(o,a),MM(e,t,n,r),SD.setMenubar(u,OD(e,n)),l.show(),function(e,t,n,r){var o=wo(VM(t,n.isPositionedAtTop())),i=function(r){var i=VM(t,n.isPositionedAtTop()),a=i.pos,u=i.bounds,c=o.get(),s=c.pos,l=c.bounds,f=u.height!==l.height||u.width!==l.width;o.set({pos:a,bounds:u}),f&&Vy(e,r),n.isVisible()&&(s!==a?n.update(!0):f&&(n.updateMode(),n.repositionPopups()))};r||(e.on("activate",n.show),e.on("deactivate",n.hide)),e.on("SkinLoaded ResizeWindow",(function(){return n.update(!0)})),e.on("NodeChange keydown",(function(e){hh.requestAnimationFrame((function(){return i(e)}))})),e.on("ScrollWindow",(function(){return n.updateMode()}));var a=Jc();a.set(ts(Re.fromDom(e.getBody()),"load",i)),e.on("remove",(function(){a.clear()}))}(e,s,l,f),e.nodeChanged()}},m=function(){return hh.setEditorTimeout(e,d,0)};e.on("show",d),e.on("hide",l.hide),f||(e.on("focus",m),e.on("blur",l.hide)),e.on("init",(function(){(e.hasFocus()||f)&&m()})),$b(e,t);var g={show:function(){l.show()},hide:function(){l.hide()},enable:function(){Wb(t,!1)},disable:function(){Wb(t,!0)},isDisabled:function(){return Xd.isDisabled(u)}};return{editorContainer:u.element.dom,api:g}}}),UM="contexttoolbar-hide",WM=function(e,t){return Ii(DT,(function(n,r){var o=function(e){return{hide:function(){return Ei(e,fi())},getValue:function(){return Of.getValue(e)}}}(e.get(n));t.onAction(o,r.event.buttonApi)}))},$M=function(e,t,n){var r={backstage:{shared:{providers:n}}};return"contextformtogglebutton"===t.type?function(e,t,n){var r=t.original;r.primary;var o=O(r,["primary"]),i=Vr(iv(T(T({},o),{type:"togglebutton",onAction:g})));return CM(i,n.backstage.shared.providers,[WM(e,t)])}(e,t,r):function(e,t,n){var r=t.original;r.primary;var o=O(r,["primary"]),i=Vr(nv(T(T({},o),{type:"button",onAction:g})));return xM(i,n.backstage.shared.providers,[WM(e,t)])}(e,t,r)},qM=function(e,t){var n=e.label.fold((function(){return{}}),(function(e){return{"aria-label":e}})),r=bh(yx.sketch({inputClasses:["tox-toolbar-textfield","tox-toolbar-nav-js"],data:e.initValue(),inputAttributes:n,selectOnFocus:!0,inputBehaviours:wc([tp.config({mode:"special",onEnter:function(e){return o.findPrimary(e).map((function(e){return Di(e),!0}))},onLeft:function(e,t){return t.cut(),R.none()},onRight:function(e,t){return t.cut(),R.none()}})])})),o=function(e,t,n){var r=j(t,(function(t){return bh($M(e,t,n))}));return{asSpecs:function(){return j(r,(function(e){return e.asSpec()}))},findPrimary:function(e){return ce(t,(function(t,n){return t.primary?R.from(r[n]).bind((function(t){return t.getOpt(e)})).filter(w(Xd.isDisabled)):R.none()}))}}}(r,e.commands,t);return[{title:R.none(),items:[r.asSpec()]},{title:R.none(),items:o.asSpecs()}]},GM=qM,KM=function(e,t,n){return void 0===n&&(n=.01),t.bottom-e.y>=n&&e.bottom-t.y>=n},XM=function(e){var t=function(e){var t=e.getBoundingClientRect();if(t.height<=0&&t.width<=0){var n=Dt(Re.fromDom(e.startContainer),e.startOffset).element;return(Fe(n)?Tt(n):R.some(n)).filter(Ie).map((function(e){return e.dom.getBoundingClientRect()})).getOr(t)}return t}(e.selection.getRng());if(e.inline){var n=Dn();return In(n.left+t.left,n.top+t.top,t.width,t.height)}var r=Ln(Re.fromDom(e.getBody()));return In(r.x+t.left,r.y+t.top,t.width,t.height)},YM=function(e,t,n,r){void 0===r&&(r=0);var o=Rn(window),i=Fn(Re.fromDom(e.getContentAreaContainer())),a=Sb(e)||kb(e)||Ob(e),u=function(e,t,n){var r=Math.max(e.x+n,t.x);return{x:r,width:Math.min(e.right-n,t.right)-r}}(i,o,r),c=u.x,s=u.width;if(e.inline&&!a)return In(c,o.y,s,o.height);var l=function(e,t,n,r,o,i){var a=Re.fromDom(e.getContainer()),u=su(a,".tox-editor-header").getOr(a),c=Fn(u),s=c.y>=t.bottom,l=r&&!s;if(e.inline&&l)return{y:Math.max(c.bottom+i,n.y),bottom:n.bottom};if(e.inline&&!l)return{y:n.y,bottom:Math.min(c.y-i,n.bottom)};var f="line"===o?Fn(a):t;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)}}(e,i,o,t.header.isPositionedAtTop(),n,r),f=l.y,d=l.bottom;return In(c,f,s,d-f)},JM={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"]},ZM={maxHeightFunction:ms(),maxWidthFunction:$A()},QM=function(e){return"node"===e},eN=function(e,t,n,r,o){var i=XM(e),a=r.lastElement().exists((function(e){return bt(n,e)}));return function(e,t){var n=e.selection.getRng(),r=Dt(Re.fromDom(n.startContainer),n.startOffset);return n.startContainer===n.endContainer&&n.startOffset===n.endOffset-1&&bt(r.element,t)}(e,n)?a?mh:ch:a?function(e,t,n){var r=tn(e,"position");Yt(e,"position",t);var o=n(e);return r.each((function(t){return Yt(e,"position",t)})),o}(t,r.getMode(),(function(){return KM(i,Fn(t))&&!r.isReposition()?ph:mh})):("fixed"===r.getMode()?o.y+Dn().top:o.y)+(sn(t)+12)<=i.y?ch:sh},tN=function(e,t,n,r){var o=function(t){return function(r,o,i,a,u){var c=eN(e,a,t,n,u),s=T(T({},r),{y:u.y,height:u.height});return T(T({},c(s,o,i,a,u)),{alwaysFit:!0})}},i=function(e){return QM(r)?[o(e)]:[]};return t?{onLtr:function(e){return[ic,ec,tc,nc,rc,oc].concat(i(e))},onRtl:function(e){return[ic,tc,ec,rc,nc,oc].concat(i(e))}}:{onLtr:function(e){return[oc,ic,nc,ec,rc,tc].concat(i(e))},onRtl:function(e){return[oc,ic,rc,tc,nc,ec].concat(i(e))}}},nN=function(e,t){var n=$(t,(function(t){return t.predicate(e.dom)})),r=W(n,(function(e){return"contexttoolbar"===e.type}));return{contextToolbars:r.pass,contextForms:r.fail}},rN=function(e,t,n){var r=nN(e,t);if(r.contextForms.length>0)return R.some({elem:e,toolbars:[r.contextForms[0]]});var o=nN(e,n);if(o.contextForms.length>0)return R.some({elem:e,toolbars:[o.contextForms[0]]});if(r.contextToolbars.length>0||o.contextToolbars.length>0){var i=function(e){if(e.length<=1)return e;var t=function(t){return L(e,(function(e){return e.position===t}))},n=function(t){return $(e,(function(e){return e.position===t}))},r=t("selection"),o=t("node");if(r||o){if(o&&r){var i=n("node"),a=j(n("selection"),(function(e){return T(T({},e),{position:"node"})}));return i.concat(a)}return n(r?"selection":"node")}return n("line")}(r.contextToolbars.concat(o.contextToolbars));return R.some({elem:e,toolbars:i})}return R.none()},oN=function(e,t,n){return e(t)?R.none():Eo(t,(function(e){if(Ie(e)){var t=nN(e,n.inNodeScope),r=t.contextToolbars,o=t.contextForms,i=o.length>0?o:function(e){if(e.length<=1)return e;var t=function(t){return K(e,(function(e){return e.position===t}))},n=t("selection").orThunk((function(){return t("node")})).orThunk((function(){return t("line")})).map((function(e){return e.position}));return n.fold((function(){return[]}),(function(t){return $(e,(function(e){return e.position===t}))}))}(r);return i.length>0?R.some({elem:e,toolbars:i}):R.none()}return R.none()}),e)},iN=function(e,t){var n={},r=[],o=[],i={},a={},u=function(e,u){var c=Vr(Hr("ContextForm",dv,u));n[e]=c,c.launch.map((function(n){i["form:"+e]=T(T({},u.launch),{type:"contextformtogglebutton"===n.type?"togglebutton":"button",onAction:function(){t(c)}})})),"editor"===c.scope?o.push(c):r.push(c),a[e]=c},c=function(e,t){var n;(n=t,Hr("ContextToolbar",mv,n)).each((function(n){"editor"===t.scope?o.push(n):r.push(n),a[e]=n}))},s=se(e);return U(s,(function(t){var n=e[t];"contextform"===n.type?u(t,n):"contexttoolbar"===n.type&&c(t,n)})),{forms:n,inNodeScope:r,inEditorScope:o,lookupTable:a,formNavigators:i}},aN=ra("forward-slide"),uN=ra("backward-slide"),cN=ra("change-slide-event"),sN="tox-pop--resizing",lN="tox-pop--transition",fN=function(e,t,n,r){var o,i,a=r.backstage,u=a.shared,c=pt().deviceType.isTouch,s=Zc(),l=Zc(),f=Zc(),d=eu((o={sink:n,onEscape:function(){return e.focus(),R.some(!0)}},i=wo([]),Yp.sketch({dom:{tag:"div",classes:["tox-pop"]},fireDismissalEventInstead:{event:"doNotDismissYet"},onShow:function(e){i.set([]),Yp.getContent(e).each((function(e){on(e.element,"visibility")})),Fa(e.element,sN),on(e.element,"width")},inlineBehaviours:wc([cp("context-toolbar-events",[Wi(Zo(),(function(e,t){"width"===t.event.raw.propertyName&&(Fa(e.element,sN),on(e.element,"width"))})),Ii(cN,(function(e,t){var n=e.element;on(n,"width");var r=vn(n);Yp.setContent(e,t.event.contents),Pa(n,sN);var o=vn(n);Yt(n,"width",r+"px"),Yp.getContent(e).each((function(e){t.event.focus.bind((function(e){return Ac(e),Nc(n)})).orThunk((function(){return tp.focusIn(e),Mc(zt(n))}))})),hh.setTimeout((function(){Yt(e.element,"width",o+"px")}),0)})),Ii(aN,(function(e,t){Yp.getContent(e).each((function(t){i.set(i.get().concat([{bar:t,focus:Mc(zt(e.element))}]))})),Ai(e,cN,{contents:t.event.forwardContents,focus:R.none()})})),Ii(uN,(function(e,t){ae(i.get()).each((function(t){i.set(i.get().slice(0,i.get().length-1)),Ai(e,cN,{contents:tu(t.bar),focus:t.focus})}))}))]),tp.config({mode:"special",onEscape:function(e){return ae(i.get()).fold((function(){return o.onEscape()}),(function(t){return Ei(e,uN),R.some(!0)}))}})]),lazySink:function(){return Un.value(o.sink)}}))),m=function(){var t=f.get().getOr("node"),n=QM(t)?1:0;return YM(e,u,t,n)},p=function(){return!(e.removed||c()&&a.isContextMenuOpen())},h=function(){if(p()){var t=m(),n=xe(f.get(),"node")?function(e,t){return t.filter(Lt).map(Ln).getOrThunk((function(){return XM(e)}))}(e,s.get()):XM(e);return t.height<=0||!KM(n,t)}return!0},v=function(){s.clear(),l.clear(),f.clear(),Yp.hide(d)},b=function(){if(Yp.isOpen(d)){var e=d.element;on(e,"display"),h()?Yt(e,"display","none"):(l.set(0),Yp.reposition(d))}},y=function(t){return{dom:{tag:"div",classes:["tox-pop__dialog"]},components:[t],behaviours:wc([tp.config({mode:"acyclic"}),cp("pop-dialog-wrap-events",[$i((function(t){e.shortcuts.add("ctrl+F9","focus statusbar",(function(){return tp.focusIn(t)}))})),qi((function(t){e.shortcuts.remove("ctrl+F9")}))])])}},w=Ve((function(){return iN(t,(function(e){var t=x([e]);Ai(d,aN,{forwardContents:y(t)})}))})),x=function(t){var n=e.ui.registry.getAll().buttons,o=w(),i=T(T({},n),o.formNavigators),a=Eb(e)===pv.scrolling?pv.scrolling:pv.default,c=Y(j(t,(function(t){return"contexttoolbar"===t.type?function(t,n){return DM(e,{buttons:t,toolbar:n.items,allowToolbarGroups:!1},r,R.some(["form:"]))}(i,t):function(e,t){return GM(e,t)}(t,u.providers)})));return pD({type:a,uid:ra("context-toolbar"),initGroups:c,onEscape:R.none,cyclicKeying:!0,providers:u.providers})},C=function(t,r){var o="node"===t?u.anchors.node(r):u.anchors.cursor(),i=function(e,t,n,r){return"line"===t?{bubble:vs(12,0,JM),layouts:{onLtr:function(){return[ac]},onRtl:function(){return[uc]}},overrides:ZM}:{bubble:vs(0,12,JM,1/12),layouts:tN(e,n,r,t),overrides:ZM}}(e,t,c(),{lastElement:s.get,isReposition:function(){return xe(l.get(),0)},getMode:function(){return Pl.getMode(n)}});return ar(o,i)},S=function(e,t){if(k.cancel(),p()){var r=x(e),o=e[0].position,i=C(o,t);f.set(o),l.set(1);var a=d.element;on(a,"display"),function(e){return xe(Se(e,s.get(),bt),!0)}(t)||(Fa(a,lN),Pl.reset(n,d)),Yp.showWithinBounds(d,y(r),{anchor:i,transition:{classes:[lN],mode:"placement"}},(function(){return R.some(m())})),t.fold(s.clear,s.set),h()&&Yt(a,"display","none")}},k=Rh((function(){e.hasFocus()&&!e.removed&&(La(d.element,lN)?k.throttle():function(e,t){var n=Re.fromDom(t.getBody()),r=function(e){return bt(e,n)},o=Re.fromDom(t.selection.getNode());return function(e){return!r(e)&&!wt(n,e)}(o)?R.none():rN(o,e.inNodeScope,e.inEditorScope).orThunk((function(){return oN(r,o,e)}))}(w(),e).fold(v,(function(e){S(e.toolbars,R.some(e.elem))})))}),17);e.on("init",(function(){e.on("remove",v),e.on("ScrollContent ScrollWindow ObjectResized ResizeEditor longpress",b),e.on("click keyup focus SetContent",k.throttle),e.on(UM,v),e.on("contexttoolbar-show",(function(t){var n=w();be(n.lookupTable,t.toolbarKey).each((function(n){S([n],ke(t.target!==e,t.target)),Yp.getContent(d).each(tp.focusIn)}))})),e.on("focusout",(function(t){hh.setEditorTimeout(e,(function(){Nc(n.element).isNone()&&Nc(d.element).isNone()&&v()}),0)})),e.on("SwitchMode",(function(){e.mode.isReadOnly()&&v()})),e.on("AfterProgressState",(function(t){t.state?v():e.hasFocus()&&k.throttle()})),e.on("NodeChange",(function(e){Nc(d.element).fold(k.throttle,g)}))}))},dN={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:[""]},mN=(jD="[eE][+-]?[0-9]+",UD=function(e){return"(?:"+e+")?"},WD=["Infinity","[0-9]+\\."+UD(VD="[0-9]+")+UD(jD),"\\.[0-9]+"+UD(jD),VD+UD(jD)].join("|"),new RegExp("^([+-]?(?:"+WD+"))(.*)$")),gN=function(e,t){return R.from(mN.exec(e)).bind((function(e){var n=Number(e[1]),r=e[2];return function(e,t){return L(t,(function(t){return L(dN[t],(function(t){return e===t}))}))}(r,t)?R.some({value:n,unit:r}):R.none()}))},pN=function(e,t){var n=function(){var n=t.getOptions(e),r=t.getCurrent(e).map(t.hash),o=Zc();return j(n,(function(n){return{type:"togglemenuitem",text:t.display(n),onSetup:function(i){var a=function(e){e&&(o.on((function(e){return e.setActive(!1)})),o.set(i)),i.setActive(e)};a(xe(r,t.hash(n)));var u=t.watcher(e,n,a);return function(){o.clear(),u()}},onAction:function(){return t.setCurrent(e,n)}}}))};e.ui.registry.addMenuButton(t.name,{tooltip:t.text,icon:t.icon,fetch:function(e){return e(n())},onSetup:t.onToolbarSetup}),e.ui.registry.addNestedMenuItem(t.name,{type:"nestedmenuitem",text:t.text,getSubmenuItems:n,onSetup:t.onMenuSetup})},hN={name:"lineheight",text:"Line height",icon:"line-height",getOptions:function(e){return e.getParam("lineheight_formats","1 1.1 1.2 1.3 1.4 1.5 2","string").split(" ")},hash:function(e){return function(e,t){return gN(e,t).map((function(e){return e.value+e.unit}))}(e,["fixed","relative","empty"]).getOr(e)},display:v,watcher:function(e,t,n){return e.formatter.formatChanged("lineheight",n,!1,{value:t}).unbind},getCurrent:function(e){return R.from(e.queryCommandValue("LineHeight"))},setCurrent:function(e,t){return e.execCommand("LineHeight",!1,t)}},vN=function(e){pN(e,hN),function(e){var t=R.from(function(e){return e.getParam("content_langs",void 0,"array")}(e));return t.map((function(t){return{name:"language",text:"Language",icon:"language",getOptions:h(t),hash:function(e){return c(e.customCode)?e.code:e.code+"/"+e.customCode},display:function(e){return e.title},watcher:function(e,t,n){return e.formatter.formatChanged("lang",n,!1,{value:t.code,customValue:t.customCode}).unbind},getCurrent:function(e){var t=Re.fromDom(e.selection.getNode());return Ao(t,(function(e){return R.some(e).filter(Ie).bind((function(e){return $t(e,"lang").map((function(t){return{code:t,customCode:$t(e,"data-mce-lang").getOrUndefined(),title:""}}))}))}))},setCurrent:function(e,t){return e.execCommand("Lang",!1,t)},onToolbarSetup:function(t){var n=Jc();return t.setActive(e.formatter.match("lang",{},void 0,!0)),n.set(e.formatter.formatChanged("lang",t.setActive,!0)),n.clear}}}))}(e).each((function(t){return pN(e,t)}))},bN=function(e,t){!function(e,t){var n=LD(0,t,KD(e));e.ui.registry.addNestedMenuItem("align",{text:t.shared.providers.translate("Align"),getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})}(e,t),function(e,t){var n=LD(0,t,JD(e));e.ui.registry.addNestedMenuItem("fontformats",{text:t.shared.providers.translate("Fonts"),getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})}(e,t),function(e,t){var n=T({type:"advanced"},t.styleselect),r=LD(0,t,oM(e,n));e.ui.registry.addNestedMenuItem("formats",{text:"Formats",getSubmenuItems:function(){return r.items.validateItems(r.getStyleItems())}})}(e,t),function(e,t){var n=LD(0,t,rM(e));e.ui.registry.addNestedMenuItem("blockformats",{text:"Blocks",getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})}(e,t),function(e,t){var n=LD(0,t,tM(e));e.ui.registry.addNestedMenuItem("fontsizes",{text:"Font sizes",getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})}(e,t)},yN=function(e){return BD(e,"NodeChange",(function(t){t.setDisabled(!e.queryCommandState("outdent"))}))},wN=function(e){!function(e){e.ui.registry.addButton("outdent",{tooltip:"Decrease indent",icon:"outdent",onSetup:yN(e),onAction:ID(e,"outdent")}),e.ui.registry.addButton("indent",{tooltip:"Increase indent",icon:"indent",onAction:ID(e,"indent")})}(e)},xN=function(e,t){return function(){e.execCommand("mceToggleFormat",!1,t)}},CN=function(e){!function(e){xk.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(t,n){e.ui.registry.addToggleButton(t.name,{tooltip:t.text,icon:t.icon,onSetup:zD(e,t.name),onAction:xN(e,t.name)})}));for(var t=1;t<=6;t++){var n="h"+t;e.ui.registry.addToggleButton(n,{text:n.toUpperCase(),tooltip:"Heading "+t,onSetup:zD(e,n),onAction:xN(e,n)})}}(e),function(e){xk.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(t){e.ui.registry.addButton(t.name,{tooltip:t.text,icon:t.icon,onAction:ID(e,t.action)})}))}(e),function(e){xk.each([{name:"blockquote",text:"Blockquote",action:"mceBlockQuote",icon:"quote"}],(function(t){e.ui.registry.addToggleButton(t.name,{tooltip:t.text,icon:t.icon,onAction:ID(e,t.action),onSetup:zD(e,t.name)})}))}(e)},SN=function(e){CN(e),function(e){xk.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(t){e.ui.registry.addMenuItem(t.name,{text:t.text,icon:t.icon,shortcut:t.shortcut,onAction:ID(e,t.action)})})),e.ui.registry.addMenuItem("codeformat",{text:"Code",icon:"sourcecode",onAction:xN(e,"code")})}(e)},kN=function(e,t){return BD(e,"Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",(function(n){n.setDisabled(e.mode.isReadOnly()||!e.undoManager[t]())}))},TN=function(e){!function(e){e.ui.registry.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onSetup:kN(e,"hasUndo"),onAction:ID(e,"undo")}),e.ui.registry.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onSetup:kN(e,"hasRedo"),onAction:ID(e,"redo")})}(e),function(e){e.ui.registry.addButton("undo",{tooltip:"Undo",icon:"undo",disabled:!0,onSetup:kN(e,"hasUndo"),onAction:ID(e,"undo")}),e.ui.registry.addButton("redo",{tooltip:"Redo",icon:"redo",disabled:!0,onSetup:kN(e,"hasRedo"),onAction:ID(e,"redo")})}(e)},ON=function(e){return BD(e,"VisualAid",(function(t){t.setActive(e.hasVisual)}))},_N=function(e){!function(e){e.ui.registry.addButton("visualaid",{tooltip:"Visual aids",text:"Visual aids",onAction:ID(e,"mceToggleVisualAid")})}(e),function(e){e.ui.registry.addToggleMenuItem("visualaid",{text:"Visual aids",onSetup:ON(e),onAction:ID(e,"mceToggleVisualAid")})}(e)},EN=function(e,t){!function(e){U([{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(t){e.ui.registry.addToggleButton(t.name,{tooltip:t.text,icon:t.icon,onAction:ID(e,t.cmd),onSetup:zD(e,t.name)})})),e.ui.registry.addButton("alignnone",{tooltip:"No alignment",icon:"align-none",onAction:ID(e,"JustifyNone")})}(e),SN(e),bN(e,t),TN(e),function(e){!function(e){e.addCommand("mceApplyTextcolor",(function(t,n){!function(e,t,n){e.undoManager.transact((function(){e.focus(),e.formatter.apply(t,{value:n}),e.nodeChanged()}))}(e,t,n)})),e.addCommand("mceRemoveTextcolor",(function(t){!function(e,t){e.undoManager.transact((function(){e.focus(),e.formatter.remove(t,{value:null},null,!0),e.nodeChanged()}))}(e,t)}))}(e);var t=wo(null),n=wo(null);uw(e,"forecolor","forecolor","Text color",t),uw(e,"backcolor","hilitecolor","Background color",n),cw(e,"forecolor","forecolor","Text color"),cw(e,"backcolor","hilitecolor","Background color")}(e),_N(e),wN(e),vN(e)},AN=function(e,t){return{type:"makeshift",x:e,y:t}},DN=function(e){return"longpress"===e.type||0===e.type.indexOf("touch")},MN=function(e,t){var n=pb.DOM.getPos(e);return function(e,t,n){return AN(e.x+t,e.y+n)}(t,n.x,n.y)},NN=function(e,t){return"contextmenu"===t.type||"longpress"===t.type?e.inline?function(e){if(DN(e)){var t=e.touches[0];return AN(t.pageX,t.pageY)}return AN(e.pageX,e.pageY)}(t):MN(e.getContentAreaContainer(),function(e){if(DN(e)){var t=e.touches[0];return AN(t.clientX,t.clientY)}return AN(e.clientX,e.clientY)}(t)):RN(e)},RN=function(e){return{type:"selection",root:Re.fromDom(e.selection.getNode())}},zN=function(e,t,n){switch(n){case"node":return function(e){return{type:"node",node:R.some(Re.fromDom(e.selection.getNode())),root:Re.fromDom(e.getBody())}}(e);case"point":return NN(e,t);case"selection":return RN(e)}},BN=function(e,t,n,r,o,i){var a=n(),u=zN(e,t,i);HT(a,hv.CLOSE_ON_EXECUTE,r,!1).map((function(e){t.preventDefault(),Yp.showMenuAt(o,{anchor:u},{menu:{markers:Mv("normal")},data:e})}))},PN={onLtr:function(){return[ic,ec,tc,nc,rc,oc,ch,sh,uh,ih,ah,oh]},onRtl:function(){return[ic,tc,ec,rc,nc,oc,ch,sh,ah,oh,uh,ih]}},IN={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"]},FN=function(e,t,n,r,o,i,a){var u=function(e,t,n){var r=zN(e,t,n);return T({bubble:vs(0,"point"===n?12:0,IN),layouts:PN,overrides:{maxWidthFunction:$A(),maxHeightFunction:ms()}},r)}(e,t,i);HT(n,hv.CLOSE_ON_EXECUTE,r,!0).map((function(n){t.preventDefault(),Yp.showMenuWithinBounds(o,{anchor:u},{menu:{markers:Mv("normal"),highlightImmediately:a},data:n,type:"horizontal"},(function(){return R.some(YM(e,r.shared,"node"===i?"node":"selection"))})),e.fire(UM)}))},LN=function(e,t,n,r,o,i){var a=pt(),u=a.os.isiOS(),c=a.os.isOSX(),s=a.os.isAndroid(),l=a.deviceType.isTouch(),f=function(){var a=n();FN(e,t,a,r,o,i,!(s||u||c&&l))};if((c||u)&&"node"!==i){var d=function(){!function(e){var t=e.selection.getRng(),n=function(){hh.setEditorTimeout(e,(function(){e.selection.setRng(t)}),10),i()};e.once("touchend",n);var r=function(e){e.preventDefault(),e.stopImmediatePropagation()};e.on("mousedown",r,!0);var o=function(){return i()};e.once("longpresscancel",o);var i=function(){e.off("touchend",n),e.off("longpresscancel",o),e.off("mousedown",r)}}(e),f()};!function(e,t){var n=e.selection;if(n.isCollapsed()||t.touches.length<1)return!1;var r=t.touches[0],o=n.getRng();return cl(e.getWin(),Us.domRange(o)).exists((function(e){return e.left<=r.clientX&&e.right>=r.clientX&&e.top<=r.clientY&&e.bottom>=r.clientY}))}(e,t)?(e.once("selectionchange",d),e.once("touchend",(function(){return e.off("selectionchange",d)}))):d()}else f()},HN=function(e){return"string"==typeof e?e.split(/[ ,]/):e},VN=function(e){return e.getParam("contextmenu_never_use_native",!1,"boolean")},jN=function(e){return function(e,t,n){var r=e.ui.registry.getAll().contextMenus;return R.from(e.getParam(t)).map(HN).getOrThunk((function(){return $(HN(n),(function(e){return ye(r,e)}))}))}(e,"contextmenu","link linkchecker image imagetools table spellchecker configurepermanentpen")},UN=function(e){return r(e)?"|"===e:"separator"===e.type},WN={type:"separator"},$N=function(e){var t,n=function(e){return{text:e.text,icon:e.icon,disabled:e.disabled,shortcut:e.shortcut}};if(r(e))return e;switch(e.type){case"separator":return WN;case"submenu":return T(T({type:"nestedmenuitem"},n(e)),{getSubmenuItems:function(){var t=e.getSubmenuItems();return r(t)?t:j(t,$N)}});default:return T(T({type:"menuitem"},n(e)),{onAction:(t=e.onAction,function(){return t()})})}},qN=function(e,t){if(0===t.length)return e;var n=ae(e).filter((function(e){return!UN(e)})),r=n.fold((function(){return[]}),(function(e){return[WN]}));return e.concat(r).concat(t).concat([WN])},GN=function(e,t){return"longpress"!==t.type&&(2!==t.button||t.target===e.getBody()&&""===t.pointerType)},KN=function(e,t){return GN(e,t)?e.selection.getStart(!0):t.target},XN=function(e,t,n){var o=pt().deviceType.isTouch,i=eu(Yp.sketch({dom:{tag:"div"},lazySink:t,onEscape:function(){return e.focus()},onShow:function(){return n.setContextMenuState(!0)},onHide:function(){return n.setContextMenuState(!1)},fireDismissalEventInstead:{},inlineBehaviours:wc([cp("dismissContextMenu",[Ii(wi(),(function(t,n){af.close(t),e.focus()}))])])})),a=function(e){return Yp.hide(i)},u=function(t){if(VN(e)&&t.preventDefault(),!function(e,t){return t.ctrlKey&&!VN(e)}(e,t)&&!function(e){return!1===e.getParam("contextmenu")}(e)){var a=function(e,t){var n=function(e){return e.getParam("contextmenu_avoid_overlap","","string")}(e),r=GN(e,t)?"selection":"point";if(De(n)){var o=KN(e,t);return Nw(Re.fromDom(o),n)?"node":r}return r}(e,t);(o()?LN:BN)(e,t,(function(){var n=KN(e,t),o=e.ui.registry.getAll(),i=jN(e);return function(e,t,n){var o=G(t,(function(t,o){return be(e,o.toLowerCase()).map((function(e){var o=e.update(n);if(r(o))return qN(t,o.split(" "));if(o.length>0){var i=j(o,$N);return qN(t,i)}return t})).getOrThunk((function(){return t.concat([o])}))}),[]);return o.length>0&&UN(o[o.length-1])&&o.pop(),o}(o.contextMenus,i,n)}),n,i,a)}};e.on("init",(function(){var t="ResizeEditor ScrollContent ScrollWindow longpresscancel"+(o()?"":" ResizeWindow");e.on(t,a),e.on("longpress contextmenu",u)}))},YN=xo([{offset:["x","y"]},{absolute:["x","y"]},{fixed:["x","y"]}]),JN=function(e){return function(t){return t.translate(-e.left,-e.top)}},ZN=function(e){return function(t){return t.translate(e.left,e.top)}},QN=function(e){return function(t,n){return G(e,(function(e,t){return t(e)}),dn(t,n))}},eR=function(e,t,n){return e.fold(QN([ZN(n),JN(t)]),QN([JN(t)]),QN([]))},tR=function(e,t,n){return e.fold(QN([ZN(n)]),QN([]),QN([ZN(t)]))},nR=function(e,t,n){return e.fold(QN([]),QN([JN(n)]),QN([ZN(t),JN(n)]))},rR=function(e,t,n){var r=e.fold((function(e,t){return{position:R.some("absolute"),left:R.some(e+"px"),top:R.some(t+"px")}}),(function(e,t){return{position:R.some("absolute"),left:R.some(e-n.left+"px"),top:R.some(t-n.top+"px")}}),(function(e,t){return{position:R.some("fixed"),left:R.some(e+"px"),top:R.some(t+"px")}}));return T({right:R.none(),bottom:R.none()},r)},oR=function(e,t,n,r){var o=function(e,o){return function(i,a){var u=e(t,n,r);return o(i.getOr(u.left),a.getOr(u.top))}};return e.fold(o(nR,iR),o(tR,aR),o(eR,uR))},iR=YN.offset,aR=YN.absolute,uR=YN.fixed,cR=function(e,t){var n=Wt(e,t);return c(n)?NaN:parseInt(n,10)},sR=function(e,t,n,r){return function(e,t){var n=e.element,r=cR(n,t.leftAttr),o=cR(n,t.topAttr);return isNaN(r)||isNaN(o)?R.none():R.some(dn(r,o))}(e,t).fold((function(){return n}),(function(e){return uR(e.left+r.left,e.top+r.top)}))},lR=function(e,t,n,r,o,i){var a=sR(e,t,n,r),u=t.mustSnap?mR(e,t,a,o,i):gR(e,t,a,o,i),c=eR(a,o,i);return function(e,t,n){var r=e.element;Ut(r,t.leftAttr,n.left+"px"),Ut(r,t.topAttr,n.top+"px")}(e,t,c),u.fold((function(){return{coord:uR(c.left,c.top),extra:R.none()}}),(function(e){return{coord:e.output,extra:e.extra}}))},fR=function(e,t){!function(e,t){var n=e.element;Gt(n,t.leftAttr),Gt(n,t.topAttr)}(e,t)},dR=function(e,t,n,r){return ce(e,(function(e){var o=e.sensor,i=function(e,t,n,r,o,i){var a=tR(e,o,i),u=tR(t,o,i);return Math.abs(a.left-u.left)<=n&&Math.abs(a.top-u.top)<=r}(t,o,e.range.left,e.range.top,n,r);return i?R.some({output:oR(e.output,t,n,r),extra:e.extra}):R.none()}))},mR=function(e,t,n,r,o){var i=t.getSnapPoints(e);return dR(i,n,r,o).orThunk((function(){var e=G(i,(function(e,t){var i=t.sensor,a=function(e,t,n,r,o,i){var a=tR(e,o,i),u=tR(t,o,i),c=Math.abs(a.left-u.left),s=Math.abs(a.top-u.top);return dn(c,s)}(n,i,t.range.left,t.range.top,r,o);return e.deltas.fold((function(){return{deltas:R.some(a),snap:R.some(t)}}),(function(n){return(a.left+a.top)/2<=(n.left+n.top)/2?{deltas:R.some(a),snap:R.some(t)}:e}))}),{deltas:R.none(),snap:R.none()});return e.snap.map((function(e){return{output:oR(e.output,n,r,o),extra:e.extra}}))}))},gR=function(e,t,n,r,o){var i=t.getSnapPoints(e);return dR(i,n,r,o)},pR=Object.freeze({__proto__:null,snapTo:function(e,t,n,r){var o=t.getTarget(e.element);if(t.repositionTarget){var i=xt(e.element),a=Dn(i),u=yE(o),c=function(e,t,n){return{coord:oR(e.output,e.output,t,n),extra:e.extra}}(r,a,u),s=rR(c.coord,0,u);Zt(o,s)}}}),hR="data-initial-z-index",vR=function(e,t){e.getSystem().addToGui(t),function(e){Tt(e.element).filter(Ie).each((function(t){tn(t,"z-index").each((function(e){Ut(t,hR,e)})),Yt(t,"z-index",Qt(e.element,"z-index"))}))}(t)},bR=function(e){!function(e){Tt(e.element).filter(Ie).each((function(e){$t(e,hR).fold((function(){return on(e,"z-index")}),(function(t){return Yt(e,"z-index",t)})),Gt(e,hR)}))}(e),e.getSystem().removeFromGui(e)},yR=function(e,t,n){return e.getSystem().build(qw.sketch({dom:{styles:{left:"0px",top:"0px",width:"100%",height:"100%",position:"fixed","z-index":"1000000000000000"},classes:[t]},events:n}))},wR=so("snaps",[Kr("getSnapPoints"),_u("onSensor"),Kr("leftAttr"),Kr("topAttr"),lo("lazyViewport",Hn),lo("mustSnap",!1)]),xR=[lo("useFixed",C),Kr("blockerClass"),lo("getTarget",v),lo("onDrag",g),lo("repositionTarget",!0),lo("onDrop",g),vo("getBounds",Hn),wR],CR=function(e){return(t=tn(e,"left"),n=tn(e,"top"),r=tn(e,"position"),o=function(e,t,n){return("fixed"===n?uR:iR)(parseInt(e,10),parseInt(t,10))},t.isSome()&&n.isSome()&&r.isSome()?R.some(o(t.getOrDie(),n.getOrDie(),r.getOrDie())):R.none()).getOrThunk((function(){var t=gn(e);return aR(t.left,t.top)}));var t,n,r,o},SR=function(e,t,n,r,o,i,a){return function(e,t,n,r,o){var i=o.bounds,a=tR(t,n,r),u=$u(a.left,i.x,i.x+i.width-o.width),c=$u(a.top,i.y,i.y+i.height-o.height),s=aR(u,c);return t.fold((function(){var e=nR(s,n,r);return iR(e.left,e.top)}),h(s),(function(){var e=eR(s,n,r);return uR(e.left,e.top)}))}(0,t.fold((function(){var e,t,a,u=(e=n,t=i.left,a=i.top,e.fold((function(e,n){return iR(e+t,n+a)}),(function(e,n){return aR(e+t,n+a)}),(function(e,n){return uR(e+t,n+a)}))),c=eR(u,r,o);return uR(c.left,c.top)}),(function(t){var a=lR(e,t,n,i,r,o);return a.extra.each((function(n){t.onSensor(e,n)})),a.coord})),r,o,a)},kR=function(e,t){return{bounds:e.getBounds(),height:ln(t.element),width:bn(t.element)}},TR=function(e,t,n,r,o){var i=n.update(r,o),a=n.getStartData().getOrThunk((function(){return kR(t,e)}));i.each((function(n){!function(e,t,n,r){var o=t.getTarget(e.element);if(t.repositionTarget){var i=xt(e.element),a=Dn(i),u=yE(o),c=CR(o),s=SR(e,t.snaps,c,a,u,r,n),l=rR(s,0,u);Zt(o,l)}t.onDrag(e,o,r)}(e,t,a,n)}))},OR=function(e,t,n,r){t.each(bR),n.snaps.each((function(t){fR(e,t)}));var o=n.getTarget(e.element);r.reset(),n.onDrop(e,o)},_R=function(e){return function(t,n){var r=function(e){n.setStartData(kR(t,e))};return zi(_([Ii(hi(),(function(e){n.getStartData().each((function(){return r(e)}))}))],e(t,n,r),!0))}},ER=Object.freeze({__proto__:null,getData:function(e){return R.from(dn(e.x,e.y))},getDelta:function(e,t){return dn(t.left-e.left,t.top-e.top)}}),AR=function(e,t,n){return[Ii(Lo(),(function(r,o){if(0===o.event.raw.button){o.stop();var i=function(){return OR(r,R.some(c),e,t)},a=Rw(i,200),u={drop:i,delayDrop:a.schedule,forceDrop:i,move:function(n){a.cancel(),TR(r,e,t,ER,n)}},c=yR(r,e.blockerClass,function(e){return zi([Ii(Lo(),e.forceDrop),Ii(jo(),e.drop),Ii(Ho(),(function(t,n){e.move(n.event)})),Ii(Vo(),e.delayDrop)])}(u));n(r),vR(r,c)}}))]},DR=_(_([],xR,!0),[Mu("dragger",{handlers:_R(AR)})],!1),MR=Object.freeze({__proto__:null,getData:function(e){var t=e.raw.touches;return 1===t.length?function(e){var t=e[0];return R.some(dn(t.clientX,t.clientY))}(t):R.none()},getDelta:function(e,t){return dn(t.left-e.left,t.top-e.top)}}),NR=function(e,t,n){var r=Zc(),o=function(n){OR(n,r.get(),e,t),r.clear()};return[Ii(Bo(),(function(i,a){a.stop();var u=function(){return o(i)},c={drop:u,delayDrop:g,forceDrop:u,move:function(n){TR(i,e,t,MR,n)}},s=yR(i,e.blockerClass,function(e){return zi([Ii(Bo(),e.forceDrop),Ii(Io(),e.drop),Ii(Fo(),e.drop),Ii(Po(),(function(t,n){e.move(n.event)}))])}(c));r.set(s);n(i),vR(i,s)})),Ii(Po(),(function(n,r){r.stop(),TR(n,e,t,MR,r.event)})),Ii(Io(),(function(e,t){t.stop(),o(e)})),Ii(Fo(),o)]},RR=DR,zR=_(_([],xR,!0),[Mu("dragger",{handlers:_R(NR)})],!1),BR=_(_([],xR,!0),[Mu("dragger",{handlers:_R((function(e,t,n){return _(_([],AR(e,t,n),!0),NR(e,t,n),!0)}))})],!1),PR=Object.freeze({__proto__:null,mouse:RR,touch:zR,mouseOrTouch:BR}),IR=Object.freeze({__proto__:null,init:function(){var e=R.none(),t=R.none(),n=h({});return wa({readState:n,reset:function(){e=R.none(),t=R.none()},update:function(t,n){return t.getData(n).bind((function(n){return function(t,n){var r=e.map((function(e){return t.getDelta(e,n)}));return e=R.some(n),r}(t,n)}))},getStartData:function(){return t},setStartData:function(e){t=R.some(e)}})}}),FR=kc({branchKey:"mode",branches:PR,name:"dragging",active:{events:function(e,t){return e.dragger.handlers(e,t)}},extra:{snap:function(e){return{sensor:e.sensor,range:e.range,output:e.output,extra:R.from(e.extra)}}},state:IR,apis:pR}),LR=function(e,t,n,r,o,i){return e.fold((function(){return FR.snap({sensor:aR(n-20,r-20),range:dn(o,i),output:aR(R.some(n),R.some(r)),extra:{td:t}})}),(function(e){var o=n-20,i=r-20,a=e.element.dom.getBoundingClientRect();return FR.snap({sensor:aR(o,i),range:dn(40,40),output:aR(R.some(n-a.width/2),R.some(r-a.height/2)),extra:{td:t}})}))},HR=function(e,t,n){return{getSnapPoints:e,leftAttr:"data-drag-left",topAttr:"data-drag-top",onSensor:function(e,r){var o=r.td;(function(e,t){return e.exists((function(e){return bt(e,t)}))})(t.get(),o)||(t.set(o),n(o))},mustSnap:!0}},VR=function(e){return bh(vh.sketch({dom:{tag:"div",classes:["tox-selector"]},buttonBehaviours:wc([FR.config({mode:"mouseOrTouch",blockerClass:"blocker",snaps:e}),sC.config({})]),eventOrder:{mousedown:["dragging","alloy.base.behaviour"],touchstart:["dragging","alloy.base.behaviour"]}}))},jR=function(e,t){var n=wo([]),r=wo([]),o=wo(!1),i=Zc(),a=Zc(),u=function(e){var n=Ln(e);return LR(f.getOpt(t),e,n.x,n.y,n.width,n.height)},c=function(e){var n=Ln(e);return LR(d.getOpt(t),e,n.right,n.bottom,n.width,n.height)},s=HR((function(){return j(n.get(),(function(e){return u(e)}))}),i,(function(t){a.get().each((function(n){e.fire("TableSelectorChange",{start:t,finish:n})}))})),l=HR((function(){return j(r.get(),(function(e){return c(e)}))}),a,(function(t){i.get().each((function(n){e.fire("TableSelectorChange",{start:n,finish:t})}))})),f=VR(s),d=VR(l),m=eu(f.asSpec()),g=eu(d.asSpec()),p=function(t,n,r,o){var i=r(n);FR.snapTo(t,i);!function(t,n,r,o){var i=n.dom.getBoundingClientRect();on(t.element,"display");var a=kt(Re.fromDom(e.getBody())).dom.innerHeight,u=r(i),c=o(i,a);(u||c)&&Yt(t.element,"display","none")}(t,n,(function(e){return e[o]<0}),(function(e,t){return e[o]>t}))},h=function(e){return p(m,e,u,"top")},v=function(e){return p(g,e,c,"bottom")};pt().deviceType.isTouch()&&(e.on("TableSelectionChange",(function(e){o.get()||(Vl(t,m),Vl(t,g),o.set(!0)),i.set(e.start),a.set(e.finish),e.otherCells.each((function(t){n.set(t.upOrLeftCells),r.set(t.downOrRightCells),h(e.start),v(e.finish)}))})),e.on("ResizeEditor ResizeWindow ScrollContent",(function(){i.get().each(h),a.get().each(v)})),e.on("TableSelectionClear",(function(){o.get()&&(Wl(m),Wl(g),o.set(!1)),i.clear(),a.clear()})))},UR=function(e){if(1===e.nodeType){if("BR"===e.nodeName||e.getAttribute("data-mce-bogus"))return!0;if("bookmark"===e.getAttribute("data-mce-type"))return!0}return!1},WR=function(e,t,n){t.delimiter||(t.delimiter="»");return{dom:{tag:"div",classes:["tox-statusbar__path"],attributes:{role:"navigation"}},behaviours:wc([tp.config({mode:"flow",selector:"div[role=button]"}),Xd.config({disabled:n.isDisabled}),qb(),Qw.config({}),up.config({}),cp("elementPathEvents",[$i((function(r,o){e.shortcuts.add("alt+F11","focus statusbar elementpath",(function(){return tp.focusIn(r)})),e.on("NodeChange",(function(o){var i,a,u=function(t){for(var n=[],r=t.length;r-- >0;){var o=t[r];if(1===o.nodeType&&!UR(o)){var i=e.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);u.length>0?up.set(r,(i=j(u||[],(function(t,r){return vh.sketch({dom:{tag:"div",classes:["tox-statusbar__path-item"],attributes:{role:"button","data-index":r,"tab-index":-1,"aria-level":r+1},innerHtml:t.name},action:function(n){e.focus(),e.selection.select(t.element),e.nodeChanged()},buttonBehaviours:wc([Kb(n.isDisabled),qb()])})})),a={dom:{tag:"div",classes:["tox-statusbar__path-divider"],attributes:{"aria-hidden":!0},innerHtml:" "+t.delimiter+" "}},G(i.slice(1),(function(e,t){var n=e;return n.push(a),n.push(t),n}),[i[0]]))):up.set(r,[])}))}))])]),components:[]}};!function(e){e[e.None=0]="None",e[e.Both=1]="Both",e[e.Vertical=2]="Vertical"}($D||($D={}));var $R=function(e,t,n){var r=Re.fromDom(e.getContainer()),o=function(e,t,n,r,o){var i={};return i.height=IM(r+t.top,wb(e),Cb(e)),n===$D.Both&&(i.width=IM(o+t.left,yb(e),xb(e))),i}(e,t,n,sn(r),vn(r));fe(o,(function(e,t){return Yt(r,t,PM(e))})),function(e){e.fire("ResizeEditor")}(e)},qR=function(e,t,n,r){var o=dn(20*n,20*r);return $R(e,o,t),R.some(!0)},GR=function(e,t){var n=function(e){var t=!e.hasPlugin("autoresize"),n=e.getParam("resize",t);return!1===n?$D.None:"both"===n?$D.Both:$D.Vertical}(e);return n===$D.None?R.none():R.some(Eh("resize-handle",{tag:"div",classes:["tox-statusbar__resize-handle"],attributes:{title:t.translate("Resize")},behaviours:[FR.config({mode:"mouse",repositionTarget:!1,onDrag:function(t,r,o){return $R(e,o,n)},blockerClass:"tox-blocker"}),tp.config({mode:"special",onLeft:function(){return qR(e,n,-1,0)},onRight:function(){return qR(e,n,1,0)},onUp:function(){return qR(e,n,0,-1)},onDown:function(){return qR(e,n,0,1)}}),Qw.config({}),mp.config({})]},t.icons))},KR=function(e,t){var n=function(){var n,r=[];return e.getParam("elementpath",!0,"boolean")&&r.push(WR(e,{},t)),e.hasPlugin("wordcount")&&r.push(function(e,t){var n,r=function(e,n,r){return up.set(e,[Ja(t.translate(["{0} "+r,n[r]]))])};return vh.sketch({dom:{tag:"button",classes:["tox-statusbar__wordcount"]},components:[],buttonBehaviours:wc([Kb(t.isDisabled),qb(),Qw.config({}),up.config({}),Of.config({store:{mode:"memory",initialValue:{mode:"words",count:{words:0,characters:0}}}}),cp("wordcount-events",[Ki((function(e){var t=Of.getValue(e),n="words"===t.mode?"characters":"words";Of.setValue(e,{mode:n,count:t.count}),r(e,t.count,n)})),$i((function(t){e.on("wordCountUpdate",(function(e){var n=Of.getValue(t).mode;Of.setValue(t,{mode:n,count:e.wordCount}),r(t,e.wordCount,n)}))}))])]),eventOrder:(n={},n[ui()]=["disabling","alloy.base.behaviour","wordcount-events"],n)})}(e,t)),e.getParam("branding",!0,"boolean")&&r.push({dom:{tag:"span",classes:["tox-statusbar__branding"],innerHtml:'<a href="https://www.tiny.cloud/?utm_campaign=editor_referral&amp;utm_medium=poweredby&amp;utm_source=tinymce&amp;utm_content=v5" rel="noopener" target="_blank" tabindex="-1" aria-label="'+(n=yh.translate(["Powered by {0}","Tiny"]))+'">'+n+"</a>"}}),r.length>0?[{dom:{tag:"div",classes:["tox-statusbar__text-container"]},components:r}]:[]};return{dom:{tag:"div",classes:["tox-statusbar"]},components:function(){var r=n(),o=GR(e,t);return r.concat(o.toArray())}()}},XR=function(e){var t,n,r,o,i=e.inline,a=i?jM:zM,u=Ib(e)?GE:vE,c=R.none(),s=pt(),l=s.browser.isIE()?["tox-platform-ie"]:[],f=s.deviceType.isTouch()?["tox-platform-touch"]:[],d=Nb(e),m=Bb(e),p=yh.isRtl()?{attributes:{dir:"rtl"}}:{},h={attributes:(t={},t[Cs]=d?jc.BottomToTop:jc.TopToBottom,t)},v=function(){return c.bind(SD.getHeader)},b=function(){Yt(q.element,"width",document.body.clientWidth+"px")},y=eu((n=bt(Ht(),m)&&"grid"===Qt(m,"display"),r={dom:T({tag:"div",classes:["tox","tox-silver-sink","tox-tinymce-aux"].concat(l).concat(f)},p),behaviours:wc([Pl.config({useFixed:function(){return u.isDocked(v)}})])},o={dom:{styles:{width:document.body.clientWidth+"px"}},events:zi([Ii(vi(),b)])},ar(r,n?o:{}))),w=function(){return Un.value(y)},x=bh({dom:{tag:"div",classes:["tox-anchorbar"]}}),C=function(){return c.bind((function(e){return SD.getThrobber(e)})).getOrDie("Could not find throbber element")},S=rE(y,e,(function(){return c.bind((function(e){return x.getOpt(e)})).getOrDie("Could not find a anchor bar element")})),k=SD.parts.menubar({dom:{tag:"div",classes:["tox-menubar"]},backstage:S,onEscape:function(){e.focus()}}),O=Eb(e),_=SD.parts.toolbar(T({dom:{tag:"div",classes:["tox-toolbar"]},getSink:w,providers:S.shared.providers,onEscape:function(){e.focus()},type:O,lazyToolbar:function(){return c.bind((function(e){return SD.getToolbar(e)})).getOrDie("Could not find more toolbar element")},lazyHeader:function(){return v().getOrDie("Could not find header element")}},h)),E=SD.parts["multiple-toolbar"]({dom:{tag:"div",classes:["tox-toolbar-overlord"]},providers:S.shared.providers,onEscape:function(){e.focus()},type:O}),A=SD.parts.socket({dom:{tag:"div",classes:["tox-edit-area"]}}),D=SD.parts.sidebar({dom:{tag:"div",classes:["tox-sidebar"]}}),M=SD.parts.throbber({dom:{tag:"div",classes:["tox-throbber"]},backstage:S}),N=e.getParam("statusbar",!0,"boolean")&&!i?R.some(KR(e,S.shared.providers)):R.none(),z={dom:{tag:"div",classes:["tox-sidebar-wrap"]},components:[A,D]},B=Ob(e),P=kb(e),I=Sb(e),F=SD.parts.header({dom:T({tag:"div",classes:["tox-editor-header"]},h),components:Y([I?[k]:[],B?[E]:P?[_]:[],zb(e)?[]:[x.asSpec()]]),sticky:Ib(e),editor:e,sharedBackstage:S.shared}),L=Y([d?[]:[F],i?[]:[z],d?[F]:[]]),H=Y([[{dom:{tag:"div",classes:["tox-editor-container"]},components:L}],i?[]:N.toArray(),[M]]),V=Pb(e),j=T(T({role:"application"},yh.isRtl()?{dir:"rtl"}:{}),V?{"aria-hidden":"true"}:{}),W=eu(SD.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:j},components:H,behaviours:wc([qb(),Xd.config({disableClass:"tox-tinymce--disabled"}),tp.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(W),e.shortcuts.add("alt+F9","focus menubar",(function(){SD.focusMenubar(W)})),e.shortcuts.add("alt+F10","focus toolbar",(function(){SD.focusToolbar(W)})),e.addCommand("ToggleToolbarDrawer",(function(){SD.toggleToolbarDrawer(W)})),e.addQueryStateHandler("ToggleToolbarDrawer",(function(){return SD.isToolbarDrawerToggled(W)}));var $=Gw(W),q=Gw(y);!function(e,t,n){var r=function(e,r){U([t,n],(function(t){t.broadcastEvent(e,r)}))},o=function(e,r){U([t,n],(function(t){t.broadcastOn([e],r)}))},i=function(e){return o(uf(),{target:e.target})},a=Ec(),u=es(a,"touchstart",i),c=es(a,"touchmove",(function(e){return r(gi(),e)})),s=es(a,"touchend",(function(e){return r(pi(),e)})),l=es(a,"mousedown",i),f=es(a,"mouseup",(function(e){0===e.raw.button&&o(sf(),{target:e.target})})),d=function(e){return o(uf(),{target:Re.fromDom(e.target)})},m=function(e){0===e.button&&o(sf(),{target:Re.fromDom(e.target)})},g=function(){U(e.editorManager.get(),(function(t){e!==t&&t.fire("DismissPopups",{relatedTarget:e})}))},p=function(e){return r(hi(),ns(e))},h=function(e){o(cf(),{}),r(vi(),ns(e))},v=function(){return o(cf(),{})},b=function(t){t.state&&o(uf(),{target:Re.fromDom(e.getContainer())})},y=function(e){o(uf(),{target:Re.fromDom(e.relatedTarget.getContainer())})};e.on("PostRender",(function(){e.on("click",d),e.on("tap",d),e.on("mouseup",m),e.on("mousedown",g),e.on("ScrollWindow",p),e.on("ResizeWindow",h),e.on("ResizeEditor",v),e.on("AfterProgressState",b),e.on("DismissPopups",y)})),e.on("remove",(function(){e.off("click",d),e.off("tap",d),e.off("mouseup",m),e.off("mousedown",g),e.off("ScrollWindow",p),e.off("ResizeWindow",h),e.off("ResizeEditor",v),e.off("AfterProgressState",b),e.off("DismissPopups",y),l.unbind(),u.unbind(),c.unbind(),s.unbind(),f.unbind()})),e.on("detach",(function(){Kl(t),Kl(n),t.destroy(),n.destroy()}))}(e,$,q);var G=function(){var t=PM(FM(e)),n=PM(function(e){return LM(e).getOr(bb(e))}(e));return e.inline||(rn("div","width",n)&&Yt(W.element,"width",n),rn("div","height",t)?Yt(W.element,"height",t):Yt(W.element,"height","200px")),t};return{mothership:$,uiMothership:q,backstage:S,renderUI:function(){u.setup(e,S.shared,v),EN(e,S),XN(e,w,S),function(e){var t=e.ui.registry.getAll().sidebars;U(se(t),(function(n){var r=t[n],o=function(){return xe(R.from(e.queryCommandValue("ToggleSidebar")),n)};e.ui.registry.addToggleButton(n,{icon:r.icon,tooltip:r.tooltip,onAction:function(t){e.execCommand("ToggleSidebar",!1,n),t.setActive(o())},onSetup:function(t){var n=function(){return t.setActive(o())};return e.on("ToggleSidebar",n),function(){e.off("ToggleSidebar",n)}}})}))}(e),BA(e,C,S.shared),de(function(e){return e.getParam("toolbar_groups",{},"object")}(e),(function(t,n){e.ui.registry.addGroupToolbarButton(n,t)}));var t=e.ui.registry.getAll(),n=t.buttons,r=t.menuItems,o=t.contextToolbars,i=t.sidebars,c=Tb(e),s={menuItems:r,menus:Fb(e),menubar:Lb(e),toolbar:c.getOrThunk((function(){return function(e){return e.getParam("toolbar",!0)}(e)})),allowToolbarGroups:O===pv.floating,buttons:n,sidebar:i};fN(e,o,y,{backstage:S}),jR(e,y);var l=e.getElement(),f=G(),d={mothership:$,uiMothership:q,outerContainer:W},m={targetNode:l,height:f};return a.render(e,d,s,S,m)},getUi:function(){return{channels:{broadcastAll:q.broadcast,broadcastOn:q.broadcastOn,register:g}}}}},YR=h([Kr("lazySink"),ro("dragBlockClass"),vo("getBounds",Hn),lo("useTabstopAt",S),lo("eventOrder",{}),_f("modalBehaviours",[tp]),Eu("onExecute"),Du("onEscape")]),JR={sketch:v},ZR=h([od({name:"draghandle",overrides:function(e,t){return{behaviours:wc([FR.config({mode:"mouse",getTarget:function(e){return uu(e,'[role="dialog"]').getOr(e)},blockerClass:e.dragBlockClass.getOrDie(new Error("The drag blocker class was not specified for a dialog with a drag handle: \n"+JSON.stringify(t,null,2)).message),getBounds:e.getDragBounds})])}}}),nd({schema:[Kr("dom")],name:"title"}),nd({factory:JR,schema:[Kr("dom")],name:"close"}),nd({factory:JR,schema:[Kr("dom")],name:"body"}),od({factory:JR,schema:[Kr("dom")],name:"footer"}),rd({factory:{sketch:function(e,t){return T(T({},e),{dom:t.dom,components:t.components})}},schema:[lo("dom",{tag:"div",styles:{position:"fixed",left:"0px",top:"0px",right:"0px",bottom:"0px"}}),lo("components",[])],name:"blocker"})]),QR=Md({name:"ModalDialog",configFields:YR(),partFields:ZR(),factory:function(e,t,n,r){var o,i=Zc(),a=ra("modal-events"),u=T(T({},e.eventOrder),((o={})[bi()]=[a].concat(e.eventOrder["alloy.system.attached"]||[]),o));return{uid:e.uid,dom:e.dom,components:t,apis:{show:function(t){i.set(t);var n=e.lazySink(t).getOrDie(),o=r.blocker(),a=n.getSystem().build(T(T({},o),{components:o.components.concat([tu(t)]),behaviours:wc([mp.config({}),cp("dialog-blocker-events",[Wi(Wo(),(function(){tp.focusIn(t)}))])])}));Vl(n,a),tp.focusIn(t)},hide:function(e){i.clear(),Tt(e.element).each((function(t){e.getSystem().getByDom(t).each((function(e){Wl(e)}))}))},getBody:function(t){return vd(t,e,"body")},getFooter:function(t){return vd(t,e,"footer")},setIdle:function(e){MA.unblock(e)},setBusy:function(e,t){MA.block(e,t)}},eventOrder:u,domModification:{attributes:{role:"dialog","aria-modal":"true"}},behaviours:Af(e.modalBehaviours,[up.config({}),tp.config({mode:"cyclic",onEnter:e.onExecute,onEscape:e.onEscape,useTabstopAt:e.useTabstopAt}),MA.config({getRoot:i.get}),cp(a,[$i((function(t){var n,r,o,i,a,u;n=t.element,r=vd(t,e,"title").element,o=$t(n,"id").fold((function(){var e=ra("dialog-label");return Ut(r,"id",e),e}),v),Ut(n,"aria-labelledby",o),i=t.element,a=vd(t,e,"body").element,u=R.from(Wt(i,"id")).fold((function(){var e=ra("dialog-describe");return Ut(a,"id",e),e}),v),Ut(i,"aria-describedby",u)}))])])}},apis:{show:function(e,t){e.show(t)},hide:function(e,t){e.hide(t)},getBody:function(e,t){return e.getBody(t)},getFooter:function(e,t){return e.getFooter(t)},setBusy:function(e,t,n){e.setBusy(t,n)},setIdle:function(e,t){e.setIdle(t)}}}),ez=Sr([Jr("type"),Jr("name")].concat(Kv)),tz=Nr,nz=[$r("name","name",cr((function(){return ra("button-name")})),Mr),ao("icon"),po("align","end",["start","end"]),ho("primary",!1),ho("disabled",!1)],rz=_(_([],nz,!0),[Jr("text")],!1),oz=_([Zr("type",["submit","cancel","custom"])],rz,!0),iz=_([Zr("type",["menu"]),ao("text"),ao("tooltip"),ao("icon"),no("items",ez)],nz,!0),az=Wr("type",{submit:oz,cancel:oz,custom:oz,menu:iz}),uz=[Jr("type"),Jr("text"),Zr("level",["info","warn","error","success"]),Jr("icon"),lo("url","")],cz=Sr(uz),sz=[Jr("type"),Jr("text"),ho("disabled",!1),ho("primary",!1),$r("name","name",cr((function(){return ra("button-name")})),Mr),ao("icon"),ho("borderless",!1)],lz=Sr(sz),fz=[Jr("type"),Jr("name"),Jr("label"),ho("disabled",!1)],dz=Sr(fz),mz=Nr,gz=[Jr("type"),Jr("name")],pz=gz.concat([ao("label")]),hz=pz.concat([lo("columns","auto")]),vz=Sr(hz),bz=_r([Jr("value"),Jr("text"),Jr("icon")]),yz=Sr(pz),wz=Mr,xz=Sr(pz),Cz=Mr,Sz=gz.concat([go("tag","textarea"),Jr("scriptId"),Jr("scriptUrl"),function(e,t){return fo(e,t,Br)}("settings",void 0)]),kz=gz.concat([go("tag","textarea"),Qr("init")]),Tz=Fr((function(e){return Hr("customeditor.old",Cr(kz),e).orThunk((function(){return Hr("customeditor.new",Cr(Sz),e)}))})),Oz=Mr,_z=Sr(pz),Ez=kr(hr),Az=function(e){return[Jr("type"),Yr("columns"),e]},Dz=[Jr("type"),Jr("html"),po("presets","presentation",["presentation","document"])],Mz=Sr(Dz),Nz=pz.concat([ho("sandboxed",!0)]),Rz=Sr(Nz),zz=Mr,Bz=pz.concat([Xr("currentState",Sr([Kr("blob"),Jr("url")]))]),Pz=Sr(Bz),Iz=pz.concat([ao("inputMode"),ao("placeholder"),ho("maximized",!1),ho("disabled",!1)]),Fz=Sr(Iz),Lz=Mr,Hz=function(e){return[Jr("type"),Jr("label"),e]},Vz=[Jr("text"),Jr("value")],jz=[Jr("text"),no("items",function(e,t){return n=Ve(t),{extract:function(e,t){return n().extract(e,t)},toString:function(){return n().toString()}};var n}(0,(function(){return Uz})))],Uz=Tr([Sr(Vz),Sr(jz)]),Wz=pz.concat([no("items",Uz),ho("disabled",!1)]),$z=Sr(Wz),qz=Mr,Gz=pz.concat([to("items",[Jr("text"),Jr("value")]),mo("size",1),ho("disabled",!1)]),Kz=Sr(Gz),Xz=Mr,Yz=pz.concat([ho("constrain",!0),ho("disabled",!1)]),Jz=Sr(Yz),Zz=Sr([Jr("width"),Jr("height")]),Qz=[Jr("type"),no("header",Mr),no("cells",kr(Mr))],eB=Sr(Qz),tB=pz.concat([ao("placeholder"),ho("maximized",!1),ho("disabled",!1)]),nB=Sr(tB),rB=Mr,oB=pz.concat([po("filetype","file",["image","media","file"]),lo("disabled",!1)]),iB=Sr(oB),aB=Sr([Jr("value"),lo("meta",{})]),uB=function(e){return $r("items","items",{tag:"required",process:{}},kr(Fr((function(t){return Hr("Checking item of "+e,cB,t).fold((function(e){return Un.error(Ur(e))}),(function(e){return Un.value(e)}))}))))},cB=wr((function(){return Ir("type",{alertbanner:cz,bar:Sr((e=uB("bar"),[Jr("type"),e])),button:lz,checkbox:dz,colorinput:yz,colorpicker:xz,dropzone:_z,grid:Sr(Az(uB("grid"))),iframe:Rz,input:Fz,listbox:$z,selectbox:Kz,sizeinput:Jz,textarea:nB,urlinput:iB,customeditor:Tz,htmlpanel:Mz,imagetools:Pz,collection:vz,label:Sr(Hz(uB("label"))),table:eB,panel:lB});var e})),sB=[Jr("type"),lo("classes",[]),no("items",cB)],lB=Sr(sB),fB=[$r("name","name",cr((function(){return ra("tab-name")})),Mr),Jr("title"),no("items",cB)],dB=[Jr("type"),to("tabs",fB)],mB=Sr(dB),gB=rz,pB=az,hB=Sr([Jr("title"),Xr("body",Ir("type",{panel:lB,tabpanel:mB})),go("size","normal"),no("buttons",pB),lo("initialData",{}),vo("onAction",g),vo("onChange",g),vo("onSubmit",g),vo("onClose",g),vo("onCancel",g),lo("onTabChange",g)]),vB=Sr(_([Zr("type",["cancel","custom"])],gB,!0)),bB=Sr([Jr("title"),Jr("url"),io("height"),io("width"),co("buttons",vB),vo("onAction",g),vo("onCancel",g),vo("onClose",g),vo("onMessage",g)]),yB=function(e){return o(e)?[e].concat(J(ve(e),yB)):i(e)?J(e,yB):[]},wB=function(e){return r(e.type)&&r(e.name)},xB={checkbox:mz,colorinput:wz,colorpicker:Cz,dropzone:Ez,input:Lz,iframe:zz,sizeinput:Zz,selectbox:Xz,listbox:qz,size:Zz,textarea:rB,urlinput:aB,customeditor:Oz,collection:bz,togglemenuitem:tz},CB=function(e){var t=function(e){return $(yB(e),wB)}(e),n=J(t,(function(e){return function(e){return R.from(xB[e.type])}(e).fold((function(){return[]}),(function(t){return[Xr(e.name,t)]}))}));return Sr(n)},SB=function(e){return{internalDialog:Vr(Hr("dialog",hB,e)),dataValidator:CB(e),initialData:e.initialData}},kB={open:function(e,t){var n=SB(t);return e(n.internalDialog,n.initialData,n.dataValidator)},openUrl:function(e,t){return e(Vr(Hr("dialog",bB,t)))},redial:function(e){return SB(e)}},TB=function(e){var t=[],n={};return fe(e,(function(e,r){e.fold((function(){t.push(r)}),(function(e){n[r]=e}))})),t.length>0?Un.error(t):Un.value(n)},OB=function(e,t){var n=bh(uk.sketch((function(n){return{dom:{tag:"div",classes:["tox-form"].concat(e.classes)},components:j(e.items,(function(e){return s_(n,e,t)}))}})));return{dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[n.asSpec()]}],behaviours:wc([tp.config({mode:"acyclic",useTabstopAt:w(Pk)}),hk(n),Tk(n,{postprocess:function(e){return TB(e).fold((function(e){return console.error(e),{}}),v)}})])}},_B=Dd({name:"TabButton",configFields:[lo("uid",void 0),Kr("value"),$r("dom","dom",lr((function(){return{attributes:{role:"tab",id:ra("aria"),"aria-selected":"false"}}})),Er()),ro("action"),lo("domModification",{}),_f("tabButtonBehaviours",[mp,tp,Of]),Kr("view")],factory:function(e,t){return{uid:e.uid,dom:e.dom,components:e.components,events:_p(e.action),behaviours:Af(e.tabButtonBehaviours,[mp.config({}),tp.config({mode:"execution",useSpace:!0,useEnter:!0}),Of.config({store:{mode:"memory",initialValue:e.value}})]),domModification:e.domModification}}}),EB=h([Kr("tabs"),Kr("dom"),lo("clickToDismiss",!1),_f("tabbarBehaviours",[am,tp]),Tu(["tabClass","selectedClass"])]),AB=id({factory:_B,name:"tabs",unit:"tab",overrides:function(e){var t=function(e,t){am.dehighlight(e,t),Ai(e,Ti(),{tabbar:e,button:t})},n=function(e,t){am.highlight(e,t),Ai(e,ki(),{tabbar:e,button:t})};return{action:function(r){var o=r.getSystem().getByUid(e.uid).getOrDie(),i=am.isHighlighted(o,r);(i&&e.clickToDismiss?t:i?g:n)(o,r)},domModification:{classes:[e.markers.tabClass]}}}}),DB=h([AB]),MB=Md({name:"Tabbar",configFields:EB(),partFields:DB(),factory:function(e,t,n,r){return{uid:e.uid,dom:e.dom,components:t,"debug.sketcher":"Tabbar",domModification:{attributes:{role:"tablist"}},behaviours:Af(e.tabbarBehaviours,[am.config({highlightClass:e.markers.selectedClass,itemClass:e.markers.tabClass,onHighlight:function(e,t){Ut(t.element,"aria-selected","true")},onDehighlight:function(e,t){Ut(t.element,"aria-selected","false")}}),tp.config({mode:"flow",getInitial:function(e){return am.getHighlighted(e).map((function(e){return e.element}))},selector:"."+e.markers.tabClass,executeOnMove:!0})])}}}),NB=Dd({name:"Tabview",configFields:[_f("tabviewBehaviours",[up])],factory:function(e,t){return{uid:e.uid,dom:e.dom,behaviours:Af(e.tabviewBehaviours,[up.config({})]),domModification:{attributes:{role:"tabpanel"}}}}}),RB=h([lo("selectFirst",!0),_u("onChangeTab"),_u("onDismissTab"),lo("tabs",[]),_f("tabSectionBehaviours",[])]),zB=nd({factory:MB,schema:[Kr("dom"),eo("markers",[Kr("tabClass"),Kr("selectedClass")])],name:"tabbar",defaults:function(e){return{tabs:e.tabs}}}),BB=nd({factory:NB,name:"tabview"}),PB=h([zB,BB]),IB=Md({name:"TabSection",configFields:RB(),partFields:PB(),factory:function(e,t,n,r){var o=function(t,n){hd(t,e,"tabbar").each((function(e){n(e).each(Di)}))};return{uid:e.uid,dom:e.dom,components:t,behaviours:Ef(e.tabSectionBehaviours),events:zi(Y([e.selectFirst?[$i((function(e,t){o(e,am.getFirst)}))]:[],[Ii(ki(),(function(t,n){!function(t){var n=Of.getValue(t);hd(t,e,"tabview").each((function(r){var o=K(e.tabs,(function(e){return e.value===n}));o.each((function(n){var o=n.view();$t(t.element,"id").each((function(e){Ut(r.element,"aria-labelledby",e)})),up.set(r,o),e.onChangeTab(r,t,o)}))}))}(n.event.button)})),Ii(Ti(),(function(t,n){var r=n.event.button;e.onDismissTab(t,r)}))]])),apis:{getViewItems:function(t){return hd(t,e,"tabview").map((function(e){return up.contents(e)})).getOr([])},showTab:function(e,t){o(e,(function(e){var n=am.getCandidates(e);return K(n,(function(e){return Of.getValue(e)===t})).filter((function(t){return!am.isHighlighted(e,t)}))}))}}}},apis:{getViewItems:function(e,t){return e.getViewItems(t)},showTab:function(e,t,n){e.showTab(t,n)}}}),FB=function(e,t){Yt(e,"height",t+"px"),pt().browser.isIE()?on(e,"flex-basis"):Yt(e,"flex-basis",t+"px")},LB=function(e,t,n){uu(e,'[role="dialog"]').each((function(e){su(e,'[role="tablist"]').each((function(r){n.get().map((function(n){return Yt(t,"height","0"),Yt(t,"flex-basis","0"),Math.min(n,function(e,t,n){var r,o=St(e).dom,i=uu(e,".tox-dialog-wrap").getOr(e);r="fixed"===Qt(i,"position")?Math.max(o.clientHeight,window.innerHeight):Math.max(o.offsetHeight,o.scrollHeight);var a=sn(t),u=t.dom.offsetLeft>=n.dom.offsetLeft+vn(n)?Math.max(sn(n),a):a,c=parseInt(Qt(e,"margin-top"),10)||0,s=parseInt(Qt(e,"margin-bottom"),10)||0;return r-(sn(e)+c+s-u)}(e,t,r))})).each((function(e){FB(t,e)}))}))}))},HB=function(e){return su(e,'[role="tabpanel"]')},VB=function(e){var t,n,r=(t=Zc(),n=[$i((function(n){var r=n.element;HB(r).each((function(o){Yt(o,"visibility","hidden"),n.getSystem().getByDom(o).toOptional().each((function(n){var r=function(e,t,n){return j(e,(function(r,o){up.set(n,e[o].view());var i=t.dom.getBoundingClientRect();return up.set(n,[]),i.height}))}(e,o,n),i=function(e){return ie(re(e,(function(e,t){return e>t?-1:e<t?1:0})))}(r);i.fold(t.clear,t.set)})),LB(r,o,t),on(o,"visibility"),function(e,t){ie(e).each((function(e){return IB.showTab(t,e.value)}))}(e,n),hh.requestAnimationFrame((function(){LB(r,o,t)}))}))})),Ii(vi(),(function(e){var n=e.element;HB(n).each((function(e){LB(n,e,t)}))})),Ii(mx,(function(e,n){var r=e.element;HB(r).each((function(e){var n=Mc(zt(e));Yt(e,"visibility","hidden");var o=tn(e,"height").map((function(e){return parseInt(e,10)}));on(e,"height"),on(e,"flex-basis");var i=e.dom.getBoundingClientRect().height;o.forall((function(e){return i>e}))?(t.set(i),LB(r,e,t)):o.each((function(t){FB(e,t)})),on(e,"visibility"),n.each(Ac)}))}))],{extraEvents:n,selectFirst:!1});return{smartTabHeight:r,naiveTabHeight:{extraEvents:[],selectFirst:!0}}},jB="send-data-to-section",UB="send-data-to-view",WB=function(e,t){var n=wo({}),r=function(e){var t=Of.getValue(e),r=TB(t).getOr({}),o=n.get(),i=ar(o,r);n.set(i)},o=function(e){var t=n.get();Of.setValue(e,t)},i=wo(null),a=j(e.tabs,(function(e){return{value:e.name,dom:{tag:"div",classes:["tox-dialog__body-nav-item"],innerHtml:t.shared.providers.translate(e.title)},view:function(){return[uk.sketch((function(n){return{dom:{tag:"div",classes:["tox-form"]},components:j(e.items,(function(e){return s_(n,e,t)})),formBehaviours:wc([tp.config({mode:"acyclic",useTabstopAt:w(Pk)}),cp("TabView.form.events",[$i(o),qi(r)]),Oc.config({channels:To([{key:jB,value:{onReceive:r}},{key:UB,value:{onReceive:o}}])})])}}))]}}})),u=VB(a).smartTabHeight;return IB.sketch({dom:{tag:"div",classes:["tox-dialog__body"]},onChangeTab:function(e,t,n){var r=Of.getValue(t);Ai(e,dx,{name:r,oldName:i.get()}),i.set(r)},tabs:a,components:[IB.parts.tabbar({dom:{tag:"div",classes:["tox-dialog__body-nav"]},components:[MB.parts.tabs({})],markers:{tabClass:"tox-tab",selectedClass:"tox-dialog__body-nav-item--active"},tabbarBehaviours:wc([Qw.config({})])}),IB.parts.tabview({dom:{tag:"div",classes:["tox-dialog__body-content"]}})],selectFirst:u.selectFirst,tabSectionBehaviours:wc([cp("tabpanel",u.extraEvents),tp.config({mode:"acyclic"}),Bd.config({find:function(e){return ie(IB.getViewItems(e))}}),Of.config({store:{mode:"manual",getValue:function(e){return e.getSystem().broadcastOn([jB],{}),n.get()},setValue:function(e,t){n.set(t),e.getSystem().broadcastOn([UB],{})}}})])})},$B=ra("update-dialog"),qB=ra("update-title"),GB=ra("update-body"),KB=ra("update-footer"),XB=ra("body-send-message"),YB=function(e,t,n,r){return{dom:{tag:"div",classes:["tox-dialog__content-js"],attributes:T(T({},t.map((function(e){return{id:e}})).getOr({})),r?{"aria-live":"polite"}:{})},components:[],behaviours:wc([vk(0),sM.config({channel:GB,updateState:function(e,t){return R.some({isTabPanel:function(){return"tabpanel"===t.body.type}})},renderComponents:function(e){return"tabpanel"===e.body.type?[WB(e.body,n)]:[OB(e.body,n)]},initialData:e})])}},JB=iy.deviceType.isTouch(),ZB=function(e,t){return{dom:{tag:"div",styles:{display:"none"},classes:["tox-dialog__header"]},components:[e,t]}},QB=function(e,t){return QR.parts.close(vh.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":t.translate("Close")}},action:e,buttonBehaviours:wc([Qw.config({})])}))},eP=function(){return QR.parts.title({dom:{tag:"div",classes:["tox-dialog__title"],innerHtml:"",styles:{display:"none"}}})},tP=function(e,t){return QR.parts.body({dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[{dom:NA("<p>"+t.translate(e)+"</p>")}]}]})},nP=function(e){return QR.parts.footer({dom:{tag:"div",classes:["tox-dialog__footer"]},components:e})},rP=function(e,t){return[qw.sketch({dom:{tag:"div",classes:["tox-dialog__footer-start"]},components:e}),qw.sketch({dom:{tag:"div",classes:["tox-dialog__footer-end"]},components:t})]},oP=function(e){var t,n="tox-dialog",r=n+"-wrap",o=r+"__backdrop",i=n+"__disable-scroll";return QR.sketch({lazySink:e.lazySink,onEscape:function(t){return e.onEscape(t),R.some(!0)},useTabstopAt:function(e){return!Pk(e)},dom:{tag:"div",classes:[n].concat(e.extraClasses),styles:T({position:"relative"},e.extraStyles)},components:_([e.header,e.body],e.footer.toArray(),!0),parts:{blocker:{dom:NA('<div class="'+r+'"></div>'),components:[{dom:{tag:"div",classes:JB?[o,o+"--opaque"]:[o]}}]}},dragBlockClass:r,modalBehaviours:wc(_([mp.config({}),cp("dialog-events",e.dialogEvents.concat([Wi(Wo(),(function(e,t){tp.focusIn(e)}))])),cp("scroll-lock",[$i((function(){Pa(Ht(),i)})),qi((function(){Fa(Ht(),i)}))])],e.extraBehaviours,!0)),eventOrder:T((t={},t[ui()]=["dialog-events"],t[bi()]=["scroll-lock","dialog-events","alloy.base.behaviour"],t[yi()]=["alloy.base.behaviour","dialog-events","scroll-lock"],t),e.eventOrder)})},iP=function(e){return vh.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":e.translate("Close"),title:e.translate("Close")}},components:[Eh("close",{tag:"div",classes:["tox-icon"]},e.icons)],action:function(e){Ei(e,ux)}})},aP=function(e,t,n){var r=function(e){return[Ja(n.translate(e.title))]};return{dom:{tag:"div",classes:["tox-dialog__title"],attributes:T({},t.map((function(e){return{id:e}})).getOr({}))},components:r(e),behaviours:wc([sM.config({channel:qB,renderComponents:r})])}},uP=function(){return{dom:NA('<div class="tox-dialog__draghandle"></div>')}},cP=function(e,t){return function(e,t){var n=QR.parts.title(aP(e,R.none(),t)),r=QR.parts.draghandle(uP()),o=QR.parts.close(iP(t)),i=[n].concat(e.draggable?[r]:[]).concat([o]);return qw.sketch({dom:NA('<div class="tox-dialog__header"></div>'),components:i})}({title:t.shared.providers.translate(e),draggable:t.dialog.isDraggableModal()},t.shared.providers)},sP=function(e,t,n){return{dom:{tag:"div",classes:["tox-dialog__busy-spinner"],attributes:{"aria-label":n.translate(e)},styles:{left:"0px",right:"0px",bottom:"0px",top:"0px",position:"absolute"}},behaviours:t,components:[{dom:NA('<div class="tox-spinner"><div></div><div></div><div></div></div>')}]}},lP=function(e,t,n){return{onClose:function(){return n.closeWindow()},onBlock:function(n){QR.setBusy(e(),(function(e,r){return sP(n.message,r,t)}))},onUnblock:function(){QR.setIdle(e())}}},fP=function(e,t,n,r){var o;return eu(oP(T(T({},e),{lazySink:r.shared.getSink,extraBehaviours:_([sM.config({channel:$B,updateState:function(e,t){return R.some(t)},initialData:t}),Ek({})],e.extraBehaviours,!0),onEscape:function(e){Ei(e,ux)},dialogEvents:n,eventOrder:(o={},o[ai()]=[sM.name(),Oc.name()],o[bi()]=["scroll-lock",sM.name(),"messages","dialog-events","alloy.base.behaviour"],o[yi()]=["alloy.base.behaviour","dialog-events","messages",sM.name(),"scroll-lock"],o)})))},dP=function(e){return j(e,(function(e){return"menu"===e.type?function(e){var t=j(e.items,(function(e){var t=wo(!1);return T(T({},e),{storage:t})}));return T(T({},e),{items:t})}(e):e}))},mP=function(e){return G(e,(function(e,t){return"menu"===t.type?G(t.items,(function(e,t){return e[t.name]=t.storage,e}),e):e}),{})},gP=function(e,t){return[Vi(Wo(),Bk),e(ax,(function(e,n){t.onClose(),n.onClose()})),e(ux,(function(e,t,n,r){t.onCancel(e),Ei(r,ax)})),Ii(fx,(function(e,n){return t.onUnblock()})),Ii(lx,(function(e,n){return t.onBlock(n.event)}))]},pP=function(e,t){var n=function(t,n){return Ii(t,(function(t,o){r(t,(function(r,i){n(e(),r,o.event,t)}))}))},r=function(e,t){sM.getState(e).get().each((function(n){t(n,e)}))};return _(_([],gP(n,t),!0),[n(cx,(function(e,t,n){t.onAction(e,{name:n.name})}))],!1)},hP=function(e,t,n){var r=function(t,n){return Ii(t,(function(t,r){o(t,(function(o,i){n(e(),o,r.event,t)}))}))},o=function(e,t){sM.getState(e).get().each((function(n){t(n.internalDialog,e)}))};return _(_([],gP(r,t),!0),[r(sx,(function(e,t){return t.onSubmit(e)})),r(ix,(function(e,t,n){t.onChange(e,{name:n.name})})),r(cx,(function(e,t,r,o){var i=function(){return tp.focusIn(o)},a=function(e){return qt(e,"disabled")||$t(e,"aria-disabled").exists((function(e){return"true"===e}))},u=zt(o.element),c=Mc(u);t.onAction(e,{name:r.name,value:r.value}),Mc(u).fold(i,(function(e){a(e)||c.exists((function(t){return wt(e,t)&&a(t)}))?i():n().toOptional().filter((function(t){return!wt(t.element,e)})).each(i)}))})),r(dx,(function(e,t,n){t.onTabChange(e,{newTabName:n.name,oldTabName:n.oldName})})),qi((function(t){var n=e();Of.setValue(t,n.getData())}))],!1)},vP=function(e,t){var n=t.map((function(e){return e.footerButtons})).getOr([]),r=W(n,(function(e){return"start"===e.align})),o=function(e,t){return qw.sketch({dom:{tag:"div",classes:["tox-dialog__footer-"+e]},components:j(t,(function(e){return e.memento.asSpec()}))})};return[o("start",r.pass),o("end",r.fail)]},bP=function(e,t){return{dom:NA('<div class="tox-dialog__footer"></div>'),components:[],behaviours:wc([sM.config({channel:KB,initialData:e,updateState:function(e,n){var r=j(n.buttons,(function(e){var n=bh(function(e,t){return YT(e,e.type,t)}(e,t));return{name:e.name,align:e.align,memento:n}}));return R.some({lookupByName:function(e,t){return function(e,t,n){return K(t,(function(e){return e.name===n})).bind((function(t){return t.memento.getOpt(e)}))}(e,r,t)},footerButtons:r})},renderComponents:vP})])}},yP=function(e,t){return QR.parts.footer(bP(e,t))},wP=function(e,t){if(e.getRoot().getSystem().isConnected()){var n=Bd.getCurrent(e.getFormWrapper()).getOr(e.getFormWrapper());return uk.getField(n,t).fold((function(){var r=e.getFooter();return sM.getState(r).get().bind((function(e){return e.lookupByName(n,t)}))}),(function(e){return R.some(e)}))}return R.none()},xP=function(e,t,n){var o=function(t){var n=e.getRoot();n.getSystem().isConnected()&&t(n)},i={getData:function(){var t=e.getRoot(),r=t.getSystem().isConnected()?e.getFormWrapper():t,o=Of.getValue(r),i=de(n,(function(e){return e.get()}));return T(T({},o),i)},setData:function(t){o((function(r){var o=i.getData(),a=T(T({},o),t),u=function(e,t){var n=e.getRoot();return sM.getState(n).get().map((function(e){return Vr(Hr("data",e.dataValidator,t))})).getOr(t)}(e,a),c=e.getFormWrapper();Of.setValue(c,u),fe(n,(function(e,t){ye(a,t)&&e.set(a[t])}))}))},disable:function(t){wP(e,t).each(Xd.disable)},enable:function(t){wP(e,t).each(Xd.enable)},focus:function(t){wP(e,t).each(mp.focus)},block:function(e){if(!r(e))throw new Error("The dialogInstanceAPI.block function should be passed a blocking message of type string as an argument");o((function(t){Ai(t,lx,{message:e})}))},unblock:function(){o((function(e){Ei(e,fx)}))},showTab:function(t){o((function(n){var r=e.getBody();sM.getState(r).get().exists((function(e){return e.isTabPanel()}))&&Bd.getCurrent(r).each((function(e){IB.showTab(e,t)}))}))},redial:function(e){o((function(n){var r=t(e);n.getSystem().broadcastOn([$B],r),n.getSystem().broadcastOn([qB],r.internalDialog),n.getSystem().broadcastOn([GB],r.internalDialog),n.getSystem().broadcastOn([KB],r.internalDialog),i.setData(r.initialData)}))},close:function(){o((function(e){Ei(e,ax)}))}};return i},CP=function(e,t,n){var r=cP(e.internalDialog.title,n),o=function(e,t){var n=YB(e,R.none(),t,!1);return QR.parts.body(n)}({body:e.internalDialog.body},n),i=dP(e.internalDialog.buttons),a=mP(i),u=yP({buttons:i},n),c=hP((function(){return m}),lP((function(){return f}),n.shared.providers,t),n.shared.getSink),s=function(e){switch(e){case"large":return["tox-dialog--width-lg"];case"medium":return["tox-dialog--width-md"];default:return[]}}(e.internalDialog.size),l={header:r,body:o,footer:R.some(u),extraClasses:s,extraBehaviours:[],extraStyles:{}},f=fP(l,e,c,n),d={getRoot:h(f),getBody:function(){return QR.getBody(f)},getFooter:function(){return QR.getFooter(f)},getFormWrapper:function(){var e=QR.getBody(f);return Bd.getCurrent(e).getOr(e)}},m=xP(d,t.redial,a);return{dialog:f,instanceApi:m}},SP=function(e,t,n,r){var o,i,a,u,c,s=ra("dialog-label"),l=ra("dialog-content"),f=bh((a={title:e.internalDialog.title,draggable:!0},u=s,c=n.shared.providers,qw.sketch({dom:NA('<div class="tox-dialog__header"></div>'),components:[aP(a,R.some(u),c),uP(),iP(c)],containerBehaviours:wc([FR.config({mode:"mouse",blockerClass:"blocker",getTarget:function(e){return lu(e,'[role="dialog"]').getOrDie()},snaps:{getSnapPoints:function(){return[]},leftAttr:"data-drag-left",topAttr:"data-drag-top"}})])}))),d=bh(function(e,t,n,r){return YB(e,R.some(t),n,r)}({body:e.internalDialog.body},l,n,r)),m=dP(e.internalDialog.buttons),g=mP(m),p=bh(function(e,t){return bP(e,t)}({buttons:m},n)),v=hP((function(){return y}),{onBlock:function(e){MA.block(b,(function(t,r){return sP(e.message,r,n.shared.providers)}))},onUnblock:function(){MA.unblock(b)},onClose:function(){return t.closeWindow()}},n.shared.getSink),b=eu({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[ai()]=[sM.name(),Oc.name()],i[ui()]=["execute-on-form"],i[bi()]=["reflecting","execute-on-form"],i),behaviours:wc([tp.config({mode:"cyclic",onEscape:function(e){return Ei(e,ax),R.some(!0)},useTabstopAt:function(e){return!Pk(e)&&("button"!==Be(e)||"disabled"!==Wt(e,"disabled"))}}),sM.config({channel:$B,updateState:function(e,t){return R.some(t)},initialData:e}),mp.config({}),cp("execute-on-form",v.concat([Wi(Wo(),(function(e,t){tp.focusIn(e)}))])),MA.config({getRoot:function(){return R.some(b)}}),up.config({}),Ek({})]),components:[f.asSpec(),d.asSpec(),p.asSpec()]}),y=xP({getRoot:h(b),getFooter:function(){return p.get(b)},getBody:function(){return d.get(b)},getFormWrapper:function(){var e=d.get(b);return Bd.getCurrent(e).getOr(e)}},t.redial,g);return{dialog:b,instanceApi:y}},kP=tinymce.util.Tools.resolve("tinymce.util.URI"),TP=["insertContent","setContent","execCommand","close","block","unblock"],OP=function(e){return o(e)&&-1!==TP.indexOf(e.mceAction)},_P=function(e,t,n,i){var a,c,s,l=cP(e.title,i),f=function(e){var t={dom:{tag:"div",classes:["tox-dialog__content-js"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-iframe"]},components:[Rk({dom:{tag:"iframe",attributes:{src:e.url}},behaviours:wc([Qw.config({}),mp.config({})])})]}],behaviours:wc([tp.config({mode:"acyclic",useTabstopAt:w(Pk)})])};return QR.parts.body(t)}(e),d=e.buttons.bind((function(e){return 0===e.length?R.none():R.some(yP({buttons:e},i))})),m=pP((function(){return C}),lP((function(){return x}),i.shared.providers,t)),g=T(T({},e.height.fold((function(){return{}}),(function(e){return{height:e+"px","max-height":e+"px"}}))),e.width.fold((function(){return{}}),(function(e){return{width:e+"px","max-width":e+"px"}}))),p=e.width.isNone()&&e.height.isNone()?["tox-dialog--width-lg"]:[],h=new kP(e.url,{base_uri:new kP(window.location.href)}),v=h.protocol+"://"+h.host+(h.port?":"+h.port:""),b=Jc(),y=[cp("messages",[$i((function(){var t=es(Re.fromDom(window),"message",(function(t){if(h.isSameOrigin(new kP(t.raw.origin))){var r=t.raw.data;OP(r)?function(e,t,n){switch(n.mceAction){case"insertContent":e.insertContent(n.content);break;case"setContent":e.setContent(n.content);break;case"execCommand":var r=!!u(n.ui)&&n.ui;e.execCommand(n.cmd,r,n.value);break;case"close":t.close();break;case"block":t.block(n.message);break;case"unblock":t.unblock()}}(n,C,r):function(e){return!OP(e)&&o(e)&&ye(e,"mceAction")}(r)&&e.onMessage(C,r)}}));b.set(t)})),qi(b.clear)]),Oc.config({channels:(a={},a[XB]={onReceive:function(e,t){su(e.element,"iframe").each((function(e){e.dom.contentWindow.postMessage(t,v)}))}},a)})],x=fP({header:l,body:f,footer:d,extraClasses:p,extraBehaviours:y,extraStyles:g},e,m,i),C=(c=x,s=function(e){c.getSystem().isConnected()&&e(c)},{block:function(e){if(!r(e))throw new Error("The urlDialogInstanceAPI.block function should be passed a blocking message of type string as an argument");s((function(t){Ai(t,lx,{message:e})}))},unblock:function(){s((function(e){Ei(e,fx)}))},close:function(){s((function(e){Ei(e,ax)}))},sendMessage:function(e){s((function(t){t.getSystem().broadcastOn([XB],e)}))}});return{dialog:x,instanceApi:C}},EP=function(e,t,n){return t&&n?[]:[IE.config({contextual:{lazyContext:function(){return R.some(Fn(Re.fromDom(e.getContentAreaContainer())))},fadeInClass:"tox-dialog-dock-fadein",fadeOutClass:"tox-dialog-dock-fadeout",transitionClass:"tox-dialog-dock-transition"},modes:["top"]})]},AP=function(e){var t=e.backstage,n=e.editor,r=Ib(n),o=function(e){var t=e.backstage.shared;return{open:function(n,r){var o=function(){QR.hide(c),r()},i=bh(YT({name:"close-alert",text:"OK",primary:!0,align:"end",disabled:!1,icon:R.none()},"cancel",e.backstage)),a=eP(),u=QB(o,t.providers),c=eu(oP({lazySink:function(){return t.getSink()},header:ZB(a,u),body:tP(n,t.providers),footer:R.some(nP(rP([],[i.asSpec()]))),onEscape:o,extraClasses:["tox-alert-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[Ii(ux,o)],eventOrder:{}}));QR.show(c);var s=i.get(c);mp.focus(s)}}}(e),i=function(e){var t=e.backstage.shared;return{open:function(n,r){var o=function(e){QR.hide(s),r(e)},i=bh(YT({name:"yes",text:"Yes",primary:!0,align:"end",disabled:!1,icon:R.none()},"submit",e.backstage)),a=YT({name:"no",text:"No",primary:!1,align:"end",disabled:!1,icon:R.none()},"cancel",e.backstage),u=eP(),c=QB((function(){return o(!1)}),t.providers),s=eu(oP({lazySink:function(){return t.getSink()},header:ZB(u,c),body:tP(n,t.providers),footer:R.some(nP(rP([],[a,i.asSpec()]))),onEscape:function(){return o(!1)},extraClasses:["tox-confirm-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[Ii(ux,(function(){return o(!1)})),Ii(sx,(function(){return o(!0)}))],eventOrder:{}}));QR.show(s);var l=i.get(s);mp.focus(l)}}}(e),a=function(e,r){return kB.openUrl((function(e){var o=_P(e,{closeWindow:function(){QR.hide(o.dialog),r(o.instanceApi)}},n,t);return QR.show(o.dialog),o.instanceApi}),e)},u=function(e,n){return kB.open((function(e,r,o){var i=r,a=CP({dataValidator:o,initialData:i,internalDialog:e},{redial:kB.redial,closeWindow:function(){QR.hide(a.dialog),n(a.instanceApi)}},t);return QR.show(a.dialog),a.instanceApi.setData(i),a.instanceApi}),e)},c=function(e,o,i,a){return kB.open((function(e,u,c){var s=Vr(Hr("data",c,u)),l=Zc(),f=t.shared.header.isPositionedAtTop(),d=function(){return l.on((function(e){Yp.reposition(e),IE.refresh(e)}))},m=SP({dataValidator:c,initialData:s,internalDialog:e},{redial:kB.redial,closeWindow:function(){l.on(Yp.hide),n.off("ResizeEditor",d),l.clear(),i(m.instanceApi)}},t,a),g=eu(Yp.sketch(T(T({lazySink:t.shared.getSink,dom:{tag:"div",classes:[]},fireDismissalEventInstead:{}},f?{}:{fireRepositionEventInstead:{}}),{inlineBehaviours:wc(_([cp("window-manager-inline-events",[Ii(wi(),(function(e,t){Ei(m.dialog,ux)}))])],EP(n,r,f),!0)),isExtraPart:function(e,t){return function(e){return Nw(e,".tox-alert-dialog")||Nw(e,".tox-confirm-dialog")}(t)}})));return l.set(g),Yp.showWithin(g,tu(m.dialog),{anchor:o},R.some(Ht())),r&&f||(IE.refresh(g),n.on("ResizeEditor",d)),m.instanceApi.setData(s),tp.focusIn(m.dialog),m.instanceApi}),e)};return{open:function(e,n,r){return void 0!==n&&"toolbar"===n.inline?c(e,t.shared.anchors.inlineDialog(),r,n.ariaAttrs):void 0!==n&&"cursor"===n.inline?c(e,t.shared.anchors.cursor(),r,n.ariaAttrs):u(e,r)},openUrl:function(e,t){return a(e,t)},alert:function(e,t){o.open(e,(function(){t()}))},close:function(e){e.close()},confirm:function(e,t){i.open(e,(function(e){t(e)}))}}};k.add("silver",(function(e){var t=XR(e),n=t.uiMothership,r=t.backstage,o=t.renderUI,i=t.getUi;Mw(e,r.shared);var a=AP({editor:e,backstage:r});return{renderUI:o,getWindowManagerImpl:h(a),getNotificationManagerImpl:function(){return Mh(e,{backstage:r},n)},ui:i()}}))}(),function(){"use strict";var e=function(){return e=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},e.apply(this,arguments)};function t(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function n(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}var r=function(e){return function(t){return function(e){var t=typeof e;return null===e?"null":"object"===t&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"===t&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":t}(t)===e}},o=function(e){return function(t){return typeof t===e}},i=function(e){return function(t){return e===t}},a=r("string"),u=r("object"),c=r("array"),s=i(null),l=o("boolean"),f=i(void 0),d=function(e){return!function(e){return null==e}(e)},m=o("function"),g=o("number"),p=function(){},h=function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return e(t.apply(null,n))}},v=function(e){return function(){return e}},b=function(e){return e},y=function(e,t){return e===t};function w(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=t.concat(n);return e.apply(null,o)}}var x,C,S=function(e){return function(t){return!e(t)}},k=function(e){return function(){throw new Error(e)}},T=function(e){return e()},O=v(!1),_=v(!0),E=function(){return A},A={fold:function(e,t){return e()},isSome:O,isNone:_,getOr:C=b,getOrThunk:x=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:v(null),getOrUndefined:v(void 0),or:C,orThunk:x,map:E,each:p,bind:E,exists:O,forall:_,filter:function(){return E()},toArray:function(){return[]},toString:v("none()")},D=function(e){var t=v(e),n=function(){return o},r=function(t){return t(e)},o={fold:function(t,n){return n(e)},isSome:_,isNone:O,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:n,orThunk:n,map:function(t){return D(t(e))},each:function(t){t(e)},bind:r,exists:r,forall:r,filter:function(t){return t(e)?o:A},toArray:function(){return[e]},toString:function(){return"some("+e+")"}};return o},M={some:D,none:E,from:function(e){return null==e?A:D(e)}},N=function(e){var t,n=!1;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=!0,t=e.apply(null,r)),t}},R=Array.prototype.slice,z=Array.prototype.indexOf,B=Array.prototype.push,P=function(e,t){return function(e,t){return z.call(e,t)}(e,t)>-1},I=function(e,t){for(var n=0,r=e.length;n<r;n++){if(t(e[n],n))return!0}return!1},F=function(e,t){for(var n=e.length,r=new Array(n),o=0;o<n;o++){var i=e[o];r[o]=t(i,o)}return r},L=function(e,t){for(var n=0,r=e.length;n<r;n++){t(e[n],n)}},H=function(e,t){for(var n=[],r=0,o=e.length;r<o;r++){var i=e[r];t(i,r)&&n.push(i)}return n},V=function(e,t,n){return function(e,t){for(var n=e.length-1;n>=0;n--)t(e[n],n)}(e,(function(e,r){n=t(n,e,r)})),n},j=function(e,t,n){return L(e,(function(e,r){n=t(n,e,r)})),n},U=function(e,t){return function(e,t,n){for(var r=0,o=e.length;r<o;r++){var i=e[r];if(t(i,r))return M.some(i);if(n(i,r))break}return M.none()}(e,t,O)},W=function(e,t){for(var n=0,r=e.length;n<r;n++){if(t(e[n],n))return M.some(n)}return M.none()},$=function(e){for(var t=[],n=0,r=e.length;n<r;++n){if(!c(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);B.apply(t,e[n])}return t},q=function(e,t){return $(F(e,t))},G=function(e,t){for(var n=0,r=e.length;n<r;++n){if(!0!==t(e[n],n))return!1}return!0},K=function(e){var t=R.call(e,0);return t.reverse(),t},X=function(e,t){return H(e,(function(e){return!P(t,e)}))},Y=function(e){return[e]},J=function(e){return function(e,t){return t>=0&&t<e.length?M.some(e[t]):M.none()}(e,0)},Z=function(e,t){for(var n=0;n<e.length;n++){var r=t(e[n],n);if(r.isSome())return r}return M.none()},Q=function(){return ee(0,0)},ee=function(e,t){return{major:e,minor:t}},te={nu:ee,detect:function(e,t){var n=String(t).toLowerCase();return 0===e.length?Q():function(e,t){var n=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(r.test(t))return r}}(e,t);if(!n)return{major:0,minor:0};var r=function(e){return Number(t.replace(n,"$"+e))};return ee(r(1),r(2))}(e,n)},unknown:Q},ne=function(e,t){var n=String(t).toLowerCase();return U(e,(function(e){return e.search(n)}))},re=function(e,t){return-1!==e.indexOf(t)},oe=function(e){return function(t){return t.replace(e,"")}}(/^\s+|\s+$/g),ie=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,ae=function(e){return function(t){return re(t,e)}},ue=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return re(e,"edge/")&&re(e,"chrome")&&re(e,"safari")&&re(e,"applewebkit")}},{name:"Chrome",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,ie],search:function(e){return re(e,"chrome")&&!re(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return re(e,"msie")||re(e,"trident")}},{name:"Opera",versionRegexes:[ie,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:ae("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:ae("firefox")},{name:"Safari",versionRegexes:[ie,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(re(e,"safari")||re(e,"mobile/"))&&re(e,"applewebkit")}}],ce=[{name:"Windows",search:ae("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return re(e,"iphone")||re(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:ae("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:ae("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:ae("linux"),versionRegexes:[]},{name:"Solaris",search:ae("sunos"),versionRegexes:[]},{name:"FreeBSD",search:ae("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:ae("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],se={browsers:v(ue),oses:v(ce)},le="Edge",fe="Chrome",de="Opera",me="Firefox",ge="Safari",pe=function(e){var t=e.current,n=e.version,r=function(e){return function(){return t===e}};return{current:t,version:n,isEdge:r(le),isChrome:r(fe),isIE:r("IE"),isOpera:r(de),isFirefox:r(me),isSafari:r(ge)}},he={unknown:function(){return pe({current:void 0,version:te.unknown()})},nu:pe,edge:v(le),chrome:v(fe),ie:v("IE"),opera:v(de),firefox:v(me),safari:v(ge)},ve="Windows",be="Android",ye="Linux",we="Solaris",xe="FreeBSD",Ce="ChromeOS",Se=function(e){var t=e.current,n=e.version,r=function(e){return function(){return t===e}};return{current:t,version:n,isWindows:r(ve),isiOS:r("iOS"),isAndroid:r(be),isOSX:r("OSX"),isLinux:r(ye),isSolaris:r(we),isFreeBSD:r(xe),isChromeOS:r(Ce)}},ke={unknown:function(){return Se({current:void 0,version:te.unknown()})},nu:Se,windows:v(ve),ios:v("iOS"),android:v(be),linux:v(ye),osx:v("OSX"),solaris:v(we),freebsd:v(xe),chromeos:v(Ce)},Te=function(e,t,n){var r=se.browsers(),o=se.oses(),i=t.bind((function(e){return function(e,t){return Z(t.brands,(function(t){var n=t.brand.toLowerCase();return U(e,(function(e){var t;return n===(null===(t=e.brand)||void 0===t?void 0:t.toLowerCase())})).map((function(e){return{current:e.name,version:te.nu(parseInt(t.version,10),0)}}))}))}(r,e)})).orThunk((function(){return function(e,t){return ne(e,t).map((function(e){var n=te.detect(e.versionRegexes,t);return{current:e.name,version:n}}))}(r,e)})).fold(he.unknown,he.nu),a=function(e,t){return ne(e,t).map((function(e){var n=te.detect(e.versionRegexes,t);return{current:e.name,version:n}}))}(o,e).fold(ke.unknown,ke.nu),u=function(e,t,n,r){var o=e.isiOS()&&!0===/ipad/i.test(n),i=e.isiOS()&&!o,a=e.isiOS()||e.isAndroid(),u=a||r("(pointer:coarse)"),c=o||!i&&a&&r("(min-device-width:768px)"),s=i||a&&!c,l=t.isSafari()&&e.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(u),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:v(l),isDesktop:v(f)}}(a,i,e,n);return{browser:i,os:a,deviceType:u}},Oe=function(e){return window.matchMedia(e).matches},_e=N((function(){return Te(navigator.userAgent,M.from(navigator.userAgentData),Oe)})),Ee=function(){return _e()},Ae=v,De=Ae("touchstart"),Me=Ae("touchmove"),Ne=Ae("touchend"),Re=Ae("mousedown"),ze=Ae("mousemove"),Be=Ae("mouseup"),Pe=Ae("mouseover"),Ie=Ae("keydown"),Fe=Ae("keyup"),Le=Ae("input"),He=Ae("change"),Ve=Ae("click"),je=Ae("transitionend"),Ue=Ae("selectstart"),We=function(e){return v("alloy."+e)},$e={tap:We("tap")},qe=We("focus"),Ge=We("blur.post"),Ke=We("paste.post"),Xe=We("receive"),Ye=We("execute"),Je=We("focus.item"),Ze=$e.tap,Qe=We("longpress"),et=We("system.init"),tt=We("system.attached"),nt=We("system.detached"),rt=We("focusmanager.shifted"),ot=We("highlight"),it=We("dehighlight"),at=function(e,t){lt(e,e.element,t,{})},ut=function(e,t,n){lt(e,e.element,t,n)},ct=function(e){at(e,Ye())},st=function(e,t,n){lt(e,t,n,{})},lt=function(t,n,r,o){var i=e({target:n},o);t.getSystem().triggerEvent(r,n,i)},ft=function(e){if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}},dt={fromHtml:function(e,t){var n=(t||document).createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return ft(n.childNodes[0])},fromTag:function(e,t){var n=(t||document).createElement(e);return ft(n)},fromText:function(e,t){var n=(t||document).createTextNode(e);return ft(n)},fromDom:ft,fromPoint:function(e,t,n){return M.from(e.dom.elementFromPoint(t,n)).map(ft)}},mt=function(e,t){var n=e.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(t);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(t);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(t);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")},gt=function(e){return 1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType||0===e.childElementCount},pt=function(e,t){var n=void 0===t?document:t.dom;return gt(n)?[]:F(n.querySelectorAll(e),dt.fromDom)},ht=function(e,t){var n=void 0===t?document:t.dom;return gt(n)?M.none():M.from(n.querySelector(e)).map(dt.fromDom)},vt=function(e,t){return e.dom===t.dom};"undefined"!=typeof window?window:Function("return this;")();var bt,yt=function(e){return e.dom.nodeName.toLowerCase()},wt=function(e){return function(t){return function(e){return e.dom.nodeType}(t)===e}},xt=wt(1),Ct=wt(3),St=wt(9),kt=wt(11),Tt=function(e){return dt.fromDom(e.dom.ownerDocument)},Ot=function(e){return St(e)?e:Tt(e)},_t=function(e){return M.from(e.dom.parentNode).map(dt.fromDom)},Et=function(e){return F(e.dom.childNodes,dt.fromDom)},At=function(e,t){var n=e.dom.childNodes;return M.from(n[t]).map(dt.fromDom)},Dt=function(e,t){_t(e).each((function(n){n.dom.insertBefore(t.dom,e.dom)}))},Mt=function(e,t){var n=function(e){return M.from(e.dom.nextSibling).map(dt.fromDom)}(e);n.fold((function(){_t(e).each((function(e){Rt(e,t)}))}),(function(e){Dt(e,t)}))},Nt=function(e,t){var n=function(e){return At(e,0)}(e);n.fold((function(){Rt(e,t)}),(function(n){e.dom.insertBefore(t.dom,n.dom)}))},Rt=function(e,t){e.dom.appendChild(t.dom)},zt=function(e,t){L(t,(function(t){Rt(e,t)}))},Bt=function(e){e.dom.textContent="",L(Et(e),(function(e){Pt(e)}))},Pt=function(e){var t=e.dom;null!==t.parentNode&&t.parentNode.removeChild(t)},It=function(e){return kt(e)&&d(e.dom.host)},Ft=m(Element.prototype.attachShadow)&&m(Node.prototype.getRootNode),Lt=v(Ft),Ht=Ft?function(e){return dt.fromDom(e.dom.getRootNode())}:Ot,Vt=function(e){return dt.fromDom(e.dom.host)},jt=function(e){return d(e.dom.shadowRoot)},Ut=function(e){var t=Ct(e)?e.dom.parentNode:e.dom;if(null==t||null===t.ownerDocument)return!1;var n,r,o=t.ownerDocument;return function(e){var t=Ht(e);return It(t)?M.some(t):M.none()}(dt.fromDom(t)).fold((function(){return o.body.contains(t)}),(n=Ut,r=Vt,function(e){return n(r(e))}))},Wt=function(){return $t(dt.fromDom(document))},$t=function(e){var t=e.dom.body;if(null==t)throw new Error("Body is not available yet");return dt.fromDom(t)},qt=function(e){at(e,nt());var t=e.components();L(t,qt)},Gt=function(e){var t=e.components();L(t,Gt),at(e,tt())},Kt=function(e,t){Rt(e.element,t.element)},Xt=function(e,t){var n=e.components();!function(e){L(e.components(),(function(e){return Pt(e.element)})),Bt(e.element),e.syncComponents()}(e);var r=X(n,t);L(r,(function(t){qt(t),e.getSystem().removeFromWorld(t)})),L(t,(function(t){t.getSystem().isConnected()?Kt(e,t):(e.getSystem().addToWorld(t),Kt(e,t),Ut(e.element)&&Gt(t)),e.syncComponents()}))},Yt=function(e,t,n){e.getSystem().addToWorld(t),n(e.element,t.element),Ut(e.element)&&Gt(t),e.syncComponents()},Jt=function(e){var t=_t(e.element).bind((function(t){return e.getSystem().getByDom(t).toOptional()}));!function(e){qt(e),Pt(e.element),e.getSystem().removeFromWorld(e)}(e),t.each((function(e){e.syncComponents()}))},Zt=function(e,t,n){n(e,t.element);var r=Et(t.element);L(r,(function(e){t.getByDom(e).each(Gt)}))},Qt=Object.keys,en=Object.hasOwnProperty,tn=function(e,t){for(var n=Qt(e),r=0,o=n.length;r<o;r++){var i=n[r];t(e[i],i)}},nn=function(e,t){return rn(e,(function(e,n){return{k:n,v:t(e,n)}}))},rn=function(e,t){var n={};return tn(e,(function(e,r){var o=t(e,r);n[o.k]=o.v})),n},on=function(e,t){var n={};return function(e,t,n,r){tn(e,(function(e,o){(t(e,o)?n:r)(e,o)}))}(e,t,function(e){return function(t,n){e[n]=t}}(n),p),n},an=function(e,t){var n=[];return tn(e,(function(e,r){n.push(t(e,r))})),n},un=function(e,t){return cn(e,t)?M.from(e[t]):M.none()},cn=function(e,t){return en.call(e,t)},sn=function(e,t){return cn(e,t)&&void 0!==e[t]&&null!==e[t]},ln=function(e,t,n){if(!(a(n)||l(n)||g(n)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",n,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,n+"")},fn=function(e,t,n){ln(e.dom,t,n)},dn=function(e,t){var n=e.dom;tn(t,(function(e,t){ln(n,t,e)}))},mn=function(e,t){var n=e.dom.getAttribute(t);return null===n?void 0:n},gn=function(e,t){return M.from(mn(e,t))},pn=function(e,t){var n=e.dom;return!(!n||!n.hasAttribute)&&n.hasAttribute(t)},hn=function(e,t){e.dom.removeAttribute(t)},vn=function(e,t){var n=mn(e,t);return void 0===n||""===n?[]:n.split(" ")},bn=function(e){return void 0!==e.dom.classList},yn=function(e,t){return function(e,t,n){var r=vn(e,t).concat([n]);return fn(e,t,r.join(" ")),!0}(e,"class",t)},wn=function(e,t){return function(e,t,n){var r=H(vn(e,t),(function(e){return e!==n}));return r.length>0?fn(e,t,r.join(" ")):hn(e,t),!1}(e,"class",t)},xn=function(e,t){bn(e)?e.dom.classList.add(t):yn(e,t)},Cn=function(e){var t=bn(e)?e.dom.classList:function(e){return vn(e,"class")}(e);0===t.length&&hn(e,"class")},Sn=function(e,t){bn(e)?e.dom.classList.remove(t):wn(e,t);Cn(e)},kn=function(e,t){return bn(e)&&e.dom.classList.contains(t)},Tn=function(e,t,n){Sn(e,n),xn(e,t)},On=Object.freeze({__proto__:null,toAlpha:function(e,t,n){Tn(e.element,t.alpha,t.omega)},toOmega:function(e,t,n){Tn(e.element,t.omega,t.alpha)},isAlpha:function(e,t,n){return kn(e.element,t.alpha)},isOmega:function(e,t,n){return kn(e.element,t.omega)},clear:function(e,t,n){Sn(e.element,t.alpha),Sn(e.element,t.omega)}}),_n=function(e){return{isValue:_,isError:O,getOr:v(e),getOrThunk:v(e),getOrDie:v(e),or:function(t){return _n(e)},orThunk:function(t){return _n(e)},fold:function(t,n){return n(e)},map:function(t){return _n(t(e))},mapError:function(t){return _n(e)},each:function(t){t(e)},bind:function(t){return t(e)},exists:function(t){return t(e)},forall:function(t){return t(e)},toOptional:function(){return M.some(e)}}},En=function(e){return{isValue:O,isError:_,getOr:b,getOrThunk:function(e){return e()},getOrDie:function(){return k(String(e))()},or:b,orThunk:function(e){return e()},fold:function(t,n){return t(e)},map:function(t){return En(e)},mapError:function(t){return En(t(e))},each:p,bind:function(t){return En(e)},exists:O,forall:_,toOptional:M.none}},An={value:_n,error:En,fromOption:function(e,t){return e.fold((function(){return En(t)}),_n)}};!function(e){e[e.Error=0]="Error",e[e.Value=1]="Value"}(bt||(bt={}));var Dn,Mn,Nn=function(e,t,n){return e.stype===bt.Error?t(e.serror):n(e.svalue)},Rn=function(e){return{stype:bt.Value,svalue:e}},zn=function(e){return{stype:bt.Error,serror:e}},Bn=function(e){return e.fold(zn,Rn)},Pn=function(e){return Nn(e,An.error,An.value)},In=Rn,Fn=function(e){var t=[],n=[];return L(e,(function(e){Nn(e,(function(e){return n.push(e)}),(function(e){return t.push(e)}))})),{values:t,errors:n}},Ln=zn,Hn=function(e,t){return e.stype===bt.Value?t(e.svalue):e},Vn=function(e,t){return e.stype===bt.Error?t(e.serror):e},jn=function(e,t){return e.stype===bt.Value?{stype:bt.Value,svalue:t(e.svalue)}:e},Un=function(e,t){return e.stype===bt.Error?{stype:bt.Error,serror:t(e.serror)}:e},Wn=Nn,$n=function(e,t,n,r){return{tag:"field",key:e,newKey:t,presence:n,prop:r}},qn=function(e,t,n){switch(e.tag){case"field":return t(e.key,e.newKey,e.presence,e.prop);case"custom":return n(e.newKey,e.instantiator)}},Gn=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(0===t.length)throw new Error("Can't merge zero objects");for(var r={},o=0;o<t.length;o++){var i=t[o];for(var a in i)cn(i,a)&&(r[a]=e(r[a],i[a]))}return r}},Kn=Gn((function(e,t){return u(e)&&u(t)?Kn(e,t):t})),Xn=Gn((function(e,t){return t})),Yn=function(e){return{tag:"defaultedThunk",process:e}},Jn=function(e){return Yn(v(e))},Zn=function(e){return{tag:"mergeWithThunk",process:e}},Qn=function(e){return h(Ln,$)(e)},er=function(e){var t=Fn(e);return t.errors.length>0?Qn(t.errors):In(t.values)},tr=function(e){return u(e)&&Qt(e).length>100?" removed due to size":JSON.stringify(e,null,2)},nr=function(e,t){return Ln([{path:e,getErrorInfo:t}])},rr=function(e){return{extract:function(t,n){return Vn(e(n),(function(e){return function(e,t){return nr(e,v(t))}(t,e)}))},toString:v("val")}},or=rr(In),ir=function(e,t,n,r){return un(t,n).fold((function(){return function(e,t,n){return nr(e,(function(){return'Could not find valid *required* value for "'+t+'" in '+tr(n)}))}(e,n,t)}),r)},ar=function(e,t,n,r){return r(un(e,t).getOrThunk((function(){return n(e)})))},ur=function(e,t,n,r,o){var i=function(e){return o.extract(t.concat([r]),e)},a=function(e){return e.fold((function(){return In(M.none())}),(function(e){var n=o.extract(t.concat([r]),e);return jn(n,M.some)}))};switch(e.tag){case"required":return ir(t,n,r,i);case"defaultedThunk":return ar(n,r,e.process,i);case"option":return function(e,t,n){return n(un(e,t))}(n,r,a);case"defaultedOptionThunk":return function(e,t,n,r){return r(un(e,t).map((function(t){return!0===t?n(e):t})))}(n,r,e.process,a);case"mergeWithThunk":return ar(n,r,v({}),(function(t){var r=Kn(e.process(n),t);return i(r)}))}},cr=function(e){return Qt(on(e,d))},sr=function(e){var t=lr(e),n=V(e,(function(e,t){return qn(t,(function(t){var n;return Kn(e,((n={})[t]=!0,n))}),v(e))}),{});return{extract:function(e,r){var o=l(r)?[]:cr(r),i=H(o,(function(e){return!sn(n,e)}));return 0===i.length?t.extract(e,r):function(e,t){return nr(e,(function(){return"There are unsupported fields: ["+t.join(", ")+"] specified"}))}(e,i)},toString:t.toString}},lr=function(e){return{extract:function(t,n){return function(e,t,n){for(var r={},o=[],i=0,a=n;i<a.length;i++){var u=a[i];qn(u,(function(n,i,a,u){var c=ur(a,e,t,n,u);Wn(c,(function(e){o.push.apply(o,e)}),(function(e){r[i]=e}))}),(function(e,n){r[e]=n(t)}))}return o.length>0?Ln(o):In(r)}(t,n,e)},toString:function(){var t=F(e,(function(e){return qn(e,(function(e,t,n,r){return e+" -> "+r.toString()}),(function(e,t){return"state("+e+")"}))}));return"obj{\n"+t.join("\n")+"}"}}},fr=function(e,t){var n=function(t,n){return function(e){return{extract:function(t,n){var r=F(n,(function(n,r){return e.extract(t.concat(["["+r+"]"]),n)}));return er(r)},toString:function(){return"array("+e.toString()+")"}}}(rr(e)).extract(t,n)};return{extract:function(e,r){var o=Qt(r),i=n(e,o);return Hn(i,(function(n){var o=F(n,(function(e){return $n(e,e,{tag:"required",process:{}},t)}));return lr(o).extract(e,r)}))},toString:function(){return"setOf("+t.toString()+")"}}},dr=v(or),mr=(Dn=m,Mn="function",rr((function(e){var t=typeof e;return Dn(e)?In(e):Ln("Expected type: "+Mn+" but got: "+t)}))),gr=function(e,t,n,r){return un(n,r).fold((function(){return function(e,t,n){return nr(e,(function(){return'The chosen schema: "'+n+'" did not exist in branches: '+tr(t)}))}(e,n,r)}),(function(n){return n.extract(e.concat(["branch: "+r]),t)}))},pr=function(e,t){return{extract:function(n,r){return un(r,e).fold((function(){return function(e,t){return nr(e,(function(){return'Choice schema did not contain choice key: "'+t+'"'}))}(n,e)}),(function(e){return gr(n,r,t,e)}))},toString:function(){return"chooseOn("+e+"). Possible values: "+Qt(t)}}},hr=function(e){return rr((function(t){return e(t).fold(Ln,In)}))},vr=function(e,t){return fr((function(t){return Bn(e(t))}),t)},br=function(e,t,n){return Pn(function(e,t,n){var r=t.extract([e],n);return Un(r,(function(e){return{input:n,errors:e}}))}(e,t,n))},yr=function(e){return e.fold((function(e){throw new Error(xr(e))}),b)},wr=function(e,t,n){return yr(br(e,t,n))},xr=function(e){return"Errors: \n"+(t=e.errors,n=t.length>10?t.slice(0,10).concat([{path:[],getErrorInfo:v("... (only showing first ten failures)")}]):t,F(n,(function(e){return"Failed path: ("+e.path.join(" > ")+")\n"+e.getErrorInfo()}))).join("\n")+"\n\nInput object: "+tr(e.input);var t,n},Cr=function(e,t){return pr(e,nn(t,lr))},Sr=$n,kr=function(e,t){return{tag:"custom",newKey:e,instantiator:t}},Tr=function(e){return Sr(e,e,{tag:"required",process:{}},dr())},Or=function(e,t){return Sr(e,e,{tag:"required",process:{}},t)},_r=function(e,t){return Sr(e,e,{tag:"required",process:{}},lr(t))},Er=function(e){return Sr(e,e,{tag:"option",process:{}},dr())},Ar=function(e,t){return Sr(e,e,{tag:"option",process:{}},t)},Dr=function(e,t){return Ar(e,lr(t))},Mr=function(e,t){return Ar(e,sr(t))},Nr=function(e,t){return Sr(e,e,Jn(t),dr())},Rr=function(e,t,n){return Sr(e,e,Jn(t),n)},zr=[Tr("alpha"),Tr("omega")],Br=function(e){if(!c(e))throw new Error("cases must be an array");if(0===e.length)throw new Error("there must be at least one case");var t=[],n={};return L(e,(function(r,o){var i=Qt(r);if(1!==i.length)throw new Error("one and only one name per case");var a=i[0],u=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(!c(u))throw new Error("case arguments must be an array");t.push(a),n[a]=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=n.length;if(i!==u.length)throw new Error("Wrong number of arguments to case "+a+". Expected "+u.length+" ("+u+"), got "+i);var c=function(e){var r=Qt(e);if(t.length!==r.length)throw new Error("Wrong number of arguments to match. Expected: "+t.join(",")+"\nActual: "+r.join(","));if(!G(t,(function(e){return P(r,e)})))throw new Error("Not all branches were specified when using match. Specified: "+r.join(", ")+"\nRequired: "+t.join(", "));return e[a].apply(null,n)};return{fold:function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];if(t.length!==e.length)throw new Error("Wrong number of arguments to fold. Expected "+e.length+", got "+t.length);var i=t[o];return i.apply(null,n)},match:c,log:function(e){console.log(e,{constructors:t,constructor:a,params:n})}}}})),n};Br([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);var Pr,Ir=function(e,t){return function(e,t){var n={};return tn(e,(function(e,r){P(t,r)||(n[r]=e)})),n}(e,t)},Fr=function(e,t){return function(e,t){var n;return(n={})[e]=t,n}(e,t)},Lr=function(e){return function(e){var t={};return L(e,(function(e){t[e.key]=e.value})),t}(e)},Hr=function(e,t){var n,r=function(e){var t=[],n=[];return L(e,(function(e){e.fold((function(e){t.push(e)}),(function(e){n.push(e)}))})),{errors:t,values:n}}(e);return r.errors.length>0?(n=r.errors,An.error($(n))):function(e,t){return 0===e.length?An.value(t):An.value(Kn(t,Xn.apply(void 0,e)))}(r.values,t)},Vr=function(e,t,n){return void 0===n&&(n=y),e.exists((function(e){return n(e,t)}))},jr=function(e){for(var t=[],n=function(e){t.push(e)},r=0;r<e.length;r++)e[r].each(n);return t},Ur=function(e){return m(e)?e:O},Wr=function(e,t,n){var r=t(e),o=Ur(n);return r.orThunk((function(){return o(e)?M.none():function(e,t,n){for(var r=e.dom,o=Ur(n);r.parentNode;){r=r.parentNode;var i=dt.fromDom(r),a=t(i);if(a.isSome())return a;if(o(i))break}return M.none()}(e,t,o)}))},$r=function(e,t){return vt(e.element,t.event.target)},qr={can:_,abort:O,run:p},Gr=function(t){if(!sn(t,"can")&&!sn(t,"abort")&&!sn(t,"run"))throw new Error("EventHandler defined by: "+JSON.stringify(t,null,2)+" does not have can, abort, or run!");return e(e({},qr),t)},Kr=function(e){var t=function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return j(e,(function(e,r){return e&&t(r).apply(void 0,n)}),!0)}}(e,(function(e){return e.can})),n=function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return j(e,(function(e,r){return e||t(r).apply(void 0,n)}),!1)}}(e,(function(e){return e.abort}));return{can:t,abort:n,run:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];L(e,(function(e){e.run.apply(void 0,t)}))}}},Xr=function(e){return Lr(e)},Yr=function(e,t){return{key:e,value:Gr({abort:t})}},Jr=function(e,t){return{key:e,value:Gr({run:t})}},Zr=function(e,t,n){return{key:e,value:Gr({run:function(e,r){t.apply(void 0,[e,r].concat(n))}})}},Qr=function(e){return function(t){return{key:e,value:Gr({run:function(e,n){$r(e,n)&&t(e,n)}})}}},eo=function(e,t,n){return function(e,t){return Jr(e,(function(n,r){n.getSystem().getByUid(t).each((function(t){!function(e,t,n,r){e.getSystem().triggerEvent(n,t,r.event)}(t,t.element,e,r)}))}))}(e,t.partUids[n])},to=function(e){return Jr(e,(function(e,t){t.cut()}))},no=function(e){return Jr(e,(function(e,t){t.stop()}))},ro=function(e,t){return Qr(e)(t)},oo=Qr(tt()),io=Qr(nt()),ao=Qr(et()),uo=function(e){return function(t){return Jr(e,t)}}(Ye()),co=function(e){return F(e,(function(e){return function(e,t,n){return""===t||e.length>=t.length&&e.substr(n,n+t.length)===t}(t=e,n="/*",t.length-n.length)?e.substring(0,e.length-"/*".length):e;var t,n}))},so=function(e,t){var n=e.toString(),r=n.indexOf(")")+1,o=n.indexOf("("),i=n.substring(o+1,r-1).split(/,\s*/);return e.toFunctionAnnotation=function(){return{name:t,parameters:co(i)}},e},lo=function(e){return{classes:f(e.classes)?[]:e.classes,attributes:f(e.attributes)?{}:e.attributes,styles:f(e.styles)?{}:e.styles}},fo=function(e,t,n){return ao((function(r,o){n(r,e,t)}))},mo=function(e,t,n){return function(e,t,n){var r=n.toString(),o=r.indexOf(")")+1,i=r.indexOf("("),a=r.substring(i+1,o-1).split(/,\s*/);return e.toFunctionAnnotation=function(){return{name:t,parameters:co(a.slice(0,1).concat(a.slice(3)))}},e}((function(r){for(var o=[],i=1;i<arguments.length;i++)o[i-1]=arguments[i];var a=[r].concat(o);return r.config({name:v(e)}).fold((function(){throw new Error("We could not find any behaviour configuration for: "+e+". Using API: "+n)}),(function(e){var n=Array.prototype.slice.call(a,1);return t.apply(void 0,[r,e.config,e.state].concat(n))}))}),n,t)},go=function(e){return{key:e,value:void 0}},po=function(t,n,r,o,i,a,u){var c=function(e){return sn(e,r)?e[r]():M.none()},s=nn(i,(function(e,t){return mo(r,e,t)})),l=nn(a,(function(e,t){return so(e,t)})),f=e(e(e({},l),s),{revoke:w(go,r),config:function(e){var n=wr(r+"-config",t,e);return{key:r,value:{config:n,me:f,configAsRaw:N((function(){return wr(r+"-config",t,e)})),initialConfig:e,state:u}}},schema:v(n),exhibit:function(e,t){return(n=c(e),r=un(o,"exhibit"),i=function(e,n){return n(t,e.config,e.state)},n.isSome()&&r.isSome()?M.some(i(n.getOrDie(),r.getOrDie())):M.none()).getOrThunk((function(){return lo({})}));var n,r,i},name:v(r),handlers:function(e){return c(e).map((function(e){return un(o,"events").getOr((function(){return{}}))(e.config,e.state)})).getOr({})}});return f},ho={init:function(){return vo({readState:v("No State required")})}},vo=function(e){return e},bo=function(e){return Lr(e)},yo=sr([Tr("fields"),Tr("name"),Nr("active",{}),Nr("apis",{}),Nr("state",ho),Nr("extra",{})]),wo=function(e){var t=wr("Creating behaviour: "+e.name,yo,e);return function(e,t,n,r,o,i){var a=sr(e),u=Dr(t,[Mr("config",e)]);return po(a,u,t,n,r,o,i)}(t.fields,t.name,t.active,t.apis,t.extra,t.state)},xo=sr([Tr("branchKey"),Tr("branches"),Tr("name"),Nr("active",{}),Nr("apis",{}),Nr("state",ho),Nr("extra",{})]),Co=v(void 0),So=wo({fields:zr,name:"swapping",apis:On}),ko=function(e){var t=e;return{get:function(){return t},set:function(e){t=e}}},To=function(e){return e.dom.focus()},Oo=function(e){return e.dom.blur()},_o=function(e){return void 0===e&&(e=dt.fromDom(document)),M.from(e.dom.activeElement).map(dt.fromDom)},Eo=function(e){return _o(Ht(e)).filter((function(t){return e.dom.contains(t.dom)}))},Ao=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),Do=tinymce.util.Tools.resolve("tinymce.ThemeManager"),Mo=[{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",icon:"bold",format:"bold"},{title:"Italic",icon:"italic",format:"italic"},{title:"Underline",icon:"underline",format:"underline"},{title:"Strikethrough",icon:"strikethrough",format:"strikethrough"},{title:"Superscript",icon:"superscript",format:"superscript"},{title:"Subscript",icon:"subscript",format:"subscript"},{title:"Code",icon:"code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Alignment",items:[{title:"Left",icon:"alignleft",format:"alignleft"},{title:"Center",icon:"aligncenter",format:"aligncenter"},{title:"Right",icon:"alignright",format:"alignright"},{title:"Justify",icon:"alignjustify",format:"alignjustify"}]}],No=["undo","bold","italic","link","image","bullist","styleselect"],Ro="formatChanged",zo="orientationChanged",Bo="dropupDismissed",Po=function(e){return e.dom.innerHTML},Io=function(e,t){var n,r,o=Tt(e).dom,i=dt.fromDom(o.createDocumentFragment()),a=(n=t,(r=(o||document).createElement("div")).innerHTML=n,Et(dt.fromDom(r)));zt(i,a),Bt(e),Rt(e,i)},Fo=function(e){return function(e,t){return dt.fromDom(e.dom.cloneNode(t))}(e,!1)},Lo=function(e){return It(e)?"#shadow-root":function(e){var t=dt.fromTag("div"),n=dt.fromDom(e.dom.cloneNode(!0));return Rt(t,n),Po(t)}(Fo(e))},Ho=function(e){return Lo(e)},Vo=Object.freeze({__proto__:null,events:function(e){return Xr([Jr(Xe(),(function(t,n){var r=e.channels,o=Qt(r),i=n,a=function(e,t){return t.universal?e:H(e,(function(e){return P(t.channels,e)}))}(o,i);L(a,(function(e){var n=r[e],o=n.schema,a=wr("channel["+e+"] data\nReceiver: "+Ho(t.element),o,i.data);n.onReceive(t,a)}))}))])}}),jo="unknown";!function(e){e[e.STOP=0]="STOP",e[e.NORMAL=1]="NORMAL",e[e.LOGGING=2]="LOGGING"}(Pr||(Pr={}));var Uo=ko({}),Wo=function(e,t,n){switch(un(Uo.get(),e).orThunk((function(){var t=Qt(Uo.get());return Z(t,(function(t){return e.indexOf(t)>-1?M.some(Uo.get()[t]):M.none()}))})).getOr(Pr.NORMAL)){case Pr.NORMAL:return n(Go());case Pr.LOGGING:var r=function(e,t){var n=[],r=(new Date).getTime();return{logEventCut:function(e,t,r){n.push({outcome:"cut",target:t,purpose:r})},logEventStopped:function(e,t,r){n.push({outcome:"stopped",target:t,purpose:r})},logNoParent:function(e,t,r){n.push({outcome:"no-parent",target:t,purpose:r})},logEventNoHandlers:function(e,t){n.push({outcome:"no-handlers-left",target:t})},logEventResponse:function(e,t,r){n.push({outcome:"response",purpose:r,target:t})},write:function(){var o=(new Date).getTime();P(["mousemove","mouseover","mouseout",et()],e)||console.log(e,{event:e,time:o-r,target:t.dom,sequence:F(n,(function(e){return P(["cut","stopped","response"],e.outcome)?"{"+e.purpose+"} "+e.outcome+" at ("+Ho(e.target)+")":e.outcome}))})}}}(e,t),o=n(r);return r.write(),o;case Pr.STOP:return!0}},$o=["alloy/data/Fields","alloy/debugging/Debugging"],qo=function(e,t,n){return Wo(e,t,n)},Go=v({logEventCut:p,logEventStopped:p,logNoParent:p,logEventNoHandlers:p,logEventResponse:p,write:p}),Ko=v([Tr("menu"),Tr("selectedMenu")]),Xo=v([Tr("item"),Tr("selectedItem")]);v(lr(Xo().concat(Ko())));var Yo,Jo=v(lr(Xo())),Zo=_r("initSize",[Tr("numColumns"),Tr("numRows")]),Qo=function(e,t,n){return function(){var e=new Error;if(void 0!==e.stack){var t=e.stack.split("\n");return U(t,(function(e){return e.indexOf("alloy")>0&&!I($o,(function(t){return e.indexOf(t)>-1}))})).getOr(jo)}}(),Sr(t,t,n,hr((function(e){return An.value((function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.apply(void 0,t)}))})))},ei=function(e){return Qo(0,e,Jn(p))},ti=function(e){return Qo(0,e,Jn(M.none))},ni=function(e){return Qo(0,e,{tag:"required",process:{}})},ri=function(e){return Qo(0,e,{tag:"required",process:{}})},oi=function(e,t){return kr(e,v(t))},ii=function(e){return kr(e,b)},ai=v(Zo),ui=[Or("channels",vr(An.value,sr([ni("onReceive"),Nr("schema",dr())])))],ci=wo({fields:ui,name:"receiving",active:Vo}),si=function(e,t,n){var r=t.aria;r.update(e,r,n.get())},li=function(e,t,n){t.toggleClass.each((function(t){n.get()?xn(e.element,t):Sn(e.element,t)}))},fi=function(e,t,n){gi(e,t,n,!n.get())},di=function(e,t,n){n.set(!0),li(e,t,n),si(e,t,n)},mi=function(e,t,n){n.set(!1),li(e,t,n),si(e,t,n)},gi=function(e,t,n,r){(r?di:mi)(e,t,n)},pi=function(e,t,n){gi(e,t,n,t.selected)},hi=Object.freeze({__proto__:null,onLoad:pi,toggle:fi,isOn:function(e,t,n){return n.get()},on:di,off:mi,set:gi}),vi=Object.freeze({__proto__:null,exhibit:function(){return lo({})},events:function(e,t){var n,r,o,i=(n=e,r=t,o=fi,uo((function(e){o(e,n,r)}))),a=fo(e,t,pi);return Xr($([e.toggleOnExecute?[i]:[],[a]]))}}),bi=function(e,t,n){fn(e.element,"aria-expanded",n)},yi=[Nr("selected",!1),Er("toggleClass"),Nr("toggleOnExecute",!0),Rr("aria",{mode:"none"},Cr("mode",{pressed:[Nr("syncWithExpanded",!1),oi("update",(function(e,t,n){fn(e.element,"aria-pressed",n),t.syncWithExpanded&&bi(e,t,n)}))],checked:[oi("update",(function(e,t,n){fn(e.element,"aria-checked",n)}))],expanded:[oi("update",bi)],selected:[oi("update",(function(e,t,n){fn(e.element,"aria-selected",n)}))],none:[oi("update",p)]}))],wi=wo({fields:yi,name:"toggling",active:vi,apis:hi,state:(Yo=!1,{init:function(){var e=ko(Yo);return{get:function(){return e.get()},set:function(t){return e.set(t)},clear:function(){return e.set(Yo)},readState:function(){return e.get()}}}})}),xi=function(e,t){return ci.config({channels:Fr(Ro,{onReceive:function(n,r){r.command===e&&t(n,r.state)}})})},Ci=function(e){return ci.config({channels:Fr(zo,{onReceive:e})})},Si=function(e,t){return{key:e,value:{onReceive:t}}},ki="tinymce-mobile",Ti=function(e){return ki+"-"+e},Oi=function(){var e=function(e,t){t.stop(),ct(e)};return[Jr(Ve(),e),Jr(Ze(),e),to(De()),to(Re())]},_i=function(e,t){t.ignore||(To(e.element),t.onFocus(e))},Ei=Object.freeze({__proto__:null,focus:_i,blur:function(e,t){t.ignore||Oo(e.element)},isFocused:function(e){return function(e){var t=Ht(e).dom;return e.dom===t.activeElement}(e.element)}}),Ai=Object.freeze({__proto__:null,exhibit:function(e,t){var n=t.ignore?{}:{attributes:{tabindex:"-1"}};return lo(n)},events:function(e){return Xr([Jr(qe(),(function(t,n){_i(t,e),n.stop()}))].concat(e.stopMousedown?[Jr(Re(),(function(e,t){t.event.prevent()}))]:[]))}}),Di=[ei("onFocus"),Nr("stopMousedown",!1),Nr("ignore",!1)],Mi=wo({fields:Di,name:"focusing",active:Ai,apis:Ei}),Ni=function(e){return void 0!==e.style&&m(e.style.getPropertyValue)},Ri=function(e,t,n){if(!a(n))throw console.error("Invalid call to CSS.set. Property ",t,":: Value ",n,":: Element ",e),new Error("CSS value must be a string: "+n);Ni(e)&&e.style.setProperty(t,n)},zi=function(e,t,n){var r=e.dom;Ri(r,t,n)},Bi=function(e,t){var n=e.dom;tn(t,(function(e,t){Ri(n,t,e)}))},Pi=function(e,t){var n=e.dom,r=window.getComputedStyle(n).getPropertyValue(t);return""!==r||Ut(e)?r:Ii(n,t)},Ii=function(e,t){return Ni(e)?e.style.getPropertyValue(t):""},Fi=function(e,t){var n=e.dom,r=Ii(n,t);return M.from(r).filter((function(e){return e.length>0}))},Li=function(e,t){!function(e,t){Ni(e)&&e.style.removeProperty(t)}(e.dom,t),Vr(gn(e,"style").map(oe),"")&&hn(e,"style")},Hi=function(e){return e.dom.offsetWidth},Vi=function(e,t){var n=function(n){var r=t(n);if(r<=0||null===r){var o=Pi(n,e);return parseFloat(o)||0}return r},r=function(e,t){return j(t,(function(t,n){var r=Pi(e,n),o=void 0===r?0:parseInt(r,10);return isNaN(o)?t:t+o}),0)};return{set:function(t,n){if(!g(n)&&!n.match(/^[0-9]+$/))throw new Error(e+".set accepts only positive integer values. Value was "+n);var r=t.dom;Ni(r)&&(r.style[e]=n+"px")},get:n,getOuter:n,aggregate:r,max:function(e,t,n){var o=r(e,n);return t>o?t-o:0}}},ji=Vi("height",(function(e){var t=e.dom;return Ut(e)?t.getBoundingClientRect().height:t.offsetHeight})),Ui=function(e){return ji.get(e)},Wi=function(e,t,n){return H(function(e,t){for(var n=m(t)?t:O,r=e.dom,o=[];null!==r.parentNode&&void 0!==r.parentNode;){var i=r.parentNode,a=dt.fromDom(i);if(o.push(a),!0===n(a))break;r=i}return o}(e,n),t)},$i=function(e,t){return H(function(e){return _t(e).map(Et).map((function(t){return H(t,(function(t){return!vt(e,t)}))})).getOr([])}(e),t)},qi=function(e,t,n){return Wi(e,(function(e){return mt(e,t)}),n)},Gi=function(e,t){return $i(e,(function(e){return mt(e,t)}))},Ki=function(e,t){return pt(t,e)};function Xi(e,t,n,r,o){return e(n,r)?M.some(n):m(o)&&o(n)?M.none():t(n,r,o)}var Yi,Ji=function(e,t,n){for(var r=e.dom,o=m(n)?n:O;r.parentNode;){r=r.parentNode;var i=dt.fromDom(r);if(t(i))return M.some(i);if(o(i))break}return M.none()},Zi=function(e){return ht(e)},Qi=function(e,t,n){return Ji(e,(function(e){return mt(e,t)}),n)},ea=function(e,t){return ht(t,e)},ta=function(e,t,n){return Xi((function(e,t){return mt(e,t)}),Qi,e,t,n)},na=[8],ra=[9],oa=[13],ia=[27],aa=[32],ua=[37],ca=[38],sa=[39],la=[40],fa=function(e,t,n){var r=K(e.slice(0,t)),o=K(e.slice(t+1));return U(r.concat(o),n)},da=function(e,t,n){var r=K(e.slice(0,t));return U(r,n)},ma=function(e,t,n){var r=e.slice(0,t),o=e.slice(t+1);return U(o.concat(r),n)},ga=function(e,t,n){var r=e.slice(t+1);return U(r,n)},pa=function(e){return function(t){var n=t.raw;return P(e,n.which)}},ha=function(e){return function(t){return G(e,(function(e){return e(t)}))}},va=function(e){return!0===e.raw.shiftKey},ba=function(e){return!0===e.raw.ctrlKey},ya=S(va),wa=function(e,t){return{matches:e,classification:t}},xa=function(e,t,n,r){var o=e+t;return o>r?n:o<n?r:o},Ca=function(e,t,n){return Math.min(Math.max(e,t),n)},Sa=function(e,t,n,r){var o=Ki(e.element,"."+t.highlightClass);L(o,(function(n){I(r,(function(e){return e.element===n}))||(Sn(n,t.highlightClass),e.getSystem().getByDom(n).each((function(n){t.onDehighlight(e,n),at(n,it())})))}))},ka=function(e,t,n,r){Sa(e,t,0,[r]),Ta(e,t,n,r)||(xn(r.element,t.highlightClass),t.onHighlight(e,r),at(r,ot()))},Ta=function(e,t,n,r){return kn(r.element,t.highlightClass)},Oa=function(e,t,n,r){var o=Ki(e.element,"."+t.itemClass);return M.from(o[r]).fold((function(){return An.error(new Error("No element found with index "+r))}),e.getSystem().getByDom)},_a=function(e,t,n){return ea(e.element,"."+t.itemClass).bind((function(t){return e.getSystem().getByDom(t).toOptional()}))},Ea=function(e,t,n){var r=Ki(e.element,"."+t.itemClass);return(r.length>0?M.some(r[r.length-1]):M.none()).bind((function(t){return e.getSystem().getByDom(t).toOptional()}))},Aa=function(e,t,n,r){var o=Ki(e.element,"."+t.itemClass);return W(o,(function(e){return kn(e,t.highlightClass)})).bind((function(t){var n=xa(t,r,0,o.length-1);return e.getSystem().getByDom(o[n]).toOptional()}))},Da=function(e,t,n){var r=Ki(e.element,"."+t.itemClass);return jr(F(r,(function(t){return e.getSystem().getByDom(t).toOptional()})))},Ma=Object.freeze({__proto__:null,dehighlightAll:function(e,t,n){return Sa(e,t,0,[])},dehighlight:function(e,t,n,r){Ta(e,t,n,r)&&(Sn(r.element,t.highlightClass),t.onDehighlight(e,r),at(r,it()))},highlight:ka,highlightFirst:function(e,t,n){_a(e,t).each((function(r){ka(e,t,n,r)}))},highlightLast:function(e,t,n){Ea(e,t).each((function(r){ka(e,t,n,r)}))},highlightAt:function(e,t,n,r){Oa(e,t,n,r).fold((function(e){throw e}),(function(r){ka(e,t,n,r)}))},highlightBy:function(e,t,n,r){var o=Da(e,t);U(o,r).each((function(r){ka(e,t,n,r)}))},isHighlighted:Ta,getHighlighted:function(e,t,n){return ea(e.element,"."+t.highlightClass).bind((function(t){return e.getSystem().getByDom(t).toOptional()}))},getFirst:_a,getLast:Ea,getPrevious:function(e,t,n){return Aa(e,t,0,-1)},getNext:function(e,t,n){return Aa(e,t,0,1)},getCandidates:Da}),Na=[Tr("highlightClass"),Tr("itemClass"),ei("onHighlight"),ei("onDehighlight")],Ra=wo({fields:Na,name:"highlighting",apis:Ma}),za=function(e,t,n){t.exists((function(e){return n.exists((function(t){return vt(t,e)}))}))||ut(e,rt(),{prevFocus:t,newFocus:n})},Ba=function(){var e=function(e){return Eo(e.element)};return{get:e,set:function(t,n){var r=e(t);t.getSystem().triggerFocus(n,t.element);var o=e(t);za(t,r,o)}}},Pa=function(){var e=function(e){return Ra.getHighlighted(e).map((function(e){return e.element}))};return{get:e,set:function(t,n){var r=e(t);t.getSystem().getByDom(n).fold(p,(function(e){Ra.highlight(t,e)}));var o=e(t);za(t,r,o)}}};!function(e){e.OnFocusMode="onFocus",e.OnEnterOrSpaceMode="onEnterOrSpace",e.OnApiMode="onApi"}(Yi||(Yi={}));var Ia=function(e,t,n,r,o){var i=function(e,t,n,r,o){var i,a,u,c=n(e,t,r,o);return(i=c,a=t.event,u=U(i,(function(e){return e.matches(a)})),u.map((function(e){return e.classification}))).bind((function(n){return n(e,t,r,o)}))},a={schema:function(){return e.concat([Nr("focusManager",Ba()),Rr("focusInside","onFocus",hr((function(e){return P(["onFocus","onEnterOrSpace","onApi"],e)?An.value(e):An.error("Invalid value for focusInside")}))),oi("handler",a),oi("state",t),oi("sendFocusIn",o)])},processKey:i,toEvents:function(e,t){var a=e.focusInside!==Yi.OnFocusMode?M.none():o(e).map((function(n){return Jr(qe(),(function(r,o){n(r,e,t),o.stop()}))})),u=[Jr(Ie(),(function(r,a){i(r,a,n,e,t).fold((function(){!function(n,r){var i=pa(aa.concat(oa))(r.event);e.focusInside===Yi.OnEnterOrSpaceMode&&i&&$r(n,r)&&o(e).each((function(o){o(n,e,t),r.stop()}))}(r,a)}),(function(e){a.stop()}))})),Jr(Fe(),(function(n,o){i(n,o,r,e,t).each((function(e){o.stop()}))}))];return Xr(a.toArray().concat(u))}};return a},Fa=function(e){var t=[Er("onEscape"),Er("onEnter"),Nr("selector",'[data-alloy-tabstop="true"]:not(:disabled)'),Nr("firstTabstop",0),Nr("useTabstopAt",_),Er("visibilitySelector")].concat([e]),n=function(e,t){var n=e.visibilitySelector.bind((function(e){return ta(t,e)})).getOr(t);return Ui(n)>0},r=function(e,t,r){(function(e,t){var r=Ki(e.element,t.selector),o=H(r,(function(e){return n(t,e)}));return M.from(o[t.firstTabstop])})(e,t).each((function(n){t.focusManager.set(e,n)}))},o=function(e,t,r,o,i){return i(t,r,(function(e){return function(e,t){return n(e,t)&&e.useTabstopAt(t)}(o,e)})).fold((function(){return o.cyclic?M.some(!0):M.none()}),(function(t){return o.focusManager.set(e,t),M.some(!0)}))},i=function(e,t,n,r){var i=Ki(e.element,n.selector);return function(e,t){return t.focusManager.get(e).bind((function(e){return ta(e,t.selector)}))}(e,n).bind((function(t){return W(i,w(vt,t)).bind((function(t){return o(e,i,t,n,r)}))}))},a=v([wa(ha([va,pa(ra)]),(function(e,t,n){var r=n.cyclic?fa:da;return i(e,0,n,r)})),wa(pa(ra),(function(e,t,n){var r=n.cyclic?ma:ga;return i(e,0,n,r)})),wa(pa(ia),(function(e,t,n){return n.onEscape.bind((function(n){return n(e,t)}))})),wa(ha([ya,pa(oa)]),(function(e,t,n){return n.onEnter.bind((function(n){return n(e,t)}))}))]),u=v([]);return Ia(t,ho.init,a,u,(function(){return M.some(r)}))},La=Fa(kr("cyclic",O)),Ha=Fa(kr("cyclic",_)),Va=function(e){return"input"===yt(e)&&"radio"!==mn(e,"type")||"textarea"===yt(e)},ja=function(e,t,n){return Va(n)&&pa(aa)(t.event)?M.none():function(e,t,n){return st(e,n,Ye()),M.some(!0)}(e,0,n)},Ua=function(e,t){return M.some(!0)},Wa=[Nr("execute",ja),Nr("useSpace",!1),Nr("useEnter",!0),Nr("useControlEnter",!1),Nr("useDown",!1)],$a=function(e,t,n){return n.execute(e,t,e.element)},qa=Ia(Wa,ho.init,(function(e,t,n,r){var o=n.useSpace&&!Va(e.element)?aa:[],i=n.useEnter?oa:[],a=n.useDown?la:[],u=o.concat(i).concat(a);return[wa(pa(u),$a)].concat(n.useControlEnter?[wa(ha([ba,pa(oa)]),$a)]:[])}),(function(e,t,n,r){return n.useSpace&&!Va(e.element)?[wa(pa(aa),Ua)]:[]}),(function(){return M.none()})),Ga=function(e){var t=ko(M.none()),n=function(){return t.get().each(e)};return{clear:function(){n(),t.set(M.none())},isSet:function(){return t.get().isSome()},get:function(){return t.get()},set:function(e){n(),t.set(M.some(e))}}},Ka=function(){var t=Ga((function(e){return e.destroy()}));return e(e({},t),{run:function(e){return t.get().each(e)}})},Xa=function(){var t=Ga(p);return e(e({},t),{on:function(e){return t.get().each(e)}})},Ya=function(){var e=Xa();return vo({readState:function(){return e.get().map((function(e){return{numRows:String(e.numRows),numColumns:String(e.numColumns)}})).getOr({numRows:"?",numColumns:"?"})},setGridSize:function(t,n){e.set({numRows:t,numColumns:n})},getNumRows:function(){return e.get().map((function(e){return e.numRows}))},getNumColumns:function(){return e.get().map((function(e){return e.numColumns}))}})},Ja=Object.freeze({__proto__:null,flatgrid:Ya,init:function(e){return e.state(e)}}),Za=function(e,t){return function(n){return"rtl"===Qa(n)?t:e}},Qa=function(e){return"rtl"===Pi(e,"direction")?"rtl":"ltr"},eu=function(e){return function(t,n,r,o){var i=e(t.element);return ou(i,t,n,r,o)}},tu=function(e,t){var n=Za(e,t);return eu(n)},nu=function(e,t){var n=Za(t,e);return eu(n)},ru=function(e){return function(t,n,r,o){return ou(e,t,n,r,o)}},ou=function(e,t,n,r,o){return r.focusManager.get(t).bind((function(n){return e(t.element,n,r,o)})).map((function(e){return r.focusManager.set(t,e),!0}))},iu=ru,au=ru,uu=ru,cu=function(e){return!function(e){return e.offsetWidth<=0&&e.offsetHeight<=0}(e.dom)},su=function(e,t,n){var r=Ki(e,n);return function(e,t){return W(e,t).map((function(t){return{index:t,candidates:e}}))}(H(r,cu),(function(e){return vt(e,t)}))},lu=function(e,t){return W(e,(function(e){return vt(t,e)}))},fu=function(e,t,n,r){return r(Math.floor(t/n),t%n).bind((function(t){var r=t.row*n+t.column;return r>=0&&r<e.length?M.some(e[r]):M.none()}))},du=function(e,t,n,r,o){return fu(e,t,r,(function(t,i){var a=t===n-1?e.length-t*r:r,u=xa(i,o,0,a-1);return M.some({row:t,column:u})}))},mu=function(e,t,n,r,o){return fu(e,t,r,(function(t,i){var a=xa(t,o,0,n-1),u=a===n-1?e.length-a*r:r,c=Ca(i,0,u-1);return M.some({row:a,column:c})}))},gu=[Tr("selector"),Nr("execute",ja),ti("onEscape"),Nr("captureTab",!1),ai()],pu=function(e,t,n){ea(e.element,t.selector).each((function(n){t.focusManager.set(e,n)}))},hu=function(e){return function(t,n,r,o){return su(t,n,r.selector).bind((function(t){return e(t.candidates,t.index,o.getNumRows().getOr(r.initSize.numRows),o.getNumColumns().getOr(r.initSize.numColumns))}))}},vu=function(e,t,n){return n.captureTab?M.some(!0):M.none()},bu=hu((function(e,t,n,r){return du(e,t,n,r,-1)})),yu=hu((function(e,t,n,r){return du(e,t,n,r,1)})),wu=hu((function(e,t,n,r){return mu(e,t,n,r,-1)})),xu=hu((function(e,t,n,r){return mu(e,t,n,r,1)})),Cu=v([wa(pa(ua),tu(bu,yu)),wa(pa(sa),nu(bu,yu)),wa(pa(ca),iu(wu)),wa(pa(la),au(xu)),wa(ha([va,pa(ra)]),vu),wa(ha([ya,pa(ra)]),vu),wa(pa(ia),(function(e,t,n){return n.onEscape(e,t)})),wa(pa(aa.concat(oa)),(function(e,t,n,r){return function(e,t){return t.focusManager.get(e).bind((function(e){return ta(e,t.selector)}))}(e,n).bind((function(r){return n.execute(e,t,r)}))}))]),Su=v([wa(pa(aa),Ua)]),ku=Ia(gu,Ya,Cu,Su,(function(){return M.some(pu)})),Tu=function(e,t,n,r){var o=function(e,t,n){var i,a=xa(t,r,0,n.length-1);return a===e?M.none():(i=n[a],"button"===yt(i)&&"disabled"===mn(i,"disabled")?o(e,a,n):M.from(n[a]))};return su(e,n,t).bind((function(e){var t=e.index,n=e.candidates;return o(t,t,n)}))},Ou=[Tr("selector"),Nr("getInitial",M.none),Nr("execute",ja),ti("onEscape"),Nr("executeOnMove",!1),Nr("allowVertical",!0)],_u=function(e,t,n){return function(e,t){return t.focusManager.get(e).bind((function(e){return ta(e,t.selector)}))}(e,n).bind((function(r){return n.execute(e,t,r)}))},Eu=function(e,t,n){t.getInitial(e).orThunk((function(){return ea(e.element,t.selector)})).each((function(n){t.focusManager.set(e,n)}))},Au=function(e,t,n){return Tu(e,n.selector,t,-1)},Du=function(e,t,n){return Tu(e,n.selector,t,1)},Mu=function(e){return function(t,n,r,o){return e(t,n,r,o).bind((function(){return r.executeOnMove?_u(t,n,r):M.some(!0)}))}},Nu=function(e,t,n){return n.onEscape(e,t)},Ru=v([wa(pa(aa),Ua)]),zu=Ia(Ou,ho.init,(function(e,t,n,r){var o=ua.concat(n.allowVertical?ca:[]),i=sa.concat(n.allowVertical?la:[]);return[wa(pa(o),Mu(tu(Au,Du))),wa(pa(i),Mu(nu(Au,Du))),wa(pa(oa),_u),wa(pa(aa),_u),wa(pa(ia),Nu)]}),Ru,(function(){return M.some(Eu)})),Bu=function(e,t,n){return M.from(e[t]).bind((function(e){return M.from(e[n]).map((function(e){return{rowIndex:t,columnIndex:n,cell:e}}))}))},Pu=function(e,t,n,r){var o=e[t].length,i=xa(n,r,0,o-1);return Bu(e,t,i)},Iu=function(e,t,n,r){var o=xa(n,r,0,e.length-1),i=e[o].length,a=Ca(t,0,i-1);return Bu(e,o,a)},Fu=function(e,t,n,r){var o=e[t].length,i=Ca(n+r,0,o-1);return Bu(e,t,i)},Lu=function(e,t,n,r){var o=Ca(n+r,0,e.length-1),i=e[o].length,a=Ca(t,0,i-1);return Bu(e,o,a)},Hu=[_r("selectors",[Tr("row"),Tr("cell")]),Nr("cycles",!0),Nr("previousSelector",M.none),Nr("execute",ja)],Vu=function(e,t,n){t.previousSelector(e).orThunk((function(){var n=t.selectors;return ea(e.element,n.cell)})).each((function(n){t.focusManager.set(e,n)}))},ju=function(e,t){return function(n,r,o){var i=o.cycles?e:t;return ta(r,o.selectors.row).bind((function(e){var t=Ki(e,o.selectors.cell);return lu(t,r).bind((function(t){var r=Ki(n,o.selectors.row);return lu(r,e).bind((function(e){var n=function(e,t){return F(e,(function(e){return Ki(e,t.selectors.cell)}))}(r,o);return i(n,e,t).map((function(e){return e.cell}))}))}))}))}},Uu=ju((function(e,t,n){return Pu(e,t,n,-1)}),(function(e,t,n){return Fu(e,t,n,-1)})),Wu=ju((function(e,t,n){return Pu(e,t,n,1)}),(function(e,t,n){return Fu(e,t,n,1)})),$u=ju((function(e,t,n){return Iu(e,n,t,-1)}),(function(e,t,n){return Lu(e,n,t,-1)})),qu=ju((function(e,t,n){return Iu(e,n,t,1)}),(function(e,t,n){return Lu(e,n,t,1)})),Gu=v([wa(pa(ua),tu(Uu,Wu)),wa(pa(sa),nu(Uu,Wu)),wa(pa(ca),iu($u)),wa(pa(la),au(qu)),wa(pa(aa.concat(oa)),(function(e,t,n){return Eo(e.element).bind((function(r){return n.execute(e,t,r)}))}))]),Ku=v([wa(pa(aa),Ua)]),Xu=Ia(Hu,ho.init,Gu,Ku,(function(){return M.some(Vu)})),Yu=[Tr("selector"),Nr("execute",ja),Nr("moveOnTab",!1)],Ju=function(e,t,n){return n.focusManager.get(e).bind((function(r){return n.execute(e,t,r)}))},Zu=function(e,t,n){ea(e.element,t.selector).each((function(n){t.focusManager.set(e,n)}))},Qu=function(e,t,n){return Tu(e,n.selector,t,-1)},ec=function(e,t,n){return Tu(e,n.selector,t,1)},tc=v([wa(pa(ca),uu(Qu)),wa(pa(la),uu(ec)),wa(ha([va,pa(ra)]),(function(e,t,n,r){return n.moveOnTab?uu(Qu)(e,t,n,r):M.none()})),wa(ha([ya,pa(ra)]),(function(e,t,n,r){return n.moveOnTab?uu(ec)(e,t,n,r):M.none()})),wa(pa(oa),Ju),wa(pa(aa),Ju)]),nc=v([wa(pa(aa),Ua)]),rc=Ia(Yu,ho.init,tc,nc,(function(){return M.some(Zu)})),oc=[ti("onSpace"),ti("onEnter"),ti("onShiftEnter"),ti("onLeft"),ti("onRight"),ti("onTab"),ti("onShiftTab"),ti("onUp"),ti("onDown"),ti("onEscape"),Nr("stopSpaceKeyup",!1),Er("focusIn")],ic=Ia(oc,ho.init,(function(e,t,n){return[wa(pa(aa),n.onSpace),wa(ha([ya,pa(oa)]),n.onEnter),wa(ha([va,pa(oa)]),n.onShiftEnter),wa(ha([va,pa(ra)]),n.onShiftTab),wa(ha([ya,pa(ra)]),n.onTab),wa(pa(ca),n.onUp),wa(pa(la),n.onDown),wa(pa(ua),n.onLeft),wa(pa(sa),n.onRight),wa(pa(aa),n.onSpace),wa(pa(ia),n.onEscape)]}),(function(e,t,n){return n.stopSpaceKeyup?[wa(pa(aa),Ua)]:[]}),(function(e){return e.focusIn})),ac=La.schema(),uc=Ha.schema(),cc=zu.schema(),sc=ku.schema(),lc=Xu.schema(),fc=qa.schema(),dc=rc.schema(),mc=ic.schema(),gc=function(e){var t=wr("Creating behaviour: "+e.name,xo,e);return function(e,t,n,r,o,i){var a=e,u=Dr(t,[Ar("config",e)]);return po(a,u,t,n,r,o,i)}(Cr(t.branchKey,t.branches),t.name,t.active,t.apis,t.extra,t.state)}({branchKey:"mode",branches:Object.freeze({__proto__:null,acyclic:ac,cyclic:uc,flow:cc,flatgrid:sc,matrix:lc,execution:fc,menu:dc,special:mc}),name:"keying",active:{events:function(e,t){return e.handler.toEvents(e,t)}},apis:{focusIn:function(e,t,n){t.sendFocusIn(t).fold((function(){e.getSystem().triggerFocus(e.element,e.element)}),(function(r){r(e,t,n)}))},setGridSize:function(e,t,n,r,o){!function(e){return sn(e,"setGridSize")}(n)?console.error("Layout does not support setGridSize"):n.setGridSize(r,o)}},state:Ja}),pc=function(e,t){return n=e,r={},o=F(t,(function(t){return n=t.name(),r="Cannot configure "+t.name()+" for "+e,Sr(n,n,{tag:"option",process:{}},rr((function(e){return Ln("The field: "+n+" is forbidden. "+r)})));var n,r})).concat([kr("dump",b)]),Rr(n,r,lr(o));var n,r,o},hc=function(e){return e.dump},vc=function(t,n){return e(e({},bo(n)),t.dump)},bc=pc,yc=vc,wc="placeholder",xc=Br([{single:["required","valueThunk"]},{multiple:["required","valueThunks"]}]),Cc=function(e){return cn(e,"uiType")},Sc=function(e,t,n,r){return Cc(n)&&n.uiType===wc?function(e,t,n,r){return e.exists((function(e){return e!==n.owner}))?xc.single(!0,v(n)):un(r,n.name).fold((function(){throw new Error("Unknown placeholder component: "+n.name+"\nKnown: ["+Qt(r)+"]\nNamespace: "+e.getOr("none")+"\nSpec: "+JSON.stringify(n,null,2))}),(function(e){return e.replace()}))}(e,0,n,r):xc.single(!1,v(n))},kc=function(t,n,r,o){return Sc(t,0,r,o).fold((function(i,a){var u=Cc(r)?a(n,r.config,r.validated):a(n),c=un(u,"components").getOr([]),s=q(c,(function(e){return kc(t,n,e,o)}));return[e(e({},u),{components:s})]}),(function(e,t){if(Cc(r)){var o=t(n,r.config,r.validated);return r.validated.preprocess.getOr(b)(o)}return t(n)}))},Tc=function(e,t,n,r){var o=nn(r,(function(e,t){return r=e,o=!1,{name:v(n=t),required:function(){return r.fold((function(e,t){return e}),(function(e,t){return e}))},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(e,t,n,r){return q(n,(function(n){return kc(e,t,n,r)}))}(e,t,n,o);return tn(o,(function(n){if(!1===n.used()&&n.required())throw new Error("Placeholder: "+n.name()+" was not found in components list\nNamespace: "+e.getOr("none")+"\nComponents: "+JSON.stringify(t.components,null,2))})),i},Oc=xc.single,_c=xc.multiple,Ec=v(wc),Ac=0,Dc=function(e){var t=(new Date).getTime();return e+"_"+Math.floor(1e9*Math.random())+ ++Ac+String(t)},Mc=Br([{required:["data"]},{external:["data"]},{optional:["data"]},{group:["data"]}]),Nc=Nr("factory",{sketch:b}),Rc=Nr("schema",[]),zc=Tr("name"),Bc=Sr("pname","pname",Yn((function(e){return"<alloy."+Dc(e.name)+">"})),dr()),Pc=kr("schema",(function(){return[Er("preprocess")]})),Ic=Nr("defaults",v({})),Fc=Nr("overrides",v({})),Lc=lr([Nc,Rc,zc,Bc,Ic,Fc]),Hc=lr([Nc,Rc,zc,Ic,Fc]),Vc=lr([Nc,Rc,zc,Bc,Ic,Fc]),jc=lr([Nc,Pc,zc,Tr("unit"),Bc,Ic,Fc]),Uc=function(e){var t=function(e){return e.name};return e.fold(t,t,t,t)},Wc=function(e,t){return function(n){var r=wr("Converting part type",t,n);return e(r)}},$c=Wc(Mc.required,Lc);Wc(Mc.external,Hc);var qc=Wc(Mc.optional,Vc),Gc=Wc(Mc.group,jc),Kc=v("entirety"),Xc=function(e,t,n,r){return Kn(t.defaults(e,n,r),n,{uid:e.partUids[t.name]},t.overrides(e,n,r))},Yc=function(t,n){var r={};return L(n,(function(n){(function(e){return e.fold(M.some,M.none,M.some,M.some)})(n).each((function(n){var o=Jc(t,n.pname);r[n.name]=function(r){var i=wr("Part: "+n.name+" in "+t,lr(n.schema),r);return e(e({},o),{config:r,validated:i})}}))})),r},Jc=function(e,t){return{uiType:Ec(),owner:e,name:t}},Zc=function(e,t,n){return function(e,t,n){var r={},o={};return L(n,(function(e){e.fold((function(e){r[e.pname]=Oc(!0,(function(t,n,r){return e.factory.sketch(Xc(t,e,n,r))}))}),(function(e){var n=t.parts[e.name];o[e.name]=v(e.factory.sketch(Xc(t,e,n[Kc()]),n))}),(function(e){r[e.pname]=Oc(!1,(function(t,n,r){return e.factory.sketch(Xc(t,e,n,r))}))}),(function(e){r[e.pname]=_c(!0,(function(t,n,r){var o=t[e.name];return F(o,(function(n){return e.factory.sketch(Kn(e.defaults(t,n,r),n,e.overrides(t,n)))}))}))}))})),{internals:v(r),externals:v(o)}}(0,t,n)},Qc=function(e,t,n){return Tc(M.some(e),t,t.components,n)},es=function(e,t,n){var r=t.partUids[n];return e.getSystem().getByUid(r).toOptional()},ts=function(e,t,n){return es(e,t,n).getOrDie("Could not find part: "+n)},ns=function(e,t){var n=function(e){return F(e,Uc)}(t);return Lr(F(n,(function(t){return{key:t,value:e+"-"+t}})))},rs=function(e){return Sr("partUids","partUids",Zn((function(t){return ns(t.uid,e)})),dr())},os=Dc("alloy-premade"),is=function(e){return Fr(os,e)},as=function(e){return function(e,t){var n=t.toString(),r=n.indexOf(")")+1,o=n.indexOf("("),i=n.substring(o+1,r-1).split(/,\s*/);return e.toFunctionAnnotation=function(){return{name:"OVERRIDE",parameters:co(i.slice(1))}},e}((function(t){for(var r=[],o=1;o<arguments.length;o++)r[o-1]=arguments[o];return e.apply(void 0,n([t.getApis(),t],r,!1))}),e)},us=v("alloy-id-"),cs=v("data-alloy-id"),ss=us(),ls=cs(),fs=function(e,t){Object.defineProperty(e.dom,ls,{value:t,writable:!0})},ds=function(e){var t=xt(e)?e.dom[ls]:null;return M.from(t)},ms=function(e){return Dc(e)},gs=function(e,t,n,r,o){var i=function(e,t){return(e.length>0?[_r("parts",e)]:[]).concat([Tr("uid"),Nr("dom",{}),Nr("components",[]),ii("originalSpec"),Nr("debug.sketcher",{})]).concat(t)}(r,o);return wr(e+" [SpecSchema]",sr(i.concat(t)),n)},ps=function(e,t,n,r,o){var i=hs(o),a=function(e){return q(e,(function(e){return e.fold(M.none,M.some,M.none,M.none).map((function(e){return _r(e.name,e.schema.concat([ii(Kc())]))})).toArray()}))}(n),u=rs(n),c=gs(e,t,i,a,[u]),s=Zc(0,c,n);return r(c,Qc(e,c,s.internals()),i,s.externals())},hs=function(t){return function(e){return cn(e,"uid")}(t)?t:e(e({},t),{uid:ms("uid")})},vs=sr([Tr("name"),Tr("factory"),Tr("configFields"),Nr("apis",{}),Nr("extraApis",{})]),bs=sr([Tr("name"),Tr("factory"),Tr("configFields"),Tr("partFields"),Nr("apis",{}),Nr("extraApis",{})]),ys=function(t){var n=wr("Sketcher for "+t.name,vs,t),r=nn(n.apis,as),o=nn(n.extraApis,(function(e,t){return so(e,t)}));return e(e({name:n.name,configFields:n.configFields,sketch:function(e){return function(e,t,n,r){var o=hs(r);return n(gs(e,t,o,[],[]),o)}(n.name,n.configFields,n.factory,e)}},r),o)},ws=function(t){var n=wr("Sketcher for "+t.name,bs,t),r=Yc(n.name,n.partFields),o=nn(n.apis,as),i=nn(n.extraApis,(function(e,t){return so(e,t)}));return e(e({name:n.name,partFields:n.partFields,configFields:n.configFields,sketch:function(e){return ps(n.name,n.configFields,n.partFields,n.factory,e)},parts:r},o),i)},xs=ys({name:"Button",factory:function(t){var n,r=(n=t.action,Xr($([n.map((function(e){return uo((function(t,n){e(t),n.stop()}))})).toArray(),Oi()]))),o=t.dom.tag,i=function(e){return un(t.dom,"attributes").bind((function(t){return un(t,e)}))};return{uid:t.uid,dom:t.dom,components:t.components,events:r,behaviours:yc(t.buttonBehaviours,[Mi.config({}),gc.config({mode:"execution",useSpace:!0,useEnter:!0})]),domModification:{attributes:function(){if("button"===o){var t=i("type").getOr("button"),n=i("role").map((function(e){return{role:e}})).getOr({});return e({type:t},n)}return{role:i("role").getOr("button")}}()},eventOrder:t.eventOrder}},configFields:[Nr("uid",void 0),Tr("dom"),Nr("components",[]),bc("buttonBehaviours",[Mi,gc]),Er("action"),Er("role"),Nr("eventOrder",{})]}),Cs=Object.freeze({__proto__:null,events:function(){return Xr([Yr(Ue(),_)])},exhibit:function(){return lo({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})}}),Ss=wo({fields:[],name:"unselecting",active:Cs}),ks=function(t){var n=dt.fromHtml(t),r=Et(n),o=function(t){var n=void 0!==t.dom.attributes?t.dom.attributes:[];return j(n,(function(t,n){var r;return"class"===n.name?t:e(e({},t),((r={})[n.name]=n.value,r))}),{})}(n),i=function(e){return Array.prototype.slice.call(e.dom.classList,0)}(n),a=0===r.length?{}:{innerHtml:Po(n)};return e({tag:yt(n),classes:i,attributes:o},a)},Ts=function(e){var t,n=(t={prefix:ki},e.replace(/\$\{([^{}]*)\}/g,(function(e,n){var r=t[n];return function(e){var t=typeof e;return"string"===t||"number"===t}(r)?r.toString():e})));return ks(n)},Os=function(e){return{dom:Ts(e)}},_s=function(e){return bo([wi.config({toggleClass:Ti("toolbar-button-selected"),toggleOnExecute:!1,aria:{mode:"pressed"}}),xi(e,(function(e,t){(t?wi.on:wi.off)(e)}))])},Es=function(e,t,n,r){var o=_s(n);return Ds(t,r,o,e)},As=function(e,t){var n=t.ui.registry.getAll().icons;return M.from(n[e]).fold((function(){return Ts('<span class="${prefix}-toolbar-button ${prefix}-toolbar-group-item ${prefix}-icon-'+e+' ${prefix}-icon"></span>')}),(function(e){return Ts('<span class="${prefix}-toolbar-button ${prefix}-toolbar-group-item">'+e+"</span>")}))},Ds=function(e,t,n,r){return xs.sketch({dom:As(e,r),action:t,buttonBehaviours:Kn(bo([Ss.config({})]),n)})},Ms=qc({schema:[Tr("dom")],name:"label"}),Ns=function(e){return qc({name:e+"-edge",overrides:function(t){return t.model.manager.edgeActions[e].fold((function(){return{}}),(function(e){return{events:Xr([Zr(De(),(function(t,n,r){return e(t,r)}),[t]),Zr(Re(),(function(t,n,r){return e(t,r)}),[t]),Zr(ze(),(function(t,n,r){r.mouseIsDown.get()&&e(t,r)}),[t])])}}))}})},Rs=Ns("top-left"),zs=Ns("top"),Bs=Ns("top-right"),Ps=Ns("right"),Is=Ns("bottom-right"),Fs=Ns("bottom"),Ls=Ns("bottom-left"),Hs=Ns("left"),Vs=$c({name:"thumb",defaults:v({dom:{styles:{position:"absolute"}}}),overrides:function(e){return{events:Xr([eo(De(),e,"spectrum"),eo(Me(),e,"spectrum"),eo(Ne(),e,"spectrum"),eo(Re(),e,"spectrum"),eo(ze(),e,"spectrum"),eo(Be(),e,"spectrum")])}}}),js=$c({schema:[kr("mouseIsDown",(function(){return ko(!1)}))],name:"spectrum",overrides:function(e){var t=e.model.manager,n=function(n,r){return t.getValueFromEvent(r).map((function(r){return t.setValueFrom(n,e,r)}))};return{behaviours:bo([gc.config({mode:"special",onLeft:function(n){return t.onLeft(n,e)},onRight:function(n){return t.onRight(n,e)},onUp:function(n){return t.onUp(n,e)},onDown:function(n){return t.onDown(n,e)}}),Mi.config({})]),events:Xr([Jr(De(),n),Jr(Me(),n),Jr(Re(),n),Jr(ze(),(function(t,r){e.mouseIsDown.get()&&n(t,r)}))])}}}),Us=[Ms,Hs,Ps,zs,Fs,Rs,Bs,Ls,Is,Vs,js],Ws=function(e,t,n){t.store.manager.onLoad(e,t,n)},$s=function(e,t,n){t.store.manager.onUnload(e,t,n)},qs=Object.freeze({__proto__:null,onLoad:Ws,onUnload:$s,setValue:function(e,t,n,r){t.store.manager.setValue(e,t,n,r)},getValue:function(e,t,n){return t.store.manager.getValue(e,t,n)},getState:function(e,t,n){return n}}),Gs=Object.freeze({__proto__:null,events:function(e,t){var n=e.resetOnDom?[oo((function(n,r){Ws(n,e,t)})),io((function(n,r){$s(n,e,t)}))]:[fo(e,t,Ws)];return Xr(n)}}),Ks=function(){var e=ko(null);return vo({set:e.set,get:e.get,isNotSet:function(){return null===e.get()},clear:function(){e.set(null)},readState:function(){return{mode:"memory",value:e.get()}}})},Xs=function(){var t=ko({}),n=ko({});return vo({readState:function(){return{mode:"dataset",dataByValue:t.get(),dataByText:n.get()}},lookup:function(e){return un(t.get(),e).orThunk((function(){return un(n.get(),e)}))},update:function(r){var o=t.get(),i=n.get(),a={},u={};L(r,(function(e){a[e.value]=e,un(e,"meta").each((function(t){un(t,"text").each((function(t){u[t]=e}))}))})),t.set(e(e({},o),a)),n.set(e(e({},i),u))},clear:function(){t.set({}),n.set({})}})},Ys=Object.freeze({__proto__:null,memory:Ks,dataset:Xs,manual:function(){return vo({readState:p})},init:function(e){return e.store.manager.state(e)}}),Js=function(e,t,n,r){var o=t.store;n.update([r]),o.setValue(e,r),t.onSetValue(e,r)},Zs=[Er("initialValue"),Tr("getFallbackEntry"),Tr("getDataKey"),Tr("setValue"),oi("manager",{setValue:Js,getValue:function(e,t,n){var r=t.store,o=r.getDataKey(e);return n.lookup(o).getOrThunk((function(){return r.getFallbackEntry(o)}))},onLoad:function(e,t,n){t.store.initialValue.each((function(r){Js(e,t,n,r)}))},onUnload:function(e,t,n){n.clear()},state:Xs})],Qs=[Tr("getValue"),Nr("setValue",p),Er("initialValue"),oi("manager",{setValue:function(e,t,n,r){t.store.setValue(e,r),t.onSetValue(e,r)},getValue:function(e,t,n){return t.store.getValue(e)},onLoad:function(e,t,n){t.store.initialValue.each((function(n){t.store.setValue(e,n)}))},onUnload:p,state:ho.init})],el=[Er("initialValue"),oi("manager",{setValue:function(e,t,n,r){n.set(r),t.onSetValue(e,r)},getValue:function(e,t,n){return n.get()},onLoad:function(e,t,n){t.store.initialValue.each((function(e){n.isNotSet()&&n.set(e)}))},onUnload:function(e,t,n){n.clear()},state:Ks})],tl=[Rr("store",{mode:"memory"},Cr("mode",{memory:el,manual:Qs,dataset:Zs})),ei("onSetValue"),Nr("resetOnDom",!1)],nl=wo({fields:tl,name:"representing",active:Gs,apis:qs,extra:{setValueFrom:function(e,t){var n=nl.getValue(t);nl.setValue(e,n)}},state:Ys}),rl=Vi("width",(function(e){return e.dom.offsetWidth})),ol=function(e,t){return rl.set(e,t)},il=function(e){return rl.get(e)},al=function(e,t){return{left:e,top:t,translate:function(n,r){return al(e+n,t+r)}}},ul=al,cl=v("slider.change.value"),sl=function(e){var t=e.event.raw;if(function(e){return-1!==e.type.indexOf("touch")}(t)){var n=t;return void 0!==n.touches&&1===n.touches.length?M.some(n.touches[0]).map((function(e){return ul(e.clientX,e.clientY)})):M.none()}var r=t;return void 0!==r.clientX?M.some(r).map((function(e){return ul(e.clientX,e.clientY)})):M.none()},ll=function(e){return e.model.minX},fl=function(e){return e.model.minY},dl=function(e){return e.model.minX-1},ml=function(e){return e.model.minY-1},gl=function(e){return e.model.maxX},pl=function(e){return e.model.maxY},hl=function(e){return e.model.maxX+1},vl=function(e){return e.model.maxY+1},bl=function(e,t,n){return t(e)-n(e)},yl=function(e){return bl(e,gl,ll)},wl=function(e){return bl(e,pl,fl)},xl=function(e){return yl(e)/2},Cl=function(e){return wl(e)/2},Sl=function(e){return e.stepSize},kl=function(e){return e.snapToGrid},Tl=function(e){return e.snapStart},Ol=function(e){return e.rounded},_l=function(e,t){return void 0!==e[t+"-edge"]},El=function(e){return _l(e,"left")},Al=function(e){return _l(e,"right")},Dl=function(e){return _l(e,"top")},Ml=function(e){return _l(e,"bottom")},Nl=function(e){return e.model.value.get()},Rl=function(e){return{x:e}},zl=function(e){return{y:e}},Bl=function(e,t){return{x:e,y:t}},Pl=function(e,t){ut(e,cl(),{value:t})},Il=function(e,t,n,r){return e<t?e:e>n?n:e===t?t-1:Math.max(t,e-r)},Fl=function(e,t,n,r){return e>n?e:e<t?t:e===n?n+1:Math.min(n,e+r)},Ll=function(e,t,n){return Math.max(t,Math.min(n,e))},Hl=function(e){var t=e.min,n=e.max,r=e.range,o=e.value,i=e.step,a=e.snap,u=e.snapStart,c=e.rounded,s=e.hasMinEdge,l=e.hasMaxEdge,f=e.minBound,d=e.maxBound,m=e.screenRange,g=s?t-1:t,p=l?n+1:n;if(o<f)return g;if(o>d)return p;var h=function(e,t,n){return Math.min(n,Math.max(e,t))-t}(o,f,d),v=Ll(h/m*r+t,g,p);return a&&v>=t&&v<=n?function(e,t,n,r,o){return o.fold((function(){var o=e-t,i=Math.round(o/r)*r;return Ll(t+i,t-1,n+1)}),(function(t){var o=(e-t)%r,i=Math.round(o/r),a=Math.floor((e-t)/r),u=Math.floor((n-t)/r),c=t+Math.min(u,a+i)*r;return Math.max(t,c)}))}(v,t,n,i,u):c?Math.round(v):v},Vl=function(e){var t=e.min,n=e.max,r=e.range,o=e.value,i=e.hasMinEdge,a=e.hasMaxEdge,u=e.maxBound,c=e.maxOffset,s=e.centerMinEdge,l=e.centerMaxEdge;return o<t?i?0:s:o>n?a?u:l:(o-t)/r*c},jl="top",Ul="right",Wl="bottom",$l="left",ql=function(e){return e.element.dom.getBoundingClientRect()},Gl=function(e,t){return e[t]},Kl=function(e){var t=ql(e);return Gl(t,$l)},Xl=function(e){var t=ql(e);return Gl(t,Ul)},Yl=function(e){var t=ql(e);return Gl(t,jl)},Jl=function(e){var t=ql(e);return Gl(t,Wl)},Zl=function(e){var t=ql(e);return Gl(t,"width")},Ql=function(e){var t=ql(e);return Gl(t,"height")},ef=function(e,t,n){return(e+t)/2-n},tf=function(e,t){var n=ql(e),r=ql(t),o=Gl(n,$l),i=Gl(n,Ul),a=Gl(r,$l);return ef(o,i,a)},nf=function(e,t){var n=ql(e),r=ql(t),o=Gl(n,jl),i=Gl(n,Wl),a=Gl(r,jl);return ef(o,i,a)},rf=function(e,t){ut(e,cl(),{value:t})},of=function(e){return{x:e}},af=function(e,t,n){var r={min:ll(t),max:gl(t),range:yl(t),value:n,step:Sl(t),snap:kl(t),snapStart:Tl(t),rounded:Ol(t),hasMinEdge:El(t),hasMaxEdge:Al(t),minBound:Kl(e),maxBound:Xl(e),screenRange:Zl(e)};return Hl(r)},uf=function(e){return function(t,n){return function(e,t,n){var r=(e>0?Fl:Il)(Nl(n).x,ll(n),gl(n),Sl(n));return rf(t,of(r)),M.some(r)}(e,t,n).map(_)}},cf=function(e,t,n,r,o,i){var a=function(e,t,n,r,o){var i=Zl(e),a=r.bind((function(t){return M.some(tf(t,e))})).getOr(0),u=o.bind((function(t){return M.some(tf(t,e))})).getOr(i),c={min:ll(t),max:gl(t),range:yl(t),value:n,hasMinEdge:El(t),hasMaxEdge:Al(t),minBound:Kl(e),minOffset:0,maxBound:Xl(e),maxOffset:i,centerMinEdge:a,centerMaxEdge:u};return Vl(c)}(t,i,n,r,o);return Kl(t)-Kl(e)+a},sf=uf(-1),lf=uf(1),ff=M.none,df=M.none,mf={"top-left":M.none(),top:M.none(),"top-right":M.none(),right:M.some((function(e,t){Pl(e,Rl(hl(t)))})),"bottom-right":M.none(),bottom:M.none(),"bottom-left":M.none(),left:M.some((function(e,t){Pl(e,Rl(dl(t)))}))},gf=Object.freeze({__proto__:null,setValueFrom:function(e,t,n){var r=af(e,t,n),o=of(r);return rf(e,o),r},setToMin:function(e,t){var n=ll(t);rf(e,of(n))},setToMax:function(e,t){var n=gl(t);rf(e,of(n))},findValueOfOffset:af,getValueFromEvent:function(e){return sl(e).map((function(e){return e.left}))},findPositionOfValue:cf,setPositionFromValue:function(e,t,n,r){var o=Nl(n),i=cf(e,r.getSpectrum(e),o.x,r.getLeftEdge(e),r.getRightEdge(e),n),a=il(t.element)/2;zi(t.element,"left",i-a+"px")},onLeft:sf,onRight:lf,onUp:ff,onDown:df,edgeActions:mf}),pf=function(e,t){ut(e,cl(),{value:t})},hf=function(e){return{y:e}},vf=function(e,t,n){var r={min:fl(t),max:pl(t),range:wl(t),value:n,step:Sl(t),snap:kl(t),snapStart:Tl(t),rounded:Ol(t),hasMinEdge:Dl(t),hasMaxEdge:Ml(t),minBound:Yl(e),maxBound:Jl(e),screenRange:Ql(e)};return Hl(r)},bf=function(e){return function(t,n){return function(e,t,n){var r=(e>0?Fl:Il)(Nl(n).y,fl(n),pl(n),Sl(n));return pf(t,hf(r)),M.some(r)}(e,t,n).map(_)}},yf=function(e,t,n,r,o,i){var a=function(e,t,n,r,o){var i=Ql(e),a=r.bind((function(t){return M.some(nf(t,e))})).getOr(0),u=o.bind((function(t){return M.some(nf(t,e))})).getOr(i),c={min:fl(t),max:pl(t),range:wl(t),value:n,hasMinEdge:Dl(t),hasMaxEdge:Ml(t),minBound:Yl(e),minOffset:0,maxBound:Jl(e),maxOffset:i,centerMinEdge:a,centerMaxEdge:u};return Vl(c)}(t,i,n,r,o);return Yl(t)-Yl(e)+a},wf=M.none,xf=M.none,Cf=bf(-1),Sf=bf(1),kf={"top-left":M.none(),top:M.some((function(e,t){Pl(e,zl(ml(t)))})),"top-right":M.none(),right:M.none(),"bottom-right":M.none(),bottom:M.some((function(e,t){Pl(e,zl(vl(t)))})),"bottom-left":M.none(),left:M.none()},Tf=Object.freeze({__proto__:null,setValueFrom:function(e,t,n){var r=vf(e,t,n),o=hf(r);return pf(e,o),r},setToMin:function(e,t){var n=fl(t);pf(e,hf(n))},setToMax:function(e,t){var n=pl(t);pf(e,hf(n))},findValueOfOffset:vf,getValueFromEvent:function(e){return sl(e).map((function(e){return e.top}))},findPositionOfValue:yf,setPositionFromValue:function(e,t,n,r){var o=Nl(n),i=yf(e,r.getSpectrum(e),o.y,r.getTopEdge(e),r.getBottomEdge(e),n),a=Ui(t.element)/2;zi(t.element,"top",i-a+"px")},onLeft:wf,onRight:xf,onUp:Cf,onDown:Sf,edgeActions:kf}),Of=function(e,t){ut(e,cl(),{value:t})},_f=function(e,t){return{x:e,y:t}},Ef=function(e,t){return function(n,r){return function(e,t,n,r){var o=e>0?Fl:Il,i=t?Nl(r).x:o(Nl(r).x,ll(r),gl(r),Sl(r)),a=t?o(Nl(r).y,fl(r),pl(r),Sl(r)):Nl(r).y;return Of(n,_f(i,a)),M.some(i)}(e,t,n,r).map(_)}},Af=Ef(-1,!1),Df=Ef(1,!1),Mf=Ef(-1,!0),Nf=Ef(1,!0),Rf={"top-left":M.some((function(e,t){Pl(e,Bl(dl(t),ml(t)))})),top:M.some((function(e,t){Pl(e,Bl(xl(t),ml(t)))})),"top-right":M.some((function(e,t){Pl(e,Bl(hl(t),ml(t)))})),right:M.some((function(e,t){Pl(e,Bl(hl(t),Cl(t)))})),"bottom-right":M.some((function(e,t){Pl(e,Bl(hl(t),vl(t)))})),bottom:M.some((function(e,t){Pl(e,Bl(xl(t),vl(t)))})),"bottom-left":M.some((function(e,t){Pl(e,Bl(dl(t),vl(t)))})),left:M.some((function(e,t){Pl(e,Bl(dl(t),Cl(t)))}))},zf=Object.freeze({__proto__:null,setValueFrom:function(e,t,n){var r=af(e,t,n.left),o=vf(e,t,n.top),i=_f(r,o);return Of(e,i),i},setToMin:function(e,t){var n=ll(t),r=fl(t);Of(e,_f(n,r))},setToMax:function(e,t){var n=gl(t),r=pl(t);Of(e,_f(n,r))},getValueFromEvent:function(e){return sl(e)},setPositionFromValue:function(e,t,n,r){var o=Nl(n),i=cf(e,r.getSpectrum(e),o.x,r.getLeftEdge(e),r.getRightEdge(e),n),a=yf(e,r.getSpectrum(e),o.y,r.getTopEdge(e),r.getBottomEdge(e),n),u=il(t.element)/2,c=Ui(t.element)/2;zi(t.element,"left",i-u+"px"),zi(t.element,"top",a-c+"px")},onLeft:Af,onRight:Df,onUp:Mf,onDown:Nf,edgeActions:Rf}),Bf=[Nr("stepSize",1),Nr("onChange",p),Nr("onChoose",p),Nr("onInit",p),Nr("onDragStart",p),Nr("onDragEnd",p),Nr("snapToGrid",!1),Nr("rounded",!0),Er("snapStart"),Or("model",Cr("mode",{x:[Nr("minX",0),Nr("maxX",100),kr("value",(function(e){return ko(e.mode.minX)})),Tr("getInitialValue"),oi("manager",gf)],y:[Nr("minY",0),Nr("maxY",100),kr("value",(function(e){return ko(e.mode.minY)})),Tr("getInitialValue"),oi("manager",Tf)],xy:[Nr("minX",0),Nr("maxX",100),Nr("minY",0),Nr("maxY",100),kr("value",(function(e){return ko({x:e.mode.minX,y:e.mode.minY})})),Tr("getInitialValue"),oi("manager",zf)]})),pc("sliderBehaviours",[gc,nl]),kr("mouseIsDown",(function(){return ko(!1)}))],Pf=v("mouse.released"),If=ws({name:"Slider",configFields:Bf,partFields:Us,factory:function(e,t,n,r){var o,i=function(t){return ts(t,e,"thumb")},a=function(t){return ts(t,e,"spectrum")},u=function(t){return es(t,e,"left-edge")},c=function(t){return es(t,e,"right-edge")},s=function(t){return es(t,e,"top-edge")},l=function(t){return es(t,e,"bottom-edge")},f=e.model,d=f.manager,m=function(t,n){d.setPositionFromValue(t,n,e,{getLeftEdge:u,getRightEdge:c,getTopEdge:s,getBottomEdge:l,getSpectrum:a})},g=function(e,t){f.value.set(t);var n=i(e);m(e,n)},p=function(t){var n=e.mouseIsDown.get();e.mouseIsDown.set(!1),n&&es(t,e,"thumb").each((function(n){var r=f.value.get();e.onChoose(t,n,r)}))},h=function(t,n){n.stop(),e.mouseIsDown.set(!0),e.onDragStart(t,i(t))},v=function(t,n){n.stop(),e.onDragEnd(t,i(t)),p(t)};return{uid:e.uid,dom:e.dom,components:t,behaviours:vc(e.sliderBehaviours,[gc.config({mode:"special",focusIn:function(t){return es(t,e,"spectrum").map(gc.focusIn).map(_)}}),nl.config({store:{mode:"manual",getValue:function(e){return f.value.get()}}}),ci.config({channels:(o={},o[Pf()]={onReceive:p},o)})]),events:Xr([Jr(cl(),(function(t,n){!function(t,n){g(t,n);var r=i(t);e.onChange(t,r,n),M.some(!0)}(t,n.event.value)})),oo((function(t,n){var r=f.getInitialValue();f.value.set(r);var o=i(t);m(t,o);var u=a(t);e.onInit(t,o,u,f.value.get())})),Jr(De(),h),Jr(Ne(),v),Jr(Re(),h),Jr(Be(),v)]),apis:{resetToMin:function(t){d.setToMin(t,e)},resetToMax:function(t){d.setToMax(t,e)},setValue:g,refresh:m},domModification:{styles:{position:"relative"}}}},apis:{setValue:function(e,t,n){e.setValue(t,n)},resetToMin:function(e,t){e.resetToMin(t)},resetToMax:function(e,t){e.resetToMax(t)},refresh:function(e,t){e.refresh(t)}}}),Ff=function(e,t,n,r){return Ds(t,(function(){var r=n();e.setContextToolbar([{label:t+" group",items:r}])}),{},r)},Lf=function(e){var t=function(e){return e<0?"black":e>360?"white":"hsl("+e+", 100%, 50%)"};return If.sketch({dom:Ts('<div class="${prefix}-slider ${prefix}-hue-slider-container"></div>'),components:[If.parts["left-edge"](Os('<div class="${prefix}-hue-slider-black"></div>')),If.parts.spectrum({dom:Ts('<div class="${prefix}-slider-gradient-container"></div>'),components:[Os('<div class="${prefix}-slider-gradient"></div>')],behaviours:bo([wi.config({toggleClass:Ti("thumb-active")})])}),If.parts["right-edge"](Os('<div class="${prefix}-hue-slider-white"></div>')),If.parts.thumb({dom:Ts('<div class="${prefix}-slider-thumb"></div>'),behaviours:bo([wi.config({toggleClass:Ti("thumb-active")})])})],onChange:function(n,r,o){var i=t(o.x());zi(r.element,"background-color",i),e.onChange(n,r,i)},onDragStart:function(e,t){wi.on(t)},onDragEnd:function(e,t){wi.off(t)},onInit:function(e,n,r,o){var i=t(o.x());zi(n.element,"background-color",i)},stepSize:10,model:{mode:"x",minX:0,maxX:360,getInitialValue:function(){return{x:e.getInitialValue()}}},sliderBehaviours:bo([Ci(If.refresh)])})},Hf=function(e,t){var n={onChange:function(e,n,r){t.undoManager.transact((function(){t.formatter.apply("forecolor",{value:r}),t.nodeChanged()}))},getInitialValue:v(-1)};return Ff(e,"color-levels",(function(){return function(e){return[Lf(e)]}(n)}),t)},Vf=["9px","10px","11px","12px","14px","16px","18px","20px","24px","32px","36px"],jf=function(e,t){return(xt(t)?M.some(t):_t(t).filter(xt)).map((function(t){var n=function(e,t,n){return Xi((function(e,t){return t(e)}),Ji,e,t,n)}(t,(function(e){return Fi(e,"font-size").isSome()}),e).bind((function(e){return Fi(e,"font-size")}));return n.getOrThunk((function(){return Pi(t,"font-size")}))})).getOr("")},Uf=function(e){var t=e.selection.getStart(),n=dt.fromDom(t),r=dt.fromDom(e.getBody()),o=jf((function(e){return vt(r,e)}),n);return U(Vf,(function(e){return o===e})).getOr("medium")},Wf=function(e){return function(e){return W(Vf,(function(t){return t===e}))}(Uf(e)).getOr(2)},$f=function(e,t){(function(e){return M.from(Vf[e])})(t).each((function(t){!function(e,t){Uf(e)!==t&&e.execCommand("fontSize",!1,t)}(e,t)}))},qf=v(Vf),Gf=sr([Tr("getInitialValue"),Tr("onChange"),Tr("category"),Tr("sizes")]),Kf=function(e){var t=wr("SizeSlider",Gf,e);return If.sketch({dom:{tag:"div",classes:[Ti("slider-"+t.category+"-size-container"),Ti("slider"),Ti("slider-size-container")]},onChange:function(e,n,r){var o=r.x();(function(e){return e>=0&&e<t.sizes.length})(o)&&t.onChange(o)},onDragStart:function(e,t){wi.on(t)},onDragEnd:function(e,t){wi.off(t)},model:{mode:"x",minX:0,maxX:t.sizes.length-1,getInitialValue:function(){return{x:t.getInitialValue()}}},stepSize:1,snapToGrid:!0,sliderBehaviours:bo([Ci(If.refresh)]),components:[If.parts.spectrum({dom:Ts('<div class="${prefix}-slider-size-container"></div>'),components:[Os('<div class="${prefix}-slider-size-line"></div>')]}),If.parts.thumb({dom:Ts('<div class="${prefix}-slider-thumb"></div>'),behaviours:bo([wi.config({toggleClass:Ti("thumb-active")})])})]})},Xf=qf(),Yf=function(e){return Kf({onChange:e.onChange,sizes:Xf,category:"font",getInitialValue:e.getInitialValue})},Jf=function(e){return[Os('<span class="${prefix}-toolbar-button ${prefix}-icon-small-font ${prefix}-icon"></span>'),Yf(e),Os('<span class="${prefix}-toolbar-button ${prefix}-icon-large-font ${prefix}-icon"></span>')]},Zf=function(t){var n=function(e){return void 0!==e.uid}(t)&&sn(t,"uid")?t.uid:ms("memento");return{get:function(e){return e.getSystem().getByUid(n).getOrDie()},getOpt:function(e){return e.getSystem().getByUid(n).toOptional()},asSpec:function(){return e(e({},t),{uid:n})}}},Qf={},ed={exports:Qf};!function(e,t,n,r){!function(r,o){"object"==typeof t&&void 0!==n?n.exports=o():"function"==typeof e&&e.amd?e(o):(r="undefined"!=typeof globalThis?globalThis:r||self).EphoxContactWrapper=o()}(this,(function(){var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t={exports:{}};!function(t){!function(e){var n=setTimeout;function r(){}function o(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],l(e,this)}function i(e,t){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,o._immediateFn((function(){var n=1===e._state?t.onFulfilled:t.onRejected;if(null!==n){var r;try{r=n(e._value)}catch(e){return void u(t.promise,e)}a(t.promise,r)}else(1===e._state?a:u)(t.promise,e._value)}))):e._deferreds.push(t)}function a(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if(t instanceof o)return e._state=3,e._value=t,void c(e);if("function"==typeof n)return void l((r=n,i=t,function(){r.apply(i,arguments)}),e)}e._state=1,e._value=t,c(e)}catch(t){u(e,t)}var r,i}function u(e,t){e._state=2,e._value=t,c(e)}function c(e){2===e._state&&0===e._deferreds.length&&o._immediateFn((function(){e._handled||o._unhandledRejectionFn(e._value)}));for(var t=0,n=e._deferreds.length;t<n;t++)i(e,e._deferreds[t]);e._deferreds=null}function s(e,t,n){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=n}function l(e,t){var n=!1;try{e((function(e){n||(n=!0,a(t,e))}),(function(e){n||(n=!0,u(t,e))}))}catch(e){if(n)return;n=!0,u(t,e)}}o.prototype.catch=function(e){return this.then(null,e)},o.prototype.then=function(e,t){var n=new this.constructor(r);return i(this,new s(e,t,n)),n},o.all=function(e){var t=Array.prototype.slice.call(e);return new o((function(e,n){if(0===t.length)return e([]);var r=t.length;function o(i,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var u=a.then;if("function"==typeof u)return void u.call(a,(function(e){o(i,e)}),n)}t[i]=a,0==--r&&e(t)}catch(e){n(e)}}for(var i=0;i<t.length;i++)o(i,t[i])}))},o.resolve=function(e){return e&&"object"==typeof e&&e.constructor===o?e:new o((function(t){t(e)}))},o.reject=function(e){return new o((function(t,n){n(e)}))},o.race=function(e){return new o((function(t,n){for(var r=0,o=e.length;r<o;r++)e[r].then(t,n)}))},o._immediateFn="function"==typeof setImmediate?function(e){setImmediate(e)}:function(e){n(e,0)},o._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)},o._setImmediateFn=function(e){o._immediateFn=e},o._setUnhandledRejectionFn=function(e){o._unhandledRejectionFn=e},t.exports?t.exports=o:e.Promise||(e.Promise=o)}(e)}(t);var n=t.exports;return{boltExport:("undefined"!=typeof window?window:Function("return this;")()).Promise||n}}))}(void 0,Qf,ed);var td,nd,rd,od=ed.exports.boltExport,id=function(e){return function(e){return new od((function(t){var n=new FileReader;n.onloadend=function(){t(n.result)},n.readAsDataURL(e)}))}(e).then((function(e){return e.split(",")[1]}))},ad=function(e,t){(function(e){return id(e)})(t).then((function(n){e.undoManager.transact((function(){var r=e.editorUpload.blobCache,o=r.create(Dc("mceu"),t,n);r.add(o);var i=e.dom.createHTML("img",{src:o.blobUri()});e.insertContent(i)}))}))},ud=function(e){var t=Zf({dom:{tag:"input",attributes:{accept:"image/*",type:"file",title:""},styles:{visibility:"hidden",position:"absolute"}},events:Xr([to(Ve()),Jr(He(),(function(t,n){(function(e){var t=e.event.raw,n=t.target.files||t.dataTransfer.files;return M.from(n[0])})(n).each((function(t){ad(e,t)}))}))])});return xs.sketch({dom:As("image",e),components:[t.asSpec()],action:function(e){t.get(e).element.dom.click()}})},cd=function(e){return e.dom.textContent},sd=function(e){return e.length>0},ld=function(e){return null==e?"":e},fd=function(e){return gd(e).fold((function(){return function(e){return{url:"",text:e.selection.getContent({format:"text"}),title:"",target:"",link:M.none()}}(e)}),(function(e){return function(e){var t=cd(e),n=mn(e,"href"),r=mn(e,"title"),o=mn(e,"target");return{url:ld(n),text:t!==n?ld(t):"",title:ld(r),target:ld(o),link:M.some(e)}}(e)}))},dd=function(e,t,n){return n.text.toOptional().filter(sd).fold((function(){return function(e){return mn(e,"href")===cd(e)}(e)?M.some(t):M.none()}),M.some)},md=function(e,t){t.url.toOptional().filter(sd).fold((function(){!function(e,t){t.link.bind(b).each((function(t){e.execCommand("unlink")}))}(e,t)}),(function(n){var r=function(e,t){var n={};return n.href=e,t.title.toOptional().filter(sd).each((function(e){n.title=e})),t.target.toOptional().filter(sd).each((function(e){n.target=e})),n}(n,t);t.link.bind(b).fold((function(){var o=t.text.toOptional().filter(sd).getOr(n);e.insertContent(e.dom.createHTML("a",r,e.dom.encode(o)))}),(function(e){var o=dd(e,n,t);dn(e,r),o.each((function(t){!function(e,t){e.dom.textContent=t}(e,t)}))}))}))},gd=function(e){var t=dt.fromDom(e.selection.getStart());return ta(t,"a")},pd=Ee(),hd=function(e,t){var n=t.selection.getRng();e(),t.selection.setRng(n)},vd=function(e,t){var n=function(e,t){var n=Xr(t);return wo({fields:[Tr("enabled")],name:e,active:{events:v(n)}})}(e,t);return{key:e,value:{config:{},me:n,configAsRaw:v({}),initialConfig:{},state:ho}}},bd=Object.freeze({__proto__:null,getCurrent:function(e,t,n){return t.find(e)}}),yd=[Tr("find")],wd=wo({fields:yd,name:"composing",apis:bd}),xd=ys({name:"Container",factory:function(n){var r=n.dom,o=r.attributes,i=t(r,["attributes"]);return{uid:n.uid,dom:e({tag:"div",attributes:e({role:"presentation"},o)},i),components:n.components,behaviours:hc(n.containerBehaviours),events:n.events,domModification:n.domModification,eventOrder:n.eventOrder}},configFields:[Nr("components",[]),pc("containerBehaviours",[]),Nr("events",{}),Nr("domModification",{}),Nr("eventOrder",{})]}),Cd=ys({name:"DataField",factory:function(e){return{uid:e.uid,dom:e.dom,behaviours:yc(e.dataBehaviours,[nl.config({store:{mode:"memory",initialValue:e.getInitialValue()}}),wd.config({find:M.some})]),events:Xr([oo((function(t,n){nl.setValue(t,e.getInitialValue())}))])}},configFields:[Tr("uid"),Tr("dom"),Tr("getInitialValue"),bc("dataBehaviours",[nl,wd])]}),Sd=function(e){return e.dom.value},kd=function(e,t){if(void 0===t)throw new Error("Value.set was undefined");e.dom.value=t},Td=v([Er("data"),Nr("inputAttributes",{}),Nr("inputStyles",{}),Nr("tag","input"),Nr("inputClasses",[]),ei("onSetValue"),Nr("styles",{}),Nr("eventOrder",{}),pc("inputBehaviours",[nl,Mi]),Nr("selectOnFocus",!0)]),Od=function(t){return e(e({},function(e){return bo([Mi.config({onFocus:e.selectOnFocus?function(e){var t=e.element,n=Sd(t);t.dom.setSelectionRange(0,n.length)}:p})])}(t)),vc(t.inputBehaviours,[nl.config({store:e(e({mode:"manual"},t.data.map((function(e){return{initialValue:e}})).getOr({})),{getValue:function(e){return Sd(e.element)},setValue:function(e,t){Sd(e.element)!==t&&kd(e.element,t)}}),onSetValue:t.onSetValue})]))},_d=function(t){return{tag:t.tag,attributes:e({type:"text"},t.inputAttributes),styles:t.inputStyles,classes:t.inputClasses}},Ed=ys({name:"Input",configFields:Td(),factory:function(e,t){return{uid:e.uid,dom:_d(e),components:[],behaviours:Od(e),eventOrder:e.eventOrder}}}),Ad=Object.freeze({__proto__:null,exhibit:function(e,t){return lo({attributes:Lr([{key:t.tabAttr,value:"true"}])})}}),Dd=[Nr("tabAttr","data-alloy-tabstop")],Md=wo({fields:Dd,name:"tabstopping",active:Ad}),Nd=tinymce.util.Tools.resolve("tinymce.util.I18n"),Rd=function(e,t){var n=Zf(Ed.sketch({inputAttributes:{placeholder:Nd.translate(t)},onSetValue:function(e,t){at(e,Le())},inputBehaviours:bo([wd.config({find:M.some}),Md.config({}),gc.config({mode:"execution"})]),selectOnFocus:!1})),r=Zf(xs.sketch({dom:Ts('<button class="${prefix}-input-container-x ${prefix}-icon-cancel-circle ${prefix}-icon"></button>'),action:function(e){var t=n.get(e);nl.setValue(t,"")}}));return{name:e,spec:xd.sketch({dom:Ts('<div class="${prefix}-input-container"></div>'),components:[n.asSpec(),r.asSpec()],containerBehaviours:bo([wi.config({toggleClass:Ti("input-container-empty")}),wd.config({find:function(e){return M.some(n.get(e))}}),vd("input-clearing",[Jr(Le(),(function(e){var t=n.get(e);(nl.getValue(t).length>0?wi.off:wi.on)(e)}))])])})}},zd=function(e){return{name:e,spec:Cd.sketch({dom:{tag:"span",styles:{display:"none"}},getInitialValue:function(){return M.none()}})}},Bd=["input","button","textarea","select"],Pd=function(e,t,n){(t.disabled()?jd:Ud)(e,t)},Id=function(e,t){return!0===t.useNative&&P(Bd,yt(e.element))},Fd=function(e){fn(e.element,"disabled","disabled")},Ld=function(e){hn(e.element,"disabled")},Hd=function(e){fn(e.element,"aria-disabled","true")},Vd=function(e){fn(e.element,"aria-disabled","false")},jd=function(e,t,n){t.disableClass.each((function(t){xn(e.element,t)})),(Id(e,t)?Fd:Hd)(e),t.onDisabled(e)},Ud=function(e,t,n){t.disableClass.each((function(t){Sn(e.element,t)})),(Id(e,t)?Ld:Vd)(e),t.onEnabled(e)},Wd=function(e,t){return Id(e,t)?function(e){return pn(e.element,"disabled")}(e):function(e){return"true"===mn(e.element,"aria-disabled")}(e)},$d=Object.freeze({__proto__:null,enable:Ud,disable:jd,isDisabled:Wd,onLoad:Pd,set:function(e,t,n,r){(r?jd:Ud)(e,t)}}),qd=Object.freeze({__proto__:null,exhibit:function(e,t){return lo({classes:t.disabled()?t.disableClass.toArray():[]})},events:function(e,t){return Xr([Yr(Ye(),(function(t,n){return Wd(t,e)})),fo(e,t,Pd)])}}),Gd=[(td="disabled",nd=O,Rr(td,nd,mr)),Nr("useNative",!0),Er("disableClass"),ei("onDisabled"),ei("onEnabled")],Kd=wo({fields:Gd,name:"disabling",active:qd,apis:$d}),Xd="form",Yd=[pc("formBehaviours",[nl])],Jd=function(e){return"<alloy.field."+e+">"},Zd=function(e,t){return{uid:e.uid,dom:e.dom,components:t,behaviours:vc(e.formBehaviours,[nl.config({store:{mode:"manual",getValue:function(t){var n=function(e,t){var n=e.getSystem();return nn(t.partUids,(function(e,t){return v(n.getByUid(e))}))}(t,e);return nn(n,(function(e,t){return e().bind((function(e){var n,r,o=wd.getCurrent(e);return n=o,r=new Error("Cannot find a current component to extract the value from for form part '"+t+"': "+Ho(e.element)),n.fold((function(){return An.error(r)}),An.value)})).map(nl.getValue)}))},setValue:function(t,n){tn(n,(function(n,r){es(t,e,r).each((function(e){wd.getCurrent(e).each((function(e){nl.setValue(e,n)}))}))}))}}})]),apis:{getField:function(t,n){return es(t,e,n).bind(wd.getCurrent)}}}},Qd=(as((function(e,t,n){return e.getField(t,n)})),function(e){var t=function(){var e=[];return{field:function(t,n){return e.push(t),function(e,t,n){return{uiType:Ec(),owner:e,name:t,config:n,validated:{}}}(Xd,Jd(t),n)},record:v(e)}}(),n=e(t),r=t.record(),o=F(r,(function(e){return $c({name:e,pname:Jd(e)})}));return ps(Xd,Yd,o,Zd,n)}),em=function(e){var t="navigateEvent",n=lr([Tr("fields"),Nr("maxFieldIndex",e.fields.length-1),Tr("onExecute"),Tr("getInitialValue"),kr("state",(function(){return{dialogSwipeState:Xa(),currentScreen:ko(0)}}))]),r=wr("SerialisedDialog",n,e),o=function(e,n,r){return xs.sketch({dom:Ts('<span class="${prefix}-icon-'+n+' ${prefix}-icon"></span>'),action:function(n){ut(n,t,{direction:e})},buttonBehaviours:bo([Kd.config({disableClass:Ti("toolbar-navigation-disabled"),disabled:function(){return!r}})])})},i=function(e,t){var n=Ki(e.element,"."+Ti("serialised-dialog-screen"));ea(e.element,"."+Ti("serialised-dialog-chain")).each((function(e){r.state.currentScreen.get()+t>=0&&r.state.currentScreen.get()+t<n.length&&(Fi(e,"left").each((function(r){var o=parseInt(r,10),i=il(n[0]);zi(e,"left",o-t*i+"px")})),r.state.currentScreen.set(r.state.currentScreen.get()+t))}))},a=function(e){var t=Ki(e.element,"input");M.from(t[r.state.currentScreen.get()]).each((function(t){e.getSystem().getByDom(t).each((function(t){var n,r;n=e,r=t.element,n.getSystem().triggerFocus(r,n.element)}))}));var n=c.get(e);Ra.highlightAt(n,r.state.currentScreen.get())},u=Zf(Qd((function(e){return{dom:Ts('<div class="${prefix}-serialised-dialog"></div>'),components:[xd.sketch({dom:Ts('<div class="${prefix}-serialised-dialog-chain" style="left: 0px; position: absolute;"></div>'),components:F(r.fields,(function(t,n){return n<=r.maxFieldIndex?xd.sketch({dom:Ts('<div class="${prefix}-serialised-dialog-screen"></div>'),components:[o(-1,"previous",n>0),e.field(t.name,t.spec),o(1,"next",n<r.maxFieldIndex)]}):e.field(t.name,t.spec)}))})],formBehaviours:bo([Ci((function(e,t){!function(e,t){ea(e.element,"."+Ti("serialised-dialog-chain")).each((function(e){zi(e,"left",-r.state.currentScreen.get()*t.width+"px")}))}(e,t)})),gc.config({mode:"special",focusIn:function(e,t){a(e)},onTab:function(e,t){return i(e,1),M.some(!0)},onShiftTab:function(e,t){return i(e,-1),M.some(!0)}}),vd("form-events",[oo((function(e,t){r.state.currentScreen.set(0),r.state.dialogSwipeState.clear();var n=c.get(e);Ra.highlightFirst(n),r.getInitialValue(e).each((function(t){nl.setValue(e,t)}))})),uo(r.onExecute),Jr(je(),(function(e,t){"left"===t.event.raw.propertyName&&a(e)})),Jr(t,(function(e,t){var n=t.event.direction;i(e,n)}))])])}}))),c=Zf({dom:Ts('<div class="${prefix}-dot-container"></div>'),behaviours:bo([Ra.config({highlightClass:Ti("dot-active"),itemClass:Ti("dot-item")})]),components:q(r.fields,(function(e,t){return t<=r.maxFieldIndex?[Os('<div class="${prefix}-dot-item ${prefix}-icon-full-dot ${prefix}-icon"></div>')]:[]}))});return{dom:Ts('<div class="${prefix}-serializer-wrapper"></div>'),components:[u.asSpec(),c.asSpec()],behaviours:bo([gc.config({mode:"special",focusIn:function(e){var t=u.get(e);gc.focusIn(t)}}),vd("serializer-wrapper-events",[Jr(De(),(function(e,t){var n=t.event;r.state.dialogSwipeState.set(function(e){return{xValue:e,points:[]}}(n.raw.touches[0].clientX))})),Jr(Me(),(function(e,t){var n=t.event;r.state.dialogSwipeState.on((function(e){t.event.prevent(),r.state.dialogSwipeState.set(function(e,t){if(t===e.xValue)return e;var n=t-e.xValue>0?1:-1,r={direction:n,xValue:t};return{xValue:t,points:(0===e.points.length?[]:e.points[e.points.length-1].direction===n?e.points.slice(0,e.points.length-1):e.points).concat([r])}}(e,n.raw.touches[0].clientX))}))})),Jr(Ne(),(function(e,t){r.state.dialogSwipeState.on((function(t){var n=u.get(e),r=-1*function(e){if(0===e.points.length)return 0;var t=e.points[0].direction,n=e.points[e.points.length-1].direction;return-1===t&&-1===n?-1:1===t&&1===n?1:0}(t);i(n,r)}))}))])])}},tm=N((function(e,t){return[{label:"the link group",items:[em({fields:[Rd("url","Type or paste URL"),Rd("text","Link text"),Rd("title","Link title"),Rd("target","Link target"),zd("link")],maxFieldIndex:["url","text","title","target"].length-1,getInitialValue:function(){return M.some(fd(t))},onExecute:function(n,r){var o=nl.getValue(n);md(t,o),e.restoreToolbar(),t.focus()}})]}]})),nm=function(e,t){return Es(t,"link","link",(function(){var n=tm(e,t);e.setContextToolbar(n),function(e,t){(pd.os.isAndroid()?hd:T)(t,e)}(t,(function(){e.focusToolbar()})),gd(t).each((function(e){t.selection.select(e.dom)}))}))},rm=Xr([function(e,t){return{key:e,value:Gr({can:t})}}(qe(),(function(e,t){var n=t.event,r=n.originator,o=n.target;return!function(e,t,n){return vt(t,e.element)&&!vt(t,n)}(e,r,o)||(console.warn(qe()+" did not get interpreted by the desired target. \nOriginator: "+Ho(r)+"\nTarget: "+Ho(o)+"\nCheck the "+qe()+" event handlers"),!1)}))]),om=Object.freeze({__proto__:null,events:rm}),im=b,am=function(e){var t=function(t){return"The component must be in a context to execute: "+t+(e?"\n"+Ho(e().element)+" is not in context.":"")},n=function(e){return function(){throw new Error(t(e))}},r=function(e){return function(){console.warn(t(e))}};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:O}},um=am(),cm=function(e,t){var n={};return tn(e,(function(e,r){tn(e,(function(e,o){var i=un(n,o).getOr([]);n[o]=i.concat([t(r,e)])}))})),n},sm=function(e,t,n,r){try{var o=(i=n,a=function(n,o){var i=n[t],a=o[t],u=r.indexOf(i),c=r.indexOf(a);if(-1===u)throw new Error("The ordering for "+e+" does not have an entry for "+i+".\nOrder specified: "+JSON.stringify(r,null,2));if(-1===c)throw new Error("The ordering for "+e+" does not have an entry for "+a+".\nOrder specified: "+JSON.stringify(r,null,2));return u<c?-1:c<u?1:0},(u=R.call(i,0)).sort(a),u);return An.value(o)}catch(e){return An.error([e])}var i,a,u},lm=function(e){return e.cHandler},fm=function(e,t){return{name:e,handler:t}},dm=function(t,n,r){var o=e(e({},r),function(e,t){var n={};return L(e,(function(e){n[e.name()]=e.handlers(t)})),n}(n,t));return cm(o,fm)},mm=function(e){var t=function(e){return m(e)?{can:_,abort:O,run:e}:e}(e);return function(e,n){for(var r=[],o=2;o<arguments.length;o++)r[o-2]=arguments[o];var i=[e,n].concat(r);t.abort.apply(void 0,i)?n.stop():t.can.apply(void 0,i)&&t.run.apply(void 0,i)}},gm=function(e,t,n){var r=t[n];return r?sm("Event: "+n,"name",e,r).map((function(e){var t=F(e,(function(e){return e.handler}));return Kr(t)})):function(e,t){return An.error(["The event ("+e+') 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(F(t,(function(e){return e.name})),null,2)])}(n,e)},pm=function(e,t){var n=an(e,(function(e,n){return(1===e.length?An.value(e[0].handler):gm(e,t,n)).map((function(r){var o=mm(r),i=e.length>1?H(t[n],(function(t){return I(e,(function(e){return e.name===t}))})).join(" > "):e[0].name;return Fr(n,function(e,t){return{handler:e,purpose:t}}(o,i))}))}));return Hr(n,{})},hm="alloy.base.behaviour",vm=lr([Sr("dom","dom",{tag:"required",process:{}},lr([Tr("tag"),Nr("styles",{}),Nr("classes",[]),Nr("attributes",{}),Er("value"),Er("innerHtml")])),Tr("components"),Tr("uid"),Nr("events",{}),Nr("apis",{}),Sr("eventOrder","eventOrder",function(e){return Zn(v(e))}((rd={},rd[Ye()]=["disabling",hm,"toggling","typeaheadevents"],rd[qe()]=[hm,"focusing","keying"],rd[et()]=[hm,"disabling","toggling","representing"],rd[Le()]=[hm,"representing","streaming","invalidating"],rd[nt()]=[hm,"representing","item-events","tooltipping"],rd[Re()]=["focusing",hm,"item-type-events"],rd[De()]=["focusing",hm,"item-type-events"],rd[Pe()]=["item-type-events","tooltipping"],rd[Xe()]=["receiving","reflecting","tooltipping"],rd)),dr()),Er("domModification")]),bm=function(e){return e.events},ym=function(e,t){L(t,(function(t){xn(e,t)}))},wm=function(e,t){L(t,(function(t){Sn(e,t)}))},xm=function(e,t){return function(e,t){var n=F(t,(function(e){return Dr(e.name(),[Tr("config"),Nr("state",ho)])})),r=br("component.behaviours",lr(n),e.behaviours).fold((function(t){throw new Error(xr(t)+"\nComplete spec:\n"+JSON.stringify(e,null,2))}),b);return{list:t,data:nn(r,(function(e){var t=e.map((function(e){return{config:e.config,state:e.state.init(e.config)}}));return v(t)}))}}(e,t)},Cm=function(e){var t=function(e){var t=un(e,"behaviours").getOr({});return q(Qt(t),(function(e){var n=t[e];return d(n)?[n.me]:[]}))}(e);return xm(e,t)},Sm=function(t,n,r){var o,i,a,u=e(e({},(o=t).dom),{uid:o.uid,domChildren:F(o.components,(function(e){return e.element}))}),c=function(e){return e.domModification.fold((function(){return lo({})}),lo)}(t),s={"alloy.base.modification":c},l=n.length>0?function(t,n,r,o){var i=e({},n);L(r,(function(e){i[e.name()]=e.exhibit(t,o)}));var a=cm(i,(function(e,t){return{name:e,modification:t}})),u=function(t){return V(t,(function(t,n){return e(e({},n.modification),t)}),{})},c=V(a.classes,(function(e,t){return t.modification.concat(e)}),[]),s=u(a.attributes),l=u(a.styles);return lo({classes:c,attributes:s,styles:l})}(r,s,n,u):c;return a=l,e(e({},i=u),{attributes:e(e({},i.attributes),a.attributes),styles:e(e({},i.styles),a.styles),classes:i.classes.concat(a.classes)})},km=function(e,t,n){var r={"alloy.base.behaviour":bm(e)};return function(e,t,n,r){var o=dm(e,n,r);return pm(o,t)}(n,e.eventOrder,t,r).getOrDie()},Tm=function(e){var t=function(){return l},n=ko(um),r=yr(function(e){return br("custom.definition",vm,e)}(e)),o=Cm(e),i=function(e){return e.list}(o),a=function(e){return e.data}(o),u=function(e){var t=dt.fromTag(e.tag);dn(t,e.attributes),ym(t,e.classes),Bi(t,e.styles),e.innerHtml.each((function(e){return Io(t,e)}));var n=e.domChildren;return zt(t,n),e.value.each((function(e){kd(t,e)})),e.uid,fs(t,e.uid),t}(Sm(r,i,a)),c=km(r,i,a),s=ko(r.components),l={uid:e.uid,getSystem:n.get,config:function(t){var n=a;return(m(n[t.name()])?n[t.name()]:function(){throw new Error("Could not find "+t.name()+" in "+JSON.stringify(e,null,2))})()},hasConfigured:function(e){return m(a[e.name()])},spec:e,readState:function(e){return a[e]().map((function(e){return e.state.readState()})).getOr("not enabled")},getApis:function(){return r.apis},connect:function(e){n.set(e)},disconnect:function(){n.set(am(t))},element:u,syncComponents:function(){var e=Et(u),t=q(e,(function(e){return n.get().getByDom(e).fold((function(){return[]}),Y)}));s.set(t)},components:s.get,events:c};return l},Om=function(n){var r=im(n),o=r.events,i=t(r,["events"]),a=function(e){var t=un(e,"components").getOr([]);return F(t,Dm)}(i),u=e(e({},i),{events:e(e({},om),o),components:a});return An.value(Tm(u))},_m=function(e){var t=dt.fromText(e);return Em({element:t})},Em=function(e){var t=wr("external.component",sr([Tr("element"),Er("uid")]),e),n=ko(am()),r=t.uid.getOrThunk((function(){return ms("external")}));fs(t.element,r);var o={uid:r,getSystem:n.get,config:M.none,hasConfigured:O,connect:function(e){n.set(e)},disconnect:function(){n.set(am((function(){return o})))},getApis:function(){return{}},element:t.element,spec:e,readState:v("No state"),syncComponents:p,components:v([]),events:{}};return is(o)},Am=ms,Dm=function(t){return function(e){return un(e,os)}(t).getOrThunk((function(){var n=function(e){return cn(e,"uid")}(t)?t:e({uid:Am("")},t);return Om(n).getOrDie()}))},Mm=is,Nm="alloy.item-hover",Rm="alloy.item-focus",zm=function(e){(Eo(e.element).isNone()||Mi.isFocused(e))&&(Mi.isFocused(e)||Mi.focus(e),ut(e,Nm,{item:e}))},Bm=function(e){ut(e,Rm,{item:e})},Pm=v(Nm),Im=v(Rm),Fm=[Tr("data"),Tr("components"),Tr("dom"),Nr("hasSubmenu",!1),Er("toggling"),bc("itemBehaviours",[wi,Mi,gc,nl]),Nr("ignoreFocus",!1),Nr("domModification",{}),oi("builder",(function(t){return{dom:t.dom,domModification:e(e({},t.domModification),{attributes:e(e(e({role:t.toggling.isSome()?"menuitemcheckbox":"menuitem"},t.domModification.attributes),{"aria-haspopup":t.hasSubmenu}),t.hasSubmenu?{"aria-expanded":!1}:{})}),behaviours:yc(t.itemBehaviours,[t.toggling.fold(wi.revoke,(function(t){return wi.config(e({aria:{mode:"checked"}},t))})),Mi.config({ignore:t.ignoreFocus,stopMousedown:t.ignoreFocus,onFocus:function(e){Bm(e)}}),gc.config({mode:"execution"}),nl.config({store:{mode:"memory",initialValue:t.data}}),vd("item-type-events",n(n([],Oi(),!0),[Jr(Pe(),zm),Jr(Je(),Mi.focus)],!1))]),components:t.components,eventOrder:t.eventOrder}})),Nr("eventOrder",{})],Lm=[Tr("dom"),Tr("components"),oi("builder",(function(e){return{dom:e.dom,components:e.components,events:Xr([no(Je())])}}))],Hm=v("item-widget"),Vm=v([$c({name:"widget",overrides:function(e){return{behaviours:bo([nl.config({store:{mode:"manual",getValue:function(t){return e.data},setValue:p}})])}}})]),jm=[Tr("uid"),Tr("data"),Tr("components"),Tr("dom"),Nr("autofocus",!1),Nr("ignoreFocus",!1),bc("widgetBehaviours",[nl,Mi,gc]),Nr("domModification",{}),rs(Vm()),oi("builder",(function(e){var t=Zc(Hm(),e,Vm()),n=Qc(Hm(),e,t.internals()),r=function(t){return es(t,e,"widget").map((function(e){return gc.focusIn(e),e}))},o=function(t,n){return Va(n.event.target)?M.none():e.autofocus?(n.setSource(t.element),M.none()):M.none()};return{dom:e.dom,components:n,domModification:e.domModification,events:Xr([uo((function(e,t){r(e).each((function(e){t.stop()}))})),Jr(Pe(),zm),Jr(Je(),(function(t,n){e.autofocus?r(t):Mi.focus(t)}))]),behaviours:yc(e.widgetBehaviours,[nl.config({store:{mode:"memory",initialValue:e.data}}),Mi.config({ignore:e.ignoreFocus,onFocus:function(e){Bm(e)}}),gc.config({mode:"special",focusIn:e.autofocus?function(e){r(e)}:Co(),onLeft:o,onRight:o,onEscape:function(t,n){return Mi.isFocused(t)||e.autofocus?e.autofocus?(n.setSource(t.element),M.none()):M.none():(Mi.focus(t),M.some(!0))}})])}}))],Um=Cr("type",{widget:jm,item:Fm,separator:Lm}),Wm=v([Gc({factory:{sketch:function(e){var t=wr("menu.spec item",Um,e);return t.builder(t)}},name:"items",unit:"item",defaults:function(t,n){return cn(n,"uid")?n:e(e({},n),{uid:ms("item")})},overrides:function(e,t){return{type:t.type,ignoreFocus:e.fakeFocus,domModification:{classes:[e.markers.item]}}}})]),$m=v([Tr("value"),Tr("items"),Tr("dom"),Tr("components"),Nr("eventOrder",{}),pc("menuBehaviours",[Ra,nl,wd,gc]),Rr("movement",{mode:"menu",moveOnTab:!0},Cr("mode",{grid:[ai(),oi("config",(function(e,t){return{mode:"flatgrid",selector:"."+e.markers.item,initSize:{numColumns:t.initSize.numColumns,numRows:t.initSize.numRows},focusManager:e.focusManager}}))],matrix:[oi("config",(function(e,t){return{mode:"matrix",selectors:{row:t.rowSelector,cell:"."+e.markers.item},focusManager:e.focusManager}})),Tr("rowSelector")],menu:[Nr("moveOnTab",!0),oi("config",(function(e,t){return{mode:"menu",selector:"."+e.markers.item,moveOnTab:t.moveOnTab,focusManager:e.focusManager}}))]})),Or("markers",Jo()),Nr("fakeFocus",!1),Nr("focusManager",Ba()),ei("onHighlight")]),qm=v("alloy.menu-focus"),Gm=ws({name:"Menu",configFields:$m(),partFields:Wm(),factory:function(e,t,n,r){return{uid:e.uid,dom:e.dom,markers:e.markers,behaviours:vc(e.menuBehaviours,[Ra.config({highlightClass:e.markers.selectedItem,itemClass:e.markers.item,onHighlight:e.onHighlight}),nl.config({store:{mode:"memory",initialValue:e.value}}),wd.config({find:M.some}),gc.config(e.movement.config(e,e.movement))]),events:Xr([Jr(Im(),(function(e,t){var n=t.event;e.getSystem().getByDom(n.target).each((function(n){Ra.highlight(e,n),t.stop(),ut(e,qm(),{menu:e,item:n})}))})),Jr(Pm(),(function(e,t){var n=t.event.item;Ra.highlight(e,n)}))]),components:t,eventOrder:e.eventOrder,domModification:{attributes:{role:"menu"}}}}}),Km=function(e,t){var n=Ht(t),r=_o(n).bind((function(e){var n,r,o=function(t){return vt(e,t)};return o(t)?M.some(t):(n=o,(r=function(e){for(var t=0;t<e.childNodes.length;t++){var o=dt.fromDom(e.childNodes[t]);if(n(o))return M.some(o);var i=r(e.childNodes[t]);if(i.isSome())return i}return M.none()})(t.dom))})),o=e(t);return r.each((function(e){_o(n).filter((function(t){return vt(t,e)})).fold((function(){To(e)}),p)})),o},Xm=function(e,t,n,r){var o=e.getSystem().build(r);Yt(e,o,n)},Ym=function(e,t,n,r){var o=Jm(e),i=U(o,(function(e){return vt(r.element,e.element)}));i.each(Jt)},Jm=function(e,t){return e.components()},Zm=function(e,t,n,r,o){var i=Jm(e);return M.from(i[r]).map((function(t){return Ym(e,0,0,t),o.each((function(t){Xm(e,0,(function(e,t){!function(e,t,n){At(e,n).fold((function(){Rt(e,t)}),(function(e){Dt(e,t)}))}(e,t,r)}),t)})),t}))},Qm=Object.freeze({__proto__:null,append:function(e,t,n,r){Xm(e,0,Rt,r)},prepend:function(e,t,n,r){Xm(e,0,Nt,r)},remove:Ym,replaceAt:Zm,replaceBy:function(e,t,n,r,o){var i=Jm(e);return W(i,r).bind((function(t){return Zm(e,0,0,t,o)}))},set:function(e,t,n,r){Km((function(){var t=F(r,e.getSystem().build);Xt(e,t)}),e.element)},contents:Jm}),eg=wo({fields:[],name:"replacing",apis:Qm}),tg=function(e,t,n,r){return un(n,r).bind((function(r){return un(e,r).bind((function(r){var o=tg(e,t,n,r);return M.some([r].concat(o))}))})).getOr([])},ng=function(e,t){var n={};tn(e,(function(e,t){L(e,(function(e){n[e]=t}))}));var r=t,o=rn(t,(function(e,t){return{k:e,v:t}})),i=nn(o,(function(e,t){return[t].concat(tg(n,r,o,t))}));return nn(n,(function(e){return un(i,e).getOr([e])}))},rg=function(e){return"prepared"===e.type?M.some(e.menu):M.none()},og={init:function(){var t=ko({}),n=ko({}),r=ko({}),o=Xa(),i=ko({}),a=function(e){return function(e,t){for(var n=Qt(e),r=0,o=n.length;r<o;r++){var i=n[r],a=e[i];if(t(a,i,e))return M.some(a)}return M.none()}(t.get(),(function(t,n){return t===e}))},u=function(e){return c(e).bind(rg)},c=function(e){return un(n.get(),e)},s=function(e){return un(t.get(),e)};return{setMenuBuilt:function(t,r){var o;n.set(e(e({},n.get()),((o={})[t]={type:"prepared",menu:r},o)))},setContents:function(e,a,u,c){o.set(e),t.set(u),n.set(a),i.set(c);var s=ng(c,u);r.set(s)},expand:function(e){return un(t.get(),e).map((function(t){var n=un(r.get(),e).getOr([]);return[t].concat(n)}))},refresh:function(e){return un(r.get(),e)},collapse:function(e){return un(r.get(),e).bind((function(e){return e.length>1?M.some(e.slice(1)):M.none()}))},lookupMenu:c,lookupItem:s,otherMenus:function(e){var t=i.get();return X(Qt(t),e)},getPrimary:function(){return o.get().bind(u)},getMenus:function(){return n.get()},clear:function(){t.set({}),n.set({}),r.set({}),o.clear()},isClear:function(){return o.get().isNone()},getTriggeringPath:function(e,t){var n=H(s(e).toArray(),(function(e){return u(e).isSome()}));return un(r.get(),e).bind((function(e){var r=K(n.concat(e)),i=q(r,(function(e,n){return function(e,t,n){return u(e).bind((function(r){return a(e).bind((function(e){return t(e).map((function(e){return{triggeredMenu:r,triggeringItem:e,triggeringPath:n}}))}))}))}(e,t,r.slice(0,n+1)).fold((function(){return Vr(o.get(),e)?[]:[M.none()]}),(function(e){return[M.some(e)]}))}));return function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];if(!r.isSome())return M.none();t.push(r.getOrDie())}return M.some(t)}(i)}))}}},extractPreparedMenu:rg},ig=v("collapse-item"),ag=ys({name:"TieredMenu",configFields:[ri("onExecute"),ri("onEscape"),ni("onOpenMenu"),ni("onOpenSubmenu"),ei("onRepositionMenu"),ei("onCollapseMenu"),Nr("highlightImmediately",!0),_r("data",[Tr("primary"),Tr("menus"),Tr("expansions")]),Nr("fakeFocus",!1),ei("onHighlight"),ei("onHover"),_r("markers",[Tr("backgroundMenu")].concat(Ko()).concat(Xo())),Tr("dom"),Nr("navigateOnHover",!0),Nr("stayInDom",!1),pc("tmenuBehaviours",[gc,Ra,wd,eg]),Nr("eventOrder",{})],apis:{collapseMenu:function(e,t){e.collapseMenu(t)},highlightPrimary:function(e,t){e.highlightPrimary(t)},repositionMenus:function(e,t){e.repositionMenus(t)}},factory:function(t,n){var r,o=Xa(),i=og.init(),a=function(n){var r=function(n,r,o){return nn(o,(function(o,i){var a=function(){return Gm.sketch(e(e({},o),{value:i,markers:t.markers,fakeFocus:t.fakeFocus,onHighlight:t.onHighlight,focusManager:t.fakeFocus?Pa():Ba()}))};return i===r?{type:"prepared",menu:n.getSystem().build(a())}:{type:"notbuilt",nbMenu:a}}))}(n,t.data.primary,t.data.menus),o=c();return i.setContents(t.data.primary,r,t.data.expansions,o),i.getPrimary()},u=function(e){return nl.getValue(e).value},c=function(e){return nn(t.data.menus,(function(e,t){return q(e.items,(function(e){return"separator"===e.type?[]:[e.data.value]}))}))},s=function(e,t){Ra.highlight(e,t),Ra.getHighlighted(t).orThunk((function(){return Ra.getFirst(t)})).each((function(t){st(e,t.element,Je())}))},l=function(e,t){return jr(F(t,(function(t){return e.lookupMenu(t).bind((function(e){return"prepared"===e.type?M.some(e.menu):M.none()}))})))},f=function(e,n,r){var o=l(n,n.otherMenus(r));L(o,(function(n){wm(n.element,[t.markers.backgroundMenu]),t.stayInDom||eg.remove(e,n)}))},d=function(e,n){var r=function(e){return o.get().getOrThunk((function(){var n={},r=Ki(e.element,"."+t.markers.item),i=H(r,(function(e){return"true"===mn(e,"aria-haspopup")}));return L(i,(function(t){e.getSystem().getByDom(t).each((function(e){var t=u(e);n[t]=e}))})),o.set(n),n}))}(e);tn(r,(function(e,t){var r=P(n,t);fn(e.element,"aria-expanded",r)}))},m=function(e,n,r){return M.from(r[0]).bind((function(o){return n.lookupMenu(o).bind((function(o){if("notbuilt"===o.type)return M.none();var i=o.menu,a=l(n,r.slice(1));return L(a,(function(e){xn(e.element,t.markers.backgroundMenu)})),Ut(i.element)||eg.append(e,Mm(i)),wm(i.element,[t.markers.backgroundMenu]),s(e,i),f(e,n,r),M.some(i)}))}))};!function(e){e[e.HighlightSubmenu=0]="HighlightSubmenu",e[e.HighlightParent=1]="HighlightParent"}(r||(r={}));var g=function(e,n,o){if(void 0===o&&(o=r.HighlightSubmenu),n.hasConfigured(Kd)&&Kd.isDisabled(n))return M.some(n);var a=u(n);return i.expand(a).bind((function(a){return d(e,a),M.from(a[0]).bind((function(u){return i.lookupMenu(u).bind((function(c){var s=function(e,t,n){if("notbuilt"===n.type){var r=e.getSystem().build(n.nbMenu());return i.setMenuBuilt(t,r),r}return n.menu}(e,u,c);return Ut(s.element)||eg.append(e,Mm(s)),t.onOpenSubmenu(e,n,s,K(a)),o===r.HighlightSubmenu?(Ra.highlightFirst(s),m(e,i,a)):(Ra.dehighlightAll(s),M.some(n))}))}))}))},h=function(e,n){var r=u(n);return i.collapse(r).bind((function(r){return d(e,r),m(e,i,r).map((function(r){return t.onCollapseMenu(e,n,r),r}))}))},v=function(e){return function(n,r){return ta(r.getSource(),"."+t.markers.item).bind((function(t){return n.getSystem().getByDom(t).toOptional().bind((function(t){return e(n,t).map(_)}))}))}},y=Xr([Jr(qm(),(function(e,t){var n=t.event.item;i.lookupItem(u(n)).each((function(){var n=t.event.menu;Ra.highlight(e,n);var r=u(t.event.item);i.refresh(r).each((function(t){return f(e,i,t)}))}))})),uo((function(e,n){var o=n.event.target;e.getSystem().getByDom(o).each((function(n){0===u(n).indexOf("collapse-item")&&h(e,n),g(e,n,r.HighlightSubmenu).fold((function(){t.onExecute(e,n)}),p)}))})),oo((function(e,n){a(e).each((function(n){eg.append(e,Mm(n)),t.onOpenMenu(e,n),t.highlightImmediately&&s(e,n)}))}))].concat(t.navigateOnHover?[Jr(Pm(),(function(e,n){var o=n.event.item;!function(e,t){var n=u(t);i.refresh(n).bind((function(t){return d(e,t),m(e,i,t)}))}(e,o),g(e,o,r.HighlightParent),t.onHover(e,o)}))]:[])),w=function(e){return Ra.getHighlighted(e).bind(Ra.getHighlighted)},x={collapseMenu:function(e){w(e).each((function(t){h(e,t)}))},highlightPrimary:function(e){i.getPrimary().each((function(t){s(e,t)}))},repositionMenus:function(e){var n=i.getPrimary().bind((function(t){return w(e).bind((function(e){var t,n=u(e),r=(t=i.getMenus(),an(t,b)),o=jr(F(r,og.extractPreparedMenu));return i.getTriggeringPath(n,(function(e){return function(e,t,n){return Z(t,(function(e){if(!e.getSystem().isConnected())return M.none();var t=Ra.getCandidates(e);return U(t,(function(e){return u(e)===n}))}))}(0,o,e)}))})).map((function(e){return{primary:t,triggeringPath:e}}))}));n.fold((function(){(function(e){return M.from(e.components()[0]).filter((function(e){return"menu"===mn(e.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:vc(t.tmenuBehaviours,[gc.config({mode:"special",onRight:v((function(e,t){return Va(t.element)?M.none():g(e,t,r.HighlightSubmenu)})),onLeft:v((function(e,t){return Va(t.element)?M.none():h(e,t)})),onEscape:v((function(e,n){return h(e,n).orThunk((function(){return t.onEscape(e,n).map((function(){return e}))}))})),focusIn:function(e,t){i.getPrimary().each((function(t){st(e,t.element,Je())}))}}),Ra.config({highlightClass:t.markers.selectedMenu,itemClass:t.markers.menu}),wd.config({find:function(e){return Ra.getHighlighted(e)}}),eg.config({})]),eventOrder:t.eventOrder,apis:x,events:y}},extraApis:{tieredData:function(e,t,n){return{primary:e,menus:t,expansions:n}},singleData:function(e,t){return{primary:e,menus:Fr(e,t),expansions:{}}},collapseItem:function(e){return{value:Dc(ig()),meta:{text:e}}}}}),ug=function(e,t,n,r){return un(t.routes,r.start).bind((function(e){return un(e,r.destination)}))},cg=function(e,t,n,r){return ug(0,t,0,r).bind((function(e){return e.transition.map((function(t){return{transition:t,route:e}}))}))},sg=function(e,t,n){(function(e,t,n){return lg(e,t).bind((function(r){return cg(e,t,n,r)}))})(e,t,n).each((function(n){var r=n.transition;Sn(e.element,r.transitionClass),hn(e.element,t.destinationAttr)}))},lg=function(e,t,n){var r=e.element;return gn(r,t.destinationAttr).map((function(n){return{start:mn(e.element,t.stateAttr),destination:n}}))},fg=function(e,t,n,r){sg(e,t,n),pn(e.element,t.stateAttr)&&mn(e.element,t.stateAttr)!==r&&t.onFinish(e,r),fn(e.element,t.stateAttr,r)},dg=Object.freeze({__proto__:null,findRoute:ug,disableTransition:sg,getCurrentRoute:lg,jumpTo:fg,progressTo:function(e,t,n,r){!function(e,t,n,r){pn(e.element,t.destinationAttr)&&(gn(e.element,t.destinationAttr).each((function(n){fn(e.element,t.stateAttr,n)})),hn(e.element,t.destinationAttr))}(e,t);var o=function(e,t,n,r){return{start:mn(e.element,t.stateAttr),destination:r}}(e,t,0,r);cg(e,t,n,o).fold((function(){fg(e,t,n,r)}),(function(o){sg(e,t,n);var i=o.transition;xn(e.element,i.transitionClass),fn(e.element,t.destinationAttr,r)}))},getState:function(e,t,n){return gn(e.element,t.stateAttr)}}),mg=Object.freeze({__proto__:null,events:function(e,t){return Xr([Jr(je(),(function(n,r){var o=r.event.raw;lg(n,e).each((function(r){ug(0,e,0,r).each((function(i){i.transition.each((function(i){o.propertyName===i.property&&(fg(n,e,t,r.destination),e.onTransition(n,r))}))}))}))})),oo((function(n,r){fg(n,e,t,e.initialState)}))])}}),gg=[Nr("destinationAttr","data-transitioning-destination"),Nr("stateAttr","data-transitioning-state"),Tr("initialState"),ei("onTransition"),ei("onFinish"),Or("routes",vr(An.value,vr(An.value,sr([Mr("transition",[Tr("property"),Tr("transitionClass")])]))))],pg=wo({fields:gg,name:"transitioning",active:mg,apis:dg,extra:{createRoutes:function(e){var t={};return tn(e,(function(e,n){var r=n.split("<->");t[r[0]]=Fr(r[1],e),t[r[1]]=Fr(r[0],e)})),t},createBistate:function(e,t,n){return Lr([{key:e,value:Fr(t,n)},{key:t,value:Fr(e,n)}])},createTristate:function(e,t,n,r){return Lr([{key:e,value:Lr([{key:t,value:r},{key:n,value:r}])},{key:t,value:Lr([{key:e,value:r},{key:n,value:r}])},{key:n,value:Lr([{key:e,value:r},{key:t,value:r}])}])}}}),hg=Ti("scrollable"),vg=function(e){xn(e,hg)},bg=function(e){Sn(e,hg)},yg=hg,wg=function(e){return un(e,"format").getOr(e.title)},xg=function(e,t,n,r,o){return{data:{value:e,text:t},type:"item",dom:{tag:"div",classes:o?[Ti("styles-item-is-menu")]:[]},toggling:{toggleOnExecute:!1,toggleClass:Ti("format-matches"),selected:n},itemBehaviours:bo(o?[]:[xi(e,(function(e,t){(t?wi.on:wi.off)(e)}))]),components:[{dom:{tag:"div",attributes:{style:r},innerHtml:t}}]}},Cg=function(e,t,n,r){return{value:e,dom:{tag:"div"},components:[xs.sketch({dom:{tag:"div",classes:[Ti("styles-collapser")]},components:r?[{dom:{tag:"span",classes:[Ti("styles-collapse-icon")]}},_m(e)]:[_m(e)],action:function(e){if(r){var t=n().get(e);ag.collapseMenu(t)}}}),{dom:{tag:"div",classes:[Ti("styles-menu-items-container")]},components:[Gm.parts.items({})],behaviours:bo([vd("adhoc-scrollable-menu",[oo((function(e,t){zi(e.element,"overflow-y","auto"),zi(e.element,"-webkit-overflow-scrolling","touch"),vg(e.element)})),io((function(e){Li(e.element,"overflow-y"),Li(e.element,"-webkit-overflow-scrolling"),bg(e.element)}))])])}],items:t,menuBehaviours:bo([pg.config({initialState:"after",routes:pg.createTristate("before","current","after",{transition:{property:"transform",transitionClass:"transitioning"}})})])}},Sg=function(e){var t,n,r,o,i,a=(t=e.formats,n=function(){return u},r=Cg("Styles",[].concat(F(t.items,(function(e){return xg(wg(e),e.title,e.isSelected(),e.getPreview(),sn(t.expansions,wg(e)))}))),n,!1),o=nn(t.menus,(function(e,r){var o=F(e,(function(e){return xg(wg(e),e.title,void 0!==e.isSelected&&e.isSelected(),void 0!==e.getPreview?e.getPreview():"",sn(t.expansions,wg(e)))}));return Cg(r,o,n,!0)})),i=Kn(o,Fr("styles",r)),{tmenu:ag.tieredData("styles",i,t.expansions)}),u=Zf(ag.sketch({dom:{tag:"div",classes:[Ti("styles-menu")]},components:[],fakeFocus:!0,stayInDom:!0,onExecute:function(t,n){var r=nl.getValue(n);return e.handle(n,r.value),M.none()},onEscape:function(){return M.none()},onOpenMenu:function(e,t){var n=il(e.element);ol(t.element,n),pg.jumpTo(t,"current")},onOpenSubmenu:function(e,t,n){var r=il(e.element),o=Qi(t.element,'[role="menu"]').getOrDie("hacky"),i=e.getSystem().getByDom(o).getOrDie();ol(n.element,r),pg.progressTo(i,"before"),pg.jumpTo(n,"after"),pg.progressTo(n,"current")},onCollapseMenu:function(e,t,n){var r=Qi(t.element,'[role="menu"]').getOrDie("hacky"),o=e.getSystem().getByDom(r).getOrDie();pg.progressTo(o,"after"),pg.progressTo(n,"current")},navigateOnHover:!1,highlightImmediately:!0,data:a.tmenu,markers:{backgroundMenu:Ti("styles-background-menu"),menu:Ti("styles-menu"),selectedMenu:Ti("styles-selected-menu"),item:Ti("styles-item"),selectedItem:Ti("styles-selected-item")}}));return u.asSpec()},kg=function(e){return sn(e,"items")?function(e){var t=Kn(Ir(e,["items"]),{menu:!0}),n=Tg(e.items);return{item:t,menus:Kn(n.menus,Fr(e.title,n.items)),expansions:Kn(n.expansions,Fr(e.title,e.title))}}(e):{item:e,menus:{},expansions:{}}},Tg=function(e){return V(e,(function(e,t){var n=kg(t);return{menus:Kn(e.menus,n.menus),items:[n.item].concat(e.items),expansions:Kn(e.expansions,n.expansions)}}),{menus:{},expansions:{},items:[]})},Og=function(e){var t=function(t){return function(){return e.formatter.match(t)}},n=function(t){return function(){return e.formatter.getCssText(t)}},r=function(o){return F(o,(function(o){if(sn(o,"items")){var i=r(o.items);return Kn(function(e){return Kn(e,{isSelected:O,getPreview:v("")})}(o),{items:i})}return sn(o,"format")?function(e){return Kn(e,{isSelected:t(e.format),getPreview:n(e.format)})}(o):function(r){var o=Dc(r.title),i=Kn(r,{format:o,isSelected:t(o),getPreview:n(o)});return e.formatter.register(o,i),i}(o)}))};return r(function(e){return e.getParam("style_formats",Mo,"array")}(e))},_g=function(e,t,n){var r=function(e,t){var n=function(t){return q(t,(function(t){return void 0!==t.items?n(t.items).length>0?[t]:[]:!sn(t,"format")||e.formatter.canApply(t.format)?[t]:[]}))},r=n(t);return Tg(r)}(e,t);return Sg({formats:r,handle:function(t,r){e.undoManager.transact((function(){wi.isOn(t)?e.formatter.remove(r):e.formatter.apply(r)})),n()}})},Eg=function(e){var t=e.replace(/\|/g," ").trim();return t.length>0?t.split(/\s+/):[]},Ag=function(e){return q(e,(function(e){return c(e)?Ag(e):Eg(e)}))},Dg=function(e){var t=function(e){return e.getParam("toolbar",No,"array")}(e);return c(t)?Ag(t):Eg(t)},Mg=function(e,t){var n=function(e){return function(){return function(e,t){return Ds(t,(function(){e.execCommand(t)}),{},e)}(t,e)}},r=function(e){return function(){return function(e,t){var n=_s(t);return Ds(t,(function(){e.execCommand(t)}),n,e)}(t,e)}},o=function(e,n,r){return function(){return Es(t,e,n,r)}},i=n("undo"),a=n("redo"),u=r("bold"),c=r("italic"),s=r("underline"),l=n("removeformat"),f=o("unlink","link",(function(){t.execCommand("unlink",null,!1)})),d=o("unordered-list","ul",(function(){t.execCommand("InsertUnorderedList",null,!1)})),m=o("ordered-list","ol",(function(){t.execCommand("InsertOrderedList",null,!1)})),g=Og(t),p=function(){return _g(t,g,(function(){t.fire("scrollIntoView")}))},h=function(e,n){return{isSupported:function(){var n=t.ui.registry.getAll().buttons;return e.forall((function(e){return sn(n,e)}))},sketch:n}};return{undo:h(M.none(),i),redo:h(M.none(),a),bold:h(M.none(),u),italic:h(M.none(),c),underline:h(M.none(),s),removeformat:h(M.none(),l),link:h(M.none(),(function(){return nm(e,t)})),unlink:h(M.none(),f),image:h(M.none(),(function(){return ud(t)})),bullist:h(M.some("bullist"),d),numlist:h(M.some("numlist"),m),fontsizeselect:h(M.none(),(function(){return function(e,t){var n={onChange:function(e){$f(t,e)},getInitialValue:function(){return Wf(t)}};return Ff(e,"font-size",(function(){return Jf(n)}),t)}(e,t)})),forecolor:h(M.none(),(function(){return Hf(e,t)})),styleselect:h(M.none(),(function(){return Ds("style-formats",(function(n){t.fire("toReading"),e.dropup.appear(p,wi.on,n)}),bo([wi.config({toggleClass:Ti("toolbar-button-selected"),toggleOnExecute:!1,aria:{mode:"pressed"}}),ci.config({channels:Lr([Si(zo,wi.off),Si(Bo,wi.off)])})]),t)}))}},Ng=function(e){var t=dt.fromDom(function(e){if(Lt()&&d(e.target)){var t=dt.fromDom(e.target);if(xt(t)&&jt(t)&&e.composed&&e.composedPath){var n=e.composedPath();if(n)return J(n)}}return M.from(e.target)}(e).getOr(e.target)),n=function(){return e.stopPropagation()},r=function(){return e.preventDefault()},o=h(r,n);return function(e,t,n,r,o,i,a){return{target:e,x:t,y:n,stop:r,prevent:o,kill:i,raw:a}}(t,e.clientX,e.clientY,n,r,o,e)},Rg=function(e,t,n,r,o){var i=function(e,t){return function(n){e(n)&&t(Ng(n))}}(n,r);return e.dom.addEventListener(t,i,o),{unbind:w(zg,e,t,i,o)}},zg=function(e,t,n,r){e.dom.removeEventListener(t,n,r)},Bg=_,Pg=function(e,t,n){return function(e,t,n,r){return Rg(e,t,n,r,!1)}(e,t,Bg,n)},Ig=function(e,t,n){return function(e,t,n,r){return Rg(e,t,n,r,!0)}(e,t,Bg,n)},Fg=tinymce.util.Tools.resolve("tinymce.util.Delay"),Lg=function(e){var t=e.matchMedia("(orientation: portrait)").matches;return{isPortrait:v(t)}},Hg=function(e){var t=Ee().os.isiOS(),n=Lg(e).isPortrait();return t&&!n?e.screen.height:e.screen.width},Vg=function(e,t){var n=dt.fromDom(e),r=null,o=Pg(n,"orientationchange",(function(){Fg.clearInterval(r);var n=Lg(e);t.onChange(n),i((function(){t.onReady(n)}))})),i=function(t){Fg.clearInterval(r);var n=e.innerHeight,o=0;r=Fg.setInterval((function(){n!==e.innerHeight?(Fg.clearInterval(r),t(M.some(e.innerHeight))):o>20&&(Fg.clearInterval(r),t(M.none())),o++}),50)};return{onAdjustment:i,destroy:function(){o.unbind()}}},jg=function(e,t,n){var r,o=e.document.createRange();return r=o,t.fold((function(e){r.setStartBefore(e.dom)}),(function(e,t){r.setStart(e.dom,t)}),(function(e){r.setStartAfter(e.dom)})),function(e,t){t.fold((function(t){e.setEndBefore(t.dom)}),(function(t,n){e.setEnd(t.dom,n)}),(function(t){e.setEndAfter(t.dom)}))}(o,n),o},Ug=function(e,t,n,r,o){var i=e.document.createRange();return i.setStart(t.dom,n),i.setEnd(r.dom,o),i},Wg=function(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom,width:e.width,height:e.height}},$g=Br([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),qg=function(e,t,n){return t(dt.fromDom(n.startContainer),n.startOffset,dt.fromDom(n.endContainer),n.endOffset)},Gg=function(e,t){var n=function(e,t){return t.match({domRange:function(e){return{ltr:v(e),rtl:M.none}},relative:function(t,n){return{ltr:N((function(){return jg(e,t,n)})),rtl:N((function(){return M.some(jg(e,n,t))}))}},exact:function(t,n,r,o){return{ltr:N((function(){return Ug(e,t,n,r,o)})),rtl:N((function(){return M.some(Ug(e,r,o,t,n))}))}}})}(e,t);return function(e,t){var n=t.ltr();return n.collapsed?t.rtl().filter((function(e){return!1===e.collapsed})).map((function(e){return $g.rtl(dt.fromDom(e.endContainer),e.endOffset,dt.fromDom(e.startContainer),e.startOffset)})).getOrThunk((function(){return qg(0,$g.ltr,n)})):qg(0,$g.ltr,n)}(0,n)};$g.ltr,$g.rtl;var Kg=function(e,t,n,r){return{start:e,soffset:t,finish:n,foffset:r}},Xg=function(e,t){var n=function(t){return e(t)?M.from(t.dom.nodeValue):M.none()};return{get:function(r){if(!e(r))throw new Error("Can only get "+t+" value of a "+t+" node");return n(r).getOr("")},getOption:n,set:function(n,r){if(!e(n))throw new Error("Can only set raw "+t+" value of a "+t+" node");n.dom.nodeValue=r}}}(Ct,"text"),Yg=function(e){return"img"===yt(e)?1:function(e){return Xg.getOption(e)}(e).fold((function(){return Et(e).length}),(function(e){return e.length}))},Jg=Br([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Zg={before:Jg.before,on:Jg.on,after:Jg.after,cata:function(e,t,n,r){return e.fold(t,n,r)},getStart:function(e){return e.fold(b,b,b)}},Qg=Br([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),ep={domRange:Qg.domRange,relative:Qg.relative,exact:Qg.exact,exactFromRange:function(e){return Qg.exact(e.start,e.soffset,e.finish,e.foffset)},getWin:function(e){var t=function(e){return e.match({domRange:function(e){return dt.fromDom(e.startContainer)},relative:function(e,t){return Zg.getStart(e)},exact:function(e,t,n,r){return e}})}(e);return function(e){return dt.fromDom(Ot(e).dom.defaultView)}(t)},range:Kg},tp=function(e,t){var n=yt(e);return"input"===n?Zg.after(e):P(["br","img"],n)?0===t?Zg.before(e):Zg.after(e):Zg.on(e,t)},np=function(e,t,n,r){var o=function(e,t,n,r){var o=Tt(e).dom.createRange();return o.setStart(e.dom,t),o.setEnd(n.dom,r),o}(e,t,n,r),i=vt(e,n)&&t===r;return o.collapsed&&!i},rp=function(e){return M.from(e.getSelection())},op=function(e,t,n,r,o){!function(e,t){rp(e).each((function(e){e.removeAllRanges(),e.addRange(t)}))}(e,Ug(e,t,n,r,o))},ip=function(e,t,n,r,o){var i=function(e,t,n,r){var o=tp(e,t),i=tp(n,r);return ep.relative(o,i)}(t,n,r,o);!function(e,t){Gg(e,t).match({ltr:function(t,n,r,o){op(e,t,n,r,o)},rtl:function(t,n,r,o){rp(e).each((function(i){if(i.setBaseAndExtent)i.setBaseAndExtent(t.dom,n,r.dom,o);else if(i.extend)try{!function(e,t,n,r,o,i){t.collapse(n.dom,r),t.extend(o.dom,i)}(0,i,t,n,r,o)}catch(i){op(e,r,o,t,n)}else op(e,r,o,t,n)}))}})}(e,i)},ap=function(e){if(e.rangeCount>0){var t=e.getRangeAt(0),n=e.getRangeAt(e.rangeCount-1);return M.some(Kg(dt.fromDom(t.startContainer),t.startOffset,dt.fromDom(n.endContainer),n.endOffset))}return M.none()},up=function(e){if(null===e.anchorNode||null===e.focusNode)return ap(e);var t=dt.fromDom(e.anchorNode),n=dt.fromDom(e.focusNode);return np(t,e.anchorOffset,n,e.focusOffset)?M.some(Kg(t,e.anchorOffset,n,e.focusOffset)):ap(e)},cp=function(e){return rp(e).filter((function(e){return e.rangeCount>0})).bind(up)},sp=function(e,t){var n=function(e,t){return Gg(e,t).match({ltr:function(t,n,r,o){var i=e.document.createRange();return i.setStart(t.dom,n),i.setEnd(r.dom,o),i},rtl:function(t,n,r,o){var i=e.document.createRange();return i.setStart(r.dom,o),i.setEnd(t.dom,n),i}})}(e,t);return function(e){var t=e.getClientRects(),n=t.length>0?t[0]:e.getBoundingClientRect();return n.width>0||n.height>0?M.some(n).map(Wg):M.none()}(n)},lp=function(e){return M.from(e.dom.contentWindow)},fp=function(e){return lp(e).bind(cp)},dp=function(e){return e.getFrame()},mp=function(e,t,n,r){return e[n].getOrThunk((function(){return function(e){return Pg(t,r,e)}}))},gp=function(e){var t=dp(e);return function(e){return M.some(dt.fromDom(e.dom.contentWindow.document.body))}(t).bind((function(n){return function(e){return M.some(dt.fromDom(e.dom.contentWindow.document))}(t).bind((function(r){return lp(t).map((function(o){var i=dt.fromDom(r.dom.documentElement),a=e.getCursorBox.getOrThunk((function(){return function(){return function(e){return cp(e).map((function(e){return ep.exact(e.start,e.soffset,e.finish,e.foffset)}))}(o).bind((function(e){return sp(o,e).orThunk((function(){return function(e){return cp(e).filter((function(e){return vt(e.start,e.finish)&&e.soffset===e.foffset})).bind((function(e){var t=e.start.dom.getBoundingClientRect();return t.width>0||t.height>0?M.some(t):M.none()}))}(o)}))}))}})),u=e.setSelection.getOrThunk((function(){return function(e,t,n,r){ip(o,e,t,n,r)}})),c=e.clearSelection.getOrThunk((function(){return function(){!function(e){rp(e).each((function(e){return e.removeAllRanges()}))}(o)}}));return{body:n,doc:r,win:o,html:i,getSelection:w(fp,t),setSelection:u,clearSelection:c,frame:t,onKeyup:mp(e,r,"onKeyup","keyup"),onNodeChanged:mp(e,r,"onNodeChanged","SelectionChange"),onDomChanged:e.onDomChanged,onScrollToCursor:e.onScrollToCursor,onScrollToElement:e.onScrollToElement,onToReading:e.onToReading,onToEditing:e.onToEditing,onToolbarScrollStart:e.onToolbarScrollStart,onTouchContent:e.onTouchContent,onTapContent:e.onTapContent,onTouchToolstrip:e.onTouchToolstrip,getCursorBox:a}}))}))}))},pp=function(e,t){return function(n){return n[e].getOrThunk((function(){var e=dp(n);return function(){return t(e)}}))()}}("getWin",lp),hp=function(){var e=Zi("head").getOrDie(),t=Zi('meta[name="viewport"]').getOrThunk((function(){var t=dt.fromTag("meta");return fn(t,"name","viewport"),Rt(e,t),t})),n=mn(t,"content");return{maximize:function(){fn(t,"content","width=device-width, initial-scale=1.0, user-scalable=no, maximum-scale=1.0")},restore:function(){null!=n&&n.length>0?fn(t,"content",n):fn(t,"content","user-scalable=yes")}}},vp="data-ephox-mobile-fullscreen-style",bp="position:absolute!important;",yp="top:0!important;left:0!important;margin:0!important;padding:0!important;width:100%!important;height:100%!important;overflow:visible!important;",wp=Ee().os.isAndroid(),xp=function(e,t){var n=function(e){return function(t){var n=mn(t,"style"),r=void 0===n?"no-styles":n.trim();r!==e&&(fn(t,vp,r),fn(t,"style",e))}},r=qi(e,"*"),o=q(r,(function(e){return Gi(e,"*")})),i=function(e){var t=Pi(e,"background-color");return void 0!==t&&""!==t?"background-color:"+t+"!important":"background-color:rgb(255,255,255)!important;"}(t);L(o,n("display:none!important;")),L(r,n(bp+yp+i)),n((!0===wp?"":bp)+yp+i)(e)},Cp=function(){var e=pt("["+vp+"]");L(e,(function(e){var t=mn(e,vp);"no-styles"!==t?fn(e,"style",t):hn(e,"style"),hn(e,vp)}))},Sp=function(e){var t=e.raw;return void 0===t.touches||1!==t.touches.length?M.none():M.some(t.touches[0])},kp=function(e){var t,n,r,o=Xa(),i=ko(!1),a=(t=function(t){e.triggerEvent(Qe(),t),i.set(!0)},n=400,r=null,{cancel:function(){null!==r&&(clearTimeout(r),r=null)},schedule:function(){for(var e=[],o=0;o<arguments.length;o++)e[o]=arguments[o];r=setTimeout((function(){t.apply(null,e),r=null}),n)}}),u=Lr([{key:De(),value:function(e){return Sp(e).each((function(t){a.cancel();var n={x:t.clientX,y:t.clientY,target:e.target};a.schedule(e),i.set(!1),o.set(n)})),M.none()}},{key:Me(),value:function(e){return a.cancel(),Sp(e).each((function(e){o.on((function(t){(function(e,t){var n=Math.abs(e.clientX-t.x),r=Math.abs(e.clientY-t.y);return n>5||r>5})(e,t)&&o.clear()}))})),M.none()}},{key:Ne(),value:function(t){a.cancel();return o.get().filter((function(e){return vt(e.target,t.target)})).map((function(n){return i.get()?(t.prevent(),!1):e.triggerEvent(Ze(),t)}))}}]);return{fireIfReady:function(e,t){return un(u,t).bind((function(t){return t(e)}))}}},Tp=function(e){var t=kp({triggerEvent:function(t,n){e.onTapContent(n)}});return{fireTouchstart:function(e){t.fireIfReady(e,"touchstart")},onTouchend:function(){return Pg(e.body,"touchend",(function(e){t.fireIfReady(e,"touchend")}))},onTouchmove:function(){return Pg(e.body,"touchmove",(function(e){t.fireIfReady(e,"touchmove")}))}}},Op=Ee().os.version.major>=6,_p=function(e,t,n){var r=Tp(e),o=Tt(t),i=function(e){return!vt(e.start,e.finish)||e.soffset!==e.foffset},a=function(){var r=e.doc.dom.hasFocus()&&e.getSelection().exists(i);n.getByDom(t).each(!0===(r||_o(o).filter((function(e){return"input"===yt(e)})).exists((function(e){return e.dom.selectionStart!==e.dom.selectionEnd})))?wi.on:wi.off)},u=[Pg(e.body,"touchstart",(function(t){e.onTouchContent(),r.fireTouchstart(t)})),r.onTouchmove(),r.onTouchend(),Pg(t,"touchstart",(function(t){e.onTouchToolstrip()})),e.onToReading((function(){Oo(e.body)})),e.onToEditing(p),e.onScrollToCursor((function(t){t.preventDefault(),e.getCursorBox().each((function(t){var n=e.win,r=t.top>n.innerHeight||t.bottom>n.innerHeight?t.bottom-n.innerHeight+50:0;0!==r&&n.scrollTo(n.pageXOffset,n.pageYOffset+r)}))}))].concat(!0===Op?[]:[Pg(dt.fromDom(e.win),"blur",(function(){n.getByDom(t).each(wi.off)})),Pg(o,"select",a),Pg(e.doc,"selectionchange",a)]);return{destroy:function(){L(u,(function(e){e.unbind()}))}}},Ep=function(e,t){var n=parseInt(mn(e,t),10);return isNaN(n)?0:n},Ap=function(t){return e(e({},t),{width:2})},Dp=function(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom,width:e.width,height:e.height}},Mp=function(e){var t=e.getSelection();return void 0!==t&&t.rangeCount>0?function(e){if(e.collapsed){var t=dt.fromDom(e.startContainer);return _t(t).bind((function(n){var r=ep.exact(t,e.startOffset,n,Yg(n));return sp(e.startContainer.ownerDocument.defaultView,r).map(Ap).map(Y)})).getOr([])}return F(e.getClientRects(),Dp)}(t.getRangeAt(0)):[]},Np=function(e){e.focus();var t=dt.fromDom(e.document.body);(_o().exists((function(e){return P(["input","textarea"],yt(e))}))?function(e){Fg.setTimeout((function(){e()}),0)}:T)((function(){_o().each(Oo),To(t)}))},Rp="data-"+Ti("last-outer-height"),zp=function(e,t){fn(e,Rp,t)},Bp=function(e){return{top:e.top,bottom:e.top+e.height}},Pp=function(e,t){var n=function(e){return Ep(e,Rp)}(t),r=e.innerHeight;return n>r?M.some(n-r):M.none()},Ip=function(e,t){var n=dt.fromDom(t.document.body),r=Pg(dt.fromDom(e),"resize",(function(){Pp(e,n).each((function(e){(function(e){var t=Mp(e);return t.length>0?M.some(t[0]).map(Bp):M.none()})(t).each((function(n){var r=function(e,t,n){return t.top>e.innerHeight||t.bottom>e.innerHeight?Math.min(n,t.bottom-e.innerHeight+50):0}(t,n,e);0!==r&&t.scrollTo(t.pageXOffset,t.pageYOffset+r)}))})),zp(n,e.innerHeight)}));zp(n,e.innerHeight);return{toEditing:function(){Np(t)},destroy:function(){r.unbind()}}},Fp=function(e,t){var n=null,r=function(){s(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,e.apply(null,o)}),t)}}},Lp=function(e,t){var n,r,o,i=Zf(xd.sketch({dom:Ts('<div aria-hidden="true" class="${prefix}-mask-tap-icon"></div>'),containerBehaviours:bo([wi.config({toggleClass:Ti("mask-tap-icon-selected"),toggleOnExecute:!1})])})),a=(n=e,r=200,o=null,{cancel:function(){s(o)||(clearTimeout(o),o=null)},throttle:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];s(o)&&(o=setTimeout((function(){o=null,n.apply(null,e)}),r))}});return xd.sketch({dom:Ts('<div class="${prefix}-disabled-mask"></div>'),components:[xd.sketch({dom:Ts('<div class="${prefix}-content-container"></div>'),components:[xs.sketch({dom:Ts('<div class="${prefix}-content-tap-section"></div>'),components:[i.asSpec()],action:function(e){a.throttle()},buttonBehaviours:bo([wi.config({toggleClass:Ti("mask-tap-icon-selected")})])})]})]})},Hp=v({unbind:p}),Vp=lr([_r("editor",[Tr("getFrame"),Er("getBody"),Er("getDoc"),Er("getWin"),Er("getSelection"),Er("setSelection"),Er("clearSelection"),Er("cursorSaver"),Er("onKeyup"),Er("onNodeChanged"),Er("getCursorBox"),Tr("onDomChanged"),Nr("onTouchContent",p),Nr("onTapContent",p),Nr("onTouchToolstrip",p),Nr("onScrollToCursor",Hp),Nr("onScrollToElement",Hp),Nr("onToEditing",Hp),Nr("onToReading",Hp),Nr("onToolbarScrollStart",b)]),Tr("socket"),Tr("toolstrip"),Tr("dropup"),Tr("toolbar"),Tr("container"),Tr("alloy"),kr("win",(function(e){return Tt(e.socket).dom.defaultView})),kr("body",(function(e){return dt.fromDom(e.socket.dom.ownerDocument.body)})),Nr("translate",b),Nr("setReadOnly",p),Nr("readOnlyOnInit",_)]),jp=function(e){var t=wr("Getting AndroidWebapp schema",Vp,e);zi(t.toolstrip,"width","100%");var n=Dm(Lp((function(){t.setReadOnly(t.readOnlyOnInit()),o.enter()}),t.translate));t.alloy.add(n);var r={show:function(){t.alloy.add(n)},hide:function(){t.alloy.remove(n)}};Rt(t.container,n.element);var o=function(e,t){var n=hp(),r=Ka(),o=Ka();return{enter:function(){t.hide(),xn(e.container,Ti("fullscreen-maximized")),xn(e.container,Ti("android-maximized")),n.maximize(),xn(e.body,Ti("android-scroll-reload")),r.set(Ip(e.win,pp(e.editor).getOrDie("no"))),gp(e.editor).each((function(t){xp(e.container,t.body),o.set(_p(t,e.toolstrip,e.alloy))}))},exit:function(){n.restore(),t.show(),Sn(e.container,Ti("fullscreen-maximized")),Sn(e.container,Ti("android-maximized")),Cp(),Sn(e.body,Ti("android-scroll-reload")),o.clear(),r.clear()}}}(t,r);return{setReadOnly:t.setReadOnly,refreshStructure:p,enter:o.enter,exit:o.exit,destroy:p}},Up=v([Tr("dom"),Nr("shell",!0),pc("toolbarBehaviours",[eg])]),Wp=v([qc({name:"groups",overrides:function(){return{behaviours:bo([eg.config({})])}}})]),$p=ws({name:"Toolbar",configFields:Up(),partFields:Wp(),factory:function(e,t,n,r){var o=function(t){return e.shell?M.some(t):es(t,e,"groups")},i=e.shell?{behaviours:[eg.config({})],components:[]}:{behaviours:[],components:t};return{uid:e.uid,dom:e.dom,components:i.components,behaviours:vc(e.toolbarBehaviours,i.behaviours),apis:{setGroups:function(e,t){o(e).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(e){eg.set(e,t)}))}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(e,t,n){e.setGroups(t,n)}}}),qp=v([Tr("items"),function(e){return _r("markers",F(e,Tr))}(["itemSelector"]),pc("tgroupBehaviours",[gc])]),Gp=v([Gc({name:"items",unit:"item"})]),Kp=ws({name:"ToolbarGroup",configFields:qp(),partFields:Gp(),factory:function(e,t,n,r){return{uid:e.uid,dom:e.dom,components:t,behaviours:vc(e.tgroupBehaviours,[gc.config({mode:"flow",selector:e.markers.itemSelector})]),domModification:{attributes:{role:"toolbar"}}}}}),Xp="data-"+Ti("horizontal-scroll"),Yp=function(e){return"true"===mn(e,Xp)?function(e){return e.dom.scrollLeft>0||function(e){e.dom.scrollLeft=1;var t=0!==e.dom.scrollLeft;return e.dom.scrollLeft=0,t}(e)}(e):function(e){return e.dom.scrollTop>0||function(e){e.dom.scrollTop=1;var t=0!==e.dom.scrollTop;return e.dom.scrollTop=0,t}(e)}(e)},Jp=function(){var e=function(e){var t=!0===e.scrollable?"${prefix}-toolbar-scrollable-group":"";return{dom:Ts('<div aria-label="'+e.label+'" class="${prefix}-toolbar-group '+t+'"></div>'),tgroupBehaviours:bo([vd("adhoc-scrollable-toolbar",!0===e.scrollable?[ao((function(e,t){var n;zi(e.element,"overflow-x","auto"),n=e.element,fn(n,Xp,"true"),vg(e.element)}))]:[])]),components:[xd.sketch({components:[Kp.parts.items({})]})],markers:{itemSelector:"."+Ti("toolbar-group-item")},items:e.items}},t=Dm($p.sketch({dom:Ts('<div class="${prefix}-toolbar"></div>'),components:[$p.parts.groups({})],toolbarBehaviours:bo([wi.config({toggleClass:Ti("context-toolbar"),toggleOnExecute:!1,aria:{mode:"none"}}),gc.config({mode:"cyclic"})]),shell:!0})),n=Dm(xd.sketch({dom:{classes:[Ti("toolstrip")]},components:[Mm(t)],containerBehaviours:bo([wi.config({toggleClass:Ti("android-selection-context-toolbar"),toggleOnExecute:!1})])})),r=function(){$p.setGroups(t,o.get()),wi.off(t)},o=ko([]);return{wrapper:n,toolbar:t,createGroups:function(t){return F(t,h(Kp.sketch,e))},setGroups:function(e){o.set(e),r()},setContextToolbar:function(e){wi.on(t),$p.setGroups(t,e)},restoreToolbar:function(){wi.isOn(t)&&r()},refresh:function(){},focus:function(){gc.focusIn(t)}}},Zp=function(e){return Dm(xs.sketch({dom:Ts('<div class="${prefix}-mask-edit-icon ${prefix}-icon"></div>'),action:function(){e.run((function(e){e.setReadOnly(!1)}))}}))},Qp=function(){return Dm(xd.sketch({dom:Ts('<div class="${prefix}-editor-socket"></div>'),components:[],containerBehaviours:bo([eg.config({})])}))},eh=function(e,t){eg.append(e,Mm(t))},th=function(e,t){eg.remove(e,t)},nh=function(e,t,n,r){(!0===n?So.toAlpha:So.toOmega)(r),(n?eh:th)(e,t)},rh=function(e,t){return t.getAnimationRoot.fold((function(){return e.element}),(function(t){return t(e)}))},oh=function(e){return e.dimension.property},ih=function(e,t){return e.dimension.getDimension(t)},ah=function(e,t){var n=rh(e,t);wm(n,[t.shrinkingClass,t.growingClass])},uh=function(e,t){Sn(e.element,t.openClass),xn(e.element,t.closedClass),zi(e.element,oh(t),"0px"),Hi(e.element)},ch=function(e,t){Sn(e.element,t.closedClass),xn(e.element,t.openClass),Li(e.element,oh(t))},sh=function(e,t,n,r){n.setCollapsed(),zi(e.element,oh(t),ih(t,e.element)),Hi(e.element),ah(e,t),uh(e,t),t.onStartShrink(e),t.onShrunk(e)},lh=function(e,t,n,r){var o=r.getOrThunk((function(){return ih(t,e.element)}));n.setCollapsed(),zi(e.element,oh(t),o),Hi(e.element);var i=rh(e,t);Sn(i,t.growingClass),xn(i,t.shrinkingClass),uh(e,t),t.onStartShrink(e)},fh=function(e,t,n){var r=ih(t,e.element);("0px"===r?sh:lh)(e,t,n,M.some(r))},dh=function(e,t,n){var r=rh(e,t),o=kn(r,t.shrinkingClass),i=ih(t,e.element);ch(e,t);var a=ih(t,e.element);(o?function(){zi(e.element,oh(t),i),Hi(e.element)}:function(){uh(e,t)})(),Sn(r,t.shrinkingClass),xn(r,t.growingClass),ch(e,t),zi(e.element,oh(t),a),n.setExpanded(),t.onStartGrow(e)},mh=function(e,t,n){var r=rh(e,t);return!0===kn(r,t.growingClass)},gh=function(e,t,n){var r=rh(e,t);return!0===kn(r,t.shrinkingClass)},ph=Object.freeze({__proto__:null,refresh:function(e,t,n){if(n.isExpanded()){Li(e.element,oh(t));var r=ih(t,e.element);zi(e.element,oh(t),r)}},grow:function(e,t,n){n.isExpanded()||dh(e,t,n)},shrink:function(e,t,n){n.isExpanded()&&fh(e,t,n)},immediateShrink:function(e,t,n){n.isExpanded()&&sh(e,t,n)},hasGrown:function(e,t,n){return n.isExpanded()},hasShrunk:function(e,t,n){return n.isCollapsed()},isGrowing:mh,isShrinking:gh,isTransitioning:function(e,t,n){return mh(e,t)||gh(e,t)},toggleGrow:function(e,t,n){(n.isExpanded()?fh:dh)(e,t,n)},disableTransitions:ah}),hh=Object.freeze({__proto__:null,exhibit:function(e,t,n){var r=t.expanded;return lo(r?{classes:[t.openClass],styles:{}}:{classes:[t.closedClass],styles:Fr(t.dimension.property,"0px")})},events:function(e,t){return Xr([ro(je(),(function(n,r){r.event.raw.propertyName===e.dimension.property&&(ah(n,e),t.isExpanded()&&Li(n.element,e.dimension.property),(t.isExpanded()?e.onGrown:e.onShrunk)(n))}))])}}),vh=[Tr("closedClass"),Tr("openClass"),Tr("shrinkingClass"),Tr("growingClass"),Er("getAnimationRoot"),ei("onShrunk"),ei("onStartShrink"),ei("onGrown"),ei("onStartGrow"),Nr("expanded",!1),Or("dimension",Cr("property",{width:[oi("property","width"),oi("getDimension",(function(e){return il(e)+"px"}))],height:[oi("property","height"),oi("getDimension",(function(e){return Ui(e)+"px"}))]}))],bh=Object.freeze({__proto__:null,init:function(e){var t=ko(e.expanded);return vo({isExpanded:function(){return!0===t.get()},isCollapsed:function(){return!1===t.get()},setCollapsed:w(t.set,!1),setExpanded:w(t.set,!0),readState:function(){return"expanded: "+t.get()}})}}),yh=wo({fields:vh,name:"sliding",active:hh,apis:ph,state:bh}),wh=function(e,t){var n=Dm(xd.sketch({dom:{tag:"div",classes:[Ti("dropup")]},components:[],containerBehaviours:bo([eg.config({}),yh.config({closedClass:Ti("dropup-closed"),openClass:Ti("dropup-open"),shrinkingClass:Ti("dropup-shrinking"),growingClass:Ti("dropup-growing"),dimension:{property:"height"},onShrunk:function(n){e(),t(),eg.set(n,[])},onGrown:function(n){e(),t()}}),Ci((function(e,t){r(p)}))])})),r=function(e){window.requestAnimationFrame((function(){e(),yh.shrink(n)}))};return{appear:function(e,t,r){!0===yh.hasShrunk(n)&&!1===yh.isTransitioning(n)&&window.requestAnimationFrame((function(){t(r),eg.set(n,[e()]),yh.grow(n)}))},disappear:r,component:n,element:n.element}},xh=function(e){var t,n;return e.raw.which===na[0]&&!P(["input","textarea"],yt(e.target))&&(t=e.target,!ta(t,'[contenteditable="true"]',n).isSome())},Ch=function(){return Ee().browser.isFirefox()},Sh=function(t,n){var r=e({stopBackspace:!0},n),o=kp(r),i=F(["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 Pg(t,e,(function(t){o.fireIfReady(t,e).each((function(e){e&&t.kill()})),r.triggerEvent(e,t)&&t.kill()}))})),a=Xa(),u=Pg(t,"paste",(function(e){o.fireIfReady(e,"paste").each((function(t){t&&e.kill()})),r.triggerEvent("paste",e)&&e.kill(),a.set(setTimeout((function(){r.triggerEvent(Ke(),e)}),0))})),c=Pg(t,"keydown",(function(e){r.triggerEvent("keydown",e)?e.kill():r.stopBackspace&&xh(e)&&e.prevent()})),s=function(e,t){return Ch()?Ig(e,"focus",t):Pg(e,"focusin",t)}(t,(function(e){r.triggerEvent("focusin",e)&&e.kill()})),l=Xa(),f=function(e,t){return Ch()?Ig(e,"blur",t):Pg(e,"focusout",t)}(t,(function(e){r.triggerEvent("focusout",e)&&e.kill(),l.set(setTimeout((function(){r.triggerEvent(Ge(),e)}),0))}));return{unbind:function(){L(i,(function(e){e.unbind()})),c.unbind(),s.unbind(),f.unbind(),u.unbind(),a.on(clearTimeout),l.on(clearTimeout)}}},kh=function(e,t){var n=un(e,"target").getOr(t);return ko(n)},Th=Br([{stopped:[]},{resume:["element"]},{complete:[]}]),Oh=function(e,t,n,r,o,i){var a=e(t,r),u=function(e,t){var n=ko(!1),r=ko(!1);return{stop:function(){n.set(!0)},cut:function(){r.set(!0)},isStopped:n.get,isCut:r.get,event:e,setSource:t.set,getSource:t.get}}(n,o);return a.fold((function(){return i.logEventNoHandlers(t,r),Th.complete()}),(function(e){var n=e.descHandler;return lm(n)(u),u.isStopped()?(i.logEventStopped(t,e.element,n.purpose),Th.stopped()):u.isCut()?(i.logEventCut(t,e.element,n.purpose),Th.complete()):_t(e.element).fold((function(){return i.logNoParent(t,e.element,n.purpose),Th.complete()}),(function(r){return i.logEventResponse(t,e.element,n.purpose),Th.resume(r)}))}))},_h=function(e,t,n,r,o,i){return Oh(e,t,n,r,o,i).fold(_,(function(r){return _h(e,t,n,r,o,i)}),O)},Eh=function(e,t,n){var r=function(e){var t=ko(!1);return{stop:function(){t.set(!0)},cut:p,isStopped:t.get,isCut:O,event:e,setSource:k("Cannot set source of a broadcasted event"),getSource:k("Cannot get source of a broadcasted event")}}(t);return L(e,(function(e){var t=e.descHandler;lm(t)(r)})),r.isStopped()},Ah=function(e,t,n,r,o){var i=kh(n,r);return _h(e,t,n,r,i,o)},Dh=function(){var e={};return{registerId:function(t,n,r){tn(r,(function(r,o){var i=void 0!==e[o]?e[o]:{};i[n]=function(e,t){return n=w.apply(void 0,[e.handler].concat(t)),r=e.purpose,{cHandler:n,purpose:r};var n,r}(r,t),e[o]=i}))},unregisterId:function(t){tn(e,(function(e,n){cn(e,t)&&delete e[t]}))},filterByType:function(t){return un(e,t).map((function(e){return an(e,(function(e,t){return function(e,t){return{id:e,descHandler:t}}(t,e)}))})).getOr([])},find:function(t,n,r){return un(e,n).bind((function(e){return Wr(r,(function(t){return function(e,t){return ds(t).bind((function(t){return un(e,t)})).map((function(e){return function(e,t){return{element:e,descHandler:t}}(t,e)}))}(e,t)}),t)}))}}},Mh=function(){var e=Dh(),t={},n=function(e){var t=e.element;return ds(t).getOrThunk((function(){return function(e,t){var n=Dc(ss+e);return fs(t,n),n}("uid-",e.element)}))},r=function(n){ds(n.element).each((function(n){delete t[n],e.unregisterId(n)}))};return{find:function(t,n,r){return e.find(t,n,r)},filter:function(t){return e.filterByType(t)},register:function(o){var i=n(o);sn(t,i)&&function(e,n){var o=t[n];if(o!==e)throw new Error('The tagId "'+n+'" is already used by: '+Ho(o.element)+"\nCannot use it for: "+Ho(e.element)+"\nThe conflicting element is"+(Ut(o.element)?" ":" not ")+"already in the DOM");r(e)}(o,i);var a=[o];e.registerId(a,i,o.events),t[i]=o},unregister:r,getById:function(e){return un(t,e)}}},Nh=function(e){var t=function(t){return _t(e.element).fold(_,(function(e){return vt(t,e)}))},n=Mh(),r=function(e,r){return n.find(t,e,r)},o=Sh(e.element,{triggerEvent:function(e,t){return qo(e,t.target,(function(n){return function(e,t,n,r){return Ah(e,t,n,n.target,r)}(r,e,t,n)}))}}),i={debugInfo:v("real"),triggerEvent:function(e,t,n){qo(e,t,(function(o){return Ah(r,e,n,t,o)}))},triggerFocus:function(e,t){ds(e).fold((function(){To(e)}),(function(n){qo(qe(),e,(function(n){return function(e,t,n,r,o){var i=kh(n,r);Oh(e,t,n,r,i,o)}(r,qe(),{originator:t,kill:p,prevent:p,target:e},e,n),!1}))}))},triggerEscape:function(e,t){i.triggerEvent("keydown",e.element,t.event)},getByUid:function(e){return g(e)},getByDom:function(e){return h(e)},build:Dm,addToGui:function(e){c(e)},removeFromGui:function(e){s(e)},addToWorld:function(e){a(e)},removeFromWorld:function(e){u(e)},broadcast:function(e){f(e)},broadcastOn:function(e,t){d(e,t)},broadcastEvent:function(e,t){m(e,t)},isConnected:_},a=function(e){e.connect(i),Ct(e.element)||(n.register(e),L(e.components(),a),i.triggerEvent(et(),e.element,{target:e.element}))},u=function(e){Ct(e.element)||(L(e.components(),u),n.unregister(e)),e.disconnect()},c=function(t){!function(e,t){Yt(e,t,Rt)}(e,t)},s=function(e){Jt(e)},l=function(e){var t=n.filter(Xe());L(t,(function(t){var n=t.descHandler;lm(n)(e)}))},f=function(e){l({universal:!0,data:e})},d=function(e,t){l({universal:!1,channels:e,data:t})},m=function(e,t){var r=n.filter(e);return Eh(r,t)},g=function(e){return n.getById(e).fold((function(){return An.error(new Error('Could not find component with uid: "'+e+'" in system.'))}),An.value)},h=function(e){var t=ds(e).getOr("not found");return g(t)};return a(e),{root:e,element:e.element,destroy:function(){o.unbind(),Pt(e.element)},add:c,remove:s,getByUid:g,getByDom:h,addToWorld:a,removeFromWorld:u,broadcast:f,broadcastOn:d,broadcastEvent:m}},Rh=Ti("readonly-mode"),zh=Ti("edit-mode");function Bh(e){var t=Dm(xd.sketch({dom:{classes:[Ti("outer-container")].concat(e.classes)},containerBehaviours:bo([So.config({alpha:Rh,omega:zh})])}));return Nh(t)}var Ph=function(e,t){var n=dt.fromTag("input");Bi(n,{opacity:"0",position:"absolute",top:"-1000px",left:"-1000px"}),Rt(e,n),To(n),t(n),Pt(n)},Ih=function(e){var t=e.getSelection();if(t.rangeCount>0){var n=t.getRangeAt(0),r=e.document.createRange();r.setStart(n.startContainer,n.startOffset),r.setEnd(n.endContainer,n.endOffset),t.removeAllRanges(),t.addRange(r)}},Fh=function(e,t){_o().each((function(e){vt(e,t)||Oo(e)})),e.focus(),To(dt.fromDom(e.document.body)),Ih(e)},Lh=function(e,t,n,r){var o=function(){Fh(t,r)},i=Pg(n,"keydown",(function(e){P(["input","textarea"],yt(e.target))||o()}));return{toReading:function(){Ph(e,Oo)},toEditing:o,onToolbarTouch:p,destroy:function(){i.unbind()}}},Hh=function(e,t,n,r,o){var i=function(){t.run((function(e){e.refreshSelection()}))},a=function(e,n){var o=e-r.dom.scrollTop;t.run((function(e){e.scrollIntoView(o,o+n)}))},u=function(){t.run((function(e){e.clearSelection()}))},c=function(){e.getCursorBox().each((function(e){a(e.top,e.height)})),t.run((function(e){e.syncHeight()}))},s=Tp(e),l=Fp(c,300),f=[e.onKeyup((function(){u(),l.throttle()})),e.onNodeChanged(i),e.onDomChanged(l.throttle),e.onDomChanged(i),e.onScrollToCursor((function(e){e.preventDefault(),l.throttle()})),e.onScrollToElement((function(e){e.element,a(t,r)})),e.onToEditing((function(){t.run((function(e){e.toEditing()}))})),e.onToReading((function(){t.run((function(e){e.toReading()}))})),Pg(e.doc,"touchend",(function(t){vt(e.html,t.target)||vt(e.body,t.target)})),Pg(n,"transitionend",(function(e){var r;"height"===e.raw.propertyName&&(r=Ui(n),t.run((function(e){e.setViewportOffset(r)})),i(),c())})),Ig(n,"touchstart",(function(n){var r;t.run((function(e){e.highlightSelection()})),r=n,t.run((function(e){e.onToolbarTouch(r)})),e.onTouchToolstrip()})),Pg(e.body,"touchstart",(function(t){u(),e.onTouchContent(),s.fireTouchstart(t)})),s.onTouchmove(),s.onTouchend(),Pg(e.body,"click",(function(e){e.kill()})),Pg(n,"touchmove",(function(){e.onToolbarScrollStart()}))];return{destroy:function(){L(f,(function(e){e.unbind()}))}}};var Vh,jh=function(e){var t=M.none(),n=[],r=function(e){o()?a(e):n.push(e)},o=function(){return t.isSome()},i=function(e){L(e,a)},a=function(e){t.each((function(t){setTimeout((function(){e(t)}),0)}))};return e((function(e){o()||(t=M.some(e),i(n),n=[])})),{get:r,map:function(e){return jh((function(t){r((function(n){t(e(n))}))}))},isReady:o}},Uh={nu:jh,pure:function(e){return jh((function(t){t(e)}))}},Wh=function(e){setTimeout((function(){throw e}),0)},$h=function(e){var t=function(t){e().then(t,Wh)};return{map:function(t){return $h((function(){return e().then(t)}))},bind:function(t){return $h((function(){return e().then((function(e){return t(e).toPromise()}))}))},anonBind:function(t){return $h((function(){return e().then((function(){return t.toPromise()}))}))},toLazy:function(){return Uh.nu(t)},toCached:function(){var t=null;return $h((function(){return null===t&&(t=e()),t}))},toPromise:e,get:t}},qh=function(e){return $h((function(){return new od(e)}))},Gh=function(e){return $h((function(){return od.resolve(e)}))},Kh=function(e,t){return Z([{width:320,height:480,keyboard:{portrait:300,landscape:240}},{width:320,height:568,keyboard:{portrait:300,landscape:240}},{width:375,height:667,keyboard:{portrait:305,landscape:240}},{width:414,height:736,keyboard:{portrait:320,landscape:240}},{width:768,height:1024,keyboard:{portrait:320,landscape:400}},{width:1024,height:1366,keyboard:{portrait:380,landscape:460}}],(function(n){return function(e,t){return e?M.some(t):M.none()}(e<=n.width&&t<=n.height,n.keyboard)})).getOr({portrait:t/5,landscape:e/4})},Xh=function(e){var t=Lg(e).isPortrait(),n=function(e){return Kh(e.screen.width,e.screen.height)}(e),r=t?n.portrait:n.landscape;return(t?e.screen.height:e.screen.width)-e.innerHeight>r?0:r},Yh=function(e,t){var n=Tt(e).dom.defaultView;return Ui(e)+Ui(t)-Xh(n)},Jh=function(e,t,n){var r=Yh(t,n),o=Ui(t)+Ui(n)-r;zi(e,"padding-bottom",o+"px")},Zh=Br([{fixed:["element","property","offsetY"]},{scroller:["element","offsetY"]}]),Qh="data-"+Ti("position-y-fixed"),ev="data-"+Ti("y-property"),tv="data-"+Ti("scrolling"),nv="data-"+Ti("last-window-height"),rv=function(e){return Ep(e,Qh)},ov=function(e,t){var n=function(e){return mn(e,ev)}(e);return Zh.fixed(e,n,t)},iv=function(e,t){return Zh.scroller(e,t)},av=function(e){var t=rv(e);return("true"===mn(e,tv)?iv:ov)(e,t)},uv=function(e,t,n){var r=Tt(e).dom.defaultView.innerHeight;return fn(e,nv,r+"px"),r-t-n},cv=function(e,t,n,r){var o=Tt(e).dom.defaultView,i=function(e){var t=mn(e,"style");return Bi(e,{position:"absolute",top:"0px"}),fn(e,Qh,"0px"),fn(e,ev,"top"),{restore:function(){fn(e,"style",t||""),hn(e,Qh),hn(e,ev)}}}(n),a=Ui(n),u=Ui(r),c=function(e,t,n){var r=mn(n,"style");return vg(n),Bi(n,{position:"absolute",height:t+"px",width:"100%",top:e+"px"}),fn(n,Qh,e+"px"),fn(n,tv,"true"),fn(n,ev,"top"),{restore:function(){bg(n),fn(n,"style",r||""),hn(n,Qh),hn(n,tv),hn(n,ev)}}}(a,uv(e,a,u),e),s=function(e){var t=mn(e,"style");return Bi(e,{position:"absolute",bottom:"0px"}),fn(e,Qh,"0px"),fn(e,ev,"bottom"),{restore:function(){fn(e,"style",t||""),hn(e,Qh),hn(e,ev)}}}(r),l=!0,f=function(){var t=o.innerHeight,n=function(e){return Ep(e,nv)}(e);return t>n},d=function(){if(l){var o=Ui(n),i=Ui(r),a=uv(e,o,i);fn(e,Qh,o+"px"),zi(e,"height",a+"px"),Jh(t,e,r)}};return Jh(t,e,r),{setViewportOffset:function(t){fn(e,Qh,t+"px"),d()},isExpanding:f,isShrinking:S(f),refresh:d,restore:function(){l=!1,i.restore(),c.restore(),s.restore()}}},sv=(Vh=null,{animate:function(e,t,n,r,o,i){var a=!1,u=function(e){a=!0,o(e)};Fg.clearInterval(Vh);var c=function(e){Fg.clearInterval(Vh),u(e)};Vh=Fg.setInterval((function(){var o=e();(function(e,t,n){return Math.abs(e-t)<=n?M.none():e<t?M.some(e+n):M.some(e-n)})(o,t,n).fold((function(){Fg.clearInterval(Vh),u(t)}),(function(n){if(r(n,c),!a){var i=e();(i!==n||Math.abs(i-t)>Math.abs(o-t))&&(Fg.clearInterval(Vh),u(t))}}))}),i)}}),lv="data-"+Ti("last-scroll-top"),fv=function(e){var t=Fi(e,"top").getOr("0");return parseInt(t,10)},dv=function(e){return parseInt(e.dom.scrollTop,10)},mv=function(e,t){return qh((function(n){var r=w(dv,e);fn(e,lv,r());var o=Math.abs(t-r()),i=Math.ceil(o/10);sv.animate(r,t,i,(function(t,n){Ep(e,lv)!==e.dom.scrollTop?n(e.dom.scrollTop):(e.dom.scrollTop=t,fn(e,lv,t))}),(function(){e.dom.scrollTop=t,fn(e,lv,t),n(t)}),10)}))},gv=function(e,t){var n=t+rv(e)+"px";zi(e,"top",n)};var pv=function(e,t){return t((function(t){var n=[],r=0;0===e.length?t([]):L(e,(function(o,i){o.get(function(o){return function(i){n[o]=i,++r>=e.length&&t(n)}}(i))}))}))},hv=function(e,t,n){var r=t+n,o=Fi(e,"top").getOr(n),i=r-parseInt(o,10);return function(e,t,n){return qh((function(r){var o=w(dv,e);sv.animate(o,t,15,(function(t){e.dom.scrollTop=t,zi(e,"top",fv(e)+15+"px")}),(function(){e.dom.scrollTop=t,zi(e,"top",n+"px"),r(t)}),10)}))}(e,e.dom.scrollTop+i,r)},vv=function(e,t){return e.fold((function(e,n,r){return function(e,t,n,r){return zi(e,t,n+r+"px"),Gh(r)}(e,n,t,r)}),(function(e,n){return hv(e,t,n)}))},bv=function(e,t){var n=function(e){var t=Ki(e,"["+Qh+"]");return F(t,av)}(e),r=F(n,(function(e){return vv(e,t)}));return pv(r,qh)},yv=function(e,t,n,r,o,i){var a,u,c=(a=function(n){return function(e,t,n){var r=Tt(e).dom.defaultView;return qh((function(o){gv(e,n),gv(t,n),r.scrollTo(0,n),o(n)}))}(e,t,n)},u=ko(Uh.pure({})),{start:function(e){var t=Uh.nu((function(t){return a(e).get(t)}));u.set(t)},idle:function(e){u.get().get((function(){e()}))}}),s=Fp((function(){c.idle((function(){bv(n,r.pageYOffset).get((function(){var e;(e=Mp(i),M.from(e[0]).bind((function(e){var n=e.top-t.dom.scrollTop;return n>r.innerHeight+5||n<-5?M.some({top:n,bottom:n+e.height}):M.none()}))).each((function(e){t.dom.scrollTop=t.dom.scrollTop+e.top})),c.start(0),o.refresh()}))}))}),1e3),l=Pg(dt.fromDom(r),"scroll",(function(){r.pageYOffset<0||s.throttle()}));return bv(n,r.pageYOffset).get(b),{unbind:l.unbind}},wv=function(e){var t=e.cWin,n=e.ceBody,r=e.socket,o=e.toolstrip,i=e.contentElement,a=e.keyboardType,u=e.outerWindow,c=e.dropup,s=e.outerBody,l=cv(r,n,o,c),f=a(s,t,Wt(),i),d=Vg(u,{onChange:p,onReady:l.refresh});d.onAdjustment((function(){l.refresh()}));var m=Pg(dt.fromDom(u),"resize",(function(){l.isExpanding()&&l.refresh()})),g=yv(o,r,s,u,l,t),h=function(e,t){var n=e.document,r=dt.fromTag("div");xn(r,Ti("unfocused-selections")),Rt(dt.fromDom(n.documentElement),r);var o=Pg(r,"touchstart",(function(n){n.prevent(),Fh(e,t),a()})),i=function(e){var t=dt.fromTag("span");return ym(t,[Ti("layer-editor"),Ti("unfocused-selection")]),Bi(t,{left:e.left+"px",top:e.top+"px",width:e.width+"px",height:e.height+"px"}),t},a=function(){Bt(r)};return{update:function(){a();var t=Mp(e),n=F(t,i);zt(r,n)},isActive:function(){return Et(r).length>0},destroy:function(){o.unbind(),Pt(r)},clear:a}}(t,i),v=function(){h.clear()};return{toEditing:function(){f.toEditing(),v()},toReading:function(){f.toReading()},onToolbarTouch:function(e){f.onToolbarTouch()},refreshSelection:function(){h.isActive()&&h.update()},clearSelection:v,highlightSelection:function(){h.update()},scrollIntoView:function(e,n){!function(e,t,n,r,o){var i=Yh(t,n),a=w(Ih,e);r>i||o>i?mv(t,t.dom.scrollTop-i+o).get(a):r<0&&mv(t,t.dom.scrollTop+r).get(a)}(t,r,c,e,n)},updateToolbarPadding:p,setViewportOffset:function(e){l.setViewportOffset(e),function(e,t){return qh((function(n){var r=w(fv,e),o=function(t){zi(e,"top",t+"px")},i=Math.abs(t-r()),a=Math.ceil(i/10);sv.animate(r,t,a,o,(function(){o(t),n(t)}),10)}))}(r,e).get(b)},syncHeight:function(){zi(i,"height",i.dom.contentWindow.document.body.scrollHeight+"px")},refreshStructure:l.refresh,destroy:function(){l.restore(),d.destroy(),g.unbind(),m.unbind(),f.destroy(),h.destroy(),Ph(Wt(),Oo)}}},xv=function(e){var t=wr("Getting IosWebapp schema",Vp,e);zi(t.toolstrip,"width","100%"),zi(t.container,"position","relative");var n=Dm(Lp((function(){t.setReadOnly(t.readOnlyOnInit()),o.enter()}),t.translate));t.alloy.add(n);var r={show:function(){t.alloy.add(n)},hide:function(){t.alloy.remove(n)}},o=function(e,t){var n=hp(),r=Xa(),o=Xa(),i=Ka(),a=Ka();return{enter:function(){t.hide();var u=dt.fromDom(document);gp(e.editor).each((function(t){var c,s;r.set({socketHeight:Fi(e.socket,"height"),iframeHeight:Fi(t.frame,"height"),outerScroll:document.body.scrollTop}),o.set({exclusives:(c=u,s="."+yg,Pg(c,"touchmove",(function(e){ta(e.target,s).filter(Yp).fold((function(){e.prevent()}),p)})))}),xn(e.container,Ti("fullscreen-maximized")),xp(e.container,t.body),n.maximize(),zi(e.socket,"overflow","scroll"),zi(e.socket,"-webkit-overflow-scrolling","touch"),To(t.body),i.set(wv({cWin:t.win,ceBody:t.body,socket:e.socket,toolstrip:e.toolstrip,dropup:e.dropup.element,contentElement:t.frame,outerBody:e.body,outerWindow:e.win,keyboardType:Lh})),i.run((function(e){e.syncHeight()})),a.set(Hh(t,i,e.toolstrip,e.socket,e.dropup))}))},refreshStructure:function(){i.run((function(e){e.refreshStructure()}))},exit:function(){n.restore(),a.clear(),i.clear(),t.show(),r.on((function(t){t.socketHeight.each((function(t){zi(e.socket,"height",t)})),t.iframeHeight.each((function(t){zi(e.editor.getFrame(),"height",t)})),document.body.scrollTop=t.scrollTop})),r.clear(),o.on((function(e){e.exclusives.unbind()})),o.clear(),Sn(e.container,Ti("fullscreen-maximized")),Cp(),bg(e.toolbar),Li(e.socket,"overflow"),Li(e.socket,"-webkit-overflow-scrolling"),Oo(e.editor.getFrame()),gp(e.editor).each((function(e){e.clearSelection()}))}}}(t,r);return{setReadOnly:t.setReadOnly,refreshStructure:o.refreshStructure,enter:o.enter,exit:o.exit,destroy:p}};var Cv=tinymce.util.Tools.resolve("tinymce.EditorManager"),Sv=function(e,t,n){e.system.broadcastOn([Ro],{command:t,state:n})},kv=function(e){return function(){var t=function(){e._skinLoaded=!0,e.fire("SkinLoaded")};e.initialized?t():e.on("init",t)}},Tv="toReading",Ov="toEditing",_v=function(e){return{getNotificationManagerImpl:function(){return{open:v({progressBar:{value:p},close:p,text:p,getEl:v(null),moveTo:p,moveRel:p,settings:{}}),close:p,reposition:p,getArgs:v({})}},renderUI:function(){var t=e.getElement(),n=function(e){var t=M.from(function(e){return e.getParam("skin_url")}(e)).getOrThunk((function(){return Cv.baseURL+"/skins/ui/oxide"}));return{content:t+"/content.mobile.min.css",ui:t+"/skin.mobile.min.css"}}(e);if(!1===function(e){return!1===e.getParam("skin")}(e)){var r=Ao.DOM.styleSheetLoader;e.contentCSS.push(n.content),r.load(n.ui,kv(e)),e.on("remove",(function(){return r.unload(n.ui)}))}else kv(e)();var o=function(){e.fire("ScrollIntoView")},i=Ee().os.isAndroid()?function(e){var t=Bh({classes:[Ti("android-container")]}),n=Jp(),r=Ka(),o=Zp(r),i=Qp(),a=wh(p,e);return t.add(n.wrapper),t.add(i),t.add(a.component),{system:t,element:t.element,init:function(e){r.set(jp(e))},exit:function(){r.run((function(e){e.exit(),eg.remove(i,o)}))},setToolbarGroups:function(e){var t=n.createGroups(e);n.setGroups(t)},setContextToolbar:function(e){var t=n.createGroups(e);n.setContextToolbar(t)},focusToolbar:function(){n.focus()},restoreToolbar:function(){n.restoreToolbar()},updateMode:function(e){nh(i,o,e,t.root)},socket:i,dropup:a}}(o):function(e){var t=Bh({classes:[Ti("ios-container")]}),n=Jp(),r=Ka(),o=Zp(r),i=Qp(),a=wh((function(){r.run((function(e){e.refreshStructure()}))}),e);return t.add(n.wrapper),t.add(i),t.add(a.component),{system:t,element:t.element,init:function(e){r.set(xv(e))},exit:function(){r.run((function(e){eg.remove(i,o),e.exit()}))},setToolbarGroups:function(e){var t=n.createGroups(e);n.setGroups(t)},setContextToolbar:function(e){var t=n.createGroups(e);n.setContextToolbar(t)},focusToolbar:function(){n.focus()},restoreToolbar:function(){n.restoreToolbar()},updateMode:function(e){nh(i,o,e,t.root)},socket:i,dropup:a}}(o);!function(e,t){Zt(e,t,Mt)}(dt.fromDom(t),i.system);var a=t.ownerDocument.defaultView,u=Vg(a,{onChange:function(){i.system.broadcastOn([zo],{width:Hg(a)})},onReady:p}),c=function(t,n,r,o){!1===o&&e.selection.collapse();var a=s(t,n,r);i.setToolbarGroups(!0===o?a.readOnly:a.main),e.setMode(!0===o?"readonly":"design"),e.fire(!0===o?Tv:Ov),i.updateMode(o)},s=function(e,t,n){var r=e.get();return{readOnly:r.backToMask.concat(t.get()),main:r.backToMask.concat(n.get())}},l=function(t,n){return e.on(t,n),{unbind:function(){e.off(t)}}};return e.on("init",(function(){i.init({editor:{getFrame:function(){return dt.fromDom(e.contentAreaContainer.querySelector("iframe"))},onDomChanged:function(){return{unbind:p}},onToReading:function(e){return l(Tv,e)},onToEditing:function(e){return l(Ov,e)},onScrollToCursor:function(t){e.on("ScrollIntoView",(function(e){t(e)}));return{unbind:function(){e.off("ScrollIntoView"),u.destroy()}}},onTouchToolstrip:function(){t()},onTouchContent:function(){var n,r=dt.fromDom(e.editorContainer.querySelector("."+Ti("toolbar")));(n=r,Eo(n).bind((function(e){return i.system.getByDom(e).toOptional()}))).each(ct),i.restoreToolbar(),t()},onTapContent:function(t){var n=t.target;if("img"===yt(n))e.selection.select(n.dom),t.kill();else if("a"===yt(n)){i.system.getByDom(dt.fromDom(e.editorContainer)).each((function(e){So.isAlpha(e)&&function(e){var t=document.createElement("a");t.target="_blank",t.href=e.href,t.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),document.body.appendChild(t),t.dispatchEvent(n),document.body.removeChild(t)}(n.dom)}))}}},container:dt.fromDom(e.editorContainer),socket:dt.fromDom(e.contentAreaContainer),toolstrip:dt.fromDom(e.editorContainer.querySelector("."+Ti("toolstrip"))),toolbar:dt.fromDom(e.editorContainer.querySelector("."+Ti("toolbar"))),dropup:i.dropup,alloy:i.system,translate:p,setReadOnly:function(e){c(m,d,f,e)},readOnlyOnInit:function(){return!1}});var t=function(){i.dropup.disappear((function(){i.system.broadcastOn([Bo],{})}))},n={label:"The first group",scrollable:!1,items:[Ds("back",(function(){e.selection.collapse(),i.exit()}),{},e)]},r={label:"Back to read only",scrollable:!1,items:[Ds("readonly-back",(function(){c(m,d,f,!0)}),{},e)]},o=Mg(i,e),a=function(e,t){var n=Dg(e),r={};return q(n,(function(e){var n=!sn(r,e)&&sn(t,e)&&t[e].isSupported()?[t[e].sketch()]:[];return r[e]=!0,n}))}(e,o),s={label:"The extra group",scrollable:!1,items:[]},f=ko([{label:"the action group",scrollable:!0,items:a},s]),d=ko([{label:"The read only mode group",scrollable:!0,items:[]},s]),m=ko({backToMask:[n],backToReadOnly:[r]});!function(e,t){var n=Qt(t.formatter.get());L(n,(function(n){t.formatter.formatChanged(n,(function(t){Sv(e,n,t)}))})),L(["ul","ol"],(function(n){t.selection.selectorChanged(n,(function(t,r){Sv(e,n,t)}))}))}(i,e)})),e.on("remove",(function(){i.exit()})),e.on("detach",(function(){var e,t;e=i.system,t=Et(e.element),L(t,(function(t){e.getByDom(t).each(qt)})),Pt(e.element),i.system.destroy()})),{iframeContainer:i.socket.element.dom,editorContainer:i.element.dom}}}};Do.add("mobile",_v)}(),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>'}}),function(){"use strict";var e,t,n=tinymce.util.Tools.resolve("tinymce.PluginManager"),r=function(e,t,n){var r="UL"===t?"InsertUnorderedList":"InsertOrderedList";e.execCommand(r,!1,!1===n?null:{"list-style-type":n})},o=tinymce.util.Tools.resolve("tinymce.util.Tools"),i=function(){},a=function(e){return function(){return e}},u=function(e){return e},c=a(!1),s=a(!0),l=function(){return f},f={fold:function(e,t){return e()},isSome:c,isNone:s,getOr:t=u,getOrThunk:e=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:a(null),getOrUndefined:a(void 0),or:t,orThunk:e,map:l,each:i,bind:l,exists:c,forall:s,filter:function(){return l()},toArray:function(){return[]},toString:a("none()")},d=function(e){var t=a(e),n=function(){return o},r=function(t){return t(e)},o={fold:function(t,n){return n(e)},isSome:s,isNone:c,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:n,orThunk:n,map:function(t){return d(t(e))},each:function(t){t(e)},bind:r,exists:r,forall:r,filter:function(t){return t(e)?o:f},toArray:function(){return[e]},toString:function(){return"some("+e+")"}};return o},m=function(e){return null==e?f:d(e)},g=function(e){return e&&/^(TH|TD)$/.test(e.nodeName)},p=function(e,t){return function(n){var r=function(r){n.setActive(function(e,t,n){var r=function(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n;return-1}(t.parents,g),i=-1!==r?t.parents.slice(0,r):t.parents,a=o.grep(i,function(e){return function(t){return t&&/^(OL|UL|DL)$/.test(t.nodeName)&&function(e,t){return e.$.contains(e.getBody(),t)}(e,t)}}(e));return a.length>0&&a[0].nodeName===n}(e,r,t))};return e.on("NodeChange",r),function(){return e.off("NodeChange",r)}}},h=function(e,t,n,i,a,u){e.ui.registry.addSplitButton(t,{tooltip:n,icon:"OL"===a?"ordered-list":"unordered-list",presets:"listpreview",columns:3,fetch:function(e){e(o.map(u,(function(e){var t="OL"===a?"num":"bull",n="disc"===e||"decimal"===e?"default":e,r="default"===e?"":e,o=function(e){return e.replace(/\-/g," ").replace(/\b\w/g,(function(e){return e.toUpperCase()}))}(e);return{type:"choiceitem",value:r,icon:"list-"+t+"-"+n,text:o}})))},onAction:function(){return e.execCommand(i)},onItemAction:function(t,n){r(e,a,n)},select:function(t){var n=function(e){var t=e.dom.getParent(e.selection.getNode(),"ol,ul"),n=e.dom.getStyle(t,"listStyleType");return m(n)}(e);return n.map((function(e){return t===e})).getOr(!1)},onSetup:p(e,a)})},v=function(e,t,n,r,o,i){i.length>1?h(e,t,n,r,o,i):function(e,t,n,r,o,i){e.ui.registry.addToggleButton(t,{active:!1,tooltip:n,icon:"OL"===o?"ordered-list":"unordered-list",onSetup:p(e,o),onAction:function(){return e.execCommand(r)}})}(e,t,n,r,o)};n.add("advlist",(function(e){e.hasPlugin("lists")?(function(e){v(e,"numlist","Numbered list","InsertOrderedList","OL",function(e){var t=e.getParam("advlist_number_styles","default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman");return t?t.split(/[ ,]/):[]}(e)),v(e,"bullist","Bullet list","InsertUnorderedList","UL",function(e){var t=e.getParam("advlist_bullet_styles","default,circle,square");return t?t.split(/[ ,]/):[]}(e))}(e),function(e){e.addCommand("ApplyUnorderedListStyle",(function(t,n){r(e,"UL",n["list-style-type"])})),e.addCommand("ApplyOrderedListStyle",(function(t,n){r(e,"OL",n["list-style-type"])}))}(e)):console.error("Please use the Lists plugin together with the Advanced List plugin.")}))}(),function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),n=tinymce.util.Tools.resolve("tinymce.util.Tools"),r="a:not([href])",o=function(e){return!e},i=function(e){return e.getAttribute("id")||e.getAttribute("name")||""},a=function(e){return function(e){return e&&"a"===e.nodeName.toLowerCase()}(e)&&!e.getAttribute("href")&&""!==i(e)},u=function(e){var r=e.dom;t(r).walk(e.selection.getRng(),(function(e){n.each(e,(function(e){var t;a(t=e)&&!t.firstChild&&r.remove(e,!1)}))}))},c=function(e){return e.dom.getParent(e.selection.getStart(),r)},s=function(e,t){var n=c(e);n?function(e,t,n){n.removeAttribute("name"),n.id=t,e.addVisual(),e.undoManager.add()}(e,t,n):function(e,t){e.undoManager.transact((function(){(function(e){return e.getParam("allow_html_in_named_anchor",!1,"boolean")})(e)||e.selection.collapse(!0),e.selection.isCollapsed()?e.insertContent(e.dom.createHTML("a",{id:t})):(u(e),e.formatter.remove("namedAnchor",null,null,!0),e.formatter.apply("namedAnchor",{value:t}),e.addVisual())}))}(e,t),e.focus()},l=function(e){var t=function(e){var t=c(e);return t?i(t):""}(e);e.windowManager.open({title:"Anchor",size:"normal",body:{type:"panel",items:[{name:"id",type:"input",label:"ID",placeholder:"example"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{id:t},onSubmit:function(t){(function(e,t){return/^[A-Za-z][A-Za-z0-9\-:._]*$/.test(t)?(s(e,t),!0):(e.windowManager.alert("Id should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores."),!1)})(e,t.getData().id)&&t.close()}})},f=function(e){return function(e){return e&&o(e.attr("href"))&&!o(e.attr("id")||e.attr("name"))}(e)&&!e.firstChild},d=function(e){return function(t){for(var n=0;n<t.length;n++){var r=t[n];f(r)&&r.attr("contenteditable",e)}}};e.add("anchor",(function(e){!function(e){e.on("PreInit",(function(){e.parser.addNodeFilter("a",d("false")),e.serializer.addNodeFilter("a",d(null))}))}(e),function(e){e.addCommand("mceAnchor",(function(){l(e)}))}(e),function(e){e.ui.registry.addToggleButton("anchor",{icon:"bookmark",tooltip:"Anchor",onAction:function(){return e.execCommand("mceAnchor")},onSetup:function(t){return e.selection.selectorChangedWithUnbind("a:not([href])",t.setActive).unbind}}),e.ui.registry.addMenuItem("anchor",{icon:"bookmark",text:"Anchor...",onAction:function(){return e.execCommand("mceAnchor")}})}(e),e.on("PreInit",(function(){!function(e){e.formatter.register("namedAnchor",{inline:"a",selector:r,remove:"all",split:!0,deep:!0,attributes:{id:"%value"},onmatch:function(e,t,n){return a(e)}})}(e)}))}))}(),function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.Env"),n=new RegExp("^"+/(?:[A-Za-z][A-Za-z\d.+-]{0,14}:\/\/(?:[-.~*+=!&;:'%@?^${}(),\w]+@)?|www\.|[-;:&=+$,.\w]+@)[A-Za-z\d-]+(?:\.[A-Za-z\d-]+)*(?::\d+)?(?:\/(?:[-+~=.,%()\/\w]*[-+~=%()\/\w])?)?(?:\?(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?(?:#(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?/g.source+"$","i"),r=function(e,t){if(t<0&&(t=0),3===e.nodeType){var n=e.data.length;t>n&&(t=n)}return t},o=function(e,t,n){1!==t.nodeType||t.hasChildNodes()?e.setStart(t,r(t,n)):e.setStartBefore(t)},i=function(e,t,n){1!==t.nodeType||t.hasChildNodes()?e.setEnd(t,r(t,n)):e.setEndAfter(t)},a=function(e,t,r){var a,u,c,s,l,f,d,m=function(e){return e.getParam("autolink_pattern",n)}(e),g=function(e){return e.getParam("default_link_target",!1)}(e);if("A"!==e.selection.getNode().tagName){var p=e.selection.getRng().cloneRange();if(p.startOffset<5){if(!(l=p.endContainer.previousSibling)){if(!p.endContainer.firstChild||!p.endContainer.firstChild.nextSibling)return;l=p.endContainer.firstChild.nextSibling}if(f=l.length,o(p,l,f),i(p,l,f),p.endOffset<5)return;a=p.endOffset,u=l}else{if(3!==(u=p.endContainer).nodeType&&u.firstChild){for(;3!==u.nodeType&&u.firstChild;)u=u.firstChild;3===u.nodeType&&(o(p,u,0),i(p,u,u.nodeValue.length))}a=1===p.endOffset?2:p.endOffset-1-t}var h,v=a;do{o(p,u,a>=2?a-2:0),i(p,u,a>=1?a-1:0),a-=1,d=p.toString()}while(" "!==d&&""!==d&&160!==d.charCodeAt(0)&&a-2>=0&&d!==r);!function(e,t){return e===t||" "===e||160===e.charCodeAt(0)}(p.toString(),r)?0===p.startOffset?(o(p,u,0),i(p,u,v)):(o(p,u,a),i(p,u,v)):(o(p,u,a),i(p,u,v),a+=1),s=p.toString(),h=s.charAt(s.length-1),/[?!,.;:]/.test(h)&&i(p,u,v-1);var b=(s=p.toString().trim()).match(m),y=function(e){return e.getParam("link_default_protocol","http","string")}(e);if(b){var w=b[0];(function(e,t,n){return""===t||e.length>=t.length&&e.substr(n,n+t.length)===t})(w,"www.",0)?w=y+"://"+w:function(e,t){return-1!==e.indexOf(t)}(w,"@")&&!function(e){return/^([A-Za-z][A-Za-z\d.+-]*:\/\/)|mailto:/.test(e)}(w)&&(w="mailto:"+w),c=e.selection.getBookmark(),e.selection.setRng(p),e.execCommand("createlink",!1,w),!1!==g&&e.dom.setAttrib(e.selection.getNode(),"target",g),e.selection.moveToBookmark(c),e.nodeChanged()}}},u=function(e){var n;e.on("keydown",(function(t){if(13===t.keyCode)return function(e){a(e,-1,"")}(e)})),t.browser.isIE()?e.on("focus",(function(){if(!n){n=!0;try{e.execCommand("AutoUrlDetect",!1,!0)}catch(e){}}})):(e.on("keypress",(function(t){if(41===t.keyCode)return function(e){a(e,-1,"(")}(e)})),e.on("keyup",(function(t){if(32===t.keyCode)return function(e){a(e,0,"")}(e)})))};e.add("autolink",(function(e){u(e)}))}(),function(){"use strict";var e=Object.hasOwnProperty,t=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=tinymce.util.Tools.resolve("tinymce.Env"),r=tinymce.util.Tools.resolve("tinymce.util.Delay"),o=function(e){return e.getParam("min_height",e.getElement().offsetHeight,"number")},i=function(e,t,n,o,a){r.setEditorTimeout(e,(function(){c(e,t),n--?i(e,t,n,o,a):a&&a()}),o)},a=function(e,t){var n=e.getBody();n&&(n.style.overflowY=t?"":"hidden",t||(n.scrollTop=0))},u=function(e,t,n,r){var o=parseInt(e.getStyle(t,n,r),10);return isNaN(o)?0:o},c=function(e,t,r){var i=e.dom,s=e.getDoc();if(s)if(function(e){return e.plugins.fullscreen&&e.plugins.fullscreen.isFullscreen()}(e))a(e,!0);else{var l=s.documentElement,f=function(e){return e.getParam("autoresize_bottom_margin",50,"number")}(e),d=o(e),m=u(i,l,"margin-top",!0),g=u(i,l,"margin-bottom",!0),p=l.offsetHeight+m+g+f;p<0&&(p=0);var h=e.getContainer().offsetHeight-e.getContentAreaContainer().offsetHeight;p+h>o(e)&&(d=p+h);var v=function(e){return e.getParam("max_height",0,"number")}(e);if(v&&d>v?(d=v,a(e,!0)):a(e,!1),d!==t.get()){var b=d-t.get();if(i.setStyle(e.getContainer(),"height",d+"px"),t.set(d),function(e){e.fire("ResizeEditor")}(e),n.browser.isSafari()&&n.mac){var y=e.getWin();y.scrollTo(y.pageXOffset,y.pageYOffset)}e.hasFocus()&&function(e){if("setcontent"===(null==e?void 0:e.type.toLowerCase())){var t=e;return!0===t.selection||!0===t.paste}return!1}(r)&&e.selection.scrollIntoView(),n.webkit&&b<0&&c(e,t,r)}}};t.add("autoresize",(function(t){var n,r,o;if(n=t.settings,r="resize",e.call(n,r)||(t.settings.resize=!1),!t.inline){var a=(o=0,{get:function(){return o},set:function(e){o=e}});!function(e,t){e.addCommand("mceAutoResize",(function(){c(e,t)}))}(t,a),function(e,t){e.on("init",(function(){var t=function(e){return e.getParam("autoresize_overflow_padding",1,"number")}(e),n=e.dom;n.setStyles(e.getDoc().documentElement,{height:"auto"}),n.setStyles(e.getBody(),{paddingLeft:t,paddingRight:t,"min-height":0})})),e.on("NodeChange SetContent keyup FullscreenStateChanged ResizeContent",(function(n){c(e,t,n)})),function(e){return e.getParam("autoresize_on_init",!0,"boolean")}(e)&&e.on("init",(function(){i(e,t,20,100,(function(){i(e,t,5,1e3)}))}))}(t,a)}}))}(),function(){"use strict";var e,t=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=(e=void 0,function(t){return e===t}),r=tinymce.util.Tools.resolve("tinymce.util.Delay"),o=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),i=tinymce.util.Tools.resolve("tinymce.util.Tools"),a=function(e,t){var n=e||t,r=/^(\d+)([ms]?)$/.exec(""+n);return(r[2]?{s:1e3,m:6e4}[r[2]]:1)*parseInt(n,10)},u=function(e){var t=document.location;return e.getParam("autosave_prefix","tinymce-autosave-{path}{query}{hash}-{id}-").replace(/{path}/g,t.pathname).replace(/{query}/g,t.search).replace(/{hash}/g,t.hash).replace(/{id}/g,e.id)},c=function(e,t){if(n(t))return e.dom.isEmpty(e.getBody());var r=i.trim(t);if(""===r)return!0;var o=(new DOMParser).parseFromString(r,"text/html");return e.dom.isEmpty(o)},s=function(e){var t=parseInt(o.getItem(u(e)+"time"),10)||0;return!((new Date).getTime()-t>function(e){return a(e.getParam("autosave_retention"),"20m")}(e))||(l(e,!1),!1)},l=function(e,t){var n=u(e);o.removeItem(n+"draft"),o.removeItem(n+"time"),!1!==t&&function(e){e.fire("RemoveDraft")}(e)},f=function(e){var t=u(e);!c(e)&&e.isDirty()&&(o.setItem(t+"draft",e.getContent({format:"raw",no_events:!0})),o.setItem(t+"time",(new Date).getTime().toString()),function(e){e.fire("StoreDraft")}(e))},d=function(e){var t=u(e);s(e)&&(e.setContent(o.getItem(t+"draft"),{format:"raw"}),function(e){e.fire("RestoreDraft")}(e))},m=function(e){var t=function(e){return a(e.getParam("autosave_interval"),"30s")}(e);r.setEditorInterval(e,(function(){f(e)}),t)},g=function(e){e.undoManager.transact((function(){d(e),l(e)})),e.focus()},p=tinymce.util.Tools.resolve("tinymce.EditorManager"),h=function(e){return function(t){t.setDisabled(!s(e));var n=function(){return t.setDisabled(!s(e))};return e.on("StoreDraft RestoreDraft RemoveDraft",n),function(){return e.off("StoreDraft RestoreDraft RemoveDraft",n)}}};t.add("autosave",(function(e){return function(e){e.editorManager.on("BeforeUnload",(function(e){var t;i.each(p.get(),(function(e){e.plugins.autosave&&e.plugins.autosave.storeDraft(),!t&&e.isDirty()&&function(e){return e.getParam("autosave_ask_before_unload",!0)}(e)&&(t=e.translate("You have unsaved changes are you sure you want to navigate away?"))})),t&&(e.preventDefault(),e.returnValue=t)}))}(e),function(e){m(e),e.ui.registry.addButton("restoredraft",{tooltip:"Restore last draft",icon:"restore-draft",onAction:function(){g(e)},onSetup:h(e)}),e.ui.registry.addMenuItem("restoredraft",{text:"Restore last draft",icon:"restore-draft",onAction:function(){g(e)},onSetup:h(e)})}(e),e.on("init",(function(){(function(e){return e.getParam("autosave_restore_when_empty",!1)})(e)&&e.dom.isEmpty(e.getBody())&&d(e)})),function(e){return{hasDraft:function(){return s(e)},storeDraft:function(){return f(e)},restoreDraft:function(){return d(e)},removeDraft:function(t){return l(e,t)},isEmpty:function(t){return c(e,t)}}}(e)}))}(),function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.util.Tools"),n=function(e){e=t.trim(e);var n=function(t,n){e=e.replace(t,n)};return n(/\n/gi,"<br />"),n(/\[b\]/gi,"<strong>"),n(/\[\/b\]/gi,"</strong>"),n(/\[i\]/gi,"<em>"),n(/\[\/i\]/gi,"</em>"),n(/\[u\]/gi,"<u>"),n(/\[\/u\]/gi,"</u>"),n(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,'<a href="$1">$2</a>'),n(/\[url\](.*?)\[\/url\]/gi,'<a href="$1">$1</a>'),n(/\[img\](.*?)\[\/img\]/gi,'<img src="$1" />'),n(/\[color=(.*?)\](.*?)\[\/color\]/gi,'<font color="$1">$2</font>'),n(/\[code\](.*?)\[\/code\]/gi,'<span class="codeStyle">$1</span>&nbsp;'),n(/\[quote.*?\](.*?)\[\/quote\]/gi,'<span class="quoteStyle">$1</span>&nbsp;'),e};e.add("bbcode",(function(e){e.on("BeforeSetContent",(function(e){e.content=n(e.content)})),e.on("PostProcess",(function(e){e.set&&(e.content=n(e.content)),e.get&&(e.content=function(e){e=t.trim(e);var n=function(t,n){e=e.replace(t,n)};return n(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]"),n(/<font.*?color=\"(.*?)\".*?class=\"codeStyle\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"),n(/<font.*?color=\"(.*?)\".*?class=\"quoteStyle\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"),n(/<font.*?class=\"codeStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"),n(/<font.*?class=\"quoteStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"),n(/<span style=\"color: ?(.*?);\">(.*?)<\/span>/gi,"[color=$1]$2[/color]"),n(/<font.*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[color=$1]$2[/color]"),n(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi,"[size=$1]$2[/size]"),n(/<font>(.*?)<\/font>/gi,"$1"),n(/<img.*?src=\"(.*?)\".*?\/>/gi,"[img]$1[/img]"),n(/<span class=\"codeStyle\">(.*?)<\/span>/gi,"[code]$1[/code]"),n(/<span class=\"quoteStyle\">(.*?)<\/span>/gi,"[quote]$1[/quote]"),n(/<strong class=\"codeStyle\">(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]"),n(/<strong class=\"quoteStyle\">(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]"),n(/<em class=\"codeStyle\">(.*?)<\/em>/gi,"[code][i]$1[/i][/code]"),n(/<em class=\"quoteStyle\">(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]"),n(/<u class=\"codeStyle\">(.*?)<\/u>/gi,"[code][u]$1[/u][/code]"),n(/<u class=\"quoteStyle\">(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]"),n(/<\/(strong|b)>/gi,"[/b]"),n(/<(strong|b)>/gi,"[b]"),n(/<\/(em|i)>/gi,"[/i]"),n(/<(em|i)>/gi,"[i]"),n(/<\/u>/gi,"[/u]"),n(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi,"[u]$1[/u]"),n(/<u>/gi,"[u]"),n(/<blockquote[^>]*>/gi,"[quote]"),n(/<\/blockquote>/gi,"[/quote]"),n(/<br \/>/gi,"\n"),n(/<br\/>/gi,"\n"),n(/<br>/gi,"\n"),n(/<p>/gi,""),n(/<\/p>/gi,"\n"),n(/&nbsp;|\u00a0/gi," "),n(/&quot;/gi,'"'),n(/&lt;/gi,"<"),n(/&gt;/gi,">"),n(/&amp;/gi,"&"),e}(e.content))}))}))}(),function(){"use strict";var e,t,n,r,o=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=function(e,t){var n=function(e,t){return e.fire("insertCustomChar",{chr:t})}(e,t).chr;e.execCommand("mceInsertContent",!1,n)},a=(e="array",function(t){return r=typeof(n=t),(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)===e;var n,r}),u=(t=null,function(e){return t===e}),c=function(){},s=function(e){return function(){return e}},l=function(e){return e},f=s(!1),d=s(!0),m=function(){return g},g={fold:function(e,t){return e()},isSome:f,isNone:d,getOr:r=l,getOrThunk:n=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:s(null),getOrUndefined:s(void 0),or:r,orThunk:n,map:m,each:c,bind:m,exists:f,forall:d,filter:function(){return m()},toArray:function(){return[]},toString:s("none()")},p=function(e){var t=s(e),n=function(){return o},r=function(t){return t(e)},o={fold:function(t,n){return n(e)},isSome:d,isNone:f,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:n,orThunk:n,map:function(t){return p(t(e))},each:function(t){t(e)},bind:r,exists:r,forall:r,filter:function(t){return t(e)?o:g},toArray:function(){return[e]},toString:function(){return"some("+e+")"}};return o},h={some:p,none:m,from:function(e){return null==e?g:p(e)}},v=Array.prototype.push,b=function(e,t){for(var n=e.length,r=new Array(n),o=0;o<n;o++){var i=e[o];r[o]=t(i,o)}return r},y=function(e,t){return function(e,t,n){for(var r=0,o=e.length;r<o;r++){var i=e[r];if(t(i,r))return h.some(i);if(n(i,r))break}return h.none()}(e,t,f)},w=function(e,t){return function(e){for(var t=[],n=0,r=e.length;n<r;++n){if(!a(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);v.apply(t,e[n])}return t}(b(e,t))},x=tinymce.util.Tools.resolve("tinymce.util.Tools"),C=x.isArray,S="User Defined",k=function(e){return C(e)?(t=e,x.grep(t,(function(e){return C(e)&&2===e.length}))):"function"==typeof e?e():[];var t},T=function(e){var t=function(e,t){var n=function(e){return e.getParam("charmap")}(e);n&&(t=[{name:S,characters:k(n)}]);var r=function(e){return e.getParam("charmap_append")}(e);if(r){var o=x.grep(t,(function(e){return e.name===S}));return o.length?(o[0].characters=[].concat(o[0].characters).concat(k(r)),t):t.concat({name:S,characters:k(r)})}return t}(e,[{name:"Currency",characters:[[36,"dollar sign"],[162,"cent sign"],[8364,"euro sign"],[163,"pound sign"],[165,"yen sign"],[164,"currency sign"],[8352,"euro-currency sign"],[8353,"colon sign"],[8354,"cruzeiro sign"],[8355,"french franc sign"],[8356,"lira sign"],[8357,"mill sign"],[8358,"naira sign"],[8359,"peseta sign"],[8360,"rupee sign"],[8361,"won sign"],[8362,"new sheqel sign"],[8363,"dong sign"],[8365,"kip sign"],[8366,"tugrik sign"],[8367,"drachma sign"],[8368,"german penny symbol"],[8369,"peso sign"],[8370,"guarani sign"],[8371,"austral sign"],[8372,"hryvnia sign"],[8373,"cedi sign"],[8374,"livre tournois sign"],[8375,"spesmilo sign"],[8376,"tenge sign"],[8377,"indian rupee sign"],[8378,"turkish lira sign"],[8379,"nordic mark sign"],[8380,"manat sign"],[8381,"ruble sign"],[20870,"yen character"],[20803,"yuan character"],[22291,"yuan character, in hong kong and taiwan"],[22278,"yen/yuan character variant one"]]},{name:"Text",characters:[[169,"copyright sign"],[174,"registered sign"],[8482,"trade mark sign"],[8240,"per mille sign"],[181,"micro sign"],[183,"middle dot"],[8226,"bullet"],[8230,"three dot leader"],[8242,"minutes / feet"],[8243,"seconds / inches"],[167,"section sign"],[182,"paragraph sign"],[223,"sharp s / ess-zed"]]},{name:"Quotations",characters:[[8249,"single left-pointing angle quotation mark"],[8250,"single right-pointing angle quotation mark"],[171,"left pointing guillemet"],[187,"right pointing guillemet"],[8216,"left single quotation mark"],[8217,"right single quotation mark"],[8220,"left double quotation mark"],[8221,"right double quotation mark"],[8218,"single low-9 quotation mark"],[8222,"double low-9 quotation mark"],[60,"less-than sign"],[62,"greater-than sign"],[8804,"less-than or equal to"],[8805,"greater-than or equal to"],[8211,"en dash"],[8212,"em dash"],[175,"macron"],[8254,"overline"],[164,"currency sign"],[166,"broken bar"],[168,"diaeresis"],[161,"inverted exclamation mark"],[191,"turned question mark"],[710,"circumflex accent"],[732,"small tilde"],[176,"degree sign"],[8722,"minus sign"],[177,"plus-minus sign"],[247,"division sign"],[8260,"fraction slash"],[215,"multiplication sign"],[185,"superscript one"],[178,"superscript two"],[179,"superscript three"],[188,"fraction one quarter"],[189,"fraction one half"],[190,"fraction three quarters"]]},{name:"Mathematical",characters:[[402,"function / florin"],[8747,"integral"],[8721,"n-ary sumation"],[8734,"infinity"],[8730,"square root"],[8764,"similar to"],[8773,"approximately equal to"],[8776,"almost equal to"],[8800,"not equal to"],[8801,"identical to"],[8712,"element of"],[8713,"not an element of"],[8715,"contains as member"],[8719,"n-ary product"],[8743,"logical and"],[8744,"logical or"],[172,"not sign"],[8745,"intersection"],[8746,"union"],[8706,"partial differential"],[8704,"for all"],[8707,"there exists"],[8709,"diameter"],[8711,"backward difference"],[8727,"asterisk operator"],[8733,"proportional to"],[8736,"angle"]]},{name:"Extended Latin",characters:[[192,"A - grave"],[193,"A - acute"],[194,"A - circumflex"],[195,"A - tilde"],[196,"A - diaeresis"],[197,"A - ring above"],[256,"A - macron"],[198,"ligature AE"],[199,"C - cedilla"],[200,"E - grave"],[201,"E - acute"],[202,"E - circumflex"],[203,"E - diaeresis"],[274,"E - macron"],[204,"I - grave"],[205,"I - acute"],[206,"I - circumflex"],[207,"I - diaeresis"],[298,"I - macron"],[208,"ETH"],[209,"N - tilde"],[210,"O - grave"],[211,"O - acute"],[212,"O - circumflex"],[213,"O - tilde"],[214,"O - diaeresis"],[216,"O - slash"],[332,"O - macron"],[338,"ligature OE"],[352,"S - caron"],[217,"U - grave"],[218,"U - acute"],[219,"U - circumflex"],[220,"U - diaeresis"],[362,"U - macron"],[221,"Y - acute"],[376,"Y - diaeresis"],[562,"Y - macron"],[222,"THORN"],[224,"a - grave"],[225,"a - acute"],[226,"a - circumflex"],[227,"a - tilde"],[228,"a - diaeresis"],[229,"a - ring above"],[257,"a - macron"],[230,"ligature ae"],[231,"c - cedilla"],[232,"e - grave"],[233,"e - acute"],[234,"e - circumflex"],[235,"e - diaeresis"],[275,"e - macron"],[236,"i - grave"],[237,"i - acute"],[238,"i - circumflex"],[239,"i - diaeresis"],[299,"i - macron"],[240,"eth"],[241,"n - tilde"],[242,"o - grave"],[243,"o - acute"],[244,"o - circumflex"],[245,"o - tilde"],[246,"o - diaeresis"],[248,"o slash"],[333,"o macron"],[339,"ligature oe"],[353,"s - caron"],[249,"u - grave"],[250,"u - acute"],[251,"u - circumflex"],[252,"u - diaeresis"],[363,"u - macron"],[253,"y - acute"],[254,"thorn"],[255,"y - diaeresis"],[563,"y - macron"],[913,"Alpha"],[914,"Beta"],[915,"Gamma"],[916,"Delta"],[917,"Epsilon"],[918,"Zeta"],[919,"Eta"],[920,"Theta"],[921,"Iota"],[922,"Kappa"],[923,"Lambda"],[924,"Mu"],[925,"Nu"],[926,"Xi"],[927,"Omicron"],[928,"Pi"],[929,"Rho"],[931,"Sigma"],[932,"Tau"],[933,"Upsilon"],[934,"Phi"],[935,"Chi"],[936,"Psi"],[937,"Omega"],[945,"alpha"],[946,"beta"],[947,"gamma"],[948,"delta"],[949,"epsilon"],[950,"zeta"],[951,"eta"],[952,"theta"],[953,"iota"],[954,"kappa"],[955,"lambda"],[956,"mu"],[957,"nu"],[958,"xi"],[959,"omicron"],[960,"pi"],[961,"rho"],[962,"final sigma"],[963,"sigma"],[964,"tau"],[965,"upsilon"],[966,"phi"],[967,"chi"],[968,"psi"],[969,"omega"]]},{name:"Symbols",characters:[[8501,"alef symbol"],[982,"pi symbol"],[8476,"real part symbol"],[978,"upsilon - hook symbol"],[8472,"Weierstrass p"],[8465,"imaginary part"]]},{name:"Arrows",characters:[[8592,"leftwards arrow"],[8593,"upwards arrow"],[8594,"rightwards arrow"],[8595,"downwards arrow"],[8596,"left right arrow"],[8629,"carriage return"],[8656,"leftwards double arrow"],[8657,"upwards double arrow"],[8658,"rightwards double arrow"],[8659,"downwards double arrow"],[8660,"left right double arrow"],[8756,"therefore"],[8834,"subset of"],[8835,"superset of"],[8836,"not a subset of"],[8838,"subset of or equal to"],[8839,"superset of or equal to"],[8853,"circled plus"],[8855,"circled times"],[8869,"perpendicular"],[8901,"dot operator"],[8968,"left ceiling"],[8969,"right ceiling"],[8970,"left floor"],[8971,"right floor"],[9001,"left-pointing angle bracket"],[9002,"right-pointing angle bracket"],[9674,"lozenge"],[9824,"black spade suit"],[9827,"black club suit"],[9829,"black heart suit"],[9830,"black diamond suit"],[8194,"en space"],[8195,"em space"],[8201,"thin space"],[8204,"zero width non-joiner"],[8205,"zero width joiner"],[8206,"left-to-right mark"],[8207,"right-to-left mark"]]}]);return t.length>1?[{name:"All",characters:w(t,(function(e){return e.characters}))}].concat(t):t},O=function(e){var t=e;return{get:function(){return t},set:function(e){t=e}}},_=String.fromCodePoint,E=function(e,t){return-1!==e.indexOf(t)},A=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(_)return _.apply(void 0,e);for(var n=[],r=0,o="",i=0,a=e.length;i!==a;++i){var u=+e[i];if(!(u<1114111&&u>>>0===u))throw RangeError("Invalid code point: "+u);u<=65535?r=n.push(u):(u-=65536,r=n.push(55296+(u>>10),u%1024+56320)),r>=16383&&(o+=String.fromCharCode.apply(null,n),n.length=0)}return o+String.fromCharCode.apply(null,n)},D=function(e,t){var n=[],r=t.toLowerCase();return function(e,t){for(var n=0,r=e.length;n<r;n++)t(e[n],n)}(e.characters,(function(e){(function(e,t,n){return!!E(A(e).toLowerCase(),n)||E(t.toLowerCase(),n)||E(t.toLowerCase().replace(/\s+/g,""),n)})(e[0],e[1],r)&&n.push(e)})),b(n,(function(e){return{text:e[1],value:A(e[0]),icon:A(e[0])}}))},M="pattern",N=function(e,t){var n,r,o,a,c=function(){return[{label:"Search",type:"input",name:M},{type:"collection",name:"results"}]},s=1===t.length?O(S):O("All"),l=(n=function(e){var n=e.getData().pattern;!function(e,n){y(t,(function(e){return e.name===s.get()})).each((function(t){var r=D(t,n);e.setData({results:r})}))}(e,n)},r=40,o=null,{cancel:a=function(){u(o)||(clearTimeout(o),o=null)},throttle:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];a(),o=setTimeout((function(){o=null,n.apply(null,e)}),r)}}),f={title:"Special Character",size:"normal",body:1===t.length?{type:"panel",items:c()}:{type:"tabpanel",tabs:b(t,(function(e){return{title:e.name,name:e.name,items:c()}}))},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}],initialData:{pattern:"",results:D(t[0],"")},onAction:function(t,n){"results"===n.name&&(i(e,n.value),t.close())},onTabChange:function(e,t){s.set(t.newTabName),l.throttle(e)},onChange:function(e,t){t.name===M&&l.throttle(e)}};e.windowManager.open(f).focus(M)},R=tinymce.util.Tools.resolve("tinymce.util.Promise");o.add("charmap",(function(e){var t=T(e);return function(e,t){e.addCommand("mceShowCharmap",(function(){N(e,t)}))}(e,t),function(e){e.ui.registry.addButton("charmap",{icon:"insert-character",tooltip:"Special character",onAction:function(){return e.execCommand("mceShowCharmap")}}),e.ui.registry.addMenuItem("charmap",{icon:"insert-character",text:"Special character...",onAction:function(){return e.execCommand("mceShowCharmap")}})}(e),function(e,t){e.ui.registry.addAutocompleter("charmap",{ch:":",columns:"auto",minChars:2,fetch:function(e,n){return new R((function(n,r){n(D(t,e))}))},onAction:function(t,n,r){e.selection.setRng(n),e.insertContent(r),t.hide()}})}(e,t[0]),function(e){return{getCharMap:function(){return T(e)},insertChar:function(t){i(e,t)}}}(e)}))}(),function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");e.add("code",(function(e){return function(e){e.addCommand("mceCodeEditor",(function(){!function(e){var t=function(e){return e.getContent({source_view:!0})}(e);e.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:t},onSubmit:function(t){!function(e,t){e.focus(),e.undoManager.transact((function(){e.setContent(t)})),e.selection.setCursorLocation(),e.nodeChanged()}(e,t.getData().code),t.close()}})}(e)}))}(e),function(e){var t=function(){return e.execCommand("mceCodeEditor")};e.ui.registry.addButton("code",{icon:"sourcecode",tooltip:"Source code",onAction:t}),e.ui.registry.addMenuItem("code",{icon:"sourcecode",text:"Source code",onAction:t})}(e),{}}))}(),function(){"use strict";var e,t,n=tinymce.util.Tools.resolve("tinymce.PluginManager"),r=function(){},o=function(e){return function(){return e}},i=function(e){return e},a=o(!1),u=o(!0),c=function(){return s},s={fold:function(e,t){return e()},isSome:a,isNone:u,getOr:t=i,getOrThunk:e=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:o(null),getOrUndefined:o(void 0),or:t,orThunk:e,map:c,each:r,bind:c,exists:a,forall:u,filter:function(){return c()},toArray:function(){return[]},toString:o("none()")},l=function(e){var t=o(e),n=function(){return i},r=function(t){return t(e)},i={fold:function(t,n){return n(e)},isSome:u,isNone:a,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:n,orThunk:n,map:function(t){return l(t(e))},each:function(t){t(e)},bind:r,exists:r,forall:r,filter:function(t){return t(e)?i:s},toArray:function(){return[e]},toString:function(){return"some("+e+")"}};return i},f={some:l,none:c,from:function(e){return null==e?s:l(e)}},d=function(e){return function(e,t){return t>=0&&t<e.length?f.some(e[t]):f.none()}(e,0)},m=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),g=function(e){return e&&"PRE"===e.nodeName&&-1!==e.className.indexOf("language-")},p=function(e){return function(t,n){return e(n)}},h="undefined"!=typeof window?window:Function("return this;")(),v={},b={exports:v},y={};!function(e,t,n,r){var o=window.Prism;window.Prism={manual:!0},function(r,o){"object"==typeof t&&void 0!==n?n.exports=o():"function"==typeof e&&e.amd?e(o):(r="undefined"!=typeof globalThis?globalThis:r||self).EphoxContactWrapper=o()}(this,(function(){var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==y?y:"undefined"!=typeof self?self:{},t={exports:{}};return function(t){var n=function(e){var t=/\blang(?:uage)?-([\w-]+)\b/i,n=0,r={},o={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function e(t){return t instanceof i?new i(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++n}),e.__id},clone:function e(t,n){var r,i;switch(n=n||{},o.util.type(t)){case"Object":if(i=o.util.objId(t),n[i])return n[i];for(var a in r={},n[i]=r,t)t.hasOwnProperty(a)&&(r[a]=e(t[a],n));return r;case"Array":return i=o.util.objId(t),n[i]?n[i]:(r=[],n[i]=r,t.forEach((function(t,o){r[o]=e(t,n)})),r);default:return t}},getLanguage:function(e){for(;e&&!t.test(e.className);)e=e.parentElement;return e?(e.className.match(t)||[,"none"])[1].toLowerCase():"none"},currentScript:function(){if("undefined"==typeof document)return null;if("currentScript"in document)return document.currentScript;try{throw new Error}catch(r){var e=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(r.stack)||[])[1];if(e){var t=document.getElementsByTagName("script");for(var n in t)if(t[n].src==e)return t[n]}return null}},isActive:function(e,t,n){for(var r="no-"+t;e;){var o=e.classList;if(o.contains(t))return!0;if(o.contains(r))return!1;e=e.parentElement}return!!n}},languages:{plain:r,plaintext:r,text:r,txt:r,extend:function(e,t){var n=o.util.clone(o.languages[e]);for(var r in t)n[r]=t[r];return n},insertBefore:function(e,t,n,r){var i=(r=r||o.languages)[e],a={};for(var u in i)if(i.hasOwnProperty(u)){if(u==t)for(var c in n)n.hasOwnProperty(c)&&(a[c]=n[c]);n.hasOwnProperty(u)||(a[u]=i[u])}var s=r[e];return r[e]=a,o.languages.DFS(o.languages,(function(t,n){n===s&&t!=e&&(this[t]=a)})),a},DFS:function e(t,n,r,i){i=i||{};var a=o.util.objId;for(var u in t)if(t.hasOwnProperty(u)){n.call(t,u,t[u],r||u);var c=t[u],s=o.util.type(c);"Object"!==s||i[a(c)]?"Array"!==s||i[a(c)]||(i[a(c)]=!0,e(c,n,u,i)):(i[a(c)]=!0,e(c,n,null,i))}}},plugins:{},highlightAll:function(e,t){o.highlightAllUnder(document,e,t)},highlightAllUnder:function(e,t,n){var r={callback:n,container:e,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};o.hooks.run("before-highlightall",r),r.elements=Array.prototype.slice.apply(r.container.querySelectorAll(r.selector)),o.hooks.run("before-all-elements-highlight",r);for(var i,a=0;i=r.elements[a++];)o.highlightElement(i,!0===t,r.callback)},highlightElement:function(n,r,i){var a=o.util.getLanguage(n),u=o.languages[a];n.className=n.className.replace(t,"").replace(/\s+/g," ")+" language-"+a;var c=n.parentElement;c&&"pre"===c.nodeName.toLowerCase()&&(c.className=c.className.replace(t,"").replace(/\s+/g," ")+" language-"+a);var s={element:n,language:a,grammar:u,code:n.textContent};function l(e){s.highlightedCode=e,o.hooks.run("before-insert",s),s.element.innerHTML=s.highlightedCode,o.hooks.run("after-highlight",s),o.hooks.run("complete",s),i&&i.call(s.element)}if(o.hooks.run("before-sanity-check",s),(c=s.element.parentElement)&&"pre"===c.nodeName.toLowerCase()&&!c.hasAttribute("tabindex")&&c.setAttribute("tabindex","0"),!s.code)return o.hooks.run("complete",s),void(i&&i.call(s.element));if(o.hooks.run("before-highlight",s),s.grammar)if(r&&e.Worker){var f=new Worker(o.filename);f.onmessage=function(e){l(e.data)},f.postMessage(JSON.stringify({language:s.language,code:s.code,immediateClose:!0}))}else l(o.highlight(s.code,s.grammar,s.language));else l(o.util.encode(s.code))},highlight:function(e,t,n){var r={code:e,grammar:t,language:n};return o.hooks.run("before-tokenize",r),r.tokens=o.tokenize(r.code,r.grammar),o.hooks.run("after-tokenize",r),i.stringify(o.util.encode(r.tokens),r.language)},tokenize:function(e,t){var n=t.rest;if(n){for(var r in n)t[r]=n[r];delete t.rest}var o=new c;return s(o,o.head,e),u(e,o,t,o.head,0),function(e){var t=[],n=e.head.next;for(;n!==e.tail;)t.push(n.value),n=n.next;return t}(o)},hooks:{all:{},add:function(e,t){var n=o.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=o.hooks.all[e];if(n&&n.length)for(var r,i=0;r=n[i++];)r(t)}},Token:i};function i(e,t,n,r){this.type=e,this.content=t,this.alias=n,this.length=0|(r||"").length}function a(e,t,n,r){e.lastIndex=t;var o=e.exec(n);if(o&&r&&o[1]){var i=o[1].length;o.index+=i,o[0]=o[0].slice(i)}return o}function u(e,t,n,r,c,f){for(var d in n)if(n.hasOwnProperty(d)&&n[d]){var m=n[d];m=Array.isArray(m)?m:[m];for(var g=0;g<m.length;++g){if(f&&f.cause==d+","+g)return;var p=m[g],h=p.inside,v=!!p.lookbehind,b=!!p.greedy,y=p.alias;if(b&&!p.pattern.global){var w=p.pattern.toString().match(/[imsuy]*$/)[0];p.pattern=RegExp(p.pattern.source,w+"g")}for(var x=p.pattern||p,C=r.next,S=c;C!==t.tail&&!(f&&S>=f.reach);S+=C.value.length,C=C.next){var k=C.value;if(t.length>e.length)return;if(!(k instanceof i)){var T,O=1;if(b){if(!(T=a(x,S,e,v)))break;var _=T.index,E=T.index+T[0].length,A=S;for(A+=C.value.length;_>=A;)A+=(C=C.next).value.length;if(S=A-=C.value.length,C.value instanceof i)continue;for(var D=C;D!==t.tail&&(A<E||"string"==typeof D.value);D=D.next)O++,A+=D.value.length;O--,k=e.slice(S,A),T.index-=S}else if(!(T=a(x,0,k,v)))continue;_=T.index;var M=T[0],N=k.slice(0,_),R=k.slice(_+M.length),z=S+k.length;f&&z>f.reach&&(f.reach=z);var B=C.prev;if(N&&(B=s(t,B,N),S+=N.length),l(t,B,O),C=s(t,B,new i(d,h?o.tokenize(M,h):M,y,M)),R&&s(t,C,R),O>1){var P={cause:d+","+g,reach:z};u(e,t,n,C.prev,S,P),f&&P.reach>f.reach&&(f.reach=P.reach)}}}}}}function c(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function s(e,t,n){var r=t.next,o={value:n,prev:t,next:r};return t.next=o,r.prev=o,e.length++,o}function l(e,t,n){for(var r=t.next,o=0;o<n&&r!==e.tail;o++)r=r.next;t.next=r,r.prev=t,e.length-=o}if(e.Prism=o,i.stringify=function e(t,n){if("string"==typeof t)return t;if(Array.isArray(t)){var r="";return t.forEach((function(t){r+=e(t,n)})),r}var i={type:t.type,content:e(t.content,n),tag:"span",classes:["token",t.type],attributes:{},language:n},a=t.alias;a&&(Array.isArray(a)?Array.prototype.push.apply(i.classes,a):i.classes.push(a)),o.hooks.run("wrap",i);var u="";for(var c in i.attributes)u+=" "+c+'="'+(i.attributes[c]||"").replace(/"/g,"&quot;")+'"';return"<"+i.tag+' class="'+i.classes.join(" ")+'"'+u+">"+i.content+"</"+i.tag+">"},!e.document)return e.addEventListener?(o.disableWorkerMessageHandler||e.addEventListener("message",(function(t){var n=JSON.parse(t.data),r=n.language,i=n.code,a=n.immediateClose;e.postMessage(o.highlight(i,o.languages[r],r)),a&&e.close()}),!1),o):o;var f=o.util.currentScript();function d(){o.manual||o.highlightAll()}if(f&&(o.filename=f.src,f.hasAttribute("data-manual")&&(o.manual=!0)),!o.manual){var m=document.readyState;"loading"===m||"interactive"===m&&f&&f.defer?document.addEventListener("DOMContentLoaded",d):window.requestAnimationFrame?window.requestAnimationFrame(d):window.setTimeout(d,16)}return o}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{});t.exports&&(t.exports=n),void 0!==e&&(e.Prism=n)}(t),Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|interface|extends|implements|trait|instanceof|new)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,boolean:/\b(?:true|false)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},function(e){function t(e,t){return"___"+e.toUpperCase()+t+"___"}Object.defineProperties(e.languages["markup-templating"]={},{buildPlaceholders:{value:function(n,r,o,i){if(n.language===r){var a=n.tokenStack=[];n.code=n.code.replace(o,(function(e){if("function"==typeof i&&!i(e))return e;for(var o,u=a.length;-1!==n.code.indexOf(o=t(r,u));)++u;return a[u]=e,o})),n.grammar=e.languages.markup}}},tokenizePlaceholders:{value:function(n,r){if(n.language===r&&n.tokenStack){n.grammar=e.languages[r];var o=0,i=Object.keys(n.tokenStack);!function a(u){for(var c=0;c<u.length&&!(o>=i.length);c++){var s=u[c];if("string"==typeof s||s.content&&"string"==typeof s.content){var l=i[o],f=n.tokenStack[l],d="string"==typeof s?s:s.content,m=t(r,l),g=d.indexOf(m);if(g>-1){++o;var p=d.substring(0,g),h=new e.Token(r,e.tokenize(f,n.grammar),"language-"+r,f),v=d.substring(g+m.length),b=[];p&&b.push.apply(b,a([p])),b.push(h),v&&b.push.apply(b,a([v])),"string"==typeof s?u.splice.apply(u,[c,1].concat(b)):s.content=b}}else s.content&&a(s.content)}return u}(n.tokens)}}}})}(Prism),Prism.languages.c=Prism.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:__attribute__|_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|asm|typeof|inline|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),Prism.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},Prism.languages.c.string],comment:Prism.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:Prism.languages.c}}},constant:/\b(?:__FILE__|__LINE__|__DATE__|__TIME__|__TIMESTAMP__|__func__|EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|stdin|stdout|stderr)\b/}),delete Prism.languages.c.boolean,function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char8_t|char16_t|char32_t|class|compl|concept|const|consteval|constexpr|constinit|const_cast|continue|co_await|co_return|co_yield|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int8_t|int16_t|int32_t|int64_t|uint8_t|uint16_t|uint32_t|uint64_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,(function(){return t.source}));e.languages.cpp=e.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,(function(){return t.source}))),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:true|false)\b/}),e.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:module|import)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,(function(){return n}))+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),e.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e.languages.cpp}}}}),e.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),e.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend("cpp",{})}}),e.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])}(Prism),function(e){function t(e,t){return e.replace(/<<(\d+)>>/g,(function(e,n){return"(?:"+t[+n]+")"}))}function n(e,n,r){return RegExp(t(e,n),r||"")}function r(e,t){for(var n=0;n<t;n++)e=e.replace(/<<self>>/g,(function(){return"(?:"+e+")"}));return e.replace(/<<self>>/g,"[^\\s\\S]")}var o="bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void",i="class enum interface record struct",a="add alias and ascending async await by descending from(?=\\s*(?:\\w|$)) get global group into init(?=\\s*;) join let nameof not notnull on or orderby partial remove select set unmanaged value when where with(?=\\s*{)",u="abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield";function c(e){return"\\b(?:"+e.trim().replace(/ /g,"|")+")\\b"}var s=c(i),l=RegExp(c(o+" "+i+" "+a+" "+u)),f=c(i+" "+a+" "+u),d=c(o+" "+i+" "+u),m=r(/<(?:[^<>;=+\-*/%&|^]|<<self>>)*>/.source,2),g=r(/\((?:[^()]|<<self>>)*\)/.source,2),p=/@?\b[A-Za-z_]\w*\b/.source,h=t(/<<0>>(?:\s*<<1>>)?/.source,[p,m]),v=t(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source,[f,h]),b=/\[\s*(?:,\s*)*\]/.source,y=t(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source,[v,b]),w=t(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source,[m,g,b]),x=t(/\(<<0>>+(?:,<<0>>+)+\)/.source,[w]),C=t(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source,[x,v,b]),S={keyword:l,punctuation:/[<>()?,.:[\]]/},k=/'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source,T=/"(?:\\.|[^\\"\r\n])*"/.source,O=/@"(?:""|\\[\s\S]|[^\\"])*"(?!")/.source;e.languages.csharp=e.languages.extend("clike",{string:[{pattern:n(/(^|[^$\\])<<0>>/.source,[O]),lookbehind:!0,greedy:!0},{pattern:n(/(^|[^@$\\])<<0>>/.source,[T]),lookbehind:!0,greedy:!0},{pattern:RegExp(k),greedy:!0,alias:"character"}],"class-name":[{pattern:n(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source,[v]),lookbehind:!0,inside:S},{pattern:n(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source,[p,C]),lookbehind:!0,inside:S},{pattern:n(/(\busing\s+)<<0>>(?=\s*=)/.source,[p]),lookbehind:!0},{pattern:n(/(\b<<0>>\s+)<<1>>/.source,[s,h]),lookbehind:!0,inside:S},{pattern:n(/(\bcatch\s*\(\s*)<<0>>/.source,[v]),lookbehind:!0,inside:S},{pattern:n(/(\bwhere\s+)<<0>>/.source,[p]),lookbehind:!0},{pattern:n(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source,[y]),lookbehind:!0,inside:S},{pattern:n(/\b<<0>>(?=\s+(?!<<1>>|with\s*\{)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source,[C,d,p]),inside:S}],keyword:l,number:/(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:ul|lu|[dflmu])?\b/i,operator:/>>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/,punctuation:/\?\.?|::|[{}[\];(),.:]/}),e.languages.insertBefore("csharp","number",{range:{pattern:/\.\./,alias:"operator"}}),e.languages.insertBefore("csharp","punctuation",{"named-parameter":{pattern:n(/([(,]\s*)<<0>>(?=\s*:)/.source,[p]),lookbehind:!0,alias:"punctuation"}}),e.languages.insertBefore("csharp","class-name",{namespace:{pattern:n(/(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source,[p]),lookbehind:!0,inside:{punctuation:/\./}},"type-expression":{pattern:n(/(\b(?:default|typeof|sizeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/.source,[g]),lookbehind:!0,alias:"class-name",inside:S},"return-type":{pattern:n(/<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source,[C,v]),inside:S,alias:"class-name"},"constructor-invocation":{pattern:n(/(\bnew\s+)<<0>>(?=\s*[[({])/.source,[C]),lookbehind:!0,inside:S,alias:"class-name"},"generic-method":{pattern:n(/<<0>>\s*<<1>>(?=\s*\()/.source,[p,m]),inside:{function:n(/^<<0>>/.source,[p]),generic:{pattern:RegExp(m),alias:"class-name",inside:S}}},"type-list":{pattern:n(/\b((?:<<0>>\s+<<1>>|record\s+<<1>>\s*<<5>>|where\s+<<2>>)\s*:\s*)(?:<<3>>|<<4>>|<<1>>\s*<<5>>|<<6>>)(?:\s*,\s*(?:<<3>>|<<4>>|<<6>>))*(?=\s*(?:where|[{;]|=>|$))/.source,[s,h,p,C,l.source,g,/\bnew\s*\(\s*\)/.source]),lookbehind:!0,inside:{"record-arguments":{pattern:n(/(^(?!new\s*\()<<0>>\s*)<<1>>/.source,[h,g]),lookbehind:!0,greedy:!0,inside:e.languages.csharp},keyword:l,"class-name":{pattern:RegExp(C),greedy:!0,inside:S},punctuation:/[,()]/}},preprocessor:{pattern:/(^[\t ]*)#.*/m,lookbehind:!0,alias:"property",inside:{directive:{pattern:/(#)\b(?:define|elif|else|endif|endregion|error|if|line|nullable|pragma|region|undef|warning)\b/,lookbehind:!0,alias:"keyword"}}}});var _=T+"|"+k,E=t(/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source,[_]),A=r(t(/[^"'/()]|<<0>>|\(<<self>>*\)/.source,[E]),2),D=/\b(?:assembly|event|field|method|module|param|property|return|type)\b/.source,M=t(/<<0>>(?:\s*\(<<1>>*\))?/.source,[v,A]);e.languages.insertBefore("csharp","class-name",{attribute:{pattern:n(/((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/.source,[D,M]),lookbehind:!0,greedy:!0,inside:{target:{pattern:n(/^<<0>>(?=\s*:)/.source,[D]),alias:"keyword"},"attribute-arguments":{pattern:n(/\(<<0>>*\)/.source,[A]),inside:e.languages.csharp},"class-name":{pattern:RegExp(v),inside:{punctuation:/\./}},punctuation:/[:,]/}}});var N=/:[^}\r\n]+/.source,R=r(t(/[^"'/()]|<<0>>|\(<<self>>*\)/.source,[E]),2),z=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[R,N]),B=r(t(/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<<self>>*\)/.source,[_]),2),P=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[B,N]);function I(t,r){return{interpolation:{pattern:n(/((?:^|[^{])(?:\{\{)*)<<0>>/.source,[t]),lookbehind:!0,inside:{"format-string":{pattern:n(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source,[r,N]),lookbehind:!0,inside:{punctuation:/^:/}},punctuation:/^\{|\}$/,expression:{pattern:/[\s\S]+/,alias:"language-csharp",inside:e.languages.csharp}}},string:/[\s\S]+/}}e.languages.insertBefore("csharp","string",{"interpolation-string":[{pattern:n(/(^|[^\\])(?:\$@|@\$)"(?:""|\\[\s\S]|\{\{|<<0>>|[^\\{"])*"/.source,[z]),lookbehind:!0,greedy:!0,inside:I(z,R)},{pattern:n(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source,[P]),lookbehind:!0,greedy:!0,inside:I(P,B)}]})}(Prism),Prism.languages.dotnet=Prism.languages.cs=Prism.languages.csharp,function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-](?:[^;{\s]|\s+(?![\s{]))*(?:;|(?=\s*\{))/,inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))}(Prism),function(e){var t=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,n=/(^|[^\w.])(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,r={pattern:RegExp(n+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};e.languages.java=e.languages.extend("clike",{"class-name":[r,{pattern:RegExp(n+/[A-Z]\w*(?=\s+\w+\s*[;,=()])/.source),lookbehind:!0,inside:r.inside}],keyword:t,function:[e.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0}}),e.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"}}),e.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":r,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g,(function(){return t.source}))),lookbehind:!0,inside:{punctuation:/\./}}})}(Prism),Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:prototype|constructor))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:/\b(?:(?:0[xX](?:[\dA-Fa-f](?:_[\dA-Fa-f])?)+|0[bB](?:[01](?:_[01])?)+|0[oO](?:[0-7](?:_[0-7])?)+)n?|(?:\d(?:_\d)?)+n|NaN|Infinity)\b|(?:\b(?:\d(?:_\d)?)+\.?(?:\d(?:_\d)?)*|\B\.(?:\d(?:_\d)?)+)(?:[Ee][+-]?(?:\d(?:_\d)?)+)?/,operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/,Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/,lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Prism.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}}}),Prism.languages.markup&&(Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),Prism.languages.js=Prism.languages.javascript,Prism.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity,Prism.languages.markup.doctype.inside["internal-subset"].inside=Prism.languages.markup,Prism.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&amp;/,"&"))})),Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(e,t){var n={};n["language-"+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Prism.languages[t]},n.cdata=/^<!\[CDATA\[|\]\]>$/i;var r={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}};r["language-"+t]={pattern:/[\s\S]+/,inside:Prism.languages[t]};var o={};o[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,(function(){return e})),"i"),lookbehind:!0,greedy:!0,inside:r},Prism.languages.insertBefore("markup","cdata",o)}}),Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(e,t){Prism.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:Prism.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup,Prism.languages.xml=Prism.languages.extend("markup",{}),Prism.languages.ssml=Prism.languages.xml,Prism.languages.atom=Prism.languages.xml,Prism.languages.rss=Prism.languages.xml,function(e){var t=/\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/,n=[{pattern:/\b(?:false|true)\b/i,alias:"boolean"},{pattern:/(::\s*)\b[a-z_]\w*\b(?!\s*\()/i,greedy:!0,lookbehind:!0},{pattern:/(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/i,greedy:!0,lookbehind:!0},/\b(?:null)\b/i,/\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/],r=/\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[\da-f]+(?:_[\da-f]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i,o=/<?=>|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,i=/[{}\[\](),:;]/;e.languages.php={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"},comment:t,variable:/\$+(?:\w+\b|(?=\{))/i,package:{pattern:/(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,lookbehind:!0,inside:{punctuation:/\\/}},"class-name-definition":{pattern:/(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,lookbehind:!0,alias:"class-name"},"function-definition":{pattern:/(\bfunction\s+)[a-z_]\w*(?=\s*\()/i,lookbehind:!0,alias:"function"},keyword:[{pattern:/(\(\s*)\b(?:bool|boolean|int|integer|float|string|object|array)\b(?=\s*\))/i,alias:"type-casting",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)\b(?:bool|int|float|string|object|array(?!\s*\()|mixed|self|static|callable|iterable|(?:null|false)(?=\s*\|))\b(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*[\w|]\|\s*)(?:null|false)\b(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b(?:bool|int|float|string|object|void|array(?!\s*\()|mixed|self|static|callable|iterable|(?:null|false)(?=\s*\|))\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?[\w|]\|\s*)(?:null|false)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/\b(?:bool|int|float|string|object|void|array(?!\s*\()|mixed|iterable|(?:null|false)(?=\s*\|))\b/i,alias:"type-declaration",greedy:!0},{pattern:/(\|\s*)(?:null|false)\b/i,alias:"type-declaration",greedy:!0,lookbehind:!0},{pattern:/\b(?:parent|self|static)(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(\byield\s+)from\b/i,lookbehind:!0},/\bclass\b/i,{pattern:/((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:__halt_compiler|abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|namespace|match|new|or|parent|print|private|protected|public|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield)\b/i,lookbehind:!0}],"argument-name":{pattern:/([(,]\s+)\b[a-z_]\w*(?=\s*:(?!:))/i,lookbehind:!0},"class-name":[{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/(\|\s*)\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i,greedy:!0},{pattern:/(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,alias:"class-name-fully-qualified",greedy:!0,inside:{punctuation:/\\/}},{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*\$)/i,alias:"type-declaration",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-declaration"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,alias:["class-name-fully-qualified","static-context"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-hint"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:["class-name-fully-qualified","return-type"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:n,function:{pattern:/(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i,lookbehind:!0,inside:{punctuation:/\\/}},property:{pattern:/(->\s*)\w+/,lookbehind:!0},number:r,operator:o,punctuation:i};var a={pattern:/\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,lookbehind:!0,inside:e.languages.php},u=[{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,alias:"nowdoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:a}},{pattern:/`(?:\\[\s\S]|[^\\`])*`/,alias:"backtick-quoted-string",greedy:!0},{pattern:/'(?:\\[\s\S]|[^\\'])*'/,alias:"single-quoted-string",greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,alias:"double-quoted-string",greedy:!0,inside:{interpolation:a}}];e.languages.insertBefore("php","variable",{string:u,attribute:{pattern:/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,greedy:!0,inside:{"attribute-content":{pattern:/^(#\[)[\s\S]+(?=\]$)/,lookbehind:!0,inside:{comment:t,string:u,"attribute-class-name":[{pattern:/([^:]|^)\b[a-z_]\w*(?!\\)\b/i,alias:"class-name",greedy:!0,lookbehind:!0},{pattern:/([^:]|^)(?:\\?\b[a-z_]\w*)+/i,alias:["class-name","class-name-fully-qualified"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:n,number:r,operator:o,punctuation:i}},delimiter:{pattern:/^#\[|\]$/,alias:"punctuation"}}}}),e.hooks.add("before-tokenize",(function(t){if(/<\?/.test(t.code)){e.languages["markup-templating"].buildPlaceholders(t,"php",/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/gi)}})),e.hooks.add("after-tokenize",(function(t){e.languages["markup-templating"].tokenizePlaceholders(t,"php")}))}(Prism),Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0},"string-interpolation":{pattern:/(?:f|rf|fr)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|rb|br)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|rb|br)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/im,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:and|as|assert|async|await|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:True|False|None)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?\b/i,operator:/[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python,function(e){e.languages.ruby=e.languages.extend("clike",{comment:[/#.*/,{pattern:/^=begin\s[\s\S]*?^=end/m,greedy:!0}],"class-name":{pattern:/(\b(?:class)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:alias|and|BEGIN|begin|break|case|class|def|define_method|defined|do|each|else|elsif|END|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|protected|private|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/});var t={pattern:/#\{[^}]+\}/,inside:{delimiter:{pattern:/^#\{|\}$/,alias:"tag"},rest:e.languages.ruby}};delete e.languages.ruby.function,e.languages.insertBefore("ruby","keyword",{regex:[{pattern:RegExp(/%r/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/\((?:[^()\\]|\\[\s\S])*\)/.source,/\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}/.source,/\[(?:[^\[\]\\]|\\[\s\S])*\]/.source,/<(?:[^<>\\]|\\[\s\S])*>/.source].join("|")+")"+/[egimnosux]{0,6}/.source),greedy:!0,inside:{interpolation:t}},{pattern:/(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,lookbehind:!0,greedy:!0,inside:{interpolation:t}}],variable:/[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,symbol:{pattern:/(^|[^:]):[a-zA-Z_]\w*(?:[?!]|\b)/,lookbehind:!0},"method-definition":{pattern:/(\bdef\s+)[\w.]+/,lookbehind:!0,inside:{function:/\w+$/,rest:e.languages.ruby}}}),e.languages.insertBefore("ruby","number",{builtin:/\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Stat|Fixnum|Float|Hash|Integer|IO|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|String|Struct|TMS|Symbol|ThreadGroup|Thread|Time|TrueClass)\b/,constant:/\b[A-Z]\w*(?:[?!]|\b)/}),e.languages.ruby.string=[{pattern:RegExp(/%[qQiIwWxs]?/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/\((?:[^()\\]|\\[\s\S])*\)/.source,/\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}/.source,/\[(?:[^\[\]\\]|\\[\s\S])*\]/.source,/<(?:[^<>\\]|\\[\s\S])*>/.source].join("|")+")"),greedy:!0,inside:{interpolation:t}},{pattern:/("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,greedy:!0,inside:{interpolation:t}},{pattern:/<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?[a-z_]\w*|[a-z_]\w*$/i,alias:"symbol",inside:{punctuation:/^<<[-~]?/}},interpolation:t}},{pattern:/<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?'[a-z_]\w*'|[a-z_]\w*$/i,alias:"symbol",inside:{punctuation:/^<<[-~]?'|'$/}}}}],e.languages.rb=e.languages.ruby}(Prism),{boltExport:t.exports}}));var i=window.Prism;window.Prism=o}(void 0,v,b);var w=b.exports.boltExport,x=function(e){return h.Prism&&function(e){return e.getParam("codesample_global_prismjs",!1,"boolean")}(e)?h.Prism:w},C=function(e){var t,n,r=e.selection?e.selection.getNode():null;return t=g(r),n=r,t?f.some(n):f.none()},S=function(e){var t=function(e){var t=function(e){return e.getParam("codesample_languages")}(e);return t||[{text:"HTML/XML",value:"markup"},{text:"JavaScript",value:"javascript"},{text:"CSS",value:"css"},{text:"PHP",value:"php"},{text:"Ruby",value:"ruby"},{text:"Python",value:"python"},{text:"Java",value:"java"},{text:"C",value:"c"},{text:"C#",value:"csharp"},{text:"C++",value:"cpp"}]}(e),n=d(t).fold(o(""),(function(e){return e.value})),r=function(e,t){return C(e).fold((function(){return t}),(function(e){var n=e.className.match(/language-(\w+)/);return n?n[1]:t}))}(e,n),i=function(e){return C(e).fold(o(""),(function(e){return e.textContent}))}(e);e.windowManager.open({title:"Insert/Edit Code Sample",size:"large",body:{type:"panel",items:[{type:"selectbox",name:"language",label:"Language",items:t},{type:"textarea",name:"code",label:"Code view"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{language:r,code:i},onSubmit:function(t){var n=t.getData();!function(e,t,n){e.undoManager.transact((function(){var r=C(e);return n=m.DOM.encode(n),r.fold((function(){e.insertContent('<pre id="__new" class="language-'+t+'">'+n+"</pre>"),e.selection.select(e.$("#__new").removeAttr("id")[0])}),(function(r){e.dom.setAttrib(r,"class","language-"+t),r.innerHTML=n,x(e).highlightElement(r),e.selection.select(r)}))}))}(e,n.language,n.code),t.close()}})};n.add("codesample",(function(e){!function(e){var t=e.$;e.on("PreProcess",(function(e){t("pre[contenteditable=false]",e.node).filter(p(g)).each((function(e,n){var r=t(n),o=n.textContent;r.attr("class",t.trim(r.attr("class"))),r.removeAttr("contentEditable"),r.empty().append(t("<code></code>").each((function(){this.textContent=o})))}))})),e.on("SetContent",(function(){var n=t("pre").filter(p(g)).filter((function(e,t){return"false"!==t.contentEditable}));n.length&&e.undoManager.transact((function(){n.each((function(n,r){t(r).find("br").each((function(t,n){n.parentNode.replaceChild(e.getDoc().createTextNode("\n"),n)})),r.contentEditable="false",r.innerHTML=e.dom.encode(r.textContent),x(e).highlightElement(r),r.className=t.trim(r.className)}))}))}))}(e),function(e){var t=function(){return e.execCommand("codesample")};e.ui.registry.addToggleButton("codesample",{icon:"code-sample",tooltip:"Insert/edit code sample",onAction:t,onSetup:function(t){var n=function(){t.setActive(function(e){var t=e.selection.getStart();return e.dom.is(t,'pre[class*="language-"]')}(e))};return e.on("NodeChange",n),function(){return e.off("NodeChange",n)}}}),e.ui.registry.addMenuItem("codesample",{text:"Code sample...",icon:"code-sample",onAction:t})}(e),function(e){e.addCommand("codesample",(function(){var t=e.selection.getNode();e.selection.isCollapsed()||g(t)?S(e):e.formatter.toggle("code")}))}(e),e.on("dblclick",(function(t){g(t.target)&&S(e)}))}))}(),function(){"use strict";tinymce.util.Tools.resolve("tinymce.PluginManager").add("colorpicker",(function(){}))}(),function(){"use strict";tinymce.util.Tools.resolve("tinymce.PluginManager").add("contextmenu",(function(){}))}(),function(){"use strict";var e,t,n=tinymce.util.Tools.resolve("tinymce.PluginManager"),r=function(e){return function(t){return typeof t===e}},o=function(e){return function(t){return r=typeof(n=t),(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)===e;var n,r}}("string"),i=r("boolean"),a=r("function"),u=r("number"),c=function(){},s=function(e){return function(){return e}},l=function(e){return e},f=s(!1),d=s(!0),m=function(){return g},g={fold:function(e,t){return e()},isSome:f,isNone:d,getOr:t=l,getOrThunk:e=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:s(null),getOrUndefined:s(void 0),or:t,orThunk:e,map:m,each:c,bind:m,exists:f,forall:d,filter:function(){return m()},toArray:function(){return[]},toString:s("none()")},p=function(e){var t=s(e),n=function(){return o},r=function(t){return t(e)},o={fold:function(t,n){return n(e)},isSome:d,isNone:f,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:n,orThunk:n,map:function(t){return p(t(e))},each:function(t){t(e)},bind:r,exists:r,forall:r,filter:function(t){return t(e)?o:g},toArray:function(){return[e]},toString:function(){return"some("+e+")"}};return o},h={some:p,none:m,from:function(e){return null==e?g:p(e)}},v=function(e,t){for(var n=0,r=e.length;n<r;n++){t(e[n],n)}},b=function(e){if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}},y={fromHtml:function(e,t){var n=(t||document).createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return b(n.childNodes[0])},fromTag:function(e,t){var n=(t||document).createElement(e);return b(n)},fromText:function(e,t){var n=(t||document).createTextNode(e);return b(n)},fromDom:b,fromPoint:function(e,t,n){return h.from(e.dom.elementFromPoint(t,n)).map(b)}},w=function(e,t){var n=e.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(t);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(t);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(t);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")};"undefined"!=typeof window?window:Function("return this;")();var x,C=function(e){return function(t){return function(e){return e.dom.nodeType}(t)===e}},S=C(1),k=C(3),T=C(9),O=C(11),_=function(e){return function(e,t){for(var n=e.length,r=new Array(n),o=0;o<n;o++){var i=e[o];r[o]=t(i,o)}return r}(e.dom.childNodes,y.fromDom)},E=function(e,t,n){!function(e,t,n){if(!(o(n)||i(n)||u(n)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",n,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,n+"")}(e.dom,t,n)},A=function(e,t){e.dom.removeAttribute(t)},D=a(Element.prototype.attachShadow)&&a(Node.prototype.getRootNode)?function(e){return y.fromDom(e.dom.getRootNode())}:function(e){return T(e)?e:(t=e,y.fromDom(t.dom.ownerDocument));var t},M=function(e){var t,n=D(e);return O(t=n)&&null!=t.dom.host?h.some(n):h.none()},N=function(e){return y.fromDom(e.dom.host)},R=function(e){var t=k(e)?e.dom.parentNode:e.dom;if(null==t||null===t.ownerDocument)return!1;var n,r,o=t.ownerDocument;return M(y.fromDom(t)).fold((function(){return o.body.contains(t)}),(n=R,r=N,function(e){return n(r(e))}))},z=function(e,t,n){return function(e,t,n){for(var r=e.dom,o=a(n)?n:f;r.parentNode;){r=r.parentNode;var i=y.fromDom(r);if(t(i))return h.some(i);if(o(i))break}return h.none()}(e,(function(e){return w(e,t)}),n)},B=function(e,t){return function(e){return void 0!==e.style&&a(e.style.getPropertyValue)}(e)?e.style.getPropertyValue(t):""},P=function(e){return"rtl"===function(e,t){var n=e.dom,r=window.getComputedStyle(n).getPropertyValue(t);return""!==r||R(e)?r:B(n,t)}(e,"direction")?"rtl":"ltr"},I=function(e,t){return function(e,t){return function(e,t){for(var n=[],r=0,o=e.length;r<o;r++){var i=e[r];t(i,r)&&n.push(i)}return n}(_(e),t)}(e,(function(e){return w(e,t)}))},F=function(e){return function(e){return h.from(e.dom.parentNode).map(y.fromDom)}(e).filter(S)},L=(x="li",function(e){return S(e)&&e.dom.nodeName.toLowerCase()===x}),H=function(e,t){var n=e.selection.getSelectedBlocks();n.length>0&&(v(n,(function(e){var n=y.fromDom(e),r=L(n),o=function(e,t){return(t?z(e,"ol,ul"):h.some(e)).getOr(e)}(n,r);F(o).each((function(e){if(P(e)!==t?E(o,"dir",t):P(o)!==t&&A(o,"dir"),r){var n=I(o,"li[dir]");v(n,(function(e){return A(e,"dir")}))}}))})),e.nodeChanged())},V=function(e,t){return function(n){var r=function(e){var r=y.fromDom(e.element);n.setActive(P(r)===t)};return e.on("NodeChange",r),function(){return e.off("NodeChange",r)}}};n.add("directionality",(function(e){!function(e){e.addCommand("mceDirectionLTR",(function(){H(e,"ltr")})),e.addCommand("mceDirectionRTL",(function(){H(e,"rtl")}))}(e),function(e){e.ui.registry.addToggleButton("ltr",{tooltip:"Left to right",icon:"ltr",onAction:function(){return e.execCommand("mceDirectionLTR")},onSetup:V(e,"ltr")}),e.ui.registry.addToggleButton("rtl",{tooltip:"Right to left",icon:"rtl",onAction:function(){return e.execCommand("mceDirectionRTL")},onSetup:V(e,"rtl")})}(e)}))}(),function(){"use strict";var e,t,n,r,o=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=(e=null,function(t){return e===t}),a=function(){},u=function(e){return function(){return e}},c=function(e){return e},s=u(!1),l=u(!0),f=function(){return d},d={fold:function(e,t){return e()},isSome:s,isNone:l,getOr:n=c,getOrThunk:t=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:u(null),getOrUndefined:u(void 0),or:n,orThunk:t,map:f,each:a,bind:f,exists:s,forall:l,filter:function(){return f()},toArray:function(){return[]},toString:u("none()")},m=function(e){var t=u(e),n=function(){return o},r=function(t){return t(e)},o={fold:function(t,n){return n(e)},isSome:l,isNone:s,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:n,orThunk:n,map:function(t){return m(t(e))},each:function(t){t(e)},bind:r,exists:r,forall:r,filter:function(t){return t(e)?o:d},toArray:function(){return[e]},toString:function(){return"some("+e+")"}};return o},g={some:m,none:f,from:function(e){return null==e?d:m(e)}},p=function(e,t){for(var n=e.length,r=new Array(n),o=0;o<n;o++){var i=e[o];r[o]=t(i,o)}return r},h=function(e){var t=e;return{get:function(){return t},set:function(e){t=e}}},v=function(){return v=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},v.apply(this,arguments)},b=Object.keys,y=Object.hasOwnProperty,w=function(e,t){for(var n=b(e),r=0,o=n.length;r<o;r++){var i=n[r];t(e[i],i)}},x=function(e,t){var n={};return w(e,(function(e,r){var o=t(e,r);n[o.k]=o.v})),n},C=function(e,t){return y.call(e,t)},S=(r=function(e,t){return t},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(0===e.length)throw new Error("Can't merge zero objects");for(var n={},o=0;o<e.length;o++){var i=e[o];for(var a in i)C(i,a)&&(n[a]=r(n[a],i[a]))}return n}),k=function(){var e=function(e){var t=h(g.none()),n=function(){return t.get().each(e)};return{clear:function(){n(),t.set(g.none())},isSet:function(){return t.get().isSome()},get:function(){return t.get()},set:function(e){n(),t.set(g.some(e))}}}(a);return v(v({},e),{on:function(t){return e.get().each(t)}})},T=function(e,t){return-1!==e.indexOf(t)},O=tinymce.util.Tools.resolve("tinymce.Resource"),_=tinymce.util.Tools.resolve("tinymce.util.Delay"),E=tinymce.util.Tools.resolve("tinymce.util.Promise"),A="All",D={symbols:"Symbols",people:"People",animals_and_nature:"Animals and Nature",food_and_drink:"Food and Drink",activity:"Activity",travel_and_places:"Travel and Places",objects:"Objects",flags:"Flags",user:"User Defined"},M=function(e,t){return C(e,t)?e[t]:t},N=function(e){var t,n=function(e){return e.getParam("emoticons_append",{},"object")}(e);return t=function(e){return v({keywords:[],category:"user"},e)},x(n,(function(e,n){return{k:n,v:t(e,n)}}))},R=function(e,t,n){var r=k(),o=k(),i=function(e){return e.getParam("emoticons_images_url","https://twemoji.maxcdn.com/v/13.0.1/72x72/","string")}(e),a=function(e){return function(e,t,n){return""===t||e.length>=t.length&&e.substr(n,n+t.length)===t}(e.char,"<img",0)?e.char.replace(/src="([^"]+)"/,(function(e,t){return'src="'+i+t+'"'})):e.char};e.on("init",(function(){O.load(n,t).then((function(t){var n=N(e);!function(e){var t={},n=[];w(e,(function(e,r){var o={title:r,keywords:e.keywords,char:a(e),category:M(D,e.category)},i=void 0!==t[o.category]?t[o.category]:[];t[o.category]=i.concat([o]),n.push(o)})),r.set(t),o.set(n)}(S(t,n))}),(function(e){console.log("Failed to load emoticons: "+e),r.set({}),o.set([])}))}));var u=function(){return o.get().getOr([])},c=function(){return r.isSet()&&o.isSet()};return{listCategories:function(){return[A].concat(b(r.get().getOr({})))},hasLoaded:c,waitForLoad:function(){return c()?E.resolve(!0):new E((function(e,n){var r=15,o=_.setInterval((function(){c()?(_.clearInterval(o),e(!0)):--r<0&&(console.log("Could not load emojis from url: "+t),_.clearInterval(o),n(!1))}),100)}))},listAll:u,listCategory:function(e){return e===A?u():r.get().bind((function(t){return g.from(t[e])})).getOr([])}}},z=function(e,t){return T(e.title.toLowerCase(),t)||function(e,t){for(var n=0,r=e.length;n<r;n++)if(t(e[n],n))return!0;return!1}(e.keywords,(function(e){return T(e.toLowerCase(),t)}))},B=function(e,t,n){for(var r=[],o=t.toLowerCase(),i=n.fold((function(){return s}),(function(e){return function(t){return t>=e}})),a=0;a<e.length&&(0!==t.length&&!z(e[a],o)||(r.push({value:e[a].char,text:e[a].title,icon:e[a].char}),!i(r.length)));a++);return r},P="pattern",I=function(e,t){var n,r,o,a,u={pattern:"",results:B(t.listAll(),"",g.some(300))},c=h(A),s=(n=function(e){!function(e){var n=e.getData(),r=c.get(),o=t.listCategory(r),i=B(o,n.pattern,r===A?g.some(300):g.none());e.setData({results:i})}(e)},r=200,o=null,{cancel:a=function(){i(o)||(clearTimeout(o),o=null)},throttle:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];a(),o=setTimeout((function(){o=null,n.apply(null,e)}),r)}}),l={label:"Search",type:"input",name:P},f={type:"collection",name:"results"},d=function(){return{title:"Emoticons",size:"normal",body:{type:"tabpanel",tabs:p(t.listCategories(),(function(e){return{title:e,name:e,items:[l,f]}}))},initialData:u,onTabChange:function(e,t){c.set(t.newTabName),s.throttle(e)},onChange:s.throttle,onAction:function(t,n){"results"===n.name&&(!function(e,t){e.insertContent(t)}(e,n.value),t.close())},buttons:[{type:"cancel",text:"Close",primary:!0}]}},m=e.windowManager.open(d());m.focus(P),t.hasLoaded()||(m.block("Loading emoticons..."),t.waitForLoad().then((function(){m.redial(d()),s.throttle(m),m.focus(P),m.unblock()})).catch((function(e){m.redial({title:"Emoticons",body:{type:"panel",items:[{type:"alertbanner",level:"error",icon:"warning",text:"<p>Could not load emoticons</p>"}]},buttons:[{type:"cancel",text:"Close",primary:!0}],initialData:{pattern:"",results:[]}}),m.focus(P),m.unblock()})))};o.add("emoticons",(function(e,t){var n=function(e,t){var n=function(e){return e.getParam("emoticons_database","emojis","string")}(e);return e.getParam("emoticons_database_url",t+"/js/"+n+e.suffix+".js","string")}(e,t),r=function(e){return e.getParam("emoticons_database_id","tinymce.plugins.emoticons","string")}(e),o=R(e,n,r);!function(e,t){e.addCommand("mceEmoticons",(function(){return I(e,t)}))}(e,o),function(e){var t=function(){return e.execCommand("mceEmoticons")};e.ui.registry.addButton("emoticons",{tooltip:"Emoticons",icon:"emoji",onAction:t}),e.ui.registry.addMenuItem("emoticons",{text:"Emoticons...",icon:"emoji",onAction:t})}(e),function(e,t){e.ui.registry.addAutocompleter("emoticons",{ch:":",columns:"auto",minChars:2,fetch:function(e,n){return t.waitForLoad().then((function(){var r=t.listAll();return B(r,e,g.some(n))}))},onAction:function(t,n,r){e.selection.setRng(n),e.insertContent(r),t.hide()}})}(e,o),function(e){e.on("PreInit",(function(){e.parser.addAttributeFilter("data-emoticon",(function(e){!function(e,t){for(var n=0,r=e.length;n<r;n++)t(e[n],n)}(e,(function(e){e.attr("data-mce-resize","false"),e.attr("data-mce-placeholder","1")}))}))}))}(e)}))}(),function(){"use strict";var e=function(e){var t=e;return{get:function(){return t},set:function(e){t=e}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=function(){return n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)},r=tinymce.util.Tools.resolve("tinymce.util.Tools"),o=tinymce.util.Tools.resolve("tinymce.html.DomParser"),i=tinymce.util.Tools.resolve("tinymce.html.Node"),a=tinymce.util.Tools.resolve("tinymce.html.Serializer"),u=function(e){return e.getParam("fullpage_hide_in_source_view")},c=function(e){return e.getParam("fullpage_default_encoding")},s=function(e){return e.getParam("fullpage_default_font_family")},l=function(e){return e.getParam("fullpage_default_font_size")},f=function(e,t){return o({validate:!1,root_name:"#document"},e.schema).parse(t,{format:"xhtml"})},d=function(e,t){var o=function(e,t){var n,o,i=f(e,t),a={},u=function(e,t){return e.attr(t)||""};return a.fontface=s(e),a.fontsize=l(e),7===(n=i.firstChild).type&&(a.xml_pi=!0,(o=/encoding="([^"]+)"/.exec(n.value))&&(a.docencoding=o[1])),(n=i.getAll("#doctype")[0])&&(a.doctype="<!DOCTYPE"+n.value+">"),(n=i.getAll("title")[0])&&n.firstChild&&(a.title=n.firstChild.value),r.each(i.getAll("meta"),(function(e){var t,n=e.attr("name"),r=e.attr("http-equiv");n?a[n.toLowerCase()]=e.attr("content"):"Content-Type"===r&&(t=/charset\s*=\s*(.*)\s*/gi.exec(e.attr("content")))&&(a.docencoding=t[1])})),(n=i.getAll("html")[0])&&(a.langcode=u(n,"lang")||u(n,"xml:lang")),a.stylesheets=[],r.each(i.getAll("link"),(function(e){"stylesheet"===e.attr("rel")&&a.stylesheets.push(e.attr("href"))})),(n=i.getAll("body")[0])&&(a.langdir=u(n,"dir"),a.style=u(n,"style"),a.visited_color=u(n,"vlink"),a.link_color=u(n,"link"),a.active_color=u(n,"alink")),a}(e,t.get()),u=n(n({},{title:"",keywords:"",description:"",robots:"",author:"",docencoding:""}),o);e.windowManager.open({title:"Metadata and Document Properties",size:"normal",body:{type:"panel",items:[{name:"title",type:"input",label:"Title"},{name:"keywords",type:"input",label:"Keywords"},{name:"description",type:"input",label:"Description"},{name:"robots",type:"input",label:"Robots"},{name:"author",type:"input",label:"Author"},{name:"docencoding",type:"input",label:"Encoding"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:u,onSubmit:function(n){var u=n.getData(),c=function(e,t,n){var o,u,c=e.dom,s=function(e,t,n){e.attr(t,n||void 0)},l=function(e){o.firstChild?o.insert(e,o.firstChild):o.append(e)},d=f(e,n);if((o=d.getAll("head")[0])||(u=d.getAll("html")[0],o=new i("head",1),u.firstChild?u.insert(o,u.firstChild,!0):u.append(o)),u=d.firstChild,t.xml_pi){var m='version="1.0"';t.docencoding&&(m+=' encoding="'+t.docencoding+'"'),7!==u.type&&(u=new i("xml",7),d.insert(u,d.firstChild,!0)),u.value=m}else u&&7===u.type&&u.remove();u=d.getAll("#doctype")[0],t.doctype?(u||(u=new i("#doctype",10),t.xml_pi?d.insert(u,d.firstChild):l(u)),u.value=t.doctype.substring(9,t.doctype.length-1)):u&&u.remove(),u=null,r.each(d.getAll("meta"),(function(e){"Content-Type"===e.attr("http-equiv")&&(u=e)})),t.docencoding?(u||((u=new i("meta",1)).attr("http-equiv","Content-Type"),u.shortEnded=!0,l(u)),u.attr("content","text/html; charset="+t.docencoding)):u&&u.remove(),u=d.getAll("title")[0],t.title?(u?u.empty():(u=new i("title",1),l(u)),u.append(new i("#text",3)).value=t.title):u&&u.remove(),r.each("keywords,description,author,copyright,robots".split(","),(function(e){var n,r,o=d.getAll("meta"),a=t[e];for(n=0;n<o.length;n++)if((r=o[n]).attr("name")===e)return void(a?r.attr("content",a):r.remove());a&&((u=new i("meta",1)).attr("name",e),u.attr("content",a),u.shortEnded=!0,l(u))}));var g={};r.each(d.getAll("link"),(function(e){"stylesheet"===e.attr("rel")&&(g[e.attr("href")]=e)})),r.each(t.stylesheets,(function(e){g[e]||((u=new i("link",1)).attr({rel:"stylesheet",text:"text/css",href:e}),u.shortEnded=!0,l(u)),delete g[e]})),r.each(g,(function(e){e.remove()})),(u=d.getAll("body")[0])&&(s(u,"dir",t.langdir),s(u,"style",t.style),s(u,"vlink",t.visited_color),s(u,"link",t.link_color),s(u,"alink",t.active_color),c.setAttribs(e.getBody(),{style:t.style,dir:t.dir,vLink:t.visited_color,link:t.link_color,aLink:t.active_color})),(u=d.getAll("html")[0])&&(s(u,"lang",t.langcode),s(u,"xml:lang",t.langcode)),o.firstChild||o.remove();var p=a({validate:!1,indent:!0,indent_before:"head,html,body,meta,title,script,link,style",indent_after:"head,html,body,meta,title,script,link,style"}).serialize(d);return p.substring(0,p.indexOf("</body>"))}(e,r.extend(o,u),t.get());t.set(c),n.close()}})},m=r.each,g=function(e){return e.replace(/<\/?[A-Z]+/g,(function(e){return e.toLowerCase()}))},p=function(e,t,n,o){var i,a,c,s,l,d="",p=e.dom;if(!o.selection&&(s=function(e){return e.getParam("protect")}(e),l=o.content,r.each(s,(function(e){l=l.replace(e,(function(e){return"\x3c!--mce:protected "+escape(e)+"--\x3e"}))})),c=l,!("raw"===o.format&&t.get()||o.source_view&&u(e)))){0!==c.length||o.source_view||(c=r.trim(t.get())+"\n"+r.trim(c)+"\n"+r.trim(n.get())),-1!==(i=(c=c.replace(/<(\/?)BODY/gi,"<$1body")).indexOf("<body"))?(i=c.indexOf(">",i),t.set(g(c.substring(0,i+1))),-1===(a=c.indexOf("</body",i))&&(a=c.length),o.content=r.trim(c.substring(i+1,a)),n.set(g(c.substring(a)))):(t.set(h(e)),n.set("\n</body>\n</html>"));var v=f(e,t.get());m(v.getAll("style"),(function(e){e.firstChild&&(d+=e.firstChild.value)}));var b=v.getAll("body")[0];b&&p.setAttribs(e.getBody(),{style:b.attr("style")||"",dir:b.attr("dir")||"",vLink:b.attr("vlink")||"",link:b.attr("link")||"",aLink:b.attr("alink")||""}),p.remove("fullpage_styles");var y=e.getDoc().getElementsByTagName("head")[0];if(d)p.add(y,"style",{id:"fullpage_styles"}).appendChild(document.createTextNode(d));var w={};r.each(y.getElementsByTagName("link"),(function(e){"stylesheet"===e.rel&&e.getAttribute("data-mce-fullpage")&&(w[e.href]=e)})),r.each(v.getAll("link"),(function(e){var t=e.attr("href");if(!t)return!0;w[t]||"stylesheet"!==e.attr("rel")||p.add(y,"link",{rel:"stylesheet",text:"text/css",href:t,"data-mce-fullpage":"1"}),delete w[t]})),r.each(w,(function(e){e.parentNode.removeChild(e)}))}},h=function(e){var t,n="",r="";if(function(e){return e.getParam("fullpage_default_xml_pi")}(e)){var o=c(e);n+='<?xml version="1.0" encoding="'+(o||"ISO-8859-1")+'" ?>\n'}return n+=function(e){return e.getParam("fullpage_default_doctype","<!DOCTYPE html>")}(e),n+="\n<html>\n<head>\n",(t=function(e){return e.getParam("fullpage_default_title")}(e))&&(n+="<title>"+t+"</title>\n"),(t=c(e))&&(n+='<meta http-equiv="Content-Type" content="text/html; charset='+t+'" />\n'),(t=s(e))&&(r+="font-family: "+t+";"),(t=l(e))&&(r+="font-size: "+t+";"),(t=function(e){return e.getParam("fullpage_default_text_color")}(e))&&(r+="color: "+t+";"),n+="</head>\n<body"+(r?' style="'+r+'"':"")+">\n"},v=function(e,t,n,o){"html"!==o.format||o.selection||o.source_view&&u(e)||(o.content=(r.trim(t)+"\n"+r.trim(o.content)+"\n"+r.trim(n)).replace(/<!--mce:protected ([\s\S]*?)-->/g,(function(e,t){return unescape(t)})))};t.add("fullpage",(function(t){var n=e(""),r=e("");!function(e,t){e.addCommand("mceFullPageProperties",(function(){d(e,t)}))}(t,n),function(e){e.ui.registry.addButton("fullpage",{tooltip:"Metadata and document properties",icon:"document-properties",onAction:function(){e.execCommand("mceFullPageProperties")}}),e.ui.registry.addMenuItem("fullpage",{text:"Metadata and document properties",icon:"document-properties",onAction:function(){e.execCommand("mceFullPageProperties")}})}(t),function(e,t,n){e.on("BeforeSetContent",(function(r){p(e,t,n,r)})),e.on("GetContent",(function(r){v(e,t.get(),n.get(),r)}))}(t,n,r)}))}(),function(){"use strict";var e=function(e){var t=e;return{get:function(){return t},set:function(e){t=e}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=function(e){return{isFullscreen:function(){return null!==e.get()}}},r=function(e){return function(t){return r=typeof(n=t),(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)===e;var n,r}},o=function(e){return function(t){return typeof t===e}},i=r("string"),a=r("array"),u=o("boolean"),c=function(e){return!function(e){return null==e}(e)},s=o("function"),l=o("number"),f=function(){},d=function(e){return function(){return e}},m=function(e){return e};function g(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=t.concat(n);return e.apply(null,o)}}var p,h,v=d(!1),b=d(!0),y=function(){return w},w={fold:function(e,t){return e()},isSome:v,isNone:b,getOr:h=m,getOrThunk:p=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:d(null),getOrUndefined:d(void 0),or:h,orThunk:p,map:y,each:f,bind:y,exists:v,forall:b,filter:function(){return y()},toArray:function(){return[]},toString:d("none()")},x=function(e){var t=d(e),n=function(){return o},r=function(t){return t(e)},o={fold:function(t,n){return n(e)},isSome:b,isNone:v,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:n,orThunk:n,map:function(t){return x(t(e))},each:function(t){t(e)},bind:r,exists:r,forall:r,filter:function(t){return t(e)?o:w},toArray:function(){return[e]},toString:function(){return"some("+e+")"}};return o},C={some:x,none:y,from:function(e){return null==e?w:x(e)}},S=function(){return S=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},S.apply(this,arguments)},k=function(t){var n=e(C.none()),r=function(){return n.get().each(t)};return{clear:function(){r(),n.set(C.none())},isSet:function(){return n.get().isSome()},get:function(){return n.get()},set:function(e){r(),n.set(C.some(e))}}},T=function(){return k((function(e){return e.unbind()}))},O=Array.prototype.push,_=function(e,t){for(var n=e.length,r=new Array(n),o=0;o<n;o++){var i=e[o];r[o]=t(i,o)}return r},E=function(e,t){for(var n=0,r=e.length;n<r;n++){t(e[n],n)}},A=function(e,t){for(var n=[],r=0,o=e.length;r<o;r++){var i=e[r];t(i,r)&&n.push(i)}return n},D=function(e,t){return function(e,t,n){for(var r=0,o=e.length;r<o;r++){var i=e[r];if(t(i,r))return C.some(i);if(n(i,r))break}return C.none()}(e,t,v)},M=function(e,t){return function(e){for(var t=[],n=0,r=e.length;n<r;++n){if(!a(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);O.apply(t,e[n])}return t}(_(e,t))},N=function(e){return function(e,t){return t>=0&&t<e.length?C.some(e[t]):C.none()}(e,0)},R=Object.keys,z=function(e,t){return-1!==e.indexOf(t)},B=function(e){return void 0!==e.style&&s(e.style.getPropertyValue)},P=function(e){if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}},I={fromHtml:function(e,t){var n=(t||document).createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return P(n.childNodes[0])},fromTag:function(e,t){var n=(t||document).createElement(e);return P(n)},fromText:function(e,t){var n=(t||document).createTextNode(e);return P(n)},fromDom:P,fromPoint:function(e,t,n){return C.from(e.dom.elementFromPoint(t,n)).map(P)}};"undefined"!=typeof window?window:Function("return this;")();var F=function(e){return function(t){return function(e){return e.dom.nodeType}(t)===e}},L=F(1),H=F(3),V=F(9),j=F(11),U=function(){return W(0,0)},W=function(e,t){return{major:e,minor:t}},$={nu:W,detect:function(e,t){var n=String(t).toLowerCase();return 0===e.length?U():function(e,t){var n=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(r.test(t))return r}}(e,t);if(!n)return{major:0,minor:0};var r=function(e){return Number(t.replace(n,"$"+e))};return W(r(1),r(2))}(e,n)},unknown:U},q=function(e,t){return function(e,t){for(var n=0;n<e.length;n++){var r=t(e[n],n);if(r.isSome())return r}return C.none()}(t.brands,(function(t){var n=t.brand.toLowerCase();return D(e,(function(e){var t;return n===(null===(t=e.brand)||void 0===t?void 0:t.toLowerCase())})).map((function(e){return{current:e.name,version:$.nu(parseInt(t.version,10),0)}}))}))},G=function(e,t){var n=String(t).toLowerCase();return D(e,(function(e){return e.search(n)}))},K=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,X=function(e){return function(t){return z(t,e)}},Y=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return z(e,"edge/")&&z(e,"chrome")&&z(e,"safari")&&z(e,"applewebkit")}},{name:"Chrome",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,K],search:function(e){return z(e,"chrome")&&!z(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return z(e,"msie")||z(e,"trident")}},{name:"Opera",versionRegexes:[K,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:X("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:X("firefox")},{name:"Safari",versionRegexes:[K,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(z(e,"safari")||z(e,"mobile/"))&&z(e,"applewebkit")}}],J=[{name:"Windows",search:X("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return z(e,"iphone")||z(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:X("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:X("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:X("linux"),versionRegexes:[]},{name:"Solaris",search:X("sunos"),versionRegexes:[]},{name:"FreeBSD",search:X("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:X("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],Z={browsers:d(Y),oses:d(J)},Q="Edge",ee="Chrome",te="Opera",ne="Firefox",re="Safari",oe=function(e){var t=e.current,n=e.version,r=function(e){return function(){return t===e}};return{current:t,version:n,isEdge:r(Q),isChrome:r(ee),isIE:r("IE"),isOpera:r(te),isFirefox:r(ne),isSafari:r(re)}},ie={unknown:function(){return oe({current:void 0,version:$.unknown()})},nu:oe,edge:d(Q),chrome:d(ee),ie:d("IE"),opera:d(te),firefox:d(ne),safari:d(re)},ae="Windows",ue="Android",ce="Linux",se="Solaris",le="FreeBSD",fe="ChromeOS",de=function(e){var t=e.current,n=e.version,r=function(e){return function(){return t===e}};return{current:t,version:n,isWindows:r(ae),isiOS:r("iOS"),isAndroid:r(ue),isOSX:r("OSX"),isLinux:r(ce),isSolaris:r(se),isFreeBSD:r(le),isChromeOS:r(fe)}},me={unknown:function(){return de({current:void 0,version:$.unknown()})},nu:de,windows:d(ae),ios:d("iOS"),android:d(ue),linux:d(ce),osx:d("OSX"),solaris:d(se),freebsd:d(le),chromeos:d(fe)},ge=function(e,t,n){var r=Z.browsers(),o=Z.oses(),i=t.bind((function(e){return q(r,e)})).orThunk((function(){return function(e,t){return G(e,t).map((function(e){var n=$.detect(e.versionRegexes,t);return{current:e.name,version:n}}))}(r,e)})).fold(ie.unknown,ie.nu),a=function(e,t){return G(e,t).map((function(e){var n=$.detect(e.versionRegexes,t);return{current:e.name,version:n}}))}(o,e).fold(me.unknown,me.nu),u=function(e,t,n,r){var o=e.isiOS()&&!0===/ipad/i.test(n),i=e.isiOS()&&!o,a=e.isiOS()||e.isAndroid(),u=a||r("(pointer:coarse)"),c=o||!i&&a&&r("(min-device-width:768px)"),s=i||a&&!c,l=t.isSafari()&&e.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(u),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:d(l),isDesktop:d(f)}}(a,i,e,n);return{browser:i,os:a,deviceType:u}},pe=function(e){return window.matchMedia(e).matches},he=function(e){var t,n=!1;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=!0,t=e.apply(null,r)),t}}((function(){return ge(navigator.userAgent,C.from(navigator.userAgentData),pe)})),ve=function(e,t){var n=e.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(t);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(t);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(t);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")},be=function(e){return I.fromDom(e.dom.ownerDocument)},ye=function(e){return function(e){return C.from(e.dom.parentNode).map(I.fromDom)}(e).map(we).map((function(t){return A(t,(function(t){return n=t,!(e.dom===n.dom);var n}))})).getOr([])},we=function(e){return _(e.dom.childNodes,I.fromDom)},xe=s(Element.prototype.attachShadow)&&s(Node.prototype.getRootNode),Ce=d(xe),Se=xe?function(e){return I.fromDom(e.dom.getRootNode())}:function(e){return V(e)?e:be(e)},ke=function(e){var t,n=Se(e);return j(t=n)&&c(t.dom.host)?C.some(n):C.none()},Te=function(e){return I.fromDom(e.dom.host)},Oe=function(e){return c(e.dom.shadowRoot)},_e=function(e){var t=H(e)?e.dom.parentNode:e.dom;if(null==t||null===t.ownerDocument)return!1;var n,r,o=t.ownerDocument;return ke(I.fromDom(t)).fold((function(){return o.body.contains(t)}),(n=_e,r=Te,function(e){return n(r(e))}))},Ee=function(e,t,n){!function(e,t,n){if(!(i(n)||u(n)||l(n)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",n,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,n+"")}(e.dom,t,n)},Ae=function(e,t){var n=e.dom.getAttribute(t);return null===n?void 0:n},De=function(e,t){e.dom.removeAttribute(t)},Me=function(e,t){var n=e.dom;!function(e,t){for(var n=R(e),r=0,o=n.length;r<o;r++){var i=n[r];t(e[i],i)}}(t,(function(e,t){!function(e,t,n){if(!i(n))throw console.error("Invalid call to CSS.set. Property ",t,":: Value ",n,":: Element ",e),new Error("CSS value must be a string: "+n);B(e)&&e.style.setProperty(t,n)}(n,t,e)}))},Ne=function(e,t){return B(e)?e.style.getPropertyValue(t):""},Re=function(e){var t,n,r=I.fromDom(function(e){if(Ce()&&c(e.target)){var t=I.fromDom(e.target);if(L(t)&&Oe(t)&&e.composed&&e.composedPath){var n=e.composedPath();if(n)return N(n)}}return C.from(e.target)}(e).getOr(e.target)),o=function(){return e.stopPropagation()},i=function(){return e.preventDefault()},a=(t=i,n=o,function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return t(n.apply(null,e))});return function(e,t,n,r,o,i,a){return{target:e,x:t,y:n,stop:r,prevent:o,kill:i,raw:a}}(r,e.clientX,e.clientY,o,i,a,e)},ze=function(e,t,n,r,o){var i=function(e,t){return function(n){e(n)&&t(Re(n))}}(n,r);return e.dom.addEventListener(t,i,o),{unbind:g(Be,e,t,i,o)}},Be=function(e,t,n,r){e.dom.removeEventListener(t,n,r)},Pe=b,Ie=function(e,t,n){return function(e,t,n,r){return ze(e,t,n,r,!1)}(e,t,Pe,n)},Fe=function(e,t){return{left:e,top:t,translate:function(n,r){return Fe(e+n,t+r)}}},Le=Fe,He=function(e){var t=void 0===e?window:e;return he().browser.isFirefox()?C.none():C.from(t.visualViewport)},Ve=function(e,t,n,r){return{x:e,y:t,width:n,height:r,right:e+n,bottom:t+r}},je=function(e){var t=void 0===e?window:e,n=t.document,r=function(e){var t=void 0!==e?e.dom:document,n=t.body.scrollLeft||t.documentElement.scrollLeft,r=t.body.scrollTop||t.documentElement.scrollTop;return Le(n,r)}(I.fromDom(n));return He(t).fold((function(){var e=t.document.documentElement,n=e.clientWidth,o=e.clientHeight;return Ve(r.left,r.top,n,o)}),(function(e){return Ve(Math.max(e.pageLeft,r.left),Math.max(e.pageTop,r.top),e.width,e.height)}))},Ue=function(e,t,n){return He(n).map((function(n){var r=function(e){return t(Re(e))};return n.addEventListener(e,r),{unbind:function(){return n.removeEventListener(e,r)}}})).getOrThunk((function(){return{unbind:f}}))},We=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),$e=tinymce.util.Tools.resolve("tinymce.Env"),qe=tinymce.util.Tools.resolve("tinymce.util.Delay"),Ge=function(e,t){e.fire("FullscreenStateChanged",{state:t})},Ke=function(e){return e.getParam("fullscreen_native",!1,"boolean")},Xe=function(e){var t=I.fromDom(e.getElement());return ke(t).map(Te).getOrThunk((function(){return function(e){var t=e.dom.body;if(null==t)throw new Error("Body is not available yet");return I.fromDom(t)}(be(t))}))},Ye=function(e){return e.dom===(void 0!==(t=be(e).dom).fullscreenElement?t.fullscreenElement:void 0!==t.msFullscreenElement?t.msFullscreenElement:void 0!==t.webkitFullscreenElement?t.webkitFullscreenElement:null);var t},Je=function(e,t,n){return A(function(e,t){for(var n=s(t)?t:v,r=e.dom,o=[];null!==r.parentNode&&void 0!==r.parentNode;){var i=r.parentNode,a=I.fromDom(i);if(o.push(a),!0===n(a))break;r=i}return o}(e,n),t)},Ze=function(e){return function(e,t){var n,r=void 0===t?document:t.dom;return 1!==(n=r).nodeType&&9!==n.nodeType&&11!==n.nodeType||0===n.childElementCount?[]:_(r.querySelectorAll(e),I.fromDom)}(e)},Qe=function(e,t,n){return Je(e,(function(e){return ve(e,t)}),n)},et=function(e,t){return function(e,t){return A(ye(e),t)}(e,(function(e){return ve(e,t)}))},tt="data-ephox-mobile-fullscreen-style",nt="position:absolute!important;",rt="top:0!important;left:0!important;margin:0!important;padding:0!important;width:100%!important;height:100%!important;overflow:visible!important;",ot=$e.os.isAndroid(),it=function(e){var t=function(e,t){var n=e.dom,r=window.getComputedStyle(n).getPropertyValue(t);return""!==r||_e(e)?r:Ne(n,t)}(e,"background-color");return void 0!==t&&""!==t?"background-color:"+t+"!important":"background-color:rgb(255,255,255)!important;"},at=We.DOM,ut=He().fold((function(){return{bind:f,unbind:f}}),(function(e){var t,n=(t=k(f),S(S({},t),{on:function(e){return t.get().each(e)}})),r=T(),o=T(),i=qe.throttle((function(){document.body.scrollTop=0,document.documentElement.scrollTop=0,window.requestAnimationFrame((function(){n.on((function(t){return Me(t,{top:e.offsetTop+"px",left:e.offsetLeft+"px",height:e.height+"px",width:e.width+"px"})}))}))}),50);return{bind:function(e){n.set(e),i(),r.set(Ue("resize",i)),o.set(Ue("scroll",i))},unbind:function(){n.on((function(){r.clear(),o.clear()})),n.clear()}}})),ct=function(e,t){var n,r,o,i,a=document.body,u=document.documentElement,c=e.getContainer(),s=I.fromDom(c),l=Xe(e),f=t.get(),d=I.fromDom(e.getBody()),m=$e.deviceType.isTouch(),g=c.style,p=e.iframeElement.style,h=function(e){e(a,"tox-fullscreen"),e(u,"tox-fullscreen"),e(c,"tox-fullscreen"),ke(s).map((function(e){return Te(e).dom})).each((function(t){e(t,"tox-fullscreen"),e(t,"tox-shadowhost")}))},v=function(){var n,r;m&&(n=e.dom,r=Ze("["+tt+"]"),E(r,(function(e){var t=Ae(e,tt);"no-styles"!==t?Me(e,n.parseStyle(t)):De(e,"style"),De(e,tt)}))),h(at.removeClass),ut.unbind(),C.from(t.get()).each((function(e){return e.fullscreenChangeHandler.unbind()}))};if(f)f.fullscreenChangeHandler.unbind(),Ke(e)&&Ye(l)&&(r=be(l),(o=r.dom).exitFullscreen?o.exitFullscreen():o.msExitFullscreen?o.msExitFullscreen():o.webkitCancelFullScreen&&o.webkitCancelFullScreen()),p.width=f.iframeWidth,p.height=f.iframeHeight,g.width=f.containerWidth,g.height=f.containerHeight,g.top=f.containerTop,g.left=f.containerLeft,n=f.scrollPos,window.scrollTo(n.x,n.y),t.set(null),Ge(e,!1),v(),e.off("remove",v);else{var b=Ie(be(l),void 0!==document.fullscreenElement?"fullscreenchange":void 0!==document.msFullscreenElement?"MSFullscreenChange":void 0!==document.webkitFullscreenElement?"webkitfullscreenchange":"fullscreenchange",(function(n){Ke(e)&&(Ye(l)||null===t.get()||ct(e,t))})),y={scrollPos:je(window),containerWidth:g.width,containerHeight:g.height,containerTop:g.top,containerLeft:g.left,iframeWidth:p.width,iframeHeight:p.height,fullscreenChangeHandler:b};m&&function(e,t,n){var r=function(t){return function(n){var r=Ae(n,"style"),o=void 0===r?"no-styles":r.trim();o!==t&&(Ee(n,tt,o),Me(n,e.parseStyle(t)))}},o=Qe(t,"*"),i=M(o,(function(e){return et(e,"*:not(.tox-silver-sink)")})),a=it(n);E(i,r("display:none!important;")),E(o,r(nt+rt+a)),r((!0===ot?"":nt)+rt+a)(t)}(e.dom,s,d),p.width=p.height="100%",g.width=g.height="",h(at.addClass),ut.bind(s),e.on("remove",v),t.set(y),Ke(e)&&((i=l.dom).requestFullscreen?i.requestFullscreen():i.msRequestFullscreen?i.msRequestFullscreen():i.webkitRequestFullScreen&&i.webkitRequestFullScreen()),Ge(e,!0)}},st=function(e,t){return function(n){n.setActive(null!==t.get());var r=function(e){return n.setActive(e.state)};return e.on("FullscreenStateChanged",r),function(){return e.off("FullscreenStateChanged",r)}}};t.add("fullscreen",(function(t){var r=e(null);return t.inline||(function(e,t){e.addCommand("mceFullScreen",(function(){ct(e,t)}))}(t,r),function(e,t){var n=function(){return e.execCommand("mceFullScreen")};e.ui.registry.addToggleMenuItem("fullscreen",{text:"Fullscreen",icon:"fullscreen",shortcut:"Meta+Shift+F",onAction:n,onSetup:st(e,t)}),e.ui.registry.addToggleButton("fullscreen",{tooltip:"Fullscreen",icon:"fullscreen",onAction:n,onSetup:st(e,t)})}(t,r),t.addShortcut("Meta+Shift+F","","mceFullScreen")),n(r)}))}(),function(){"use strict";var e,t,n=tinymce.util.Tools.resolve("tinymce.PluginManager"),r=function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=function(){},i=function(e){return function(){return e}},a=function(e){return e},u=i(!1),c=i(!0),s=function(){return l},l={fold:function(e,t){return e()},isSome:u,isNone:c,getOr:t=a,getOrThunk:e=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(void 0),or:t,orThunk:e,map:s,each:o,bind:s,exists:u,forall:c,filter:function(){return s()},toArray:function(){return[]},toString:i("none()")},f=function(e){var t=i(e),n=function(){return o},r=function(t){return t(e)},o={fold:function(t,n){return n(e)},isSome:c,isNone:u,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:n,orThunk:n,map:function(t){return f(t(e))},each:function(t){t(e)},bind:r,exists:r,forall:r,filter:function(t){return t(e)?o:l},toArray:function(){return[e]},toString:function(){return"some("+e+")"}};return o},d={some:f,none:s,from:function(e){return null==e?l:f(e)}},m=Array.prototype.indexOf,g=function(e,t){return n=e,r=t,m.call(n,r)>-1;var n,r},p=function(e,t){for(var n=e.length,r=new Array(n),o=0;o<n;o++){var i=e[o];r[o]=t(i,o)}return r},h=function(e,t){for(var n=[],r=0,o=e.length;r<o;r++){var i=e[r];t(i,r)&&n.push(i)}return n},v=function(e,t){return function(e,t,n){for(var r=0,o=e.length;r<o;r++){var i=e[r];if(t(i,r))return d.some(i);if(n(i,r))break}return d.none()}(e,t,u)},b=Object.keys,y=Object.hasOwnProperty,w=function(e,t){return y.call(e,t)},x=tinymce.util.Tools.resolve("tinymce.Env"),C=function(e){var t=x.mac?{alt:"&#x2325;",ctrl:"&#x2303;",shift:"&#x21E7;",meta:"&#x2318;",access:"&#x2303;&#x2325;"}:{meta:"Ctrl ",access:"Shift + Alt "},n=e.split("+"),r=p(n,(function(e){var n=e.toLowerCase().trim();return w(t,n)?t[n]:e}));return x.mac?r.join("").replace(/\s/,""):r.join("+")},S=[{shortcuts:["Meta + B"],action:"Bold"},{shortcuts:["Meta + I"],action:"Italic"},{shortcuts:["Meta + U"],action:"Underline"},{shortcuts:["Meta + A"],action:"Select all"},{shortcuts:["Meta + Y","Meta + Shift + Z"],action:"Redo"},{shortcuts:["Meta + Z"],action:"Undo"},{shortcuts:["Access + 1"],action:"Heading 1"},{shortcuts:["Access + 2"],action:"Heading 2"},{shortcuts:["Access + 3"],action:"Heading 3"},{shortcuts:["Access + 4"],action:"Heading 4"},{shortcuts:["Access + 5"],action:"Heading 5"},{shortcuts:["Access + 6"],action:"Heading 6"},{shortcuts:["Access + 7"],action:"Paragraph"},{shortcuts:["Access + 8"],action:"Div"},{shortcuts:["Access + 9"],action:"Address"},{shortcuts:["Alt + 0"],action:"Open help dialog"},{shortcuts:["Alt + F9"],action:"Focus to menubar"},{shortcuts:["Alt + F10"],action:"Focus to toolbar"},{shortcuts:["Alt + F11"],action:"Focus to element path"},{shortcuts:["Ctrl + F9"],action:"Focus to contextual toolbar"},{shortcuts:["Shift + Enter"],action:"Open popup menu for split buttons"},{shortcuts:["Meta + K"],action:"Insert link (if link plugin activated)"},{shortcuts:["Meta + S"],action:"Save (if save plugin activated)"},{shortcuts:["Meta + F"],action:"Find (if searchreplace plugin activated)"},{shortcuts:["Meta + Shift + F"],action:"Switch to or from fullscreen mode"}],k=function(){return{name:"shortcuts",title:"Handy Shortcuts",items:[{type:"table",header:["Action","Shortcut"],cells:p(S,(function(e){var t=p(e.shortcuts,C).join(" or ");return[e.action,t]}))}]}},T=tinymce.util.Tools.resolve("tinymce.util.I18n"),O=p([{key:"advlist",name:"Advanced List"},{key:"anchor",name:"Anchor"},{key:"autolink",name:"Autolink"},{key:"autoresize",name:"Autoresize"},{key:"autosave",name:"Autosave"},{key:"bbcode",name:"BBCode"},{key:"charmap",name:"Character Map"},{key:"code",name:"Code"},{key:"codesample",name:"Code Sample"},{key:"colorpicker",name:"Color Picker"},{key:"directionality",name:"Directionality"},{key:"emoticons",name:"Emoticons"},{key:"fullpage",name:"Full Page"},{key:"fullscreen",name:"Full Screen"},{key:"help",name:"Help"},{key:"hr",name:"Horizontal Rule"},{key:"image",name:"Image"},{key:"imagetools",name:"Image Tools"},{key:"importcss",name:"Import CSS"},{key:"insertdatetime",name:"Insert Date/Time"},{key:"legacyoutput",name:"Legacy Output"},{key:"link",name:"Link"},{key:"lists",name:"Lists"},{key:"media",name:"Media"},{key:"nonbreaking",name:"Nonbreaking"},{key:"noneditable",name:"Noneditable"},{key:"pagebreak",name:"Page Break"},{key:"paste",name:"Paste"},{key:"preview",name:"Preview"},{key:"print",name:"Print"},{key:"quickbars",name:"Quick Toolbars"},{key:"save",name:"Save"},{key:"searchreplace",name:"Search and Replace"},{key:"spellchecker",name:"Spell Checker"},{key:"tabfocus",name:"Tab Focus"},{key:"table",name:"Table"},{key:"template",name:"Template"},{key:"textcolor",name:"Text Color"},{key:"textpattern",name:"Text Pattern"},{key:"toc",name:"Table of Contents"},{key:"visualblocks",name:"Visual Blocks"},{key:"visualchars",name:"Visual Characters"},{key:"wordcount",name:"Word Count"},{key:"a11ychecker",name:"Accessibility Checker",type:"premium"},{key:"advcode",name:"Advanced Code Editor",type:"premium"},{key:"advtable",name:"Advanced Tables",type:"premium"},{key:"autocorrect",name:"Autocorrect",type:"premium"},{key:"casechange",name:"Case Change",type:"premium"},{key:"checklist",name:"Checklist",type:"premium"},{key:"export",name:"Export",type:"premium"},{key:"mediaembed",name:"Enhanced Media Embed",type:"premium"},{key:"formatpainter",name:"Format Painter",type:"premium"},{key:"linkchecker",name:"Link Checker",type:"premium"},{key:"mentions",name:"Mentions",type:"premium"},{key:"pageembed",name:"Page Embed",type:"premium"},{key:"permanentpen",name:"Permanent Pen",type:"premium"},{key:"powerpaste",name:"PowerPaste",type:"premium"},{key:"rtc",name:"Real-Time Collaboration",type:"premium"},{key:"tinymcespellchecker",name:"Spell Checker Pro",type:"premium"},{key:"tinycomments",name:"Tiny Comments",type:"premium",slug:"comments"},{key:"tinydrive",name:"Tiny Drive",type:"premium"}],(function(e){return r(r({},e),{type:e.type||"opensource",slug:e.slug||e.key})})),_=function(e){var t,n,r=function(e){return'<a href="'+e.url+'" target="_blank" rel="noopener">'+e.name+"</a>"},o=function(e){var t=function(e){var t=b(e.plugins),n=function(e){return e.getParam("forced_plugins")}(e);return void 0===n?t:h(t,(function(e){return!g(n,e)}))}(e),n=p(t,(function(t){return"<li>"+function(e,t){return v(O,(function(e){return e.key===t})).fold((function(){var n=e.plugins[t].getMetadata;return"function"==typeof n?r(n()):t}),(function(e){var t="premium"===e.type?e.name+"*":e.name;return r({name:t,url:"https://www.tiny.cloud/docs/plugins/"+e.type+"/"+e.slug})}))}(e,t)+"</li>"})),o=n.length,i=n.join("");return"<p><b>"+T.translate(["Plugins installed ({0}):",o])+"</b></p><ul>"+i+"</ul>"},i={type:"htmlpanel",presets:"document",html:[function(e){return null==e?"":'<div data-mce-tabstop="1" tabindex="-1">'+o(e)+"</div>"}(e),(t=h(O,(function(e){var t=e.key,n=e.type;return"autocorrect"!==t&&"premium"===n})),n=p(t,(function(e){return"<li>"+T.translate(e.name)+"</li>"})).join(""),'<div data-mce-tabstop="1" tabindex="-1"><p><b>'+T.translate("Premium plugins:")+"</b></p><ul>"+n+'<li class="tox-help__more-link" "><a href="https://www.tiny.cloud/pricing/?utm_campaign=editor_referral&utm_medium=help_dialog&utm_source=tinymce" target="_blank">'+T.translate("Learn more...")+"</a></li></ul></div>")].join("")};return{name:"plugins",title:"Plugins",items:[i]}},E=tinymce.util.Tools.resolve("tinymce.EditorManager"),A=function(e,t){var n,o,i,a,u=k(),c={name:"keyboardnav",title:"Keyboard Navigation",items:[{type:"htmlpanel",presets:"document",html:"<h1>Editor UI keyboard navigation</h1>\n\n<h2>Activating keyboard navigation</h2>\n\n<p>The sections of the outer UI of the editor - the menubar, toolbar, sidebar and footer - are all keyboard navigable. As such, there are multiple ways to activate keyboard navigation:</p>\n<ul>\n  <li>Focus the menubar: Alt + F9 (Windows) or &#x2325;F9 (MacOS)</li>\n  <li>Focus the toolbar: Alt + F10 (Windows) or &#x2325;F10 (MacOS)</li>\n  <li>Focus the footer: Alt + F11 (Windows) or &#x2325;F11 (MacOS)</li>\n</ul>\n\n<p>Focusing the menubar or toolbar will start keyboard navigation at the first item in the menubar or toolbar, which will be highlighted with a gray background. Focusing the footer will start keyboard navigation at the first item in the element path, which will be highlighted with an underline. </p>\n\n<h2>Moving between UI sections</h2>\n\n<p>When keyboard navigation is active, pressing tab will move the focus to the next major section of the UI, where applicable. These sections are:</p>\n<ul>\n  <li>the menubar</li>\n  <li>each group of the toolbar </li>\n  <li>the sidebar</li>\n  <li>the element path in the footer </li>\n  <li>the wordcount toggle button in the footer </li>\n  <li>the branding link in the footer </li>\n  <li>the editor resize handle in the footer</li>\n</ul>\n\n<p>Pressing shift + tab will move backwards through the same sections, except when moving from the footer to the toolbar. Focusing the element path then pressing shift + tab will move focus to the first toolbar group, not the last.</p>\n\n<h2>Moving within UI sections</h2>\n\n<p>Keyboard navigation within UI sections can usually be achieved using the left and right arrow keys. This includes:</p>\n<ul>\n  <li>moving between menus in the menubar</li>\n  <li>moving between buttons in a toolbar group</li>\n  <li>moving between items in the element path</li>\n</ul>\n\n<p>In all these UI sections, keyboard navigation will cycle within the section. For example, focusing the last button in a toolbar group then pressing right arrow will move focus to the first item in the same toolbar group. </p>\n\n<h1>Executing buttons</h1>\n\n<p>To execute a button, navigate the selection to the desired button and hit space or enter.</p>\n\n<h1>Opening, navigating and closing menus</h1>\n\n<p>When focusing a menubar button or a toolbar button with a menu, pressing space, enter or down arrow will open the menu. When the menu opens the first item will be selected. To move up or down the menu, press the up or down arrow key respectively. This is the same for submenus, which can also be opened and closed using the left and right arrow keys.</p>\n\n<p>To close any active menu, hit the escape key. When a menu is closed the selection will be restored to its previous selection. This also works for closing submenus.</p>\n\n<h1>Context toolbars and menus</h1>\n\n<p>To focus an open context toolbar such as the table context toolbar, press Ctrl + F9 (Windows) or &#x2303;F9 (MacOS).</p>\n\n<p>Context toolbar navigation is the same as toolbar navigation, and context menu navigation is the same as standard menu navigation.</p>\n\n<h1>Dialog navigation</h1>\n\n<p>There are two types of dialog UIs in TinyMCE: tabbed dialogs and non-tabbed dialogs.</p>\n\n<p>When a non-tabbed dialog is opened, the first interactive component in the dialog will be focused. Users can navigate between interactive components by pressing tab. This includes any footer buttons. Navigation will cycle back to the first dialog component if tab is pressed while focusing the last component in the dialog. Pressing shift + tab will navigate backwards.</p>\n\n<p>When a tabbed dialog is opened, the first button in the tab menu is focused. Pressing tab will navigate to the first interactive component in that tab, and will cycle through the tab’s components, the footer buttons, then back to the tab button. To switch to another tab, focus the tab button for the current tab, then use the arrow keys to cycle through the tab buttons.</p>"}]},s=_(e),l=(a='<a href="https://www.tiny.cloud/docs/changelog/?utm_campaign=editor_referral&utm_medium=help_dialog&utm_source=tinymce" target="_blank">TinyMCE '+(o=E.majorVersion,i=E.minorVersion,(0===o.indexOf("@")?"X.X.X":o+"."+i)+"</a>"),{name:"versions",title:"Version",items:[{type:"htmlpanel",html:"<p>"+T.translate(["You are using {0}",a])+"</p>",presets:"document"}]}),f=r(((n={})[u.name]=u,n[c.name]=c,n[s.name]=s,n[l.name]=l,n),t.get());return function(e){return d.from(e.getParam("help_tabs"))}(e).fold((function(){return function(e){var t=b(e),n=t.indexOf("versions");return-1!==n&&(t.splice(n,1),t.push("versions")),{tabs:e,names:t}}(f)}),(function(e){return function(e,t){var n={},r=p(e,(function(e){return"string"==typeof e?(w(t,e)&&(n[e]=t[e]),e):(n[e.name]=e,e.name)}));return{tabs:n,names:r}}(e,f)}))},D=function(e,t){return function(){var n=A(e,t),r=n.tabs,o=n.names,i={type:"tabpanel",tabs:function(e){for(var t=[],n=function(e){t.push(e)},r=0;r<e.length;r++)e[r].each(n);return t}(p(o,(function(e){return w(t=r,n=e)?d.from(t[n]):d.none();var t,n})))};e.windowManager.open({title:"Help",size:"medium",body:i,buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}],initialData:{}})}};n.add("help",(function(e){var t,n=(t={},{get:function(){return t},set:function(e){t=e}}),r=function(e){return{addTab:function(t){var n=e.get();n[t.name]=t,e.set(n)}}}(n),o=D(e,n);return function(e,t){e.ui.registry.addButton("help",{icon:"help",tooltip:"Help",onAction:t}),e.ui.registry.addMenuItem("help",{text:"Help",icon:"help",shortcut:"Alt+0",onAction:t})}(e,o),function(e,t){e.addCommand("mceHelp",t)}(e,o),e.shortcuts.add("Alt+0","Open help dialog","mceHelp"),r}))}(),function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");e.add("hr",(function(e){!function(e){e.addCommand("InsertHorizontalRule",(function(){e.execCommand("mceInsertContent",!1,"<hr />")}))}(e),function(e){var t=function(){return e.execCommand("InsertHorizontalRule")};e.ui.registry.addButton("hr",{icon:"horizontal-rule",tooltip:"Horizontal line",onAction:t}),e.ui.registry.addMenuItem("hr",{icon:"horizontal-rule",text:"Horizontal line",onAction:t})}(e)}))}(),function(){"use strict";var e,t,n,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=function(){return o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},o.apply(this,arguments)},i=function(e){return function(t){return r=typeof(n=t),(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)===e;var n,r}},a=function(e){return function(t){return typeof t===e}},u=i("string"),c=i("object"),s=i("array"),l=(e=null,function(t){return e===t}),f=a("boolean"),d=function(e){return!function(e){return null==e}(e)},m=a("function"),g=a("number"),p=function(){},h=function(e){return function(){return e}},v=function(e){return e},b=h(!1),y=h(!0),w=function(){return x},x={fold:function(e,t){return e()},isSome:b,isNone:y,getOr:n=v,getOrThunk:t=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:h(null),getOrUndefined:h(void 0),or:n,orThunk:t,map:w,each:p,bind:w,exists:b,forall:y,filter:function(){return w()},toArray:function(){return[]},toString:h("none()")},C=function(e){var t=h(e),n=function(){return o},r=function(t){return t(e)},o={fold:function(t,n){return n(e)},isSome:y,isNone:b,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:n,orThunk:n,map:function(t){return C(t(e))},each:function(t){t(e)},bind:r,exists:r,forall:r,filter:function(t){return t(e)?o:x},toArray:function(){return[e]},toString:function(){return"some("+e+")"}};return o},S={some:C,none:w,from:function(e){return null==e?x:C(e)}},k=Object.keys,T=Object.hasOwnProperty,O=function(e,t,n,r){return function(e,t){for(var n=k(e),r=0,o=n.length;r<o;r++){var i=n[r];t(e[i],i)}}(e,(function(e,o){(t(e,o)?n:r)(e,o)})),{}},_=function(e,t){return T.call(e,t)},E=Array.prototype.push,A=function(e){for(var t=[],n=0,r=e.length;n<r;++n){if(!s(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);E.apply(t,e[n])}return t},D=function(e){return function(e,t){return t>=0&&t<e.length?S.some(e[t]):S.none()}(e,0)};"undefined"!=typeof window?window:Function("return this;")();var M,N=function(e,t,n){!function(e,t,n){if(!(u(n)||f(n)||g(n)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",n,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,n+"")}(e.dom,t,n)},R=function(e){if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}},z={fromHtml:function(e,t){var n=(t||document).createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return R(n.childNodes[0])},fromTag:function(e,t){var n=(t||document).createElement(e);return R(n)},fromText:function(e,t){var n=(t||document).createTextNode(e);return R(n)},fromDom:R,fromPoint:function(e,t,n){return S.from(e.dom.elementFromPoint(t,n)).map(R)}},B=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),P=tinymce.util.Tools.resolve("tinymce.util.Promise"),I=tinymce.util.Tools.resolve("tinymce.util.URI"),F=tinymce.util.Tools.resolve("tinymce.util.XHR"),L=function(e){return e.getParam("image_dimensions",!0,"boolean")},H=function(e,t){return Math.max(parseInt(e,10),parseInt(t,10))},V=function(e){return e&&(e=e.replace(/px$/,"")),e},j=function(e){return e.length>0&&/^[0-9]+$/.test(e)&&(e+="px"),e},U=function(e){if(e.margin){var t=String(e.margin).split(" ");switch(t.length){case 1:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[0],e["margin-bottom"]=e["margin-bottom"]||t[0],e["margin-left"]=e["margin-left"]||t[0];break;case 2:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[1],e["margin-bottom"]=e["margin-bottom"]||t[0],e["margin-left"]=e["margin-left"]||t[1];break;case 3:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[1],e["margin-bottom"]=e["margin-bottom"]||t[2],e["margin-left"]=e["margin-left"]||t[1];break;case 4:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[1],e["margin-bottom"]=e["margin-bottom"]||t[2],e["margin-left"]=e["margin-left"]||t[3]}delete e.margin}return e},W=function(e){return"IMG"===e.nodeName&&(e.hasAttribute("data-mce-object")||e.hasAttribute("data-mce-placeholder"))},$=function(e,t){return I.isDomSafe(t,"img",e.settings)},q=B.DOM,G=function(e){return e.style.marginLeft&&e.style.marginRight&&e.style.marginLeft===e.style.marginRight?V(e.style.marginLeft):""},K=function(e){return e.style.marginTop&&e.style.marginBottom&&e.style.marginTop===e.style.marginBottom?V(e.style.marginTop):""},X=function(e){return e.style.borderWidth?V(e.style.borderWidth):""},Y=function(e,t){return e.hasAttribute(t)?e.getAttribute(t):""},J=function(e,t){return e.style[t]?e.style[t]:""},Z=function(e){return null!==e.parentNode&&"FIGURE"===e.parentNode.nodeName},Q=function(e,t,n){""===n?e.removeAttribute(t):e.setAttribute(t,n)},ee=function(e){Z(e)?function(e){var t=e.parentNode;q.insertAfter(e,t),q.remove(t)}(e):function(e){var t=q.create("figure",{class:"image"});q.insertAfter(t,e),t.appendChild(e),t.appendChild(q.create("figcaption",{contentEditable:"true"},"Caption")),t.contentEditable="false"}(e)},te=function(e,t){var n=e.getAttribute("style"),r=t(null!==n?n:"");r.length>0?(e.setAttribute("style",r),e.setAttribute("data-mce-style",r)):e.removeAttribute("style")},ne=function(e,t){return function(e,n,r){e.style[n]?(e.style[n]=j(r),te(e,t)):Q(e,n,r)}},re=function(e,t){return e.style[t]?V(e.style[t]):Y(e,t)},oe=function(e,t){var n=j(t);e.style.marginLeft=n,e.style.marginRight=n},ie=function(e,t){var n=j(t);e.style.marginTop=n,e.style.marginBottom=n},ae=function(e,t){var n=j(t);e.style.borderWidth=n},ue=function(e,t){e.style.borderStyle=t},ce=function(e){return"FIGURE"===e.nodeName},se=function(e){return 0===q.getAttrib(e,"alt").length&&"presentation"===q.getAttrib(e,"role")},le=function(e){return se(e)?"":Y(e,"alt")},fe=function(e,t){var n=document.createElement("img");return Q(n,"style",t.style),(G(n)||""!==t.hspace)&&oe(n,t.hspace),(K(n)||""!==t.vspace)&&ie(n,t.vspace),(X(n)||""!==t.border)&&ae(n,t.border),(function(e){return J(e,"borderStyle")}(n)||""!==t.borderStyle)&&ue(n,t.borderStyle),e(n.getAttribute("style"))},de=function(e,t){return{src:Y(t,"src"),alt:le(t),title:Y(t,"title"),width:re(t,"width"),height:re(t,"height"),class:Y(t,"class"),style:e(Y(t,"style")),caption:Z(t),hspace:G(t),vspace:K(t),border:X(t),borderStyle:J(t,"borderStyle"),isDecorative:se(t)}},me=function(e,t,n,r,o){n[r]!==t[r]&&o(e,r,n[r])},ge=function(e,t,n){if(n){q.setAttrib(e,"role","presentation");var r=z.fromDom(e);N(r,"alt","")}else{if(l(t)){r=z.fromDom(e);o="alt",r.dom.removeAttribute(o)}else{r=z.fromDom(e);N(r,"alt",t)}"presentation"===q.getAttrib(e,"role")&&q.setAttrib(e,"role","")}var o},pe=function(e,t){return function(n,r,o){e(n,o),te(n,t)}},he=function(e,t,n){var r=de(e,n);me(n,r,t,"caption",(function(e,t,n){return ee(e)})),me(n,r,t,"src",Q),me(n,r,t,"title",Q),me(n,r,t,"width",ne(0,e)),me(n,r,t,"height",ne(0,e)),me(n,r,t,"class",Q),me(n,r,t,"style",pe((function(e,t){return Q(e,"style",t)}),e)),me(n,r,t,"hspace",pe(oe,e)),me(n,r,t,"vspace",pe(ie,e)),me(n,r,t,"border",pe(ae,e)),me(n,r,t,"borderStyle",pe(ue,e)),function(e,t,n){n.alt===t.alt&&n.isDecorative===t.isDecorative||ge(e,n.alt,n.isDecorative)}(n,r,t)},ve=function(e,t){var n=e.dom.styles.parse(t),r=U(n),o=e.dom.styles.parse(e.dom.styles.serialize(r));return e.dom.styles.serialize(o)},be=function(e){var t=e.selection.getNode(),n=e.dom.getParent(t,"figure.image");return n?e.dom.select("img",n)[0]:t&&("IMG"!==t.nodeName||W(t))?null:t},ye=function(e,t){var n=e.dom,r=function(e,t){var n,r={};return O(e,t,(n=r,function(e,t){n[t]=e}),p),r}(e.schema.getTextBlockElements(),(function(t,n){return!e.schema.isValidChild(n,"figure")})),o=n.getParent(t.parentNode,(function(e){return t=r,n=e.nodeName,_(t,n)&&void 0!==t[n]&&null!==t[n];var t,n}),e.getBody());return o?n.split(o,t):t},we=function(e,t){var n=function(e,t){var n=document.createElement("img");if(he(e,o(o({},t),{caption:!1}),n),ge(n,t.alt,t.isDecorative),t.caption){var r=q.create("figure",{class:"image"});return r.appendChild(n),r.appendChild(q.create("figcaption",{contentEditable:"true"},"Caption")),r.contentEditable="false",r}return n}((function(t){return ve(e,t)}),t);e.dom.setAttrib(n,"data-mce-id","__mcenew"),e.focus(),e.selection.setContent(n.outerHTML);var r=e.dom.select('*[data-mce-id="__mcenew"]')[0];if(e.dom.setAttrib(r,"data-mce-id",null),ce(r)){var i=ye(e,r);e.selection.select(i)}else e.selection.select(r)},xe=function(e,t){var n=be(e);if(he((function(t){return ve(e,t)}),t,n),function(e,t){e.dom.setAttrib(t,"src",t.getAttribute("src"))}(e,n),ce(n.parentNode)){var r=n.parentNode;ye(e,r),e.selection.select(n.parentNode)}else e.selection.select(n),function(e,t,n){var r=function(){n.onload=n.onerror=null,e.selection&&(e.selection.select(n),e.nodeChanged())};n.onload=function(){t.width||t.height||!L(e)||e.dom.setAttribs(n,{width:String(n.clientWidth),height:String(n.clientHeight)}),r()},n.onerror=r}(e,t,n)},Ce=function(e,t){var n=be(e);if(n){var r=de((function(t){return ve(e,t)}),n),i=o(o({},r),t),a=function(e,t){var n=t.src;return o(o({},t),{src:$(e,n)?n:""})}(e,i);i.src?xe(e,a):function(e,t){if(t){var n=e.dom.is(t.parentNode,"figure.image")?t.parentNode:t;e.dom.remove(n),e.focus(),e.nodeChanged(),e.dom.isEmpty(e.getBody())&&(e.setContent(""),e.selection.setCursorLocation())}}(e,n)}else t.src&&we(e,o(o({},{src:"",alt:"",title:"",width:"",height:"",class:"",style:"",caption:!1,hspace:"",vspace:"",border:"",borderStyle:"",isDecorative:!1}),t))},Se=(M=function(e,t){return c(e)&&c(t)?Se(e,t):t},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(0===e.length)throw new Error("Can't merge zero objects");for(var n={},r=0;r<e.length;r++){var o=e[r];for(var i in o)_(o,i)&&(n[i]=M(n[i],o[i]))}return n}),ke=tinymce.util.Tools.resolve("tinymce.util.ImageUploader"),Te=tinymce.util.Tools.resolve("tinymce.util.Tools"),Oe=function(e){return u(e.value)?e.value:""},_e=function(e,t){var n=[];return Te.each(e,(function(e){var r=function(e){return u(e.text)?e.text:u(e.title)?e.title:""}(e);if(void 0!==e.menu){var o=_e(e.menu,t);n.push({text:r,items:o})}else{var i=t(e);n.push({text:r,value:i})}})),n},Ee=function(e){return void 0===e&&(e=Oe),function(t){return t?S.from(t).map((function(t){return _e(t,e)})):S.none()}},Ae=function(e,t){return function(e,t){for(var n=0;n<e.length;n++){var r=t(e[n],n);if(r.isSome())return r}return S.none()}(e,(function(e){return function(e){return _(e,"items")}(e)?Ae(e.items,t):e.value===t?S.some(e):S.none()}))},De=Ee,Me=function(e){return Ee(Oe)(e)},Ne=function(e,t){return e.bind((function(e){return Ae(e,t)}))},Re=function(e){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"}]}]}]}},ze=function(e){var t=De((function(t){return e.convertURL(t.value||t.url,"src")})),n=new P((function(n){!function(e,t){var n=function(e){return e.getParam("image_list",!1)}(e);u(n)?F.send({url:n,success:function(e){t(JSON.parse(e))}}):m(n)?n(t):t(n)}(e,(function(e){n(t(e).map((function(e){return A([[{text:"None",value:""}],e])})))}))})),r=Me(function(e){return e.getParam("image_class_list")}(e)),o=function(e){return e.getParam("image_advtab",!1,"boolean")}(e),i=function(e){return e.getParam("image_uploadtab",!0,"boolean")}(e),a=function(e){return d(e.getParam("images_upload_url"))}(e),c=function(e){return d(e.getParam("images_upload_handler"))}(e),s=function(e){var t=be(e);return t?de((function(t){return ve(e,t)}),t):{src:"",alt:"",title:"",width:"",height:"",class:"",style:"",caption:!1,hspace:"",vspace:"",border:"",borderStyle:"",isDecorative:!1}}(e),l=function(e){return e.getParam("image_description",!0,"boolean")}(e),f=function(e){return e.getParam("image_title",!1,"boolean")}(e),g=L(e),p=function(e){return e.getParam("image_caption",!1,"boolean")}(e),h=function(e){return e.getParam("a11y_advanced_options",!1,"boolean")}(e),v=function(e){return e.getParam("automatic_uploads",!0,"boolean")}(e),b=S.some(function(e){return e.getParam("image_prepend_url","","string")}(e)).filter((function(e){return u(e)&&e.length>0}));return n.then((function(e){return{image:s,imageList:e,classList:r,hasAdvTab:o,hasUploadTab:i,hasUploadUrl:a,hasUploadHandler:c,hasDescription:l,hasImageTitle:f,hasDimensions:g,hasImageCaption:p,prependURL:b,hasAccessibilityOptions:h,automaticUploads:v}}))},Be=function(e){var t,n=e.imageList.map((function(e){return{name:"images",type:"listbox",label:"Image list",items:e}})),r={name:"alt",type:"input",label:"Alternative description",disabled:e.hasAccessibilityOptions&&e.image.isDecorative},i=e.classList.map((function(e){return{name:"classes",type:"listbox",label:"Class",items:e}}));return A([[{name:"src",type:"urlinput",filetype:"image",label:"Source"}],n.toArray(),e.hasAccessibilityOptions&&e.hasDescription?[{type:"label",label:"Accessibility",items:[{name:"isDecorative",type:"checkbox",label:"Image is decorative"}]}]:[],e.hasDescription?[r]:[],e.hasImageTitle?[{name:"title",type:"input",label:"Image title"}]:[],e.hasDimensions?[{name:"dimensions",type:"sizeinput"}]:[],[o(o({},(t=e.classList.isSome()&&e.hasImageCaption,t?{type:"grid",columns:2}:{type:"panel"})),{items:A([i.toArray(),e.hasImageCaption?[{type:"label",label:"Caption",items:[{type:"checkbox",name:"caption",label:"Show caption"}]}]:[]])})]])},Pe=function(e){return{title:"General",name:"general",items:Be(e)}},Ie=Be,Fe=function(e){return{title:"Upload",name:"upload",items:[{type:"dropzone",name:"fileinput"}]}},Le=function(e){return{src:{value:e.src,meta:{}},images:e.src,alt:e.alt,title:e.title,dimensions:{width:e.width,height:e.height},classes:e.class,caption:e.caption,style:e.style,vspace:e.vspace,border:e.border,hspace:e.hspace,borderstyle:e.borderStyle,fileinput:[],isDecorative:e.isDecorative}},He=function(e,t){return{src:e.src.value,alt:0===e.alt.length&&t?null:e.alt,title:e.title,width:e.dimensions.width,height:e.dimensions.height,class:e.classes,style:e.style,caption:e.caption,hspace:e.hspace,vspace:e.vspace,border:e.border,borderStyle:e.borderstyle,isDecorative:e.isDecorative}},Ve=function(e,t){var n=t.getData();(function(e,t){return/^(?:[a-zA-Z]+:)?\/\//.test(t)?S.none():e.prependURL.bind((function(e){return t.substring(0,e.length)!==e?S.some(e+t):S.none()}))})(e,n.src.value).each((function(e){t.setData({src:{value:e,meta:n.src.meta}})}))},je=function(e,t){var n=t.getData(),r=n.src.meta;if(void 0!==r){var o=Se({},n);!function(e,t,n){e.hasDescription&&u(n.alt)&&(t.alt=n.alt),e.hasAccessibilityOptions&&(t.isDecorative=n.isDecorative||t.isDecorative||!1),e.hasImageTitle&&u(n.title)&&(t.title=n.title),e.hasDimensions&&(u(n.width)&&(t.dimensions.width=n.width),u(n.height)&&(t.dimensions.height=n.height)),u(n.class)&&Ne(e.classList,n.class).each((function(e){t.classes=e.value})),e.hasImageCaption&&f(n.caption)&&(t.caption=n.caption),e.hasAdvTab&&(u(n.style)&&(t.style=n.style),u(n.vspace)&&(t.vspace=n.vspace),u(n.border)&&(t.border=n.border),u(n.hspace)&&(t.hspace=n.hspace),u(n.borderstyle)&&(t.borderstyle=n.borderstyle))}(e,o,r),t.setData(o)}},Ue=function(e,t,n,r){Ve(t,r),je(t,r),function(e,t,n,r){var o=r.getData(),i=o.src.value,a=o.src.meta||{};a.width||a.height||!t.hasDimensions||(i.length>0?e.imageSize(i).then((function(e){n.open&&r.setData({dimensions:e})})).catch((function(e){return console.error(e)})):r.setData({dimensions:{width:"",height:""}}))}(e,t,n,r),function(e,t,n){var r=n.getData(),o=Ne(e.imageList,r.src.value);t.prevImage=o,n.setData({images:o.map((function(e){return e.value})).getOr("")})}(t,n,r)},We=function(e,t,n){var r=U(e(n.style)),o=Se({},n);return o.vspace=function(e){return e["margin-top"]&&e["margin-bottom"]&&e["margin-top"]===e["margin-bottom"]?V(String(e["margin-top"])):""}(r),o.hspace=function(e){return e["margin-right"]&&e["margin-left"]&&e["margin-right"]===e["margin-left"]?V(String(e["margin-right"])):""}(r),o.border=function(e){return e["border-width"]?V(String(e["border-width"])):""}(r),o.borderstyle=function(e){return e["border-style"]?String(e["border-style"]):""}(r),o.style=function(e,t,n){return t(e(t(n)))}(e,t,r),o},$e=function(e,t,n,r){var o=r.getData();r.block("Uploading image"),D(o.fileinput).fold((function(){r.unblock()}),(function(o){var i,a=URL.createObjectURL(o),u=function(){r.unblock(),URL.revokeObjectURL(a)},c=function(o){r.setData({src:{value:o,meta:{}}}),r.showTab("general"),Ue(e,t,n,r)};(i=o,new P((function(e,t){var n=new FileReader;n.onload=function(){e(n.result)},n.onerror=function(){t(n.error.message)},n.readAsDataURL(i)}))).then((function(n){var i=e.createBlobCache(o,a,n);t.automaticUploads?e.uploadImage(i).then((function(e){c(e.url),u()})).catch((function(t){u(),e.alertErr(t)})):(e.addToBlobCache(i),c(i.blobUri()),r.unblock())}))}))},qe=function(e,t,n){return function(r,o){"src"===o.name?Ue(e,t,n,r):"images"===o.name?function(e,t,n,r){var o=r.getData(),i=Ne(t.imageList,o.images);i.each((function(e){var t=""===o.alt||n.prevImage.map((function(e){return e.text===o.alt})).getOr(!1);t?""===e.value?r.setData({src:e,alt:n.prevAlt}):r.setData({src:e,alt:e.text}):r.setData({src:e})})),n.prevImage=i,Ue(e,t,n,r)}(e,t,n,r):"alt"===o.name?n.prevAlt=r.getData().alt:"style"===o.name?function(e,t){var n=t.getData(),r=We(e.parseStyle,e.serializeStyle,n);t.setData(r)}(e,r):"vspace"===o.name||"hspace"===o.name||"border"===o.name||"borderstyle"===o.name?function(e,t,n){var r=Se(Le(t.image),n.getData()),o=fe(e.normalizeCss,He(r,!1));n.setData({style:o})}(e,t,r):"fileinput"===o.name?$e(e,t,n,r):"isDecorative"===o.name&&(r.getData().isDecorative?r.disable("alt"):r.enable("alt"))}},Ge=function(e){return function(){e.open=!1}},Ke=function(e){return e.hasAdvTab||e.hasUploadUrl||e.hasUploadHandler?{type:"tabpanel",tabs:A([[Pe(e)],e.hasAdvTab?[Re(e)]:[],e.hasUploadTab&&(e.hasUploadUrl||e.hasUploadHandler)?[Fe(e)]:[]])}:{type:"panel",items:Ie(e)}},Xe=function(e){return function(t){var n=function(e){return{prevImage:Ne(e.imageList,e.image.src),prevAlt:e.image.alt,open:!0}}(t);return{title:"Insert/Edit Image",size:"normal",body:Ke(t),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:Le(t.image),onSubmit:e.onSubmit(t),onChange:qe(e,t,n),onClose:Ge(n)}}},Ye=function(e){return function(t){return function(n){var r=Se(Le(t.image),n.getData());e.execCommand("mceUpdateImage",!1,He(r,t.hasAccessibilityOptions)),e.editorUpload.uploadImagesAuto(),n.close()}}},Je=function(e){return function(t){return $(e,t)?function(e){return new P((function(t){var n=document.createElement("img"),r=function(e){n.onload=n.onerror=null,n.parentNode&&n.parentNode.removeChild(n),t(e)};n.onload=function(){var e={width:H(n.width,n.clientWidth),height:H(n.height,n.clientHeight)};r(P.resolve(e))},n.onerror=function(){r(P.reject("Failed to get image dimensions for: "+e))};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=e}))}(e.documentBaseURI.toAbsolute(t)).then((function(e){return{width:String(e.width),height:String(e.height)}})):P.resolve({width:"",height:""})}},Ze=function(e){return function(t,n,r){return e.editorUpload.blobCache.create({blob:t,blobUri:n,name:t.name?t.name.replace(/\.[^\.]+$/,""):null,filename:t.name,base64:r.split(",")[1]})}},Qe=function(e){return function(t){e.editorUpload.blobCache.add(t)}},et=function(e){return function(t){e.windowManager.alert(t)}},tt=function(e){return function(t){return ve(e,t)}},nt=function(e){return function(t){return e.dom.parseStyle(t)}},rt=function(e){return function(t,n){return e.dom.serializeStyle(t,n)}},ot=function(e){return function(t){return ke(e).upload([t],!1).then((function(e){return 0===e.length?P.reject("Failed to upload image"):!1===e[0].status?P.reject(e[0].error.message):e[0]}))}},it=function(e){var t={onSubmit:Ye(e),imageSize:Je(e),addToBlobCache:Qe(e),createBlobCache:Ze(e),alertErr:et(e),normalizeCss:tt(e),parseStyle:nt(e),serializeStyle:rt(e),uploadImage:ot(e)};return{open:function(){ze(e).then(Xe(t)).then(e.windowManager.open)}}},at=function(e){var t=e.attr("class");return t&&/\bimage\b/.test(t)},ut=function(e){return function(t){for(var n=t.length,r=function(t){t.attr("contenteditable",e?"true":null)};n--;){var o=t[n];at(o)&&(o.attr("contenteditable",e?"false":null),Te.each(o.getAll("figcaption"),r))}}};r.add("image",(function(e){!function(e){e.on("PreInit",(function(){e.parser.addNodeFilter("figure",ut(!0)),e.serializer.addNodeFilter("figure",ut(!1))}))}(e),function(e){e.ui.registry.addToggleButton("image",{icon:"image",tooltip:"Insert/edit image",onAction:it(e).open,onSetup:function(t){return t.setActive(d(be(e))),e.selection.selectorChangedWithUnbind("img:not([data-mce-object],[data-mce-placeholder]),figure.image",t.setActive).unbind}}),e.ui.registry.addMenuItem("image",{icon:"image",text:"Image...",onAction:it(e).open}),e.ui.registry.addContextMenu("image",{update:function(e){return ce(e)||"IMG"===e.nodeName&&!W(e)?["image"]:[]}})}(e),function(e){e.addCommand("mceImage",it(e).open),e.addCommand("mceUpdateImage",(function(t,n){e.undoManager.transact((function(){return Ce(e,n)}))}))}(e)}))}(),function(){"use strict";var e,t,n,r=function(e){var t=e;return{get:function(){return t},set:function(e){t=e}}},o=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=tinymce.util.Tools.resolve("tinymce.util.Tools"),a=(e="array",function(t){return r=typeof(n=t),(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)===e;var n,r}),u=function(e){return!function(e){return null==e}(e)},c=function(e){return function(t){return typeof t===e}}("function"),s=function(){},l=function(e){return function(){return e}},f=function(e){return e},d=l(!1),m=l(!0),g=function(){return p},p={fold:function(e,t){return e()},isSome:d,isNone:m,getOr:n=f,getOrThunk:t=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:l(null),getOrUndefined:l(void 0),or:n,orThunk:t,map:g,each:s,bind:g,exists:d,forall:m,filter:function(){return g()},toArray:function(){return[]},toString:l("none()")},h=function(e){var t=l(e),n=function(){return o},r=function(t){return t(e)},o={fold:function(t,n){return n(e)},isSome:m,isNone:d,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:n,orThunk:n,map:function(t){return h(t(e))},each:function(t){t(e)},bind:r,exists:r,forall:r,filter:function(t){return t(e)?o:p},toArray:function(){return[e]},toString:function(){return"some("+e+")"}};return o},v={some:h,none:g,from:function(e){return null==e?p:h(e)}},b={},y={exports:b};!function(e,t,n,r){!function(r,o){"object"==typeof t&&void 0!==n?n.exports=o():"function"==typeof e&&e.amd?e(o):(r="undefined"!=typeof globalThis?globalThis:r||self).EphoxContactWrapper=o()}(this,(function(){var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t={exports:{}};!function(t){!function(e){var n=setTimeout;function r(){}function o(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],l(e,this)}function i(e,t){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,o._immediateFn((function(){var n=1===e._state?t.onFulfilled:t.onRejected;if(null!==n){var r;try{r=n(e._value)}catch(e){return void u(t.promise,e)}a(t.promise,r)}else(1===e._state?a:u)(t.promise,e._value)}))):e._deferreds.push(t)}function a(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if(t instanceof o)return e._state=3,e._value=t,void c(e);if("function"==typeof n)return void l((r=n,i=t,function(){r.apply(i,arguments)}),e)}e._state=1,e._value=t,c(e)}catch(t){u(e,t)}var r,i}function u(e,t){e._state=2,e._value=t,c(e)}function c(e){2===e._state&&0===e._deferreds.length&&o._immediateFn((function(){e._handled||o._unhandledRejectionFn(e._value)}));for(var t=0,n=e._deferreds.length;t<n;t++)i(e,e._deferreds[t]);e._deferreds=null}function s(e,t,n){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=n}function l(e,t){var n=!1;try{e((function(e){n||(n=!0,a(t,e))}),(function(e){n||(n=!0,u(t,e))}))}catch(e){if(n)return;n=!0,u(t,e)}}o.prototype.catch=function(e){return this.then(null,e)},o.prototype.then=function(e,t){var n=new this.constructor(r);return i(this,new s(e,t,n)),n},o.all=function(e){var t=Array.prototype.slice.call(e);return new o((function(e,n){if(0===t.length)return e([]);var r=t.length;function o(i,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var u=a.then;if("function"==typeof u)return void u.call(a,(function(e){o(i,e)}),n)}t[i]=a,0==--r&&e(t)}catch(e){n(e)}}for(var i=0;i<t.length;i++)o(i,t[i])}))},o.resolve=function(e){return e&&"object"==typeof e&&e.constructor===o?e:new o((function(t){t(e)}))},o.reject=function(e){return new o((function(t,n){n(e)}))},o.race=function(e){return new o((function(t,n){for(var r=0,o=e.length;r<o;r++)e[r].then(t,n)}))},o._immediateFn="function"==typeof setImmediate?function(e){setImmediate(e)}:function(e){n(e,0)},o._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)},o._setImmediateFn=function(e){o._immediateFn=e},o._setUnhandledRejectionFn=function(e){o._unhandledRejectionFn=e},t.exports?t.exports=o:e.Promise||(e.Promise=o)}(e)}(t);var n=t.exports;return{boltExport:("undefined"!=typeof window?window:Function("return this;")()).Promise||n}}))}(void 0,b,y);var w=y.exports.boltExport,x=function(e,t){return k(document.createElement("canvas"),e,t)},C=function(e){var t=x(e.width,e.height);return S(t).drawImage(e,0,0),t},S=function(e){return e.getContext("2d")},k=function(e,t,n){return e.width=t,e.height=n,e},T=function(e){return new w((function(t,n){var r=URL.createObjectURL(e),o=new Image,i=function(){o.removeEventListener("load",a),o.removeEventListener("error",u)},a=function(){i(),t(o)},u=function(){i(),n("Unable to load data of type "+e.type+": "+r)};o.addEventListener("load",a),o.addEventListener("error",u),o.src=r,o.complete&&setTimeout(a,0)}))},O=function(e){return new w((function(t,n){var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="blob",r.onload=function(){200===this.status&&t(this.response)},r.onerror=function(){var e,t=this;n(0===this.status?((e=new Error("No access to download image")).code=18,e.name="SecurityError",e):new Error("Error "+t.status+" downloading image"))},r.send()}))},_=function(e){return new w((function(t,n){(function(e){var t=e.split(","),n=/data:([^;]+)/.exec(t[0]);if(!n)return v.none();for(var r=n[1],o=t[1],i=1024,a=atob(o),u=a.length,c=Math.ceil(u/i),s=new Array(c),l=0;l<c;++l){for(var f=l*i,d=Math.min(f+i,u),m=new Array(d-f),g=f,p=0;g<d;++p,++g)m[p]=a[g].charCodeAt(0);s[l]=new Uint8Array(m)}return v.some(new Blob(s,{type:r}))})(e).fold((function(){n("uri is not base64: "+e)}),t)}))},E=function(e,t,n){return t=t||"image/png",c(HTMLCanvasElement.prototype.toBlob)?new w((function(r,o){e.toBlob((function(e){e?r(e):o()}),t,n)})):_(e.toDataURL(t,n))},A=function(e){URL.revokeObjectURL(e.src)},D=function(e){return function(e){var t=e.src;return 0===t.indexOf("data:")?_(t):O(t)}(e)},M=Array.prototype.indexOf,N=function(e,t){return n=e,r=t,M.call(n,r)>-1;var n,r},R=function(e,t){for(var n=0,r=e.length;n<r;n++){t(e[n],n)}},z=function(e,t){return function(e,t,n){for(var r=0,o=e.length;r<o;r++){var i=e[r];if(t(i,r))return v.some(i);if(n(i,r))break}return v.none()}(e,t,d)},B=function(e,t){for(var n=0,r=e.length;n<r;++n){if(!0!==t(e[n],n))return!1}return!0},P=Object.keys,I=function(e){if(!a(e))throw new Error("cases must be an array");if(0===e.length)throw new Error("there must be at least one case");var t=[],n={};return R(e,(function(r,o){var i=P(r);if(1!==i.length)throw new Error("one and only one name per case");var u=i[0],c=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(!a(c))throw new Error("case arguments must be an array");t.push(u),n[u]=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 "+u+". Expected "+c.length+" ("+c+"), got "+i);var a=function(e){var r=P(e);if(t.length!==r.length)throw new Error("Wrong number of arguments to match. Expected: "+t.join(",")+"\nActual: "+r.join(","));if(!B(t,(function(e){return N(r,e)})))throw new Error("Not all branches were specified when using match. Specified: "+r.join(", ")+"\nRequired: "+t.join(", "));return e[u].apply(null,n)};return{fold:function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];if(t.length!==e.length)throw new Error("Wrong number of arguments to fold. Expected "+e.length+", got "+t.length);var i=t[o];return i.apply(null,n)},match:a,log:function(e){console.log(e,{constructors:t,constructor:u,params:n})}}}})),n};I([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);var F=function(e,t,n){var r=t.type,o=l(r),i=l(n),a=function(t,n){return e.then((function(e){return function(e,t,n){return t=t||"image/png",e.toDataURL(t,n)}(e,t,n)}))};return{getType:o,toBlob:function(){return w.resolve(t)},toDataURL:i,toBase64:function(){return n.split(",")[1]},toAdjustedBlob:function(t,n){return e.then((function(e){return E(e,t,n)}))},toAdjustedDataURL:a,toAdjustedBase64:function(e,t){return a(e,t).then((function(e){return e.split(",")[1]}))},toCanvas:function(){return e.then(C)}}},L=function(e){return function(e){return new w((function(t){var n=new FileReader;n.onloadend=function(){t(n.result)},n.readAsDataURL(e)}))}(e).then((function(t){return F(function(e){return T(e).then((function(e){A(e);var t=x(function(e){return e.naturalWidth||e.width}(e),function(e){return e.naturalHeight||e.height}(e));return S(t).drawImage(e,0,0),t}))}(e),e,t)}))},H=function(e,t){return E(e,t).then((function(t){return F(w.resolve(e),t,e.toDataURL())}))},V=function(e,t){void 0===t&&(t=2);var n=Math.pow(10,t),r=Math.round(e*n);return Math.ceil(r/n)},j=function(e,t,n){var r=(n<0?360+n:n)*Math.PI/180,o=e.width,i=e.height,a=Math.sin(r),u=Math.cos(r),c=V(Math.abs(o*u)+Math.abs(i*a)),s=V(Math.abs(o*a)+Math.abs(i*u)),l=x(c,s),f=S(l);return f.translate(c/2,s/2),f.rotate(r),f.drawImage(e,-o/2,-i/2),H(l,t)},U=function(e,t,n){var r=x(e.width,e.height),o=S(r);return"v"===n?(o.scale(1,-1),o.drawImage(e,0,-r.height)):(o.scale(-1,1),o.drawImage(e,-r.width,0)),H(r,t)},W=function(e,t){return function(e,t){return e.toCanvas().then((function(n){return U(n,e.getType(),t)}))}(e,t)},$=function(e,t){return function(e,t){return e.toCanvas().then((function(n){return j(n,e.getType(),t)}))}(e,t)},q=function(e,t,n){return void 0===n&&(n=!1),new w((function(r){var o=new XMLHttpRequest;o.onreadystatechange=function(){4===o.readyState&&r({status:o.status,blob:o.response})},o.open("GET",e,!0),o.withCredentials=n,function(e,t){for(var n=P(e),r=0,o=n.length;r<o;r++){var i=n[r];t(e[i],i)}}(t,(function(e,t){o.setRequestHeader(t,e)})),o.responseType="blob",o.send()}))},G=[{code:404,message:"Could not find Image Proxy"},{code:403,message:"Rejected request"},{code:0,message:"Incorrect Image Proxy URL"}],K=[{type:"not_found",message:"Failed to load image."},{type:"key_missing",message:"The request did not include an api key."},{type:"key_not_found",message:"The provided api key could not be found."},{type:"domain_not_trusted",message:"The api key is not valid for the request origins."}],X=function(e,t){var n,r,o=(n=function(e,t){return u(e)?e[t]:void 0},r=e,R(t,(function(e,t){r=n(r,e,t)})),r);return v.from(o)},Y=function(e){var t=function(e){return"ImageProxy HTTP error: "+z(G,(function(t){return e===t.code})).fold(l("Unknown ImageProxy error"),(function(e){return e.message}))}(e);return w.reject(t)},J=function(e){return z(K,(function(t){return t.type===e})).fold(l("Unknown service error"),(function(e){return e.message}))},Z=function(e){var t=function(e){try{return v.some(JSON.parse(e))}catch(e){return v.none()}}(e);return"ImageProxy Service error: "+t.bind((function(e){return X(e,["error","type"]).map(J)})).getOr("Invalid JSON in service error message")},Q=function(e){return function(e){return new w((function(t,n){var r=new FileReader;r.onload=function(){t(r.result)},r.onerror=function(e){n(e)},r.readAsText(e)}))}(e).then((function(e){var t=Z(e);return w.reject(t)}))},ee=function(e){return e<200||e>=300},te=function(e,t){var n={"Content-Type":"application/json;charset=UTF-8","tiny-api-key":t};return q(function(e,t){var n=-1===e.indexOf("?")?"?":"&";return/[?&]apiKey=/.test(e)?e:e+n+"apiKey="+encodeURIComponent(t)}(e,t),n).then((function(e){return ee(e.status)?(t=e.status,n=e.blob,function(e,t){return"application/json"===(null==t?void 0:t.type)&&(400===e||403===e||404===e||500===e)}(t,n)?Q(n):Y(t)):w.resolve(e.blob);var t,n}))},ne=function(e,t,n){return void 0===n&&(n=!1),t?te(e,t):function(e,t){return q(e,{},t).then((function(e){return ee(e.status)?Y(e.status):w.resolve(e.blob)}))}(e,n)},re=function(e){return L(e)},oe=function(e){if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}},ie={fromHtml:function(e,t){var n=(t||document).createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return oe(n.childNodes[0])},fromTag:function(e,t){var n=(t||document).createElement(e);return oe(n)},fromText:function(e,t){var n=(t||document).createTextNode(e);return oe(n)},fromDom:oe,fromPoint:function(e,t,n){return v.from(e.dom.elementFromPoint(t,n)).map(oe)}};"undefined"!=typeof window?window:Function("return this;")();var ae=function(e,t){return function(e,t){return z(e.dom.childNodes,(function(e){return t(ie.fromDom(e))})).map(ie.fromDom)}(e,(function(e){return function(e,t){var n=e.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(t);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(t);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(t);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")}(e,t)}))},ue=tinymce.util.Tools.resolve("tinymce.util.Delay"),ce=tinymce.util.Tools.resolve("tinymce.util.Promise"),se=tinymce.util.Tools.resolve("tinymce.util.URI"),le=function(e){return e.getParam("imagetools_toolbar","rotateleft rotateright flipv fliph editimage imageoptions")},fe=function(e){return e.getParam("imagetools_proxy")},de=function(e){var t,n,r=function(e){return/^[0-9\.]+px$/.test(e)};return t=e.style.width,n=e.style.height,t||n?r(t)&&r(n)?{w:parseInt(t,10),h:parseInt(n,10)}:null:(t=e.width,n=e.height,t&&n?{w:parseInt(t,10),h:parseInt(n,10)}:null)},me=function(e){return{w:e.naturalWidth,h:e.naturalHeight}},ge=0,pe=function(e){return ae(ie.fromDom(e),"img")},he=function(e,t){return e.dom.is(t,"figure")},ve=function(e,t){return e.dom.is(t,"img:not([data-mce-object],[data-mce-placeholder])")},be=function(e,t){var n=function(t){return ve(e,t)&&(Ce(e,t)||Se(e,t)||u(fe(e)))};return he(e,t)?pe(t).bind((function(e){return n(e.dom)?v.some(e.dom):v.none()})):n(t)?v.some(t):v.none()},ye=function(e,t){e.notificationManager.open({text:t,type:"error"})},we=function(e){var t=e.selection.getNode(),n=e.dom.getParent(t,"figure.image");return null!==n&&he(e,n)?pe(n):ve(e,t)?v.some(ie.fromDom(t)):v.none()},xe=function(e,t,n){var r=t.match(/(?:\/|^)(([^\/\?]+)\.(?:[a-z0-9.]+))(?:\?|$)/i);return u(r)?e.dom.encode(r[n]):null},Ce=function(e,t){var n=t.src;return 0===n.indexOf("data:")||0===n.indexOf("blob:")||new se(n).host===e.documentBaseURI.host},Se=function(e,t){return-1!==i.inArray(function(e){return e.getParam("imagetools_cors_hosts",[],"string[]")}(e),new se(t.src).host)},ke=function(e,t){if(Se(e,t))return ne(t.src,null,function(e,t){return-1!==i.inArray(function(e){return e.getParam("imagetools_credentials_hosts",[],"string[]")}(e),new se(t.src).host)}(e,t));if(!Ce(e,t)){var n=fe(e),r=n+(-1===n.indexOf("?")?"?":"&")+"url="+encodeURIComponent(t.src),o=function(e){return e.getParam("api_key",e.getParam("imagetools_api_key","","string"),"string")}(e);return ne(r,o,!1)}return D(t)},Te=function(e,t){return function(e){return v.from(e.getParam("imagetools_fetch_image",null,"function"))}(e).fold((function(){return ke(e,t)}),(function(e){return e(t)}))},Oe=function(e,t){var n=e.editorUpload.blobCache.getByUri(t.src);return n?ce.resolve(n.blob()):Te(e,t)},_e=function(e){ue.clearTimeout(e.get())},Ee=function(e,t,n,r,o,i,a){return n.toBlob().then((function(c){var s,l,f,d,m=e.editorUpload.blobCache;s=i.src;var g=t.type===c.type;return function(e){return e.getParam("images_reuse_filename",!1,"boolean")}(e)&&(d=m.getByUri(s),u(d)?(s=d.uri(),l=d.name(),f=d.filename()):(l=xe(e,s,2),f=xe(e,s,1))),d=m.create({id:"imagetools"+ge++,blob:c,base64:n.toBase64(),uri:s,name:l,filename:g?f:void 0}),m.add(d),e.undoManager.transact((function(){var t=function(){e.$(i).off("load",t),e.nodeChanged(),r?e.editorUpload.uploadImagesAuto():(_e(o),function(e,t){var n=ue.setEditorTimeout(e,(function(){e.editorUpload.uploadImagesAuto()}),function(e){return e.getParam("images_upload_timeout",3e4,"number")}(e));t.set(n)}(e,o))};e.$(i).on("load",t),a&&e.$(i).attr({width:a.w,height:a.h}),e.$(i).attr({src:d.blobUri()}).removeAttr("data-mce-src")})),d}))},Ae=function(e,t,n,r){return function(){return we(e).fold((function(){ye(e,"Could not find selected image")}),(function(o){return e._scanForImages().then((function(){return Oe(e,o.dom)})).then((function(i){return re(i).then(n).then((function(n){return Ee(e,i,n,!1,t,o.dom,r)}))})).catch((function(t){ye(e,t)}))}))}},De=function(e,t,n){return function(){var r=we(e).map((function(e){var t=de(e.dom);return t?{w:t.h,h:t.w}:null})).getOrNull();return Ae(e,t,(function(e){return $(e,n)}),r)()}},Me=function(e,t,n){return function(){return Ae(e,t,(function(e){return W(e,n)}))()}},Ne=function(e,t,n,r,o){return function(e){return T(e)}(o).then((function(e){var t=me(e);return r.w===t.w&&r.h===t.h||de(n)&&function(e,t){var n,r;t&&(n=e.style.width,r=e.style.height,(n||r)&&(e.style.width=t.w+"px",e.style.height=t.h+"px",e.removeAttribute("data-mce-style")),n=e.width,r=e.height,(n||r)&&(e.setAttribute("width",String(t.w)),e.setAttribute("height",String(t.h))))}(n,t),URL.revokeObjectURL(e.src),o})).then(re).then((function(r){return Ee(e,o,r,!0,t,n)}))},Re=function(e,t){return function(){var n=we(e),r=n.map((function(e){return me(e.dom)}));n.each((function(o){be(e,o.dom).each((function(i){Oe(e,o.dom).then((function(o){var i=function(e){return{blob:e,url:URL.createObjectURL(e)}}(o);e.windowManager.open({title:"Edit Image",size:"large",body:{type:"panel",items:[{type:"imagetools",name:"imagetools",label:"Edit Image",currentState:i}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0,disabled:!0}],onSubmit:function(o){var i=o.getData().imagetools.blob;n.each((function(n){r.each((function(r){Ne(e,t,n.dom,r,i)}))})),o.close()},onCancel:s,onAction:function(e,t){switch(t.name){case"save-state":t.value?e.enable("save"):e.disable("save");break;case"disable":e.disable("save"),e.disable("cancel");break;case"enable":e.enable("cancel")}}})}))}))}))}};o.add("imagetools",(function(e){var t=r(0),n=r(null);!function(e,t){i.each({mceImageRotateLeft:De(e,t,-90),mceImageRotateRight:De(e,t,90),mceImageFlipVertical:Me(e,t,"v"),mceImageFlipHorizontal:Me(e,t,"h"),mceEditImage:Re(e,t)},(function(t,n){e.addCommand(n,t)}))}(e,t),function(e){var t=[],n=function(t){return function(){return e.execCommand(t)}},r=function(){return we(e).exists((function(t){return be(e,t.dom).isSome()}))},o=function(e){var n=function(t){return e.setDisabled(!t)};return n(r()),t=t.concat([n]),function(){t=function(e,t){for(var n=[],r=0,o=e.length;r<o;r++){var i=e[r];t(i,r)&&n.push(i)}return n}(t,(function(e){return e!==n}))}};e.on("NodeChange",(function(){var e=r();R(t,(function(t){return t(e)}))})),e.ui.registry.addButton("rotateleft",{tooltip:"Rotate counterclockwise",icon:"rotate-left",onAction:n("mceImageRotateLeft"),onSetup:o}),e.ui.registry.addButton("rotateright",{tooltip:"Rotate clockwise",icon:"rotate-right",onAction:n("mceImageRotateRight"),onSetup:o}),e.ui.registry.addButton("flipv",{tooltip:"Flip vertically",icon:"flip-vertically",onAction:n("mceImageFlipVertical"),onSetup:o}),e.ui.registry.addButton("fliph",{tooltip:"Flip horizontally",icon:"flip-horizontally",onAction:n("mceImageFlipHorizontal"),onSetup:o}),e.ui.registry.addButton("editimage",{tooltip:"Edit image",icon:"edit-image",onAction:n("mceEditImage"),onSetup:o}),e.ui.registry.addButton("imageoptions",{tooltip:"Image options",icon:"image",onAction:n("mceImage")}),e.ui.registry.addContextMenu("imagetools",{update:function(t){return be(e,t).map((function(e){return{text:"Edit image",icon:"edit-image",onAction:n("mceEditImage")}})).toArray()}})}(e),function(e){e.ui.registry.addContextToolbar("imagetools",{items:le(e),predicate:function(t){return be(e,t).isSome()},position:"node",scope:"node"})}(e),function(e,t,n){e.on("NodeChange",(function(r){var o=n.get(),i=be(e,r.element);o&&!i.exists((function(e){return o.src===e.src}))&&(_e(t),e.editorUpload.uploadImagesAuto(),n.set(null)),i.each(n.set)}))}(e,t,n)}))}(),function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=function(e){return function(t){return r=typeof(n=t),(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)===e;var n,r}},n=t("string"),r=t("array"),o=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),i=tinymce.util.Tools.resolve("tinymce.EditorManager"),a=tinymce.util.Tools.resolve("tinymce.Env"),u=tinymce.util.Tools.resolve("tinymce.util.Tools"),c=function(e){return e.getParam("importcss_selector_converter")},s=function(e){return e.getParam("importcss_append")},l=Array.prototype.push,f=function(e,t){return function(e){for(var t=[],n=0,o=e.length;n<o;++n){if(!r(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);l.apply(t,e[n])}return t}(function(e,t){for(var n=e.length,r=new Array(n),o=0;o<n;o++){var i=e[o];r[o]=t(i,o)}return r}(e,t))},d=function(e){return n(e)?function(t){return-1!==t.indexOf(e)}:e instanceof RegExp?function(t){return e.test(t)}:e},m=function(e,t,r){var o=[],c={},s=function(t,c){var l,f,d,m=t.href;if(f=m,d=a.cacheSuffix,n(f)&&(f=f.replace("?"+d,"").replace("&"+d,"")),(m=f)&&r(m,c)&&!function(e,t){var n=function(e){var t=e.getParam("skin");return!1!==t&&(t||"oxide")}(e);if(n){var r=function(e){return e.getParam("skin_url")}(e),o=r?e.documentBaseURI.toAbsolute(r):i.baseURL+"/skins/ui/"+n,a=i.baseURL+"/skins/content/";return t===o+"/content"+(e.inline?".inline":"")+".min.css"||-1!==t.indexOf(a)}return!1}(e,m)){u.each(t.imports,(function(e){s(e,!0)}));try{l=t.cssRules||t.rules}catch(e){}u.each(l,(function(e){e.styleSheet?s(e.styleSheet,!0):function(e){return e.selectorText}(e)&&u.each(e.selectorText.split(","),(function(e){o.push(u.trim(e))}))}))}};u.each(e.contentCSS,(function(e){c[e]=!0})),r||(r=function(e,t){return t||c[e]});try{u.each(t.styleSheets,(function(e){s(e)}))}catch(e){}return o},g=function(e,t){var n,r=/^(?:([a-z0-9\-_]+))?(\.[a-z0-9_\-\.]+)$/i.exec(t);if(r){var o=r[1],i=r[2].substr(1).split(".").join(" "),a=u.makeMap("a,img");return r[1]?(n={title:t},e.schema.getTextBlockElements()[o]?n.block=o:e.schema.getBlockElements()[o]||a[o.toLowerCase()]?n.selector=o:n.inline=o):r[2]&&(n={inline:"span",title:t.substr(1),classes:i}),!1!==function(e){return e.getParam("importcss_merge_classes")}(e)?n.classes=i:n.attributes={class:i},n}},p=function(e,t){return null===t||!1!==function(e){return e.getParam("importcss_exclusive")}(e)},h=function(e){e.on("init",(function(){var t=function(){var e=[],t=[],n={};return{addItemToGroup:function(e,r){n[e]?n[e].push(r):(t.push(e),n[e]=[r])},addItem:function(t){e.push(t)},toFormats:function(){return f(t,(function(e){var t=n[e];return 0===t.length?[]:[{title:e,items:t}]})).concat(e)}}}(),n={},r=d(function(e){return e.getParam("importcss_selector_filter")}(e)),i=function(e){return u.map(e,(function(e){return u.extend({},e,{original:e,selectors:{},filter:d(e.filter)})}))}(function(e){return e.getParam("importcss_groups")}(e)),a=function(t,r){if(function(e,t,n,r){return!(p(e,n)?t in r:t in n.selectors)}(e,t,r,n)){!function(e,t,n,r){p(e,n)?r[t]=!0:n.selectors[t]=!0}(e,t,r,n);var i=function(e,t,n,r){return(r&&r.selector_converter?r.selector_converter:c(e)?c(e):function(){return g(e,n)}).call(t,n,r)}(e,e.plugins.importcss,t,r);if(i){var a=i.name||o.DOM.uniqueId();return e.formatter.register(a,i),{title:i.title,format:a}}}return null};u.each(m(e,e.getDoc(),d(function(e){return e.getParam("importcss_file_filter")}(e))),(function(e){if(-1===e.indexOf(".mce-")&&(!r||r(e))){var n=function(e,t){return u.grep(e,(function(e){return!e.filter||e.filter(t)}))}(i,e);if(n.length>0)u.each(n,(function(n){var r=a(e,n);r&&t.addItemToGroup(n.title,r)}));else{var o=a(e,null);o&&t.addItem(o)}}}));var l=t.toFormats();e.fire("addStyleModifications",{items:l,replace:!s(e)})}))};e.add("importcss",(function(e){return h(e),function(e){return{convertSelectorToFormat:function(t){return g(e,t)}}}(e)}))}(),function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=function(e){return e.getParam("insertdatetime_timeformat",e.translate("%H:%M:%S"))},n=function(e){return e.getParam("insertdatetime_formats",["%H:%M:%S","%Y-%m-%d","%I:%M:%S %p","%D"])},r="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),o="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),i="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),a="January February March April May June July August September October November December".split(" "),u=function(e,t){if((e=""+e).length<t)for(var n=0;n<t-e.length;n++)e="0"+e;return e},c=function(e,t,n){return void 0===n&&(n=new Date),t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace("%D","%m/%d/%Y")).replace("%r","%I:%M:%S %p")).replace("%Y",""+n.getFullYear())).replace("%y",""+n.getYear())).replace("%m",u(n.getMonth()+1,2))).replace("%d",u(n.getDate(),2))).replace("%H",""+u(n.getHours(),2))).replace("%M",""+u(n.getMinutes(),2))).replace("%S",""+u(n.getSeconds(),2))).replace("%I",""+((n.getHours()+11)%12+1))).replace("%p",n.getHours()<12?"AM":"PM")).replace("%B",""+e.translate(a[n.getMonth()]))).replace("%b",""+e.translate(i[n.getMonth()]))).replace("%A",""+e.translate(o[n.getDay()]))).replace("%a",""+e.translate(r[n.getDay()]))).replace("%%","%")},s=function(e,t){if(function(e){return e.getParam("insertdatetime_element",!1)}(e)){var n=c(e,t),r=void 0;r=/%[HMSIp]/.test(t)?c(e,"%Y-%m-%dT%H:%M"):c(e,"%Y-%m-%d");var o=e.dom.getParent(e.selection.getStart(),"time");o?function(e,t,n,r){var o=e.dom.create("time",{datetime:n},r);t.parentNode.insertBefore(o,t),e.dom.remove(t),e.selection.select(o,!0),e.selection.collapse(!1)}(e,o,r,n):e.insertContent('<time datetime="'+r+'">'+n+"</time>")}else e.insertContent(c(e,t))},l=tinymce.util.Tools.resolve("tinymce.util.Tools"),f=function(e){var r,o,i=n(e),a=(r=function(e){var r=n(e);return r.length>0?r[0]:t(e)}(e),o=r,{get:function(){return o},set:function(e){o=e}}),u=function(t){return e.execCommand("mceInsertDate",!1,t)};e.ui.registry.addSplitButton("insertdatetime",{icon:"insert-time",tooltip:"Insert date/time",select:function(e){return e===a.get()},fetch:function(t){t(l.map(i,(function(t){return{type:"choiceitem",text:c(e,t),value:t}})))},onAction:function(e){u(a.get())},onItemAction:function(e,t){a.set(t),u(t)}});var s=function(e){return function(){a.set(e),u(e)}};e.ui.registry.addNestedMenuItem("insertdatetime",{icon:"insert-time",text:"Date/time",getSubmenuItems:function(){return l.map(i,(function(t){return{type:"menuitem",text:c(e,t),onAction:s(t)}}))}})};e.add("insertdatetime",(function(e){!function(e){e.addCommand("mceInsertDate",(function(t,n){s(e,null!=n?n:function(e){return e.getParam("insertdatetime_dateformat",e.translate("%Y-%m-%d"))}(e))})),e.addCommand("mceInsertTime",(function(n,r){s(e,null!=r?r:t(e))}))}(e),f(e)}))}(),function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.util.Tools"),n=function(e){!function(e){!function(e,t){e.settings.inline_styles=t}(e,!1),function(e){return e.getParam("fontsize_formats")}(e)||function(e,t){e.settings.fontsize_formats=t}(e,"8pt=1 10pt=2 12pt=3 14pt=4 18pt=5 24pt=6 36pt=7"),function(e){return e.getParam("font_formats")}(e)||function(e,t){e.settings.font_formats=t}(e,"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")}(e),e.on("PreInit",(function(){return function(e){var n="p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table",r=t.explode(function(e){return e.getParam("font_size_style_values","xx-small,x-small,small,medium,large,x-large,xx-large")}(e)),o=e.schema;e.formatter.register({alignleft:{selector:n,attributes:{align:"left"}},aligncenter:{selector:n,attributes:{align:"center"}},alignright:{selector:n,attributes:{align:"right"}},alignjustify:{selector:n,attributes:{align:"justify"}},bold:[{inline:"b",remove:"all",preserve_attributes:["class","style"]},{inline:"strong",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontWeight:"bold"}}],italic:[{inline:"i",remove:"all",preserve_attributes:["class","style"]},{inline:"em",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontStyle:"italic"}}],underline:[{inline:"u",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{textDecoration:"underline"},exact:!0}],strikethrough:[{inline:"strike",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{textDecoration:"line-through"},exact:!0}],fontname:{inline:"font",toggle:!1,attributes:{face:"%value"}},fontsize:{inline:"font",toggle:!1,attributes:{size:function(e){return String(t.inArray(r,e.value)+1)}}},forecolor:{inline:"font",attributes:{color:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},hilitecolor:{inline:"font",styles:{backgroundColor:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0}}),t.each("b,i,u,strike".split(","),(function(e){o.addValidElements(e+"[*]")})),o.getElementRule("font")||o.addValidElements("font[face|size|color|style]"),t.each(n.split(","),(function(e){var t=o.getElementRule(e);t&&(t.attributes.align||(t.attributes.align={},t.attributesOrder.push("align")))}))}(e)}))};e.add("legacyoutput",(function(e){n(e)}))}(),function(){"use strict";var e,t,n,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=tinymce.util.Tools.resolve("tinymce.util.VK"),i=function(e){return function(t){return r=typeof(n=t),(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)===e;var n,r}},a=function(e){return function(t){return typeof t===e}},u=i("string"),c=i("array"),s=(e=null,function(t){return e===t}),l=a("boolean"),f=a("function"),d=function(){},m=function(e){return function(){return e}},g=function(e){return e},p=function(e,t){return e===t},h=m(!1),v=m(!0),b=function(){return y},y={fold:function(e,t){return e()},isSome:h,isNone:v,getOr:n=g,getOrThunk:t=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:m(null),getOrUndefined:m(void 0),or:n,orThunk:t,map:b,each:d,bind:b,exists:h,forall:v,filter:function(){return b()},toArray:function(){return[]},toString:m("none()")},w=function(e){var t=m(e),n=function(){return o},r=function(t){return t(e)},o={fold:function(t,n){return n(e)},isSome:v,isNone:h,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:n,orThunk:n,map:function(t){return w(t(e))},each:function(t){t(e)},bind:r,exists:r,forall:r,filter:function(t){return t(e)?o:y},toArray:function(){return[e]},toString:function(){return"some("+e+")"}};return o},x={some:w,none:b,from:function(e){return null==e?y:w(e)}},C=Array.prototype.indexOf,S=Array.prototype.push,k=function(e,t){return function(e,t){return C.call(e,t)}(e,t)>-1},T=function(e){for(var t=[],n=0,r=e.length;n<r;++n){if(!c(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);S.apply(t,e[n])}return t},O=function(e,t){return T(function(e,t){for(var n=e.length,r=new Array(n),o=0;o<n;o++){var i=e[o];r[o]=t(i,o)}return r}(e,t))},_=function(e,t){for(var n=0;n<e.length;n++){var r=t(e[n],n);if(r.isSome())return r}return x.none()},E=function(e,t,n){return void 0===n&&(n=p),e.exists((function(e){return n(e,t)}))},A=function(e){for(var t=[],n=function(e){t.push(e)},r=0;r<e.length;r++)e[r].each(n);return t},D=function(e,t){return e?x.some(t):x.none()},M=function(e){var t=e.getParam("link_assume_external_targets",!1);return l(t)&&t?1:!u(t)||"http"!==t&&"https"!==t?0:t},N=function(e){return e.getParam("default_link_target")},R=function(e){return e.getParam("target_list",!0)},z=function(e){return e.getParam("rel_list",[],"array")},B=function(e){return e.getParam("link_title",!0,"boolean")},P=function(e){return e.getParam("allow_unsafe_link_target",!1,"boolean")},I=function(e){return e.getParam("link_default_protocol","http","string")},F=tinymce.util.Tools.resolve("tinymce.util.Tools"),L=function(e){return u(e.value)?e.value:""},H=function(e,t){var n=[];return F.each(e,(function(e){var r=function(e){return u(e.text)?e.text:u(e.title)?e.title:""}(e);if(void 0!==e.menu){var o=H(e.menu,t);n.push({text:r,items:o})}else{var i=t(e);n.push({text:r,value:i})}})),n},V=function(e){return void 0===e&&(e=L),function(t){return x.from(t).map((function(t){return H(t,e)}))}},j={sanitize:function(e){return V(L)(e)},sanitizeWith:V,createUi:function(e,t){return function(n){return{name:e,type:"listbox",label:t,items:n}}},getValue:L},U=function(){return U=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},U.apply(this,arguments)},W=Object.keys,$=Object.hasOwnProperty,q=function(e,t,n,r){return function(e,t){for(var n=W(e),r=0,o=n.length;r<o;r++){var i=n[r];t(e[i],i)}}(e,(function(e,o){(t(e,o)?n:r)(e,o)})),{}},G=function(e,t){return $.call(e,t)},K=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),X=tinymce.util.Tools.resolve("tinymce.util.URI"),Y=function(e){return e&&"a"===e.nodeName.toLowerCase()},J=function(e){return Y(e)&&!!ee(e)},Z=function(e,t){if(e.collapsed)return[];var n=e.cloneContents(),r=new K(n.firstChild,n),o=[],i=n.firstChild;do{t(i)&&o.push(i)}while(i=r.next());return o},Q=function(e){return/^\w+:/i.test(e)},ee=function(e){var t=e.getAttribute("data-mce-href");return t||e.getAttribute("href")},te=function(e,t){var n=["noopener"],r=e?e.split(/\s+/):[],o=function(e){return e.filter((function(e){return-1===F.inArray(n,e)}))},i=t?function(e){return(e=o(e)).length>0?e.concat(n):n}(r):o(r);return i.length>0?function(e){return F.trim(e.sort().join(" "))}(i):""},ne=function(e,t){return t=t||e.selection.getNode(),ae(t)?e.dom.select("a[href]",t)[0]:e.dom.getParent(t,"a[href]")},re=function(e,t){return function(e){return e.replace(/\uFEFF/g,"")}(t?t.innerText||t.textContent:e.getContent({format:"text"}))},oe=function(e){return F.grep(e,J).length>0},ie=function(e){var t=e.schema.getTextInlineElements();return 0===Z(e.selection.getRng(),(function(e){return 1===e.nodeType&&!Y(e)&&!G(t,e.nodeName.toLowerCase())})).length},ae=function(e){return e&&"FIGURE"===e.nodeName&&/\bimage\b/i.test(e.className)},ue=function(e,t){var n=U({},t);if(!(z(e).length>0)&&!1===P(e)){var r=te(n.rel,"_blank"===n.target);n.rel=r||null}return x.from(n.target).isNone()&&!1===R(e)&&(n.target=N(e)),n.href=function(e,t){return"http"!==t&&"https"!==t||Q(e)?e:t+"://"+e}(n.href,M(e)),n},ce=function(e,t,n){var r=e.selection.getNode(),o=ne(e,r),i=ue(e,function(e){var t,n,r;return t=["title","rel","class","target"],n=function(t,n){return e[n].each((function(e){t[n]=e.length>0?e:null})),t},r={href:e.href},function(e,t){for(var n=0,r=e.length;n<r;n++)t(e[n],n)}(t,(function(e,t){r=n(r,e,t)})),r}(n));e.undoManager.transact((function(){n.href===t.href&&t.attach(),o?(e.focus(),function(e,t,n,r){n.each((function(e){G(t,"innerText")?t.innerText=e:t.textContent=e})),e.dom.setAttribs(t,r),e.selection.select(t)}(e,o,n.text,i)):function(e,t,n,r){ae(t)?me(e,t,r):n.fold((function(){e.execCommand("mceInsertLink",!1,r)}),(function(t){e.insertContent(e.dom.createHTML("a",r,e.dom.encode(t)))}))}(e,r,n.text,i)}))},se=function(e){var t=e.class,n=e.href,r=e.rel,o=e.target,i=e.text,a=e.title;return function(e,t){var n,r={};return q(e,t,(n=r,function(e,t){n[t]=e}),d),r}({class:t.getOrNull(),href:n,rel:r.getOrNull(),target:o.getOrNull(),text:i.getOrNull(),title:a.getOrNull()},(function(e,t){return!1===s(e)}))},le=function(e,t,n){var r=function(e,t){var n=t.href;return U(U({},t),{href:X.isDomSafe(n,"a",e.settings)?n:""})}(e,n);e.hasPlugin("rtc",!0)?e.execCommand("createlink",!1,se(r)):ce(e,t,r)},fe=function(e){e.hasPlugin("rtc",!0)?e.execCommand("unlink"):function(e){e.undoManager.transact((function(){var t=e.selection.getNode();ae(t)?de(e,t):function(e){var t=e.dom,n=e.selection,r=n.getBookmark(),o=n.getRng().cloneRange(),i=t.getParent(o.startContainer,"a[href]",e.getBody()),a=t.getParent(o.endContainer,"a[href]",e.getBody());i&&o.setStartBefore(i),a&&o.setEndAfter(a),n.setRng(o),e.execCommand("unlink"),n.moveToBookmark(r)}(e),e.focus()}))}(e)},de=function(e,t){var n=e.dom.select("img",t)[0];if(n){var r=e.dom.getParents(n,"a[href]",t)[0];r&&(r.parentNode.insertBefore(n,r),e.dom.remove(r))}},me=function(e,t,n){var r=e.dom.select("img",t)[0];if(r){var o=e.dom.create("a",n);r.parentNode.insertBefore(o,r),o.appendChild(r)}},ge=function(e){return G(t=e,n="items")&&void 0!==t[n]&&null!==t[n];var t,n},pe=function(e,t){return _(t,(function(t){return ge(t)?pe(e,t.items):D(t.value===e,t)}))},he=function(e,t,n,r){var o=r[t],i=e.length>0;return void 0!==o?pe(o,n).map((function(t){return{url:{value:t.value,meta:{text:i?e:t.text,attach:d}},text:i?e:t.text}})):x.none()},ve=function(e,t){var n={text:e.text,title:e.title},r=function(e){var t,r=(t=e.url,D(n.text.length<=0,x.from(t.meta.text).getOr(t.value))),o=function(e){return D(n.title.length<=0,x.from(e.meta.title).getOr(""))}(e.url);return r.isSome()||o.isSome()?x.some(U(U({},r.map((function(e){return{text:e}})).getOr({})),o.map((function(e){return{title:e}})).getOr({}))):x.none()},o=function(e,r){var o,i,a=(o=t,i=r.name,"link"===i?o.link:"anchor"===i?o.anchor:x.none()).getOr([]);return he(n.text,r.name,a,e)};return{onChange:function(e,t){var i=t.name;return"url"===i?r(e()):k(["anchor","link"],i)?o(e(),t):"text"===i||"title"===i?(n[i]=e()[i],x.none()):x.none()}}},be=tinymce.util.Tools.resolve("tinymce.util.Delay"),ye=tinymce.util.Tools.resolve("tinymce.util.Promise"),we=function(e){var t=e.href;return t.indexOf("@")>0&&-1===t.indexOf("/")&&-1===t.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(e){return U(U({},e),{href:"mailto:"+t})}}):x.none()},xe=function(e,t){return function(n){var r=n.href;return 1===e&&!Q(r)||0===e&&/^\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 "+t+":// prefix?",preprocess:function(e){return U(U({},e),{href:t+"://"+r})}}):x.none()}},Ce=function(e,t){return _([we,xe(M(e),I(e))],(function(e){return e(t)})).fold((function(){return ye.resolve(t)}),(function(n){return new ye((function(r){!function(e,t,n){var r=e.selection.getRng();be.setEditorTimeout(e,(function(){e.windowManager.confirm(t,(function(t){e.selection.setRng(r),n(t)}))}))}(e,n.message,(function(e){r(e?n.preprocess(t):t)}))}))}))},Se=function(e){var t=e.dom.select("a:not([href])"),n=O(t,(function(e){var t=e.name||e.id;return t?[{text:t,value:"#"+t}]:[]}));return n.length>0?x.some([{text:"None",value:""}].concat(n)):x.none()},ke=function(e){var t=function(e){return e.getParam("link_class_list",[],"array")}(e);return t.length>0?j.sanitize(t):x.none()},Te=tinymce.util.Tools.resolve("tinymce.util.XHR"),Oe=function(e){var t=function(t){return e.convertURL(t.value||t.url,"href")},n=function(e){return e.getParam("link_list")}(e);return new ye((function(e){u(n)?Te.send({url:n,success:function(t){return e(function(e){try{return x.some(JSON.parse(e))}catch(e){return x.none()}}(t))},error:function(t){return e(x.none())}}):f(n)?n((function(t){return e(x.some(t))})):e(x.from(n))})).then((function(e){return e.bind(j.sanitizeWith(t)).map((function(e){if(e.length>0){return[{text:"None",value:""}].concat(e)}return e}))}))},_e=function(e,t){var n=z(e);if(n.length>0){var r=E(t,"_blank");return(!1===P(e)?j.sanitizeWith((function(e){return te(j.getValue(e),r)})):j.sanitize)(n)}return x.none()},Ee=[{text:"Current window",value:""},{text:"New window",value:"_blank"}],Ae=function(e){var t=R(e);return c(t)?j.sanitize(t).orThunk((function(){return x.some(Ee)})):!1===t?x.none():x.some(Ee)},De=function(e,t,n){var r=e.getAttrib(t,n);return null!==r&&r.length>0?x.some(r):x.none()},Me=function(e,t){return Oe(e).then((function(n){var r=function(e,t){var n=e.dom,r=ie(e)?x.some(re(e.selection,t)):x.none(),o=t?x.some(n.getAttrib(t,"href")):x.none(),i=t?x.from(n.getAttrib(t,"target")):x.none(),a=De(n,t,"rel"),u=De(n,t,"class");return{url:o,text:r,title:De(n,t,"title"),target:i,rel:a,linkClass:u}}(e,t);return{anchor:r,catalogs:{targets:Ae(e),rels:_e(e,r.target),classes:ke(e),anchor:Se(e),link:n},optNode:x.from(t),flags:{titleEnabled:B(e)}}}))},Ne=function(e){var t=function(e){var t=ne(e);return Me(e,t)}(e);t.then((function(t){var n=function(e,t){return function(n){var r=n.getData();if(!r.url.value)return fe(e),void n.close();var o=function(e){return x.from(r[e]).filter((function(n){return!E(t.anchor[e],n)}))},i={href:r.url.value,text:o("text"),target:o("target"),rel:o("rel"),class:o("linkClass"),title:o("title")},a={href:r.url.value,attach:void 0!==r.url.meta&&r.url.meta.attach?r.url.meta.attach:d};Ce(e,i).then((function(t){le(e,a,t)})),n.close()}}(e,t);return function(e,t,n){var r=e.anchor.text.map((function(){return{name:"text",type:"input",label:"Text to display"}})).toArray(),o=e.flags.titleEnabled?[{name:"title",type:"input",label:"Title"}]:[],i=function(e,t){var n=e.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(t).getOr(""),linkClass:n.linkClass.getOr("")}}(e,x.from(N(n))),a=e.catalogs,u=ve(i,a);return{title:"Insert/Edit Link",size:"normal",body:{type:"panel",items:T([[{name:"url",type:"urlinput",filetype:"file",label:"URL"}],r,o,A([a.anchor.map(j.createUi("anchor","Anchors")),a.rels.map(j.createUi("rel","Rel")),a.targets.map(j.createUi("target","Open link in...")),a.link.map(j.createUi("link","Link list")),a.classes.map(j.createUi("linkClass","Class"))])])},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:i,onChange:function(e,t){var n=t.name;u.onChange(e.getData,{name:n}).each((function(t){e.setData(t)}))},onSubmit:t}}(t,n,e)})).then((function(t){e.windowManager.open(t)}))},Re=function(e){var t=document.createElement("a");t.target="_blank",t.href=e,t.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(e,t){document.body.appendChild(e),e.dispatchEvent(t),document.body.removeChild(e)}(t,n)},ze=function(e,t){return e.dom.getParent(t,"a[href]")},Be=function(e){return ze(e,e.selection.getStart())},Pe=function(e,t){if(t){var n=ee(t);if(/^#/.test(n)){var r=e.$(n);r.length&&e.selection.scrollIntoView(r[0],!0)}else Re(t.href)}},Ie=function(e){return function(){Ne(e)}},Fe=function(e){return function(){Pe(e,Be(e))}},Le=function(e,t){return e.on("NodeChange",t),function(){return e.off("NodeChange",t)}},He=function(e){return function(t){var n=function(){return t.setActive(!e.mode.isReadOnly()&&null!==ne(e,e.selection.getNode()))};return n(),Le(e,n)}},Ve=function(e){return function(t){var n=function(){return t.setDisabled(null===ne(e,e.selection.getNode()))};return n(),Le(e,n)}},je=function(e){return function(t){var n=function(t){return oe(t)||(n=e.selection.getRng(),Z(n,J).length>0);var n},r=e.dom.getParents(e.selection.getStart());return t.setDisabled(!n(r)),Le(e,(function(e){return t.setDisabled(!n(e.parents))}))}},Ue=function(e){var t=function(t){var n=e.selection.getNode();return t.setDisabled(!ne(e,n)),d};e.ui.registry.addContextForm("quicklink",{launch:{type:"contextformtogglebutton",icon:"link",tooltip:"Link",onSetup:He(e)},label:"Link",predicate:function(t){return!!ne(e,t)&&function(e){return e.getParam("link_context_toolbar",!1,"boolean")}(e)},initValue:function(){var t=ne(e);return t?ee(t):""},commands:[{type:"contextformtogglebutton",icon:"link",tooltip:"Link",primary:!0,onSetup:function(t){var n=e.selection.getNode();return t.setActive(!!ne(e,n)),He(e)(t)},onAction:function(t){var n=t.getValue(),r=function(t){var n=ne(e),r=ie(e);if(!n&&r){var o=re(e.selection,n);return x.some(o.length>0?o:t)}return x.none()}(n);le(e,{href:n,attach:d},{href:n,text:r,title:x.none(),rel:x.none(),target:x.none(),class:x.none()}),function(e){e.selection.collapse(!1)}(e),t.hide()}},{type:"contextformbutton",icon:"unlink",tooltip:"Remove link",onSetup:t,onAction:function(t){fe(e),t.hide()}},{type:"contextformbutton",icon:"new-tab",tooltip:"Open link",onSetup:t,onAction:function(t){Fe(e)(),t.hide()}}]})};r.add("link",(function(e){!function(e){e.ui.registry.addToggleButton("link",{icon:"link",tooltip:"Insert/edit link",onAction:Ie(e),onSetup:He(e)}),e.ui.registry.addButton("openlink",{icon:"new-tab",tooltip:"Open link",onAction:Fe(e),onSetup:Ve(e)}),e.ui.registry.addButton("unlink",{icon:"unlink",tooltip:"Remove link",onAction:function(){return fe(e)},onSetup:je(e)})}(e),function(e){e.ui.registry.addMenuItem("openlink",{text:"Open link",icon:"new-tab",onAction:Fe(e),onSetup:Ve(e)}),e.ui.registry.addMenuItem("link",{icon:"link",text:"Link...",shortcut:"Meta+K",onAction:Ie(e)}),e.ui.registry.addMenuItem("unlink",{icon:"unlink",text:"Remove link",onAction:function(){return fe(e)},onSetup:je(e)})}(e),function(e){e.ui.registry.addContextMenu("link",{update:function(t){return oe(e.dom.getParents(t,"a"))?"link unlink openlink":"link"}})}(e),Ue(e),function(e){e.on("click",(function(t){var n=ze(e,t.target);n&&o.metaKeyPressed(t)&&(t.preventDefault(),Pe(e,n))})),e.on("keydown",(function(t){var n=Be(e);n&&13===t.keyCode&&function(e){return!0===e.altKey&&!1===e.shiftKey&&!1===e.ctrlKey&&!1===e.metaKey}(t)&&(t.preventDefault(),Pe(e,n))}))}(e),function(e){e.addCommand("mceLink",(function(){!function(e){return e.getParam("link_quicklink",!1,"boolean")}(e)?Ie(e)():e.fire("contexttoolbar-show",{toolbarKey:"quicklink"})}))}(e),function(e){e.addShortcut("Meta+K","",(function(){e.execCommand("mceLink")}))}(e)}))}(),function(){"use strict";var e,t,n=tinymce.util.Tools.resolve("tinymce.PluginManager"),r=function(e){return function(t){return r=typeof(n=t),(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)===e;var n,r}},o=function(e){return function(t){return typeof t===e}},i=r("string"),a=r("object"),u=r("array"),c=o("boolean"),s=o("function"),l=o("number"),f=function(){},d=function(e){return function(){return e}},m=function(e){return e},g=function(e,t){return e===t},p=function(e){return function(t){return!e(t)}},h=d(!1),v=d(!0),b=function(){return y},y={fold:function(e,t){return e()},isSome:h,isNone:v,getOr:t=m,getOrThunk:e=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:d(null),getOrUndefined:d(void 0),or:t,orThunk:e,map:b,each:f,bind:b,exists:h,forall:v,filter:function(){return b()},toArray:function(){return[]},toString:d("none()")},w=function(e){var t=d(e),n=function(){return o},r=function(t){return t(e)},o={fold:function(t,n){return n(e)},isSome:v,isNone:h,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:n,orThunk:n,map:function(t){return w(t(e))},each:function(t){t(e)},bind:r,exists:r,forall:r,filter:function(t){return t(e)?o:y},toArray:function(){return[e]},toString:function(){return"some("+e+")"}};return o},x={some:w,none:b,from:function(e){return null==e?y:w(e)}},C=Array.prototype.slice,S=Array.prototype.push,k=function(e,t){for(var n=e.length,r=new Array(n),o=0;o<n;o++){var i=e[o];r[o]=t(i,o)}return r},T=function(e,t){for(var n=0,r=e.length;n<r;n++){t(e[n],n)}},O=function(e,t){for(var n=[],r=0,o=e.length;r<o;r++){var i=e[r];t(i,r)&&n.push(i)}return n},_=function(e,t,n){return T(e,(function(e,r){n=t(n,e,r)})),n},E=function(e,t,n){for(var r=0,o=e.length;r<o;r++){var i=e[r];if(t(i,r))return x.some(i);if(n(i,r))break}return x.none()},A=function(e,t){return E(e,t,h)},D=function(e,t){return function(e){for(var t=[],n=0,r=e.length;n<r;++n){if(!u(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);S.apply(t,e[n])}return t}(k(e,t))},M=function(e){var t=C.call(e,0);return t.reverse(),t},N=function(e,t){return t>=0&&t<e.length?x.some(e[t]):x.none()},R=function(e){return N(e,0)},z=function(e){return N(e,e.length-1)},B=function(){return B=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},B.apply(this,arguments)};var P,I=function(){return F(0,0)},F=function(e,t){return{major:e,minor:t}},L={nu:F,detect:function(e,t){var n=String(t).toLowerCase();return 0===e.length?I():function(e,t){var n=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(r.test(t))return r}}(e,t);if(!n)return{major:0,minor:0};var r=function(e){return Number(t.replace(n,"$"+e))};return F(r(1),r(2))}(e,n)},unknown:I},H=function(e,t){return function(e,t){for(var n=0;n<e.length;n++){var r=t(e[n],n);if(r.isSome())return r}return x.none()}(t.brands,(function(t){var n=t.brand.toLowerCase();return A(e,(function(e){var t;return n===(null===(t=e.brand)||void 0===t?void 0:t.toLowerCase())})).map((function(e){return{current:e.name,version:L.nu(parseInt(t.version,10),0)}}))}))},V=function(e,t){var n=String(t).toLowerCase();return A(e,(function(e){return e.search(n)}))},j=function(e,t){return-1!==e.indexOf(t)},U=(P=/^\s+|\s+$/g,function(e){return e.replace(P,"")}),W=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,$=function(e){return function(t){return j(t,e)}},q=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return j(e,"edge/")&&j(e,"chrome")&&j(e,"safari")&&j(e,"applewebkit")}},{name:"Chrome",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,W],search:function(e){return j(e,"chrome")&&!j(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return j(e,"msie")||j(e,"trident")}},{name:"Opera",versionRegexes:[W,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:$("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:$("firefox")},{name:"Safari",versionRegexes:[W,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(j(e,"safari")||j(e,"mobile/"))&&j(e,"applewebkit")}}],G=[{name:"Windows",search:$("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return j(e,"iphone")||j(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:$("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:$("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:$("linux"),versionRegexes:[]},{name:"Solaris",search:$("sunos"),versionRegexes:[]},{name:"FreeBSD",search:$("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:$("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],K={browsers:d(q),oses:d(G)},X="Edge",Y="Chrome",J="Opera",Z="Firefox",Q="Safari",ee=function(e){var t=e.current,n=e.version,r=function(e){return function(){return t===e}};return{current:t,version:n,isEdge:r(X),isChrome:r(Y),isIE:r("IE"),isOpera:r(J),isFirefox:r(Z),isSafari:r(Q)}},te={unknown:function(){return ee({current:void 0,version:L.unknown()})},nu:ee,edge:d(X),chrome:d(Y),ie:d("IE"),opera:d(J),firefox:d(Z),safari:d(Q)},ne="Windows",re="Android",oe="Linux",ie="Solaris",ae="FreeBSD",ue="ChromeOS",ce=function(e){var t=e.current,n=e.version,r=function(e){return function(){return t===e}};return{current:t,version:n,isWindows:r(ne),isiOS:r("iOS"),isAndroid:r(re),isOSX:r("OSX"),isLinux:r(oe),isSolaris:r(ie),isFreeBSD:r(ae),isChromeOS:r(ue)}},se={unknown:function(){return ce({current:void 0,version:L.unknown()})},nu:ce,windows:d(ne),ios:d("iOS"),android:d(re),linux:d(oe),osx:d("OSX"),solaris:d(ie),freebsd:d(ae),chromeos:d(ue)},le=function(e,t,n){var r=K.browsers(),o=K.oses(),i=t.bind((function(e){return H(r,e)})).orThunk((function(){return function(e,t){return V(e,t).map((function(e){var n=L.detect(e.versionRegexes,t);return{current:e.name,version:n}}))}(r,e)})).fold(te.unknown,te.nu),a=function(e,t){return V(e,t).map((function(e){var n=L.detect(e.versionRegexes,t);return{current:e.name,version:n}}))}(o,e).fold(se.unknown,se.nu),u=function(e,t,n,r){var o=e.isiOS()&&!0===/ipad/i.test(n),i=e.isiOS()&&!o,a=e.isiOS()||e.isAndroid(),u=a||r("(pointer:coarse)"),c=o||!i&&a&&r("(min-device-width:768px)"),s=i||a&&!c,l=t.isSafari()&&e.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(u),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:d(l),isDesktop:d(f)}}(a,i,e,n);return{browser:i,os:a,deviceType:u}},fe=function(e){return window.matchMedia(e).matches},de=function(e){var t,n=!1;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=!0,t=e.apply(null,r)),t}}((function(){return le(navigator.userAgent,x.from(navigator.userAgentData),fe)})),me=function(e){if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}},ge={fromHtml:function(e,t){var n=(t||document).createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return me(n.childNodes[0])},fromTag:function(e,t){var n=(t||document).createElement(e);return me(n)},fromText:function(e,t){var n=(t||document).createTextNode(e);return me(n)},fromDom:me,fromPoint:function(e,t,n){return x.from(e.dom.elementFromPoint(t,n)).map(me)}},pe=function(e,t){return e.dom===t.dom},he=function(e,t){return n=e.dom,r=t.dom,function(e,t,n){return 0!=(e.compareDocumentPosition(t)&n)}(n,r,Node.DOCUMENT_POSITION_CONTAINED_BY);var n,r},ve=function(e,t){return de().browser.isIE()?he(e,t):function(e,t){var n=e.dom,r=t.dom;return n!==r&&n.contains(r)}(e,t)},be=function(e,t){var n=e.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(t);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(t);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(t);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")},ye=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),we=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),xe=tinymce.util.Tools.resolve("tinymce.util.VK"),Ce=Object.keys,Se=function(e,t){for(var n=Ce(e),r=0,o=n.length;r<o;r++){var i=n[r];t(e[i],i)}},ke=function(e,t){var n={};return function(e,t,n,r){Se(e,(function(e,o){(t(e,o)?n:r)(e,o)}))}(e,t,function(e){return function(t,n){e[n]=t}}(n),f),n};"undefined"!=typeof window?window:Function("return this;")();var Te,Oe=function(e){return e.dom.nodeName.toLowerCase()},_e=(Te=1,function(e){return function(e){return e.dom.nodeType}(e)===Te}),Ee=function(e){return function(t){return _e(t)&&Oe(t)===e}},Ae=function(e,t){var n=e.dom;Se(t,(function(e,t){!function(e,t,n){if(!(i(n)||c(n)||l(n)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",n,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,n+"")}(n,t,e)}))},De=function(e){return _(e.dom.attributes,(function(e,t){return e[t.name]=t.value,e}),{})},Me=function(e){return x.from(e.dom.parentNode).map(ge.fromDom)},Ne=function(e){return k(e.dom.childNodes,ge.fromDom)},Re=function(e,t){var n=e.dom.childNodes;return x.from(n[t]).map(ge.fromDom)},ze=function(e){return Re(e,0)},Be=function(e){return Re(e,e.dom.childNodes.length-1)},Pe=function(e,t){Me(e).each((function(n){n.dom.insertBefore(t.dom,e.dom)}))},Ie=function(e,t){e.dom.appendChild(t.dom)},Fe=function(e,t){T(t,(function(t){Ie(e,t)}))},Le=function(e){var t=e.dom;null!==t.parentNode&&t.parentNode.removeChild(t)},He=function(e){return function(e,t){return ge.fromDom(e.dom.cloneNode(t))}(e,!0)},Ve=function(e,t){var n=function(e,t){var n=ge.fromTag(t),r=De(e);return Ae(n,r),n}(e,t);Pe(e,n);var r=Ne(e);return Fe(n,r),Le(e),n},je=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),Ue=tinymce.util.Tools.resolve("tinymce.util.Tools"),We=function(e){return function(t){return t&&t.nodeName.toLowerCase()===e}},$e=function(e){return function(t){return t&&e.test(t.nodeName)}},qe=function(e){return e&&3===e.nodeType},Ge=$e(/^(OL|UL|DL)$/),Ke=$e(/^(OL|UL)$/),Xe=We("ol"),Ye=$e(/^(LI|DT|DD)$/),Je=$e(/^(DT|DD)$/),Ze=$e(/^(TH|TD)$/),Qe=We("br"),et=function(e,t){return t&&!!e.schema.getTextBlockElements()[t.nodeName]},tt=function(e,t){return e&&e.nodeName in t},nt=function(e,t,n){var r=e.isEmpty(t);return!(n&&e.select("span[data-mce-type=bookmark]",t).length>0)&&r},rt=function(e,t){return e.isChildOf(t,e.getRoot())},ot=function(e,t){var n,r,o,i=e.dom,a=e.schema.getBlockElements(),u=i.createFragment(),c=function(e){var t=e.getParam("forced_root_block","p");return!1===t?"":!0===t?"p":t}(e);if(c&&((r=i.create(c)).tagName===c.toUpperCase()&&i.setAttribs(r,function(e){return e.getParam("forced_root_block_attrs",{})}(e)),tt(t.firstChild,a)||u.appendChild(r)),t)for(;n=t.firstChild;){var s=n.nodeName;o||"SPAN"===s&&"bookmark"===n.getAttribute("data-mce-type")||(o=!0),tt(n,a)?(u.appendChild(n),r=null):c?(r||(r=i.create(c),u.appendChild(r)),r.appendChild(n)):u.appendChild(n)}return c?o||r.appendChild(i.create("br",{"data-mce-bogus":"1"})):u.appendChild(i.create("br")),u},it=je.DOM,at=Ee("dd"),ut=Ee("dt"),ct=function(e,t){at(t)?Ve(t,"dt"):ut(t)&&Me(t).each((function(n){return function(e,t,n){var r=it.select('span[data-mce-type="bookmark"]',t),o=ot(e,n),i=it.createRng();i.setStartAfter(n),i.setEndAfter(t);for(var a,u=i.extractContents(),c=u.firstChild;c;c=c.firstChild)if("LI"===c.nodeName&&e.dom.isEmpty(c)){it.remove(c);break}e.dom.isEmpty(u)||it.insertAfter(u,t),it.insertAfter(o,t),nt(e.dom,n.parentNode)&&(a=n.parentNode,Ue.each(r,(function(e){a.parentNode.insertBefore(e,n.parentNode)})),it.remove(a)),it.remove(n),nt(e.dom,t)&&it.remove(t)}(e,n.dom,t.dom)}))},st=function(e){ut(e)&&Ve(e,"dd")},lt=function(e,t){if(qe(e))return{container:e,offset:t};var n=ye.getNode(e,t);return qe(n)?{container:n,offset:t>=e.childNodes.length?n.data.length:0}:n.previousSibling&&qe(n.previousSibling)?{container:n.previousSibling,offset:n.previousSibling.data.length}:n.nextSibling&&qe(n.nextSibling)?{container:n.nextSibling,offset:0}:{container:e,offset:t}},ft=function(e){var t=e.cloneRange(),n=lt(e.startContainer,e.startOffset);t.setStart(n.container,n.offset);var r=lt(e.endContainer,e.endOffset);return t.setEnd(r.container,r.offset),t},dt=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),mt=function(e,t){var n=t||e.selection.getStart(!0);return e.dom.getParent(n,"OL,UL,DL",ht(e,n))},gt=function(e){var t=mt(e),n=e.selection.getSelectedBlocks();return function(e,t){return e&&1===t.length&&t[0]===e}(t,n)?function(e){return O(e.querySelectorAll("ol,ul,dl"),Ge)}(t):O(n,(function(e){return Ge(e)&&t!==e}))},pt=function(e){var t=e.selection.getSelectedBlocks();return O(function(e,t){var n=Ue.map(t,(function(t){return e.dom.getParent(t,"li,dd,dt",ht(e,t))||t}));return dt.unique(n)}(e,t),Ye)},ht=function(e,t){var n=e.dom.getParents(t,"TD,TH");return n.length>0?n[0]:e.getBody()},vt=function(e,t){var n=e.dom.getParents(t,"ol,ul",ht(e,t));return z(n)},bt=function(e){var t=function(e){var t=vt(e,e.selection.getStart()),n=O(e.selection.getSelectedBlocks(),Ke);return t.toArray().concat(n)}(e);return yt(e,t)},yt=function(e,t){var n=k(t,(function(t){return vt(e,t).getOr(t)}));return dt.unique(n)},wt=function(e,t,n){return void 0===n&&(n=g),e.exists((function(e){return n(e,t)}))},xt=function(e,t,n){return e.isSome()&&t.isSome()?x.some(n(e.getOrDie(),t.getOrDie())):x.none()},Ct=function(e,t,n){return e.fire("ListMutation",{action:t,element:n})},St=function(e,t,n){if(!i(n))throw console.error("Invalid call to CSS.set. Property ",t,":: Value ",n,":: Element ",e),new Error("CSS value must be a string: "+n);(function(e){return void 0!==e.style&&s(e.style.getPropertyValue)})(e)&&e.style.setProperty(t,n)},kt=function(e,t){Ie(e.item,t.list)},Tt=function(e,t){var n={list:ge.fromTag(t,e),item:ge.fromTag("li",e)};return Ie(n.list,n.item),n},Ot=function(e,t,n){var r=t.slice(0,n.depth);return z(r).each((function(t){var r=function(e,t,n){var r=ge.fromTag("li",e);return Ae(r,t),Fe(r,n),r}(e,n.itemAttributes,n.content);!function(e,t){Ie(e.list,t),e.item=t}(t,r),function(e,t){Oe(e.list)!==t.listType&&(e.list=Ve(e.list,t.listType)),Ae(e.list,t.listAttributes)}(t,n)})),r},_t=function(e,t,n){var r,o=function(e,t,n){for(var r=[],o=0;o<n;o++)r.push(Tt(e,t.listType));return r}(e,n,n.depth-t.length);return function(e){for(var t=1;t<e.length;t++)kt(e[t-1],e[t])}(o),function(e,t){for(var n=0;n<e.length-1;n++)r=e[n].item,o="list-style-type",i="none",a=void 0,a=r.dom,St(a,o,i);var r,o,i,a;z(e).each((function(e){Ae(e.list,t.listAttributes),Ae(e.item,t.itemAttributes),Fe(e.item,t.content)}))}(o,n),r=o,xt(z(t),R(r),kt),t.concat(o)},Et=function(e){return be(e,"OL,UL")},At=function(e){return ze(e).exists(Et)},Dt=function(e){return e.depth>0},Mt=function(e){return e.isSelected},Nt=function(e){var t=Ne(e),n=Be(e).exists(Et)?t.slice(0,-1):t;return k(n,He)},Rt=function(e){return T(e,(function(t,n){(function(e,t){var n=e[t].depth,r=function(e){return e.depth===n&&!e.dirty},o=function(e){return e.depth<n};return E(M(e.slice(0,t)),r,o).orThunk((function(){return E(e.slice(t+1),r,o)}))})(e,n).fold((function(){t.dirty&&function(e){e.listAttributes=ke(e.listAttributes,(function(e,t){return"start"!==t}))}(t)}),(function(e){return r=e,(n=t).listType=r.listType,void(n.listAttributes=B({},r.listAttributes));var n,r}))})),e},zt=function(e,t,n,r){return ze(r).filter(Et).fold((function(){t.each((function(e){pe(e.start,r)&&n.set(!0)}));var o=function(e,t,n){return Me(e).filter(_e).map((function(r){return{depth:t,dirty:!1,isSelected:n,content:Nt(e),itemAttributes:De(e),listAttributes:De(r),listType:Oe(r)}}))}(r,e,n.get());t.each((function(e){pe(e.end,r)&&n.set(!1)}));var i=Be(r).filter(Et).map((function(r){return Bt(e,t,n,r)})).getOr([]);return o.toArray().concat(i)}),(function(r){return Bt(e,t,n,r)}))},Bt=function(e,t,n,r){return D(Ne(r),(function(r){return(Et(r)?Bt:zt)(e+1,t,n,r)}))},Pt=function(e,t){var n=Rt(t);return k(n,(function(t){var n,r,o,i=(n=t.content,o=(r||document).createDocumentFragment(),T(n,(function(e){o.appendChild(e.dom)})),ge.fromDom(o));return ge.fromDom(ot(e,i.dom))}))},It=function(e,t){var n=Rt(t);return function(e,t){var n=_(t,(function(t,n){return n.depth>t.length?_t(e,t,n):Ot(e,t,n)}),[]);return R(n).map((function(e){return e.list}))}(e.contentDocument,n).toArray()},Ft=function(e,t,n){var r=function(e,t){var n,r=(n=!1,{get:function(){return n},set:function(e){n=e}});return k(e,(function(e){return{sourceList:e,entries:Bt(0,t,r,e)}}))}(t,function(e){var t=k(pt(e),ge.fromDom);return xt(A(t,p(At)),A(M(t),p(At)),(function(e,t){return{start:e,end:t}}))}(e));T(r,(function(t){!function(e,t){T(O(e,Mt),(function(e){return function(e,t){switch(e){case"Indent":t.depth++;break;case"Outdent":t.depth--;break;case"Flatten":t.depth=0}t.dirty=!0}(t,e)}))}(t.entries,n);var r,o=function(e,t){return D(function(e,t){if(0===e.length)return[];for(var n=t(e[0]),r=[],o=[],i=0,a=e.length;i<a;i++){var u=e[i],c=t(u);c!==n&&(r.push(o),o=[]),n=c,o.push(u)}return 0!==o.length&&r.push(o),r}(t,Dt),(function(t){return R(t).exists(Dt)?It(e,t):Pt(e,t)}))}(e,t.entries);T(o,(function(t){Ct(e,"Indent"===n?"IndentList":"OutdentList",t.dom)})),r=t.sourceList,T(o,(function(e){Pe(r,e)})),Le(t.sourceList)}))},Lt=function(e,t){var n=k(bt(e),ge.fromDom),r=k(function(e){return O(pt(e),Je)}(e),ge.fromDom),o=!1;if(n.length||r.length){var i=e.selection.getBookmark();Ft(e,n,t),function(e,t,n){T(n,"Indent"===t?st:function(t){return ct(e,t)})}(e,t,r),e.selection.moveToBookmark(i),e.selection.setRng(ft(e.selection.getRng())),e.nodeChanged(),o=!0}return o},Ht=function(e){return Lt(e,"Indent")},Vt=function(e){return Lt(e,"Outdent")},jt=function(e){return Lt(e,"Flatten")},Ut=tinymce.util.Tools.resolve("tinymce.dom.BookmarkManager"),Wt=je.DOM,$t=function(e){var t={},n=function(n){var r=e[n?"startContainer":"endContainer"],o=e[n?"startOffset":"endOffset"];if(1===r.nodeType){var i=Wt.create("span",{"data-mce-type":"bookmark"});r.hasChildNodes()?(o=Math.min(o,r.childNodes.length-1),n?r.insertBefore(i,r.childNodes[o]):Wt.insertAfter(i,r.childNodes[o])):r.appendChild(i),r=i,o=0}t[n?"startContainer":"endContainer"]=r,t[n?"startOffset":"endOffset"]=o};return n(!0),e.collapsed||n(),t},qt=function(e){var t=function(t){var n,r=n=e[t?"startContainer":"endContainer"],o=e[t?"startOffset":"endOffset"];r&&(1===r.nodeType&&(o=function(e){for(var t=e.parentNode.firstChild,n=0;t;){if(t===e)return n;1===t.nodeType&&"bookmark"===t.getAttribute("data-mce-type")||n++,t=t.nextSibling}return-1}(r),r=r.parentNode,Wt.remove(n),!r.hasChildNodes()&&Wt.isBlock(r)&&r.appendChild(Wt.create("br"))),e[t?"startContainer":"endContainer"]=r,e[t?"startOffset":"endOffset"]=o)};t(!0),t();var n=Wt.createRng();return n.setStart(e.startContainer,e.startOffset),e.endContainer&&n.setEnd(e.endContainer,e.endOffset),ft(n)},Gt=function(e){switch(e){case"UL":return"ToggleUlList";case"OL":return"ToggleOlList";case"DL":return"ToggleDLList"}},Kt=function(e){return/\btox\-/.test(e.className)},Xt=function(e,t,n){var r=function(e){var r=E(e.parents,Ge,Ze).filter((function(e){return e.nodeName===t&&!Kt(e)})).isSome();n(r)},o=e.dom.getParents(e.selection.getNode());return r({parents:o}),e.on("NodeChange",r),function(){return e.off("NodeChange",r)}},Yt=function(e,t){Ue.each(t,(function(t,n){e.setAttribute(n,t)}))},Jt=function(e,t,n){!function(e,t,n){var r=n["list-style-type"]?n["list-style-type"]:null;e.setStyle(t,"list-style-type",r)}(e,t,n),function(e,t,n){Yt(t,n["list-attributes"]),Ue.each(e.select("li",t),(function(e){Yt(e,n["list-item-attributes"])}))}(e,t,n)},Zt=function(e,t,n,r){var o=t[n?"startContainer":"endContainer"],i=t[n?"startOffset":"endOffset"];for(1===o.nodeType&&(o=o.childNodes[Math.min(i,o.childNodes.length-1)]||o),!n&&Qe(o.nextSibling)&&(o=o.nextSibling);o.parentNode!==r;){if(et(e,o))return o;if(/^(TD|TH)$/.test(o.parentNode.nodeName))return o;o=o.parentNode}return o},Qt=function(e,t,n){var r=e.selection.getRng(),o="LI",i=ht(e,e.selection.getStart(!0)),a=e.dom;if("false"!==a.getContentEditable(e.selection.getNode())){"DL"===(t=t.toUpperCase())&&(o="DT");var u=$t(r),c=function(e,t,n){for(var r,o=[],i=e.dom,a=Zt(e,t,!0,n),u=Zt(e,t,!1,n),c=[],s=a;s&&(c.push(s),s!==u);s=s.nextSibling);return Ue.each(c,(function(t){if(et(e,t))return o.push(t),void(r=null);if(i.isBlock(t)||Qe(t))return Qe(t)&&i.remove(t),void(r=null);var a=t.nextSibling;Ut.isBookmarkNode(t)&&(Ge(a)||et(e,a)||!a&&t.parentNode===n)?r=null:(r||(r=i.create("p"),t.parentNode.insertBefore(r,t),o.push(r)),r.appendChild(t))})),o}(e,r,i);Ue.each(c,(function(r){var i,u=r.previousSibling,c=r.parentNode;Ye(c)||(u&&Ge(u)&&u.nodeName===t&&function(e,t,n){var r=e.getStyle(t,"list-style-type"),o=n?n["list-style-type"]:"";return r===(null===o?"":o)}(a,u,n)?(i=u,r=a.rename(r,o),u.appendChild(r)):(i=a.create(t),r.parentNode.insertBefore(i,r),i.appendChild(r),r=a.rename(r,o)),function(e,t,n){Ue.each(n,(function(n){var r;return e.setStyle(t,((r={})[n]="",r))}))}(a,r,["margin","margin-right","margin-bottom","margin-left","margin-top","padding","padding-right","padding-bottom","padding-left","padding-top"]),Jt(a,i,n),tn(e.dom,i))})),e.selection.setRng(qt(u))}},en=function(e,t,n){return function(e,t){return e&&t&&Ge(e)&&e.nodeName===t.nodeName}(t,n)&&function(e,t,n){return e.getStyle(t,"list-style-type",!0)===e.getStyle(n,"list-style-type",!0)}(e,t,n)&&(r=n,t.className===r.className);var r},tn=function(e,t){var n,r;if(n=t.nextSibling,en(e,t,n)){for(;r=n.firstChild;)t.appendChild(r);e.remove(n)}if(n=t.previousSibling,en(e,t,n)){for(;r=n.lastChild;)t.insertBefore(r,t.firstChild);e.remove(n)}},nn=function(e,t,n,r,o){var i=Ge(t);if(i&&t.nodeName===r&&!rn(o))jt(e);else{Qt(e,r,o);var a=$t(e.selection.getRng()),u=i?function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}([t],n,!0):n;Ue.each(u,(function(t){!function(e,t,n,r){if(t.nodeName!==n){var o=e.dom.rename(t,n);Jt(e.dom,o,r),Ct(e,Gt(n),o)}else Jt(e.dom,t,r),Ct(e,Gt(n),t)}(e,t,r,o)})),e.selection.setRng(qt(a))}},rn=function(e){return"list-style-type"in e},on=function(e,t,n){var r=mt(e),o=gt(e),i=a(n)?n:{};o.length>0?nn(e,r,o,t,i):function(e,t,n,r){if(t!==e.getBody())if(t)if(t.nodeName!==n||rn(r)||Kt(t)){var o=$t(e.selection.getRng());Jt(e.dom,t,r);var i=e.dom.rename(t,n);tn(e.dom,i),e.selection.setRng(qt(o)),Qt(e,n,r),Ct(e,Gt(n),i)}else jt(e);else Qt(e,n,r),Ct(e,Gt(n),t)}(e,r,t,i)},an=je.DOM,un=function(e,t){var n=Ue.grep(e.select("ol,ul",t));Ue.each(n,(function(t){!function(e,t){var n,r=t.parentNode;"LI"===r.nodeName&&r.firstChild===t&&((n=r.previousSibling)&&"LI"===n.nodeName?(n.appendChild(t),nt(e,r)&&an.remove(r)):an.setStyle(r,"listStyleType","none")),Ge(r)&&(n=r.previousSibling)&&"LI"===n.nodeName&&n.appendChild(t)}(e,t)}))},cn=function(e,t,n,r){var o=t.startContainer,i=t.startOffset;if(qe(o)&&(n?i<o.data.length:i>0))return o;var a=e.schema.getNonEmptyElements();1===o.nodeType&&(o=ye.getNode(o,i));var u=new we(o,r);for(n&&function(e,t){return!!Qe(t)&&e.isBlock(t.nextSibling)&&!Qe(t.previousSibling)}(e.dom,o)&&u.next();o=u[n?"next":"prev2"]();){if("LI"===o.nodeName&&!o.hasChildNodes())return o;if(a[o.nodeName])return o;if(qe(o)&&o.data.length>0)return o}},sn=function(e,t){var n=t.childNodes;return 1===n.length&&!Ge(n[0])&&e.isBlock(n[0])},ln=function(e,t,n){var r,o=sn(e,n)?n.firstChild:n;if(function(e,t){sn(e,t)&&e.remove(t.firstChild,!0)}(e,t),!nt(e,t,!0))for(;r=t.firstChild;)o.appendChild(r)},fn=function(e,t,n){var r,o=t.parentNode;if(rt(e,t)&&rt(e,n)){Ge(n.lastChild)&&(r=n.lastChild),o===n.lastChild&&Qe(o.previousSibling)&&e.remove(o.previousSibling);var i=n.lastChild;i&&Qe(i)&&t.hasChildNodes()&&e.remove(i),nt(e,n,!0)&&e.$(n).empty(),ln(e,t,n),r&&n.appendChild(r);var a=ve(ge.fromDom(n),ge.fromDom(t))?e.getParents(t,Ge,n):[];e.remove(t),T(a,(function(t){nt(e,t)&&t!==e.getRoot()&&e.remove(t)}))}},dn=function(e,t,n,r){var o=e.dom;if(o.isEmpty(r))!function(e,t,n){e.dom.$(n).empty(),fn(e.dom,t,n),e.selection.setCursorLocation(n,0)}(e,n,r);else{var i=$t(t);fn(o,n,r),e.selection.setRng(qt(i))}},mn=function(e,t){var n=e.dom,r=e.selection,o=r.getStart(),i=ht(e,o),a=n.getParent(r.getStart(),"LI",i);if(a){var u=a.parentNode;if(u===e.getBody()&&nt(n,u))return!0;var c=ft(r.getRng()),s=n.getParent(cn(e,c,t,i),"LI",i);if(s&&s!==a)return e.undoManager.transact((function(){var n;t?dn(e,c,s,a):(n=a).parentNode.firstChild===n?Vt(e):function(e,t,n,r){var o=$t(t);fn(e.dom,n,r);var i=qt(o);e.selection.setRng(i)}(e,c,a,s)})),!0;if(!s&&!t&&0===c.startOffset&&0===c.endOffset)return e.undoManager.transact((function(){jt(e)})),!0}return!1},gn=function(e,t){return mn(e,t)||function(e,t){var n=e.dom,r=e.selection.getStart(),o=ht(e,r),i=n.getParent(r,n.isBlock,o);if(i&&n.isEmpty(i)){var a=ft(e.selection.getRng()),u=n.getParent(cn(e,a,t,o),"LI",o);if(u)return e.undoManager.transact((function(){!function(e,t,n){var r=e.getParent(t.parentNode,e.isBlock,n);e.remove(t),r&&e.isEmpty(r)&&e.remove(r)}(n,i,o),tn(n,u.parentNode),e.selection.select(u,!0),e.selection.collapse(t)})),!0}return!1}(e,t)},pn=function(e,t){return e.selection.isCollapsed()?gn(e,t):function(e){var t=e.selection.getStart(),n=ht(e,t);return!!(e.dom.getParent(t,"LI,DT,DD",n)||pt(e).length>0)&&(e.undoManager.transact((function(){e.execCommand("Delete"),un(e.dom,e.getBody())})),!0)}(e)},hn=function(e){var t=M(U(e).split("")),n=k(t,(function(e,t){var n=e.toUpperCase().charCodeAt(0)-"A".charCodeAt(0)+1;return Math.pow(26,t)*n}));return _(n,(function(e,t){return e+t}),0)},vn=function(e){if(--e<0)return"";var t=e%26,n=Math.floor(e/26);return vn(n)+String.fromCharCode("A".charCodeAt(0)+t)},bn=function(e){var t,n,r=mt(e);Xe(r)&&e.windowManager.open({title:"List Properties",body:{type:"panel",items:[{type:"input",name:"start",label:"Start list at number",inputMode:"numeric"}]},initialData:{start:(t={start:e.dom.getAttrib(r,"start","1"),listStyleType:x.some(e.dom.getStyle(r,"list-style-type"))},n=parseInt(t.start,10),wt(t.listStyleType,"upper-alpha")?vn(n):wt(t.listStyleType,"lower-alpha")?vn(n).toLowerCase():t.start)},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:function(t){(function(e){switch(function(e){return/^[0-9]+$/.test(e)?2:/^[A-Z]+$/.test(e)?0:function(e){return/^[a-z]+$/.test(e)}(e)?1:e.length>0?4:3}(e)){case 2:return x.some({listStyleType:x.none(),start:e});case 0:return x.some({listStyleType:x.some("upper-alpha"),start:hn(e).toString()});case 1:return x.some({listStyleType:x.some("lower-alpha"),start:hn(e).toString()});case 3:return x.some({listStyleType:x.none(),start:""});case 4:return x.none()}})(t.getData().start).each((function(t){e.execCommand("mceListUpdate",!1,{attrs:{start:"1"===t.start?"":t.start},styles:{"list-style-type":t.listStyleType.getOr("")}})})),t.close()}})},yn=function(e,t){return function(){var n=mt(e);return n&&n.nodeName===t}},wn=function(e){e.addCommand("mceListProps",(function(){bn(e)}))},xn=function(e){e.on("BeforeExecCommand",(function(t){var n=t.command.toLowerCase();"indent"===n?Ht(e):"outdent"===n&&Vt(e)})),e.addCommand("InsertUnorderedList",(function(t,n){on(e,"UL",n)})),e.addCommand("InsertOrderedList",(function(t,n){on(e,"OL",n)})),e.addCommand("InsertDefinitionList",(function(t,n){on(e,"DL",n)})),e.addCommand("RemoveList",(function(){jt(e)})),wn(e),e.addCommand("mceListUpdate",(function(t,n){a(n)&&function(e,t){var n=mt(e);e.undoManager.transact((function(){a(t.styles)&&e.dom.setStyles(n,t.styles),a(t.attrs)&&Se(t.attrs,(function(t,r){return e.dom.setAttrib(n,r,t)}))}))}(e,n)})),e.addQueryStateHandler("InsertUnorderedList",yn(e,"UL")),e.addQueryStateHandler("InsertOrderedList",yn(e,"OL")),e.addQueryStateHandler("InsertDefinitionList",yn(e,"DL"))},Cn=function(e){(function(e){return e.getParam("lists_indent_on_tab",!0)})(e)&&function(e){e.on("keydown",(function(t){t.keyCode!==xe.TAB||xe.metaKeyPressed(t)||e.undoManager.transact((function(){(t.shiftKey?Vt(e):Ht(e))&&t.preventDefault()}))}))}(e),function(e){e.on("keydown",(function(t){t.keyCode===xe.BACKSPACE?pn(e,!1)&&t.preventDefault():t.keyCode===xe.DELETE&&pn(e,!0)&&t.preventDefault()}))}(e)};n.add("lists",(function(e){return!1===e.hasPlugin("rtc",!0)?(Cn(e),xn(e)):wn(e),function(e){var t=function(t){return function(){return e.execCommand(t)}};e.hasPlugin("advlist")||(e.ui.registry.addToggleButton("numlist",{icon:"ordered-list",active:!1,tooltip:"Numbered list",onAction:t("InsertOrderedList"),onSetup:function(t){return Xt(e,"OL",t.setActive)}}),e.ui.registry.addToggleButton("bullist",{icon:"unordered-list",active:!1,tooltip:"Bullet list",onAction:t("InsertUnorderedList"),onSetup:function(t){return Xt(e,"UL",t.setActive)}}))}(e),function(e){var t={text:"List properties...",icon:"ordered-list",onAction:function(){return e.execCommand("mceListProps")},onSetup:function(t){return Xt(e,"OL",(function(e){return t.setDisabled(!e)}))}};e.ui.registry.addMenuItem("listprops",t),e.ui.registry.addContextMenu("lists",{update:function(t){var n=mt(e,t);return Xe(n)?["listprops"]:[]}})}(e),function(e){return{backspaceDelete:function(t){pn(e,t)}}}(e)}))}(),function(){"use strict";var e,t,n=tinymce.util.Tools.resolve("tinymce.PluginManager"),r=function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=function(e){return function(t){return r=typeof(n=t),(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)===e;var n,r}},i=o("string"),a=o("object"),u=o("array"),c=function(e){return!function(e){return null==e}(e)},s=function(){},l=function(e){return function(){return e}},f=function(e){return e},d=l(!1),m=l(!0),g=function(){return p},p={fold:function(e,t){return e()},isSome:d,isNone:m,getOr:t=f,getOrThunk:e=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:l(null),getOrUndefined:l(void 0),or:t,orThunk:e,map:g,each:s,bind:g,exists:d,forall:m,filter:function(){return g()},toArray:function(){return[]},toString:l("none()")},h=function(e){var t=l(e),n=function(){return o},r=function(t){return t(e)},o={fold:function(t,n){return n(e)},isSome:m,isNone:d,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:n,orThunk:n,map:function(t){return h(t(e))},each:function(t){t(e)},bind:r,exists:r,forall:r,filter:function(t){return t(e)?o:p},toArray:function(){return[e]},toString:function(){return"some("+e+")"}};return o},v={some:h,none:g,from:function(e){return null==e?p:h(e)}},b=Array.prototype.push,y=function(e,t){for(var n=0,r=e.length;n<r;n++){t(e[n],n)}},w=function(e){for(var t=[],n=0,r=e.length;n<r;++n){if(!u(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);b.apply(t,e[n])}return t},x=function(e){var t=e;return{get:function(){return t},set:function(e){t=e}}},C=Object.keys,S=Object.hasOwnProperty,k=function(e,t){return T(e,t)?v.from(e[t]):v.none()},T=function(e,t){return S.call(e,t)},O=function(e){return e.getParam("media_scripts")},_=function(e){return e.getParam("media_live_embeds",!0)},E=tinymce.util.Tools.resolve("tinymce.util.Tools"),A=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),D=tinymce.util.Tools.resolve("tinymce.html.SaxParser"),M=function(e,t){if(e)for(var n=0;n<e.length;n++)if(-1!==t.indexOf(e[n].filter))return e[n]},N=A.DOM,R=function(e){return e.replace(/px$/,"")},z=function(e,t){var n=x(!1),r={};return D({validate:!1,allow_conditional_comments:!0,start:function(t,o){if(n.get());else if(T(o.map,"data-ephox-embed-iri"))n.set(!0),r=function(e){var t=e.map.style,n=t?N.parseStyle(t):{};return{type:"ephox-embed-iri",source:e.map["data-ephox-embed-iri"],altsource:"",poster:"",width:k(n,"max-width").map(R).getOr(""),height:k(n,"max-height").map(R).getOr("")}}(o);else{if(r.source||"param"!==t||(r.source=o.map.movie),"iframe"!==t&&"object"!==t&&"embed"!==t&&"video"!==t&&"audio"!==t||(r.type||(r.type=t),r=E.extend(o.map,r)),"script"===t){var i=M(e,o.map.src);if(!i)return;r={type:"script",source:o.map.src,width:String(i.width),height:String(i.height)}}"source"===t&&(r.source?r.altsource||(r.altsource=o.map.src):r.source=o.map.src),"img"!==t||r.poster||(r.poster=o.map.src)}}}).parse(t),r.source=r.source||r.src||r.data,r.altsource=r.altsource||"",r.poster=r.poster||"",r},B=function(e){var t={mp3:"audio/mpeg",m4a:"audio/x-m4a",wav:"audio/wav",mp4:"video/mp4",webm:"video/webm",ogg:"video/ogg",swf:"application/x-shockwave-flash"}[e.toLowerCase().split(".").pop()];return t||""},P=tinymce.util.Tools.resolve("tinymce.html.Schema"),I=tinymce.util.Tools.resolve("tinymce.html.Writer"),F=A.DOM,L=function(e){return/^[0-9.]+$/.test(e)?e+"px":e},H=function(e,t){!function(e,t){for(var n=C(e),r=0,o=n.length;r<o;r++){var i=n[r];t(e[i],i)}}(t,(function(t,n){var r=""+t;if(e.map[n])for(var o=e.length;o--;){var i=e[o];i.name===n&&(r?(e.map[n]=r,i.value=r):(delete e.map[n],e.splice(o,1)))}else r&&(e.push({name:n,value:r}),e.map[n]=r)}))},V=["source","altsource"],j=function(e,t,n){var r,o=I(),i=x(!1),a=0;return D({validate:!1,allow_conditional_comments:!0,comment:function(e){o.comment(e)},cdata:function(e){o.cdata(e)},text:function(e,t){o.text(e,t)},start:function(e,u,c){if(i.get());else if(T(u.map,"data-ephox-embed-iri"))i.set(!0),function(e,t){var n=t.map.style,r=n?F.parseStyle(n):{};r["max-width"]=L(e.width),r["max-height"]=L(e.height),H(t,{style:F.serializeStyle(r)})}(t,u);else{switch(e){case"video":case"object":case"embed":case"img":case"iframe":void 0!==t.height&&void 0!==t.width&&H(u,{width:t.width,height:t.height})}if(n)switch(e){case"video":H(u,{poster:t.poster,src:""}),t.altsource&&H(u,{src:""});break;case"iframe":H(u,{src:t.source});break;case"source":if(a<2&&(H(u,{src:t[V[a]],type:t[V[a]+"mime"]}),!t[V[a]]))return;a++;break;case"img":if(!t.poster)return;r=!0}}o.start(e,u,c)},end:function(e){if(!i.get()){if("video"===e&&n)for(var u=0;u<2;u++)if(t[V[u]]){var c=[];c.map={},a<=u&&(H(c,{src:t[V[u]],type:t[V[u]+"mime"]}),o.start("source",c,!0))}if(t.poster&&"object"===e&&n&&!r){var s=[];s.map={},H(s,{src:t.poster,width:t.width,height:t.height}),o.start("img",s,!0)}}o.end(e)}},P({})).parse(e),o.getContent()},U=[{regex:/youtu\.be\/([\w\-_\?&=.]+)/i,type:"iframe",w:560,h:314,url:"www.youtube.com/embed/$1",allowFullscreen:!0},{regex:/youtube\.com(.+)v=([^&]+)(&([a-z0-9&=\-_]+))?/i,type:"iframe",w:560,h:314,url:"www.youtube.com/embed/$2?$4",allowFullscreen:!0},{regex:/youtube.com\/embed\/([a-z0-9\?&=\-_]+)/i,type:"iframe",w:560,h:314,url:"www.youtube.com/embed/$1",allowFullscreen:!0},{regex:/vimeo\.com\/([0-9]+)/,type:"iframe",w:425,h:350,url:"player.vimeo.com/video/$1?title=0&byline=0&portrait=0&color=8dc7dc",allowFullscreen:!0},{regex:/vimeo\.com\/(.*)\/([0-9]+)/,type:"iframe",w:425,h:350,url:"player.vimeo.com/video/$2?title=0&amp;byline=0",allowFullscreen:!0},{regex:/maps\.google\.([a-z]{2,3})\/maps\/(.+)msid=(.+)/,type:"iframe",w:425,h:350,url:'maps.google.com/maps/ms?msid=$2&output=embed"',allowFullscreen:!1},{regex:/dailymotion\.com\/video\/([^_]+)/,type:"iframe",w:480,h:270,url:"www.dailymotion.com/embed/video/$1",allowFullscreen:!0},{regex:/dai\.ly\/([^_]+)/,type:"iframe",w:480,h:270,url:"www.dailymotion.com/embed/video/$1",allowFullscreen:!0}],W=function(e,t){for(var n=function(e){var t=e.match(/^(https?:\/\/|www\.)(.+)$/i);return t&&t.length>1?"www."===t[1]?"https://":t[1]:"https://"}(t),r=e.regex.exec(t),o=n+e.url,i=function(e){o=o.replace("$"+e,(function(){return r[e]?r[e]:""}))},a=0;a<r.length;a++)i(a);return o.replace(/\?$/,"")},$=function(e,t){var n=E.extend({},t);if(!n.source&&(E.extend(n,z(O(e),n.embed)),!n.source))return"";n.altsource||(n.altsource=""),n.poster||(n.poster=""),n.source=e.convertURL(n.source,"source"),n.altsource=e.convertURL(n.altsource,"source"),n.sourcemime=B(n.source),n.altsourcemime=B(n.altsource),n.poster=e.convertURL(n.poster,"poster");var r,o,i=(r=n.source,o=U.filter((function(e){return e.regex.test(r)})),o.length>0?E.extend({},o[0],{url:W(o[0],r)}):null);if(i&&(n.source=i.url,n.type=i.type,n.allowfullscreen=i.allowFullscreen,n.width=n.width||String(i.w),n.height=n.height||String(i.h)),n.embed)return j(n.embed,n,!0);var a=M(O(e),n.source);a&&(n.type="script",n.width=String(a.width),n.height=String(a.height));var u=function(e){return e.getParam("audio_template_callback")}(e),c=function(e){return e.getParam("video_template_callback")}(e);return n.width=n.width||"300",n.height=n.height||"150",E.each(n,(function(t,r){n[r]=e.dom.encode(""+t)})),"iframe"===n.type?function(e){var t=e.allowfullscreen?' allowFullscreen="1"':"";return'<iframe src="'+e.source+'" width="'+e.width+'" height="'+e.height+'"'+t+"></iframe>"}(n):"application/x-shockwave-flash"===n.sourcemime?function(e){var t='<object data="'+e.source+'" width="'+e.width+'" height="'+e.height+'" type="application/x-shockwave-flash">';return e.poster&&(t+='<img src="'+e.poster+'" width="'+e.width+'" height="'+e.height+'" />'),t+"</object>"}(n):-1!==n.sourcemime.indexOf("audio")?function(e,t){return t?t(e):'<audio controls="controls" src="'+e.source+'">'+(e.altsource?'\n<source src="'+e.altsource+'"'+(e.altsourcemime?' type="'+e.altsourcemime+'"':"")+" />\n":"")+"</audio>"}(n,u):"script"===n.type?function(e){return'<script src="'+e.source+'"><\/script>'}(n):function(e,t){return t?t(e):'<video width="'+e.width+'" height="'+e.height+'"'+(e.poster?' poster="'+e.poster+'"':"")+' controls="controls">\n<source src="'+e.source+'"'+(e.sourcemime?' type="'+e.sourcemime+'"':"")+" />\n"+(e.altsource?'<source src="'+e.altsource+'"'+(e.altsourcemime?' type="'+e.altsourcemime+'"':"")+" />\n":"")+"</video>"}(n,c)},q=function(e){return e.hasAttribute("data-mce-object")||e.hasAttribute("data-ephox-embed-iri")},G=tinymce.util.Tools.resolve("tinymce.util.Promise"),K={},X=function(e){return function(t){return $(e,t)}},Y=function(e,t){var n=function(e){return e.getParam("media_url_resolver")}(e);return n?function(e,t,n){return new G((function(r,o){var i=function(n){return n.html&&(K[e.source]=n),r({url:e.source,html:n.html?n.html:t(e)})};K[e.source]?i(K[e.source]):n({url:e.source},i,o)}))}(t,X(e),n):function(e,t){return G.resolve({html:t(e),url:e.source})}(t,X(e))},J=function(e,t){var n=t?function(e,t){return k(t,e).bind((function(e){return k(e,"meta")}))}(t,e).getOr({}):{},o=function(e,t,n){return function(r){var o,i=function(){return k(e,r)},u=function(){return k(t,r)},c=function(e){return k(e,"value").bind((function(e){return e.length>0?v.some(e):v.none()}))};return(o={})[r]=(r===n?i().bind((function(e){return a(e)?c(e).orThunk(u):u().orThunk((function(){return v.from(e)}))})):u().orThunk((function(){return i().bind((function(e){return a(e)?c(e):v.from(e)}))}))).getOr(""),o}}(e,n,t);return r(r(r(r(r({},o("source")),o("altsource")),o("poster")),o("embed")),function(e,t){var n={};return k(e,"dimensions").each((function(e){y(["width","height"],(function(r){k(t,r).orThunk((function(){return k(e,r)})).each((function(e){return n[r]=e}))}))})),n}(e,n))},Z=function(e){var t=r(r({},e),{source:{value:k(e,"source").getOr("")},altsource:{value:k(e,"altsource").getOr("")},poster:{value:k(e,"poster").getOr("")}});return y(["width","height"],(function(n){k(e,n).each((function(e){var r=t.dimensions||{};r[n]=e,t.dimensions=r}))})),t},Q=function(e){return function(t){var n=t&&t.msg?"Media embed handler error: "+t.msg:"Media embed handler threw unknown error.";e.notificationManager.open({type:"error",text:n})}},ee=function(e,t){return z(O(e),t)},te=function(e,t){return function(n){if(i(n.url)&&n.url.trim().length>0){var o=n.html,a=ee(t,o),u=r(r({},a),{source:n.url,embed:o});e.setData(Z(u))}}},ne=function(e,t){var n=e.dom.select("*[data-mce-object]");e.insertContent(t),function(e,t){for(var n=e.dom.select("*[data-mce-object]"),r=0;r<t.length;r++)for(var o=n.length-1;o>=0;o--)t[r]===n[o]&&n.splice(o,1);e.selection.select(n[0])}(e,n),e.nodeChanged()},re=function(e,t,n){var r;t.embed=j(t.embed,t),t.embed&&(e.source===t.source||(r=t.source,T(K,r)))?ne(n,t.embed):Y(n,t).then((function(e){ne(n,e.html)})).catch(Q(n))},oe=function(e){var t=function(e){var t=e.selection.getNode(),n=q(t)?e.serializer.serialize(t,{selection:!0}):"";return r({embed:n},z(O(e),n))}(e),n=x(t),o=Z(t),i=function(e){return e.getParam("media_dimensions",!0)}(e)?[{type:"sizeinput",name:"dimensions",label:"Constrain proportions",constrain:!0}]:[],a={title:"General",name:"general",items:w([[{name:"source",type:"urlinput",filetype:"media",label:"Source"}],i])},u={title:"Embed",items:[{type:"textarea",name:"embed",label:"Paste your embed code below:"}]},c=[];(function(e){return e.getParam("media_alt_source",!0)})(e)&&c.push({name:"altsource",type:"urlinput",filetype:"media",label:"Alternative source URL"}),function(e){return e.getParam("media_poster",!0)}(e)&&c.push({name:"poster",type:"urlinput",filetype:"image",label:"Media poster (Image URL)"});var s={title:"Advanced",name:"advanced",items:c},l=[a,u];c.length>0&&l.push(s);var f={type:"tabpanel",tabs:l},d=e.windowManager.open({title:"Insert/Edit Media",size:"normal",body:f,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:function(t){var r=J(t.getData());re(n.get(),r,e),t.close()},onChange:function(t,o){switch(o.name){case"source":!function(t,n){var r=J(n.getData(),"source");t.source!==r.source&&(te(d,e)({url:r.source,html:""}),Y(e,r).then(te(d,e)).catch(Q(e)))}(n.get(),t);break;case"embed":!function(t){var n=J(t.getData()),r=ee(e,n.embed);t.setData(Z(r))}(t);break;case"dimensions":case"altsource":case"poster":!function(t,n){var o=J(t.getData(),n),i=$(e,o);t.setData(Z(r(r({},o),{embed:i})))}(t,o.name)}n.set(J(t.getData()))},initialData:o})},ie=tinymce.util.Tools.resolve("tinymce.html.Node"),ae=tinymce.util.Tools.resolve("tinymce.Env"),ue=tinymce.util.Tools.resolve("tinymce.html.DomParser"),ce=function(e,t){if(!1===function(e){return e.getParam("media_filter_html",!0)}(e))return t;var n,r=I();return D({validate:!1,allow_conditional_comments:!1,comment:function(e){n||r.comment(e)},cdata:function(e){n||r.cdata(e)},text:function(e,t){n||r.text(e,t)},start:function(t,o,i){if(n=!0,"script"!==t&&"noscript"!==t&&"svg"!==t){for(var a=o.length-1;a>=0;a--){var u=o[a].name;0===u.indexOf("on")&&(delete o.map[u],o.splice(a,1)),"style"===u&&(o[a].value=e.dom.serializeStyle(e.dom.parseStyle(o[a].value),t))}r.start(t,o,i),n=!1}},end:function(e){n||r.end(e)}},P({})).parse(t),r.getContent()},se=function(e){var t=e.name;return"iframe"===t||"video"===t||"audio"===t},le=function(e,t,n,r){void 0===r&&(r=null);var o=e.attr(n);return c(o)?o:T(t,n)?null:r},fe=function(e,t,n){var r="img"===t.name||"video"===e.name,o=r?"300":null,i="audio"===e.name?"30":"150",a=r?i:null;t.attr({width:le(e,n,"width",o),height:le(e,n,"height",a)})},de=function(e,t){var n=t.name,r=new ie("img",1);return r.shortEnded=!0,ge(e,t,r),fe(t,r,{}),r.attr({style:t.attr("style"),src:ae.transparentSrc,"data-mce-object":n,class:"mce-object mce-object-"+n}),r},me=function(e,t){var n=t.name,r=new ie("span",1);r.attr({contentEditable:"false",style:t.attr("style"),"data-mce-object":n,class:"mce-preview-object mce-object-"+n}),ge(e,t,r);var o=e.dom.parseStyle(t.attr("style")),i=new ie(n,1);if(fe(t,i,o),i.attr({src:t.attr("src"),style:t.attr("style"),class:t.attr("class")}),"iframe"===n)i.attr({allowfullscreen:t.attr("allowfullscreen"),frameborder:"0"});else{y(["controls","crossorigin","currentTime","loop","muted","poster","preload"],(function(e){i.attr(e,t.attr(e))}));var a=r.attr("data-mce-html");c(a)&&function(e,t,n,r){for(var o=ue({forced_root_block:!1,validate:!1},e.schema).parse(r,{context:t});o.firstChild;)n.append(o.firstChild)}(e,n,i,unescape(a))}var u=new ie("span",1);return u.attr("class","mce-shim"),r.append(i),r.append(u),r},ge=function(e,t,n){for(var r=t.attributes,o=r.length;o--;){var i=r[o].name,a=r[o].value;"width"!==i&&"height"!==i&&"style"!==i&&("data"!==i&&"src"!==i||(a=e.convertURL(a,i)),n.attr("data-mce-p-"+i,a))}var u=t.firstChild&&t.firstChild.value;u&&(n.attr("data-mce-html",escape(ce(e,u))),n.firstChild=null)},pe=function(e){var t=e.attr("class");return t&&/\btiny-pageembed\b/.test(t)},he=function(e){for(;e=e.parent;)if(e.attr("data-ephox-embed-iri")||pe(e))return!0;return!1},ve=function(e){e.on("preInit",(function(){var t=e.schema.getSpecialElements();E.each("video audio iframe object".split(" "),(function(e){t[e]=new RegExp("</"+e+"[^>]*>","gi")}));var n=e.schema.getBoolAttrs();E.each("webkitallowfullscreen mozallowfullscreen allowfullscreen".split(" "),(function(e){n[e]={}})),e.parser.addNodeFilter("iframe,video,audio,object,embed,script",function(e){return function(t){for(var n,r,o=t.length;o--;)(n=t[o]).parent&&(n.parent.attr("data-mce-object")||("script"!==n.name||(r=M(O(e),n.attr("src"))))&&(r&&(r.width&&n.attr("width",r.width.toString()),r.height&&n.attr("height",r.height.toString())),se(n)&&_(e)&&ae.ceFalse?he(n)||n.replace(me(e,n)):he(n)||n.replace(de(e,n))))}}(e)),e.serializer.addAttributeFilter("data-mce-object",(function(t,n){for(var r,o,i,a,u,c,s,l,f=t.length;f--;)if((r=t[f]).parent){for(s=r.attr(n),o=new ie(s,1),"audio"!==s&&"script"!==s&&((l=r.attr("class"))&&-1!==l.indexOf("mce-preview-object")?o.attr({width:r.firstChild.attr("width"),height:r.firstChild.attr("height")}):o.attr({width:r.attr("width"),height:r.attr("height")})),o.attr({style:r.attr("style")}),i=(a=r.attributes).length;i--;){var d=a[i].name;0===d.indexOf("data-mce-p-")&&o.attr(d.substr(11),a[i].value)}"script"===s&&o.attr("type","text/javascript"),(u=r.attr("data-mce-html"))&&((c=new ie("#text",3)).raw=!0,c.value=ce(e,unescape(u)),o.append(c)),r.replace(o)}}))})),e.on("SetContent",(function(){e.$("span.mce-preview-object").each((function(t,n){var r=e.$(n);0===r.find("span.mce-shim").length&&r.append('<span class="mce-shim"></span>')}))}))};n.add("media",(function(e){return function(e){e.addCommand("mceMedia",(function(){oe(e)}))}(e),function(e){var t=function(){return e.execCommand("mceMedia")};e.ui.registry.addToggleButton("media",{tooltip:"Insert/edit media",icon:"embed",onAction:t,onSetup:function(t){var n=e.selection;return t.setActive(q(n.getNode())),n.selectorChangedWithUnbind("img[data-mce-object],span[data-mce-object],div[data-ephox-embed-iri]",t.setActive).unbind}}),e.ui.registry.addMenuItem("media",{icon:"embed",text:"Media...",onAction:t})}(e),function(e){e.on("ResolveName",(function(e){var t;1===e.target.nodeType&&(t=e.target.getAttribute("data-mce-object"))&&(e.name=t)}))}(e),ve(e),function(e){e.on("click keyup touchend",(function(){var t=e.selection.getNode();t&&e.dom.hasClass(t,"mce-preview-object")&&e.dom.getAttrib(t,"data-mce-selected")&&t.setAttribute("data-mce-selected","2")})),e.on("ObjectSelected",(function(e){"script"===e.target.getAttribute("data-mce-object")&&e.preventDefault()})),e.on("ObjectResized",(function(e){var t=e.target;if(t.getAttribute("data-mce-object")){var n=t.getAttribute("data-mce-html");n&&(n=unescape(n),t.setAttribute("data-mce-html",escape(j(n,{width:String(e.width),height:String(e.height)}))))}}))}(e),function(e){return{showDialog:function(){oe(e)}}}(e)}))}(),function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=function(e,t){for(var n="",r=0;r<t;r++)n+=e;return n},n=function(e,n){var r=function(e){return e.getParam("nonbreaking_wrap",!0,"boolean")}(e),o=r||e.plugins.visualchars?'<span class="'+(function(e){return!!e.plugins.visualchars&&e.plugins.visualchars.isEnabled()}(e)?"mce-nbsp-wrap mce-nbsp":"mce-nbsp-wrap")+'" contenteditable="false">'+t("&nbsp;",n)+"</span>":t("&nbsp;",n);e.undoManager.transact((function(){return e.insertContent(o)}))},r=tinymce.util.Tools.resolve("tinymce.util.VK");e.add("nonbreaking",(function(e){!function(e){e.addCommand("mceNonBreaking",(function(){n(e,1)}))}(e),function(e){var t=function(){return e.execCommand("mceNonBreaking")};e.ui.registry.addButton("nonbreaking",{icon:"non-breaking",tooltip:"Nonbreaking space",onAction:t}),e.ui.registry.addMenuItem("nonbreaking",{icon:"non-breaking",text:"Nonbreaking space",onAction:t})}(e),function(e){var t=function(e){var t=e.getParam("nonbreaking_force_tab",0);return"boolean"==typeof t?!0===t?3:0:t}(e);t>0&&e.on("keydown",(function(o){if(o.keyCode===r.TAB&&!o.isDefaultPrevented()){if(o.shiftKey)return;o.preventDefault(),o.stopImmediatePropagation(),n(e,t)}}))}(e)}))}(),function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.util.Tools"),n=function(e){return e.getParam("noneditable_noneditable_class","mceNonEditable")},r=function(e){return function(t){return-1!==(" "+t.attr("class")+" ").indexOf(e)}},o=function(e,t,n){return function(r){var o=arguments,i=o[o.length-2],a=i>0?t.charAt(i-1):"";if('"'===a)return r;if(">"===a){var u=t.lastIndexOf("<",i);if(-1!==u){var c=t.substring(u,i);if(-1!==c.indexOf('contenteditable="false"'))return r}}return'<span class="'+n+'" data-mce-content="'+e.dom.encode(o[0])+'">'+e.dom.encode("string"==typeof o[1]?o[1]:o[0])+"</span>"}},i=function(e){var i="contenteditable",a=" "+t.trim(function(e){return e.getParam("noneditable_editable_class","mceEditable")}(e))+" ",u=" "+t.trim(n(e))+" ",c=r(a),s=r(u),l=function(e){var t=e.getParam("noneditable_regexp",[]);return t&&t.constructor===RegExp?[t]:t}(e);e.on("PreInit",(function(){l.length>0&&e.on("BeforeSetContent",(function(t){!function(e,t,r){var i=t.length,a=r.content;if("raw"!==r.format){for(;i--;)a=a.replace(t[i],o(e,a,n(e)));r.content=a}}(e,l,t)})),e.parser.addAttributeFilter("class",(function(e){for(var t,n=e.length;n--;)t=e[n],c(t)?t.attr(i,"true"):s(t)&&t.attr(i,"false")})),e.serializer.addAttributeFilter(i,(function(e){for(var t,n=e.length;n--;)t=e[n],(c(t)||s(t))&&(l.length>0&&t.attr("data-mce-content")?(t.name="#text",t.type=3,t.raw=!0,t.value=t.attr("data-mce-content")):t.attr(i,null))}))}))};e.add("noneditable",(function(e){i(e)}))}(),function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.Env"),n=function(e){return e.getParam("pagebreak_split_block",!1)},r="mce-pagebreak",o=function(e){var n='<img src="'+t.transparentSrc+'" class="'+'mce-pagebreak" data-mce-resize="false" data-mce-placeholder />';return e?"<p>"+n+"</p>":n};e.add("pagebreak",(function(e){!function(e){e.addCommand("mcePageBreak",(function(){e.insertContent(o(n(e)))}))}(e),function(e){var t=function(){return e.execCommand("mcePageBreak")};e.ui.registry.addButton("pagebreak",{icon:"page-break",tooltip:"Page break",onAction:t}),e.ui.registry.addMenuItem("pagebreak",{text:"Page break",icon:"page-break",onAction:t})}(e),function(e){var t=function(e){return e.getParam("pagebreak_separator","\x3c!-- pagebreak --\x3e")}(e),i=function(){return n(e)},a=new RegExp(t.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,(function(e){return"\\"+e})),"gi");e.on("BeforeSetContent",(function(e){e.content=e.content.replace(a,o(i()))})),e.on("PreInit",(function(){e.serializer.addNodeFilter("img",(function(n){for(var o,a,u=n.length;u--;)if((a=(o=n[u]).attr("class"))&&-1!==a.indexOf(r)){var c=o.parent;if(e.schema.getBlockElements()[c.name]&&i()){c.type=3,c.value=t,c.raw=!0,o.remove();continue}o.type=3,o.value=t,o.raw=!0}}))}))}(e),function(e){e.on("ResolveName",(function(t){"IMG"===t.target.nodeName&&e.dom.hasClass(t.target,r)&&(t.name="pagebreak")}))}(e)}))}(),function(){"use strict";var e,t,n,r,o,i=function(e){var t=e;return{get:function(){return t},set:function(e){t=e}}},a=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=(e="array",function(t){return r=typeof(n=t),(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)===e;var n,r}),c=function(e){return!function(e){return null==e}(e)},s=function(e){return function(t){return typeof t===e}}("function"),l=function(){},f=function(e){return function(){return e}},d=function(e){return e},m=f(!1),g=f(!0),p=function(){return h},h={fold:function(e,t){return e()},isSome:m,isNone:g,getOr:n=d,getOrThunk:t=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:f(null),getOrUndefined:f(void 0),or:n,orThunk:t,map:p,each:l,bind:p,exists:m,forall:g,filter:function(){return p()},toArray:function(){return[]},toString:f("none()")},v=function(e){var t=f(e),n=function(){return o},r=function(t){return t(e)},o={fold:function(t,n){return n(e)},isSome:g,isNone:m,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:n,orThunk:n,map:function(t){return v(t(e))},each:function(t){t(e)},bind:r,exists:r,forall:r,filter:function(t){return t(e)?o:h},toArray:function(){return[e]},toString:function(){return"some("+e+")"}};return o},b={some:v,none:p,from:function(e){return null==e?h:v(e)}},y=Array.prototype.slice,w=Array.prototype.push,x=function(e,t){for(var n=0,r=e.length;n<r;n++){if(t(e[n],n))return!0}return!1},C=function(e,t){for(var n=e.length,r=new Array(n),o=0;o<n;o++){var i=e[o];r[o]=t(i,o)}return r},S=function(e,t){for(var n=0,r=e.length;n<r;n++){t(e[n],n)}},k=function(e,t){return function(e){for(var t=[],n=0,r=e.length;n<r;++n){if(!u(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);w.apply(t,e[n])}return t}(C(e,t))},T=s(Array.from)?Array.from:function(e){return y.call(e)},O=function(){return O=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},O.apply(this,arguments)},_=function(){var e=function(e){var t=i(b.none()),n=function(){return t.get().each(e)};return{clear:function(){n(),t.set(b.none())},isSet:function(){return t.get().isSome()},get:function(){return t.get()},set:function(e){n(),t.set(b.some(e))}}}(l);return O(O({},e),{on:function(t){return e.get().each(t)}})},E=function(e,t,n){return""===t||e.length>=t.length&&e.substr(n,n+t.length)===t},A=tinymce.util.Tools.resolve("tinymce.Env"),D=tinymce.util.Tools.resolve("tinymce.util.Delay"),M=tinymce.util.Tools.resolve("tinymce.util.Promise"),N=tinymce.util.Tools.resolve("tinymce.util.VK"),R=function(e,t){return e.fire("PastePlainTextToggle",{state:t})},z=tinymce.util.Tools.resolve("tinymce.util.Tools"),B=function(e){return e.getParam("paste_data_images",!1)},P=function(e){return e.getParam("paste_merge_formats",!0)},I=function(e){return e.getParam("paste_retain_style_properties")},F=function(e){return e.getParam("validate")},L=function(e){return e.getParam("allow_html_data_urls",!1,"boolean")},H=function(e){return e.getParam("paste_data_images",!1,"boolean")},V=function(e){return z.explode(e.getParam("images_file_types","jpeg,jpg,jpe,jfi,jif,jfif,png,gif,bmp,webp","string"))},j="x-tinymce/html",U="\x3c!-- x-tinymce/html --\x3e",W=function(e){return-1!==e.indexOf(U)},$=f(j),q=Object.hasOwnProperty,G=function(e,t){return q.call(e,t)},K=tinymce.util.Tools.resolve("tinymce.html.Entities"),X=function(e,t,n){var r=e.split(/\n\n/),o=function(e,t){var n=[],r="<"+e;if("object"==typeof t){for(var o in t)G(t,o)&&n.push(o+'="'+K.encodeAllRaw(t[o])+'"');n.length&&(r+=" "+n.join(" "))}return r+">"}(t,n),i="</"+t+">",a=z.map(r,(function(e){return e.split(/\n/).join("<br />")}));return 1===a.length?a[0]:z.map(a,(function(e){return o+e+i})).join("")},Y=tinymce.util.Tools.resolve("tinymce.html.DomParser"),J=tinymce.util.Tools.resolve("tinymce.html.Serializer"),Z=" ",Q=tinymce.util.Tools.resolve("tinymce.html.Node"),ee=tinymce.util.Tools.resolve("tinymce.html.Schema"),te=function(e,t){return z.each(t,(function(t){e=t.constructor===RegExp?e.replace(t,""):e.replace(t[0],t[1])})),e},ne=function(e){return e=te(e,[/^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/gi,/<!--StartFragment-->|<!--EndFragment-->/g,[/( ?)<span class="Apple-converted-space">\u00a0<\/span>( ?)/g,function(e,t,n){return t||n?Z:" "}],/<br class="Apple-interchange-newline">/g,/<br>$/i])},re=function(e){return/<font face="Times New Roman"|class="?Mso|style="[^"]*\bmso-|style='[^']*\bmso-|w:WordDocument/i.test(e)||/class="OutlineElement/.test(e)||/id="?docs\-internal\-guid\-/.test(e)},oe=function(e){var t=!1;return e=e.replace(/^[\u00a0 ]+/,""),z.each([/^[IVXLMCD]+\.[ \u00a0]/,/^[ivxlmcd]+\.[ \u00a0]/,/^[a-z]{1,2}[\.\)][ \u00a0]/,/^[A-Z]{1,2}[\.\)][ \u00a0]/,/^[0-9]+\.[ \u00a0]/,/^[\u3007\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d]+\.[ \u00a0]/,/^[\u58f1\u5f10\u53c2\u56db\u4f0d\u516d\u4e03\u516b\u4e5d\u62fe]+\.[ \u00a0]/],(function(n){if(n.test(e))return t=!0,!1})),t},ie=function(e,t,n,r){var o={},i=e.dom.parseStyle(r);z.each(i,(function(i,a){switch(a){case"mso-list":var u=/\w+ \w+([0-9]+)/i.exec(r);u&&(n._listLevel=parseInt(u[1],10)),/Ignore/i.test(i)&&n.firstChild&&(n._listIgnore=!0,n.firstChild._listIgnore=!0);break;case"horiz-align":a="text-align";break;case"vert-align":a="vertical-align";break;case"font-color":case"mso-foreground":a="color";break;case"mso-background":case"mso-highlight":a="background";break;case"font-weight":case"font-style":return void("normal"!==i&&(o[a]=i));case"mso-element":if(/^(comment|comment-list)$/i.test(i))return void n.remove()}0!==a.indexOf("mso-comment")?0!==a.indexOf("mso-")&&("all"===I(e)||t&&t[a])&&(o[a]=i):n.remove()})),/(bold)/i.test(o["font-weight"])&&(delete o["font-weight"],n.wrap(new Q("b",1))),/(italic)/i.test(o["font-style"])&&(delete o["font-style"],n.wrap(new Q("i",1)));var a=e.dom.serializeStyle(o,n.name);return a||null},ae=function(e,t){var n,r=I(e);r&&(n=z.makeMap(r.split(/[, ]/))),t=te(t,[/<br class="?Apple-interchange-newline"?>/gi,/<b[^>]+id="?docs-internal-[^>]*>/gi,/<!--[\s\S]+?-->/gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/&nbsp;/gi,Z],[/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,function(e,t){return t.length>0?t.replace(/./," ").slice(Math.floor(t.length/2)).split("").join(Z):""}]]);var o=function(e){return e.getParam("paste_word_valid_elements","-strong/b,-em/i,-u,-span,-p,-ol,-ul,-li,-h1,-h2,-h3,-h4,-h5,-h6,-p/div,-a[href|name],sub,sup,strike,br,del,table[width],tr,td[colspan|rowspan|width],th[colspan|rowspan|width],thead,tfoot,tbody")}(e),i=ee({valid_elements:o,valid_children:"-li[p]"});z.each(i.elements,(function(e){e.attributes.class||(e.attributes.class={},e.attributesOrder.push("class")),e.attributes.style||(e.attributes.style={},e.attributesOrder.push("style"))}));var a=Y({},i);a.addAttributeFilter("style",(function(t){for(var r,o=t.length;o--;)(r=t[o]).attr("style",ie(e,n,r,r.attr("style"))),"span"===r.name&&r.parent&&!r.attributes.length&&r.unwrap()})),a.addAttributeFilter("class",(function(e){for(var t,n,r=e.length;r--;)n=(t=e[r]).attr("class"),/^(MsoCommentReference|MsoCommentText|msoDel)$/i.test(n)&&t.remove(),t.attr("class",null)})),a.addNodeFilter("del",(function(e){for(var t=e.length;t--;)e[t].remove()})),a.addNodeFilter("a",(function(e){for(var t,n,r,o=e.length;o--;)if(n=(t=e[o]).attr("href"),r=t.attr("name"),n&&-1!==n.indexOf("#_msocom_"))t.remove();else if(n&&0===n.indexOf("file://")&&(n=n.split("#")[1])&&(n="#"+n),n||r){if(r&&!/^_?(?:toc|edn|ftn)/i.test(r)){t.unwrap();continue}t.attr({href:n,name:r})}else t.unwrap()}));var u=a.parse(t);return function(e){return e.getParam("paste_convert_word_fake_lists",!0)}(e)&&function(e){for(var t,n,r=1,o=function(e){var t="";if(3===e.type)return e.value;if(e=e.firstChild)do{t+=o(e)}while(e=e.next);return t},i=function(e,t){if(3===e.type&&t.test(e.value))return e.value=e.value.replace(t,""),!1;if(e=e.firstChild)do{if(!i(e,t))return!1}while(e=e.next);return!0},a=function(e){if(e._listIgnore)e.remove();else if(e=e.firstChild)do{a(e)}while(e=e.next)},u=function(e,o,u){var c=e._listLevel||r;c!==r&&(c<r?t&&(t=t.parent.parent):(n=t,t=null)),t&&t.name===o?t.append(e):(n=n||t,t=new Q(o,1),u>1&&t.attr("start",""+u),e.wrap(t)),e.name="li",c>r&&n&&n.lastChild.append(t),r=c,a(e),i(e,/^\u00a0+/),i(e,/^\s*([\u2022\u00b7\u00a7\u25CF]|\w+\.)/),i(e,/^\u00a0+/)},c=[],s=e.firstChild;null!=s;)if(c.push(s),null!==(s=s.walk()))for(;void 0!==s&&s.parent!==e;)s=s.walk();for(var l=0;l<c.length;l++)if("p"===(e=c[l]).name&&e.firstChild){var f=o(e);if(/^[\s\u00a0]*[\u2022\u00b7\u00a7\u25CF]\s*/.test(f)){u(e,"ul");continue}if(oe(f)){var d=/([0-9]+)\./.exec(f),m=1;d&&(m=parseInt(d[1],10)),u(e,"ol",m);continue}if(e._listLevel){u(e,"ul",1);continue}t=null}else n=t,t=null}(u),t=J({validate:F(e)},i).serialize(u)},ue=function(e,t){return{content:e,cancelled:t}},ce=function(e,t,n,r){var o=function(e,t,n,r){return e.fire("PastePreProcess",{content:t,internal:n,wordContent:r})}(e,t,n,r),i=function(e,t){var n=Y({},e.schema);n.addNodeFilter("meta",(function(e){z.each(e,(function(e){e.remove()}))}));var r=n.parse(t,{forced_root_block:!1,isRootContent:!0});return J({validate:F(e)},e.schema).serialize(r)}(e,o.content);return e.hasEventListeners("PastePostProcess")&&!o.isDefaultPrevented()?function(e,t,n,r){var o=e.dom.create("div",{style:"display:none"},t),i=function(e,t,n,r){return e.fire("PastePostProcess",{node:t,internal:n,wordContent:r})}(e,o,n,r);return ue(i.node.innerHTML,i.isDefaultPrevented())}(e,i,n,r):ue(i,o.isDefaultPrevented())},se=function(e,t,n){var r=re(t),o=r?function(e,t){return function(e){return e.getParam("paste_enable_default_filters",!0)}(e)?ae(e,t):t}(e,t):t;return ce(e,o,n,r)},le=function(e,t){return e.insertContent(t,{merge:P(e),paste:!0}),!0},fe=function(e){return/^https?:\/\/[\w\?\-\/+=.&%@~#]+$/i.test(e)},de=function(e,t){return fe(t)&&x(V(e),(function(e){return n=t.toLowerCase(),r="."+e.toLowerCase(),E(n,r,n.length-r.length);var n,r}))},me=function(e,t,n){return!(!1!==e.selection.isCollapsed()||!fe(t))&&function(e,t,n){return e.undoManager.extra((function(){n(e,t)}),(function(){e.execCommand("mceInsertLink",!1,t)})),!0}(e,t,n)},ge=function(e,t,n){return!!de(e,t)&&function(e,t,n){return e.undoManager.extra((function(){n(e,t)}),(function(){e.insertContent('<img src="'+t+'">')})),!0}(e,t,n)},pe=function(e,t,n){n||!1===function(e){return e.getParam("smart_paste",!0)}(e)?le(e,t):function(e,t){z.each([me,ge,le],(function(n){return!0!==n(e,t,le)}))}(e,t)},he=function(e){return"\n"===e||"\r"===e},ve=function(e,t){var n,r,o,i,a=(n=" ",r=function(e){return e.getParam("paste_tab_spaces",4,"number")}(e),r<=0?"":new Array(r+1).join(n)),u=t.replace(/\t/g,a),c=(o=function(e,t){return function(e){return-1!==" \f\t\v".indexOf(e)}(t)||t===Z?e.pcIsSpace||""===e.str||e.str.length===u.length-1||function(e,t){return t<e.length&&t>=0&&he(e[t])}(u,e.str.length+1)?{pcIsSpace:!1,str:e.str+Z}:{pcIsSpace:!0,str:e.str+" "}:{pcIsSpace:he(t),str:e.str+t}},i={pcIsSpace:!1,str:""},S(u,(function(e,t){i=o(i,e,t)})),i);return c.str},be=function(e,t,n,r){var o=se(e,t,n);!1===o.cancelled&&pe(e,o.content,r)},ye=function(e,t,n){var r=n||W(t);be(e,function(e){return e.replace(U,"")}(t),r,!1)},we=function(e,t){var n=e.dom.encode(t).replace(/\r\n/g,"\n"),r=function(e,t,n){return t?X(e,!0===t?"p":t,n):function(e){return e.replace(/\r?\n/g,"<br>")}(e)}(ve(e,n),function(e){return e.getParam("forced_root_block")}(e),function(e){return e.getParam("forced_root_block_attrs")}(e));be(e,r,!1,!0)},xe=function(e){var t={};if(e){if(e.getData){var n=e.getData("Text");n&&n.length>0&&-1===n.indexOf("data:text/mce-internal,")&&(t["text/plain"]=n)}if(e.types)for(var r=0;r<e.types.length;r++){var o=e.types[r];try{t[o]=e.getData(o)}catch(e){t[o]=""}}}return t},Ce=function(e,t){return t in e&&e[t].length>0},Se=function(e){return Ce(e,"text/html")||Ce(e,"text/plain")},ke=(r="mceclip",o=0,function(){return r+o++}),Te=function(e,t){var n,r,o=(n=t.uri,(r=/data:([^;]+);base64,([a-z0-9\+\/=]+)/i.exec(n))?{type:r[1],data:decodeURIComponent(r[2])}:{type:null,data:null}),i=o.data,a=o.type,u=ke(),s=t.blob,l=new Image;if(l.src=t.uri,function(e,t){var n=function(e){return e.getParam("images_dataimg_filter")}(e);return!n||n(t)}(e,l)){var f=e.editorUpload.blobCache,d=void 0,m=f.getByData(i,a);if(m)d=m;else{var g=function(e){return e.getParam("images_reuse_filename")}(e)&&c(s.name),p=g?function(e,t){var n=t.match(/([\s\S]+?)(?:\.[a-z0-9.]+)$/i);return c(n)?e.dom.encode(n[1]):null}(e,s.name):u,h=g?s.name:void 0;d=f.create(u,s,i,p,h),f.add(d)}ye(e,'<img src="'+d.blobUri()+'">',!1)}else ye(e,'<img src="'+t.uri+'">',!1)},Oe=function(e){return M.all(C(e,(function(e){return new M((function(t){var n=function(e){return c(e.getAsFile)}(e)?e.getAsFile():e,r=new window.FileReader;r.onload=function(){t({blob:n,uri:r.result})},r.readAsDataURL(n)}))})))},_e=function(e){var t=V(e);return function(e){return function(e,t){return E(e,t,0)}(e.type,"image/")&&x(t,(function(t){return n=t.toLowerCase(),r={jpg:"jpeg",jpe:"jpeg",jfi:"jpeg",jif:"jpeg",jfif:"jpeg",pjpeg:"jpeg",pjp:"jpeg",svg:"svg+xml"},(z.hasOwn(r,n)?"image/"+r[n]:"image/"+n)===e.type;var n,r}))}},Ee=function(e,t,n){var r="paste"===t.type?t.clipboardData:t.dataTransfer;if(H(e)&&r){var o=function(e,t){var n=t.items?k(T(t.items),(function(e){return"file"===e.kind?[e.getAsFile()]:[]})):[],r=t.files?T(t.files):[];return function(e,t){for(var n=[],r=0,o=e.length;r<o;r++){var i=e[r];t(i,r)&&n.push(i)}return n}(n.length>0?n:r,_e(e))}(e,r);if(o.length>0)return t.preventDefault(),Oe(o).then((function(t){n&&e.selection.setRng(n),S(t,(function(t){Te(e,t)}))})),!0}return!1},Ae=function(e){return N.metaKeyPressed(e)&&86===e.keyCode||e.shiftKey&&45===e.keyCode},De=function(e,t,n){var r,o=_(),i=_();e.on("keyup",i.clear),e.on("keydown",(function(n){var a=function(e){Ae(e)&&!e.isDefaultPrevented()&&t.remove()};if(Ae(n)&&!n.isDefaultPrevented()){if((r=n.shiftKey&&86===n.keyCode)&&A.webkit&&-1!==navigator.userAgent.indexOf("Version/"))return;if(n.stopImmediatePropagation(),o.set(n),i.set(!0),A.ie&&r)return n.preventDefault(),void function(e,t){e.fire("paste",{ieFake:t})}(e,!0);t.remove(),t.create(),e.once("keyup",a),e.once("paste",(function(){e.off("keyup",a)}))}}));var a=function(e,n,r,o,i){var a;Ce(n,"text/html")?a=n["text/html"]:(a=t.getHtml(),i=i||W(a),t.isDefaultContent(a)&&(o=!0)),a=ne(a),t.remove();var u=!1===i&&!/<(?:\/?(?!(?:div|p|br|span)>)\w+|(?:(?!(?:span style="white-space:\s?pre;?">)|br\s?\/>))\w+\s[^>]+)>/i.test(a),c=fe(a);(!a.length||u&&!c)&&(o=!0),(o||c)&&(a=Ce(n,"text/plain")&&u?n["text/plain"]:function(e){var t=ee(),n=Y({},t),r="",o=t.getShortEndedElements(),i=z.makeMap("script noscript style textarea video audio iframe object"," "),a=t.getBlockElements(),u=function(e){var t=e.name,n=e;if("br"!==t){if("wbr"!==t)if(o[t]&&(r+=" "),i[t])r+=" ";else{if(3===e.type&&(r+=e.value),!e.shortEnded&&(e=e.firstChild))do{u(e)}while(e=e.next);a[t]&&n.next&&(r+="\n","p"===t&&(r+="\n"))}}else r+="\n"};return e=te(e,[/<!\[[^\]]+\]>/g]),u(n.parse(e)),r}(a)),t.isDefaultContent(a)?r||e.windowManager.alert("Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents."):o?we(e,a):ye(e,a,i)};e.on("paste",(function(u){var c=o.isSet()||i.isSet();c&&o.clear();var s=function(e,t){return xe(t.clipboardData||e.getDoc().dataTransfer)}(e,u),l="text"===n.get()||r,f=Ce(s,$());r=!1,u.isDefaultPrevented()||function(e){var t=e.clipboardData;return-1!==navigator.userAgent.indexOf("Android")&&t&&t.items&&0===t.items.length}(u)?t.remove():Se(s)||!Ee(e,u,t.getLastRng()||e.selection.getRng())?(c||u.preventDefault(),!A.ie||c&&!u.ieFake||Ce(s,"text/html")||(t.create(),e.dom.bind(t.getEl(),"paste",(function(e){e.stopPropagation()})),e.getDoc().execCommand("Paste",!1,null),s["text/html"]=t.getHtml()),Ce(s,"text/html")?(u.preventDefault(),f||(f=W(s["text/html"])),a(e,s,c,l,f)):D.setEditorTimeout(e,(function(){a(e,s,c,l,f)}),0)):t.remove()}))},Me=function(e){return A.ie&&e.inline?document.body:e.getBody()},Ne=function(e,t,n){(function(e){return Me(e)!==e.getBody()})(e)&&e.dom.bind(t,"paste keyup",(function(t){Be(e,n)||e.fire("paste")}))},Re=function(e){return e.dom.get("mcepastebin")},ze=function(e,t){return t===e},Be=function(e,t){var n,r=Re(e);return(n=r)&&"mcepastebin"===n.id&&ze(t,r.innerHTML)},Pe=function(e){var t=i(null),n="%MCEPASTEBIN%";return{create:function(){return function(e,t,n){var r=e.dom,o=e.getBody();t.set(e.selection.getRng());var i=e.dom.add(Me(e),"div",{id:"mcepastebin",class:"mce-pastebin",contentEditable:!0,"data-mce-bogus":"all",style:"position: fixed; top: 50%; width: 10px; height: 10px; overflow: hidden; opacity: 0"},n);(A.ie||A.gecko)&&r.setStyle(i,"left","rtl"===r.getStyle(o,"direction",!0)?65535:-65535),r.bind(i,"beforedeactivate focusin focusout",(function(e){e.stopPropagation()})),Ne(e,i,n),i.focus(),e.selection.select(i,!0)}(e,t,n)},remove:function(){return function(e,t){if(Re(e)){for(var n=void 0,r=t.get();n=e.dom.get("mcepastebin");)e.dom.remove(n),e.dom.unbind(n);r&&e.selection.setRng(r)}t.set(null)}(e,t)},getEl:function(){return Re(e)},getHtml:function(){return function(e){var t=function(t,n){t.appendChild(n),e.dom.remove(n,!0)},n=z.grep(Me(e).childNodes,(function(e){return"mcepastebin"===e.id})),r=n.shift();z.each(n,(function(e){t(r,e)}));for(var o=e.dom.select("div[id=mcepastebin]",r),i=o.length-1;i>=0;i--){var a=e.dom.create("div");r.insertBefore(a,o[i]),t(a,o[i])}return r?r.innerHTML:""}(e)},getLastRng:t.get,isDefault:function(){return Be(e,n)},isDefaultContent:function(e){return ze(n,e)}}},Ie=function(e,t){var n=Pe(e);return e.on("PreInit",(function(){return function(e,t,n){var r;De(e,t,n),e.parser.addNodeFilter("img",(function(t,n,o){var i=function(e){e.attr("data-mce-object")||r===A.transparentSrc||e.remove()},a=function(e){return 0===e.indexOf("webkit-fake-url")},u=function(e){return 0===e.indexOf("data:")};if(!H(e)&&function(e){return e.data&&!0===e.data.paste}(o))for(var c=t.length;c--;)(r=t[c].attr("src"))&&(a(r)||!L(e)&&u(r))&&i(t[c])}))}(e,n,t)})),{pasteFormat:t,pasteHtml:function(t,n){return ye(e,t,n)},pasteText:function(t){return we(e,t)},pasteImageData:function(t,n){return Ee(e,t,n)},getDataTransferItems:xe,hasHtmlOrText:Se,hasContentType:Ce}},Fe=function(e,t){e.addCommand("mceTogglePlainTextPaste",(function(){!function(e,t){"text"===t.pasteFormat.get()?(t.pasteFormat.set("html"),R(e,!1)):(t.pasteFormat.set("text"),R(e,!0)),e.focus()}(e,t)})),e.addCommand("mceInsertClipboardContent",(function(e,n){n.content&&t.pasteHtml(n.content,n.internal),n.text&&t.pasteText(n.text)}))},Le=function(e,t,n){if(!function(e){return!1===A.iOS&&"function"==typeof(null==e?void 0:e.setData)}(e))return!1;try{return e.clearData(),e.setData("text/html",t),e.setData("text/plain",n),e.setData($(),t),!0}catch(e){return!1}},He=function(e,t,n,r){Le(e.clipboardData,t.html,t.text)?(e.preventDefault(),r()):n(t.html,r)},Ve=function(e){return function(t,n){var r=function(e){return U+e}(t),o=e.dom.create("div",{contenteditable:"false","data-mce-bogus":"all"}),i=e.dom.create("div",{contenteditable:"true"},r);e.dom.setStyles(o,{position:"fixed",top:"0",left:"-3000px",width:"1000px",overflow:"hidden"}),o.appendChild(i),e.dom.add(e.getBody(),o);var a=e.selection.getRng();i.focus();var u=e.dom.createRng();u.selectNodeContents(i),e.selection.setRng(u),D.setTimeout((function(){e.selection.setRng(a),o.parentNode.removeChild(o),n()}),0)}},je=function(e){return{html:e.selection.getContent({contextual:!0}),text:e.selection.getContent({format:"text"})}},Ue=function(e){return!e.selection.isCollapsed()||function(e){return!!e.dom.getParent(e.selection.getStart(),"td[data-mce-selected],th[data-mce-selected]",e.getBody())}(e)},We=function(e){e.on("cut",function(e){return function(t){Ue(e)&&He(t,je(e),Ve(e),(function(){if(A.browser.isChrome()||A.browser.isFirefox()){var t=e.selection.getRng();D.setEditorTimeout(e,(function(){e.selection.setRng(t),e.execCommand("Delete")}),0)}else e.execCommand("Delete")}))}}(e)),e.on("copy",function(e){return function(t){Ue(e)&&He(t,je(e),Ve(e),l)}}(e))},$e=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),qe=function(e,t){return $e.getCaretRangeFromPoint(t.clientX,t.clientY,e.getDoc())},Ge=function(e,t){e.focus(),e.selection.setRng(t)},Ke=function(e,t){e.on("PastePreProcess",(function(n){n.content=t(e,n.content,n.internal,n.wordContent)}))},Xe=function(e,t){if(!re(t))return t;var n=[];z.each(e.schema.getBlockElements(),(function(e,t){n.push(t)}));var r=new RegExp("(?:<br>&nbsp;[\\s\\r\\n]+|<br>)*(<\\/?("+n.join("|")+")[^>]*>)(?:<br>&nbsp;[\\s\\r\\n]+|<br>)*","g");return t=te(t,[[r,"$1"]]),t=te(t,[[/<br><br>/g,"<BR><BR>"],[/<br>/g," "],[/<BR><BR>/g,"<br>"]])},Ye=function(e,t,n,r){if(r||n)return t;var o,i=function(e){return e.getParam("paste_webkit_styles")}(e);if(!1===function(e){return e.getParam("paste_remove_styles_if_webkit",!0)}(e)||"all"===i)return t;if(i&&(o=i.split(/[, ]/)),o){var a=e.dom,u=e.selection.getNode();t=t.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,(function(e,t,n,r){var i=a.parseStyle(a.decode(n)),c={};if("none"===o)return t+r;for(var s=0;s<o.length;s++){var l=i[o[s]],f=a.getStyle(u,o[s],!0);/color/.test(o[s])&&(l=a.toHex(l),f=a.toHex(f)),f!==l&&(c[o[s]]=l)}var d=a.serializeStyle(c,"span");return d?t+' style="'+d+'"'+r:t+r}))}else t=t.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,"$1$3");return t=t.replace(/(<[^>]+) data-mce-style="([^"]+)"([^>]*>)/gi,(function(e,t,n,r){return t+' style="'+n+'"'+r})),t},Je=function(e,t){e.$("a",t).find("font,u").each((function(t,n){e.dom.remove(n,!0)}))},Ze=function(e,t){return function(n){n.setActive("text"===t.pasteFormat.get());var r=function(e){return n.setActive(e.state)};return e.on("PastePlainTextToggle",r),function(){return e.off("PastePlainTextToggle",r)}}};a.add("paste",(function(e){if(!1===function(e){return!!e.hasPlugin("powerpaste",!0)&&(void 0!==window.console&&window.console.log&&window.console.log("PowerPaste is incompatible with Paste plugin! Remove 'paste' from the 'plugins' option."),!0)}(e)){var t=i(!1),n=i(function(e){return e.getParam("paste_as_text",!1)}(e)?"text":"html"),r=Ie(e,n);return function(e){A.webkit&&Ke(e,Ye),A.ie&&(Ke(e,Xe),function(e,t){e.on("PastePostProcess",(function(n){t(e,n.node)}))}(e,Je))}(e),function(e,t){var n=function(){return e.execCommand("mceTogglePlainTextPaste")};e.ui.registry.addToggleButton("pastetext",{active:!1,icon:"paste-text",tooltip:"Paste as text",onAction:n,onSetup:Ze(e,t)}),e.ui.registry.addToggleMenuItem("pastetext",{text:"Paste as text",icon:"paste-text",onAction:n,onSetup:Ze(e,t)})}(e,r),Fe(e,r),function(e){var t=e.plugins.paste,n=function(e){return e.getParam("paste_preprocess")}(e);n&&e.on("PastePreProcess",(function(e){n.call(t,t,e)}));var r=function(e){return e.getParam("paste_postprocess")}(e);r&&e.on("PastePostProcess",(function(e){r.call(t,t,e)}))}(e),We(e),function(e,t,n){(function(e){return e.getParam("paste_block_drop",!1)})(e)&&e.on("dragend dragover draggesture dragdrop drop drag",(function(e){e.preventDefault(),e.stopPropagation()})),B(e)||e.on("drop",(function(e){var t=e.dataTransfer;t&&t.files&&t.files.length>0&&e.preventDefault()})),e.on("drop",(function(r){var o=qe(e,r);if(!r.isDefaultPrevented()&&!n.get()){var i,a=t.getDataTransferItems(r.dataTransfer),u=t.hasContentType(a,$());if((t.hasHtmlOrText(a)&&(!(i=a["text/plain"])||0!==i.indexOf("file://"))||!t.pasteImageData(r,o))&&o&&function(e){return e.getParam("paste_filter_drop",!0)}(e)){var c=a["mce-internal"]||a["text/html"]||a["text/plain"];c&&(r.preventDefault(),D.setEditorTimeout(e,(function(){e.undoManager.transact((function(){a["mce-internal"]&&e.execCommand("Delete"),Ge(e,o),c=ne(c),a["text/html"]?t.pasteHtml(c,u):t.pasteText(c)}))})))}}})),e.on("dragstart",(function(e){n.set(!0)})),e.on("dragover dragend",(function(t){B(e)&&!1===n.get()&&(t.preventDefault(),Ge(e,qe(e,t))),"dragend"===t.type&&n.set(!1)}))}(e,r,t),function(e){return{clipboard:e}}(r)}}))}(),function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.Env"),n=tinymce.util.Tools.resolve("tinymce.util.Tools"),r=function(e){var r=function(e){var r="",o=e.dom.encode,i=function(e){return e.getParam("content_style","","string")}(e);r+='<base href="'+o(e.documentBaseURI.getURI())+'">';var a=function(e){return e.getParam("content_css_cors",!1,"boolean")}(e)?' crossorigin="anonymous"':"";n.each(e.contentCSS,(function(t){r+='<link type="text/css" rel="stylesheet" href="'+o(e.documentBaseURI.toAbsolute(t))+'"'+a+">"})),i&&(r+='<style type="text/css">'+i+"</style>");var u=function(e){var t=e.getParam("body_id","tinymce","string");return-1===t.indexOf("=")?t:function(e){var t=e.getParam("body_id","","hash");return t[e.id]||t}(e)}(e),c=function(e){var t=e.getParam("body_class","","string");return-1===t.indexOf("=")?t:function(e){return e.getParam("body_class","","hash")[e.id]||""}(e)}(e),s='<script>document.addEventListener && document.addEventListener("click", function(e) {for (var elm = e.target; elm; elm = elm.parentNode) {if (elm.nodeName === "A" && !('+(t.mac?"e.metaKey":"e.ctrlKey && !e.altKey")+")) {e.preventDefault();}}}, false);<\/script> ",l=e.getBody().dir,f=l?' dir="'+o(l)+'"':"";return"<!DOCTYPE html><html><head>"+r+'</head><body id="'+o(u)+'" class="mce-content-body '+o(c)+'"'+f+">"+e.getContent()+s+"</body></html>"}(e);e.windowManager.open({title:"Preview",size:"large",body:{type:"panel",items:[{name:"preview",type:"iframe",sandboxed:!0}]},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}],initialData:{preview:r}}).focus("close")};e.add("preview",(function(e){!function(e){e.addCommand("mcePreview",(function(){r(e)}))}(e),function(e){var t=function(){return e.execCommand("mcePreview")};e.ui.registry.addButton("preview",{icon:"preview",tooltip:"Preview",onAction:t}),e.ui.registry.addMenuItem("preview",{icon:"preview",text:"Preview",onAction:t})}(e)}))}(),function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.Env");e.add("print",(function(e){!function(e){e.addCommand("mcePrint",(function(){t.browser.isIE()?e.getDoc().execCommand("print",!1,null):e.getWin().print()}))}(e),function(e){var t=function(){return e.execCommand("mcePrint")};e.ui.registry.addButton("print",{icon:"print",tooltip:"Print",onAction:t}),e.ui.registry.addMenuItem("print",{text:"Print...",icon:"print",onAction:t})}(e),e.addShortcut("Meta+P","","mcePrint")}))}(),function(){"use strict";var e,t,n,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=0,i=function(e,t,n){var r,i,a=e.editorUpload.blobCache,u=a.create((r="mceu",i=(new Date).getTime(),r+"_"+Math.floor(1e9*Math.random())+ ++o+String(i)),n,t);a.add(u),e.insertContent(e.dom.createHTML("img",{src:u.blobUri()}))},a=tinymce.util.Tools.resolve("tinymce.util.Promise"),u=tinymce.util.Tools.resolve("tinymce.Env"),c=tinymce.util.Tools.resolve("tinymce.util.Delay"),s=function(e){e.ui.registry.addButton("quickimage",{icon:"image",tooltip:"Insert image",onAction:function(){(function(e){return new a((function(t){var n=document.createElement("input");n.type="file",n.accept="image/*",n.style.position="fixed",n.style.left="0",n.style.top="0",n.style.opacity="0.001",document.body.appendChild(n),n.addEventListener("change",(function(e){t(Array.prototype.slice.call(e.target.files))}));var r=function(o){var i=function(){t([]),n.parentNode.removeChild(n)};u.os.isAndroid()&&"remove"!==o.type?c.setEditorTimeout(e,i,0):i(),e.off("focusin remove",r)};e.on("focusin remove",r),n.click()}))})(e).then((function(t){if(t.length>0){var n=t[0];(r=n,new a((function(e){var t=new FileReader;t.onloadend=function(){e(t.result.split(",")[1])},t.readAsDataURL(r)}))).then((function(t){i(e,t,n)}))}var r}))}}),e.ui.registry.addButton("quicktable",{icon:"table",tooltip:"Insert table",onAction:function(){!function(e,t,n){e.plugins.table?e.plugins.table.insertTable(t,n):function(e,t,n){e.undoManager.transact((function(){e.insertContent(function(e,t){var n='<table data-mce-id="mce" style="width: 100%">';n+="<tbody>";for(var r=0;r<t;r++){n+="<tr>";for(var o=0;o<e;o++)n+="<td><br></td>";n+="</tr>"}return(n+="</tbody>")+"</table>"}(t,n));var r=function(e){return e.dom.select("*[data-mce-id]")[0]}(e);r.removeAttribute("data-mce-id");var o=e.dom.select("td,th",r);e.selection.setCursorLocation(o[0],0)}))}(e,t,n)}(e,2,2)}})},l=function(e){return function(t){return r=typeof(n=t),(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)===e;var n,r}},f=function(e){return function(t){return typeof t===e}},d=l("string"),m=l("object"),g=l("array"),p=f("boolean"),h=(e=void 0,function(t){return e===t}),v=f("function"),b=function(){},y=function(e){return function(){return e}},w=function(e){return e},x=y(!1),C=y(!0),S=function(){return k},k={fold:function(e,t){return e()},isSome:x,isNone:C,getOr:n=w,getOrThunk:t=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:y(null),getOrUndefined:y(void 0),or:n,orThunk:t,map:S,each:b,bind:S,exists:x,forall:C,filter:function(){return S()},toArray:function(){return[]},toString:y("none()")},T=function(e){var t=y(e),n=function(){return o},r=function(t){return t(e)},o={fold:function(t,n){return n(e)},isSome:C,isNone:x,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:n,orThunk:n,map:function(t){return T(t(e))},each:function(t){t(e)},bind:r,exists:r,forall:r,filter:function(t){return t(e)?o:k},toArray:function(){return[e]},toString:function(){return"some("+e+")"}};return o},O={some:T,none:S,from:function(e){return null==e?k:T(e)}};function _(e,t,n,r,o){return e(n,r)?O.some(n):v(o)&&o(n)?O.none():t(n,r,o)}var E=function(e){if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}},A={fromHtml:function(e,t){var n=(t||document).createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return E(n.childNodes[0])},fromTag:function(e,t){var n=(t||document).createElement(e);return E(n)},fromText:function(e,t){var n=(t||document).createTextNode(e);return E(n)},fromDom:E,fromPoint:function(e,t,n){return O.from(e.dom.elementFromPoint(t,n)).map(E)}},D=function(e,t){var n=e.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(t);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(t);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(t);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")};"undefined"!=typeof window?window:Function("return this;")();var M,N=function(e,t,n){for(var r=e.dom,o=v(n)?n:x;r.parentNode;){r=r.parentNode;var i=A.fromDom(r);if(t(i))return O.some(i);if(o(i))break}return O.none()},R=function(e,t,n){return N(e,(function(e){return D(e,t)}),n)},z=(M=d,function(e,t,n){return function(e,t){if(t(e))return!0;throw new Error("Default value doesn't match requested type.")}(n,M),function(e,t){if(g(e)||m(e))throw new Error("expected a string but found: "+e);return h(e)?t:p(e)?!1===e?"":t:e}(e.getParam(t,n),n)}),B=function(e){var t=function(e){return z(e,"quickbars_insert_toolbar","quickimage quicktable")}(e);t.trim().length>0&&e.ui.registry.addContextToolbar("quickblock",{predicate:function(t){var n=A.fromDom(t),r=e.schema.getTextBlockElements(),o=function(t){return t.dom===e.getBody()};return function(e,t,n){return _((function(e,t){return D(e,t)}),R,e,t,n)}(n,"table",o).fold((function(){return function(e,t,n){return _((function(e,t){return t(e)}),N,e,t,n)}(n,(function(t){return t.dom.nodeName.toLowerCase()in r&&e.dom.isEmpty(t.dom)}),o).isSome()}),x)},items:t,position:"line",scope:"editor"})},P=function(e){var t=function(e){return"IMG"===e.nodeName||"FIGURE"===e.nodeName&&/image/i.test(e.className)},n=function(e){return z(e,"quickbars_image_toolbar","alignleft aligncenter alignright")}(e);n.trim().length>0&&e.ui.registry.addContextToolbar("imageselection",{predicate:t,items:n,position:"node"});var r=function(e){return z(e,"quickbars_selection_toolbar","bold italic | quicklink h2 h3 blockquote")}(e);r.trim().length>0&&e.ui.registry.addContextToolbar("textselection",{predicate:function(n){return!t(n)&&!e.selection.isCollapsed()&&function(t){return"false"!==e.dom.getContentEditableParent(t)}(n)},items:r,position:"selection",scope:"editor"})};r.add("quickbars",(function(e){s(e),B(e),P(e)}))}(),function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),n=tinymce.util.Tools.resolve("tinymce.util.Tools"),r=function(e){return e.getParam("save_enablewhendirty",!0)},o=function(e,t){e.notificationManager.open({text:t,type:"error"})},i=function(e){e.addCommand("mceSave",(function(){!function(e){var n=t.DOM.getParent(e.id,"form");if(!r(e)||e.isDirty()){if(e.save(),function(e){return!!e.getParam("save_onsavecallback")}(e))return e.execCallback("save_onsavecallback",e),void e.nodeChanged();n?(e.setDirty(!1),n.onsubmit&&!n.onsubmit()||("function"==typeof n.submit?n.submit():o(e,"Error: Form submit field collision.")),e.nodeChanged()):o(e,"Error: No form element found.")}}(e)})),e.addCommand("mceCancel",(function(){!function(e){var t=n.trim(e.startContent);!function(e){return!!e.getParam("save_oncancelcallback")}(e)?e.resetContent(t):e.execCallback("save_oncancelcallback",e)}(e)}))},a=function(e){return function(t){var n=function(){t.setDisabled(r(e)&&!e.isDirty())};return n(),e.on("NodeChange dirty",n),function(){return e.off("NodeChange dirty",n)}}};e.add("save",(function(e){!function(e){e.ui.registry.addButton("save",{icon:"save",tooltip:"Save",disabled:!0,onAction:function(){return e.execCommand("mceSave")},onSetup:a(e)}),e.ui.registry.addButton("cancel",{icon:"cancel",tooltip:"Cancel",disabled:!0,onAction:function(){return e.execCommand("mceCancel")},onSetup:a(e)}),e.addShortcut("Meta+S","","mceSave")}(e),i(e)}))}(),function(){"use strict";var e,t,n=function(e){var t=e;return{get:function(){return t},set:function(e){t=e}}},r=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=function(){return o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},o.apply(this,arguments)},i=function(e){return function(t){return r=typeof(n=t),(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)===e;var n,r}},a=function(e){return function(t){return typeof t===e}},u=i("string"),c=i("array"),s=a("boolean"),l=a("number"),f=function(){},d=function(e){return function(){return e}},m=function(e){return e},g=d(!1),p=d(!0),h=d("[!-#%-*,-\\/:;?@\\[-\\]_{}¡«·»¿;·՚-՟։֊־׀׃׆׳״؉؊،؍؛؞؟٪-٭۔܀-܍߷-߹࠰-࠾࡞।॥॰෴๏๚๛༄-༒༺-༽྅࿐-࿔࿙࿚၊-၏჻፡-፨᐀᙭᙮᚛᚜᛫-᛭᜵᜶។-៖៘-៚᠀-᠊᥄᥅᨞᨟᪠-᪦᪨-᪭᭚-᭠᯼-᯿᰻-᰿᱾᱿᳓‐-‧‰-⁃⁅-⁑⁓-⁞⁽⁾₍₎〈〉❨-❵⟅⟆⟦-⟯⦃-⦘⧘-⧛⧼⧽⳹-⳼⳾⳿⵰⸀-⸮⸰⸱、-〃〈-】〔-〟〰〽゠・꓾꓿꘍-꘏꙳꙾꛲-꛷꡴-꡷꣎꣏꣸-꣺꤮꤯꥟꧁-꧍꧞꧟꩜-꩟꫞꫟꯫﴾﴿︐-︙︰-﹒﹔-﹡﹣﹨﹪﹫!-#%-*,-/:;?@[-]_{}⦅-・]"),v=function(){return b},b={fold:function(e,t){return e()},isSome:g,isNone:p,getOr:t=m,getOrThunk:e=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:d(null),getOrUndefined:d(void 0),or:t,orThunk:e,map:v,each:f,bind:v,exists:g,forall:p,filter:function(){return v()},toArray:function(){return[]},toString:d("none()")},y=function(e){var t=d(e),n=function(){return o},r=function(t){return t(e)},o={fold:function(t,n){return n(e)},isSome:p,isNone:g,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:n,orThunk:n,map:function(t){return y(t(e))},each:function(t){t(e)},bind:r,exists:r,forall:r,filter:function(t){return t(e)?o:b},toArray:function(){return[e]},toString:function(){return"some("+e+")"}};return o},w={some:y,none:v,from:function(e){return null==e?b:y(e)}},x=h,C=tinymce.util.Tools.resolve("tinymce.util.Tools"),S=Array.prototype.slice,k=Array.prototype.push,T=function(e,t){for(var n=e.length,r=new Array(n),o=0;o<n;o++){var i=e[o];r[o]=t(i,o)}return r},O=function(e,t){for(var n=0,r=e.length;n<r;n++){t(e[n],n)}},_=function(e,t){for(var n=e.length-1;n>=0;n--){t(e[n],n)}},E=function(e,t){return function(e){for(var t=[],n=0,r=e.length;n<r;++n){if(!c(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);k.apply(t,e[n])}return t}(T(e,t))},A=Object.hasOwnProperty,D=function(e,t){return A.call(e,t)};"undefined"!=typeof window?window:Function("return this;")();var M,N,R,z,B=(M=3,function(e){return function(e){return e.dom.nodeType}(e)===M}),P=function(e,t,n){!function(e,t,n){if(!(u(n)||s(n)||l(n)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",n,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,n+"")}(e.dom,t,n)},I=function(e){if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}},F={fromHtml:function(e,t){var n=(t||document).createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return I(n.childNodes[0])},fromTag:function(e,t){var n=(t||document).createElement(e);return I(n)},fromText:function(e,t){var n=(t||document).createTextNode(e);return I(n)},fromDom:I,fromPoint:function(e,t,n){return w.from(e.dom.elementFromPoint(t,n)).map(I)}},L=function(e,t){return{element:e,offset:t}},H=function(e,t){var n=function(e){return T(e.dom.childNodes,F.fromDom)}(e);return n.length>0&&t<n.length?L(n[t],0):L(e,t)},V=function(e,t){var n=function(e){return w.from(e.dom.parentNode).map(F.fromDom)}(e);n.each((function(n){n.dom.insertBefore(t.dom,e.dom)}))},j=function(e,t){V(e,t),function(e,t){e.dom.appendChild(t.dom)}(t,e)},U=(N=B,R="text",{get:function(e){if(!N(e))throw new Error("Can only get "+R+" value of a "+R+" node");return z(e).getOr("")},getOption:z=function(e){return N(e)?w.from(e.dom.nodeValue):w.none()},set:function(e,t){if(!N(e))throw new Error("Can only set raw "+R+" value of a "+R+" node");e.dom.nodeValue=t}}),W=function(e){return U.get(e)},$=function(e,t){return function(e,t){var n,r=void 0===t?document:t.dom;return 1!==(n=r).nodeType&&9!==n.nodeType&&11!==n.nodeType||0===n.childElementCount?[]:T(r.querySelectorAll(e),F.fromDom)}(t,e)},q=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),G=function(e,t){return e.isBlock(t)||D(e.schema.getShortEndedElements(),t.nodeName)},K=function(e,t){return"false"===e.getContentEditable(t)},X=function(e,t){return!e.isBlock(t)&&D(e.schema.getWhiteSpaceElements(),t.nodeName)},Y=function(e,t){return H(F.fromDom(e),t)},J=function(e,t,n,r,o,i){void 0===i&&(i=!0);for(var a=i?t(!1):n;a;){var u=K(e,a);if(u||X(e,a)){if(u?r.cef(a):r.boundary(a))break;a=t(!0)}else{if(G(e,a)){if(r.boundary(a))break}else 3===a.nodeType&&r.text(a);if(a===o)break;a=t(!1)}}},Z=function(e,t,n,r,o){if(!function(e,t){return G(e,t)||K(e,t)||X(e,t)||function(e,t){return"true"===e.getContentEditable(t)&&"false"===e.getContentEditableParent(t.parentNode)}(e,t)}(e,n)){var i=e.getParent(r,e.isBlock),a=new q(n,i),u=o?a.next.bind(a):a.prev.bind(a);J(e,u,n,{boundary:p,cef:p,text:function(e){o?t.fOffset+=e.length:t.sOffset+=e.length,t.elements.push(F.fromDom(e))}})}},Q=function(e,t,n,r,o,i){void 0===i&&(i=!0);var a=new q(n,t),u=[],c={sOffset:0,fOffset:0,elements:[]};Z(e,c,n,t,!1);var s=function(){return c.elements.length>0&&(u.push(c),c={sOffset:0,fOffset:0,elements:[]}),!1};return J(e,a.next.bind(a),n,{boundary:s,cef:function(e){return s(),o&&u.push.apply(u,o.cef(e)),!1},text:function(e){c.elements.push(F.fromDom(e)),o&&o.text(e,c)}},r,i),r&&Z(e,c,r,t,!0),s(),u},ee=function(e,t){var n=Y(t.startContainer,t.startOffset),r=n.element.dom,o=Y(t.endContainer,t.endOffset),i=o.element.dom;return Q(e,t.commonAncestorContainer,r,i,{text:function(e,t){e===i?t.fOffset+=e.length-o.offset:e===r&&(t.sOffset+=n.offset)},cef:function(t){var n,r,o,i=E($(F.fromDom(t),"*[contenteditable=true]"),(function(t){var n=t.dom;return Q(e,n,n)}));return n=i,r=function(e,t){return function(e,t){return function(e,t,n){return 0!=(e.compareDocumentPosition(t)&n)}(e,t,Node.DOCUMENT_POSITION_PRECEDING)}(e.elements[0].dom,t.elements[0].dom)?1:-1},(o=S.call(n,0)).sort(r),o}},!1)},te=function(e,t){return t.collapsed?[]:ee(e,t)},ne=function(e,t){var n=e.createRng();return n.selectNode(t),te(e,n)},re=function(e,t){var n,r,o,i=(n=e,r=function(e,n){var r=W(n),o=e.last,i=o+r.length,a=E(t,(function(e,t){return e.start<i&&e.finish>o?[{element:n,start:Math.max(o,e.start)-o,finish:Math.min(i,e.finish)-o,matchId:t}]:[]}));return{results:e.results.concat(a),last:i}},o={results:[],last:0},O(n,(function(e,t){o=r(o,e,t)})),o).results;return function(e,t){if(0===e.length)return[];for(var n=t(e[0]),r=[],o=[],i=0,a=e.length;i<a;i++){var u=e[i],c=t(u);c!==n&&(r.push(o),o=[]),n=c,o.push(u)}return 0!==o.length&&r.push(o),r}(i,(function(e){return e.matchId}))},oe=function(e,t){return E(t,(function(t){var n=t.elements,r=T(n,W).join(""),o=function(e,t,n,r){void 0===n&&(n=0),void 0===r&&(r=e.length);var o=t.regex;o.lastIndex=n;for(var i,a=[];i=o.exec(e);){var u=i[t.matchIndex],c=i.index+i[0].indexOf(u),s=c+u.length;if(s>r)break;a.push({start:c,finish:s}),o.lastIndex=s}return a}(r,e,t.sOffset,r.length-t.fOffset);return re(n,o)}))},ie=function(e,t){_(e,(function(e,n){_(e,(function(e){var r=F.fromDom(t.cloneNode(!1));P(r,"data-mce-index",n);var o=e.element.dom;if(o.length===e.finish&&0===e.start)j(e.element,r);else{o.length!==e.finish&&o.splitText(e.finish);var i=o.splitText(e.start);j(F.fromDom(i),r)}}))}))},ae=function(e,t,n,r){var o=n.getBookmark(),i=e.select("td[data-mce-selected],th[data-mce-selected]"),a=i.length>0?function(e,t){return E(t,(function(t){return ne(e,t)}))}(e,i):te(e,n.getRng()),u=oe(t,a);return ie(u,r),n.moveToBookmark(o),u.length},ue=function(e){var t=e.getAttribute("data-mce-index");return"number"==typeof t?""+t:t},ce=function(e,t,n,r){var o=e.dom.create("span",{"data-mce-bogus":1});o.className="mce-match-marker";var i=e.getBody();return be(e,t,!1),r?ae(e.dom,n,e.selection,o):function(e,t,n,r){var o=ne(e,n),i=oe(t,o);return ie(i,r),i.length}(e.dom,n,i,o)},se=function(e){var t=e.parentNode;e.firstChild&&t.insertBefore(e.firstChild,e),e.parentNode.removeChild(e)},le=function(e,t){var n=[],r=C.toArray(e.getBody().getElementsByTagName("span"));if(r.length)for(var o=0;o<r.length;o++){var i=ue(r[o]);null!==i&&i.length&&(i===t.toString()&&n.push(r[o]))}return n},fe=function(e,t,n){var r=t.get(),o=r.index,i=e.dom;(n=!1!==n)?o+1===r.count?o=0:o++:o-1==-1?o=r.count-1:o--,i.removeClass(le(e,r.index),"mce-match-marker-selected");var a=le(e,o);return a.length?(i.addClass(le(e,o),"mce-match-marker-selected"),e.selection.scrollIntoView(a[0]),o):-1},de=function(e,t){var n=t.parentNode;e.remove(t),e.isEmpty(n)&&e.remove(n)},me=function(e,t,n,r,o,i){var a=function(e,t){var n="("+e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&").replace(/\s/g,"[^\\S\\r\\n\\uFEFF]")+")";return t?"(?:^|\\s|"+x()+")"+n+"(?=$|\\s|"+x()+")":n}(n,o),u={regex:new RegExp(a,r?"g":"gi"),matchIndex:1},c=ce(e,t,u,i);if(c){var s=fe(e,t,!0);t.set({index:s,count:c,text:n,matchCase:r,wholeWord:o,inSelection:i})}return c},ge=function(e,t){var n=fe(e,t,!0);t.set(o(o({},t.get()),{index:n}))},pe=function(e,t){var n=fe(e,t,!1);t.set(o(o({},t.get()),{index:n}))},he=function(e){var t=ue(e);return null!==t&&t.length>0},ve=function(e,t,n,r,i){var a,u=t.get(),c=u.index,s=c;r=!1!==r;for(var l=e.getBody(),f=C.grep(C.toArray(l.getElementsByTagName("span")),he),d=0;d<f.length;d++){var m=ue(f[d]),g=a=parseInt(m,10);if(i||g===u.index){for(n.length?(f[d].firstChild.nodeValue=n,se(f[d])):de(e.dom,f[d]);f[++d];){if((g=parseInt(ue(f[d]),10))!==a){d--;break}de(e.dom,f[d])}r&&s--}else a>c&&f[d].setAttribute("data-mce-index",String(a-1))}return t.set(o(o({},u),{count:i?0:u.count-1,index:s})),r?ge(e,t):pe(e,t),!i&&t.get().count>0},be=function(e,t,n){for(var r,i,a=t.get(),u=C.toArray(e.getBody().getElementsByTagName("span")),c=0;c<u.length;c++){var s=ue(u[c]);null!==s&&s.length&&(s===a.index.toString()&&(r||(r=u[c].firstChild),i=u[c].firstChild),se(u[c]))}if(t.set(o(o({},a),{index:-1,count:0,text:""})),r&&i){var l=e.dom.createRng();return l.setStart(r,0),l.setEnd(i,i.data.length),!1!==n&&e.selection.setRng(l),l}},ye=function(){var e=function(e){var t=n(w.none()),r=function(){return t.get().each(e)};return{clear:function(){r(),t.set(w.none())},isSet:function(){return t.get().isSome()},get:function(){return t.get()},set:function(e){r(),t.set(w.some(e))}}}(f);return o(o({},e),{on:function(t){return e.get().each(t)}})},we=tinymce.util.Tools.resolve("tinymce.Env"),xe=function(e,t){var n=ye();e.undoManager.add();var r=C.trim(e.selection.getContent({format:"text"})),i=function(e){var n=function(e,t){return t.get().count>1}(0,t)?e.enable:e.disable;n("next");var r=function(e,t){return t.get().count>1}(0,t)?e.enable:e.disable;r("prev")},a=function(e,t){var n=t?e.disable:e.enable;O(["replace","replaceall","prev","next"],n)},u=function(e,t){we.browser.isSafari()&&we.deviceType.isTouch()&&("find"===t||"replace"===t||"replaceall"===t)&&e.focus(t)},c=function(n){be(e,t,!1),a(n,!0),i(n)},s=function(n){var r=n.getData(),o=t.get();if(r.findtext.length){if(o.text===r.findtext&&o.matchCase===r.matchcase&&o.wholeWord===r.wholewords)ge(e,t);else{var u=me(e,t,r.findtext,r.matchcase,r.wholewords,r.inselection);u<=0&&function(t){e.windowManager.alert("Could not find the specified string.",(function(){t.focus("findtext")}))}(n),a(n,0===u)}i(n)}else c(n)},l=t.get(),f={title:"Find and Replace",size:"normal",body:{type:"panel",items:[{type:"bar",items:[{type:"input",name:"findtext",placeholder:"Find",maximized:!0,inputMode:"search"},{type:"button",name:"prev",text:"Previous",icon:"action-prev",disabled:!0,borderless:!0},{type:"button",name:"next",text:"Next",icon:"action-next",disabled:!0,borderless:!0}]},{type:"input",name:"replacetext",placeholder:"Replace with",inputMode:"search"}]},buttons:[{type:"menu",name:"options",icon:"preferences",tooltip:"Preferences",align:"start",items:[{type:"togglemenuitem",name:"matchcase",text:"Match case"},{type:"togglemenuitem",name:"wholewords",text:"Find whole words only"},{type:"togglemenuitem",name:"inselection",text:"Find in selection"}]},{type:"custom",name:"find",text:"Find",primary:!0},{type:"custom",name:"replace",text:"Replace",disabled:!0},{type:"custom",name:"replaceall",text:"Replace all",disabled:!0}],initialData:{findtext:r,replacetext:"",wholewords:l.wholeWord,matchcase:l.matchCase,inselection:l.inSelection},onChange:function(e,n){"findtext"===n.name&&t.get().count>0&&c(e)},onAction:function(n,r){var a=n.getData();switch(r.name){case"find":s(n);break;case"replace":ve(e,t,a.replacetext)?i(n):c(n);break;case"replaceall":ve(e,t,a.replacetext,!0,!0),c(n);break;case"prev":pe(e,t),i(n);break;case"next":ge(e,t),i(n);break;case"matchcase":case"wholewords":case"inselection":!function(e){var n=e.getData(),r=t.get();t.set(o(o({},r),{matchCase:n.matchcase,wholeWord:n.wholewords,inSelection:n.inselection}))}(n),c(n)}u(n,r.name)},onSubmit:function(e){s(e),u(e,"find")},onClose:function(){e.focus(),be(e,t),e.undoManager.add()}};n.set(e.windowManager.open(f,{inline:"toolbar"}))},Ce=function(e,t){return function(){xe(e,t)}};r.add("searchreplace",(function(e){var t=n({index:-1,count:0,text:"",matchCase:!1,wholeWord:!1,inSelection:!1});return function(e,t){e.addCommand("SearchReplace",(function(){xe(e,t)}))}(e,t),function(e,t){e.ui.registry.addMenuItem("searchreplace",{text:"Find and replace...",shortcut:"Meta+F",onAction:Ce(e,t),icon:"search"}),e.ui.registry.addButton("searchreplace",{tooltip:"Find and replace",onAction:Ce(e,t),icon:"search"}),e.shortcuts.add("Meta+F","",Ce(e,t))}(e,t),function(e,t){return{done:function(n){return be(e,t,n)},find:function(n,r,o,i){return void 0===i&&(i=!1),me(e,t,n,r,o,i)},next:function(){return ge(e,t)},prev:function(){return pe(e,t)},replace:function(n,r,o){return ve(e,t,n,r,o)}}}(e,t)}))}(),function(){"use strict";var e=function(e){var t=e;return{get:function(){return t},set:function(e){t=e}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=Object.hasOwnProperty,r=tinymce.util.Tools.resolve("tinymce.util.Tools"),o=tinymce.util.Tools.resolve("tinymce.util.URI"),i=tinymce.util.Tools.resolve("tinymce.util.XHR"),a=function(e){return e.getParam("spellchecker_rpc_url")},u=function(e){var t=new RegExp('[^\\s!"#$%&()*+,-./:;<=>?@[\\]^_{|}`§©«®±¶·¸»¼½¾¿×÷¤”“„    ]+',"g");return e.getParam("spellchecker_wordchar_pattern",t)},c=function(e){return e&&1===e.nodeType&&"false"===e.contentEditable},s=function(e,t){var n,r=[],o=t.dom,i=t.schema.getBlockElements(),a=t.schema.getWhiteSpaceElements(),u=t.schema.getShortEndedElements(),s=function(e,t){if(!e[0])throw new Error("findAndReplaceDOMText cannot handle zero-length matches");return{start:e.index,end:e.index+e[0].length,text:e[0],data:t}},l=function(e){if(3===e.nodeType)return e.data;if(a[e.nodeName]&&!i[e.nodeName])return"";if(c(e))return"\n";var t="";if((i[e.nodeName]||u[e.nodeName])&&(t+="\n"),e=e.firstChild)do{t+=l(e)}while(e=e.nextSibling);return t},f=function(e){for(var t=e.parentNode;e.childNodes.length>0;)t.insertBefore(e.childNodes[0],e);t.removeChild(e)},d=function(t){var n=e.getElementsByTagName("*"),r=[];t="number"==typeof t?""+t:null;for(var o=0;o<n.length;o++){var i=n[o],a=i.getAttribute("data-mce-index");null!==a&&a.length&&-1!==i.className.indexOf("mce-spellchecker-word")&&(a!==t&&null!==t||r.push(i))}return r},m=function(e){for(var t=r.length;t--;)if(r[t]===e)return t;return-1};function g(e){for(var t=0,n=r.length;t<n&&!1!==e(r[t],t);t++);return this}function p(e){var t,n=d(e?m(e):null);for(t=n.length;t--;)f(n[t]);return this}var h=function(e){var n=d(m(e)),r=t.dom.createRng();return r.setStartBefore(n[0]),r.setEndAfter(n[n.length-1]),r};var v=l(e);return{text:v,matches:r,each:g,filter:function(e){var t=[];return g((function(n,r){e(n,r)&&t.push(n)})),r=t,this},reset:function(){return r.splice(0,r.length),p(),this},matchFromElement:function(e){return r[e.getAttribute("data-mce-index")]},elementFromMatch:function(e){return d(m(e))[0]},find:function(e,t){if(v&&e.global)for(;n=e.exec(v);)r.push(s(n,t));return this},add:function(e,t,n){return r.push({start:e,end:e+t,text:v.substr(e,t),data:n}),this},wrap:function(t){return r.length&&function(e,t,n){var r,o,s,l,f,d=[],m=0,g=e,p=0;(t=t.slice(0)).sort((function(e,t){return e.start-t.start})),f=t.shift();e:for(;;){if((i[g.nodeName]||u[g.nodeName]||c(g))&&m++,3===g.nodeType&&(!o&&g.length+m>=f.end?(o=g,l=f.end-m):r&&d.push(g),!r&&g.length+m>f.start&&(r=g,s=f.start-m),m+=g.length),r&&o){if(g=n({startNode:r,startNodeIndex:s,endNode:o,endNodeIndex:l,innerNodes:d,match:f.text,matchIndex:p}),m-=o.length-l,r=null,o=null,d=[],p++,!(f=t.shift()))break}else if(a[g.nodeName]&&!i[g.nodeName]||!g.firstChild){if(g.nextSibling){g=g.nextSibling;continue}}else if(!c(g)){g=g.firstChild;continue}for(;;){if(g.nextSibling){g=g.nextSibling;break}if(g.parentNode===e)break e;g=g.parentNode}}}(e,r,function(e){var t=function(t,n){var i=r[n];i.stencil||(i.stencil=e(i));var a=i.stencil.cloneNode(!1);return a.setAttribute("data-mce-index",""+n),t&&a.appendChild(o.doc.createTextNode(t)),a};return function(e){var n,r,i,a=e.startNode,u=e.endNode,c=e.matchIndex,s=o.doc;if(a===u){var l=a;i=l.parentNode,e.startNodeIndex>0&&(n=s.createTextNode(l.data.substring(0,e.startNodeIndex)),i.insertBefore(n,l));var f=t(e.match,c);return i.insertBefore(f,l),e.endNodeIndex<l.length&&(r=s.createTextNode(l.data.substring(e.endNodeIndex)),i.insertBefore(r,l)),l.parentNode.removeChild(l),f}n=s.createTextNode(a.data.substring(0,e.startNodeIndex)),r=s.createTextNode(u.data.substring(e.endNodeIndex));for(var d=t(a.data.substring(e.startNodeIndex),c),m=0,g=e.innerNodes.length;m<g;++m){var p=e.innerNodes[m],h=t(p.data,c);p.parentNode.replaceChild(h,p)}var v=t(u.data.substring(0,e.endNodeIndex),c);return(i=a.parentNode).insertBefore(n,a),i.insertBefore(d,a),i.removeChild(a),(i=u.parentNode).insertBefore(v,u),i.insertBefore(r,u),i.removeChild(u),v}}(t)),this},unwrap:p,replace:function(e,n){var r=h(e);return r.deleteContents(),n.length>0&&r.insertNode(t.dom.doc.createTextNode(n)),r},rangeFromMatch:h,indexOf:m}},l=function(e,t){if(!t.get()){var n=s(e.getBody(),e);t.set(n)}return t.get()},f=function(e,t,n,u,c,s,l){var f=function(e){return e.getParam("spellchecker_callback")}(e),d=f||function(e,t,n){return function(u,c,s,l){var f={method:u,lang:n.get()},d="";f["addToDictionary"===u?"word":"text"]=c,r.each(f,(function(e,t){d&&(d+="&"),d+=t+"="+encodeURIComponent(e)})),i.send({url:new o(t).toAbsolute(a(e)),type:"post",content_type:"application/x-www-form-urlencoded",data:d,success:function(t){var n=JSON.parse(t);if(n)n.error?l(n.error):s(n);else{var r=e.translate("Server response wasn't proper JSON.");l(r)}},error:function(){var t=e.translate("The spelling service was not found: (")+a(e)+e.translate(")");l(t)}})}}(e,t,n);d.call(e.plugins.spellchecker,u,c,s,l)},d=function(e,t,n,r,o,i){if(!p(e,n,r)){e.setProgressState(!0),f(e,t,i,"spellcheck",l(e,r).text,(function(t){v(e,n,r,o,t)}),(function(t){e.notificationManager.open({text:t,type:"error"}),e.setProgressState(!1),p(e,n,r)})),e.focus()}},m=function(e,t,n){e.dom.select("span.mce-spellchecker-word").length||p(e,t,n)},g=function(e,t,n,o,i,a){e.selection.collapse(),a?r.each(e.dom.select("span.mce-spellchecker-word"),(function(t){t.getAttribute("data-mce-word")===o&&e.dom.remove(t,!0)})):e.dom.remove(i,!0),m(e,t,n)},p=function(e,t,n){var r=e.selection.getBookmark();if(l(e,n).reset(),e.selection.moveToBookmark(r),n.set(null),t.get())return t.set(!1),function(e){e.fire("SpellcheckEnd")}(e),!0},h=function(e){var t=e.getAttribute("data-mce-index");return"number"==typeof t?""+t:t},v=function(e,t,r,o,i){var a=!!i.dictionary,c=i.words;if(e.setProgressState(!1),function(e){for(var t in e)if(n.call(e,t))return!1;return!0}(c)){var s=e.translate("No misspellings found.");return e.notificationManager.open({text:s,type:"info"}),void t.set(!1)}o.set({suggestions:c,hasDictionarySupport:a});var f=e.selection.getBookmark();l(e,r).find(u(e)).filter((function(e){return!!c[e.text]})).wrap((function(t){return e.dom.create("span",{class:"mce-spellchecker-word","aria-invalid":"spelling","data-mce-bogus":1,"data-mce-word":t.text})})),e.selection.moveToBookmark(f),t.set(!0),function(e){e.fire("SpellcheckStart")}(e)},b=function(){return b=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},b.apply(this,arguments)},y="SpellcheckStart SpellcheckEnd",w=function(e,t,n,o,i,a){var u,c,s=(u=function(e){return r.map(function(e){return e.getParam("spellchecker_languages","English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr_FR,German=de,Italian=it,Polish=pl,Portuguese=pt_BR,Spanish=es,Swedish=sv")}(e).split(","),(function(e){var t=e.split("=");return{name:t[0],value:t[1]}}))}(e),c=[],r.each(u,(function(e){c.push({selectable:!0,text:e.name,data:e.value})})),c),l=function(){d(e,t,n,o,a,i)},f={tooltip:"Spellcheck",onAction:l,icon:"spell-check",onSetup:function(t){var r=function(){t.setActive(n.get())};return e.on(y,r),function(){e.off(y,r)}}},m=b(b({},f),{type:"splitbutton",select:function(e){return e===i.get()},fetch:function(e){e(r.map(s,(function(e){return{type:"choiceitem",value:e.data,text:e.text}})))},onItemAction:function(e,t){i.set(t)}});s.length>1?e.ui.registry.addSplitButton("spellchecker",m):e.ui.registry.addToggleButton("spellchecker",f),e.ui.registry.addToggleMenuItem("spellchecker",{text:"Spellcheck",icon:"spell-check",onSetup:function(t){t.setActive(n.get());var r=function(){t.setActive(n.get())};return e.on(y,r),function(){e.off(y,r)}},onAction:l})},x=function(e,t,n,o,i,a,u,c){var s=[],l=n.get().suggestions[u];return r.each(l,(function(t){s.push({text:t,onAction:function(){e.insertContent(e.dom.encode(t)),e.dom.remove(c),m(e,o,i)}})})),n.get().hasDictionarySupport&&(s.push({type:"separator"}),s.push({text:"Add to dictionary",onAction:function(){!function(e,t,n,r,o,i,a){e.setProgressState(!0),f(e,t,o,"addToDictionary",i,(function(){e.setProgressState(!1),e.dom.remove(a,!0),m(e,n,r)}),(function(t){e.notificationManager.open({text:t,type:"error"}),e.setProgressState(!1)}))}(e,t,o,i,a,u,c)}})),s.push.apply(s,[{type:"separator"},{text:"Ignore",onAction:function(){g(e,o,i,u,c)}},{text:"Ignore all",onAction:function(){g(e,o,i,u,c,true)}}]),s},C=function(e,t,n,o,i,a){e.ui.registry.addContextMenu("spellchecker",{update:function(u){var c=u;if("mce-spellchecker-word"!==c.className)return[];var s=function(e,t){var n=[],o=r.toArray(e.getBody().getElementsByTagName("span"));if(o.length)for(var i=0;i<o.length;i++){var a=h(o[i]);null!==a&&a.length&&a===t.toString()&&n.push(o[i])}return n}(e,h(c));if(s.length>0){var l=e.dom.createRng();return l.setStartBefore(s[0]),l.setEndAfter(s[s.length-1]),e.selection.setRng(l),x(e,t,n,o,i,a,c.getAttribute("data-mce-word"),s)}}})};t.add("spellchecker",(function(t,n){if(!1===function(e){return!!e.hasPlugin("tinymcespellchecker",!0)&&(void 0!==window.console&&window.console.log&&window.console.log("Spell Checker Pro is incompatible with Spell Checker plugin! Remove 'spellchecker' from the 'plugins' option."),!0)}(t)){var r=e(!1),o=e(function(e){var t=e.getParam("language","en");return e.getParam("spellchecker_language",t)}(t)),i=e(null),a=e(null);return w(t,n,r,i,o,a),C(t,n,a,r,i,o),function(e,t,n,r,o,i){e.addCommand("mceSpellCheck",(function(){d(e,t,n,r,o,i)}))}(t,n,r,i,a,o),function(e,t,n,r,o){return{getTextMatcher:r.get,getWordCharPattern:function(){return u(e)},markErrors:function(o){v(e,t,r,n,o)},getLanguage:o.get}}(t,r,a,i,o)}}))}(),function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),n=tinymce.util.Tools.resolve("tinymce.EditorManager"),r=tinymce.util.Tools.resolve("tinymce.Env"),o=tinymce.util.Tools.resolve("tinymce.util.Delay"),i=tinymce.util.Tools.resolve("tinymce.util.Tools"),a=tinymce.util.Tools.resolve("tinymce.util.VK"),u=t.DOM,c=function(e){e.keyCode!==a.TAB||e.ctrlKey||e.altKey||e.metaKey||e.preventDefault()};e.add("tabfocus",(function(e){!function(e){var t=function(t){var c;if(!(t.keyCode!==a.TAB||t.ctrlKey||t.altKey||t.metaKey||t.isDefaultPrevented())){var s,l=function(r){var o=u.select(":input:enabled,*[tabindex]:not(iframe)"),a=function(e){var t=e;return"BODY"===e.nodeName||"hidden"!==t.type&&"none"!==t.style.display&&"hidden"!==t.style.visibility&&a(e.parentNode)},s=function(e){return/INPUT|TEXTAREA|BUTTON/.test(e.tagName)&&n.get(t.id)&&-1!==e.tabIndex&&a(e)};if(i.each(o,(function(t,n){if(t.id===e.id)return c=n,!1})),r>0){for(var l=c+1;l<o.length;l++)if(s(o[l]))return o[l]}else for(l=c-1;l>=0;l--)if(s(o[l]))return o[l];return null},f=i.explode(function(e){return e.getParam("tab_focus",function(e){return e.getParam("tabfocus_elements",":prev,:next")}(e))}(e));if(1===f.length&&(f[1]=f[0],f[0]=":prev"),s=t.shiftKey?":prev"===f[0]?l(-1):u.get(f[0]):":next"===f[1]?l(1):u.get(f[1])){var d=n.get(s.id||s.name);s.id&&d?d.focus():o.setTimeout((function(){r.webkit||window.focus(),s.focus()}),10),t.preventDefault()}}};e.on("init",(function(){e.inline&&u.setAttrib(e.getBody(),"tabIndex",null),e.on("keyup",c),r.gecko?e.on("keypress keydown",t):e.on("keydown",t)}))}(e)}))}(),function(){"use strict";var e=function(e){return function(t){return r=typeof(n=t),(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)===e;var n,r}},t=function(e){return function(t){return typeof t===e}},n=function(e){return function(t){return e===t}},r=e("string"),o=e("object"),i=e("array"),a=n(null),u=t("boolean"),c=n(void 0),s=function(e){return!function(e){return null==e}(e)},l=t("function"),f=t("number"),d=function(){},m=function(e){return function(){return e}},g=function(e){return e},p=function(e,t){return e===t};function h(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=t.concat(n);return e.apply(null,o)}}var v,b,y=function(e){return function(t){return!e(t)}},w=m(!1),x=m(!0),C=function(){return S},S={fold:function(e,t){return e()},isSome:w,isNone:x,getOr:b=g,getOrThunk:v=function(e){return e()},getOrDie:function(e){throw new Error(e||"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(e){var t=m(e),n=function(){return o},r=function(t){return t(e)},o={fold:function(t,n){return n(e)},isSome:x,isNone:w,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:n,orThunk:n,map:function(t){return k(t(e))},each:function(t){t(e)},bind:r,exists:r,forall:r,filter:function(t){return t(e)?o:S},toArray:function(){return[e]},toString:function(){return"some("+e+")"}};return o},T={some:k,none:C,from:function(e){return null==e?S:k(e)}},O=Array.prototype.slice,_=Array.prototype.indexOf,E=Array.prototype.push,A=function(e,t){return n=e,r=t,_.call(n,r)>-1;var n,r},D=function(e,t){for(var n=0,r=e.length;n<r;n++){if(t(e[n],n))return!0}return!1},M=function(e,t){for(var n=[],r=0;r<e;r++)n.push(t(r));return n},N=function(e,t){for(var n=e.length,r=new Array(n),o=0;o<n;o++){var i=e[o];r[o]=t(i,o)}return r},R=function(e,t){for(var n=0,r=e.length;n<r;n++){t(e[n],n)}},z=function(e,t){for(var n=[],r=[],o=0,i=e.length;o<i;o++){var a=e[o];(t(a,o)?n:r).push(a)}return{pass:n,fail:r}},B=function(e,t){for(var n=[],r=0,o=e.length;r<o;r++){var i=e[r];t(i,r)&&n.push(i)}return n},P=function(e,t,n){return function(e,t){for(var n=e.length-1;n>=0;n--)t(e[n],n)}(e,(function(e,r){n=t(n,e,r)})),n},I=function(e,t,n){return R(e,(function(e,r){n=t(n,e,r)})),n},F=function(e,t){return function(e,t,n){for(var r=0,o=e.length;r<o;r++){var i=e[r];if(t(i,r))return T.some(i);if(n(i,r))break}return T.none()}(e,t,w)},L=function(e,t){for(var n=0,r=e.length;n<r;n++){if(t(e[n],n))return T.some(n)}return T.none()},H=function(e){for(var t=[],n=0,r=e.length;n<r;++n){if(!i(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);E.apply(t,e[n])}return t},V=function(e,t){return H(N(e,t))},j=function(e,t){for(var n=0,r=e.length;n<r;++n){if(!0!==t(e[n],n))return!1}return!0},U=function(e,t){for(var n={},r=0,o=e.length;r<o;r++){var i=e[r];n[String(i)]=t(i,r)}return n},W=function(e){return[e]},$=function(e,t){return t>=0&&t<e.length?T.some(e[t]):T.none()},q=function(e){return $(e,0)},G=function(e){return $(e,e.length-1)},K=function(e,t){for(var n=0;n<e.length;n++){var r=t(e[n],n);if(r.isSome())return r}return T.none()},X=function(){return X=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},X.apply(this,arguments)};function Y(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}var J=function(e){var t,n=!1;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=!0,t=e.apply(null,r)),t}},Z=function(){return Q(0,0)},Q=function(e,t){return{major:e,minor:t}},ee={nu:Q,detect:function(e,t){var n=String(t).toLowerCase();return 0===e.length?Z():function(e,t){var n=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(r.test(t))return r}}(e,t);if(!n)return{major:0,minor:0};var r=function(e){return Number(t.replace(n,"$"+e))};return Q(r(1),r(2))}(e,n)},unknown:Z},te=function(e,t){var n=String(t).toLowerCase();return F(e,(function(e){return e.search(n)}))},ne=function(e,t,n){return""===t||e.length>=t.length&&e.substr(n,n+t.length)===t},re=function(e,t){return-1!==e.indexOf(t)},oe=function(e,t){return ne(e,t,0)},ie=function(e,t){return ne(e,t,e.length-t.length)},ae=function(e){return function(t){return t.replace(e,"")}}(/^\s+|\s+$/g),ue=function(e){return e.length>0},ce=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,se=function(e){return function(t){return re(t,e)}},le=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return re(e,"edge/")&&re(e,"chrome")&&re(e,"safari")&&re(e,"applewebkit")}},{name:"Chrome",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,ce],search:function(e){return re(e,"chrome")&&!re(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return re(e,"msie")||re(e,"trident")}},{name:"Opera",versionRegexes:[ce,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:se("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:se("firefox")},{name:"Safari",versionRegexes:[ce,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(re(e,"safari")||re(e,"mobile/"))&&re(e,"applewebkit")}}],fe=[{name:"Windows",search:se("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return re(e,"iphone")||re(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:se("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:se("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:se("linux"),versionRegexes:[]},{name:"Solaris",search:se("sunos"),versionRegexes:[]},{name:"FreeBSD",search:se("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:se("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],de={browsers:m(le),oses:m(fe)},me="Edge",ge="Chrome",pe="Opera",he="Firefox",ve="Safari",be=function(e){var t=e.current,n=e.version,r=function(e){return function(){return t===e}};return{current:t,version:n,isEdge:r(me),isChrome:r(ge),isIE:r("IE"),isOpera:r(pe),isFirefox:r(he),isSafari:r(ve)}},ye={unknown:function(){return be({current:void 0,version:ee.unknown()})},nu:be,edge:m(me),chrome:m(ge),ie:m("IE"),opera:m(pe),firefox:m(he),safari:m(ve)},we="Windows",xe="Android",Ce="Linux",Se="Solaris",ke="FreeBSD",Te="ChromeOS",Oe=function(e){var t=e.current,n=e.version,r=function(e){return function(){return t===e}};return{current:t,version:n,isWindows:r(we),isiOS:r("iOS"),isAndroid:r(xe),isOSX:r("OSX"),isLinux:r(Ce),isSolaris:r(Se),isFreeBSD:r(ke),isChromeOS:r(Te)}},_e={unknown:function(){return Oe({current:void 0,version:ee.unknown()})},nu:Oe,windows:m(we),ios:m("iOS"),android:m(xe),linux:m(Ce),osx:m("OSX"),solaris:m(Se),freebsd:m(ke),chromeos:m(Te)},Ee=function(e,t,n){var r=de.browsers(),o=de.oses(),i=t.bind((function(e){return function(e,t){return K(t.brands,(function(t){var n=t.brand.toLowerCase();return F(e,(function(e){var t;return n===(null===(t=e.brand)||void 0===t?void 0:t.toLowerCase())})).map((function(e){return{current:e.name,version:ee.nu(parseInt(t.version,10),0)}}))}))}(r,e)})).orThunk((function(){return function(e,t){return te(e,t).map((function(e){var n=ee.detect(e.versionRegexes,t);return{current:e.name,version:n}}))}(r,e)})).fold(ye.unknown,ye.nu),a=function(e,t){return te(e,t).map((function(e){var n=ee.detect(e.versionRegexes,t);return{current:e.name,version:n}}))}(o,e).fold(_e.unknown,_e.nu),u=function(e,t,n,r){var o=e.isiOS()&&!0===/ipad/i.test(n),i=e.isiOS()&&!o,a=e.isiOS()||e.isAndroid(),u=a||r("(pointer:coarse)"),c=o||!i&&a&&r("(min-device-width:768px)"),s=i||a&&!c,l=t.isSafari()&&e.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(u),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:m(l),isDesktop:m(f)}}(a,i,e,n);return{browser:i,os:a,deviceType:u}},Ae=function(e){return window.matchMedia(e).matches},De=J((function(){return Ee(navigator.userAgent,T.from(navigator.userAgentData),Ae)})),Me=function(){return De()},Ne=function(e){if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}},Re={fromHtml:function(e,t){var n=(t||document).createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return Ne(n.childNodes[0])},fromTag:function(e,t){var n=(t||document).createElement(e);return Ne(n)},fromText:function(e,t){var n=(t||document).createTextNode(e);return Ne(n)},fromDom:Ne,fromPoint:function(e,t,n){return T.from(e.dom.elementFromPoint(t,n)).map(Ne)}},ze=function(e,t){var n=e.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(t);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(t);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(t);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")},Be=function(e){return 1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType||0===e.childElementCount},Pe=function(e,t){var n=void 0===t?document:t.dom;return Be(n)?T.none():T.from(n.querySelector(e)).map(Re.fromDom)},Ie=function(e,t){return e.dom===t.dom},Fe=function(e,t){return n=e.dom,r=t.dom,function(e,t,n){return 0!=(e.compareDocumentPosition(t)&n)}(n,r,Node.DOCUMENT_POSITION_CONTAINED_BY);var n,r},Le=function(e,t){return Me().browser.isIE()?Fe(e,t):function(e,t){var n=e.dom,r=t.dom;return n!==r&&n.contains(r)}(e,t)},He=ze,Ve=Object.keys,je=Object.hasOwnProperty,Ue=function(e,t){for(var n=Ve(e),r=0,o=n.length;r<o;r++){var i=n[r];t(e[i],i)}},We=function(e,t){return $e(e,(function(e,n){return{k:n,v:t(e,n)}}))},$e=function(e,t){var n={};return Ue(e,(function(e,r){var o=t(e,r);n[o.k]=o.v})),n},qe=function(e,t){var n={};return function(e,t,n,r){Ue(e,(function(e,o){(t(e,o)?n:r)(e,o)}))}(e,t,function(e){return function(t,n){e[n]=t}}(n),d),n},Ge=function(e,t){var n=[];return Ue(e,(function(e,r){n.push(t(e,r))})),n},Ke=function(e){return Ge(e,g)},Xe=function(e){return Ve(e).length},Ye=function(e,t){return Je(e,t)?T.from(e[t]):T.none()},Je=function(e,t){return je.call(e,t)},Ze=function(e,t){return Je(e,t)&&void 0!==e[t]&&null!==e[t]},Qe=["tfoot","thead","tbody","colgroup"],et=function(e,t,n){return{element:e,rowspan:t,colspan:n}},tt=function(e,t,n){return{element:e,cells:t,section:n}},nt=function(e,t,n){return{element:e,isNew:t,isLocked:n}},rt=function(e,t,n,r){return{element:e,cells:t,section:n,isNew:r}};"undefined"!=typeof window?window:Function("return this;")();var ot=function(e){return e.dom.nodeName.toLowerCase()},it=function(e){return e.dom.nodeType},at=function(e){return function(t){return it(t)===e}},ut=function(e){return 8===it(e)||"#comment"===ot(e)},ct=at(1),st=at(3),lt=at(9),ft=at(11),dt=function(e){return function(t){return ct(t)&&ot(t)===e}},mt=function(e){return Re.fromDom(e.dom.ownerDocument)},gt=function(e){return lt(e)?e:mt(e)},pt=function(e){return T.from(e.dom.parentNode).map(Re.fromDom)},ht=function(e,t){for(var n=l(t)?t:w,r=e.dom,o=[];null!==r.parentNode&&void 0!==r.parentNode;){var i=r.parentNode,a=Re.fromDom(i);if(o.push(a),!0===n(a))break;r=i}return o},vt=function(e){return T.from(e.dom.previousSibling).map(Re.fromDom)},bt=function(e){return T.from(e.dom.nextSibling).map(Re.fromDom)},yt=function(e){return N(e.dom.childNodes,Re.fromDom)},wt=function(e,t){var n=e.dom.childNodes;return T.from(n[t]).map(Re.fromDom)},xt=l(Element.prototype.attachShadow)&&l(Node.prototype.getRootNode),Ct=m(xt),St=xt?function(e){return Re.fromDom(e.dom.getRootNode())}:gt,kt=function(e){var t,n=St(e);return ft(t=n)&&s(t.dom.host)?T.some(n):T.none()},Tt=function(e){return Re.fromDom(e.dom.host)},Ot=function(e){return s(e.dom.shadowRoot)},_t=function(e){var t=st(e)?e.dom.parentNode:e.dom;if(null==t||null===t.ownerDocument)return!1;var n,r,o=t.ownerDocument;return kt(Re.fromDom(t)).fold((function(){return o.body.contains(t)}),(n=_t,r=Tt,function(e){return n(r(e))}))},Et=function(e){var t=e.dom.body;if(null==t)throw new Error("Body is not available yet");return Re.fromDom(t)},At=function(e,t){var n=[];return R(yt(e),(function(e){t(e)&&(n=n.concat([e])),n=n.concat(At(e,t))})),n},Dt=function(e,t,n){return function(e,t,n){return B(ht(e,n),t)}(e,(function(e){return ze(e,t)}),n)},Mt=function(e,t){return function(e,t){return B(yt(e),t)}(e,(function(e){return ze(e,t)}))},Nt=function(e,t){return function(e,t){var n=void 0===t?document:t.dom;return Be(n)?[]:N(n.querySelectorAll(e),Re.fromDom)}(t,e)};function Rt(e,t,n,r,o){return e(n,r)?T.some(n):l(o)&&o(n)?T.none():t(n,r,o)}var zt=function(e,t,n){for(var r=e.dom,o=l(n)?n:w;r.parentNode;){r=r.parentNode;var i=Re.fromDom(r);if(t(i))return T.some(i);if(o(i))break}return T.none()},Bt=function(e,t,n){return zt(e,(function(e){return ze(e,t)}),n)},Pt=function(e,t){return function(e,t){return F(e.dom.childNodes,(function(e){return t(Re.fromDom(e))})).map(Re.fromDom)}(e,(function(e){return ze(e,t)}))},It=function(e,t){return Pe(t,e)},Ft=function(e,t,n){return Rt((function(e,t){return ze(e,t)}),Bt,e,t,n)},Lt=function(e,t,n){if(!(r(n)||u(n)||f(n)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",n,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,n+"")},Ht=function(e,t,n){Lt(e.dom,t,n)},Vt=function(e,t){var n=e.dom;Ue(t,(function(e,t){Lt(n,t,e)}))},jt=function(e,t){var n=e.dom.getAttribute(t);return null===n?void 0:n},Ut=function(e,t){return T.from(jt(e,t))},Wt=function(e,t){e.dom.removeAttribute(t)},$t=function(e){return I(e.dom.attributes,(function(e,t){return e[t.name]=t.value,e}),{})},qt=function(e,t,n){return void 0===n&&(n=p),e.exists((function(e){return n(e,t)}))},Gt=function(e){for(var t=[],n=function(e){t.push(e)},r=0;r<e.length;r++)e[r].each(n);return t},Kt=function(e,t,n){return e.isSome()&&t.isSome()?T.some(n(e.getOrDie(),t.getOrDie())):T.none()},Xt=function(e,t){return e?T.some(t):T.none()},Yt=function(e){return void 0!==e.style&&l(e.style.getPropertyValue)},Jt=function(e,t,n){if(!r(n))throw console.error("Invalid call to CSS.set. Property ",t,":: Value ",n,":: Element ",e),new Error("CSS value must be a string: "+n);Yt(e)&&e.style.setProperty(t,n)},Zt=function(e,t,n){var r=e.dom;Jt(r,t,n)},Qt=function(e,t){var n=e.dom;Ue(t,(function(e,t){Jt(n,t,e)}))},en=function(e,t){var n=e.dom,r=window.getComputedStyle(n).getPropertyValue(t);return""!==r||_t(e)?r:tn(n,t)},tn=function(e,t){return Yt(e)?e.style.getPropertyValue(t):""},nn=function(e,t){var n=e.dom,r=tn(n,t);return T.from(r).filter((function(e){return e.length>0}))},rn=function(e,t){!function(e,t){Yt(e)&&e.style.removeProperty(t)}(e.dom,t),qt(Ut(e,"style").map(ae),"")&&Wt(e,"style")},on=function(e,t,n){return void 0===n&&(n=0),Ut(e,t).map((function(e){return parseInt(e,10)})).getOr(n)},an=function(e,t){return on(e,t,1)},un=function(e){return dt("col")(e)?on(e,"span",1)>1:an(e,"colspan")>1},cn=function(e){return an(e,"rowspan")>1},sn=function(e,t){return parseInt(en(e,t),10)},ln=m(10),fn=m(10),dn=function(e,t){return mn(e,t,x)},mn=function(e,t,n){return V(yt(e),(function(e){return ze(e,t)?n(e)?[e]:[]:mn(e,t,n)}))},gn=function(e,t){return function(e,t,n){return void 0===n&&(n=w),n(t)?T.none():A(e,ot(t))?T.some(t):Bt(t,e.join(","),(function(e){return ze(e,"table")||n(e)}))}(["td","th"],e,t)},pn=function(e){return dn(e,"th,td")},hn=function(e){return ze(e,"colgroup")?Mt(e,"col"):V(yn(e),(function(e){return Mt(e,"col")}))},vn=function(e,t){return Ft(e,"table",t)},bn=function(e){return dn(e,"tr")},yn=function(e){return vn(e).fold(m([]),(function(e){return Mt(e,"colgroup")}))},wn=function(e,t){return N(e,(function(e){if("colgroup"===ot(e)){var n=N(hn(e),(function(e){var t=on(e,"span",1);return et(e,1,t)}));return tt(e,n,"colgroup")}n=N(pn(e),(function(e){var t=on(e,"rowspan",1),n=on(e,"colspan",1);return et(e,t,n)}));return tt(e,n,t(e))}))},xn=function(e){return pt(e).map((function(e){var t=ot(e);return function(e){return A(Qe,e)}(t)?t:"tbody"})).getOr("tbody")},Cn=function(e){var t=bn(e),n=Y(Y([],yn(e),!0),t,!0);return wn(n,xn)},Sn=function(e,t,n){var r=e.cells,o=r.slice(0,t),i=r.slice(t),a=o.concat(n).concat(i);return On(e,a)},kn=function(e,t,n){return Sn(e,t,[n])},Tn=function(e,t,n){e.cells[t]=n},On=function(e,t){return rt(e.element,t,e.section,e.isNew)},_n=function(e,t){return e.cells[t]},En=function(e,t){return _n(e,t).element},An=function(e){return e.cells.length},Dn=function(e){var t=z(e,(function(e){return"colgroup"===e.section}));return{rows:t.fail,cols:t.pass}},Mn=function(e,t,n){var r=N(e.cells,n);return rt(t(e.element),r,e.section,!0)},Nn="data-snooker-locked-cols",Rn=function(e){return Ut(e,Nn).bind((function(e){return T.from(e.match(/\d+/g))})).map((function(e){return U(e,x)}))},zn=function(e){var t=I(Dn(e).rows,(function(e,t){return R(t.cells,(function(t,n){t.isLocked&&(e[n]=!0)})),e}),{}),n=Ge(t,(function(e,t){return parseInt(t,10)}));return function(e,t){var n=O.call(e,0);return n.sort(t),n}(n)},Bn=function(e,t){return e+","+t},Pn=function(e,t){var n=V(e.all,(function(e){return e.cells}));return B(n,t)},In=function(e){var t={},n=[],r=q(e).map((function(e){return e.element})).bind(vn).bind(Rn).getOr({}),o=0,i=0,a=0,u=z(e,(function(e){return"colgroup"===e.section})),c=u.pass,s=u.fail;R(s,(function(e){var u=[];R(e.cells,(function(e){for(var n=0;void 0!==t[Bn(a,n)];)n++;for(var o=Ze(r,n.toString()),c=function(e,t,n,r,o,i){return{element:e,rowspan:t,colspan:n,row:r,column:o,isLocked:i}}(e.element,e.rowspan,e.colspan,a,n,o),s=0;s<e.colspan;s++)for(var l=0;l<e.rowspan;l++){var f=n+s,d=Bn(a+l,f);t[d]=c,i=Math.max(i,f+1)}u.push(c)})),o++,n.push(tt(e.element,u,e.section)),a++}));var l=G(c).map((function(e){var t=function(e){var t={},n=0;return R(e.cells,(function(e){var r=e.colspan;M(r,(function(o){var i=n+o;t[i]=function(e,t,n){return{element:e,colspan:t,column:n}}(e.element,r,i)})),n+=r})),t}(e),n=function(e,t){return{element:e,columns:t}}(e.element,Ke(t));return{colgroups:[n],columns:t}})).getOrThunk((function(){return{colgroups:[],columns:{}}})),f=l.columns,d=l.colgroups,m=function(e,t){return{rows:e,columns:t}}(o,i);return{grid:m,access:t,all:n,columns:f,colgroups:d}},Fn={fromTable:function(e){var t=Cn(e);return In(t)},generate:In,getAt:function(e,t,n){return T.from(e.access[Bn(t,n)])},findItem:function(e,t,n){var r=Pn(e,(function(e){return n(t,e.element)}));return r.length>0?T.some(r[0]):T.none()},filterItems:Pn,justCells:function(e){return V(e.all,(function(e){return e.cells}))},justColumns:function(e){return Ke(e.columns)},hasColumns:function(e){return Ve(e.columns).length>0},getColumnAt:function(e,t){return T.from(e.columns[t])}},Ln=function(e,t){var n=t.column,r=t.column+t.colspan-1,o=t.row,i=t.row+t.rowspan-1;return n<=e.finishCol&&r>=e.startCol&&o<=e.finishRow&&i>=e.startRow},Hn=function(e,t){return t.column>=e.startCol&&t.column+t.colspan-1<=e.finishCol&&t.row>=e.startRow&&t.row+t.rowspan-1<=e.finishRow},Vn=function(e,t,n){var r=Fn.findItem(e,t,Ie),o=Fn.findItem(e,n,Ie);return r.bind((function(e){return o.map((function(t){return n=e,r=t,o=Math.min(n.row,r.row),i=Math.min(n.column,r.column),a=Math.max(n.row+n.rowspan-1,r.row+r.rowspan-1),u=Math.max(n.column+n.colspan-1,r.column+r.colspan-1),{startRow:o,startCol:i,finishRow:a,finishCol:u};var n,r,o,i,a,u}))}))},jn=function(e,t,n){return Vn(e,t,n).bind((function(t){return function(e,t){for(var n=!0,r=h(Hn,t),o=t.startRow;o<=t.finishRow;o++)for(var i=t.startCol;i<=t.finishCol;i++)n=n&&Fn.getAt(e,o,i).exists(r);return n?T.some(t):T.none()}(e,t)}))},Un=function(e,t,n){return Vn(e,t,n).map((function(t){var n=Fn.filterItems(e,h(Ln,t));return N(n,(function(e){return e.element}))}))},Wn=function(e,t){return Fn.findItem(e,t,(function(e,t){return Le(t,e)})).map((function(e){return e.element}))},$n=function(e,t,n){return vn(e).bind((function(r){return function(e,t,n,r){return Fn.findItem(e,t,Ie).bind((function(t){var o=n>0?t.row+t.rowspan-1:t.row,i=r>0?t.column+t.colspan-1:t.column;return Fn.getAt(e,o+n,i+r).map((function(e){return e.element}))}))}(Kn(r),e,t,n)}))},qn=function(e,t,n){var r=Kn(e);return Un(r,t,n)},Gn=function(e,t,n,r,o){var i=Kn(e),a=Ie(e,n)?T.some(t):Wn(i,t),u=Ie(e,o)?T.some(r):Wn(i,r);return a.bind((function(e){return u.bind((function(t){return Un(i,e,t)}))}))},Kn=Fn.fromTable,Xn=function(e,t){pt(e).each((function(n){n.dom.insertBefore(t.dom,e.dom)}))},Yn=function(e,t){bt(e).fold((function(){pt(e).each((function(e){Zn(e,t)}))}),(function(e){Xn(e,t)}))},Jn=function(e,t){var n=function(e){return wt(e,0)}(e);n.fold((function(){Zn(e,t)}),(function(n){e.dom.insertBefore(t.dom,n.dom)}))},Zn=function(e,t){e.dom.appendChild(t.dom)},Qn=function(e,t){Xn(e,t),Zn(t,e)},er=function(e,t){R(t,(function(n,r){var o=0===r?e:t[r-1];Yn(o,n)}))},tr=function(e,t){R(t,(function(t){Zn(e,t)}))},nr=function(e){e.dom.textContent="",R(yt(e),(function(e){rr(e)}))},rr=function(e){var t=e.dom;null!==t.parentNode&&t.parentNode.removeChild(t)},or=function(e){var t,n=yt(e);n.length>0&&(t=e,R(n,(function(e){Xn(t,e)}))),rr(e)},ir=function(e,t){var n=function(t){return e(t)?T.from(t.dom.nodeValue):T.none()};return{get:function(r){if(!e(r))throw new Error("Can only get "+t+" value of a "+t+" node");return n(r).getOr("")},getOption:n,set:function(n,r){if(!e(n))throw new Error("Can only set raw "+t+" value of a "+t+" node");n.dom.nodeValue=r}}}(st,"text"),ar=function(e){return ir.get(e)},ur=function(e){return ir.getOption(e)},cr=function(e,t){return ir.set(e,t)},sr=["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 lr(){return{up:m({selector:Bt,closest:Ft,predicate:zt,all:ht}),down:m({selector:Nt,predicate:At}),styles:m({get:en,getRaw:nn,set:Zt,remove:rn}),attrs:m({get:jt,set:Ht,remove:Wt,copyTo:function(e,t){var n=$t(e);Vt(t,n)}}),insert:m({before:Xn,after:Yn,afterAll:er,append:Zn,appendAll:tr,prepend:Jn,wrap:Qn}),remove:m({unwrap:or,remove:rr}),create:m({nu:Re.fromTag,clone:function(e){return Re.fromDom(e.dom.cloneNode(!1))},text:Re.fromText}),query:m({comparePosition:function(e,t){return e.dom.compareDocumentPosition(t.dom)},prevSibling:vt,nextSibling:bt}),property:m({children:yt,name:ot,parent:pt,document:function(e){return gt(e).dom},isText:st,isComment:ut,isElement:ct,isSpecial:function(e){var t=ot(e);return A(["script","noscript","iframe","noframes","noembed","title","style","textarea","xmp"],t)},getLanguage:function(e){return ct(e)?Ut(e,"lang"):T.none()},getText:ar,setText:cr,isBoundary:function(e){return!!ct(e)&&("body"===ot(e)||A(sr,ot(e)))},isEmptyTag:function(e){return!!ct(e)&&A(["br","img","hr","input"],ot(e))},isNonEditable:function(e){return ct(e)&&"false"===jt(e,"contenteditable")}}),eq:Ie,is:He}}var fr,dr,mr,gr,pr=function(e,t,n,r){var o=t(e,n);return P(r,(function(n,r){var o=t(e,r);return hr(e,n,o)}),o)},hr=function(e,t,n){return t.bind((function(t){return n.filter(h(e.eq,t))}))},vr=function(e,t,n){return n.length>0?function(e,t,n,r){return r(e,t,n[0],n.slice(1))}(e,t,n,pr):T.none()},br=function(e,t,n,r){void 0===r&&(r=w);var o=[t].concat(e.up().all(t)),i=[n].concat(e.up().all(n)),a=function(e){return L(e,r).fold((function(){return e}),(function(t){return e.slice(0,t+1)}))},u=a(o),c=a(i),s=F(u,(function(t){return D(c,function(e,t){return h(e.eq,t)}(e,t))}));return{firstpath:u,secondpath:c,shared:s}},yr=lr(),wr=function(e,t){return vr(yr,(function(t,n){return e(n)}),t)},xr=function(e){return Bt(e,"table")},Cr=function(e,t,n){var r=function(e){return function(t){return void 0!==n&&n(t)||Ie(t,e)}};return Ie(e,t)?T.some({boxes:T.some([e]),start:e,finish:t}):xr(e).bind((function(o){return xr(t).bind((function(i){if(Ie(o,i))return T.some({boxes:qn(o,e,t),start:e,finish:t});if(Le(o,i)){var a=(u=Dt(t,"td,th",r(o))).length>0?u[u.length-1]:t;return T.some({boxes:Gn(o,e,o,t,i),start:e,finish:a})}if(Le(i,o)){var u,c=(u=Dt(e,"td,th",r(i))).length>0?u[u.length-1]:e;return T.some({boxes:Gn(i,e,o,t,i),start:e,finish:c})}return function(e,t,n){return br(yr,e,t,n)}(e,t).shared.bind((function(a){return Ft(a,"table",n).bind((function(n){var a=Dt(t,"td,th",r(n)),u=a.length>0?a[a.length-1]:t,c=Dt(e,"td,th",r(n)),s=c.length>0?c[c.length-1]:e;return T.some({boxes:Gn(n,e,o,t,i),start:s,finish:u})}))}))}))}))},Sr=function(e,t){var n=Nt(e,t);return n.length>0?T.some(n):T.none()},kr=function(e,t,n){return It(e,t).bind((function(t){return It(e,n).bind((function(e){return wr(xr,[t,e]).map((function(n){return{first:t,last:e,table:n}}))}))}))},Tr=function(e,t,n,r,o){return function(e,t){return F(e,(function(e){return ze(e,t)}))}(e,o).bind((function(e){return $n(e,t,n).bind((function(e){return function(e,t){return Bt(e,"table").bind((function(n){return It(n,t).bind((function(t){return Cr(t,e).bind((function(e){return e.boxes.map((function(t){return{boxes:t,start:e.start,finish:e.finish}}))}))}))}))}(e,r)}))}))},Or=function(e,t){return Sr(e,t)},_r=function(e,t,n){return kr(e,t,n).bind((function(t){var n=function(t){return Ie(e,t)},r="thead,tfoot,tbody,table",o=Bt(t.first,r,n),i=Bt(t.last,r,n);return o.bind((function(e){return i.bind((function(n){return Ie(e,n)?function(e,t,n){var r=Kn(e);return jn(r,t,n)}(t.table,t.first,t.last):T.none()}))}))}))},Er=function(e){if(!i(e))throw new Error("cases must be an array");if(0===e.length)throw new Error("there must be at least one case");var t=[],n={};return R(e,(function(r,o){var a=Ve(r);if(1!==a.length)throw new Error("one and only one name per case");var u=a[0],c=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(!i(c))throw new Error("case arguments must be an array");t.push(u),n[u]=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 "+u+". Expected "+c.length+" ("+c+"), got "+i);var a=function(e){var r=Ve(e);if(t.length!==r.length)throw new Error("Wrong number of arguments to match. Expected: "+t.join(",")+"\nActual: "+r.join(","));if(!j(t,(function(e){return A(r,e)})))throw new Error("Not all branches were specified when using match. Specified: "+r.join(", ")+"\nRequired: "+t.join(", "));return e[u].apply(null,n)};return{fold:function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];if(t.length!==e.length)throw new Error("Wrong number of arguments to fold. Expected "+e.length+", got "+t.length);var i=t[o];return i.apply(null,n)},match:a,log:function(e){console.log(e,{constructors:t,constructor:u,params:n})}}}})),n},Ar=Er([{none:[]},{multiple:["elements"]},{single:["element"]}]),Dr=function(e,t,n,r){return e.fold(t,n,r)},Mr=Ar.none,Nr=Ar.multiple,Rr=Ar.single,zr=tinymce.util.Tools.resolve("tinymce.PluginManager"),Br=function(e,t){return Re.fromDom(e.dom.cloneNode(t))},Pr=function(e){return Br(e,!1)},Ir=function(e){return Br(e,!0)},Fr=function(e,t){var n=Re.fromTag(t),r=$t(e);return Vt(n,r),n},Lr=function(e,t){var n=function(n){var r=t(n);if(r<=0||null===r){var o=en(n,e);return parseFloat(o)||0}return r},r=function(e,t){return I(t,(function(t,n){var r=en(e,n),o=void 0===r?0:parseInt(r,10);return isNaN(o)?t:t+o}),0)};return{set:function(t,n){if(!f(n)&&!n.match(/^[0-9]+$/))throw new Error(e+".set accepts only positive integer values. Value was "+n);var r=t.dom;Yt(r)&&(r.style[e]=n+"px")},get:n,getOuter:n,aggregate:r,max:function(e,t,n){var o=r(e,n);return t>o?t-o:0}}},Hr=function(){var e=Me().browser;return e.isIE()||e.isEdge()},Vr=function(e,t){return function(e){var t=parseFloat(e);return isNaN(t)?T.none():T.some(t)}(e).getOr(t)},jr=function(e,t,n){return Vr(en(e,t),n)},Ur=function(e){return en(e,"box-sizing")},Wr=function(e,t,n,r){return t-jr(e,"padding-"+n,0)-jr(e,"padding-"+r,0)-jr(e,"border-"+n+"-width",0)-jr(e,"border-"+r+"-width",0)},$r=function(e,t){var n=e.dom,r=n.getBoundingClientRect().width||n.offsetWidth;return"border-box"===t?r:Wr(e,r,"left","right")},qr=Lr("width",(function(e){return e.dom.offsetWidth})),Gr=function(e){return qr.get(e)},Kr=function(e){return qr.getOuter(e)},Xr=function(e){return $r(e,"content-box")},Yr=function(e){return Hr()?$r(e,Ur(e)):jr(e,"width",e.dom.offsetWidth)},Jr=function(e,t){void 0===t&&(t=x);var n=e.grid,r=M(n.columns,g),o=M(n.rows,g);return N(r,(function(n){return Zr((function(){return V(o,(function(t){return Fn.getAt(e,t,n).filter((function(e){return e.column===n})).toArray()}))}),(function(e){return 1===e.colspan&&t(e.element)}),(function(){return Fn.getAt(e,0,n)}))}))},Zr=function(e,t,n){var r=e();return F(r,t).orThunk((function(){return T.from(r[0]).orThunk(n)})).map((function(e){return e.element}))},Qr=function(e){var t=e.grid,n=M(t.rows,g),r=M(t.columns,g);return N(n,(function(t){return Zr((function(){return V(r,(function(n){return Fn.getAt(e,t,n).filter((function(e){return e.row===t})).fold(m([]),(function(e){return[e]}))}))}),(function(e){return 1===e.rowspan}),(function(){return Fn.getAt(e,t,0)}))}))},eo=function(e,t){if(t<0||t>=e.length-1)return T.none();var n=e[t].fold((function(){var n=function(e){var t=O.call(e,0);return t.reverse(),t}(e.slice(0,t));return K(n,(function(e,t){return e.map((function(e){return{value:e,delta:t+1}}))}))}),(function(e){return T.some({value:e,delta:0})})),r=e[t+1].fold((function(){var n=e.slice(t+1);return K(n,(function(e,t){return e.map((function(e){return{value:e,delta:t+1}}))}))}),(function(e){return T.some({value:e,delta:1})}));return n.bind((function(e){return r.map((function(t){var n=t.delta+e.delta;return Math.abs(t.value-e.value)/n}))}))},to=function(e,t){return function(n){return"rtl"===no(n)?t:e}},no=function(e){return"rtl"===en(e,"direction")?"rtl":"ltr"},ro=Lr("height",(function(e){var t=e.dom;return _t(e)?t.getBoundingClientRect().height:t.offsetHeight})),oo=function(e){return ro.get(e)},io=function(e){return ro.getOuter(e)},ao=function(e){return Hr()?function(e,t){var n=e.dom,r=n.getBoundingClientRect().height||n.offsetHeight;return"border-box"===t?r:Wr(e,r,"top","bottom")}(e,Ur(e)):jr(e,"height",e.dom.offsetHeight)},uo=function(e,t){return{left:e,top:t,translate:function(n,r){return uo(e+n,t+r)}}},co=uo,so=function(e,t){return void 0!==e?e:void 0!==t?t:0},lo=function(e){var t=e.dom.ownerDocument,n=t.body,r=t.defaultView,o=t.documentElement;if(n===e.dom)return co(n.offsetLeft,n.offsetTop);var i=so(null==r?void 0:r.pageYOffset,o.scrollTop),a=so(null==r?void 0:r.pageXOffset,o.scrollLeft),u=so(o.clientTop,n.clientTop),c=so(o.clientLeft,n.clientLeft);return fo(e).translate(a-c,i-u)},fo=function(e){var t=e.dom,n=t.ownerDocument.body;return n===t?co(n.offsetLeft,n.offsetTop):_t(e)?function(e){var t=e.getBoundingClientRect();return co(t.left,t.top)}(t):co(0,0)},mo=function(e,t){return{row:e,y:t}},go=function(e,t){return{col:e,x:t}},po=function(e){return lo(e).left+Kr(e)},ho=function(e){return lo(e).left},vo=function(e,t){return go(e,ho(t))},bo=function(e,t){return go(e,po(t))},yo=function(e){return lo(e).top},wo=function(e,t){return mo(e,yo(t))},xo=function(e,t){return mo(e,yo(t)+io(t))},Co=function(e,t,n){if(0===n.length)return[];var r=N(n.slice(1),(function(t,n){return t.map((function(t){return e(n,t)}))})),o=n[n.length-1].map((function(e){return t(n.length-1,e)}));return r.concat([o])},So={delta:g,positions:function(e){return Co(wo,xo,e)},edge:yo},ko={delta:g,edge:ho,positions:function(e){return Co(vo,bo,e)}},To={delta:function(e){return-e},edge:po,positions:function(e){return Co(bo,vo,e)}},Oo=to(ko,To),_o={delta:function(e,t){return Oo(t).delta(e,t)},positions:function(e,t){return Oo(t).positions(e,t)},edge:function(e){return Oo(e).edge(e)}},Eo={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:[""]},Ao=(fr="[0-9]+",dr="[eE][+-]?[0-9]+",mr=function(e){return"(?:"+e+")?"},gr=["Infinity","[0-9]+\\."+mr(fr)+mr(dr),"\\.[0-9]+"+mr(dr),fr+mr(dr)].join("|"),new RegExp("^([+-]?(?:"+gr+"))(.*)$")),Do=function(e,t){return T.from(Ao.exec(e)).bind((function(e){var n=Number(e[1]),r=e[2];return function(e,t){return D(t,(function(t){return D(Eo[t],(function(t){return e===t}))}))}(r,t)?T.some({value:n,unit:r}):T.none()}))},Mo=/(\d+(\.\d+)?)%/,No=/(\d+(\.\d+)?)px|em/,Ro=dt("col"),zo=function(e,t,n){var r,o=(r=e,T.from(r.dom.parentElement).map(Re.fromDom)).getOrThunk((function(){return Et(mt(e))}));return t(e)/n(o)*100},Bo=function(e,t){Zt(e,"width",t+"px")},Po=function(e,t){Zt(e,"width",t+"%")},Io=function(e,t){Zt(e,"height",t+"px")},Fo=function(e,t,n,r){var o=parseFloat(e);return ie(e,"%")&&"table"!==ot(t)?function(e,t,n,r){var o=vn(e).map((function(e){var r=n(e);return Math.floor(t/100*r)})).getOr(t);return r(e,o),o}(t,o,n,r):o},Lo=function(e){var t=function(e){return ao(e)+"px"}(e);return t?Fo(t,e,oo,Io):oo(e)},Ho=function(e,t){return nn(e,t).orThunk((function(){return Ut(e,t).map((function(e){return e+"px"}))}))},Vo=function(e){return Ho(e,"width")},jo=function(e){return zo(e,Gr,Xr)},Uo=function(e){return Ro(e)?Gr(e):Yr(e)},Wo=function(e){return function(e,t,n){return n(e)/an(e,t)}(e,"rowspan",Lo)},$o=function(e,t,n){Zt(e,"width",t+n)},qo=function(e){return zo(e,Gr,Xr)+"%"},Go=m(Mo),Ko=dt("col"),Xo=function(e){return Vo(e).getOrThunk((function(){return Uo(e)+"px"}))},Yo=function(e){return(t=e,Ho(t,"height")).getOrThunk((function(){return Wo(e)+"px"}));var t},Jo=function(e,t,n,r,o,i){return e.filter(r).fold((function(){return i(eo(n,t))}),(function(e){return o(e)}))},Zo=function(e,t,n,r){var o=Jr(e),i=Fn.hasColumns(e)?function(e){return N(Fn.justColumns(e),(function(e){return T.from(e.element)}))}(e):o,a=[T.some(_o.edge(t))].concat(N(_o.positions(o,t),(function(e){return e.map((function(e){return e.x}))}))),u=y(un);return N(i,(function(e,t){return Jo(e,t,a,u,(function(e){if(function(e){var t=Me().browser,n=t.isChrome()||t.isFirefox();return!Ko(e)||n}(e))return n(e);var i,c,s=(i=o[t],c=g,null!=i?c(i):T.none());return Jo(s,t,a,u,(function(e){return r(T.some(Gr(e)))}),r)}),r)}))},Qo=function(e){return e.map((function(e){return e+"px"})).getOr("")},ei=function(e,t,n){return Zo(e,t,Uo,(function(e){return e.getOrThunk(n.minCellWidth)}))},ti=function(e,t,n,r,o){var i=Qr(e),a=[T.some(n.edge(t))].concat(N(n.positions(i,t),(function(e){return e.map((function(e){return e.y}))})));return N(i,(function(e,t){return Jo(e,t,a,y(cn),r,o)}))},ni=function(e,t){return function(){return _t(e)?t(e):parseFloat(nn(e,"width").getOr("0"))}},ri=function(e){var t=ni(e,Gr),n=m(0);return{width:t,pixelWidth:t,getWidths:function(t,n){return ei(t,e,n)},getCellDelta:n,singleColumnWidth:m([0]),minCellWidth:n,setElementWidth:d,adjustTableWidth:d,isRelative:!0,label:"none"}},oi=function(e){var t=ni(e,(function(e){return parseFloat(qo(e))})),n=ni(e,Gr);return{width:t,pixelWidth:n,getWidths:function(t,n){return function(e,t,n){return Zo(e,t,jo,(function(e){return e.fold((function(){return n.minCellWidth()}),(function(e){return e/n.pixelWidth()*100}))}))}(t,e,n)},getCellDelta:function(e){return e/n()*100},singleColumnWidth:function(e,t){return[100-e]},minCellWidth:function(){return ln()/n()*100},setElementWidth:Po,adjustTableWidth:function(n){var r=t();Po(e,r+n/100*r)},isRelative:!0,label:"percent"}},ii=function(e){var t=ni(e,Gr);return{width:t,pixelWidth:t,getWidths:function(t,n){return ei(t,e,n)},getCellDelta:g,singleColumnWidth:function(e,t){return[Math.max(ln(),e+t)-e]},minCellWidth:ln,setElementWidth:Bo,adjustTableWidth:function(n){var r=t()+n;Bo(e,r)},isRelative:!1,label:"pixel"}},ai=function(e){return Vo(e).fold((function(){return ri(e)}),(function(t){return function(e,t){return null!==Go().exec(t)?oi(e):ii(e)}(e,t)}))},ui=ii,ci=oi,si=function(e,t,n){var r=e[n].element,o=Re.fromTag("td");Zn(o,Re.fromTag("br")),(t?Zn:Jn)(r,o)},li=function(e,t){var n=function(e){return ze(e.element,t)},r=Ir(e),o=Cn(r),i=ai(e),a=Fn.generate(o),u=function(e,t){var n=e.grid.columns,r=e.grid.rows,o=n,i=0,a=0,u=[],c=[];return Ue(e.access,(function(e){if(u.push(e),t(e)){c.push(e);var n=e.row,s=n+e.rowspan-1,l=e.column,f=l+e.colspan-1;n<r?r=n:s>i&&(i=s),l<o?o=l:f>a&&(a=f)}})),function(e,t,n,r,o,i){return{minRow:e,minCol:t,maxRow:n,maxCol:r,allCells:o,selectedCells:i}}(r,o,i,a,u,c)}(a,n),c="th:not("+t+"),td:not("+t+")",s=mn(r,"th,td",(function(e){return ze(e,c)}));R(s,rr),function(e,t,n,r){for(var o=t.grid.columns,i=t.grid.rows,a=0;a<i;a++)for(var u=!1,c=0;c<o;c++)a<n.minRow||a>n.maxRow||c<n.minCol||c>n.maxCol||(Fn.getAt(t,a,c).filter(r).isNone()?si(e,u,a):u=!0)}(o,a,u,n);var l=function(e,t,n,r){if(0===r.minCol&&t.grid.columns===r.maxCol+1)return 0;var o=ei(t,e,n),i=I(o,(function(e,t){return e+t}),0),a=I(o.slice(r.minCol,r.maxCol+1),(function(e,t){return e+t}),0),u=a/i*n.pixelWidth()-n.pixelWidth();return n.getCellDelta(u)}(e,Fn.fromTable(e),i,u);return function(e,t,n,r){Ue(n.columns,(function(e){(e.column<t.minCol||e.column>t.maxCol)&&rr(e.element)}));var o=B(dn(e,"tr"),(function(e){return 0===e.dom.childElementCount}));R(o,rr),t.minCol!==t.maxCol&&t.minRow!==t.maxRow||R(dn(e,"th,td"),(function(e){Wt(e,"rowspan"),Wt(e,"colspan")})),Wt(e,Nn),Wt(e,"data-snooker-col-series"),ai(e).adjustTableWidth(r)}(r,u,a,l),r},fi=function(e){return"img"===ot(e)?1:ur(e).fold((function(){return yt(e).length}),(function(e){return e.length}))},di=["img","br"],mi=function(e){return ur(e).filter((function(e){return 0!==e.trim().length||e.indexOf(" ")>-1})).isSome()||A(di,ot(e))},gi=function(e){return t=mi,(n=function(e){for(var r=0;r<e.childNodes.length;r++){var o=Re.fromDom(e.childNodes[r]);if(t(o))return T.some(o);var i=n(e.childNodes[r]);if(i.isSome())return i}return T.none()})(e.dom);var t,n},pi=function(e){return hi(e,mi)},hi=function(e,t){var n=function(e){for(var r=yt(e),o=r.length-1;o>=0;o--){var i=r[o];if(t(i))return T.some(i);var a=n(i);if(a.isSome())return a}return T.none()};return n(e)},vi={scope:["row","col"]},bi=function(e){return function(){var t=Re.fromTag("td",e.dom);return Zn(t,Re.fromTag("br",e.dom)),t}},yi=function(e){return function(){return Re.fromTag("col",e.dom)}},wi=function(e){return function(){return Re.fromTag("colgroup",e.dom)}},xi=function(e){return function(){return Re.fromTag("tr",e.dom)}},Ci=function(e,t,n){var r=function(e,t){var n=Fr(e,t),r=yt(Ir(e));return tr(n,r),n}(e,t);return Ue(n,(function(e,t){null===e?Wt(r,t):Ht(r,t,e)})),r},Si=function(e){return e},ki=function(e,t,n){var r=function(e,t){var n,r,o,i;n=e.element,r=t,o=n.dom,i=r.dom,Yt(o)&&Yt(i)&&(i.style.cssText=o.style.cssText),rn(t,"height"),1!==e.colspan&&rn(t,"width")};return{col:function(n){var o=Re.fromTag(ot(n.element),t.dom);return r(n,o),e(n.element,o),o},colgroup:wi(t),row:xi(t),cell:function(o){var i=Re.fromTag(ot(o.element),t.dom),a=n.getOr(["strong","em","b","i","span","font","h1","h2","h3","h4","h5","h6","p","div"]),u=a.length>0?function(e,t,n){return gi(e).map((function(r){var o=n.join(","),i=Dt(r,o,(function(t){return Ie(t,e)}));return P(i,(function(e,t){var n=Pr(t);return Wt(n,"contenteditable"),Zn(e,n),n}),t)})).getOr(t)}(o.element,i,a):i;return Zn(u,Re.fromTag("br")),r(o,i),function(e,t){Ue(vi,(function(n,r){return Ut(e,r).filter((function(e){return A(n,e)})).each((function(e){return Ht(t,r,e)}))}))}(o.element,i),e(o.element,i),i},replace:Ci,colGap:yi(t),gap:bi(t)}},Ti=function(e){return{col:yi(e),colgroup:wi(e),row:xi(e),cell:bi(e),replace:Si,colGap:yi(e),gap:bi(e)}},Oi=function(e){return N(e,Re.fromDom)},_i=function(e){return Re.fromDom(e.getBody())},Ei=function(e){return e.getBoundingClientRect().width},Ai=function(e){return e.getBoundingClientRect().height},Di=function(e){return function(t){return Ie(t,_i(e))}},Mi=function(e){return/^\d+(\.\d+)?$/.test(e)?e+"px":e},Ni=function(e){Wt(e,"data-mce-style");var t=function(e){return Wt(e,"data-mce-style")};R(pn(e),t),R(hn(e),t)},Ri=function(e){return Re.fromDom(e.selection.getStart())},zi=function(e){return Dr(e.get(),m([]),g,W)},Bi=function(e){var t=function(e,t){return Ut(e,t).exists((function(e){return parseInt(e,10)>1}))},n=zi(e);return n.length>0&&j(n,(function(e){return t(e,"rowspan")||t(e,"colspan")}))?T.some(n):T.none()},Pi=function(e,t,n){return Dr(t.get(),T.none,(function(t){return t.length<=1?T.none():_r(e,n.firstSelectedSelector,n.lastSelectedSelector).map((function(e){return{bounds:e,cells:t}}))}),T.none)},Ii="data-mce-selected",Fi="data-mce-first-selected",Li="data-mce-last-selected",Hi={selected:Ii,selectedSelector:"td[data-mce-selected],th[data-mce-selected]",firstSelected:Fi,firstSelectedSelector:"td[data-mce-first-selected],th[data-mce-first-selected]",lastSelected:Li,lastSelectedSelector:"td[data-mce-last-selected],th[data-mce-last-selected]"},Vi=function(e,t,n){return{element:n,mergable:Pi(t,e,Hi),unmergable:Bi(e),selection:zi(e)}},ji=function(e){return function(t,n){var r,o=ot(t),i="col"===o||"colgroup"===o?vn(r=t).bind((function(e){return Or(e,Hi.firstSelectedSelector)})).fold(m(r),(function(e){return e[0]})):t;return Ft(i,e,n)}},Ui=ji("th,td,caption"),Wi=ji("th,td"),$i=function(e){return zi(e)},qi=function(e,t,n){e.on("BeforeGetContent",(function(n){!0===n.selection&&Dr(t.get(),d,(function(t){n.preventDefault(),function(e){return vn(e[0]).map((function(e){var t=li(e,"[data-mce-selected]");return Ni(t),[t]}))}(t).each((function(t){n.content="text"===n.format?function(e){return N(e,(function(e){return e.dom.innerText})).join("")}(t):function(e,t){return N(t,(function(t){return e.selection.serializer.serialize(t.dom,{})})).join("")}(e,t)}))}),d)})),e.on("BeforeSetContent",(function(r){if(!0===r.selection&&!0===r.paste){var o=$i(t);q(o).each((function(t){vn(t).each((function(o){var i,a,u,c=B((i=r.content,(u=(a||document).createElement("div")).innerHTML=i,yt(Re.fromDom(u))),(function(e){return"meta"!==ot(e)})),s=dt("table");if(1===c.length&&s(c[0])){r.preventDefault();var l=Re.fromDom(e.getDoc()),f=Ti(l),d=function(e,t,n){return{element:e,clipboard:t,generators:n}}(t,c[0],f);n.pasteCells(o,d).each((function(){e.focus()}))}}))}))}}))},Gi=Er([{none:[]},{only:["index"]},{left:["index","next"]},{middle:["prev","index","next"]},{right:["prev","index"]}]),Ki=X({},Gi),Xi=function(e,t,n,r,o){var i=e.slice(0),a=function(e,t){return 0===e.length?Ki.none():1===e.length?Ki.only(0):0===t?Ki.left(0,1):t===e.length-1?Ki.right(t-1,t):t>0&&t<e.length-1?Ki.middle(t-1,t,t+1):Ki.none()}(e,t),u=m(N(i,m(0)));return a.fold(u,(function(e){return r.singleColumnWidth(i[e],n)}),(function(e,t){return o.calcLeftEdgeDeltas(i,e,t,n,r.minCellWidth(),r.isRelative)}),(function(e,t,a){return o.calcMiddleDeltas(i,e,t,a,n,r.minCellWidth(),r.isRelative)}),(function(e,t){return o.calcRightEdgeDeltas(i,e,t,n,r.minCellWidth(),r.isRelative)}))},Yi=function(e,t,n){for(var r=0,o=e;o<t;o++)r+=void 0!==n[o]?n[o]:0;return r},Ji=function(e,t){var n=Fn.justCells(e);return N(n,(function(e){var n=Yi(e.row,e.row+e.rowspan,t);return{element:e.element,height:n,rowspan:e.rowspan}}))},Zi=function(e,t){return Fn.hasColumns(e)?function(e,t){var n=Fn.justColumns(e);return N(n,(function(e,n){return{element:e.element,width:t[n],colspan:e.colspan}}))}(e,t):function(e,t){var n=Fn.justCells(e);return N(n,(function(e){var n=Yi(e.column,e.column+e.colspan,t);return{element:e.element,width:n,colspan:e.colspan}}))}(e,t)},Qi=function(e,t,n){var r=Zi(e,t);R(r,(function(e){n.setElementWidth(e.element,e.width)}))},ea=function(e,t,n,r,o){var i=Fn.fromTable(e),a=o.getCellDelta(t),u=o.getWidths(i,o),c=n===i.grid.columns-1,s=r.clampTableDelta(u,n,a,o.minCellWidth(),c),l=Xi(u,n,s,o,r),f=N(l,(function(e,t){return e+u[t]}));Qi(i,f,o),r.resizeTable(o.adjustTableWidth,s,c)},ta=function(e,t,n,r){var o=Fn.fromTable(e),i=function(e,t,n){return ti(e,t,n,Wo,(function(e){return e.getOrThunk(fn)}))}(o,e,r),a=N(i,(function(e,r){return n===r?Math.max(t+e,fn()):e})),u=Ji(o,a),c=function(e,t){return N(e.all,(function(e,n){return{element:e.element,height:t[n]}}))}(o,a);R(c,(function(e){Io(e.element,e.height)})),R(u,(function(e){Io(e.element,e.height)}));var s=P(a,(function(e,t){return e+t}),0);Io(e,s)},na=function(e){return N(e,m(0))},ra=function(e,t,n,r,o){return o(e.slice(0,t)).concat(r).concat(o(e.slice(n)))},oa=function(e){return function(t,n,r,o){if(e(r)){var i=Math.max(o,t[n]-Math.abs(r)),a=Math.abs(i-t[n]);return r>=0?a:-a}return r}},ia=oa((function(e){return e<0})),aa=oa(x),ua=function(){var e=function(e,t,n,r){var o=(100+n)/100,i=Math.max(r,(e[t]+n)/o);return N(e,(function(e,n){return(n===t?i:e/o)-e}))},t=function(t,n,r,o,i,a){return a?e(t,n,o,i):function(e,t,n,r,o){var i=ia(e,t,r,o);return ra(e,t,n+1,[i,0],na)}(t,n,r,o,i)};return{resizeTable:function(e,t){return e(t)},clampTableDelta:ia,calcLeftEdgeDeltas:t,calcMiddleDeltas:function(e,n,r,o,i,a,u){return t(e,r,o,i,a,u)},calcRightEdgeDeltas:function(t,n,r,o,i,a){if(a)return e(t,r,o,i);var u=ia(t,r,o,i);return na(t.slice(0,r)).concat([u])},calcRedestributedWidths:function(e,t,n,r){if(r){var o=(t+n)/t,i=N(e,(function(e){return e/o}));return{delta:100*o-100,newSizes:i}}return{delta:n,newSizes:e}}}},ca=function(){var e=function(e,t,n,r,o){var i=aa(e,r>=0?n:t,r,o);return ra(e,t,n+1,[i,-i],na)};return{resizeTable:function(e,t,n){n&&e(t)},clampTableDelta:function(e,t,n,r,o){if(o){if(n>=0)return n;var i=I(e,(function(e,t){return e+t-r}),0);return Math.max(-i,n)}return ia(e,t,n,r)},calcLeftEdgeDeltas:e,calcMiddleDeltas:function(t,n,r,o,i,a){return e(t,r,o,i,a)},calcRightEdgeDeltas:function(e,t,n,r,o,i){if(i)return na(e);var a=r/e.length;return N(e,m(a))},calcRedestributedWidths:function(e,t,n,r){return{delta:0,newSizes:e}}}},sa=function(e,t){var n=T.from(e.dom.documentElement).map(Re.fromDom).getOr(e);return{parent:m(n),view:m(e),origin:m(co(0,0)),isResizable:t}},la=function(e,t,n){return{parent:m(t),view:m(e),origin:m(co(0,0)),isResizable:n}},fa=Er([{invalid:["raw"]},{pixels:["value"]},{percent:["value"]}]),da=function(e,t,n){var r=n.substring(0,n.length-e.length),o=parseFloat(r);return r===o.toString()?t(o):fa.invalid(n)},ma=X(X({},fa),{from:function(e){return ie(e,"%")?da("%",fa.percent,e):ie(e,"px")?da("px",fa.pixels,e):fa.invalid(e)}}),ga=function(e,t,n){return e.fold((function(){return t}),(function(e){return function(e,t,n){var r=n/t;return N(e,(function(e){return ma.from(e).fold((function(){return e}),(function(e){return e*r+"px"}),(function(e){return e/100*n+"px"}))}))}(t,n,e)}),(function(e){return function(e,t){return N(e,(function(e){return ma.from(e).fold((function(){return e}),(function(e){return e/t*100+"%"}),(function(e){return e+"%"}))}))}(t,n)}))},pa=function(e,t,n){var r=ma.from(n),o=j(e,(function(e){return"0px"===e}))?function(e,t){var n=e.fold((function(){return m("")}),(function(e){return m(e/t+"px")}),(function(){return m(100/t+"%")}));return M(t,n)}(r,e.length):ga(r,e,t);return ba(o)},ha=function(e,t){return 0===e.length?t:P(e,(function(e,t){return ma.from(t).fold(m(0),g,g)+e}),0)},va=function(e,t){return ma.from(e).fold(m(e),(function(e){return e+t+"px"}),(function(e){return e+t+"%"}))},ba=function(e){if(0===e.length)return e;var t=P(e,(function(e,t){var n=ma.from(t).fold((function(){return{value:t,remainder:0}}),(function(e){return function(e,t){var n=Math.floor(e);return{value:n+t,remainder:e-n}}(e,"px")}),(function(e){return{value:e+"%",remainder:0}}));return{output:[n.value].concat(e.output),remainder:e.remainder+n.remainder}}),{output:[],remainder:0}),n=t.output;return n.slice(0,n.length-1).concat([va(n[n.length-1],Math.round(t.remainder))])},ya=ma.from,wa=function(e){return ya(e).fold(m("px"),m("px"),m("%"))},xa=function(e,t,n){var r=Fn.fromTable(e),o=r.all,i=Fn.justCells(r),a=Fn.justColumns(r);t.each((function(t){var n=wa(t),o=Gr(e),u=function(e,t){return Zo(e,t,Xo,Qo)}(r,e),c=pa(u,o,t);Fn.hasColumns(r)?function(e,t,n){R(t,(function(t,r){var o=ha([e[r]],ln());Zt(t.element,"width",o+n)}))}(c,a,n):function(e,t,n){R(t,(function(t){var r=e.slice(t.column,t.colspan+t.column),o=ha(r,ln());Zt(t.element,"width",o+n)}))}(c,i,n),Zt(e,"width",t)})),n.each((function(t){var n=wa(t),a=oo(e),u=function(e,t,n){return ti(e,t,n,Yo,Qo)}(r,e,So);!function(e,t,n,r){R(n,(function(t){var n=e.slice(t.row,t.rowspan+t.row),o=ha(n,fn());Zt(t.element,"height",o+r)})),R(t,(function(t,n){Zt(t.element,"height",e[n])}))}(pa(u,a,t),o,i,n),Zt(e,"height",t)}))},Ca=function(e){return Vo(e).exists((function(e){return Mo.test(e)}))},Sa=function(e){return Vo(e).exists((function(e){return No.test(e)}))},ka=function(e){return Vo(e).isNone()},Ta=function(e){return Fn.fromTable(e).grid},Oa=function(e){var t=[];return{bind:function(e){if(void 0===e)throw new Error("Event bind error: undefined handler");t.push(e)},unbind:function(e){t=B(t,(function(t){return t!==e}))},trigger:function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o={};R(e,(function(e,t){o[e]=n[t]})),R(t,(function(e){e(o)}))}}},_a=function(e){return{registry:We(e,(function(e){return{bind:e.bind,unbind:e.unbind}})),trigger:We(e,(function(e){return e.trigger}))}},Ea=function(e){return e.slice(0).sort()},Aa=function(e,t,n){if(0===t.length)throw new Error("You must specify at least one required field.");var o;return function(e,t){if(!i(t))throw new Error("The "+e+" fields must be an array. Was: "+t+".");R(t,(function(t){if(!r(t))throw new Error("The value "+t+" in the "+e+" fields was not a string.")}))}("required",t),o=Ea(t),F(o,(function(e,t){return t<o.length-1&&e===o[t+1]})).each((function(e){throw new Error("The field: "+e+" occurs more than once in the combined fields: ["+o.join(", ")+"].")})),function(r){var o=Ve(r);j(t,(function(e){return A(o,e)}))||function(e,t){throw new Error("All required keys ("+Ea(e).join(", ")+") were not specified. Specified keys were: "+Ea(t).join(", ")+".")}(t,o),e(t,o);var i=B(t,(function(e){return!n.validate(r[e],e)}));return i.length>0&&function(e,t){throw new Error("All values need to be of type: "+t+". Keys ("+Ea(e).join(", ")+") were not.")}(i,n.label),r}},Da=function(e,t){var n=B(t,(function(t){return!A(e,t)}));n.length>0&&function(e){throw new Error("Unsupported keys for object: "+Ea(e).join(", "))}(n)},Ma=function(e){return function(e,t){return Aa(e,t,{validate:l,label:"function"})}(Da,e)},Na=Ma(["compare","extract","mutate","sink"]),Ra=Ma(["element","start","stop","destroy"]),za=Ma(["forceDrop","drop","move","delayDrop"]),Ba=function(){var e=T.none(),t=_a({move:Oa(["info"])});return{onEvent:function(n,r){r.extract(n).each((function(n){var o=function(t,n){var r=e.map((function(e){return t.compare(e,n)}));return e=T.some(n),r}(r,n);o.each((function(e){t.trigger.move(e)}))}))},reset:function(){e=T.none()},events:t.registry}},Pa=function(){var e,t=(e=_a({move:Oa(["info"])}),{onEvent:d,reset:d,events:e.registry}),n=Ba(),r=t;return{on:function(){r.reset(),r=n},off:function(){r.reset(),r=t},isOn:function(){return r===n},onEvent:function(e,t){r.onEvent(e,t)},events:n.events}},Ia=function(e,t,n){var r,o,i,u,c=!1,s=_a({start:Oa([]),stop:Oa([])}),l=Pa(),f=function(){g.stop(),l.isOn()&&(l.off(),s.trigger.stop())},d=(r=f,o=200,i=null,{cancel:u=function(){a(i)||(clearTimeout(i),i=null)},throttle:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];u(),i=setTimeout((function(){i=null,r.apply(null,e)}),o)}});l.events.move.bind((function(n){t.mutate(e,n.info)}));var m=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];c&&e.apply(null,t)}},g=t.sink(za({forceDrop:f,drop:m(f),move:m((function(e){d.cancel(),l.onEvent(e,t)})),delayDrop:m(d.throttle)}),n);return{element:g.element,go:function(e){g.start(e),l.on(),s.trigger.start()},on:function(){c=!0},off:function(){c=!1},destroy:function(){g.destroy()},events:s.registry}},Fa=function(e){var t,n,r=Re.fromDom(function(e){if(Ct()&&s(e.target)){var t=Re.fromDom(e.target);if(ct(t)&&Ot(t)&&e.composed&&e.composedPath){var n=e.composedPath();if(n)return q(n)}}return T.from(e.target)}(e).getOr(e.target)),o=function(){return e.stopPropagation()},i=function(){return e.preventDefault()},a=(t=i,n=o,function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return t(n.apply(null,e))});return function(e,t,n,r,o,i,a){return{target:e,x:t,y:n,stop:r,prevent:o,kill:i,raw:a}}(r,e.clientX,e.clientY,o,i,a,e)},La=function(e,t,n,r,o){var i=function(e,t){return function(n){e(n)&&t(Fa(n))}}(n,r);return e.dom.addEventListener(t,i,o),{unbind:h(Ha,e,t,i,o)}},Ha=function(e,t,n,r){e.dom.removeEventListener(t,n,r)},Va=x,ja=function(e,t,n){return function(e,t,n,r){return La(e,t,n,r,!1)}(e,t,Va,n)},Ua=Fa,Wa=function(e,t){var n=jt(e,t);return void 0===n||""===n?[]:n.split(" ")},$a=function(e){return void 0!==e.dom.classList},qa=function(e,t){return function(e,t,n){var r=Wa(e,t).concat([n]);return Ht(e,t,r.join(" ")),!0}(e,"class",t)},Ga=function(e,t){$a(e)?e.dom.classList.add(t):qa(e,t)},Ka=function(e,t){return $a(e)&&e.dom.classList.contains(t)},Xa=function(e){var t=e.replace(/\./g,"-");return{resolve:function(e){return t+"-"+e}}},Ya=Xa("ephox-dragster"),Ja=Ya.resolve,Za=Na({compare:function(e,t){return co(t.left-e.left,t.top-e.top)},extract:function(e){return T.some(co(e.x,e.y))},sink:function(e,t){var n=function(e){var t=X({layerClass:Ja("blocker")},e),n=Re.fromTag("div");return Ht(n,"role","presentation"),Qt(n,{position:"fixed",left:"0px",top:"0px",width:"100%",height:"100%"}),Ga(n,Ja("blocker")),Ga(n,t.layerClass),{element:m(n),destroy:function(){rr(n)}}}(t),r=ja(n.element(),"mousedown",e.forceDrop),o=ja(n.element(),"mouseup",e.drop),i=ja(n.element(),"mousemove",e.move),a=ja(n.element(),"mouseout",e.delayDrop);return Ra({element:n.element,start:function(e){Zn(e,n.element())},stop:function(){rr(n.element())},destroy:function(){n.destroy(),o.unbind(),i.unbind(),a.unbind(),r.unbind()}})},mutate:function(e,t){e.mutate(t.left,t.top)}}),Qa=function(e){return Ft(e,"[contenteditable]")},eu=function(e,t){return void 0===t&&(t=!1),!Me().browser.isIE()&&_t(e)?e.dom.isContentEditable:Qa(e).fold(m(t),(function(e){return"true"===tu(e)}))},tu=function(e){return e.dom.contentEditable},nu=Xa("ephox-snooker"),ru=nu.resolve,ou=function(){var e=_a({drag:Oa(["xDelta","yDelta","target"])}),t=T.none(),n=function(){var e=_a({drag:Oa(["xDelta","yDelta"])});return{mutate:function(t,n){e.trigger.drag(t,n)},events:e.registry}}();n.events.drag.bind((function(n){t.each((function(t){e.trigger.drag(n.xDelta,n.yDelta,t)}))}));return{assign:function(e){t=T.some(e)},get:function(){return t},mutate:n.mutate,events:e.registry}},iu=ru("resizer-bar"),au=ru("resizer-rows"),uu=ru("resizer-cols"),cu=function(e){var t=Nt(e.parent(),"."+iu);R(t,rr)},su=function(e,t,n){var r=e.origin();R(t,(function(t){t.each((function(t){var o=n(r,t);Ga(o,iu),Zn(e.parent(),o)}))}))},lu=function(e,t,n,r){su(e,t,(function(e,t){var o,i,a,u,c,s,l=(o=t.col,i=t.x-e.left,a=n.top-e.top,u=7,c=r,s=Re.fromTag("div"),Qt(s,{position:"absolute",left:i-u/2+"px",top:a+"px",height:c+"px",width:u+"px"}),Vt(s,{"data-column":o,role:"presentation"}),s);return Ga(l,uu),l}))},fu=function(e,t,n,r){su(e,t,(function(e,t){var o=function(e,t,n,r,o){var i=Re.fromTag("div");return Qt(i,{position:"absolute",left:t+"px",top:n-o/2+"px",height:o+"px",width:r+"px"}),Vt(i,{"data-row":e,role:"presentation"}),i}(t.row,n.left-e.left,t.y-e.top,r,7);return Ga(o,au),o}))},du=function(e,t,n,r,o){var i=lo(n),a=t.isResizable,u=r.length>0?So.positions(r,n):[],c=u.length>0?function(e,t){return V(e.all,(function(e,n){return t(e.element)?[n]:[]}))}(e,a):[],s=B(u,(function(e,t){return D(c,(function(e){return t===e}))}));fu(t,s,i,Kr(n));var l=o.length>0?_o.positions(o,n):[],f=l.length>0?function(e,t){var n=[];return M(e.grid.columns,(function(r){var o=Fn.getColumnAt(e,r).map((function(e){return e.element}));o.forall(t)&&n.push(r)})),B(n,(function(n){var r=Fn.filterItems(e,(function(e){return e.column===n}));return j(r,(function(e){return t(e.element)}))}))}(e,a):[],d=B(l,(function(e,t){return D(f,(function(e){return t===e}))}));lu(t,d,i,io(n))},mu=function(e,t){if(cu(e),e.isResizable(t)){var n=Fn.fromTable(t),r=Qr(n),o=Jr(n);du(n,e,t,r,o)}},gu=function(e,t){var n=Nt(e.parent(),"."+iu);R(n,t)},pu=function(e){gu(e,(function(e){Zt(e,"display","none")}))},hu=function(e){gu(e,(function(e){Zt(e,"display","block")}))},vu=ru("resizer-bar-dragging"),bu=function(e){var t=ou(),n=function(e,t){void 0===t&&(t={});var n=void 0!==t.mode?t.mode:Za;return Ia(e,n,t)}(t,{}),r=T.none(),o=function(e,t){return T.from(jt(e,t))};t.events.drag.bind((function(e){o(e.target,"data-row").each((function(t){var n=sn(e.target,"top");Zt(e.target,"top",n+e.yDelta+"px")})),o(e.target,"data-column").each((function(t){var n=sn(e.target,"left");Zt(e.target,"left",n+e.xDelta+"px")}))}));var i=function(e,t){return sn(e,t)-on(e,"data-initial-"+t,0)};n.events.stop.bind((function(){t.get().each((function(t){r.each((function(n){o(t,"data-row").each((function(e){var r=i(t,"top");Wt(t,"data-initial-top"),l.trigger.adjustHeight(n,r,parseInt(e,10))})),o(t,"data-column").each((function(e){var r=i(t,"left");Wt(t,"data-initial-left"),l.trigger.adjustWidth(n,r,parseInt(e,10))})),mu(e,n)}))}))}));var a=function(r,o){l.trigger.startAdjust(),t.assign(r),Ht(r,"data-initial-"+o,sn(r,o)),Ga(r,vu),Zt(r,"opacity","0.2"),n.go(e.parent())},u=ja(e.parent(),"mousedown",(function(e){var t;t=e.target,Ka(t,au)&&a(e.target,"top"),function(e){return Ka(e,uu)}(e.target)&&a(e.target,"left")})),c=function(t){return Ie(t,e.view())},s=ja(e.view(),"mouseover",(function(t){var n;(n=t.target,Ft(n,"table",c).filter(eu)).fold((function(){_t(t.target)&&cu(e)}),(function(t){r=T.some(t),mu(e,t)}))})),l=_a({adjustHeight:Oa(["table","delta","row"]),adjustWidth:Oa(["table","delta","column"]),startAdjust:Oa([])});return{destroy:function(){u.unbind(),s.unbind(),n.destroy(),cu(e)},refresh:function(t){mu(e,t)},on:n.on,off:n.off,hideBars:h(pu,e),showBars:h(hu,e),events:l.registry}},yu=function(e,t,n){var r=So,o=_o,i=bu(e),a=_a({beforeResize:Oa(["table","type"]),afterResize:Oa(["table","type"]),startDrag:Oa([])});return i.events.adjustHeight.bind((function(e){var t=e.table;a.trigger.beforeResize(t,"row");var n=r.delta(e.delta,t);ta(t,n,e.row,r),a.trigger.afterResize(t,"row")})),i.events.startAdjust.bind((function(e){a.trigger.startDrag()})),i.events.adjustWidth.bind((function(e){var r=e.table;a.trigger.beforeResize(r,"col");var i=o.delta(e.delta,r),u=n(r);ea(r,i,e.column,t,u),a.trigger.afterResize(r,"col")})),{on:i.on,off:i.off,hideBars:i.hideBars,showBars:i.showBars,destroy:i.destroy,events:a.registry}},wu=function(e,t){return e.fire("newrow",{node:t})},xu=function(e,t){return e.fire("newcell",{node:t})},Cu=function(e,t,n){e.fire("TableModified",X(X({},n),{table:t}))},Su={structure:!1,style:!0},ku={structure:!0,style:!1},Tu={structure:!0,style:!0},Ou={"border-collapse":"collapse",width:"100%"},_u=M(5,(function(e){var t=e+1+"px";return{title:t,value:t}})),Eu=N(["Solid","Dotted","Dashed","Double","Groove","Ridge","Inset","Outset","None","Hidden"],(function(e){return{title:e,value:e.toLowerCase()}})),Au={border:"1"},Du="preservetable",Mu=function(e){return e.getParam("table_sizing_mode","auto")},Nu=function(e){return e.getParam("table_responsive_width")},Ru=function(e){return e.getParam("table_border_widths",_u,"array")},zu=function(e){return e.getParam("table_border_styles",Eu,"array")},Bu=function(e){return e.getParam("table_default_attributes",Au,"object")},Pu=function(e){return e.getParam("table_default_styles",function(e){var t;if(Wu(e)){var n=e.dom,r=null!==(t=n.getParent(e.selection.getStart(),n.isBlock))&&void 0!==t?t:e.getBody(),o=Xr(Re.fromDom(r));return X(X({},Ou),{width:o+"px"})}return $u(e)?qe(Ou,(function(e,t){return"width"!==t})):Ou}(e),"object")},Iu=function(e){return e.getParam("table_cell_advtab",!0,"boolean")},Fu=function(e){return e.getParam("table_row_advtab",!0,"boolean")},Lu=function(e){return e.getParam("table_advtab",!0,"boolean")},Hu=function(e){return e.getParam("table_style_by_css",!1,"boolean")},Vu=function(e){return e.getParam("table_cell_class_list",[],"array")},ju=function(e){return e.getParam("table_class_list",[],"array")},Uu=function(e){return"relative"===Mu(e)||!0===Nu(e)},Wu=function(e){return"fixed"===Mu(e)||!1===Nu(e)},$u=function(e){return"responsive"===Mu(e)},qu=function(e){return e.getParam("table_use_colgroups",!1,"boolean")},Gu=function(e){var t="section",n=e.getParam("table_header_type",t,"string");return A(["section","cells","sectionCells","auto"],n)?n:t},Ku=function(e){var t=e.getParam("table_column_resizing",Du,"string");return F(["preservetable","resizetable"],(function(e){return e===t})).getOr(Du)},Xu=function(e){return"preservetable"===Ku(e)},Yu=function(e){return"resizetable"===Ku(e)},Ju=function(e){var t=e.getParam("table_clone_elements");return r(t)?T.some(t.split(/[ ,]/)):Array.isArray(t)?T.some(t):T.none()},Zu=function(e){return e.getParam("table_background_color_map",[],"array")},Qu=function(e){return e.getParam("table_border_color_map",[],"array")},ec=function(e,t){return Uu(e)?ci(t):Wu(e)?ui(t):ai(t)},tc=function(e){Wt(e,"width")},nc=function(e){var t=qo(e);xa(e,T.some(t),T.none()),tc(e)},rc=function(e){var t=function(e){return Gr(e)+"px"}(e);xa(e,T.some(t),T.none()),tc(e)},oc=function(e){rn(e,"width");var t=hn(e),n=t.length>0?t:pn(e);R(n,(function(e){rn(e,"width"),tc(e)})),tc(e)},ic=function(){var e=Re.fromTag("div");return Qt(e,{position:"static",height:"0",width:"0",padding:"0",margin:"0",border:"0"}),Zn(Et(Re.fromDom(document)),e),e},ac="bar-",uc=function(e){return"false"!==jt(e,"data-mce-resize")},cc=function(e){var t,n,o=T.none(),i=T.none(),a=T.none(),u=function(e){return"TABLE"===e.nodeName},c=function(){return i},s=function(t){return ec(e,t)},l=function(){return Xu(e)?ca():ua()},f=function(r,o,i){var a=ie(o,"e");if(""===n&&nc(r),i!==t&&""!==n){Zt(r,"width",n);var u=l(),c=s(r),f=Xu(e)||a?function(e){return Ta(e).columns}(r)-1:0;ea(r,i-t,f,u,c)}else if(function(e){return/^(\d+(\.\d+)?)%$/.test(e)}(n)){var d=parseFloat(n.replace("%",""));Zt(r,"width",i*d/t+"%")}(function(e){return/^(\d+(\.\d+)?)px$/.test(e)})(n)&&function(e){var t=Fn.fromTable(e);Fn.hasColumns(t)||R(pn(e),(function(e){var t=en(e,"width");Zt(e,"width",t),Wt(e,"width")}))}(r)};return e.on("init",(function(){var t=function(e,t){return e.inline?la(_i(e),ic(),t):sa(Re.fromDom(e.getDoc()),t)}(e,uc);if(a=T.some(t),function(e){var t=e.getParam("object_resizing",!0);return r(t)?"table"===t:t}(e)&&function(e){return e.getParam("table_resize_bars",!0,"boolean")}(e)){var n=l(),u=yu(t,n,s);u.on(),u.events.startDrag.bind((function(t){o=T.some(e.selection.getRng())})),u.events.beforeResize.bind((function(t){var n=t.table.dom;!function(e,t,n,r,o){e.fire("ObjectResizeStart",{target:t,width:n,height:r,origin:o})}(e,n,Ei(n),Ai(n),ac+t.type)})),u.events.afterResize.bind((function(t){var n=t.table,r=n.dom;Ni(n),o.each((function(t){e.selection.setRng(t),e.focus()})),function(e,t,n,r,o){e.fire("ObjectResized",{target:t,width:n,height:r,origin:o})}(e,r,Ei(r),Ai(r),ac+t.type),e.undoManager.add()})),i=T.some(u)}})),e.on("ObjectResizeStart",(function(r){var o=r.target;if(u(o)){var i=Re.fromDom(o);R(e.dom.select(".mce-clonedresizable"),(function(t){e.dom.addClass(t,"mce-"+Ku(e)+"-columns")})),!Sa(i)&&Wu(e)?rc(i):!Ca(i)&&Uu(e)&&nc(i),ka(i)&&oe(r.origin,ac)&&nc(i),t=r.width,n=$u(e)?"":function(e,t){var n=e.dom.getStyle(t,"width")||e.dom.getAttrib(t,"width");return T.from(n).filter(ue)}(e,o).getOr("")}})),e.on("ObjectResized",(function(t){var n=t.target;if(u(n)){var r=Re.fromDom(n),o=t.origin;oe(o,"corner-")&&f(r,o,t.width),Ni(r),Cu(e,r.dom,Su)}})),e.on("SwitchMode",(function(){c().each((function(t){e.mode.isReadOnly()?t.hideBars():t.showBars()}))})),{lazyResize:c,lazyWire:function(){return a.getOr(sa(Re.fromDom(e.getBody()),uc))},destroy:function(){i.each((function(e){e.destroy()})),a.each((function(t){!function(e,t){e.inline&&rr(t.parent())}(e,t)}))}}},sc=function(e,t){return{element:e,offset:t}},lc=function(e,t,n){return e.property().isText(t)&&0===e.property().getText(t).trim().length||e.property().isComment(t)?n(t).bind((function(t){return lc(e,t,n).orThunk((function(){return T.some(t)}))})):T.none()},fc=function(e,t){return e.property().isText(t)?e.property().getText(t).length:e.property().children(t).length},dc=function(e,t){var n=lc(e,t,e.query().prevSibling).getOr(t);if(e.property().isText(n))return sc(n,fc(e,n));var r=e.property().children(n);return r.length>0?dc(e,r[r.length-1]):sc(n,fc(e,n))},mc=dc,gc=lr(),pc=function(e,t){if(1===an(e,"colspan")){var n=function(e){return Vo(e).bind((function(e){return Do(e,["fixed","relative","empty"])}))}(e);n.each((function(n){var r=n.value/2;$o(e,r,n.unit),$o(t,r,n.unit)}))}},hc=dt("th"),vc=function(e){return j(e,(function(e){return hc(e.element)}))},bc=function(e,t){return e&&t?"sectionCells":e?"section":"cells"},yc=function(e){var t="thead"===e.section,n=qt(wc(e.cells),"th");return t||n?{type:"header",subType:bc(t,n)}:"tfoot"===e.section?{type:"footer"}:{type:"body"}},wc=function(e){var t=B(e,(function(e){return hc(e.element)}));return 0===t.length?T.some("td"):t.length===e.length?T.some("th"):T.none()},xc=function(e,t,n){return nt(n(e.element,t),!0,e.isLocked)},Cc=function(e,t){return e.section!==t?rt(e.element,e.cells,t,e.isNew):e},Sc=function(){return{transformRow:Cc,transformCell:function(e,t,n){var r=n(e.element,t),o="td"!==ot(r)?function(e,t){var n=Fr(e,t);Xn(e,n);var r=yt(e);return tr(n,r),rr(e),n}(r,"td"):r;return nt(o,e.isNew,e.isLocked)}}},kc=function(){return{transformRow:Cc,transformCell:xc}},Tc=function(){return{transformRow:function(e,t){return Cc(e,"thead"===t?"tbody":t)},transformCell:xc}},Oc=function(e,t){var n=function(e){return K(e.all,(function(e){var t=yc(e);return"header"===t.type?T.from(t.subType):T.none()}))}(Fn.fromTable(e)).getOr(t);switch(n){case"section":return Sc();case"sectionCells":return kc();case"cells":return Tc()}},_c=Sc,Ec=kc,Ac=Tc,Dc=function(){return{transformRow:g,transformCell:xc}},Mc=function(e,t,n,r){n===r?Wt(e,t):Ht(e,t,n)},Nc=function(e,t,n){G(Mt(e,t)).fold((function(){return Jn(e,n)}),(function(e){return Yn(e,n)}))},Rc=function(e,t){var n=[],r=[],o=function(e){return N(e,(function(e){e.isNew&&n.push(e.element);var t=e.element;return nr(t),R(e.cells,(function(e){e.isNew&&r.push(e.element),Mc(e.element,"colspan",e.colspan,1),Mc(e.element,"rowspan",e.rowspan,1),Zn(t,e.element)})),t}))},i=function(e){return V(e,(function(e){return N(e.cells,(function(e){return Mc(e.element,"span",e.colspan,1),e.element}))}))},a=function(t,n){var r=function(e,t){var n=Pt(e,t).getOrThunk((function(){var n=Re.fromTag(t,mt(e).dom);return"thead"===t?Nc(e,"caption,colgroup",n):"colgroup"===t?Nc(e,"caption",n):Zn(e,n),n}));return nr(n),n}(e,n),a=("colgroup"===n?i:o)(t);tr(r,a)},u=function(t,n){t.length>0?a(t,n):function(t){Pt(e,t).each(rr)}(n)},c=[],s=[],l=[],f=[];return R(t,(function(e){switch(e.section){case"thead":c.push(e);break;case"tbody":s.push(e);break;case"tfoot":l.push(e);break;case"colgroup":f.push(e)}})),u(f,"colgroup"),u(c,"thead"),u(s,"tbody"),u(l,"tfoot"),{newRows:n,newCells:r}},zc=function(e,t){if(0===e.length)return 0;var n=e[0];return L(e,(function(e){return!t(n.element,e.element)})).getOr(e.length)},Bc=function(e,t,n,r){var o=function(e,t){return e[t]}(e,t),i="colgroup"===o.section,a=zc(o.cells.slice(n),r),u=i?1:zc(function(e,t){return N(e,(function(e){return _n(e,t)}))}(e.slice(t),n),r);return{colspan:a,rowspan:u}},Pc=function(e,t){var n=N(e,(function(e){return N(e.cells,w)}));return N(e,(function(r,o){var i=V(r.cells,(function(r,i){if(!1===n[o][i]){var a=Bc(e,o,i,t);return function(e,t,r,o){for(var i=e;i<e+r;i++)for(var a=t;a<t+o;a++)n[i][a]=!0}(o,i,a.rowspan,a.colspan),[(u=r.element,c=a.rowspan,s=a.colspan,l=r.isNew,{element:u,rowspan:c,colspan:s,isNew:l})]}return[];var u,c,s,l}));return function(e,t,n,r){return{element:e,cells:t,section:n,isNew:r}}(r.element,i,r.section,r.isNew)}))},Ic=function(e,t,n){var r=[];R(e.colgroups,(function(o){for(var i=[],a=0;a<e.grid.columns;a++){var u=Fn.getColumnAt(e,a).map((function(e){return nt(e.element,n,!1)})).getOrThunk((function(){return nt(t.colGap(),!0,!1)}));i.push(u)}r.push(rt(o.element,i,"colgroup",n))}));for(var o=0;o<e.grid.rows;o++){for(var i=[],a=0;a<e.grid.columns;a++){var u=Fn.getAt(e,o,a).map((function(e){return nt(e.element,n,e.isLocked)})).getOrThunk((function(){return nt(t.gap(),!0,!1)}));i.push(u)}var c=e.all[o],s=rt(c.element,i,c.section,n);r.push(s)}return r},Fc=function(e){return Pc(e,Ie)},Lc=function(e,t){return K(e.all,(function(e){return F(e.cells,(function(e){return Ie(t,e.element)}))}))},Hc=function(e,t,n){var r=N(t.selection,(function(t){return gn(t).bind((function(t){return Lc(e,t)})).filter(n)})),o=Gt(r);return Xt(o.length>0,o)},Vc=function(e,t,n,r,o){return function(i,a,u,c,s){var l=Fn.fromTable(a),f=T.from(null==s?void 0:s.section).getOrThunk(Dc);return t(l,u).map((function(t){var n=function(e,t){return Ic(e,t,!1)}(l,c),r=e(n,t,Ie,o(c),f),i=zn(r.grid);return{info:t,grid:Fc(r.grid),cursor:r.cursor,lockedColumns:i}})).bind((function(e){var t=Rc(a,e.grid),o=T.from(null==s?void 0:s.sizing).getOrThunk((function(){return ai(a)})),u=T.from(null==s?void 0:s.resize).getOrThunk(ca);return n(a,e.grid,e.info,{sizing:o,resize:u,section:f}),r(a),mu(i,a),Wt(a,Nn),e.lockedColumns.length>0&&Ht(a,Nn,e.lockedColumns.join(",")),T.some({cursor:e.cursor,newRows:t.newRows,newCells:t.newCells})}))}},jc=function(e,t){return Hc(e,t,x).map((function(e){return{cells:e,generators:t.generators,clipboard:t.clipboard}}))},Uc=function(e,t){return Hc(e,t,x)},Wc=function(e,t){return Hc(e,t,(function(e){return!e.isLocked}))},$c=function(e,t){return j(t,(function(t){return function(e,t){return Lc(e,t).exists((function(e){return!e.isLocked}))}(e,t)}))},qc=function(e,t){return function(e,t){return t.mergable}(0,t).filter((function(t){return $c(e,t.cells)}))},Gc=function(e,t){return function(e,t){return t.unmergable}(0,t).filter((function(t){return $c(e,t)}))},Kc=function(e,t,n,r){for(var o=Dn(e).rows,i=!0,a=0;a<o.length;a++)for(var u=0;u<An(o[0]);u++){var c=o[a],s=_n(c,u),l=n(s.element,t);!0===l&&!1===i?Tn(c,u,nt(r(),!0,s.isLocked)):!0===l&&(i=!1)}return e},Xc=function(e,t,n,r){var o=Dn(e).rows;if(t>0&&t<o.length){var i=function(e,t){return I(e,(function(e,n){return D(e,(function(e){return t(e.element,n.element)}))?e:e.concat([n])}),[])}(o[t-1].cells,n);R(i,(function(e){for(var i=T.none(),a=t;a<o.length;a++)for(var u=function(t){var u=o[a],c=_n(u,t);n(c.element,e.element)&&(i.isNone()&&(i=T.some(r())),i.each((function(e){Tn(u,t,nt(e,!0,c.isLocked))})))},c=0;c<An(o[0]);c++)u(c)}))}return e},Yc=function(e){return{isValue:x,isError:w,getOr:m(e),getOrThunk:m(e),getOrDie:m(e),or:function(t){return Yc(e)},orThunk:function(t){return Yc(e)},fold:function(t,n){return n(e)},map:function(t){return Yc(t(e))},mapError:function(t){return Yc(e)},each:function(t){t(e)},bind:function(t){return t(e)},exists:function(t){return t(e)},forall:function(t){return t(e)},toOptional:function(){return T.some(e)}}},Jc=function(e){return{isValue:w,isError:x,getOr:g,getOrThunk:function(e){return e()},getOrDie:function(){return(t=String(e),function(){throw new Error(t)})();var t},or:g,orThunk:function(e){return e()},fold:function(t,n){return t(e)},map:function(t){return Jc(e)},mapError:function(t){return Jc(t(e))},each:d,bind:function(t){return Jc(e)},exists:w,forall:x,toOptional:T.none}},Zc={value:Yc,error:Jc,fromOption:function(e,t){return e.fold((function(){return Jc(t)}),Yc)}},Qc=function(e,t){return{rowDelta:0,colDelta:An(e[0])-An(t[0])}},es=function(e,t){return{rowDelta:e.length-t.length,colDelta:0}},ts=function(e,t,n,r){var o="colgroup"===t.section?n.col:n.cell;return M(e,(function(e){return nt(o(),!0,r(e))}))},ns=function(e,t,n,r){var o=e[e.length-1];return e.concat(M(t,(function(){var e="colgroup"===o.section?n.colgroup:n.row,t=Mn(o,e,g),i=ts(t.cells.length,t,n,(function(e){return Je(r,e.toString())}));return On(t,i)})))},rs=function(e,t,n,r){return N(e,(function(e){var o=ts(t,e,n,w);return Sn(e,r,o)}))},os=function(e,t,n){var r=t.colDelta<0?rs:g,o=t.rowDelta<0?ns:g,i=zn(e),a=An(e[0]),u=D(i,(function(e){return e===a-1})),c=r(e,Math.abs(t.colDelta),n,u?a-1:a),s=zn(c);return o(c,Math.abs(t.rowDelta),n,U(s,x))},is=function(e,t,n,r){var o=h(r,_n(e[t],n).element),i=e[t];return e.length>1&&An(i)>1&&(n>0&&o(En(i,n-1))||n<i.cells.length-1&&o(En(i,n+1))||t>0&&o(En(e[t-1],n))||t<e.length-1&&o(En(e[t+1],n)))},as=function(e,t,n){return B(n,(function(n){return n>=e.column&&n<=An(t[0])+e.column}))},us=function(e,t,n,r,o){var i=zn(t),a=function(e,t,n){var r=An(t[0]),o=Dn(t).cols.length+e.row,i=M(r-e.column,(function(t){return t+e.column})),a=F(i,(function(e){return j(n,(function(t){return t!==e}))})).getOr(r-1);return{row:o,column:a}}(e,t,i),u=Dn(n).rows,c=as(a,u,i),s=function(e,t,n){if(e.row>=t.length||e.column>An(t[0]))return Zc.error("invalid start address out of table bounds, row: "+e.row+", column: "+e.column);var r=t.slice(e.row),o=r[0].cells.slice(e.column),i=An(n[0]),a=n.length;return Zc.value({rowDelta:r.length-a,colDelta:o.length-i})}(a,t,u);return s.map((function(e){var n=X(X({},e),{colDelta:e.colDelta-c.length}),i=os(t,n,r),s=zn(i),l=as(a,u,s);return function(e,t,n,r,o,i){for(var a=e.row,u=e.column,c=a+n.length,s=u+An(n[0])+i.length,l=U(i,x),f=a;f<c;f++)for(var d=0,m=u;m<s;m++)if(l[m])d++;else{is(t,f,m,o)&&Kc(t,En(t[f],m),o,r.cell);var g=m-u-d,p=_n(n[f-a],g),h=p.element,v=r.replace(h);Tn(t[f],m,nt(v,!0,p.isLocked))}return t}(a,i,u,r,o,l)}))},cs=function(e,t,n,r,o){!function(e,t,n,r){t>0&&t<e[0].cells.length&&R(e,(function(e){var o=e.cells[t-1],i=e.cells[t];n(i.element,o.element)&&Tn(e,t,nt(r(),!0,i.isLocked))}))}(t,e,o,r.cell);var i=es(n,t),a=os(n,i,r),u=es(t,a),c=os(t,u,r);return N(c,(function(t,n){return Sn(t,e,a[n].cells)}))},ss=function(e,t,n,r,o){Xc(t,e,o,r.cell);var i=zn(t),a=Qc(t,n),u=X(X({},a),{colDelta:a.colDelta-i.length}),c=os(t,u,r),s=Dn(c),l=s.cols,f=s.rows,d=zn(c),m=Qc(n,t),g=X(X({},m),{colDelta:m.colDelta+d.length}),p=function(e,t,n){return N(e,(function(e){return I(n,(function(n,r){var o=ts(1,e,t,x)[0];return kn(n,r,o)}),e)}))}(n,r,d),h=os(p,g,r);return l.concat(f.slice(0,e)).concat(h).concat(f.slice(e,f.length))},ls=function(e,t,n,r,o){var i=Dn(e),a=i.rows,u=i.cols,c=a.slice(0,t),s=a.slice(t),l=function(e,t,n,r){return Mn(e,(function(e){return r(e,n)}),t)}(a[n],(function(e,n){return t>0&&t<a.length&&r(En(a[t-1],n),En(a[t],n))?_n(a[t],n):nt(o(e.element,r),!0,e.isLocked)}),r,o);return u.concat(c).concat([l]).concat(s)},fs=function(e,t,n,r,o){return N(e,(function(e){var i=t>0&&t<An(e)&&r(En(e,t-1),En(e,t)),a=function(e,t,n,r,o,i,a){if("colgroup"!==n&&r)return _n(e,t);var u=_n(e,o);return nt(a(u.element,i),!0,!1)}(e,t,e.section,i,n,r,o);return kn(e,t,a)}))},ds=function(e,t,n,r){return function(e,t,n,r){return void 0!==En(e[t],n)&&t>0&&r(En(e[t-1],n),En(e[t],n))}(e,t,n,r)||function(e,t,n){return t>0&&n(En(e,t-1),En(e,t))}(e[t],n,r)},ms=function(e,t,n,r){var o=function(e){return function(e){return"row"===e?cn(t):un(t)}(e)?e+"group":e};return e?hc(t)?o(n):null:r&&hc(t)?o("row"===n?"col":"row"):null},gs=function(e,t,n){return nt(n(e.element,t),!0,e.isLocked)},ps=function(e,t,n,r,o,i,a){return N(e,(function(e,u){return function(e,t){var n=e.cells,r=N(n,t);return rt(e.element,r,e.section,e.isNew)}(e,(function(e,c){if(function(e){return D(t,(function(t){return n(e.element,t.element)}))}(e)){var s=a(e,u,c)?o(e,n,r):e;return i(s,u,c).each((function(e){var t,n;t=s.element,n={scope:T.from(e)},Ue(n,(function(e,n){e.fold((function(){Wt(t,n)}),(function(e){Lt(t.dom,n,e)}))}))})),s}return e}))}))},hs=function(e,t,n){return V(e,(function(r,o){return ds(e,o,t,n)?[]:[_n(r,t)]}))},vs=function(e,t,n,r,o){var i=Dn(e).rows,a=V(t,(function(e){return hs(i,e,r)})),u=N(e,(function(e){return vc(e.cells)})),c=function(e,t){return j(t,g)&&vc(e)?x:function(e,n,r){return!("th"===ot(e.element)&&t[n])}}(a,u),s=function(e,t){return function(n,r){return T.some(ms(e,n.element,"row",t[r]))}}(n,u);return ps(e,a,r,o,gs,s,c)},bs=function(e,t,n,r,o,i,a){var u=Dn(e),c=u.cols,s=u.rows,l=s[t[0]],f=V(t,(function(e){return function(e,t,n){var r=e[t];return V(r.cells,(function(r,o){return ds(e,t,o,n)?[]:[r]}))}(s,e,o)})),d=N(l.cells,(function(e,t){return vc(hs(s,t,o))})),m=Y([],s,!0);R(t,(function(e){m[e]=a.transformRow(s[e],n)}));var p=c.concat(m),h=function(e,t){return j(t,g)&&vc(e.cells)?x:function(e,n,r){return!("th"===ot(e.element)&&t[r])}}(l,d),v=function(e,t){return function(n,r,o){return T.some(ms(e,n.element,"col",t[o]))}}(r,d);return ps(p,f,o,i,a.transformCell,v,h)},ys=function(e,t,n,r){var o=Dn(e).rows,i=N(t,(function(e){return _n(o[e.row],e.column)}));return ps(e,i,n,r,gs,T.none,x)},ws=function(e){return I(e,(function(e,t){return D(e,(function(e){return e.column===t.column}))?e:e.concat([t])}),[]).sort((function(e,t){return e.column-t.column}))},xs=dt("col"),Cs=dt("colgroup"),Ss=function(e){return"tr"===ot(e)||Cs(e)},ks=function(e){return{element:e,colspan:on(e,"colspan",1),rowspan:on(e,"rowspan",1)}},Ts=function(e){return Ut(e,"scope").map((function(e){return e.substr(0,3)}))},Os=function(e,t){void 0===t&&(t=ks);var n=function(n){if(Ss(n))return Cs((o={element:n}).element)?e.colgroup(o):e.row(o);var o,i=function(t){return xs(t.element)?e.col(t):e.cell(t)}(t(n));return r=T.some({item:n,replacement:i}),i},r=T.none();return{getOrInit:function(e,t){return r.fold((function(){return n(e)}),(function(r){return t(e,r.item)?r.replacement:n(e)}))}}},_s=function(e){return function(t){var n=[],r=function(r){var o="td"===e?{scope:null}:{},i=t.replace(r,e,o);return n.push({item:r,sub:i}),i};return{replaceOrInit:function(e,t){return Ss(e)||xs(e)?e:function(e,t){return F(n,(function(n){return t(n.item,e)}))}(e,t).fold((function(){return r(e)}),(function(n){return t(e,n.item)?n.sub:r(e)}))}}}},Es=function(e){return{unmerge:function(t){var n=Ts(t);return n.each((function(e){return Ht(t,"scope",e)})),function(){var r=e.cell({element:t,colspan:1,rowspan:1});return rn(r,"width"),rn(t,"width"),n.each((function(e){return Ht(r,"scope",e)})),r}},merge:function(e){return rn(e[0],"width"),function(){var t=Gt(N(e,Ts));if(0===t.length)return T.none();var n=t[0],r=["row","col"];return D(t,(function(e){return e!==n&&A(r,e)}))?T.none():T.from(n)}().fold((function(){return Wt(e[0],"scope")}),(function(t){return Ht(e[0],"scope",t+"group")})),m(e[0])}}},As=["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"],Ds=lr(),Ms=function(e){return function(e,t){var n=e.property().name(t);return A(As,n)}(Ds,e)},Ns=function(e){return function(e,t){var n=e.property().name(t);return A(["ol","ul"],n)}(Ds,e)},Rs=function(e){return function(e,t){return A(["br","img","hr","input"],e.property().name(t))}(Ds,e)},zs=function(e){var t,n=function(e){return"br"===ot(e)},r=function(e){return pi(e).bind((function(t){var r=bt(t).map((function(e){return!!Ms(e)||!!Rs(e)&&"img"!==ot(e)})).getOr(!1);return pt(t).map((function(o){return!0===r||function(e){return"li"===ot(e)||zt(e,Ns).isSome()}(o)||n(t)||Ms(o)&&!Ie(e,o)?[]:[Re.fromTag("br")]}))})).getOr([])},o=(t=V(e,(function(e){var t=yt(e);return function(e){return j(e,(function(e){return n(e)||st(e)&&0===ar(e).trim().length}))}(t)?[]:t.concat(r(e))})),0===t.length?[Re.fromTag("br")]:t);nr(e[0]),tr(e[0],o)},Bs=function(e){return eu(e,!0)},Ps=function(e){0===pn(e).length&&rr(e)},Is=function(e,t){return{grid:e,cursor:t}},Fs=function(e,t,n){var r,o,i=Dn(e).rows;return T.from(null===(o=null===(r=i[t])||void 0===r?void 0:r.cells[n])||void 0===o?void 0:o.element).filter(Bs).orThunk((function(){return function(e){return K(e,(function(e){return K(e.cells,(function(e){var t=e.element;return Xt(Bs(t),t)}))}))}(i)}))},Ls=function(e,t,n){var r=Fs(e,t,n);return Is(e,r)},Hs=function(e){return I(e,(function(e,t){return D(e,(function(e){return e.row===t.row}))?e:e.concat([t])}),[]).sort((function(e,t){return e.row-t.row}))},Vs=function(e,t){return function(n,r,o,i,a){var u=Hs(r),c=N(u,(function(e){return e.row})),s=bs(n,c,e,t,o,i.replaceOrInit,a);return Ls(s,r[0].row,r[0].column)}},js=Vs("thead",!0),Us=Vs("tbody",!1),Ws=Vs("tfoot",!1),$s=function(e,t,n){var r=function(e,t){return wn(e,(function(){return t}))}(e,n.section),o=Fn.generate(r);return Ic(o,t,!0)},qs=function(e,t,n,r){return function(e,t,n,r){var o=Fn.generate(t),i=r.getWidths(o,r);Qi(o,i,r)}(0,t,0,r.sizing)},Gs=function(e,t,n,r){return function(e,t,n,r,o){var i=Fn.generate(t),a=r.getWidths(i,r),u=r.pixelWidth(),c=o.calcRedestributedWidths(a,u,n.pixelDelta,r.isRelative),s=c.newSizes,l=c.delta;Qi(i,s,r),r.adjustTableWidth(l)}(0,t,n,r.sizing,r.resize)},Ks=function(e,t){return D(t,(function(e){return 0===e.column&&e.isLocked}))},Xs=function(e,t){return D(t,(function(t){return t.column+t.colspan>=e.grid.columns&&t.isLocked}))},Ys=function(e,t){var n=Jr(e),r=ws(t);return I(r,(function(e,t){return e+n[t.column].map(Kr).getOr(0)}),0)},Js=function(e){return function(t,n){return Uc(t,n).filter((function(n){return!(e?Ks:Xs)(t,n)})).map((function(e){return{details:e,pixelDelta:Ys(t,e)}}))}},Zs=function(e){return function(t,n){return jc(t,n).filter((function(n){return!(e?Ks:Xs)(t,n.cells)}))}},Qs=_s("th"),el=_s("td"),tl=Vc((function(e,t,n,r){var o=t[0].row,i=Hs(t),a=P(i,(function(e,t){return{grid:ls(e.grid,o,t.row+e.delta,n,r.getOrInit),delta:e.delta+1}}),{grid:e,delta:0}).grid;return Ls(a,o,t[0].column)}),Uc,d,d,Os),nl=Vc((function(e,t,n,r){var o=Hs(t),i=o[o.length-1],a=i.row+i.rowspan,u=P(o,(function(e,t){return ls(e,a,t.row,n,r.getOrInit)}),e);return Ls(u,a,t[0].column)}),Uc,d,d,Os),rl=Vc((function(e,t,n,r){var o=t.details,i=ws(o),a=i[0].column,u=P(i,(function(e,t){return{grid:fs(e.grid,a,t.column+e.delta,n,r.getOrInit),delta:e.delta+1}}),{grid:e,delta:0}).grid;return Ls(u,o[0].row,a)}),Js(!0),Gs,d,Os),ol=Vc((function(e,t,n,r){var o=t.details,i=o[o.length-1],a=i.column+i.colspan,u=ws(o),c=P(u,(function(e,t){return fs(e,a,t.column,n,r.getOrInit)}),e);return Ls(c,o[0].row,a)}),Js(!1),Gs,d,Os),il=Vc((function(e,t,n,r){var o=ws(t.details),i=function(e,t){return V(e,(function(e){var n=e.cells,r=P(t,(function(e,t){return t>=0&&t<e.length?e.slice(0,t).concat(e.slice(t+1)):e}),n);return r.length>0?[rt(e.element,r,e.section,e.isNew)]:[]}))}(e,N(o,(function(e){return e.column}))),a=i.length>0?i[0].cells.length-1:0;return Ls(i,o[0].row,Math.min(o[0].column,a))}),(function(e,t){return Wc(e,t).map((function(t){return{details:t,pixelDelta:-Ys(e,t)}}))}),Gs,Ps,Os),al=Vc((function(e,t,n,r){var o=Hs(t),i=function(e,t,n){var r=Dn(e),o=r.rows;return r.cols.concat(o.slice(0,t)).concat(o.slice(n+1))}(e,o[0].row,o[o.length-1].row),a=i.length>0?i.length-1:0;return Ls(i,Math.min(t[0].row,a),t[0].column)}),Uc,d,Ps,Os),ul=Vc((function(e,t,n,r){var o=ws(t),i=N(o,(function(e){return e.column})),a=vs(e,i,!0,n,r.replaceOrInit);return Ls(a,t[0].row,t[0].column)}),Wc,d,d,Qs),cl=Vc((function(e,t,n,r){var o=ws(t),i=N(o,(function(e){return e.column})),a=vs(e,i,!1,n,r.replaceOrInit);return Ls(a,t[0].row,t[0].column)}),Wc,d,d,el),sl=Vc(js,Wc,d,d,Qs),ll=Vc(Us,Wc,d,d,el),fl=Vc(Ws,Wc,d,d,el),dl=Vc((function(e,t,n,r){var o=ys(e,t,n,r.replaceOrInit);return Ls(o,t[0].row,t[0].column)}),Wc,d,d,Qs),ml=Vc((function(e,t,n,r){var o=ys(e,t,n,r.replaceOrInit);return Ls(o,t[0].row,t[0].column)}),Wc,d,d,el),gl=Vc((function(e,t,n,r){var o=t.cells;zs(o);var i=function(e,t,n,r){var o=Dn(e).rows;if(0===o.length)return e;for(var i=t.startRow;i<=t.finishRow;i++)for(var a=t.startCol;a<=t.finishCol;a++){var u=o[i],c=_n(u,a).isLocked;Tn(u,a,nt(r(),!1,c))}return e}(e,t.bounds,0,r.merge(o));return Is(i,T.from(o[0]))}),qc,qs,d,Es),pl=Vc((function(e,t,n,r){var o=P(t,(function(e,t){return Kc(e,t,n,r.unmerge(t))}),e);return Is(o,T.from(t[0]))}),Gc,qs,d,Es),hl=Vc((function(e,t,n,r){var o=function(e,t){var n=Fn.fromTable(e);return Ic(n,t,!0)}(t.clipboard,t.generators),i=function(e,t){return{row:e,column:t}}(t.row,t.column);return us(i,e,o,t.generators,n).fold((function(){return Is(e,T.some(t.element))}),(function(e){return Ls(e,t.row,t.column)}))}),(function(e,t){return gn(t.element).bind((function(n){return Lc(e,n).map((function(e){return X(X({},e),{generators:t.generators,clipboard:t.clipboard})}))}))}),qs,d,Os),vl=Vc((function(e,t,n,r){var o=Dn(e).rows,i=t.cells[0].column,a=o[t.cells[0].row],u=$s(t.clipboard,t.generators,a),c=cs(i,e,u,t.generators,n);return Ls(c,t.cells[0].row,t.cells[0].column)}),Zs(!0),d,d,Os),bl=Vc((function(e,t,n,r){var o=Dn(e).rows,i=t.cells[t.cells.length-1].column+t.cells[t.cells.length-1].colspan,a=o[t.cells[0].row],u=$s(t.clipboard,t.generators,a),c=cs(i,e,u,t.generators,n);return Ls(c,t.cells[0].row,t.cells[0].column)}),Zs(!1),d,d,Os),yl=Vc((function(e,t,n,r){var o=Dn(e).rows,i=t.cells[0].row,a=o[i],u=$s(t.clipboard,t.generators,a),c=ss(i,e,u,t.generators,n);return Ls(c,t.cells[0].row,t.cells[0].column)}),jc,d,d,Os),wl=Vc((function(e,t,n,r){var o=Dn(e).rows,i=t.cells[t.cells.length-1].row+t.cells[t.cells.length-1].rowspan,a=o[t.cells[0].row],u=$s(t.clipboard,t.generators,a),c=ss(i,e,u,t.generators,n);return Ls(c,t.cells[0].row,t.cells[0].column)}),jc,d,d,Os),xl=function(e,t){var n=Fn.fromTable(e);return Uc(n,t).bind((function(e){var t=e[e.length-1],r=e[0].column,o=t.column+t.colspan,i=H(N(n.all,(function(e){return B(e.cells,(function(e){return e.column>=r&&e.column<o}))})));return wc(i)})).getOr("")},Cl=function(e,t){var n=Fn.fromTable(e);return Uc(n,t).bind(wc).getOr("")},Sl=function(e,t){var n=Fn.fromTable(e);return Uc(n,t).bind((function(e){var t=e[e.length-1],r=e[0].row,o=t.row+t.rowspan;return function(e){var t=N(e,(function(e){return yc(e).type})),n=A(t,"header"),r=A(t,"footer");if(n||r){var o=A(t,"body");return!n||o||r?n||o||!r?T.none():T.some("footer"):T.some("header")}return T.some("body")}(n.all.slice(r,o))})).getOr("")},kl=function(e,t,n){var r=function(e){return"table"===ot(_i(e))},o=Ju(e),i=Yu(e)?d:pc,a=function(t){switch(Gu(e)){case"section":return _c();case"sectionCells":return Ec();case"cells":return Ac();default:return Oc(t,"section")}},u=function(n,r){return r.cursor.fold((function(){var r=pn(n);return q(r).filter(_t).map((function(r){t.clear(n);var o=e.dom.createRng();return o.selectNode(r.dom),e.selection.setRng(o),Ht(r,"data-mce-selected","1"),o}))}),(function(r){var o=mc(gc,r),i=e.dom.createRng();return i.setStart(o.element.dom,o.offset),i.setEnd(o.element.dom,o.offset),e.selection.setRng(i),t.clear(n),T.some(i)}))},c=function(t,n,r,i,c){return function(s,l,f){void 0===f&&(f=!1),Ni(s);var d=i(),m=Re.fromDom(e.getDoc()),g=ki(r,m,o),p={sizing:ec(e,s),resize:Yu(e)?ua():ca(),section:a(s)};return n(s)?t(d,s,l,g,p).bind((function(t){R(t.newRows,(function(t){wu(e,t.dom)})),R(t.newCells,(function(t){xu(e,t.dom)}));var n=u(s,t);return _t(s)&&(Ni(s),f||Cu(e,s.dom,c)),n.map((function(e){return{rng:e,effect:c}}))})):T.none()}},s=c(al,(function(t){return!1===r(e)||Ta(t).rows>1}),d,n,ku),l=c(il,(function(t){return!1===r(e)||Ta(t).columns>1}),d,n,ku);return{deleteRow:s,deleteColumn:l,insertRowsBefore:c(tl,x,d,n,ku),insertRowsAfter:c(nl,x,d,n,ku),insertColumnsBefore:c(rl,x,i,n,ku),insertColumnsAfter:c(ol,x,i,n,ku),mergeCells:c(gl,x,d,n,ku),unmergeCells:c(pl,x,d,n,ku),pasteColsBefore:c(vl,x,d,n,ku),pasteColsAfter:c(bl,x,d,n,ku),pasteRowsBefore:c(yl,x,d,n,ku),pasteRowsAfter:c(wl,x,d,n,ku),pasteCells:c(hl,x,d,n,Tu),makeCellsHeader:c(dl,x,d,n,ku),unmakeCellsHeader:c(ml,x,d,n,ku),makeColumnsHeader:c(ul,x,d,n,ku),unmakeColumnsHeader:c(cl,x,d,n,ku),makeRowsHeader:c(sl,x,d,n,ku),makeRowsBody:c(ll,x,d,n,ku),makeRowsFooter:c(fl,x,d,n,ku),getTableRowType:Sl,getTableCellType:Cl,getTableColType:xl}},Tl={styles:{"border-collapse":"collapse",width:"100%"},attributes:{border:"1"},colGroups:!1},Ol=function(e){var t=Re.fromTag("colgroup");return M(e,(function(){return Zn(t,Re.fromTag("col"))})),t},_l=function(e,t,n,r){return M(e,(function(e){return function(e,t,n,r){for(var o=Re.fromTag("tr"),i=0;i<e;i++){var a=r<t||i<n?Re.fromTag("th"):Re.fromTag("td");i<n&&Ht(a,"scope","row"),r<t&&Ht(a,"scope","col"),Zn(a,Re.fromTag("br")),Zn(o,a)}return o}(t,n,r,e)}))},El=function(e,t){e.selection.select(t.dom,!0),e.selection.collapse(!0)},Al=function(e,t,n,o,i){var a=Pu(e),u={styles:a,attributes:Bu(e),colGroups:qu(e)};return e.undoManager.ignore((function(){var r=function(e,t,n,r,o,i){void 0===i&&(i=Tl);var a=Re.fromTag("table"),u="cells"!==o;Qt(a,i.styles),Vt(a,i.attributes),i.colGroups&&Zn(a,Ol(t));var c=Math.min(e,n);if(u&&n>0){var s=Re.fromTag("thead");Zn(a,s);var l=_l(n,t,"sectionCells"===o?c:0,r);tr(s,l)}var f=Re.fromTag("tbody");Zn(a,f);var d=_l(u?e-c:e,t,u?0:n,r);return tr(f,d),a}(n,t,i,o,Gu(e),u);Ht(r,"data-mce-id","__mce");var a=function(e){var t=Re.fromTag("div"),n=Re.fromDom(e.dom.cloneNode(!0));return Zn(t,n),function(e){return e.dom.innerHTML}(t)}(r);e.insertContent(a),e.addVisual()})),It(_i(e),'table[data-mce-id="__mce"]').map((function(t){return Wu(e)?rc(t):$u(e)?oc(t):(Uu(e)||function(e){return r(e)&&-1!==e.indexOf("%")}(a.width))&&nc(t),Ni(t),Wt(t,"data-mce-id"),function(e,t){R(Nt(t,"tr"),(function(t){wu(e,t.dom),R(Nt(t,"th,td"),(function(t){xu(e,t.dom)}))}))}(e,t),function(e,t){It(t,"td,th").each(h(El,e))}(e,t),t.dom})).getOr(null)},Dl=function(e,t,n,r,o){void 0===r&&(r={});var i=function(e){return f(e)&&e>0};if(i(t)&&i(n)){var a=r.headerRows||0,u=r.headerColumns||0;return Al(e,n,t,u,a)}return console.error(o),null},Ml=function(e){return function(){return e().fold((function(){return[]}),(function(e){return N(e,(function(e){return e.dom}))}))}},Nl=function(e){return function(t){var n=t.length>0?T.some(Oi(t)):T.none();e(n)}},Rl=function(e){return function(t,n,r){void 0===r&&(r={});var o=Dl(e,n,t,r,"Invalid values for insertTable - rows and columns values are required to insert a table.");return e.undoManager.add(),o}},zl=function(e,t,n){var r=on(e,t,1);1===n||r<=1?Wt(e,t):Ht(e,t,Math.min(n,r))},Bl=function(e,t){var n=Fn.fromTable(e);return Wc(n,t).map((function(e){var t=e[e.length-1],r=e[0].column,o=t.column+t.colspan,i=function(e,t,n){if(Fn.hasColumns(e)){var r=B(Fn.justColumns(e),(function(e){return e.column>=t&&e.column<n})),o=N(r,(function(e){var r=Ir(e.element);return zl(r,"span",n-t),r})),i=Re.fromTag("colgroup");return tr(i,o),[i]}return[]}(n,r,o),a=function(e,t,n){return N(e.all,(function(e){var r=B(e.cells,(function(e){return e.column>=t&&e.column<n})),o=N(r,(function(e){var r=Ir(e.element);return zl(r,"colspan",n-t),r})),i=Re.fromTag("tr");return tr(i,o),i}))}(n,r,o);return Y(Y([],i,!0),a,!0)}))},Pl=function(e,t,n){var r=Fn.fromTable(e);return Uc(r,t).bind((function(e){var t=Ic(r,n,!1),o=Dn(t).rows.slice(e[0].row,e[e.length-1].row+e[e.length-1].rowspan),i=V(o,(function(e){var t=B(e.cells,(function(e){return!e.isLocked}));return t.length>0?[X(X({},e),{cells:t})]:[]})),a=Fc(i);return Xt(a.length>0,a)})).map((function(e){return function(e){return N(e,(function(e){var t=Pr(e.element);return R(e.cells,(function(e){var n=Ir(e.element);Mc(n,"colspan",e.colspan,1),Mc(n,"rowspan",e.rowspan,1),Zn(t,n)})),t}))}(e)}))},Il=tinymce.util.Tools.resolve("tinymce.util.Tools"),Fl=function(e,t,n){return function(t,r){for(var o=0;o<r.length;o++){var i=e.getStyle(r[o],n);if(void 0===t&&(t=i),t!==i)return""}return t}(undefined,e.select("td,th",t))},Ll=function(e,t,n){n&&e.formatter.apply("align"+n,{},t)},Hl=function(e,t){Il.each("left center right".split(" "),(function(n){e.formatter.remove("align"+n,{},t)}))},Vl=[{text:"None",value:""},{text:"Top",value:"top"},{text:"Middle",value:"middle"},{text:"Bottom",value:"bottom"}],jl=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,Ul=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,Wl=function(e){return(t=e,n="#",oe(t,n)?function(e,t){return e.substring(t)}(t,n.length):t).toUpperCase();var t,n},$l=function(e){return function(e){return jl.test(e)||Ul.test(e)}(e)?T.some({value:Wl(e)}):T.none()},ql=function(e){var t=e.toString(16);return(1===t.length?"0"+t:t).toUpperCase()},Gl=function(e){return function(e){return{value:e}}(ql(e.red)+ql(e.green)+ql(e.blue))},Kl=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)/,Xl=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d?(?:\.\d+)?)\)/,Yl=function(e,t,n,r){return{red:e,green:t,blue:n,alpha:r}},Jl=function(e,t,n,r){var o=parseInt(e,10),i=parseInt(t,10),a=parseInt(n,10),u=parseFloat(r);return Yl(o,i,a,u)},Zl=function(e){return $l(e).orThunk((function(){return function(e){if("transparent"===e)return T.some(Yl(0,0,0,0));var t=Kl.exec(e);if(null!==t)return T.some(Jl(t[1],t[2],t[3],"1"));var n=Xl.exec(e);return null!==n?T.some(Jl(n[1],n[2],n[3],n[4])):T.none()}(e).map(Gl)})).getOrThunk((function(){var t=document.createElement("canvas");t.height=1,t.width=1;var n=t.getContext("2d");n.clearRect(0,0,t.width,t.height),n.fillStyle="#FFFFFF",n.fillStyle=e,n.fillRect(0,0,1,1);var r=n.getImageData(0,0,1,1).data,o=r[0],i=r[1],a=r[2],u=r[3];return Gl(Yl(o,i,a,u))}))},Ql=function(e){var t=e;return{get:function(){return t},set:function(e){t=e}}},ef=function(e){var t=Ql(T.none()),n=function(){return t.get().each(e)};return{clear:function(){n(),t.set(T.none())},isSet:function(){return t.get().isSome()},get:function(){return t.get()},set:function(e){n(),t.set(T.some(e))}}},tf=function(){var e=ef(d);return X(X({},e),{on:function(t){return e.get().each(t)}})},nf=function(e,t,n,r){return function(o){var i=ef((function(e){return e.unbind()})),a=!ue(r),u=function(){var u=$i(t),c=function(t){return e.formatter.match(n,{value:r},t.dom,a)};a?(o.setActive(!D(u,c)),i.set(e.formatter.formatChanged(n,(function(e){return o.setActive(!e)}),!0))):(o.setActive(j(u,c)),i.set(e.formatter.formatChanged(n,o.setActive,!1,{value:r})))};return e.initialized?u():e.on("init",u),i.clear}},rf=function(e){return Ze(e,"menu")},of=function(e){return N(e,(function(e){var t=e.text||e.title;return rf(e)?{text:t,items:of(e.menu)}:{text:t,value:e.value}}))},af=function(e,t,n,r,o){return N(n,(function(n){var i=n.text||n.title;return rf(n)?{type:"nestedmenuitem",text:i,getSubmenuItems:function(){return af(e,t,n.menu,r,o)}}:{text:i,type:"togglemenuitem",onAction:function(){return o(n.value)},onSetup:nf(e,t,r,n.value)}}))},uf=function(e,t){return function(n){var r;e.execCommand("mceTableApplyCellStyle",!1,((r={})[t]=n,r))}},cf=function(e){return V(e,(function(e){return rf(e)?[X(X({},e),{menu:cf(e.menu)})]:ue(e.value)?[e]:[]}))},sf=function(e,t,n,r,o){return function(i){return i(af(e,t,n,r,o))}},lf=function(e,t,n){var r=N(t,(function(e){return{text:e.title,value:"#"+Zl(e.value).value,type:"choiceitem"}}));return[{type:"fancymenuitem",fancytype:"colorswatch",initData:{colors:r.length>0?r:void 0,allowCustomColors:!1},onAction:function(t){var r,o="remove"===t.value?"":t.value;e.execCommand("mceTableApplyCellStyle",!1,((r={})[n]=o,r))}}]},ff=function(e){return function(){var t="header"===e.queryCommandValue("mceTableRowType")?"body":"header";e.execCommand("mceTableRowType",!1,{type:t})}},df=function(e){return function(){var t="th"===e.queryCommandValue("mceTableColType")?"td":"th";e.execCommand("mceTableColType",!1,{type:t})}},mf=[{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}],gf=function(e){return mf.concat(function(e){var t=of(Vu(e));return t.length>0?T.some({name:"class",type:"listbox",label:"Class",items:t}):T.none()}(e).toArray())},pf=function(e,t){var n=[{name:"borderstyle",type:"listbox",label:"Border style",items:[{text:"Select...",value:""}].concat(of(zu(e)))},{name:"bordercolor",type:"colorinput",label:"Border color"},{name:"backgroundcolor",type:"colorinput",label:"Background color"}];return{title:"Advanced",name:"advanced",items:"cell"===t?[{name:"borderwidth",type:"input",label:"Border width"}].concat(n):n}},hf=function(e){return function(t,n){var r=t.dom;return{setAttrib:function(t,o){e&&!o||r.setAttrib(n,t,o)},setStyle:function(t,o){e&&!o||r.setStyle(n,t,o)},setFormat:function(r,o){e&&!o||(""===o?t.formatter.remove(r,{value:null},n,!0):t.formatter.apply(r,{value:o},n))}}}},vf={normal:hf(!1),ifTruthy:hf(!0)},bf=function(e){return function(t){return oe(t,"rgb")?e.toHex(t):t}},yf=function(e,t){var n=Re.fromDom(t);return{borderwidth:nn(n,"border-width").getOr(""),borderstyle:nn(n,"border-style").getOr(""),bordercolor:nn(n,"border-color").map(bf(e)).getOr(""),backgroundcolor:nn(n,"background-color").map(bf(e)).getOr("")}},wf=function(e){var t=e[0],n=e.slice(1);return R(n,(function(e){R(Ve(t),(function(n){Ue(e,(function(e,r){var o=t[n];""!==o&&n===r&&o!==e&&(t[n]="")}))}))})),t},xf=function(e,t,n,r){return F(e,(function(e){return!c(n.formatter.matchNode(r,t+e))})).getOr("")},Cf=h(xf,["left","center","right"],"align"),Sf=h(xf,["top","middle","bottom"],"valign"),kf=function(e){return vn(Re.fromDom(e)).map((function(t){var n={selection:Oi(e.cells)};return Sl(t,n)})).getOr("")},Tf=function(e,t){var n=Fn.fromTable(e),r=Fn.justCells(n),o=B(r,(function(e){return D(t,(function(t){return Ie(e.element,t)}))}));return N(o,(function(e){return{element:e.element.dom,column:Fn.getColumnAt(n,e.column).map((function(e){return e.element.dom}))}}))},Of=function(e,t,n){var r=1===t.length;R(t,(function(t){var o=t.element,i=r?vf.normal(e,o):vf.ifTruthy(e,o),a=t.column.map((function(t){return r?vf.normal(e,t):vf.ifTruthy(e,t)})).getOr(i);!function(e,t,n){e.setAttrib("scope",n.scope),e.setAttrib("class",n.class),e.setStyle("height",Mi(n.height)),t.setStyle("width",Mi(n.width))}(i,a,n),Iu(e)&&function(e,t){e.setFormat("tablecellbackgroundcolor",t.backgroundcolor),e.setFormat("tablecellbordercolor",t.bordercolor),e.setFormat("tablecellborderstyle",t.borderstyle),e.setFormat("tablecellborderwidth",Mi(t.borderwidth))}(i,n),r&&(Hl(e,o),function(e,t){Il.each("top middle bottom".split(" "),(function(n){e.formatter.remove("valign"+n,{},t)}))}(e,o)),n.halign&&Ll(e,o,n.halign),n.valign&&function(e,t,n){n&&e.formatter.apply("valign"+n,{},t)}(e,o,n.valign)}))},_f=function(e,t,n,r){var o=r.getData();r.close(),e.undoManager.transact((function(){!function(e,t,n,r){var o=qe(r,(function(e,t){return n[t]!==e}));Xe(o)>0&&t.length>=1&&vn(t[0]).each((function(n){var i=Tf(n,t),a=Xe(qe(o,(function(e,t){return"scope"!==t&&"celltype"!==t})))>0,u=Je(o,"celltype");(a||Je(o,"scope"))&&Of(e,i,r),u&&function(e,t){e.execCommand("mceTableCellType",!1,{type:t.celltype,no_events:!0})}(e,r),Cu(e,n.dom,{structure:u,style:a})}))}(e,t,n,o),e.focus()}))},Ef=function(e,t){var n=vn(t[0]).map((function(n){return N(Tf(n,t),(function(t){return function(e,t,n,r){var o,i=e.dom,a=r.getOr(t),u=function(e,t){return i.getStyle(e,t)||i.getAttrib(e,t)};return X({width:u(a,"width"),height:u(t,"height"),scope:i.getAttrib(t,"scope"),celltype:(o=t,o.nodeName.toLowerCase()),class:i.getAttrib(t,"class",""),halign:Cf(e,t),valign:Sf(e,t)},n?yf(i,t):{})}(e,t.element,Iu(e),t.column)}))}));return wf(n.getOrDie())},Af=function(e,t){var n=$i(t);if(0!==n.length){var r=Ef(e,n),o={type:"tabpanel",tabs:[{title:"General",name:"general",items:gf(e)},pf(e,"cell")]},i={type:"panel",items:[{type:"grid",columns:2,items:gf(e)}]};e.windowManager.open({title:"Cell Properties",size:"normal",body:Iu(e)?o:i,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:r,onSubmit:h(_f,e,n,r)})}},Df=[{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"}],Mf=function(e){return Df.concat(function(e){var t=of(function(e){return e.getParam("table_row_class_list",[],"array")}(e));return t.length>0?T.some({name:"class",type:"listbox",label:"Class",items:t}):T.none()}(e).toArray())},Nf=function(e,t,n,r){var o=1===t.length;R(t,(function(t){var i=o?vf.normal(e,t):vf.ifTruthy(e,t);!function(e,t){e.setAttrib("class",t.class),e.setStyle("height",Mi(t.height))}(i,n),Fu(e)&&function(e,t){e.setStyle("background-color",t.backgroundcolor),e.setStyle("border-color",t.bordercolor),e.setStyle("border-style",t.borderstyle)}(i,n),n.align!==r.align&&(Hl(e,t),Ll(e,t,n.align))}))},Rf=function(e,t,n,r){var o=r.getData();r.close(),e.undoManager.transact((function(){!function(e,t,n,r){var o=qe(r,(function(e,t){return n[t]!==e}));if(Xe(o)>0){var i=Je(o,"type"),a=!i||Xe(o)>1;a&&Nf(e,t,r,n),i&&function(e,t){e.execCommand("mceTableRowType",!1,{type:t.type,no_events:!0})}(e,r),vn(Re.fromDom(t[0])).each((function(t){return Cu(e,t.dom,{structure:i,style:a})}))}}(e,t,n,o),e.focus()}))},zf=function(e){var t,n,r,o,i=(t=Ri(e),n=Hi.selected,r=Wi(t),o=r.bind((function(e){return vn(e)})).map((function(e){return bn(e)})),Kt(r,o,(function(e,t){return B(t,(function(t){return D(Oi(t.dom.cells),(function(t){return"1"===jt(t,n)||Ie(t,e)}))}))})).getOr([]));if(0!==i.length){var a=N(i,(function(t){return function(e,t,n){var r=e.dom;return X({height:r.getStyle(t,"height")||r.getAttrib(t,"height"),class:r.getAttrib(t,"class",""),type:kf(t),align:Cf(e,t)},n?yf(r,t):{})}(e,t.dom,Fu(e))})),u=wf(a),c={type:"tabpanel",tabs:[{title:"General",name:"general",items:Mf(e)},pf(e,"row")]},s={type:"panel",items:[{type:"grid",columns:2,items:Mf(e)}]};e.windowManager.open({title:"Row Properties",size:"normal",body:Fu(e)?c:s,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:u,onSubmit:h(Rf,e,N(i,(function(e){return e.dom})),u)})}},Bf=function(e,t,n){var r=n?[{type:"input",name:"cols",label:"Cols",inputMode:"numeric"},{type:"input",name:"rows",label:"Rows",inputMode:"numeric"}]:[],o=function(e){return e.getParam("table_appearance_options",!0,"boolean")}(e)?[{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=t.length>0?[{type:"listbox",name:"class",label:"Class",items:t}]:[];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)},Pf=function(e,t,n,o){if("TD"===t.tagName||"TH"===t.tagName)r(n)?e.setStyle(t,n,o):e.setStyle(t,n);else if(t.children)for(var i=0;i<t.children.length;i++)Pf(e,t.children[i],n,o)},If=function(e,t,n,r){var o=e.dom,i=r.getData(),a=qe(i,(function(e,t){return n[t]!==e}));r.close(),""===i.class&&delete i.class,e.undoManager.transact((function(){if(!t){var n=parseInt(i.cols,10)||1,r=parseInt(i.rows,10)||1;t=Al(e,n,r,0,0)}if(Xe(a)>0){!function(e,t,n){var r=e.dom,o={},i={};if(o.class=n.class,i.height=Mi(n.height),r.getAttrib(t,"width")&&!Hu(e)?o.width=function(e){return e?e.replace(/px$/,""):""}(n.width):i.width=Mi(n.width),Hu(e)?(i["border-width"]=Mi(n.border),i["border-spacing"]=Mi(n.cellspacing)):(o.border=n.border,o.cellpadding=n.cellpadding,o.cellspacing=n.cellspacing),Hu(e)&&t.children)for(var a=0;a<t.children.length;a++)Pf(r,t.children[a],{"border-width":Mi(n.border),padding:Mi(n.cellpadding)}),Lu(e)&&Pf(r,t.children[a],{"border-color":n.bordercolor});Lu(e)&&(i["background-color"]=n.backgroundcolor,i["border-color"]=n.bordercolor,i["border-style"]=n.borderstyle),o.style=r.serializeStyle(X(X({},Pu(e)),i)),r.setAttribs(t,X(X({},Bu(e)),o))}(e,t,i);var u=o.select("caption",t)[0];(u&&!i.caption||!u&&i.caption)&&e.execCommand("mceTableToggleCaption"),""===i.align?Hl(e,t):Ll(e,t,i.align)}if(e.focus(),e.addVisual(),Xe(a)>0){var c=Je(a,"caption"),s=!c||Xe(a)>1;Cu(e,t,{structure:c,style:s})}}))},Ff=function(e,t){var n,r=e.dom,o=function(e,t){var n,r,o,i,a=Pu(e),u=Bu(e),c=t?(n=e.dom,{borderstyle:Ye(a,"border-style").getOr(""),bordercolor:bf(n)(Ye(a,"border-color").getOr("")),backgroundcolor:bf(n)(Ye(a,"background-color").getOr(""))}):{};return X(X(X(X(X(X({},{height:"",width:"100%",cellspacing:"",cellpadding:"",caption:!1,class:"",align:"",border:""}),a),u),c),(i=a["border-width"],Hu(e)&&i?{border:i}:Ye(u,"border").fold((function(){return{}}),(function(e){return{border:e}})))),(r=Ye(a,"border-spacing").or(Ye(u,"cellspacing")).fold((function(){return{}}),(function(e){return{cellspacing:e}})),o=Ye(a,"border-padding").or(Ye(u,"cellpadding")).fold((function(){return{}}),(function(e){return{cellpadding:e}})),X(X({},r),o)))}(e,Lu(e));!1===t?(n=r.getParent(e.selection.getStart(),"table",e.getBody()))?o=function(e,t,n){var r=e.dom,o=Hu(e)?r.getStyle(t,"border-spacing")||r.getAttrib(t,"cellspacing"):r.getAttrib(t,"cellspacing")||r.getStyle(t,"border-spacing"),i=Hu(e)?Fl(r,t,"padding")||r.getAttrib(t,"cellpadding"):r.getAttrib(t,"cellpadding")||Fl(r,t,"padding");return X({width:r.getStyle(t,"width")||r.getAttrib(t,"width"),height:r.getStyle(t,"height")||r.getAttrib(t,"height"),cellspacing:o,cellpadding:i,border:function(t,n){var r=nn(Re.fromDom(n),"border-width");return Hu(e)&&r.isSome()?r.getOr(""):t.getAttrib(n,"border")||Fl(e.dom,n,"border-width")||Fl(e.dom,n,"border")}(r,t),caption:!!r.select("caption",t)[0],class:r.getAttrib(t,"class",""),align:Cf(e,t)},n?yf(r,t):{})}(e,n,Lu(e)):Lu(e)&&(o.borderstyle="",o.bordercolor="",o.backgroundcolor=""):(o.cols="1",o.rows="1",Lu(e)&&(o.borderstyle="",o.bordercolor="",o.backgroundcolor=""));var i=of(ju(e));i.length>0&&o.class&&(o.class=o.class.replace(/\s*mce\-item\-table\s*/g,""));var a={type:"grid",columns:2,items:Bf(e,i,t)},u=Lu(e)?{type:"tabpanel",tabs:[{title:"General",name:"general",items:[a]},pf(e,"table")]}:{type:"panel",items:[a]};e.windowManager.open({title:"Table Properties",size:"normal",body:u,onSubmit:h(If,e,n,o),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:o})},Lf=function(e){return Ui(Ri(e),Di(e))},Hf=function(e,t,n,i,a){var u=Di(e),c=function(e){return vn(e,u)},s=function(t){return function(e){return Wi(Ri(e),Di(e))}(e).bind((function(e){return c(e).map((function(n){return t(n,e)}))}))},l=function(t){e.focus()},f=function(e,t){return void 0===t&&(t=!1),s((function(n,r){var o=Vi(i,n,r);e(n,o,t).each(l)}))},m=function(){return s((function(t,n){var r=Vi(i,t,n),o=ki(d,Re.fromDom(e.getDoc()),T.none());return Pl(t,r,o)}))},g=function(){return s((function(e,t){var n=Vi(i,e,t);return Bl(e,n)}))},p=function(t,n){return n().each((function(n){var r=N(n,(function(e){return Ir(e)}));s((function(n,o){var a=Ti(Re.fromDom(e.getDoc())),u=function(e,t,n,r){return{selection:zi(e),clipboard:n,generators:r}}(i,0,r,a);t(n,u).each(l)}))}))},v=function(e){return function(t,n){return Ye(n,"type").each((function(t){f(e(t),n.no_events)}))}};Ue({mceTableSplitCells:function(){return f(t.unmergeCells)},mceTableMergeCells:function(){return f(t.mergeCells)},mceTableInsertRowBefore:function(){return f(t.insertRowsBefore)},mceTableInsertRowAfter:function(){return f(t.insertRowsAfter)},mceTableInsertColBefore:function(){return f(t.insertColumnsBefore)},mceTableInsertColAfter:function(){return f(t.insertColumnsAfter)},mceTableDeleteCol:function(){return f(t.deleteColumn)},mceTableDeleteRow:function(){return f(t.deleteRow)},mceTableCutCol:function(){return g().each((function(e){a.setColumns(e),f(t.deleteColumn)}))},mceTableCutRow:function(){return m().each((function(e){a.setRows(e),f(t.deleteRow)}))},mceTableCopyCol:function(){return g().each((function(e){return a.setColumns(e)}))},mceTableCopyRow:function(){return m().each((function(e){return a.setRows(e)}))},mceTablePasteColBefore:function(){return p(t.pasteColsBefore,a.getColumns)},mceTablePasteColAfter:function(){return p(t.pasteColsAfter,a.getColumns)},mceTablePasteRowBefore:function(){return p(t.pasteRowsBefore,a.getRows)},mceTablePasteRowAfter:function(){return p(t.pasteRowsAfter,a.getRows)},mceTableDelete:function(){return Lf(e).each((function(t){vn(t,u).filter(y(u)).each((function(t){var n=Re.fromText("");if(Yn(t,n),rr(t),e.dom.isEmpty(e.getBody()))e.setContent(""),e.selection.setCursorLocation();else{var r=e.dom.createRng();r.setStart(n.dom,0),r.setEnd(n.dom,0),e.selection.setRng(r),e.nodeChanged()}}))}))},mceTableCellToggleClass:function(t,n){s((function(t){var r=$i(i),o=j(r,(function(t){return e.formatter.match("tablecellclass",{value:n},t.dom)})),a=o?e.formatter.remove:e.formatter.apply;R(r,(function(e){return a("tablecellclass",{value:n},e.dom)})),Cu(e,t.dom,Su)}))},mceTableToggleClass:function(t,n){s((function(t){e.formatter.toggle("tableclass",{value:n},t.dom),Cu(e,t.dom,Su)}))},mceTableToggleCaption:function(){Lf(e).each((function(t){vn(t,u).each((function(n){Pt(n,"caption").fold((function(){var t=Re.fromTag("caption");Zn(t,Re.fromText("Caption")),function(e,t,n){wt(e,n).fold((function(){Zn(e,t)}),(function(e){Xn(e,t)}))}(n,t,0),e.selection.setCursorLocation(t.dom,0)}),(function(r){dt("caption")(t)&&Pe("td",n).each((function(t){return e.selection.setCursorLocation(t.dom,0)})),rr(r)})),Cu(e,n.dom,ku)}))}))},mceTableSizingMode:function(t,n){return function(t){return Lf(e).each((function(n){$u(e)||Wu(e)||Uu(e)||vn(n,u).each((function(n){"relative"!==t||Ca(n)?"fixed"!==t||Sa(n)?"responsive"!==t||ka(n)||oc(n):rc(n):nc(n),Ni(n),Cu(e,n.dom,ku)}))}))}(n)},mceTableCellType:v((function(e){return"th"===e?t.makeCellsHeader:t.unmakeCellsHeader})),mceTableColType:v((function(e){return"th"===e?t.makeColumnsHeader:t.unmakeColumnsHeader})),mceTableRowType:v((function(e){switch(e){case"header":return t.makeRowsHeader;case"footer":return t.makeRowsFooter;default:return t.makeRowsBody}}))},(function(t,n){return e.addCommand(n,t)})),Ue({mceTableProps:h(Ff,e,!1),mceTableRowProps:h(zf,e),mceTableCellProps:h(Af,e,i)},(function(t,n){return e.addCommand(n,(function(){return t()}))})),e.addCommand("mceInsertTable",(function(t,n){o(n)&&Ve(n).length>0?Dl(e,n.rows,n.columns,n.options,"Invalid values for mceInsertTable - rows and columns values are required to insert a table."):Ff(e,!0)})),e.addCommand("mceTableApplyCellStyle",(function(t,n){var a=function(e){return"tablecell"+e.toLowerCase().replace("-","")};if(o(n)){var u=$i(i);if(0!==u.length){var s=qe(n,(function(t,n){return e.formatter.has(a(n))&&r(t)}));(function(e){for(var t in e)if(je.call(e,t))return!1;return!0})(s)||(Ue(s,(function(t,n){R(u,(function(r){vf.normal(e,r.dom).setFormat(a(n),t)}))})),c(u[0]).each((function(t){return Cu(e,t.dom,Su)})))}}}))},Vf={remove_similar:!0,inherit:!1},jf=X({selector:"td,th"},Vf),Uf={tablecellbackgroundcolor:X({styles:{backgroundColor:"%value"}},jf),tablecellverticalalign:X({styles:{"vertical-align":"%value"}},jf),tablecellbordercolor:X({styles:{borderColor:"%value"}},jf),tablecellclass:X({classes:["%value"]},jf),tableclass:X({selector:"table",classes:["%value"]},Vf),tablecellborderstyle:X({styles:{borderStyle:"%value"}},jf),tablecellborderwidth:X({styles:{borderWidth:"%value"}},jf)},Wf=Er([{none:["current"]},{first:["current"]},{middle:["current","target"]},{last:["current"]}]),$f=X(X({},Wf),{none:function(e){return void 0===e&&(e=void 0),Wf.none(e)}}),qf=function(e,t,n,r,o){void 0===o&&(o=x);var i=1===r;if(!i&&n<=0)return $f.first(e[0]);if(i&&n>=e.length-1)return $f.last(e[e.length-1]);var a=n+r,u=e[a];return o(u)?$f.middle(t,u):qf(e,t,a,r,o)},Gf=function(e,t){return vn(e,t).bind((function(t){var n=pn(t);return L(n,(function(t){return Ie(e,t)})).map((function(e){return{index:e,all:n}}))}))},Kf=function(e,t,n,r){return{start:e,soffset:t,finish:n,foffset:r}},Xf=Er([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Yf={before:Xf.before,on:Xf.on,after:Xf.after,cata:function(e,t,n,r){return e.fold(t,n,r)},getStart:function(e){return e.fold(g,g,g)}},Jf=Er([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Zf={domRange:Jf.domRange,relative:Jf.relative,exact:Jf.exact,exactFromRange:function(e){return Jf.exact(e.start,e.soffset,e.finish,e.foffset)},getWin:function(e){var t,n=function(e){return e.match({domRange:function(e){return Re.fromDom(e.startContainer)},relative:function(e,t){return Yf.getStart(e)},exact:function(e,t,n,r){return e}})}(e);return t=n,Re.fromDom(gt(t).dom.defaultView)},range:Kf},Qf=function(e,t){var n=e.document.createRange();return n.selectNode(t.dom),n},ed=function(e,t){var n=e.document.createRange();return td(n,t),n},td=function(e,t){return e.selectNodeContents(t.dom)},nd=function(e,t,n){var r,o=e.document.createRange();return r=o,t.fold((function(e){r.setStartBefore(e.dom)}),(function(e,t){r.setStart(e.dom,t)}),(function(e){r.setStartAfter(e.dom)})),function(e,t){t.fold((function(t){e.setEndBefore(t.dom)}),(function(t,n){e.setEnd(t.dom,n)}),(function(t){e.setEndAfter(t.dom)}))}(o,n),o},rd=function(e,t,n,r,o){var i=e.document.createRange();return i.setStart(t.dom,n),i.setEnd(r.dom,o),i},od=function(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom,width:e.width,height:e.height}},id=Er([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),ad=function(e,t,n){return t(Re.fromDom(n.startContainer),n.startOffset,Re.fromDom(n.endContainer),n.endOffset)},ud=function(e,t){var n=function(e,t){return t.match({domRange:function(e){return{ltr:m(e),rtl:T.none}},relative:function(t,n){return{ltr:J((function(){return nd(e,t,n)})),rtl:J((function(){return T.some(nd(e,n,t))}))}},exact:function(t,n,r,o){return{ltr:J((function(){return rd(e,t,n,r,o)})),rtl:J((function(){return T.some(rd(e,r,o,t,n))}))}}})}(e,t);return function(e,t){var n=t.ltr();return n.collapsed?t.rtl().filter((function(e){return!1===e.collapsed})).map((function(e){return id.rtl(Re.fromDom(e.endContainer),e.endOffset,Re.fromDom(e.startContainer),e.startOffset)})).getOrThunk((function(){return ad(0,id.ltr,n)})):ad(0,id.ltr,n)}(0,n)},cd=function(e,t){return ud(e,t).match({ltr:function(t,n,r,o){var i=e.document.createRange();return i.setStart(t.dom,n),i.setEnd(r.dom,o),i},rtl:function(t,n,r,o){var i=e.document.createRange();return i.setStart(r.dom,o),i.setEnd(t.dom,n),i}})};id.ltr,id.rtl;var sd=function(e,t,n){return t>=e.left&&t<=e.right&&n>=e.top&&n<=e.bottom},ld=function(e,t,n,r,o){var i=function(n){var r=e.dom.createRange();return r.setStart(t.dom,n),r.collapse(!0),r},a=ar(t).length,u=function(e,t,n,r,o){if(0===o)return 0;if(t===r)return o-1;for(var i=r,a=1;a<o;a++){var u=e(a),c=Math.abs(t-u.left);if(n<=u.bottom){if(n<u.top||c>i)return a-1;i=c}}return 0}((function(e){return i(e).getBoundingClientRect()}),n,r,o.right,a);return i(u)},fd=function(e,t,n,r){return st(t)?function(e,t,n,r){var o=e.dom.createRange();o.selectNode(t.dom);var i=o.getClientRects();return K(i,(function(e){return sd(e,n,r)?T.some(e):T.none()})).map((function(o){return ld(e,t,n,r,o)}))}(e,t,n,r):function(e,t,n,r){var o=e.dom.createRange(),i=yt(t);return K(i,(function(t){return o.selectNode(t.dom),sd(o.getBoundingClientRect(),n,r)?fd(e,t,n,r):T.none()}))}(e,t,n,r)},dd=function(e,t){return t-e.left<e.right-t},md=function(e,t,n){var r=e.dom.createRange();return r.selectNode(t.dom),r.collapse(n),r},gd=function(e,t,n){var r=e.dom.createRange();r.selectNode(t.dom);var o=r.getBoundingClientRect(),i=dd(o,n);return(true===i?gi:pi)(t).map((function(t){return md(e,t,i)}))},pd=function(e,t,n){var r=t.dom.getBoundingClientRect(),o=dd(r,n);return T.some(md(e,t,o))},hd=function(e,t,n){var r,o;return T.from(null===(o=(r=e.dom).caretPositionFromPoint)||void 0===o?void 0:o.call(r,t,n)).bind((function(t){if(null===t.offsetNode)return T.none();var n=e.dom.createRange();return n.setStart(t.offsetNode,t.offset),n.collapse(),T.some(n)}))},vd=function(e,t,n){var r,o;return T.from(null===(o=(r=e.dom).caretRangeFromPoint)||void 0===o?void 0:o.call(r,t,n))},bd=function(e,t,n,r){var o=e.dom.createRange();o.selectNode(t.dom);var i=o.getBoundingClientRect();return function(e,t,n,r){var o=e.dom.createRange();o.selectNode(t.dom);var i=o.getBoundingClientRect(),a=Math.max(i.left,Math.min(i.right,n)),u=Math.max(i.top,Math.min(i.bottom,r));return fd(e,t,a,u)}(e,t,Math.max(i.left,Math.min(i.right,n)),Math.max(i.top,Math.min(i.bottom,r)))},yd=function(e,t,n){return Re.fromPoint(e,t,n).bind((function(r){var o=function(){return function(e,t,n){return(0===yt(t).length?pd:gd)(e,t,n)}(e,r,t)};return 0===yt(r).length?o():bd(e,r,t,n).orThunk(o)}))},wd=document.caretPositionFromPoint?hd:document.caretRangeFromPoint?vd:yd,xd=function(e,t){var n=ot(e);return"input"===n?Yf.after(e):A(["br","img"],n)?0===t?Yf.before(e):Yf.after(e):Yf.on(e,t)},Cd=function(e,t){var n=e.fold(Yf.before,xd,Yf.after),r=t.fold(Yf.before,xd,Yf.after);return Zf.relative(n,r)},Sd=function(e,t,n,r){var o=xd(e,t),i=xd(n,r);return Zf.relative(o,i)},kd=function(e,t,n,r){var o=function(e,t,n,r){var o=mt(e).dom.createRange();return o.setStart(e.dom,t),o.setEnd(n.dom,r),o}(e,t,n,r),i=Ie(e,n)&&t===r;return o.collapsed&&!i},Td=function(e){return T.from(e.getSelection())},Od=function(e,t){Td(e).each((function(e){e.removeAllRanges(),e.addRange(t)}))},_d=function(e,t,n,r,o){var i=rd(e,t,n,r,o);Od(e,i)},Ed=function(e,t){return ud(e,t).match({ltr:function(t,n,r,o){_d(e,t,n,r,o)},rtl:function(t,n,r,o){Td(e).each((function(i){if(i.setBaseAndExtent)i.setBaseAndExtent(t.dom,n,r.dom,o);else if(i.extend)try{!function(e,t,n,r,o,i){t.collapse(n.dom,r),t.extend(o.dom,i)}(0,i,t,n,r,o)}catch(i){_d(e,r,o,t,n)}else _d(e,r,o,t,n)}))}})},Ad=function(e,t,n,r,o){var i=Sd(t,n,r,o);Ed(e,i)},Dd=function(e,t,n){var r=Cd(t,n);Ed(e,r)},Md=function(e){var t=Zf.getWin(e).dom,n=function(e,n,r,o){return rd(t,e,n,r,o)},r=function(e){return e.match({domRange:function(e){var t=Re.fromDom(e.startContainer),n=Re.fromDom(e.endContainer);return Sd(t,e.startOffset,n,e.endOffset)},relative:Cd,exact:Sd})}(e);return ud(t,r).match({ltr:n,rtl:n})},Nd=function(e){if(e.rangeCount>0){var t=e.getRangeAt(0),n=e.getRangeAt(e.rangeCount-1);return T.some(Kf(Re.fromDom(t.startContainer),t.startOffset,Re.fromDom(n.endContainer),n.endOffset))}return T.none()},Rd=function(e){if(null===e.anchorNode||null===e.focusNode)return Nd(e);var t=Re.fromDom(e.anchorNode),n=Re.fromDom(e.focusNode);return kd(t,e.anchorOffset,n,e.focusOffset)?T.some(Kf(t,e.anchorOffset,n,e.focusOffset)):Nd(e)},zd=function(e,t,n){void 0===n&&(n=!0);var r=(n?ed:Qf)(e,t);Od(e,r)},Bd=function(e){return function(e){return Td(e).filter((function(e){return e.rangeCount>0})).bind(Rd)}(e).map((function(e){return Zf.exact(e.start,e.soffset,e.finish,e.foffset)}))},Pd=function(e,t){return function(e){var t=e.getClientRects(),n=t.length>0?t[0]:e.getBoundingClientRect();return n.width>0||n.height>0?T.some(n).map(od):T.none()}(cd(e,t))},Id=function(e,t,n){return function(e,t,n){var r=Re.fromDom(e.document);return wd(r,t,n).map((function(e){return Kf(Re.fromDom(e.startContainer),e.startOffset,Re.fromDom(e.endContainer),e.endOffset)}))}(e,t,n)},Fd=tinymce.util.Tools.resolve("tinymce.util.VK"),Ld=function(e,t,n){return Vd(e,t,function(e,t,n){return Gf(e,n).fold((function(){return $f.none(e)}),(function(n){return qf(n.all,e,n.index,1,t)}))}(n,eu))},Hd=function(e,t,n){return Vd(e,t,function(e,t,n){return Gf(e,n).fold((function(){return $f.none()}),(function(n){return qf(n.all,e,n.index,-1,t)}))}(n,eu))},Vd=function(e,t,n){return n.fold(T.none,T.none,(function(e,t){return gi(t).map((function(e){return function(e,t){var n=Zf.exact(t,0,t,0);return Md(n)}(0,e)}))}),(function(n){return e.execCommand("mceTableInsertRowAfter"),Ld(e,t,n)}))},jd=["table","li","dl"],Ud=function(e,t){return{selection:e,kill:t}},Wd=function(e,t,n,r){return{start:Yf.on(e,t),finish:Yf.on(n,r)}},$d=function(e,t){var n=cd(e,t);return Kf(Re.fromDom(n.startContainer),n.startOffset,Re.fromDom(n.endContainer),n.endOffset)},qd=Wd,Gd=function(e,t,n,r,o){return Ie(n,r)?T.none():Cr(n,r,t).bind((function(t){var r=t.boxes.getOr([]);return r.length>1?(o(e,r,t.start,t.finish),T.some(Ud(T.some(qd(n,0,n,fi(n))),!0))):T.none()}))},Kd=function(e,t){return{item:e,mode:t}},Xd=function(e,t,n,r){return void 0===r&&(r=Yd),e.property().parent(t).map((function(e){return Kd(e,r)}))},Yd=function(e,t,n,r){return void 0===r&&(r=Jd),n.sibling(e,t).map((function(e){return Kd(e,r)}))},Jd=function(e,t,n,r){void 0===r&&(r=Jd);var o=e.property().children(t);return n.first(o).map((function(e){return Kd(e,r)}))},Zd=[{current:Xd,next:Yd,fallback:T.none()},{current:Yd,next:Jd,fallback:T.some(Xd)},{current:Jd,next:Jd,fallback:T.some(Yd)}],Qd=function(e,t,n,r,o){return void 0===o&&(o=Zd),F(o,(function(e){return e.current===n})).bind((function(n){return n.current(e,t,r,n.next).orThunk((function(){return n.fallback.bind((function(n){return Qd(e,t,n,r)}))}))}))},em=function(){return{sibling:function(e,t){return e.query().prevSibling(t)},first:function(e){return e.length>0?T.some(e[e.length-1]):T.none()}}},tm=function(){return{sibling:function(e,t){return e.query().nextSibling(t)},first:function(e){return e.length>0?T.some(e[0]):T.none()}}},nm=function(e,t,n,r,o,i){return Qd(e,t,r,o).bind((function(t){return i(t.item)?T.none():n(t.item)?T.some(t.item):nm(e,t.item,n,t.mode,o,i)}))},rm=function(e){return function(t){return 0===e.property().children(t).length}},om=function(e,t,n,r){return nm(e,t,n,Yd,em(),r)},im=function(e,t,n,r){return nm(e,t,n,Yd,tm(),r)},am=lr(),um=function(e,t){return function(e,t,n){return om(e,t,rm(e),n)}(am,e,t)},cm=function(e,t){return function(e,t,n){return im(e,t,rm(e),n)}(am,e,t)},sm=Er([{none:["message"]},{success:[]},{failedUp:["cell"]},{failedDown:["cell"]}]),lm=function(e){return Ft(e,"tr")},fm=X(X({},sm),{verify:function(e,t,n,r,o,i,a){return Ft(r,"td,th",a).bind((function(n){return Ft(t,"td,th",a).map((function(t){return Ie(n,t)?Ie(r,n)&&fi(n)===o?i(t):sm.none("in same cell"):wr(lm,[n,t]).fold((function(){return function(e,t,n){var r=e.getRect(t),o=e.getRect(n);return o.right>r.left&&o.left<r.right}(e,t,n)?sm.success():i(t)}),(function(e){return i(t)}))}))})).getOr(sm.none("default"))},cata:function(e,t,n,r,o){return e.fold(t,n,r,o)}}),dm=function(e,t){return L(e,h(Ie,t))},mm=function(e){return"br"===ot(e)},gm=function(e,t,n){return t(e,n).bind((function(e){return st(e)&&0===ar(e).trim().length?gm(e,t,n):T.some(e)}))},pm=function(e,t,n,r){return function(e,t){return wt(e,t).filter(mm).orThunk((function(){return wt(e,t-1).filter(mm)}))}(t,n).bind((function(t){return r.traverse(t).fold((function(){return gm(t,r.gather,e).map(r.relative)}),(function(e){return function(e){return pt(e).bind((function(t){var n=yt(t);return dm(n,e).map((function(r){return function(e,t,n,r){return{parent:e,children:t,element:n,index:r}}(t,n,e,r)}))}))}(e).map((function(e){return Yf.on(e.parent,e.index)}))}))}))},hm=function(e,t,n,r){var o=mm(t)?function(e,t,n){return n.traverse(t).orThunk((function(){return gm(t,n.gather,e)})).map(n.relative)}(e,t,r):pm(e,t,n,r);return o.map((function(e){return{start:e,finish:e}}))},vm=function(e,t){return{left:e.left,top:e.top+t,right:e.right,bottom:e.bottom+t}},bm=function(e,t){return{left:e.left,top:e.top-t,right:e.right,bottom:e.bottom-t}},ym=function(e,t,n){return{left:e.left+t,top:e.top+n,right:e.right+t,bottom:e.bottom+n}},wm=function(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}},xm=function(e,t){return T.some(e.getRect(t))},Cm=function(e,t,n){return ct(t)?xm(e,t).map(wm):st(t)?function(e,t,n){return n>=0&&n<fi(t)?e.getRangedRect(t,n,t,n+1):n>0?e.getRangedRect(t,n-1,t,n):T.none()}(e,t,n).map(wm):T.none()},Sm=function(e,t){return ct(t)?xm(e,t).map(wm):st(t)?e.getRangedRect(t,0,t,fi(t)).map(wm):T.none()},km=Er([{none:[]},{retry:["caret"]}]),Tm=function(e,t,n){return(r=t,o=Ms,Rt((function(e,t){return t(e)}),zt,r,o,i)).fold(w,(function(t){return Sm(e,t).exists((function(e){return function(e,t){return e.left<t.left||Math.abs(t.right-e.left)<1||e.left>t.right}(n,e)}))}));var r,o,i},Om={point:function(e){return e.bottom},adjuster:function(e,t,n,r,o){var i=vm(o,5);return Math.abs(n.bottom-r.bottom)<1||n.top>o.bottom?km.retry(i):n.top===o.bottom?km.retry(vm(o,1)):Tm(e,t,o)?km.retry(ym(i,5,0)):km.none()},move:vm,gather:cm},_m=function(e,t,n,r,o){return 0===o?T.some(r):function(e,t,n){return e.elementFromPoint(t,n).filter((function(e){return"table"===ot(e)})).isSome()}(e,r.left,t.point(r))?function(e,t,n,r,o){return _m(e,t,n,t.move(r,5),o)}(e,t,n,r,o-1):e.situsFromPoint(r.left,t.point(r)).bind((function(i){return i.start.fold(T.none,(function(i){return Sm(e,i).bind((function(a){return t.adjuster(e,i,a,n,r).fold(T.none,(function(r){return _m(e,t,n,r,o-1)}))})).orThunk((function(){return T.some(r)}))}),T.none)}))},Em=function(e,t,n){var r=e.move(n,5),o=_m(t,e,n,r,100).getOr(r);return function(e,t,n){return e.point(t)>n.getInnerHeight()?T.some(e.point(t)-n.getInnerHeight()):e.point(t)<0?T.some(-e.point(t)):T.none()}(e,o,t).fold((function(){return t.situsFromPoint(o.left,e.point(o))}),(function(n){return t.scrollBy(0,n),t.situsFromPoint(o.left,e.point(o)-n)}))},Am={tryUp:h(Em,{point:function(e){return e.top},adjuster:function(e,t,n,r,o){var i=bm(o,5);return Math.abs(n.top-r.top)<1||n.bottom<o.top?km.retry(i):n.bottom===o.top?km.retry(bm(o,1)):Tm(e,t,o)?km.retry(ym(i,5,0)):km.none()},move:bm,gather:um}),tryDown:h(Em,Om),ieTryUp:function(e,t){return e.situsFromPoint(t.left,t.top-5)},ieTryDown:function(e,t){return e.situsFromPoint(t.left,t.bottom+5)},getJumpSize:m(5)},Dm=function(e,t,n){return e.getSelection().bind((function(r){return hm(t,r.finish,r.foffset,n).fold((function(){return T.some(sc(r.finish,r.foffset))}),(function(o){var i=e.fromSitus(o);return function(e){return fm.cata(e,(function(e){return T.none()}),(function(){return T.none()}),(function(e){return T.some(sc(e,0))}),(function(e){return T.some(sc(e,fi(e)))}))}(fm.verify(e,r.finish,r.foffset,i.finish,i.foffset,n.failure,t))}))}))},Mm=function(e,t,n,r,o,i){return 0===i?T.none():zm(e,t,n,r,o).bind((function(a){var u=e.fromSitus(a),c=fm.verify(e,n,r,u.finish,u.foffset,o.failure,t);return fm.cata(c,(function(){return T.none()}),(function(){return T.some(a)}),(function(a){return Ie(n,a)&&0===r?Nm(e,n,r,bm,o):Mm(e,t,a,0,o,i-1)}),(function(a){return Ie(n,a)&&r===fi(a)?Nm(e,n,r,vm,o):Mm(e,t,a,fi(a),o,i-1)}))}))},Nm=function(e,t,n,r,o){return Cm(e,t,n).bind((function(t){return Rm(e,o,r(t,Am.getJumpSize()))}))},Rm=function(e,t,n){var r=Me().browser;return r.isChrome()||r.isSafari()||r.isFirefox()||r.isEdge()?t.otherRetry(e,n):r.isIE()?t.ieRetry(e,n):T.none()},zm=function(e,t,n,r,o){return Cm(e,n,r).bind((function(t){return Rm(e,o,t)}))},Bm=function(e,t){return zt(e,(function(e){return pt(e).exists((function(e){return Ie(e,t)}))}),n).isSome();var n},Pm=function(e,t,n,r,o){return Ft(r,"td,th",t).bind((function(r){return Ft(r,"table",t).bind((function(i){return Bm(o,i)?function(e,t,n){return Dm(e,t,n).bind((function(r){return Mm(e,t,r.element,r.offset,n,20).map(e.fromSitus)}))}(e,t,n).bind((function(e){return Ft(e.finish,"td,th",t).map((function(t){return{start:r,finish:t,range:e}}))})):T.none()}))}))},Im=function(e,t,n,r,o,i){return Me().browser.isIE()?T.none():i(r,t).orThunk((function(){return Pm(e,t,n,r,o).map((function(e){var t=e.range;return Ud(T.some(qd(t.start,t.soffset,t.finish,t.foffset)),!0)}))}))},Fm=function(e,t){return Ft(e,"tr",t).bind((function(e){return Ft(e,"table",t).bind((function(n){var r=Nt(n,"tr");return Ie(e,r[0])?function(e,t,n){return om(am,e,t,n)}(n,(function(e){return pi(e).isSome()}),t).map((function(e){var t=fi(e);return Ud(T.some(qd(e,t,e,t)),!0)})):T.none()}))}))},Lm=function(e,t){return Ft(e,"tr",t).bind((function(e){return Ft(e,"table",t).bind((function(n){var r=Nt(n,"tr");return Ie(e,r[r.length-1])?function(e,t,n){return im(am,e,t,n)}(n,(function(e){return gi(e).isSome()}),t).map((function(e){return Ud(T.some(qd(e,0,e,0)),!0)})):T.none()}))}))},Hm=function(e,t,n,r,o,i,a){return Pm(e,n,r,o,i).bind((function(e){return Gd(t,n,e.start,e.finish,a)}))},Vm=function(e,t){return Ft(e,"td,th",t)},jm={traverse:bt,gather:cm,relative:Yf.before,otherRetry:Am.tryDown,ieRetry:Am.ieTryDown,failure:fm.failedDown},Um={traverse:vt,gather:um,relative:Yf.before,otherRetry:Am.tryUp,ieRetry:Am.ieTryUp,failure:fm.failedUp},Wm=function(e){return function(t){return t===e}},$m=Wm(38),qm=Wm(40),Gm=function(e){return e>=37&&e<=40},Km={isBackward:Wm(37),isForward:Wm(39)},Xm={isBackward:Wm(39),isForward:Wm(37)},Ym=function(e){return{elementFromPoint:function(t,n){return Re.fromPoint(Re.fromDom(e.document),t,n)},getRect:function(e){return e.dom.getBoundingClientRect()},getRangedRect:function(t,n,r,o){var i=Zf.exact(t,n,r,o);return Pd(e,i)},getSelection:function(){return Bd(e).map((function(t){return $d(e,t)}))},fromSitus:function(t){var n=Zf.relative(t.start,t.finish);return $d(e,n)},situsFromPoint:function(t,n){return Id(e,t,n).map((function(e){return Wd(e.start,e.soffset,e.finish,e.foffset)}))},clearSelection:function(){!function(e){Td(e).each((function(e){return e.removeAllRanges()}))}(e)},collapseSelection:function(t){void 0===t&&(t=!1),Bd(e).each((function(n){return n.fold((function(e){return e.collapse(t)}),(function(n,r){var o=t?n:r;Dd(e,o,o)}),(function(n,r,o,i){var a=t?n:o,u=t?r:i;Ad(e,a,u,a,u)}))}))},setSelection:function(t){Ad(e,t.start,t.soffset,t.finish,t.foffset)},setRelativeSelection:function(t,n){Dd(e,t,n)},selectNode:function(t){zd(e,t,!1)},selectContents:function(t){zd(e,t)},getInnerHeight:function(){return e.innerHeight},getScrollY:function(){var t,n,r,o;return(t=Re.fromDom(e.document),n=void 0!==t?t.dom:document,r=n.body.scrollLeft||n.documentElement.scrollLeft,o=n.body.scrollTop||n.documentElement.scrollTop,co(r,o)).top},scrollBy:function(t,n){!function(e,t,n){var r=(void 0!==n?n.dom:document).defaultView;r&&r.scrollBy(e,t)}(t,n,Re.fromDom(e.document))}}},Jm=function(e,t){return{rows:e,cols:t}},Zm=function(e,t,n,r){var o=function(e,t,n,r){var o=tf(),i=o.clear,a=function(i){o.on((function(o){r.clearBeforeUpdate(t),Vm(i.target,n).each((function(a){Cr(o,a,n).each((function(n){var o=n.boxes.getOr([]);if(1===o.length){var u=o[0],c="false"===tu(u),s=qt(Qa(i.target),u,Ie);c&&s&&(r.selectRange(t,o,u,u),e.selectContents(u))}else o.length>1&&(r.selectRange(t,o,n.start,n.finish),e.selectContents(a))}))}))}))};return{clearstate:i,mousedown:function(e){r.clear(t),Vm(e.target,n).each(o.set)},mouseover:function(e){a(e)},mouseup:function(e){a(e),i()}}}(Ym(e),t,n,r);return{clearstate:o.clearstate,mousedown:o.mousedown,mouseover:o.mouseover,mouseup:o.mouseup}},Qm=function(e,t,n,r){var o=Ym(e),i=function(){return r.clear(t),T.none()};return{keydown:function(e,a,u,c,s,l){var f=e.raw,d=f.which,m=!0===f.shiftKey,g=Sr(t,r.selectedSelector).fold((function(){return Gm(d)&&!m&&r.clearBeforeUpdate(t),qm(d)&&m?h(Hm,o,t,n,jm,c,a,r.selectRange):$m(d)&&m?h(Hm,o,t,n,Um,c,a,r.selectRange):qm(d)?h(Im,o,n,jm,c,a,Lm):$m(d)?h(Im,o,n,Um,c,a,Fm):T.none}),(function(e){var n=function(n){return function(){var i=K(n,(function(n){return function(e,t,n,r,o){return Tr(r,e,t,o.firstSelectedSelector,o.lastSelectedSelector).map((function(e){return o.clearBeforeUpdate(n),o.selectRange(n,e.boxes,e.start,e.finish),e.boxes}))}(n.rows,n.cols,t,e,r)}));return i.fold((function(){return kr(t,r.firstSelectedSelector,r.lastSelectedSelector).map((function(e){var n=qm(d)||l.isForward(d)?Yf.after:Yf.before;return o.setRelativeSelection(Yf.on(e.first,0),n(e.table)),r.clear(t),Ud(T.none(),!0)}))}),(function(e){return T.some(Ud(T.none(),!0))}))}};return qm(d)&&m?n([Jm(1,0)]):$m(d)&&m?n([Jm(-1,0)]):l.isBackward(d)&&m?n([Jm(0,-1),Jm(-1,0)]):l.isForward(d)&&m?n([Jm(0,1),Jm(1,0)]):Gm(d)&&!m?i:T.none}));return g()},keyup:function(e,o,i,a,u){return Sr(t,r.selectedSelector).fold((function(){var c=e.raw,s=c.which;return!0===c.shiftKey&&Gm(s)?function(e,t,n,r,o,i,a){return Ie(n,o)&&r===i?T.none():Ft(n,"td,th",t).bind((function(n){return Ft(o,"td,th",t).bind((function(r){return Gd(e,t,n,r,a)}))}))}(t,n,o,i,a,u,r.selectRange):T.none()}),T.none)}}},eg=function(e,t,n){var r=function(t){Wt(t,e.selected),Wt(t,e.firstSelected),Wt(t,e.lastSelected)},o=function(t){Ht(t,e.selected,"1")},i=function(e){a(e),n()},a=function(t){var n=Nt(t,e.selectedSelector+","+e.firstSelectedSelector+","+e.lastSelectedSelector);R(n,r)};return{clearBeforeUpdate:a,clear:i,selectRange:function(n,r,a,u){i(n),R(r,o),Ht(a,e.firstSelected,"1"),Ht(u,e.lastSelected,"1"),t(r,a,u)},selectedSelector:e.selectedSelector,firstSelectedSelector:e.firstSelectedSelector,lastSelectedSelector:e.lastSelectedSelector}},tg=function(e,t,n){var r=Fn.fromTable(e);return Uc(r,t).map((function(e){var t=Ic(r,n,!1),o=function(e,t){var n=e.slice(0,t[t.length-1].row+1),r=Fc(n);return V(r,(function(e){var n=e.cells.slice(0,t[t.length-1].column+1);return N(n,(function(e){return e.element}))}))}(t,e),i=function(e,t){var n=e.slice(t[0].row+t[0].rowspan-1,e.length),r=Fc(n);return V(r,(function(e){var n=e.cells.slice(t[0].column+t[0].colspan-1,e.cells.length);return N(n,(function(e){return e.element}))}))}(t,e);return{upOrLeftCells:o,downOrRightCells:i}}))},ng=tinymce.util.Tools.resolve("tinymce.Env"),rg=function(e){return!1===Ka(Re.fromDom(e.target),"ephox-snooker-resizer-bar")};function og(e,t,n){var r=eg(Hi,(function(t,r,o){n.targets().each((function(n){vn(r).each((function(i){var a=Ju(e),u=ki(d,Re.fromDom(e.getDoc()),a),c=tg(i,n,u);!function(e,t,n,r,o){e.fire("TableSelectionChange",{cells:t,start:n,finish:r,otherCells:o})}(e,t,r,o,c)}))}))}),(function(){return function(e){e.fire("TableSelectionClear")}(e)}));return e.on("init",(function(n){var o=e.getWin(),i=_i(e),a=Di(e),u=Zm(o,i,a,r),c=Qm(o,i,a,r),s=function(e,t,n,r){var o=Ym(e);return function(e,i){r.clearBeforeUpdate(t),Cr(e,i,n).each((function(e){var n=e.boxes.getOr([]);r.selectRange(t,n,e.start,e.finish),o.selectContents(i),o.collapseSelection()}))}}(o,i,a,r);e.on("TableSelectorChange",(function(e){return s(e.start,e.finish)}));var l,f,m=function(t,n){(function(e){return!0===e.raw.shiftKey})(t)&&(n.kill&&t.kill(),n.selection.each((function(t){var n=Zf.relative(t.start,t.finish),r=cd(o,n);e.selection.setRng(r)})))},g=function(e){return 0===e.button},p=(l=Ql(Re.fromDom(i)),f=Ql(0),{touchEnd:function(e){var t=Re.fromDom(e.target);if("td"===ot(t)||"th"===ot(t)){var n=l.get(),r=f.get();Ie(n,t)&&e.timeStamp-r<300&&(e.preventDefault(),s(t,t))}l.set(t),f.set(e.timeStamp)}});e.on("dragstart",(function(e){u.clearstate()})),e.on("mousedown",(function(e){g(e)&&rg(e)&&u.mousedown(Ua(e))})),e.on("mouseover",(function(e){var t;(void 0===(t=e).buttons||ng.browser.isEdge()&&0===t.buttons||0!=(1&t.buttons))&&rg(e)&&u.mouseover(Ua(e))})),e.on("mouseup",(function(e){g(e)&&rg(e)&&u.mouseup(Ua(e))})),e.on("touchend",p.touchEnd),e.on("keyup",(function(t){var n=Ua(t);if(n.raw.shiftKey&&Gm(n.raw.which)){var r=e.selection.getRng(),o=Re.fromDom(r.startContainer),i=Re.fromDom(r.endContainer);c.keyup(n,o,r.startOffset,i,r.endOffset).each((function(e){m(n,e)}))}})),e.on("keydown",(function(n){var r=Ua(n);t().each((function(e){return e.hideBars()}));var o=e.selection.getRng(),i=Re.fromDom(o.startContainer),a=Re.fromDom(o.endContainer),u=to(Km,Xm)(Re.fromDom(e.selection.getStart()));c.keydown(r,i,o.startOffset,a,o.endOffset,u).each((function(e){m(r,e)})),t().each((function(e){return e.showBars()}))})),e.on("NodeChange",(function(){var t=e.selection,n=Re.fromDom(t.getStart()),o=Re.fromDom(t.getEnd());wr(vn,[n,o]).fold((function(){return r.clear(i)}),d)}))})),{clear:r.clear}}var ig=function(e,t){var n=Ql(T.none()),r=Ql([]),o=T.none(),i=dt("caption"),a=function(e){return o.forall((function(t){return!t[e]}))},u=function(){return Ui(function(e){return Re.fromDom(e.selection.getEnd())}(e),Di(e))},c=function(){return Ui(Ri(e),Di(e)).bind((function(e){return n=Kt(vn(e),u().bind(vn),(function(n,r){return Ie(n,r)?i(e)?T.some(function(e){return{element:e,mergable:T.none(),unmergable:T.none(),selection:[e]}}(e)):T.some(Vi(t,n,e)):T.none()})),n.bind(g);var n}))},s=function(e){return vn(e.element).map((function(t){var n=Fn.fromTable(t),r=Uc(n,e).getOr([]),o=I(r,(function(e,t){return t.isLocked&&(e.onAny=!0,0===t.column?e.onFirst=!0:t.column+t.colspan>=n.grid.columns&&(e.onLast=!0)),e}),{onAny:!1,onFirst:!1,onLast:!1});return{mergeable:qc(n,e).isSome(),unmergeable:Gc(n,e).isSome(),locked:o}}))},l=function(){n.set(J(c)()),o=n.get().bind(s),R(r.get(),(function(e){return e()}))},f=function(e){return e(),r.set(r.get().concat([e])),function(){r.set(B(r.get(),(function(t){return t!==e})))}},d=function(e,t){return f((function(){return n.get().fold((function(){e.setDisabled(!0)}),(function(n){e.setDisabled(t(n))}))}))},m=function(e,t,r){return f((function(){return n.get().fold((function(){e.setDisabled(!0),e.setActive(!1)}),(function(n){e.setDisabled(t(n)),e.setActive(r(n))}))}))},p=function(e){return o.exists((function(t){return t.locked[e]}))},h=function(t,n){return function(r){return m(r,(function(e){return i(e.element)}),(function(){return e.queryCommandValue(t)===n}))}},v=h("mceTableRowType","header"),b=h("mceTableColType","th");return e.on("NodeChange ExecCommand TableSelectorChange",l),{onSetupTable:function(e){return d(e,(function(e){return!1}))},onSetupCellOrRow:function(e){return d(e,(function(e){return i(e.element)}))},onSetupColumn:function(e){return function(t){return d(t,(function(t){return i(t.element)||p(e)}))}},onSetupPasteable:function(e){return function(t){return d(t,(function(t){return i(t.element)||e().isNone()}))}},onSetupPasteableColumn:function(e,t){return function(n){return d(n,(function(n){return i(n.element)||e().isNone()||p(t)}))}},onSetupMergeable:function(e){return d(e,(function(e){return a("mergeable")}))},onSetupUnmergeable:function(e){return d(e,(function(e){return a("unmergeable")}))},resetTargets:l,onSetupTableWithCaption:function(t){return m(t,w,(function(t){return vn(t.element,Di(e)).exists((function(e){return Pt(e,"caption").isSome()}))}))},onSetupTableRowHeaders:v,onSetupTableColumnHeaders:b,targets:n.get}},ag=function(e){var t=function(e,t,n){return{get:function(){return Or(e(),n).fold((function(){return t().fold(Mr,Rr)}),(function(e){return Nr(e)}))}}}((function(){return _i(e)}),(function(){return Wi(Ri(e),Di(e))}),Hi.selectedSelector),n=ig(e,t),r=cc(e),o=og(e,r.lazyResize,n),i=kl(e,o,r.lazyWire),a=function(){var e=tf(),t=tf();return{getRows:e.get,setRows:function(n){n.fold(e.clear,e.set),t.clear()},clearRows:e.clear,getColumns:t.get,setColumns:function(n){n.fold(t.clear,t.set),e.clear()},clearColumns:t.clear}}();return Hf(e,i,0,t,a),function(e,t,n){var r=Di(e),o=function(t){return Wi(Ri(e)).bind((function(e){return vn(e,r).map((function(r){var o=Vi(n,r,e);return t(r,o)}))})).getOr("")};Ue({mceTableRowType:function(){return o(t.getTableRowType)},mceTableCellType:function(){return o(t.getTableCellType)},mceTableColType:function(){return o(t.getTableColType)}},(function(t,n){return e.addQueryValueHandler(n,t)}))}(e,i,t),qi(e,t,i),function(e,t,n,r){var o=function(t){return function(){return e.execCommand(t)}},i=function(t){e.execCommand("mceInsertTable",!1,{rows:t.numRows,columns:t.numColumns})},a={text:"Table properties",onSetup:n.onSetupTable,onAction:o("mceTableProps")},u={text:"Delete table",icon:"table-delete-table",onSetup:n.onSetupTable,onAction:o("mceTableDelete")};e.ui.registry.addMenuItem("tableinsertrowbefore",{text:"Insert row before",icon:"table-insert-row-above",onAction:o("mceTableInsertRowBefore"),onSetup:n.onSetupCellOrRow}),e.ui.registry.addMenuItem("tableinsertrowafter",{text:"Insert row after",icon:"table-insert-row-after",onAction:o("mceTableInsertRowAfter"),onSetup:n.onSetupCellOrRow}),e.ui.registry.addMenuItem("tabledeleterow",{text:"Delete row",icon:"table-delete-row",onAction:o("mceTableDeleteRow"),onSetup:n.onSetupCellOrRow}),e.ui.registry.addMenuItem("tablerowprops",{text:"Row properties",icon:"table-row-properties",onAction:o("mceTableRowProps"),onSetup:n.onSetupCellOrRow}),e.ui.registry.addMenuItem("tablecutrow",{text:"Cut row",icon:"cut-row",onAction:o("mceTableCutRow"),onSetup:n.onSetupCellOrRow}),e.ui.registry.addMenuItem("tablecopyrow",{text:"Copy row",icon:"duplicate-row",onAction:o("mceTableCopyRow"),onSetup:n.onSetupCellOrRow}),e.ui.registry.addMenuItem("tablepasterowbefore",{text:"Paste row before",icon:"paste-row-before",onAction:o("mceTablePasteRowBefore"),onSetup:n.onSetupPasteable(r.getRows)}),e.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")};e.ui.registry.addMenuItem("tableinsertcolumnbefore",{text:"Insert column before",icon:"table-insert-column-before",onAction:o("mceTableInsertColBefore"),onSetup:n.onSetupColumn("onFirst")}),e.ui.registry.addMenuItem("tableinsertcolumnafter",{text:"Insert column after",icon:"table-insert-column-after",onAction:o("mceTableInsertColAfter"),onSetup:n.onSetupColumn("onLast")}),e.ui.registry.addMenuItem("tabledeletecolumn",{text:"Delete column",icon:"table-delete-column",onAction:o("mceTableDeleteCol"),onSetup:n.onSetupColumn("onAny")}),e.ui.registry.addMenuItem("tablecutcolumn",{text:"Cut column",icon:"cut-column",onAction:o("mceTableCutCol"),onSetup:n.onSetupColumn("onAny")}),e.ui.registry.addMenuItem("tablecopycolumn",{text:"Copy column",icon:"duplicate-column",onAction:o("mceTableCopyCol"),onSetup:n.onSetupColumn("onAny")}),e.ui.registry.addMenuItem("tablepastecolumnbefore",{text:"Paste column before",icon:"paste-column-before",onAction:o("mceTablePasteColBefore"),onSetup:n.onSetupPasteableColumn(r.getColumns,"onFirst")}),e.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")};e.ui.registry.addMenuItem("tablecellprops",{text:"Cell properties",icon:"table-cell-properties",onAction:o("mceTableCellProps"),onSetup:n.onSetupCellOrRow}),e.ui.registry.addMenuItem("tablemergecells",{text:"Merge cells",icon:"table-merge-cells",onAction:o("mceTableMergeCells"),onSetup:n.onSetupMergeable}),e.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(e){return e.getParam("table_grid",!0,"boolean")}(e)?e.ui.registry.addMenuItem("inserttable",{text:"Table",icon:"table",onAction:o("mceInsertTable")}):e.ui.registry.addNestedMenuItem("inserttable",{text:"Table",icon:"table",getSubmenuItems:function(){return[{type:"fancymenuitem",fancytype:"inserttable",onAction:i}]}}),e.ui.registry.addMenuItem("inserttabledialog",{text:"Insert table",icon:"table",onAction:o("mceInsertTable")}),e.ui.registry.addMenuItem("tableprops",a),e.ui.registry.addMenuItem("deletetable",u),e.ui.registry.addNestedMenuItem("row",c),e.ui.registry.addNestedMenuItem("column",s),e.ui.registry.addNestedMenuItem("cell",l),e.ui.registry.addContextMenu("table",{update:function(){return n.resetTargets(),n.targets().fold(m(""),(function(e){return"caption"===ot(e.element)?"tableprops deletetable":"cell row column | advtablesort | tableprops deletetable"}))}});var f=cf(ju(e));0!==f.length&&e.ui.registry.addNestedMenuItem("tableclass",{icon:"table-classes",text:"Table styles",getSubmenuItems:function(){return af(e,t,f,"tableclass",(function(t){return e.execCommand("mceTableToggleClass",!1,t)}))},onSetup:n.onSetupTable});var d=cf(Vu(e));0!==d.length&&e.ui.registry.addNestedMenuItem("tablecellclass",{icon:"table-cell-classes",text:"Cell styles",getSubmenuItems:function(){return af(e,t,d,"tablecellclass",(function(t){return e.execCommand("mceTableCellToggleClass",!1,t)}))},onSetup:n.onSetupCellOrRow}),e.ui.registry.addNestedMenuItem("tablecellvalign",{icon:"vertical-align",text:"Vertical align",getSubmenuItems:function(){return af(e,t,Vl,"tablecellverticalalign",uf(e,"vertical-align"))},onSetup:n.onSetupCellOrRow}),e.ui.registry.addNestedMenuItem("tablecellborderwidth",{icon:"border-width",text:"Border width",getSubmenuItems:function(){return af(e,t,Ru(e),"tablecellborderwidth",uf(e,"border-width"))},onSetup:n.onSetupCellOrRow}),e.ui.registry.addNestedMenuItem("tablecellborderstyle",{icon:"border-style",text:"Border style",getSubmenuItems:function(){return af(e,t,zu(e),"tablecellborderstyle",uf(e,"border-style"))},onSetup:n.onSetupCellOrRow}),e.ui.registry.addToggleMenuItem("tablecaption",{icon:"table-caption",text:"Table caption",onAction:o("mceTableToggleCaption"),onSetup:n.onSetupTableWithCaption}),e.ui.registry.addNestedMenuItem("tablecellbackgroundcolor",{icon:"cell-background-color",text:"Background color",getSubmenuItems:function(){return lf(e,Zu(e),"background-color")},onSetup:n.onSetupCellOrRow}),e.ui.registry.addNestedMenuItem("tablecellbordercolor",{icon:"cell-border-color",text:"Border color",getSubmenuItems:function(){return lf(e,Qu(e),"border-color")},onSetup:n.onSetupCellOrRow}),e.ui.registry.addToggleMenuItem("tablerowheader",{text:"Row header",icon:"table-top-header",onAction:ff(e),onSetup:n.onSetupTableRowHeaders}),e.ui.registry.addToggleMenuItem("tablecolheader",{text:"Column header",icon:"table-left-header",onAction:df(e),onSetup:n.onSetupTableColumnHeaders})}(e,t,n,a),function(e,t,n,r){e.ui.registry.addMenuButton("table",{tooltip:"Table",icon:"table",fetch:function(e){return e("inserttable | cell row column | advtablesort | tableprops deletetable")}});var o=function(t){return function(){return e.execCommand(t)}};e.ui.registry.addButton("tableprops",{tooltip:"Table properties",onAction:o("mceTableProps"),icon:"table",onSetup:n.onSetupTable}),e.ui.registry.addButton("tabledelete",{tooltip:"Delete table",onAction:o("mceTableDelete"),icon:"table-delete-table",onSetup:n.onSetupTable}),e.ui.registry.addButton("tablecellprops",{tooltip:"Cell properties",onAction:o("mceTableCellProps"),icon:"table-cell-properties",onSetup:n.onSetupCellOrRow}),e.ui.registry.addButton("tablemergecells",{tooltip:"Merge cells",onAction:o("mceTableMergeCells"),icon:"table-merge-cells",onSetup:n.onSetupMergeable}),e.ui.registry.addButton("tablesplitcells",{tooltip:"Split cell",onAction:o("mceTableSplitCells"),icon:"table-split-cells",onSetup:n.onSetupUnmergeable}),e.ui.registry.addButton("tableinsertrowbefore",{tooltip:"Insert row before",onAction:o("mceTableInsertRowBefore"),icon:"table-insert-row-above",onSetup:n.onSetupCellOrRow}),e.ui.registry.addButton("tableinsertrowafter",{tooltip:"Insert row after",onAction:o("mceTableInsertRowAfter"),icon:"table-insert-row-after",onSetup:n.onSetupCellOrRow}),e.ui.registry.addButton("tabledeleterow",{tooltip:"Delete row",onAction:o("mceTableDeleteRow"),icon:"table-delete-row",onSetup:n.onSetupCellOrRow}),e.ui.registry.addButton("tablerowprops",{tooltip:"Row properties",onAction:o("mceTableRowProps"),icon:"table-row-properties",onSetup:n.onSetupCellOrRow}),e.ui.registry.addButton("tableinsertcolbefore",{tooltip:"Insert column before",onAction:o("mceTableInsertColBefore"),icon:"table-insert-column-before",onSetup:n.onSetupColumn("onFirst")}),e.ui.registry.addButton("tableinsertcolafter",{tooltip:"Insert column after",onAction:o("mceTableInsertColAfter"),icon:"table-insert-column-after",onSetup:n.onSetupColumn("onLast")}),e.ui.registry.addButton("tabledeletecol",{tooltip:"Delete column",onAction:o("mceTableDeleteCol"),icon:"table-delete-column",onSetup:n.onSetupColumn("onAny")}),e.ui.registry.addButton("tablecutrow",{tooltip:"Cut row",icon:"cut-row",onAction:o("mceTableCutRow"),onSetup:n.onSetupCellOrRow}),e.ui.registry.addButton("tablecopyrow",{tooltip:"Copy row",icon:"duplicate-row",onAction:o("mceTableCopyRow"),onSetup:n.onSetupCellOrRow}),e.ui.registry.addButton("tablepasterowbefore",{tooltip:"Paste row before",icon:"paste-row-before",onAction:o("mceTablePasteRowBefore"),onSetup:n.onSetupPasteable(r.getRows)}),e.ui.registry.addButton("tablepasterowafter",{tooltip:"Paste row after",icon:"paste-row-after",onAction:o("mceTablePasteRowAfter"),onSetup:n.onSetupPasteable(r.getRows)}),e.ui.registry.addButton("tablecutcol",{tooltip:"Cut column",icon:"cut-column",onAction:o("mceTableCutCol"),onSetup:n.onSetupColumn("onAny")}),e.ui.registry.addButton("tablecopycol",{tooltip:"Copy column",icon:"duplicate-column",onAction:o("mceTableCopyCol"),onSetup:n.onSetupColumn("onAny")}),e.ui.registry.addButton("tablepastecolbefore",{tooltip:"Paste column before",icon:"paste-column-before",onAction:o("mceTablePasteColBefore"),onSetup:n.onSetupPasteableColumn(r.getColumns,"onFirst")}),e.ui.registry.addButton("tablepastecolafter",{tooltip:"Paste column after",icon:"paste-column-after",onAction:o("mceTablePasteColAfter"),onSetup:n.onSetupPasteableColumn(r.getColumns,"onLast")}),e.ui.registry.addButton("tableinsertdialog",{tooltip:"Insert table",onAction:o("mceInsertTable"),icon:"table"});var i=cf(ju(e));0!==i.length&&e.ui.registry.addMenuButton("tableclass",{icon:"table-classes",tooltip:"Table styles",fetch:sf(e,t,i,"tableclass",(function(t){return e.execCommand("mceTableToggleClass",!1,t)})),onSetup:n.onSetupTable});var a=cf(Vu(e));0!==a.length&&e.ui.registry.addMenuButton("tablecellclass",{icon:"table-cell-classes",tooltip:"Cell styles",fetch:sf(e,t,a,"tablecellclass",(function(t){return e.execCommand("mceTableCellToggleClass",!1,t)})),onSetup:n.onSetupCellOrRow}),e.ui.registry.addMenuButton("tablecellvalign",{icon:"vertical-align",tooltip:"Vertical align",fetch:sf(e,t,Vl,"tablecellverticalalign",uf(e,"vertical-align")),onSetup:n.onSetupCellOrRow}),e.ui.registry.addMenuButton("tablecellborderwidth",{icon:"border-width",tooltip:"Border width",fetch:sf(e,t,Ru(e),"tablecellborderwidth",uf(e,"border-width")),onSetup:n.onSetupCellOrRow}),e.ui.registry.addMenuButton("tablecellborderstyle",{icon:"border-style",tooltip:"Border style",fetch:sf(e,t,zu(e),"tablecellborderstyle",uf(e,"border-style")),onSetup:n.onSetupCellOrRow}),e.ui.registry.addToggleButton("tablecaption",{tooltip:"Table caption",onAction:o("mceTableToggleCaption"),icon:"table-caption",onSetup:n.onSetupTableWithCaption}),e.ui.registry.addMenuButton("tablecellbackgroundcolor",{icon:"cell-background-color",tooltip:"Background color",fetch:function(t){return t(lf(e,Zu(e),"background-color"))},onSetup:n.onSetupCellOrRow}),e.ui.registry.addMenuButton("tablecellbordercolor",{icon:"cell-border-color",tooltip:"Border color",fetch:function(t){return t(lf(e,Qu(e),"border-color"))},onSetup:n.onSetupCellOrRow}),e.ui.registry.addToggleButton("tablerowheader",{tooltip:"Row header",icon:"table-top-header",onAction:ff(e),onSetup:n.onSetupTableRowHeaders}),e.ui.registry.addToggleButton("tablecolheader",{tooltip:"Column header",icon:"table-left-header",onAction:df(e),onSetup:n.onSetupTableColumnHeaders})}(e,t,n,a),function(e){var t=function(e){return e.getParam("table_toolbar","tableprops tabledelete | tableinsertrowbefore tableinsertrowafter tabledeleterow | tableinsertcolbefore tableinsertcolafter tabledeletecol")}(e);t.length>0&&e.ui.registry.addContextToolbar("table",{predicate:function(t){return e.dom.is(t,"table")&&e.getBody().contains(t)},items:t,scope:"node",position:"node"})}(e),e.on("PreInit",(function(){e.serializer.addTempAttr(Hi.firstSelected),e.serializer.addTempAttr(Hi.lastSelected),function(e){e.formatter.register(Uf)}(e)})),function(e){return e.getParam("table_tab_navigation",!0,"boolean")}(e)&&e.on("keydown",(function(t){!function(e,t,n){if(e.keyCode===Fd.TAB){var r=_i(t),o=function(e){var t=ot(e);return Ie(e,r)||A(jd,t)},i=t.selection.getRng(),a=Re.fromDom(e.shiftKey?i.startContainer:i.endContainer);gn(a,o).each((function(r){e.preventDefault(),vn(r,o).each(n.clear),t.selection.collapse(e.shiftKey),(e.shiftKey?Hd:Ld)(t,o,r).each((function(e){t.selection.setRng(e)}))}))}}(t,e,o)})),e.on("remove",(function(){r.destroy()})),function(e,t,n,r){return{insertTable:Rl(e),setClipboardRows:Nl(t.setRows),getClipboardRows:Ml(t.getRows),setClipboardCols:Nl(t.setColumns),getClipboardCols:Ml(t.getColumns),resizeHandler:n,selectionTargets:r}}(e,a,r,n)};zr.add("table",ag)}(),function(){"use strict";var e,t=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=(e="string",function(t){return r=typeof(n=t),(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)===e;var n,r}),r=function(e){return function(t){return typeof t===e}}("function"),o=function(){},i=function(e){return function(){return e}},a=function(e){return e};var u,c,s=i(!1),l=i(!0),f=tinymce.util.Tools.resolve("tinymce.util.Tools"),d=tinymce.util.Tools.resolve("tinymce.util.XHR"),m=function(e){return e.getParam("template_mdate_classes","mdate")},g=function(e){return e.getParam("template_replace_values")},p=function(e){return e.getParam("template_mdate_format",e.translate("%Y-%m-%d"))},h=function(e,t){if((e=""+e).length<t)for(var n=0;n<t-e.length;n++)e="0"+e;return e},v=function(e,t,n){void 0===n&&(n=new Date);var r="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),o="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),i="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),a="January February March April May June July August September October November December".split(" ");return t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace("%D","%m/%d/%Y")).replace("%r","%I:%M:%S %p")).replace("%Y",""+n.getFullYear())).replace("%y",""+n.getYear())).replace("%m",h(n.getMonth()+1,2))).replace("%d",h(n.getDate(),2))).replace("%H",""+h(n.getHours(),2))).replace("%M",""+h(n.getMinutes(),2))).replace("%S",""+h(n.getSeconds(),2))).replace("%I",""+((n.getHours()+11)%12+1))).replace("%p",n.getHours()<12?"AM":"PM")).replace("%B",""+e.translate(a[n.getMonth()]))).replace("%b",""+e.translate(i[n.getMonth()]))).replace("%A",""+e.translate(o[n.getDay()]))).replace("%a",""+e.translate(r[n.getDay()]))).replace("%%","%")},b=function(e,t){return f.each(t,(function(t,n){r(t)&&(t=t(n)),e=e.replace(new RegExp("\\{\\$"+n+"\\}","g"),t)})),e},y=function(e,t){var n=e.dom,o=g(e);f.each(n.select("*",t),(function(e){f.each(o,(function(t,o){n.hasClass(e,o)&&r(t)&&t(e)}))}))},w=function(e,t){return new RegExp("\\b"+t+"\\b","g").test(e.className)},x=function(e,t,n){var r=e.dom,o=e.selection.getContent();n=b(n,g(e));var i=r.create("div",null,n),a=r.select(".mceTmpl",i);a&&a.length>0&&(i=r.create("div",null)).appendChild(a[0].cloneNode(!0)),f.each(r.select("*",i),(function(t){w(t,function(e){return e.getParam("template_cdate_classes","cdate")}(e).replace(/\s+/g,"|"))&&(t.innerHTML=v(e,function(e){return e.getParam("template_cdate_format",e.translate("%Y-%m-%d"))}(e))),w(t,m(e).replace(/\s+/g,"|"))&&(t.innerHTML=v(e,p(e))),w(t,function(e){return e.getParam("template_selected_content_classes","selcontent")}(e).replace(/\s+/g,"|"))&&(t.innerHTML=o)})),y(e,i),e.execCommand("mceInsertContent",!1,i.innerHTML),e.addVisual()},C=function(){return S},S={fold:function(e,t){return e()},isSome:s,isNone:l,getOr:c=a,getOrThunk:u=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(void 0),or:c,orThunk:u,map:C,each:o,bind:C,exists:s,forall:l,filter:function(){return C()},toArray:function(){return[]},toString:i("none()")},k=function(e){var t=i(e),n=function(){return o},r=function(t){return t(e)},o={fold:function(t,n){return n(e)},isSome:l,isNone:s,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:n,orThunk:n,map:function(t){return k(t(e))},each:function(t){t(e)},bind:r,exists:r,forall:r,filter:function(t){return t(e)?o:S},toArray:function(){return[e]},toString:function(){return"some("+e+")"}};return o},T={some:k,none:C,from:function(e){return null==e?S:k(e)}},O=function(e,t){return function(e,t,n){for(var r=0,o=e.length;r<o;r++){var i=e[r];if(t(i,r))return T.some(i);if(n(i,r))break}return T.none()}(e,t,s)},_=tinymce.util.Tools.resolve("tinymce.Env"),E=tinymce.util.Tools.resolve("tinymce.util.Promise"),A=Object.hasOwnProperty,D=function(e,t){return A.call(e,t)},M={'"':"&quot;","<":"&lt;",">":"&gt;","&":"&amp;","'":"&#039;"},N=function(e){return e.replace(/["'<>&]/g,(function(e){return(t=M,n=e,D(t,n)?T.from(t[n]):T.none()).getOr(e);var t,n}))},R=function(e,t){var n=function(e){return function(e,t){for(var n=e.length,r=new Array(n),o=0;o<n;o++){var i=e[o];r[o]=t(i,o)}return r}(e,(function(e){return{text:e.text,value:e.text}}))},r=function(e,t){return O(e,(function(e){return e.text===t}))},o=function(t){e.windowManager.alert("Could not load the specified template.",(function(){return t.focus("template")}))},i=function(e){return new E((function(t,n){e.value.url.fold((function(){return t(e.value.content.getOr(""))}),(function(e){return d.send({url:e,success:function(e){t(e)},error:function(e){n(e)}})}))}))},a=function(e,t){return function(n,a){if("template"===a.name){var u=n.getData().template;r(e,u).each((function(e){n.block("Loading..."),i(e).then((function(r){t(n,e,r)})).catch((function(){t(n,e,""),n.disable("save"),o(n)}))}))}}},u=function(t){return function(n){var a=n.getData();r(t,a.template).each((function(t){i(t).then((function(t){e.execCommand("mceInsertTemplate",!1,t),n.close()})).catch((function(){n.disable("save"),o(n)}))}))}};(function(){if(!t||0===t.length){var n=e.translate("No templates defined.");return e.notificationManager.open({text:n,type:"info"}),T.none()}return T.from(f.map(t,(function(e,t){var n=function(e){return void 0!==e.url};return{selected:0===t,text:e.title,value:{url:n(e)?T.from(e.url):T.none(),content:n(e)?T.none():T.from(e.content),description:e.description}}})))})().each((function(t){var r=n(t),c=function(e,n){return{title:"Insert Template",size:"large",body:{type:"panel",items:e},initialData:n,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:u(t),onChange:a(t,s)}},s=function(t,n,o){var i=function(e,t){if(-1===t.indexOf("<html>")){var n="",r=function(e){return e.getParam("content_style","","string")}(e),o=function(e){return e.getParam("content_css_cors",!1,"boolean")}(e)?' crossorigin="anonymous"':"";f.each(e.contentCSS,(function(t){n+='<link type="text/css" rel="stylesheet" href="'+e.documentBaseURI.toAbsolute(t)+'"'+o+">"})),r&&(n+='<style type="text/css">'+r+"</style>");var i=function(e){var t=e.getParam("body_class","","string");return-1===t.indexOf("=")?t:function(e){return e.getParam("body_class","","hash")[e.id]||""}(e)}(e),a=e.dom.encode,u='<script>document.addEventListener && document.addEventListener("click", function(e) {for (var elm = e.target; elm; elm = elm.parentNode) {if (elm.nodeName === "A" && !('+(_.mac?"e.metaKey":"e.ctrlKey && !e.altKey")+")) {e.preventDefault();}}}, false);<\/script> ",c=e.getBody().dir,s=c?' dir="'+a(c)+'"':"";t='<!DOCTYPE html><html><head><base href="'+a(e.documentBaseURI.getURI())+'">'+n+u+'</head><body class="'+a(i)+'"'+s+">"+t+"</body></html>"}return b(t,function(e){return e.getParam("template_preview_replace_values")}(e))}(e,o),a=[{type:"selectbox",name:"template",label:"Templates",items:r},{type:"htmlpanel",html:'<p aria-live="polite">'+N(n.value.description)+"</p>"},{label:"Preview",type:"iframe",name:"preview",sandboxed:!1}],u={template:n.text,preview:i};t.unblock(),t.redial(c(a,u)),t.focus("template")},l=e.windowManager.open(c([],{template:"",preview:""}));l.block("Loading..."),i(t[0]).then((function(e){s(l,t[0],e)})).catch((function(){s(l,t[0],""),l.disable("save"),o(l)}))}))},z=function(e){e.addCommand("mceInsertTemplate",function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=t.concat(n);return e.apply(null,o)}}(x,e)),e.addCommand("mceTemplate",function(e,t){return function(){var o=function(e){return e.getParam("templates")}(e);r(o)?o(t):n(o)?d.send({url:o,success:function(e){t(JSON.parse(e))}}):t(o)}}(e,function(e){return function(t){R(e,t)}}(e)))};t.add("template",(function(e){!function(e){var t=function(){return e.execCommand("mceTemplate")};e.ui.registry.addButton("template",{icon:"template",tooltip:"Insert template",onAction:t}),e.ui.registry.addMenuItem("template",{icon:"template",text:"Insert template...",onAction:t})}(e),z(e),function(e){e.on("PreProcess",(function(t){var n=e.dom,r=p(e);f.each(n.select("div",t.node),(function(t){n.hasClass(t,"mceTmpl")&&(f.each(n.select("*",t),(function(t){n.hasClass(t,m(e).replace(/\s+/g,"|"))&&(t.innerHTML=v(e,r))})),y(e,t))}))}))}(e)}))}(),function(){"use strict";tinymce.util.Tools.resolve("tinymce.PluginManager").add("textcolor",(function(){}))}(),function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=function(){return t=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},t.apply(this,arguments)};function n(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}var r,o,i=function(e){return function(t){return r=typeof(n=t),(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)===e;var n,r}},a=i("string"),u=i("object"),c=i("array"),s=function(){},l=function(e){return function(){return e}},f=function(e){return e},d=l(!1),m=l(!0),g=function(){return p},p={fold:function(e,t){return e()},isSome:d,isNone:m,getOr:o=f,getOrThunk:r=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:l(null),getOrUndefined:l(void 0),or:o,orThunk:r,map:g,each:s,bind:g,exists:d,forall:m,filter:function(){return g()},toArray:function(){return[]},toString:l("none()")},h=function(e){var t=l(e),n=function(){return o},r=function(t){return t(e)},o={fold:function(t,n){return n(e)},isSome:m,isNone:d,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:n,orThunk:n,map:function(t){return h(t(e))},each:function(t){t(e)},bind:r,exists:r,forall:r,filter:function(t){return t(e)?o:p},toArray:function(){return[e]},toString:function(){return"some("+e+")"}};return o},v={some:h,none:g,from:function(e){return null==e?p:h(e)}},b=Array.prototype.slice,y=Array.prototype.indexOf,w=function(e,t){return n=e,r=t,y.call(n,r)>-1;var n,r},x=function(e,t){for(var n=e.length,r=new Array(n),o=0;o<n;o++){var i=e[o];r[o]=t(i,o)}return r},C=function(e,t){for(var n=0,r=e.length;n<r;n++){t(e[n],n)}},S=function(e,t){for(var n=[],r=0,o=e.length;r<o;r++){var i=e[r];t(i,r)&&n.push(i)}return n},k=function(e,t,n){return function(e,t){for(var n=e.length-1;n>=0;n--)t(e[n],n)}(e,(function(e,r){n=t(n,e,r)})),n},T=function(e,t){return function(e,t,n){for(var r=0,o=e.length;r<o;r++){var i=e[r];if(t(i,r))return v.some(i);if(n(i,r))break}return v.none()}(e,t,d)},O=function(e,t){for(var n=0,r=e.length;n<r;++n){if(!0!==t(e[n],n))return!1}return!0},_=function(e){return function(e,t){return t>=0&&t<e.length?v.some(e[t]):v.none()}(e,0)},E=Object.keys,A=Object.hasOwnProperty,D=function(e){if(!c(e))throw new Error("cases must be an array");if(0===e.length)throw new Error("there must be at least one case");var t=[],n={};return C(e,(function(r,o){var i=E(r);if(1!==i.length)throw new Error("one and only one name per case");var a=i[0],u=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(!c(u))throw new Error("case arguments must be an array");t.push(a),n[a]=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=n.length;if(i!==u.length)throw new Error("Wrong number of arguments to case "+a+". Expected "+u.length+" ("+u+"), got "+i);var c=function(e){var r=E(e);if(t.length!==r.length)throw new Error("Wrong number of arguments to match. Expected: "+t.join(",")+"\nActual: "+r.join(","));if(!O(t,(function(e){return w(r,e)})))throw new Error("Not all branches were specified when using match. Specified: "+r.join(", ")+"\nRequired: "+t.join(", "));return e[a].apply(null,n)};return{fold:function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];if(t.length!==e.length)throw new Error("Wrong number of arguments to fold. Expected "+e.length+", got "+t.length);var i=t[o];return i.apply(null,n)},match:c,log:function(e){console.log(e,{constructors:t,constructor:a,params:n})}}}})),n};D([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);var M=function(e){var t=[],n=[];return C(e,(function(e){e.fold((function(e){t.push(e)}),(function(e){n.push(e)}))})),{errors:t,values:n}},N=function(e){return{isValue:m,isError:d,getOr:l(e),getOrThunk:l(e),getOrDie:l(e),or:function(t){return N(e)},orThunk:function(t){return N(e)},fold:function(t,n){return n(e)},map:function(t){return N(t(e))},mapError:function(t){return N(e)},each:function(t){t(e)},bind:function(t){return t(e)},exists:function(t){return t(e)},forall:function(t){return t(e)},toOptional:function(){return v.some(e)}}},R=function(e){return{isValue:d,isError:m,getOr:f,getOrThunk:function(e){return e()},getOrDie:function(){return(t=String(e),function(){throw new Error(t)})();var t},or:f,orThunk:function(e){return e()},fold:function(t,n){return t(e)},map:function(t){return R(e)},mapError:function(t){return R(t(e))},each:s,bind:function(t){return R(e)},exists:d,forall:m,toOptional:v.none}},z={value:N,error:R,fromOption:function(e,t){return e.fold((function(){return R(t)}),N)}},B=function(e){return"inline-command"===e.type||"inline-format"===e.type},P=function(e){return"block-command"===e.type||"block-format"===e.type},I=function(e){return t=e,n=function(e,t){return e.start.length===t.start.length?0:e.start.length>t.start.length?-1:1},(r=b.call(t,0)).sort(n),r;var t,n,r},F=function(e){var t=function(t){return z.error({message:t,pattern:e})},n=function(n,r,o){if(void 0!==e.format){var i=void 0;if(c(e.format)){if(!O(e.format,a))return t(n+" pattern has non-string items in the `format` array");i=e.format}else{if(!a(e.format))return t(n+" pattern has non-string `format` parameter");i=[e.format]}return z.value(r(i))}return void 0!==e.cmd?a(e.cmd)?z.value(o(e.cmd,e.value)):t(n+" pattern has non-string `cmd` parameter"):t(n+" pattern is missing both `format` and `cmd` parameters")};if(!u(e))return t("Raw pattern is not an object");if(!a(e.start))return t("Raw pattern is missing `start` parameter");if(void 0!==e.end){if(!a(e.end))return t("Inline pattern has non-string `end` parameter");if(0===e.start.length&&0===e.end.length)return t("Inline pattern has empty `start` and `end` parameters");var r=e.start,o=e.end;return 0===o.length&&(o=r,r=""),n("Inline",(function(e){return{type:"inline-format",start:r,end:o,format:e}}),(function(e,t){return{type:"inline-command",start:r,end:o,cmd:e,value:t}}))}return void 0!==e.replacement?a(e.replacement)?0===e.start.length?t("Replacement pattern has empty `start` parameter"):z.value({type:"inline-command",start:"",end:e.start,cmd:"mceInsertContent",value:e.replacement}):t("Replacement pattern has non-string `replacement` parameter"):0===e.start.length?t("Block pattern has empty `start` parameter"):n("Block",(function(t){return{type:"block-format",start:e.start,format:t[0]}}),(function(t,n){return{type:"block-command",start:e.start,cmd:t,value:n}}))},L=function(e){return"block-command"===e.type?{start:e.start,cmd:e.cmd,value:e.value}:"block-format"===e.type?{start:e.start,format:e.format}:"inline-command"===e.type?"mceInsertContent"===e.cmd&&""===e.start?{start:e.end,replacement:e.value}:{start:e.start,end:e.end,cmd:e.cmd,value:e.value}:"inline-format"===e.type?{start:e.start,end:e.end,format:1===e.format.length?e.format[0]:e.format}:void 0},H=function(e){return{inlinePatterns:S(e,B),blockPatterns:I(S(e,P))}},V="undefined"!=typeof window?window:Function("return this;")(),j=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=V.console;n&&(n.error?n.error.apply(n,e):n.log.apply(n,e))},U=[{start:"*",end:"*",format:"italic"},{start:"**",end:"**",format:"bold"},{start:"#",format:"h1"},{start:"##",format:"h2"},{start:"###",format:"h3"},{start:"####",format:"h4"},{start:"#####",format:"h5"},{start:"######",format:"h6"},{start:"1. ",cmd:"InsertOrderedList"},{start:"* ",cmd:"InsertUnorderedList"},{start:"- ",cmd:"InsertUnorderedList"}],W=function(e){var t=e.getParam("forced_root_block","p");return!1===t?"":!0===t?"p":t},$=tinymce.util.Tools.resolve("tinymce.util.Delay"),q=tinymce.util.Tools.resolve("tinymce.util.VK"),G=tinymce.util.Tools.resolve("tinymce.util.Tools"),K=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),X=tinymce.util.Tools.resolve("tinymce.dom.TextSeeker"),Y=function(e,t){return{container:e,offset:t}},J=function(e){return e.nodeType===Node.TEXT_NODE},Z=function(e,t,n){if(t&&e.isEmpty(t)&&!n(t)){var r=t.parentNode;e.remove(t),Z(e,r,n)}},Q=function(e,t,n,r){void 0===r&&(r=!0);var o=t.startContainer.parentNode,i=t.endContainer.parentNode;t.deleteContents(),r&&!n(t.startContainer)&&(J(t.startContainer)&&0===t.startContainer.data.length&&e.remove(t.startContainer),J(t.endContainer)&&0===t.endContainer.data.length&&e.remove(t.endContainer),Z(e,o,n),o!==i&&Z(e,i,n))},ee=function(e,t){var n=t.get(e);return c(n)&&_(n).exists((function(e){return t=e,n="block",A.call(t,n);var t,n}))},te=function(e){return 0===e.start.length},ne=function(e,t){var n=v.from(e.dom.getParent(t.startContainer,e.dom.isBlock));return""===W(e)?n.orThunk((function(){return v.some(e.getBody())})):n},re=K.DOM,oe=function(e){return function(t){return e===t?-1:0}},ie=function(e,t,n){if(J(e)&&t>=0)return v.some(Y(e,t));var r=X(re);return v.from(r.backwards(e,t,oe(e),n)).map((function(e){return Y(e.container,e.container.data.length)}))},ae=function(e,t,n){if(!J(e))return v.none();var r=e.textContent;if(t>=0&&t<=r.length)return v.some(Y(e,t));var o=X(re);return v.from(o.backwards(e,t,oe(e),n)).bind((function(e){var r=e.container.data;return ae(e.container,t+r.length,n)}))},ue=function(e,t,n){if(!J(e))return v.none();var r=e.textContent;if(t<=r.length)return v.some(Y(e,t));var o=X(re);return v.from(o.forwards(e,t,oe(e),n)).bind((function(e){return ue(e.container,t-r.length,n)}))},ce=function(e,t,n,r,o){var i=X(e,function(e){return function(t){return e.isBlock(t)||w(["BR","IMG","HR","INPUT"],t.nodeName)||"false"===e.getContentEditable(t)}}(e));return v.from(i.backwards(t,n,r,o))},se=function(e,t,n){if(J(t)&&(n<0||n>t.data.length))return[];for(var r=[n],o=t;o!==e&&o.parentNode;){for(var i=o.parentNode,a=0;a<i.childNodes.length;a++)if(i.childNodes[a]===o){r.push(a);break}o=i}return o===e?r.reverse():[]},le=function(e,t,n,r,o){return{start:se(e,t,n),end:se(e,r,o)}},fe=function(e,t){var n,r,o,i=t.slice(),a=i.pop();return(n=i,r=function(e,t){return e.bind((function(e){return v.from(e.childNodes[t])}))},o=v.some(e),C(n,(function(e,t){o=r(o,e,t)})),o).bind((function(e){return J(e)&&(a<0||a>e.data.length)?v.none():v.some({node:e,offset:a})}))},de=function(e,t){return fe(e,t.start).bind((function(n){var r=n.node,o=n.offset;return fe(e,t.end).map((function(e){var t=e.node,n=e.offset,i=document.createRange();return i.setStart(r,o),i.setEnd(t,n),i}))}))},me=function(e,t,n){(function(e,t,n){if(J(e)&&t>=e.length)return v.some(Y(e,t));var r=X(re);return v.from(r.forwards(e,t,oe(e),n)).map((function(e){return Y(e.container,0)}))})(t,0,t).each((function(r){var o=r.container;ue(o,n.start.length,t).each((function(n){var r=e.createRng();r.setStart(o,0),r.setEnd(n.container,n.offset),Q(e,r,(function(e){return e===t}))}))}))},ge=function(e,t){var n=e.dom,r=e.selection.getRng();return ne(e,r).filter((function(t){var r=W(e),o=""===r&&n.is(t,"body")||n.is(t,r);return null!==t&&o})).bind((function(e){var r=e.textContent,o=function(e,t){var n=t.replace(" "," ");return T(e,(function(e){return 0===t.indexOf(e.start)||0===n.indexOf(e.start)}))}(t,r);return o.map((function(t){return G.trim(r).length===t.start.length?[]:[{pattern:t,range:le(n.getRoot(),e,0,e,0)}]}))})).getOr([])},pe=function(e,t){if(0!==t.length){var n=e.selection.getBookmark();C(t,(function(t){return function(e,t){var n=e.dom,r=t.pattern,o=de(n.getRoot(),t.range).getOrDie("Unable to resolve path range");return ne(e,o).each((function(t){"block-format"===r.type?ee(r.format,e.formatter)&&e.undoManager.transact((function(){me(e.dom,t,r),e.formatter.apply(r.format)})):"block-command"===r.type&&e.undoManager.transact((function(){me(e.dom,t,r),e.execCommand(r.cmd,!1,r.value)}))})),!0}(e,t)})),e.selection.moveToBookmark(n)}},he=0,ve=function(e,t){return e.create("span",{"data-mce-type":"bookmark",id:t})},be=function(e,t){var n=e.createRng();return n.setStartAfter(t.start),n.setEndBefore(t.end),n},ye=function(e,t,n){var r=de(e.getRoot(),n).getOrDie("Unable to resolve path range"),o=r.startContainer,i=r.endContainer,a=0===r.endOffset?i:i.splitText(r.endOffset),u=0===r.startOffset?o:o.splitText(r.startOffset);return{prefix:t,end:a.parentNode.insertBefore(ve(e,t+"-end"),a),start:u.parentNode.insertBefore(ve(e,t+"-start"),u)}},we=function(e,t,n){Z(e,e.get(t.prefix+"-end"),n),Z(e,e.get(t.prefix+"-start"),n)},xe=function(e,t,n,r){var o,i=t.start;return ce(e,r.container,r.offset,(o=i,function(e,t){var n=e.data.substring(0,t),r=n.lastIndexOf(o.charAt(o.length-1)),i=n.lastIndexOf(o);return-1!==i?i+o.length:-1!==r?r+1:-1}),n).bind((function(r){if(r.offset>=i.length){var o=e.createRng();return o.setStart(r.container,r.offset-i.length),o.setEnd(r.container,r.offset),v.some(o)}var a=r.offset-i.length;return ae(r.container,a,n).map((function(t){var n=e.createRng();return n.setStart(t.container,t.offset),n.setEnd(r.container,r.offset),n})).filter((function(e){return e.toString()===i})).orThunk((function(){return xe(e,t,n,Y(r.container,0))}))}))},Ce=function(e,t,n){var r=e.dom,o=r.getRoot(),i=n.pattern,a=n.position.container,u=n.position.offset;return ae(a,u-n.pattern.end.length,t).bind((function(c){var s=le(o,c.container,c.offset,a,u);if(te(i))return v.some({matches:[{pattern:i,startRng:s,endRng:s}],position:c});var l=Se(e,n.remainingPatterns,c.container,c.offset,t),f=l.getOr({matches:[],position:c}),d=f.position,m=function(e,t,n,r,o,i){if(void 0===i&&(i=!1),0===t.start.length&&!i){var a=e.createRng();return a.setStart(n,r),a.setEnd(n,r),v.some(a)}return ie(n,r,o).bind((function(n){return xe(e,t,o,n).bind((function(e){if(i){if(e.endContainer===n.container&&e.endOffset===n.offset)return v.none();if(0===n.offset&&e.endContainer.textContent.length===e.endOffset)return v.none()}return v.some(e)}))}))}(r,i,d.container,d.offset,t,l.isNone());return m.map((function(e){var t=function(e,t){return le(e,t.startContainer,t.startOffset,t.endContainer,t.endOffset)}(o,e);return{matches:f.matches.concat([{pattern:i,startRng:t,endRng:s}]),position:Y(e.startContainer,e.startOffset)}}))}))},Se=function(e,t,n,r,o){var i=e.dom;return ie(n,r,i.getRoot()).bind((function(a){var u=i.createRng();u.setStart(o,0),u.setEnd(n,r);for(var c,s,l=u.toString(),f=0;f<t.length;f++){var d=t[f];if(c=l,s=d.end,function(e,t,n){return""===t||e.length>=t.length&&e.substr(n,n+t.length)===t}(c,s,c.length-s.length)){var m=t.slice();m.splice(f,1);var g=Ce(e,o,{pattern:d,remainingPatterns:m,position:a});if(g.isSome())return g}}return v.none()}))},ke=function(e,t,n){e.selection.setRng(n),"inline-format"===t.type?C(t.format,(function(t){e.formatter.apply(t)})):e.execCommand(t.cmd,!1,t.value)},Te=function(e,n){var r,o,i=(r="mce_textpattern",o=(new Date).getTime(),r+"_"+Math.floor(1e9*Math.random())+ ++he+String(o)),a=k(n,(function(n,r){var o=ye(e,i+"_end"+n.length,r.endRng);return n.concat([t(t({},r),{endMarker:o})])}),[]);return k(a,(function(n,r){var o=a.length-n.length-1,u=te(r.pattern)?r.endMarker:ye(e,i+"_start"+o,r.startRng);return n.concat([t(t({},r),{startMarker:u})])}),[])},Oe=function(e,t,n){var r=e.selection.getRng();return!1===r.collapsed?[]:ne(e,r).bind((function(o){var i=r.startOffset-(n?1:0);return Se(e,t,r.startContainer,i,o)})).fold((function(){return[]}),(function(e){return e.matches}))},_e=function(e,t){if(0!==t.length){var n=e.dom,r=e.selection.getBookmark(),o=Te(n,t);C(o,(function(t){var r=n.getParent(t.startMarker.start,n.isBlock),o=function(e){return e===r};te(t.pattern)?function(e,t,n,r){var o=be(e.dom,n);Q(e.dom,o,r),ke(e,t,o)}(e,t.pattern,t.endMarker,o):function(e,t,n,r,o){var i=e.dom,a=be(i,r),u=be(i,n);Q(i,u,o),Q(i,a,o);var c={prefix:n.prefix,start:n.end,end:r.start},s=be(i,c);ke(e,t,s)}(e,t.pattern,t.startMarker,t.endMarker,o),we(n,t.endMarker,o),we(n,t.startMarker,o)})),e.selection.moveToBookmark(r)}},Ee=function(e,t){var n=Oe(e,t.inlinePatterns,!0);n.length>0&&e.undoManager.transact((function(){_e(e,n)}))},Ae=function(e,t,n){for(var r=0;r<e.length;r++)if(n(e[r],t))return!0;return!1},De=function(e,t){var n=[",",".",";",":","!","?"],r=[32];e.on("keydown",(function(n){13!==n.keyCode||q.modifierPressed(n)||function(e,t){if(!e.selection.isCollapsed())return!1;var n=Oe(e,t.inlinePatterns,!1),r=ge(e,t.blockPatterns);return(r.length>0||n.length>0)&&(e.undoManager.add(),e.undoManager.extra((function(){e.execCommand("mceInsertNewLine")}),(function(){e.insertContent("\ufeff"),_e(e,n),pe(e,r);var t=e.selection.getRng(),o=ie(t.startContainer,t.startOffset,e.dom.getRoot());e.execCommand("mceInsertNewLine"),o.each((function(t){var n=t.container;"\ufeff"===n.data.charAt(t.offset-1)&&(n.deleteData(t.offset-1,1),Z(e.dom,n.parentNode,(function(t){return t===e.dom.getRoot()})))}))})),!0)}(e,t.get())&&n.preventDefault()}),!0),e.on("keyup",(function(n){Ae(r,n,(function(e,t){return e===t.keyCode&&!1===q.modifierPressed(t)}))&&Ee(e,t.get())})),e.on("keypress",(function(r){Ae(n,r,(function(e,t){return e.charCodeAt(0)===t.charCode}))&&$.setEditorTimeout(e,(function(){Ee(e,t.get())}))}))};e.add("textpattern",(function(e){var t=function(e){var t=e;return{get:function(){return t},set:function(e){t=e}}}(function(e){var t=e.getParam("textpattern_patterns",U,"array");if(!c(t))return j("The setting textpattern_patterns should be an array"),{inlinePatterns:[],blockPatterns:[]};var n=M(x(t,F));return C(n.errors,(function(e){return j(e.message,e.pattern)})),H(n.values)}(e));return De(e,t),function(e){return{setPatterns:function(t){var n=M(x(t,F));if(n.errors.length>0){var r=n.errors[0];throw new Error(r.message+":\n"+JSON.stringify(r.pattern,null,2))}e.set(H(n.values))},getPatterns:function(){return n(n([],x(e.get().inlinePatterns,L),!0),x(e.get().blockPatterns,L),!0)}}}(t)}))}(),function(){"use strict";var e,t,n=tinymce.util.Tools.resolve("tinymce.PluginManager"),r=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),o=tinymce.util.Tools.resolve("tinymce.util.I18n"),i=tinymce.util.Tools.resolve("tinymce.util.Tools"),a=function(e){return e.getParam("toc_class","mce-toc")},u=function(e){var t=e.getParam("toc_header","h2");return/^h[1-6]$/.test(t)?t:"h2"},c=(e="mcetoc_",t=0,function(){var n=(new Date).getTime().toString(32);return e+n+(t++).toString(32)}),s=function(e){var t=a(e),n=u(e),r=function(e){var t,n=[];for(t=1;t<=e;t++)n.push("h"+t);return n.join(",")}(function(e){var t=parseInt(e.getParam("toc_depth","3"),10);return t>=1&&t<=9?t:3}(e)),o=e.$(r);return o.length&&/^h[1-9]$/i.test(n)&&(o=o.filter((function(n,r){return!e.dom.hasClass(r.parentNode,t)}))),i.map(o,(function(t){var n=t.id;return{id:n||c(),level:parseInt(t.nodeName.replace(/^H/i,""),10),title:e.$.text(t),element:t}}))},l=function(e){var t,n,i,a="",c=s(e),l=function(e){for(var t=9,n=0;n<e.length;n++)if(e[n].level<t&&(t=e[n].level),1===t)return t;return t}(c)-1;if(!c.length)return"";a+=(t=u(e),n=o.translate("Table of Contents"),i="</"+t+">","<"+t+' contenteditable="true">'+r.DOM.encode(n)+i);for(var f=0;f<c.length;f++){var d=c[f];d.element.id=d.id;var m=c[f+1]&&c[f+1].level;if(l===d.level)a+="<li>";else for(var g=l;g<d.level;g++)a+="<ul><li>";if(a+='<a href="#'+d.id+'">'+d.title+"</a>",m!==d.level&&m)for(g=d.level;g>m;g--)a+="</li></ul><li>";else a+="</li>",m||(a+="</ul>");l=d.level}return a},f=function(e){var t=a(e),n=e.$("."+t);!function(e,t){return!t.length||e.dom.getParents(t[0],".mce-offscreen-selection").length>0}(e,n)?d(e):e.insertContent(function(e){var t=l(e);return'<div class="'+e.dom.encode(a(e))+'" contenteditable="false">'+t+"</div>"}(e))},d=function(e){var t=a(e),n=e.$("."+t);n.length&&e.undoManager.transact((function(){n.html(l(e))}))},m=function(e){return function(t){var n=function(){return t.setDisabled(e.mode.isReadOnly()||!function(e){return s(e).length>0}(e))};return n(),e.on("LoadContent SetContent change",n),function(){return e.on("LoadContent SetContent change",n)}}},g=function(e){return function(t){return t&&e.dom.is(t,"."+a(e))&&e.getBody().contains(t)}};n.add("toc",(function(e){!function(e){e.addCommand("mceInsertToc",(function(){f(e)})),e.addCommand("mceUpdateToc",(function(){d(e)}))}(e),function(e){var t=function(){return e.execCommand("mceInsertToc")};e.ui.registry.addButton("toc",{icon:"toc",tooltip:"Table of contents",onAction:t,onSetup:m(e)}),e.ui.registry.addButton("tocupdate",{icon:"reload",tooltip:"Update",onAction:function(){return e.execCommand("mceUpdateToc")}}),e.ui.registry.addMenuItem("toc",{icon:"toc",text:"Table of contents",onAction:t,onSetup:m(e)}),e.ui.registry.addContextToolbar("toc",{items:"tocupdate",predicate:g(e),scope:"node",position:"node"})}(e),function(e){var t=e.$,n=a(e);e.on("PreProcess",(function(e){var r=t("."+n,e.node);r.length&&(r.removeAttr("contentEditable"),r.find("[contenteditable]").removeAttr("contentEditable"))})),e.on("SetContent",(function(){var e=t("."+n);e.length&&(e.attr("contentEditable",!1),e.children(":first-child").attr("contentEditable",!0))}))}(e)}))}(),function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=function(e,t,n){e.dom.toggleClass(e.getBody(),"mce-visualblocks"),n.set(!n.get()),function(e,t){e.fire("VisualBlocks",{state:t})}(e,n.get())},n=function(e,t){return function(n){n.setActive(t.get());var r=function(e){return n.setActive(e.state)};return e.on("VisualBlocks",r),function(){return e.off("VisualBlocks",r)}}};e.add("visualblocks",(function(e,r){var o,i=(o=!1,{get:function(){return o},set:function(e){o=e}});!function(e,n,r){e.addCommand("mceVisualBlocks",(function(){t(e,0,r)}))}(e,0,i),function(e,t){var r=function(){return e.execCommand("mceVisualBlocks")};e.ui.registry.addToggleButton("visualblocks",{icon:"visualblocks",tooltip:"Show blocks",onAction:r,onSetup:n(e,t)}),e.ui.registry.addToggleMenuItem("visualblocks",{text:"Show blocks",icon:"visualblocks",onAction:r,onSetup:n(e,t)})}(e,i),function(e,n,r){e.on("PreviewFormats AfterPreviewFormats",(function(t){r.get()&&e.dom.toggleClass(e.getBody(),"mce-visualblocks","afterpreviewformats"===t.type)})),e.on("init",(function(){(function(e){return e.getParam("visualblocks_default_state",!1,"boolean")})(e)&&t(e,0,r)}))}(e,0,i)}))}(),function(){"use strict";var e,t,n=tinymce.util.Tools.resolve("tinymce.PluginManager"),r=function(e){return function(t){return typeof t===e}},o=function(e){return function(t){return r=typeof(n=t),(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)===e;var n,r}}("string"),i=r("boolean"),a=r("number"),u=function(){},c=function(e){return function(){return e}},s=function(e){return e},l=c(!1),f=c(!0),d=function(){return m},m={fold:function(e,t){return e()},isSome:l,isNone:f,getOr:t=s,getOrThunk:e=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:c(null),getOrUndefined:c(void 0),or:t,orThunk:e,map:d,each:u,bind:d,exists:l,forall:f,filter:function(){return d()},toArray:function(){return[]},toString:c("none()")},g=function(e){var t=c(e),n=function(){return o},r=function(t){return t(e)},o={fold:function(t,n){return n(e)},isSome:f,isNone:l,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:n,orThunk:n,map:function(t){return g(t(e))},each:function(t){t(e)},bind:r,exists:r,forall:r,filter:function(t){return t(e)?o:m},toArray:function(){return[e]},toString:function(){return"some("+e+")"}};return o},p=function(e){return null==e?m:g(e)},h=function(e,t){for(var n=0,r=e.length;n<r;n++){t(e[n],n)}},v=Object.keys,b=function(e,t){for(var n=v(e),r=0,o=n.length;r<o;r++){var i=n[r];t(e[i],i)}};"undefined"!=typeof window?window:Function("return this;")();var y,w=function(e){return e.dom.nodeValue},x=(y=3,function(e){return function(e){return e.dom.nodeType}(e)===y}),C=function(e,t,n){!function(e,t,n){if(!(o(n)||i(n)||a(n)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",n,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,n+"")}(e.dom,t,n)},S=function(e,t){e.dom.removeAttribute(t)},k=function(e,t){var n=function(e,t){var n=e.dom.getAttribute(t);return null===n?void 0:n}(e,t);return void 0===n||""===n?[]:n.split(" ")},T=function(e){return void 0!==e.dom.classList},O=function(e,t){return function(e,t,n){var r=k(e,t).concat([n]);return C(e,t,r.join(" ")),!0}(e,"class",t)},_=function(e,t){return function(e,t,n){var r=function(e,t){for(var n=[],r=0,o=e.length;r<o;r++){var i=e[r];t(i,r)&&n.push(i)}return n}(k(e,t),(function(e){return e!==n}));return r.length>0?C(e,t,r.join(" ")):S(e,t),!1}(e,"class",t)},E=function(e){var t=T(e)?e.dom.classList:function(e){return k(e,"class")}(e);0===t.length&&S(e,"class")},A=function(e){if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}},D={fromHtml:function(e,t){var n=(t||document).createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return A(n.childNodes[0])},fromTag:function(e,t){var n=(t||document).createElement(e);return A(n)},fromText:function(e,t){var n=(t||document).createTextNode(e);return A(n)},fromDom:A,fromPoint:function(e,t,n){return p(e.dom.elementFromPoint(t,n)).map(A)}},M={" ":"nbsp","­":"shy"},N=function(e,t){var n="";return b(e,(function(e,t){n+=t})),new RegExp("["+n+"]",t?"g":"")},R=N(M),z=N(M,!0),B=function(e){var t="";return b(e,(function(e){t&&(t+=","),t+="span.mce-"+e})),t}(M),P="mce-nbsp",I=function(e){return'<span data-mce-bogus="1" class="mce-'+M[e]+'">'+e+"</span>"},F=function(e){var t=w(e);return x(e)&&void 0!==t&&R.test(t)},L=function(e,t){var n=[],r=function(e,t){for(var n=e.length,r=new Array(n),o=0;o<n;o++){var i=e[o];r[o]=t(i,o)}return r}(e.dom.childNodes,D.fromDom);return h(r,(function(e){t(e)&&(n=n.concat([e])),n=n.concat(L(e,t))})),n},H=function(e){return"span"===e.nodeName.toLowerCase()&&e.classList.contains("mce-nbsp-wrap")},V=function(e,t){var n=L(D.fromDom(t),F);h(n,(function(t){var n,r,o=t.dom.parentNode;if(H(o))n=D.fromDom(o),r=P,T(n)?n.dom.classList.add(r):O(n,r);else{for(var i=e.dom.encode(w(t)).replace(z,I),a=e.dom.create("div",null,i),u=void 0;u=a.lastChild;)e.dom.insertAfter(u,t.dom);e.dom.remove(t.dom)}}))},j=function(e,t){var n=e.dom.select(B,t);h(n,(function(t){var n,r;H(t)?(n=D.fromDom(t),r=P,T(n)?n.dom.classList.remove(r):_(n,r),E(n)):e.dom.remove(t,!0)}))},U=function(e){var t=e.getBody(),n=e.selection.getBookmark(),r=function(e,t){for(;e.parentNode;){if(e.parentNode===t)return e;e=e.parentNode}}(e.selection.getNode(),t);j(e,r=void 0!==r?r:t),V(e,r),e.selection.moveToBookmark(n)},W=function(e,t){!function(e,t){e.fire("VisualChars",{state:t})}(e,t.get());var n=e.getBody();!0===t.get()?V(e,n):j(e,n)},$=function(e,t){e.addCommand("mceVisualChars",(function(){!function(e,t){t.set(!t.get());var n=e.selection.getBookmark();W(e,t),e.selection.moveToBookmark(n)}(e,t)}))},q=tinymce.util.Tools.resolve("tinymce.util.Delay"),G=function(e,t){return function(n){n.setActive(t.get());var r=function(e){return n.setActive(e.state)};return e.on("VisualChars",r),function(){return e.off("VisualChars",r)}}};n.add("visualchars",(function(e){var t=function(e){var t=e;return{get:function(){return t},set:function(e){t=e}}}(function(e){return e.getParam("visualchars_default_state",!1)}(e));return $(e,t),function(e,t){var n=function(){return e.execCommand("mceVisualChars")};e.ui.registry.addToggleButton("visualchars",{tooltip:"Show invisible characters",icon:"visualchars",onAction:n,onSetup:G(e,t)}),e.ui.registry.addToggleMenuItem("visualchars",{text:"Show invisible characters",icon:"visualchars",onAction:n,onSetup:G(e,t)})}(e,t),function(e,t){var n=q.debounce((function(){U(e)}),300);(function(e){return!1!==e.getParam("forced_root_block")})(e)&&e.on("keydown",(function(r){!0===t.get()&&(13===r.keyCode?U(e):n())})),e.on("remove",n.stop)}(e,t),function(e,t){e.on("init",(function(){W(e,t)}))}(e,t),function(e){return{isEnabled:function(){return e.get()}}}(t)}))}(),function(){"use strict";var e,t=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=function(e){return e},r=function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o="[-'\\.‘’․﹒'.]",i="[:··״‧︓﹕:]",a="[±+*/,;;։،؍٬߸⁄︐︔﹐﹔,;]",u="[0-9٠-٩٫۰-۹߀-߉०-९০-৯੦-੯૦-૯୦-୯௦-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩၀-၉႐-႙០-៩᠐-᠙᥆-᥏᧐-᧙᪀-᪉᪐-᪙᭐-᭙᮰-᮹᱀-᱉᱐-᱙꘠-꘩꣐-꣙꤀-꤉꧐-꧙꩐-꩙꯰-꯹]",c="\\r",s="\\n",l="[\v\f…\u2028\u2029]",f="[̀-ͯ҃-҉֑-ׇֽֿׁׂׅׄؐ-ًؚ-ٰٟۖ-ۜ۟-۪ۤۧۨ-ܑۭܰ-݊ަ-ް߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ऀ-ःऺ-़ा-ॏ॑-ॗॢॣঁ-ঃ়া-ৄেৈো-্ৗৢৣਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑੰੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୢୣஂா-ூெ-ைொ-்ௗఁ-ఃా-ౄె-ైొ-్ౕౖౢౣಂಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣംഃാ-ൄെ-ൈൊ-്ൗൢൣංඃ්ා-ුූෘ-ෟෲෳัิ-ฺ็-๎ັິ-ູົຼ່-ໍ༹༘༙༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏႚ-ႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳា-៓៝᠋-᠍ᢩᤠ-ᤫᤰ-᤻ᦰ-ᧀᧈᧉᨗ-ᨛᩕ-ᩞ᩠-᩿᩼ᬀ-ᬄ᬴-᭄᭫-᭳ᮀ-ᮂᮡ-᯦᮪-᯳ᰤ-᰷᳐-᳔᳒-᳨᳭ᳲ᷀-ᷦ᷼-᷿‌‍⃐-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꙯-꙲꙼꙽꛰꛱ꠂ꠆ꠋꠣ-ꠧꢀꢁꢴ-꣄꣠-꣱ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀ꨩ-ꨶꩃꩌꩍꩻꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꯣ-ꯪ꯬꯭ﬞ︀-️︠-゙゚︦]",d="[­؀-؃۝܏឴឵‎‏‪-‮⁠-⁤-\ufeff-]",m="[〱-〵゛゜゠-ヺー-ヿㇰ-ㇿ㋐-㋾㌀-㍗ヲ-ン]",g="[=_‿⁀⁔︳︴﹍-﹏_∀-⋿<>]",p="[!-#%-*,-\\/:;?@\\[-\\]_{}¡«·»¿;·՚-՟։֊־׀׃׆׳״؉؊،؍؛؞؟٪-٭۔܀-܍߷-߹࠰-࠾࡞।॥॰෴๏๚๛༄-༒༺-༽྅࿐-࿔࿙࿚၊-၏჻፡-፨᐀᙭᙮᚛᚜᛫-᛭᜵᜶។-៖៘-៚᠀-᠊᥄᥅᨞᨟᪠-᪦᪨-᪭᭚-᭠᯼-᯿᰻-᰿᱾᱿᳓‐-‧‰-⁃⁅-⁑⁓-⁞⁽⁾₍₎〈〉❨-❵⟅⟆⟦-⟯⦃-⦘⧘-⧛⧼⧽⳹-⳼⳾⳿⵰⸀-⸮⸰⸱、-〃〈-】〔-〟〰〽゠・꓾꓿꘍-꘏꙳꙾꛲-꛷꡴-꡷꣎꣏꣸-꣺꤮꤯꥟꧁-꧍꧞꧟꩜-꩟꫞꫟꯫﴾﴿︐-︙︰-﹒﹔-﹡﹣﹨﹪﹫!-#%-*,-/:;?@[-]_{}⦅-・]",h=0,v=1,b=2,y=3,w=4,x=5,C=6,S=7,k=8,T=9,O=10,_=11,E=12,A=13,D=[new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-׳ؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆༀཀ-ཇཉ-ཬྈ-ྌႠ-Ⴥა-ჺჼᄀ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᨀ-ᨖᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᯀ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⒶ-ⓩⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⴀ-ⴥⴰ-ⵥⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々〻〼ㄅ-ㄭㄱ-ㆎㆠ-ㆺꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐꞑꞠ-ꞩꟺ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zᅠ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]"),new RegExp(o),new RegExp(i),new RegExp(a),new RegExp(u),new RegExp(c),new RegExp(s),new RegExp(l),new RegExp(f),new RegExp(d),new RegExp(m),new RegExp(g),new RegExp("@")],M=new RegExp("^"+p+"$"),N=D,R=A,z=function(e){for(var t=R,n=N.length,r=0;r<n;++r){var o=N[r];if(o&&o.test(e)){t=r;break}}return t},B=function(e){var t,n;return function(e,t){for(var n=e.length,r=new Array(n),o=0;o<n;o++){var i=e[o];r[o]=t(i,o)}return r}(e,(t=z,n={},function(e){if(n[e])return n[e];var r=t(e);return n[e]=r,r}))},P=function(e,t){var n=e[t],r=e[t+1];if(t<0||t>e.length-1&&0!==t)return!1;if(n===h&&r===h)return!1;var o=e[t+2];if(n===h&&(r===b||r===v||r===E)&&o===h)return!1;var i=e[t-1];return(n!==b&&n!==v&&r!==E||r!==h||i!==h)&&((n!==w&&n!==h||r!==w&&r!==h)&&((n!==y&&n!==v||r!==w||i!==w)&&((n!==w||r!==y&&r!==v||o!==w)&&(n!==k&&n!==T&&i!==k&&i!==T&&r!==k&&r!==T&&((n!==x||r!==C)&&(n===S||n===x||n===C||(r===S||r===x||r===C||(n!==O||r!==O)&&((r!==_||n!==h&&n!==w&&n!==O&&n!==_)&&((n!==_||r!==h&&r!==w&&r!==O)&&n!==E)))))))))},I=/^\s+$/,F=M,L=function(e){return"http"===e||"https"===e},H=function(e,t){var n=function(e,t){var n;for(n=t;n<e.length&&!I.test(e[n]);n++);return n}(e,t+1);return"://"===e.slice(t+1,n).join("").substr(0,3)?n:t},V=function(e,t,n){n=r(r({},{includeWhitespace:!1,includePunctuation:!1}),n);for(var o=[],i=[],a=0;a<e.length;a++){var u=t(e[a]);"\ufeff"!==u&&(o.push(e[a]),i.push(u))}return function(e,t,n,r){for(var o=[],i=[],a=0;a<n.length;++a)if(i.push(e[a]),P(n,a)){var u=t[a];if((r.includeWhitespace||!I.test(u))&&(r.includePunctuation||!F.test(u))){var c=a-i.length+1,s=a+1,l=t.slice(c,s).join("");if(L(l)){var f=H(t,a),d=e.slice(s,f);Array.prototype.push.apply(i,d),a=f}o.push(i)}i=[]}return o}(o,i,B(i),n)},j=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),U=function(e,t){for(var n=t.getBlockElements(),r=t.getShortEndedElements(),o=function(e){return n[e.nodeName]||r[e.nodeName]},i=[],a="",u=new j(e,e);e=u.next();)3===e.nodeType?a+=e.data.replace(/\uFEFF/g,""):o(e)&&a.length&&(i.push(a),a="");return a.length&&i.push(a),i},W=function(e){return e.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"_").length},$=function(e,t){var r=U(e,t).join("\n");return V(r.split(""),n).length},q=function(e,t){var n=U(e,t).join("");return W(n)},G=function(e,t){var n=U(e,t).join("").replace(/\s/g,"");return W(n)},K=function(e,t){return function(){return t(e.getBody(),e.schema)}},X=function(e,t){return function(){return t(e.selection.getRng().cloneContents(),e.schema)}},Y=function(e){return K(e,$)},J=function(e,t){e.addCommand("mceWordCount",(function(){return function(e,t){e.windowManager.open({title:"Word Count",body:{type:"panel",items:[{type:"table",header:["Count","Document","Selection"],cells:[["Words",String(t.body.getWordCount()),String(t.selection.getWordCount())],["Characters (no spaces)",String(t.body.getCharacterCountWithoutSpaces()),String(t.selection.getCharacterCountWithoutSpaces())],["Characters",String(t.body.getCharacterCount()),String(t.selection.getCharacterCount())]]}]},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}]})}(e,t)}))},Z=tinymce.util.Tools.resolve("tinymce.util.Delay"),Q=function(e,t){!function(e,t){e.fire("wordCountUpdate",{wordCount:{words:t.body.getWordCount(),characters:t.body.getCharacterCount(),charactersWithoutSpaces:t.body.getCharacterCountWithoutSpaces()}})}(e,t)};void 0===e&&(e=300),t.add("wordcount",(function(t){var n=function(e){return{body:{getWordCount:Y(e),getCharacterCount:K(e,q),getCharacterCountWithoutSpaces:K(e,G)},selection:{getWordCount:X(e,$),getCharacterCount:X(e,q),getCharacterCountWithoutSpaces:X(e,G)},getCount:Y(e)}}(t);return J(t,n),function(e){var t=function(){return e.execCommand("mceWordCount")};e.ui.registry.addButton("wordcount",{tooltip:"Word count",icon:"character-count",onAction:t}),e.ui.registry.addMenuItem("wordcount",{text:"Word count",icon:"character-count",onAction:t})}(t),function(e,t,n){var r=Z.debounce((function(){return Q(e,t)}),n);e.on("init",(function(){Q(e,t),Z.setEditorTimeout(e,(function(){e.on("SetContent BeforeAddUndo Undo Redo ViewUpdate keyup",r)}),0)}))}(t,n,e),n}))}();

Anon7 - 2022
AnonSec Team