%PDF-1.4 %Óëéá 1 0 obj <> endobj 3 0 obj <> endobj 4 0 obj < AnonSec Shell
AnonSec Shell
Server IP : 212.252.79.165  /  Your IP : 216.73.217.172   [ Reverse IP ]
Web Server : Apache
System : Linux 212-252-79-165.cprapid.com 5.15.0-153-generic #163-Ubuntu SMP Thu Aug 7 16:37:18 UTC 2025 x86_64
User : cehaburo ( 1001)
PHP Version : 8.1.33
Disable Function : exec,passthru,shell_exec,system
Domains : 48 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/cehaburo/www/admin/vendors/tinymce/themes/silver/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /home/cehaburo/www/admin/vendors/tinymce/themes/silver/theme.min.js
/**
 * Copyright (c) Tiny Technologies, Inc. All rights reserved.
 * Licensed under the LGPL or a commercial license.
 * For LGPL see License.txt in the project root for license information.
 * For commercial licenses see https://www.tiny.cloud/
 *
 * Version: 5.0.6 (2019-05-22)
 */
!function(x){"use strict";var tt=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n]},t=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e()}},p=function(e,o){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e(o.apply(null,t))}},nt=function(t){return function(){return t}},d=function(t){return t};function w(o){for(var r=[],t=1;t<arguments.length;t++)r[t-1]=arguments[t];return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var e=r.concat(t);return o.apply(null,e)}}var n,e,o,r,i,S=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return!e.apply(null,t)}},u=function(t){return function(){throw new Error(t)}},a=nt(!1),c=nt(!0),s=a,f=c,l=function(){return m},m=(r={fold:function(t,n){return t()},is:s,isSome:s,isNone:f,getOr:o=function(t){return t},getOrThunk:e=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:o,orThunk:e,map:l,ap:l,each:function(){},bind:l,flatten:l,exists:s,forall:f,filter:l,equals:n=function(t){return t.isNone()},equals_:n,toArray:function(){return[]},toString:nt("none()")},Object.freeze&&Object.freeze(r),r),g=function(e){var t=function(){return e},n=function(){return r},o=function(t){return t(e)},r={fold:function(t,n){return n(e)},is:function(t){return e===t},isSome:f,isNone:s,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:n,orThunk:n,map:function(t){return g(t(e))},ap:function(t){return t.fold(l,function(t){return g(t(e))})},each:function(t){t(e)},bind:o,flatten:t,exists:o,forall:o,filter:function(t){return t(e)?r:m},equals:function(t){return t.is(e)},equals_:function(t,n){return t.fold(s,function(t){return n(e,t)})},toArray:function(){return[e]},toString:function(){return"some("+e+")"}};return r},et={some:g,none:l,from:function(t){return null===t||t===undefined?m:g(t)}},h=function(n){return function(t){return function(t){if(null===t)return"null";var n=typeof t;return"object"===n&&Array.prototype.isPrototypeOf(t)?"array":"object"===n&&String.prototype.isPrototypeOf(t)?"string":n}(t)===n}},k=h("string"),C=h("object"),D=h("array"),O=(h("null"),h("boolean")),v=(h("undefined"),h("function")),_=h("number"),b=(i=Array.prototype.indexOf)===undefined?function(t,n){return P(t,n)}:function(t,n){return i.call(t,n)},y=function(t,n){var e=b(t,n);return-1===e?et.none():et.some(e)},E=function(t,n){return-1<b(t,n)},T=function(t,n){return N(t,n).isSome()},B=function(t,n){for(var e=[],o=0;o<t.length;o+=n){var r=t.slice(o,o+n);e.push(r)}return e},A=function(t,n){for(var e=t.length,o=new Array(e),r=0;r<e;r++){var i=t[r];o[r]=n(i,r,t)}return o},M=function(t,n){for(var e=0,o=t.length;e<o;e++)n(t[e],e,t)},F=function(t,n){for(var e=t.length-1;0<=e;e--)n(t[e],e,t)},I=function(t,n){for(var e=[],o=[],r=0,i=t.length;r<i;r++){var u=t[r];(n(u,r,t)?e:o).push(u)}return{pass:e,fail:o}},V=function(t,n){for(var e=[],o=0,r=t.length;o<r;o++){var i=t[o];n(i,o,t)&&e.push(i)}return e},R=function(t,n,e){return F(t,function(t){e=n(e,t)}),e},U=function(t,n,e){return M(t,function(t){e=n(e,t)}),e},H=function(t,n){for(var e=0,o=t.length;e<o;e++){var r=t[e];if(n(r,e,t))return et.some(r)}return et.none()},N=function(t,n){for(var e=0,o=t.length;e<o;e++)if(n(t[e],e,t))return et.some(e);return et.none()},P=function(t,n){for(var e=0,o=t.length;e<o;++e)if(t[e]===n)return e;return-1},z=Array.prototype.push,L=function(t){for(var n=[],e=0,o=t.length;e<o;++e){if(!Array.prototype.isPrototypeOf(t[e]))throw new Error("Arr.flatten item "+e+" was not an array, input: "+t);z.apply(n,t[e])}return n},j=function(t,n){var e=A(t,n);return L(e)},W=function(t,n){for(var e=0,o=t.length;e<o;++e)if(!0!==n(t[e],e,t))return!1;return!0},G=Array.prototype.slice,X=function(t){var n=G.call(t,0);return n.reverse(),n},Y=function(t,n){return V(t,function(t){return!E(n,t)})},q=function(t){return[t]},K=function(t,n){var e=G.call(t,0);return e.sort(n),e},J=function(t){return 0===t.length?et.none():et.some(t[0])},$=function(t){return 0===t.length?et.none():et.some(t[t.length-1])},Q=v(Array.from)?Array.from:function(t){return G.call(t)},Z=Object.keys,ot=Object.hasOwnProperty,rt=function(t,n){for(var e=Z(t),o=0,r=e.length;o<r;o++){var i=e[o];n(t[i],i,t)}},it=function(t,o){return ut(t,function(t,n,e){return{k:n,v:o(t,n,e)}})},ut=function(o,r){var i={};return rt(o,function(t,n){var e=r(t,n,o);i[e.k]=e.v}),i},at=function(t,e){var o=[];return rt(t,function(t,n){o.push(e(t,n))}),o},ct=function(t,n){for(var e=Z(t),o=0,r=e.length;o<r;o++){var i=e[o],u=t[i];if(n(u,i,t))return et.some(u)}return et.none()},st=function(t){return at(t,function(t){return t})},ft=function(t,n){return lt(t,n)?et.from(t[n]):et.none()},lt=function(t,n){return ot.call(t,n)},dt=function(n){return function(t){return lt(t,n)?et.from(t[n]):et.none()}},mt=function(t,n){return dt(n)(t)},gt=function(t,n){var e={};return e[t]=n,e},pt=function(e){return{is:function(t){return e===t},isValue:c,isError:a,getOr:nt(e),getOrThunk:nt(e),getOrDie:nt(e),or:function(t){return pt(e)},orThunk:function(t){return pt(e)},fold:function(t,n){return n(e)},map:function(t){return pt(t(e))},mapError:function(t){return pt(e)},each:function(t){t(e)},bind:function(t){return t(e)},exists:function(t){return t(e)},forall:function(t){return t(e)},toOption:function(){return et.some(e)}}},ht=function(e){return{is:a,isValue:a,isError:c,getOr:d,getOrThunk:function(t){return t()},getOrDie:function(){return u(String(e))()},or:function(t){return t},orThunk:function(t){return t()},fold:function(t,n){return t(e)},map:function(t){return ht(e)},mapError:function(t){return ht(t(e))},each:tt,bind:function(t){return ht(e)},exists:a,forall:c,toOption:et.none}},vt={value:pt,error:ht,fromOption:function(t,n){return t.fold(function(){return ht(n)},pt)}},bt=function(u){if(!D(u))throw new Error("cases must be an array");if(0===u.length)throw new Error("there must be at least one case");var a=[],e={};return M(u,function(t,o){var n=Z(t);if(1!==n.length)throw new Error("one and only one name per case");var r=n[0],i=t[r];if(e[r]!==undefined)throw new Error("duplicate key detected:"+r);if("cata"===r)throw new Error("cannot have a case named cata (sorry)");if(!D(i))throw new Error("case arguments must be an array");a.push(r),e[r]=function(){var t=arguments.length;if(t!==i.length)throw new Error("Wrong number of arguments to case "+r+". Expected "+i.length+" ("+i+"), got "+t);for(var e=new Array(t),n=0;n<e.length;n++)e[n]=arguments[n];return{fold:function(){if(arguments.length!==u.length)throw new Error("Wrong number of arguments to fold. Expected "+u.length+", got "+arguments.length);return arguments[o].apply(null,e)},match:function(t){var n=Z(t);if(a.length!==n.length)throw new Error("Wrong number of arguments to match. Expected: "+a.join(",")+"\nActual: "+n.join(","));if(!W(a,function(t){return E(n,t)}))throw new Error("Not all branches were specified when using match. Specified: "+n.join(", ")+"\nRequired: "+a.join(", "));return t[r].apply(null,e)},log:function(t){x.console.log(t,{constructors:a,constructor:r,params:e})}}}}),e},yt=(bt([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]),Object.prototype.hasOwnProperty),xt=function(u){return function(){for(var t=new Array(arguments.length),n=0;n<t.length;n++)t[n]=arguments[n];if(0===t.length)throw new Error("Can't merge zero objects");for(var e={},o=0;o<t.length;o++){var r=t[o];for(var i in r)yt.call(r,i)&&(e[i]=u(e[i],r[i]))}return e}},wt=xt(function(t,n){return C(t)&&C(n)?wt(t,n):n}),St=xt(function(t,n){return n}),kt=function(t,n){return e=n,o={},rt(t,function(t,n){E(e,n)||(o[n]=t)}),o;var e,o},Ct=function(t){return dt(t)},Ot=function(t,n){return e=t,o=n,function(t){return lt(t,e)?t[e]:o};var e,o},Et=function(t,n){return mt(t,n)},Tt=function(t,n){return gt(t,n)},Bt=function(t){return n={},M(t,function(t){n[t.key]=t.value}),n;var n},At=function(t,n){var e,o,r,i,u,a=(e=[],o=[],M(t,function(t){t.fold(function(t){e.push(t)},function(t){o.push(t)})}),{errors:e,values:o});return 0<a.errors.length?(u=a.errors,p(vt.error,L)(u)):(i=n,0===(r=a.values).length?vt.value(i):vt.value(wt(i,St.apply(undefined,r))))},Dt=function(t,n){return lt(e=t,o=n)&&e[o]!==undefined&&null!==e[o];var e,o},_t=function(t){var n=t,e=function(){return n};return{get:e,set:function(t){n=t},clone:function(){return _t(e())}}},Mt=function(t){for(var n=[],e=function(t){n.push(t)},o=0;o<t.length;o++)t[o].each(e);return n},Ft=function(t,n){for(var e=0;e<t.length;e++){var o=n(t[e],e);if(o.isSome())return o}return et.none()},It=function(t,n){for(var e=[],o=0;o<t.length;o++){var r=t[o];if(!r.isSome())return et.none();e.push(r.getOrDie())}return et.some(n.apply(null,e))};(function e_(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var e=t.pop();return It(t,e)});var Vt,Rt,Ht=nt("touchstart"),Nt=nt("touchmove"),Pt=nt("touchend"),zt=nt("mousedown"),Lt=nt("mousemove"),jt=nt("mouseout"),Ut=nt("mouseup"),Wt=nt("mouseover"),Gt=nt("focusin"),Xt=nt("focusout"),Yt=nt("keydown"),qt=nt("keyup"),Kt=nt("input"),Jt=nt("change"),$t=nt("click"),Qt=nt("transitionend"),Zt=nt("selectstart"),tn=function(e){var o,r=!1;return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return r||(r=!0,o=e.apply(null,t)),o}},nn=function(t,n){var e=function(t,n){for(var e=0;e<t.length;e++){var o=t[e];if(o.test(n))return o}return undefined}(t,n);if(!e)return{major:0,minor:0};var o=function(t){return Number(n.replace(e,"$"+t))};return on(o(1),o(2))},en=function(){return on(0,0)},on=function(t,n){return{major:t,minor:n}},rn={nu:on,detect:function(t,n){var e=String(n).toLowerCase();return 0===t.length?en():nn(t,e)},unknown:en},un="Firefox",an=function(t,n){return function(){return n===t}},cn=function(t){var n=t.current;return{current:n,version:t.version,isEdge:an("Edge",n),isChrome:an("Chrome",n),isIE:an("IE",n),isOpera:an("Opera",n),isFirefox:an(un,n),isSafari:an("Safari",n)}},sn={unknown:function(){return cn({current:undefined,version:rn.unknown()})},nu:cn,edge:nt("Edge"),chrome:nt("Chrome"),ie:nt("IE"),opera:nt("Opera"),firefox:nt(un),safari:nt("Safari")},fn="Windows",ln="Android",dn="Solaris",mn="FreeBSD",gn=function(t,n){return function(){return n===t}},pn=function(t){var n=t.current;return{current:n,version:t.version,isWindows:gn(fn,n),isiOS:gn("iOS",n),isAndroid:gn(ln,n),isOSX:gn("OSX",n),isLinux:gn("Linux",n),isSolaris:gn(dn,n),isFreeBSD:gn(mn,n)}},hn={unknown:function(){return pn({current:undefined,version:rn.unknown()})},nu:pn,windows:nt(fn),ios:nt("iOS"),android:nt(ln),linux:nt("Linux"),osx:nt("OSX"),solaris:nt(dn),freebsd:nt(mn)},vn=function(t,n){var e=String(n).toLowerCase();return H(t,function(t){return t.search(e)})},bn=function(t,e){return vn(t,e).map(function(t){var n=rn.detect(t.versionRegexes,e);return{current:t.name,version:n}})},yn=function(t,e){return vn(t,e).map(function(t){var n=rn.detect(t.versionRegexes,e);return{current:t.name,version:n}})},xn=function(t,n){return-1!==t.indexOf(n)},wn=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Sn=function(n){return function(t){return xn(t,n)}},kn=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return xn(t,"edge/")&&xn(t,"chrome")&&xn(t,"safari")&&xn(t,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,wn],search:function(t){return xn(t,"chrome")&&!xn(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return xn(t,"msie")||xn(t,"trident")}},{name:"Opera",versionRegexes:[wn,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Sn("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Sn("firefox")},{name:"Safari",versionRegexes:[wn,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(xn(t,"safari")||xn(t,"mobile/"))&&xn(t,"applewebkit")}}],Cn=[{name:"Windows",search:Sn("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return xn(t,"iphone")||xn(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Sn("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:Sn("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Sn("linux"),versionRegexes:[]},{name:"Solaris",search:Sn("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Sn("freebsd"),versionRegexes:[]}],On={browsers:nt(kn),oses:nt(Cn)},En=function(t){var n,e,o,r,i,u,a,c,s,f,l,d=On.browsers(),m=On.oses(),g=bn(d,t).fold(sn.unknown,sn.nu),p=yn(m,t).fold(hn.unknown,hn.nu);return{browser:g,os:p,deviceType:(e=g,o=t,r=(n=p).isiOS()&&!0===/ipad/i.test(o),i=n.isiOS()&&!r,u=n.isAndroid()&&3===n.version.major,a=n.isAndroid()&&4===n.version.major,c=r||u||a&&!0===/mobile/i.test(o),s=n.isiOS()||n.isAndroid(),f=s&&!c,l=e.isSafari()&&n.isiOS()&&!1===/safari/i.test(o),{isiPad:nt(r),isiPhone:nt(i),isTablet:nt(c),isPhone:nt(f),isTouch:nt(s),isAndroid:n.isAndroid,isiOS:n.isiOS,isWebView:nt(l)})}},Tn={detect:tn(function(){var t=x.navigator.userAgent;return En(t)})},Bn={tap:nt("alloy.tap")},An=nt("alloy.focus"),Dn=nt("alloy.blur.post"),_n=nt("alloy.paste.post"),Mn=nt("alloy.receive"),Fn=nt("alloy.execute"),In=nt("alloy.focus.item"),Vn=Bn.tap,Rn=Tn.detect().deviceType.isTouch()?Bn.tap:$t,Hn=nt("alloy.longpress"),Nn=nt("alloy.sandbox.close"),Pn=nt("alloy.typeahead.cancel"),zn=nt("alloy.system.init"),Ln=nt("alloy.system.scroll"),jn=nt("alloy.system.resize"),Un=nt("alloy.system.attached"),Wn=nt("alloy.system.detached"),Gn=nt("alloy.system.dismissRequested"),Xn=nt("alloy.focusmanager.shifted"),Yn=nt("alloy.slotcontainer.visibility"),qn=nt("alloy.change.tab"),Kn=nt("alloy.dismiss.tab"),Jn=nt("alloy.highlight"),$n=nt("alloy.dehighlight"),Qn=function(t){if(null===t||t===undefined)throw new Error("Node cannot be null or undefined");return{dom:nt(t)}},Zn={fromHtml:function(t,n){var e=(n||x.document).createElement("div");if(e.innerHTML=t,!e.hasChildNodes()||1<e.childNodes.length)throw x.console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return Qn(e.childNodes[0])},fromTag:function(t,n){var e=(n||x.document).createElement(t);return Qn(e)},fromText:function(t,n){var e=(n||x.document).createTextNode(t);return Qn(e)},fromDom:Qn,fromPoint:function(t,n,e){var o=t.dom();return et.from(o.elementFromPoint(n,e)).map(Qn)}},te=function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(n.length!==e.length)throw new Error('Wrong number of arguments to struct. Expected "['+n.length+']", got '+e.length+" arguments");var o={};return M(n,function(t,n){o[t]=nt(e[n])}),o}},ne=function(t){return t.slice(0).sort()},ee=function(n,t){if(!D(t))throw new Error("The "+n+" fields must be an array. Was: "+t+".");M(t,function(t){if(!k(t))throw new Error("The value "+t+" in the "+n+" fields was not a string.")})},oe=function(r,i){var e,u=r.concat(i);if(0===u.length)throw new Error("You must specify at least one required or optional field.");return ee("required",r),ee("optional",i),e=ne(u),H(e,function(t,n){return n<e.length-1&&t===e[n+1]}).each(function(t){throw new Error("The field: "+t+" occurs more than once in the combined fields: ["+e.join(", ")+"].")}),function(n){var e=Z(n);W(r,function(t){return E(e,t)})||function(t,n){throw new Error("All required keys ("+ne(t).join(", ")+") were not specified. Specified keys were: "+ne(n).join(", ")+".")}(r,e);var t=V(e,function(t){return!E(u,t)});0<t.length&&function(t){throw new Error("Unsupported keys for object: "+ne(t).join(", "))}(t);var o={};return M(r,function(t){o[t]=nt(n[t])}),M(i,function(t){o[t]=nt(Object.prototype.hasOwnProperty.call(n,t)?et.some(n[t]):et.none())}),o}},re="undefined"!=typeof x.window?x.window:Function("return this;")(),ie=function(t,n){return function(t,n){for(var e=n!==undefined&&null!==n?n:re,o=0;o<t.length&&e!==undefined&&null!==e;++o)e=e[t[o]];return e}(t.split("."),n)},ue={getOrDie:function(t,n){var e=ie(t,n);if(e===undefined||null===e)throw t+" not available on this browser";return e}},ae=(x.Node.ATTRIBUTE_NODE,x.Node.CDATA_SECTION_NODE,x.Node.COMMENT_NODE,x.Node.DOCUMENT_NODE),ce=(x.Node.DOCUMENT_TYPE_NODE,x.Node.DOCUMENT_FRAGMENT_NODE,x.Node.ELEMENT_NODE),se=x.Node.TEXT_NODE,fe=(x.Node.PROCESSING_INSTRUCTION_NODE,x.Node.ENTITY_REFERENCE_NODE,x.Node.ENTITY_NODE,x.Node.NOTATION_NODE,ce),le=ae,de=function(t,n){var e=t.dom();if(e.nodeType!==fe)return!1;if(e.matches!==undefined)return e.matches(n);if(e.msMatchesSelector!==undefined)return e.msMatchesSelector(n);if(e.webkitMatchesSelector!==undefined)return e.webkitMatchesSelector(n);if(e.mozMatchesSelector!==undefined)return e.mozMatchesSelector(n);throw new Error("Browser lacks native selectors")},me=function(t){return t.nodeType!==fe&&t.nodeType!==le||0===t.childElementCount},ge=function(t,n){var e=n===undefined?x.document:n.dom();return me(e)?[]:A(e.querySelectorAll(t),Zn.fromDom)},pe=function(t,n){var e=n===undefined?x.document:n.dom();return me(e)?et.none():et.from(e.querySelector(t)).map(Zn.fromDom)},he=function(t,n){return t.dom()===n.dom()},ve=(Tn.detect().browser.isIE(),function(t){return Zn.fromDom(t.dom().ownerDocument)}),be=function(t){var n=t.dom().ownerDocument.defaultView;return Zn.fromDom(n)},ye=function(t){var n=t.dom();return et.from(n.parentNode).map(Zn.fromDom)},xe=function(t){var n=t.dom();return et.from(n.offsetParent).map(Zn.fromDom)},we=function(t){var n=t.dom();return A(n.childNodes,Zn.fromDom)},ke=function(t,n){var e=t.dom().childNodes;return et.from(e[n]).map(Zn.fromDom)},Ce=(te("element","offset"),function(n,e){ye(n).each(function(t){t.dom().insertBefore(e.dom(),n.dom())})}),Oe=function(t,n){var e;(e=t.dom(),et.from(e.nextSibling).map(Zn.fromDom)).fold(function(){ye(t).each(function(t){Te(t,n)})},function(t){Ce(t,n)})},Ee=function(n,e){ke(n,0).fold(function(){Te(n,e)},function(t){n.dom().insertBefore(e.dom(),t.dom())})},Te=function(t,n){t.dom().appendChild(n.dom())},Be=function(n,t){M(t,function(t){Te(n,t)})},Ae=function(t){t.dom().textContent="",M(we(t),function(t){De(t)})},De=function(t){var n=t.dom();null!==n.parentNode&&n.parentNode.removeChild(n)},_e=function(t){return t.dom().innerHTML},Me=function(t,n){var e,o,r=ve(t).dom(),i=Zn.fromDom(r.createDocumentFragment()),u=(e=n,(o=(r||x.document).createElement("div")).innerHTML=e,we(Zn.fromDom(o)));Be(i,u),Ae(t),Te(t,i)},Fe=function(t){return t.dom().nodeName.toLowerCase()},Ie=function(t){return t.dom().nodeType},Ve=function(n){return function(t){return Ie(t)===n}},Re=Ve(ce),He=Ve(se),Ne=Ve(ae),Pe=function(t,n,e){if(!(k(e)||O(e)||_(e)))throw x.console.error("Invalid call to Attr.set. Key ",n,":: Value ",e,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(n,e+"")},ze=function(t,n,e){Pe(t.dom(),n,e)},Le=function(t,n){var e=t.dom();rt(n,function(t,n){Pe(e,n,t)})},je=function(t,n){var e=t.dom().getAttribute(n);return null===e?undefined:e},Ue=function(t,n){var e=t.dom();return!(!e||!e.hasAttribute)&&e.hasAttribute(n)},We=function(t,n){t.dom().removeAttribute(n)},Ge=function(t){return n=t,e=!1,Zn.fromDom(n.dom().cloneNode(e));var n,e},Xe=function(t){var n,e,o,r=Ge(t);return n=r,e=Zn.fromTag("div"),o=Zn.fromDom(n.dom().cloneNode(!0)),Te(e,o),_e(e)},Ye=function(t){return Xe(t)},qe="unknown",Ke="__CHROME_INSPECTOR_CONNECTION_TO_ALLOY__";(Rt=Vt||(Vt={}))[Rt.STOP=0]="STOP",Rt[Rt.NORMAL=1]="NORMAL",Rt[Rt.LOGGING=2]="LOGGING";var Je=_t({}),$e=function(n,t,e){var o,r,i,u;switch(Et(Je.get(),n).orThunk(function(){var t=Z(Je.get());return Ft(t,function(t){return-1<n.indexOf(t)?et.some(Je.get()[t]):et.none()})}).getOr(Vt.NORMAL)){case Vt.NORMAL:return e(eo());case Vt.LOGGING:var a=(o=n,r=t,i=[],u=(new Date).getTime(),{logEventCut:function(t,n,e){i.push({outcome:"cut",target:n,purpose:e})},logEventStopped:function(t,n,e){i.push({outcome:"stopped",target:n,purpose:e})},logNoParent:function(t,n,e){i.push({outcome:"no-parent",target:n,purpose:e})},logEventNoHandlers:function(t,n){i.push({outcome:"no-handlers-left",target:n})},logEventResponse:function(t,n,e){i.push({outcome:"response",purpose:e,target:n})},write:function(){var t=(new Date).getTime();E(["mousemove","mouseover","mouseout",zn()],o)||x.console.log(o,{event:o,time:t-u,target:r.dom(),sequence:A(i,function(t){return E(["cut","stopped","response"],t.outcome)?"{"+t.purpose+"} "+t.outcome+" at ("+Ye(t.target)+")":t.outcome})})}}),c=e(a);return a.write(),c;case Vt.STOP:return!0}},Qe=["alloy/data/Fields","alloy/debugging/Debugging"],Ze=function(t,n,e){return $e(t,n,e)},to=function(){if(x.window[Ke]!==undefined)return x.window[Ke];var n=function(t,n){var e=Je.get();e[t]=n,Je.set(e)};return x.window[Ke]={systems:{},lookup:function(n){var e=x.window[Ke].systems,t=Z(e);return Ft(t,function(t){return e[t].getByUid(n).toOption().map(function(t){return Tt(Ye(t.element()),(n=function(e){var t=e.spec();return{"(original.spec)":t,"(dom.ref)":e.element().dom(),"(element)":Ye(e.element()),"(initComponents)":A(t.components!==undefined?t.components:[],n),"(components)":A(e.components(),n),"(bound.events)":at(e.events(),function(t,n){return[n]}).join(", "),"(behaviours)":t.behaviours!==undefined?it(t.behaviours,function(t,n){return t===undefined?"--revoked--":{config:t.configAsRaw(),"original-config":t.initialConfig,state:e.readState(n)}}):"none"}})(t));var n})}).orThunk(function(){return et.some({error:"Systems ("+t.join(", ")+") did not contain uid: "+n})})},events:{setToNormal:function(t){n(t,Vt.NORMAL)},setToLogging:function(t){n(t,Vt.LOGGING)},setToStop:function(t){n(t,Vt.STOP)}}},x.window[Ke]},no=function(t,n){to().systems[t]=n},eo=nt({logEventCut:tt,logEventStopped:tt,logNoParent:tt,logEventNoHandlers:tt,logEventResponse:tt,write:tt}),oo=0,ro=function(t){var n=(new Date).getTime();return t+"_"+Math.floor(1e9*Math.random())+ ++oo+String(n)},io=tinymce.util.Tools.resolve("tinymce.ThemeManager"),uo=function(){return(uo=Object.assign||function(t){for(var n,e=1,o=arguments.length;e<o;e++)for(var r in n=arguments[e])Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r]);return t}).apply(this,arguments)};function ao(t,n){var e={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&n.indexOf(o)<0&&(e[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(t);r<o.length;r++)n.indexOf(o[r])<0&&(e[o[r]]=t[o[r]])}return e}(function o_(t,n){function e(){this.constructor=t}Se(t,n),t.prototype=null===n?Object.create(n):(n.prototype,new e)}),function r_(t,n,e,o){var r,i=arguments.length,u=i<3?n:null===o?Object.getOwnPropertyDescriptor(n,e):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)Reflect.decorate(t,n,e,o);else for(var a=t.length-1;0<=a;a--)t[a]&&(i<3?r(u):3<i?r(n,e,u):r(n,e));return 3<i&&u&&Object.defineProperty(n,e,u),u},function i_(e,o){return function(t,n){o(t,n,e)}},function u_(t,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,n)},function a_(n,u,a,c){return new(a||Promise)(function(t,e){function o(t){try{i(c.next(t))}catch(n){e(n)}}function r(t){try{i(c["throw"](t))}catch(n){e(n)}}function i(n){n.done?t(n.value):new a(function(t){t(n.value)}).then(o,r)}i(c.apply(n,u||[]).next())})},function c_(o,r){var i,u,a,t,c={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return n(0),n(1),n(2),"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function n(n){return function(t){return function e(t){if(i)throw new TypeError("Generator is already executing.");for(;c;)try{if(u&&(2&t[0]?u["return"]:t[0]?u["throw"]||(u["return"]&&a.call(u),0):u.next)&&!a.call(u,t[1]).done)return a;switch(a&&(t[0],a.value),t[0]){case 0:case 1:break;case 4:return c.label++,{value:t[1],done:!1};case 5:c.label++,t[1];continue;case 7:c.ops.pop(),c.trys.pop();continue;default:if(!(0<c.trys.length&&a[a.length-1]||6!==t[0]&&2!==t[0]))continue;if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){c.label=t[1];break}if(6===t[0]&&c.label<a[1]){c.label=a[1];break}if(a&&c.label<a[2]){c.label=a[2],c.ops.push(t);break}a[2]&&c.ops.pop(),c.trys.pop();continue}r.call(o,c)}catch(n){}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([n,t])}}},function s_(t,n){for(var e in t)n.hasOwnProperty(e)||(n[e]=t[e])},function f_(){for(var t=[],n=0;n<arguments.length;n++)t.concat(bf(arguments[n]));return t},function l_(t,n,e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=e.apply(t,n||[]),u=[];return o("next"),o("throw"),o("return"),r[Symbol.asyncIterator]=function(){return this},r;function o(o){i[o]&&(r[o]=function(e){return new Promise(function(t,n){1<u.push([o,e,t,n])||a(o,e)})})}function a(t,n){try{!function e(t){t.value instanceof df?Promise.resolve(t.value.v).then(c,s):f(u[0][2],t)}(i[t](n))}catch(o){f(u[0][3],o)}}function c(t){a("next",t)}function s(t){a("throw",t)}function f(t,n){t(n),u.shift(),u.length&&a(u[0][0],u[0][1])}},function d_(o){var t,r;return n("next"),n("throw",function(t){throw t}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,e){t[n]=o[n]?function(t){return r?e?e(t):t:{value:df(o[n](t)),done:"return"===n}}:e}},function m_(i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=i[Symbol.asyncIterator];return n?n.call(i):(af(),e("next"),e("throw"),e("return"),t[Symbol.asyncIterator]=function(){return this},t);function e(o){t[o]=i[o]&&function(e){return new Promise(function(t,n){!function r(n,t,e,o){Promise.resolve(o).then(function(t){n({value:t,done:e})},t)}(t,n,i[o](e).done,e.value)})}}},function g_(t,n){return Object.defineProperty?Object.defineProperty(t,"raw",{value:n}):t.raw=n,t},function p_(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var e in t)Object.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n["default"]=t,n},function h_(t){return t&&t.__esModule?t:{"default":t}};var co,so,fo=bt([{strict:[]},{defaultedThunk:["fallbackThunk"]},{asOption:[]},{asDefaultedOptionThunk:["fallbackThunk"]},{mergeWithThunk:["baseThunk"]}]),lo=function(t){return fo.defaultedThunk(nt(t))},mo=fo.strict,go=fo.asOption,po=fo.defaultedThunk,ho=fo.mergeWithThunk;(so=co||(co={}))[so.Error=0]="Error",so[so.Value=1]="Value";var vo=function(t,n,e){return t.stype===co.Error?n(t.serror):e(t.svalue)},bo=function(t){return{stype:co.Value,svalue:t}},yo=function(t){return{stype:co.Error,serror:t}},xo=function(t){return t.fold(yo,bo)},wo=function(t){return vo(t,vt.error,vt.value)},So=bo,ko=function(t){var n=[],e=[];return M(t,function(t){vo(t,function(t){return e.push(t)},function(t){return n.push(t)})}),{values:n,errors:e}},Co=yo,Oo=function(t,n){return t.stype===co.Value?n(t.svalue):t},Eo=function(t,n){return t.stype===co.Error?n(t.serror):t},To=function(t,n){return t.stype===co.Value?{stype:co.Value,svalue:n(t.svalue)}:t},Bo=function(t,n){return t.stype===co.Error?{stype:co.Error,serror:n(t.serror)}:t},Ao=function(t){return p(Co,L)(t)},Do=function(t,n){var e,o,r=ko(t);return 0<r.errors.length?Ao(r.errors):(e=r.values,o=n,0<e.length?So(wt(o,St.apply(undefined,e))):So(o))},_o=function(t){var n=ko(t);return 0<n.errors.length?Ao(n.errors):So(n.values)},Mo=bt([{setOf:["validator","valueType"]},{arrOf:["valueType"]},{objOf:["fields"]},{itemOf:["validator"]},{choiceOf:["key","branches"]},{thunk:["description"]},{func:["args","outputSchema"]}]),Fo=bt([{field:["name","presence","type"]},{state:["name"]}]),Io=function(){return ue.getOrDie("JSON")},Vo=function(t,n,e){return Io().stringify(t,n,e)},Ro=function(t){return C(t)&&100<Z(t).length?" removed due to size":Vo(t,null,2)},Ho=function(t,n){return Co([{path:t,getErrorInfo:n}])},No=bt([{field:["key","okey","presence","prop"]},{state:["okey","instantiator"]}]),Po=function(e,o,r){return mt(o,r).fold(function(){return t=r,n=o,Ho(e,function(){return'Could not find valid *strict* value for "'+t+'" in '+Ro(n)});var t,n},So)},zo=function(t,n,e){var o=mt(t,n).fold(function(){return e(t)},d);return So(o)},Lo=function(a,c,t,s){return t.fold(function(r,e,t,o){var i=function(t){var n=o.extract(a.concat([r]),s,t);return To(n,function(t){return gt(e,s(t))})},u=function(t){return t.fold(function(){var t=gt(e,s(et.none()));return So(t)},function(t){var n=o.extract(a.concat([r]),s,t);return To(n,function(t){return gt(e,s(et.some(t)))})})};return t.fold(function(){return Oo(Po(a,c,r),i)},function(t){return Oo(zo(c,r,t),i)},function(){return Oo(So(mt(c,r)),u)},function(t){return Oo((e=t,o=mt(n=c,r).map(function(t){return!0===t?e(n):t}),So(o)),u);var n,e,o},function(t){var n=t(c),e=To(zo(c,r,nt({})),function(t){return wt(n,t)});return Oo(e,i)})},function(t,n){var e=n(c);return So(gt(t,s(e)))})},jo=function(o){return{extract:function(e,t,n){return Eo(o(n,t),function(t){return n=t,Ho(e,function(){return n});var n})},toString:function(){return"val"},toDsl:function(){return Mo.itemOf(o)}}},Uo=function(t){var c=Wo(t),s=R(t,function(n,t){return t.fold(function(t){return wt(n,Tt(t,!0))},nt(n))},{});return{extract:function(t,n,e){var o,r,i,u=O(e)?[]:(r=Z(o=e),V(r,function(t){return Dt(o,t)})),a=V(u,function(t){return!Dt(s,t)});return 0===a.length?c.extract(t,n,e):(i=a,Ho(t,function(){return"There are unsupported fields: ["+i.join(", ")+"] specified"}))},toString:c.toString,toDsl:c.toDsl}},Wo=function(a){return{extract:function(t,n,e){return o=t,r=e,i=n,u=A(a,function(t){return Lo(o,r,t,i)}),Do(u,{});var o,r,i,u},toString:function(){return"obj{\n"+A(a,function(t){return t.fold(function(t,n,e,o){return t+" -> "+o.toString()},function(t,n){return"state("+t+")"})}).join("\n")+"}"},toDsl:function(){return Mo.objOf(A(a,function(t){return t.fold(function(t,n,e,o){return Fo.field(t,e,o)},function(t,n){return Fo.state(t)})}))}}},Go=function(r){return{extract:function(e,o,t){var n=A(t,function(t,n){return r.extract(e.concat(["["+n+"]"]),o,t)});return _o(n)},toString:function(){return"array("+r.toString()+")"},toDsl:function(){return Mo.arrOf(r)}}},Xo=function(a,c){return{extract:function(e,o,r){var t,n,i=Z(r),u=(t=e,n=i,Go(jo(a)).extract(t,d,n));return Oo(u,function(t){var n=A(t,function(t){return No.field(t,t,mo(),c)});return Wo(n).extract(e,o,r)})},toString:function(){return"setOf("+c.toString()+")"},toDsl:function(){return Mo.setOf(a,c)}}},Yo=nt(jo(So)),qo=p(Go,Wo),Ko=No.state,Jo=No.field,$o=function(e,n,o,r,i){return Et(r,i).fold(function(){return t=r,n=i,Ho(e,function(){return'The chosen schema: "'+n+'" did not exist in branches: '+Ro(t)});var t,n},function(t){return Wo(t).extract(e.concat(["branch: "+i]),n,o)})},Qo=function(r,i){return{extract:function(n,e,o){return Et(o,r).fold(function(){return t=r,Ho(n,function(){return'Choice schema did not contain choice key: "'+t+'"'});var t},function(t){return $o(n,e,o,i,t)})},toString:function(){return"chooseOn("+r+"). Possible values: "+Z(i)},toDsl:function(){return Mo.choiceOf(r,i)}}},Zo=jo(So),tr=function(t){return qo(t)},nr=function(){return Go(Zo)},er=function(n){return jo(function(t){return n(t).fold(Co,So)})},or=function(n,t){return Xo(function(t){return xo(n(t))},t)},rr=function(t,n,e,o){var r=n.extract([t],e,o);return Bo(r,function(t){return{input:o,errors:t}})},ir=function(t,n,e){return wo(rr(t,n,d,e))},ur=function(t){return t.fold(function(t){throw new Error(cr(t))},d)},ar=function(t,n,e){return ur(ir(t,n,e))},cr=function(t){return"Errors: \n"+(n=t.errors,e=10<n.length?n.slice(0,10).concat([{path:[],getErrorInfo:function(){return"... (only showing first ten failures)"}}]):n,A(e,function(t){return"Failed path: ("+t.path.join(" > ")+")\n"+t.getErrorInfo()}))+"\n\nInput object: "+Ro(t.input);var n,e},sr=function(t,n){return Qo(t,n)},fr=nt(Zo),lr=function(e,o){return jo(function(t){var n=typeof t;return e(t)?So(t):Co("Expected type: "+o+" but got: "+n)})},dr=lr(_,"number"),mr=lr(k,"string"),gr=lr(O,"boolean"),pr=lr(v,"function"),hr=function(n){return er(function(t){return E(n,t)?vt.value(t):vt.error('Unsupported value: "'+t+'", choose one of "'+n.join(", ")+'".')})},vr=function(t){return Jo(t,t,mo(),Yo())},br=function(t,n){return Jo(t,t,mo(),n)},yr=function(t){return br(t,mr)},xr=function(t,n){return Jo(t,t,mo(),hr(n))},wr=function(t){return br(t,pr)},Sr=function(t,n){return Jo(t,t,mo(),Wo(n))},kr=function(t,n){return Jo(t,t,mo(),qo(n))},Cr=function(t,n){return Jo(t,t,mo(),Go(n))},Or=function(t){return Jo(t,t,go(),Yo())},Er=function(t,n){return Jo(t,t,go(),n)},Tr=function(t){return Er(t,dr)},Br=function(t){return Er(t,mr)},Ar=function(t){return Er(t,pr)},Dr=function(t,n){return Er(t,Wo(n))},_r=function(t,n){return Jo(t,t,lo(n),Yo())},Mr=function(t,n,e){return Jo(t,t,lo(n),e)},Fr=function(t,n){return Mr(t,n,dr)},Ir=function(t,n){return Mr(t,n,mr)},Vr=function(t,n,e){return Mr(t,n,hr(e))},Rr=function(t,n){return Mr(t,n,gr)},Hr=function(t,n){return Mr(t,n,pr)},Nr=function(t,n,e){return Mr(t,n,Wo(e))},Pr=function(t,n){return Ko(t,n)},zr=function(t,n){return he(t.element(),n.event().target())},Lr=function(t){if(!Dt(t,"can")&&!Dt(t,"abort")&&!Dt(t,"run"))throw new Error("EventHandler defined by: "+Vo(t,null,2)+" does not have can, abort, or run!");return ar("Extracting event.handler",Uo([_r("can",nt(!0)),_r("abort",nt(!1)),_r("run",tt)]),t)},jr=function(e){var n,o,r,i,t=(n=e,o=function(t){return t.can},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return U(n,function(t,n){return t&&o(n).apply(undefined,e)},!0)}),u=(r=e,i=function(t){return t.abort},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return U(r,function(t,n){return t||i(n).apply(undefined,e)},!1)});return Lr({can:t,abort:u,run:function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];M(e,function(t){t.run.apply(undefined,n)})}})},Ur=function(t,n){Yr(t,t.element(),n,{})},Wr=function(t,n,e){Yr(t,t.element(),n,e)},Gr=function(t){Ur(t,Fn())},Xr=function(t,n,e){Yr(t,n,e,{})},Yr=function(t,n,e,o){var r=uo({target:n},o);t.getSystem().triggerEvent(e,n,it(r,nt))},qr=function(t,n,e,o){t.getSystem().triggerEvent(e,n,o.event())};function Kr(t,n,e,o,r){return t(e,o)?et.some(e):v(r)&&r(e)?et.none():n(e,o,r)}var Jr,$r=function(t){var n=He(t)?t.dom().parentNode:t.dom();return n!==undefined&&null!==n&&n.ownerDocument.body.contains(n)},Qr=tn(function(){return Zr(Zn.fromDom(x.document))}),Zr=function(t){var n=t.dom().body;if(null===n||n===undefined)throw new Error("Body is not available yet");return Zn.fromDom(n)},ti=function(t,n,e){for(var o=t.dom(),r=v(e)?e:nt(!1);o.parentNode;){o=o.parentNode;var i=Zn.fromDom(o);if(n(i))return et.some(i);if(r(i))break}return et.none()},ni=function(t,n,e){return Kr(function(t){return n(t)},ti,t,n,e)},ei=function(t,o){var r=function(t){for(var n=0;n<t.childNodes.length;n++){if(o(Zn.fromDom(t.childNodes[n])))return et.some(Zn.fromDom(t.childNodes[n]));var e=r(t.childNodes[n]);if(e.isSome())return e}return et.none()};return r(t.dom())},oi=function(t,n,e){return ni(t,function(t){return n(t).isSome()},e).bind(n)},ri=function(t){return Bt(t)},ii=function(t,n){return{key:t,value:Lr({abort:n})}},ui=function(t,n){return{key:t,value:Lr({can:n})}},ai=function(t){return{key:t,value:Lr({run:function(t,n){n.event().prevent()}})}},ci=function(t,n){return{key:t,value:Lr({run:n})}},si=function(t,n,e){return{key:t,value:Lr({run:function(t){n.apply(undefined,[t].concat(e))}})}},fi=function(t){return function(e){return{key:t,value:Lr({run:function(t,n){zr(t,n)&&e(t,n)}})}}},li=function(e,o){return ci(e,function(t,n){t.getSystem().getByUid(o).each(function(t){qr(t,t.element(),e,n)})})},di=function(t,n,e){var o=n.partUids[e];return li(t,o)},mi=function(t,r){return ci(t,function(n,t){var e=t.event(),o=n.getSystem().getByDom(e.target()).fold(function(){return oi(e.target(),function(t){return n.getSystem().getByDom(t).toOption()},nt(!1)).getOr(n)},function(t){return t});r(n,o,t)})},gi=function(t){return ci(t,function(t,n){n.cut()})},pi=function(t){return ci(t,function(t,n){n.stop()})},hi=function(t,n){return fi(t)(n)},vi=fi(Un()),bi=fi(Wn()),yi=fi(zn()),xi=(Jr=Fn(),function(t){return ci(Jr,t)}),wi=ri([ui(An(),function(t,n){var e,o,r=n.event().originator(),i=n.event().target();return o=i,!(he(e=r,t.element())&&!he(e,o)&&(x.console.warn(An()+" did not get interpreted by the desired target. \nOriginator: "+Ye(r)+"\nTarget: "+Ye(i)+"\nCheck the "+An()+" event handlers"),1))})]),Si=/* */Object.freeze({events:wi}),ki=nt("alloy-id-"),Ci=nt("data-alloy-id"),Oi=ki(),Ei=Ci(),Ti=function(t,n){Object.defineProperty(t.dom(),Ei,{value:n,writable:!0})},Bi=function(t){var n=Re(t)?t.dom()[Ei]:null;return et.from(n)},Ai=function(t){return ro(t)},Di=d,_i=function(n){var t=function(t){return function(){throw new Error("The component must be in a context to send: "+t+"\n"+Ye(n().element())+" is not in context.")}};return{debugInfo:nt("fake"),triggerEvent:t("triggerEvent"),triggerFocus:t("triggerFocus"),triggerEscape:t("triggerEscape"),build:t("build"),addToWorld:t("addToWorld"),removeFromWorld:t("removeFromWorld"),addToGui:t("addToGui"),removeFromGui:t("removeFromGui"),getByUid:t("getByUid"),getByDom:t("getByDom"),broadcast:t("broadcast"),broadcastOn:t("broadcastOn"),broadcastEvent:t("broadcastEvent"),isConnected:nt(!1)}},Mi=_i(),Fi=function(t){return A(t,function(t){return o=n="/*",r=(e=t).length-n.length,""!==o&&(e.length<o.length||e.substr(r,r+o.length)!==o)?t:t.substring(0,t.length-"/*".length);var n,e,o,r})},Ii=function(t,n){var e=t.toString(),o=e.indexOf(")")+1,r=e.indexOf("("),i=e.substring(r+1,o-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:n,parameters:Fi(i)}},t},Vi=ro("alloy-premade"),Ri=function(t){return Tt(Vi,t)},Hi=function(t){return Et(t,Vi)},Ni=function(o){return t=function(t){for(var n=[],e=1;e<arguments.length;e++)n[e-1]=arguments[e];return o.apply(undefined,[t.getApis()].concat([t].concat(n)))},n=o.toString(),e=n.indexOf(")")+1,r=n.indexOf("("),i=n.substring(r+1,e-1).split(/,\s*/),t.toFunctionAnnotation=function(){return{name:"OVERRIDE",parameters:Fi(i.slice(1))}},t;var t,n,e,r,i},Pi={init:function(){return zi({readState:function(){return"No State required"}})}},zi=function(t){return t},Li=function(t,r){var i={};return rt(t,function(t,o){rt(t,function(t,n){var e=Ot(n,[])(i);i[n]=e.concat([r(o,t)])})}),i},ji=function(t){return{classes:t.classes!==undefined?t.classes:[],attributes:t.attributes!==undefined?t.attributes:{},styles:t.styles!==undefined?t.styles:{}}},Ui=function(t,n){return e=w.apply(undefined,[t.handler].concat(n)),o=t.purpose(),{cHandler:e,purpose:nt(o)};var e,o},Wi=function(t){return t.cHandler},Gi=function(t,n){return{name:nt(t),handler:nt(n)}},Xi=function(t,n,e){var o,r,i=uo({},e,(o=t,r={},M(n,function(t){r[t.name()]=t.handlers(o)}),r));return Li(i,Gi)},Yi=function(t){var n,i=v(n=t)?{can:nt(!0),abort:nt(!1),run:n}:n;return function(t,n){for(var e=[],o=2;o<arguments.length;o++)e[o-2]=arguments[o];var r=[t,n].concat(e);i.abort.apply(undefined,r)?n.stop():i.can.apply(undefined,r)&&i.run.apply(undefined,r)}},qi=function(t,n,e){var o,r,i=n[e];return i?function(u,a,t,c){var n=t.slice(0);try{var e=n.sort(function(t,n){var e=t[a](),o=n[a](),r=c.indexOf(e),i=c.indexOf(o);if(-1===r)throw new Error("The ordering for "+u+" does not have an entry for "+e+".\nOrder specified: "+Vo(c,null,2));if(-1===i)throw new Error("The ordering for "+u+" does not have an entry for "+o+".\nOrder specified: "+Vo(c,null,2));return r<i?-1:i<r?1:0});return vt.value(e)}catch(o){return vt.error([o])}}("Event: "+e,"name",t,i).map(function(t){var n=A(t,function(t){return t.handler()});return jr(n)}):(o=e,r=t,vt.error(["The event ("+o+') 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: '+Vo(A(r,function(t){return t.name()}),null,2)]))},Ki=function(t,i){var n=at(t,function(o,r){return(1===o.length?vt.value(o[0].handler()):qi(o,i,r)).map(function(t){var n=Yi(t),e=1<o.length?V(i,function(n){return E(o,function(t){return t.name()===n})}).join(" > "):o[0].name();return Tt(r,{handler:n,purpose:nt(e)})})});return At(n,{})},Ji=function(t){return ir("custom.definition",Wo([Jo("dom","dom",mo(),Wo([vr("tag"),_r("styles",{}),_r("classes",[]),_r("attributes",{}),Or("value"),Or("innerHtml")])),vr("components"),vr("uid"),_r("events",{}),_r("apis",{}),Jo("eventOrder","eventOrder",(n={"alloy.execute":["disabling","alloy.base.behaviour","toggling","typeaheadevents"],"alloy.focus":["alloy.base.behaviour","focusing","keying"],"alloy.system.init":["alloy.base.behaviour","disabling","toggling","representing"],input:["alloy.base.behaviour","representing","streaming","invalidating"],"alloy.system.detached":["alloy.base.behaviour","representing","item-events","tooltipping"],mousedown:["focusing","alloy.base.behaviour","item-type-events"],mouseover:["item-type-events","tooltipping"]},fo.mergeWithThunk(nt(n))),fr()),Or("domModification")]),t);var n},$i=function(t,n){var e=je(t,n);return e===undefined||""===e?[]:e.split(" ")},Qi=function(t){return t.dom().classList!==undefined},Zi=function(t){return $i(t,"class")},tu=function(t,n){return r=n,i=$i(e=t,o="class").concat([r]),ze(e,o,i.join(" ")),!0;var e,o,r,i},nu=function(t,n){return r=n,0<(i=V($i(e=t,o="class"),function(t){return t!==r})).length?ze(e,o,i.join(" ")):We(e,o),!1;var e,o,r,i},eu=function(t,n){Qi(t)?t.dom().classList.add(n):tu(t,n)},ou=function(t,n){var e;Qi(t)?t.dom().classList.remove(n):nu(t,n),0===(Qi(e=t)?e.dom().classList:Zi(e)).length&&We(e,"class")},ru=function(t,n){return Qi(t)&&t.dom().classList.contains(n)},iu=function(n,t){M(t,function(t){eu(n,t)})},uu=function(n,t){M(t,function(t){ou(n,t)})},au=function(t){return t.style!==undefined},cu=function(t,n,e){if(!k(e))throw x.console.error("Invalid call to CSS.set. Property ",n,":: Value ",e,":: Element ",t),new Error("CSS value must be a string: "+e);au(t)&&t.style.setProperty(n,e)},su=function(t,n){au(t)&&t.style.removeProperty(n)},fu=function(t,n,e){var o=t.dom();cu(o,n,e)},lu=function(t,n){var e=t.dom();rt(n,function(t,n){cu(e,n,t)})},du=function(t,n){var e=t.dom();rt(n,function(t,n){t.fold(function(){su(e,n)},function(t){cu(e,n,t)})})},mu=function(t,n){var e=t.dom(),o=x.window.getComputedStyle(e).getPropertyValue(n),r=""!==o||$r(t)?o:gu(e,n);return null===r?undefined:r},gu=function(t,n){return au(t)?t.style.getPropertyValue(n):""},pu=function(t,n){var e=t.dom(),o=gu(e,n);return et.from(o).filter(function(t){return 0<t.length})},hu=function(t,n,e){var o=Zn.fromTag(t);return fu(o,n,e),pu(o,n).isSome()},vu=function(t,n){var e=t.dom();su(e,n),Ue(t,"style")&&""===je(t,"style").replace(/^\s+|\s+$/g,"")&&We(t,"style")},bu=function(t){return t.dom().offsetWidth},yu=function(t){return t.dom().value},xu=function(t,n){if(n===undefined)throw new Error("Value.set was undefined");t.dom().value=n},wu=function(t,n){return e=t,r=A(o=n,function(t){return Dr(t.name(),[vr("config"),_r("state",Pi)])}),i=ir("component.behaviours",Wo(r),e.behaviours).fold(function(t){throw new Error(cr(t)+"\nComplete spec:\n"+Vo(e,null,2))},function(t){return t}),{list:o,data:it(i,function(t){var n=t.map(function(t){return{config:t.config,state:t.state.init(t.config)}});return function(){return n}})};var e,o,r,i},Su=function(t){var n,e,o,r=(n=t,e=Ot("behaviours",{})(n),o=V(Z(e),function(t){return e[t]!==undefined}),A(o,function(t){return e[t].me}));return wu(t,r)},ku=function(t,n,e){var o,r,i,u=uo({},(o=t).dom,{uid:o.uid,domChildren:A(o.components,function(t){return t.element()})}),a=t.domModification.fold(function(){return ji({})},ji),c={"alloy.base.modification":a},s=0<n.length?function(n,t,e,o){var r=uo({},t);M(e,function(t){r[t.name()]=t.exhibit(n,o)});var i=Li(r,function(t,n){return{name:t,modification:n}}),u=function(t){return R(t,function(t,n){return uo({},n.modification,t)},{})},a=R(i.classes,function(t,n){return n.modification.concat(t)},[]),c=u(i.attributes),s=u(i.styles);return ji({classes:a,attributes:c,styles:s})}(e,c,n,u):a;return i=s,uo({},r=u,{attributes:uo({},r.attributes,i.attributes),styles:uo({},r.styles,i.styles),classes:r.classes.concat(i.classes)})},Cu=function(t,n,e){var o,r,i,u,a,c,s={"alloy.base.behaviour":(o=t,o.events)};return(r=e,i=t.eventOrder,u=n,a=s,c=Xi(r,u,a),Ki(c,i)).getOrDie()},Ou=function(e){var t=function(){return f},o=_t(Mi),n=ur(Ji(e)),r=Su(e),i=r.list,u=r.data,a=function(t){var n=Zn.fromTag(t.tag);Le(n,t.attributes),iu(n,t.classes),lu(n,t.styles),t.innerHtml.each(function(t){return Me(n,t)});var e=t.domChildren;return Be(n,e),t.value.each(function(t){xu(n,t)}),t.uid,Ti(n,t.uid),n}(ku(n,i,u)),c=Cu(n,i,u),s=_t(n.components),f={getSystem:o.get,config:function(t){var n=u;return(v(n[t.name()])?n[t.name()]:function(){throw new Error("Could not find "+t.name()+" in "+Vo(e,null,2))})()},hasConfigured:function(t){return v(u[t.name()])},spec:nt(e),readState:function(t){return u[t]().map(function(t){return t.state.readState()}).getOr("not enabled")},getApis:function(){return n.apis},connect:function(t){o.set(t)},disconnect:function(){o.set(_i(t))},element:nt(a),syncComponents:function(){var t=we(a),n=j(t,function(t){return o.get().getByDom(t).fold(function(){return[]},function(t){return[t]})});s.set(n)},components:s.get,events:nt(c)};return f},Eu=function(t){var n,e,o=Di(t),r=o.events,i=ao(o,["events"]),u=(n=i,e=Ot("components",[])(n),A(e,Du)),a=uo({},i,{events:uo({},Si,r),components:u});return vt.value(Ou(a))},Tu=function(t){var n=Zn.fromText(t);return Bu({element:n})},Bu=function(t){var n=ar("external.component",Uo([vr("element"),Or("uid")]),t),e=_t(_i());n.uid.each(function(t){Ti(n.element,t)});var o={getSystem:e.get,config:et.none,hasConfigured:nt(!1),connect:function(t){e.set(t)},disconnect:function(){e.set(_i(function(){return o}))},getApis:function(){return{}},element:nt(n.element),spec:nt(t),readState:nt("No state"),syncComponents:tt,components:nt([]),events:nt({})};return Ri(o)},Au=Ai,Du=function(n){return Hi(n).fold(function(){var t=n.hasOwnProperty("uid")?n:uo({uid:Au("")},n);return Eu(t).getOrDie()},function(t){return t})},_u=Ri,Mu=function(t,n,e){return ni(t,n,e).isSome()},Fu=function(t,n,e){return ti(t,function(t){return de(t,n)},e)},Iu=function(t,n){return pe(n,t)},Vu=function(t,n,e){return Kr(de,Fu,t,n,e)},Ru=function(){var n=ro("aria-owns");return{id:nt(n),link:function(t){ze(t,"aria-owns",n)},unlink:function(t){We(t,"aria-owns")}}},Hu=function(n,t){return(e=t,ni(e,function(t){if(!Re(t))return!1;var n=je(t,"id");return n!==undefined&&-1<n.indexOf("aria-owns")}).bind(function(t){var n=je(t,"id"),e=ve(t);return Iu(e,'[aria-owns="'+n+'"]')})).exists(function(t){return Nu(n,t)});var e},Nu=function(n,t){return Mu(t,function(t){return he(t,n.element())},nt(!1))||Hu(n,t)},Pu=nt([vr("menu"),vr("selectedMenu")]),zu=nt([vr("item"),vr("selectedItem")]),Lu=(nt(Wo(zu().concat(Pu()))),nt(Wo(zu()))),ju=Sr("initSize",[vr("numColumns"),vr("numRows")]),Uu=function(){return Sr("markers",[vr("backgroundMenu")].concat(Pu()).concat(zu()))},Wu=function(t){return Sr("markers",A(t,vr))},Gu=function(t,n,e){return function(){var t=new Error;if(t.stack!==undefined){var n=t.stack.split("\n");H(n,function(n){return 0<n.indexOf("alloy")&&!T(Qe,function(t){return-1<n.indexOf(t)})}).getOr(qe)}}(),Jo(n,n,e,er(function(e){return vt.value(function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.apply(undefined,t)})}))},Xu=function(t){return Gu(0,t,lo(tt))},Yu=function(t){return Gu(0,t,lo(et.none))},qu=function(t){return Gu(0,t,mo())},Ku=function(t){return Gu(0,t,mo())},Ju=function(t,n){return Pr(t,nt(n))},$u=function(t){return Pr(t,d)},Qu=nt(ju),Zu=function(e,o,r){return yi(function(t,n){r(t,e,o)})},ta=function(t,n,e,o,r,i){var u,a,c=Uo(t),s=Dr(n,[(u="config",a=t,Er(u,Uo(a)))]);return oa(c,s,n,e,o,r,i)},na=function(r,i,u){var t,n,e,o,a,c;return t=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var o=[e].concat(t);return e.config({name:nt(r)}).fold(function(){throw new Error("We could not find any behaviour configuration for: "+r+". Using API: "+u)},function(t){var n=Array.prototype.slice.call(o,1);return i.apply(undefined,[e,t.config,t.state].concat(n))})},n=u,e=i.toString(),o=e.indexOf(")")+1,a=e.indexOf("("),c=e.substring(a+1,o-1).split(/,\s*/),t.toFunctionAnnotation=function(){return{name:n,parameters:Fi(c.slice(0,1).concat(c.slice(3)))}},t},ea=function(t){return{key:t,value:undefined}},oa=function(e,t,o,r,n,i,u){var a=function(t){return Dt(t,o)?t[o]():et.none()},c=it(n,function(t,n){return na(o,t,n)}),s=it(i,function(t,n){return Ii(t,n)}),f=uo({},s,c,{revoke:w(ea,o),config:function(t){var n=ar(o+"-config",e,t);return{key:o,value:{config:n,me:f,configAsRaw:tn(function(){return ar(o+"-config",e,t)}),initialConfig:t,state:u}}},schema:function(){return t},exhibit:function(t,e){return a(t).bind(function(n){return Et(r,"exhibit").map(function(t){return t(e,n.config,n.state)})}).getOr(ji({}))},name:function(){return o},handlers:function(t){return a(t).map(function(t){return Ot("events",function(t,n){return{}})(r)(t.config,t.state)}).getOr({})}});return f},ra=function(t){return Bt(t)},ia=Uo([vr("fields"),vr("name"),_r("active",{}),_r("apis",{}),_r("state",Pi),_r("extra",{})]),ua=function(t){var n=ar("Creating behaviour: "+t.name,ia,t);return ta(n.fields,n.name,n.active,n.apis,n.extra,n.state)},aa=Uo([vr("branchKey"),vr("branches"),vr("name"),_r("active",{}),_r("apis",{}),_r("state",Pi),_r("extra",{})]),ca=function(t){var n,e,o,r,i,u,a,c,s=ar("Creating behaviour: "+t.name,aa,t);return n=sr(s.branchKey,s.branches),e=s.name,o=s.active,r=s.apis,i=s.extra,u=s.state,c=Dr(e,[Er("config",a=n)]),oa(a,c,e,o,r,i,u)},sa=nt(undefined),fa=/* */Object.freeze({events:function(a){return ri([ci(Mn(),function(r,i){var t,n,u=a.channels,e=Z(u),o=(t=e,(n=i).universal()?t:V(t,function(t){return E(n.channels(),t)}));M(o,function(t){var n=u[t],e=n.schema,o=ar("channel["+t+"] data\nReceiver: "+Ye(r.element()),e,i.data());n.onReceive(r,o)})})])}}),la=[br("channels",or(vt.value,Uo([qu("onReceive"),_r("schema",fr())])))],da=ua({fields:la,name:"receiving",active:fa}),ma=/* */Object.freeze({exhibit:function(t,n){return ji({classes:[],styles:n.useFixed?{}:{position:"relative"}})}}),ga=function(e,o){return{left:nt(e),top:nt(o),translate:function(t,n){return ga(e+t,o+n)}}},pa=ga,ha=function(t,n){return t!==undefined?t:n!==undefined?n:0},va=function(t){var n,e,o=t.dom().ownerDocument,r=o.body,i=(n=Zn.fromDom(o),(e=n.dom())===e.window&&n instanceof x.Window?n:Ne(n)?e.defaultView||e.parentWindow:null),u=o.documentElement,a=ha(i.pageYOffset,u.scrollTop),c=ha(i.pageXOffset,u.scrollLeft),s=ha(u.clientTop,r.clientTop),f=ha(u.clientLeft,r.clientLeft);return ba(t).translate(c-f,a-s)},ba=function(t){var n,e,o,r=t.dom(),i=r.ownerDocument,u=i.body,a=Zn.fromDom(i.documentElement);return u===r?pa(u.offsetLeft,u.offsetTop):(n=t,e=a||Zn.fromDom(x.document.documentElement),ti(n,w(he,e)).isSome()?(o=r.getBoundingClientRect(),pa(o.left,o.top)):pa(0,0))},ya=(Tn.detect().browser.isSafari(),function(t){var n=t!==undefined?t.dom():x.document,e=n.body.scrollLeft||n.documentElement.scrollLeft,o=n.body.scrollTop||n.documentElement.scrollTop;return pa(e,o)});function xa(o,r){var t=function(t){var n=r(t);if(n<=0||null===n){var e=mu(t,o);return parseFloat(e)||0}return n},i=function(r,t){return U(t,function(t,n){var e=mu(r,n),o=e===undefined?0:parseInt(e,10);return isNaN(o)?t:t+o},0)};return{set:function(t,n){if(!_(n)&&!n.match(/^[0-9]+$/))throw new Error(o+".set accepts only positive integer values. Value was "+n);var e=t.dom();au(e)&&(e.style[o]=n+"px")},get:t,getOuter:t,aggregate:i,max:function(t,n,e){var o=i(t,e);return o<n?n-o:0}}}var wa=xa("width",function(t){return t.dom().offsetWidth}),Sa=function(t){return wa.get(t)},ka=function(t){return wa.getOuter(t)},Ca=xa("height",function(t){var n=t.dom();return $r(t)?n.getBoundingClientRect().height:n.offsetHeight}),Oa=function(t){return Ca.get(t)},Ea=function(t){return Ca.getOuter(t)},Ta=oe(["x","y","width","height","maxHeight","direction","classes","label","candidateYforTest"],[]),Ba=te("position","left","top","right","bottom"),Aa=bt([{southeast:[]},{southwest:[]},{northeast:[]},{northwest:[]},{south:[]},{north:[]},{east:[]},{west:[]}]),Da=Aa.southeast,_a=Aa.southwest,Ma=Aa.northeast,Fa=Aa.northwest,Ia=Aa.south,Va=Aa.north,Ra=Aa.east,Ha=Aa.west,Na=te("point","width","height"),Pa=te("x","y","width","height"),za=function(t,n,e,o){return{x:nt(t),y:nt(n),width:nt(e),height:nt(o),right:nt(t+e),bottom:nt(n+o)}},La=function(t){var n=va(t),e=ka(t),o=Ea(t);return za(n.left(),n.top(),e,o)},ja=function(o,t){return o.view(t).fold(nt([]),function(t){var n=o.owner(t),e=ja(o,n);return[t].concat(e)})},Ua=/* */Object.freeze({view:function(t){return(t.dom()===x.document?et.none():et.from(t.dom().defaultView.frameElement)).map(Zn.fromDom)},owner:function(t){return ve(t)}}),Wa=function(o){var t,n,e,r,i=Zn.fromDom(x.document),u=ya(i);return(t=o,e=(n=Ua).owner(t),r=ja(n,e),et.some(r)).fold(w(va,o),function(t){var n=ba(o),e=R(t,function(t,n){var e=ba(n);return{left:t.left+e.left(),top:t.top+e.top()}},{left:0,top:0});return pa(e.left+n.left()+u.left(),e.top+n.top()+u.top())})},Ga=function(){var t=x.window.innerWidth,n=x.window.innerHeight,e=Zn.fromDom(x.document),o=ya(e);return za(o.left(),o.top(),t,n)},Xa=bt([{none:[]},{relative:["x","y","width","height"]},{fixed:["x","y","width","height"]}]),Ya=function(t,n,e,o,r,i){var u,a,c,s,f,l,d,m,g,p=n.x()-e,h=n.y()-o,v=r-(p+n.width()),b=i-(h+n.height()),y=et.some(p),x=et.some(h),w=et.some(v),S=et.some(b),k=et.none();return u=n.direction(),a=function(){return Ba(t,y,x,k,k)},c=function(){return Ba(t,k,x,w,k)},s=function(){return Ba(t,y,k,k,S)},f=function(){return Ba(t,k,k,w,S)},l=function(){return Ba(t,y,x,k,k)},d=function(){return Ba(t,y,k,k,S)},m=function(){return Ba(t,y,x,k,k)},g=function(){return Ba(t,k,x,w,k)},u.fold(a,c,s,f,l,d,m,g)},qa=function(t,n){var e=w(Wa,n),o=t.fold(e,e,function(){var t=ya();return Wa(n).translate(-t.left(),-t.top())}),r=ka(n),i=Ea(n);return za(o.left(),o.top(),r,i)},Ka=Xa.relative,Ja=Xa.fixed,$a=te("anchorBox","origin"),Qa=bt([{fit:["reposition"]},{nofit:["reposition","deltaW","deltaH"]}]),Za=function(t,H,N,P,z){var L=N.width(),j=N.height(),o=function(t,o,r,i){var n,e,u,a,c,s,f,l,d,m,g,p,h,v,b,y,x,w,S,k,C,O,E,T,B,A,D,_,M,F,I,V,R=t(H,N,P);return(e=L,u=j,a=z,d=(n=R).x(),m=n.y(),g=n.bubble().offset().left(),p=n.bubble().offset().top(),h=a.x(),v=a.y(),b=a.width(),y=a.height(),k=v<=(w=m+p),C=(S=h<=(x=d+g))&&k,O=x+e<=h+b&&w+u<=v+y,E=S?Math.min(e,h+b-x):Math.abs(h-(x+e)),T=k?Math.min(u,v+y-w):Math.abs(v-(w+u)),B=a.x()+a.width(),A=Math.max(a.x(),x),D=Math.min(A,B),M=nt((_=k?w:w+(u-T))+T-v),F=nt(v+y-_),c=n.direction(),f=s=F,l=M,I=c.fold(s,s,l,l,s,l,f,f),V=Ta({x:D,y:_,width:E,height:T,maxHeight:I,direction:n.direction(),classes:{on:n.bubble().classesOn(),off:n.bubble().classesOff()},label:n.label(),candidateYforTest:w}),C&&O?Qa.fit(V):Qa.nofit(V,E,T)).fold(Qa.fit,function(t,n,e){return i<e||r<n?Qa.nofit(t,n,e):Qa.nofit(o,r,i)})};return U(t,function(t,n){var e=w(o,n);return t.fold(Qa.fit,e)},Qa.nofit(Ta({x:H.x(),y:H.y(),width:N.width(),height:N.height(),maxHeight:N.height(),direction:Da(),classes:[],label:"none",candidateYforTest:H.y()}),-1,-1)).fold(d,d)},tc=function(t,n,e,o){vu(n,"max-height");var r,i={width:nt(ka(r=n)),height:nt(Ea(r))};return Za(o.preference(),t,i,e,o.bounds())},nc=function(t,n,e){var o,r,i=function(t){return t+"px"},u=(o=e.origin(),r=n,o.fold(function(){return Ba("absolute",et.some(r.x()),et.some(r.y()),et.none(),et.none())},function(t,n,e,o){return Ya("absolute",r,t,n,e,o)},function(t,n,e,o){return Ya("fixed",r,t,n,e,o)}));du(t,{position:et.some(u.position()),left:u.left().map(i),top:u.top().map(i),right:u.right().map(i),bottom:u.bottom().map(i)})},ec=function(t,n){var e,o,r;e=t,o=Math.floor(n),r=Ca.max(e,o,["margin-top","border-top-width","padding-top","padding-bottom","border-bottom-width","margin-bottom"]),fu(e,"max-height",r+"px")},oc=nt(function(t,n){ec(t,n),lu(t,{"overflow-x":"hidden","overflow-y":"auto"})}),rc=nt(function(t,n){ec(t,n)}),ic=oe(["bounds","origin","preference","maxHeightFunction"],[]),uc=function(t,n,e,o,r,i){var u,a,c,s,f,l=(u=i,a="maxHeightFunction",c=oc(),u[a]===undefined?c:u[a]),d=t.anchorBox(),m=t.origin(),g=ic({bounds:(s=m,f=r,f.fold(function(){return s.fold(Ga,Ga,za)},function(t){return s.fold(t,t,za)})),origin:m,preference:o,maxHeightFunction:l});ac(d,n,e,g)},ac=function(t,n,e,o){var r,i,u,a,c=tc(t,n,e,o);nc(n,c,o),r=n,i=c.classes(),uu(r,i.off),iu(r,i.on),u=n,a=c,o.maxHeightFunction()(u,a.maxHeight())},cc=["valignCentre","alignLeft","alignRight","alignCentre","top","bottom","left","right"],sc=function(t,n,e){var r=function(t){return Et(e,t).getOr([])},o=function(t,n,e){var o=Y(cc,e);return{offset:function(){return pa(t,n)},classesOn:function(){return j(e,r)},classesOff:function(){return j(o,r)}}};return{southeast:function(){return o(-t,n,["top","alignLeft"])},southwest:function(){return o(t,n,["top","alignRight"])},south:function(){return o(-t/2,n,["top","alignCentre"])},northeast:function(){return o(-t,-n,["bottom","alignLeft"])},northwest:function(){return o(t,-n,["bottom","alignRight"])},north:function(){return o(-t/2,-n,["bottom","alignCentre"])},east:function(){return o(t,-n/2,["valignCentre","left"])},west:function(){return o(-t,-n/2,["valignCentre","right"])}}},fc=function(){return sc(0,0,{})},lc=te("x","y","bubble","direction","label"),dc=function(t){return t.x()},mc=function(t,n){return t.x()+t.width()/2-n.width()/2},gc=function(t,n){return t.x()+t.width()-n.width()},pc=function(t,n){return t.y()-n.height()},hc=function(t){return t.y()+t.height()},vc=function(t,n){return t.y()+t.height()/2-n.height()/2},bc=function(t,n,e){return lc(dc(t),hc(t),e.southeast(),Da(),"layout-se")},yc=function(t,n,e){return lc(gc(t,n),hc(t),e.southwest(),_a(),"layout-sw")},xc=function(t,n,e){return lc(dc(t),pc(t,n),e.northeast(),Ma(),"layout-ne")},wc=function(t,n,e){return lc(gc(t,n),pc(t,n),e.northwest(),Fa(),"layout-nw")},Sc=function(t,n,e){return lc(mc(t,n),pc(t,n),e.north(),Va(),"layout-n")},kc=function(t,n,e){return lc(mc(t,n),hc(t),e.south(),Ia(),"layout-s")},Cc=function(t,n,e){return lc((o=t).x()+o.width(),vc(t,n),e.east(),Ra(),"layout-e");var o},Oc=function(t,n,e){return lc((o=n,t.x()-o.width()),vc(t,n),e.west(),Ha(),"layout-w");var o},Ec=function(){return[bc,yc,xc,wc,kc,Sc,Cc,Oc]},Tc=function(){return[yc,bc,wc,xc,kc,Sc,Cc,Oc]},Bc=function(t){return t},Ac=function(n,e){return function(t){return"rtl"===Dc(t)?e:n}},Dc=function(t){return"rtl"===mu(t,"direction")?"rtl":"ltr"},_c=function(){return Dr("layouts",[vr("onLtr"),vr("onRtl")])},Mc=function(n,t,e,o){var r=t.layouts.map(function(t){return t.onLtr(n)}).getOr(e),i=t.layouts.map(function(t){return t.onRtl(n)}).getOr(o);return Ac(r,i)(n)},Fc=[vr("hotspot"),Or("bubble"),_r("overrides",{}),_c(),Ju("placement",function(t,n,e){var o=n.hotspot,r=qa(e,o.element()),i=Mc(t.element(),n,Ec(),Tc());return et.some(Bc({anchorBox:r,bubble:n.bubble.getOr(fc()),overrides:n.overrides,layouts:i,placer:et.none()}))})],Ic=[vr("x"),vr("y"),_r("height",0),_r("width",0),_r("bubble",fc()),_r("overrides",{}),_c(),Ju("placement",function(t,n,e){var o=za(n.x,n.y,n.width,n.height),r=Mc(t.element(),n,Ec(),Tc());return et.some(Bc({anchorBox:o,bubble:n.bubble,overrides:n.overrides,layouts:r,placer:et.none()}))})],Vc=(bt([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),bt([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}])),Rc=te("start","soffset","finish","foffset"),Hc=Vc.exact,Nc=function(t,n,e,o){var r,i,u,a,c,s=(i=n,u=e,a=o,(c=ve(r=t).dom().createRange()).setStart(r.dom(),i),c.setEnd(u.dom(),a),c),f=he(t,e)&&n===o;return s.collapsed&&!f},Pc=function(t,n,e){var o,r,i=t.document.createRange();return o=i,n.fold(function(t){o.setStartBefore(t.dom())},function(t,n){o.setStart(t.dom(),n)},function(t){o.setStartAfter(t.dom())}),r=i,e.fold(function(t){r.setEndBefore(t.dom())},function(t,n){r.setEnd(t.dom(),n)},function(t){r.setEndAfter(t.dom())}),i},zc=function(t,n,e,o,r){var i=t.document.createRange();return i.setStart(n.dom(),e),i.setEnd(o.dom(),r),i},Lc=function(t){return{left:nt(t.left),top:nt(t.top),right:nt(t.right),bottom:nt(t.bottom),width:nt(t.width),height:nt(t.height)}},jc=bt([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),Uc=function(t,n,e){return n(Zn.fromDom(e.startContainer),e.startOffset,Zn.fromDom(e.endContainer),e.endOffset)},Wc=function(t,n){var r,e,o,i=(r=t,n.match({domRange:function(t){return{ltr:nt(t),rtl:et.none}},relative:function(t,n){return{ltr:tn(function(){return Pc(r,t,n)}),rtl:tn(function(){return et.some(Pc(r,n,t))})}},exact:function(t,n,e,o){return{ltr:tn(function(){return zc(r,t,n,e,o)}),rtl:tn(function(){return et.some(zc(r,e,o,t,n))})}}}));return(o=(e=i).ltr()).collapsed?e.rtl().filter(function(t){return!1===t.collapsed}).map(function(t){return jc.rtl(Zn.fromDom(t.endContainer),t.endOffset,Zn.fromDom(t.startContainer),t.startOffset)}).getOrThunk(function(){return Uc(0,jc.ltr,o)}):Uc(0,jc.ltr,o)},Gc=function v_(e,o){var r=function(t){return e(t)?et.from(t.dom().nodeValue):et.none()},t=Tn.detect().browser,n=t.isIE()&&10===t.version.major?function(t){try{return r(t)}catch(n){return et.none()}}:r;return{get:function(t){if(!e(t))throw new Error("Can only get "+o+" value of a "+o+" node");return n(t).getOr("")},getOption:n,set:function(t,n){if(!e(t))throw new Error("Can only set raw "+o+" value of a "+o+" node");t.dom().nodeValue=n}}}(He,"text"),Xc=function(t){return Gc.get(t)},Yc=(document.caretPositionFromPoint||document.caretRangeFromPoint,function(t,n){return ge(n,t)}),qc=function(t){var n=Zn.fromDom(t.anchorNode),e=Zn.fromDom(t.focusNode);return Nc(n,t.anchorOffset,e,t.focusOffset)?et.some(Rc(n,t.anchorOffset,e,t.focusOffset)):function(t){if(0<t.rangeCount){var n=t.getRangeAt(0),e=t.getRangeAt(t.rangeCount-1);return et.some(Rc(Zn.fromDom(n.startContainer),n.startOffset,Zn.fromDom(e.endContainer),e.endOffset))}return et.none()}(t)},Kc=function(t,n){var i,e,o,r,u=Wc(i=t,n).match({ltr:function(t,n,e,o){var r=i.document.createRange();return r.setStart(t.dom(),n),r.setEnd(e.dom(),o),r},rtl:function(t,n,e,o){var r=i.document.createRange();return r.setStart(e.dom(),o),r.setEnd(t.dom(),n),r}});return o=(e=u).getClientRects(),0<(r=0<o.length?o[0]:e.getBoundingClientRect()).width||0<r.height?et.some(r).map(Lc):et.none()},Jc=te("element","offset"),$c=bt([{screen:["point"]},{absolute:["point","scrollLeft","scrollTop"]}]),Qc=function(t){return t.fold(function(t){return t},function(t,n,e){return t.translate(-n,-e)})},Zc=function(t){return t.fold(function(t){return t},function(t,n,e){return t})},ts=function(t){return U(t,function(t,n){return t.translate(n.left(),n.top())},pa(0,0))},ns=function(t){var n=A(t,Zc);return ts(n)},es=$c.screen,os=$c.absolute,rs=function(t,n,e){var o,r,i,u=ve(t.element()),a=ya(u),c=(o=t,r=e,i=be(r.root).dom(),et.from(i.frameElement).map(Zn.fromDom).filter(function(t){var n=ve(t),e=ve(o.element());return he(n,e)}).map(va)).getOr(a);return os(c,a.left(),a.top())},is=function(t,n,e,o){var r=t,i=n,u=e,a=o;t<0&&(r=0,u=e+t),n<0&&(i=0,a=o+n);var c=es(pa(r,i));return et.some(Na(c,u,a))},us=function(t,c,s,f,l){return t.map(function(t){var n,e,o,r=[c,t.point()],i=(n=function(){return ns(r)},e=function(){return ns(r)},o=function(){return t=A(r,Qc),ts(t);var t},f.fold(n,e,o)),u=Pa(i.left(),i.top(),t.width(),t.height()),a=Mc(l,s,s.showAbove?[xc,wc,bc,yc,Sc,kc]:[bc,yc,xc,wc,kc,kc],s.showAbove?[wc,xc,yc,bc,Sc,kc]:[yc,bc,wc,xc,kc,Sc]);return Bc({anchorBox:u,bubble:s.bubble.getOr(fc()),overrides:s.overrides,layouts:a,placer:et.none()})})},as=te("element","offset"),cs=function(t,n){return He(t)?as(t,n):function(t,n){var e=we(t);if(0===e.length)return Jc(t,n);if(n<e.length)return Jc(e[n],0);var o=e[e.length-1],r=He(o)?Xc(o).length:we(o).length;return Jc(o,r)}(t,n)},ss=function(n,t){return t.getSelection.getOrThunk(function(){return function(){return t=n,et.from(t.getSelection()).filter(function(t){return 0<t.rangeCount}).bind(qc);var t}})().map(function(t){var n=cs(t.start(),t.soffset()),e=cs(t.finish(),t.foffset());return Rc(n.element(),n.offset(),e.element(),e.offset())})},fs=[Or("getSelection"),vr("root"),Or("bubble"),_c(),_r("overrides",{}),_r("showAbove",!1),Ju("placement",function(t,n,e){var o=be(n.root).dom(),r=rs(t,0,n),i=ss(o,n).bind(function(t){var n;return Kc(o,(n=t,Vc.exact(n.start(),n.soffset(),n.finish(),n.foffset()))).orThunk(function(){var n=Zn.fromText("\ufeff");return Ce(t.start(),n),Kc(o,Hc(n,0,n,1)).map(function(t){return De(n),t})}).bind(function(t){return is(t.left(),t.top(),t.width(),t.height())})}),u=ss(o,n).bind(function(t){return Re(t.start())?et.some(t.start()):ye(t.start())}).getOr(t.element());return us(i,r,n,e,u)})],ls=[vr("node"),vr("root"),Or("bubble"),_c(),_r("overrides",{}),_r("showAbove",!1),Ju("placement",function(r,i,u){var a=rs(r,0,i);return i.node.bind(function(t){var n=t.dom().getBoundingClientRect(),e=is(n.left,n.top,n.width,n.height),o=i.node.getOr(r.element());return us(e,a,i,u,o)})})],ds=function(t){return t.x()+t.width()},ms=function(t,n){return t.x()-n.width()},gs=function(t,n){return t.y()-n.height()+t.height()},ps=function(t){return t.y()},hs=function(t,n,e){return lc(ds(t),ps(t),e.southeast(),Da(),"link-layout-se")},vs=function(t,n,e){return lc(ms(t,n),ps(t),e.southwest(),_a(),"link-layout-sw")},bs=function(t,n,e){return lc(ds(t),gs(t,n),e.northeast(),Ma(),"link-layout-ne")},ys=function(t,n,e){return lc(ms(t,n),gs(t,n),e.northwest(),Fa(),"link-layout-nw")},xs=[vr("item"),_c(),_r("overrides",{}),Ju("placement",function(t,n,e){var o=qa(e,n.item.element()),r=Mc(t.element(),n,[hs,vs,bs,ys],[vs,hs,ys,bs]);return et.some(Bc({anchorBox:o,bubble:fc(),overrides:n.overrides,layouts:r,placer:et.none()}))})],ws=sr("anchor",{selection:fs,node:ls,hotspot:Fc,submenu:xs,makeshift:Ic}),Ss=function(t,n,e,o,r){var i,u=(i=e.anchorBox,$a(i,n));uc(u,r.element(),e.bubble,e.layouts,o,e.overrides)},ks=function(n,t,e,o,r,i){var u=ar("positioning anchor.info",ws,o);fu(r.element(),"position","fixed");var a=pu(r.element(),"visibility");fu(r.element(),"visibility","hidden");var c,s,f,l=t.useFixed?Ja(0,0,x.window.innerWidth,x.window.innerHeight):(s=va((c=n).element()),f=c.element().dom().getBoundingClientRect(),Ka(s.left(),s.top(),f.width,f.height)),d=u.placement,m=i.map(function(t){return function(){return La(t)}}).or(t.getBounds);d(n,u,l).each(function(t){t.placer.getOr(Ss)(n,l,t,m,r)}),a.fold(function(){vu(r.element(),"visibility")},function(t){fu(r.element(),"visibility",t)}),pu(r.element(),"left").isNone()&&pu(r.element(),"top").isNone()&&pu(r.element(),"right").isNone()&&pu(r.element(),"bottom").isNone()&&pu(r.element(),"position").is("fixed")&&vu(r.element(),"position")},Cs=/* */Object.freeze({position:function(t,n,e,o,r){var i=et.none();ks(t,n,e,o,r,i)},positionWithin:ks,getMode:function(t,n,e){return n.useFixed?"fixed":"absolute"}}),Os=[_r("useFixed",!1),Or("getBounds")],Es=ua({fields:Os,name:"positioning",active:ma,apis:Cs}),Ts=function(t){Ur(t,Wn());var n=t.components();M(n,Ts)},Bs=function(t){var n=t.components();M(n,Bs),Ur(t,Un())},As=function(t,n){Ds(t,n,Te)},Ds=function(t,n,e){t.getSystem().addToWorld(n),e(t.element(),n.element()),$r(t.element())&&Bs(n),t.syncComponents()},_s=function(t){Ts(t),De(t.element()),t.getSystem().removeFromWorld(t)},Ms=function(n){var t=ye(n.element()).bind(function(t){return n.getSystem().getByDom(t).fold(et.none,et.some)});_s(n),t.each(function(t){t.syncComponents()})},Fs=function(t){var n=t.components();M(n,_s),Ae(t.element()),t.syncComponents()},Is=function(t,n){Vs(t,n,Te)},Vs=function(t,n,e){e(t,n.element());var o=we(n.element());M(o,function(t){n.getByDom(t).each(Bs)})},Rs=function(n){var t=we(n.element());M(t,function(t){n.getByDom(t).each(Ts)}),De(n.element())},Hs=function(t,n,e,o){var r=function(n,t,e,o){e.get().each(function(t){Fs(n)});var r=t.getAttachPoint(n);As(r,n);var i=n.getSystem().build(o);return As(n,i),e.set(i),i}(t,n,e,o);return n.onOpen(t,r),r},Ns=function(n,e,o){o.get().each(function(t){Fs(n),Ms(n),e.onClose(n,t),o.clear()})},Ps=function(t,n,e){return e.isOpen()},zs=function(t,n,e){var o,r,i,u,a=n.getAttachPoint(t);fu(t.element(),"position",Es.getMode(a)),o=t,r="visibility",i=n.cloakVisibilityAttr,u="hidden",pu(o.element(),r).fold(function(){We(o.element(),i)},function(t){ze(o.element(),i,t)}),fu(o.element(),r,u)},Ls=function(t,n,e){var o;o=t.element(),T(["top","left","right","bottom"],function(t){return pu(o,t).isSome()})||vu(t.element(),"position"),function(t,n,e){if(Ue(t.element(),e)){var o=je(t.element(),e);fu(t.element(),n,o)}else vu(t.element(),n)}(t,"visibility",n.cloakVisibilityAttr)},js=/* */Object.freeze({cloak:zs,decloak:Ls,open:Hs,openWhileCloaked:function(t,n,e,o,r){zs(t,n,e),Hs(t,n,e,o),r(),Ls(t,n,e)},close:Ns,isOpen:Ps,isPartOf:function(n,e,t,o){return Ps(0,0,t)&&t.get().exists(function(t){return e.isPartOf(n,t,o)})},getState:function(t,n,e){return e.get()}}),Us=/* */Object.freeze({events:function(e,o){return ri([ci(Nn(),function(t,n){Ns(t,e,o)})])}}),Ws=[Xu("onOpen"),Xu("onClose"),vr("isPartOf"),vr("getAttachPoint"),_r("cloakVisibilityAttr","data-precloak-visibility")],Gs=ua({fields:Ws,name:"sandboxing",active:Us,apis:js,state:/* */Object.freeze({init:function(){var n=_t(et.none()),t=nt("not-implemented");return zi({readState:t,isOpen:function(){return n.get().isSome()},clear:function(){n.set(et.none())},set:function(t){n.set(et.some(t))},get:function(t){return n.get()}})}})}),Xs=nt("dismiss.popups"),Ys=nt("mouse.released"),qs=Uo([_r("isExtraPart",nt(!1)),Dr("fireEventInstead",[_r("event",Gn())])]),Ks=function(t){var n=Js(t);return da.config(n)},Js=function(t){var e=ar("Dismissal",qs,t);return{channels:Tt(Xs(),{schema:Uo([vr("target")]),onReceive:function(n,t){Gs.isOpen(n)&&(Gs.isPartOf(n,t.target)||e.isExtraPart(n,t.target)||e.fireEventInstead.fold(function(){return Gs.close(n)},function(t){return Ur(n,t.event)}))}})}},$s=function(o,t){return Nr(o,{},A(t,function(t){return n=t.name(),e="Cannot configure "+t.name()+" for "+o,Jo(n,n,go(),jo(function(t){return Co("The field: "+n+" is forbidden. "+e)}));var n,e}).concat([Pr("dump",d)]))},Qs=function(t){return t.dump},Zs=function(t,n){return uo({},t.dump,ra(n))},tf={field:$s,augment:Zs,get:Qs},nf="placeholder",ef=bt([{single:["required","valueThunk"]},{multiple:["required","valueThunks"]}]),of=function(t,n,e,o){return e.uiType===nf?(i=e,u=o,(r=t).exists(function(t){return t!==i.owner})?ef.single(!0,nt(i)):Et(u,i.name).fold(function(){throw new Error("Unknown placeholder component: "+i.name+"\nKnown: ["+Z(u)+"]\nNamespace: "+r.getOr("none")+"\nSpec: "+Vo(i,null,2))},function(t){return t.replace()})):ef.single(!1,nt(e));var r,i,u},rf=function(i,u,a,c){return of(i,0,a,c).fold(function(t,n){var e=n(u,a.config,a.validated),o=Et(e,"components").getOr([]),r=j(o,function(t){return rf(i,u,t,c)});return[uo({},e,{components:r})]},function(t,n){var e=n(u,a.config,a.validated);return a.validated.preprocess.getOr(d)(e)})},uf=function(n,e,t,o){return j(t,function(t){return rf(n,e,t,o)})},cf=function(n,e,t,o){var r=it(o,function(t,n){return o=t,r=!1,{name:nt(e=n),required:function(){return o.fold(function(t,n){return t},function(t,n){return t})},used:function(){return r},replace:function(){if(!0===r)throw new Error("Trying to use the same placeholder more than once: "+e);return r=!0,o}};var e,o,r}),i=uf(n,e,t,r);return rt(r,function(t){if(!1===t.used()&&t.required())throw new Error("Placeholder: "+t.name()+" was not found in components list\nNamespace: "+n.getOr("none")+"\nComponents: "+Vo(e.components,null,2))}),i},sf=ef.single,ff=ef.multiple,lf=nt(nf),mf=bt([{required:["data"]},{external:["data"]},{optional:["data"]},{group:["data"]}]),gf=_r("factory",{sketch:d}),pf=_r("schema",[]),hf=vr("name"),vf=Jo("pname","pname",po(function(t){return"<alloy."+ro(t.name)+">"}),fr()),yf=Pr("schema",function(){return[Or("preprocess")]}),xf=_r("defaults",nt({})),wf=_r("overrides",nt({})),Sf=Wo([gf,pf,hf,vf,xf,wf]),kf=Wo([gf,pf,hf,xf,wf]),Cf=Wo([gf,pf,hf,vf,xf,wf]),Of=Wo([gf,yf,hf,vr("unit"),vf,xf,wf]),Ef=function(t){return t.fold(et.some,et.none,et.some,et.some)},Tf=function(t){var n=function(t){return t.name};return t.fold(n,n,n,n)},Bf=function(e,o){return function(t){var n=ar("Converting part type",o,t);return e(n)}},Af=Bf(mf.required,Sf),Df=Bf(mf.external,kf),_f=Bf(mf.optional,Cf),Mf=Bf(mf.group,Of),Ff=nt("entirety"),If=/* */Object.freeze({required:Af,external:Df,optional:_f,group:Mf,asNamedPart:Ef,name:Tf,asCommon:function(t){return t.fold(d,d,d,d)},original:Ff}),Vf=function(t,n,e,o){return wt(n.defaults(t,e,o),e,{uid:t.partUids[n.name]},n.overrides(t,e,o))},Rf=function(r,t){var n={};return M(t,function(t){Ef(t).each(function(e){var o=Hf(r,e.pname);n[e.name]=function(t){var n=ar("Part: "+e.name+" in "+r,Wo(e.schema),t);return uo({},o,{config:t,validated:n})}})}),n},Hf=function(t,n){return{uiType:lf(),owner:t,name:n}},Nf=function(t,n,e){return{uiType:lf(),owner:t,name:n,config:e,validated:{}}},Pf=function(t){return j(t,function(t){return t.fold(et.none,et.some,et.none,et.none).map(function(t){return Sr(t.name,t.schema.concat([$u(Ff())]))}).toArray()})},zf=function(t){return A(t,Tf)},Lf=function(t,n,e){return o=n,i={},r={},M(e,function(t){t.fold(function(o){i[o.pname]=sf(!0,function(t,n,e){return o.factory.sketch(Vf(t,o,n,e))})},function(t){var n=o.parts[t.name];r[t.name]=nt(t.factory.sketch(Vf(o,t,n[Ff()]),n))},function(o){i[o.pname]=sf(!1,function(t,n,e){return o.factory.sketch(Vf(t,o,n,e))})},function(r){i[r.pname]=ff(!0,function(n,t,e){var o=n[r.name];return A(o,function(t){return r.factory.sketch(wt(r.defaults(n,t,e),t,r.overrides(n,t)))})})})}),{internals:nt(i),externals:nt(r)};var o,i,r},jf=function(t,n,e){return cf(et.some(t),n,n.components,e)},Uf=function(t,n,e){var o=n.partUids[e];return t.getSystem().getByUid(o).toOption()},Wf=function(t,n,e){return Uf(t,n,e).getOrDie("Could not find part: "+e)},Gf=function(t,n,e){var o={},r=n.partUids,i=t.getSystem();return M(e,function(t){o[t]=i.getByUid(r[t])}),it(o,nt)},Xf=function(t,n){var e=t.getSystem();return it(n.partUids,function(t,n){return nt(e.getByUid(t))})},Yf=function(t){return Z(t.partUids)},qf=function(t,n,e){var o={},r=n.partUids,i=t.getSystem();return M(e,function(t){o[t]=i.getByUid(r[t]).getOrDie()}),it(o,nt)},Kf=function(n,t){var e=zf(t);return Bt(A(e,function(t){return{key:t,value:n+"-"+t}}))},Jf=function(n){return Jo("partUids","partUids",ho(function(t){return Kf(t.uid,n)}),fr())},$f=/* */Object.freeze({generate:Rf,generateOne:Nf,schemas:Pf,names:zf,substitutes:Lf,components:jf,defaultUids:Kf,defaultUidsSchema:Jf,getAllParts:Xf,getAllPartNames:Yf,getPart:Uf,getPartOrDie:Wf,getParts:Gf,getPartsOrDie:qf}),Qf=function(t,n,e,o,r){var i,u,a=(u=r,(0<(i=o).length?[Sr("parts",i)]:[]).concat([vr("uid"),_r("dom",{}),_r("components",[]),$u("originalSpec"),_r("debug.sketcher",{})]).concat(u));return ar(t+" [SpecSchema]",Uo(a.concat(n)),e)},Zf=function(t,n,e,o,r){var i=tl(r),u=Pf(e),a=Jf(e),c=Qf(t,n,i,u,[a]),s=Lf(0,c,e);return o(c,jf(t,c,s.internals()),i,s.externals())},tl=function(t){return t.hasOwnProperty("uid")?t:uo({},t,{uid:Ai("uid")})};function nl(t){return t.uid!==undefined}var el,ol,rl=Uo([vr("name"),vr("factory"),vr("configFields"),_r("apis",{}),_r("extraApis",{})]),il=Uo([vr("name"),vr("factory"),vr("configFields"),vr("partFields"),_r("apis",{}),_r("extraApis",{})]),ul=function(t){var i=ar("Sketcher for "+t.name,rl,t),n=it(i.apis,Ni),e=it(i.extraApis,function(t,n){return Ii(t,n)});return uo({name:nt(i.name),partFields:nt([]),configFields:nt(i.configFields),sketch:function(t){return n=i.name,e=i.configFields,o=i.factory,r=tl(t),o(Qf(n,e,r,[],[]),r);var n,e,o,r}},n,e)},al=function(t){var n=ar("Sketcher for "+t.name,il,t),e=Rf(n.name,n.partFields),o=it(n.apis,Ni),r=it(n.extraApis,function(t,n){return Ii(t,n)});return uo({name:nt(n.name),partFields:nt(n.partFields),configFields:nt(n.configFields),sketch:function(t){return Zf(n.name,n.configFields,n.partFields,n.factory,t)},parts:nt(e)},o,r)},cl=function(t){return"input"===Fe(t)&&"radio"!==je(t,"type")||"textarea"===Fe(t)},sl=/* */Object.freeze({getCurrent:function(t,n,e){return n.find(t)}}),fl=[vr("find")],ll=ua({fields:fl,name:"composing",apis:sl}),dl=function(t,n,e,o){var r=t+n;return o<r?e:r<e?o:r},ml=function(t,n,e){return t<=n?n:e<=t?e:t},gl=function(e,o,t,r){var n=Yc(e.element(),"."+o.highlightClass);M(n,function(n){T(r,function(t){return t.element()===n})||(ou(n,o.highlightClass),e.getSystem().getByDom(n).each(function(t){o.onDehighlight(e,t),Ur(t,$n())}))})},pl=function(t,n,e,o){gl(t,n,0,[o]),hl(t,n,e,o)||(eu(o.element(),n.highlightClass),n.onHighlight(t,o),Ur(o,Jn()))},hl=function(t,n,e,o){return ru(o.element(),n.highlightClass)},vl=function(t,n,e,o){var r=Yc(t.element(),"."+n.itemClass);return et.from(r[o]).fold(function(){return vt.error("No element found with index "+o)},t.getSystem().getByDom)},bl=function(n,t,e){return Iu(n.element(),"."+t.itemClass).bind(function(t){return n.getSystem().getByDom(t).toOption()})},yl=function(n,t,e){var o=Yc(n.element(),"."+t.itemClass);return(0<o.length?et.some(o[o.length-1]):et.none()).bind(function(t){return n.getSystem().getByDom(t).toOption()})},xl=function(e,n,t,o){var r=Yc(e.element(),"."+n.itemClass);return N(r,function(t){return ru(t,n.highlightClass)}).bind(function(t){var n=dl(t,o,0,r.length-1);return e.getSystem().getByDom(r[n]).toOption()})},wl=function(n,t,e){var o=Yc(n.element(),"."+t.itemClass);return Mt(A(o,function(t){return n.getSystem().getByDom(t).toOption()}))},Sl=/* */Object.freeze({dehighlightAll:function(t,n,e){return gl(t,n,0,[])},dehighlight:function(t,n,e,o){hl(t,n,e,o)&&(ou(o.element(),n.highlightClass),n.onDehighlight(t,o),Ur(o,$n()))},highlight:pl,highlightFirst:function(n,e,o){bl(n,e,o).each(function(t){pl(n,e,o,t)})},highlightLast:function(n,e,o){yl(n,e,o).each(function(t){pl(n,e,o,t)})},highlightAt:function(n,e,o,t){vl(n,e,o,t).fold(function(t){throw new Error(t)},function(t){pl(n,e,o,t)})},highlightBy:function(n,e,o,t){var r=wl(n,e,o);H(r,t).each(function(t){pl(n,e,o,t)})},isHighlighted:hl,getHighlighted:function(n,t,e){return Iu(n.element(),"."+t.highlightClass).bind(function(t){return n.getSystem().getByDom(t).toOption()})},getFirst:bl,getLast:yl,getPrevious:function(t,n,e){return xl(t,n,0,-1)},getNext:function(t,n,e){return xl(t,n,0,1)},getCandidates:wl}),kl=[vr("highlightClass"),vr("itemClass"),Xu("onHighlight"),Xu("onDehighlight")],Cl=ua({fields:kl,name:"highlighting",apis:Sl}),Ol=function(t,n,e){var o=X(t.slice(0,n)),r=X(t.slice(n+1));return H(o.concat(r),e)},El=function(t,n,e){var o=X(t.slice(0,n));return H(o,e)},Tl=function(t,n,e){var o=t.slice(0,n),r=t.slice(n+1);return H(r.concat(o),e)},Bl=function(t,n,e){var o=t.slice(n+1);return H(o,e)},Al=function(e){return function(t){var n=t.raw();return E(e,n.which)}},Dl=function(t){return function(n){return W(t,function(t){return t(n)})}},_l=function(t){return!0===t.raw().shiftKey},Ml=function(t){return!0===t.raw().ctrlKey},Fl=S(_l),Il=function(t,n){return{matches:t,classification:n}},Vl=function(t,n){return H(t,function(t){return t.matches(n)}).map(function(t){return t.classification})},Rl=function(t){t.dom().focus()},Hl=function(t){var n=t!==undefined?t.dom():x.document;return et.from(n.activeElement).map(Zn.fromDom)},Nl=function(n){return Hl(ve(n)).filter(function(t){return n.dom().contains(t.dom())})},Pl=function(t,n,e){n.exists(function(n){return e.exists(function(t){return he(t,n)})})||Wr(t,Xn(),{prevFocus:n,newFocus:e})},zl=function(){var r=function(t){return Nl(t.element())};return{get:r,set:function(t,n){var e=r(t);t.getSystem().triggerFocus(n,t.element());var o=r(t);Pl(t,e,o)}}},Ll=function(){var r=function(t){return Cl.getHighlighted(t).map(function(t){return t.element()})};return{get:r,set:function(n,t){var e=r(n);n.getSystem().getByDom(t).fold(tt,function(t){Cl.highlight(n,t)});var o=r(n);Pl(n,e,o)}}};(ol=el||(el={})).OnFocusMode="onFocus",ol.OnEnterOrSpaceMode="onEnterOrSpace",ol.OnApiMode="onApi";var jl,Ul=function(t,n,e,o,a){var c=function(n,e,t,o,r){var i=t(n,e,o,r);return Vl(i,e.event()).bind(function(t){return t(n,e,o,r)})},r={schema:function(){return t.concat([_r("focusManager",zl()),Mr("focusInside","onFocus",er(function(t){return E(["onFocus","onEnterOrSpace","onApi"],t)?vt.value(t):vt.error("Invalid value for focusInside")})),Ju("handler",r),Ju("state",n),Ju("sendFocusIn",a)])},processKey:c,toEvents:function(i,u){var t=i.focusInside!==el.OnFocusMode?et.none():a(i).map(function(e){return ci(An(),function(t,n){e(t,i,u),n.stop()})});return ri(t.toArray().concat([ci(Yt(),function(o,r){c(o,r,e,i,u).fold(function(){var n,e,t;n=o,e=r,t=Al([32].concat([13]))(e.event()),i.focusInside===el.OnEnterOrSpaceMode&&t&&zr(n,e)&&a(i).each(function(t){t(n,i,u),e.stop()})},function(t){r.stop()})}),ci(qt(),function(t,n){c(t,n,o,i,u).each(function(t){n.stop()})})]))}};return r},Wl=function(t){var n=[Or("onEscape"),Or("onEnter"),_r("selector",'[data-alloy-tabstop="true"]'),_r("firstTabstop",0),_r("useTabstopAt",nt(!0)),Or("visibilitySelector")].concat([t]),u=function(t,n){var e=t.visibilitySelector.bind(function(t){return Vu(n,t)}).getOr(n);return 0<Oa(e)},e=function(n,e){var t,o,r,i;(t=n,o=e,r=Yc(t.element(),o.selector),i=V(r,function(t){return u(o,t)}),et.from(i[o.firstTabstop])).each(function(t){e.focusManager.set(n,t)})},a=function(n,t,e,o,r){return r(t,e,function(t){return u(n=o,e=t)&&n.useTabstopAt(e);var n,e}).fold(function(){return o.cyclic?et.some(!0):et.none()},function(t){return o.focusManager.set(n,t),et.some(!0)})},i=function(n,t,e,o){var r,i,u=Yc(n.element(),e.selector);return(r=n,i=e,i.focusManager.get(r).bind(function(t){return Vu(t,i.selector)})).bind(function(t){return N(u,w(he,t)).bind(function(t){return a(n,u,t,e,o)})})},o=nt([Il(Dl([_l,Al([9])]),function(t,n,e,o){var r=e.cyclic?Ol:El;return i(t,0,e,r)}),Il(Al([9]),function(t,n,e,o){var r=e.cyclic?Tl:Bl;return i(t,0,e,r)}),Il(Al([27]),function(n,e,t,o){return t.onEscape.bind(function(t){return t(n,e)})}),Il(Dl([Fl,Al([13])]),function(n,e,t,o){return t.onEnter.bind(function(t){return t(n,e)})})]),r=nt([]);return Ul(n,Pi.init,o,r,function(){return et.some(e)})},Gl=Wl(Pr("cyclic",nt(!1))),Xl=Wl(Pr("cyclic",nt(!0))),Yl=function(t,n,e){return cl(e)&&Al([32])(n.event())?et.none():(Xr(t,e,Fn()),et.some(!0))},ql=function(t,n){return et.some(!0)},Kl=[_r("execute",Yl),_r("useSpace",!1),_r("useEnter",!0),_r("useControlEnter",!1),_r("useDown",!1)],Jl=function(t,n,e){return e.execute(t,n,t.element())},$l=Ul(Kl,Pi.init,function(t,n,e,o){var r=e.useSpace&&!cl(t.element())?[32]:[],i=e.useEnter?[13]:[],u=e.useDown?[40]:[],a=r.concat(i).concat(u);return[Il(Al(a),Jl)].concat(e.useControlEnter?[Il(Dl([Ml,Al([13])]),Jl)]:[])},function(t,n,e,o){return e.useSpace&&!cl(t.element())?[Il(Al([32]),ql)]:[]},function(){return et.none()}),Ql=function(t){var e=_t(et.none());return zi({readState:function(){return e.get().map(function(t){return{numRows:t.numRows(),numColumns:t.numColumns()}}).getOr({numRows:"?",numColumns:"?"})},setGridSize:function(t,n){e.set(et.some({numRows:nt(t),numColumns:nt(n)}))},getNumRows:function(){return e.get().map(function(t){return t.numRows()})},getNumColumns:function(){return e.get().map(function(t){return t.numColumns()})}})},Zl=/* */Object.freeze({flatgrid:Ql,init:function(t){return t.state(t)}}),td=function(i){return function(t,n,e,o){var r=i(t.element());return rd(r,t,n,e,o)}},nd=function(t,n){var e=Ac(t,n);return td(e)},ed=function(t,n){var e=Ac(n,t);return td(e)},od=function(r){return function(t,n,e,o){return rd(r,t,n,e,o)}},rd=function(n,e,t,o,r){return o.focusManager.get(e).bind(function(t){return n(e.element(),t,o,r)}).map(function(t){return o.focusManager.set(e,t),!0})},id=od,ud=od,ad=od,cd=function(t){var n,e=t.dom();return!((n=e).offsetWidth<=0&&n.offsetHeight<=0)},sd=oe(["index","candidates"],[]),fd=function(t,n,e){return ld(t,n,e,cd)},ld=function(t,n,e,o){var r,i=w(he,n),u=Yc(t,e),a=V(u,cd);return N(r=a,i).map(function(t){return sd({index:t,candidates:r})})},dd=function(t,n){return N(t,function(t){return he(n,t)})},md=function(e,t,o,n){return n(Math.floor(t/o),t%o).bind(function(t){var n=t.row()*o+t.column();return 0<=n&&n<e.length?et.some(e[n]):et.none()})},gd=function(r,t,i,u,a){return md(r,t,u,function(t,n){var e=t===i-1?r.length-t*u:u,o=dl(n,a,0,e-1);return et.some({row:nt(t),column:nt(o)})})},pd=function(i,t,u,a,c){return md(i,t,a,function(t,n){var e=dl(t,c,0,u-1),o=e===u-1?i.length-e*a:a,r=ml(n,0,o-1);return et.some({row:nt(e),column:nt(r)})})},hd=[vr("selector"),_r("execute",Yl),Yu("onEscape"),_r("captureTab",!1),Qu()],vd=function(n,e,t){Iu(n.element(),e.selector).each(function(t){e.focusManager.set(n,t)})},bd=function(r){return function(t,n,e,o){return fd(t,n,e.selector).bind(function(t){return r(t.candidates(),t.index(),o.getNumRows().getOr(e.initSize.numRows),o.getNumColumns().getOr(e.initSize.numColumns))})}},yd=function(t,n,e,o){return e.captureTab?et.some(!0):et.none()},xd=bd(function(t,n,e,o){return gd(t,n,e,o,-1)}),wd=bd(function(t,n,e,o){return gd(t,n,e,o,1)}),Sd=bd(function(t,n,e,o){return pd(t,n,e,o,-1)}),kd=bd(function(t,n,e,o){return pd(t,n,e,o,1)}),Cd=nt([Il(Al([37]),nd(xd,wd)),Il(Al([39]),ed(xd,wd)),Il(Al([38]),id(Sd)),Il(Al([40]),ud(kd)),Il(Dl([_l,Al([9])]),yd),Il(Dl([Fl,Al([9])]),yd),Il(Al([27]),function(t,n,e,o){return e.onEscape(t,n)}),Il(Al([32].concat([13])),function(n,e,o,t){return(r=n,i=o,i.focusManager.get(r).bind(function(t){return Vu(t,i.selector)})).bind(function(t){return o.execute(n,e,t)});var r,i})]),Od=nt([Il(Al([32]),ql)]),Ed=Ul(hd,Ql,Cd,Od,function(){return et.some(vd)}),Td=function(t,n,e,i){var u=function(t,n,e){var o,r=dl(n,i,0,e.length-1);return r===t?et.none():(o=e[r],"button"===Fe(o)&&"disabled"===je(o,"disabled")?u(t,r,e):et.from(e[r]))};return fd(t,e,n).bind(function(t){var n=t.index(),e=t.candidates();return u(n,n,e)})},Bd=[vr("selector"),_r("getInitial",et.none),_r("execute",Yl),Yu("onEscape"),_r("executeOnMove",!1),_r("allowVertical",!0)],Ad=function(n,e,o){return(t=n,r=o,r.focusManager.get(t).bind(function(t){return Vu(t,r.selector)})).bind(function(t){return o.execute(n,e,t)});var t,r},Dd=function(n,e){e.getInitial(n).orThunk(function(){return Iu(n.element(),e.selector)}).each(function(t){e.focusManager.set(n,t)})},_d=function(t,n,e){return Td(t,e.selector,n,-1)},Md=function(t,n,e){return Td(t,e.selector,n,1)},Fd=function(o){return function(t,n,e){return o(t,n,e).bind(function(){return e.executeOnMove?Ad(t,n,e):et.some(!0)})}},Id=function(t,n,e,o){return e.onEscape(t,n)},Vd=nt([Il(Al([32]),ql)]),Rd=Ul(Bd,Pi.init,function(t,n,e,o){var r=[37].concat(e.allowVertical?[38]:[]),i=[39].concat(e.allowVertical?[40]:[]);return[Il(Al(r),Fd(nd(_d,Md))),Il(Al(i),Fd(ed(_d,Md))),Il(Al([13]),Ad),Il(Al([32]),Ad),Il(Al([27]),Id)]},Vd,function(){return et.some(Dd)}),Hd=oe(["rowIndex","columnIndex","cell"],[]),Nd=function(t,n,e){return et.from(t[n]).bind(function(t){return et.from(t[e]).map(function(t){return Hd({rowIndex:n,columnIndex:e,cell:t})})})},Pd=function(t,n,e,o){var r=t[n].length,i=dl(e,o,0,r-1);return Nd(t,n,i)},zd=function(t,n,e,o){var r=dl(e,o,0,t.length-1),i=t[r].length,u=ml(n,0,i-1);return Nd(t,r,u)},Ld=function(t,n,e,o){var r=t[n].length,i=ml(e+o,0,r-1);return Nd(t,n,i)},jd=function(t,n,e,o){var r=ml(e+o,0,t.length-1),i=t[r].length,u=ml(n,0,i-1);return Nd(t,r,u)},Ud=[Sr("selectors",[vr("row"),vr("cell")]),_r("cycles",!0),_r("previousSelector",et.none),_r("execute",Yl)],Wd=function(n,e){e.previousSelector(n).orThunk(function(){var t=e.selectors;return Iu(n.element(),t.cell)}).each(function(t){e.focusManager.set(n,t)})},Gd=function(t,n){return function(e,o,i){var u=i.cycles?t:n;return Vu(o,i.selectors.row).bind(function(t){var n=Yc(t,i.selectors.cell);return dd(n,o).bind(function(o){var r=Yc(e,i.selectors.row);return dd(r,t).bind(function(t){var n,e=(n=i,A(r,function(t){return Yc(t,n.selectors.cell)}));return u(e,t,o).map(function(t){return t.cell()})})})})}},Xd=Gd(function(t,n,e){return Pd(t,n,e,-1)},function(t,n,e){return Ld(t,n,e,-1)}),Yd=Gd(function(t,n,e){return Pd(t,n,e,1)},function(t,n,e){return Ld(t,n,e,1)}),qd=Gd(function(t,n,e){return zd(t,e,n,-1)},function(t,n,e){return jd(t,e,n,-1)}),Kd=Gd(function(t,n,e){return zd(t,e,n,1)},function(t,n,e){return jd(t,e,n,1)}),Jd=nt([Il(Al([37]),nd(Xd,Yd)),Il(Al([39]),ed(Xd,Yd)),Il(Al([38]),id(qd)),Il(Al([40]),ud(Kd)),Il(Al([32].concat([13])),function(n,e,o){return Nl(n.element()).bind(function(t){return o.execute(n,e,t)})})]),$d=nt([Il(Al([32]),ql)]),Qd=Ul(Ud,Pi.init,Jd,$d,function(){return et.some(Wd)}),Zd=[vr("selector"),_r("execute",Yl),_r("moveOnTab",!1)],tm=function(n,e,o){return o.focusManager.get(n).bind(function(t){return o.execute(n,e,t)})},nm=function(n,e){Iu(n.element(),e.selector).each(function(t){e.focusManager.set(n,t)})},em=function(t,n,e){return Td(t,e.selector,n,-1)},om=function(t,n,e){return Td(t,e.selector,n,1)},rm=nt([Il(Al([38]),ad(em)),Il(Al([40]),ad(om)),Il(Dl([_l,Al([9])]),function(t,n,e){return e.moveOnTab?ad(em)(t,n,e):et.none()}),Il(Dl([Fl,Al([9])]),function(t,n,e){return e.moveOnTab?ad(om)(t,n,e):et.none()}),Il(Al([13]),tm),Il(Al([32]),tm)]),im=nt([Il(Al([32]),ql)]),um=Ul(Zd,Pi.init,rm,im,function(){return et.some(nm)}),am=[Yu("onSpace"),Yu("onEnter"),Yu("onShiftEnter"),Yu("onLeft"),Yu("onRight"),Yu("onTab"),Yu("onShiftTab"),Yu("onUp"),Yu("onDown"),Yu("onEscape"),_r("stopSpaceKeyup",!1),Or("focusIn")],cm=Ul(am,Pi.init,function(t,n,e){return[Il(Al([32]),e.onSpace),Il(Dl([Fl,Al([13])]),e.onEnter),Il(Dl([_l,Al([13])]),e.onShiftEnter),Il(Dl([_l,Al([9])]),e.onShiftTab),Il(Dl([Fl,Al([9])]),e.onTab),Il(Al([38]),e.onUp),Il(Al([40]),e.onDown),Il(Al([37]),e.onLeft),Il(Al([39]),e.onRight),Il(Al([32]),e.onSpace),Il(Al([27]),e.onEscape)]},function(t,n,e){return e.stopSpaceKeyup?[Il(Al([32]),ql)]:[]},function(t){return t.focusIn}),sm=Gl.schema(),fm=Xl.schema(),lm=Rd.schema(),dm=Ed.schema(),mm=Qd.schema(),gm=$l.schema(),pm=um.schema(),hm=cm.schema(),vm=ca({branchKey:"mode",branches:/* */Object.freeze({acyclic:sm,cyclic:fm,flow:lm,flatgrid:dm,matrix:mm,execution:gm,menu:pm,special:hm}),name:"keying",active:{events:function(t,n){return t.handler.toEvents(t,n)}},apis:{focusIn:function(n,e,o){e.sendFocusIn(e).fold(function(){n.getSystem().triggerFocus(n.element(),n.element())},function(t){t(n,e,o)})},setGridSize:function(t,n,e,o,r){Dt(e,"setGridSize")?e.setGridSize(o,r):x.console.error("Layout does not support setGridSize")}},state:Zl}),bm=function(t,n,e,o){var r=t.getSystem().build(o);Ds(t,r,e)},ym=function(t,n,e,o){var r=xm(t,n);H(r,function(t){return he(o.element(),t.element())}).each(Ms)},xm=function(t,n){return t.components()},wm=function(n,e,t,r,o){var i=xm(n,e);return et.from(i[r]).map(function(t){return ym(n,e,0,t),o.each(function(t){bm(n,0,function(t,n){var e,o;o=n,ke(e=t,r).fold(function(){Te(e,o)},function(t){Ce(t,o)})},t)}),t})},Sm=ua({fields:[],name:"replacing",apis:/* */Object.freeze({append:function(t,n,e,o){bm(t,0,Te,o)},prepend:function(t,n,e,o){bm(t,0,Ee,o)},remove:ym,replaceAt:wm,replaceBy:function(n,e,t,o,r){var i=xm(n,e);return N(i,o).bind(function(t){return wm(n,e,0,t,r)})},set:function(n,t,e,o){var r,i,u,a;Fs(n),r=function(){var t=A(o,n.getSystem().build);M(t,function(t){As(n,t)})},i=n.element(),u=ve(i),a=Hl(u).bind(function(n){var t=function(t){return he(n,t)};return t(i)?et.some(i):ei(i,t)}),r(i),a.each(function(n){Hl(u).filter(function(t){return he(t,n)}).fold(function(){Rl(n)},tt)})},contents:xm})}),km=function(t,n,e){n.store.manager.onLoad(t,n,e)},Cm=function(t,n,e){n.store.manager.onUnload(t,n,e)},Om=/* */Object.freeze({onLoad:km,onUnload:Cm,setValue:function(t,n,e,o){n.store.manager.setValue(t,n,e,o)},getValue:function(t,n,e){return n.store.manager.getValue(t,n,e)},getState:function(t,n,e){return e}}),Em=/* */Object.freeze({events:function(e,o){var t=e.resetOnDom?[vi(function(t,n){km(t,e,o)}),bi(function(t,n){Cm(t,e,o)})]:[Zu(e,o,km)];return ri(t)}}),Tm=function(){var t=_t(null);return zi({set:t.set,get:t.get,isNotSet:function(){return null===t.get()},clear:function(){t.set(null)},readState:function(){return{mode:"memory",value:t.get()}}})},Bm=function(){var i=_t({}),u=_t({});return zi({readState:function(){return{mode:"dataset",dataByValue:i.get(),dataByText:u.get()}},lookup:function(t){return Et(i.get(),t).orThunk(function(){return Et(u.get(),t)})},update:function(t){var n=i.get(),e=u.get(),o={},r={};M(t,function(n){o[n.value]=n,Et(n,"meta").each(function(t){Et(t,"text").each(function(t){r[t]=n})})}),i.set(uo({},n,o)),u.set(uo({},e,r))},clear:function(){i.set({}),u.set({})}})},Am=/* */Object.freeze({memory:Tm,dataset:Bm,manual:function(){return zi({readState:function(){}})},init:function(t){return t.store.manager.state(t)}}),Dm=function(t,n,e,o){var r=n.store;e.update([o]),r.setValue(t,o),n.onSetValue(t,o)},_m=[Or("initialValue"),vr("getFallbackEntry"),vr("getDataKey"),vr("setValue"),Ju("manager",{setValue:Dm,getValue:function(t,n,e){var o=n.store,r=o.getDataKey(t);return e.lookup(r).fold(function(){return o.getFallbackEntry(r)},function(t){return t})},onLoad:function(n,e,o){e.store.initialValue.each(function(t){Dm(n,e,o,t)})},onUnload:function(t,n,e){e.clear()},state:Bm})],Mm=[vr("getValue"),_r("setValue",tt),Or("initialValue"),Ju("manager",{setValue:function(t,n,e,o){n.store.setValue(t,o),n.onSetValue(t,o)},getValue:function(t,n,e){return n.store.getValue(t)},onLoad:function(n,e,t){e.store.initialValue.each(function(t){e.store.setValue(n,t)})},onUnload:tt,state:Pi.init})],Fm=[Or("initialValue"),Ju("manager",{setValue:function(t,n,e,o){e.set(o),n.onSetValue(t,o)},getValue:function(t,n,e){return e.get()},onLoad:function(t,n,e){n.store.initialValue.each(function(t){e.isNotSet()&&e.set(t)})},onUnload:function(t,n,e){e.clear()},state:Tm})],Im=[Mr("store",{mode:"memory"},sr("mode",{memory:Fm,manual:Mm,dataset:_m})),Xu("onSetValue"),_r("resetOnDom",!1)],Vm=ua({fields:Im,name:"representing",active:Em,apis:Om,extra:{setValueFrom:function(t,n){var e=Vm.getValue(n);Vm.setValue(t,e)}},state:Am}),Rm=function(t,n){n.ignore||(Rl(t.element()),n.onFocus(t))},Hm=/* */Object.freeze({focus:Rm,blur:function(t,n){n.ignore||t.element().dom().blur()},isFocused:function(t){return n=t.element(),e=ve(n).dom(),n.dom()===e.activeElement;var n,e}}),Nm=/* */Object.freeze({exhibit:function(t,n){var e=n.ignore?{}:{attributes:{tabindex:"-1"}};return ji(e)},events:function(e){return ri([ci(An(),function(t,n){Rm(t,e),n.stop()})].concat(e.stopMousedown?[ci(zt(),function(t,n){n.event().prevent()})]:[]))}}),Pm=[Xu("onFocus"),_r("stopMousedown",!1),_r("ignore",!1)],zm=ua({fields:Pm,name:"focusing",active:Nm,apis:Hm}),Lm=function(t,n,e){var o=n.aria;o.update(t,o,e.get())},jm=function(n,t,e){t.toggleClass.each(function(t){e.get()?eu(n.element(),t):ou(n.element(),t)})},Um=function(t,n,e){Xm(t,n,e,!e.get())},Wm=function(t,n,e){e.set(!0),jm(t,n,e),Lm(t,n,e)},Gm=function(t,n,e){e.set(!1),jm(t,n,e),Lm(t,n,e)},Xm=function(t,n,e,o){(o?Wm:Gm)(t,n,e)},Ym=function(t,n,e){Xm(t,n,e,n.selected)},qm=/* */Object.freeze({onLoad:Ym,toggle:Um,isOn:function(t,n,e){return e.get()},on:Wm,off:Gm,set:Xm}),Km=/* */Object.freeze({exhibit:function(t,n,e){return ji({})},events:function(t,n){var e,o,r,i=(e=t,o=n,r=Um,xi(function(t){r(t,e,o)})),u=Zu(t,n,Ym);return ri(L([t.toggleOnExecute?[i]:[],[u]]))}}),Jm=function(t,n,e){ze(t.element(),"aria-expanded",e)},$m=[_r("selected",!1),Or("toggleClass"),_r("toggleOnExecute",!0),Mr("aria",{mode:"none"},sr("mode",{pressed:[_r("syncWithExpanded",!1),Ju("update",function(t,n,e){ze(t.element(),"aria-pressed",e),n.syncWithExpanded&&Jm(t,n,e)})],checked:[Ju("update",function(t,n,e){ze(t.element(),"aria-checked",e)})],expanded:[Ju("update",Jm)],selected:[Ju("update",function(t,n,e){ze(t.element(),"aria-selected",e)})],none:[Ju("update",tt)]}))],Qm=ua({fields:$m,name:"toggling",active:Km,apis:qm,state:(jl=!1,{init:function(){var n=_t(jl);return{get:function(){return n.get()},set:function(t){return n.set(t)},clear:function(){return n.set(jl)},readState:function(){return n.get()}}}})}),Zm="alloy.item-hover",tg="alloy.item-focus",ng=function(t){(Nl(t.element()).isNone()||zm.isFocused(t))&&(zm.isFocused(t)||zm.focus(t),Wr(t,Zm,{item:t}))},eg=function(t){Wr(t,tg,{item:t})},og=nt(Zm),rg=nt(tg),ig=function(t,n){var e,o;return{key:t,value:{config:{},me:(e=t,o=ri(n),ua({fields:[vr("enabled")],name:e,active:{events:nt(o)}})),configAsRaw:nt({}),initialConfig:{},state:Pi}}},ug=[vr("data"),vr("components"),vr("dom"),_r("hasSubmenu",!1),Or("toggling"),tf.field("itemBehaviours",[Qm,zm,vm,Vm]),_r("ignoreFocus",!1),_r("domModification",{}),Ju("builder",function(t){return{dom:t.dom,domModification:uo({},t.domModification,{attributes:uo({role:t.toggling.isSome()?"menuitemcheckbox":"menuitem"},t.domModification.attributes,{"aria-haspopup":t.hasSubmenu},t.hasSubmenu?{"aria-expanded":!1}:{})}),behaviours:tf.augment(t.itemBehaviours,[t.toggling.fold(Qm.revoke,function(t){return Qm.config(uo({aria:{mode:"checked"}},t))}),zm.config({ignore:t.ignoreFocus,stopMousedown:t.ignoreFocus,onFocus:function(t){eg(t)}}),vm.config({mode:"execution"}),Vm.config({store:{mode:"memory",initialValue:t.data}}),ig("item-type-events",[ci(Rn(),Gr),gi(zt()),ci(Wt(),ng),ci(In(),zm.focus)])]),components:t.components,eventOrder:t.eventOrder}}),_r("eventOrder",{})],ag=[vr("dom"),vr("components"),Ju("builder",function(t){return{dom:t.dom,components:t.components,events:ri([pi(In())])}})],cg=nt([Af({name:"widget",overrides:function(n){return{behaviours:ra([Vm.config({store:{mode:"manual",getValue:function(t){return n.data},setValue:function(){}}})])}}})]),sg=[vr("uid"),vr("data"),vr("components"),vr("dom"),_r("autofocus",!1),_r("ignoreFocus",!1),tf.field("widgetBehaviours",[Vm,zm,vm]),_r("domModification",{}),Jf(cg()),Ju("builder",function(e){var t=Lf(0,e,cg()),n=jf("item-widget",e,t.internals()),o=function(t){return Uf(t,e,"widget").map(function(t){return vm.focusIn(t),t})},r=function(t,n){return cl(n.event().target())||e.autofocus&&n.setSource(t.element()),et.none()};return{dom:e.dom,components:n,domModification:e.domModification,events:ri([xi(function(t,n){o(t).each(function(t){n.stop()})}),ci(Wt(),ng),ci(In(),function(t,n){e.autofocus?o(t):zm.focus(t)})]),behaviours:tf.augment(e.widgetBehaviours,[Vm.config({store:{mode:"memory",initialValue:e.data}}),zm.config({ignore:e.ignoreFocus,onFocus:function(t){eg(t)}}),vm.config({mode:"special",focusIn:e.autofocus?function(t){o(t)}:sa(),onLeft:r,onRight:r,onEscape:function(t,n){return zm.isFocused(t)||e.autofocus?(e.autofocus&&n.setSource(t.element()),et.none()):(zm.focus(t),et.some(!0))}})])}})],fg=sr("type",{widget:sg,item:ug,separator:ag}),lg=nt([Mf({factory:{sketch:function(t){var n=ar("menu.spec item",fg,t);return n.builder(n)}},name:"items",unit:"item",defaults:function(t,n){return n.hasOwnProperty("uid")?n:uo({},n,{uid:Ai("item")})},overrides:function(t,n){return{type:n.type,ignoreFocus:t.fakeFocus,domModification:{classes:[t.markers.item]}}}})]),dg=nt([vr("value"),vr("items"),vr("dom"),vr("components"),_r("eventOrder",{}),$s("menuBehaviours",[Cl,Vm,ll,vm]),Mr("movement",{mode:"menu",moveOnTab:!0},sr("mode",{grid:[Qu(),Ju("config",function(t,n){return{mode:"flatgrid",selector:"."+t.markers.item,initSize:{numColumns:n.initSize.numColumns,numRows:n.initSize.numRows},focusManager:t.focusManager}})],matrix:[Ju("config",function(t,n){return{mode:"matrix",selectors:{row:n.rowSelector,cell:"."+t.markers.item},focusManager:t.focusManager}}),vr("rowSelector")],menu:[_r("moveOnTab",!0),Ju("config",function(t,n){return{mode:"menu",selector:"."+t.markers.item,moveOnTab:n.moveOnTab,focusManager:t.focusManager}})]})),br("markers",Lu()),_r("fakeFocus",!1),_r("focusManager",zl()),Xu("onHighlight")]),mg=nt("alloy.menu-focus"),gg=al({name:"Menu",configFields:dg(),partFields:lg(),factory:function(t,n,e,o){return{uid:t.uid,dom:t.dom,markers:t.markers,behaviours:Zs(t.menuBehaviours,[Cl.config({highlightClass:t.markers.selectedItem,itemClass:t.markers.item,onHighlight:t.onHighlight}),Vm.config({store:{mode:"memory",initialValue:t.value}}),ll.config({find:et.some}),vm.config(t.movement.config(t,t.movement))]),events:ri([ci(rg(),function(n,e){var t=e.event();n.getSystem().getByDom(t.target()).each(function(t){Cl.highlight(n,t),e.stop(),Wr(n,mg(),{menu:n,item:t})})}),ci(og(),function(t,n){var e=n.event().item();Cl.highlight(t,e)})]),components:n,eventOrder:t.eventOrder,domModification:{attributes:{role:"menu"}}}}}),pg=function(e,o,r,t){return Et(r,t).bind(function(t){return Et(e,t).bind(function(t){var n=pg(e,o,r,t);return et.some([t].concat(n))})}).getOr([])},hg=function(t,n){var e={};rt(t,function(t,n){M(t,function(t){e[t]=n})});var o=n,r=ut(n,function(t,n){return{k:t,v:n}}),i=it(r,function(t,n){return[n].concat(pg(e,o,r,n))});return it(e,function(t){return Et(i,t).getOr([t])})},vg=function(){var i=_t({}),u=_t({}),a=_t({}),c=_t(et.none()),s=_t({}),n=function(t){return Et(u.get(),t)};return{setMenuBuilt:function(t,n){var e;u.set(uo({},u.get(),((e={})[t]={type:"prepared",menu:n},e)))},setContents:function(t,n,e,o){c.set(et.some(t)),i.set(e),u.set(n),s.set(o);var r=hg(o,e);a.set(r)},expand:function(e){return Et(i.get(),e).map(function(t){var n=Et(a.get(),e).getOr([]);return[t].concat(n)})},refresh:function(t){return Et(a.get(),t)},collapse:function(t){return Et(a.get(),t).bind(function(t){return 1<t.length?et.some(t.slice(1)):et.none()})},lookupMenu:n,otherMenus:function(t){var n=s.get();return Y(Z(n),t)},getPrimary:function(){return c.get().bind(function(t){return n(t).bind(function(t){return"prepared"===t.type?et.some(t.menu):et.none()})})},getMenus:function(){return u.get()},clear:function(){i.set({}),u.set({}),a.set({}),c.set(et.none())},isClear:function(){return c.get().isNone()}}},bg=nt("collapse-item"),yg=ul({name:"TieredMenu",configFields:[Ku("onExecute"),Ku("onEscape"),qu("onOpenMenu"),qu("onOpenSubmenu"),Xu("onCollapseMenu"),_r("highlightImmediately",!0),Sr("data",[vr("primary"),vr("menus"),vr("expansions")]),_r("fakeFocus",!1),Xu("onHighlight"),Xu("onHover"),Uu(),vr("dom"),_r("navigateOnHover",!0),_r("stayInDom",!1),$s("tmenuBehaviours",[vm,Cl,ll,Sm]),_r("eventOrder",{})],apis:{collapseMenu:function(t,n){t.collapseMenu(n)},highlightPrimary:function(t,n){t.highlightPrimary(n)}},factory:function(a,t){var c,n,i=_t(et.none()),s=vg(),e=function(t){var o,r,n,e=(o=t,r=a.data.primary,n=a.data.menus,it(n,function(t,n){var e=function(){return gg.sketch(uo({dom:t.dom},t,{value:n,items:t.items,markers:a.markers,fakeFocus:a.fakeFocus,onHighlight:a.onHighlight,focusManager:a.fakeFocus?Ll():zl()}))};return n===r?{type:"prepared",menu:o.getSystem().build(e())}:{type:"notbuilt",nbMenu:e}})),i=u(t);return s.setContents(a.data.primary,e,a.data.expansions,i),s.getPrimary()},f=function(t){return Vm.getValue(t).value},u=function(t){return it(a.data.menus,function(t,n){return j(t.items,function(t){return"separator"===t.type?[]:[t.data.value]})})},l=function(n,t){Cl.highlight(n,t),Cl.getHighlighted(t).orThunk(function(){return Cl.getFirst(t)}).each(function(t){Xr(n,t.element(),In())})},d=function(n,t){return Mt(A(t,function(t){return n.lookupMenu(t).bind(function(t){return"prepared"===t.type?et.some(t.menu):et.none()})}))},m=function(n,t,e){var o=d(t,t.otherMenus(e));M(o,function(t){uu(t.element(),[a.markers.backgroundMenu]),a.stayInDom||Sm.remove(n,t)})},g=function(t,o){var r,n=(r=t,i.get().getOrThunk(function(){var e={},t=Yc(r.element(),"."+a.markers.item),n=V(t,function(t){return"true"===je(t,"aria-haspopup")});return M(n,function(t){r.getSystem().getByDom(t).each(function(t){var n=f(t);e[n]=t})}),i.set(et.some(e)),e}));rt(n,function(t,n){var e=E(o,n);ze(t.element(),"aria-expanded",e)})},p=function(o,r,i){return et.from(i[0]).bind(function(t){return r.lookupMenu(t).bind(function(t){if("notbuilt"===t.type)return et.none();var n=t.menu,e=d(r,i.slice(1));return M(e,function(t){eu(t.element(),a.markers.backgroundMenu)}),$r(n.element())||Sm.append(o,_u(n)),uu(n.element(),[a.markers.backgroundMenu]),l(o,n),m(o,r,i),et.some(n)})})};(n=c||(c={}))[n.HighlightSubmenu=0]="HighlightSubmenu",n[n.HighlightParent=1]="HighlightParent";var h=function(r,i,u){void 0===u&&(u=c.HighlightSubmenu);var t=f(i);return s.expand(t).bind(function(o){return g(r,o),et.from(o[0]).bind(function(e){return s.lookupMenu(e).bind(function(t){var n=function(t,n,e){if("notbuilt"!==e.type)return e.menu;var o=t.getSystem().build(e.nbMenu());return s.setMenuBuilt(n,o),o}(r,e,t);return $r(n.element())||Sm.append(r,_u(n)),a.onOpenSubmenu(r,i,n),u===c.HighlightSubmenu?(Cl.highlightFirst(n),p(r,s,o)):(Cl.dehighlightAll(n),et.some(i))})})})},o=function(n,e){var t=f(e);return s.collapse(t).bind(function(t){return g(n,t),p(n,s,t).map(function(t){return a.onCollapseMenu(n,e,t),t})})},r=function(e){return function(n,t){return Vu(t.getSource(),"."+a.markers.item).bind(function(t){return n.getSystem().getByDom(t).toOption().bind(function(t){return e(n,t).map(function(){return!0})})})}},v=ri([ci(mg(),function(n,t){var e=t.event().menu();Cl.highlight(n,e);var o=f(t.event().item());s.refresh(o).each(function(t){return m(n,s,t)})}),xi(function(n,t){var e=t.event().target();n.getSystem().getByDom(e).each(function(t){0===f(t).indexOf("collapse-item")&&o(n,t),h(n,t,c.HighlightSubmenu).fold(function(){a.onExecute(n,t)},function(){})})}),vi(function(n,t){e(n).each(function(t){Sm.append(n,_u(t)),a.onOpenMenu(n,t),a.highlightImmediately&&l(n,t)})})].concat(a.navigateOnHover?[ci(og(),function(t,n){var e,o,r=n.event().item();e=t,o=f(r),s.refresh(o).bind(function(t){return g(e,t),p(e,s,t)}),h(t,r,c.HighlightParent),a.onHover(t,r)})]:[])),b={collapseMenu:function(n){Cl.getHighlighted(n).each(function(t){Cl.getHighlighted(t).each(function(t){o(n,t)})})},highlightPrimary:function(n){s.getPrimary().each(function(t){l(n,t)})}};return{uid:a.uid,dom:a.dom,markers:a.markers,behaviours:Zs(a.tmenuBehaviours,[vm.config({mode:"special",onRight:r(function(t,n){return cl(n.element())?et.none():h(t,n,c.HighlightSubmenu)}),onLeft:r(function(t,n){return cl(n.element())?et.none():o(t,n)}),onEscape:r(function(t,n){return o(t,n).orThunk(function(){return a.onEscape(t,n).map(function(){return t})})}),focusIn:function(n,t){s.getPrimary().each(function(t){Xr(n,t.element(),In())})}}),Cl.config({highlightClass:a.markers.selectedMenu,itemClass:a.markers.menu}),ll.config({find:function(t){return Cl.getHighlighted(t)}}),Sm.config({})]),eventOrder:a.eventOrder,apis:b,events:v}},extraApis:{tieredData:function(t,n,e){return{primary:t,menus:n,expansions:e}},singleData:function(t,n){return{primary:t,menus:Tt(t,n),expansions:{}}},collapseItem:function(t){return{value:ro(bg()),meta:{text:t}}}}}),xg=ul({name:"InlineView",configFields:[vr("lazySink"),Xu("onShow"),Xu("onHide"),Ar("onEscape"),$s("inlineBehaviours",[Gs,da]),Dr("fireDismissalEventInstead",[_r("event",Gn())]),_r("getRelated",et.none),_r("eventOrder",et.none)],factory:function(s,t){var r=function(t,n,e,o){var r=s.lazySink(t).getOrDie();Gs.openWhileCloaked(t,e,function(){return Es.positionWithin(r,n,t,o)}),s.onShow(t)},n={setContent:function(t,n){Gs.open(t,n)},showAt:function(t,n,e){var o=et.none();r(t,n,e,o)},showWithin:r,showMenuAt:function(t,n,e){var o,r,i,u,a,c=(o=s,r=t,i=n,u=e,a=function(){return o.lazySink(r)},yg.sketch({dom:{tag:"div"},data:u.data,markers:u.menu.markers,onEscape:function(){return Gs.close(r),o.onEscape.map(function(t){return t(r)}),et.some(!0)},onExecute:function(){return et.some(!0)},onOpenMenu:function(t,n){Es.position(a().getOrDie(),i,n)},onOpenSubmenu:function(t,n,e){var o=a().getOrDie();Es.position(o,{anchor:"submenu",item:n},e)}}));Gs.open(t,c),s.onShow(t)},hide:function(t){Gs.close(t),s.onHide(t)},getContent:function(t){return Gs.getState(t)},isOpen:Gs.isOpen};return{uid:s.uid,dom:s.dom,behaviours:Zs(s.inlineBehaviours,[Gs.config({isPartOf:function(t,n,e){return Nu(n,e)||(o=t,r=e,s.getRelated(o).exists(function(t){return Nu(t,r)}));var o,r},getAttachPoint:function(t){return s.lazySink(t).getOrDie()}}),Ks(uo({isExtraPart:nt(!1)},s.fireDismissalEventInstead.map(function(t){return{fireEventInstead:{event:t.event}}}).getOr({})))]),eventOrder:s.eventOrder,apis:n}},apis:{showAt:function(t,n,e,o){t.showAt(n,e,o)},showWithin:function(t,n,e,o,r){t.showWithin(n,e,o,r)},showMenuAt:function(t,n,e,o){t.showMenuAt(n,e,o)},hide:function(t,n){t.hide(n)},isOpen:function(t,n){return t.isOpen(n)},getContent:function(t,n){return t.getContent(n)},setContent:function(t,n,e){t.setContent(n,e)}}}),wg=function(t){var n=function(t,n){n.stop(),Gr(t)},e=Tn.detect().deviceType.isTouch()?[ci(Vn(),n)]:[ci($t(),n),ci(zt(),function(t,n){n.cut()})];return ri(L([t.map(function(e){return ci(Fn(),function(t,n){e(t),n.stop()})}).toArray(),e]))},Sg=ul({name:"Button",factory:function(t){var n=wg(t.action),e=t.dom.tag,o=function(n){return Et(t.dom,"attributes").bind(function(t){return Et(t,n)})};return{uid:t.uid,dom:t.dom,components:t.components,events:n,behaviours:tf.augment(t.buttonBehaviours,[zm.config({}),vm.config({mode:"execution",useSpace:!0,useEnter:!0})]),domModification:{attributes:function(){if("button"!==e)return{role:o("role").getOr("button")};var t=o("type").getOr("button"),n=o("role").map(function(t){return{role:t}}).getOr({});return uo({type:t},n)}()},eventOrder:t.eventOrder}},configFields:[_r("uid",undefined),vr("dom"),_r("components",[]),tf.field("buttonBehaviours",[zm,vm]),Or("action"),Or("role"),_r("eventOrder",{})]}),kg=function(t){var n=nl(t)&&Dt(t,"uid")?t.uid:Ai("memento");return{get:function(t){return t.getSystem().getByUid(n).getOrDie()},getOpt:function(t){return t.getSystem().getByUid(n).fold(et.none,et.some)},asSpec:function(){return uo({},t,{uid:n})}}},Cg=function(t){return et.from(t()["temporary-placeholder"]).getOr("!not found!")},Og=function(t,n){return et.from(n()[t]).getOrThunk(function(){return Cg(n)})},Eg={success:"checkmark",error:"warning",err:"error",warning:"warning",warn:"warning",info:"info"},Tg=ul({name:"Notification",factory:function(n){var t,e,o=kg({dom:{tag:"p",innerHtml:n.translationProvider(n.text)},behaviours:ra([Sm.config({})])}),r=function(t){return{dom:{tag:"div",classes:["tox-bar"],attributes:{style:"width: "+t+"%"}}}},i=function(t){return{dom:{tag:"div",classes:["tox-text"],innerHtml:t+"%"}}},u=kg({dom:{tag:"div",classes:n.progress?["tox-progress-bar","tox-progress-indicator"]:["tox-progress-bar"]},components:[{dom:{tag:"div",classes:["tox-bar-container"]},components:[r(0)]},i(0)],behaviours:ra([Sm.config({})])}),a={updateProgress:function(t,n){t.getSystem().isConnected()&&u.getOpt(t).each(function(t){Sm.set(t,[{dom:{tag:"div",classes:["tox-bar-container"]},components:[r(n)]},i(n)])})},updateText:function(t,n){if(t.getSystem().isConnected()){var e=o.get(t);Sm.set(e,[Tu(n)])}}},c=L([n.icon.toArray(),n.level.toArray(),n.level.bind(function(t){return et.from(Eg[t])}).toArray()]);return{uid:n.uid,dom:{tag:"div",attributes:{role:"alert"},classes:n.level.map(function(t){return["tox-notification","tox-notification--in","tox-notification--"+t]}).getOr(["tox-notification","tox-notification--in"])},components:[{dom:{tag:"div",classes:["tox-notification__icon"],innerHtml:(t=c,e=n.iconProvider,Ft(t,function(t){return et.from(e()[t])}).getOrThunk(function(){return Cg(e)}))}},{dom:{tag:"div",classes:["tox-notification__body"]},components:[o.asSpec()],behaviours:ra([Sm.config({})])}].concat(n.progress?[u.asSpec()]:[]).concat(Sg.sketch({dom:{tag:"button",classes:["tox-notification__dismiss","tox-button","tox-button--naked","tox-button--icon"]},components:[{dom:{tag:"div",classes:["tox-icon"],innerHtml:Og("close",n.iconProvider),attributes:{"aria-label":n.translationProvider("Close")}}}],action:function(t){n.onAction(t)}})),apis:a}},configFields:[Or("level"),vr("progress"),vr("icon"),vr("onAction"),vr("text"),vr("iconProvider"),vr("translationProvider")],apis:{updateProgress:function(t,n,e){t.updateProgress(n,e)},updateText:function(t,n,e){t.updateText(n,e)}}}),Bg=tinymce.util.Tools.resolve("tinymce.util.Delay");function Ag(r,i,u){var a=i.backstage;return{open:function(t,n){var e=function(){n(),xg.hide(r)},o=Du(Tg.sketch({text:t.text,level:E(["success","error","warning","info"],t.type)?t.type:undefined,progress:!0===t.progressBar,icon:et.from(t.icon),onAction:e,iconProvider:a.shared.providers.icons,translationProvider:a.shared.providers.translate})),r=Du(xg.sketch({dom:{tag:"div",classes:["tox-notifications-container"]},lazySink:i.backstage.shared.getSink,fireDismissalEventInstead:{}}));return u.add(r),t.timeout&&Bg.setTimeout(function(){e()},t.timeout),{close:e,moveTo:function(t,n){xg.showAt(r,{anchor:"makeshift",x:t,y:n},_u(o))},moveRel:function(t,n){xg.showAt(r,i.backstage.shared.anchors.banner(),_u(o))},text:function(t){Tg.updateText(o,t)},settings:t,getEl:function(){},progressBar:{value:function(t){Tg.updateProgress(o,t)}}}},close:function(t){t.close()},reposition:function(t){M(t,function(t){t.moveTo(0,0)}),function(e){if(0<e.length){var t=e.slice(0,1)[0],n=(o=r).inline?o.getElement():o.getContentAreaContainer();t.moveRel(n,"tc-tc"),M(e,function(t,n){0<n&&t.moveRel(e[n-1].getEl(),"bc-tc")})}var o}(t)},getArgs:function(t){return t.settings}}}var Dg,_g,Mg=function(e,o){var r=null;return{cancel:function(){null!==r&&(x.clearTimeout(r),r=null)},throttle:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];null!==r&&x.clearTimeout(r),r=x.setTimeout(function(){e.apply(null,t),r=null},o)}}},Fg=/[\u00a0 \t\r\n]/,Ig=function(e,t,n,o,r){return void 0===r&&(r=0),(i=e).collapsed&&3===i.startContainer.nodeType?function(t,n,e,o){var r;for(r=n-1;0<=r;r--){if(Fg.test(t.charAt(r)))return et.none();if(t.charAt(r)===e)break}return-1===r||n-r<o?et.none():et.some(t.substring(r+1,n))}(n,o,t,r).map(function(t){var n=e.cloneRange();return n.setStart(e.startContainer,e.startOffset-t.length-1),n.setEnd(e.startContainer,e.startOffset),{text:t,rng:n}}):et.none();var i},Vg=function(e,t){t.on("keypress",e.onKeypress.throttle),t.on("remove",e.onKeypress.cancel);var o=function(t,n){Wr(t,Yt(),{raw:n})};t.on("keydown",function(n){var t=function(){return e.getView().bind(Cl.getHighlighted)};8===n.which&&e.onKeypress.throttle(n),e.isActive()&&(27===n.which?e.closeIfNecessary():32===n.which?e.closeIfNecessary():13===n.which?(t().each(Gr),n.preventDefault()):40===n.which?(t().fold(function(){e.getView().each(Cl.highlightFirst)},function(t){o(t,n)}),n.preventDefault()):37!==n.which&&38!==n.which&&39!==n.which||t().each(function(t){o(t,n),n.preventDefault()}))})},Rg=tinymce.util.Tools.resolve("tinymce.util.Promise"),Hg=function(t,n){return 0===t.startOffset||/\s/.test(n.charAt(t.startOffset-1))},Ng=function(t,n){var e,o,r,i=n(),u=t.selection.getRng(),a=u.startContainer.nodeValue;return(e=u,o=a,r=i,Ft(r.triggerChars,function(n){return Ig(e,n,o,e.startOffset).map(function(t){return{range:t.rng,text:t.text,triggerChar:n}})})).map(function(e){var t=V(i.lookupByChar(e.triggerChar),function(t){return e.text.length>=t.minChars&&t.matches.getOr(Hg)(e.range,a,e.text)});return{lookupData:Rg.all(A(t,function(n){return n.fetch(e.text,n.maxResults).then(function(t){return{items:t,columns:n.columns,onAction:n.onAction}})})),triggerChar:e.triggerChar,range:e.range}})},Pg=Wo([Pr("type",function(){return"autocompleteitem"}),Pr("active",function(){return!1}),Pr("disabled",function(){return!1}),_r("meta",{}),yr("value"),Br("text"),Br("icon")]),zg=Wo([yr("type"),yr("ch"),Fr("minChars",1),_r("columns",1),Fr("maxResults",10),Ar("matches"),wr("fetch"),wr("onAction")]),Lg=function(t){var n,e,o=t.ui.registry.getAll().popups,r=it(o,function(t){return(n=t,ir("Autocompleter",zg,n)).fold(function(t){throw new Error(cr(t))},function(t){return t});var n}),i=(n=at(r,function(t){return t.ch}),e={},M(n,function(t){e[t]={}}),Z(e)),u=st(r);return{dataset:r,triggerChars:i,lookupByChar:function(n){return V(u,function(t){return t.ch===n})}}},jg=[Rr("disabled",!1),Br("text"),Br("shortcut"),Jo("value","value",po(function(){return ro("menuitem-value")}),fr()),_r("meta",{})],Ug=Wo([yr("type"),Hr("onSetup",function(){return tt}),Hr("onAction",tt),Br("icon")].concat(jg)),Wg=Wo([yr("type"),wr("getSubmenuItems"),Hr("onSetup",function(){return tt}),Br("icon")].concat(jg)),Gg=Wo([yr("type"),Rr("active",!1),Hr("onSetup",function(){return tt}),wr("onAction")].concat(jg)),Xg=Wo([yr("type"),Rr("active",!1),Br("icon")].concat(jg)),Yg=Wo([yr("type"),Br("text")]),qg=Wo([yr("type"),xr("fancytype",["inserttable","colorswatch"]),Hr("onAction",tt)]),Kg=function(t,o,n){var r=Yc(t.element(),"."+n);if(0<r.length){var e=N(r,function(t){var n=t.dom().getBoundingClientRect().top,e=r[0].dom().getBoundingClientRect().top;return Math.abs(n-e)>o}).getOr(r.length);return et.some({numColumns:e,numRows:Math.ceil(r.length/e)})}return et.none()},Jg=function(t,n){return ra([ig(t,n)])},$g=function(t){return Jg(ro("unnamed-events"),t)},Qg=[vr("lazySink"),vr("tooltipDom"),_r("exclusive",!0),_r("tooltipComponents",[]),_r("delay",300),Vr("mode","normal",["normal","follow-highlight"]),_r("anchor",function(t){return{anchor:"hotspot",hotspot:t,layouts:{onLtr:nt([kc,Sc,bc,xc,yc,wc]),onRtl:nt([kc,Sc,bc,xc,yc,wc])}}}),Xu("onHide"),Xu("onShow")],Zg=/* */Object.freeze({init:function(){var e=_t(et.none()),n=_t(et.none()),o=function(){e.get().each(function(t){x.clearTimeout(t)})},t=nt("not-implemented");return zi({getTooltip:function(){return n.get()},isShowing:function(){return n.get().isSome()},setTooltip:function(t){n.set(et.some(t))},clearTooltip:function(){n.set(et.none())},clearTimer:o,resetTimer:function(t,n){o(),e.set(et.some(x.setTimeout(function(){t()},n)))},readState:t})}}),tp=ro("tooltip.exclusive"),np=ro("tooltip.show"),ep=ro("tooltip.hide"),op=function(t,n,e){t.getSystem().broadcastOn([tp],{})},rp=/* */Object.freeze({hideAllExclusive:op,setComponents:function(t,n,e,o){e.getTooltip().each(function(t){t.getSystem().isConnected()&&Sm.set(t,o)})}}),ip=ua({fields:Qg,name:"tooltipping",active:/* */Object.freeze({events:function(o,r){var e=function(n){r.getTooltip().each(function(t){Ms(t),o.onHide(n,t),r.clearTooltip()}),r.clearTimer()};return ri(L([[ci(np,function(t){r.resetTimer(function(){!function(n){if(!r.isShowing()){op(n);var t=o.lazySink(n).getOrDie(),e=n.getSystem().build({dom:o.tooltipDom,components:o.tooltipComponents,events:ri("normal"===o.mode?[ci(Wt(),function(t){Ur(n,np)}),ci(jt(),function(t){Ur(n,ep)})]:[]),behaviours:ra([Sm.config({})])});r.setTooltip(e),As(t,e),o.onShow(n,e),Es.position(t,o.anchor(n),e)}}(t)},o.delay)}),ci(ep,function(t){r.resetTimer(function(){e(t)},o.delay)}),ci(Mn(),function(t,n){E(n.channels(),tp)&&e(t)}),bi(function(t){e(t)})],"normal"===o.mode?[ci(Gt(),function(t){Ur(t,np)}),ci(Dn(),function(t){Ur(t,ep)}),ci(Wt(),function(t){Ur(t,np)}),ci(jt(),function(t){Ur(t,ep)})]:[ci(Jn(),function(t,n){Ur(t,np)}),ci($n(),function(t){Ur(t,ep)})]]))}}),state:Zg,apis:rp}),up=function(t){var n,e,o,r=Zn.fromHtml(t),i=we(r),u=(e=(n=r).dom().attributes!==undefined?n.dom().attributes:[],U(e,function(t,n){var e;return"class"===n.name?t:uo({},t,((e={})[n.name]=n.value,e))},{})),a=(o=r,Array.prototype.slice.call(o.dom().classList,0)),c=0===i.length?{}:{innerHtml:_e(r)};return uo({tag:Fe(r),classes:a,attributes:u},c)},ap=tinymce.util.Tools.resolve("tinymce.util.I18n"),cp="tox-menu-nav__js",sp="tox-collection__item",fp="tox-swatch",lp={normal:cp,color:fp},dp="tox-collection__item--enabled",mp="tox-collection__item-icon",gp="tox-collection__item-label",pp="tox-collection__item--active",hp=function(t){return Et(lp,t).getOr(cp)},vp=tinymce.util.Tools.resolve("tinymce.Env"),bp=function(t){var e=vp.mac?{alt:"&#x2325;",ctrl:"&#x2303;",shift:"&#x21E7;",meta:"&#x2318;",access:"&#x2303;&#x2325;"}:{meta:"Ctrl",access:"Shift+Alt"},n=t.split("+"),o=A(n,function(t){var n=t.toLowerCase().trim();return lt(e,n)?e[n]:t});return vp.mac?o.join(""):o.join("+")},yp=function(t){return{dom:{tag:"div",classes:[mp],innerHtml:t}}},xp=function(t){return{dom:{tag:"div",classes:[gp]},components:[Tu(ap.translate(t))]}},wp=function(t,n){return{dom:{tag:"div",classes:[gp]},components:[{dom:{tag:t.tag,attributes:{style:t.styleAttr}},components:[Tu(ap.translate(n))]}]}},Sp=function(t){return{dom:{tag:"div",classes:["tox-collection__item-accessory"],innerHtml:bp(t)}}},kp=function(t){return{dom:{tag:"div",classes:[mp,"tox-collection__item-checkmark"],innerHtml:Og("checkmark",t)}}},Cp=["list-num-default","list-num-lower-alpha","list-num-lower-greek","list-num-lower-roman","list-num-upper-alpha","list-num-upper-roman"],Op=["list-bull-circle","list-bull-default","list-bull-square"],Ep=function(t,r,n,i){void 0===i&&(i=et.none());var e,o,u,a,c,s,f,l,d,m,g,p,h,v=ap.isRtl()&&t.iconContent.exists(function(t){return E(Op,t)}),b=(e=t.iconContent,e.map(function(t){return ap.isRtl()&&E(Cp,t)?t+"-rtl":t})).map(function(t){return n=t,e=r.icons,o=i,et.from(e()[n]).or(o).getOrThunk(function(){return Cg(e)});var n,e,o}),y=et.from(t.meta).fold(function(){return xp},function(t){return lt(t,"style")?w(wp,t.style):xp});return"color"===t.presets?(l=t.ariaLabel,d=t.value,m=r,{dom:(g=fp,p=b.getOr(""),h=l.map(function(t){return' title="'+m.translate(t)+'"'}).getOr(""),up("custom"===d?'<button class="'+g+' tox-swatches__picker-btn"'+h+">"+p+"</button>":"remove"===d?'<div class="'+g+' tox-swatch--remove"'+h+">"+p+"</div>":'<div class="'+g+'" style="background-color: '+d+'" data-mce-color="'+d+'"'+h+"></div>")),optComponents:[]}):(o=t,u=b,a=y,c=v,s=n?o.checkMark.orThunk(function(){return u.or(et.some("")).map(yp)}):et.none(),f=o.ariaLabel.map(function(t){return{attributes:{title:ap.translate(t)}}}).getOr({}),{dom:St({tag:"div",classes:[cp,sp].concat(c?["tox-collection__item-icon-rtl"]:[])},f),optComponents:[s,o.textContent.map(a),o.shortcutContent.map(Sp),o.caret]})},Tp=["input","button","textarea"],Bp=function(t,n,e){n.disabled&&Ip(t,n,e)},Ap=function(t){return E(Tp,Fe(t.element()))},Dp=function(t){ze(t.element(),"disabled","disabled")},_p=function(t){We(t.element(),"disabled")},Mp=function(t){ze(t.element(),"aria-disabled","true")},Fp=function(t){ze(t.element(),"aria-disabled","false")},Ip=function(n,t,e){t.disableClass.each(function(t){eu(n.element(),t)}),(Ap(n)?Dp:Mp)(n)},Vp=function(n,t,e){t.disableClass.each(function(t){ou(n.element(),t)}),(Ap(n)?_p:Fp)(n)},Rp=function(t){return Ap(t)?Ue(t.element(),"disabled"):"true"===je(t.element(),"aria-disabled")},Hp=/* */Object.freeze({enable:Vp,disable:Ip,isDisabled:Rp,onLoad:Bp,set:function(t,n,e,o){(o?Ip:Vp)(t,n,e)}}),Np=/* */Object.freeze({exhibit:function(t,n,e){return ji({classes:n.disabled?n.disableClass.map(q).getOr([]):[]})},events:function(t,n){return ri([ii(Fn(),function(t,n){return Rp(t)}),Zu(t,n,Bp)])}}),Pp=[_r("disabled",!1),Or("disableClass")],zp=ua({fields:Pp,name:"disabling",active:Np,apis:Hp}),Lp=function(t){return zp.config({disabled:t,disableClass:"tox-collection__item--state-disabled"})},jp=function(t){return zp.config({disabled:t})},Up=function(t){return zp.config({disabled:t,disableClass:"tox-tbtn--disabled"})},Wp=function(t,n){var e=t.getApi(n);return function(t){t(e)}},Gp=function(e,o){return vi(function(t){Wp(e,t)(function(t){var n=e.onSetup(t);null!==n&&n!==undefined&&o.set(n)})})},Xp=function(n,e){return bi(function(t){return Wp(n,t)(e.get())})};(_g=Dg||(Dg={}))[_g.CLOSE_ON_EXECUTE=0]="CLOSE_ON_EXECUTE",_g[_g.BUBBLE_TO_SANDBOX=1]="BUBBLE_TO_SANDBOX";var Yp,qp,Kp=Dg,Jp={"alloy.execute":["disabling","alloy.base.behaviour","toggling","item-events"]},$p=function(t){return j(t,function(t){return t.toArray()})},Qp=function(t,n,e){var o,r,i=_t(tt);return{type:"item",dom:n.dom,components:$p(n.optComponents),data:t.data,eventOrder:Jp,hasSubmenu:t.triggersSubmenu,itemBehaviours:ra([ig("item-events",[(o=t,r=e,xi(function(t,n){Wp(o,t)(o.onAction),o.triggersSubmenu||r!==Kp.CLOSE_ON_EXECUTE||(Ur(t,Nn()),n.stop())})),Gp(t,i),Xp(t,i)]),Lp(t.disabled),Sm.config({})].concat(t.itemBehaviours))}},Zp=function(t){return{value:t.value,meta:St({text:t.text.getOr("")},t.meta)}},th=nt(Rf("item-widget",cg())),nh=ro("cell-over"),eh=ro("cell-execute"),oh=function(n,e,t){var o,r=function(t){return Wr(t,eh,{row:n,col:e})};return Du({dom:{tag:"div",attributes:(o={role:"button"},o["aria-labelledby"]=t,o)},behaviours:ra([ig("insert-table-picker-cell",[ci(Wt(),zm.focus),ci(Fn(),r),ci(Rn(),r)]),Qm.config({toggleClass:"tox-insert-table-picker__selected",toggleOnExecute:!1}),zm.config({onFocus:function(t){return Wr(t,nh,{row:n,col:e})}})])})},rh=function(t){return{value:nt(t)}},ih=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,uh=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,ah=function(t){return ih.test(t)||uh.test(t)},ch=function(t){var n,e=(n=t.value().replace(ih,function(t,n,e,o){return n+n+e+e+o+o}),{value:nt(n)}),o=uh.exec(e.value());return null===o?["FFFFFF","FF","FF","FF"]:o},sh=function(t){var n=t.toString(16);return 1===n.length?"0"+n:n},fh=function(t){var n=sh(t.red())+sh(t.green())+sh(t.blue());return rh(n)},lh=Math.min,dh=Math.max,mh=Math.round,gh=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)/,ph=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d?(?:\.\d+)?)\)/,hh=function(t,n,e,o){return{red:nt(t),green:nt(n),blue:nt(e),alpha:nt(o)}},vh=function(t){var n=parseInt(t,10);return n.toString()===t&&0<=n&&n<=255},bh=function(t){var n,e,o,r=(t.hue()||0)%360,i=t.saturation()/100,u=t.value()/100;if(i=dh(0,lh(i,1)),u=dh(0,lh(u,1)),0===i)return n=e=o=mh(255*u),hh(n,e,o,1);var a=r/60,c=u*i,s=c*(1-Math.abs(a%2-1)),f=u-c;switch(Math.floor(a)){case 0:n=c,e=s,o=0;break;case 1:n=s,e=c,o=0;break;case 2:n=0,e=c,o=s;break;case 3:n=0,e=s,o=c;break;case 4:n=s,e=0,o=c;break;case 5:n=c,e=0,o=s;break;default:n=e=o=0}return n=mh(255*(n+f)),e=mh(255*(e+f)),o=mh(255*(o+f)),hh(n,e,o,1)},yh=function(t){var n=ch(t),e=parseInt(n[1],16),o=parseInt(n[2],16),r=parseInt(n[3],16);return hh(e,o,r,1)},xh=function(t,n,e,o){var r=parseInt(t,10),i=parseInt(n,10),u=parseInt(e,10),a=parseFloat(o);return hh(r,i,u,a)},wh=function(t){return"rgba("+t.red()+","+t.green()+","+t.blue()+","+t.alpha()+")"},Sh=nt(hh(255,0,0,1)),kh=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),Ch="tinymce-custom-colors",Oh="choiceitem",Eh=[{type:Oh,text:"Turquoise",value:"#18BC9B"},{type:Oh,text:"Green",value:"#2FCC71"},{type:Oh,text:"Blue",value:"#3598DB"},{type:Oh,text:"Purple",value:"#9B59B6"},{type:Oh,text:"Navy Blue",value:"#34495E"},{type:Oh,text:"Dark Turquoise",value:"#18A085"},{type:Oh,text:"Dark Green",value:"#27AE60"},{type:Oh,text:"Medium Blue",value:"#2880B9"},{type:Oh,text:"Medium Purple",value:"#8E44AD"},{type:Oh,text:"Midnight Blue",value:"#2B3E50"},{type:Oh,text:"Yellow",value:"#F1C40F"},{type:Oh,text:"Orange",value:"#E67E23"},{type:Oh,text:"Red",value:"#E74C3C"},{type:Oh,text:"Light Gray",value:"#ECF0F1"},{type:Oh,text:"Gray",value:"#95A5A6"},{type:Oh,text:"Dark Yellow",value:"#F29D12"},{type:Oh,text:"Dark Orange",value:"#D35400"},{type:Oh,text:"Dark Red",value:"#C0392B"},{type:Oh,text:"Medium Gray",value:"#BDC3C7"},{type:Oh,text:"Dark Gray",value:"#7E8C8D"},{type:Oh,text:"Black",value:"#000000"},{type:Oh,text:"White",value:"#ffffff"}],Th=function b_(n){void 0===n&&(n=10);var t,e=kh.getItem(Ch),o=k(e)?JSON.parse(e):[],r=n-(t=o).length<0?t.slice(0,n):t,i=function(t){r.splice(t,1)};return{add:function(t){y(r,t).each(i),r.unshift(t),r.length>n&&r.pop(),kh.setItem(Ch,JSON.stringify(r))},state:function(){return r.slice(0)}}}(10),Bh=function(t){var n,e=[];for(n=0;n<t.length;n+=2)e.push({text:t[n+1],value:"#"+t[n],type:"choiceitem"});return e},Ah=function(t){return t.getParam("color_map")},Dh=function(t,n){return t.getParam("color_cols",n,"number")},_h=function(t){return!1!==t.getParam("custom_colors")},Mh=function(t){var n=Ah(t);return n!==undefined?Bh(n):Eh},Fh=function(){return A(Th.state(),function(t){return{type:Oh,text:t,value:t}})},Ih=function(t){Th.add(t)},Vh=function(t,e){var o;return t.dom.getParents(t.selection.getStart(),function(t){var n;(n=t.style["forecolor"===e?"color":"background-color"])&&(o=o||n)}),o},Rh=function(t){return Math.max(5,Math.ceil(Math.sqrt(t)))},Hh=function(t){var n=Mh(t),e=Rh(n.length);return Dh(t,e)},Nh=function(n,e,t,o){"custom"===t?Wh(n)(function(t){t.each(function(t){Ih(t),n.execCommand("mceApplyTextcolor",e,t),o(t)})},"#000000"):"remove"===t?(o(""),n.execCommand("mceRemoveTextcolor",e)):(o(t),n.execCommand("mceApplyTextcolor",e,t))},Ph=function(t,n){return t.concat(Fh().concat((o={type:e="choiceitem",text:"Remove color",icon:"color-swatch-remove-color",value:"remove"},n?[o,{type:e,text:"Custom color",icon:"color-picker",value:"custom"}]:[o])));var e,o},zh=function(n,e){return function(t){t(Ph(n,e))}},Lh=function(t,n,e){var o,r;o="forecolor"===n?"tox-icon-text-color__color":"tox-icon-highlight-bg-color__color",r=e,t.setIconFill(o,r),t.setIconStroke(o,r)},jh=function(o,e,r,t,i){o.ui.registry.addSplitButton(e,{tooltip:t,presets:"color",icon:"forecolor"===e?"text-color":"highlight-bg-color",select:function(e){return et.from(Vh(o,r)).bind(function(t){return function(t){if("transparent"===t)return et.some(hh(0,0,0,0));var n=gh.exec(t);if(null!==n)return et.some(xh(n[1],n[2],n[3],"1"));var e=ph.exec(t);return null!==e?et.some(xh(e[1],e[2],e[3],e[4])):et.none()}(t).map(function(t){var n=fh(t).value();return xn(e.toLowerCase(),n)})}).getOr(!1)},columns:Hh(o),fetch:zh(Mh(o),_h(o)),onAction:function(t){null!==i.get()&&Nh(o,r,i.get(),function(){})},onItemAction:function(n,t){Nh(o,r,t,function(t){i.set(t),Lh(n,e,t)})},onSetup:function(t){return null!==i.get()&&Lh(t,e,i.get()),function(){}}})},Uh=function(n,t,e,o){n.ui.registry.addNestedMenuItem(t,{text:o,icon:"forecolor"===t?"text-color":"highlight-bg-color",getSubmenuItems:function(){return[{type:"fancymenuitem",fancytype:"colorswatch",onAction:function(t){Nh(n,e,t.value,tt)}}]}})},Wh=function(i){return function(t,n){var e,o={colorpicker:n},r=(e=t,function(t){var n=t.getData();e(et.from(n.colorpicker)),t.close()});i.windowManager.open({title:"Color Picker",size:"normal",body:{type:"panel",items:[{type:"colorpicker",name:"colorpicker",label:"Color"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:o,onAction:function(t,n){"hex-valid"===n.name&&(n.value?t.enable("ok"):t.disable("ok"))},onSubmit:r,onClose:function(){},onCancel:function(){t(et.none())}})}},Gh={register:function(t){var i;(i=t).addCommand("mceApplyTextcolor",function(t,n){var e,o,r;o=t,r=n,(e=i).undoManager.transact(function(){e.focus(),e.formatter.apply(o,{value:r}),e.nodeChanged()})}),i.addCommand("mceRemoveTextcolor",function(t){var n,e;e=t,(n=i).undoManager.transact(function(){n.focus(),n.formatter.remove(e,{value:null},null,!0),n.nodeChanged()})});var n=_t(null),e=_t(null);jh(t,"forecolor","forecolor","Text color",n),jh(t,"backcolor","hilitecolor","Background color",e),Uh(t,"forecolor","forecolor","Text color"),Uh(t,"backcolor","hilitecolor","Background color")},getColors:Ph,getFetch:zh,colorPickerDialog:Wh,getCurrentColor:Vh,getColorCols:Hh,calcCols:Rh},Xh=function(e,o){return function(t){var n=B(t,o);return A(n,function(t){return{dom:e,components:t}})}},Yh=function(n,i,t){return void 0===t&&(t=!0),{dom:{tag:"div",classes:["tox-menu","tox-collection"].concat(1===n?["tox-collection--list"]:["tox-collection--grid"])},components:[gg.parts().items({preprocess:function(t){return"auto"!==n&&1<n?Xh({tag:"div",classes:["tox-collection__group"]},n)(t):(e=function(t,n){return"separator"===i[n].type},o=[],r=[],M(t,function(t,n){e(t,n)?(0<r.length&&o.push(r),r=[],lt(t.dom,"innerHtml")&&r.push(t)):r.push(t)}),0<r.length&&o.push(r),A(o,function(t){return{dom:{tag:"div",classes:["tox-collection__group"]},components:t}}));var e,o,r}})]}},qh=function(t){return{backgroundMenu:"tox-background-menu",selectedMenu:"tox-selected-menu",selectedItem:"tox-collection__item--active",hasIcons:"tox-menu--has-icons",menu:(n=t,"color"===n?"tox-swatches":"tox-menu"),tieredMenu:"tox-tiered-menu"};var n},Kh=function(t){var n=qh(t);return{backgroundMenu:n.backgroundMenu,selectedMenu:n.selectedMenu,menu:n.menu,selectedItem:n.selectedItem,item:hp(t)}},Jh=[gg.parts().items({})],$h=function(t,n,e){var o=qh(e);return{dom:{tag:"div",classes:L([[o.tieredMenu]])},markers:Kh(e)}},Qh=function(t){return t.icon!==undefined||"togglemenuitem"===t.type||"choicemenuitem"===t.type},Zh=function(t){return x.console.error(cr(t)),x.console.log(t),et.none()},tv=function(t,n,e,o,r){var i,u,a,c,s,f,l;return"color"===r?{value:t,dom:(i=o,l={dom:{tag:"div",classes:["tox-menu","tox-swatches-menu"]},components:[{dom:{tag:"div",classes:["tox-swatches"]},components:[gg.parts().items({preprocess:"auto"!==i?Xh({tag:"div",classes:["tox-swatches__row"]},i):d})]}]}).dom,components:l.components,items:e}:"normal"===r&&"auto"===o?{value:t,dom:(l=Yh(o,e)).dom,components:l.components,items:e}:"normal"===r&&1===o?{value:t,dom:(l=Yh(1,e)).dom,components:l.components,items:e}:"normal"===r?{value:t,dom:(l=Yh(o,e)).dom,components:l.components,items:e}:"listpreview"!==r||"auto"===o?{value:t,dom:(a=n,c=o,s=r,f=qh(s),{tag:"div",classes:L([[f.menu,"tox-menu-"+c+"-column"],a?[f.hasIcons]:[]])}),components:Jh,items:e}:{value:t,dom:(u=o,l={dom:{tag:"div",classes:["tox-menu","tox-collection","tox-collection--toolbar","tox-collection--toolbar-lg"]},components:[gg.parts().items({preprocess:Xh({tag:"div",classes:["tox-collection__group"]},u)})]}).dom,components:l.components,items:e}},nv=function(t,n,e,o,r,i,u,a){var c=T(n,Qh),s=ev(n,e,o,"color"!==r?"normal":"color",i,u,a);return tv(t,c,s,o,r)},ev=function(t,f,l,d,m,g,p){return Mt(A(t,function(s){return"choiceitem"===s.type?(t=s,ir("choicemenuitem",Xg,t)).fold(Zh,function(t){return et.some((n=t,e=1===l,o=d,r=f,i=g(s.value),u=m,a=p,c=Ep({presets:o,textContent:e?n.text:et.none(),ariaLabel:n.text,iconContent:n.icon,shortcutContent:e?n.shortcut:et.none(),checkMark:e?et.some(kp(a.icons)):et.none(),caret:et.none(),value:n.value},a,!0),wt(Qp({data:Zp(n),disabled:n.disabled,getApi:function(n){return{setActive:function(t){Qm.set(n,t)},isActive:function(){return Qm.isOn(n)},isDisabled:function(){return zp.isDisabled(n)},setDisabled:function(t){return zp.set(n,t)}}},onAction:function(t){return r(n.value)},onSetup:function(t){return t.setActive(i),function(){}},triggersSubmenu:!1,itemBehaviours:[]},c,u),{toggling:{toggleClass:dp,toggleOnExecute:!1,selected:n.active}})));var n,e,o,r,i,u,a,c}):et.none();var t}))},ov=function(t,n){var e=Kh(n);return 1===t?{mode:"menu",moveOnTab:!0}:"auto"===t?{mode:"grid",selector:"."+e.item,initSize:{numColumns:1,numRows:1}}:{mode:"matrix",rowSelector:"."+("color"===n?"tox-swatches__row":"tox-collection__group")}},rv={inserttable:function y_(o){var t,n=ro("size-label"),a=function(t,n,e){for(var o=[],r=0;r<n;r++){for(var i=[],u=0;u<e;u++)i.push(oh(r,u,t));o.push(i)}return o}(n,10,10),c=kg({dom:{tag:"span",classes:["tox-insert-table-picker__label"],attributes:{id:n}},components:[Tu("0x0")],behaviours:ra([Sm.config({})])});return{type:"widget",data:{value:ro("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[th().widget({dom:{tag:"div",classes:["tox-insert-table-picker"]},components:(t=a,j(t,function(t){return A(t,_u)})).concat(c.asSpec()),behaviours:ra([ig("insert-table-picker",[mi(nh,function(t,n,e){var o,r,i=e.event().row(),u=e.event().col();!function(t,n,e,o,r){for(var i=0;i<o;i++)for(var u=0;u<r;u++)Qm.set(t[i][u],i<=n&&u<=e)}(a,i,u,10,10),Sm.set(c.get(t),[(o=i,r=u,Tu(r+1+"x"+(o+1)))])}),mi(eh,function(t,n,e){o.onAction({numRows:e.event().row()+1,numColumns:e.event().col()+1}),Ur(t,Nn())})]),vm.config({initSize:{numRows:10,numColumns:10},mode:"flatgrid",selector:'[role="button"]'})])})]}},colorswatch:function x_(n,t){var e=Gh.getColors(t.colorinput.getColors(),t.colorinput.hasCustomColors()),o=t.colorinput.getColorCols(),r=nv(ro("menu-value"),e,function(t){n.onAction({value:t})},o,"color",Kp.CLOSE_ON_EXECUTE,function(){return!1},t.shared.providers),i=wt(uo({},r,{markers:Kh("color"),movement:ov(o,"color")}));return{type:"widget",data:{value:ro("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[th().widget(gg.sketch(i))]}}},iv=function(n,t,e,o,r,i,u){void 0===u&&(u=!0);var a,c,s=Ep({presets:e,textContent:t?n.text:et.none(),ariaLabel:n.text,iconContent:n.icon,shortcutContent:et.none(),checkMark:et.none(),caret:et.none(),value:n.value},i.providers,u,n.icon);return Qp({data:Zp(n),disabled:n.disabled,getApi:function(){return{}},onAction:function(t){return o(n.value,n.meta)},onSetup:function(){return function(){}},triggersSubmenu:!1,itemBehaviours:(a=n.meta,c=i,ft(a,"tooltipWorker").map(function(e){return[ip.config({lazySink:c.getSink,tooltipDom:{tag:"div",classes:["tox-tooltip-worker-container"]},tooltipComponents:[],anchor:function(t){return{anchor:"submenu",item:t,overrides:{maxHeightFunction:rc}}},mode:"follow-highlight",onShow:function(n,t){e(function(t){ip.setComponents(n,[Bu({element:Zn.fromDom(t)})])})}})]}).getOr([]))},s,r)},uv=function(t){var n=t.text.fold(function(){return{}},function(t){return{innerHtml:t}});return{type:"separator",dom:uo({tag:"div",classes:[sp,"tox-collection__group-heading"]},n),components:[]}},av=function(t,n,e,o){void 0===o&&(o=!0);var r=Ep({presets:"normal",iconContent:t.icon,textContent:t.text,ariaLabel:t.text,caret:et.none(),checkMark:et.none(),shortcutContent:t.shortcut},e,o);return Qp({data:Zp(t),getApi:function(n){return{isDisabled:function(){return zp.isDisabled(n)},setDisabled:function(t){return zp.set(n,t)}}},disabled:t.disabled,onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:[]},r,n)},cv=function(t,n,e,o){void 0===o&&(o=!0);var r,i=(r=e.icons,{dom:{tag:"div",classes:["tox-collection__item-caret"],innerHtml:Og("chevron-right",r)}}),u=Ep({presets:"normal",iconContent:t.icon,textContent:t.text,ariaLabel:t.text,caret:et.some(i),checkMark:et.none(),shortcutContent:t.shortcut},e,o);return Qp({data:Zp(t),getApi:function(n){return{isDisabled:function(){return zp.isDisabled(n)},setDisabled:function(t){return zp.set(n,t)}}},disabled:t.disabled,onAction:tt,onSetup:t.onSetup,triggersSubmenu:!0,itemBehaviours:[]},u,n)},sv=function(t,n,e){var o=Ep({iconContent:et.none(),textContent:t.text,ariaLabel:t.text,checkMark:et.some(kp(e.icons)),caret:et.none(),shortcutContent:t.shortcut,presets:"normal",meta:t.meta},e,!0);return wt(Qp({data:Zp(t),disabled:t.disabled,getApi:function(n){return{setActive:function(t){Qm.set(n,t)},isActive:function(){return Qm.isOn(n)},isDisabled:function(){return zp.isDisabled(n)},setDisabled:function(t){return zp.set(n,t)}}},onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:[]},o,n),{toggling:{toggleClass:dp,toggleOnExecute:!1,selected:t.active}})},fv=function(n,e){return(t=rv,o=n.fancytype,Object.prototype.hasOwnProperty.call(t,o)?et.some(t[o]):et.none()).map(function(t){return t(n,e)});var t,o};(qp=Yp||(Yp={}))[qp.ContentFocus=0]="ContentFocus",qp[qp.UiFocus=1]="UiFocus";var lv=function(t){return t.icon!==undefined||"togglemenuitem"===t.type||"choicemenuitem"===t.type},dv=function(t){return T(t,lv)},mv=function(t,n,e,o){void 0===o&&(o=!0);var r,i,u,a,c,s=e.shared.providers;switch(t.type){case"menuitem":return(c=t,ir("menuitem",Ug,c)).fold(Zh,function(t){return et.some(av(t,n,s,o))});case"nestedmenuitem":return(a=t,ir("nestedmenuitem",Wg,a)).fold(Zh,function(t){return et.some(cv(t,n,s,o))});case"togglemenuitem":return(u=t,ir("togglemenuitem",Gg,u)).fold(Zh,function(t){return et.some(sv(t,n,s))});case"separator":return(i=t,ir("separatormenuitem",Yg,i)).fold(Zh,function(t){return et.some(uv(t))});case"fancymenuitem":return(r=t,ir("fancymenuitem",qg,r)).fold(Zh,function(t){return fv(t,e)});default:return x.console.error("Unknown item in general menu",t),et.none()}},gv=function(t,e,n,o,r){var i=1===n,u=!i||dv(t);return Mt(A(t,function(t){return(n=t,ir("Autocompleter.Item",Pg,n)).fold(Zh,function(t){return et.some(iv(t,i,"normal",e,o,r,u))});var n}))},pv=function(t,n,e,o){var r=dv(n),i=Mt(A(n,function(t){var n=function(t){return mv(t,e,o,r)};return"nestedmenuitem"===t.type&&t.getSubmenuItems().length<=0?n(St(t,{disabled:!0})):n(t)}));return tv(t,r,i,1,"normal")},hv=function(t){return yg.singleData(t.value,t)},vv=function(g,p){var h=Du(xg.sketch({dom:{tag:"div",classes:["tox-autocompleter"]},components:[],lazySink:p.getSink})),t=function(){return xg.isOpen(h)},v=function(){t()&&xg.hide(h)},n=tn(function(){return Lg(g)}),e=Mg(function(t){(" "===t.key?et.none():Ng(g,n)).fold(v,function(m){m.lookupData.then(function(t){var e,n,o,r,i,u,a,c,s,f,l=(e=m.triggerChar,o=Ft(n=t,function(t){return et.from(t.columns)}).getOr(1),j(n,function(i){var t=i.items;return gv(t,function(o,r){var t=g.selection.getRng(),n=t.startContainer;Ig(t,e,n.data,t.startOffset).fold(function(){return x.console.error("Lost context. Cursor probably moved")},function(t){var n=t.rng,e={hide:v};i.onAction(e,n,o,r)})},o,Kp.BUBBLE_TO_SANDBOX,p)}));if(0<l.length){var d=Ft(t,function(t){return et.from(t.columns)}).getOr(1);xg.showAt(h,{anchor:"selection",root:Zn.fromDom(g.getBody()),getSelection:function(){return et.some({start:function(){return Zn.fromDom(m.range.startContainer)},soffset:function(){return m.range.startOffset},finish:function(){return Zn.fromDom(m.range.endContainer)},foffset:function(){return m.range.endOffset}})}},gg.sketch((r=tv("autocompleter-value",!0,l,d,"normal"),i=d,u=Yp.ContentFocus,a="normal",c=u===Yp.ContentFocus?Ll():zl(),s=ov(i,a),f=Kh(a),{dom:r.dom,components:r.components,items:r.items,value:r.value,markers:{selectedItem:f.selectedItem,item:f.item},movement:s,fakeFocus:u===Yp.ContentFocus,focusManager:c,menuBehaviours:$g("auto"!==i?[]:[vi(function(o,t){Kg(o,4,f.item).each(function(t){var n=t.numColumns,e=t.numRows;vm.setGridSize(o,e,n)})})])}))),xg.getContent(h).each(Cl.highlightFirst)}else v()})})},50);Vg({onKeypress:e,closeIfNecessary:v,isActive:t,getView:function(){return xg.getContent(h)}},g)},bv=function(m,g){return function(t){if(m(t)){var n,e,o,r,i,u,a,c=Zn.fromDom(t.target),s=function(){t.stopPropagation()},f=function(){t.preventDefault()},l=p(f,s),d=(n=c,e=t.clientX,o=t.clientY,r=s,i=f,u=l,a=t,{target:nt(n),x:nt(e),y:nt(o),stop:r,prevent:i,kill:u,raw:nt(a)});g(d)}}},yv=function(t,n,e,o,r){var i=bv(e,o);return t.dom().addEventListener(n,i,r),{unbind:w(xv,t,n,i,r)}},xv=function(t,n,e,o){t.dom().removeEventListener(n,e,o)},wv=nt(!0),Sv=function(t,n,e){return yv(t,n,wv,e,!1)},kv=function(t,n,e){return yv(t,n,wv,e,!0)},Cv=function(t,n,e){return Vu(t,n,e).isSome()};function Ov(e,o){var r=null;return{cancel:function(){null!==r&&(x.clearTimeout(r),r=null)},schedule:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];r=x.setTimeout(function(){e.apply(null,t),r=null},o)}}}var Ev=function(t){var n=t.raw();return n.touches===undefined||1!==n.touches.length?et.none():et.some(n.touches[0])},Tv=function(e){var u=_t(et.none()),o=Ov(function(t){u.set(et.none()),e.triggerEvent(Hn(),t)},400),r=Bt([{key:Ht(),value:function(e){return Ev(e).each(function(t){o.cancel();var n={x:nt(t.clientX),y:nt(t.clientY),target:e.target};o.schedule(e),u.set(et.some(n))}),et.none()}},{key:Nt(),value:function(t){return o.cancel(),Ev(t).each(function(i){u.get().each(function(t){var n,e,o,r;n=i,e=t,o=Math.abs(n.clientX-e.x()),r=Math.abs(n.clientY-e.y()),(5<o||5<r)&&u.set(et.none())})}),et.none()}},{key:Pt(),value:function(n){return o.cancel(),u.get().filter(function(t){return he(t.target(),n.target())}).map(function(t){return e.triggerEvent(Vn(),n)})}}]);return{fireIfReady:function(n,t){return Et(r,t).bind(function(t){return t(n)})}}},Bv=Tn.detect().browser.isFirefox(),Av=Uo([wr("triggerEvent"),_r("stopBackspace",!0)]),Dv=function(n,t){var e,o,r,i,u=ar("Getting GUI events settings",Av,t),a=Tn.detect().deviceType.isTouch()?["touchstart","touchmove","touchend","gesturestart"]:["mousedown","mouseup","mouseover","mousemove","mouseout","click"],c=Tv(u),s=A(a.concat(["selectstart","input","contextmenu","change","transitionend","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","keyup"]),function(t){return Sv(n,t,function(n){c.fireIfReady(n,t).each(function(t){t&&n.kill()}),u.triggerEvent(t,n)&&n.kill()})}),f=_t(et.none()),l=Sv(n,"paste",function(n){c.fireIfReady(n,"paste").each(function(t){t&&n.kill()}),u.triggerEvent("paste",n)&&n.kill(),f.set(et.some(x.setTimeout(function(){u.triggerEvent(_n(),n)},0)))}),d=Sv(n,"keydown",function(t){var n;u.triggerEvent("keydown",t)?t.kill():!0!==u.stopBackspace||8!==(n=t).raw().which||E(["input","textarea"],Fe(n.target()))||Cv(n.target(),'[contenteditable="true"]')||t.prevent()}),m=(e=n,o=function(t){u.triggerEvent("focusin",t)&&t.kill()},Bv?kv(e,"focus",o):Sv(e,"focusin",o)),g=_t(et.none()),p=(r=n,i=function(t){u.triggerEvent("focusout",t)&&t.kill(),g.set(et.some(x.setTimeout(function(){u.triggerEvent(Dn(),t)},0)))},Bv?kv(r,"blur",i):Sv(r,"focusout",i));return{unbind:function(){M(s,function(t){t.unbind()}),d.unbind(),m.unbind(),p.unbind(),l.unbind(),f.get().each(x.clearTimeout),g.get().each(x.clearTimeout)}}},_v=function(t,n){var e=Et(t,"target").map(function(t){return t()}).getOr(n);return _t(e)},Mv=bt([{stopped:[]},{resume:["element"]},{complete:[]}]),Fv=function(t,o,n,e,r,i){var u,a,c,s,f=t(o,e),l=(u=n,a=r,c=_t(!1),s=_t(!1),{stop:function(){c.set(!0)},cut:function(){s.set(!0)},isStopped:c.get,isCut:s.get,event:nt(u),setSource:a.set,getSource:a.get});return f.fold(function(){return i.logEventNoHandlers(o,e),Mv.complete()},function(n){var e=n.descHandler();return Wi(e)(l),l.isStopped()?(i.logEventStopped(o,n.element(),e.purpose()),Mv.stopped()):l.isCut()?(i.logEventCut(o,n.element(),e.purpose()),Mv.complete()):ye(n.element()).fold(function(){return i.logNoParent(o,n.element(),e.purpose()),Mv.complete()},function(t){return i.logEventResponse(o,n.element(),e.purpose()),Mv.resume(t)})})},Iv=function(n,e,o,t,r,i){return Fv(n,e,o,t,r,i).fold(function(){return!0},function(t){return Iv(n,e,o,t,r,i)},function(){return!1})},Vv=function(t,n,e){var o,r,i=(o=n,r=_t(!1),{stop:function(){r.set(!0)},cut:tt,isStopped:r.get,isCut:nt(!1),event:nt(o),setSource:u("Cannot set source of a broadcasted event"),getSource:u("Cannot get source of a broadcasted event")});return M(t,function(t){var n=t.descHandler();Wi(n)(i)}),i.isStopped()},Rv=function(t,n,e,o,r){var i=_v(e,o);return Iv(t,n,e,o,i,r)},Hv=te("element","descHandler"),Nv=function(t,n){return{id:nt(t),descHandler:nt(n)}};function Pv(){var i={};return{registerId:function(o,r,t){rt(t,function(t,n){var e=i[n]!==undefined?i[n]:{};e[r]=Ui(t,o),i[n]=e})},unregisterId:function(e){rt(i,function(t,n){t.hasOwnProperty(e)&&delete t[e]})},filterByType:function(t){return Et(i,t).map(function(t){return at(t,function(t,n){return Nv(n,t)})}).getOr([])},find:function(t,n,e){var r=Ct(n)(i);return oi(e,function(t){return e=r,Bi(o=t).fold(function(){return et.none()},function(t){var n=Ct(t);return e.bind(n).map(function(t){return Hv(o,t)})});var e,o},t)}}}function zv(){var o=Pv(),r={},i=function(o){var t=o.element();return Bi(t).fold(function(){return t="uid-",n=o.element(),e=ro(Oi+t),Ti(n,e),e;var t,n,e},function(t){return t})},u=function(t){Bi(t.element()).each(function(t){delete r[t],o.unregisterId(t)})};return{find:function(t,n,e){return o.find(t,n,e)},filter:function(t){return o.filterByType(t)},register:function(t){var n=i(t);Dt(r,n)&&function(t,n){var e=r[n];if(e!==t)throw new Error('The tagId "'+n+'" is already used by: '+Ye(e.element())+"\nCannot use it for: "+Ye(t.element())+"\nThe conflicting element is"+($r(e.element())?" ":" not ")+"already in the DOM");u(t)}(t,n);var e=[t];o.registerId(e,n,t.events()),r[n]=t},unregister:u,getById:function(t){return Ct(t)(r)}}}var Lv,jv,Uv=ul({name:"Container",factory:function(t){var n=t.dom,e=n.attributes,o=ao(n,["attributes"]);return{uid:t.uid,dom:uo({tag:"div",attributes:uo({role:"presentation"},e)},o),components:t.components,behaviours:Qs(t.containerBehaviours),events:t.events,domModification:t.domModification,eventOrder:t.eventOrder}},configFields:[_r("components",[]),$s("containerBehaviours",[]),_r("events",{}),_r("domModification",{}),_r("eventOrder",{})]}),Wv=function(e){var o=function(n){return ye(e.element()).fold(function(){return!0},function(t){return he(n,t)})},r=zv(),s=function(t,n){return r.find(o,t,n)},t=Dv(e.element(),{triggerEvent:function(u,a){return Ze(u,a.target(),function(t){return n=s,e=u,r=t,i=(o=a).target(),Rv(n,e,o,i,r);var n,e,o,r,i})}}),i={debugInfo:nt("real"),triggerEvent:function(n,e,o){Ze(n,e,function(t){Rv(s,n,o,e,t)})},triggerFocus:function(a,c){Bi(a).fold(function(){Rl(a)},function(t){Ze(An(),a,function(t){var n,e,o,r,i,u;n=s,e=An(),o={originator:nt(c),kill:tt,prevent:tt,target:nt(a)},i=t,u=_v(o,r=a),Fv(n,e,o,r,u,i)})})},triggerEscape:function(t,n){i.triggerEvent("keydown",t.element(),n.event())},getByUid:function(t){return g(t)},getByDom:function(t){return p(t)},build:Du,addToGui:function(t){a(t)},removeFromGui:function(t){c(t)},addToWorld:function(t){n(t)},removeFromWorld:function(t){u(t)},broadcast:function(t){l(t)},broadcastOn:function(t,n){d(t,n)},broadcastEvent:function(t,n){m(t,n)},isConnected:nt(!0)},n=function(t){t.connect(i),He(t.element())||(r.register(t),M(t.components(),n),i.triggerEvent(zn(),t.element(),{target:nt(t.element())}))},u=function(t){He(t.element())||(M(t.components(),u),r.unregister(t)),t.disconnect()},a=function(t){As(e,t)},c=function(t){Ms(t)},f=function(e){var t=r.filter(Mn());M(t,function(t){var n=t.descHandler();Wi(n)(e)})},l=function(t){f({universal:nt(!0),data:nt(t)})},d=function(t,n){f({universal:nt(!1),channels:nt(t),data:nt(n)})},m=function(t,n){var e=r.filter(t);return Vv(e,n)},g=function(t){return r.getById(t).fold(function(){return vt.error(new Error('Could not find component with uid: "'+t+'" in system.'))},vt.value)},p=function(t){var n=Bi(t).getOr("not found");return g(n)};return n(e),{root:nt(e),element:e.element,destroy:function(){t.unbind(),De(e.element())},add:a,remove:c,getByUid:g,getByDom:p,addToWorld:n,removeFromWorld:u,broadcast:l,broadcastOn:d,broadcastEvent:m}},Gv=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),Xv=tinymce.util.Tools.resolve("tinymce.EditorManager"),Yv=function(t){return et.from(t.settings.min_width).filter(_)},qv=function(t){return et.from(t.settings.min_height).filter(_)},Kv=function(n){var t=Z(n.settings),e=V(t,function(t){return/^toolbar([1-9])$/.test(t)}),o=A(e,function(t){return n.getParam(t,!1,"string")}),r=V(o,function(t){return"string"==typeof t});return 0<r.length?et.some(r):et.none()};(jv=Lv||(Lv={}))["default"]="",jv.floating="floating",jv.sliding="sliding";var Jv,$v,Qv=function(t){return t.getParam("toolbar_drawer","","string")},Zv=function(t){var n=t.getParam("fixed_toolbar_container","","string"),e=t.getParam("inline",!1,"boolean");return 0<n.length&&e?Iu(Qr(),n):et.none()},tb=function(t){return t.getParam("inline",!1,"boolean")&&Zv(t).isSome()},nb=ro("form-component-change"),eb=ro("form-close"),ob=ro("form-cancel"),rb=ro("form-action"),ib=ro("form-submit"),ub=ro("form-block"),ab=ro("form-unblock"),cb=ro("form-tabchange"),sb=ro("form-resize"),fb=nt([_r("prefix","form-field"),$s("fieldBehaviours",[ll,Vm])]),lb=nt([_f({schema:[vr("dom")],name:"label"}),_f({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:t.text}}}},schema:[vr("text")],name:"aria-descriptor"}),Af({factory:{sketch:function(t){var n=kt(t,["factory"]);return t.factory.sketch(n)}},schema:[vr("factory")],name:"field"})]),db=al({name:"FormField",configFields:fb(),partFields:lb(),factory:function(r,t,n,e){var o=Zs(r.fieldBehaviours,[ll.config({find:function(t){return Uf(t,r,"field")}}),Vm.config({store:{mode:"manual",getValue:function(t){return ll.getCurrent(t).bind(Vm.getValue)},setValue:function(t,n){ll.getCurrent(t).each(function(t){Vm.setValue(t,n)})}}})]),i=ri([vi(function(t,n){var o=Gf(t,r,["label","field","aria-descriptor"]);o.field().each(function(e){var n=ro(r.prefix);o.label().each(function(t){ze(t.element(),"for",n),ze(e.element(),"id",n)}),o["aria-descriptor"]().each(function(t){var n=ro(r.prefix);ze(t.element(),"id",n),ze(e.element(),"aria-describedby",n)})})})]),u={getField:function(t){return Uf(t,r,"field")},getLabel:function(t){return Uf(t,r,"label")}};return{uid:r.uid,dom:r.dom,components:t,behaviours:o,events:i,apis:u}},apis:{getField:function(t,n){return t.getField(n)},getLabel:function(t,n){return t.getLabel(n)}}}),mb=/* */Object.freeze({getCoupled:function(t,n,e,o){return e.getOrCreate(t,n,o)}}),gb=[br("others",or(vt.value,fr()))],pb=ua({fields:gb,name:"coupling",apis:mb,state:/* */Object.freeze({init:function(t){var i={},n=nt({});return zi({readState:n,getOrCreate:function(e,o,r){var t=Z(o.others);if(t)return Et(i,r).getOrThunk(function(){var t=Et(o.others,r).getOrDie("No information found for coupled component: "+r)(e),n=e.getSystem().build(t);return i[r]=n});throw new Error("Cannot find coupled component: "+r+". Known coupled components: "+Vo(t,null,2))}})}})}),hb=/* */Object.freeze({events:function(t,n){var e=t.stream.streams.setup(t,n);return ri([ci(t.event,e),bi(function(){return n.cancel()})].concat(t.cancelEvent.map(function(t){return[ci(t,function(){return n.cancel()})]}).getOr([])))}}),vb=function(t){var n=_t(null);return zi({readState:function(){return{timer:null!==n.get()?"set":"unset"}},setTimer:function(t){n.set(t)},cancel:function(){var t=n.get();null!==t&&t.cancel()}})},bb=/* */Object.freeze({throttle:vb,init:function(t){return t.stream.streams.state(t)}}),yb=[br("stream",sr("mode",{throttle:[vr("delay"),_r("stopEvent",!0),Ju("streams",{setup:function(t,n){var e=t.stream,o=Mg(t.onStream,e.delay);return n.setTimer(o),function(t,n){o.throttle(t,n),e.stopEvent&&n.stop()}},state:vb})]})),_r("event","input"),Or("cancelEvent"),qu("onStream")],xb=ua({fields:yb,name:"streaming",active:hb,state:bb}),wb=function(t){var e=et.none(),n=[],o=function(t){r()?u(t):n.push(t)},r=function(){return e.isSome()},i=function(t){M(t,u)},u=function(n){e.each(function(t){x.setTimeout(function(){n(t)},0)})};return t(function(t){e=et.some(t),i(n),n=[]}),{get:o,map:function(e){return wb(function(n){o(function(t){n(e(t))})})},isReady:r}},Sb={nu:wb,pure:function(n){return wb(function(t){t(n)})}},kb=function(n){var t=function(t){var o;n((o=t,function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var e=this;x.setTimeout(function(){o.apply(e,t)},0)}))},e=function(){return Sb.nu(t)};return{map:function(o){return kb(function(e){t(function(t){var n=o(t);e(n)})})},bind:function(e){return kb(function(n){t(function(t){e(t).get(n)})})},anonBind:function(e){return kb(function(n){t(function(t){e.get(n)})})},toLazy:e,toCached:function(){var n=null;return kb(function(t){null===n&&(n=e()),n.get(t)})},get:t}},Cb={nu:kb,pure:function(n){return kb(function(t){t(n)})}},Ob=nt("sink"),Eb=nt(_f({name:Ob(),overrides:nt({dom:{tag:"div"},behaviours:ra([Es.config({useFixed:!0})]),events:ri([gi(Yt()),gi(zt()),gi($t())])})}));($v=Jv||(Jv={}))[$v.HighlightFirst=0]="HighlightFirst",$v[$v.HighlightNone=1]="HighlightNone";var Tb=function(t,n){var e=t.getHotspot(n).getOr(n),o=t.getAnchorOverrides();return t.layouts.fold(function(){return{anchor:"hotspot",hotspot:e,overrides:o}},function(t){return{anchor:"hotspot",hotspot:e,overrides:o,layouts:t}})},Bb=function(t,n,e,o,r,i,u){var a,c,s,f,l,d,m,g,p,h,v=Tb(t,e);return(c=v,f=o,l=r,d=u,m=n,g=s=e,p=(0,(a=t).fetch)(g).map(m),h=Mb(s,a),p.map(function(t){return t.bind(function(t){return et.from(yg.sketch(uo({},l.menu(),{uid:Ai(""),data:t,highlightImmediately:d===Jv.HighlightFirst,onOpenMenu:function(t,n){var e=h().getOrDie();Es.position(e,c,n),Gs.decloak(f)},onOpenSubmenu:function(t,n,e){var o=h().getOrDie();Es.position(o,{anchor:"submenu",item:n},e),Gs.decloak(f)},onEscape:function(){return zm.focus(s),Gs.close(f),et.some(!0)}})))})})).map(function(t){return t.fold(function(){Gs.isOpen(o)&&Gs.close(o)},function(t){Gs.cloak(o),Gs.open(o,t),i(o)}),o})},Ab=function(t,n,e,o,r,i,u){return Gs.close(o),Cb.pure(o)},Db=function(t,n,e,o,r,i){var u=pb.getCoupled(e,"sandbox");return(Gs.isOpen(u)?Ab:Bb)(t,n,e,u,o,r,i)},_b=function(t,n,e){var o,r,i=ll.getCurrent(n).getOr(n),u=Sa(t.element());e?fu(i.element(),"min-width",u+"px"):(o=i.element(),r=u,wa.set(o,r))},Mb=function(n,t){return n.getSystem().getByUid(t.uid+"-"+Ob()).map(function(t){return function(){return vt.value(t)}}).getOrThunk(function(){return t.lazySink.fold(function(){return function(){return vt.error(new Error("No internal sink is specified, nor could an external sink be found"))}},function(t){return function(){return t(n)}})})},Fb=function(o,r,i){var u=Ru(),t=Mb(r,o);return{dom:{tag:"div",classes:o.sandboxClasses,attributes:{id:u.id(),role:"listbox"}},behaviours:tf.augment(o.sandboxBehaviours,[Vm.config({store:{mode:"memory",initialValue:r}}),Gs.config({onOpen:function(t,n){var e=Tb(o,r);u.link(r.element()),o.matchWidth&&_b(e.hotspot,n,o.useMinWidth),o.onOpen(e,t,n),i!==undefined&&i.onOpen!==undefined&&i.onOpen(t,n)},onClose:function(t,n){u.unlink(r.element()),i!==undefined&&i.onClose!==undefined&&i.onClose(t,n)},isPartOf:function(t,n,e){return Nu(n,e)||Nu(r,e)},getAttachPoint:function(){return t().getOrDie()}}),ll.config({find:function(t){return Gs.getState(t).bind(function(t){return ll.getCurrent(t)})}}),Ks({isExtraPart:nt(!1)})])}},Ib=function(t,n,e){var o=Vm.getValue(e);Vm.setValue(n,o),Rb(n)},Vb=function(t,n){var e=t.element(),o=yu(e),r=e.dom();"number"!==je(e,"type")&&n(r,o)},Rb=function(t){Vb(t,function(t,n){return t.setSelectionRange(n.length,n.length)})},Hb=function(t,n,o){if(t.selectsOver){var e=Vm.getValue(n),r=t.getDisplayText(e),i=Vm.getValue(o);return 0===t.getDisplayText(i).indexOf(r)?et.some(function(){var t,e;Ib(0,n,o),t=n,e=r.length,Vb(t,function(t,n){return t.setSelectionRange(e,n.length)})}):et.none()}return et.none()},Nb=nt([Or("data"),_r("inputAttributes",{}),_r("inputStyles",{}),_r("tag","input"),_r("inputClasses",[]),Xu("onSetValue"),_r("styles",{}),_r("eventOrder",{}),$s("inputBehaviours",[Vm,zm]),_r("selectOnFocus",!0)]),Pb=function(t){return ra([zm.config({onFocus:!1===t.selectOnFocus?tt:function(t){var n=t.element(),e=yu(n);n.dom().setSelectionRange(0,e.length)}})])},zb=function(t){return{tag:t.tag,attributes:uo({type:"text"},t.inputAttributes),styles:t.inputStyles,classes:t.inputClasses}},Lb=nt("alloy.typeahead.itemexecute"),jb=function(){return[_r("sandboxClasses",[]),tf.field("sandboxBehaviours",[ll,da,Gs,Vm])]},Ub=nt([Or("lazySink"),vr("fetch"),_r("minChars",5),_r("responseTime",1e3),Xu("onOpen"),_r("getHotspot",et.some),_r("getAnchorOverrides",nt({})),_r("layouts",et.none()),_r("eventOrder",{}),Nr("model",{},[_r("getDisplayText",function(t){return t.meta!==undefined&&t.meta.text!==undefined?t.meta.text:t.value}),_r("selectsOver",!0),_r("populateFromBrowse",!0)]),Xu("onSetValue"),Yu("onExecute"),Xu("onItemExecute"),_r("inputClasses",[]),_r("inputAttributes",{}),_r("inputStyles",{}),_r("matchWidth",!0),_r("useMinWidth",!1),_r("dismissOnBlur",!0),Wu(["openClass"]),Or("initialData"),$s("typeaheadBehaviours",[zm,Vm,xb,vm,Qm,pb]),Pr("previewing",function(){return _t(!0)})].concat(Nb()).concat(jb())),Wb=nt([Df({schema:[Uu()],name:"menu",overrides:function(o){return{fakeFocus:!0,onHighlight:function(n,e){o.previewing.get()?n.getSystem().getByUid(o.uid).each(function(t){Hb(o.model,t,e).fold(function(){return Cl.dehighlight(n,e)},function(t){return t()})}):n.getSystem().getByUid(o.uid).each(function(t){o.model.populateFromBrowse&&Ib(o.model,t,e)}),o.previewing.set(!1)},onExecute:function(t,n){return t.getSystem().getByUid(o.uid).toOption().map(function(t){return Wr(t,Lb(),{item:n}),!0})},onHover:function(t,n){o.previewing.set(!1),t.getSystem().getByUid(o.uid).each(function(t){o.model.populateFromBrowse&&Ib(o.model,t,n)})}}}})]),Gb=al({name:"Typeahead",configFields:Ub(),partFields:Wb(),factory:function(r,t,n,i){var e=function(t,n,e){r.previewing.set(!1);var o=pb.getCoupled(t,"sandbox");Gs.isOpen(o)?ll.getCurrent(o).each(function(t){Cl.getHighlighted(t).fold(function(){e(t)},function(){qr(o,t.element(),"keydown",n)})}):Bb(r,u(t),t,o,i,function(t){ll.getCurrent(t).each(e)},Jv.HighlightFirst).get(tt)},o=Pb(r),u=function(o){return function(t){return t.map(function(t){var n=st(t.menus),e=j(n,function(t){return V(t.items,function(t){return"item"===t.type})});return Vm.getState(o).update(A(e,function(t){return t.data})),t})}},a=[zm.config({}),Vm.config({onSetValue:r.onSetValue,store:uo({mode:"dataset",getDataKey:function(t){return yu(t.element())},getFallbackEntry:function(t){return{value:t,meta:{}}},setValue:function(t,n){xu(t.element(),r.model.getDisplayText(n))}},r.initialData.map(function(t){return Tt("initialValue",t)}).getOr({}))}),xb.config({stream:{mode:"throttle",delay:r.responseTime,stopEvent:!1},onStream:function(t,n){var e=pb.getCoupled(t,"sandbox");if(zm.isFocused(t)&&yu(t.element()).length>=r.minChars){var o=ll.getCurrent(e).bind(function(t){return Cl.getHighlighted(t).map(Vm.getValue)});r.previewing.set(!0),Bb(r,u(t),t,e,i,function(t){ll.getCurrent(e).each(function(t){o.fold(function(){r.model.selectsOver&&Cl.highlightFirst(t)},function(n){Cl.highlightBy(t,function(t){return Vm.getValue(t).value===n.value}),Cl.getHighlighted(t).orThunk(function(){return Cl.highlightFirst(t),et.none()})})})},Jv.HighlightFirst).get(tt)}},cancelEvent:Pn()}),vm.config({mode:"special",onDown:function(t,n){return e(t,n,Cl.highlightFirst),et.some(!0)},onEscape:function(t){var n=pb.getCoupled(t,"sandbox");return Gs.isOpen(n)?(Gs.close(n),et.some(!0)):et.none()},onUp:function(t,n){return e(t,n,Cl.highlightLast),et.some(!0)},onEnter:function(n){var t=pb.getCoupled(n,"sandbox"),e=Gs.isOpen(t);if(e&&!r.previewing.get())return ll.getCurrent(t).bind(function(t){return Cl.getHighlighted(t)}).map(function(t){return Wr(n,Lb(),{item:t}),!0});var o=Vm.getValue(n);return Ur(n,Pn()),r.onExecute(t,n,o),e&&Gs.close(t),et.some(!0)}}),Qm.config({toggleClass:r.markers.openClass,aria:{mode:"expanded"}}),pb.config({others:{sandbox:function(t){return Fb(r,t,{onOpen:function(){return Qm.on(t)},onClose:function(){return Qm.off(t)}})}}}),ig("typeaheadevents",[xi(function(t){var n=tt;Db(r,u(t),t,i,n,Jv.HighlightFirst).get(tt)}),ci(Lb(),function(t,n){var e=pb.getCoupled(t,"sandbox");Ib(r.model,t,n.event().item()),Ur(t,Pn()),r.onItemExecute(t,e,n.event().item(),Vm.getValue(t)),Gs.close(e),Rb(t)})].concat(r.dismissOnBlur?[ci(Dn(),function(t){var n=pb.getCoupled(t,"sandbox");Nl(n.element()).isNone()&&Gs.close(n)})]:[]))];return{uid:r.uid,dom:zb(wt(r,{inputAttributes:{role:"combobox","aria-autocomplete":"list","aria-haspopup":"true"}})),behaviours:uo({},o,Zs(r.typeaheadBehaviours,a)),eventOrder:r.eventOrder}}}),Xb=function(t,n,e){var o=qb(t,n,e);return db.sketch(o)},Yb=function(t,n){return Xb(t,n,[])},qb=function(t,n,e){return{dom:Kb(e),components:t.toArray().concat([n])}},Kb=function(t){return{tag:"div",classes:["tox-form__group"].concat(t)}},Jb=function(t,n){return db.parts().label({dom:{tag:"label",classes:["tox-label"],innerHtml:n.translate(t)}})},$b=function(t){return"separator"===t.type},Qb={type:"separator"},Zb=function(t,e){var n=U(t,function(t,n){return k(n)?""===n?t:"|"===n?0<t.length&&!$b(t[t.length-1])?t.concat([Qb]):t:lt(e,n.toLowerCase())?t.concat([e[n.toLowerCase()]]):t:t.concat([n])},[]);return 0<n.length&&$b(n[n.length-1])&&n.pop(),n},ty=function(t,n){return lt(t,"getSubmenuItems")?(o=n,r=(e=t).getSubmenuItems(),i=ny(r,o),{item:e,menus:wt(i.menus,Tt(e.value,i.items)),expansions:wt(i.expansions,Tt(e.value,e.value))}):{item:t,menus:{},expansions:{}};var e,o,r,i},ny=function(t,r){var n=Zb(k(t)?t.split(" "):t,r);return R(n,function(t,n){var e=function(t){if($b(t))return t;var n=Et(t,"value").getOrThunk(function(){return ro("generated-menu-item")});return wt({value:n},t)}(n),o=ty(e,r);return{menus:wt(t.menus,o.menus),items:[o.item].concat(t.items),expansions:wt(t.expansions,o.expansions)}},{menus:{},expansions:{},items:[]})},ey=function(t,e,o){var n=ro("primary-menu"),r=ny(t,o.shared.providers.menuItems());if(0===r.items.length)return et.none();var i=pv(n,r.items,e,o),u=it(r.menus,function(t,n){return pv(n,t,e,o)}),a=wt(u,Tt(n,i));return et.from(yg.tieredData(n,a,r.expansions))},oy=ul({name:"Input",configFields:Nb(),factory:function(t,n){return{uid:t.uid,dom:zb(t),components:[],behaviours:(e=t,uo({},Pb(e),Zs(e.inputBehaviours,[Vm.config({store:{mode:"manual",initialValue:e.data.getOr(undefined),getValue:function(t){return yu(t.element())},setValue:function(t,n){yu(t.element())!==n&&xu(t.element(),n)}},onSetValue:e.onSetValue})]))),eventOrder:t.eventOrder};var e}}),ry=["input","textarea"],iy=function(t){var n=Fe(t);return E(ry,n)},uy=function(t,n){var e=n.getRoot(t).getOr(t.element());ou(e,n.invalidClass),n.notify.each(function(n){iy(t.element())&&ze(t.element(),"aria-invalid",!1),n.getContainer(t).each(function(t){Me(t,n.validHtml)}),n.onValid(t)})},ay=function(n,t,e,o){var r=t.getRoot(n).getOr(n.element());eu(r,t.invalidClass),t.notify.each(function(t){iy(n.element())&&ze(n.element(),"aria-invalid",!0),t.getContainer(n).each(function(t){Me(t,o)}),t.onInvalid(n,o)})},cy=function(n,t,e){return t.validator.fold(function(){return Cb.pure(vt.value(!0))},function(t){return t.validate(n)})},sy=function(n,e,t){return e.notify.each(function(t){t.onValidate(n)}),cy(n,e).map(function(t){return n.getSystem().isConnected()?t.fold(function(t){return ay(n,e,0,t),vt.error(t)},function(t){return uy(n,e),vt.value(t)}):vt.error("No longer in system")})},fy=/* */Object.freeze({markValid:uy,markInvalid:ay,query:cy,run:sy,isInvalid:function(t,n){var e=n.getRoot(t).getOr(t.element());return ru(e,n.invalidClass)}}),ly=/* */Object.freeze({events:function(n,t){return n.validator.map(function(t){return ri([ci(t.onEvent,function(t){sy(t,n).get(d)})].concat(t.validateOnLoad?[vi(function(t){sy(t,n).get(tt)})]:[]))}).getOr({})}}),dy=[vr("invalidClass"),_r("getRoot",et.none),Dr("notify",[_r("aria","alert"),_r("getContainer",et.none),_r("validHtml",""),Xu("onValid"),Xu("onInvalid"),Xu("onValidate")]),Dr("validator",[vr("validate"),_r("onEvent","input"),_r("validateOnLoad",!0)])],my=ua({fields:dy,name:"invalidating",active:ly,apis:fy,extra:{validation:function(e){return function(t){var n=Vm.getValue(t);return Cb.pure(e(n))}}}}),gy=/* */Object.freeze({exhibit:function(t,n){return ji({attributes:Bt([{key:n.tabAttr,value:"true"}])})}}),py=[_r("tabAttr","data-alloy-tabstop")],hy=ua({fields:py,name:"tabstopping",active:gy}),vy=nt([vr("dom"),vr("fetch"),Xu("onOpen"),Yu("onExecute"),_r("getHotspot",et.some),_r("getAnchorOverrides",nt({})),_r("layouts",et.none()),$s("dropdownBehaviours",[Qm,pb,vm,zm]),vr("toggleClass"),_r("eventOrder",{}),Or("lazySink"),_r("matchWidth",!1),_r("useMinWidth",!1),Or("role")].concat(jb())),by=nt([Df({schema:[Uu()],name:"menu",defaults:function(t){return{onExecute:t.onExecute}}}),Eb()]),yy=al({name:"Dropdown",configFields:vy(),partFields:by(),factory:function(n,t,e,o){var r,i,u=function(t){Gs.getState(t).each(function(t){yg.highlightPrimary(t)})},a={expand:function(t){Qm.isOn(t)||Db(n,function(t){return t},t,o,tt,Jv.HighlightNone).get(tt)},open:function(t){Qm.isOn(t)||Db(n,function(t){return t},t,o,tt,Jv.HighlightFirst).get(tt)},isOpen:Qm.isOn,close:function(t){Qm.isOn(t)&&Db(n,function(t){return t},t,o,tt,Jv.HighlightFirst).get(tt)}},c=function(t,n){return Gr(t),et.some(!0)};return{uid:n.uid,dom:n.dom,components:t,behaviours:Zs(n.dropdownBehaviours,[Qm.config({toggleClass:n.toggleClass,aria:{mode:"expanded"}}),pb.config({others:{sandbox:function(t){return Fb(n,t,{onOpen:function(){Qm.on(t)},onClose:function(){Qm.off(t)}})}}}),vm.config({mode:"special",onSpace:c,onEnter:c,onDown:function(t,n){if(yy.isOpen(t)){var e=pb.getCoupled(t,"sandbox");u(e)}else yy.open(t);return et.some(!0)},onEscape:function(t,n){return yy.isOpen(t)?(yy.close(t),et.some(!0)):et.none()}}),zm.config({})]),events:wg(et.some(function(t){Db(n,function(t){return t},t,o,u,Jv.HighlightFirst).get(tt)})),eventOrder:uo({},n.eventOrder,(r={},r[Fn()]=["disabling","toggling","alloy.base.behaviour"],r)),apis:a,domModification:{attributes:uo({"aria-haspopup":"true"},n.role.fold(function(){return{}},function(t){return{role:t}}),"button"===n.dom.tag?{type:(i="type",Et(n.dom,"attributes").bind(function(t){return Et(t,i)})).getOr("button")}:{})}}},apis:{open:function(t,n){return t.open(n)},expand:function(t,n){return t.expand(n)},close:function(t,n){return t.close(n)},isOpen:function(t,n){return t.isOpen(n)}}}),xy=ua({fields:[],name:"unselecting",active:/* */Object.freeze({events:function(t){return ri([ii(Zt(),nt(!0))])},exhibit:function(t,n){return ji({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})}})}),wy=ro("color-input-change"),Sy=ro("color-swatch-change"),ky=ro("color-picker-cancel"),Cy=function(t,n,o){var e,r,i=db.parts().field({factory:oy,inputClasses:["tox-textfield"],onSetValue:function(t){return my.run(t).get(function(){})},inputBehaviours:ra([hy.config({}),my.config({invalidClass:"tox-textbox-field-invalid",getRoot:function(t){return ye(t.element())},notify:{onValid:function(t){var n=Vm.getValue(t);Wr(t,wy,{color:n})}},validator:{validateOnLoad:!1,validate:function(t){var n=Vm.getValue(t);if(0===n.length)return Cb.pure(vt.value(!0));var e=Zn.fromTag("span");fu(e,"background-color",n);var o=pu(e,"background-color").fold(function(){return vt.error("blah")},function(t){return vt.value(n)});return Cb.pure(o)}}})]),selectOnFocus:!1}),u=t.label.map(function(t){return Jb(t,n.providers)}),a=function(t,n){Wr(t,Sy,{value:n})},c=kg((e={dom:{tag:"span",attributes:{"aria-label":n.providers.translate("Color swatch")}},layouts:et.some({onRtl:function(){return[bc]},onLtr:function(){return[yc]}}),components:[],fetch:Gh.getFetch(o.getColors(),o.hasCustomColors()),columns:o.getColorCols(),presets:"color",onItemAction:function(t,e){c.getOpt(t).each(function(n){"custom"===e?o.colorPicker(function(t){t.fold(function(){return Ur(n,ky)},function(t){a(n,t),Ih(t)})},"#ffffff"):a(n,"remove"===e?"":e)})}},r=n,yy.sketch({dom:e.dom,components:e.components,toggleClass:"mce-active",dropdownBehaviours:ra([xy.config({}),hy.config({})]),layouts:e.layouts,sandboxClasses:["tox-dialog__popups"],lazySink:r.getSink,fetch:function(n){return Cb.nu(function(t){return e.fetch(t)}).map(function(t){return et.from(hv(wt(nv(ro("menu-value"),t,function(t){e.onItemAction(n,t)},e.columns,e.presets,Kp.CLOSE_ON_EXECUTE,function(){return!1},r.providers),{movement:ov(e.columns,e.presets)})))})},parts:{menu:$h(0,0,e.presets)}})));return db.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:u.toArray().concat([{dom:{tag:"div",classes:["tox-color-input"]},components:[i,c.asSpec()]}]),fieldBehaviours:ra([ig("form-field-events",[ci(wy,function(t,n){c.getOpt(t).each(function(t){fu(t.element(),"background-color",n.event().color())})}),ci(Sy,function(n,e){db.getField(n).each(function(t){Vm.setValue(t,e.event().value()),ll.getCurrent(n).each(zm.focus)})}),ci(ky,function(n,t){db.getField(n).each(function(t){ll.getCurrent(n).each(zm.focus)})})])])})},Oy=function(t,n,e){return{hue:nt(t),saturation:nt(n),value:nt(e)}},Ey=nt(ro("rgb-hex-update")),Ty=nt(ro("slider-update")),By=nt(ro("palette-update")),Ay=Tn.detect().deviceType.isTouch(),Dy=_f({schema:[vr("dom")],name:"label"}),_y=function(t){return _f({name:t+"-edge",overrides:function(o){return o.model.manager.edgeActions[t].fold(function(){return{}},function(e){var t=ri([si(Ht(),e,[o])]),n=ri([si(zt(),e,[o]),si(Lt(),function(t,n){n.mouseIsDown.get()&&e(t,n)},[o])]);return{events:Ay?t:n}})}})},My=_y("top-left"),Fy=_y("top"),Iy=_y("top-right"),Vy=_y("right"),Ry=_y("bottom-right"),Hy=_y("bottom"),Ny=_y("bottom-left"),Py=[Dy,_y("left"),Vy,Fy,Hy,My,Iy,Ny,Ry,Af({name:"thumb",defaults:nt({dom:{styles:{position:"absolute"}}}),overrides:function(t){return{events:ri([di(Ht(),t,"spectrum"),di(Nt(),t,"spectrum"),di(Pt(),t,"spectrum"),di(zt(),t,"spectrum"),di(Lt(),t,"spectrum"),di(Ut(),t,"spectrum")])}}}),Af({schema:[Pr("mouseIsDown",function(){return _t(!1)})],name:"spectrum",overrides:function(e){var o=e.model.manager,r=function(n,t){return o.getValueFromEvent(t).map(function(t){return o.setValueFrom(n,e,t)})},t=ri([ci(Ht(),r),ci(Nt(),r)]),n=ri([ci(zt(),r),ci(Lt(),function(t,n){e.mouseIsDown.get()&&r(t,n)})]);return{behaviours:ra(Ay?[]:[vm.config({mode:"special",onLeft:function(t){return o.onLeft(t,e)},onRight:function(t){return o.onRight(t,e)},onUp:function(t){return o.onUp(t,e)},onDown:function(t){return o.onDown(t,e)}}),zm.config({})]),events:Ay?t:n}}})],zy=Tn.detect().deviceType.isTouch(),Ly=nt("slider.change.value"),jy=function(t){var n=t.event().raw();if(zy){var e=n;return e.touches!==undefined&&1===e.touches.length?et.some(e.touches[0]).map(function(t){return pa(t.clientX,t.clientY)}):et.none()}var o=n;return o.clientX!==undefined?et.some(o).map(function(t){return pa(t.clientX,t.clientY)}):et.none()},Uy=function(t,n,e,o){return t<n?t:e<t?e:t===n?n-1:Math.max(n,t-o)},Wy=function(t,n,e,o){return e<t?t:t<n?n:t===e?e+1:Math.min(e,t+o)},Gy=function(t,n,e){return Math.max(n,Math.min(e,t))},Xy=function(t){var n=t.min,e=t.max,o=t.range,r=t.value,i=t.step,u=t.snap,a=t.snapStart,c=t.rounded,s=t.hasMinEdge,f=t.hasMaxEdge,l=t.minBound,d=t.maxBound,m=t.screenRange,g=s?n-1:n,p=f?e+1:e;if(r<l)return g;if(d<r)return p;var h,v,b,y,x,w,S,k=(x=r,w=l,S=d,Math.min(S,Math.max(x,w))-w),C=Gy(k/m*o+n,g,p);return u&&n<=C&&C<=e?(h=C,v=n,b=e,y=i,a.fold(function(){var t=h-v,n=Math.round(t/y)*y;return Gy(v+n,v-1,b+1)},function(t){var n=(h-t)%y,e=Math.round(n/y),o=Math.floor((h-t)/y),r=Math.floor((b-t)/y),i=t+Math.min(r,o+e)*y;return Math.max(t,i)})):c?Math.round(C):C},Yy=function(t){var n=t.min,e=t.max,o=t.range,r=t.value,i=t.hasMinEdge,u=t.hasMaxEdge,a=t.maxBound,c=t.maxOffset,s=t.centerMinEdge,f=t.centerMaxEdge;return r<n?i?0:s:e<r?u?a:f:(r-n)/o*c},qy=function(t){return t.model.minX},Ky=function(t){return t.model.minY},Jy=function(t){return t.model.minX-1},$y=function(t){return t.model.minY-1},Qy=function(t){return t.model.maxX},Zy=function(t){return t.model.maxY},tx=function(t){return t.model.maxX+1},nx=function(t){return t.model.maxY+1},ex=function(t,n,e){return n(t)-e(t)},ox=function(t){return ex(t,Qy,qy)},rx=function(t){return ex(t,Zy,Ky)},ix=function(t){return ox(t)/2},ux=function(t){return rx(t)/2},ax=function(t){return t.stepSize},cx=function(t){return t.snapToGrid},sx=function(t){return t.snapStart},fx=function(t){return t.rounded},lx=function(t,n){return t[n+"-edge"]!==undefined},dx=function(t){return lx(t,"left")},mx=function(t){return lx(t,"right")},gx=function(t){return lx(t,"top")},px=function(t){return lx(t,"bottom")},hx=function(t){return t.model.value.get()},vx=function(t){return{x:nt(t)}},bx=function(t){return{y:nt(t)}},yx=function(t,n){return{x:nt(t),y:nt(n)}},xx=function(t,n){Wr(t,Ly(),{value:n})},wx="left",Sx=function(t){return t.element().dom().getBoundingClientRect()},kx=function(t,n){return t[n]},Cx=function(t){var n=Sx(t);return kx(n,wx)},Ox=function(t){var n=Sx(t);return kx(n,"right")},Ex=function(t){var n=Sx(t);return kx(n,"top")},Tx=function(t){var n=Sx(t);return kx(n,"bottom")},Bx=function(t){var n=Sx(t);return kx(n,"width")},Ax=function(t){var n=Sx(t);return kx(n,"height")},Dx=function(t,n,e){return(t+n)/2-e},_x=function(t,n){var e=Sx(t),o=Sx(n),r=kx(e,wx),i=kx(e,"right"),u=kx(o,wx);return Dx(r,i,u)},Mx=function(t,n){var e=Sx(t),o=Sx(n),r=kx(e,"top"),i=kx(e,"bottom"),u=kx(o,"top");return Dx(r,i,u)},Fx=function(t,n){Wr(t,Ly(),{value:n})},Ix=function(t){return{x:nt(t)}},Vx=function(t,n,e){var o={min:qy(n),max:Qy(n),range:ox(n),value:e,step:ax(n),snap:cx(n),snapStart:sx(n),rounded:fx(n),hasMinEdge:dx(n),hasMaxEdge:mx(n),minBound:Cx(t),maxBound:Ox(t),screenRange:Bx(t)};return Xy(o)},Rx=function(u){return function(t,n){return(e=u,o=t,r=n,i=(0<e?Wy:Uy)(hx(r).x(),qy(r),Qy(r),ax(r)),Fx(o,Ix(i)),et.some(i)).map(function(){return!0});var e,o,r,i}},Hx=function(t,n,e,o,r,i){var u,a,c,s,f,l,d,m,g,p=(a=i,c=e,s=o,f=r,l=Bx(u=n),d=s.bind(function(t){return et.some(_x(t,u))}).getOr(0),m=f.bind(function(t){return et.some(_x(t,u))}).getOr(l),g={min:qy(a),max:Qy(a),range:ox(a),value:c,hasMinEdge:dx(a),hasMaxEdge:mx(a),minBound:Cx(u),minOffset:0,maxBound:Ox(u),maxOffset:l,centerMinEdge:d,centerMaxEdge:m},Yy(g));return Cx(n)-Cx(t)+p},Nx=Rx(-1),Px=Rx(1),zx=et.none,Lx=et.none,jx={"top-left":et.none(),top:et.none(),"top-right":et.none(),right:et.some(function(t,n){xx(t,vx(tx(n)))}),"bottom-right":et.none(),bottom:et.none(),"bottom-left":et.none(),left:et.some(function(t,n){xx(t,vx(Jy(n)))})},Ux=/* */Object.freeze({setValueFrom:function(t,n,e){var o=Vx(t,n,e),r=Ix(o);return Fx(t,r),o},setToMin:function(t,n){var e=qy(n);Fx(t,Ix(e))},setToMax:function(t,n){var e=Qy(n);Fx(t,Ix(e))},findValueOfOffset:Vx,getValueFromEvent:function(t){return jy(t).map(function(t){return t.left()})},findPositionOfValue:Hx,setPositionFromValue:function(t,n,e,o){var r=hx(e),i=Hx(t,o.getSpectrum(t),r.x(),o.getLeftEdge(t),o.getRightEdge(t),e),u=Sa(n.element())/2;fu(n.element(),"left",i-u+"px")},onLeft:Nx,onRight:Px,onUp:zx,onDown:Lx,edgeActions:jx}),Wx=function(t,n){Wr(t,Ly(),{value:n})},Gx=function(t){return{y:nt(t)}},Xx=function(t,n,e){var o={min:Ky(n),max:Zy(n),range:rx(n),value:e,step:ax(n),snap:cx(n),snapStart:sx(n),rounded:fx(n),hasMinEdge:gx(n),hasMaxEdge:px(n),minBound:Ex(t),maxBound:Tx(t),screenRange:Ax(t)};return Xy(o)},Yx=function(u){return function(t,n){return(e=u,o=t,r=n,i=(0<e?Wy:Uy)(hx(r).y(),Ky(r),Zy(r),ax(r)),Wx(o,Gx(i)),et.some(i)).map(function(){return!0});var e,o,r,i}},qx=function(t,n,e,o,r,i){var u,a,c,s,f,l,d,m,g,p=(a=i,c=e,s=o,f=r,l=Ax(u=n),d=s.bind(function(t){return et.some(Mx(t,u))}).getOr(0),m=f.bind(function(t){return et.some(Mx(t,u))}).getOr(l),g={min:Ky(a),max:Zy(a),range:rx(a),value:c,hasMinEdge:gx(a),hasMaxEdge:px(a),minBound:Ex(u),minOffset:0,maxBound:Tx(u),maxOffset:l,centerMinEdge:d,centerMaxEdge:m},Yy(g));return Ex(n)-Ex(t)+p},Kx=et.none,Jx=et.none,$x=Yx(-1),Qx=Yx(1),Zx={"top-left":et.none(),top:et.some(function(t,n){xx(t,bx($y(n)))}),"top-right":et.none(),right:et.none(),"bottom-right":et.none(),bottom:et.some(function(t,n){xx(t,bx(nx(n)))}),"bottom-left":et.none(),left:et.none()},tw=/* */Object.freeze({setValueFrom:function(t,n,e){var o=Xx(t,n,e),r=Gx(o);return Wx(t,r),o},setToMin:function(t,n){var e=Ky(n);Wx(t,Gx(e))},setToMax:function(t,n){var e=Zy(n);Wx(t,Gx(e))},findValueOfOffset:Xx,getValueFromEvent:function(t){return jy(t).map(function(t){return t.top()})},findPositionOfValue:qx,setPositionFromValue:function(t,n,e,o){var r=hx(e),i=qx(t,o.getSpectrum(t),r.y(),o.getTopEdge(t),o.getBottomEdge(t),e),u=Oa(n.element())/2;fu(n.element(),"top",i-u+"px")},onLeft:Kx,onRight:Jx,onUp:$x,onDown:Qx,edgeActions:Zx}),nw=function(t,n){Wr(t,Ly(),{value:n})},ew=function(t,n){return{x:nt(t),y:nt(n)}},ow=function(s,f){return function(t,n){return(e=s,o=f,r=t,i=n,u=0<e?Wy:Uy,a=o?hx(i).x():u(hx(i).x(),qy(i),Qy(i),ax(i)),c=o?u(hx(i).y(),Ky(i),Zy(i),ax(i)):hx(i).y(),nw(r,ew(a,c)),et.some(a)).map(function(){return!0});var e,o,r,i,u,a,c}},rw=ow(-1,!1),iw=ow(1,!1),uw=ow(-1,!0),aw=ow(1,!0),cw={"top-left":et.some(function(t,n){xx(t,yx(Jy(n),$y(n)))}),top:et.some(function(t,n){xx(t,yx(ix(n),$y(n)))}),"top-right":et.some(function(t,n){xx(t,yx(tx(n),$y(n)))}),right:et.some(function(t,n){xx(t,yx(tx(n),ux(n)))}),"bottom-right":et.some(function(t,n){xx(t,yx(tx(n),nx(n)))}),bottom:et.some(function(t,n){xx(t,yx(ix(n),nx(n)))}),"bottom-left":et.some(function(t,n){xx(t,yx(Jy(n),nx(n)))}),left:et.some(function(t,n){xx(t,yx(Jy(n),ux(n)))})},sw=/* */Object.freeze({setValueFrom:function(t,n,e){var o=Vx(t,n,e.left()),r=Xx(t,n,e.top()),i=ew(o,r);return nw(t,i),i},setToMin:function(t,n){var e=qy(n),o=Ky(n);nw(t,ew(e,o))},setToMax:function(t,n){var e=Qy(n),o=Zy(n);nw(t,ew(e,o))},getValueFromEvent:function(t){return jy(t)},setPositionFromValue:function(t,n,e,o){var r=hx(e),i=Hx(t,o.getSpectrum(t),r.x(),o.getLeftEdge(t),o.getRightEdge(t),e),u=qx(t,o.getSpectrum(t),r.y(),o.getTopEdge(t),o.getBottomEdge(t),e),a=Sa(n.element())/2,c=Oa(n.element())/2;fu(n.element(),"left",i-a+"px"),fu(n.element(),"top",u-c+"px")},onLeft:rw,onRight:iw,onUp:uw,onDown:aw,edgeActions:cw}),fw=Tn.detect().deviceType.isTouch(),lw=[_r("stepSize",1),_r("onChange",tt),_r("onChoose",tt),_r("onInit",tt),_r("onDragStart",tt),_r("onDragEnd",tt),_r("snapToGrid",!1),_r("rounded",!0),Or("snapStart"),br("model",sr("mode",{x:[_r("minX",0),_r("maxX",100),Pr("value",function(t){return _t(t.mode.minX)}),vr("getInitialValue"),Ju("manager",Ux)],y:[_r("minY",0),_r("maxY",100),Pr("value",function(t){return _t(t.mode.minY)}),vr("getInitialValue"),Ju("manager",tw)],xy:[_r("minX",0),_r("maxX",100),_r("minY",0),_r("maxY",100),Pr("value",function(t){return _t({x:nt(t.mode.minX),y:nt(t.mode.minY)})}),vr("getInitialValue"),Ju("manager",sw)]})),$s("sliderBehaviours",[vm,Vm])].concat(fw?[]:[Pr("mouseIsDown",function(){return _t(!1)})]),dw=Tn.detect().deviceType.isTouch(),mw=al({name:"Slider",configFields:lw,partFields:Py,factory:function(i,t,n,e){var u=function(t){return Wf(t,i,"thumb")},a=function(t){return Wf(t,i,"spectrum")},o=function(t){return Uf(t,i,"left-edge")},r=function(t){return Uf(t,i,"right-edge")},c=function(t){return Uf(t,i,"top-edge")},s=function(t){return Uf(t,i,"bottom-edge")},f=i.model,l=f.manager,d=function(t,n){l.setPositionFromValue(t,n,i,{getLeftEdge:o,getRightEdge:r,getTopEdge:c,getBottomEdge:s,getSpectrum:a})},m=function(t,n){f.value.set(n);var e=u(t);return d(t,e),i.onChange(t,e,n),et.some(!0)},g=[ci(Ht(),function(t,n){i.onDragStart(t,u(t))}),ci(Pt(),function(t,n){i.onDragEnd(t,u(t))})],p=[ci(zt(),function(t,n){n.stop(),i.onDragStart(t,u(t)),i.mouseIsDown.set(!0)}),ci(Ut(),function(t,n){i.onDragEnd(t,u(t))})],h=dw?g:p;return{uid:i.uid,dom:i.dom,components:t,behaviours:Zs(i.sliderBehaviours,L([dw?[]:[vm.config({mode:"special",focusIn:function(t){return Uf(t,i,"spectrum").map(vm.focusIn).map(nt(!0))}})],[Vm.config({store:{mode:"manual",getValue:function(t){return f.value.get()}}}),da.config({channels:{"mouse.released":{onReceive:function(e,t){var n=i.mouseIsDown.get();i.mouseIsDown.set(!1),n&&Uf(e,i,"thumb").each(function(t){var n=f.value.get();i.onChoose(e,t,n)})}}}})]])),events:ri([ci(Ly(),function(t,n){m(t,n.event().value())}),vi(function(t,n){var e=f.getInitialValue();f.value.set(e);var o=u(t);d(t,o);var r=a(t);i.onInit(t,o,r,f.value.get())})].concat(h)),apis:{resetToMin:function(t){l.setToMin(t,i)},resetToMax:function(t){l.setToMax(t,i)},changeValue:m,refresh:d},domModification:{styles:{position:"relative"}}}},apis:{resetToMin:function(t,n){t.resetToMin(n)},resetToMax:function(t,n){t.resetToMax(n)},refresh:function(t,n){t.refresh(n)}}}),gw=function(t,n){var e=mw.parts().spectrum({dom:{tag:"div",classes:[n("hue-slider-spectrum")],attributes:{role:"presentation"}}}),o=mw.parts().thumb({dom:{tag:"div",classes:[n("hue-slider-thumb")],attributes:{role:"presentation"}}});return mw.sketch({dom:{tag:"div",classes:[n("hue-slider")],attributes:{role:"presentation"}},rounded:!1,model:{mode:"y",getInitialValue:nt({y:nt(0)})},components:[e,o],sliderBehaviours:ra([zm.config({})]),onChange:function(t,n,e){Wr(t,Ty(),{value:e})}})},pw=[$s("formBehaviours",[Vm])],hw=function(t){return"<alloy.field."+t+">"},vw=function(o,t,n){return{uid:o.uid,dom:o.dom,components:t,behaviours:Zs(o.formBehaviours,[Vm.config({store:{mode:"manual",getValue:function(t){var n=Xf(t,o);return it(n,function(t,n){return t().bind(function(t){var n,e=ll.getCurrent(t);return n="missing current",e.fold(function(){return vt.error(n)},vt.value)}).map(Vm.getValue)})},setValue:function(e,t){rt(t,function(n,t){Uf(e,o,t).each(function(t){ll.getCurrent(t).each(function(t){Vm.setValue(t,n)})})})}}})]),apis:{getField:function(t,n){return Uf(t,o,n).bind(ll.getCurrent)}}}},bw={getField:Ni(function(t,n,e){return t.getField(n,e)}),sketch:function(t){var e,n=(e=[],{field:function(t,n){return e.push(t),Nf("form",hw(t),n)},record:function(){return e}}),o=t(n),r=n.record(),i=A(r,function(t){return Af({name:t,pname:hw(t)})});return Zf("form",pw,i,vw,o)}},yw=ro("valid-input"),xw=ro("invalid-input"),ww=ro("validating-input"),Sw="colorcustom.rgb.",kw=function(d,m,g,p){var h=function(t,n,e,o,r){var i,u,a=d(Sw+"range"),c=[db.parts().label({dom:{tag:"label",innerHtml:e,attributes:{"aria-label":o}}}),db.parts().field({data:r,factory:oy,inputAttributes:uo({type:"text"},"hex"===n?{"aria-live":"polite"}:{}),inputClasses:[m("textfield")],inputBehaviours:ra([(i=n,u=t,my.config({invalidClass:m("invalid"),notify:{onValidate:function(t){Wr(t,ww,{type:i})},onValid:function(t){Wr(t,yw,{type:i,value:Vm.getValue(t)})},onInvalid:function(t){Wr(t,xw,{type:i,value:Vm.getValue(t)})}},validator:{validate:function(t){var n=Vm.getValue(t),e=u(n)?vt.value(!0):vt.error(d("aria.input.invalid"));return Cb.pure(e)},validateOnLoad:!1}})),hy.config({})]),onSetValue:function(t){my.isInvalid(t)&&my.run(t).get(tt)}})],s="hex"!==n?[db.parts()["aria-descriptor"]({text:a})]:[];return{dom:{tag:"div",attributes:{role:"presentation"}},components:c.concat(s)}},v=function(t,n){var e=n.red(),o=n.green(),r=n.blue();Vm.setValue(t,{red:e,green:o,blue:r})},b=kg({dom:{tag:"div",classes:[m("rgba-preview")],styles:{"background-color":"white"},attributes:{role:"presentation"}}}),y=function(t,n){b.getOpt(t).each(function(t){fu(t.element(),"background-color","#"+n.value())})};return ul({factory:function(){var e={red:nt(_t(et.some(255))),green:nt(_t(et.some(255))),blue:nt(_t(et.some(255))),hex:nt(_t(et.some("ffffff")))},o=function(t){return e[t]().get()},i=function(t,n){e[t]().set(n)},r=function(t){var n=t.red(),e=t.green(),o=t.blue();i("red",et.some(n)),i("green",et.some(e)),i("blue",et.some(o))},n=function(t,n){var e=n.event();"hex"!==e.type()?i(e.type(),et.none()):p(t)},u=function(r,t,n){var e=parseInt(n,10);i(t,et.some(e)),o("red").bind(function(e){return o("green").bind(function(n){return o("blue").map(function(t){return hh(e,n,t,1)})})}).each(function(t){var n,e,o=(n=r,e=fh(t),bw.getField(n,"hex").each(function(t){zm.isFocused(t)||Vm.setValue(n,{hex:e.value()})}),e);y(r,o)})},a=function(t,n){var e=n.event();"hex"===e.type()?function(t,n){g(t);var e=rh(n);i("hex",et.some(n));var o=yh(e);v(t,o),r(o),Wr(t,Ey(),{hex:e}),y(t,e)}(t,e.value()):u(t,e.type(),e.value())},t=function(t){return{label:d(Sw+t+".label"),description:d(Sw+t+".description")}},c=t("red"),s=t("green"),f=t("blue"),l=t("hex");return wt(bw.sketch(function(t){return{dom:{tag:"form",classes:[m("rgb-form")],attributes:{"aria-label":d("aria.color.picker")}},components:[t.field("red",db.sketch(h(vh,"red",c.label,c.description,255))),t.field("green",db.sketch(h(vh,"green",s.label,s.description,255))),t.field("blue",db.sketch(h(vh,"blue",f.label,f.description,255))),t.field("hex",db.sketch(h(ah,"hex",l.label,l.description,"ffffff"))),b.asSpec()],formBehaviours:ra([my.config({invalidClass:m("form-invalid")}),ig("rgb-form-events",[ci(yw,a),ci(xw,n),ci(ww,n)])])}}),{apis:{updateHex:function(t,n){var e,o;Vm.setValue(t,{hex:n.value()}),e=t,o=yh(n),v(e,o),r(o),y(t,n)}}})},name:"RgbForm",configFields:[],apis:{updateHex:function(t,n,e){t.updateHex(n,e)}},extraApis:{}})},Cw=function(t,o){var r=mw.parts().spectrum({dom:{tag:"canvas",attributes:{role:"presentation"},classes:[o("sv-palette-spectrum")]}}),i=mw.parts().thumb({dom:{tag:"div",attributes:{role:"presentation"},classes:[o("sv-palette-thumb")],innerHtml:"<div class="+o("sv-palette-inner-thumb")+' role="presentation"></div>'}}),u=function(t,n){var e=t.width,o=t.height,r=t.getContext("2d");if(null!==r){r.fillStyle=n,r.fillRect(0,0,e,o);var i=r.createLinearGradient(0,0,e,0);i.addColorStop(0,"rgba(255,255,255,1)"),i.addColorStop(1,"rgba(255,255,255,0)"),r.fillStyle=i,r.fillRect(0,0,e,o);var u=r.createLinearGradient(0,0,0,o);u.addColorStop(0,"rgba(0,0,0,0)"),u.addColorStop(1,"rgba(0,0,0,1)"),r.fillStyle=u,r.fillRect(0,0,e,o)}};return ul({factory:function(t){var n=nt({x:nt(0),y:nt(0)}),e=ra([ll.config({find:et.some}),zm.config({})]);return mw.sketch({dom:{tag:"div",attributes:{role:"presentation"},classes:[o("sv-palette")]},model:{mode:"xy",getInitialValue:n},rounded:!1,components:[r,i],onChange:function(t,n,e){Wr(t,By(),{value:e})},onInit:function(t,n,e,o){u(e.element().dom(),wh(Sh()))},sliderBehaviours:e})},name:"SaturationBrightnessPalette",configFields:[],apis:{setRgba:function(t,n,e){var o,r;o=e,r=n.components()[0].element().dom(),u(r,wh(o))}},extraApis:{}})},Ow=function(c,s){return ul({name:"ColourPicker",configFields:[vr("dom"),_r("onValidHex",tt),_r("onInvalidHex",tt)],factory:function(t){var a,v,e=kw(c,s,t.onValidHex,t.onInvalidHex),o=Cw(c,s),b={paletteRgba:nt(_t(Sh()))},n=kg(o.sketch({})),r=kg(e.sketch({})),i=function(t,e){n.getOpt(t).each(function(t){var n=yh(e);b.paletteRgba().set(n),o.setRgba(t,n)})},u=function(t,n){r.getOpt(t).each(function(t){e.updateHex(t,n)})},y=function(n,e,t){M(t,function(t){t(n,e)})};return{uid:t.uid,dom:t.dom,components:[n.asSpec(),gw(c,s),r.asSpec()],behaviours:ra([ig("colour-picker-events",[ci(By(),(v=[u],function(t,n){var e,o,r,i,u,a,c,s,f,l=n.event().value(),d=b.paletteRgba().get(),m=(i=r=0,u=(e=d).red()/255,a=e.green()/255,c=e.blue()/255,s=Math.min(u,Math.min(a,c)),f=Math.max(u,Math.max(a,c)),s===f?Oy(0,0,100*(i=s)):(r=60*((r=u===s?3:c===s?1:5)-(u===s?a-c:c===s?u-a:c-u)/(f-s)),o=(f-s)/f,i=f,Oy(Math.round(r),Math.round(100*o),Math.round(100*i)))),g=Oy(m.hue(),l.x(),100-l.y()),p=bh(g),h=fh(p);y(t,h,v)})),ci(Ty(),(a=[i,u],function(t,n){var e,o,r,i=n.event().value(),u=(e=i.y(),o=Oy((100-e)/100*360,100,100),r=bh(o),fh(r));y(t,u,a)}))]),ll.config({find:function(t){return r.getOpt(t)}}),vm.config({mode:"acyclic"})])}}})},Ew=function(){return ll.config({find:et.some})},Tw=function(t){return ll.config({find:t.getOpt})},Bw=function(t){return ll.config({find:function(n){return ke(n.element(),t).bind(function(t){return n.getSystem().getByDom(t).toOption()})}})},Aw={"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"},Dw=function(t){return Aw[t]},_w=Wo([_r("preprocess",d),_r("postprocess",d)]),Mw=function(t,n,e){return Vm.config(wt({store:{mode:"manual",getValue:n,setValue:e}},t.map(function(t){return{store:{initialValue:t}}}).getOr({})))},Fw=function(t,n,e){return Mw(t,function(t){return n(t.element())},function(t,n){return e(t.element(),n)})},Iw=function(r,t){var i=ar("RepresentingConfigs.memento processors",_w,t);return Vm.config({store:{mode:"manual",getValue:function(t){var n=r.get(t),e=Vm.getValue(n);return i.postprocess(e)},setValue:function(t,n){var e=i.preprocess(n),o=r.get(t);Vm.setValue(o,e)}}})},Vw=Mw,Rw=function(t){return Fw(t,_e,Me)},Hw=function(t){return Vm.config({store:{mode:"memory",initialValue:t}})},Nw=function(r,n){var e=function(t,n){n.stop()},o=function(t){return function(n,e){M(t,function(t){t(n,e)})}},i=function(t,n){if(!zp.isDisabled(t)){var e=n.event().raw();a(t,e.dataTransfer.files)}},u=function(t,n){var e=n.event().raw().target.files;a(t,e)},a=function(t,n){var e,o;Vm.setValue(t,(e=n,o=new RegExp("("+".jpg,.jpeg,.png,.gif".split(/\s*,\s*/).join("|")+")$","i"),V(Q(e),function(t){return o.test(t.name)}))),Wr(t,nb,{name:r.name})},c=kg({dom:{tag:"input",attributes:{type:"file",accept:"image/*"},styles:{display:"none"}},behaviours:ra([ig("input-file-events",[gi(Rn())])])}),t=r.label.map(function(t){return Jb(t,n)}),s=db.parts().field({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-dropzone-container"]},behaviours:ra([Hw([]),Ew(),zp.config({}),Qm.config({toggleClass:"dragenter",toggleOnExecute:!1}),ig("dropzone-events",[ci("dragenter",o([e,Qm.toggle])),ci("dragleave",o([e,Qm.toggle])),ci("dragover",e),ci("drop",o([e,i])),ci(Jt(),u)])]),components:[{dom:{tag:"div",classes:["tox-dropzone"],styles:{}},components:[{dom:{tag:"p",innerHtml:n.translate("Drop an image here")}},Sg.sketch({dom:{tag:"button",innerHtml:n.translate("Browse for an image"),styles:{position:"relative"},classes:["tox-button","tox-button--secondary"]},components:[c.asSpec()],action:function(t){c.get(t).element().dom().click()},buttonBehaviours:ra([hy.config({})])})]}]}}}});return Xb(t,s,["tox-form__group--stretched"])},Pw=ro("alloy-fake-before-tabstop"),zw=ro("alloy-fake-after-tabstop"),Lw=function(t){return{dom:{tag:"div",styles:{width:"1px",height:"1px",outline:"none"},attributes:{tabindex:"0"},classes:t},behaviours:ra([zm.config({ignore:!0}),hy.config({})])}},jw=function(t,n){Wr(t,Yt(),{raw:{which:9,shiftKey:n}})},Uw=function(t){return Cv(t,["."+Pw,"."+zw].join(","),nt(!1))},Ww=function(t,n){var e=n.element();ru(e,Pw)?jw(t,!0):ru(e,zw)&&jw(t,!1)},Gw=function(t){return{dom:{tag:"div",classes:["tox-navobj"]},components:[Lw([Pw]),t,Lw([zw])],behaviours:ra([Bw(1)])}},Xw=!(Tn.detect().browser.isIE()||Tn.detect().browser.isEdge()),Yw=function(t,n){var o,r,e=Xw&&t.sandboxed,i=uo({},t.label.map(function(t){return{title:t}}).getOr({}),e?{sandbox:"allow-scripts allow-same-origin"}:{}),u=(o=e,r=_t(""),{getValue:function(t){return r.get()},setValue:function(t,n){if(o)ze(t.element(),"src","data:text/html;charset=utf-8,"+encodeURIComponent(n));else{ze(t.element(),"src","javascript:''");var e=t.element().dom().contentWindow.document;e.open(),e.write(n),e.close()}r.set(n)}}),a=t.label.map(function(t){return Jb(t,n)}),c=db.parts().field({factory:{sketch:function(t){return Gw({uid:t.uid,dom:{tag:"iframe",attributes:i},behaviours:ra([hy.config({}),zm.config({}),Vw(et.none(),u.getValue,u.setValue)])})}}});return Xb(a,c,["tox-form__group--stretched"])};function qw(t,n){return $w(x.document.createElement("canvas"),t,n)}function Kw(t){var n=qw(t.width,t.height);return Jw(n).drawImage(t,0,0),n}function Jw(t){return t.getContext("2d")}function $w(t,n,e){return t.width=n,t.height=e,t}var Qw={atob:function(t){return ue.getOrDie("atob")(t)},requestAnimationFrame:function(t){ue.getOrDie("requestAnimationFrame")(t)}};function Zw(t){return t.naturalWidth||t.width}function tS(t){return t.naturalHeight||t.height}var nS=window.Promise?window.Promise:function(){var i=function(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],f(t,o(r,this),o(a,this))},t=i.immediateFn||"function"==typeof window.setImmediate&&window.setImmediate||function(t){x.setTimeout(t,1)};function o(t,n){return function(){return t.apply(n,arguments)}}var e=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function u(o){var r=this;null!==this._state?t(function(){var t=r._state?o.onFulfilled:o.onRejected;if(null!==t){var n;try{n=t(r._value)}catch(e){return void o.reject(e)}o.resolve(n)}else(r._state?o.resolve:o.reject)(r._value)}):this._deferreds.push(o)}function r(t){try{if(t===this)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if("function"==typeof n)return void f(o(n,t),o(r,this),o(a,this))}this._state=!0,this._value=t,c.call(this)}catch(e){a.call(this,e)}}function a(t){this._state=!1,this._value=t,c.call(this)}function c(){for(var t=0,n=this._deferreds;t<n.length;t++){var e=n[t];u.call(this,e)}this._deferreds=[]}function s(t,n,e,o){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof n?n:null,this.resolve=e,this.reject=o}function f(t,n,e){var o=!1;try{t(function(t){o||(o=!0,n(t))},function(t){o||(o=!0,e(t))})}catch(r){if(o)return;o=!0,e(r)}}return i.prototype["catch"]=function(t){return this.then(null,t)},i.prototype.then=function(e,o){var r=this;return new i(function(t,n){u.call(r,new s(e,o,t,n))})},i.all=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var c=Array.prototype.slice.call(1===t.length&&e(t[0])?t[0]:t);return new i(function(r,i){if(0===c.length)return r([]);var u=c.length;function a(n,t){try{if(t&&("object"==typeof t||"function"==typeof t)){var e=t.then;if("function"==typeof e)return void e.call(t,function(t){a(n,t)},i)}c[n]=t,0==--u&&r(c)}catch(o){i(o)}}for(var t=0;t<c.length;t++)a(t,c[t])})},i.resolve=function(n){return n&&"object"==typeof n&&n.constructor===i?n:new i(function(t){t(n)})},i.reject=function(e){return new i(function(t,n){n(e)})},i.race=function(r){return new i(function(t,n){for(var e=0,o=r;e<o.length;e++)o[e].then(t,n)})},i}();function eS(t){var n=t.split(","),e=/data:([^;]+)/.exec(n[0]);if(!e)return et.none();for(var o,r=e[1],i=n[1],u=Qw.atob(i),a=u.length,c=Math.ceil(a/1024),s=new Array(c),f=0;f<c;++f){for(var l=1024*f,d=Math.min(l+1024,a),m=new Array(d-l),g=l,p=0;g<d;++p,++g)m[p]=u[g].charCodeAt(0);s[f]=(o=m,new(ue.getOrDie("Uint8Array"))(o))}return et.some(function h(t,n){return new(ue.getOrDie("Blob"))(t,n)}(s,{type:r}))}function oS(e){return new nS(function(t,n){eS(e).fold(function(){n("uri is not base64: "+e)},t)})}function rS(t,o,r){return o=o||"image/png",x.HTMLCanvasElement.prototype.toBlob?new nS(function(n,e){t.toBlob(function(t){t?n(t):e()},o,r)}):oS(t.toDataURL(o,r))}function iS(t){return function n(a){return new nS(function(t,n){var e=x.URL.createObjectURL(a),o=new x.Image,r=function(){o.removeEventListener("load",i),o.removeEventListener("error",u)};function i(){r(),t(o)}function u(){r(),n("Unable to load data of type "+a.type+": "+e)}o.addEventListener("load",i),o.addEventListener("error",u),o.src=e,o.complete&&i()})}(t).then(function(t){!function e(t){x.URL.revokeObjectURL(t.src)}(t);var n=qw(Zw(t),tS(t));return Jw(n).drawImage(t,0,0),n})}function uS(o){return new nS(function(t){var n=function e(){return new(ue.getOrDie("FileReader"))}();n.onloadend=function(){t(n.result)},n.readAsDataURL(o)})}function aS(t,n,e){var o=n.type;function r(n,e){return t.then(function(t){return function o(t,n,e){return n=n||"image/png",t.toDataURL(n,e)}(t,n,e)})}return{getType:nt(o),toBlob:function i(){return nS.resolve(n)},toDataURL:function u(){return e},toBase64:function a(){return e.split(",")[1]},toAdjustedBlob:function c(n,e){return t.then(function(t){return rS(t,n,e)})},toAdjustedDataURL:r,toAdjustedBase64:function s(t,n){return r(t,n).then(function(t){return t.split(",")[1]})},toCanvas:function f(){return t.then(Kw)}}}function cS(n){return uS(n).then(function(t){return aS(iS(n),n,t)})}function sS(n,t){return rS(n,t).then(function(t){return aS(nS.resolve(n),t,n.toDataURL())})}function fS(t,n,e){var o="string"==typeof t?parseFloat(t):t;return e<o?o=e:o<n&&(o=n),o}(function w_(t){return tH().then(function(t){return cS(t)})});var lS=[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];function dS(t,n){for(var e,o=[],r=new Array(25),i=0;i<5;i++){for(var u=0;u<5;u++)o[u]=n[u+5*i];for(u=0;u<5;u++){for(var a=e=0;a<5;a++)e+=t[u+5*a]*o[a];r[u+5*i]=e}}return r}function mS(n,e){return n.toCanvas().then(function(t){return function i(t,n,e){var o=Jw(t),r=function B(t,n){for(var e,o,r,i,u=t.data,a=n[0],c=n[1],s=n[2],f=n[3],l=n[4],d=n[5],m=n[6],g=n[7],p=n[8],h=n[9],v=n[10],b=n[11],y=n[12],x=n[13],w=n[14],S=n[15],k=n[16],C=n[17],O=n[18],E=n[19],T=0;T<u.length;T+=4)e=u[T],o=u[T+1],r=u[T+2],i=u[T+3],u[T]=e*a+o*c+r*s+i*f+l,u[T+1]=e*d+o*m+r*g+i*p+h,u[T+2]=e*v+o*b+r*y+i*x+w,u[T+3]=e*S+o*k+r*C+i*O+E;return t}(o.getImageData(0,0,t.width,t.height),e);return o.putImageData(r,0,0),sS(t,n)}(t,n.getType(),e)})}function gS(n,e){return n.toCanvas().then(function(t){return function u(t,n,e){var o=Jw(t),r=o.getImageData(0,0,t.width,t.height),i=o.getImageData(0,0,t.width,t.height);return i=function S(t,n,e){function o(t,n,e){return e<t?t=e:t<n&&(t=n),t}for(var r=Math.round(Math.sqrt(e.length)),i=Math.floor(r/2),u=t.data,a=n.data,c=t.width,s=t.height,f=0;f<s;f++)for(var l=0;l<c;l++){for(var d=0,m=0,g=0,p=0;p<r;p++)for(var h=0;h<r;h++){var v=o(l+h-i,0,c-1),b=o(f+p-i,0,s-1),y=4*(b*c+v),x=e[p*r+h];d+=u[y]*x,m+=u[y+1]*x,g+=u[y+2]*x}var w=4*(f*c+l);a[w]=o(d,0,255),a[w+1]=o(m,0,255),a[w+2]=o(g,0,255)}return n}(r,i,e),o.putImageData(i,0,0),sS(t,n)}(t,n.getType(),e)})}function pS(e){return function(t,n){return mS(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))}}var hS=function S_(n){return function(t){return mS(t,n)}}([-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]),vS=pS(function k_(t,n){return dS(t,[1,0,0,0,n=fS(255*n,-255,255),0,1,0,0,n,0,0,1,0,n,0,0,0,1,0,0,0,0,0,1])}),bS=pS(function C_(t,n){var e;return n=fS(n,-1,1),dS(t,[(e=(n*=100)<0?127+n/100*127:127*(e=0==(e=n%1)?lS[n]:lS[Math.floor(n)]*(1-e)+lS[Math.floor(n)+1]*e)+127)/127,0,0,0,.5*(127-e),0,e/127,0,0,.5*(127-e),0,0,e/127,0,.5*(127-e),0,0,0,1,0,0,0,0,0,1])}),yS=function(t,n,e,o){return mS(t,function r(t,n,e,o){return dS(t,[n=fS(n,0,2),0,0,0,0,0,e=fS(e,0,2),0,0,0,0,0,o=fS(o,0,2),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],n,e,o))},xS=function O_(n){return function(t){return gS(t,n)}}([0,-1,0,-1,5,-1,0,-1,0]),wS=function E_(c){return function(n,e){return n.toCanvas().then(function(t){return function(t,n,e){for(var o=Jw(t),r=new Array(256),i=0;i<r.length;i++)r[i]=c(i,e);var u=function a(t,n){for(var e=t.data,o=0;o<e.length;o+=4)e[o]=n[e[o]],e[o+1]=n[e[o+1]],e[o+2]=n[e[o+2]];return t}(o.getImageData(0,0,t.width,t.height),r);return o.putImageData(u,0,0),sS(t,n)}(t,n.getType(),e)})}}(function(t,n){return 255*Math.pow(t/255,1-n)});function SS(t,n,e){var o=Zw(t),r=tS(t),i=n/o,u=e/r,a=!1;(i<.5||2<i)&&(i=i<.5?.5:2,a=!0),(u<.5||2<u)&&(u=u<.5?.5:2,a=!0);var c=function f(a,c,s){return new nS(function(t){var n=Zw(a),e=tS(a),o=Math.floor(n*c),r=Math.floor(e*s),i=qw(o,r),u=Jw(i);u.drawImage(a,0,0,n,e,0,0,o,r),t(i)})}(t,i,u);return a?c.then(function(t){return SS(t,n,e)}):c}function kS(n,e){return n.toCanvas().then(function(t){return function a(t,n,e){var o=qw(t.width,t.height),r=Jw(o),i=0,u=0;return 90!==(e=e<0?360+e:e)&&270!==e||$w(o,o.height,o.width),90!==e&&180!==e||(i=o.width),270!==e&&180!==e||(u=o.height),r.translate(i,u),r.rotate(e*Math.PI/180),r.drawImage(t,0,0),sS(o,n)}(t,n.getType(),e)})}function CS(n,e){return n.toCanvas().then(function(t){return function i(t,n,e){var o=qw(t.width,t.height),r=Jw(o);return"v"===e?(r.scale(1,-1),r.drawImage(t,0,-o.height)):(r.scale(-1,1),r.drawImage(t,-o.width,0)),sS(o,n)}(t,n.getType(),e)})}function OS(n,e,o,r,i){return n.toCanvas().then(function(t){return function a(t,n,e,o,r,i){var u=qw(r,i);return Jw(u).drawImage(t,-e,-o),sS(u,n)}(t,n.getType(),e,o,r,i)})}var ES=function(t){return hS(t)},TS=function(t){return xS(t)},BS=function(t,n){return wS(t,n)},AS=function(t,n){return vS(t,n)},DS=function(t,n){return bS(t,n)},_S=function(t,n){return CS(t,n)},MS=function(t,n,e){return function r(n,e,o){return n.toCanvas().then(function(t){return SS(t,e,o).then(function(t){return sS(t,n.getType())})})}(t,n,e)},FS=function(t,n){return kS(t,n)},IS=function(t,n){return uo({dom:{tag:"span",innerHtml:t,classes:["tox-icon","tox-tbtn__icon-wrap"]}},n)},VS=function(t,n){return IS(Og(t,n),{})},RS=function(t,n){return IS(Og(t,n),{behaviours:ra([Sm.config({})])})},HS=function(t,n,e){return{dom:{tag:"span",innerHtml:e.translate(t),classes:[n+"__select-label"]},behaviours:ra([Sm.config({})])}},NS=function(t,n,e,o,r){void 0===e&&(e=[]);var i=n.fold(function(){return{}},function(t){return{action:t}}),u=uo({buttonBehaviours:ra([jp(t.disabled),hy.config({}),ig("button press",[ai("click"),ai("mousedown")])].concat(e)),eventOrder:{click:["button press","alloy.base.behaviour"],mousedown:["button press","alloy.base.behaviour"]}},i),a=wt(u,{dom:o});return wt(a,{components:r})},PS=function(t,n,e,o){void 0===o&&(o=[]);var r={tag:"button",classes:["tox-tbtn"],attributes:t.tooltip.map(function(t){return{"aria-label":e.translate(t),title:e.translate(t)}}).getOr({})},i=t.icon.map(function(t){return VS(t,e.icons)}),u=$p([i]);return NS(t,n,o,r,u)},zS=function(t,n,e,o){void 0===o&&(o=[]);var r=PS(t,et.some(n),e,o);return Sg.sketch(r)},LS=function(t,n,e,o){void 0===o&&(o=[]);var r=e.translate(t.text),i=t.icon?t.icon.map(function(t){return VS(t,e.icons)}):et.none(),u=i.isSome()?$p([i]):[],a=i.isSome()?{}:{innerHtml:r},c=(t.primary?["tox-button"]:["tox-button","tox-button--secondary"]).concat(i.isSome()?["tox-button--icon"]:[]);return function(t,n,e,o,r){void 0===e&&(e=[]);var i=NS(t,et.some(n),e,o,r);return Sg.sketch(i)}(t,n,o,uo({tag:"button",classes:c},a,{attributes:{title:r}}),u)},jS=function(n,e){return function(t){"custom"===e?Wr(t,rb,{name:n,value:{}}):"submit"===e?Ur(t,ib):"cancel"===e?Ur(t,ob):x.console.error("Unknown button type: ",e)}},US=function(t,n,e){var o=jS(t.name,n);return LS(t,o,e,[])},WS=nt([_r("field1Name","field1"),_r("field2Name","field2"),qu("onLockedChange"),Wu(["lockClass"]),_r("locked",!1),tf.field("coupledFieldBehaviours",[ll,Vm])]),GS=function(t,i){return Af({factory:db,name:t,overrides:function(r){return{fieldBehaviours:ra([ig("coupled-input-behaviour",[ci(Kt(),function(e){var t,n,o;(t=e,n=r,o=i,Uf(t,n,o).bind(ll.getCurrent)).each(function(n){Uf(e,r,"lock").each(function(t){Qm.isOn(t)&&r.onLockedChange(e,n,t)})})})])])}}})},XS=nt([GS("field1","field2"),GS("field2","field1"),Af({factory:Sg,schema:[vr("dom")],name:"lock",overrides:function(t){return{buttonBehaviours:ra([Qm.config({selected:t.locked,toggleClass:t.markers.lockClass,aria:{mode:"pressed"}})])}}})]),YS=al({name:"FormCoupledInputs",configFields:WS(),partFields:XS(),factory:function(o,t,n,e){return{uid:o.uid,dom:o.dom,components:t,behaviours:tf.augment(o.coupledFieldBehaviours,[ll.config({find:et.some}),Vm.config({store:{mode:"manual",getValue:function(t){var n,e=qf(t,o,["field1","field2"]);return(n={})[o.field1Name]=Vm.getValue(e.field1()),n[o.field2Name]=Vm.getValue(e.field2()),n},setValue:function(t,n){var e=qf(t,o,["field1","field2"]);Dt(n,o.field1Name)&&Vm.setValue(e.field1(),n[o.field1Name]),Dt(n,o.field2Name)&&Vm.setValue(e.field2(),n[o.field2Name])}}})]),apis:{getField1:function(t){return Uf(t,o,"field1")},getField2:function(t){return Uf(t,o,"field2")},getLock:function(t){return Uf(t,o,"lock")}}}},apis:{getField1:function(t,n){return t.getField1(n)},getField2:function(t,n){return t.getField2(n)},getLock:function(t,n){return t.getLock(n)}}}),qS=function(t){var n=/^\s*(\d+(?:\.\d+)?)\s*(|cm|mm|in|px|pt|pc|em|ex|ch|rem|vw|vh|vmin|vmax|%)\s*$/.exec(t);if(null===n)return vt.error(t);var e=parseFloat(n[1]),o=n[2];return vt.value({value:e,unit:o})},KS=function(t,n){var e={"":96,px:96,pt:72,cm:2.54,pc:12,mm:25.4,"in":1},o=function(t){return Object.prototype.hasOwnProperty.call(e,t)};return t.unit===n?et.some(t.value):o(t.unit)&&o(n)?e[t.unit]===e[n]?et.some(t.value):et.some(t.value/e[t.unit]*e[n]):et.none()},JS=function(t){return et.none()},$S=function(t,n){var e=qS(t).toOption(),o=qS(n).toOption();return It([e,o],function(t,o){return KS(t,o.unit).map(function(t){return o.value/t}).map(function(t){return n=t,e=o.unit,function(t){return KS(t,e).map(function(t){return{value:t*n,unit:e}})};var n,e}).getOr(JS)}).getOr(JS)},QS=function(o,n){var a=JS,r=ro("ratio-event"),t=YS.parts().lock({dom:{tag:"button",classes:["tox-lock","tox-button","tox-button--naked","tox-button--icon"],attributes:{title:n.translate(o.label.getOr("Constrain proportions"))}},components:[{dom:{tag:"span",classes:["tox-icon","tox-lock-icon__lock"],innerHtml:Og("lock",n.icons)}},{dom:{tag:"span",classes:["tox-icon","tox-lock-icon__unlock"],innerHtml:Og("unlock",n.icons)}}],buttonBehaviours:ra([hy.config({})])}),e=function(t){return{dom:{tag:"div",classes:["tox-form__group"]},components:t}},i=function(e){return db.parts().field({factory:oy,inputClasses:["tox-textfield"],inputBehaviours:ra([hy.config({}),ig("size-input-events",[ci(Gt(),function(t,n){Wr(t,r,{isField1:e})}),ci(Jt(),function(t,n){Wr(t,nb,{name:o.name})})])]),selectOnFocus:!1})},u=function(t){return{dom:{tag:"label",classes:["tox-label"],innerHtml:n.translate(t)}}},c=YS.parts().field1(e([db.parts().label(u("Width")),i(!0)])),s=YS.parts().field2(e([db.parts().label(u("Height")),i(!1)]));return YS.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:[{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:[c,s,e([u("&nbsp;"),t])]}],field1Name:"width",field2Name:"height",locked:!0,markers:{lockClass:"tox-locked"},onLockedChange:function(t,i,n){qS(Vm.getValue(t)).each(function(t){a(t).each(function(t){var n,e,o,r;Vm.setValue(i,(o={"":0,px:0,pt:1,mm:1,pc:2,ex:2,em:2,ch:2,rem:2,cm:3,"in":4,"%":4},-1!==(r=(n=t).value.toFixed((e=n.unit)in o?o[e]:1)).indexOf(".")&&(r=r.replace(/\.?0*$/,"")),r+n.unit))})})},coupledFieldBehaviours:ra([zp.config({}),ig("size-input-events2",[ci(r,function(t,n){var e=n.event().isField1(),o=e?YS.getField1(t):YS.getField2(t),r=e?YS.getField2(t):YS.getField1(t),i=o.map(Vm.getValue).getOr(""),u=r.map(Vm.getValue).getOr("");a=$S(i,u)})])])})},ZS={undo:nt(ro("undo")),redo:nt(ro("redo")),zoom:nt(ro("zoom")),back:nt(ro("back")),apply:nt(ro("apply")),swap:nt(ro("swap")),transform:nt(ro("transform")),tempTransform:nt(ro("temp-transform")),transformApply:nt(ro("transform-apply"))},tk=nt("save-state"),nk=nt("disable"),ek=nt("enable"),ok={formActionEvent:rb,saveState:tk,disable:nk,enable:ek},rk=function(a,c){var t=function(t,n,e,o){return kg(LS({name:t,text:t,disabled:e,primary:o},n,c))},n=function(t,n,e,o){return kg(zS({name:t,icon:et.some(t),tooltip:et.some(n),disabled:o},e,c))},u=function(t,e){t.map(function(t){var n=t.get(e);n.hasConfigured(zp)&&zp.disable(n)})},s=function(t,e){t.map(function(t){var n=t.get(e);n.hasConfigured(zp)&&zp.enable(n)})},f={tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools-edit-panel"]},e=et.none(),o=tt,r=function(t,n,e){Wr(t,n,e)},i=function(t){return Ur(t,ok.disable())},l=function(t){return Ur(t,ok.enable())},d=function(t,n){i(t),r(t,ZS.transform(),{transform:n}),l(t)},m=function(t){return function(){Z.getOpt(t).each(function(t){Sm.set(t,[$])})}},g=function(t,n){i(t),r(t,ZS.transformApply(),{transform:n,swap:m(t)}),l(t)},p=function(){return t("Back",function(t){return r(t,ZS.back(),{swap:m(t)})},!1,!1)},h=function(){return kg({dom:{tag:"div",classes:["tox-spacer"]},behaviours:ra([zp.config({})])})},v=function(){return t("Apply",function(t){return r(t,ZS.apply(),{swap:m(t)})},!0,!0)},b=function(){return function(t){var n,e,o,r,i,u=a.getRect();return n=t,e=u.x,o=u.y,r=u.w,i=u.h,OS(n,e,o,r,i)}},y=[p(),h(),t("Apply",function(t){var n=b();g(t,n),a.hideCrop()},!1,!0)],x=Uv.sketch({dom:f,components:y.map(function(t){return t.asSpec()}),containerBehaviours:ra([ig("image-tools-crop-buttons-events",[ci(ok.disable(),function(t,n){u(y,t)}),ci(ok.enable(),function(t,n){s(y,t)})])])}),w=kg(QS({name:"size",label:e,type:"sizeinput",constrain:!0},c)),S=[p(),h(),w,h(),t("Apply",function(a){w.getOpt(a).each(function(t){var n,e,o=Vm.getValue(t),r=parseInt(o.width,10),i=parseInt(o.height,10),u=(n=r,e=i,function(t){return MS(t,n,e)});g(a,u)})},!1,!0)],k=Uv.sketch({dom:f,components:S.map(function(t){return t.asSpec()}),containerBehaviours:ra([ig("image-tools-resize-buttons-events",[ci(ok.disable(),function(t,n){u(S,t)}),ci(ok.enable(),function(t,n){s(S,t)})])])}),C=function(n,e){return function(t){return n(t,e)}},O=C(_S,"h"),E=C(_S,"v"),T=C(FS,-90),B=C(FS,90),A=function(t,n){var e,o;o=n,i(e=t),r(e,ZS.tempTransform(),{transform:o}),l(e)},D=[p(),h(),n("flip-horizontally","Flip horizontally",function(t){A(t,O)},!1),n("flip-vertically","Flip vertically",function(t){A(t,E)},!1),n("rotate-left","Rotate counterclockwise",function(t){A(t,T)},!1),n("rotate-right","Rotate clockwise",function(t){A(t,B)},!1),h(),v()],_=Uv.sketch({dom:f,components:D.map(function(t){return t.asSpec()}),containerBehaviours:ra([ig("image-tools-fliprotate-buttons-events",[ci(ok.disable(),function(t,n){u(D,t)}),ci(ok.enable(),function(t,n){s(D,t)})])])}),M=function(t,n,e,o,r){var i=mw.parts().label({dom:{tag:"label",classes:["tox-label"],innerHtml:c.translate(t)}}),u=mw.parts().spectrum({dom:{tag:"div",classes:["tox-slider__rail"],attributes:{role:"presentation"}}}),a=mw.parts().thumb({dom:{tag:"div",classes:["tox-slider__handle"],attributes:{role:"presentation"}}});return kg(mw.sketch({dom:{tag:"div",classes:["tox-slider"],attributes:{role:"presentation"}},model:{mode:"x",minX:e,maxX:r,getInitialValue:nt({x:nt(o)})},components:[i,u,a],sliderBehaviours:ra([zm.config({})]),onChoose:n}))},F=function(t,n,e,o,r){return[p(),(i=t,u=n,a=e,c=o,s=r,M(i,function(t,n,e){var o=C(u,e.x()/100);d(t,o)},a,c,s)),v()];var i,u,a,c,s},I=function(t,n,e,o,r){var i=F(t,n,e,o,r);return Uv.sketch({dom:f,components:i.map(function(t){return t.asSpec()}),containerBehaviours:ra([ig("image-tools-filter-panel-buttons-events",[ci(ok.disable(),function(t,n){u(i,t)}),ci(ok.enable(),function(t,n){s(i,t)})])])})},V=[p(),h(),v()],R=Uv.sketch({dom:f,components:V.map(function(t){return t.asSpec()})}),H=I("Brightness",AS,-100,0,100),N=I("Contrast",DS,-100,0,100),P=I("Gamma",BS,-100,0,100),z=function(n,e,o){return function(t){return yS(t,n,e,o)}},L=function(t){return M(t,function(a,t,n){var e=j.getOpt(a),o=W.getOpt(a),r=U.getOpt(a);e.each(function(u){o.each(function(i){r.each(function(t){var n=Vm.getValue(u).x()/100,e=Vm.getValue(t).x()/100,o=Vm.getValue(i).x()/100,r=z(n,e,o);d(a,r)})})})},0,100,200)},j=L("R"),U=L("G"),W=L("B"),G=[p(),j,U,W,v()],X=Uv.sketch({dom:f,components:G.map(function(t){return t.asSpec()})}),Y=function(n,e,o){return function(t){r(t,ZS.swap(),{transform:e,swap:function(){Z.getOpt(t).each(function(t){Sm.set(t,[n]),o(t)})}})}},q=et.some(TS),K=et.some(ES),J=[n("crop","Crop",Y(x,e,function(t){a.showCrop()}),!1),n("resize","Resize",Y(k,e,function(t){w.getOpt(t).each(function(t){var n=a.getMeasurements(),e=n.width,o=n.height;Vm.setValue(t,{width:e,height:o})})}),!1),n("orientation","Orientation",Y(_,e,o),!1),n("brightness","Brightness",Y(H,e,o),!1),n("sharpen","Sharpen",Y(R,q,o),!1),n("contrast","Contrast",Y(N,e,o),!1),n("color-levels","Color levels",Y(X,e,o),!1),n("gamma","Gamma",Y(P,e,o),!1),n("invert","Invert",Y(R,K,o),!1)],$=Uv.sketch({dom:f,components:J.map(function(t){return t.asSpec()})}),Q=Uv.sketch({dom:{tag:"div"},components:[$],containerBehaviours:ra([Sm.config({})])}),Z=kg(Q);return{memContainer:Z,getApplyButton:function(t){return Z.getOpt(t).map(function(t){var n=t.components()[0];return n.components()[n.components().length-1]})}}},ik=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),uk=tinymce.util.Tools.resolve("tinymce.geom.Rect"),ak=tinymce.util.Tools.resolve("tinymce.util.Observable"),ck=tinymce.util.Tools.resolve("tinymce.util.Tools"),sk=tinymce.util.Tools.resolve("tinymce.util.VK");function fk(t){var n,e;if(t.changedTouches)for(n="screenX screenY pageX pageY clientX clientY".split(" "),e=0;e<n.length;e++)t[n[e]]=t.changedTouches[0][n[e]]}function lk(t,r){var i,u,n,a,c,f,l,d=r.document||x.document;r=r||{};var m=d.getElementById(r.handle||t);n=function(t){var n,e,o=function s(t){var n,e,o,r,i,u,a,c=Math.max;return n=t.documentElement,e=t.body,o=c(n.scrollWidth,e.scrollWidth),r=c(n.clientWidth,e.clientWidth),i=c(n.offsetWidth,e.offsetWidth),u=c(n.scrollHeight,e.scrollHeight),a=c(n.clientHeight,e.clientHeight),{width:o<i?r:o,height:u<c(n.offsetHeight,e.offsetHeight)?a:u}}(d);fk(t),t.preventDefault(),u=t.button,n=m,f=t.screenX,l=t.screenY,e=x.window.getComputedStyle?x.window.getComputedStyle(n,null).getPropertyValue("cursor"):n.runtimeStyle.cursor,i=ik("<div></div>").css({position:"absolute",top:0,left:0,width:o.width,height:o.height,zIndex:2147483647,opacity:1e-4,cursor:e}).appendTo(d.body),ik(d).on("mousemove touchmove",c).on("mouseup touchend",a),r.start(t)},c=function(t){if(fk(t),t.button!==u)return a(t);t.deltaX=t.screenX-f,t.deltaY=t.screenY-l,t.preventDefault(),r.drag(t)},a=function(t){fk(t),ik(d).off("mousemove touchmove",c).off("mouseup touchend",a),i.remove(),r.stop&&r.stop(t)},this.destroy=function(){ik(m).off()},ik(m).on("mousedown touchstart",n)}var dk,mk,gk,pk,hk=0,vk=function(n){var f=kg({dom:{tag:"div",classes:["tox-image-tools__image-bg"],attributes:{role:"presentation"}}}),l=_t(1),d=_t(et.none()),m=_t({x:0,y:0,w:1,h:1}),c=_t({x:0,y:0,w:1,h:1}),s=function(t,s){g.getOpt(t).each(function(t){var e=l.get(),o=Sa(t.element()),r=Oa(t.element()),i=s.dom().naturalWidth*e,u=s.dom().naturalHeight*e,a=Math.max(0,o/2-i/2),c=Math.max(0,r/2-u/2),n={left:a.toString()+"px",top:c.toString()+"px",width:i.toString()+"px",height:u.toString()+"px",position:"absolute"};lu(s,n),f.getOpt(t).each(function(t){lu(t.element(),n)}),d.get().each(function(t){var n=m.get();t.setRect({x:n.x*e+a,y:n.y*e+c,w:n.w*e,h:n.h*e}),t.setClampRect({x:a,y:c,w:i,h:u}),t.setViewPortRect({x:0,y:0,w:o,h:r})})})},e=function(t,n){var e,a=Zn.fromTag("img");return ze(a,"src",n),(e=a.dom(),new Rg(function(t){var n=function(){e.removeEventListener("load",n),t(e)};e.complete?t(e):e.addEventListener("load",n)})).then(function(){return g.getOpt(t).map(function(t){var n=Bu({element:a});Sm.replaceAt(t,1,et.some(n));var e=c.get(),o={x:0,y:0,w:a.dom().naturalWidth,h:a.dom().naturalHeight};c.set(o);var r,u,i=uk.inflate(o,-20,-20);return m.set(i),e.w===o.w&&e.h===o.h||(r=t,u=a,g.getOpt(r).each(function(t){var n=Sa(t.element()),e=Oa(t.element()),o=u.dom().naturalWidth,r=u.dom().naturalHeight,i=Math.min(n/o,e/r);1<=i?l.set(1):l.set(i)})),s(t,a),a})})},t=Uv.sketch({dom:{tag:"div",classes:["tox-image-tools__image"]},components:[f.asSpec(),{dom:{tag:"img",attributes:{src:n}}},{dom:{tag:"div"},behaviours:ra([ig("image-panel-crop-events",[vi(function(t){g.getOpt(t).each(function(t){var n=function S(s,e,f,o,r){var l,u,n,i,a="tox-",c="tox-crid-"+hk++;function d(t,n){return{x:n.x-t.x,y:n.y-t.y,w:n.w,h:n.h}}function m(t,n,e,o){var r,i,u,a,c;r=n.x,i=n.y,u=n.w,a=n.h,r+=e*t.deltaX,i+=o*t.deltaY,(u+=e*t.deltaW)<20&&(u=20),(a+=o*t.deltaH)<20&&(a=20),c=s=uk.clamp({x:r,y:i,w:u,h:a},f,"move"===t.name),c=d(f,c),l.fire("updateRect",{rect:c}),h(c)}function g(n){function t(t,n){n.h<0&&(n.h=0),n.w<0&&(n.w=0),ik("#"+c+"-"+t,o).css({left:n.x,top:n.y,width:n.w,height:n.h})}ck.each(u,function(t){ik("#"+c+"-"+t.name,o).css({left:n.w*t.xMul+n.x,top:n.h*t.yMul+n.y})}),t("top",{x:e.x,y:e.y,w:e.w,h:n.y-e.y}),t("right",{x:n.x+n.w,y:n.y,w:e.w-n.x-n.w+e.x,h:n.h}),t("bottom",{x:e.x,y:n.y+n.h,w:e.w,h:e.h-n.y-n.h+e.y}),t("left",{x:e.x,y:n.y,w:n.x-e.x,h:n.h}),t("move",n)}function p(t){g(s=t)}function h(t){p(function e(t,n){return{x:n.x+t.x,y:n.y+t.y,w:n.w,h:n.h}}(f,t))}return 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"}],i=["top","right","bottom","left"],function v(){ik('<div id="'+c+'" class="'+a+'croprect-container" role="grid" aria-dropeffect="execute">').appendTo(o),ck.each(i,function(t){ik("#"+c,o).append('<div id="'+c+"-"+t+'"class="'+a+'croprect-block" style="display: none" data-mce-bogus="all">')}),ck.each(u,function(t){ik("#"+c,o).append('<div id="'+c+"-"+t.name+'" class="'+a+"croprect-handle "+a+"croprect-handle-"+t.name+'"style="display: none" data-mce-bogus="all" role="gridcell" tabindex="-1" aria-label="'+t.label+'" aria-grabbed="false" title="'+t.label+'">')}),n=ck.map(u,function t(n){var e;return new lk(c,{document:o.ownerDocument,handle:c+"-"+n.name,start:function(){e=s},drag:function(t){m(n,e,t.deltaX,t.deltaY)}})}),g(s),ik(o).on("focusin focusout",function(t){ik(t.target).attr("aria-grabbed","focus"===t.type?"true":"false")}),ik(o).on("keydown",function(n){var i;function t(t,n,e,o,r){t.stopPropagation(),t.preventDefault(),m(i,e,o,r)}switch(ck.each(u,function(t){if(n.target.id===c+"-"+t.name)return i=t,!1}),n.keyCode){case sk.LEFT:t(n,0,s,-10,0);break;case sk.RIGHT:t(n,0,s,10,0);break;case sk.UP:t(n,0,s,0,-10);break;case sk.DOWN:t(n,0,s,0,10);break;case sk.ENTER:case sk.SPACEBAR:n.preventDefault(),r()}})}(),l=ck.extend({toggleVisibility:function b(t){var n;n=ck.map(u,function(t){return"#"+c+"-"+t.name}).concat(ck.map(i,function(t){return"#"+c+"-"+t})).join(","),t?ik(n,o).show():ik(n,o).hide()},setClampRect:function y(t){f=t,g(s)},setRect:p,getInnerRect:function t(){return d(f,s)},setInnerRect:h,setViewPortRect:function x(t){e=t,g(s)},destroy:function w(){ck.each(n,function(t){t.destroy()}),n=[]}},ak)}({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.element().dom(),function(){});n.toggleVisibility(!1),n.on("updateRect",function(t){var n=t.rect,e=l.get(),o={x:Math.round(n.x/e),y:Math.round(n.y/e),w:Math.round(n.w/e),h:Math.round(n.h/e)};m.set(o)}),d.set(et.some(n))})})])])}],containerBehaviours:ra([Sm.config({}),ig("image-panel-events",[vi(function(t){e(t,n)})])])}),g=kg(t);return{memContainer:g,updateSrc:e,zoom:function(t,n){var e=l.get(),o=0<n?Math.min(2,e+.1):Math.max(.1,e-.1);l.set(o),g.getOpt(t).each(function(t){var n=t.components()[1].element();s(t,n)})},showCrop:function(){d.get().each(function(t){t.toggleVisibility(!0)})},hideCrop:function(){d.get().each(function(t){t.toggleVisibility(!1)})},getRect:function(){return m.get()},getMeasurements:function(){var t=c.get();return{width:t.w,height:t.h}}}},bk=function(t,n,e,o,r){return zS({name:t,icon:et.some(n),disabled:e,tooltip:et.some(t)},o,r)},yk=function(t,n){n?zp.enable(t):zp.disable(t)},xk=function(t){var o=kg(bk("Undo","undo",!0,function(t){Wr(t,ZS.undo(),{direction:1})},t)),r=kg(bk("Redo","redo",!0,function(t){Wr(t,ZS.redo(),{direction:1})},t));return{container:Uv.sketch({dom:{tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools__sidebar"]},components:[o.asSpec(),r.asSpec(),bk("Zoom in","zoom-in",!1,function(t){Wr(t,ZS.zoom(),{direction:1})},t),bk("Zoom out","zoom-out",!1,function(t){Wr(t,ZS.zoom(),{direction:-1})},t)]}),updateButtonUndoStates:function(t,n,e){o.getOpt(t).each(function(t){yk(t,n)}),r.getOpt(t).each(function(t){yk(t,e)})}}},wk=function(){return ue.getOrDie("URL")},Sk=function(t){return wk().createObjectURL(t)},kk=function(t){wk().revokeObjectURL(t)},Ck=function(t){var n=_t(t),e=_t(et.none()),r=function s(){var e=[],o=-1;function t(){return 0<o}function n(){return-1!==o&&o<e.length-1}return{data:e,add:function r(t){var n;return n=e.splice(++o),e.push(t),{state:t,removed:n}},undo:function i(){if(t())return e[--o]},redo:function u(){if(n())return e[++o]},canUndo:t,canRedo:n}}();r.add(t);var i=function(t){n.set(t)},u=function(t){return{blob:t,url:Sk(t)}},a=function(t){kk(t.url)},o=function(){e.get().each(a),e.set(et.none())},c=function(t){var n=u(t);i(n);var e,o=r.add(n).removed;return e=o,ck.each(e,a),n.url};return{getBlobState:function(){return n.get()},setBlobState:i,addBlobState:c,getTempState:function(){return e.get().fold(function(){return n.get()},function(t){return t})},updateTempState:function(t){var n=u(t);return o(),e.set(et.some(n)),n.url},addTempState:function(t){var n=u(t);return e.set(et.some(n)),n.url},applyTempState:function(n){return e.get().fold(function(){},function(t){c(t.blob),n()})},destroyTempState:o,undo:function(){var t=r.undo();return i(t),t.url},redo:function(){var t=r.redo();return i(t),t.url},getHistoryStates:function(){return{undoEnabled:r.canUndo(),redoEnabled:r.canRedo()}}}},Ok=function(t,n){var u=Ck(t.currentState),a=function(t){var n=u.getHistoryStates();g.updateButtonUndoStates(t,n.undoEnabled,n.redoEnabled),Wr(t,ok.formActionEvent,{name:ok.saveState(),value:n.undoEnabled})},c=function(t){return t.toBlob()},s=function(t){Wr(t,ok.formActionEvent,{name:ok.disable(),value:{}})},f=function(t){e.getApplyButton(t).each(function(t){zp.enable(t)}),Wr(t,ok.formActionEvent,{name:ok.enable(),value:{}})},l=function(t,n){return s(t),r.updateSrc(t,n)},d=function(n,t,e,o,r){return s(n),(i=t,cS(i)).then(e).then(c).then(o).then(function(t){return l(n,t).then(function(t){return a(n),r(),f(n),t})})["catch"](function(t){return x.console.log(t),f(n),t});var i},i=function(t,n,e){var o=u.getBlobState().blob;d(t,o,n,function(t){return u.updateTempState(t)},e)},m=function(t){var n=u.getBlobState().url;return u.destroyTempState(),a(t),n},r=vk(t.currentState.url),g=xk(n),e=rk(r,n);return{dom:{tag:"div",attributes:{role:"presentation"}},components:[e.memContainer.asSpec(),r.memContainer.asSpec(),g.container],behaviours:ra([Vm.config({store:{mode:"manual",getValue:function(){return u.getBlobState()}}}),ig("image-tools-events",[ci(ZS.undo(),function(n,t){var e=u.undo();l(n,e).then(function(t){f(n),a(n)})}),ci(ZS.redo(),function(n,t){var e=u.redo();l(n,e).then(function(t){f(n),a(n)})}),ci(ZS.zoom(),function(t,n){var e=n.event().direction();r.zoom(t,e)}),ci(ZS.back(),function(t,n){var e,o;o=m(e=t),l(e,o).then(function(t){f(e)}),n.event().swap()(),r.hideCrop()}),ci(ZS.apply(),function(t,n){u.applyTempState(function(){m(t),n.event().swap()()})}),ci(ZS.transform(),function(t,n){return i(t,n.event().transform(),tt)}),ci(ZS.tempTransform(),function(t,n){return e=t,o=n.event().transform(),r=u.getTempState().blob,void d(e,r,o,function(t){return u.addTempState(t)},tt);var e,o,r}),ci(ZS.transformApply(),function(t,n){return e=t,o=n.event().transform(),r=n.event().swap(),i=u.getBlobState().blob,void d(e,i,o,function(t){var n=u.addBlobState(t);return m(e),n},r);var e,o,r,i}),ci(ZS.swap(),function(n,t){var e;e=n,g.updateButtonUndoStates(e,!1,!1);var o=t.event().transform(),r=t.event().swap();o.fold(function(){r()},function(t){i(n,t,r)})})]),Ew()])}},Ek=ul({name:"HtmlSelect",configFields:[vr("options"),$s("selectBehaviours",[zm,Vm]),_r("selectClasses",[]),_r("selectAttributes",{}),Or("data")],factory:function(e,t){var n=A(e.options,function(t){return{dom:{tag:"option",value:t.value,innerHtml:t.text}}}),o=e.data.map(function(t){return Tt("initialValue",t)}).getOr({});return{uid:e.uid,dom:{tag:"select",classes:e.selectClasses,attributes:e.selectAttributes},components:n,behaviours:Zs(e.selectBehaviours,[zm.config({}),Vm.config({store:uo({mode:"manual",getValue:function(t){return yu(t.element())},setValue:function(t,n){H(e.options,function(t){return t.value===n}).isSome()&&xu(t.element(),n)}},o)})])}}}),Tk=function(e,n){var t=e.label.map(function(t){return Jb(t,n)}),o=[vm.config({mode:"execution",useEnter:!0!==e.multiline,useControlEnter:!0===e.multiline,execute:function(t){return Ur(t,ib),et.some(!0)}}),ig("textfield-change",[ci(Kt(),function(t,n){Wr(t,nb,{name:e.name})}),ci(_n(),function(t,n){Wr(t,nb,{name:e.name})})]),hy.config({})],r=e.validation.map(function(o){return my.config({getRoot:function(t){return ye(t.element())},invalidClass:"tox-invalid",validator:{validate:function(t){var n=Vm.getValue(t),e=o.validator(n);return Cb.pure(!0===e?vt.value(n):vt.error(e))},validateOnLoad:o.validateOnLoad}})}).toArray(),i=db.parts().field({tag:!0===e.multiline?"textarea":"input",inputAttributes:e.placeholder.fold(function(){},function(t){return{placeholder:n.translate(t)}}),inputClasses:[e.classname],inputBehaviours:ra(L([o,r])),selectOnFocus:!1,factory:oy}),u=e.flex?["tox-form__group--stretched"]:[];return Xb(t,i,u)},Bk=function(i){return uo({},i,{toCached:function(){return Bk(i.toCached())},bindFuture:function(n){return Bk(i.bind(function(t){return t.fold(function(t){return Cb.pure(vt.error(t))},function(t){return n(t)})}))},bindResult:function(n){return Bk(i.map(function(t){return t.bind(n)}))},mapResult:function(n){return Bk(i.map(function(t){return t.map(n)}))},mapError:function(n){return Bk(i.map(function(t){return t.mapError(n)}))},foldResult:function(n,e){return i.map(function(t){return t.fold(n,e)})},withTimeout:function(t,r){return Bk(Cb.nu(function(n){var e=!1,o=x.setTimeout(function(){e=!0,n(vt.error(r()))},t);i.get(function(t){e||(x.clearTimeout(o),n(t))})}))}})},Ak=function(t){return Bk(Cb.nu(t))},Dk=Ak,_k={type:"separator"},Mk=function(t){return{type:"menuitem",value:t.url,text:t.title,meta:{attach:t.attach},onAction:function(){}}},Fk=function(t,n){return{type:"menuitem",value:n,text:t,meta:{attach:undefined},onAction:function(){}}},Ik=function(t,n){return o=t,e=V(n,function(t){return t.type===o}),A(e,Mk);var e,o},Vk=function(t,n){var e=t.toLowerCase();return V(n,function(t){var n=t.meta!==undefined&&t.meta.text!==undefined?t.meta.text:t.text;return xn(n.toLowerCase(),e)||xn(t.value.toLowerCase(),e)})},Rk=function(c,t,s){var n=Vm.getValue(t),f=n.meta.text!==undefined?n.meta.text:n.value;return s.getLinkInformation().fold(function(){return[]},function(t){var n,e,o,r,i,u,a=Vk(f,(n=s.getHistory(c),A(n,function(t){return Fk(t,t)})));return"file"===c?(e=[a,Vk(f,(u=t,Ik("header",u.targets))),Vk(f,L([(i=t,et.from(i.anchorTop).map(function(t){return Fk("<top>",t)}).toArray()),(r=t,Ik("anchor",r.targets)),(o=t,et.from(o.anchorBottom).map(function(t){return Fk("<bottom>",t)}).toArray())]))],U(e,function(t,n){return 0===t.length||0===n.length?t.concat(n):t.concat(_k,n)},[])):a})},Hk=ro("aria-invalid"),Nk=function(i,o,r){var t,n,e,u,a,c=o.shared.providers,s=function(t){var n=Vm.getValue(t);r.addToHistory(n.value,i.filetype)},f=db.parts().field({factory:Gb,dismissOnBlur:!0,inputClasses:["tox-textfield"],sandboxClasses:["tox-dialog__popups"],inputAttributes:{"aria-errormessage":Hk},minChars:0,responseTime:0,fetch:function(t){var n=Rk(i.filetype,t,r),e=ey(n,Kp.BUBBLE_TO_SANDBOX,o);return Cb.pure(e)},getHotspot:function(t){return h.getOpt(t)},onSetValue:function(t,n){t.hasConfigured(my)&&my.run(t).get(tt)},typeaheadBehaviours:ra(L([r.getValidationHandler().map(function(o){return my.config({getRoot:function(t){return ye(t.element())},invalidClass:"tox-control-wrap--status-invalid",notify:{onInvalid:function(t,n){d.getOpt(t).each(function(t){ze(t.element(),"title",c.translate(n))})}},validator:{validate:function(t){var e=Vm.getValue(t);return Dk(function(n){o({type:i.filetype,url:e.value},function(t){n(("invalid"===t.status?vt.error:vt.value)(t.message))})})},validateOnLoad:!1}})}).toArray(),[hy.config({}),ig("urlinput-events",L(["file"===i.filetype?[ci(Kt(),function(t){Wr(t,nb,{name:i.name})})]:[],[ci(Jt(),function(t){Wr(t,nb,{name:i.name}),s(t)}),ci(_n(),function(t){Wr(t,nb,{name:i.name}),s(t)})]]))]])),eventOrder:(t={},t[Kt()]=["streaming","urlinput-events","invalidating"],t),model:{getDisplayText:function(t){return t.value},selectsOver:!1,populateFromBrowse:!1},markers:{openClass:"dog"},lazySink:o.shared.getSink,parts:{menu:$h(0,0,"normal")},onExecute:function(t,n,e){Wr(n,ib,{})},onItemExecute:function(t,n,e,o){s(t),Wr(t,nb,{name:i.name})}}),l=i.label.map(function(t){return Jb(t,c)}),d=kg((n="invalid",e=et.some(Hk),void 0===(u="warning")&&(u=n),void 0===a&&(a=n),{dom:{tag:"div",classes:["tox-icon","tox-control-wrap__status-icon-"+n],innerHtml:Og(u,c.icons),attributes:uo({title:c.translate(a),"aria-live":"polite"},e.fold(function(){return{}},function(t){return{id:t}}))}})),m=kg({dom:{tag:"div",classes:["tox-control-wrap__status-icon-wrap"]},components:[d.asSpec()]}),g=r.getUrlPicker(i.filetype),p=ro("browser.url.event"),h=kg({dom:{tag:"div",classes:["tox-control-wrap"]},components:[f,m.asSpec()]});return db.sketch({dom:Kb([]),components:l.toArray().concat([{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:L([[h.asSpec()],g.map(function(){return t=i.label,n=p,e="tox-browse-url",o="browse",r=c,Sg.sketch({dom:{tag:"button",classes:["tox-tbtn",e],innerHtml:Og(o,r.icons),attributes:{title:r.translate(t.getOr(""))}},buttonBehaviours:ra([hy.config({})]),action:function(t){Ur(t,n)}});var t,n,e,o,r}).toArray()])}]),fieldBehaviours:ra([ig("url-input-events",[ci(p,function(o){ll.getCurrent(o).each(function(n){var e=Vm.getValue(n);g.each(function(t){t(e).get(function(t){Vm.setValue(n,t),Wr(o,nb,{name:i.name})})})})})])])})},Pk=function(u,n){var t,e,o=u.label.map(function(t){return Jb(t,n)}),r=function(e){return function(n,t){Vu(t.event().target(),"[data-collection-item-value]").each(function(t){e(n,t,je(t,"data-collection-item-value"))})}},i=[ci(Wt(),r(function(t,n){Rl(n)})),ci(Rn(),r(function(t,n,e){Wr(t,rb,{name:u.name,value:e})})),ci(Gt(),r(function(t,n,e){Iu(t.element(),"."+pp).each(function(t){ou(t,pp)}),eu(n,pp)})),ci(Xt(),r(function(t,n,e){Iu(t.element(),"."+pp).each(function(t){ou(t,pp)})})),xi(r(function(t,n,e){Wr(t,rb,{name:u.name,value:e})}))],a=db.parts().field({dom:{tag:"div",classes:["tox-collection"].concat(1!==u.columns?["tox-collection--grid"]:["tox-collection--list"])},components:[],factory:{sketch:d},behaviours:ra([Sm.config({}),Vm.config({store:{mode:"memory",initialValue:[]},onSetValue:function(o,t){var n,e,r,i;n=o,e=A(t,function(t){var n,e=1===u.columns?'<div class="tox-collection__item-label">'+t.text+"</div>":"",o='<div class="tox-collection__item-icon">'+t.icon+"</div>",r={_:" "," - ":" ","-":" "},i=t.text.replace(/\_| \- |\-/g,function(t){return r[t]});return'<div class="tox-collection__item" tabindex="-1" data-collection-item-value="'+('"'===(n=t.value)?"&quot;":n)+'" title="'+i+'" aria-label="'+i+'">'+o+e+"</div>"}),r=1<u.columns&&"auto"!==u.columns?B(e,u.columns):[e],i=A(r,function(t){return'<div class="tox-collection__group">'+t.join("")+"</div>"}),Me(n.element(),i.join("")),"auto"===u.columns&&Kg(o,5,"tox-collection__item").each(function(t){var n=t.numRows,e=t.numColumns;vm.setGridSize(o,n,e)}),Ur(o,sb)}}),hy.config({}),vm.config((t=u.columns,e="normal",1===t?{mode:"menu",moveOnTab:!1,selector:".tox-collection__item"}:"auto"===t?{mode:"flatgrid",selector:".tox-collection__item",initSize:{numColumns:1,numRows:1}}:{mode:"matrix",selectors:{row:"color"===e?".tox-swatches__row":".tox-collection__group",cell:"color"===e?"."+fp:"."+sp}})),ig("collection-events",i)])});return Xb(o,a,["tox-form__group--collection"])},zk=function(r){return function(n,e,o){return Et(e,"name").fold(function(){return r(e,o)},function(t){return n.field(t,r(e,o))})}},Lk={bar:zk(function(t,n){return e=t,o=n.shared,{dom:{tag:"div",classes:["tox-bar"]},components:A(e.items,o.interpreter)};var e,o}),collection:zk(function(t,n){return Pk(t,n.shared.providers)}),alloy:zk(d),alertbanner:zk(function(t,n){return e=t,o=n.shared.providers,Uv.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:[Sg.sketch({dom:{tag:"button",classes:["tox-button","tox-button--naked","tox-button--icon"],innerHtml:Og(e.icon,o.icons),attributes:{title:o.translate(e.actionLabel)}},action:function(t){Wr(t,rb,{name:"alert-banner",value:e.url})}})]},{dom:{tag:"div",classes:["tox-notification__body"],innerHtml:o.translate(e.text)}}]});var e,o}),input:zk(function(t,n){return e=t,o=n.shared.providers,Tk({name:e.name,multiline:!1,label:e.label,placeholder:e.placeholder,flex:!1,classname:"tox-textfield",validation:et.none()},o);var e,o}),textarea:zk(function(t,n){return e=t,o=n.shared.providers,Tk({name:e.name,multiline:!0,label:e.label,placeholder:e.placeholder,flex:!0,classname:"tox-textarea",validation:et.none()},o);var e,o}),listbox:zk(function(t,n){return e=t,o=n.shared.providers,r=Jb(e.label,o),i=db.parts().field({factory:Ek,dom:{classes:["mce-select-field"]},selectBehaviours:ra([hy.config({})]),options:e.values,data:e.initialValue.getOr(undefined)}),Yb(et.some(r),i);var e,o,r,i}),label:zk(function(t,n){return e=t,o=n.shared,r={dom:{tag:"label",innerHtml:o.providers.translate(e.label),classes:["tox-label"]}},i=A(e.items,o.interpreter),{dom:{tag:"div",classes:["tox-form__group"]},components:[r].concat(i),behaviours:ra([Ew(),Sm.config({}),Rw(et.none()),vm.config({mode:"acyclic"})])};var e,o,r,i}),iframe:(dk=function(t,n){return Yw(t,n.shared.providers)},function(t,n,e){var o=wt(n,{source:"dynamic"});return zk(dk)(t,o,e)}),autocomplete:zk(function(t,n){return i=n,e=Jb((r=t).label.getOr("?"),i.shared.providers),o=db.parts().field({factory:Gb,dismissOnBlur:!1,inputClasses:["tox-textfield"],minChars:1,fetch:function(t){var n=Vm.getValue(t),e=r.getItems(n),o=ey(e,Kp.BUBBLE_TO_SANDBOX,i);return Cb.pure(o)},markers:{openClass:"dog"},lazySink:i.shared.getSink,parts:{menu:$h(0,0,"normal")}}),Yb(et.some(e),o);var r,i,e,o}),button:zk(function(t,n){return e=t,o=n.shared.providers,r=jS(e.name,"custom"),LS(e,r,o,[Hw(""),Ew()]);var e,o,r}),checkbox:zk(function(t,n){return e=t,o=n.shared.providers,r=Vm.config({store:{mode:"manual",getValue:function(t){return t.element().dom().checked},setValue:function(t,n){t.element().dom().checked=n}}}),i=function(t){return t.element().dom().click(),et.some(!0)},u=db.parts().field({factory:{sketch:d},dom:{tag:"input",classes:["tox-checkbox__input"],attributes:{type:"checkbox"}},behaviours:ra([Ew(),hy.config({}),zm.config({}),r,vm.config({mode:"special",onEnter:i,onSpace:i,stopSpaceKeyup:!0}),ig("checkbox-events",[ci(Jt(),function(t,n){Wr(t,nb,{name:e.name})})])])}),a=db.parts().label({dom:{tag:"span",classes:["tox-checkbox__label"],innerHtml:o.translate(e.label)},behaviours:ra([xy.config({})])}),s=kg({dom:{tag:"div",classes:["tox-checkbox__icons"]},components:[(c=function(t){return{dom:{tag:"span",classes:["tox-icon","tox-checkbox-icon__"+t],innerHtml:Og("checked"===t?"selected":"unselected",o.icons)}}})("checked"),c("unchecked")]}),db.sketch({dom:{tag:"label",classes:["tox-checkbox"]},components:[u,s.asSpec(),a]});var e,o,r,i,u,a,c,s}),colorinput:zk(function(t,n){return Cy(t,n.shared,n.colorinput)}),colorpicker:zk(function(t){var n=function(t){return"tox-"+t},e=Ow(Dw,n),r=kg(e.sketch({dom:{tag:"div",classes:[n("color-picker-container")],attributes:{role:"presentation"}},onValidHex:function(t){Wr(t,rb,{name:"hex-valid",value:!0})},onInvalidHex:function(t){Wr(t,rb,{name:"hex-valid",value:!1})}}));return{dom:{tag:"div"},components:[r.asSpec()],behaviours:ra([Vm.config({store:{mode:"manual",getValue:function(t){var n=r.get(t);return ll.getCurrent(n).bind(function(t){return Vm.getValue(t).hex}).map(function(t){return"#"+t}).getOr("")},setValue:function(t,n){var e=/^#([a-fA-F0-9]{3}(?:[a-fA-F0-9]{3})?)/.exec(n),o=r.get(t);ll.getCurrent(o).fold(function(){x.console.log("Can not find form")},function(t){Vm.setValue(t,{hex:et.from(e[1]).getOr("")}),bw.getField(t,"hex").each(function(t){Ur(t,Kt())})})}}}),Ew()])}}),dropzone:zk(function(t,n){return Nw(t,n.shared.providers)}),grid:zk(function(t,n){return e=t,o=n.shared,{dom:{tag:"div",classes:["tox-form__grid","tox-form__grid--"+e.columns+"col"]},components:A(e.items,o.interpreter)};var e,o}),selectbox:zk(function(t,n){return e=t,o=n.shared.providers,r=A(e.items,function(t){return{text:o.translate(t.text),value:t.value}}),i=e.label.map(function(t){return Jb(t,o)}),u=db.parts().field({dom:{},selectAttributes:{size:e.size},options:r,factory:Ek,selectBehaviours:ra([hy.config({}),ig("selectbox-change",[ci(Jt(),function(t,n){Wr(t,nb,{name:e.name})})])])}),a=1<e.size?et.none():et.some({dom:{tag:"div",classes:["tox-selectfield__icon-js"],innerHtml:Og("chevron-down",o.icons)}}),c={dom:{tag:"div",classes:["tox-selectfield"]},components:L([[u],a.toArray()])},db.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:L([i.toArray(),[c]])});var e,o,r,i,u,a,c}),sizeinput:zk(function(t,n){return QS(t,n.shared.providers)}),urlinput:zk(function(t,n){return Nk(t,n,n.urlinput)}),customeditor:zk(function(n){var e=_t(et.none()),o=kg({dom:{tag:n.tag}}),r=_t(et.none());return{dom:{tag:"div",classes:["tox-custom-editor"]},behaviours:ra([ig("editor-foo-events",[vi(function(t){o.getOpt(t).each(function(t){n.init(t.element().dom()).then(function(n){r.get().each(function(t){n.setValue(t)}),r.set(et.none()),e.set(et.some(n))})})})]),Vm.config({store:{mode:"manual",getValue:function(){return e.get().fold(function(){return r.get().getOr("")},function(t){return t.getValue()})},setValue:function(t,n){e.get().fold(function(){r.set(et.some(n))},function(t){return t.setValue(n)})}}}),Ew()]),components:[o.asSpec()]}}),htmlpanel:zk(function(t){return"presentation"===t.presets?Uv.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:t.html}}):Uv.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:t.html,attributes:{role:"document"}},containerBehaviours:ra([hy.config({}),zm.config({})])})}),imagetools:zk(function(t,n){return Ok(t,n.shared.providers)}),table:zk(function(t,n){return e=t,o=n.shared.providers,u=function(t){return{dom:{tag:"th",innerHtml:o.translate(t)}}},a=function(t){return{dom:{tag:"td",innerHtml:o.translate(t)}}},c=function(t){return{dom:{tag:"tr"},components:A(t,a)}},{dom:{tag:"table",classes:["tox-dialog__table"]},components:[(i=e.header,{dom:{tag:"thead"},components:[{dom:{tag:"tr"},components:A(i,u)}]}),(r=e.cells,{dom:{tag:"tbody"},components:A(r,c)})],behaviours:ra([hy.config({}),zm.config({})])};var e,o,r,i,u,a,c})},jk={field:function(t,n){return n}},Uk=function(n,t,e){var o=wt(e,{shared:{interpreter:function(t){return Wk(n,t,o)}}});return Wk(n,t,o)},Wk=function(n,e,o){return Et(Lk,e.type).fold(function(){return x.console.error('Unknown factory type "'+e.type+'", defaulting to container: ',e),e},function(t){return t(n,e,o)})},Gk=function(t){return t.y()},Xk=function(t,n,e){return lc(t.x(),Gk(t),e.northeast(),Ma(),"layout-ne")},Yk=function(t,n,e){return lc((r=n,(o=t).x()+o.width()-r.width()),Gk(t),e.northwest(),Fa(),"layout-nw");var o,r},qk=function(t,n,e){return lc((r=n,(o=t).x()+o.width()/2-r.width()/2),Gk(t),e.north(),Va(),"layout-n");var o,r},Kk={valignCentre:[],alignCentre:[],alignLeft:[],alignRight:[],right:[],left:[],bottom:[],top:[]},Jk=function(t,n,e){var o,r,i,u,a,c,s,f,l,d,m=tb(t),g=function(){return Zn.fromDom(t.getBody())};return{toolbar:(f=g,l=n,d=m,d?function(){return{anchor:"node",root:f(),node:et.from(f()),bubble:sc(-12,-12,Kk),layouts:{onRtl:function(){return[Xk]},onLtr:function(){return[Yk]}}}}:function(){return{anchor:"hotspot",hotspot:l(),bubble:sc(-12,12,Kk),layouts:{onRtl:function(){return[bc]},onLtr:function(){return[yc]}}}}),toolbarOverflow:(s=e,function(){return{anchor:"hotspot",hotspot:s(),layouts:{onRtl:function(){return[bc]},onLtr:function(){return[yc]}}}}),banner:(u=g,a=n,c=e,c?function(){return{anchor:"node",root:u(),node:et.from(u()),layouts:{onRtl:function(){return[qk]},onLtr:function(){return[qk]}}}}:function(){return{anchor:"hotspot",hotspot:a(),layouts:{onRtl:function(){return[kc]},onLtr:function(){return[kc]}}}}),cursor:(r=t,i=g,function(){return{anchor:"selection",root:i(),getSelection:function(){var t=r.selection.getRng();return et.some(Rc(Zn.fromDom(t.startContainer),t.startOffset,Zn.fromDom(t.endContainer),t.endOffset))}}}),node:(o=g,function(t){return{anchor:"node",root:o(),node:t}})}},$k=function(t){return{colorPicker:(r=t,function(t,n){Gh.colorPickerDialog(r)(t,n)}),hasCustomColors:(o=t,function(){return _h(o)}),getColors:(e=t,function(){return Mh(e)}),getColorCols:(n=t,function(){return Gh.getColorCols(n)})};var n,e,o,r},Qk=[{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:"strike-through",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:"Align",items:[{title:"Left",icon:"align-left",format:"alignleft"},{title:"Center",icon:"align-center",format:"aligncenter"},{title:"Right",icon:"align-right",format:"alignright"},{title:"Justify",icon:"align-justify",format:"alignjustify"}]}],Zk=function(t){return U(t,function(t,n){if(lt(n,"items")){var e=Zk(n.items);return{customFormats:t.customFormats.concat(e.customFormats),formats:t.formats.concat([{title:n.title,items:e.formats}])}}if(lt(n,"inline")||lt(n,"block")||lt(n,"selector")){var o="custom-"+n.title.toLowerCase();return{customFormats:t.customFormats.concat([{name:o,format:n}]),formats:t.formats.concat([{title:n.title,format:o,icon:n.icon}])}}return uo({},t,{formats:t.formats.concat(n)})},{customFormats:[],formats:[]})},tC=function(i){return(t=i,et.from(t.getParam("style_formats")).filter(D)).map(function(t){var n,e,o,r=(n=i,e=Zk(t),o=function(t){M(t,function(t){n.formatter.has(t.name)||n.formatter.register(t.name,t.format)})},n.formatter?o(e.customFormats):n.on("init",function(){o(e.customFormats)}),e.formats);return i.getParam("style_formats_merge",!1,"boolean")?Qk.concat(r):r}).getOr(Qk);var t},nC=function(t,n,e){var o={type:"formatter",isSelected:n(t.format),getStylePreview:e(t.format)};return wt(t,o)},eC=function(s,t,f,l){var d=function(t){return A(t,function(t){var n,e,o,r,i,u,a=Z(t);if(Dt(t,"items")){var c=d(t.items);return wt((i=t,u={type:"submenu",isSelected:nt(!1),getStylePreview:function(){return et.none()}},wt(i,u)),{getStyleItems:function(){return c}})}return Dt(t,"format")?nC(t,f,l):1===a.length&&E(a,"title")?wt(t,{type:"separator"}):(e=ro((n=t).title),o={type:"formatter",format:e,isSelected:f(e),getStylePreview:l(e)},r=wt(n,o),s.formatter.register(e,r),r)})};return d(t)},oC=ck.trim,rC=function(n){return function(t){if(t&&1===t.nodeType){if(t.contentEditable===n)return!0;if(t.getAttribute("data-mce-contenteditable")===n)return!0}return!1}},iC=rC("true"),uC=rC("false"),aC=function(t,n,e,o,r){return{type:t,title:n,url:e,level:o,attach:r}},cC=function(t){return t.innerText||t.textContent},sC=function(t){return(n=t)&&"A"===n.nodeName&&(n.id||n.name)!==undefined&&lC(t);var n},fC=function(t){return t&&/^(H[1-6])$/.test(t.nodeName)},lC=function(t){return function(t){for(;t=t.parentNode;){var n=t.contentEditable;if(n&&"inherit"!==n)return iC(t)}return!1}(t)&&!uC(t)},dC=function(t){return fC(t)&&lC(t)},mC=function(t){var n,e,o=(n=t).id?n.id:ro("h");return aC("header",cC(t),"#"+o,fC(e=t)?parseInt(e.nodeName.substr(1),10):0,function(){t.id=o})},gC=function(t){var n=t.id||t.name,e=cC(t);return aC("anchor",e||"#"+n,"#"+n,0,tt)},pC=function(t){var n,e;return n="h1,h2,h3,h4,h5,h6,a:not([href])",e=t,A(Yc(Zn.fromDom(e),n),function(t){return t.dom()})},hC=function(t){return 0<oC(t.title).length},vC=function(t){var n,e=pC(t);return V((n=e,A(V(n,dC),mC)).concat(A(V(e,sC),gC)),hC)},bC="tinymce-url-history",yC=function(t){return k(t)&&/^https?/.test(t)},xC=function(t){return C(t)&&ct(t,function(t){return!(D(n=t)&&n.length<=5&&W(n,yC));var n}).isNone()},wC=function(){var t,n=x.localStorage.getItem(bC);if(null===n)return{};try{t=JSON.parse(n)}catch(e){if(e instanceof SyntaxError)return x.console.log("Local storage "+bC+" was not valid JSON",e),{};throw e}return xC(t)?t:(x.console.log("Local storage "+bC+" was not valid format",t),{})},SC=function(t){var n=wC();return Object.prototype.hasOwnProperty.call(n,t)?n[t]:[]},kC=function(n,t){if(yC(n)){var e=wC(),o=Object.prototype.hasOwnProperty.call(e,t)?e[t]:[],r=V(o,function(t){return t!==n});e[t]=[n].concat(r).slice(0,5),function(t){if(!xC(t))throw new Error("Bad format for history:\n"+JSON.stringify(t));x.localStorage.setItem(bC,JSON.stringify(t))}(e)}},CC=Object.prototype.hasOwnProperty,OC=function(t){return!!t},EC=function(t){return it(ck.makeMap(t,/[, ]/),OC)},TC=function(t,n,e){var o,r,i=(o=t,r=n,CC.call(o,r)?et.some(o[r]):et.none()).getOr(e);return k(i)?et.some(i):et.none()},BC=function(t){return et.some(t.file_picker_callback).filter(v)},AC=function(t,n){var e,o,r,i,u=(e=t,o=et.some(e.file_picker_types).filter(OC),r=et.some(e.file_browser_callback_types).filter(OC),i=o.or(r).map(EC),BC(e).fold(function(){return!1},function(t){return i.fold(function(){return!0},function(t){return 0<Z(t).length&&t})}));return O(u)?u?BC(t):et.none():u[n]?BC(t):et.none()},DC=function(n){return{getHistory:SC,addToHistory:kC,getLinkInformation:function(){return!1===(t=n).settings.typeahead_urls?et.none():et.some({targets:vC(t.getBody()),anchorTop:TC(t.settings,"anchor_top","#top").getOrUndefined(),anchorBottom:TC(t.settings,"anchor_bottom","#bottom").getOrUndefined()});var t},getValidationHandler:function(){return t=n.settings.filepicker_validator_handler,v(t)?et.some(t):et.none();var t},getUrlPicker:function(t){return i=t,AC((r=n).settings,i).map(function(o){return function(n){return Cb.nu(function(e){var t=ck.extend({filetype:i},et.from(n.meta).getOr({}));o.call(r,function(t,n){if(!k(t))throw new Error("Expected value to be string");if(n!==undefined&&!C(n))throw new Error("Expected meta to be a object");e({value:t,meta:n})},n.value,t)})}});var r,i}}},_C=function(t,n,e,o){var r,i,u,a,c,s,f,l,d,m={shared:{providers:{icons:function(){return n.ui.registry.getAll().icons},menuItems:function(){return n.ui.registry.getAll().menuItems},translate:ap.translate},interpreter:function(t){return Wk(jk,t,m)},anchors:Jk(n,e,o),getSink:function(){return vt.value(t)}},urlinput:DC(n),styleselect:(r=n,i=function(t){return function(){return r.formatter.match(t)}},u=function(n){return function(){var t=r.formatter.get(n);return t!==undefined?et.some({tag:0<t.length&&(t[0].inline||t[0].block)||"div",styleAttr:r.formatter.getCssText(n)}):et.none()}},a=function(t){var n=t.items;return n!==undefined&&0<n.length?j(n,a):[t.format]},c=_t([]),s=_t([]),f=_t([]),l=_t([]),d=_t(!1),r.on("init",function(){var t=tC(r),n=eC(r,t,i,u);c.set(n),s.set(j(n,a))}),r.on("addStyleModifications",function(t){var n=eC(r,t.items,i,u);f.set(n),d.set(t.replace),l.set(j(n,a))}),{getData:function(){var t=d.get()?[]:c.get(),n=f.get();return t.concat(n)},getFlattenedKeys:function(){var t=d.get()?[]:s.get(),n=l.get();return t.concat(n)}}),colorinput:$k(n)};return m},MC=nt([vr("dom"),_r("shell",!0),$s("toolbarBehaviours",[Sm])]),FC=nt([_f({name:"groups",overrides:function(t){return{behaviours:ra([Sm.config({})])}}})]),IC=al({name:"Toolbar",configFields:MC(),partFields:FC(),factory:function(n,t,e,o){var r=function(t){return n.shell?et.some(t):Uf(t,n,"groups")},i=n.shell?{behaviours:[Sm.config({})],components:[]}:{behaviours:[],components:t};return{uid:n.uid,dom:n.dom,components:i.components,behaviours:Zs(n.toolbarBehaviours,i.behaviours),apis:{setGroups:function(t,n){r(t).fold(function(){throw x.console.error("Toolbar was defined to not be a shell, but no groups container was specified in components"),new Error("Toolbar was defined to not be a shell, but no groups container was specified in components")},function(t){Sm.set(t,n)})}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,n,e){t.setGroups(n,e)}}}),VC=te("within","extra","withinWidth"),RC=function(t,n,o){var e,r=(e=function(t,n){var e=o(t);return et.some({element:nt(t),start:nt(n),finish:nt(n+e),width:nt(e)})},U(t,function(n,t){return e(t,n.len).fold(nt(n),function(t){return{len:t.finish(),list:n.list.concat([t])}})},{len:0,list:[]}).list),i=V(r,function(t){return t.finish()<=n}),u=R(i,function(t,n){return t+n.width()},0),a=r.slice(i.length);return{within:nt(i),extra:nt(a),withinWidth:nt(u)}},HC=function(t){return A(t,function(t){return t.element()})},NC=function(t,n,e,o){var r,i,u,a,c,s,f,l,d,m,g,p,h=(r=t,i=n,u=e,a=RC(i,r,u),0===a.extra().length?et.some(a):et.none()).getOrThunk(function(){return RC(n,t-e(o),e)}),v=h.within(),b=h.extra(),y=h.withinWidth();return 1===b.length&&b[0].width()<=e(o)?(m=b,g=y,p=HC(v.concat(m)),VC(p,[],g)):1<=b.length?(s=b,f=o,l=y,d=HC(v).concat([f]),VC(d,HC(s),l)):(c=y,VC(HC(v),[],c))},PC=function(t,n){var e=A(n,function(t){return _u(t)});IC.setGroups(t,e)},zC=function(t,n,e,o){var r=Wf(t,n,"primary"),i=Uf(t,n,"overflow-button"),u=pb.getCoupled(t,"overflowGroup");fu(r.element(),"visibility","hidden");var a,c=(a=i,e.bind(function(n){return Nl(n.element()).bind(function(t){return n.getSystem().getByDom(t).toOption()})}).orThunk(function(){return a.filter(zm.isFocused)}));e.each(function(t){IC.setGroups(t,[])});var s=n.builtGroups.get();PC(r,s.concat([u]));var f=Sa(r.element()),l=NC(f,s,function(t){return Sa(t.element())},u);0===l.extra().length?(Sm.remove(r,u),e.each(function(t){IC.setGroups(t,[])})):(PC(r,l.within()),e.each(function(t){PC(t,l.extra())})),vu(r.element(),"visibility"),bu(r.element()),e.each(function(n){i.each(function(t){return Qm.set(t,o(n))}),c.each(zm.focus)})},LC=nt([vr("items"),Wu(["itemSelector"]),$s("tgroupBehaviours",[vm])]),jC=nt([Mf({name:"items",unit:"item"})]),UC=al({name:"ToolbarGroup",configFields:LC(),partFields:jC(),factory:function(t,n,e,o){return{uid:t.uid,dom:t.dom,components:n,behaviours:Zs(t.tgroupBehaviours,[vm.config({mode:"flow",selector:t.markers.itemSelector})]),domModification:{attributes:{role:"toolbar"}}}}}),WC=nt([$s("splitToolbarBehaviours",[]),Pr("builtGroups",function(){return _t([])})]),GC=function(o,t,n,e,r){var i="alloy.toolbar.toggle";return{uid:o.uid,dom:o.dom,components:t,behaviours:Zs(o.splitToolbarBehaviours,[pb.config({others:uo({},r.coupling,{overflowGroup:function(n){return UC.sketch(uo({},e["overflow-group"](),{items:[Sg.sketch(uo({},e["overflow-button"](),{action:function(t){Ur(n,i)}}))]}))}})}),ig("toolbar-toggle-events",[ci(i,function(t){r.toggleToolbar(t,o,e)})])]),apis:{setGroups:function(t,n){var e;e=A(n,t.getSystem().build),o.builtGroups.set(e),r.refresh(t,o)},refresh:function(t){r.refresh(t,o)},getMoreButton:function(t){return Uf(t,o,"overflow-button")},getOverflow:function(t){return n=t,r.getOverflow(n);var n},toggle:function(t){r.toggleToolbar(t,o,e)}},domModification:{attributes:{role:"group"}}}},XC=nt([Wu(["overflowToggledClass"]),vr("getAnchor"),vr("lazySink")].concat(WC())),YC=nt([Af({factory:IC,schema:MC(),name:"primary"}),Df({factory:IC,schema:MC(),name:"overflow",overrides:function(n){return{toolbarBehaviours:ra([vm.config({mode:"cyclic",onEscape:function(t){return Uf(t,n,"overflow-button").each(zm.focus),et.none()}})])}}}),Df({name:"overflow-button",overrides:function(t){return{dom:{attributes:{"aria-haspopup":"true"}},buttonBehaviours:ra([Qm.config({toggleClass:t.markers.overflowToggledClass,aria:{mode:"expanded"},toggleOnExecute:!1})])}}}),Df({name:"overflow-group"})]),qC=function(t,n,e){var o=pb.getCoupled(t,"sandbox");Gs.isOpen(o)?Gs.close(o):Gs.open(o,e.overflow())},KC=function(t){return t.getSystem().isConnected()},JC=function(o,r){var t=Gs.getState(pb.getCoupled(o,"sandbox"));zC(o,r,t,KC),t.each(function(t){var n=r.lazySink(o).getOrDie(),e=r.getAnchor(o);Es.position(n,e,t)})},$C=al({name:"SplitFloatingToolbar",configFields:XC(),partFields:YC(),factory:function(n,t,e,o){return GC(n,t,0,o,{refresh:JC,toggleToolbar:qC,getOverflow:function(t){return Gs.getState(pb.getCoupled(t,"sandbox"))},coupling:{sandbox:function(t){return o=t,e=n,{dom:{tag:"div",attributes:{id:(r=Ru()).id()}},behaviours:ra([vm.config({mode:"special",onEscape:function(t){return Gs.close(t),et.some(!0)}}),Gs.config({onOpen:function(t,n){JC(o,e),Uf(o,e,"overflow-button").each(function(t){Qm.on(t),r.link(t.element())}),vm.focusIn(n)},onClose:function(){Uf(o,e,"overflow-button").each(function(t){Qm.off(t),zm.focus(t),r.unlink(t.element())})},isPartOf:function(t,n,e){return Nu(n,e)||Nu(o,e)},getAttachPoint:function(){return e.lazySink(o).getOrDie()}})])};var o,e,r}}})},apis:{setGroups:function(t,n,e){t.setGroups(n,e)},refresh:function(t,n){t.refresh(n)},getMoreButton:function(t,n){return t.getMoreButton(n)},getOverflow:function(t,n){return t.getOverflow(n)},toggle:function(t,n){t.toggle(n)}}}),QC=function(n,t){return t.getAnimationRoot.fold(function(){return n.element()},function(t){return t(n)})},ZC=function(t){return t.dimension.property},tO=function(t,n){return t.dimension.getDimension(n)},nO=function(t,n){var e=QC(t,n);uu(e,[n.shrinkingClass,n.growingClass])},eO=function(t,n){ou(t.element(),n.openClass),eu(t.element(),n.closedClass),fu(t.element(),ZC(n),"0px"),bu(t.element())},oO=function(t,n){ou(t.element(),n.closedClass),eu(t.element(),n.openClass),vu(t.element(),ZC(n))},rO=function(t,n,e,o){e.setCollapsed(),fu(t.element(),ZC(n),tO(n,t.element())),bu(t.element()),nO(t,n),eO(t,n),n.onStartShrink(t),n.onShrunk(t)},iO=function(t,n,e,o){var r=o.getOrThunk(function(){return tO(n,t.element())});e.setCollapsed(),fu(t.element(),ZC(n),r),bu(t.element());var i=QC(t,n);ou(i,n.growingClass),eu(i,n.shrinkingClass),eO(t,n),n.onStartShrink(t)},uO=function(t,n,e){var o=tO(n,t.element());("0px"===o?rO:iO)(t,n,e,et.some(o))},aO=function(t,n,e){var o=QC(t,n),r=ru(o,n.shrinkingClass),i=tO(n,t.element());oO(t,n);var u=tO(n,t.element());(r?function(){fu(t.element(),ZC(n),i),bu(t.element())}:function(){eO(t,n)})(),ou(o,n.shrinkingClass),eu(o,n.growingClass),oO(t,n),fu(t.element(),ZC(n),u),e.setExpanded(),n.onStartGrow(t)},cO=function(t,n,e){var o=QC(t,n);return!0===ru(o,n.growingClass)},sO=function(t,n,e){var o=QC(t,n);return!0===ru(o,n.shrinkingClass)},fO=/* */Object.freeze({refresh:function(t,n,e){if(e.isExpanded()){vu(t.element(),ZC(n));var o=tO(n,t.element());fu(t.element(),ZC(n),o)}},grow:function(t,n,e){e.isExpanded()||aO(t,n,e)},shrink:function(t,n,e){e.isExpanded()&&uO(t,n,e)},immediateShrink:function(t,n,e){e.isExpanded()&&rO(t,n,e,et.none())},hasGrown:function(t,n,e){return e.isExpanded()},hasShrunk:function(t,n,e){return e.isCollapsed()},isGrowing:cO,isShrinking:sO,isTransitioning:function(t,n,e){return!0===cO(t,n)||!0===sO(t,n)},toggleGrow:function(t,n,e){(e.isExpanded()?uO:aO)(t,n,e)},disableTransitions:nO}),lO=/* */Object.freeze({exhibit:function(t,n){var e=n.expanded;return ji(e?{classes:[n.openClass],styles:{}}:{classes:[n.closedClass],styles:Tt(n.dimension.property,"0px")})},events:function(e,o){return ri([hi(Qt(),function(t,n){n.event().raw().propertyName===e.dimension.property&&(nO(t,e),o.isExpanded()&&vu(t.element(),e.dimension.property),(o.isExpanded()?e.onGrown:e.onShrunk)(t))})])}}),dO=[vr("closedClass"),vr("openClass"),vr("shrinkingClass"),vr("growingClass"),Or("getAnimationRoot"),Xu("onShrunk"),Xu("onStartShrink"),Xu("onGrown"),Xu("onStartGrow"),_r("expanded",!1),br("dimension",sr("property",{width:[Ju("property","width"),Ju("getDimension",function(t){return Sa(t)+"px"})],height:[Ju("property","height"),Ju("getDimension",function(t){return Oa(t)+"px"})]}))],mO=ua({fields:dO,name:"sliding",active:lO,apis:fO,state:/* */Object.freeze({init:function(t){var n=_t(t.expanded);return zi({isExpanded:function(){return!0===n.get()},isCollapsed:function(){return!1===n.get()},setCollapsed:w(n.set,!1),setExpanded:w(n.set,!0),readState:function(){return"expanded: "+n.get()}})}})}),gO=nt([Wu(["closedClass","openClass","shrinkingClass","growingClass","overflowToggledClass"])].concat(WC())),pO=nt([Af({factory:IC,schema:MC(),name:"primary"}),Af({factory:IC,schema:MC(),name:"overflow",overrides:function(n){return{toolbarBehaviours:ra([mO.config({dimension:{property:"height"},closedClass:n.markers.closedClass,openClass:n.markers.openClass,shrinkingClass:n.markers.shrinkingClass,growingClass:n.markers.growingClass,onShrunk:function(t){Uf(t,n,"overflow-button").each(function(t){Qm.off(t),zm.focus(t)})},onGrown:function(t){vm.focusIn(t)},onStartGrow:function(t){Uf(t,n,"overflow-button").each(Qm.on)}}),vm.config({mode:"acyclic",onEscape:function(t){return Uf(t,n,"overflow-button").each(zm.focus),et.some(!0)}})])}}}),Df({name:"overflow-button",overrides:function(t){return{buttonBehaviours:ra([Qm.config({toggleClass:t.markers.overflowToggledClass,aria:{mode:"pressed"},toggleOnExecute:!1})])}}}),Df({name:"overflow-group"})]),hO=function(n,e){Uf(n,e,"overflow").each(function(t){bO(n,e),mO.toggleGrow(t)})},vO=function(t){return mO.hasGrown(t)},bO=function(t,n){var e=Uf(t,n,"overflow");zC(t,n,e,vO),e.each(mO.refresh)},yO=al({name:"SplitSlidingToolbar",configFields:gO(),partFields:pO(),factory:function(n,t,e,o){return GC(n,t,0,o,{refresh:bO,toggleToolbar:hO,getOverflow:function(t){return Uf(t,n,"overflow")},coupling:{}})},apis:{setGroups:function(t,n,e){t.setGroups(n,e)},refresh:function(t,n){t.refresh(n)},getMoreButton:function(t,n){return t.getMoreButton(n)},getOverflow:function(t,n){return t.getOverflow(n)},toggle:function(t,n){t.toggle(n)}}}),xO="silver.readonly",wO=Wo([(mk="readonly",br(mk,gr))]),SO=function(t,n){var e,o,r,i=t.outerContainer;o=n,r=(e=t).outerContainer.element(),o&&(e.mothership.broadcastOn([Xs()],{target:r}),e.uiMothership.broadcastOn([Xs()],{target:r})),e.mothership.broadcastOn([xO],{readonly:o}),e.uiMothership.broadcastOn([xO],{readonly:o}),ge("*",i.element()).forEach(function(t){i.getSystem().getByDom(t).each(function(t){t.hasConfigured(zp)&&zp.set(t,n)})})},kO=function(t,n){t.on("init",function(){t.readonly&&SO(n,!0)}),t.on("SwitchMode",function(){return SO(n,t.readonly)}),t.getParam("readonly",!1,"boolean")&&t.setMode("readonly")},CO=function(n){var t;return da.config({channels:(t={},t[xO]={schema:wO,onReceive:function(t,o){n(t).each(function(t){var n,e;n=t,e=o.readonly,ge("*",n.element()).forEach(function(t){n.getSystem().getByDom(t).each(function(t){t.hasConfigured(zp)&&zp.set(t,e)})})})}},t)})},OO=function(t){var n=t.title.fold(function(){return{}},function(t){return{attributes:{title:t}}});return{dom:uo({tag:"div",classes:["tox-toolbar__group"]},n),components:[UC.parts().items({})],items:t.items,markers:{itemSelector:"*:not(.tox-split-button) > .tox-tbtn:not([disabled]), .tox-split-button:not([disabled]), .tox-toolbar-nav-js:not([disabled])"},tgroupBehaviours:ra([hy.config({}),zm.config({})])}},EO=function(t){return UC.sketch(OO(t))},TO=function(e,t,n){var o=vi(function(t){var n=A(e.initGroups,EO);IC.setGroups(t,n)});return ra([vm.config({mode:t,onEscape:e.onEscape,selector:".tox-toolbar__group"}),ig("toolbar-events",[o]),CO(n)])},BO=function(t,n){var e=t.cyclicKeying?"cyclic":"acyclic";return{uid:t.uid,dom:{tag:"div",classes:["tox-toolbar-overlord"]},parts:{"overflow-group":OO({title:et.none(),items:[]}),"overflow-button":PS({name:"more",icon:et.some("more-drawer"),disabled:!1,tooltip:et.some("More...")},et.none(),t.backstage.shared.providers)},splitToolbarBehaviours:TO(t,e,n)}},AO=function(t){var n=BO(t,$C.getOverflow),e=$C.parts().primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}});return $C.sketch(uo({},n,{lazySink:t.getSink,getAnchor:function(){return t.backstage.shared.anchors.toolbarOverflow()},parts:uo({},n.parts,{overflow:{dom:{tag:"div",classes:["tox-toolbar__overflow"]}}}),components:[e],markers:{overflowToggledClass:"tox-tbtn--enabled"}}))},DO=function(t){var n=yO.parts().primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}}),e=yO.parts().overflow({dom:{tag:"div",classes:["tox-toolbar__overflow"]}}),o=BO(t,yO.getOverflow);return yO.sketch(uo({},o,{components:[n,e],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"}}))},_O=function(t){var n=t.cyclicKeying?"cyclic":"acyclic";return IC.sketch({uid:t.uid,dom:{tag:"div",classes:["tox-toolbar"]},components:[IC.parts().groups({})],toolbarBehaviours:TO(t,n,nt(et.none()))})},MO=[Rr("disabled",!1),Br("tooltip"),Br("icon"),Br("text"),Hr("onSetup",function(){return tt})],FO=Wo([yr("type"),wr("onAction")].concat(MO)),IO=function(t){return ir("toolbarbutton",FO,t)},VO=Wo([yr("type"),Br("tooltip"),Br("icon"),Br("text"),wr("fetch"),Hr("onSetup",function(){return tt})]),RO=function(t){return ir("menubutton",VO,t)},HO=Wo([yr("type"),Br("tooltip"),Br("icon"),Br("text"),Ar("select"),wr("fetch"),Hr("onSetup",function(){return tt}),Vr("presets","normal",["normal","color","listpreview"]),_r("columns",1),wr("onAction"),wr("onItemAction")]),NO=[Rr("active",!1)].concat(MO),PO=Wo(NO.concat([yr("type"),wr("onAction")])),zO=function(t){return ir("ToggleButton",PO,t)},LO=[Hr("predicate",function(){return!1}),Vr("scope","node",["node","editor"]),Vr("position","selection",["node","selection","line"])],jO=MO.concat([_r("type","contextformbutton"),_r("primary",!1),wr("onAction"),Pr("original",d)]),UO=NO.concat([_r("type","contextformbutton"),_r("primary",!1),wr("onAction"),Pr("original",d)]),WO=MO.concat([_r("type","contextformbutton")]),GO=NO.concat([_r("type","contextformtogglebutton")]),XO=sr("type",{contextformbutton:jO,contextformtogglebutton:UO}),YO=Wo([_r("type","contextform"),Hr("initValue",function(){return""}),Br("label"),Cr("commands",XO),Er("launch",sr("type",{contextformbutton:WO,contextformtogglebutton:GO}))].concat(LO)),qO=Wo([_r("type","contexttoolbar"),yr("items")].concat(LO)),KO=ro("toolbar.button.execute"),JO={"alloy.execute":["disabling","alloy.base.behaviour","toggling","toolbar-button-events"]},$O=/* */Object.freeze({getState:function(t,n,e){return e}}),QO=/* */Object.freeze({events:function(r,i){var o=function(e,o){r.updateState.each(function(t){var n=t(e,o);i.set(n)}),r.renderComponents.each(function(t){var n=t(o,i.get());Fs(e),M(n,function(t){As(e,e.getSystem().build(t))})})};return ri([ci(Mn(),function(t,n){var e=r.channel;E(n.channels(),e)&&o(t,n.data())}),vi(function(n,t){r.initialData.each(function(t){o(n,t)})})])}}),ZO=/* */Object.freeze({init:function(t){var n=_t(et.none());return{readState:function(){return n.get().getOr("none")},get:function(){return n.get()},set:function(t){return n.set(t)},clear:function(){return n.set(et.none())}}}}),tE=[vr("channel"),Or("renderComponents"),Or("updateState"),Or("initialData")],nE=ua({fields:tE,name:"reflecting",active:QO,apis:$O,state:ZO}),eE=nt([vr("toggleClass"),vr("fetch"),qu("onExecute"),_r("getHotspot",et.some),_r("getAnchorOverrides",nt({})),_r("layouts",et.none()),qu("onItemExecute"),Or("lazySink"),vr("dom"),Xu("onOpen"),$s("splitDropdownBehaviours",[pb,vm,zm]),_r("matchWidth",!1),_r("useMinWidth",!1),_r("eventOrder",{}),Or("role")].concat(jb())),oE=Af({factory:Sg,schema:[vr("dom")],name:"arrow",defaults:function(t){return{buttonBehaviours:ra([zm.revoke()])}},overrides:function(n){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(t){t.getSystem().getByUid(n.uid).each(Gr)},buttonBehaviours:ra([Qm.config({toggleOnExecute:!1,toggleClass:n.toggleClass})])}}}),rE=Af({factory:Sg,schema:[vr("dom")],name:"button",defaults:function(t){return{buttonBehaviours:ra([zm.revoke()])}},overrides:function(e){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(n){n.getSystem().getByUid(e.uid).each(function(t){e.onExecute(t,n)})}}}}),iE=nt([oE,rE,_f({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:t.text}}}},schema:[vr("text")],name:"aria-descriptor"}),Df({schema:[Uu()],name:"menu",defaults:function(o){return{onExecute:function(n,e){n.getSystem().getByUid(o.uid).each(function(t){o.onItemExecute(t,n,e)})}}}}),Eb()]),uE=al({name:"SplitDropdown",configFields:eE(),partFields:iE(),factory:function(o,t,n,e){var r=function(t){ll.getCurrent(t).each(function(t){Cl.highlightFirst(t),vm.focusIn(t)})},i=function(t){Db(o,function(t){return t},t,e,r,Jv.HighlightFirst).get(tt)},u=function(t){var n=Wf(t,o,"button");return Gr(n),et.some(!0)},a=St(ri([vi(function(e,t){Uf(e,o,"aria-descriptor").each(function(t){var n=ro("aria");ze(t.element(),"id",n),ze(e.element(),"aria-describedby",n)})})]),wg(et.some(i)));return{uid:o.uid,dom:o.dom,components:t,eventOrder:uo({},o.eventOrder,{"alloy.execute":["disabling","toggling","alloy.base.behaviour"]}),events:a,behaviours:Zs(o.splitDropdownBehaviours,[pb.config({others:{sandbox:function(t){var n=Wf(t,o,"arrow");return Fb(o,t,{onOpen:function(){Qm.on(n),Qm.on(t)},onClose:function(){Qm.off(n),Qm.off(t)}})}}}),vm.config({mode:"special",onSpace:u,onEnter:u,onDown:function(t){return i(t),et.some(!0)}}),zm.config({}),Qm.config({toggleOnExecute:!1,aria:{mode:"expanded"}})]),domModification:{attributes:{role:o.role.getOr("button"),"aria-haspopup":!0}}}}}),aE=ro("update-menu-text"),cE=ro("update-menu-icon"),sE=function(t,n,o){var e=_t(tt),r=t.text.map(function(t){return kg(HS(t,n,o.providers))}),i=t.icon.map(function(t){return kg(RS(t,o.providers.icons))}),u=function(t,n){var e=Vm.getValue(t);return zm.focus(e),Wr(e,"keydown",{raw:n.event().raw()}),yy.close(e),et.some(!0)},a=t.role.fold(function(){return{}},function(t){return{role:t}}),c=t.tooltip.fold(function(){return{}},function(t){var n=o.providers.translate(t);return{title:n,"aria-label":n}});return kg(yy.sketch(uo({},a,{dom:{tag:"button",classes:[n,n+"--select"].concat(A(t.classes,function(t){return n+"--"+t})),attributes:uo({},c)},components:$p([i.map(function(t){return t.asSpec()}),r.map(function(t){return t.asSpec()}),et.some({dom:{tag:"div",classes:[n+"__select-chevron"],innerHtml:Og("chevron-down",o.providers.icons)}})]),matchWidth:!0,useMinWidth:!0,dropdownBehaviours:ra(t.dropdownBehaviours.concat([jp(t.disabled),xy.config({}),Sm.config({}),ig("dropdown-events",[Gp(t,e),Xp(t,e)]),ig("menubutton-update-display-text",[ci(aE,function(n,e){r.bind(function(t){return t.getOpt(n)}).each(function(t){Sm.set(t,[Tu(o.providers.translate(e.event().text()))])})}),ci(cE,function(n,e){i.bind(function(t){return t.getOpt(n)}).each(function(t){Sm.set(t,[RS(e.event().icon(),o.providers.icons)])})})])])),eventOrder:wt(JO,{mousedown:["focusing","alloy.base.behaviour","item-type-events","normal-dropdown-events"]}),sandboxBehaviours:ra([vm.config({mode:"special",onLeft:u,onRight:u})]),lazySink:o.getSink,toggleClass:n+"--active",parts:{menu:$h(0,t.columns,t.presets)},fetch:function(){return Cb.nu(t.fetch)}}))).asSpec()},fE=function(n){return{isDisabled:function(){return zp.isDisabled(n)},setDisabled:function(t){return zp.set(n,t)}}},lE=function(n){return{setActive:function(t){Qm.set(n,t)},isActive:function(){return Qm.isOn(n)},isDisabled:function(){return zp.isDisabled(n)},setDisabled:function(t){return zp.set(n,t)}}},dE=function(e){return{isDisabled:function(){return zp.isDisabled(e)},setDisabled:function(t){return zp.set(e,t)},setActive:function(t){var n=e.element();t?(eu(n,"tox-tbtn--enabled"),ze(n,"aria-pressed",!0)):(ou(n,"tox-tbtn--enabled"),We(n,"aria-pressed"))},isActive:function(){return ru(e.element(),"tox-tbtn--enabled")}}},mE=function(t,n){return t.map(function(t){return{"aria-label":n.translate(t),title:n.translate(t)}}).getOr({})},gE=ro("focus-button"),pE=["checklist","ordered-list"],hE=["indent","outdent","table-insert-column-after","table-insert-column-before","unordered-list"],vE=function(n,e,t,o,r,i){var u,a=function(t){return ap.isRtl()&&E(pE,t)?t+"-rtl":t},c=ap.isRtl()&&n.exists(function(t){return E(hE,t)});return{dom:{tag:"button",classes:["tox-tbtn"].concat(e.isSome()?["tox-tbtn--select"]:[]).concat(c?["tox-tbtn__icon-rtl"]:[]),attributes:mE(t,i)},components:$p([n.map(function(t){return VS(a(t),i.icons)}),e.map(function(t){return HS(t,"tox-tbtn",i)})]),eventOrder:(u={},u[zt()]=["focusing","alloy.base.behaviour","common-button-display-events"],u),buttonBehaviours:ra([ig("common-button-display-events",[ci(zt(),function(t,n){n.event().prevent(),Ur(t,gE)})])].concat(o.map(function(t){return nE.config({channel:t,initialData:{icon:n,text:e},renderComponents:function(t,n){return $p([t.icon.map(function(t){return VS(a(t),i.icons)}),t.text.map(function(t){return HS(t,"tox-tbtn",i)})])}})}).toArray()).concat(r.getOr([])))}},bE=function(t,n,e){var o,r=_t(tt),i=vE(t.icon,t.text,t.tooltip,et.none(),et.none(),e);return Sg.sketch({dom:i.dom,components:i.components,eventOrder:JO,buttonBehaviours:ra([ig("toolbar-button-events",[(o={onAction:t.onAction,getApi:n.getApi},xi(function(n,t){Wp(o,n)(function(t){Wr(n,KO,{buttonApi:t}),o.onAction(t)})})),Gp(n,r),Xp(n,r)]),jp(t.disabled)].concat(n.toolbarButtonBehaviours))})},yE=function(t,n,e){return bE(t,{toolbarButtonBehaviours:[].concat(0<e.length?[ig("toolbarButtonWith",e)]:[]),getApi:fE,onSetup:t.onSetup},n)},xE=function(t,n,e){return wt(bE(t,{toolbarButtonBehaviours:[Sm.config({}),Qm.config({toggleClass:"tox-tbtn--enabled",aria:{mode:"pressed"},toggleOnExecute:!1})].concat(0<e.length?[ig("toolbarToggleButtonWith",e)]:[]),getApi:lE,onSetup:t.onSetup},n))},wE=function(n,t){var e,o,r,i,u=ro("channel-update-split-dropdown-display"),a=function(e){return{isDisabled:function(){return zp.isDisabled(e)},setDisabled:function(t){return zp.set(e,t)},setIconFill:function(t,n){Iu(e.element(),'svg path[id="'+t+'"], rect[id="'+t+'"]').each(function(t){ze(t,"fill",n)})},setIconStroke:function(t,n){Iu(e.element(),'svg path[id="'+t+'"], rect[id="'+t+'"]').each(function(t){ze(t,"stroke",n)})},setActive:function(n){ze(e.element(),"aria-pressed",n),Iu(e.element(),"span").each(function(t){e.getSystem().getByDom(t).each(function(t){return Qm.set(t,n)})})},isActive:function(){return Iu(e.element(),"span").exists(function(t){return e.getSystem().getByDom(t).exists(Qm.isOn)})}}},c=_t(tt),s={getApi:a,onSetup:n.onSetup};return uE.sketch({dom:{tag:"div",classes:["tox-split-button"],attributes:St({"aria-pressed":!1},mE(n.tooltip,t.providers))},onExecute:function(t){n.onAction(a(t))},onItemExecute:function(t,n,e){},splitDropdownBehaviours:ra([Up(!1),ig("split-dropdown-events",[ci(gE,zm.focus),Gp(s,c),Xp(s,c)])]),eventOrder:(e={},e[Un()]=["alloy.base.behaviour","split-dropdown-events"],e),toggleClass:"tox-tbtn--enabled",lazySink:t.getSink,fetch:(o=a,r=n,i=t.providers,function(n){return Cb.nu(function(t){return r.fetch(t)}).map(function(t){return et.from(hv(wt(nv(ro("menu-value"),t,function(t){r.onItemAction(o(n),t)},r.columns,r.presets,Kp.CLOSE_ON_EXECUTE,r.select.getOr(function(){return!1}),i),{movement:ov(r.columns,r.presets),menuBehaviours:$g("auto"!==r.columns?[]:[vi(function(o,t){Kg(o,4,hp(r.presets)).each(function(t){var n=t.numRows,e=t.numColumns;vm.setGridSize(o,n,e)})})])})))})}),parts:{menu:$h(0,n.columns,n.presets)},components:[uE.parts().button(vE(n.icon,n.text,et.none(),et.some(u),et.some([Qm.config({toggleClass:"tox-tbtn--enabled",toggleOnExecute:!1})]),t.providers)),uE.parts().arrow({dom:{tag:"button",classes:["tox-tbtn","tox-split-button__chevron"],innerHtml:Og("chevron-down",t.providers.icons)}}),uE.parts()["aria-descriptor"]({text:t.providers.translate("To open the popup, press Shift+Enter")})]})},SE=function(t,n,e,o){return sE({text:t.text,icon:t.icon,tooltip:t.tooltip,role:o,fetch:function(n){t.fetch(function(t){n(ey(t,Kp.CLOSE_ON_EXECUTE,e))})},onSetup:t.onSetup,getApi:dE,columns:1,presets:"normal",classes:[],dropdownBehaviours:[]},n,e.shared)},kE=function(i,u){return ci(KO,function(t,n){var e,o=i.get(t),r=(e=o,{hide:function(){return Ur(e,Nn())},getValue:function(){return Vm.getValue(e)}});u.onAction(r,n.event().buttonApi())})},CE=function(t,n,e){var o,r,i,u,a,c,s,f,l,d,m,g,p={backstage:{shared:{providers:e}}};return"contextformtogglebutton"===n.type?(s=t,l=p,(d=(f=n).original).primary,m=ao(d,["primary"]),g=ur(zO(uo({},m,{type:"togglebutton",onAction:function(){}}))),xE(g,l.backstage.shared.providers,[kE(s,f)])):(o=t,i=p,(u=(r=n).original).primary,a=ao(u,["primary"]),c=ur(IO(uo({},a,{type:"button",onAction:function(){}}))),yE(c,i.backstage.shared.providers,[kE(o,r)]))},OE=function(t,n){var e,o,r,i,u=t.label.fold(function(){return{}},function(t){return{"aria-label":t}}),a=kg(oy.sketch({inputClasses:["tox-toolbar-textfield","tox-toolbar-nav-js"],data:t.initValue(),inputAttributes:u,selectOnFocus:!0,inputBehaviours:ra([vm.config({mode:"special",onEnter:function(t){return c.findPrimary(t).map(function(t){return Gr(t),!0})},onLeft:function(t,n){return n.cut(),et.none()},onRight:function(t,n){return n.cut(),et.none()}})])})),c=(e=a,o=t.commands,r=n.shared.providers,i=A(o,function(t){return kg(CE(e,t,r))}),{asSpecs:function(){return A(i,function(t){return t.asSpec()})},findPrimary:function(e){return Ft(o,function(t,n){return t.primary?et.from(i[n]).bind(function(t){return t.getOpt(e)}).filter(S(zp.isDisabled)):et.none()})}});return _O({uid:ro("context-toolbar"),initGroups:[{title:et.none(),items:[a.asSpec()]},{title:et.none(),items:c.asSpecs()}],onEscape:et.none,cyclicKeying:!0,backstage:n,getSink:function(){return vt.error("")}})},EE=ro("forward-slide"),TE=ro("backward-slide"),BE=ro("change-slide-event"),AE="tox-pop--resizing",DE=function(n,t){return Ft(t,function(t){return t.predicate(n.dom())?et.some({toolbarApi:t,elem:n}):et.none()})},_E=function(n,e){var t=function(t){return t.dom()===e.getBody()},o=Zn.fromDom(e.selection.getNode());return DE(o,n.inNodeScope).orThunk(function(){return DE(o,n.inEditorScope).orThunk(function(){return function(t,n,e){for(var o=t.dom(),r=v(e)?e:nt(!1);o.parentNode;){o=o.parentNode;var i=Zn.fromDom(o),u=n(i);if(u.isSome())return u;if(r(i))break}return et.none()}(o,function(t){return DE(t,n.inNodeScope)},t)})})},ME=function(e,r){var t={},i=[],u=[],a={},c={},o=function(n,e){var o=ur(ir("ContextForm",YO,e));(t[n]=o).launch.map(function(t){a["form:"+n]=uo({},e.launch,{type:"contextformtogglebutton"===t.type?"togglebutton":"button",onAction:function(){r(o)}})}),"editor"===o.scope?u.push(o):i.push(o),c[n]=o},s=function(n,e){var t;(t=e,ir("ContextToolbar",qO,t)).each(function(t){"editor"===e.scope?u.push(t):i.push(t),c[n]=t})},n=Z(e);return M(n,function(t){var n=e[t];"contextform"===n.type?o(t,n):"contexttoolbar"===n.type&&s(t,n)}),{forms:t,inNodeScope:i,inEditorScope:u,lookupTable:c,formNavigators:a}},FE=function(o,r){return function(n){var e=_t(et.none()),t=function(){n.setActive(o.formatter.match(r));var t=o.formatter.formatChanged(r,n.setActive).unbind;e.set(et.some(t))};return o.initialized?t():o.on("init",t),function(){return e.get().each(function(t){return t()})}}},IE=function(n){return function(t){return function(){n.undoManager.transact(function(){n.focus(),n.execCommand("mceToggleFormat",!1,t.format)})}}},VE=function(t,n,e,o){var i,u,r,a,c,s="basic"===e.type?function(){return A(e.data,function(t){return nC(t,o.isSelectedFor,o.getPreviewFor)})}:e.getData;return{items:(i=n,u=o,r=function(t,n,e){var o=i.shared.providers.translate(t.title);if("separator"===t.type)return et.some({type:"separator",text:o});if("submenu"!==t.type)return et.some(uo({type:"togglemenuitem",text:o,active:t.isSelected(),disabled:e,onAction:u.onAction(t)},t.getStylePreview().fold(function(){return{}},function(t){return{meta:{style:t}}})));var r=j(t.getStyleItems(),function(t){return a(t,n)});return 0===n&&r.length<=0?et.none():et.some({type:"nestedmenuitem",text:o,disabled:r.length<=0,getSubmenuItems:function(){return j(t.getStyleItems(),function(t){return a(t,n)})}})},a=function(t,n){var e="formatter"===t.type&&u.isInvalid(t);return 0===n?e?[]:r(t,n,!1).toArray():r(t,n,e).toArray()},c=function(t){var n=u.shouldHide?0:1;return j(t,function(t){return a(t,n)})},{validateItems:c,getFetch:function(o,r){return function(t){var n=r(),e=c(n);t(ey(e,Kp.CLOSE_ON_EXECUTE,o))}}}),getStyleItems:s}},RE=function(o,t,n,r){var e=VE(0,t,n,r),i=e.items,u=e.getStyleItems;return sE({text:r.icon.isSome()?et.none():et.some(""),icon:r.icon,tooltip:et.from(r.tooltip),role:et.none(),fetch:i.getFetch(t,u),onSetup:function(e){return r.setInitialValue.each(function(t){return t(e.getComponent())}),r.nodeChangeHandler.map(function(t){var n=t(e.getComponent());return o.on("NodeChange",n),function(){o.off("NodeChange",n)}}).getOr(tt)},getApi:function(t){return{getComponent:function(){return t}}},columns:1,presets:"normal",classes:r.icon.isSome()?[]:["bespoke"],dropdownBehaviours:[]},"tox-tbtn",t.shared)};(pk=gk||(gk={}))[pk.SemiColon=0]="SemiColon",pk[pk.Space=1]="Space";var HE,NE,PE=function(t,n,e,o){var r,i,u=Et(t.settings,n).getOr(e);return{type:"basic",data:(i=u,r=o===gk.SemiColon?i.replace(/;$/,"").split(";"):i.split(" "),A(r,function(t){var n=t,e=t,o=t.split("=");return 1<o.length&&(n=o[0],e=o[1]),{title:n,format:e}}))}},zE=[{title:"Left",icon:"align-left",format:"alignleft"},{title:"Center",icon:"align-center",format:"aligncenter"},{title:"Right",icon:"align-right",format:"alignright"},{title:"Justify",icon:"align-justify",format:"alignjustify"}],LE=function(e){var n=function(t){var n=H(zE,function(t){return e.formatter.match(t.format)}).fold(function(){return"left"},function(t){return t.title.toLowerCase()});Wr(t,cE,{icon:"align-"+n})},t=et.some(function(t){return function(){return n(t)}}),o=et.some(function(t){return n(t)}),r={type:"basic",data:zE};return{tooltip:"Align",icon:et.some("align-left"),isSelectedFor:function(t){return function(){return e.formatter.match(t)}},getPreviewFor:function(t){return function(){return et.none()}},onAction:IE(e),setInitialValue:o,nodeChangeHandler:t,dataset:r,shouldHide:!1,isInvalid:function(t){return!e.formatter.canApply(t.format)}}},jE=["-apple-system","Segoe UI","Roboto","Helvetica Neue","sans-serif"],UE=function(r){var o=function(){var e=function(t){return t?t.split(",")[0]:""},t=r.queryCommandValue("FontName"),n=i.data,o=t?t.toLowerCase():"";return H(n,function(t){var n=t.format;return n.toLowerCase()===o||e(n).toLowerCase()===e(o).toLowerCase()}).orThunk(function(){return 0===(t=o).indexOf("-apple-system")&&(n=t.toLowerCase().split(/['"]?\s*,\s*['"]?/),W(jE,function(t){return-1<n.indexOf(t.toLowerCase())}))?et.from({title:"System Font",format:o}):et.none();var t,n})},n=function(t){var n=r.queryCommandValue("FontName"),e=o().fold(function(){return n},function(t){return t.title});Wr(t,aE,{text:e})},t=et.some(function(t){return function(){return n(t)}}),e=et.some(function(t){return n(t)}),i=PE(r,"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",gk.SemiColon);return{tooltip:"Fonts",icon:et.none(),isSelectedFor:function(n){return function(){return o().exists(function(t){return t.format===n})}},getPreviewFor:function(t){return function(){return et.some({tag:"div",styleAttr:-1===t.indexOf("dings")?"font-family:"+t:""})}},onAction:function(t){return function(){r.undoManager.transact(function(){r.focus(),r.execCommand("FontName",!1,t.format)})}},setInitialValue:e,nodeChangeHandler:t,dataset:i,shouldHide:!1,isInvalid:function(){return!1}}},WE=function(t,n){return/[0-9.]+px$/.test(t)?(e=72*parseInt(t,10)/96,o=n||0,r=Math.pow(10,o),Math.round(e*r)/r+"pt"):t;var e,o,r},GE=function(i){var u=function(){var e=et.none(),o=a.data,r=i.queryCommandValue("FontSize");if(r)for(var t=function(t){var n=WE(r,t);e=H(o,function(t){return t.format===r||t.format===n})},n=3;e.isNone()&&0<=n;n--)t(n);return{matchOpt:e,px:r}},n=function(t){var n=u(),e=n.matchOpt,o=n.px,r=e.fold(function(){return o},function(t){return t.title});Wr(t,aE,{text:r})},t=et.some(function(t){return function(){return n(t)}}),e=et.some(function(t){return n(t)}),a=PE(i,"fontsize_formats","8pt 10pt 12pt 14pt 18pt 24pt 36pt",gk.Space);return{tooltip:"Font sizes",icon:et.none(),isSelectedFor:function(n){return function(){return u().matchOpt.exists(function(t){return t.format===n})}},getPreviewFor:function(){return function(){return et.none()}},onAction:function(t){return function(){i.undoManager.transact(function(){i.focus(),i.execCommand("FontSize",!1,t.format)})}},setInitialValue:e,nodeChangeHandler:t,dataset:a,shouldHide:!1,isInvalid:function(){return!1}}},XE=function(e,t,n){var o=t();return Ft(n,function(n){return H(o,function(t){return e.formatter.matchNode(n,t.format)})}).orThunk(function(){return e.formatter.match("p")?et.some({title:"Paragraph",format:"p"}):et.none()})},YE=function(t){var n=t.selection.getStart(!0)||t.getBody();return t.dom.getParents(n,function(){return!0},t.getBody())},qE=function(o){var e=function(t,n){var e=XE(o,function(){return r.data},t).fold(function(){return"Paragraph"},function(t){return t.title});Wr(n,aE,{text:e})},t=et.some(function(n){return function(t){return e(t.parents,n)}}),n=et.some(function(t){var n=YE(o);e(n,t)}),r=PE(o,"block_formats","Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre",gk.SemiColon);return{tooltip:"Blocks",icon:et.none(),isSelectedFor:function(t){return function(){return o.formatter.match(t)}},getPreviewFor:function(n){return function(){var t=o.formatter.get(n);return et.some({tag:0<t.length&&(t[0].inline||t[0].block)||"div",styleAttr:o.formatter.getCssText(n)})}},onAction:IE(o),setInitialValue:n,nodeChangeHandler:t,dataset:r,shouldHide:!1,isInvalid:function(t){return!o.formatter.canApply(t.format)}}},KE=function(i){var e=function(t,n){var e=function(t){var n=t.items;return n!==undefined&&0<n.length?j(n,e):[{title:t.title,format:t.format}]},o=j(tC(i),e),r=XE(i,function(){return o},t).fold(function(){return"Paragraph"},function(t){return t.title});Wr(n,aE,{text:r})},t=et.some(function(n){return function(t){return e(t.parents,n)}}),n=et.some(function(t){var n=YE(i);e(n,t)});return{tooltip:"Formats",icon:et.none(),isSelectedFor:function(t){return function(){return i.formatter.match(t)}},getPreviewFor:function(n){return function(){var t=i.formatter.get(n);return t!==undefined?et.some({tag:0<t.length&&(t[0].inline||t[0].block)||"div",styleAttr:i.formatter.getCssText(n)}):et.none()}},onAction:IE(i),setInitialValue:n,nodeChangeHandler:t,shouldHide:i.getParam("style_formats_autohide",!1,"boolean"),isInvalid:function(t){return!i.formatter.canApply(t.format)}}},JE=[{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"]}],$E=function(o,r){return function(t,n){var e=o(t).mapError(function(t){return cr(t)}).getOrDie();return r(e,n)}},QE={button:$E(IO,function(t,n){return e=t,o=n.backstage.shared.providers,yE(e,o,[]);var e,o}),togglebutton:$E(zO,function(t,n){return e=t,o=n.backstage.shared.providers,xE(e,o,[]);var e,o}),menubutton:$E(RO,function(t,n){return SE(t,"tox-tbtn",n.backstage,et.none())}),splitbutton:$E(function(t){return ir("SplitButton",HO,t)},function(t,n){return wE(t,n.backstage.shared)}),styleSelectButton:function(t,n){return e=t,o=n.backstage,r=o.styleselect,RE(e,o,r,KE(e));var e,o,r},fontsizeSelectButton:function(t,n){return e=t,o=n.backstage,r=GE(e),RE(e,o,r.dataset,r);var e,o,r},fontSelectButton:function(t,n){return e=t,o=n.backstage,r=UE(e),RE(e,o,r.dataset,r);var e,o,r},formatButton:function(t,n){return e=t,o=n.backstage,r=qE(e),RE(e,o,r.dataset,r);var e,o,r},alignMenuButton:function(t,n){return e=t,o=n.backstage,r=LE(e),RE(e,o,r.dataset,r);var e,o,r}},ZE={styleselect:QE.styleSelectButton,fontsizeselect:QE.fontsizeSelectButton,fontselect:QE.fontSelectButton,formatselect:QE.formatButton,align:QE.alignMenuButton},tT=function(t){var n=t.split("|");return A(n,function(t){return{items:t.trim().split(" ")}})},nT=function(t){return!1===t.toolbar?[]:t.toolbar===undefined||!0===t.toolbar?(e=t.buttons,n=A(JE,function(t){var n=V(t.items,function(t){return lt(e,t)||lt(ZE,t)});return{name:t.name,items:n}}),V(n,function(t){return 0<t.items.length})):k(t.toolbar)?tT(t.toolbar):D(t.toolbar)&&k(t.toolbar[0])?tT(t.toolbar.join(" | ")):t.toolbar;var e,n},eT=function(n,e,o,r,t){return ft(e,o.toLowerCase()).orThunk(function(){return t.bind(function(t){return Ft(t,function(t){return ft(e,t+o.toLowerCase())})})}).fold(function(){return ft(ZE,o.toLowerCase()).map(function(t){return t(n,r)}).orThunk(function(){return et.none()})},function(t){return e=r,ft(QE,(n=t).type).fold(function(){return x.console.error("skipping button defined by",n),et.none()},function(t){return et.some(t(n,e))});var n,e})},oT=function(e,o,r,i){var t=nT(o),n=A(t,function(t){var n=j(t.items,function(t){return 0===t.trim().length?[]:eT(e,o.buttons,t,r,i).toArray()});return{title:et.from(e.translate(t.name)),items:n}});return V(n,function(t){return 0<t.items.length})},rT=function(i,t,u,c){var e,o,s=Du((e={sink:u,onEscape:function(){return i.focus(),et.some(!0)}},o=_t([]),xg.sketch({dom:{tag:"div",classes:["tox-pop"]},fireDismissalEventInstead:{event:"doNotDismissYet"},onShow:function(t){o.set([]),xg.getContent(t).each(function(t){vu(t.element(),"visibility")}),ou(t.element(),AE),vu(t.element(),"width")},inlineBehaviours:ra([ig("context-toolbar-events",[hi(Qt(),function(t,n){xg.getContent(t).each(function(t){}),ou(t.element(),AE),vu(t.element(),"width")}),ci(BE,function(n,e){vu(n.element(),"width");var t=Sa(n.element());xg.setContent(n,e.event().contents()),eu(n.element(),AE);var o=Sa(n.element());fu(n.element(),"width",t+"px"),xg.getContent(n).each(function(t){e.event().focus().bind(function(t){return Rl(t),Nl(n.element())}).orThunk(function(){return vm.focusIn(t),Hl()})}),Bg.setTimeout(function(){fu(n.element(),"width",o+"px")},0)}),ci(EE,function(t,n){xg.getContent(t).each(function(t){o.set(o.get().concat([{bar:t,focus:Hl()}]))}),Wr(t,BE,{contents:n.event().forwardContents(),focus:et.none()})}),ci(TE,function(n,t){$(o.get()).each(function(t){o.set(o.get().slice(0,o.get().length-1)),Wr(n,BE,{contents:_u(t.bar),focus:t.focus})})})]),vm.config({mode:"special",onEscape:function(n){return $(o.get()).fold(function(){return e.onEscape()},function(t){return Ur(n,TE),et.some(!0)})}})]),lazySink:function(){return vt.value(e.sink)}}))),f=function(){return et.some(Zn.fromDom(i.contentAreaContainer))};i.on("init",function(){var t=i.getBody().ownerDocument.defaultView,n=Sv(Zn.fromDom(t),"scroll",function(){l.get().each(function(t){var n=d.get().getOr(i.selection.getNode()).getBoundingClientRect(),e=i.contentAreaContainer.getBoundingClientRect(),o=n.bottom<0,r=n.top>e.height;o||r?fu(s.element(),"display","none"):(vu(s.element(),"display"),Es.positionWithin(u,t,s,f()))})});i.on("remove",function(){n.unbind()})});var l=_t(et.none()),d=_t(et.none()),n=_t(null),m=function(t){return{dom:{tag:"div",classes:["tox-pop__dialog"]},components:[t],behaviours:ra([vm.config({mode:"acyclic"}),ig("pop-dialog-wrap-events",[vi(function(t){i.shortcuts.add("ctrl+F9","focus statusbar",function(){return vm.focusIn(t)})}),bi(function(t){i.shortcuts.remove("ctrl+F9")})])])}},a=tn(function(){return ME(t,function(t){var n=g(t);Wr(s,EE,{forwardContents:m(n)})})}),g=function(t){var n,e,o=i.ui.registry.getAll().buttons,r=a();return"contexttoolbar"===t.type?(n=St(o,r.formNavigators),e=oT(i,{buttons:n,toolbar:t.items},c,et.some(["form:"])),_O({uid:ro("context-toolbar"),initGroups:e,onEscape:et.none,cyclicKeying:!0,backstage:c.backstage,getSink:function(){return vt.error("")}})):OE(t,c.backstage)};i.on("contexttoolbar-show",function(n){var t=a();Et(t.lookupTable,n.toolbarKey).each(function(t){b(t,n.target===i?et.none():et.some(n)),xg.getContent(s).each(vm.focusIn)})});var r={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"]},p={maxHeightFunction:rc()},h={bubble:sc(12,0,r),layouts:{onLtr:function(){return[Cc]},onRtl:function(){return[Oc]}},overrides:p},v={bubble:sc(0,12,r),layouts:{onLtr:function(){return[Sc,kc,xc,bc,wc,yc]},onRtl:function(){return[Sc,kc,wc,yc,xc,bc]}},overrides:p},b=function(t,n){x();var e,o,r,i=g(t),u=n.map(Zn.fromDom),a=(e=t.position,o=u,r="node"===e?c.backstage.shared.anchors.node(o):c.backstage.shared.anchors.cursor(),wt(r,"line"===e?h:v));l.set(et.some(a)),d.set(n),xg.showWithin(s,a,m(i),f()),vu(s.element(),"display")},y=function(){var t=a();_E(t,i).fold(function(){l.set(et.none()),xg.hide(s)},function(t){b(t.toolbarApi,et.some(t.elem.dom()))})},x=function(){var t=n.get();null!==t&&(Bg.clearTimeout(t),n.set(null))},w=function(t){x(),n.set(t)};i.on("init",function(){i.on("click keyup SetContent ObjectResized ResizeEditor",function(t){w(Bg.setEditorTimeout(i,y,0))}),i.on("focusout",function(t){Bg.setEditorTimeout(i,function(){Nl(u.element()).isNone()&&Nl(s.element()).isNone()&&(l.set(et.none()),xg.hide(s))},0)}),i.on("SwitchMode",function(){i.readonly&&(l.set(et.none()),xg.hide(s))}),i.on("NodeChange",function(t){Nl(s.element()).fold(function(){w(Bg.setEditorTimeout(i,y,0))},function(t){})})})},iT=function(t,e,o){var n=Sv(Zn.fromDom(x.document),"mousedown",function(n){M([e,o],function(t){t.broadcastOn([Xs()],{target:n.target()})})}),r=Sv(Zn.fromDom(x.document),"touchstart",function(n){M([e,o],function(t){t.broadcastOn([Xs()],{target:n.target()})})}),i=Sv(Zn.fromDom(x.document),"mouseup",function(n){0===n.raw().button&&M([e,o],function(t){t.broadcastOn([Ys()],{target:n.target()})})}),u=function(n){M([e,o],function(t){t.broadcastOn([Xs()],{target:Zn.fromDom(n.target)})})};t.on("mousedown",u),t.on("touchstart",u);var a=function(n){0===n.button&&M([e,o],function(t){t.broadcastOn([Ys()],{target:Zn.fromDom(n.target)})})};t.on("mouseup",a);var c=function(n){M([e,o],function(t){t.broadcastEvent(Ln(),n)})};t.on("ScrollWindow",c);var s=function(n){M([e,o],function(t){t.broadcastEvent(jn(),n)})};t.on("ResizeWindow",s),t.on("remove",function(){t.off("mousedown",u),t.off("touchstart",u),t.off("mouseup",a),t.off("ResizeWindow",s),t.off("ScrollWindow",c),n.unbind(),r.unbind(),i.unbind()}),t.on("detach",function(){Rs(e),Rs(o),e.destroy(),o.destroy()})},uT=function(t){return t.fire("SkinLoaded")},aT=function(t){return t.fire("ResizeEditor")},cT=function(t){return t.fire("ResizeContent")},sT=$f,fT=If,lT=ul({factory:function(n,o){var t={focus:vm.focusIn,setMenus:function(t,n){var e=A(n,function(n){var t={type:"menubutton",text:n.text,fetch:function(t){t(n.getItems())}},e=RO(t).mapError(function(t){return cr(t)}).getOrDie();return SE(e,"tox-mbtn",o.backstage,et.some("menuitem"))});Sm.set(t,e)}};return{uid:n.uid,dom:n.dom,components:[],behaviours:ra([Sm.config({}),ig("menubar-events",[vi(function(t){n.onSetup(t)}),ci(Wt(),function(e,t){Iu(e.element(),".tox-mbtn--active").each(function(n){Vu(t.event().target(),".tox-mbtn").each(function(t){he(n,t)||e.getSystem().getByDom(n).each(function(n){e.getSystem().getByDom(t).each(function(t){yy.expand(t),yy.close(n),zm.focus(t)})})})})}),ci(Xn(),function(e,t){t.event().prevFocus().bind(function(t){return e.getSystem().getByDom(t).toOption()}).each(function(n){t.event().newFocus().bind(function(t){return e.getSystem().getByDom(t).toOption()}).each(function(t){yy.isOpen(n)&&(yy.expand(t),yy.close(n))})})})]),vm.config({mode:"flow",selector:".tox-mbtn",onEscape:function(t){return n.onEscape(t),et.some(!0)}}),hy.config({})]),apis:t,domModification:{attributes:{role:"menubar"}}}},name:"silver.Menubar",configFields:[vr("dom"),vr("uid"),vr("onEscape"),vr("backstage"),_r("onSetup",tt)],apis:{focus:function(t,n){t.focus(n)},setMenus:function(t,n,e){t.setMenus(n,e)}}}),dT="container",mT=[$s("slotBehaviours",[])],gT=function(t){return"<alloy.field."+t+">"},pT=function(r,t,n){var e,o=function(t){return Yf(r)},i=function(e,o){return void 0===o&&(o=undefined),function(t,n){return Uf(t,r,n).map(function(t){return e(t,n)}).getOr(o)}},u=function(t,n){return"true"!==je(t.element(),"aria-hidden")},a=i(u,!1),c=i(function(t,n){if(u(t)){var e=t.element();fu(e,"display","none"),ze(e,"aria-hidden","true"),Wr(t,Yn(),{name:n,visible:!1})}}),s=(e=c,function(n,t){M(t,function(t){return e(n,t)})}),f=i(function(t,n){if(!u(t)){var e=t.element();vu(e,"display"),We(e,"aria-hidden"),Wr(t,Yn(),{name:n,visible:!0})}}),l={getSlotNames:o,getSlot:function(t,n){return Uf(t,r,n)},isShowing:a,hideSlot:c,hideAllSlots:function(t){return s(t,o())},showSlot:f};return{uid:r.uid,dom:r.dom,components:t,behaviours:Qs(r.slotBehaviours),apis:l}},hT=it({getSlotNames:function(t,n){return t.getSlotNames(n)},getSlot:function(t,n,e){return t.getSlot(n,e)},isShowing:function(t,n,e){return t.isShowing(n,e)},hideSlot:function(t,n,e){return t.hideSlot(n,e)},hideAllSlots:function(t,n){return t.hideAllSlots(n)},showSlot:function(t,n,e){return t.showSlot(n,e)}},Ni),vT=uo({},hT,{sketch:function(t){var e,n=(e=[],{slot:function(t,n){return e.push(t),Nf(dT,gT(t),n)},record:function(){return e}}),o=t(n),r=n.record(),i=A(r,function(t){return Af({name:t,pname:gT(t)})});return Zf(dT,mT,i,pT,o)}}),bT=Wo([Br("icon"),Br("tooltip"),Hr("onShow",tt),Hr("onHide",tt),Hr("onSetup",function(){return tt})]),yT=function(t){return{element:function(){return t.element().dom()}}},xT=function(e,o){var r=A(Z(o),function(t){var n=o[t],e=ur(ir("sidebar",bT,n));return{name:t,getApi:yT,onSetup:e.onSetup,onShow:e.onShow,onHide:e.onHide}});return A(r,function(t){var n=_t(tt);return e.slot(t.name,{dom:{tag:"div",classes:["tox-sidebar__pane"]},behaviours:$g([Gp(t,n),Xp(t,n),ci(Yn(),function(n,t){var e=t.event();H(r,function(t){return t.name===e.name()}).each(function(t){(e.visible()?t.onShow:t.onHide)(t.getApi(n))})})])})})},wT=function(t,e){ll.getCurrent(t).each(function(t){return Sm.set(t,[(n=e,vT.sketch(function(t){return{dom:{tag:"div",classes:["tox-sidebar__pane-container"]},components:xT(t,n),slotBehaviours:$g([vi(function(t){return vT.hideAllSlots(t)})])}}))]);var n})},ST=function(t){return ll.getCurrent(t).bind(function(t){return mO.isGrowing(t)||mO.hasGrown(t)?ll.getCurrent(t).bind(function(n){return H(vT.getSlotNames(n),function(t){return vT.isShowing(n,t)})}):et.none()})},kT=ro("FixSizeEvent"),CT=ro("AutoSizeEvent"),OT=function(t,n,e){var o,r=t.element();!0===n?(Sm.set(t,[(o=e,{dom:{tag:"div",attributes:{"aria-label":o.translate("Loading...")},classes:["tox-throbber__busy-spinner"]},components:[{dom:up('<div class="tox-spinner"><div></div><div></div><div></div></div>')}],behaviours:ra([vm.config({mode:"special",onTab:function(){return et.some(!0)},onShiftTab:function(){return et.some(!0)}}),zm.config({})])})]),vu(r,"display"),We(r,"aria-hidden")):(Sm.set(t,[]),fu(r,"display","none"),ze(r,"aria-hidden","true"))},ET=fT.optional({factory:lT,name:"menubar",schema:[vr("backstage")]}),TT=fT.optional({factory:{sketch:function(t){var n;return((n=t).split===Lv.sliding?DO:n.split===Lv.floating?AO:_O)({uid:t.uid,onEscape:function(){return t.onEscape(),et.some(!0)},cyclicKeying:!1,initGroups:[],getSink:t.getSink,backstage:t.backstage,moreDrawerData:{lazyToolbar:t.lazyToolbar,lazyMoreButton:t.lazyMoreButton}})}},name:"toolbar",schema:[vr("dom"),vr("onEscape"),vr("getSink")]}),BT=fT.optional({name:"socket",schema:[vr("dom")]}),AT=fT.optional({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-sidebar"],attributes:{role:"complementary"}},components:[{dom:{tag:"div",classes:["tox-sidebar__slider"]},components:[],behaviours:ra([hy.config({}),zm.config({}),mO.config({dimension:{property:"width"},closedClass:"tox-sidebar--sliding-closed",openClass:"tox-sidebar--sliding-open",shrinkingClass:"tox-sidebar--sliding-shrinking",growingClass:"tox-sidebar--sliding-growing",onShrunk:function(t){ll.getCurrent(t).each(vT.hideAllSlots),Ur(t,CT)},onGrown:function(t){Ur(t,CT)},onStartGrow:function(t){Wr(t,kT,{width:pu(t.element(),"width").getOr("")})},onStartShrink:function(t){Wr(t,kT,{width:Sa(t.element())+"px"})}}),Sm.config({}),ll.config({find:function(t){var n=Sm.contents(t);return J(n)}})])}],behaviours:ra([Bw(0),ig("sidebar-sliding-events",[ci(kT,function(t,n){fu(t.element(),"width",n.event().width())}),ci(CT,function(t,n){vu(t.element(),"width")})])])}}},name:"sidebar",schema:[vr("dom")]}),DT=fT.optional({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",attributes:{"aria-hidden":"true"},classes:["tox-throbber"],styles:{display:"none"}},behaviours:ra([Sm.config({})]),components:[]}}},name:"throbber",schema:[vr("dom")]}),_T=al({name:"OuterContainer",factory:function(e,t,n){var o={getSocket:function(t){return sT.getPart(t,e,"socket")},setSidebar:function(t,n){sT.getPart(t,e,"sidebar").each(function(t){return wT(t,n)})},toggleSidebar:function(t,o){sT.getPart(t,e,"sidebar").each(function(t){return n=t,e=o,void ll.getCurrent(n).each(function(n){ll.getCurrent(n).each(function(t){mO.hasGrown(n)?vT.isShowing(t,e)?mO.shrink(n):(vT.hideAllSlots(t),vT.showSlot(t,e)):(vT.hideAllSlots(t),vT.showSlot(t,e),mO.grow(n))})});var n,e})},whichSidebar:function(t){return sT.getPart(t,e,"sidebar").bind(ST).getOrNull()},getToolbar:function(t){return sT.getPart(t,e,"toolbar")},setToolbar:function(t,n){sT.getPart(t,e,"toolbar").each(function(t){t.getApis().setGroups(t,n)})},refreshToolbar:function(t){sT.getPart(t,e,"toolbar").each(function(t){return t.getApis().refresh(t)})},getMoreButton:function(t){return sT.getPart(t,e,"toolbar").bind(function(t){return t.getApis().getMoreButton(t)})},getThrobber:function(t){return sT.getPart(t,e,"throbber")},focusToolbar:function(t){sT.getPart(t,e,"toolbar").each(function(t){vm.focusIn(t)})},setMenubar:function(t,n){sT.getPart(t,e,"menubar").each(function(t){lT.setMenus(t,n)})},focusMenubar:function(t){sT.getPart(t,e,"menubar").each(function(t){lT.focus(t)})}};return{uid:e.uid,dom:e.dom,components:t,apis:o,behaviours:e.behaviours}},configFields:[vr("dom"),vr("behaviours")],partFields:[ET,TT,BT,AT,DT],apis:{getSocket:function(t,n){return t.getSocket(n)},setSidebar:function(t,n,e){t.setSidebar(n,e)},toggleSidebar:function(t,n,e){t.toggleSidebar(n,e)},whichSidebar:function(t,n){return t.whichSidebar(n)},getToolbar:function(t,n){return t.getToolbar(n)},setToolbar:function(t,n,e){var o=A(e,function(t){return EO(t)});t.setToolbar(n,o)},getMoreButton:function(t,n){return t.getMoreButton(n)},refreshToolbar:function(t,n){return t.refreshToolbar(n)},getThrobber:function(t,n){return t.getThrobber(n)},setMenubar:function(t,n,e){t.setMenubar(n,e)},focusMenubar:function(t,n){t.focusMenubar(n)},focusToolbar:function(t,n){t.focusToolbar(n)}}}),MT={file:{title:"File",items:"newdocument restoredraft | preview | 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 | forecolor backcolor | removeformat"},tools:{title:"Tools",items:"spellchecker spellcheckerlanguage | a11ycheck code wordcount"},table:{title:"Table",items:"inserttable tableprops deletetable row column cell"},help:{title:"Help",items:"help"}},FT=function(t){return"string"==typeof t?t.split(" "):t},IT=function(u,a){var c=St(MT,a.menus),n=0<Z(a.menus).length,t=a.menubar===undefined||!0===a.menubar?FT("file edit view insert format tools table help"):FT(!1===a.menubar?"":a.menubar),e=V(t,function(t){return n&&a.menus.hasOwnProperty(t)&&a.menus[t].hasOwnProperty("items")||MT.hasOwnProperty(t)}),o=A(e,function(t){var n,e,o,r,i=c[t];return n={title:i.title,items:FT(i.items)},e=a,r=(o=u,o.getParam("removed_menuitems","")).split(/[ ,]/),{text:n.title,getItems:function(){return j(n.items,function(t){var n=t.toLowerCase();return 0===n.trim().length?[]:T(r,function(t){return t===n})?[]:"separator"===n||"|"===n?[{type:"separator"}]:e.menuItems[n]?[e.menuItems[n]]:[]})}}});return V(o,function(t){return 0<t.getItems().length&&T(t.getItems(),function(t){return"separator"!==t.type})})},VT=function(t){var n=function(){t._skinLoaded=!0,uT(t)};return function(){t.initialized?n():t.on("init",n)}},RT=function(t,n){var e,o=function(t){var n=t.settings,e=n.skin,o=n.skin_url;if(!1!==e){var r=e||"oxide";o=o?t.documentBaseURI.toAbsolute(o):Xv.baseURL+"/skins/ui/"+r}return o}(n);o&&(e=o+"/skin.min.css",n.contentCSS.push(o+(t?"/content.inline":"/content")+".min.css")),0==(!1===n.getParam("skin"))&&e?Gv.DOM.styleSheetLoader.load(e,VT(n)):VT(n)()},HT=w(RT,!1),NT=w(RT,!0),PT=Gv.DOM,zT={render:function(e,o,t,n,r){var i,u,a=_t(0);HT(e),i=Zn.fromDom(r.targetNode),u=o.mothership,Vs(i,u,Oe),Is(Qr(),o.uiMothership),e.on("init",function(){_T.setToolbar(o.outerContainer,oT(e,t,{backstage:n},et.none())),a.set(e.getWin().innerWidth),_T.setMenubar(o.outerContainer,IT(e,t)),_T.setSidebar(o.outerContainer,t.sidebar),function(o){var r=o.getWin(),t=o.getDoc().documentElement,i=_t(pa(r.innerWidth,r.innerHeight)),u=_t(pa(t.offsetWidth,t.offsetHeight)),n=function(){var t=o.getDoc().documentElement,n=i.get(),e=u.get();n.left()!==r.innerWidth||n.top()!==r.innerHeight?(i.set(pa(r.innerWidth,r.innerHeight)),cT(o)):e.left()===t.offsetWidth&&e.top()===t.offsetHeight||(u.set(pa(t.offsetWidth,t.offsetHeight)),cT(o))};PT.bind(r,"resize",n);var e=kv(Zn.fromDom(o.getBody()),"load",n);o.on("remove",function(){e.unbind(),PT.unbind(r,"resize",n)})}(e)});var c=_T.getSocket(o.outerContainer).getOrDie("Could not find expected socket element");kO(e,o),e.addCommand("ToggleSidebar",function(t,n){_T.toggleSidebar(o.outerContainer,n),e.fire("ToggleSidebar")}),e.addQueryValueHandler("ToggleSidebar",function(){return _T.whichSidebar(o.outerContainer)});var s=Qv(e);return s!==Lv.sliding&&s!==Lv.floating||e.on("ResizeContent",function(){var t=e.getWin().innerWidth;t!==a.get()&&_T.refreshToolbar(o.outerContainer),a.set(t)}),{iframeContainer:c.element().dom(),editorContainer:o.outerContainer.element().dom()}},getBehaviours:function(t){return[]}},LT=function(e,n){return xe(e).orThunk(function(){var t=Zn.fromTag("span");Ce(e,t);var n=xe(t);return De(t),n}).map(function(t){return va(t).translate(-n.left(),-n.top())}).getOrThunk(function(){return pa(0,0)})},jT=bt([{offset:["x","y"]},{absolute:["x","y"]},{fixed:["x","y"]}]),UT=function(n){return function(t){return t.translate(-n.left(),-n.top())}},WT=function(n){return function(t){return t.translate(n.left(),n.top())}},GT=function(e){return function(t,n){return U(e,function(t,n){return n(t)},pa(t,n))}},XT=function(t,n,e){return t.fold(GT([WT(e),UT(n)]),GT([UT(n)]),GT([]))},YT=function(t,n,e){return t.fold(GT([WT(e)]),GT([]),GT([WT(n)]))},qT=function(t,n,e){return t.fold(GT([]),GT([UT(e)]),GT([WT(n),UT(e)]))},KT=function(t,n,e){return t.fold(function(t,n){return{position:"absolute",left:t+"px",top:n+"px"}},function(t,n){return{position:"absolute",left:t-e.left()+"px",top:n-e.top()+"px"}},function(t,n){return{position:"fixed",left:t+"px",top:n+"px"}})},JT=jT.offset,$T=jT.absolute,QT=jT.fixed,ZT=function(t,n){eu(t.element(),n.transitionClass),ou(t.element(),n.fadeOutClass),eu(t.element(),n.fadeInClass)},tB=function(t,n){eu(t.element(),n.transitionClass),ou(t.element(),n.fadeInClass),eu(t.element(),n.fadeOutClass)},nB=function(t,n){return t.y()>=n.y()&&t.bottom()<=n.bottom()},eB=function(t,n){return Ue(t,n)?et.some(parseInt(je(t,n),10)):et.none()},oB=function(o,r,i){return(u=o,t=r,n=u.element(),eB(n,t.leftAttr).bind(function(o){return eB(n,t.topAttr).map(function(t){var n=Sa(u.element()),e=Oa(u.element());return za(o,t,n,e)})})).bind(function(t){return nB(t,i)?(n=r,e=o.element(),We(e,n.leftAttr),We(e,n.topAttr),et.some($T(t.x(),t.y()))):et.none();var n,e});var u,t,n},rB=function(t,n,e,o,r){var i=va(t.element()),u=za(i.left(),i.top(),Sa(t.element()),Oa(t.element()));if(nB(u,e))return et.none();a=t,c=n,s=i.left(),f=i.top(),l=a.element(),ze(l,c.leftAttr,s),ze(l,c.topAttr,f);var a,c,s,f,l,d=$T(i.left(),i.top()),m=XT(d,o,r),g=$T(e.x(),e.y()),p=XT(g,o,r),h=u.y()<=e.y()?p.top():p.top()+e.height()-u.height();return et.some(QT(m.left(),h))},iB=function(i,t,n){var u=t.lazyViewport(i);t.contextual.each(function(r){r.lazyContext(i).each(function(t){var n,e,o=La(t);e=u,((n=o).y()<e.bottom()&&n.bottom()>e.y()?ZT:tB)(i,r)})});var e,o,r,a,c,s=ve(i.element()),f=ya(s),l=LT(i.element(),f);(e=i,o=t,r=u,a=f,c=l,pu(e.element(),"position").is("fixed")?oB(e,o,r):rB(e,o,r,a,c)).each(function(t){var n=KT(t,0,l);lu(i.element(),n)})},uB=/* */Object.freeze({refresh:iB}),aB=/* */Object.freeze({events:function(o,t){return ri([ci(Qt(),function(n,e){o.contextual.each(function(t){he(n.element(),e.event().target())&&(ou(n.element(),t.transitionClass),e.stop())})}),ci(Ln(),function(t,n){iB(t,o)})])}}),cB=[Dr("contextual",[vr("fadeInClass"),vr("fadeOutClass"),vr("transitionClass"),vr("lazyContext")]),_r("lazyViewport",function(t){var n=ya();return za(n.left(),n.top(),x.window.innerWidth,x.window.innerHeight)}),vr("leftAttr"),vr("topAttr")],sB=ua({fields:cB,name:"docking",active:aB,apis:uB}),fB={render:function(o,n,e,r,t){var i,u=Gv.DOM,a=tb(o),c=Qv(o),s=c===Lv.sliding||c===Lv.floating;NT(o);var f=function(t){var n=pu(i.element(),"position").is("fixed"),e=function(t){void 0===t&&(t=0);var n=va(Zn.fromDom(o.getBody()));return{top:Math.round(n.top()-Oa(i.element()))+t,left:Math.round(n.left())}}(s?t.fold(function(){return 0},function(t){return 1<t.components().length?Oa(t.components()[1].element()):0}):0);n?Le(i.element(),ut(e,function(t,n){return{k:"data-dock-"+n,v:t}})):lu(i.element(),it(e,function(t){return t+"px"})),sB.refresh(i)},l=function(){var t=_T.getToolbar(n.outerContainer);s&&_T.refreshToolbar(n.outerContainer),a||f(t)},d=function(){fu(n.outerContainer.element(),"display","flex"),u.addClass(o.getBody(),"mce-edit-focus"),vu(n.uiMothership.element(),"display"),l()},m=function(){n.outerContainer&&(fu(n.outerContainer.element(),"display","none"),u.removeClass(o.getBody(),"mce-edit-focus")),fu(n.uiMothership.element(),"display","none")},g=function(){if(i)d();else{i=n.outerContainer;var t=Zv(o).getOr(Qr());Is(t,n.mothership),Is(t,n.uiMothership),_T.setToolbar(n.outerContainer,oT(o,e,{backstage:r},et.none())),_T.setMenubar(n.outerContainer,IT(o,e)),a||fu(i.element(),"position","absolute"),l(),d(),o.on("NodeChange ResizeWindow",l),o.on("activate",d),o.on("deactivate",m),o.nodeChanged()}};return o.on("focus",g),o.on("blur hide",m),o.on("init",function(){o.hasFocus()&&g()}),kO(o,n),{editorContainer:n.outerContainer.element().dom()}},getBehaviours:function(n){return tb(n)?[]:[sB.config({leftAttr:"data-dock-left",topAttr:"data-dock-top",contextual:{lazyContext:function(t){return et.from(n).map(function(t){return Zn.fromDom(t.getBody())})},fadeInClass:"tox-toolbar-dock-fadein",fadeOutClass:"tox-toolbar-dock-fadeout",transitionClass:"tox-toolbar-dock-transition"}}),zm.config({})]}},lB=function(t,n){return{anchor:"makeshift",x:t,y:n}},dB=function(t,n){var e,o,r,i=Gv.DOM.getPos(t);return e=n,o=i.x,r=i.y,lB(e.x+o,e.y+r)},mB=function(t,n){return"contextmenu"===n.type?t.inline?lB((o=n).pageX,o.pageY):dB(t.getContentAreaContainer(),lB((e=n).clientX,e.clientY)):gB(t);var e,o},gB=function(t){return{anchor:"selection",root:Zn.fromDom(t.selection.getNode())}},pB=function(t){return"string"==typeof t?t.split(/[ ,]/):t},hB=function(t){return t.settings.contextmenu_never_use_native||!1},vB=function(t){return e="contextmenu",o="link linkchecker image imagetools table spellchecker configurepermanentpen",r=(n=t).ui.registry.getAll().contextMenus,ft(n.settings,e).map(pB).getOrThunk(function(){return V(pB(o),function(t){return lt(r,t)})});var n,e,o,r},bB=function(t){return k(t)?"|"===t:"separator"===t.type},yB={type:"separator"},xB=function(n){if(k(n))return n;switch(n.type){case"separator":return yB;case"submenu":return{type:"nestedmenuitem",text:n.text,icon:n.icon,getSubmenuItems:function(){var t=n.getSubmenuItems();return k(t)?t:A(t,xB)}};default:return{type:"menuitem",text:n.text,icon:n.icon,onAction:t(n.onAction)}}},wB=function(t,n){if(0===n.length)return t;var e=$(t).filter(function(t){return!bB(t)}).fold(function(){return[]},function(t){return[yB]});return t.concat(e).concat(n).concat([yB])},SB=function(d,t,m){var g=Du(xg.sketch({dom:{tag:"div"},lazySink:t,onEscape:function(){return d.focus()},fireDismissalEventInstead:{},inlineBehaviours:ra([ig("dismissContextMenu",[ci(Gn(),function(t,n){Gs.close(t),d.focus()})])])}));d.on("init",function(){d.on("contextmenu",function(n){if(t=d,!n.ctrlKey||hB(t)){var t,e,r,i,o,u=2!==n.button||n.target===d.getBody(),a=u?(e=d,{anchor:"node",node:et.some(Zn.fromDom(e.selection.getNode())),root:Zn.fromDom(e.getBody())}):mB(d,n),c=d.ui.registry.getAll(),s=vB(d),f=u?d.selection.getStart(!0):n.target,l=(r=c.contextMenus,i=f,0<(o=U(s,function(t,n){if(lt(r,n)){var e=r[n].update(i);if(k(e))return wB(t,e.split(" "));if(0<e.length){var o=A(e,xB);return wB(t,o)}return t}return t.concat([n])},[])).length&&bB(o[o.length-1])&&o.pop(),o);ey(l,Kp.CLOSE_ON_EXECUTE,m).map(function(t){n.preventDefault(),xg.showMenuAt(g,a,{menu:{markers:Kh("normal")},data:t})})}})})},kB=function(t){return/^[0-9\.]+(|px)$/i.test(""+t)?et.some(parseInt(t,10)):et.none()},CB=function(t){return _(t)?t+"px":t},OB="data-initial-z-index",EB=function(t,n){var e;t.getSystem().addToGui(n),ye((e=n).element()).each(function(n){pu(n,"z-index").each(function(t){ze(n,OB,t)}),fu(n,"z-index",mu(e.element(),"z-index"))})},TB=function(t){ye(t.element()).each(function(t){var n=je(t,OB);Ue(t,OB)?fu(t,"z-index",n):vu(t,"z-index"),We(t,OB)}),t.getSystem().removeFromGui(t)},BB=function(t,n,e,o){return(r=t,i=n,u=r.element(),a=parseInt(je(u,i.leftAttr),10),c=parseInt(je(u,i.topAttr),10),isNaN(a)||isNaN(c)?et.none():et.some(pa(a,c))).fold(function(){return e},function(t){return QT(t.left()+o.left(),t.top()+o.top())});var r,i,u,a,c},AB=function(t,n,e,o,r,i){var u,a,c,s=BB(t,n,e,o),f=_B(t,n,s,r,i),l=XT(s,r,i);return u=n,a=l,c=t.element(),ze(c,u.leftAttr,a.left()+"px"),ze(c,u.topAttr,a.top()+"px"),f.fold(function(){return{coord:QT(l.left(),l.top()),extra:et.none()}},function(t){return{coord:t.output(),extra:t.extra()}})},DB=function(t,n){var e,o;e=n,o=t.element(),We(o,e.leftAttr),We(o,e.topAttr)},_B=function(t,n,p,h,v){var e=n.getSnapPoints(t);return Ft(e,function(t){var n,e,o,r,i,u,a,c,s,f,l,d,m,g=t.sensor();return n=p,e=g,o=t.range().left(),r=t.range().top(),a=YT(n,i=h,u=v),c=YT(e,i,u),Math.abs(a.left()-c.left())<=o&&Math.abs(a.top()-c.top())<=r?et.some({output:nt((s=t.output(),f=p,l=h,d=v,m=function(o,r){return function(t,n){var e=o(f,l,d);return r(t.getOr(e.left()),n.getOr(e.top()))}},s.fold(m(qT,jT.offset),m(YT,jT.absolute),m(XT,jT.fixed)))),extra:t.extra}):et.none()})},MB=function(e,t,i,u,a,c){return t.fold(function(){var t,e,o,n=(t=i,e=c.left(),o=c.top(),t.fold(function(t,n){return jT.offset(t+e,n+o)},function(t,n){return jT.absolute(t+e,n+o)},function(t,n){return jT.fixed(t+e,n+o)})),r=XT(n,u,a);return QT(r.left(),r.top())},function(n){var t=AB(e,n,i,c,u,a);return t.extra.each(function(t){n.onSensor(e,t)}),t.coord})},FB=function(t,n,e){var o,r=n.getTarget(t.element());if(n.repositionTarget){var i=ve(t.element()),u=ya(i),a=LT(r,u),c=pu(o=r,"left").bind(function(e){return pu(o,"top").bind(function(n){return pu(o,"position").map(function(t){return("fixed"===t?QT:JT)(parseInt(e,10),parseInt(n,10))})})}).getOrThunk(function(){var t=va(o);return $T(t.left(),t.top())}),s=MB(t,n.snaps,c,u,a,e),f=KT(s,0,a);lu(r,f)}n.onDrag(t,r,e)},IB=Dr("snaps",[vr("getSnapPoints"),Xu("onSensor"),vr("leftAttr"),vr("topAttr"),_r("lazyViewport",function(){var t=ya();return{x:t.left,y:t.top,width:nt(x.window.innerWidth),height:nt(x.window.innerHeight),bottom:nt(t.top()+x.window.innerHeight),right:nt(t.left()+x.window.innerWidth)}})]),VB=/* */Object.freeze({getData:function(t){return et.from(pa(t.x(),t.y()))},getDelta:function(t,n){return pa(n.left()-t.left(),n.top()-t.top())}}),RB=[_r("useFixed",!1),vr("blockerClass"),_r("getTarget",d),_r("onDrag",tt),_r("repositionTarget",!0),Xu("onDrop"),IB,Ju("dragger",{handlers:function(a,c){return ri([ci(zt(),function(n,t){if(0===t.event().raw().button){t.stop();var e,o={drop:function(){i()},delayDrop:function(){u.schedule()},forceDrop:function(){i()},move:function(t){u.cancel(),c.update(VB,t).each(function(t){FB(n,a,t)})}},r=n.getSystem().build(Uv.sketch({dom:{styles:{left:"0px",top:"0px",width:"100%",height:"100%",position:"fixed","z-index":"1000000000000000"},classes:[a.blockerClass]},events:(e=o,ri([ci(zt(),e.forceDrop),ci(Ut(),e.drop),ci(Lt(),function(t,n){e.move(n.event())}),ci(jt(),e.delayDrop)]))})),i=function(){TB(r),a.snaps.each(function(t){DB(n,t)});var t=a.getTarget(n.element());a.onDrop(n,t)},u=Ov(i,200);c.reset(),EB(n,r)}})])}})],HB=/* */Object.freeze({getData:function(t){var n,e=t.raw().touches;return 1===e.length?(n=e[0],et.some(pa(n.clientX,n.clientY))):et.none()},getDelta:function(t,n){return pa(n.left()-t.left(),n.top()-t.top())}}),NB=RB,PB=[_r("useFixed",!1),_r("getTarget",d),_r("onDrag",tt),_r("repositionTarget",!0),_r("onDrop",tt),IB,Ju("dragger",{handlers:function(o,r){return ri([pi(Ht()),ci(Nt(),function(n,t){t.stop(),r.update(HB,t.event()).each(function(t){FB(n,o,t)})}),ci(Pt(),function(n,t){o.snaps.each(function(t){DB(n,t)});var e=o.getTarget(n.element());r.reset(),o.onDrop(n,e)})])}})],zB=/* */Object.freeze({mouse:NB,touch:PB}),LB=/* */Object.freeze({init:function(){var i=et.none(),t=nt({});return zi({readState:t,reset:function(){i=et.none()},update:function(r,t){return r.getData(t).bind(function(t){return n=r,e=t,o=i.map(function(t){return n.getDelta(t,e)}),i=et.some(e),o;var n,e,o})}})}}),jB=ca({branchKey:"mode",branches:zB,name:"dragging",active:{events:function(t,n){return t.dragger.handlers(t,n)}},extra:{snap:oe(["sensor","range","output"],["extra"])},state:LB});(NE=HE||(HE={}))[NE.None=0]="None",NE[NE.Both=1]="Both",NE[NE.Vertical=2]="Vertical";var UB,WB,GB,XB,YB,qB,KB=function(t,n,e,o){var r=t+n,i=e.filter(function(t){return r<t}),u=o.filter(function(t){return t<r});return i.or(u).getOr(r)},JB=function(t,n,e,o,r){var i,u,a={};return a.height=KB(o,n.top(),qv(t),(i=t,et.from(i.getParam("max_height")).filter(_))),e===HE.Both&&(a.width=KB(r,n.left(),Yv(t),(u=t,et.from(u.getParam("max_width")).filter(_)))),a},$B=function(t){if(1===t.nodeType){if("BR"===t.nodeName||t.getAttribute("data-mce-bogus"))return!0;if("bookmark"===t.getAttribute("data-mce-type"))return!0}return!1},QB=function(i,u){return u.delimiter||(u.delimiter="\xbb"),{dom:{tag:"div",classes:["tox-statusbar__path"],attributes:{role:"navigation"}},behaviours:ra([vm.config({mode:"flow",selector:"div[role=button]"}),hy.config({}),Sm.config({}),ig("elementPathEvents",[vi(function(r,t){i.shortcuts.add("alt+F11","focus statusbar elementpath",function(){return vm.focusIn(r)}),i.on("NodeChange",function(t){var n,o,e=function(t){for(var n=[],e=t.length;0<e--;){var o=t[e];if(1===o.nodeType&&!$B(o)){var r=i.fire("ResolveName",{name:o.nodeName.toLowerCase(),target:o});if(r.isDefaultPrevented()||n.push({name:r.name,element:o}),r.isPropagationStopped())break}}return n}(t.parents);0<e.length&&Sm.set(r,(n=A(e||[],function(n,t){return Sg.sketch({dom:{tag:"div",classes:["tox-statusbar__path-item"],attributes:{role:"button","data-index":t,"tab-index":-1,"aria-level":t+1},innerHtml:n.name},action:function(t){i.focus(),i.selection.select(n.element),i.nodeChanged()}})}),o={dom:{tag:"div",classes:["tox-statusbar__path-divider"],attributes:{"aria-hidden":!0},innerHtml:" "+u.delimiter+" "}},U(n.slice(1),function(t,n){var e=t;return e.push(o),e.push(n),e},[n[0]])))})})])]),components:[]}},ZB=function(s,t){var n,e,o,r,i,u,a,c,f,l,d,m=function(c){return{dom:{tag:"div",classes:["tox-statusbar__resize-handle"],attributes:{title:t.translate("Resize")},innerHtml:Og("resize-handle",t.icons)},behaviours:ra([jB.config({mode:"mouse",repositionTarget:!1,onDrag:function(t,n,e){var o,r,i,u,a;o=s,r=e,i=c,u=Zn.fromDom(o.getContainer()),a=JB(o,r,i,Oa(u),Sa(u)),rt(a,function(t,n){return fu(u,n,CB(t))}),aT(o)},blockerClass:"tox-blocker"})])}};return{dom:{tag:"div",classes:["tox-statusbar"]},components:(d=[],s.getParam("elementpath",!0,"boolean")&&d.push(QB(s,{})),xn(s.settings.plugins,"wordcount")&&d.push((u=s,a=t,f=function(t,n,e){return Sm.set(t,[Tu(a.translate(["{0} "+e,n[e]]))])},Sg.sketch({dom:{tag:"button",classes:["tox-statusbar__wordcount"]},components:[],buttonBehaviours:ra([hy.config({}),Sm.config({}),Vm.config({store:{mode:"memory",initialValue:{mode:"words",count:{words:0,characters:0}}}}),ig("wordcount-events",[ci(Rn(),function(t){var n=Vm.getValue(t),e="words"===n.mode?"characters":"words";Vm.setValue(t,{mode:e,count:n.count}),f(t,n.count,e)}),vi(function(e){u.on("wordCountUpdate",function(t){var n=Vm.getValue(e).mode;Vm.setValue(e,{mode:n,count:t.wordCount}),f(e,t.wordCount,n)})})])]),eventOrder:(c={},c[Rn()]=["wordcount-events","alloy.base.behaviour"],c)}))),s.getParam("branding",!0,"boolean")&&d.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="'+(l=ap.translate(["Powered by {0}","Tiny"]))+'">'+l+"</a>"}}),r=0<d.length?[{dom:{tag:"div",classes:["tox-statusbar__text-container"]},components:d}]:[],e=!xn((n=s).settings.plugins,"autoresize"),i=!1===(o=n.getParam("resize",e))?HE.None:"both"===o?HE.Both:HE.Vertical,i!==HE.None&&r.push(m(i)),r)}},tA=function(b){var t,n,e=b.getParam("inline",!1,"boolean"),y=e?fB:zT,o=et.none(),r=Tn.detect().browser.isIE()?["tox-platform-ie"]:[],i=ap.isRtl()?{attributes:{dir:"rtl"}}:{},x=Du({dom:uo({tag:"div",classes:["tox","tox-silver-sink","tox-tinymce-aux"].concat(r)},i),behaviours:ra([Es.config({useFixed:!1})])}),u=kg({dom:{tag:"div",classes:["tox-anchorbar"]}}),a=function(){return o.bind(function(t){return _T.getMoreButton(t)}).getOrDie("Could not find more button element")},w=function(){return o.bind(function(t){return _T.getThrobber(t)}).getOrDie("Could not find throbber element")},S=_C(x,b,function(){return o.bind(function(t){return u.getOpt(t)}).getOrDie("Could not find a anchor bar element")},a),k=function(){return vt.value(x)},c=_T.parts().menubar({dom:{tag:"div",classes:["tox-menubar"]},backstage:S,onEscape:function(){b.focus()}}),s=_T.parts().toolbar({dom:{tag:"div",classes:["tox-toolbar"]},getSink:k,backstage:S,onEscape:function(){b.focus()},split:Qv(b),lazyToolbar:function(){return o.bind(function(t){return _T.getToolbar(t)}).getOrDie("Could not find more toolbar element")},lazyMoreButton:a}),f=_T.parts().socket({dom:{tag:"div",classes:["tox-edit-area"]}}),l=_T.parts().sidebar({dom:{tag:"div",classes:["tox-sidebar"]}}),d=_T.parts().throbber({dom:{tag:"div",classes:["tox-throbber"]},backstage:S}),m=b.getParam("statusbar",!0,"boolean")&&!e?et.some(ZB(b,S.shared.providers)):et.none(),g={dom:{tag:"div",classes:["tox-sidebar-wrap"]},components:[f,l]},p=(n=(t=b).getParam("toolbar"),(D(n)?0<n.length:!1!==t.getParam("toolbar",!0,"boolean"))||Kv(b).isSome()),h=!1!==b.getParam("menubar",!0,"boolean"),v=L([h?[c]:[],p?[s]:[],tb(b)?[]:[u.asSpec()],e?[]:[g]]),C=L([[{dom:{tag:"div",classes:["tox-editor-container"]},components:v}],e?[]:m.toArray(),[d]]),O=uo({role:"application"},ap.isRtl()?{dir:"rtl"}:{}),E=Du(_T.sketch({dom:{tag:"div",classes:["tox","tox-tinymce"].concat(e?["tox-tinymce-inline"]:[]).concat(r),styles:{visibility:"hidden"},attributes:O},components:C,behaviours:ra(y.getBehaviours(b).concat([vm.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"})]))}));o=et.some(E),b.shortcuts.add("alt+F9","focus menubar",function(){_T.focusMenubar(E)}),b.shortcuts.add("alt+F10","focus toolbar",function(){_T.focusToolbar(E)});var T=Wv(E),B=Wv(x);iT(b,T,B);var A=function(t){var n,e=Gv.DOM,o=b.getParam("width",e.getStyle(t,"width")),r=(n=b).getParam("height",Math.max(n.getElement().offsetHeight,200)),i=Yv(b),u=qv(b),a=kB(o).bind(function(n){return CB(i.map(function(t){return Math.max(n,t)}))}).getOr(CB(o)),c=kB(r).bind(function(n){return u.map(function(t){return Math.max(n,t)})}).getOr(r),s=CB(a);if(hu("div","width",s)&&fu(E.element(),"width",s),!b.inline){var f=CB(c);hu("div","height",f)?fu(E.element(),"height",f):fu(E.element(),"height","200px")}return c};return{mothership:T,uiMothership:B,backstage:S,renderUI:function(){var o,r,e,n,i,u,a,c;SB(b,k,S),r=(o=b).ui.registry.getAll().sidebars,M(Z(r),function(n){var t=r[n],e=function(){return et.from(o.queryCommandValue("ToggleSidebar")).is(n)};o.ui.registry.addToggleButton(n,{icon:t.icon,tooltip:t.tooltip,onAction:function(t){o.execCommand("ToggleSidebar",!1,n),t.setActive(e())},onSetup:function(t){var n=function(){return t.setActive(e())};return o.on("ToggleSidebar",n),function(){o.off("ToggleSidebar",n)}}})}),e=b,n=w,i=S.shared,u=_t(!1),a=_t(et.none()),c=function(t){t!==u.get()&&(OT(n(),t,i.providers),u.set(t))},e.on("ProgressState",function(t){if(a.get().each(Bg.clearTimeout),_(t.time)){var n=Bg.setEditorTimeout(e,function(){return c(t.state)},t.time);a.set(et.some(n))}else c(t.state),a.set(et.none())});var t=b.ui.registry.getAll(),s=t.buttons,f=t.menuItems,l=t.contextToolbars,d=t.sidebars,m={menuItems:f,buttons:s,menus:b.settings.menu?it(b.settings.menu,function(t){return St(t,{items:t.items})}):{},menubar:b.settings.menubar,toolbar:Kv(b).getOr(b.getParam("toolbar",!0)),sidebar:d};rT(b,l,x,{backstage:S});var g=b.getElement(),p=A(g),h={mothership:T,uiMothership:B,outerContainer:E},v={targetNode:g,height:p};return y.render(b,h,m,S,v)},getUi:function(){return{channels:{broadcastAll:B.broadcast,broadcastOn:B.broadcastOn,register:function(){}}}}}},nA=function(n){ck.each([{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){n.ui.registry.addToggleButton(t.name,{tooltip:t.text,onAction:function(){return n.execCommand(t.cmd)},icon:t.icon,onSetup:FE(n,t.name)})});var t="alignnone",e="No alignment",o="JustifyNone",r="align-none";n.ui.registry.addButton(t,{tooltip:e,onAction:function(){return n.execCommand(o)},icon:r})},eA=function(t,n){return function(){t.execCommand("mceToggleFormat",!1,n)}},oA=function(t){var n,e;!function(e){ck.each([{name:"bold",text:"Bold",icon:"bold"},{name:"italic",text:"Italic",icon:"italic"},{name:"underline",text:"Underline",icon:"underline"},{name:"strikethrough",text:"Strikethrough",icon:"strike-through"},{name:"subscript",text:"Subscript",icon:"subscript"},{name:"superscript",text:"Superscript",icon:"superscript"}],function(t,n){e.ui.registry.addToggleButton(t.name,{tooltip:t.text,icon:t.icon,onSetup:FE(e,t.name),onAction:eA(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:FE(e,n),onAction:eA(e,n)})}}(t),n=t,ck.each([{name:"cut",text:"Cut",action:"Cut",icon:"cut"},{name:"copy",text:"Copy",action:"Copy",icon:"copy"},{name:"paste",text:"Paste",action:"Paste",icon:"paste"},{name:"help",text:"Help",action:"mceHelp",icon:"help"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all"},{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document"},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting"},{name:"remove",text:"Remove",action:"Delete",icon:"remove"}],function(t){n.ui.registry.addButton(t.name,{tooltip:t.text,icon:t.icon,onAction:function(){return n.execCommand(t.action)}})}),e=t,ck.each([{name:"blockquote",text:"Blockquote",action:"mceBlockQuote",icon:"quote"}],function(t){e.ui.registry.addToggleButton(t.name,{tooltip:t.text,icon:t.icon,onAction:function(){return e.execCommand(t.action)},onSetup:FE(e,t.name)})})},rA=function(t){var n;oA(t),n=t,ck.each([{name:"bold",text:"Bold",action:"Bold",icon:"bold",shortcut:"Meta+B"},{name:"italic",text:"Italic",action:"Italic",icon:"italic",shortcut:"Meta+I"},{name:"underline",text:"Underline",action:"Underline",icon:"underline",shortcut:"Meta+U"},{name:"strikethrough",text:"Strikethrough",action:"Strikethrough",icon:"strike-through",shortcut:""},{name:"subscript",text:"Subscript",action:"Subscript",icon:"subscript",shortcut:""},{name:"superscript",text:"Superscript",action:"Superscript",icon:"superscript",shortcut:""},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting",shortcut:""},{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document",shortcut:""},{name:"cut",text:"Cut",action:"Cut",icon:"cut",shortcut:"Meta+X"},{name:"copy",text:"Copy",action:"Copy",icon:"copy",shortcut:"Meta+C"},{name:"paste",text:"Paste",action:"Paste",icon:"paste",shortcut:"Meta+V"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all",shortcut:"Meta+A"}],function(t){n.ui.registry.addMenuItem(t.name,{text:t.text,icon:t.icon,shortcut:t.shortcut,onAction:function(){return n.execCommand(t.action)}})}),n.ui.registry.addMenuItem("codeformat",{text:"Code",icon:"sourcecode",onAction:eA(n,"code")})},iA=function(t,n,e){var o=function(){return!!n.undoManager&&n.undoManager[e]()},r=function(){t.setDisabled(n.readonly||!o())};return t.setDisabled(!o()),n.on("Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",r),function(){return n.off("Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",r)}},uA=function(t){var n,e;(n=t).ui.registry.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onSetup:function(t){return iA(t,n,"hasUndo")},onAction:function(){return n.execCommand("undo")}}),n.ui.registry.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onSetup:function(t){return iA(t,n,"hasRedo")},onAction:function(){return n.execCommand("redo")}}),(e=t).ui.registry.addButton("undo",{tooltip:"Undo",icon:"undo",onSetup:function(t){return iA(t,e,"hasUndo")},onAction:function(){return e.execCommand("undo")}}),e.ui.registry.addButton("redo",{tooltip:"Redo",icon:"redo",onSetup:function(t){return iA(t,e,"hasRedo")},onAction:function(){return e.execCommand("redo")}})},aA=function(t){var n,e;(n=t).ui.registry.addButton("visualaid",{tooltip:"Visual aids",text:"Visual aids",onAction:function(){return n.execCommand("mceToggleVisualAid")}}),(e=t).ui.registry.addToggleMenuItem("visualaid",{text:"Visual aids",onSetup:function(t){return function(n,t){n.setActive(t.hasVisual);var e=function(t){n.setActive(t.hasVisual)};return t.on("VisualAid",e),function(){return t.off("VisualAid",e)}}(t,e)},onAction:function(){e.execCommand("mceToggleVisualAid")}})},cA=function(t){var n;(n=t).ui.registry.addButton("outdent",{tooltip:"Decrease indent",icon:"outdent",onSetup:function(t){return function(t,n){t.setDisabled(!n.queryCommandState("outdent"));var e=function(){t.setDisabled(!n.queryCommandState("outdent"))};return n.on("NodeChange",e),function(){return n.off("NodeChange",e)}}(t,n)},onAction:function(){return n.execCommand("outdent")}}),n.ui.registry.addButton("indent",{tooltip:"Increase indent",icon:"indent",onAction:function(){return n.execCommand("indent")}})},sA=function(t,n){var e,o,r,i,u,a,c,s,f,l,d,m,g,p,h,v,b,y,x,w;o=n,r=LE(e=t),i=VE(0,o,r.dataset,r),e.ui.registry.addNestedMenuItem("align",{text:o.shared.providers.translate("Align"),getSubmenuItems:function(){return i.items.validateItems(i.getStyleItems())}}),a=n,c=UE(u=t),s=VE(0,a,c.dataset,c),u.ui.registry.addNestedMenuItem("fontformats",{text:a.shared.providers.translate("Fonts"),getSubmenuItems:function(){return s.items.validateItems(s.getStyleItems())}}),f=t,d=(l=n).styleselect,m=VE(0,l,d,KE(f)),f.ui.registry.addNestedMenuItem("formats",{text:"Formats",getSubmenuItems:function(){return m.items.validateItems(m.getStyleItems())}}),p=n,h=qE(g=t),v=VE(0,p,h.dataset,h),g.ui.registry.addNestedMenuItem("blockformats",{text:"Blocks",getSubmenuItems:function(){return v.items.validateItems(v.getStyleItems())}}),y=n,x=GE(b=t),w=VE(0,y,x.dataset,x),b.ui.registry.addNestedMenuItem("fontsizes",{text:"Font sizes",getSubmenuItems:function(){return w.items.validateItems(w.getStyleItems())}})},fA=function(t,n){nA(t),rA(t),sA(t,n),uA(t),Gh.register(t),aA(t),cA(t)},lA=function(t,n){var e=et.from(je(t,"id")).fold(function(){var t=ro("dialog-label");return ze(n,"id",t),t},d);ze(t,"aria-labelledby",e)},dA=nt([vr("lazySink"),Or("dragBlockClass"),_r("useTabstopAt",nt(!0)),_r("eventOrder",{}),$s("modalBehaviours",[vm]),Yu("onExecute"),Ku("onEscape")]),mA={sketch:d},gA=nt([_f({name:"draghandle",overrides:function(t,n){return{behaviours:ra([jB.config({mode:"mouse",getTarget:function(t){return Fu(t,'[role="dialog"]').getOr(t)},blockerClass:t.dragBlockClass.getOrDie(new Error("The drag blocker class was not specified for a dialog with a drag handle: \n"+Vo(n,null,2)).message)})])}}}),Af({schema:[vr("dom")],name:"title"}),Af({factory:mA,schema:[vr("dom")],name:"close"}),Af({factory:mA,schema:[vr("dom")],name:"body"}),_f({factory:mA,schema:[vr("dom")],name:"footer"}),Df({factory:{sketch:function(t,n){return uo({},t,{dom:n.dom,components:n.components})}},schema:[_r("dom",{tag:"div",styles:{position:"fixed",left:"0px",top:"0px",right:"0px",bottom:"0px"}}),_r("components",[])],name:"blocker"})]),pA=al({name:"ModalDialog",configFields:dA(),partFields:gA(),factory:function(r,t,n,o){var a=ro("alloy.dialog.busy"),c=ro("alloy.dialog.idle"),s=ra([vm.config({mode:"special",onTab:function(){return et.some(!0)},onShiftTab:function(){return et.some(!0)}}),zm.config({})]),e=ro("modal-events"),i=uo({},r.eventOrder,{"alloy.system.attached":[e].concat(r.eventOrder["alloy.system.attached"]||[])});return{uid:r.uid,dom:r.dom,components:t,apis:{show:function(i){var t=r.lazySink(i).getOrDie(),u=_t(et.none()),n=o.blocker(),e=t.getSystem().build(uo({},n,{components:n.components.concat([_u(i)]),behaviours:ra([ig("dialog-blocker-events",[ci(c,function(t,n){Ue(i.element(),"aria-busy")&&(We(i.element(),"aria-busy"),u.get().each(function(t){return Sm.remove(i,t)}))}),ci(a,function(t,n){ze(i.element(),"aria-busy","true");var e=n.event().getBusySpec();u.get().each(function(t){Sm.remove(i,t)});var o=e(i,s),r=t.getSystem().build(o);u.set(et.some(r)),Sm.append(i,_u(r)),r.hasConfigured(vm)&&vm.focusIn(r)})])])}));As(t,e),vm.focusIn(i)},hide:function(n){ye(n.element()).each(function(t){n.getSystem().getByDom(t).each(function(t){Ms(t)})})},getBody:function(t){return Wf(t,r,"body")},getFooter:function(t){return Wf(t,r,"footer")},setIdle:function(t){Ur(t,c)},setBusy:function(t,n){Wr(t,a,{getBusySpec:n})}},eventOrder:i,domModification:{attributes:{role:"dialog","aria-modal":"true"}},behaviours:Zs(r.modalBehaviours,[Sm.config({}),vm.config({mode:"cyclic",onEnter:r.onExecute,onEscape:r.onEscape,useTabstopAt:r.useTabstopAt}),ig(e,[vi(function(t){var n,e,o;lA(t.element(),Wf(t,r,"title").element()),n=t.element(),e=Wf(t,r,"body").element(),o=et.from(je(n,"id")).fold(function(){var t=ro("dialog-describe");return ze(e,"id",t),t},d),ze(n,"aria-describedby",o)})])])}},apis:{show:function(t,n){t.show(n)},hide:function(t,n){t.hide(n)},getBody:function(t,n){return t.getBody(n)},getFooter:function(t,n){return t.getFooter(n)},setBusy:function(t,n,e){t.setBusy(n,e)},setIdle:function(t,n){t.setIdle(n)}}}),hA=[yr("type"),yr("text"),xr("level",["info","warn","error","success"]),yr("icon"),_r("url","")],vA=[yr("type"),yr("text"),Rr("primary",!1),Jo("name","name",po(function(){return ro("button-name")}),mr),Br("icon")],bA=[yr("type"),yr("name"),yr("label")],yA=gr,xA=[yr("type"),yr("name"),Br("label")],wA=xA,SA=mr,kA=xA,CA=mr,OA=xA,EA=nr(),TA=xA.concat([Rr("sandboxed",!0)]),BA=mr,AA=xA.concat([Br("placeholder")]),DA=mr,_A=xA.concat([kr("items",[yr("text"),yr("value")]),Fr("size",1)]),MA=mr,FA=xA.concat([Rr("constrain",!0)]),IA=Wo([yr("width"),yr("height")]),VA=xA.concat([Br("placeholder")]),RA=mr,HA=xA.concat([Vr("filetype","file",["image","media","file"])]),NA=Wo([yr("value"),_r("meta",{})]),PA=xA.concat([yr("type"),Ir("tag","textarea"),wr("init")]),zA=mr,LA=[yr("type"),yr("html"),Vr("presets","presentation",["presentation","document"])],jA=xA.concat([br("currentState",Wo([vr("blob"),yr("url")]))]),UA=xA.concat([_r("columns","auto")]),WA=tr([yr("value"),yr("text"),yr("icon")]),GA=[yr("type"),Cr("header",mr),Cr("cells",Go(mr))],XA=function(n){return Jo("items","items",mo(),Go(er(function(t){return ir("Checking item of "+n,YA,t).fold(function(t){return vt.error(cr(t))},function(t){return vt.value(t)})})))},YA=sr("type",{alertbanner:hA,bar:(XB=XA("bar"),[yr("type"),XB]),button:vA,checkbox:bA,colorinput:wA,colorpicker:kA,dropzone:OA,grid:(WB=XA("grid"),[yr("type"),(GB="columns",br(GB,dr)),WB]),iframe:TA,input:AA,selectbox:_A,sizeinput:FA,textarea:VA,urlinput:HA,customeditor:PA,htmlpanel:LA,imagetools:jA,collection:UA,label:(UB=XA("label"),[yr("type"),yr("label"),UB]),table:GA}),qA=[yr("type"),Cr("items",YA)],KA=[yr("title"),Cr("items",YA)],JA=[yr("type"),kr("tabs",KA)],$A=[Jo("name","name",po(function(){return ro("button-name")}),mr),yr("text"),Br("icon"),Vr("align","end",["start","end"]),Rr("primary",!1),Rr("disabled",!1)],QA=Wo([xr("type",["submit","cancel","custom"])].concat($A)),ZA=Wo([yr("title"),br("body",sr("type",{panel:qA,tabpanel:JA})),Ir("size","normal"),Cr("buttons",QA),_r("initialData",{}),Hr("onAction",tt),Hr("onChange",tt),Hr("onSubmit",tt),Hr("onClose",tt),Hr("onCancel",tt),_r("onTabChange",tt)]),tD=function(t){return C(t)?[t].concat(j(st(t),tD)):D(t)?j(t,tD):[]},nD=function(t){return k(t.type)&&k(t.name)},eD={checkbox:yA,colorinput:SA,colorpicker:CA,dropzone:EA,input:DA,iframe:BA,sizeinput:IA,selectbox:MA,size:IA,textarea:RA,urlinput:NA,customeditor:zA,collection:WA},oD=function(t){var n=j(V(tD(t),nD),function(n){return(t=n,et.from(eD[t.type])).fold(function(){return[]},function(t){return[br(n.name,t)]});var t});return Wo(n)},rD=Wo([xr("type",["cancel","custom"])].concat($A)),iD=Wo([yr("title"),yr("url"),Tr("height"),Tr("width"),(YB="buttons",qB=rD,Er(YB,Go(qB))),Hr("onAction",tt),Hr("onCancel",tt),Hr("onClose",tt),Hr("onMessage",tt)]),uD=function(t){return{internalDialog:ur(ir("dialog",ZA,t)),dataValidator:oD(t),initialData:t.initialData}},aD={open:function(t,n){var e=uD(n);return t(e.internalDialog,e.initialData,e.dataValidator)},openUrl:function(t,n){return t(ur(ir("dialog",iD,n)))},redial:function(t){return uD(t)}},cD=function(t){var e=[],o={};return rt(t,function(t,n){t.fold(function(){e.push(n)},function(t){o[n]=t})}),0<e.length?vt.error(e):vt.value(o)},sD=ul({name:"TabButton",configFields:[_r("uid",undefined),vr("value"),Jo("dom","dom",ho(function(t){return{attributes:{role:"tab",id:ro("aria"),"aria-selected":"false"}}}),fr()),Or("action"),_r("domModification",{}),$s("tabButtonBehaviours",[zm,vm,Vm]),vr("view")],factory:function(t,n){return{uid:t.uid,dom:t.dom,components:t.components,events:wg(t.action),behaviours:Zs(t.tabButtonBehaviours,[zm.config({}),vm.config({mode:"execution",useSpace:!0,useEnter:!0}),Vm.config({store:{mode:"memory",initialValue:t.value}})]),domModification:t.domModification}}}),fD=nt([vr("tabs"),vr("dom"),_r("clickToDismiss",!1),$s("tabbarBehaviours",[Cl,vm]),Wu(["tabClass","selectedClass"])]),lD=Mf({factory:sD,name:"tabs",unit:"tab",overrides:function(o,t){var r=function(t,n){Cl.dehighlight(t,n),Wr(t,Kn(),{tabbar:t,button:n})},i=function(t,n){Cl.highlight(t,n),Wr(t,qn(),{tabbar:t,button:n})};return{action:function(t){var n=t.getSystem().getByUid(o.uid).getOrDie(),e=Cl.isHighlighted(n,t);(e&&o.clickToDismiss?r:e?tt:i)(n,t)},domModification:{classes:[o.markers.tabClass]}}}}),dD=nt([lD]),mD=al({name:"Tabbar",configFields:fD(),partFields:dD(),factory:function(t,n,e,o){return{uid:t.uid,dom:t.dom,components:n,"debug.sketcher":"Tabbar",domModification:{attributes:{role:"tablist"}},behaviours:Zs(t.tabbarBehaviours,[Cl.config({highlightClass:t.markers.selectedClass,itemClass:t.markers.tabClass,onHighlight:function(t,n){ze(n.element(),"aria-selected","true")},onDehighlight:function(t,n){ze(n.element(),"aria-selected","false")}}),vm.config({mode:"flow",getInitial:function(t){return Cl.getHighlighted(t).map(function(t){return t.element()})},selector:"."+t.markers.tabClass,executeOnMove:!0})])}}}),gD=ul({name:"Tabview",configFields:[$s("tabviewBehaviours",[Sm])],factory:function(t,n){return{uid:t.uid,dom:t.dom,behaviours:Zs(t.tabviewBehaviours,[Sm.config({})]),domModification:{attributes:{role:"tabpanel"}}}}}),pD=nt([_r("selectFirst",!0),Xu("onChangeTab"),Xu("onDismissTab"),_r("tabs",[]),$s("tabSectionBehaviours",[])]),hD=Af({factory:mD,schema:[vr("dom"),Sr("markers",[vr("tabClass"),vr("selectedClass")])],name:"tabbar",defaults:function(t){return{tabs:t.tabs}}}),vD=Af({factory:gD,name:"tabview"}),bD=nt([hD,vD]),yD=al({name:"TabSection",configFields:pD(),partFields:bD(),factory:function(i,t,n,e){var o=function(t,n){Uf(t,i,"tabbar").each(function(t){n(t).each(Gr)})};return{uid:i.uid,dom:i.dom,components:t,behaviours:Qs(i.tabSectionBehaviours),events:ri(L([i.selectFirst?[vi(function(t,n){o(t,Cl.getFirst)})]:[],[ci(qn(),function(t,n){var o,r,e=n.event().button();o=e,r=Vm.getValue(o),Uf(o,i,"tabview").each(function(e){H(i.tabs,function(t){return t.value===r}).each(function(t){var n=t.view();ze(e.element(),"aria-labelledby",je(o.element(),"id")),Sm.set(e,n),i.onChangeTab(e,o,n)})})}),ci(Kn(),function(t,n){var e=n.event().button();i.onDismissTab(t,e)})]])),apis:{getViewItems:function(t){return Uf(t,i,"tabview").map(function(t){return Sm.contents(t)}).getOr([])},showTab:function(t,e){o(t,function(n){var t=Cl.getCandidates(n);return H(t,function(t){return Vm.getValue(t)===e}).filter(function(t){return!Cl.isHighlighted(n,t)})})}}}},apis:{getViewItems:function(t,n){return t.getViewItems(n)},showTab:function(t,n,e){t.showTab(n,e)}}}),xD=function(i,u,t){Fu(i,'[role="dialog"]').each(function(r){t.get().map(function(t){return fu(u,"height","0"),Math.min(t,(e=i,o=Fu(n=r,".tox-dialog-wrap").getOr(n),("fixed"===mu(o,"position")?Math.max(x.document.documentElement.clientHeight,x.window.innerHeight):Math.max(x.document.documentElement.offsetHeight,x.document.documentElement.scrollHeight))-(n.dom().getBoundingClientRect().height-e.dom().getBoundingClientRect().height)));var n,e,o}).each(function(t){fu(u,"height",t+"px")})})},wD=function(a){var c;return{smartTabHeight:(c=_t(et.none()),{extraEvents:[vi(function(t){Iu(t.element(),'[role="tabpanel"]').each(function(u){var n;fu(u,"visibility","hidden"),t.getSystem().getByDom(u).toOption().each(function(t){var o,r,i,n=(r=u,i=t,A(o=a,function(t,n){Sm.set(i,o[n].view());var e=r.dom().getBoundingClientRect();return Sm.set(i,[]),e.height})),e=J(K(n,function(t,n){return n<t?-1:t<n?1:0}));c.set(e)}),xD(t.element(),u,c),vu(u,"visibility"),n=t,J(a).each(function(t){return yD.showTab(n,t.value)}),Bg.requestAnimationFrame(function(){xD(t.element(),u,c)})})}),ci(jn(),function(n){Iu(n.element(),'[role="tabpanel"]').each(function(t){xD(n.element(),t,c)})}),ci(sb,function(r,t){Iu(r.element(),'[role="tabpanel"]').each(function(n){var t=Hl();fu(n,"visibility","hidden");var e=pu(n,"height").map(function(t){return parseInt(t,10)});vu(n,"height");var o=n.dom().getBoundingClientRect().height;e.forall(function(t){return t<o})?(c.set(et.from(o)),xD(r.element(),n,c)):e.each(function(t){fu(n,"height",t+"px")}),vu(n,"visibility"),t.each(Rl)})})],selectFirst:!1}),naiveTabHeight:{extraEvents:[],selectFirst:!0}}},SD="send-data-to-section",kD="send-data-to-view",CD=ro("update-dialog"),OD=ro("update-title"),ED=ro("update-body"),TD=ro("update-footer"),BD=ro("body-send-message"),AD=function(t,n,d,e){return{dom:{tag:"div",classes:["tox-dialog__content-js"],attributes:uo({},n.map(function(t){return{id:t}}).getOr({}),e?{"aria-live":"polite"}:{})},components:[],behaviours:ra([Bw(0),nE.config({channel:ED,updateState:function(t,n){return et.some({isTabPanel:function(){return"tabpanel"===n.body.type}})},renderComponents:function(t){switch(t.body.type){case"tabpanel":return[(r={tabs:t.body.tabs},i=d,u=_t({}),a=function(t){var n=Vm.getValue(t),e=cD(n).getOr({}),o=u.get(),r=wt(o,e);u.set(r)},c=function(t){var n=u.get();Vm.setValue(t,n)},s=_t(null),f=A(r.tabs,function(t){return{value:t.title,dom:{tag:"div",classes:["tox-dialog__body-nav-item"],innerHtml:i.shared.providers.translate(t.title)},view:function(){return[bw.sketch(function(n){return{dom:{tag:"div",classes:["tox-form"]},components:A(t.items,function(t){return Uk(n,t,i)}),formBehaviours:ra([vm.config({mode:"acyclic",useTabstopAt:S(Uw)}),ig("TabView.form.events",[vi(c),bi(a)]),da.config({channels:Bt([{key:SD,value:{onReceive:a}},{key:kD,value:{onReceive:c}}])})])}})]}}}),l=wD(f).smartTabHeight,yD.sketch({dom:{tag:"div",classes:["tox-dialog__body"]},onChangeTab:function(t,n,e){var o=Vm.getValue(n);Wr(t,cb,{title:o,oldTitle:s.get()}),s.set(o)},tabs:f,components:[yD.parts().tabbar({dom:{tag:"div",classes:["tox-dialog__body-nav"]},components:[mD.parts().tabs({})],markers:{tabClass:"tox-tab",selectedClass:"tox-dialog__body-nav-item--active"},tabbarBehaviours:ra([hy.config({})])}),yD.parts().tabview({dom:{tag:"div",classes:["tox-dialog__body-content"]}})],selectFirst:l.selectFirst,tabSectionBehaviours:ra([ig("tabpanel",l.extraEvents),vm.config({mode:"acyclic"}),ll.config({find:function(t){return J(yD.getViewItems(t))}}),Vm.config({store:{mode:"manual",getValue:function(t){return t.getSystem().broadcastOn([SD],{}),u.get()},setValue:function(t,n){u.set(n),t.getSystem().broadcastOn([kD],{})}}})])}))];default:return[(e={items:t.body.items},o=d,n=kg(bw.sketch(function(n){return{dom:{tag:"div",classes:["tox-form"]},components:A(e.items,function(t){return Uk(n,t,o)})}})),{dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[n.asSpec()]}],behaviours:ra([vm.config({mode:"acyclic",useTabstopAt:S(Uw)}),Tw(n),Iw(n,{postprocess:function(t){return cD(t).fold(function(t){return x.console.error(t),{}},function(t){return t})}})])})]}var e,o,n,r,i,u,a,c,s,f,l},initialData:t})])}},DD=function(t,e){return[mi(Gt(),Ww),t(eb,function(t,n){e.onClose(),n.onClose()}),t(ob,function(t,n,e,o){n.onCancel(t),Ur(o,eb)}),ci(ab,function(t,n){return e.onUnblock()}),ci(ub,function(t,n){return e.onBlock(n.event())})]},_D=function(i,t){var n=function(t,r){return ci(t,function(e,o){u(e,function(t,n){r(i(),t,o.event(),e)})})},u=function(n,e){nE.getState(n).get().each(function(t){e(t,n)})};return DD(n,t).concat([n(rb,function(t,n,e){n.onAction(t,{name:e.name()})})])},MD=function(i,t){var n=function(t,r){return ci(t,function(e,o){u(e,function(t,n){r(i(),t,o.event(),e)})})},u=function(n,e){nE.getState(n).get().each(function(t){e(t.internalDialog,n)})};return DD(n,t).concat([n(ib,function(t,n){return n.onSubmit(t)}),n(nb,function(t,n,e){n.onChange(t,{name:e.name()})}),n(rb,function(t,n,e){n.onAction(t,{name:e.name(),value:e.value()})}),n(cb,function(t,n,e){n.onTabChange(t,e.title())}),bi(function(t){var n=i();Vm.setValue(t,n.getData())})])},FD=function(t,n){var e=n.map(function(t){return t.footerButtons}).getOr([]),o=I(e,function(t){return"start"===t.align}),r=function(t,n){return Uv.sketch({dom:{tag:"div",classes:["tox-dialog__footer-"+t]},components:A(n,function(t){return t.memento.asSpec()})})};return[r("start",o.pass),r("end",o.fail)]},ID=function(t,i){return{dom:up('<div class="tox-dialog__footer"></div>'),components:[],behaviours:ra([nE.config({channel:TD,initialData:t,updateState:function(t,n){var r=A(n.buttons,function(t){var n,e,o=kg((e=i,US(n=t,n.type,e)));return{name:t.name,align:t.align,memento:o}});return et.some({lookupByName:function(t,n){return e=t,o=n,H(r,function(t){return t.name===o}).bind(function(t){return t.memento.getOpt(e)});var e,o},footerButtons:r})},renderComponents:FD})])}},VD=function(t,n){return pA.parts().footer(ID(t,n))},RD=function(n,e){if(n.getRoot().getSystem().isConnected()){var o=ll.getCurrent(n.getFormWrapper()).getOr(n.getFormWrapper());return bw.getField(o,e).fold(function(){var t=n.getFooter();return nE.getState(t).get().bind(function(t){return t.lookupByName(o,e)})},function(t){return et.some(t)})}return et.none()},HD=function(c,o){var t=function(t){var n=c.getRoot();n.getSystem().isConnected()&&t(n)},s={getData:function(){var t=c.getRoot(),n=t.getSystem().isConnected()?c.getFormWrapper():t;return Vm.getValue(n)},setData:function(a){t(function(t){var n,e,o=s.getData(),r=St(o,a),i=(n=r,e=c.getRoot(),nE.getState(e).get().map(function(t){return ur(ir("data",t.dataValidator,n))}).getOr(n)),u=c.getFormWrapper();Vm.setValue(u,i)})},disable:function(t){RD(c,t).each(zp.disable)},enable:function(t){RD(c,t).each(zp.enable)},focus:function(t){RD(c,t).each(zm.focus)},block:function(n){if(!k(n))throw new Error("The dialogInstanceAPI.block function should be passed a blocking message of type string as an argument");t(function(t){Wr(t,ub,{message:n})})},unblock:function(){t(function(t){Ur(t,ab)})},showTab:function(e){t(function(t){var n=c.getBody();nE.getState(n).get().exists(function(t){return t.isTabPanel()})&&ll.getCurrent(n).each(function(t){yD.showTab(t,e)})})},redial:function(e){t(function(t){var n=o(e);t.getSystem().broadcastOn([CD],n),t.getSystem().broadcastOn([OD],n.internalDialog),t.getSystem().broadcastOn([ED],n.internalDialog),t.getSystem().broadcastOn([TD],n.internalDialog),s.setData(n.initialData)})},close:function(){t(function(t){Ur(t,eb)})}};return s},ND=function(t){return Sg.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":t.translate("Close"),title:t.translate("Close")}},components:[{dom:{tag:"div",classes:["tox-icon"],innerHtml:'<svg width="24" height="24" xmlns="http://www.w3.org/2000/svg"><path d="M17.953 7.453L13.422 12l4.531 4.547-1.406 1.406L12 13.422l-4.547 4.531-1.406-1.406L10.578 12 6.047 7.453l1.406-1.406L12 10.578l4.547-4.531z" fill-rule="evenodd"></path></svg>'}}],action:function(t){Ur(t,ob)}})},PD=function(t,n,e){var o=function(t){return[Tu(e.translate(t.title))]};return{dom:{tag:"div",classes:["tox-dialog__title"],attributes:uo({},n.map(function(t){return{id:t}}).getOr({}))},components:o(t),behaviours:ra([nE.config({channel:OD,renderComponents:o})])}},zD=function(t,n){return e={title:n.shared.providers.translate(t),draggable:!0},o=n.shared.providers,r=pA.parts().title(PD(e,et.none(),o)),i=pA.parts().draghandle({dom:up('<div class="tox-dialog__draghandle"></div>')}),u=pA.parts().close(ND(o)),a=[r].concat(e.draggable?[i]:[]).concat([u]),Uv.sketch({dom:up('<div class="tox-dialog__header"></div>'),components:a});var e,o,r,i,u,a},LD=function(t,n){return{onClose:function(){return n.closeWindow()},onBlock:function(e){pA.setBusy(t(),function(t,n){return{dom:{tag:"div",classes:["tox-dialog__busy-spinner"],attributes:{"aria-label":e.message()},styles:{left:"0px",right:"0px",bottom:"0px",top:"0px",position:"absolute"}},behaviours:n,components:[{dom:up('<div class="tox-spinner"><div></div><div></div><div></div></div>')}]}})},onUnblock:function(){pA.setIdle(t())}}},jD=function(t,n,e,o){var r;return Du(pA.sketch({lazySink:o.shared.getSink,onEscape:function(t){return Ur(t,ob),et.some(!0)},useTabstopAt:function(t){return!Uw(t)&&("button"!==Fe(t)||"disabled"!==je(t,"disabled"))},modalBehaviours:ra([nE.config({channel:CD,updateState:function(t,n){return et.some(n)},initialData:n}),Hw({}),zm.config({}),ig("execute-on-form",e.concat([hi(Gt(),function(t,n){vm.focusIn(t)})])),ig("scroll-lock",[vi(function(){eu(Qr(),"tox-dialog__disable-scroll")}),bi(function(){ou(Qr(),"tox-dialog__disable-scroll")})])].concat(t.extraBehaviours)),eventOrder:(r={},r[Fn()]=["execute-on-form"],r[Mn()]=["reflecting","receiving"],r[Un()]=["scroll-lock","reflecting","messages","execute-on-form","alloy.base.behaviour"],r[Wn()]=["alloy.base.behaviour","execute-on-form","messages","reflecting","scroll-lock"],r),dom:{tag:"div",classes:["tox-dialog"].concat(t.extraClasses),styles:uo({position:"relative"},t.extraStyles)},components:[t.header,t.body].concat(t.footer.toArray()),dragBlockClass:"tox-dialog-wrap",parts:{blocker:{dom:up('<div class="tox-dialog-wrap"></div>'),components:[{dom:{tag:"div",classes:["tox-dialog-wrap__backdrop"]}}]}}}))},UD=function(t,n,e){var o,r,i,u=zD(t.internalDialog.title,e),a=(o={body:t.internalDialog.body},r=e,i=AD(o,et.none(),r,!1),pA.parts().body(i)),c=VD({buttons:t.internalDialog.buttons},e.shared.providers),s=MD(function(){return m},LD(function(){return d},n)),f="normal"!==t.internalDialog.size?"large"===t.internalDialog.size?["tox-dialog--width-lg"]:["tox-dialog--width-md"]:[],l={header:u,body:a,footer:et.some(c),extraClasses:f,extraBehaviours:[],extraStyles:{}},d=jD(l,t,s,e),m=HD({getRoot:function(){return d},getBody:function(){return pA.getBody(d)},getFooter:function(){return pA.getFooter(d)},getFormWrapper:function(){var t=pA.getBody(d);return ll.getCurrent(t).getOr(t)}},n.redial);return{dialog:d,instanceApi:m}},WD=tinymce.util.Tools.resolve("tinymce.util.URI"),GD=["insertContent","setContent","execCommand","close","block","unblock"],XD=function(t){return C(t)&&-1!==GD.indexOf(t.mceAction)},YD=function(o,t,r,n){var e,i,u,a,c=zD(o.title,n),s=(i={dom:{tag:"div",classes:["tox-dialog__content-js"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-iframe"]},components:[Gw({dom:{tag:"iframe",attributes:{src:o.url}},behaviours:ra([hy.config({}),zm.config({})])})]}],behaviours:ra([vm.config({mode:"acyclic",useTabstopAt:S(Uw)})])},pA.parts().body(i)),f=o.buttons.bind(function(t){return 0===t.length?et.none():et.some(VD({buttons:t},n.shared.providers))}),l=_D(function(){return y},LD(function(){return b},t)),d=uo({},o.height.fold(function(){return{}},function(t){return{height:t+"px","max-height":t+"px"}}),o.width.fold(function(){return{}},function(t){return{width:t+"px","max-width":t+"px"}})),m=o.width.isNone()&&o.height.isNone()?["tox-dialog--width-lg"]:[],g=new WD(o.url,{base_uri:new WD(x.window.location.href)}),p=g.protocol+"://"+g.host+(g.port?":"+g.port:""),h=_t(et.none()),v=[ig("messages",[vi(function(){var t=Sv(Zn.fromDom(x.window),"message",function(t){if(g.isSameOrigin(new WD(t.raw().origin))){var n=t.raw().data;XD(n)?function(t,n,e){switch(e.mceAction){case"insertContent":t.insertContent(e.content);break;case"setContent":t.setContent(e.content);break;case"execCommand":var o=!!O(e.ui)&&e.ui;t.execCommand(e.cmd,o,e.value);break;case"close":n.close();break;case"block":n.block(e.message);break;case"unblock":n.unblock()}}(r,y,n):!XD(e=n)&&C(e)&&lt(e,"mceAction")&&o.onMessage(y,n)}var e});h.set(et.some(t))}),bi(function(){h.get().each(function(t){return t.unbind()})})]),da.config({channels:(e={},e[BD]={onReceive:function(t,n){Iu(t.element(),"iframe").each(function(t){t.dom().contentWindow.postMessage(n,p)})}},e)})],b=jD({header:c,body:s,footer:f,extraClasses:m,extraBehaviours:v,extraStyles:d},o,l,n),y=(u=b,a=function(t){u.getSystem().isConnected()&&t(u)},{block:function(n){if(!k(n))throw new Error("The urlDialogInstanceAPI.block function should be passed a blocking message of type string as an argument");a(function(t){Wr(t,ub,{message:n})})},unblock:function(){a(function(t){Ur(t,ab)})},close:function(){a(function(t){Ur(t,eb)})},sendMessage:function(n){a(function(t){t.getSystem().broadcastOn([BD],n)})}});return{dialog:b,instanceApi:y}},qD=function(t,n,e,o){var r,i,u,a,c,s,f,l,d,m,g,p=ro("dialog-label"),h=ro("dialog-content"),v=kg((u={title:t.internalDialog.title,draggable:!0},a=p,c=e.shared.providers,Uv.sketch({dom:up('<div class="tox-dialog__header"></div>'),components:[PD(u,et.some(a),c),ND(c)],containerBehaviours:ra([jB.config({mode:"mouse",blockerClass:"blocker",getTarget:function(t){return Vu(t,'[role="dialog"]').getOrDie()},snaps:{getSnapPoints:function(){return[]},leftAttr:"data-drag-left",topAttr:"data-drag-top"}})])}))),b=kg((s={body:t.internalDialog.body},f=h,l=e,d=o,AD(s,et.some(f),l,d))),y=kg((m={buttons:t.internalDialog.buttons},g=e.shared.providers,ID(m,g))),x=MD(function(){return S},{onBlock:function(){},onUnblock:function(){},onClose:function(){return n.closeWindow()}}),w=Du({dom:{tag:"div",classes:["tox-dialog"],attributes:(r={role:"dialog"},r["aria-labelledby"]=p,r["aria-describedby"]=""+h,r)},eventOrder:(i={},i[Mn()]=[nE.name(),da.name()],i[Fn()]=["execute-on-form"],i[Un()]=["reflecting","execute-on-form"],i),behaviours:ra([vm.config({mode:"cyclic",onEscape:function(t){return Ur(t,eb),et.some(!0)},useTabstopAt:function(t){return!Uw(t)&&("button"!==Fe(t)||"disabled"!==je(t,"disabled"))}}),nE.config({channel:CD,updateState:function(t,n){return et.some(n)},initialData:t}),ig("execute-on-form",x),Hw({})]),components:[v.asSpec(),b.asSpec(),y.asSpec()]}),S=HD({getRoot:function(){return w},getFooter:function(){return y.get(w)},getBody:function(){return b.get(w)},getFormWrapper:function(){var t=b.get(w);return ll.getCurrent(t).getOr(t)}},n.redial);return{dialog:w,instanceApi:S}},KD=function(t,n){return pA.parts().close(Sg.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":n.translate("Close")}},action:t,buttonBehaviours:ra([hy.config({})])}))},JD=function(){return pA.parts().title({dom:{tag:"div",classes:["tox-dialog__title"],innerHtml:"",styles:{display:"none"}}})},$D=function(t,n){return pA.parts().body({dom:{tag:"div",classes:["tox-dialog__body","todo-tox-fit"]},components:[{dom:up("<p>"+n.translate(t)+"</p>")}]})},QD=function(t){return pA.parts().footer({dom:{tag:"div",classes:["tox-dialog__footer"]},components:t})},ZD=function(t,n){return[Uv.sketch({dom:{tag:"div",classes:["tox-dialog__footer-start"]},components:t}),Uv.sketch({dom:{tag:"div",classes:["tox-dialog__footer-end"]},components:n})]},t_=function(e){return pA.sketch({lazySink:e.lazySink,onEscape:function(){return e.onCancel(),et.some(!0)},dom:{tag:"div",classes:["tox-dialog"].concat(e.extraClasses)},components:[{dom:{tag:"div",classes:["tox-dialog__header"]},components:[e.partSpecs.title,e.partSpecs.close]},e.partSpecs.body,e.partSpecs.footer],parts:{blocker:{dom:up('<div class="tox-dialog-wrap"></div>'),components:[{dom:{tag:"div",classes:["tox-dialog-wrap__backdrop"]}}]}},modalBehaviours:ra([ig("basic-dialog-events",[ci(ob,function(t,n){e.onCancel()}),ci(ib,function(t,n){e.onSubmit()})])])})},n_=function(s){var u,a,e=(u=s.backstage.shared,{open:function(t,n){var e=function(){pA.hide(r),n()},o=kg(US({name:"close-alert",text:"OK",primary:!0,icon:et.none()},"cancel",u.providers)),r=Du(t_({lazySink:function(){return u.getSink()},partSpecs:{title:JD(),close:KD(function(){e()},u.providers),body:$D(t,u.providers),footer:QD(ZD([],[o.asSpec()]))},onCancel:function(){return e()},onSubmit:tt,extraClasses:["tox-alert-dialog"]}));pA.show(r);var i=o.get(r);zm.focus(i)}}),o=(a=s.backstage.shared,{open:function(t,n){var e=function(t){pA.hide(i),n(t)},o=kg(US({name:"yes",text:"Yes",primary:!0,icon:et.none()},"submit",a.providers)),r=US({name:"no",text:"No",primary:!0,icon:et.none()},"cancel",a.providers),i=Du(t_({lazySink:function(){return a.getSink()},partSpecs:{title:JD(),close:KD(function(){e(!1)},a.providers),body:$D(t,a.providers),footer:QD(ZD([],[r,o.asSpec()]))},onCancel:function(){return e(!1)},onSubmit:function(){return e(!0)},extraClasses:["tox-confirm-dialog"]}));pA.show(i);var u=o.get(i);zm.focus(u)}}),r=function(t,e){return aD.openUrl(function(t){var n=YD(t,{closeWindow:function(){pA.hide(n.dialog),e(n.instanceApi)}},s.editor,s.backstage);return pA.show(n.dialog),n.instanceApi},t)},i=function(t,i){return aD.open(function(t,n,e){var o=n,r=UD({dataValidator:e,initialData:o,internalDialog:t},{redial:aD.redial,closeWindow:function(){pA.hide(r.dialog),i(r.instanceApi)}},s.backstage);return pA.show(r.dialog),r.instanceApi.setData(o),r.instanceApi},t)},c=function(t,u,a,c){return aD.open(function(t,n,e){var o=ur(ir("data",e,n)),r=qD({dataValidator:e,initialData:o,internalDialog:t},{redial:aD.redial,closeWindow:function(){xg.hide(i),a(r.instanceApi)}},s.backstage,c),i=Du(xg.sketch({lazySink:s.backstage.shared.getSink,dom:{tag:"div",classes:[]},fireDismissalEventInstead:{},inlineBehaviours:ra([ig("window-manager-inline-events",[ci(Gn(),function(t,n){Ur(r.dialog,ob)})])])}));return xg.showAt(i,u,_u(r.dialog)),r.instanceApi.setData(o),vm.focusIn(r.dialog),r.instanceApi},t)};return{open:function(t,n,e){return n!==undefined&&"toolbar"===n.inline?c(t,s.backstage.shared.anchors.toolbar(),e,n.ariaAttrs):n!==undefined&&"cursor"===n.inline?c(t,s.backstage.shared.anchors.cursor(),e,n.ariaAttrs):i(t,e)},openUrl:function(t,n){return r(t,n)},alert:function(t,n){e.open(t,function(){n()})},close:function(t){t.close()},confirm:function(t,n){o.open(t,function(t){n(t)})}}};io.add("silver",function(t){var n=tA(t),e=n.mothership,o=n.uiMothership,r=n.backstage,i=n.renderUI,u=n.getUi;fA(t,r),no(ro("silver-demo"),e),no(ro("silver-ui-demo"),o),vv(t,r.shared);var a=n_({editor:t,backstage:r});return{renderUI:i,getWindowManagerImpl:nt(a),getNotificationManagerImpl:function(){return Ag(t,{backstage:r},o)},ui:u()}}),function T_(){}}(window);

Anon7 - 2022
AnonSec Team