/** * 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.1.5 (2019-12-19) */!function(v){"use strict";functionZ(){}functioni(e,o){returnfunction(){for(varn=[],t=0;t<arguments.length;t++)n[t]=arguments[t];returne(o.apply(null,n))}}functionl(n){returnn}varnn=function(n){returnfunction(){returnn}};functiond(o){for(varr=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];returnfunction(){for(varn=[],t=0;t<arguments.length;t++)n[t]=arguments[t];vare=r.concat(n);returno.apply(null,e)}}functionb(e){returnfunction(){for(varn=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return!e.apply(null,n)}}functionr(n){returnfunction(){thrownewError(n)}}varu=nn(!1),a=nn(!0),n=tinymce.util.Tools.resolve("tinymce.ThemeManager"),N=function(){return(N=Object.assign||function(n){for(vart,e=1,o=arguments.length;e<o;e++)for(varrint=arguments[e])Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);returnn}).apply(this,arguments)};functionc(n,t){vare={};for(varoinn)Object.prototype.hasOwnProperty.call(n,o)&&t.indexOf(o)<0&&(e[o]=n[o]);if(null!=n&&"function"==typeofObject.getOwnPropertySymbols){varr=0;for(o=Object.getOwnPropertySymbols(n);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(n,o[r])&&(e[o[r]]=n[o[r]])}returne}functiong(){for(varn=0,t=0,e=arguments.length;t<e;t++)n+=arguments[t].length;varo=Array(n),r=0;for(t=0;t<e;t++)for(vari=arguments[t],u=0,a=i.length;u<a;u++,r++)o[r]=i[u];returno}functiont(){returns}vare,s=(e={fold:function(n,t){returnn()},is:u,isSome:u,isNone:a,getOr:m,getOrThunk:f,getOrDie:function(n){thrownewError(n||"error: getOrDie called on none.")},getOrNull:nn(null),getOrUndefined:nn(undefined),or:m,orThunk:f,map:t,each:Z,bind:t,exists:u,forall:a,filter:t,equals:o,equals_:o,toArray:function(){return[]},toString:nn("none()")},Object.freeze&&Object.freeze(e),e);functiono(n){returnn.isNone()}functionf(n){returnn()}functionm(n){returnn}functionp(t){returnfunction(n){returnfunction(n){if(null===n)return"null";vart=typeofn;return"object"==t&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"==t&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":t}(n)===t}}functionh(n,t){if(fn(n)){for(vare=0,o=n.length;e<o;++e)if(!0!==t(n[e]))return!1;return!0}return!1}functiony(n,t){returnpn.call(n,t)}functionx(n,t){for(vare=0,o=n.length;e<o;e++){if(t(n[e],e))return!0}return!1}functionw(n,t){for(vare=[],o=0;o<n.length;o+=t){varr=gn.call(n,o,o+t);e.push(r)}returne}functionS(n,t){for(vare=n.length,o=newArray(e),r=0;r<e;r++){vari=n[r];o[r]=t(i,r)}returno}functionC(n,t){for(vare=[],o=0,r=n.length;o<r;o++){vari=n[o];t(i,o)&&e.push(i)}returne}functionk(n,t,e){returnfunction(n,t){for(vare=n.length-1;0<=e;e--){t(n[e],e)}}(n,function(n){e=t(e,n)}),e}functionO(n,t,e){returnbn(n,function(n){e=t(e,n)}),e}functionE(n,t){for(vare=0,o=n.length;e<o;e++){varr=n[e];if(t(r,e))returnon.some(r)}returnon.none()}functionT(n,t){for(vare=0,o=n.length;e<o;e++){if(t(n[e],e))returnon.some(e)}returnon.none()}functionH(n){for(vart=[],e=0,o=n.length;e<o;++e){if(!fn(n[e]))thrownewError("Arr.flatten item "+e+" was not an array, input: "+n);hn.apply(t,n[e])}returnt}functionB(n,t){vare=S(n,t);returnH(e)}functionD(n,t){for(vare=0,o=n.length;e<o;++e){if(!0!==t(n[e],e))return!1}return!0}functionA(n){vart=gn.call(n,0);returnt.reverse(),t}function_(n,t){returnC(n,function(n){return!vn(t,n)})}functionM(n){return[n]}functionF(n){return0===n.length?on.none():on.some(n[n.length-1])}functionP(n,e){returnkn(n,function(n,t){return{k:t,v:e(n,t)}})}functionI(n,t){for(vare=wn(n),o=0,r=e.length;o<r;o++){vari=e[o],u=n[i];if(t(u,i,n))returnon.some(u)}returnon.none()}functionR(n){returnOn(n,function(n){returnn})}functionV(n,t){returnEn(n,t)?on.from(n[t]):on.none()}functionz(u){returnfunction(){for(varn=newArray(arguments.length),t=0;t<n.length;t++)n[t]=arguments[t];if(0===n.length)thrownewError("Can't merge zero objects");for(vare={},o=0;o<n.length;o++){varr=n[o];for(variinr)Bn.call(r,i)&&(e[i]=u(e[i],r[i]))}returne}}functionL(e){varo,r=!1;returnfunction(){for(varn=[],t=0;t<arguments.length;t++)n[t]=arguments[t];returnr||(r=!0,o=e.apply(null,n)),o}}functionj(n){return_n.defaultedThunk(nn(n))}functionU(t){returnfunction(n){returnEn(n,t)?on.from(n[t]):on.none()}}functionW(n,t){returnU(t)(n)}functionG(n,t){vare={};returne[n]=t,e}functionX(n,t){returnfunction(n,e){varo={};returnCn(n,function(n,t){vn(e,t)||(o[t]=n)}),o}(n,t)}functionY(n,t){returnfunction(t,e){returnfunction(n){returnEn(n,t)?n[t]:e}}(n,t)}functionq(n,t){returnG(n,t)}functionK(n){returnfunction(n){vart={};returnbn(n,function(n){t[n.key]=n.value}),t}(n)}functionJ(n,t){vare=function(n){vart=[],e=[];returnbn(n,function(n){n.fold(function(n){t.push(n)},function(n){e.push(n)})}),{errors:t,values:e}}(n);return0<e.errors.length?function(n){returnan.error(H(n))}(e.errors):function(n,t){return0===n.length?an.value(t):an.value(Dn(t,An.apply(undefined,n)))}(e.values,t)}function$(n,t){returnfunction(n,t){returnEn(n,t)&&n[t]!==undefined&&null!==n[t]}(n,t)}varQ,tn,en=function(e){functionn(){returnr}functiont(n){returnn(e)}varo=nn(e),r={fold:function(n,t){returnt(e)},is:function(n){returne===n},isSome:a,isNone:u,getOr:o,getOrThunk:o,getOrDie:o,getOrNull:o,getOrUndefined:o,or:n,orThunk:n,map:function(n){returnen(n(e))},each:function(n){n(e)},bind:t,exists:t,forall:t,filter:function(n){returnn(e)?r:s},toArray:function(){return[e]},toString:function(){return"some("+e+")"},equals:function(n){returnn.is(e)},equals_:function(n,t){returnn.fold(u,function(n){returnt(e,n)})}};returnr},on={some:en,none:t,from:function(n){returnnull===n||n===undefined?s:en(n)}},rn=function(e){return{is:function(n){returne===n},isValue:a,isError:u,getOr:nn(e),getOrThunk:nn(e),getOrDie:nn(e),or:function(n){returnrn(e)},orThunk:function(n){returnrn(e)},fold:function(n,t){returnt(e)},map:function(n){returnrn(n(e))},mapError:function(n){returnrn(e)},each:function(n){n(e)},bind:function(n){returnn(e)},exists:function(n){returnn(e)},forall:function(n){returnn(e)},toOption:function(){returnon.some(e)}}},un=function(e){return{is:u,isValue:u,isError:a,getOr:l,getOrThunk:function(n){returnn()},getOrDie:function(){returnr(String(e))()},or:function(n){returnn},orThunk:function(n){returnn()},fold:function(n,t){returnn(e)},map:function(n){returnun(e)},mapError:function(n){returnun(n(e))},each:Z,bind:function(n){returnun(e)},exists:u,forall:a,toOption:on.none}},an={value:rn,error:un,fromOption:function(n,t){returnn.fold(function(){returnun(t)},rn)}},cn=p("string"),sn=p("object"),fn=p("array"),ln=p("boolean"),dn=p("function"),mn=p("number"),gn=Array.prototype.slice,pn=Array.prototype.indexOf,hn=Array.prototype.push,vn=function(n,t){return-1<y(n,t)},bn=function(n,t){for(vare=0,o=n.length;e<o;e++){t(n[e],e)}},yn=function(n){return0===n.length?on.none():on.some(n[0])},xn=dn(Array.from)?Array.from:function(n){returngn.call(n)},wn=Object.keys,Sn=Object.hasOwnProperty,Cn=function(n,t){for(vare=wn(n),o=0,r=e.length;o<r;o++){vari=e[o];t(n[i],i)}},kn=function(n,o){varr={};returnCn(n,function(n,t){vare=o(n,t);r[e.k]=e.v}),r},On=function(n,e){varo=[];returnCn(n,function(n,t){o.push(e(n,t))}),o},En=function(n,t){returnSn.call(n,t)},Tn=function(u){if(!fn(u))thrownewError("cases must be an array");if(0===u.length)thrownewError("there must be at least one case");vara=[],e={};returnbn(u,function(n,o){vart=wn(n);if(1!==t.length)thrownewError("one and only one name per case");varr=t[0],i=n[r];if(e[r]!==undefined)thrownewError("duplicate key detected:"+r);if("cata"===r)thrownewError("cannot have a case named cata (sorry)");if(!fn(i))thrownewError("case arguments must be an array");a.push(r),e[r]=function(){varn=arguments.length;if(n!==i.length)thrownewError("Wrong number of arguments to case "+r+". Expected "+i.length+" ("+i+"), got "+n);for(vare=newArray(n),t=0;t<e.length;t++)e[t]=arguments[t];return{fold:function(){if(arguments.length!==u.length)thrownewError("Wrong number of arguments to fold. Expected "+u.length+", got "+arguments.length);returnarguments[o].apply(null,e)},match:function(n){vart=wn(n);if(a.length!==t.length)thrownewError("Wrong number of arguments to match. Expected: "+a.join(",")+"\nActual: "+t.join(","));if(!D(a,function(n){returnvn(t,n)}))thrownewError("Not all branches were specified when using match. Specified: "+t.join(", ")+"\nRequired: "+a.join(", "));returnn[r].apply(null,e)},log:function(n){v.console.log(n,{constructors:a,constructor:r,params:e})}}}}),e},Bn=Object.prototype.hasOwnProperty,Dn=z(function(n,t){returnsn(n)&&sn(t)?Dn(n,t):t}),An=z(function(n,t){returnt}),_n=Tn([{strict:[]},{defaultedThunk:["fallbackThunk"]},{asOption:[]},{asDefaultedOptionThunk:["fallbackThunk"]},{mergeWithThunk:["baseThunk"]}]),Mn=_n.strict,Fn=_n.asOption,In=_n.defaultedThunk,Rn=_n.mergeWithThunk,Vn=(Tn([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]),function(n){returnU(n)}),Nn=function(n,t){returnW(n,t)};(tn=Q=Q||{})[tn.Error=0]="Error",tn[tn.Value=1]="Value";functionHn(n,t,e){returnn.stype===Q.Error?t(n.serror):e(n.svalue)}functionPn(n){return{stype:Q.Value,svalue:n}}functionzn(n){return{stype:Q.Error,serror:n}}functionLn(n){returni(qt,H)(n)}functionjn(n){returnsn(n)&&100<wn(n).length?" removed due to size":JSON.stringify(n,null,2)}functionUn(n,t){returnqt([{path:n,getErrorInfo:t}])}functionWn(n,t,e){returnW(t,e).fold(function(){returnfunction(n,t,e){returnUn(n,function(){return'Could not find valid *strict* value for "'+t+'" in '+jn(e)})}(n,e,t)},Xt)}functionGn(n,t,e){varo=W(n,t).fold(function(){returne(n)},l);returnXt(o)}functionXn(u,a,n,c){returnn.fold(function(o,e,n,r){functioni(n){vart=r.extract(u.concat([o]),c,n);return$t(t,function(n){returnG(e,c(n))})}functiont(n){returnn.fold(function(){varn=G(e,c(on.none()));returnXt(n)},function(n){vart=r.extract(u.concat([o]),c,n);return$t(t,function(n){returnG(e,c(on.some(n)))})})}returnn.fold(function(){returnKt(Wn(u,a,o),i)},function(n){returnKt(Gn(a,o,n),i)},function(){returnKt(function(n,t){returnXt(W(n,t))}(a,o),t)},function(n){returnKt(function(t,n,e){varo=W(t,n).map(function(n){return!0===n?e(t):n});returnXt(o)}(a,o,n),t)},function(n){vart=n(a),e=$t(Gn(a,o,nn({})),function(n){returnDn(t,n)});returnKt(e,i)})},function(n,t){vare=t(a);returnXt(G(n,c(e)))})}functionYn(o){return{extract:function(t,n,e){returnJt(o(e,n),function(n){returnfunction(n,t){returnUn(n,function(){returnt})}(t,n)})},toString:function(){return"val"},toDsl:function(){returnte.itemOf(o)}}}functionqn(n){vari=re(n),u=k(n,function(t,n){returnn.fold(function(n){returnDn(t,q(n,!0))},nn(t))},{});return{extract:function(n,t,e){varo=ln(e)?[]:function(t){varn=wn(t);returnC(n,function(n){return$(t,n)})}(e),r=C(o,function(n){return!$(u,n)});return0===r.length?i.extract(n,t,e):function(n,t){returnUn(n,function(){return"There are unsupported fields: ["+t.join(", ")+"] specified"})}(n,r)},toString:i.toString,toDsl:i.toDsl}}functionKn(r){return{extract:function(e,o,n){vart=S(n,function(n,t){returnr.extract(e.concat(["["+t+"]"]),o,n)});returnne(t)},toString:function(){return"array("+r.toString()+")"},toDsl:function(){returnte.arrOf(r)}}}functionJn(i,u){return{extract:function(e,o,r){varn=wn(r),t=function(n,t){returnKn(Yn(i)).extract(n,l,t)}(e,n);returnKt(t,function(n){vart=S(n,function(n){returnoe.field(n,n,Mn(),u)});returnre(t).extract(e,o,r)})},toString:function(){return"setOf("+u.toString()+")"},toDsl:function(){returnte.setOf(i,u)}}}function$n(t,e,o,n,r){returnNn(n,r).fold(function(){returnfunction(n,t,e){returnUn(n,function(){return'The chosen schema: "'+e+'" did not exist in branches: '+jn(t)})}(t,n,r)},function(n){returnn.extract(t.concat(["branch: "+r]),e,o)})}functionQn(n,r){return{extract:function(t,e,o){returnNn(o,n).fold(function(){returnfunction(n,t){returnUn(n,function(){return'Choice schema did not contain choice key: "'+t+'"'})}(t,n)},function(n){return$n(t,e,o,r,n)})},toString:function(){return"chooseOn("+n+"). Possible values: "+wn(r)},toDsl:function(){returnte.choiceOf(n,r)}}}functionZn(t){returnYn(function(n){returnt(n).fold(qt,Xt)})}functionnt(t,n){returnJn(function(n){returnWt(t(n))},n)}functiontt(n,t,e){returnGt(function(n,t,e,o){varr=t.extract([n],e,o);returnQt(r,function(n){return{input:o,errors:n}})}(n,t,l,e))}functionet(n){returnn.fold(function(n){thrownewError(le(n))},l)}functionot(n,t,e){returnet(tt(n,t,e))}functionrt(n,t){returnQn(n,t)}functionit(n,t){returnQn(n,P(t,re))}functionut(e,o){returnYn(function(n){vart=typeofn;returne(n)?Xt(n):qt("Expected type: "+o+" but got: "+t)})}functionat(t){returnZn(function(n){returnvn(t,n)?an.value(n):an.error('Unsupported value: "'+n+'", choose one of "'+t.join(", ")+'".')})}functionct(n){returnce(n,n,Mn(),ie())}functionst(n,t){returnce(n,n,Mn(),t)}functionft(n){returnst(n,ge)}functionlt(n,t){returnce(n,n,Mn(),at(t))}functiondt(n){returnst(n,he)}functionmt(n,t){returnce(n,n,Mn(),re(t))}functiongt(n,t){returnce(n,n,Mn(),ue(t))}functionpt(n,t){returnce(n,n,Mn(),Kn(t))}functionht(n){returnce(n,n,Fn(),ie())}functionvt(n,t){returnce(n,n,Fn(),t)}functionbt(n){returnvt(n,me)}functionyt(n){returnvt(n,ge)}functionxt(n){returnvt(n,he)}functionwt(n,t){returnvt(n,re(t))}functionSt(n,t){returnce(n,n,j(t),ie())}functionCt(n,t,e){returnce(n,n,j(t),e)}functionkt(n,t){returnCt(n,t,me)}functionOt(n,t){returnCt(n,t,ge)}functionEt(n,t,e){returnCt(n,t,at(e))}functionTt(n,t){returnCt(n,t,pe)}functionBt(n,t){returnCt(n,t,he)}functionDt(n,t,e){returnCt(n,t,re(e))}functionAt(n,t){returnae(n,t)}function_t(n,t,e){return0!=(n.compareDocumentPosition(t)&e)}functionMt(n,t){vare=function(n,t){for(vare=0;e<n.length;e++){varo=n[e];if(o.test(t))returno}returnundefined}(n,t);if(!e)return{major:0,minor:0};functiono(n){returnNumber(t.replace(e,"$"+n))}returnke(o(1),o(2))}functionFt(n,t){returnfunction(){returnt===n}}functionIt(n,t){returnfunction(){returnt===n}}functionRt(n,t){vare=String(t).toLowerCase();returnE(n,function(n){returnn.search(e)})}functionVt(n,t){return-1!==n.indexOf(t)}functionNt(t){returnfunction(n){returnVt(n,t)}}functionHt(){returnLe.get()}functionPt(n,t){vare=n.dom();if(e.nodeType!==Ge)return!1;varo=e;if(o.matches!==undefined)returno.matches(t);if(o.msMatchesSelector!==undefined)returno.msMatchesSelector(t);if(o.webkitMatchesSelector!==undefined)returno.webkitMatchesSelector(t);if(o.mozMatchesSelector!==undefined)returno.mozMatchesSelector(t);thrownewError("Browser lacks native selectors")}functionzt(n){returnn.nodeType!==Ge&&n.nodeType!==Xe||0===n.childElementCount}functionLt(n,t){vare=t===undefined?v.document:t.dom();returnzt(e)?[]:S(e.querySelectorAll(n),we.fromDom)}functionjt(n,t){returnn.dom()===t.dom()}functionUt(n,t){returnjt(n.element(),t.event().target())}varWt=function(n){returnn.fold(zn,Pn)},Gt=function(n){returnHn(n,an.error,an.value)},Xt=Pn,Yt=function(n){vart=[],e=[];returnbn(n,function(n){Hn(n,function(n){returne.push(n)},function(n){returnt.push(n)})}),{values:t,errors:e}},qt=zn,Kt=function(n,t){returnn.stype===Q.Value?t(n.svalue):n},Jt=function(n,t){returnn.stype===Q.Error?t(n.serror):n},$t=function(n,t){returnn.stype===Q.Value?{stype:Q.Value,svalue:t(n.svalue)}:n},Qt=function(n,t){returnn.stype===Q.Error?{stype:Q.Error,serror:t(n.serror)}:n},Zt=function(n,t){vare=Yt(n);return0<e.errors.length?Ln(e.errors):function(n,t){return0<n.length?Xt(Dn(t,An.apply(undefined,n))):Xt(t)}(e.values,t)},ne=function(n){vart=Yt(n);return0<t.errors.length?Ln(t.errors):Xt(t.values)},te=Tn([{setOf:["validator","valueType"]},{arrOf:["valueType"]},{objOf:["fields"]},{itemOf:["validator"]},{choiceOf:["key","branches"]},{thunk:["description"]},{func:["args","outputSchema"]}]),ee=Tn([{field:["name","presence","type"]},{state:["name"]}]),oe=Tn([{field:["key","okey","presence","prop"]},{state:["okey","instantiator"]}]),re=function(o){return{extract:function(n,t,e){returnfunction(t,e,n,o){varr=S(n,function(n){returnXn(t,e,n,o)});returnZt(r,{})}(n,e,o,t)},toString:function(){return"obj{\n"+S(o,function(n){returnn.fold(function(n,t,e,o){returnn+" -> "+o.toString()},function(n,t){return"state("+n+")"})}).join("\n")+"}"},toDsl:function(){returnte.objOf(S(o,function(n){returnn.fold(function(n,t,e,o){returnee.field(n,e,o)},function(n,t){returnee.state(n)})}))}}},ie=nn(Yn(Xt)),ue=i(Kn,re),ae=oe.state,ce=oe.field,se=Yn(Xt),fe=function(o){return{extract:function(n,t,e){returno().extract(n,t,e)},toString:function(){returno().toString()},toDsl:function(){returno().toDsl()}}},le=function(n){return"Errors: \n"+function(n){vart=10<n.length?n.slice(0,10).concat([{path:[],getErrorInfo:function(){return"... (only showing first ten failures)"}}]):n;returnS(t,function(n){return"Failed path: ("+n.path.join(" > ")+")\n"+n.getErrorInfo()})}(n.errors)+"\n\nInput object: "+jn(n.input)},de=nn(se),me=ut(mn,"number"),ge=ut(cn,"string"),pe=ut(ln,"boolean"),he=ut(dn,"function"),ve=function(t){functionn(n,t){for(vare=n.next();!e.done;){if(!t(e.value))return!1;e=n.next()}return!0}if(Object(t)!==t)return!0;switch({}.toString.call(t).slice(8,-1)){case"Boolean":case"Number":case"String":case"Date":case"RegExp":case"Blob":case"FileList":case"ImageData":case"ImageBitmap":case"ArrayBuffer":return!0;case"Array":case"Object":returnObject.keys(t).every(function(n){returnve(t[n])});case"Map":returnn(t.keys(),ve)&&n(t.values(),ve);case"Set":returnn(t.keys(),ve);default:return!1}},be=Yn(function(n){returnve(n)?Xt(n):qt("Expected value to be acceptable for sending via postMessage")}),ye=function(n){functiont(){returne}vare=n;return{get:t,set:function(n){e=n},clone:function(){returnye(t())}}},xe=function(n){if(null===n||n===undefined)thrownewError("Node cannot be null or undefined");return{dom:nn(n)}},we={fromHtml:function(n,t){vare=(t||v.document).createElement("div");if(e.innerHTML=n,!e.hasChildNodes()||1<e.childNodes.length)throwv.console.error("HTML does not have a single root node",n),newError("HTML must have a single root node");returnxe(e.childNodes[0])},fromTag:function(n,t){vare=(t||v.document).createElement(n);returnxe(e)},fromText:function(n,t){vare=(t||v.document).createTextNode(n);returnxe(e)},fromDom:xe,fromPoint:function(n,t,e){varo=n.dom();returnon.from(o.elementFromPoint(t,e)).map(xe)}},Se=function(n,t){return_t(n,t,v.Node.DOCUMENT_POSITION_CONTAINED_BY)},Ce=function(){returnke(0,0)},ke=function(n,t){return{major:n,minor:t}},Oe={nu:ke,detect:function(n,t){vare=String(t).toLowerCase();return0===n.length?Ce():Mt(n,e)},unknown:Ce},Ee="Firefox",Te=function(n){vart=n.current;return{current:t,version:n.version,isEdge:Ft("Edge",t),isChrome:Ft("Chrome",t),isIE:Ft("IE",t),isOpera:Ft("Opera",t),isFirefox:Ft(Ee,t),isSafari:Ft("Safari",t)}},Be={unknown:function(){returnTe({current:undefined,version:Oe.unknown()})},nu:Te,edge:nn("Edge"),chrome:nn("Chrome"),ie:nn("IE"),opera:nn("Opera"),firefox:nn(Ee),safari:nn("Safari")},De="Windows",Ae="Android",_e="Solaris",Me="FreeBSD",Fe=function(n){vart=n.current;return{current:t,version:n.version,isWindows:It(De,t),isiOS:It("iOS",t),isAndroid:It(Ae,t),isOSX:It("OSX",t),isLinux:It("Linux",t),isSolaris:It(_e,t),isFreeBSD:It(Me,t)}},Ie={unknown:function(){returnFe({current:undefined,version:Oe.unknown()})},nu:Fe,windows:nn(De),ios:nn("iOS"),android:nn(Ae),linux:nn("Linux"),osx:nn("OSX"),solaris:nn(_e),freebsd:nn(Me)},Re=function(n,e){returnRt(n,e).map(function(n){vart=Oe.detect(n.versionRegexes,e);return{current:n.name,version:t}})},Ve=function(n,e){returnRt(n,e).map(function(n){vart=Oe.detect(n.versionRegexes,e);return{current:n.name,version:t}})},Ne=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,He=[{name:"Edge",versionRegexes:[/.*?edge\/?([0-9]+)\.([0-9]+)$/],search:function(n){returnVt(n,"edge/")&&Vt(n,"chrome")&&Vt(n,"safari")&&Vt(n,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Ne],search:function(n){returnVt(n,"chrome")&&!Vt(n,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(n){returnVt(n,"msie")||Vt(n,"trident")}},{name:"Opera",versionRegexes:[Ne,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Nt("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Nt("firefox")},{name:"Safari",versionRegexes:[Ne,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(n){return(Vt(n,"safari")||Vt(n,"mobile/"))&&Vt(n,"applewebkit")}}],Pe=[{name:"Windows",search:Nt("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(n){returnVt(n,"iphone")||Vt(n,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Nt("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:Nt("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Nt("linux"),versionRegexes:[]},{name:"Solaris",search:Nt("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Nt("freebsd"),versionRegexes:[]}],ze={browsers:nn(He),oses:nn(Pe)},Le=ye(function(n,t){vare=ze.browsers(),o=ze.oses(),r=Re(e,n).fold(Be.unknown,Be.nu),i=Ve(o,n).fold(Ie.unknown,Ie.nu);return{browser:r,os:i,deviceType:function(n,t,e,o){varr=n.isiOS()&&!0===/ipad/i.test(e),i=n.isiOS()&&!r,u=n.isiOS()||n.isAndroid(),a=u||o("(pointer:coarse)"),c=r||!i&&u&&o("(min-device-width:768px)"),s=i||u&&!c,f=t.isSafari()&&n.isiOS()&&!1===/safari/i.test(e),l=!s&&!c&&!f;return{isiPad:nn(r),isiPhone:nn(i),isTablet:nn(c),isPhone:nn(s),isTouch:nn(a),isAndroid:n.isAndroid,isiOS:n.isiOS,isWebView:nn(f),isDesktop:nn(l)}}(i,r,n,t)}}(v.navigator.userAgent,function(n){returnv.window.matchMedia(n).matches})),je=(v.Node.ATTRIBUTE_NODE,v.Node.CDATA_SECTION_NODE,v.Node.COMMENT_NODE,v.Node.DOCUMENT_NODE),Ue=(v.Node.DOCUMENT_TYPE_NODE,v.Node.DOCUMENT_FRAGMENT_NODE,v.Node.ELEMENT_NODE),We=v.Node.TEXT_NODE,Ge=(v.Node.PROCESSING_INSTRUCTION_NODE,v.Node.ENTITY_REFERENCE_NODE,v.Node.ENTITY_NODE,v.Node.NOTATION_NODE,Ue),Xe=je,Ye=Ht().browser.isIE()?function(n,t){returnSe(n.dom(),t.dom())}:function(n,t){vare=n.dom(),o=t.dom();returne!==o&&e.contains(o)};functionqe(n,t,e,o,r){returnn(e,o)?on.some(e):dn(r)&&r(e)?on.none():t(e,o,r)}functionKe(n){returnn.dom().nodeName.toLowerCase()}functionJe(t){returnfunction(n){returnfunction(n){returnn.dom().nodeType}(n)===t}}"undefined"!=typeofv.window?v.window:Function("return this;")();function$e(n){vart=Pr(n)?n.dom().parentNode:n.dom();returnt!==undefined&&null!==t&&t.ownerDocument.body.contains(t)}functionQe(n,t,e){for(varo=n.dom(),r=dn(e)?e:nn(!1);o.parentNode;){o=o.parentNode;vari=we.fromDom(o);if(t(i))returnon.some(i);if(r(i))break}returnon.none()}functionZe(n,t,e){returnqe(function(n,t){returnt(n)},Qe,n,t,e)}functionno(n,r){vari=function(n){for(vart=0;t<n.childNodes.length;t++){vare=we.fromDom(n.childNodes[t]);if(r(e))returnon.some(e);varo=i(n.childNodes[t]);if(o.isSome())returno}returnon.none()};returni(n.dom())}functionto(n){if(!$(n,"can")&&!$(n,"abort")&&!$(n,"run"))thrownewError("EventHandler defined by: "+JSON.stringify(n,null,2)+" does not have can, abort, or run!");returnot("Extracting event.handler",qn([St("can",nn(!0)),St("abort",nn(!1)),St("run",Z)]),n)}functioneo(e){varn=function(t,o){returnfunction(){for(vare=[],n=0;n<arguments.length;n++)e[n]=arguments[n];returnO(t,function(n,t){returnn&&o(t).apply(undefined,e)},!0)}}(e,function(n){returnn.can}),t=function(t,o){returnfunction(){for(vare=[],n=0;n<arguments.length;n++)e[n]=arguments[n];returnO(t,function(n,t){returnn||o(t).apply(undefined,e)},!1)}}(e,function(n){returnn.abort});returnto({can:n,abort:t,run:function(){for(vart=[],n=0;n<arguments.length;n++)t[n]=arguments[n];bn(e,function(n){n.run.apply(undefined,t)})}})}functionoo(n,t){Fi(n,n.element(),t,{})}functionro(n,t,e){Fi(n,n.element(),t,e)}functionio(n){oo(n,di())}functionuo(n,t,e){Fi(n,t,e,{})}functionao(n,t,e,o){n.getSystem().triggerEvent(e,t,o.event())}functionco(n){returnK(n)}functionso(n,t){return{key:n,value:to({abort:t})}}functionfo(n){return{key:n,value:to({run:function(n,t){t.event().prevent()}})}}functionlo(n,t){return{key:n,value:to({run:t})}}functionmo(n,e,o){return{key:n,value:to({run:function(n,t){e.apply(undefined,[n,t].concat(o))}})}}functiongo(n){returnfunction(e){return{key:n,value:to({run:function(n,t){Ut(n,t)&&e(n,t)}})}}}functionpo(n,t,e){returnfunction(e,o){returnlo(e,function(n,t){n.getSystem().getByUid(o).each(function(n){ao(n,n.element(),e,t)})})}(n,t.partUids[e])}functionho(n,r){returnlo(n,function(t,n){vare=n.event(),o=t.getSystem().getByDom(e.target()).fold(function(){returnjr(e.target(),function(n){returnt.getSystem().getByDom(n).toOption()},nn(!1)).getOr(t)},function(n){returnn});r(t,o,n)})}functionvo(n){returnlo(n,function(n,t){t.cut()})}functionbo(n,t){returngo(n)(t)}functionyo(){for(vart=[],n=0;n<arguments.length;n++)t[n]=arguments[n];returnfunction(){for(vare=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(t.length!==e.length)thrownewError('Wrong number of arguments to struct. Expected "['+t.length+']", got '+e.length+" arguments");varo={};returnbn(t,function(n,t){o[n]=nn(e[t])}),o}}functionxo(n){returnn.slice(0).sort()}functionwo(t,n){if(!fn(n))thrownewError("The "+t+" fields must be an array. Was: "+n+".");bn(n,function(n){if(!cn(n))thrownewError("The value "+n+" in the "+t+" fields was not a string.")})}functionSo(r,i){varu=r.concat(i);if(0===u.length)thrownewError("You must specify at least one required or optional field.");returnwo("required",r),wo("optional",i),function(n){vare=xo(n);E(e,function(n,t){returnt<e.length-1&&n===e[t+1]}).each(function(n){thrownewError("The field: "+n+" occurs more than once in the combined fields: ["+e.join(", ")+"].")})}(u),function(t){vare=wn(t);D(r,function(n){returnvn(e,n)})||function(n,t){thrownewError("All required keys ("+xo(n).join(", ")+") were not specified. Specified keys were: "+xo(t).join(", ")+".")}(r,e);varn=C(e,function(n){return!vn(u,n)});0<n.length&&function(n){thrownewError("Unsupported keys for object: "+xo(n).join(", "))}(n);varo={};returnbn(r,function(n){o[n]=nn(t[n])}),bn(i,function(n){o[n]=nn(Object.prototype.hasOwnProperty.call(t,n)?on.some(t[n]):on.none())}),o}}functionCo(n){returnwe.fromDom(n.dom().ownerDocument)}functionko(n){returnwe.fromDom(n.dom().ownerDocument.documentElement)}functionOo(n){returnwe.fromDom(n.dom().ownerDocument.defaultView)}functionEo(n){returnon.from(n.dom().parentNode).map(we.fromDom)}functionTo(n){returnon.from(n.dom().offsetParent).map(we.fromDom)}functionBo(n){returnS(n.dom().childNodes,we.fromDom)}functionDo(n,t){vare=n.dom().childNodes;returnon.from(e[t]).map(we.fromDom)}functionAo(t,e){Eo(t).each(function(n){n.dom().insertBefore(e.dom(),t.dom())})}function_o(n,t){(function(n){returnon.from(n.dom().nextSibling).map(we.fromDom)})(n).fold(function(){Eo(n).each(function(n){Hi(n,t)})},function(n){Ao(n,t)})}functionMo(t,e){(function(n){returnDo(n,0)})(t).fold(function(){Hi(t,e)},function(n){t.dom().insertBefore(e.dom(),n.dom())})}functionFo(t,n){bn(n,function(n){Hi(t,n)})}functionIo(n){n.dom().textContent="",bn(Bo(n),function(n){Pi(n)})}functionRo(n){vart=Bo(n);0<t.length&&function(t,n){bn(n,function(n){Ao(t,n)})}(n,t),Pi(n)}functionVo(n){returnn.dom().innerHTML}functionNo(n,t){vare=Co(n).dom(),o=we.fromDom(e.createDocumentFragment()),r=function(n,t){vare=(t||v.document).createElement("div");returne.innerHTML=n,Bo(we.fromDom(e))}(t,e);Fo(o,r),Io(n),Hi(n,o)}functionHo(n,t,e){if(!(cn(e)||ln(e)||mn(e)))throwv.console.error("Invalid call to Attr.set. Key ",t,":: Value ",e,":: Element ",n),newError("Attribute value was not simple");n.setAttribute(t,e+"")}functionPo(n,t,e){Ho(n.dom(),t,e)}functionzo(n,t){vare=n.dom().getAttribute(t);returnnull===e?undefined:e}functionLo(n,t){vare=n.dom();return!(!e||!e.hasAttribute)&&e.hasAttribute(t)}functionjo(n,t){n.dom().removeAttribute(t)}functionUo(n){returnfunction(n,t){returnwe.fromDom(n.dom().cloneNode(t))}(n,!1)}functionWo(n){returnfunction(n){vart=we.fromTag("div"),e=we.fromDom(n.dom().cloneNode(!0));returnHi(t,e),Vo(t)}(Uo(n))}functionGo(n){returnWo(n)}functionXo(n){vart=(newDate).getTime();returnn+"_"+Math.floor(1e9*Math.random())+++ji+String(t)}functionYo(n){returnXo(n)}functionqo(t){functionn(n){returnfunction(){thrownewError("The component must be in a context to send: "+n+"\n"+Go(t().element())+" is not in context.")}}return{debugInfo:nn("fake"),triggerEvent:n("triggerEvent"),triggerFocus:n("triggerFocus"),triggerEscape:n("triggerEscape"),build:n("build"),addToWorld:n("addToWorld"),removeFromWorld:n("removeFromWorld"),addToGui:n("addToGui"),removeFromGui:n("removeFromGui"),getByUid:n("getByUid"),getByDom:n("getByDom"),broadcast:n("broadcast"),broadcastOn:n("broadcastOn"),broadcastEvent:n("broadcastEvent"),isConnected:nn(!1)}}functionKo(n,t){vare=n.toString(),o=e.indexOf(")")+1,r=e.indexOf("("),i=e.substring(r+1,o-1).split(/,\s*/);returnn.toFunctionAnnotation=function(){return{name:t,parameters:$i(i)}},n}functionJo(n){returnq(Qi,n)}function$o(o){returnfunction(n,t){vare=t.toString(),o=e.indexOf(")")+1,r=e.indexOf("("),i=e.substring(r+1,o-1).split(/,\s*/);returnn.toFunctionAnnotation=function(){return{name:"OVERRIDE",parameters:$i(i.slice(1))}},n}(function(n){for(vart=[],e=1;e<arguments.length;e++)t[e-1]=arguments[e];returno.apply(undefined,[n.getApis()].concat([n].concat(t)))},o)}functionQo(n,r){vari={};returnCn(n,function(n,o){Cn(n,function(n,t){vare=Y(t,[])(i);i[t]=e.concat([r(o,n)])})}),i}functionZo(n){return{classes:n.classes!==undefined?n.classes:[],attributes:n.attributes!==undefined?n.attributes:{},styles:n.styles!==undefined?n.styles:{}}}functionnr(n){returnn.cHandler}functiontr(n,t){return{name:nn(n),handler:nn(t)}}functioner(n,t,e){varo=N(N({},e),function(n,t){vare={};returnbn(n,function(n){e[n.name()]=n.handlers(t)}),e}(t,n));returnQo(o,tr)}functionor(n){vari=function(n){returndn(n)?{can:nn(!0),abort:nn(!1),run:n}:n}(n);returnfunction(n,t){for(vare=[],o=2;o<arguments.length;o++)e[o-2]=arguments[o];varr=[n,t].concat(e);i.abort.apply(undefined,r)?t.stop():i.can.apply(undefined,r)&&i.run.apply(undefined,r)}}functionrr(n,t,e){varo=t[e];returno?function(u,a,n,c){vart=n.slice(0);try{vare=t.sort(function(n,t){vare=n[a](),o=t[a](),r=c.indexOf(e),i=c.indexOf(o);if(-1===r)thrownewError("The ordering for "+u+" does not have an entry for "+e+".\nOrder specified: "+JSON.stringify(c,null,2));if(-1===i)thrownewError("The ordering for "+u+" does not have an entry for "+o+".\nOrder specified: "+JSON.stringify(c,null,2));returnr<i?-1:i<r?1:0});returnan.value(e)}catch(o){returnan.error([o])}}("Event: "+e,"name",n,o).map(function(n){vart=S(n,function(n){returnn.handler()});returneo(t)}):function(n,t){returnan.error(["The event ("+n+') has more than one behaviour that listens to it.\nWhen this occurs, you must specify an event ordering for the behaviours in your spec (e.g. [ "listing", "toggling" ]).\nThe behaviours that can trigger it are: '+JSON.stringify(S(t,function(n){returnn.name()}),null,2)])}(e,n)}functionir(n){returntt("custom.definition",re([ce("dom","dom",Mn(),re([ct("tag"),St("styles",{}),St("classes",[]),St("attributes",{}),ht("value"),ht("innerHtml")])),ct("components"),ct("uid"),St("events",{}),St("apis",{}),ce("eventOrder","eventOrder",function(n){return_n.mergeWithThunk(nn(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"],touchstart:["focusing","alloy.base.behaviour","item-type-events"],mouseover:["item-type-events","tooltipping"]}),de()),ht("domModification")]),n)}functionur(n,t){vare=zo(n,t);returne===undefined||""===e?[]:e.split(" ")}functionar(n){returnn.dom().classList!==undefined}functioncr(n,t){returnfunction(n,t,e){varo=ur(n,t).concat([e]);returnPo(n,t,o.join(" ")),!0}(n,"class",t)}functionsr(n,t){returnfunction(n,t,e){varo=C(ur(n,t),function(n){returnn!==e});return0<o.length?Po(n,t,o.join(" ")):jo(n,t),!1}(n,"class",t)}functionfr(n,t){ar(n)?n.dom().classList.add(t):cr(n,t)}functionlr(n){0===(ar(n)?n.dom().classList:function(n){returnur(n,"class")}(n)).length&&jo(n,"class")}functiondr(n,t){ar(n)?n.dom().classList.remove(t):sr(n,t),lr(n)}functionmr(n,t){returnar(n)&&n.dom().classList.contains(t)}functiongr(t,n){bn(n,function(n){fr(t,n)})}functionpr(t,n){bn(n,function(n){dr(t,n)})}functionhr(n){returnn.style!==undefined&&dn(n.style.getPropertyValue)}functionvr(n,t,e){if(!cn(e))throwv.console.error("Invalid call to CSS.set. Property ",t,":: Value ",e,":: Element ",n),newError("CSS value must be a string: "+e);hr(n)&&n.style.setProperty(t,e)}functionbr(n,t){hr(n)&&n.style.removeProperty(t)}functionyr(n,t,e){varo=n.dom();vr(o,t,e)}functionxr(n,t){vare=n.dom();Cn(t,function(n,t){vr(e,t,n)})}functionwr(n,t){vare=n.dom(),o=v.window.getComputedStyle(e).getPropertyValue(t),r=""!==o||$e(n)?o:ou(e,t);returnnull===r?undefined:r}functionSr(n,t){vare=n.dom(),o=ou(e,t);returnon.from(o).filter(function(n){return0<n.length})}functionCr(n,t,e){varo=we.fromTag(n);returnyr(o,t,e),Sr(o,t).isSome()}functionkr(n,t){vare=n.dom();br(e,t),Lo(n,"style")&&""===function(n){returnn.replace(/^\s+|\s+$/g,"")}(zo(n,"style"))&&jo(n,"style")}functionOr(n){returnn.dom().offsetWidth}functionEr(n){returnn.dom().value}functionTr(n,t){if(t===undefined)thrownewError("Value.set was undefined");n.dom().value=t}functionBr(n){vart=we.fromTag(n.tag);!function(n,t){vare=n.dom();Cn(t,function(n,t){Ho(e,t,n)})}(t,n.attributes),gr(t,n.classes),xr(t,n.styles),n.innerHtml.each(function(n){returnNo(t,n)});vare=n.domChildren;returnFo(t,e),n.value.each(function(n){Tr(t,n)}),n.uid,Yi(t,n.uid),t}functionDr(n,t){returnfunction(t,n){vare=S(n,function(n){returnwt(n.name(),[ct("config"),St("state",Zi)])}),o=tt("component.behaviours",re(e),t.behaviours).fold(function(n){thrownewError(le(n)+"\nComplete spec:\n"+JSON.stringify(t,null,2))},function(n){returnn});return{list:n,data:P(o,function(n){vart=n.map(function(n){return{config:n.config,state:n.state.init(n.config)}});returnfunction(){returnt}})}}(n,t)}functionAr(n){vart=function(n){vart=Y("behaviours",{})(n),e=C(wn(t),function(n){returnt[n]!==undefined});returnS(e,function(n){returnt[n].me})}(n);returnDr(n,t)}function_r(n,t,e){varo=function(n){returnN(N({},n.dom),{uid:n.uid,domChildren:S(n.components,function(n){returnn.element()})})}(n),r=function(n){returnn.domModification.fold(function(){returnZo({})},Zo)}(n),i={"alloy.base.modification":r};returnfunction(n,t){returnN(N({},n),{attributes:N(N({},n.attributes),t.attributes),styles:N(N({},n.styles),t.styles),classes:n.classes.concat(t.classes)})}(o,0<t.length?function(t,n,e,o){varr=N({},n);bn(e,function(n){r[n.name()]=n.exhibit(t,o)});functioni(n){returnk(n,function(n,t){returnN(N({},t.modification),n)},{})}varu=Qo(r,function(n,t){return{name:n,modification:t}}),a=k(u.classes,function(n,t){returnt.modification.concat(n)},[]),c=i(u.attributes),s=i(u.styles);returnZo({classes:a,attributes:c,styles:s})}(e,i,t,o):r)}functionMr(n,t,e){varo={"alloy.base.behaviour":function(n){returnn.events}(n)};returnfunction(n,t,e,o){varr=er(n,e,o);returneu(r,t)}(e,n.eventOrder,t,o).getOrDie()}functionFr(n){vart=Ki(n),e=t.events,o=c(t,["events"]),r=function(n){vart=Y("components",[])(n);returnS(t,uu)}(o),i=N(N({},o),{events:N(N({},Li),e),components:r});returnan.value(function(e){functionn(){returnl}varo=ye(Ji),t=et(ir(e)),r=Ar(e),i=function(n){returnn.list}(r),u=function(n){returnn.data}(r),a=_r(t,i,u),c=Br(a),s=Mr(t,i,u),f=ye(t.components),l={getSystem:o.get,config:function(n){vart=u;return(dn(t[n.name()])?t[n.name()]:function(){thrownewError("Could not find "+n.name()+" in "+JSON.stringify(e,null,2))})()},hasConfigured:function(n){returndn(u[n.name()])},spec:nn(e),readState:function(n){returnu[n]().map(function(n){returnn.state.readState()}).getOr("not enabled")},getApis:function(){returnt.apis},connect:function(n){o.set(n)},disconnect:function(){o.set(qo(n))},element:nn(c),syncComponents:function(){varn=Bo(c),t=B(n,function(n){returno.get().getByDom(n).fold(function(){return[]},function(n){return[n]})});f.set(t)},components:f.get,events:nn(s)};returnl}(i))}functionIr(n){vart=we.fromText(n);returnru({element:t})}varRr,Vr,Nr,Hr=Je(Ue),Pr=Je(We),zr=L(function(){returnLr(we.fromDom(v.document))}),Lr=function(n){vart=n.dom().body;if(null===t||t===undefined)thrownewError("Body is not available yet");returnwe.fromDom(t)},jr=function(n,t,e){returnZe(n,function(n){returnt(n).isSome()},e).bind(t)},Ur=nn("touchstart"),Wr=nn("touchmove"),Gr=nn("touchend"),Xr=nn("touchcancel"),Yr=nn("mousedown"),qr=nn("mousemove"),Kr=nn("mouseout"),Jr=nn("mouseup"),$r=nn("mouseover"),Qr=nn("focusin"),Zr=nn("focusout"),ni=nn("keydown"),ti=nn("keyup"),ei=nn("input"),oi=nn("change"),ri=nn("click"),ii=nn("transitionend"),ui=nn("selectstart"),ai={tap:nn("alloy.tap")},ci=nn("alloy.focus"),si=nn("alloy.blur.post"),fi=nn("alloy.paste.post"),li=nn("alloy.receive"),di=nn("alloy.execute"),mi=nn("alloy.focus.item"),gi=ai.tap,pi=nn("alloy.longpress"),hi=nn("alloy.sandbox.close"),vi=nn("alloy.typeahead.cancel"),bi=nn("alloy.system.init"),yi=nn("alloy.system.touchmove"),xi=nn("alloy.system.touchend"),wi=nn("alloy.system.scroll"),Si=nn("alloy.system.resize"),Ci=nn("alloy.system.attached"),ki=nn("alloy.system.detached"),Oi=nn("alloy.system.dismissRequested"),Ei=nn("alloy.system.repositionRequested"),Ti=nn("alloy.focusmanager.shifted"),Bi=nn("alloy.slotcontainer.visibility"),Di=nn("alloy.change.tab"),Ai=nn("alloy.dismiss.tab"),_i=nn("alloy.highlight"),Mi=nn("alloy.dehighlight"),Fi=function(n,t,e,o){varr=N({target:t},o);n.getSystem().triggerEvent(e,t,P(r,nn))},Ii=go(Ci()),Ri=go(ki()),Vi=go(bi()),Ni=(Rr=di(),function(n){returnlo(Rr,n)}),Hi=(yo("element","offset"),function(n,t){n.dom().appendChild(t.dom())}),Pi=function(n){vart=n.dom();null!==t.parentNode&&t.parentNode.removeChild(t)},zi=co([(Vr=ci(),Nr=function(n,t){vare=t.event().originator(),o=t.event().target();return!function(n,t,e){returnjt(t,n.element())&&!jt(t,e)}(n,e,o)||(v.console.warn(ci()+" did not get interpreted by the desired target. \nOriginator: "+Go(e)+"\nTarget: "+Go(o)+"\nCheck the "+ci()+" event handlers"),!1)},{key:Vr,value:to({can:Nr})})]),Li=/* */Object.freeze({events:zi}),ji=0,Ui=nn("alloy-id-"),Wi=nn("data-alloy-id"),Gi=Ui(),Xi=Wi(),Yi=function(n,t){Object.defineProperty(n.dom(),Xi,{value:t,writable:!0})},qi=function(n){vart=Hr(n)?n.dom()[Xi]:null;returnon.from(t)},Ki=l,Ji=qo(),$i=function(n){returnS(n,function(n){returnfunction(n,t){returnfunction(n,t,e){return""===t||!(n.length<t.length)&&n.substr(e,e+t.length)===t}(n,t,n.length-t.length)}(n,"/*")?n.substring(0,n.length-"/*".length):n})},Qi=Xo("alloy-premade"),Zi={init:function(){returnnu({readState:function(){return"No State required"}})}},nu=function(n){returnn},tu=function(n,t){returnfunction(n,t){return{cHandler:n,purpose:nn(t)}}(d.apply(undefined,[n.handler].concat(t)),n.purpose())},eu=function(n,i){vart=On(n,function(o,r){return(1===o.length?an.value(o[0].handler()):rr(o,i,r)).map(function(n){vart=or(n),e=1<o.length?C(i[r],function(t){returnx(o,function(n){returnn.name()===t})}).join(" > "):o[0].name();returnq(r,function(n,t){return{handler:n,purpose:nn(t)}}(t,e))})});returnJ(t,{})},ou=function(n,t){returnhr(n)?n.style.getPropertyValue(t):""},ru=function(n){vart=ot("external.component",qn([ct("element"),ht("uid")]),n),e=ye(qo());t.uid.each(function(n){Yi(t.element,n)});varo={getSystem:e.get,config:on.none,hasConfigured:nn(!1),connect:function(n){e.set(n)},disconnect:function(){e.set(qo(function(){returno}))},getApis:function(){return{}},element:nn(t.element),spec:nn(n),readState:nn("No state"),syncComponents:Z,components:nn([]),events:nn({})};returnJo(o)},iu=Yo,uu=function(t){returnfunction(n){returnNn(n,Qi)}(t).fold(function(){varn=t.hasOwnProperty("uid")?t:N({uid:iu("")},t);returnFr(n).getOrDie()},function(n){returnn})},au=Jo;functioncu(o,r){functionn(n){vart=r(n);if(t<=0||null===t){vare=wr(n,o);returnparseFloat(e)||0}returnt}functioni(r,n){returnO(n,function(n,t){vare=wr(r,t),o=e===undefined?0:parseInt(e,10);returnisNaN(o)?n:n+o},0)}return{set:function(n,t){if(!mn(t)&&!t.match(/^[0-9]+$/))thrownewError(o+".set accepts only positive integer values. Value was "+t);vare=n.dom();hr(e)&&(e.style[o]=t+"px")},get:n,getOuter:n,aggregate:i,max:function(n,t,e){varo=i(n,e);returno<t?t-o:0}}}functionsu(n){returnMu.get(n)}functionfu(n){returnMu.getOuter(n)}functionlu(n,t){returnn!==undefined?n:t!==undefined?t:0}functiondu(n){vart=n.dom().ownerDocument,e=t.body,o=t.defaultView,r=t.documentElement;if(e===n.dom())returnIu(e.offsetLeft,e.offsetTop);vari=lu(o.pageYOffset,r.scrollTop),u=lu(o.pageXOffset,r.scrollLeft),a=lu(r.clientTop,e.clientTop),c=lu(r.clientLeft,e.clientLeft);returnRu(n).translate(u-c,i-a)}functionmu(n){returnVu.get(n)}functiongu(n){returnVu.getOuter(n)}functionpu(n){vart=n!==undefined?n.dom():v.document,e=t.body.scrollLeft||t.documentElement.scrollLeft,o=t.body.scrollTop||t.documentElement.scrollTop;returnIu(e,o)}functionhu(n,t,e,o){return{x:nn(n),y:nn(t),width:nn(e),height:nn(o),right:nn(n+e),bottom:nn(t+o)}}functionvu(n){vart=n===undefined?v.window:n,e=t.document,o=pu(we.fromDom(e)),r=t.visualViewport;if(r!==undefined)returnhu(Math.max(r.pageLeft,o.left()),Math.max(r.pageTop,o.top()),r.width,r.height);vari=e.documentElement,u=i.clientWidth,a=i.clientHeight;returnhu(o.left(),o.top(),u,a)}functionbu(o){varn=we.fromDom(v.document),r=pu(n);returnfunction(n,t){vare=t.owner(n),o=Nu(t,e);returnon.some(o)}(o,Hu).fold(d(du,o),function(n){vart=Ru(o),e=k(n,function(n,t){vare=Ru(t);return{left:n.left+e.left(),top:n.top+e.top()}},{left:0,top:0});returnIu(e.left+t.left()+r.left(),e.top+t.top()+r.top())})}functionyu(n,t,e,o){return{x:nn(n),y:nn(t),width:nn(e),height:nn(o),right:nn(n+e),bottom:nn(t+o)}}functionxu(n){vart=du(n),e=gu(n),o=fu(n);returnyu(t.left(),t.top(),e,o)}functionwu(n){vart=bu(n),e=gu(n),o=fu(n);returnyu(t.left(),t.top(),e,o)}functionSu(){returnvu(v.window)}functionCu(n,t,e){returnQe(n,function(n){returnPt(n,t)},e)}functionku(n,t){returnfunction(n,t){vare=t===undefined?v.document:t.dom();returnzt(e)?on.none():on.from(e.querySelector(n)).map(we.fromDom)}(t,n)}functionOu(n,t,e){returnqe(Pt,Cu,n,t,e)}functionEu(){vart=Xo("aria-owns");return{id:nn(t),link:function(n){Po(n,"aria-owns",t)},unlink:function(n){jo(n,"aria-owns")}}}functionTu(t,n){returnfunction(n){returnZe(n,function(n){if(!Hr(n))return!1;vart=zo(n,"id");returnt!==undefined&&-1<t.indexOf("aria-owns")}).bind(function(n){vart=zo(n,"id"),e=Co(n);returnku(e,'[aria-owns="'+t+'"]')})}(n).exists(function(n){returnLu(t,n)})}functionBu(n){for(vart=[],e=function(n){t.push(n)},o=0;o<n.length;o++)n[o].each(e);returnt}functionDu(n,t){for(vare=0;e<n.length;e++){varo=t(n[e],e);if(o.isSome())returno}returnon.none()}varAu,_u,Mu=cu("height",function(n){vart=n.dom();return$e(n)?t.getBoundingClientRect().height:t.offsetHeight}),Fu=function(e,o){return{left:nn(e),top:nn(o),translate:function(n,t){returnFu(e+n,o+t)}}},Iu=Fu,Ru=function(n){vart=n.dom(),e=t.ownerDocument.body;returne===t?Iu(e.offsetLeft,e.offsetTop):$e(n)?function(n){vart=n.getBoundingClientRect();returnIu(t.left,t.top)}(t):Iu(0,0)},Vu=cu("width",function(n){returnn.dom().offsetWidth}),Nu=(Ht().browser.isSafari(),function(o,n){returno.view(n).fold(nn([]),function(n){vart=o.owner(n),e=Nu(o,t);return[n].concat(e)})}),Hu=/* */Object.freeze({view:function(n){return(n.dom()===v.document?on.none():on.from(n.dom().defaultView.frameElement)).map(we.fromDom)},owner:function(n){returnCo(n)}}),Pu=yo("point","width","height"),zu=yo("x","y","width","height"),Lu=function(t,n){returnfunction(n,t,e){returnZe(n,t,e).isSome()}(n,function(n){returnjt(n,t.element())},nn(!1))||Tu(t,n)},ju="unknown";(_u=Au=Au||{})[_u.STOP=0]="STOP",_u[_u.NORMAL=1]="NORMAL",_u[_u.LOGGING=2]="LOGGING";functionUu(t,n,e){switch(Nn(Pa.get(),t).orThunk(function(){varn=wn(Pa.get());returnDu(n,function(n){return-1<t.indexOf(n)?on.some(Pa.get()[n]):on.none()})}).getOr(Au.NORMAL)){caseAu.NORMAL:returne(La());caseAu.LOGGING:varo=function(t,e){varo=[],r=(newDate).getTime();return{logEventCut:function(n,t,e){o.push({outcome:"cut",target:t,purpose:e})},logEventStopped:function(n,t,e){o.push({outcome:"stopped",target:t,purpose:e})},logNoParent:function(n,t,e){o.push({outcome:"no-parent",target:t,purpose:e})},logEventNoHandlers:function(n,t){o.push({outcome:"no-handlers-left",target:t})},logEventResponse:function(n,t,e){o.push({outcome:"response",purpose:e,target:t})},write:function(){varn=(newDate).getTime();vn(["mousemove","mouseover","mouseout",bi()],t)||v.console.log(t,{event:t,time:n-r,target:e.dom(),sequence:S(o,function(n){returnvn(["cut","stopped","response"],n.outcome)?"{"+n.purpose+"} "+n.outcome+" at ("+Go(n.target)+")":n.outcome})})}}}(t,n),r=e(o);returno.write(),r;caseAu.STOP:return!0}}functionWu(n,t,e){returnUu(n,t,e)}functionGu(){returnmt("markers",[ct("backgroundMenu")].concat(ja()).concat(Ua()))}functionXu(n){returnmt("markers",S(n,ct))}functionYu(n,t,e){returnfunction(){varn=newError;if(n.stack===undefined)return;vart=n.stack.split("\n");E(t,function(t){return0<t.indexOf("alloy")&&!x(za,function(n){return-1<t.indexOf(n)})}).getOr(ju)}(),ce(t,t,e,Zn(function(e){returnan.value(function(){for(varn=[],t=0;t<arguments.length;t++)n[t]=arguments[t];returne.apply(undefined,n)})}))}functionqu(n){returnYu(0,n,j(Z))}functionKu(n){returnYu(0,n,j(on.none))}functionJu(n){returnYu(0,n,Mn())}function$u(n){returnYu(0,n,Mn())}functionQu(n,t){returnAt(n,nn(t))}functionZu(n){returnAt(n,l)}functionna(n){returnn.x()}functionta(n,t){returnn.x()+n.width()/2-t.width()/2}functionea(n,t){returnn.x()+n.width()-t.width()}functionoa(n,t){returnn.y()-t.height()}functionra(n){returnn.y()+n.height()}functionia(n,t){returnn.y()+n.height()/2-t.height()/2}functionua(n,t,e){returnYa(na(n),ra(n),e.southeast(),Ka(),"layout-se")}functionaa(n,t,e){returnYa(ea(n,t),ra(n),e.southwest(),Ja(),"layout-sw")}functionca(n,t,e){returnYa(na(n),oa(n,t),e.northeast(),$a(),"layout-ne")}functionsa(n,t,e){returnYa(ea(n,t),oa(n,t),e.northwest(),Qa(),"layout-nw")}functionfa(n,t,e){returnYa(function(n){returnn.x()+n.width()}(n),ia(n,t),e.east(),tc(),"layout-e")}functionla(n,t,e){returnYa(function(n,t){returnn.x()-t.width()}(n,t),ia(n,t),e.west(),ec(),"layout-w")}functionda(){return[ua,aa,ca,sa,rc,oc]}functionma(){return[aa,ua,sa,ca,rc,oc]}functionga(e,o,r){returnVi(function(n,t){r(n,e,o)})}functionpa(n,t,e,o,r,i){varu=qn(n),a=wt(t,[function(n,t){returnvt(n,qn(t))}("config",n)]);returnic(u,a,t,e,o,r,i)}functionha(r,i,u){returnfunction(n,t,e){varo=e.toString(),r=o.indexOf(")")+1,i=o.indexOf("("),u=o.substring(i+1,r-1).split(/,\s*/);returnn.toFunctionAnnotation=function(){return{name:t,parameters:$i(u.slice(0,1).concat(u.slice(3)))}},n}(function(e){for(varn=[],t=1;t<arguments.length;t++)n[t-1]=arguments[t];varo=[e].concat(n);returne.config({name:nn(r)}).fold(function(){thrownewError("We could not find any behaviour configuration for: "+r+". Using API: "+u)},function(n){vart=Array.prototype.slice.call(o,1);returni.apply(undefined,[e,n.config,n.state].concat(t))})},u,i)}functionva(n){return{key:n,value:undefined}}functionba(n){returnK(n)}functionya(n){vart=ot("Creating behaviour: "+n.name,uc,n);returnpa(t.fields,t.name,t.active,t.apis,t.extra,t.state)}functionxa(n){vart=ot("Creating behaviour: "+n.name,ac,n);returnfunction(n,t,e,o,r,i){varu=n,a=wt(t,[vt("config",n)]);returnic(u,a,t,e,o,r,i)}(it(t.branchKey,t.branches),t.name,t.active,t.apis,t.extra,t.state)}functionwa(n){n.dom().focus()}functionSa(n){vart=n!==undefined?n.dom():v.document;returnon.from(t.activeElement).map(we.fromDom)}functionCa(t){returnSa(Co(t)).filter(function(n){returnt.dom().contains(n.dom())})}functionka(n,e){varo=Co(e),t=Sa(o).bind(function(t){functionn(n){returnjt(t,n)}returnn(e)?on.some(e):no(e,n)}),r=n(e);returnt.each(function(t){Sa(o).filter(function(n){returnjt(n,t)}).fold(function(){wa(t)},Z)}),r}functionOa(n,t,e){functionr(n){returnNn(e,n).getOr([])}functiono(n,t,e){varo=_(mc,e);return{offset:function(){returnIu(n,t)},classesOn:function(){returnB(e,r)},classesOff:function(){returnB(o,r)}}}return{southeast:function(){returno(-n,t,["top","alignLeft"])},southwest:function(){returno(n,t,["top","alignRight"])},south:function(){returno(-n/2,t,["top","alignCentre"])},northeast:function(){returno(-n,-t,["bottom","alignLeft"])},northwest:function(){returno(n,-t,["bottom","alignRight"])},north:function(){returno(-n/2,-t,["bottom","alignCentre"])},east:function(){returno(n,-t/2,["valignCentre","left"])},west:function(){returno(-n,-t/2,["valignCentre","right"])},innerNorthwest:function(){returno(-n,t,["top","alignRight"])},innerNortheast:function(){returno(n,t,["top","alignLeft"])},innerNorth:function(){returno(-n/2,t,["top","alignCentre"])},innerSouthwest:function(){returno(-n,-t,["bottom","alignRight"])},innerSoutheast:function(){returno(n,-t,["bottom","alignLeft"])},innerSouth:function(){returno(-n/2,-t,["bottom","alignCentre"])},innerWest:function(){returno(n,-t/2,["valignCentre","right"])},innerEast:function(){returno(-n,-t/2,["valignCentre","left"])}}}functionEa(){returnOa(0,0,{})}functionTa(n,t,e,o,r,i){varu=t.x()-e,a=t.y()-o,c=r-(u+t.width()),s=i-(a+t.height()),f=on.some(u),l=on.some(a),d=on.some(c),m=on.some(s),g=on.none();returnfunction(n,t,e,o,r,i,u,a,c){returnn.fold(t,e,o,r,i,u,a,c)}(t.direction(),function(){returnpc(n,f,l,g,g)},function(){returnpc(n,g,l,d,g)},function(){returnpc(n,f,g,g,m)},function(){returnpc(n,g,g,d,m)},function(){returnpc(n,f,l,g,g)},function(){returnpc(n,f,g,g,m)},function(){returnpc(n,f,l,g,g)},function(){returnpc(n,g,l,d,g)})}functionBa(n,t){vare=d(bu,t),o=n.fold(e,e,function(){varn=pu();returnbu(t).translate(-n.left(),-n.top())}),r=gu(t),i=fu(t);returnyu(o.left(),o.top(),r,i)}functionDa(n){returnn}functionAa(t,e){returnfunction(n){return"rtl"===xc(n)?e:t}}function_a(){returnwt("layouts",[ct("onLtr"),ct("onRtl")])}functionMa(t,n,e,o){varr=n.layouts.map(function(n){returnn.onLtr(t)}).getOr(e),i=n.layouts.map(function(n){returnn.onRtl(t)}).getOr(o);returnAa(r,i)(t)}functionFa(n,t,e){varo=n.document.createRange();returnfunction(e,n){n.fold(function(n){e.setStartBefore(n.dom())},function(n,t){e.setStart(n.dom(),t)},function(n){e.setStartAfter(n.dom())})}(o,t),function(e,n){n.fold(function(n){e.setEndBefore(n.dom())},function(n,t){e.setEnd(n.dom(),t)},function(n){e.setEndAfter(n.dom())})}(o,e),o}functionIa(n,t,e,o,r){vari=n.document.createRange();returni.setStart(t.dom(),e),i.setEnd(o.dom(),r),i}functionRa(n){return{left:nn(n.left),top:nn(n.top),right:nn(n.right),bottom:nn(n.bottom),width:nn(n.width),height:nn(n.height)}}functionVa(n,t,e){returnt(we.fromDom(e.startContainer),e.startOffset,we.fromDom(e.endContainer),e.endOffset)}functionNa(n,t){returnfunction(n,t){vare=t.ltr();returne.collapsed?t.rtl().filter(function(n){return!1===n.collapsed}).map(function(n){returnBc.rtl(we.fromDom(n.endContainer),n.endOffset,we.fromDom(n.startContainer),n.startOffset)}).getOrThunk(function(){returnVa(0,Bc.ltr,e)}):Va(0,Bc.ltr,e)}(0,function(r,n){returnn.match({domRange:function(n){return{ltr:nn(n),rtl:on.none}},relative:function(n,t){return{ltr:L(function(){returnFa(r,n,t)}),rtl:L(function(){returnon.some(Fa(r,t,n))})}},exact:function(n,t,e,o){return{ltr:L(function(){returnIa(r,n,t,e,o)}),rtl:L(function(){returnon.some(Ia(r,e,o,n,t))})}}})}(n,t))}functionHa(n,t,e){returnt>=n.left&&t<=n.right&&e>=n.top&&e<=n.bottom}varPa=ye({}),za=["alloy/data/Fields","alloy/debugging/Debugging"],La=nn({logEventCut:Z,logEventStopped:Z,logNoParent:Z,logEventNoHandlers:Z,logEventResponse:Z,write:Z}),ja=nn([ct("menu"),ct("selectedMenu")]),Ua=nn([ct("item"),ct("selectedItem")]),Wa=(nn(re(Ua().concat(ja()))),nn(re(Ua()))),Ga=mt("initSize",[ct("numColumns"),ct("numRows")]),Xa=nn(Ga),Ya=yo("x","y","bubble","direction","label"),qa=Tn([{southeast:[]},{southwest:[]},{northeast:[]},{northwest:[]},{south:[]},{north:[]},{east:[]},{west:[]}]),Ka=qa.southeast,Ja=qa.southwest,$a=qa.northeast,Qa=qa.northwest,Za=qa.south,nc=qa.north,tc=qa.east,ec=qa.west,oc=function(n,t,e){returnYa(ta(n,t),oa(n,t),e.north(),nc(),"layout-n")},rc=function(n,t,e){returnYa(ta(n,t),ra(n),e.south(),Za(),"layout-s")},ic=function(e,n,o,r,t,i,u){functiona(n){return$(n,o)?n[o]():on.none()}varc=P(t,function(n,t){returnha(o,n,t)}),s=P(i,function(n,t){returnKo(n,t)}),f=N(N(N({},s),c),{revoke:d(va,o),config:function(n){vart=ot(o+"-config",e,n);return{key:o,value:{config:t,me:f,configAsRaw:L(function(){returnot(o+"-config",e,n)}),initialConfig:n,state:u}}},schema:function(){returnn},exhibit:function(n,e){returna(n).bind(function(t){returnNn(r,"exhibit").map(function(n){returnn(e,t.config,t.state)})}).getOr(Zo({}))},name:function(){returno},handlers:function(n){returna(n).map(function(n){returnY("events",function(n,t){return{}})(r)(n.config,n.state)}).getOr({})}});returnf},uc=qn([ct("fields"),ct("name"),St("active",{}),St("apis",{}),St("state",Zi),St("extra",{})]),ac=qn([ct("branchKey"),ct("branches"),ct("name"),St("active",{}),St("apis",{}),St("state",Zi),St("extra",{})]),cc=nn(undefined),sc=/* */Object.freeze({events:function(t){returnco([lo(li(),function(r,i){varu=t.channels,n=function(n,t){returnt.universal()?n:C(n,function(n){returnvn(t.channels(),n)})}(wn(u),i);bn(n,function(n){vart=u[n],e=t.schema,o=ot("channel["+n+"] data\nReceiver: "+Go(r.element()),e,i.data());t.onReceive(r,o)})})])}}),fc=[st("channels",nt(an.value,qn([Ju("onReceive"),St("schema",de())])))],lc=ya({fields:fc,name:"receiving",active:sc}),dc=/* */Object.freeze({exhibit:function(n,t){returnZo({classes:[],styles:t.useFixed()?{}:{position:"relative"}})}}),mc=["valignCentre","alignLeft","alignRight","alignCentre","top","bottom","left","right"],gc=So(["x","y","width","height","maxHeight","maxWidth","direction","classes","label","candidateYforTest"],[]),pc=yo("position","left","top","right","bottom"),hc=Tn([{none:[]},{relative:["x","y","width","height"]},{fixed:["x","y","width","height"]}]),vc=function(n,t,e){varo=Iu(t,e);returnn.fold(nn(o),nn(o),function(){varn=pu();returno.translate(-n.left(),-n.top())})},bc=hc.relative,yc=hc.fixed,xc=function(n){return"rtl"===wr(n,"direction")?"rtl":"ltr"},wc=[ct("hotspot"),ht("bubble"),St("overrides",{}),_a(),Qu("placement",function(n,t,e){varo=t.hotspot,r=Ba(e,o.element()),i=Ma(n.element(),t,da(),ma());returnon.some(Da({anchorBox:r,bubble:t.bubble.getOr(Ea()),overrides:t.overrides,layouts:i,placer:on.none()}))})],Sc=[ct("x"),ct("y"),St("height",0),St("width",0),St("bubble",Ea()),St("overrides",{}),_a(),Qu("placement",function(n,t,e){varo=vc(e,t.x,t.y),r=yu(o.left(),o.top(),t.width,t.height),i=Ma(n.element(),t,[ua,aa,ca,sa,rc,oc,fa,la],[aa,ua,sa,ca,rc,oc,fa,la]);returnon.some(Da({anchorBox:r,bubble:t.bubble,overrides:t.overrides,layouts:i,placer:on.none()}))})],Cc={create:yo("start","soffset","finish","foffset")},kc=Tn([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Oc=(kc.before,kc.on,kc.after,function(n){returnn.fold(l,l,l)}),Ec=Tn([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Tc={domRange:Ec.domRange,relative:Ec.relative,exact:Ec.exact,exactFromRange:function(n){returnEc.exact(n.start(),n.soffset(),n.finish(),n.foffset())},getWin:function(n){vart=function(n){returnn.match({domRange:function(n){returnwe.fromDom(n.startContainer)},relative:function(n,t){returnOc(n)},exact:function(n,t,e,o){returnn}})}(n);returnOo(t)},range:Cc.create},Bc=Tn([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]);functionDc(n){returnrf.get(n)}functionAc(n){returnrf.getOption(n)}function_c(e,o,n,t,r){functioni(n){vart=e.dom().createRange();returnt.setStart(o.dom(),n),t.collapse(!0),t}varu=Dc(o).length,a=function(n,t,e,o,r){if(0===r)return0;if(t===o)returnr-1;for(vari=o,u=1;u<r;u++){vara=n(u),c=Math.abs(t-a.left);if(e<=a.bottom){if(e<a.top||i<c)returnu-1;i=c}}return0}(function(n){returni(n).getBoundingClientRect()},n,t,r.right,u);returni(a)}functionMc(n){returnfunction(n){returnAc(n).filter(function(n){return0!==n.trim().length||-1<n.indexOf("\xa0")}).isSome()}(n)||vn(af,Ke(n))}functionFc(n){returnno(n,Mc)}functionIc(n){returncf(n,Mc)}functionRc(n,t){returnt-n.left<n.right-t}functionVc(n,t,e){varo=n.dom().createRange();returno.selectNode(t.dom()),o.collapse(e),o}functionNc(t,n,e){varo=t.dom().createRange();o.selectNode(n.dom());varr=o.getBoundingClientRect(),i=Rc(r,e);return(!0===i?Fc:Ic)(n).map(function(n){returnVc(t,n,i)})}functionHc(n,t,e){varo=t.dom().getBoundingClientRect(),r=Rc(o,e);returnon.some(Vc(n,t,r))}functionPc(n,t,e,o){varr=n.dom().createRange();r.selectNode(t.dom());vari=r.getBoundingClientRect();returnfunction(n,t,e,o){varr=n.dom().createRange();r.selectNode(t.dom());vari=r.getBoundingClientRect(),u=Math.max(i.left,Math.min(i.right,e)),a=Math.max(i.top,Math.min(i.bottom,o));returnuf(n,t,u,a)}(n,t,Math.max(i.left,Math.min(i.right,e)),Math.max(i.top,Math.min(i.bottom,o)))}functionzc(n,t){returnLt(t,n)}functionLc(n,t,e,o){varr=function(n,t,e,o){varr=Co(n).dom().createRange();returnr.setStart(n.dom(),t),r.setEnd(e.dom(),o),r}(n,t,e,o),i=jt(n,e)&&t===o;returnr.collapsed&&!i}functionjc(n){vart=we.fromDom(n.anchorNode),e=we.fromDom(n.focusNode);returnLc(t,n.anchorOffset,e,n.focusOffset)?on.some(Cc.create(t,n.anchorOffset,e,n.focusOffset)):function(n){if(0<n.rangeCount){vart=n.getRangeAt(0),e=n.getRangeAt(n.rangeCount-1);returnon.some(Cc.create(we.fromDom(t.startContainer),t.startOffset,we.fromDom(e.endContainer),e.endOffset))}returnon.none()}(n)}functionUc(n,t){returnfunction(n){vart=n.getClientRects(),e=0<t.length?t[0]:n.getBoundingClientRect();return0<e.width||0<e.height?on.some(e).map(Ra):on.none()}(function(i,n){returnNa(i,n).match({ltr:function(n,t,e,o){varr=i.document.createRange();returnr.setStart(n.dom(),t),r.setEnd(e.dom(),o),r},rtl:function(n,t,e,o){varr=i.document.createRange();returnr.setStart(e.dom(),o),r.setEnd(n.dom(),t),r}})}(n,t))}functionWc(n){returnn.fold(function(n){returnn},function(n,t,e){returnn.translate(-t,-e)})}functionGc(n){returnn.fold(function(n){returnn},function(n,t,e){returnn})}functionXc(n){returnO(n,function(n,t){returnn.translate(t.left(),t.top())},Iu(0,0))}functionYc(n){vart=S(n,Gc);returnXc(t)}functionqc(n,t,e){varo=Co(n.element()),r=pu(o),i=function(o,n,t){vare=Oo(t.root).dom();returnon.from(e.frameElement).map(we.fromDom).filter(function(n){vart=Co(n),e=Co(o.element());returnjt(t,e)}).map(du)}(n,0,e).getOr(r);returndf(i,r.left(),r.top())}functionKc(n,t){returnPr(n)?pf(n,t):function(n,t){vare=Bo(n);if(0===e.length)returnsf(n,t);if(t<e.length)returnsf(e[t],0);varo=e[e.length-1],r=Pr(o)?Dc(o).length:Bo(o).length;returnsf(o,r)}(n,t)}functionJc(n,t){returnt.getSelection.getOrThunk(function(){returnfunction(){returnfunction(n){returnon.from(n.getSelection()).filter(function(n){return0<n.rangeCount}).bind(jc)}(n)}})().map(function(n){vart=Kc(n.start(),n.soffset()),e=Kc(n.finish(),n.foffset());returnTc.range(t.element(),t.offset(),e.element(),e.offset())})}function$c(n){returnn.x()+n.width()}functionQc(n,t){returnn.x()-t.width()}functionZc(n,t){returnn.y()-t.height()+n.height()}functionns(n){returnn.y()}functionts(n,t,e){returnYa($c(n),ns(n),e.southeast(),Ka(),"link-layout-se")}functiones(n,t,e){returnYa(Qc(n,t),ns(n),e.southwest(),Ja(),"link-layout-sw")}functionos(n,t,e){returnYa($c(n),Zc(n,t),e.northeast(),$a(),"link-layout-ne")}functionrs(n,t,e){returnYa(Qc(n,t),Zc(n,t),e.northwest(),Qa(),"link-layout-nw")}functionis(n,t,e,o){varr=n+t;returno<r?e:r<e?o:r}functionus(n,t,e){returnn<=t?t:e<=n?e:n}functionas(n,t,e,o){varr=n.x(),i=n.y(),u=n.bubble().offset().left(),a=n.bubble().offset().top(),c=o.y(),s=o.bottom(),f=o.x(),l=o.right(),d=i+a,m=function(n,t,e,o,r){vari=r.x(),u=r.y(),a=r.width(),c=r.height(),s=i<=n,f=u<=t,l=s&&f,d=n+e<=i+a&&t+o<=u+c,m=Math.abs(Math.min(e,s?i+a-n:i-(n+e))),g=Math.abs(Math.min(o,f?u+c-t:u-(t+o)));return{originInBounds:l,sizeInBounds:d,limitX:us(n,r.x(),r.right()),limitY:us(t,r.y(),r.bottom()),deltaW:m,deltaH:g}}(r+u,d,t,e,o),g=m.originInBounds,p=m.sizeInBounds,h=m.limitX,v=m.limitY,b=m.deltaW,y=m.deltaH,x=nn(v+y-c),w=nn(s-v),S=function(n,t,e,o){returnn.fold(t,t,o,o,t,o,e,e)}(n.direction(),w,w,x),C=nn(h+b-f),k=nn(l-h),O=function(n,t,e,o){returnn.fold(t,o,t,o,e,e,t,o)}(n.direction(),k,k,C),E=gc({x:h,y:v,width:b,height:y,maxHeight:S,maxWidth:O,direction:n.direction(),classes:{on:n.bubble().classesOn(),off:n.bubble().classesOff()},label:n.label(),candidateYforTest:d});returng&&p?wf.fit(E):wf.nofit(E,b,y)}functioncs(n,t,e,o){kr(t,"max-height"),kr(t,"max-width");varr=function(n){return{width:nn(gu(n)),height:nn(fu(n))}}(t);returnfunction(n,e,u,a,c){functiono(n,o,r,i){vart=n(e,u,a);returnas(t,s,f,c).fold(wf.fit,function(n,t,e){returni<e||r<t?wf.nofit(n,t,e):wf.nofit(o,r,i)})}vars=u.width(),f=u.height();returnO(n,function(n,t){vare=d(o,t);returnn.fold(wf.fit,e)},wf.nofit(gc({x:e.x(),y:e.y(),width:u.width(),height:u.height(),maxHeight:u.height(),maxWidth:u.width(),direction:Ka(),classes:{on:[],off:[]},label:"none",candidateYforTest:e.y()}),-1,-1)).fold(l,l)}(o.preference(),n,r,e,o.bounds())}functionss(n,t,e){functiono(n){returnn+"px"}varr=function(n,r){returnn.fold(function(){returnpc("absolute",on.some(r.x()),on.some(r.y()),on.none(),on.none())},function(n,t,e,o){returnTa("absolute",r,n,t,e,o)},function(n,t,e,o){returnTa("fixed",r,n,t,e,o)})}(e.origin(),t);!function(n,t){vare=n.dom();Cn(t,function(n,t){n.fold(function(){br(e,t)},function(n){vr(e,t,n)})})}(n,{position:on.some(r.position()),left:r.left().map(o),top:r.top().map(o),right:r.right().map(o),bottom:r.bottom().map(o)})}functionfs(n,t){!function(n,t){vare=Mu.max(n,t,["margin-top","border-top-width","padding-top","padding-bottom","border-bottom-width","margin-bottom"]);yr(n,"max-height",e+"px")}(n,Math.floor(t))}functionls(n,t,e){returnn[t]===undefined?e:n[t]}functionds(n,t,e,o,r,i){varu=ls(i,"maxHeightFunction",Sf()),a=ls(i,"maxWidthFunction",Z),c=n.anchorBox(),s=n.origin(),f=kf({bounds:function(o,n){returnn.fold(function(){returno.fold(Su,Su,yu)},function(e){returno.fold(e,e,function(){varn=e(),t=vc(o,n.x(),n.y());returnyu(t.left(),t.top(),n.width(),n.height())})})}(s,r),origin:s,preference:o,maxHeightFunction:u,maxWidthFunction:a});Of(c,t,e,f)}functionms(n,t,e,o,r){vari=function(n,t){returnxf(n,t)}(e.anchorBox,t);ds(i,r.element(),e.bubble,e.layouts,o,e.overrides)}functiongs(n,t){Hi(n.element(),t.element())}functionps(t,n){vare=t.components();!function(n){bn(n.components(),function(n){returnPi(n.element())}),Io(n.element()),n.syncComponents()}(t);varo=_(e,n);bn(o,function(n){_f(n),t.getSystem().removeFromWorld(n)}),bn(n,function(n){n.getSystem().isConnected()?gs(t,n):(t.getSystem().addToWorld(n),gs(t,n),$e(t.element())&&Mf(n)),t.syncComponents()})}functionhs(n,t){Ff(n,t,Hi)}functionvs(n){_f(n),Pi(n.element()),n.getSystem().removeFromWorld(n)}functionbs(t){varn=Eo(t.element()).bind(function(n){returnt.getSystem().getByDom(n).toOption()});vs(t),n.each(function(n){n.syncComponents()})}functionys(n){vart=n.components();bn(t,vs),Io(n.element()),n.syncComponents()}functionxs(n,t){If(n,t,Hi)}functionws(t){varn=Bo(t.element());bn(n,function(n){t.getByDom(n).each(_f)}),Pi(t.element())}functionSs(t,n,e,o){e.get().each(function(n){ys(t)});varr=n.getAttachPoint(t);hs(r,t);vari=t.getSystem().build(o);returnhs(t,i),e.set(i),i}functionCs(n,t,e,o){varr=Ss(n,t,e,o);returnt.onOpen(n,r),r}functionks(t,e,o){o.get().each(function(n){ys(t),bs(t),e.onClose(t,n),o.clear()})}functionOs(n,t,e){returne.isOpen()}functionEs(n){vart,e=ot("Dismissal",Wf,n);return(t={})[Lf()]={schema:qn([ct("target")]),onReceive:function(t,n){zf.isOpen(t)&&(zf.isPartOf(t,n.target)||e.isExtraPart(t,n.target)||e.fireEventInstead.fold(function(){returnzf.close(t)},function(n){returnoo(t,n.event)}))}},t}functionTs(n){vart,e=ot("Reposition",Gf,n);return(t={})[jf()]={onReceive:function(t){zf.isOpen(t)&&e.fireEventInstead.fold(function(){returne.doReposition(t)},function(n){returnoo(t,n.event)})}},t}functionBs(n,t,e){t.store.manager.onLoad(n,t,e)}functionDs(n,t,e){t.store.manager.onUnload(n,t,e)}functionAs(){varn=ye(null);returnnu({set:n.set,get:n.get,isNotSet:function(){returnnull===n.get()},clear:function(){n.set(null)},readState:function(){return{mode:"memory",value:n.get()}}})}function_s(){vari=ye({}),u=ye({});returnnu({readState:function(){return{mode:"dataset",dataByValue:i.get(),dataByText:u.get()}},lookup:function(n){returnNn(i.get(),n).orThunk(function(){returnNn(u.get(),n)})},update:function(n){vart=i.get(),e=u.get(),o={},r={};bn(n,function(t){o[t.value]=t,Nn(t,"meta").each(function(n){Nn(n,"text").each(function(n){r[n]=t})})}),i.set(N(N({},t),o)),u.set(N(N({},e),r))},clear:function(){i.set({}),u.set({})}})}functionMs(n,t,e,o){varr=t.store;e.update([o]),r.setValue(n,o),t.onSetValue(n,o)}functionFs(t,n){returnDt(t,{},S(n,function(n){returnfunction(t,e){returnce(t,t,Fn(),Yn(function(n){returnqt("The field: "+t+" is forbidden. "+e)}))}(n.name(),"Cannot configure "+n.name()+" for "+t)}).concat([At("dump",l)]))}functionIs(n){returnn.dump}functionRs(n,t){returnN(N({},n.dump),ba(t))}functionVs(n,t,e,o){returne.uiType===el?function(n,t,e,o){returnn.exists(function(n){returnn!==e.owner})?ol.single(!0,nn(e)):Nn(o,e.name).fold(function(){thrownewError("Unknown placeholder component: "+e.name+"\nKnown: ["+wn(o)+"]\nNamespace: "+n.getOr("none")+"\nSpec: "+JSON.stringify(e,null,2))},function(n){returnn.replace()})}(n,0,e,o):ol.single(!1,nn(e))}functionNs(t,e,n,o){varr=P(o,function(n,t){returnfunction(n,t){vare=!1;return{name:nn(n),required:function(){returnt.fold(function(n,t){returnn},function(n,t){returnn})},used:function(){returne},replace:function(){if(!0===e)thrownewError("Trying to use the same placeholder more than once: "+n);returne=!0,t}}}(t,n)}),i=function(t,e,n,o){returnB(n,function(n){returnrl(t,e,n,o)})}(t,e,n,r);returnCn(r,function(n){if(!1===n.used()&&n.required())thrownewError("Placeholder: "+n.name()+" was not found in components list\nNamespace: "+t.getOr("none")+"\nComponents: "+JSON.stringify(e.components,null,2))}),i}functionHs(n){returnn.fold(on.some,on.none,on.some,on.some)}functionPs(n){functiont(n){returnn.name}returnn.fold(t,t,t,t)}functionzs(e,o){returnfunction(n){vart=ot("Converting part type",o,n);returne(t)}}functionLs(n,t,e,o){returnDn(t.defaults(n,e,o),e,{uid:n.partUids[t.name]},t.overrides(n,e,o))}functionjs(r,n){vart={};returnbn(n,function(n){Hs(n).each(function(e){varo=El(r,e.pname);t[e.name]=function(n){vart=ot("Part: "+e.name+" in "+r,re(e.schema),n);returnN(N({},o),{config:n,validated:t})}})}),t}functionUs(n,t,e){return{uiType:al(),owner:n,name:t,config:e,validated:{}}}functionWs(n){returnB(n,function(n){returnn.fold(on.none,on.some,on.none,on.none).map(function(n){returnmt(n.name,n.schema.concat([Zu(kl())]))}).toArray()})}functionGs(n){returnS(n,Ps)}functionXs(n,t,e){returnfunction(n,e,t){vari={},o={};returnbn(t,function(n){n.fold(function(o){i[o.pname]=il(!0,function(n,t,e){returno.factory.sketch(Ls(n,o,t,e))})},function(n){vart=e.parts[n.name];o[n.name]=nn(n.factory.sketch(Ls(e,n,t[kl()]),t))},function(o){i[o.pname]=il(!1,function(n,t,e){returno.factory.sketch(Ls(n,o,t,e))})},function(r){i[r.pname]=ul(!0,function(t,n,e){varo=t[r.name];returnS(o,function(n){returnr.factory.sketch(Dn(r.defaults(t,n,e),n,r.overrides(t,n)))})})})}),{internals:nn(i),externals:nn(o)}}(0,t,e)}functionYs(n,t,e){returnNs(on.some(n),t,t.components,e)}functionqs(n,t,e){varo=t.partUids[e];returnn.getSystem().getByUid(o).toOption()}functionKs(n,t,e){returnqs(n,t,e).getOrDie("Could not find part: "+e)}functionJs(n,t,e){varo={},r=t.partUids,i=n.getSystem();returnbn(e,function(n){o[n]=nn(i.getByUid(r[n]))}),o}function$s(n,t){vare=n.getSystem();returnP(t.partUids,function(n,t){returnnn(e.getByUid(n))})}functionQs(n){returnwn(n.partUids)}functionZs(n,t,e){varo={},r=t.partUids,i=n.getSystem();returnbn(e,function(n){o[n]=nn(i.getByUid(r[n]).getOrDie())}),o}functionnf(t,n){vare=Gs(n);returnK(S(e,function(n){return{key:n,value:t+"-"+n}}))}functiontf(t){returnce("partUids","partUids",Rn(function(n){returnnf(n.uid,t)}),de())}functionef(n,t,e,o,r){vari=function(n,t){return(0<n.length?[mt("parts",n)]:[]).concat([ct("uid"),St("dom",{}),St("components",[]),Zu("originalSpec"),St("debug.sketcher",{})]).concat(t)}(o,r);returnot(n+" [SpecSchema]",qn(i.concat(t)),e)}functionof(n,t,e,o,r){vari=Bl(r),u=Ws(e),a=tf(e),c=ef(n,t,i,u,[a]),s=Xs(0,c,e);returno(c,Ys(n,c,s.internals()),i,s.externals())}varrf=functionrI(e,o){vart=function(n){returne(n)?on.from(n.dom().nodeValue):on.none()};return{get:function(n){if(!e(n))thrownewError("Can only get "+o+" value of a "+o+" node");returnt(n).getOr("")},getOption:t,set:function(n,t){if(!e(n))thrownewError("Can only set raw "+o+" value of a "+o+" node");n.dom().nodeValue=t}}}(Pr,"text"),uf=function(n,t,e,o){returnPr(t)?function(t,e,o,r){varn=t.dom().createRange();n.selectNode(e.dom());vari=n.getClientRects();returnDu(i,function(n){returnHa(n,o,r)?on.some(n):on.none()}).map(function(n){return_c(t,e,o,r,n)})}(n,t,e,o):function(t,n,e,o){varr=t.dom().createRange(),i=Bo(n);returnDu(i,function(n){returnr.selectNode(n.dom()),Ha(r.getBoundingClientRect(),e,o)?uf(t,n,e,o):on.none()})}(n,t,e,o)},af=["img","br"],cf=function(n,i){varu=function(n){for(vart=Bo(n),e=t.length-1;0<=e;e--){varo=t[e];if(i(o))returnon.some(o);varr=u(o);if(r.isSome())returnr}returnon.none()};returnu(n)},sf=(document.caretPositionFromPoint||document.caretRangeFromPoint,yo("element","offset")),ff=Tn([{screen:["point"]},{absolute:["point","scrollLeft","scrollTop"]}]),lf=ff.screen,df=ff.absolute,mf=function(n,t,e,o){varr=n,i=t,u=e,a=o;n<0&&(r=0,u=e+n),t<0&&(i=0,a=o+t);varc=lf(Iu(r,i));returnon.some(Pu(c,u,a))},gf=function(n,i,u,a,c){returnn.map(function(n){vart=[i,n.point()],e=function(n,t,e,o){returnn.fold(t,e,o)}(a,function(){returnYc(t)},function(){returnYc(t)},function(){returnfunction(n){vart=S(n,Wc);returnXc(t)}(t)}),o=zu(e.left(),e.top(),n.width(),n.height()),r=Ma(c,u,u.showAbove?[ca,sa,ua,aa,oc,rc]:[ua,aa,ca,sa,rc,rc],u.showAbove?[sa,ca,aa,ua,oc,rc]:[aa,ua,sa,ca,rc,oc]);returnDa({anchorBox:o,bubble:u.bubble.getOr(Ea()),overrides:u.overrides,layouts:r,placer:on.none()})})},pf=yo("element","offset"),hf=[ht("getSelection"),ct("root"),ht("bubble"),_a(),St("overrides",{}),St("showAbove",!1),Qu("placement",function(n,t,e){varo=Oo(t.root).dom(),r=qc(n,0,t),i=Jc(o,t).bind(function(n){returnUc(o,Tc.exactFromRange(n)).orThunk(function(){vart=we.fromText("\ufeff");returnAo(n.start(),t),Uc(o,Tc.exact(t,0,t,1)).map(function(n){returnPi(t),n})}).bind(function(n){returnmf(n.left(),n.top(),n.width(),n.height())})}),u=Jc(o,t).bind(function(n){returnHr(n.start())?on.some(n.start()):Eo(n.start())}).getOr(n.element());returngf(i,r,t,e,u)})],vf=[ct("node"),ct("root"),ht("bubble"),_a(),St("overrides",{}),St("showAbove",!1),Qu("placement",function(r,i,u){vara=qc(r,0,i);returni.node.bind(function(n){vart=n.dom().getBoundingClientRect(),e=mf(t.left,t.top,t.width,t.height),o=i.node.getOr(r.element());returngf(e,a,i,u,o)})})],bf=[ct("item"),_a(),St("overrides",{}),Qu("placement",function(n,t,e){varo=Ba(e,t.item.element()),r=Ma(n.element(),t,[ts,es,os,rs],[es,ts,rs,os]);returnon.some(Da({anchorBox:o,bubble:Ea(),overrides:t.overrides,layouts:r,placer:on.none()}))})],yf=it("anchor",{selection:hf,node:vf,hotspot:wc,submenu:bf,makeshift:Sc}),xf=yo("anchorBox","origin"),wf=Tn([{fit:["reposition"]},{nofit:["reposition","deltaW","deltaH"]}]),Sf=nn(function(n,t){fs(n,t),xr(n,{"overflow-x":"hidden","overflow-y":"auto"})}),Cf=nn(function(n,t){fs(n,t)}),kf=So(["bounds","origin","preference","maxHeightFunction","maxWidthFunction"],[]),Of=function(n,t,e,o){varr=cs(n,t,e,o);ss(t,r,o),function(n,t){vare=t.classes();pr(n,e.off),gr(n,e.on)}(t,r),function(n,t,e){e.maxHeightFunction()(n,t.maxHeight())}(t,r,o),function(n,t,e){e.maxWidthFunction()(n,t.maxWidth())}(t,r,o)},Ef=function(n,t,e,o,r,i){varu=i.map(xu);returnTf(n,t,e,o,r,u)},Tf=function(r,i,n,t,u,a){varc=ot("positioning anchor.info",yf,t);ka(function(){yr(u.element(),"position","fixed");varn=Sr(u.element(),"visibility");yr(u.element(),"visibility","hidden");vart=i.useFixed()?function(){varn=v.document.documentElement;returnyc(0,0,n.clientWidth,n.clientHeight)}():function(n){vart=du(n.element()),e=n.element().dom().getBoundingClientRect();returnbc(t.left(),t.top(),e.width,e.height)}(r),e=c.placement,o=a.map(nn).or(i.getBounds);e(r,c,t).each(function(n){n.placer.getOr(ms)(r,t,n,o,u)}),n.fold(function(){kr(u.element(),"visibility")},function(n){yr(u.element(),"visibility",n)}),Sr(u.element(),"left").isNone()&&Sr(u.element(),"top").isNone()&&Sr(u.element(),"right").isNone()&&Sr(u.element(),"bottom").isNone()&&Sr(u.element(),"position").is("fixed")&&kr(u.element(),"position")},u.element())},Bf=/* */Object.freeze({position:function(n,t,e,o,r){Ef(n,t,e,o,r,on.none())},positionWithin:Ef,positionWithinBounds:Tf,getMode:function(n,t,e){returnt.useFixed()?"fixed":"absolute"}}),Df=[St("useFixed",u),ht("getBounds")],Af=ya({fields:Df,name:"positioning",active:dc,apis:Bf}),_f=function(n){oo(n,ki());vart=n.components();bn(t,_f)},Mf=function(n){vart=n.components();bn(t,Mf),oo(n,Ci())},Ff=function(n,t,e){n.getSystem().addToWorld(t),e(n.element(),t.element()),$e(n.element())&&Mf(t),n.syncComponents()},If=function(n,t,e){e(n,t.element());varo=Bo(t.element());bn(o,function(n){t.getByDom(n).each(Mf)})},Rf=function(n,t,e){varo=t.getAttachPoint(n);yr(n.element(),"position",Af.getMode(o)),function(t,n,e,o){Sr(t.element(),n).fold(function(){jo(t.element(),e)},function(n){Po(t.element(),e,n)}),yr(t.element(),n,o)}(n,"visibility",t.cloakVisibilityAttr,"hidden")},Vf=function(n,t,e){!function(t){returnx(["top","left","right","bottom"],function(n){returnSr(t,n).isSome()})}(n.element())&&kr(n.element(),"position"),function(n,t,e){if(Lo(n.element(),e)){varo=zo(n.element(),e);yr(n.element(),t,o)}elsekr(n.element(),t)}(n,"visibility",t.cloakVisibilityAttr)},Nf=/* */Object.freeze({cloak:Rf,decloak:Vf,open:Cs,openWhileCloaked:function(n,t,e,o,r){Rf(n,t),Cs(n,t,e,o),r(),Vf(n,t)},close:ks,isOpen:Os,isPartOf:function(t,e,n,o){returnOs(0,0,n)&&n.get().exists(function(n){returne.isPartOf(t,n,o)})},getState:function(n,t,e){returne.get()},setContent:function(n,t,e,o){returne.get().map(function(){returnSs(n,t,e,o)})}}),Hf=/* */Object.freeze({events:function(e,o){returnco([lo(hi(),function(n,t){ks(n,e,o)})])}}),Pf=[qu("onOpen"),qu("onClose"),ct("isPartOf"),ct("getAttachPoint"),St("cloakVisibilityAttr","data-precloak-visibility")],zf=ya({fields:Pf,name:"sandboxing",active:Hf,apis:Nf,state:/* */Object.freeze({init:function(){vart=ye(on.none()),n=nn("not-implemented");returnnu({readState:n,isOpen:function(){returnt.get().isSome()},clear:function(){t.set(on.none())},set:function(n){t.set(on.some(n))},get:function(n){returnt.get()}})}})}),Lf=nn("dismiss.popups"),jf=nn("reposition.popups"),Uf=nn("mouse.released"),Wf=qn([St("isExtraPart",nn(!1)),wt("fireEventInstead",[St("event",Oi())])]),Gf=qn([St("isExtraPart",nn(!1)),wt("fireEventInstead",[St("event",Ei())]),dt("doReposition")]),Xf=/* */Object.freeze({onLoad:Bs,onUnload:Ds,setValue:function(n,t,e,o){t.store.manager.setValue(n,t,e,o)},getValue:function(n,t,e){returnt.store.manager.getValue(n,t,e)},getState:function(n,t,e){returne}}),Yf=/* */Object.freeze({events:function(e,o){varn=e.resetOnDom?[Ii(function(n,t){Bs(n,e,o)}),Ri(function(n,t){Ds(n,e,o)})]:[ga(e,o,Bs)];returnco(n)}}),qf=/* */Object.freeze({memory:As,dataset:_s,manual:function(){returnnu({readState:function(){}})},init:function(n){returnn.store.manager.state(n)}}),Kf=[ht("initialValue"),ct("getFallbackEntry"),ct("getDataKey"),ct("setValue"),Qu("manager",{setValue:Ms,getValue:function(n,t,e){varo=t.store,r=o.getDataKey(n);returne.lookup(r).fold(function(){returno.getFallbackEntry(r)},function(n){returnn})},onLoad:function(t,e,o){e.store.initialValue.each(function(n){Ms(t,e,o,n)})},onUnload:function(n,t,e){e.clear()},state:_s})],Jf=[ct("getValue"),St("setValue",Z),ht("initialValue"),Qu("manager",{setValue:function(n,t,e,o){t.store.setValue(n,o),t.onSetValue(n,o)},getValue:function(n,t,e){returnt.store.getValue(n)},onLoad:function(t,e,n){e.store.initialValue.each(function(n){e.store.setValue(t,n)})},onUnload:Z,state:Zi.init})],$f=[ht("initialValue"),Qu("manager",{setValue:function(n,t,e,o){e.set(o),t.onSetValue(n,o)},getValue:function(n,t,e){returne.get()},onLoad:function(n,t,e){t.store.initialValue.each(function(n){e.isNotSet()&&e.set(n)})},onUnload:function(n,t,e){e.clear()},state:As})],Qf=[Ct("store",{mode:"memory"},it("mode",{memory:$f,manual:Jf,dataset:Kf})),qu("onSetValue"),St("resetOnDom",!1)],Zf=ya({fields:Qf,name:"representing",active:Yf,apis:Xf,extra:{setValueFrom:function(n,t){vare=Zf.getValue(t);Zf.setValue(n,e)}},state:qf}),nl=Fs,tl=Rs,el="placeholder",ol=Tn([{single:["required","valueThunk"]},{multiple:["required","valueThunks"]}]),rl=function(i,u,a,c){returnVs(i,0,a,c).fold(function(n,t){vare=t(u,a.config,a.validated),o=Nn(e,"components").getOr([]),r=B(o,function(n){returnrl(i,u,n,c)});return[N(N({},e),{components:r})]},function(n,t){vare=t(u,a.config,a.validated);returna.validated.preprocess.getOr(l)(e)})},il=ol.single,ul=ol.multiple,al=nn(el),cl=Tn([{required:["data"]},{external:["data"]},{optional:["data"]},{group:["data"]}]),sl=St("factory",{sketch:l}),fl=St("schema",[]),ll=ct("name"),dl=ce("pname","pname",In(function(n){return"<alloy."+Xo(n.name)+">"}),de()),ml=At("schema",function(){return[ht("preprocess")]}),gl=St("defaults",nn({})),pl=St("overrides",nn({})),hl=re([sl,fl,ll,dl,gl,pl]),vl=re([sl,fl,ll,gl,pl]),bl=re([sl,fl,ll,dl,gl,pl]),yl=re([sl,ml,ll,ct("unit"),dl,gl,pl]),xl=zs(cl.required,hl),wl=zs(cl.external,vl),Sl=zs(cl.optional,bl),Cl=zs(cl.group,yl),kl=nn("entirety"),Ol=/* */Object.freeze({required:xl,external:wl,optional:Sl,group:Cl,asNamedPart:Hs,name:Ps,asCommon:function(n){returnn.fold(l,l,l,l)},original:kl}),El=function(n,t){return{uiType:al(),owner:n,name:t}},Tl=/* */Object.freeze({generate:js,generateOne:Us,schemas:Ws,names:Gs,substitutes:Xs,components:Ys,defaultUids:nf,defaultUidsSchema:tf,getAllParts:$s,getAllPartNames:Qs,getPart:qs,getPartOrDie:Ks,getParts:Js,getPartsOrDie:Zs}),Bl=function(n){returnn.hasOwnProperty("uid")?n:N(N({},n),{uid:Yo("uid")})};functionDl(n){vart=ot("Sketcher for "+n.name,Kl,n),e=P(t.apis,$o),o=P(t.extraApis,function(n,t){returnKo(n,t)});returnN(N({name:nn(t.name),partFields:nn([]),configFields:nn(t.configFields),sketch:function(n){returnfunction(n,t,e,o){varr=Bl(o);returne(ef(n,t,r,[],[]),r)}(t.name,t.configFields,t.factory,n)}},e),o)}functionAl(n){vart=ot("Sketcher for "+n.name,Jl,n),e=js(t.name,t.partFields),o=P(t.apis,$o),r=P(t.extraApis,function(n,t){returnKo(n,t)});returnN(N({name:nn(t.name),partFields:nn(t.partFields),configFields:nn(t.configFields),sketch:function(n){returnof(t.name,t.configFields,t.partFields,t.factory,n)},parts:nn(e)},o),r)}function_l(n){return"input"===Ke(n)&&"radio"!==zo(n,"type")||"textarea"===Ke(n)}functionMl(e,o,n,r){vart=zc(e.element(),"."+o.highlightClass);bn(t,function(t){x(r,function(n){returnn.element()===t})||(dr(t,o.highlightClass),e.getSystem().getByDom(t).each(function(n){o.onDehighlight(e,n),oo(n,Mi())}))})}functionFl(n,t,e,o){Ml(n,t,0,[o]),nd(n,t,e,o)||(fr(o.element(),t.highlightClass),t.onHighlight(n,o),oo(o,_i()))}functionIl(e,t,n,o){varr=zc(e.element(),"."+t.itemClass);returnT(r,function(n){returnmr(n,t.highlightClass)}).bind(function(n){vart=is(n,o,0,r.length-1);returne.getSystem().getByDom(r[t]).toOption()})}functionRl(n,t,e){varo=A(n.slice(0,t)),r=A(n.slice(t+1));returnE(o.concat(r),e)}functionVl(n,t,e){varo=A(n.slice(0,t));returnE(o,e)}functionNl(n,t,e){varo=n.slice(0,t),r=n.slice(t+1);returnE(r.concat(o),e)}functionHl(n,t,e){varo=n.slice(t+1);returnE(o,e)}functionPl(e){returnfunction(n){vart=n.raw();returnvn(e,t.which)}}functionzl(n){returnfunction(t){returnD(n,function(n){returnn(t)})}}functionLl(n){return!0===n.raw().shiftKey}functionjl(n){return!0===n.raw().ctrlKey}functionUl(n,t){return{matches:n,classification:t}}functionWl(n,t,e){t.exists(function(t){returne.exists(function(n){returnjt(n,t)})})||ro(n,Ti(),{prevFocus:t,newFocus:e})}functionGl(){functionr(n){returnCa(n.element())}return{get:r,set:function(n,t){vare=r(n);n.getSystem().triggerFocus(t,n.element());varo=r(n);Wl(n,e,o)}}}functionXl(){functionr(n){returnad.getHighlighted(n).map(function(n){returnn.element()})}return{get:r,set:function(t,n){vare=r(t);t.getSystem().getByDom(n).fold(Z,function(n){ad.highlight(t,n)});varo=r(t);Wl(t,e,o)}}}varYl,ql,Kl=qn([ct("name"),ct("factory"),ct("configFields"),St("apis",{}),St("extraApis",{})]),Jl=qn([ct("name"),ct("factory"),ct("configFields"),ct("partFields"),St("apis",{}),St("extraApis",{})]),$l=/* */Object.freeze({getCurrent:function(n,t,e){returnt.find(n)}}),Ql=[ct("find")],Zl=ya({fields:Ql,name:"composing",apis:$l}),nd=function(n,t,e,o){returnmr(o.element(),t.highlightClass)},td=function(n,t,e,o){varr=zc(n.element(),"."+t.itemClass);returnon.from(r[o]).fold(function(){returnan.error("No element found with index "+o)},n.getSystem().getByDom)},ed=function(t,n,e){returnku(t.element(),"."+n.itemClass).bind(function(n){returnt.getSystem().getByDom(n).toOption()})},od=function(t,n,e){varo=zc(t.element(),"."+n.itemClass);return(0<o.length?on.some(o[o.length-1]):on.none()).bind(function(n){returnt.getSystem().getByDom(n).toOption()})},rd=function(t,n,e){varo=zc(t.element(),"."+n.itemClass);returnBu(S(o,function(n){returnt.getSystem().getByDom(n).toOption()}))},id=/* */Object.freeze({dehighlightAll:function(n,t,e){returnMl(n,t,0,[])},dehighlight:function(n,t,e,o){nd(n,t,e,o)&&(dr(o.element(),t.highlightClass),t.onDehighlight(n,o),oo(o,Mi()))},highlight:Fl,highlightFirst:function(t,e,o){ed(t,e).each(function(n){Fl(t,e,o,n)})},highlightLast:function(t,e,o){od(t,e).each(function(n){Fl(t,e,o,n)})},highlightAt:function(t,e,o,n){td(t,e,o,n).fold(function(n){thrownewError(n)},function(n){Fl(t,e,o,n)})},highlightBy:function(t,e,o,n){varr=rd(t,e);E(r,n).each(function(n){Fl(t,e,o,n)})},isHighlighted:nd,getHighlighted:function(t,n,e){returnku(t.element(),"."+n.highlightClass).bind(function(n){returnt.getSystem().getByDom(n).toOption()})},getFirst:ed,getLast:od,getPrevious:function(n,t,e){returnIl(n,t,0,-1)},getNext:function(n,t,e){returnIl(n,t,0,1)},getCandidates:rd}),ud=[ct("highlightClass"),ct("itemClass"),qu("onHighlight"),qu("onDehighlight")],ad=ya({fields:ud,name:"highlighting",apis:id}),cd=b(Ll);(ql=Yl=Yl||{}).OnFocusMode="onFocus",ql.OnEnterOrSpaceMode="onEnterOrSpace",ql.OnApiMode="onApi";functionsd(n,t,e,i,u){functiona(t,e,n,o,r){returnfunction(n,t){returnE(n,function(n){returnn.matches(t)}).map(function(n){returnn.classification})}(n(t,e,o,r),e.event()).bind(function(n){returnn(t,e,o,r)})}varo={schema:function(){returnn.concat([St("focusManager",Gl()),Ct("focusInside","onFocus",Zn(function(n){returnvn(["onFocus","onEnterOrSpace","onApi"],n)?an.value(n):an.error("Invalid value for focusInside")})),Qu("handler",o),Qu("state",t),Qu("sendFocusIn",u)])},processKey:a,toEvents:function(o,r){varn=o.focusInside!==Yl.OnFocusMode?on.none():u(o).map(function(e){returnlo(ci(),function(n,t){e(n,o,r),t.stop()})});returnco(n.toArray().concat([lo(ni(),function(n,t){a(n,t,e,o,r).fold(function(){!function(t,e){varn=Pl([32].concat([13]))(e.event());o.focusInside===Yl.OnEnterOrSpaceMode&&n&&Ut(t,e)&&u(o).each(function(n){n(t,o,r),e.stop()})}(n,t)},function(n){t.stop()})}),lo(ti(),function(n,t){a(n,t,i,o,r).each(function(n){t.stop()})})]))}};returno}functionfd(n){functioni(n,t){vare=n.visibilitySelector.bind(function(n){returnOu(t,n)}).getOr(t);return0<su(e)}functiont(t,e){(function(n,t){vare=zc(n.element(),t.selector),o=C(e,function(n){returni(t,n)});returnon.from(o[t.firstTabstop])})(t,e).each(function(n){e.focusManager.set(t,n)})}functionu(t,n,e,o,r){returnr(n,e,function(n){returnfunction(n,t){returni(n,t)&&n.useTabstopAt(t)}(o,n)}).fold(function(){returno.cyclic?on.some(!0):on.none()},function(n){returno.focusManager.set(t,n),on.some(!0)})}functiona(t,n,e,o){varr=zc(t.element(),e.selector);returnfunction(n,t){returnt.focusManager.get(n).bind(function(n){returnOu(n,t.selector)})}(t,e).bind(function(n){returnT(r,d(jt,n)).bind(function(n){returnu(t,r,n,e,o)})})}vare=[ht("onEscape"),ht("onEnter"),St("selector",'[data-alloy-tabstop="true"]:not(:disabled)'),St("firstTabstop",0),St("useTabstopAt",nn(!0)),ht("visibilitySelector")].concat([n]),o=nn([Ul(zl([Ll,Pl([9])]),function(n,t,e,o){varr=e.cyclic?Rl:Vl;returna(n,0,e,r)}),Ul(Pl([9]),function(n,t,e,o){varr=e.cyclic?Nl:Hl;returna(n,0,e,r)}),Ul(Pl([27]),function(t,e,n,o){returnn.onEscape.bind(function(n){returnn(t,e)})}),Ul(zl([cd,Pl([13])]),function(t,e,n,o){returnn.onEnter.bind(function(n){returnn(t,e)})})]),r=nn([]);returnsd(e,Zi.init,o,r,function(){returnon.some(t)})}functionld(n,t,e){return_l(e)&&Pl([32])(t.event())?on.none():function(n,t,e){returnuo(n,e,di()),on.some(!0)}(n,0,e)}functiondd(n,t){returnon.some(!0)}functionmd(n,t,e){returne.execute(n,t,n.element())}functiongd(n){vare=ye(on.none());returnnu({readState:function(){returne.get().map(function(n){return{numRows:n.numRows(),numColumns:n.numColumns()}}).getOr({numRows:"?",numColumns:"?"})},setGridSize:function(n,t){e.set(on.some({numRows:nn(n),numColumns:nn(t)}))},getNumRows:function(){returne.get().map(function(n){returnn.numRows()})},getNumColumns:function(){returne.get().map(function(n){returnn.numColumns()})}})}functionpd(i){returnfunction(n,t,e,o){varr=i(n.element());returnEm(r,n,t,e,o)}}functionhd(n,t){vare=Aa(n,t);returnpd(e)}functionvd(n,t){vare=Aa(t,n);returnpd(e)}functionbd(r){returnfunction(n,t,e,o){returnEm(r,n,t,e,o)}}functionyd(n){return!function(n){returnn.offsetWidth<=0&&n.offsetHeight<=0}(n.dom())}functionxd(n,t,e){varo=d(jt,t),r=zc(n,e);returnfunction(t,n){returnT(t,n).map(function(n){returnAm({index:n,candidates:t})})}(C(r,yd),o)}functionwd(n,t){returnT(n,function(n){returnjt(t,n)})}functionSd(e,n,o,t){returnt(Math.floor(n/o),n%o).bind(function(n){vart=n.row()*o+n.column();return0<=t&&t<e.length?on.some(e[t]):on.none()})}functionCd(r,n,i,u,a){returnSd(r,n,u,function(n,t){vare=n===i-1?r.length-n*u:u,o=is(t,a,0,e-1);returnon.some({row:nn(n),column:nn(o)})})}functionkd(i,n,u,a,c){returnSd(i,n,a,function(n,t){vare=is(n,c,0,u-1),o=e===u-1?i.length-e*a:a,r=us(t,0,o-1);returnon.some({row:nn(e),column:nn(r)})})}functionOd(t,e,n){ku(t.element(),e.selector).each(function(n){e.focusManager.set(t,n)})}functionEd(r){returnfunction(n,t,e,o){returnxd(n,t,e.selector).bind(function(n){returnr(n.candidates(),n.index(),o.getNumRows().getOr(e.initSize.numRows),o.getNumColumns().getOr(e.initSize.numColumns))})}}functionTd(n,t,e,o){returne.captureTab?on.some(!0):on.none()}functionBd(n,t,e,r){vari=function(n,t,e){varo=is(t,r,0,e.length-1);returno===n?on.none():function(n){return"button"===Ke(n)&&"disabled"===zo(n,"disabled")}(e[o])?i(n,o,e):on.from(e[o])};returnxd(n,e,t).bind(function(n){vart=n.index(),e=n.candidates();returni(t,t,e)})}functionDd(t,e,o){returnfunction(n,t){returnt.focusManager.get(n).bind(function(n){returnOu(n,t.selector)})}(t,o).bind(function(n){returno.execute(t,e,n)})}functionAd(t,e){e.getInitial(t).orThunk(function(){returnku(t.element(),e.selector)}).each(function(n){e.focusManager.set(t,n)})}function_d(n,t,e){returnBd(n,e.selector,t,-1)}functionMd(n,t,e){returnBd(n,e.selector,t,1)}functionFd(o){returnfunction(n,t,e){returno(n,t,e).bind(function(){returne.executeOnMove?Dd(n,t,e):on.some(!0)})}}functionId(n,t,e,o){returne.onEscape(n,t)}functionRd(n,t,e){returnon.from(n[t]).bind(function(n){returnon.from(n[e]).map(function(n){returnjm({rowIndex:t,columnIndex:e,cell:n})})})}functionVd(n,t,e,o){varr=n[t].length,i=is(e,o,0,r-1);returnRd(n,t,i)}functionNd(n,t,e,o){varr=is(e,o,0,n.length-1),i=n[r].length,u=us(t,0,i-1);returnRd(n,r,u)}functionHd(n,t,e,o){varr=n[t].length,i=us(e+o,0,r-1);returnRd(n,t,i)}functionPd(n,t,e,o){varr=us(e+o,0,n.length-1),i=n[r].length,u=us(t,0,i-1);returnRd(n,r,u)}functionzd(t,e){e.previousSelector(t).orThunk(function(){varn=e.selectors;returnku(t.element(),n.cell)}).each(function(n){e.focusManager.set(t,n)})}functionLd(n,t){returnfunction(r,e,i){varu=i.cycles?n:t;returnOu(e,i.selectors.row).bind(function(n){vart=zc(n,i.selectors.cell);returnwd(t,e).bind(function(e){varo=zc(r,i.selectors.row);returnwd(o,n).bind(function(n){vart=function(n,t){returnS(n,function(n){returnzc(n,t.selectors.cell)})}(o,i);returnu(t,n,e).map(function(n){returnn.cell()})})})})}}functionjd(t,e,o){returno.focusManager.get(t).bind(function(n){returno.execute(t,e,n)})}functionUd(t,e){ku(t.element(),e.selector).each(function(n){e.focusManager.set(t,n)})}functionWd(n,t,e){returnBd(n,e.selector,t,-1)}functionGd(n,t,e){returnBd(n,e.selector,t,1)}functionXd(n,t,e,o){varr=n.getSystem().build(o);Ff(n,r,e)}functionYd(n,t,e,o){varr=dg(n);E(r,function(n){returnjt(o.element(),n.element())}).each(bs)}functionqd(t,n,e,o,r){vari=dg(t);returnon.from(i[o]).map(function(n){returnYd(t,0,0,n),r.each(function(n){Xd(t,0,function(n,t){!function(n,t,e){Do(n,e).fold(function(){Hi(n,t)},function(n){Ao(n,t)})}(n,t,o)},n)}),n})}functionKd(n,t){return{key:n,value:{config:{},me:function(n,t){vare=co(t);returnya({fields:[ct("enabled")],name:n,active:{events:nn(e)}})}(n,t),configAsRaw:nn({}),initialConfig:{},state:Zi}}}functionJd(n,t){t.ignore||(wa(n.element()),t.onFocus(n))}function$d(n,t,e){varo=t.aria;o.update(n,o,e.get())}functionQd(t,n,e){n.toggleClass.each(function(n){e.get()?fr(t.element(),n):dr(t.element(),n)})}functionZd(n,t,e){bg(n,t,e,!e.get())}functionnm(n,t,e){e.set(!0),Qd(n,t,e),$d(n,t,e)}functiontm(n,t,e){e.set(!1),Qd(n,t,e),$d(n,t,e)}functionem(n,t,e){bg(n,t,e,t.selected)}functionom(){functionn(n,t){t.stop(),io(n)}return[lo(ri(),n),lo(gi(),n),vo(Ur()),vo(Yr())]}functionrm(n){returnco(H([n.map(function(e){returnNi(function(n,t){e(n),t.stop()})}).toArray(),om()]))}functionim(n){(Ca(n.element()).isNone()||vg.isFocused(n))&&(vg.isFocused(n)||vg.focus(n),ro(n,kg,{item:n}))}functionum(n){ro(n,Og,{item:n})}functionam(n,t){vare={};Cn(n,function(n,t){bn(n,function(n){e[n]=t})});varo=t,r=function(n){returnkn(n,function(n,t){return{k:n,v:t}})}(t),i=P(r,function(n,t){return[t].concat(Ng(e,o,r,t))});returnP(e,function(n){returnNn(i,n).getOr([n])})}functioncm(n){returnn.x()}functionsm(n,t){returnn.x()+n.width()/2-t.width()/2}functionfm(n,t){returnn.x()+n.width()-t.width()}functionlm(n){returnn.y()}functiondm(n,t){returnn.y()+n.height()-t.height()}functionmm(n,t,e){returnYa(cm(n),dm(n,t),e.innerSoutheast(),Ka(),"layout-se")}functiongm(n,t,e){returnYa(fm(n,t),dm(n,t),e.innerSouthwest(),Ja(),"layout-sw")}functionpm(n,t,e){returnYa(cm(n),lm(n),e.innerNortheast(),$a(),"layout-ne")}functionhm(n,t,e){returnYa(fm(n,t),lm(n),e.innerNorthwest(),Qa(),"layout-nw")}functionvm(n){vart=functione(n){returnn.uid!==undefined}(n)&&$(n,"uid")?n.uid:Yo("memento");return{get:function(n){returnn.getSystem().getByUid(t).getOrDie()},getOpt:function(n){returnn.getSystem().getByUid(t).toOption()},asSpec:function(){returnN(N({},n),{uid:t})}}}functionbm(n){returnon.from(n()["temporary-placeholder"]).getOr("!not found!")}functionym(n,t){returnon.from(t()[n]).getOrThunk(function(){returnbm(t)})}varxm,wm=fd(At("cyclic",nn(!1))),Sm=fd(At("cyclic",nn(!0))),Cm=[St("execute",ld),St("useSpace",!1),St("useEnter",!0),St("useControlEnter",!1),St("useDown",!1)],km=sd(Cm,Zi.init,function(n,t,e,o){varr=e.useSpace&&!_l(n.element())?[32]:[],i=e.useEnter?[13]:[],u=e.useDown?[40]:[],a=r.concat(i).concat(u);return[Ul(Pl(a),md)].concat(e.useControlEnter?[Ul(zl([jl,Pl([13])]),md)]:[])},function(n,t,e,o){returne.useSpace&&!_l(n.element())?[Ul(Pl([32]),dd)]:[]},function(){returnon.none()}),Om=/* */Object.freeze({flatgrid:gd,init:function(n){returnn.state(n)}}),Em=function(t,e,n,o,r){returno.focusManager.get(e).bind(function(n){returnt(e.element(),n,o,r)}).map(function(n){returno.focusManager.set(e,n),!0})},Tm=bd,Bm=bd,Dm=bd,Am=So(["index","candidates"],[]),_m=[ct("selector"),St("execute",ld),Ku("onEscape"),St("captureTab",!1),Xa()],Mm=Ed(function(n,t,e,o){returnCd(n,t,e,o,-1)}),Fm=Ed(function(n,t,e,o){returnCd(n,t,e,o,1)}),Im=Ed(function(n,t,e,o){returnkd(n,t,e,o,-1)}),Rm=Ed(function(n,t,e,o){returnkd(n,t,e,o,1)}),Vm=nn([Ul(Pl([37]),hd(Mm,Fm)),Ul(Pl([39]),vd(Mm,Fm)),Ul(Pl([38]),Tm(Im)),Ul(Pl([40]),Bm(Rm)),Ul(zl([Ll,Pl([9])]),Td),Ul(zl([cd,Pl([9])]),Td),Ul(Pl([27]),function(n,t,e,o){returne.onEscape(n,t)}),Ul(Pl([32].concat([13])),function(t,e,o,n){returnfunction(n,t){returnt.focusManager.get(n).bind(function(n){returnOu(n,t.selector)})}(t,o).bind(function(n){returno.execute(t,e,n)})})]),Nm=nn([Ul(Pl([32]),dd)]),Hm=sd(_m,gd,Vm,Nm,function(){returnon.some(Od)}),Pm=[ct("selector"),St("getInitial",on.none),St("execute",ld),Ku("onEscape"),St("executeOnMove",!1),St("allowVertical",!0)],zm=nn([Ul(Pl([32]),dd)]),Lm=sd(Pm,Zi.init,function(n,t,e,o){varr=[37].concat(e.allowVertical?[38]:[]),i=[39].concat(e.allowVertical?[40]:[]);return[Ul(Pl(r),Fd(hd(_d,Md))),Ul(Pl(i),Fd(vd(_d,Md))),Ul(Pl([13]),Dd),Ul(Pl([32]),Dd),Ul(Pl([27]),Id)]},zm,function(){returnon.some(Ad)}),jm=So(["rowIndex","columnIndex","cell"],[]),Um=[mt("selectors",[ct("row"),ct("cell")]),St("cycles",!0),St("previousSelector",on.none),St("execute",ld)],Wm=Ld(function(n,t,e){returnVd(n,t,e,-1)},function(n,t,e){returnHd(n,t,e,-1)}),Gm=Ld(function(n,t,e){returnVd(n,t,e,1)},function(n,t,e){returnHd(n,t,e,1)}),Xm=Ld(function(n,t,e){returnNd(n,e,t,-1)},function(n,t,e){returnPd(n,e,t,-1)}),Ym=Ld(function(n,t,e){returnNd(n,e,t,1)},function(n,t,e){returnPd(n,e,t,1)}),qm=nn([Ul(Pl([37]),hd(Wm,Gm)),Ul(Pl([39]),vd(Wm,Gm)),Ul(Pl([38]),Tm(Xm)),Ul(Pl([40]),Bm(Ym)),Ul(Pl([32].concat([13])),function(t,e,o){returnCa(t.element()).bind(function(n){returno.execute(t,e,n)})})]),Km=nn([Ul(Pl([32]),dd)]),Jm=sd(Um,Zi.init,qm,Km,function(){returnon.some(zd)}),$m=[ct("selector"),St("execute",ld),St("moveOnTab",!1)],Qm=nn([Ul(Pl([38]),Dm(Wd)),Ul(Pl([40]),Dm(Gd)),Ul(zl([Ll,Pl([9])]),function(n,t,e){returne.moveOnTab?Dm(Wd)(n,t,e):on.none()}),Ul(zl([cd,Pl([9])]),function(n,t,e){returne.moveOnTab?Dm(Gd)(n,t,e):on.none()}),Ul(Pl([13]),jd),Ul(Pl([32]),jd)]),Zm=nn([Ul(Pl([32]),dd)]),ng=sd($m,Zi.init,Qm,Zm,function(){returnon.some(Ud)}),tg=[Ku("onSpace"),Ku("onEnter"),Ku("onShiftEnter"),Ku("onLeft"),Ku("onRight"),Ku("onTab"),Ku("onShiftTab"),Ku("onUp"),Ku("onDown"),Ku("onEscape"),St("stopSpaceKeyup",!1),ht("focusIn")],eg=sd(tg,Zi.init,function(n,t,e){return[Ul(Pl([32]),e.onSpace),Ul(zl([cd,Pl([13])]),e.onEnter),Ul(zl([Ll,Pl([13])]),e.onShiftEnter),Ul(zl([Ll,Pl([9])]),e.onShiftTab),Ul(zl([cd,Pl([9])]),e.onTab),Ul(Pl([38]),e.onUp),Ul(Pl([40]),e.onDown),Ul(Pl([37]),e.onLeft),Ul(Pl([39]),e.onRight),Ul(Pl([32]),e.onSpace),Ul(Pl([27]),e.onEscape)]},function(n,t,e){returne.stopSpaceKeyup?[Ul(Pl([32]),dd)]:[]},function(n){returnn.focusIn}),og=wm.schema(),rg=Sm.schema(),ig=Lm.schema(),ug=Hm.schema(),ag=Jm.schema(),cg=km.schema(),sg=ng.schema(),fg=eg.schema(),lg=xa({branchKey:"mode",branches:/* */Object.freeze({acyclic:og,cyclic:rg,flow:ig,flatgrid:ug,matrix:ag,execution:cg,menu:sg,special:fg}),name:"keying",active:{events:function(n,t){returnn.handler.toEvents(n,t)}},apis:{focusIn:function(t,e,o){e.sendFocusIn(e).fold(function(){t.getSystem().triggerFocus(t.element(),t.element())},function(n){n(t,e,o)})},setGridSize:function(n,t,e,o,r){$(e,"setGridSize")?e.setGridSize(o,r):v.console.error("Layout does not support setGridSize")}},state:Om}),dg=function(n,t){returnn.components()},mg=ya({fields:[],name:"replacing",apis:/* */Object.freeze({append:function(n,t,e,o){Xd(n,0,Hi,o)},prepend:function(n,t,e,o){Xd(n,0,Mo,o)},remove:Yd,replaceAt:qd,replaceBy:function(t,n,e,o,r){vari=dg(t);returnT(i,o).bind(function(n){returnqd(t,0,0,n,r)})},set:function(t,n,e,o){ka(function(){varn=S(o,t.getSystem().build);ps(t,n)},t.element())},contents:dg})}),gg=/* */Object.freeze({focus:Jd,blur:function(n,t){t.ignore||function(n){n.dom().blur()}(n.element())},isFocused:function(n){returnfunction(n){vart=Co(n).dom();returnn.dom()===t.activeElement}(n.element())}}),pg=/* */Object.freeze({exhibit:function(n,t){vare=t.ignore?{}:{attributes:{tabindex:"-1"}};returnZo(e)},events:function(e){returnco([lo(ci(),function(n,t){Jd(n,e),t.stop()})].concat(e.stopMousedown?[lo(Yr(),function(n,t){t.event().prevent()})]:[]))}}),hg=[qu("onFocus"),St("stopMousedown",!1),St("ignore",!1)],vg=ya({fields:hg,name:"focusing",active:pg,apis:gg}),bg=function(n,t,e,o){(o?nm:tm)(n,t,e)},yg=/* */Object.freeze({onLoad:em,toggle:Zd,isOn:function(n,t,e){returne.get()},on:nm,off:tm,set:bg}),xg=/* */Object.freeze({exhibit:function(n,t,e){returnZo({})},events:function(n,t){vare=function(t,e,o){returnNi(function(n){o(n,t,e)})}(n,t,Zd),o=ga(n,t,em);returnco(H([n.toggleOnExecute?[e]:[],[o]]))}}),wg=function(n,t,e){Po(n.element(),"aria-expanded",e)},Sg=[St("selected",!1),ht("toggleClass"),St("toggleOnExecute",!0),Ct("aria",{mode:"none"},it("mode",{pressed:[St("syncWithExpanded",!1),Qu("update",function(n,t,e){Po(n.element(),"aria-pressed",e),t.syncWithExpanded&&wg(n,t,e)})],checked:[Qu("update",function(n,t,e){Po(n.element(),"aria-checked",e)})],expanded:[Qu("update",wg)],selected:[Qu("update",function(n,t,e){Po(n.element(),"aria-selected",e)})],none:[Qu("update",Z)]}))],Cg=ya({fields:Sg,name:"toggling",active:xg,apis:yg,state:(xm=!1,{init:function(){vart=ye(xm);return{get:function(){returnt.get()},set:function(n){returnt.set(n)},clear:function(){returnt.set(xm)},readState:function(){returnt.get()}}}})}),kg="alloy.item-hover",Og="alloy.item-focus",Eg=nn(kg),Tg=nn(Og),Bg=[ct("data"),ct("components"),ct("dom"),St("hasSubmenu",!1),ht("toggling"),nl("itemBehaviours",[Cg,vg,lg,Zf]),St("ignoreFocus",!1),St("domModification",{}),Qu("builder",function(n){return{dom:n.dom,domModification:N(N({},n.domModification),{attributes:N(N(N({role:n.toggling.isSome()?"menuitemcheckbox":"menuitem"},n.domModification.attributes),{"aria-haspopup":n.hasSubmenu}),n.hasSubmenu?{"aria-expanded":!1}:{})}),behaviours:tl(n.itemBehaviours,[n.toggling.fold(Cg.revoke,function(n){returnCg.config(N({aria:{mode:"checked"}},n))}),vg.config({ignore:n.ignoreFocus,stopMousedown:n.ignoreFocus,onFocus:function(n){um(n)}}),lg.config({mode:"execution"}),Zf.config({store:{mode:"memory",initialValue:n.data}}),Kd("item-type-events",g(om(),[lo($r(),im),lo(mi(),vg.focus)]))]),components:n.components,eventOrder:n.eventOrder}}),St("eventOrder",{})],Dg=[ct("dom"),ct("components"),Qu("builder",function(n){return{dom:n.dom,components:n.components,events:co([function(n){returnlo(n,function(n,t){t.stop()})}(mi())])}})],Ag=nn([xl({name:"widget",overrides:function(t){return{behaviours:ba([Zf.config({store:{mode:"manual",getValue:function(n){returnt.data},setValue:function(){}}})])}}})]),_g=[ct("uid"),ct("data"),ct("components"),ct("dom"),St("autofocus",!1),St("ignoreFocus",!1),nl("widgetBehaviours",[Zf,vg,lg]),St("domModification",{}),tf(Ag()),Qu("builder",function(e){functiono(n){returnqs(n,e,"widget").map(function(n){returnlg.focusIn(n),n})}functionn(n,t){return_l(t.event().target())||e.autofocus&&t.setSource(n.element()),on.none()}vart=Xs(0,e,Ag()),r=Ys("item-widget",e,t.internals());return{dom:e.dom,components:r,domModification:e.domModification,events:co([Ni(function(n,t){o(n).each(function(n){t.stop()})}),lo($r(),im),lo(mi(),function(n,t){e.autofocus?o(n):vg.focus(n)})]),behaviours:tl(e.widgetBehaviours,[Zf.config({store:{mode:"memory",initialValue:e.data}}),vg.config({ignore:e.ignoreFocus,onFocus:function(n){um(n)}}),lg.config({mode:"special",focusIn:e.autofocus?function(n){o(n)}:cc(),onLeft:n,onRight:n,onEscape:function(n,t){returnvg.isFocused(n)||e.autofocus?(e.autofocus&&t.setSource(n.element()),on.none()):(vg.focus(n),on.some(!0))}})])}})],Mg=it("type",{widget:_g,item:Bg,separator:Dg}),Fg=nn([Cl({factory:{sketch:function(n){vart=ot("menu.spec item",Mg,n);returnt.builder(t)}},name:"items",unit:"item",defaults:function(n,t){returnt.hasOwnProperty("uid")?t:N(N({},t),{uid:Yo("item")})},overrides:function(n,t){return{type:t.type,ignoreFocus:n.fakeFocus,domModification:{classes:[n.markers.item]}}}})]),Ig=nn([ct("value"),ct("items"),ct("dom"),ct("components"),St("eventOrder",{}),Fs("menuBehaviours",[ad,Zf,Zl,lg]),Ct("movement",{mode:"menu",moveOnTab:!0},it("mode",{grid:[Xa(),Qu("config",function(n,t){return{mode:"flatgrid",selector:"."+n.markers.item,initSize:{numColumns:t.initSize.numColumns,numRows:t.initSize.numRows},focusManager:n.focusManager}})],matrix:[Qu("config",function(n,t){return{mode:"matrix",selectors:{row:t.rowSelector,cell:"."+n.markers.item},focusManager:n.focusManager}}),ct("rowSelector")],menu:[St("moveOnTab",!0),Qu("config",function(n,t){return{mode:"menu",selector:"."+n.markers.item,moveOnTab:t.moveOnTab,focusManager:n.focusManager}})]})),st("markers",Wa()),St("fakeFocus",!1),St("focusManager",Gl()),qu("onHighlight")]),Rg=nn("alloy.menu-focus"),Vg=Al({name:"Menu",configFields:Ig(),partFields:Fg(),factory:function(n,t,e,o){return{uid:n.uid,dom:n.dom,markers:n.markers,behaviours:Rs(n.menuBehaviours,[ad.config({highlightClass:n.markers.selectedItem,itemClass:n.markers.item,onHighlight:n.onHighlight}),Zf.config({store:{mode:"memory",initialValue:n.value}}),Zl.config({find:on.some}),lg.config(n.movement.config(n,n.movement))]),events:co([lo(Tg(),function(t,e){varn=e.event();t.getSystem().getByDom(n.target()).each(function(n){ad.highlight(t,n),e.stop(),ro(t,Rg(),{menu:t,item:n})})}),lo(Eg(),function(n,t){vare=t.event().item();ad.highlight(n,e)})]),components:t,eventOrder:n.eventOrder,domModification:{attributes:{role:"menu"}}}}}),Ng=function(e,o,r,n){returnNn(r,n).bind(function(n){returnNn(e,n).bind(function(n){vart=Ng(e,o,r,n);returnon.some([n].concat(t))})}).getOr([])},Hg=function(n){return"prepared"===n.type?on.some(n.menu):on.none()},Pg={init:function(){functionr(n,e,o){returnf(n).bind(function(t){returnfunction(e){returnI(i.get(),function(n,t){returnn===e})}(n).bind(function(n){returne(n).map(function(n){return{triggeredMenu:t,triggeringItem:n,triggeringPath:o}})})})}vari=ye({}),u=ye({}),a=ye({}),c=ye(on.none()),s=ye({}),f=function(n){returnt(n).bind(Hg)},t=function(n){returnNn(u.get(),n)},e=function(n){returnNn(i.get(),n)};return{setMenuBuilt:function(n,t){vare;u.set(N(N({},u.get()),((e={})[n]={type:"prepared",menu:t},e)))},setContents:function(n,t,e,o){c.set(on.some(n)),i.set(e),u.set(t),s.set(o);varr=am(o,e);a.set(r)},expand:function(e){returnNn(i.get(),e).map(function(n){vart=Nn(a.get(),e).getOr([]);return[n].concat(t)})},refresh:function(n){returnNn(a.get(),n)},collapse:function(n){returnNn(a.get(),n).bind(function(n){return1<n.length?on.some(n.slice(1)):on.none()})},lookupMenu:t,lookupItem:e,otherMenus:function(n){vart=s.get();return_(wn(t),n)},getPrimary:function(){returnc.get().bind(f)},getMenus:function(){returnu.get()},clear:function(){i.set({}),u.set({}),a.set({}),c.set(on.none())},isClear:function(){returnc.get().isNone()},getTriggeringPath:function(n,o){vart=C(e(n).toArray(),function(n){returnf(n).isSome()});returnNn(a.get(),n).bind(function(n){vare=A(t.concat(n));returnfunction(n){for(vart=[],e=0;e<n.length;e++){varo=n[e];if(!o.isSome())returnon.none();t.push(o.getOrDie())}returnon.some(t)}(B(e,function(n,t){returnr(n,o,e.slice(0,t+1)).fold(function(){returnc.get().is(n)?[]:[on.none()]},function(n){return[on.some(n)]})}))})}}},extractPreparedMenu:Hg},zg=nn("collapse-item"),Lg=Dl({name:"TieredMenu",configFields:[$u("onExecute"),$u("onEscape"),Ju("onOpenMenu"),Ju("onOpenSubmenu"),Ju("onRepositionMenu"),qu("onCollapseMenu"),St("highlightImmediately",!0),mt("data",[ct("primary"),ct("menus"),ct("expansions")]),St("fakeFocus",!1),qu("onHighlight"),qu("onHover"),Gu(),ct("dom"),St("navigateOnHover",!0),St("stayInDom",!1),Fs("tmenuBehaviours",[lg,ad,Zl,mg]),St("eventOrder",{})],apis:{collapseMenu:function(n,t){n.collapseMenu(t)},highlightPrimary:function(n,t){n.highlightPrimary(t)},repositionMenus:function(n,t){n.repositionMenus(t)}},factory:function(a,n){functione(n){vart=function(o,r,n){returnP(n,function(n,t){functione(){returnVg.sketch(N(N({dom:n.dom},n),{value:t,items:n.items,markers:a.markers,fakeFocus:a.fakeFocus,onHighlight:a.onHighlight,focusManager:a.fakeFocus?Xl():Gl()}))}returnt===r?{type:"prepared",menu:o.getSystem().build(e())}:{type:"notbuilt",nbMenu:e}})}(n,a.data.primary,a.data.menus),e=o();returng.setContents(a.data.primary,t,a.data.expansions,e),g.getPrimary()}functionc(n){returnZf.getValue(n).value}functionu(t,n){ad.highlight(t,n),ad.getHighlighted(n).orThunk(function(){returnad.getFirst(n)}).each(function(n){uo(t,n.element(),mi())})}functions(t,n){returnBu(S(n,function(n){returnt.lookupMenu(n).bind(function(n){return"prepared"===n.type?on.some(n.menu):on.none()})}))}functionf(t,n,e){varo=s(n,n.otherMenus(e));bn(o,function(n){pr(n.element(),[a.markers.backgroundMenu]),a.stayInDom||mg.remove(t,n)})}functionl(n,o){vart=function(o){returnr.get().getOrThunk(function(){vare={},n=zc(o.element(),"."+a.markers.item),t=C(n,function(n){return"true"===zo(n,"aria-haspopup")});returnbn(t,function(n){o.getSystem().getByDom(n).each(function(n){vart=c(n);e[t]=n})}),r.set(on.some(e)),e})}(n);Cn(t,function(n,t){vare=vn(o,t);Po(n.element(),"aria-expanded",e)})}functiond(o,r,i){returnon.from(i[0]).bind(function(n){returnr.lookupMenu(n).bind(function(n){if("notbuilt"===n.type)returnon.none();vart=n.menu,e=s(r,i.slice(1));returnbn(e,function(n){fr(n.element(),a.markers.backgroundMenu)}),$e(t.element())||mg.append(o,au(t)),pr(t.element(),[a.markers.backgroundMenu]),u(o,t),f(o,r,i),on.some(t)})})}varm,t,r=ye(on.none()),g=Pg.init(),o=function(n){returnP(a.data.menus,function(n,t){returnB(n.items,function(n){return"separator"===n.type?[]:[n.data.value]})})};(t=m=m||{})[t.HighlightSubmenu=0]="HighlightSubmenu",t[t.HighlightParent=1]="HighlightParent";functioni(r,i,u){void0===u&&(u=m.HighlightSubmenu);varn=c(i);returng.expand(n).bind(function(o){returnl(r,o),on.from(o[0]).bind(function(e){returng.lookupMenu(e).bind(function(n){vart=function(n,t,e){if("notbuilt"!==e.type)returne.menu;varo=n.getSystem().build(e.nbMenu());returng.setMenuBuilt(t,o),o}(r,e,n);return$e(t.element())||mg.append(r,au(t)),a.onOpenSubmenu(r,i,t,A(o)),u===m.HighlightSubmenu?(ad.highlightFirst(t),d(r,g,o)):(ad.dehighlightAll(t),on.some(i))})})})}functionp(t,e){varn=c(e);returng.collapse(n).bind(function(n){returnl(t,n),d(t,g,n).map(function(n){returna.onCollapseMenu(t,e,n),n})})}functionh(e){returnfunction(t,n){returnOu(n.getSource(),"."+a.markers.item).bind(function(n){returnt.getSystem().getByDom(n).toOption().bind(function(n){returne(t,n).map(function(){return!0})})})}}functionv(n){returnad.getHighlighted(n).bind(ad.getHighlighted)}varb=co([lo(Rg(),function(e,o){varn=o.event().item();g.lookupItem(c(n)).each(function(){varn=o.event().menu();ad.highlight(e,n);vart=c(o.event().item());g.refresh(t).each(function(n){returnf(e,g,n)})})}),Ni(function(t,n){vare=n.event().target();t.getSystem().getByDom(e).each(function(n){0===c(n).indexOf("collapse-item")&&p(t,n),i(t,n,m.HighlightSubmenu).fold(function(){a.onExecute(t,n)},function(){})})}),Ii(function(t,n){e(t).each(function(n){mg.append(t,au(n)),a.onOpenMenu(t,n),a.highlightImmediately&&u(t,n)})})].concat(a.navigateOnHover?[lo(Eg(),function(n,t){vare=t.event().item();!function(t,n){vare=c(n);g.refresh(e).bind(function(n){returnl(t,n),d(t,g,n)})}(n,e),i(n,e,m.HighlightParent),a.onHover(n,e)})]:[])),y={collapseMenu:function(t){v(t).each(function(n){p(t,n)})},highlightPrimary:function(t){g.getPrimary().each(function(n){u(t,n)})},repositionMenus:function(o){g.getPrimary().bind(function(t){returnv(o).bind(function(n){vart=c(n),e=R(g.getMenus()),o=Bu(S(e,Pg.extractPreparedMenu));returng.getTriggeringPath(t,function(n){returnfunction(n,t,e){returnDu(t,function(n){if(!n.getSystem().isConnected())returnon.none();vart=ad.getCandidates(n);returnE(t,function(n){returnc(n)===e})})}(0,o,n)})}).map(function(n){return{primary:t,triggeringPath:n}})}).fold(function(){(function(n){returnon.from(n.components()[0]).filter(function(n){return"menu"===zo(n.element(),"role")})})(o).each(function(n){a.onRepositionMenu(o,n,[])})},function(n){vart=n.primary,e=n.triggeringPath;a.onRepositionMenu(o,t,e)})}};return{uid:a.uid,dom:a.dom,markers:a.markers,behaviours:Rs(a.tmenuBehaviours,[lg.config({mode:"special",onRight:h(function(n,t){return_l(t.element())?on.none():i(n,t,m.HighlightSubmenu)}),onLeft:h(function(n,t){return_l(t.element())?on.none():p(n,t)}),onEscape:h(function(n,t){returnp(n,t).orThunk(function(){returna.onEscape(n,t).map(function(){returnn})})}),focusIn:function(t,n){g.getPrimary().each(function(n){uo(t,n.element(),mi())})}}),ad.config({highlightClass:a.markers.selectedMenu,itemClass:a.markers.menu}),Zl.config({find:function(n){returnad.getHighlighted(n)}}),mg.config({})]),eventOrder:a.eventOrder,apis:y,events:b}},extraApis:{tieredData:function(n,t,e){return{primary:n,menus:t,expansions:e}},singleData:function(n,t){return{primary:n,menus:q(n,t),expansions:{}}},collapseItem:function(n){return{value:Xo(zg()),meta:{text:n}}}}}),jg=Dl({name:"InlineView",configFields:[ct("lazySink"),qu("onShow"),qu("onHide"),xt("onEscape"),Fs("inlineBehaviours",[zf,Zf,lc]),wt("fireDismissalEventInstead",[St("event",Oi())]),wt("fireRepositionEventInstead",[St("event",Ei())]),St("getRelated",on.none),St("eventOrder",on.none)],factory:function(i,n){functiont(e){zf.isOpen(e)&&Zf.getValue(e).each(function(n){switch(n.mode){case"menu":zf.getState(e).each(function(n){Lg.repositionMenus(n)});break;case"position":vart=i.lazySink(e).getOrDie();Af.positionWithinBounds(t,n.anchor,e,n.getBounds())}})}varo=function(n,t,e,o){r(n,t,e,function(){returno.map(function(n){returnxu(n)})})},r=function(n,t,e,o){varr=i.lazySink(n).getOrDie();zf.openWhileCloaked(n,e,function(){returnAf.positionWithinBounds(r,t,n,o())}),Zf.setValue(n,on.some({mode:"position",anchor:t,getBounds:o}))},u=function(n,t,e,o){varr=function(n,t,r,e,i){functionu(){returnn.lazySink(t)}functiona(n){returnfunction(n){return2===n.length}(n)?o:{}}varo="horizontal"===e.type?{layouts:{onLtr:function(){returnda()},onRtl:function(){returnma()}}}:{};returnLg.sketch({dom:{tag:"div"},data:e.data,markers:e.menu.markers,onEscape:function(){returnzf.close(t),n.onEscape.map(function(n){returnn(t)}),on.some(!0)},onExecute:function(){returnon.some(!0)},onOpenMenu:function(n,t){Af.positionWithinBounds(u().getOrDie(),r,t,i())},onOpenSubmenu:function(n,t,e,o){varr=u().getOrDie();Af.position(r,N({anchor:"submenu",item:t},a(o)),e)},onRepositionMenu:function(n,t,e){varo=u().getOrDie();Af.positionWithinBounds(o,r,t,i()),bn(e,function(n){vart=a(n.triggeringPath);Af.position(o,N({anchor:"submenu",item:n.triggeringItem},t),n.triggeredMenu)})}})}(i,n,t,e,o);zf.open(n,r),Zf.setValue(n,on.some({mode:"menu",menu:r}))},e={setContent:function(n,t){zf.setContent(n,t)},showAt:function(n,t,e){o(n,t,e,on.none())},showWithin:o,showWithinBounds:r,showMenuAt:function(n,t,e){u(n,t,e,function(){returnon.none()})},showMenuWithinBounds:u,hide:function(n){Zf.setValue(n,on.none()),zf.close(n)},getContent:function(n){returnzf.getState(n)},reposition:t,isOpen:zf.isOpen};return{uid:i.uid,dom:i.dom,behaviours:Rs(i.inlineBehaviours,[zf.config({isPartOf:function(n,t,e){returnLu(t,e)||function(n,t){returni.getRelated(n).exists(function(n){returnLu(n,t)})}(n,e)},getAttachPoint:function(n){returni.lazySink(n).getOrDie()},onOpen:function(n){i.onShow(n)},onClose:function(n){i.onHide(n)}}),Zf.config({store:{mode:"memory",initialValue:on.none()}}),lc.config({channels:N(N({},Es(N({isExtraPart:nn(!1)},i.fireDismissalEventInstead.map(function(n){return{fireEventInstead:{event:n.event}}}).getOr({})))),Ts(N(N({isExtraPart:nn(!1)},i.fireRepositionEventInstead.map(function(n){return{fireEventInstead:{event:n.event}}}).getOr({})),{doReposition:t})))})]),eventOrder:i.eventOrder,apis:e}},apis:{showAt:function(n,t,e,o){n.showAt(t,e,o)},showWithin:function(n,t,e,o,r){n.showWithin(t,e,o,r)},showWithinBounds:function(n,t,e,o,r){n.showWithinBounds(t,e,o,r)},showMenuAt:function(n,t,e,o){n.showMenuAt(t,e,o)},showMenuWithinBounds:function(n,t,e,o,r){n.showMenuWithinBounds(t,e,o,r)},hide:function(n,t){n.hide(t)},isOpen:function(n,t){returnn.isOpen(t)},getContent:function(n,t){returnn.getContent(t)},setContent:function(n,t,e){n.setContent(t,e)},reposition:function(n,t){n.reposition(t)}}}),Ug=function(n,t,e){returnYa(sm(n,t),lm(n),e.innerNorth(),nc(),"layout-n")},Wg=function(n,t,e){returnYa(sm(n,t),dm(n,t),e.innerSouth(),Za(),"layout-s")},Gg=Dl({name:"Button",factory:function(n){functione(t){returnNn(n.dom,"attributes").bind(function(n){returnNn(n,t)})}vart=rm(n.action),o=n.dom.tag;return{uid:n.uid,dom:n.dom,components:n.components,events:t,behaviours:tl(n.buttonBehaviours,[vg.config({}),lg.config({mode:"execution",useSpace:!0,useEnter:!0})]),domModification:{attributes:function(){if("button"!==o)return{role:e("role").getOr("button")};varn=e("type").getOr("button"),t=e("role").map(function(n){return{role:n}}).getOr({});returnN({type:n},t)}()},eventOrder:n.eventOrder}},configFields:[St("uid",undefined),ct("dom"),St("components",[]),nl("buttonBehaviours",[vg,lg]),ht("action"),ht("role"),St("eventOrder",{})]}),Xg={success:"checkmark",error:"warning",err:"error",warning:"warning",warn:"warning",info:"info"},Yg=Dl({name:"Notification",factory:function(t){functione(n){return{dom:{tag:"div",classes:["tox-bar"],attributes:{style:"width: "+n+"%"}}}}functiono(n){return{dom:{tag:"div",classes:["tox-text"],innerHtml:n+"%"}}}varr=vm({dom:{tag:"p",innerHtml:t.translationProvider(t.text)},behaviours:ba([mg.config({})])}),i=vm({dom:{tag:"div",classes:t.progress?["tox-progress-bar","tox-progress-indicator"]:["tox-progress-bar"]},components:[{dom:{tag:"div",classes:["tox-bar-container"]},components:[e(0)]},o(0)],behaviours:ba([mg.config({})])}),n={updateProgress:function(n,t){n.getSystem().isConnected()&&i.getOpt(n).each(function(n){mg.set(n,[{dom:{tag:"div",classes:["tox-bar-container"]},components:[e(t)]},o(t)])})},updateText:function(n,t){if(n.getSystem().isConnected()){vare=r.get(n);mg.set(e,[Ir(t)])}}},u=H([t.icon.toArray(),t.level.toArray(),t.level.bind(function(n){returnon.from(Xg[n])}).toArray()]);return{uid:t.uid,dom:{tag:"div",attributes:{role:"alert"},classes:t.level.map(function(n){return["tox-notification","tox-notification--in","tox-notification--"+n]}).getOr(["tox-notification","tox-notification--in"])},components:[{dom:{tag:"div",classes:["tox-notification__icon"],innerHtml:function(n,t){returnDu(n,function(n){returnon.from(t()[n])}).getOrThunk(function(){returnbm(t)})}(u,t.iconProvider)}},{dom:{tag:"div",classes:["tox-notification__body"]},components:[r.asSpec()],behaviours:ba([mg.config({})])}].concat(t.progress?[i.asSpec()]:[]).concat(Gg.sketch({dom:{tag:"button",classes:["tox-notification__dismiss","tox-button","tox-button--naked","tox-button--icon"]},components:[{dom:{tag:"div",classes:["tox-icon"],innerHtml:ym("close",t.iconProvider),attributes:{"aria-label":t.translationProvider("Close")}}}],action:function(n){t.onAction(n)}})),apis:n}},configFields:[ht("level"),ct("progress"),ct("icon"),ct("onAction"),ct("text"),ct("iconProvider"),ct("translationProvider")],apis:{updateProgress:function(n,t,e){n.updateProgress(t,e)},updateText:function(n,t,e){n.updateText(t,e)}}}),qg=tinymce.util.Tools.resolve("tinymce.util.Delay");functionKg(n,u,o){vara=u.backstage;return{open:function(n,t){functione(){t(),jg.hide(i)}varr=uu(Yg.sketch({text:n.text,level:vn(["success","error","warning","warn","info"],n.type)?n.type:undefined,progress:!0===n.progressBar,icon:on.from(n.icon),onAction:e,iconProvider:a.shared.providers.icons,translationProvider:a.shared.providers.translate})),i=uu(jg.sketch({dom:{tag:"div",classes:["tox-notifications-container"]},lazySink:u.backstage.shared.getSink,fireDismissalEventInstead:{}}));returno.add(i),0<n.timeout&&qg.setTimeout(function(){e()},n.timeout),{close:e,moveTo:function(n,t){jg.showAt(i,{anchor:"makeshift",x:n,y:t},au(r))},moveRel:function(n,t){if("banner"!==t){vare=function(n){switch(n){case"bc-bc":returnWg;case"tc-tc":returnUg;case"tc-bc":returnoc;case"bc-tc":default:returnrc}}(t),o={anchor:"node",root:zr(),node:on.some(we.fromDom(n)),layouts:{onRtl:function(){return[e]},onLtr:function(){return[e]}}};jg.showAt(i,o,au(r))}elsejg.showAt(i,u.backstage.shared.anchors.banner(),au(r))},text:function(n){Yg.updateText(r,n)},settings:n,getEl:function(){returnr.element().dom()},progressBar:{value:function(n){Yg.updateProgress(r,n)}}}},close:function(n){n.close()},reposition:function(n){!function(n){bn(n,function(n){returnn.moveTo(0,0)})}(n),function(e){0<e.length&&(yn(e).each(function(n){returnn.moveRel(null,"banner")}),bn(e,function(n,t){0<t&&n.moveRel(e[t-1].getEl(),"bc-tc")}))}(n)},getArgs:function(n){returnn.settings}}}functionJg(e,o){varr=null;return{cancel:function(){null!==r&&(v.clearTimeout(r),r=null)},throttle:function(){for(varn=[],t=0;t<arguments.length;t++)n[t]=arguments[t];null!==r&&v.clearTimeout(r),r=v.setTimeout(function(){e.apply(null,n),r=null},o)}}}function$g(n,t,e,o,r){vari=newAp(t,r||n.getRoot());returnFp(n,t,on.some(e),o,i.prev,on.none())}functionQg(t,e){returnIp(we.fromDom(t.selection.getNode())).getOrThunk(function(){varn=we.fromHtml('<span data-mce-autocompleter="1" data-mce-bogus="1"></span>',t.getDoc());returnHi(n,we.fromDom(e.extractContents())),e.insertNode(n.dom()),Eo(n).each(function(n){returnn.dom().normalize()}),Ic(n).map(function(n){t.selection.setCursorLocation(n.dom(),function(n){return"img"===Ke(n)?1:Ac(n).fold(function(){returnBo(n).length},function(n){returnn.length})}(n))}),n})}functionZg(n,t){returnn.toString().substring(t.length).replace(/\u00A0/g," ").replace(/\uFEFF/g,"")}functionnp(n,u,a,c){returnvoid0===c&&(c=0),function(n){returnn.collapsed&&3===n.startContainer.nodeType}(u)?$g(n,u.startContainer,u.startOffset,function(e,o,r,n){vari=n.getOr(r.length);returnfunction(n,t,e,o){varr;for(r=t-1;0<=r;r--){vari=n.charAt(r);if(Rp.test(i))returnon.none();if(i===e)break}return-1===r||t-r<o?on.none():on.some(n.substring(r+1,t))}(r,i,a,1).fold(function(){returnr.match(Rp)?e.abort():e.kontinue()},function(n){vart=u.cloneRange();returnt.setStart(o,i-n.length-1),t.setEnd(u.endContainer,u.endOffset),r.length<c?e.abort():e.finish({text:Zg(t,a),range:t,triggerChar:a})})}).fold(on.none,on.none,on.some):on.none()}functiontp(e,n,o,t){returnvoid0===t&&(t=0),Ip(we.fromDom(n.startContainer)).fold(function(){returnnp(e,n,o,t)},function(n){vart=e.createRng();returnt.selectNode(n.dom()),on.some({range:t,text:Zg(t,o),triggerChar:o})})}functionep(n,t){return{element:n,offset:t}}functionop(t,e){varn=e(),o=t.selection.getRng();returnfunction(t,e,n){returnDu(n.triggerChars,function(n){returntp(t,e,n)})}(t.dom,o,n).bind(function(n){returnzp(t,e,n)})}functionrp(n){vart=n.ui.registry.getAll().popups,e=P(t,function(n){returnfunction(n){returntt("Autocompleter",Up,n)}(n).fold(function(n){thrownewError(le(n))},function(n){returnn})}),o=function(n){vart={};returnbn(n,function(n){t[n]={}}),wn(t)}(On(e,function(n){returnn.ch})),r=R(e);return{dataset:e,triggerChars:o,lookupByChar:function(t){returnC(r,function(n){returnn.ch===t})}}}functionip(n,o,t){varr=zc(n.element(),"."+t);if(0<r.length){vare=T(r,function(n){vart=n.dom().getBoundingClientRect().top,e=r[0].dom().getBoundingClientRect().top;returnMath.abs(t-e)>o}).getOr(r.length);returnon.some({numColumns:e,numRows:Math.ceil(r.length/e)})}returnon.none()}functionup(n,t){returnba([Kd(n,t)])}functionap(n,t,e){n.getSystem().broadcastOn([Zp],{})}functioncp(n){vart=we.fromHtml(n),e=Bo(t),o=function(n){vart=n.dom().attributes!==undefined?n.dom().attributes:[];returnO(t,function(n,t){vare;return"class"===t.name?n:N(N({},n),((e={})[t.name]=t.value,e))},{})}(t),r=function(n){returnArray.prototype.slice.call(n.dom().classList,0)}(t),i=0===e.length?{}:{innerHtml:Vo(t)};returnN({tag:Ke(t),classes:r,attributes:o},i)}functionsp(n){returnNn(ch,n).getOr(ih)}functionfp(n){return{dom:{tag:"div",classes:[fh],innerHtml:n}}}functionlp(n){return{dom:{tag:"div",classes:[lh]},components:[Ir(rh.translate(n))]}}functiondp(n,t){return{dom:{tag:"div",classes:[lh]},components:[{dom:{tag:n.tag,attributes:{style:n.styleAttr}},components:[Ir(rh.translate(t))]}]}}functionmp(n){return{dom:{tag:"div",classes:["tox-collection__item-accessory"],innerHtml:ph(n)}}}functiongp(n){return{dom:{tag:"div",classes:[fh,"tox-collection__item-checkmark"],innerHtml:ym("checkmark",n)}}}functionpp(n,t,e,o,r){vari=e?n.checkMark.orThunk(function(){returnt.or(on.some("")).map(fp)}):on.none(),u=n.ariaLabel.map(function(n){return{attributes:{title:rh.translate(n)}}}).getOr({});return{dom:An({tag:"div",classes:[ih,uh].concat(r?["tox-collection__item-icon-rtl"]:[])},u),optComponents:[i,n.htmlContent.fold(function(){returnn.textContent.map(o)},function(n){returnon.some(function(n){return{dom:{tag:"div",classes:[lh],innerHtml:n}}}(n))}),n.shortcutContent.map(mp),n.caret]}}functionhp(n,t,e,o){void0===o&&(o=on.none());varr=rh.isRtl()&&n.iconContent.exists(function(n){returnvn(vh,n)}),i=n.iconContent.map(function(n){returnrh.isRtl()&&vn(hh,n)?n+"-rtl":n}).map(function(n){returnfunction(n,t,e){returnon.from(t()[n]).or(e).getOrThunk(function(){returnbm(t)})}(n,t.icons,o)}),u=on.from(n.meta).fold(function(){returnlp},function(n){returnEn(n,"style")?d(dp,n.style):lp});return"color"===n.presets?function(n,t,e,o){varr,i,u;return{dom:(r=ah,i=e.getOr(""),u=n.map(function(n){return' title="'+o.translate(n)+'"'}).getOr(""),cp("custom"===t?'<button class="'+r+' tox-swatches__picker-btn"'+u+">"+i+"</button>":"remove"===t?'<div class="'+r+' tox-swatch--remove"'+u+">"+i+"</div>":'<div class="'+r+'" style="background-color: '+t+'" data-mce-color="'+t+'"'+u+"></div>")),optComponents:[]}}(n.ariaLabel,n.value,i,t):pp(n,i,e,u,r)}functionvp(n,t,e){t.disabled&&yh(n,t)}functionbp(n,t){return!0===t.useNative&&vn(bh,Ke(n.element()))}functionyp(n){Po(n.element(),"disabled","disabled")}functionxp(n){jo(n.element(),"disabled")}functionwp(n){Po(n.element(),"aria-disabled","true")}functionSp(n){Po(n.element(),"aria-disabled","false")}functionCp(t,n,e){n.disableClass.each(function(n){dr(t.element(),n)}),(bp(t,n)?xp:Sp)(t),n.onEnabled(t)}functionkp(n,t){returnbp(n,t)?function(n){returnLo(n.element(),"disabled")}(n):function(n){return"true"===zo(n.element(),"aria-disabled")}(n)}functionOp(n,t){vare=n.getApi(t);returnfunction(n){n(e)}}functionEp(e,o){returnIi(function(n){Op(e,n)(function(n){vart=e.onSetup(n);null!==t&&t!==undefined&&o.set(t)})})}functionTp(t,e){returnRi(function(n){returnOp(t,n)(e.get())})}varBp,Dp,Ap=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),_p=Tn([{aborted:[]},{edge:["element"]},{success:["info"]}]),Mp=Tn([{abort:[]},{kontinue:[]},{finish:["info"]}]),Fp=function(t,e,n,o,r,i){functionu(){returni.fold(_p.aborted,_p.edge)}functiona(){varn=r();returnn?Fp(t,n,on.none(),o,r,on.some(e)):u()}if(function(n,t){returnn.isBlock(t)||vn(["BR","IMG","HR","INPUT"],t.nodeName)||"false"===n.getContentEditable(t)}(t,e))returnu();if(function(n){returnn.nodeType===v.Node.TEXT_NODE}(e)){varc=e.textContent;returno(Mp,e,c,n).fold(_p.aborted,function(){returna()},_p.success)}returna()},Ip=function(n){returnOu(n,"[data-mce-autocompleter]")},Rp=/[\u00a0 \t\r\n]/,Vp=function(e,n){n.on("keypress compositionend",e.onKeypress.throttle),n.on("remove",e.onKeypress.cancel);functiono(n,t){ro(n,ni(),{raw:t})}n.on("keydown",function(t){functionn(){returne.getView().bind(ad.getHighlighted)}8===t.which&&e.onKeypress.throttle(t),e.isActive()&&(27===t.which&&e.cancelIfNecessary(),e.isMenuOpen()?13===t.which?(n().each(io),t.preventDefault()):40===t.which?(n().fold(function(){e.getView().each(ad.highlightFirst)},function(n){o(n,t)}),t.preventDefault(),t.stopImmediatePropagation()):37!==t.which&&38!==t.which&&39!==t.which||n().each(function(n){o(n,t),t.preventDefault(),t.stopImmediatePropagation()}):13!==t.which&&38!==t.which&&40!==t.which||e.cancelIfNecessary())}),n.on("NodeChange",function(n){e.isActive()&&!e.isProcessingAction()&&Ip(we.fromDom(n.element)).isNone()&&e.cancelIfNecessary()})},Np=tinymce.util.Tools.resolve("tinymce.util.Promise"),Hp=function(n){if(function(n){returnn.nodeType===v.Node.TEXT_NODE}(n))returnep(n,n.data.length);vart=n.childNodes;return0<t.length?Hp(t[t.length-1]):ep(n,t.length)},Pp=function(n,t){vare=n.childNodes;return0<e.length&&t<e.length?Pp(e[t],0):0<e.length&&function(n){returnn.nodeType===v.Node.ELEMENT_NODE}(n)&&e.length===t?Hp(e[e.length-1]):ep(n,t)},zp=function(t,n,e,o){void0===o&&(o={});varr=n(),i=t.selection.getRng().startContainer.nodeValue,u=C(r.lookupByChar(e.triggerChar),function(n){returne.text.length>=n.minChars&&n.matches.getOrThunk(function(){returnfunction(e){functiono(n,t,e,o){varr=o.getOr(e.length);return0===r?n.kontinue():n.finish(/\s/.test(e.charAt(r-1)))}returnfunction(n){vart=Pp(n.startContainer,n.startOffset);return$g(e,t.element,t.offset,o).fold(nn(!0),nn(!0),l)}}(t.dom)})(e.range,i,e.text)});if(0===u.length)returnon.none();vara=Np.all(S(u,function(t){returnt.fetch(e.text,t.maxResults,o).then(function(n){return{matchText:e.text,items:n,columns:t.columns,onAction:t.onAction}})}));returnon.some({lookupData:a,context:e})},Lp=re([ft("type"),yt("text")]),jp=re([At("type",function(){return"autocompleteitem"}),At("active",function(){return!1}),At("disabled",function(){return!1}),St("meta",{}),ft("value"),yt("text"),yt("icon")]),Up=re([ft("type"),ft("ch"),kt("minChars",1),St("columns",1),kt("maxResults",10),xt("matches"),dt("fetch"),dt("onAction")]),Wp=[Tt("disabled",!1),yt("text"),yt("shortcut"),ce("value","value",In(function(){returnXo("menuitem-value")}),de()),St("meta",{})],Gp=re([ft("type"),Bt("onSetup",function(){returnZ}),Bt("onAction",Z),yt("icon")].concat(Wp)),Xp=re([ft("type"),dt("getSubmenuItems"),Bt("onSetup",function(){returnZ}),yt("icon")].concat(Wp)),Yp=re([ft("type"),Tt("active",!1),Bt("onSetup",function(){returnZ}),dt("onAction")].concat(Wp)),qp=re([ft("type"),Tt("active",!1),yt("icon")].concat(Wp)),Kp=re([ft("type"),lt("fancytype",["inserttable","colorswatch"]),Bt("onAction",Z)]),Jp=function(n){returnup(Xo("unnamed-events"),n)},$p=[ct("lazySink"),ct("tooltipDom"),St("exclusive",!0),St("tooltipComponents",[]),St("delay",300),Et("mode","normal",["normal","follow-highlight"]),St("anchor",function(n){return{anchor:"hotspot",hotspot:n,layouts:{onLtr:nn([rc,oc,ua,ca,aa,sa]),onRtl:nn([rc,oc,ua,ca,aa,sa])}}}),qu("onHide"),qu("onShow")],Qp=/* */Object.freeze({init:function(){functione(){o.get().each(function(n){v.clearTimeout(n)})}varo=ye(on.none()),t=ye(on.none()),n=nn("not-implemented");returnnu({getTooltip:function(){returnt.get()},isShowing:function(){returnt.get().isSome()},setTooltip:function(n){t.set(on.some(n))},clearTooltip:function(){t.set(on.none())},clearTimer:e,resetTimer:function(n,t){e(),o.set(on.some(v.setTimeout(function(){n()},t)))},readState:n})}}),Zp=Xo("tooltip.exclusive"),nh=Xo("tooltip.show"),th=Xo("tooltip.hide"),eh=/* */Object.freeze({hideAllExclusive:ap,setComponents:function(n,t,e,o){e.getTooltip().each(function(n){n.getSystem().isConnected()&&mg.set(n,o)})}}),oh=ya({fields:$p,name:"tooltipping",active:/* */Object.freeze({events:function(o,r){functione(t){r.getTooltip().each(function(n){bs(n),o.onHide(t,n),r.clearTooltip()}),r.clearTimer()}returnco(H([[lo(nh,function(n){r.resetTimer(function(){!function(t){if(!r.isShowing()){ap(t);varn=o.lazySink(t).getOrDie(),e=t.getSystem().build({dom:o.tooltipDom,components:o.tooltipComponents,events:co("normal"===o.mode?[lo($r(),function(n){oo(t,nh)}),lo(Kr(),function(n){oo(t,th)})]:[]),behaviours:ba([mg.config({})])});r.setTooltip(e),hs(n,e),o.onShow(t,e),Af.position(n,o.anchor(t),e)}}(n)},o.delay)}),lo(th,function(n){r.resetTimer(function(){e(n)},o.delay)}),lo(li(),function(n,t){vn(t.channels(),Zp)&&e(n)}),Ri(function(n){e(n)})],"normal"===o.mode?[lo(Qr(),function(n){oo(n,nh)}),lo(si(),function(n){oo(n,th)}),lo($r(),function(n){oo(n,nh)}),lo(Kr(),function(n){oo(n,th)})]:[lo(_i(),function(n,t){oo(n,nh)}),lo(Mi(),function(n){oo(n,th)})]]))}}),state:Qp,apis:eh}),rh=tinymce.util.Tools.resolve("tinymce.util.I18n"),ih="tox-menu-nav__js",uh="tox-collection__item",ah="tox-swatch",ch={normal:ih,color:ah},sh="tox-collection__item--enabled",fh="tox-collection__item-icon",lh="tox-collection__item-label",dh="tox-collection__item-caret",mh="tox-collection__item--active",gh=tinymce.util.Tools.resolve("tinymce.Env"),ph=function(n){vare=gh.mac?{alt:"⌥",ctrl:"⌃",shift:"⇧",meta:"⌘",access:"⌃⌥"}:{meta:"Ctrl",access:"Shift+Alt"},t=n.split("+"),o=S(t,function(n){vart=n.toLowerCase().trim();returnEn(e,t)?e[t]:n});returngh.mac?o.join(""):o.join("+")},hh=["list-num-default","list-num-lower-alpha","list-num-lower-greek","list-num-lower-roman","list-num-upper-alpha","list-num-upper-roman"],vh=["list-bull-circle","list-bull-default","list-bull-square"],bh=["input","button","textarea","select"],yh=function(t,n,e){n.disableClass.each(function(n){fr(t.element(),n)}),(bp(t,n)?yp:wp)(t),n.onDisabled(t)},xh=/* */Object.freeze({enable:Cp,disable:yh,isDisabled:kp,onLoad:vp,set:function(n,t,e,o){(o?yh:Cp)(n,t,e)}}),wh=/* */Object.freeze({exhibit:function(n,t,e){returnZo({classes:t.disabled?t.disableClass.map(M).getOr([]):[]})},events:function(e,n){returnco([so(di(),function(n,t){returnkp(n,e)}),ga(e,n,vp)])}}),Sh=[St("disabled",!1),St("useNative",!0),ht("disableClass"),qu("onDisabled"),qu("onEnabled")],Ch=ya({fields:Sh,name:"disabling",active:wh,apis:xh}),kh=function(n){returnCh.config({disabled:n,disableClass:"tox-collection__item--state-disabled"})},Oh=function(n){returnCh.config({disabled:n})},Eh=function(n){returnCh.config({disabled:n,disableClass:"tox-tbtn--disabled"})},Th=function(n){returnCh.config({disabled:n,disableClass:"tox-tbtn--disabled",useNative:!1})};(Dp=Bp=Bp||{})[Dp.CLOSE_ON_EXECUTE=0]="CLOSE_ON_EXECUTE",Dp[Dp.BUBBLE_TO_SANDBOX=1]="BUBBLE_TO_SANDBOX";functionBh(n){returnB(n,function(n){returnn.toArray()})}functionDh(n,t,e){varo=ye(Z);return{type:"item",dom:t.dom,components:Bh(t.optComponents),data:n.data,eventOrder:Ih,hasSubmenu:n.triggersSubmenu,itemBehaviours:ba([Kd("item-events",[function(e,o){returnNi(function(n,t){Op(e,n)(e.onAction),e.triggersSubmenu||o!==Fh.CLOSE_ON_EXECUTE||(oo(n,hi()),t.stop())})}(n,e),Ep(n,o),Tp(n,o)]),kh(n.disabled),mg.config({})].concat(n.itemBehaviours))}}functionAh(n){return{value:n.value,meta:An({text:n.text.getOr("")},n.meta)}}function_h(n,t){vare=function(n){returnRh.DOM.encode(n)}(rh.translate(n));if(0<t.length){varo=newRegExp(function(n){returnn.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(t),"gi");returne.replace(o,function(n){return'<span class="tox-autocompleter-highlight">'+n+"</span>"})}returne}functionMh(t,e,n){functiono(n){returnro(n,Hh,{row:t,col:e})}functionr(n,t){t.stop(),o(n)}vari;returnuu({dom:{tag:"div",attributes:(i={role:"button"},i["aria-labelledby"]=n,i)},behaviours:ba([Kd("insert-table-picker-cell",[lo($r(),vg.focus),lo(di(),o),lo(ri(),r),lo(gi(),r)]),Cg.config({toggleClass:"tox-insert-table-picker__selected",toggleOnExecute:!1}),vg.config({onFocus:function(n){returnro(n,Nh,{row:t,col:e})}})])})}varFh=Bp,Ih={"alloy.execute":["disabling","alloy.base.behaviour","toggling","item-events"]},Rh=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),Vh=nn(js("item-widget",Ag())),Nh=Xo("cell-over"),Hh=Xo("cell-execute");functionPh(n){return{value:nn(n)}}functionzh(n){returnJh.test(n)||$h.test(n)}functionLh(n){vart=function(n){vart=n.value().replace(Jh,function(n,t,e,o){returnt+t+e+e+o+o});return{value:nn(t)}}(n),e=$h.exec(t.value());returnnull===e?["FFFFFF","FF","FF","FF"]:e}functionjh(n){vart=n.toString(16);return1===t.length?"0"+t:t}functionUh(n){vart=jh(n.red())+jh(n.green())+jh(n.blue());returnPh(t)}functionWh(n,t,e,o){return{red:nn(n),green:nn(t),blue:nn(e),alpha:nn(o)}}functionGh(n){vart=parseInt(n,10);returnt.toString()===n&&0<=t&&t<=255}functionXh(n){vart,e,o,r=(n.hue()||0)%360,i=n.saturation()/100,u=n.value()/100;if(i=Zh(0,Qh(i,1)),u=Zh(0,Qh(u,1)),0===i)returnt=e=o=nv(255*u),Wh(t,e,o,1);vara=r/60,c=u*i,s=c*(1-Math.abs(a%2-1)),f=u-c;switch(Math.floor(a)){case0:t=c,e=s,o=0;break;case1:t=s,e=c,o=0;break;case2:t=0,e=c,o=s;break;case3:t=0,e=s,o=c;break;case4:t=s,e=0,o=c;break;case5:t=c,e=0,o=s;break;default:t=e=o=0}returnt=nv(255*(t+f)),e=nv(255*(e+f)),o=nv(255*(o+f)),Wh(t,e,o,1)}functionYh(n){vart=Lh(n),e=parseInt(t[1],16),o=parseInt(t[2],16),r=parseInt(t[3],16);returnWh(e,o,r,1)}functionqh(n,t,e,o){varr=parseInt(n,10),i=parseInt(t,10),u=parseInt(e,10),a=parseFloat(o);returnWh(r,i,u,a)}functionKh(n){return"rgba("+n.red()+","+n.green()+","+n.blue()+","+n.alpha()+")"}varJh=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,$h=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,Qh=Math.min,Zh=Math.max,nv=Math.round,tv=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)/,ev=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d?(?:\.\d+)?)\)/,ov=nn(Wh(255,0,0,1)),rv=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),iv="tinymce-custom-colors";functionuv(n){vart=[],u=v.document.createElement("canvas");u.height=1,u.width=1;for(vara=u.getContext("2d"),c=function(n,t){vare=t/255;return("0"+Math.round(n*e+255*(1-e)).toString(16)).slice(-2).toUpperCase()},e=function(n){if(/^[0-9A-Fa-f]{6}$/.test(n))return"#"+n.toUpperCase();a.clearRect(0,0,u.width,u.height),a.fillStyle="#FFFFFF",a.fillStyle=n,a.fillRect(0,0,1,1);vart=a.getImageData(0,0,1,1).data,e=t[0],o=t[1],r=t[2],i=t[3];return"#"+c(e,i)+c(o,i)+c(r,i)},o=0;o<n.length;o+=2)t.push({text:n[o+1],value:e(n[o]),type:"choiceitem"});returnt}functionav(n){returnn.getParam("color_map")}functioncv(n,e){varo;returnn.dom.getParents(n.selection.getStart(),function(n){vart;(t=n.style["forecolor"===e?"color":"background-color"])&&(o=o||t)}),o}functionsv(n){returnMath.max(5,Math.ceil(Math.sqrt(n)))}functionfv(n){vart=Iv(n),e=sv(t.length);returnMv(n,e)}functionlv(t,e,n,o){"custom"===n?jv(t)(function(n){n.each(function(n){Vv(n),t.execCommand("mceApplyTextcolor",e,n),o(n)})},"#000000"):"remove"===n?(o(""),t.execCommand("mceRemoveTextcolor",e)):(o(n),t.execCommand("mceApplyTextcolor",e,n))}functiondv(n,t){returnn.concat(Rv().concat(function(n){vart="choiceitem",e={type:t,text:"Remove color",icon:"color-swatch-remove-color",value:"remove"};returnn?[e,{type:t,text:"Custom color",icon:"color-picker",value:"custom"}]:[e]}(t)))}functionmv(t,e){returnfunction(n){n(dv(t,e))}}functiongv(n,t,e){varo,r;o="forecolor"===t?"tox-icon-text-color__color":"tox-icon-highlight-bg-color__color",r=e,n.setIconFill(o,r),n.setIconStroke(o,r)}functionpv(o,e,r,n,i){o.ui.registry.addSplitButton(e,{tooltip:n,presets:"color",icon:"forecolor"===e?"text-color":"highlight-bg-color",select:function(e){returnon.from(cv(o,r)).bind(function(n){returnfunction(n){if("transparent"===n)returnon.some(Wh(0,0,0,0));vart=tv.exec(n);if(null!==t)returnon.some(qh(t[1],t[2],t[3],"1"));vare=ev.exec(n);returnnull!==e?on.some(qh(e[1],e[2],e[3],e[4])):on.none()}(n).map(function(n){vart=Uh(n).value();returnVt(e.toLowerCase(),t)})}).getOr(!1)},columns:fv(o),fetch:mv(Iv(o),Fv(o)),onAction:function(n){null!==i.get()&&lv(o,r,i.get(),function(){})},onItemAction:function(n,t){lv(o,r,t,function(n){i.set(n),Lv(o,{name:e,color:n})})},onSetup:function(t){null!==i.get()&&gv(t,e,i.get());functionn(n){n.name===e&&gv(t,n.name,n.color)}returno.on("TextColorChange",n),function(){o.off("TextColorChange",n)}}})}functionhv(t,n,e,o){t.ui.registry.addNestedMenuItem(n,{text:o,icon:"forecolor"===n?"text-color":"highlight-bg-color",getSubmenuItems:function(){return[{type:"fancymenuitem",fancytype:"colorswatch",onAction:function(n){lv(t,e,n.value,Z)}}]}})}functionvv(e,o){returnfunction(n){vart=w(n,o);returnS(t,function(n){return{dom:e,components:n}})}}functionbv(n,e){varo=[],r=[];returnbn(n,function(n,t){e(n,t)?(0<r.length&&o.push(r),r=[],En(n.dom,"innerHtml")&&r.push(n)):r.push(n)}),0<r.length&&o.push(r),S(o,function(n){return{dom:{tag:"div",classes:["tox-collection__group"]},components:n}})}functionyv(t,e,n){return{dom:{tag:"div",classes:["tox-menu","tox-collection"].concat(1===t?["tox-collection--list"]:["tox-collection--grid"])},components:[Vg.parts().items({preprocess:function(n){return"auto"!==t&&1<t?vv({tag:"div",classes:["tox-collection__group"]},t)(n):bv(n,function(n,t){return"separator"===e[t].type})}})]}}functionxv(n){return{backgroundMenu:"tox-background-menu",selectedMenu:"tox-selected-menu",selectedItem:"tox-collection__item--active",hasIcons:"tox-menu--has-icons",menu:function(n){return"color"===n?"tox-swatches":"tox-menu"}(n),tieredMenu:"tox-tiered-menu"}}functionwv(n){vart=xv(n);return{backgroundMenu:t.backgroundMenu,selectedMenu:t.selectedMenu,menu:t.menu,selectedItem:t.selectedItem,item:sp(n)}}functionSv(n,t,e){varo=xv(e);return{dom:{tag:"div",classes:H([[o.tieredMenu]])},markers:wv(e)}}functionCv(n){returnn.icon!==undefined||"togglemenuitem"===n.type||"choicemenuitem"===n.type}functionkv(n){returnv.console.error(le(n)),v.console.log(n),on.none()}functionOv(n,t,e,o,r){vari=function(e){return{dom:{tag:"div",classes:["tox-collection","tox-collection--horizontal"]},components:[Vg.parts().items({preprocess:function(n){returnbv(n,function(n,t){return"separator"===e[t].type})}})]}}(e);return{value:n,dom:i.dom,components:i.components,items:e}}functionEv(n,t,e,o,r){vari;return"color"===r?{value:n,dom:(i=function(n){return{dom:{tag:"div",classes:["tox-menu","tox-swatches-menu"]},components:[{dom:{tag:"div",classes:["tox-swatches"]},components:[Vg.parts().items({preprocess:"auto"!==n?vv({tag:"div",classes:["tox-swatches__row"]},n):l})]}]}}(o)).dom,components:i.components,items:e}:"normal"===r&&"auto"===o?{value:n,dom:(i=yv(o,e)).dom,components:i.components,items:e}:"normal"===r&&1===o?{value:n,dom:(i=yv(1,e)).dom,components:i.components,items:e}:"normal"===r?{value:n,dom:(i=yv(o,e)).dom,components:i.components,items:e}:"listpreview"!==r||"auto"===o?{value:n,dom:function(n,t,e){varo=xv(e);return{tag:"div",classes:H([[o.menu,"tox-menu-"+t+"-column"],n?[o.hasIcons]:[]])}}(t,o,r),components:Wv,items:e}:{value:n,dom:(i=function(n){return{dom:{tag:"div",classes:["tox-menu","tox-collection","tox-collection--toolbar","tox-collection--toolbar-lg"]},components:[Vg.parts().items({preprocess:vv({tag:"div",classes:["tox-collection__group"]},n)})]}}(o)).dom,components:i.components,items:e}}functionTv(n,t,e,o,r,i,u,a){varc=function(n){returnx(n,Cv)}(t),s=Gv(t,e,o,"color"!==r?"normal":"color",i,u,a);returnEv(n,c,s,o,r)}functionBv(n,t){vare=wv(t);return1===n?{mode:"menu",moveOnTab:!0}:"auto"===n?{mode:"grid",selector:"."+e.item,initSize:{numColumns:1,numRows:1}}:{mode:"matrix",rowSelector:"."+("color"===t?"tox-swatches__row":"tox-collection__group")}}varDv="choiceitem",Av=[{type:Dv,text:"Light Green",value:"#BFEDD2"},{type:Dv,text:"Light Yellow",value:"#FBEEB8"},{type:Dv,text:"Light Red",value:"#F8CAC6"},{type:Dv,text:"Light Purple",value:"#ECCAFA"},{type:Dv,text:"Light Blue",value:"#C2E0F4"},{type:Dv,text:"Green",value:"#2DC26B"},{type:Dv,text:"Yellow",value:"#F1C40F"},{type:Dv,text:"Red",value:"#E03E2D"},{type:Dv,text:"Purple",value:"#B96AD9"},{type:Dv,text:"Blue",value:"#3598DB"},{type:Dv,text:"Dark Turquoise",value:"#169179"},{type:Dv,text:"Orange",value:"#E67E23"},{type:Dv,text:"Dark Red",value:"#BA372A"},{type:Dv,text:"Dark Purple",value:"#843FA1"},{type:Dv,text:"Dark Blue",value:"#236FA1"},{type:Dv,text:"Light Gray",value:"#ECF0F1"},{type:Dv,text:"Medium Gray",value:"#CED4D9"},{type:Dv,text:"Gray",value:"#95A5A6"},{type:Dv,text:"Dark Gray",value:"#7E8C8D"},{type:Dv,text:"Navy Blue",value:"#34495E"},{type:Dv,text:"Black",value:"#000000"},{type:Dv,text:"White",value:"#ffffff"}],_v=functioniI(t){void0===t&&(t=10);varn,e=rv.getItem(iv),o=cn(e)?JSON.parse(e):[],r=t-(n=o).length<0?n.slice(0,t):n,i=function(n){r.splice(n,1)};return{add:function(n){(function(n,t){vare=y(n,t);return-1===e?on.none():on.some(e)})(r,n).each(i),r.unshift(n),r.length>t&&r.pop(),rv.setItem(iv,JSON.stringify(r))},state:function(){returnr.slice(0)}}}(10),Mv=function(n,t){returnn.getParam("color_cols",t,"number")},Fv=function(n){return!1!==n.getParam("custom_colors")},Iv=function(n){vart=av(n);returnt!==undefined?uv(t):Av},Rv=function(){returnS(_v.state(),function(n){return{type:Dv,text:n,value:n}})},Vv=function(n){_v.add(n)},Nv=function(n){returnn.fire("SkinLoaded")},Hv=function(n){returnn.fire("ResizeEditor")},Pv=function(n,t){returnn.fire("ScrollContent",t)},zv=function(n,t){returnn.fire("ResizeContent",t)},Lv=function(n,t){returnn.fire("TextColorChange",t)},jv=function(i){returnfunction(n,t){vare,o={colorpicker:t},r=(e=n,function(n){vart=n.getData();e(on.from(t.colorpicker)),n.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(n,t){"hex-valid"===t.name&&(t.value?n.enable("ok"):n.disable("ok"))},onSubmit:r,onClose:function(){},onCancel:function(){n(on.none())}})}},Uv={register:function(n){!function(e){e.addCommand("mceApplyTextcolor",function(n,t){!function(n,t,e){n.undoManager.transact(function(){n.focus(),n.formatter.apply(t,{value:e}),n.nodeChanged()})}(e,n,t)}),e.addCommand("mceRemoveTextcolor",function(n){!function(n,t){n.undoManager.transact(function(){n.focus(),n.formatter.remove(t,{value:null},null,!0),n.nodeChanged()})}(e,n)})}(n);vart=ye(null),e=ye(null);pv(n,"forecolor","forecolor","Text color",t),pv(n,"backcolor","hilitecolor","Background color",e),hv(n,"forecolor","forecolor","Text color"),hv(n,"backcolor","hilitecolor","Background color")},getColors:dv,getFetch:mv,colorPickerDialog:jv,getCurrentColor:cv,getColorCols:fv,calcCols:sv},Wv=[Vg.parts().items({})],Gv=function(n,e,o,r,i,u,a){returnBu(S(n,function(t){return"choiceitem"===t.type?function(n){returntt("choicemenuitem",qp,n)}(t).fold(kv,function(n){returnon.some(function(t,n,e,o,r,i,u){vara=hp({presets:e,textContent:n?t.text:on.none(),htmlContent:on.none(),ariaLabel:t.text,iconContent:t.icon,shortcutContent:n?t.shortcut:on.none(),checkMark:n?on.some(gp(u.icons)):on.none(),caret:on.none(),value:t.value},u,!0);returnDn(Dh({data:Ah(t),disabled:t.disabled,getApi:function(t){return{setActive:function(n){Cg.set(t,n)},isActive:function(){returnCg.isOn(t)},isDisabled:function(){returnCh.isDisabled(t)},setDisabled:function(n){returnCh.set(t,n)}}},onAction:function(n){returno(t.value)},onSetup:function(n){returnn.setActive(r),function(){}},triggersSubmenu:!1,itemBehaviours:[]},a,i),{toggling:{toggleClass:sh,toggleOnExecute:!1,selected:t.active}})}(n,1===o,r,e,u(t.value),i,a))}):on.none()}))};varXv,Yv,qv={inserttable:functionuI(o){varn=Xo("size-label"),i=function(n,t,e){for(varo=[],r=0;r<t;r++){for(vari=[],u=0;u<e;u++)i.push(Mh(r,u,n));o.push(i)}returno}(n,10,10),u=vm({dom:{tag:"span",classes:["tox-insert-table-picker__label"],attributes:{id:n}},components:[Ir("0x0")],behaviours:ba([mg.config({})])});return{type:"widget",data:{value:Xo("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[Vh().widget({dom:{tag:"div",classes:["tox-insert-table-picker"]},components:function(n){returnB(n,function(n){returnS(n,au)})}(i).concat(u.asSpec()),behaviours:ba([Kd("insert-table-picker",[ho(Nh,function(n,t,e){varo=e.event().row(),r=e.event().col();!function(n,t,e,o,r){for(vari=0;i<o;i++)for(varu=0;u<r;u++)Cg.set(n[i][u],i<=t&&u<=e)}(i,o,r,10,10),mg.set(u.get(n),[function(n,t){returnIr(t+1+"x"+(n+1))}(o,r)])}),ho(Hh,function(n,t,e){o.onAction({numRows:e.event().row()+1,numColumns:e.event().col()+1}),oo(n,hi())})]),lg.config({initSize:{numRows:10,numColumns:10},mode:"flatgrid",selector:'[role="button"]'})])})]}},colorswatch:functionaI(t,n){vare=Uv.getColors(n.colorinput.getColors(),n.colorinput.hasCustomColors()),o=n.colorinput.getColorCols(),r=Tv(Xo("menu-value"),e,function(n){t.onAction({value:n})},o,"color",Fh.CLOSE_ON_EXECUTE,function(){return!1},n.shared.providers),i=Dn(N(N({},r),{markers:wv("color"),movement:Bv(o,"color")}));return{type:"widget",data:{value:Xo("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[Vh().widget(Vg.sketch(i))]}}},Kv=function(t,e,n,o,r,i,u,a){void0===a&&(a=!0);varc=hp({presets:o,textContent:on.none(),htmlContent:n?t.text.map(function(n){return_h(n,e)}):on.none(),ariaLabel:t.text,iconContent:t.icon,shortcutContent:on.none(),checkMark:on.none(),caret:on.none(),value:t.value},u.providers,a,t.icon);returnDh({data:Ah(t),disabled:t.disabled,getApi:function(){return{}},onAction:function(n){returnr(t.value,t.meta)},onSetup:function(){returnfunction(){}},triggersSubmenu:!1,itemBehaviours:function(n,t){returnV(n,"tooltipWorker").map(function(e){return[oh.config({lazySink:t.getSink,tooltipDom:{tag:"div",classes:["tox-tooltip-worker-container"]},tooltipComponents:[],anchor:function(n){return{anchor:"submenu",item:n,overrides:{maxHeightFunction:Cf}}},mode:"follow-highlight",onShow:function(t,n){e(function(n){oh.setComponents(t,[ru({element:we.fromDom(n)})])})}})]}).getOr([])}(t.meta,u)},c,i)},Jv=function(n){vart=n.text.fold(function(){return{}},function(n){return{innerHtml:n}});return{type:"separator",dom:N({tag:"div",classes:[uh,"tox-collection__group-heading"]},t),components:[]}},$v=function(n,t,e,o){void0===o&&(o=!0);varr=hp({presets:"normal",iconContent:n.icon,textContent:n.text,htmlContent:on.none(),ariaLabel:n.text,caret:on.none(),checkMark:on.none(),shortcutContent:n.shortcut},e,o);returnDh({data:Ah(n),getApi:function(t){return{isDisabled:function(){returnCh.isDisabled(t)},setDisabled:function(n){returnCh.set(t,n)}}},disabled:n.disabled,onAction:n.onAction,onSetup:n.onSetup,triggersSubmenu:!1,itemBehaviours:[]},r,t)},Qv=function(n,t,e,o,r){void0===o&&(o=!0),void0===r&&(r=!1);vari=r?function(n){return{dom:{tag:"div",classes:[dh],innerHtml:ym("chevron-down",n)}}}(e.icons):function(n){return{dom:{tag:"div",classes:[dh],innerHtml:ym("chevron-right",n)}}}(e.icons),u=hp({presets:"normal",iconContent:n.icon,textContent:n.text,htmlContent:on.none(),ariaLabel:n.text,caret:on.some(i),checkMark:on.none(),shortcutContent:n.shortcut},e,o);returnDh({data:Ah(n),getApi:function(t){return{isDisabled:function(){returnCh.isDisabled(t)},setDisabled:function(n){returnCh.set(t,n)}}},disabled:n.disabled,onAction:Z,onSetup:n.onSetup,triggersSubmenu:!0,itemBehaviours:[]},u,t)},Zv=function(n,t,e){varo=hp({iconContent:on.none(),textContent:n.text,htmlContent:on.none(),ariaLabel:n.text,checkMark:on.some(gp(e.icons)),caret:on.none(),shortcutContent:n.shortcut,presets:"normal",meta:n.meta},e,!0);returnDn(Dh({data:Ah(n),disabled:n.disabled,getApi:function(t){return{setActive:function(n){Cg.set(t,n)},isActive:function(){returnCg.isOn(t)},isDisabled:function(){returnCh.isDisabled(t)},setDisabled:function(n){returnCh.set(t,n)}}},onAction:n.onAction,onSetup:n.onSetup,triggersSubmenu:!1,itemBehaviours:[]},o,t),{toggling:{toggleClass:sh,toggleOnExecute:!1,selected:n.active}})},nb=function(t,e){returnfunction(n,t){returnObject.prototype.hasOwnProperty.call(n,t)?on.some(n[t]):on.none()}(qv,t.fancytype).map(function(n){returnn(t,e)})};(Yv=Xv=Xv||{})[Yv.ContentFocus=0]="ContentFocus",Yv[Yv.UiFocus=1]="UiFocus";functiontb(n){returnn.icon!==undefined||"togglemenuitem"===n.type||"choicemenuitem"===n.type}functioneb(n){returnx(n,tb)}functionob(n,t,e,o,r){functioni(n){returnr?N(N({},n),{shortcut:on.none(),icon:n.text.isSome()?on.none():n.icon}):n}varu=e.shared.providers;switch(n.type){case"menuitem":returnfunction(n){returntt("menuitem",Gp,n)}(n).fold(kv,function(n){returnon.some($v(i(n),t,u,o))});case"nestedmenuitem":returnfunction(n){returntt("nestedmenuitem",Xp,n)}(n).fold(kv,function(n){returnon.some(Qv(i(n),t,u,o,r))});case"togglemenuitem":returnfunction(n){returntt("togglemenuitem",Yp,n)}(n).fold(kv,function(n){returnon.some(Zv(i(n),t,u))});case"separator":returnfunction(n){returntt("separatormenuitem",Lp,n)}(n).fold(kv,function(n){returnon.some(Jv(n))});case"fancymenuitem":returnfunction(n){returntt("fancymenuitem",Kp,n)}(n).fold(kv,function(n){returnnb(i(n),e)});default:returnv.console.error("Unknown item in general menu",n),on.none()}}functionrb(n,t,e,o,r,i){varu=1===o,a=!u||eb(n);returnBu(S(n,function(n){return"separator"===n.type?function(n){returntt("Autocompleter.Separator",Lp,n)}(n).fold(kv,function(n){returnon.some(Jv(n))}):function(n){returntt("Autocompleter.Item",jp,n)}(n).fold(kv,function(n){returnon.some(Kv(n,t,u,"normal",e,r,i,a))})}))}functionib(n,t,e,o,r){vari=eb(t),u=Bu(S(t,function(n){functiont(n){returnob(n,e,o,function(n){returnr?!n.hasOwnProperty("text"):i}(n),r)}return"nestedmenuitem"===n.type&&n.getSubmenuItems().length<=0?t(An(n,{disabled:!0})):t(n)}));return(r?Ov:Ev)(n,i,u,1,"normal")}functionub(n){returnLg.singleData(n.value,n)}functionab(n){functiont(){n.stopPropagation()}functione(){n.preventDefault()}varo=we.fromDom(n.target),r=i(e,t);returnfunction(n,t,e,o,r,i,u){return{target:nn(n),x:nn(t),y:nn(e),stop:o,prevent:r,kill:i,raw:nn(u)}}(o,n.clientX,n.clientY,t,e,r,n)}functioncb(n,t,e,o,r){vari=function(t,e){returnfunction(n){t(n)&&e(ab(n))}}(e,o);returnn.dom().addEventListener(t,i,r),{unbind:d(mb,n,t,i,r)}}functionsb(n,t,e){returnfunction(n,t,e,o){returncb(n,t,e,o,!1)}(n,t,gb,e)}functionfb(n,t,e){returnfunction(n,t,e,o){returncb(n,t,e,o,!0)}(n,t,gb,e)}functionlb(n,t,e){returnOu(n,t,e).isSome()}vardb=function(u,a){functione(){returns.get().isSome()}functionc(){e()&&jg.hide(l)}functioni(n,t,e,o){n.matchLength=t.text.length;varr=Du(e,function(n){returnon.from(n.columns)}).getOr(1);jg.showAt(l,{anchor:"node",root:we.fromDom(u.getBody()),node:on.from(n.element)},Vg.sketch(function(n,t,e,o){varr=e===Xv.ContentFocus?Xl():Gl(),i=Bv(t,o),u=wv(o);return{dom:n.dom,components:n.components,items:n.items,value:n.value,markers:{selectedItem:u.selectedItem,item:u.item},movement:i,fakeFocus:e===Xv.ContentFocus,focusManager:r,menuBehaviours:Jp("auto"!==t?[]:[Ii(function(o,n){ip(o,4,u.item).each(function(n){vart=n.numColumns,e=n.numRows;lg.setGridSize(o,e,t)})})])}}(Ev("autocompleter-value",!0,o,r,"normal"),r,Xv.ContentFocus,"normal"))),jg.getContent(l).each(ad.highlightFirst)}vars=ye(on.none()),f=ye(!1),l=uu(jg.sketch({dom:{tag:"div",classes:["tox-autocompleter"]},components:[],fireDismissalEventInstead:{},inlineBehaviours:ba([Kd("dismissAutocompleter",[lo(Oi(),function(){returnd()})])]),lazySink:a.getSink})),d=function(){if(e()){varn=s.get().map(function(n){returnn.element});Ip(n.getOr(we.fromDom(u.selection.getNode()))).each(Ro),c(),s.set(on.none()),f.set(!1)}},o=L(function(){returnrp(u)}),m=function(n){(function(t){returns.get().map(function(n){returntp(u.dom,u.selection.getRng(),n.triggerChar).bind(function(n){returnzp(u,o,n,t)})}).getOrThunk(function(){returnop(u,o)})})(n).fold(d,function(r){!function(n){if(!e()){vart=Qg(u,n.range);s.set(on.some({triggerChar:n.triggerChar,element:t,matchLength:n.text.length})),f.set(!1)}}(r.context),r.lookupData.then(function(o){s.get().map(function(n){vart=r.context;if(n.triggerChar===t.triggerChar){vare=function(t,n){vare=Du(n,function(n){returnon.from(n.columns)}).getOr(1);returnB(n,function(i){varn=i.items;returnrb(n,i.matchText,function(o,r){varn=u.selection.getRng();tp(u.dom,n,t).fold(function(){returnv.console.error("Lost context. Cursor probably moved")},function(n){vart=n.range,e={hide:function(){d()},reload:function(n){c(),m(n)}};f.set(!0),i.onAction(e,t,o,r),f.set(!1)})},e,Fh.BUBBLE_TO_SANDBOX,a)})}(t.triggerChar,o);0<e.length?i(n,t,o,e):10<=t.text.length-n.matchLength?d():c()}})})})},n={onKeypress:Jg(function(n){27!==n.which&&m()},50),cancelIfNecessary:d,isMenuOpen:function(){returnjg.isOpen(l)},isActive:e,isProcessingAction:f.get,getView:function(){returnjg.getContent(l)}};Vp(n,u)},mb=function(n,t,e,o){n.dom().removeEventListener(t,e,o)},gb=nn(!0),pb=ab;functionhb(e,o){varr=null;return{cancel:function(){null!==r&&(v.clearTimeout(r),r=null)},schedule:function(){for(varn=[],t=0;t<arguments.length;t++)n[t]=arguments[t];r=v.setTimeout(function(){e.apply(null,n),r=null},o)}}}functionvb(n){vart=n.raw();returnt.touches===undefined||1!==t.touches.length?on.none():on.some(t.touches[0])}functionbb(e){varo=ye(on.none()),r=ye(!1),i=hb(function(n){e.triggerEvent(pi(),n),r.set(!0)},400),u=K([{key:Ur(),value:function(e){returnvb(e).each(function(n){i.cancel();vart={x:nn(n.clientX),y:nn(n.clientY),target:e.target};i.schedule(e),r.set(!1),o.set(on.some(t))}),on.none()}},{key:Wr(),value:function(n){returni.cancel(),vb(n).each(function(t){o.get().each(function(n){!function(n,t){vare=Math.abs(n.clientX-t.x()),o=Math.abs(n.clientY-t.y());return5<e||5<o}(t,n)||o.set(on.none())})}),on.none()}},{key:Gr(),value:function(t){i.cancel();returno.get().filter(function(n){returnjt(n.target(),t.target())}).map(function(n){returnr.get()?(t.prevent(),!1):e.triggerEvent(gi(),t)})}}]);return{fireIfReady:function(t,n){returnNn(u,n).bind(function(n){returnn(t)})}}}functionyb(t,n){vare=ot("Getting GUI events settings",kb,n),o=bb(e),r=S(["touchstart","touchmove","touchend","touchcancel","gesturestart","mousedown","mouseup","mouseover","mousemove","mouseout","click"].concat(["selectstart","input","contextmenu","change","transitionend","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","keyup"]),function(n){returnsb(t,n,function(t){o.fireIfReady(t,n).each(function(n){n&&t.kill()}),e.triggerEvent(n,t)&&t.kill()})}),i=ye(on.none()),u=sb(t,"paste",function(t){o.fireIfReady(t,"paste").each(function(n){n&&t.kill()}),e.triggerEvent("paste",t)&&t.kill(),i.set(on.some(v.setTimeout(function(){e.triggerEvent(fi(),t)},0)))}),a=sb(t,"keydown",function(n){e.triggerEvent("keydown",n)?n.kill():!0===e.stopBackspace&&function(n){return8===n.raw().which&&!vn(["input","textarea"],Ke(n.target()))&&!lb(n.target(),'[contenteditable="true"]')}(n)&&n.prevent()}),c=function(n,t){returnCb?fb(n,"focus",t):sb(n,"focusin",t)}(t,function(n){e.triggerEvent("focusin",n)&&n.kill()}),s=ye(on.none()),f=function(n,t){returnCb?fb(n,"blur",t):sb(n,"focusout",t)}(t,function(n){e.triggerEvent("focusout",n)&&n.kill(),s.set(on.some(v.setTimeout(function(){e.triggerEvent(si(),n)},0)))});return{unbind:function(){bn(r,function(n){n.unbind()}),a.unbind(),c.unbind(),f.unbind(),u.unbind(),i.get().each(v.clearTimeout),s.get().each(v.clearTimeout)}}}functionxb(n,t){vare=Nn(n,"target").map(function(n){returnn()}).getOr(t);returnye(e)}functionwb(n,o,t,e,r,i){varu=n(o,e),a=function(n,t){vare=ye(!1),o=ye(!1);return{stop:function(){e.set(!0)},cut:function(){o.set(!0)},isStopped:e.get,isCut:o.get,event:nn(n),setSource:t.set,getSource:t.get}}(t,r);returnu.fold(function(){returni.logEventNoHandlers(o,e),Ob.complete()},function(t){vare=t.descHandler();returnnr(e)(a),a.isStopped()?(i.logEventStopped(o,t.element(),e.purpose()),Ob.stopped()):a.isCut()?(i.logEventCut(o,t.element(),e.purpose()),Ob.complete()):Eo(t.element()).fold(function(){returni.logNoParent(o,t.element(),e.purpose()),Ob.complete()},function(n){returni.logEventResponse(o,t.element(),e.purpose()),Ob.resume(n)})})}functionSb(n,t,e){varo=function(n){vart=ye(!1);return{stop:function(){t.set(!0)},cut:Z,isStopped:t.get,isCut:nn(!1),event:nn(n),setSource:r("Cannot set source of a broadcasted event"),getSource:r("Cannot get source of a broadcasted event")}}(t);returnbn(n,function(n){vart=n.descHandler();nr(t)(o)}),o.isStopped()}varCb=Ht().browser.isFirefox(),kb=qn([dt("triggerEvent"),St("stopBackspace",!0)]),Ob=Tn([{stopped:[]},{resume:["element"]},{complete:[]}]),Eb=function(t,e,o,n,r,i){returnwb(t,e,o,n,r,i).fold(function(){return!0},function(n){returnEb(t,e,o,n,r,i)},function(){return!1})},Tb=function(n,t,e,o,r){vari=xb(e,o);returnEb(n,t,e,o,i,r)},Bb=yo("element","descHandler"),Db=function(n,t){return{id:nn(n),descHandler:nn(t)}};functionAb(){vari={};return{registerId:function(o,r,n){Cn(n,function(n,t){vare=i[t]!==undefined?i[t]:{};e[r]=tu(n,o),i[t]=e})},unregisterId:function(e){Cn(i,function(n,t){n.hasOwnProperty(e)&&deleten[e]})},filterByType:function(n){returnNn(i,n).map(function(n){returnOn(n,function(n,t){returnDb(t,n)})}).getOr([])},find:function(n,t,e){varo=Vn(t)(i);returnjr(e,function(n){returnfunction(e,o){returnqi(o).fold(function(){returnon.none()},function(n){vart=Vn(n);returne.bind(t).map(function(n){returnBb(o,n)})})}(o,n)},n)}}}function_b(){functiono(n){vart=n.element();returnqi(t).fold(function(){returnfunction(n,t){vare=Xo(Gi+n);returnYi(t,e),e}("uid-",n.element())},function(n){returnn})}varr=Ab(),i={},u=function(n){qi(n.element()).each(function(n){deletei[n],r.unregisterId(n)})};return{find:function(n,t,e){returnr.find(n,t,e)},filter:function(n){returnr.filterByType(n)},register:function(n){vart=o(n);$(i,t)&&function(n,t){vare=i[t];if(e!==n)thrownewError('The tagId "'+t+'" is already used by: '+Go(e.element())+"\nCannot use it for: "+Go(n.element())+"\nThe conflicting element is"+($e(e.element())?" ":" not ")+"already in the DOM");u(n)}(n,t);vare=[n];r.registerId(e,t,n.events()),i[t]=n},unregister:u,getById:function(n){returnVn(n)(i)}}}functionMb(e){functiono(t){returnEo(e.element()).fold(function(){return!0},function(n){returnjt(t,n)})}functionr(n,t){returnu.find(o,n,t)}functioni(e){varn=u.filter(li());bn(n,function(n){vart=n.descHandler();nr(t)(e)})}varu=_b(),n=yb(e.element(),{triggerEvent:function(t,e){returnWu(t,e.target(),function(n){returnfunction(n,t,e,o){varr=e.target();returnTb(n,t,e,r,o)}(r,t,e,n)})}}),a={debugInfo:nn("real"),triggerEvent:function(t,e,o){Wu(t,e,function(n){Tb(r,t,o,e,n)})},triggerFocus:function(t,e){qi(t).fold(function(){wa(t)},function(n){Wu(ci(),t,function(n){!function(n,t,e,o,r){vari=xb(e,o);wb(n,t,e,o,i,r)}(r,ci(),{originator:nn(e),kill:Z,prevent:Z,target:nn(t)},t,n)})})},triggerEscape:function(n,t){a.triggerEvent("keydown",n.element(),t.event())},getByUid:function(n){returng(n)},getByDom:function(n){returnp(n)},build:uu,addToGui:function(n){s(n)},removeFromGui:function(n){f(n)},addToWorld:function(n){t(n)},removeFromWorld:function(n){c(n)},broadcast:function(n){l(n)},broadcastOn:function(n,t){d(n,t)},broadcastEvent:function(n,t){m(n,t)},isConnected:nn(!0)},t=function(n){n.connect(a),Pr(n.element())||(u.register(n),bn(n.components(),t),a.triggerEvent(bi(),n.element(),{target:nn(n.element())}))},c=function(n){Pr(n.element())||(bn(n.components(),c),u.unregister(n)),n.disconnect()},s=function(n){hs(e,n)},f=function(n){bs(n)},l=function(n){i({universal:nn(!0),data:nn(n)})},d=function(n,t){i({universal:nn(!1),channels:nn(n),data:nn(t)})},m=function(n,t){vare=u.filter(n);returnSb(e,t)},g=function(n){returnu.getById(n).fold(function(){returnan.error(newError('Could not find component with uid: "'+n+'" in system.'))},an.value)},p=function(n){vart=qi(n).getOr("not found");returng(t)};returnt(e),{root:nn(e),element:e.element,destroy:function(){n.unbind(),Pi(e.element())},add:s,remove:f,getByUid:g,getByDom:p,addToWorld:t,removeFromWorld:c,broadcast:l,broadcastOn:d,broadcastEvent:m}}functionFb(n){returnn.getParam("height",Math.max(n.getElement().offsetHeight,200))}functionIb(n){returnn.getParam("width",Rh.DOM.getStyle(n.getElement(),"width"))}functionRb(n){returnon.from(n.settings.min_width).filter(mn)}functionVb(n){returnon.from(n.settings.min_height).filter(mn)}functionNb(n){returnon.from(n.getParam("max_width")).filter(mn)}functionHb(n){returnon.from(n.getParam("max_height")).filter(mn)}functionPb(n){return!1!==n.getParam("menubar",!0,"boolean")}functionzb(n){vart=n.getParam("toolbar",!0),e=!0===t,o=cn(t),r=fn(t)&&0<t.length;return!Xb(n)&&(r||o||e)}functionLb(t){varn=wn(t.settings),e=C(n,function(n){return/^toolbar([1-9])$/.test(n)}),o=S(e,function(n){returnt.getParam(n,!1,"string")}),r=C(o,function(n){return"string"==typeofn});return0<r.length?on.some(r):on.none()}varjb,Ub,Wb=Dl({name:"Container",factory:function(n){vart=n.dom,e=t.attributes,o=c(t,["attributes"]);return{uid:n.uid,dom:N({tag:"div",attributes:N({role:"presentation"},e)},o),components:n.components,behaviours:Is(n.containerBehaviours),events:n.events,domModification:n.domModification,eventOrder:n.eventOrder}},configFields:[St("components",[]),Fs("containerBehaviours",[]),St("events",{}),St("domModification",{}),St("eventOrder",{})]}),Gb=tinymce.util.Tools.resolve("tinymce.EditorManager"),Xb=function(n){returnLb(n).fold(function(){return0<n.getParam("toolbar",[],"string[]").length},function(){return!0})};(Ub=jb=jb||{})["default"]="",Ub.floating="floating",Ub.sliding="sliding",Ub.scrolling="scrolling";functionYb(n){returnn.getParam("toolbar_drawer","","string")}functionqb(n){vart=function(n){returnn.getParam("fixed_toolbar_container","","string")}(n);return0<t.length&&n.inline?ku(zr(),t):on.none()}functionKb(n){returnn.inline&&qb(n).isSome()}functionJb(n){returnn.inline&&!Pb(n)&&!zb(n)&&!Xb(n)}function$b(n){return(n.getParam("toolbar_sticky",!1,"boolean")||n.inline)&&!Kb(n)&&!Jb(n)}functionQb(n){returnn.touches===undefined||1!==n.touches.length?on.none():on.some(n.touches[0])}functionZb(n){returnba([vg.config({onFocus:!1===n.selectOnFocus?Z:function(n){vart=n.element(),e=Er(t);t.dom().setSelectionRange(0,e.length)}})])}functionny(n){return{tag:n.tag,attributes:N({type:"text"},n.inputAttributes),styles:n.inputStyles,classes:n.inputClasses}}varty,ey,oy,ry,iy=function(e){varo=ye(on.none()),r=ye(!1),i=Jg(function(n){e.fire("longpress",N(N({},n),{type:"longpress"})),r.set(!0)},400);e.on("touchstart",function(e){Qb(e).each(function(n){i.cancel();vart={x:nn(n.clientX),y:nn(n.clientY),target:nn(e.target)};i.throttle(e),r.set(!1),o.set(on.some(t))})},!0),e.on("touchmove",function(n){i.cancel(),Qb(n).each(function(t){o.get().each(function(n){!function(n,t){vare=Math.abs(n.clientX-t.x()),o=Math.abs(n.clientY-t.y());return5<e||5<o}(t,n)||(o.set(on.none()),r.set(!1),e.fire("longpresscancel"))})})},!0),e.on("touchend touchcancel",function(t){i.cancel(),"touchcancel"!==t.type&&o.get().filter(function(n){returnn.target().isEqualNode(t.target)}).each(function(){r.get()?t.preventDefault():e.fire("tap",{touches:t.touches}).isDefaultPrevented()&&t.preventDefault()})},!0)},uy=Xo("form-component-change"),ay=Xo("form-close"),cy=Xo("form-cancel"),sy=Xo("form-action"),fy=Xo("form-submit"),ly=Xo("form-block"),dy=Xo("form-unblock"),my=Xo("form-tabchange"),gy=Xo("form-resize"),py=nn([St("prefix","form-field"),Fs("fieldBehaviours",[Zl,Zf])]),hy=nn([Sl({schema:[ct("dom")],name:"label"}),Sl({factory:{sketch:function(n){return{uid:n.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:n.text}}}},schema:[ct("text")],name:"aria-descriptor"}),xl({factory:{sketch:function(n){vart=X(n,["factory"]);returnn.factory.sketch(t)}},schema:[ct("factory")],name:"field"})]),vy=Al({name:"FormField",configFields:py(),partFields:hy(),factory:function(r,n,t,e){varo=Rs(r.fieldBehaviours,[Zl.config({find:function(n){returnqs(n,r,"field")}}),Zf.config({store:{mode:"manual",getValue:function(n){returnZl.getCurrent(n).bind(Zf.getValue)},setValue:function(n,t){Zl.getCurrent(n).each(function(n){Zf.setValue(n,t)})}}})]),i=co([Ii(function(n,t){varo=Js(n,r,["label","field","aria-descriptor"]);o.field().each(function(e){vart=Xo(r.prefix);o.label().each(function(n){Po(n.element(),"for",t),Po(e.element(),"id",t)}),o["aria-descriptor"]().each(function(n){vart=Xo(r.prefix);Po(n.element(),"id",t),Po(e.element(),"aria-describedby",t)})})})]),u={getField:function(n){returnqs(n,r,"field")},getLabel:function(n){returnqs(n,r,"label")}};return{uid:r.uid,dom:r.dom,components:n,behaviours:o,events:i,apis:u}},apis:{getField:function(n,t){returnn.getField(t)},getLabel:function(n,t){returnn.getLabel(t)}}}),by=nn([ht("data"),St("inputAttributes",{}),St("inputStyles",{}),St("tag","input"),St("inputClasses",[]),qu("onSetValue"),St("styles",{}),St("eventOrder",{}),Fs("inputBehaviours",[Zf,vg]),St("selectOnFocus",!0)]),yy=Dl({name:"Input",configFields:by(),factory:function(n,t){return{uid:n.uid,dom:ny(n),components:[],behaviours:function(n){returnN(N({},Zb(n)),Rs(n.inputBehaviours,[Zf.config({store:{mode:"manual",initialValue:n.data.getOr(undefined),getValue:function(n){returnEr(n.element())},setValue:function(n,t){Er(n.element())!==t&&Tr(n.element(),t)}},onSetValue:n.onSetValue})]))}(n),eventOrder:n.eventOrder}}}),xy={},wy={exports:xy};ty=undefined,ey=xy,oy=wy,ry=undefined,function(n){"object"==typeofey&&void0!==oy?oy.exports=n():"function"==typeofty&&ty.amd?ty([],n):("undefined"!=typeofwindow?window:"undefined"!=typeofglobal?global:"undefined"!=typeofself?self:this).EphoxContactWrapper=n()}(function(){returnfunctionf(i,u,a){functionc(t,n){if(!u[t]){if(!i[t]){vare="function"==typeofry&&ry;if(!n&&e)returne(t,!0);if(s)returns(t,!0);varo=newError("Cannot find module '"+t+"'");throwo.code="MODULE_NOT_FOUND",o}varr=u[t]={exports:{}};i[t][0].call(r.exports,function(n){returnc(i[t][1][n]||n)},r,r.exports,f,i,u,a)}returnu[t].exports}for(vars="function"==typeofry&&ry,n=0;n<a.length;n++)c(a[n]);returnc}({1:[function(n,t,e){varo,r,i=t.exports={};functionu(){thrownewError("setTimeout has not been defined")}functiona(){thrownewError("clearTimeout has not been defined")}functionc(n){if(o===setTimeout)returnsetTimeout(n,0);if((o===u||!o)&&setTimeout)returno=setTimeout,setTimeout(n,0);try{returno(n,0)}catch(t){try{returno.call(null,n,0)}catch(t){returno.call(this,n,0)}}}!function(){try{o="function"==typeofsetTimeout?setTimeout:u}catch(n){o=u}try{r="function"==typeofclearTimeout?clearTimeout:a}catch(n){r=a}}();vars,f=[],l=!1,d=-1;functionm(){l&&s&&(l=!1,s.length?f=s.concat(f):d=-1,f.length&&g())}functiong(){if(!l){varn=c(m);l=!0;for(vart=f.length;t;){for(s=f,f=[];++d<t;)s&&s[d].run();d=-1,t=f.length}s=null,l=!1,functione(n){if(r===clearTimeout)returnclearTimeout(n);if((r===a||!r)&&clearTimeout)returnr=clearTimeout,clearTimeout(n);try{returnr(n)}catch(t){try{returnr.call(null,n)}catch(t){returnr.call(this,n)}}}(n)}}functionp(n,t){this.fun=n,this.array=t}functionh(){}i.nextTick=function(n){vart=newArray(arguments.length-1);if(1<arguments.length)for(vare=1;e<arguments.length;e++)t[e-1]=arguments[e];f.push(newp(n,t)),1!==f.length||l||c(g)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=h,i.addListener=h,i.once=h,i.off=h,i.removeListener=h,i.removeAllListeners=h,i.emit=h,i.prependListener=h,i.prependOnceListener=h,i.listeners=function(n){return[]},i.binding=function(n){thrownewError("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(n){thrownewError("process.chdir is not supported")},i.umask=function(){return0}},{}],2:[function(n,l,t){(function(t){functiono(){}functioni(n){if("object"!=typeofthis)thrownewTypeError("Promises must be constructed via new");if("function"!=typeofn)thrownewTypeError("not a function");this._state=0,this._handled=!1,this._value=undefined,this._deferreds=[],f(n,this)}functionr(o,r){for(;3===o._state;)o=o._value;0!==o._state?(o._handled=!0,i._immediateFn(function(){varn=1===o._state?r.onFulfilled:r.onRejected;if(null!==n){vart;try{t=n(o._value)}catch(e){returnvoida(r.promise,e)}u(r.promise,t)}else(1===o._state?u:a)(r.promise,o._value)})):o._deferreds.push(r)}functionu(n,t){try{if(t===n)thrownewTypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeoft||"function"==typeoft)){vare=t.then;if(tinstanceofi)returnn._state=3,n._value=t,voidc(n);if("function"==typeofe)returnvoidf(functiono(n,t){returnfunction(){n.apply(t,arguments)}}(e,t),n)}n._state=1,n._value=t,c(n)}catch(r){a(n,r)}}functiona(n,t){n._state=2,n._value=t,c(n)}functionc(n){2===n._state&&0===n._deferreds.length&&i._immediateFn(function(){n._handled||i._unhandledRejectionFn(n._value)});for(vart=0,e=n._deferreds.length;t<e;t++)r(n,n._deferreds[t]);n._deferreds=null}functions(n,t,e){this.onFulfilled="function"==typeofn?n:null,this.onRejected="function"==typeoft?t:null,this.promise=e}functionf(n,t){vare=!1;try{n(function(n){e||(e=!0,u(t,n))},function(n){e||(e=!0,a(t,n))})}catch(o){if(e)return;e=!0,a(t,o)}}varn,e;n=this,e=setTimeout,i.prototype["catch"]=function(n){returnthis.then(null,n)},i.prototype.then=function(n,t){vare=newthis.constructor(o);returnr(this,news(n,t,e)),e},i.all=function(n){varc=Array.prototype.slice.call(n);returnnewi(function(r,i){if(0===c.length)returnr([]);varu=c.length;functiona(t,n){try{if(n&&("object"==typeofn||"function"==typeofn)){vare=n.then;if("function"==typeofe)returnvoide.call(n,function(n){a(t,n)},i)}c[t]=n,0==--u&&r(c)}catch(o){i(o)}}for(varn=0;n<c.length;n++)a(n,c[n])})},i.resolve=function(t){returnt&&"object"==typeoft&&t.constructor===i?t:newi(function(n){n(t)})},i.reject=function(e){returnnewi(function(n,t){t(e)})},i.race=function(r){returnnewi(function(n,t){for(vare=0,o=r.length;e<o;e++)r[e].then(n,t)})},i._immediateFn="function"==typeoft?function(n){t(n)}:function(n){e(n,0)},i._unhandledRejectionFn=function(n){"undefined"!=typeofconsole&&console&&console.warn("Possible Unhandled Promise Rejection:",n)},i._setImmediateFn=function(n){i._immediateFn=n},i._setUnhandledRejectionFn=function(n){i._unhandledRejectionFn=n},void0!==l&&l.exports?l.exports=i:n.Promise||(n.Promise=i)}).call(this,n("timers").setImmediate)},{timers:3}],3:[function(c,n,s){(function(n,t){varo=c("process/browser.js").nextTick,e=Function.prototype.apply,r=Array.prototype.slice,i={},u=0;functiona(n,t){this._id=n,this._clearFn=t}s.setTimeout=function(){returnnewa(e.call(setTimeout,window,arguments),clearTimeout)},s.setInterval=function(){returnnewa(e.call(setInterval,window,arguments),clearInterval)},s.clearTimeout=s.clearInterval=function(n){n.close()},a.prototype.unref=a.prototype.ref=function(){},a.prototype.close=function(){this._clearFn.call(window,this._id)},s.enroll=function(n,t){clearTimeout(n._idleTimeoutId),n._idleTimeout=t},s.unenroll=function(n){clearTimeout(n._idleTimeoutId),n._idleTimeout=-1},s._unrefActive=s.active=function(n){clearTimeout(n._idleTimeoutId);vart=n._idleTimeout;0<=t&&(n._idleTimeoutId=setTimeout(function(){n._onTimeout&&n._onTimeout()},t))},s.setImmediate="function"==typeofn?n:function(n){vart=u++,e=!(arguments.length<2)&&r.call(arguments,1);returni[t]=!0,o(function(){i[t]&&(e?n.apply(null,e):n.call(null),s.clearImmediate(t))}),t},s.clearImmediate="function"==typeoft?t:function(n){deletei[n]}}).call(this,c("timers").setImmediate,c("timers").clearImmediate)},{"process/browser.js":1,timers:3}],4:[function(n,t,e){varo=n("promise-polyfill"),r="undefined"!=typeofwindow?window:Function("return this;")();t.exports={boltExport:r.Promise||o}},{"promise-polyfill":2}]},{},[4])(4)});functionSy(n){v.setTimeout(function(){thrown},0)}functionCy(n){vart=Ke(n);returnvn(Hy,t)}functionky(n,t){vare=t.getRoot(n).getOr(n.element());dr(e,t.invalidClass),t.notify.each(function(t){Cy(n.element())&&Po(n.element(),"aria-invalid",!1),t.getContainer(n).each(function(n){No(n,t.validHtml)}),t.onValid(n)})}functionOy(t,n,e,o){varr=n.getRoot(t).getOr(t.element());fr(r,n.invalidClass),n.notify.each(function(n){Cy(t.element())&&Po(t.element(),"aria-invalid",!0),n.getContainer(t).each(function(n){No(n,o)}),n.onInvalid(t,o)})}functionEy(t,n,e){returnn.validator.fold(function(){returnNy(an.value(!0))},function(n){returnn.validate(t)})}functionTy(t,e,n){returne.notify.each(function(n){n.onValidate(t)}),Ey(t,e).map(function(n){returnt.getSystem().isConnected()?n.fold(function(n){returnOy(t,e,0,n),an.error(n)},function(n){returnky(t,e),an.value(n)}):an.error("No longer in system")})}functionBy(n,t,e,o){varr=Xy(n,t,e,o);returnvy.sketch(r)}functionDy(n,t){returnvy.parts().label({dom:{tag:"label",classes:["tox-label"],innerHtml:t.translate(n)}})}varAy,_y,My=wy.exports.boltExport,Fy=function(n){vare=on.none(),t=[],o=function(n){r()?u(n):t.push(n)},r=function(){returne.isSome()},i=function(n){bn(n,u)},u=function(t){e.each(function(n){v.setTimeout(function(){t(n)},0)})};returnn(function(n){e=on.some(n),i(t),t=[]}),{get:o,map:function(e){returnFy(function(t){o(function(n){t(e(n))})})},isReady:r}},Iy={nu:Fy,pure:function(t){returnFy(function(n){n(t)})}},Ry=function(e){functionn(n){e().then(n,Sy)}return{map:function(n){returnRy(function(){returne().then(n)})},bind:function(t){returnRy(function(){returne().then(function(n){returnt(n).toPromise()})})},anonBind:function(n){returnRy(function(){returne().then(function(){returnn.toPromise()})})},toLazy:function(){returnIy.nu(n)},toCached:function(){varn=null;returnRy(function(){returnnull===n&&(n=e()),n})},toPromise:e,get:n}},Vy=function(n){returnRy(function(){returnnewMy(n)})},Ny=function(n){returnRy(function(){returnMy.resolve(n)})},Hy=["input","textarea"],Py=/* */Object.freeze({markValid:ky,markInvalid:Oy,query:Ey,run:Ty,isInvalid:function(n,t){vare=t.getRoot(n).getOr(n.element());returnmr(e,t.invalidClass)}}),zy=/* */Object.freeze({events:function(t,n){returnt.validator.map(function(n){returnco([lo(n.onEvent,function(n){Ty(n,t).get(l)})].concat(n.validateOnLoad?[Ii(function(n){Ty(n,t).get(Z)})]:[]))}).getOr({})}}),Ly=[ct("invalidClass"),St("getRoot",on.none),wt("notify",[St("aria","alert"),St("getContainer",on.none),St("validHtml",""),qu("onValid"),qu("onInvalid"),qu("onValidate")]),wt("validator",[ct("validate"),St("onEvent","input"),St("validateOnLoad",!0)])],jy=ya({fields:Ly,name:"invalidating",active:zy,apis:Py,extra:{validation:function(e){returnfunction(n){vart=Zf.getValue(n);returnNy(e(t))}}}}),Uy=/* */Object.freeze({exhibit:function(n,t){returnZo({attributes:K([{key:t.tabAttr,value:"true"}])})}}),Wy=[St("tabAttr","data-alloy-tabstop")],Gy=ya({fields:Wy,name:"tabstopping",active:Uy}),Xy=function(n,t,e,o){return{dom:Yy(e),components:n.toArray().concat([t]),fieldBehaviours:ba(o)}},Yy=function(n){return{tag:"div",classes:["tox-form__group"].concat(n)}},qy=/* */Object.freeze({getCoupled:function(n,t,e,o){returne.getOrCreate(n,t,o)}}),Ky=[st("others",nt(an.value,de()))],Jy=ya({fields:Ky,name:"coupling",apis:qy,state:/* */Object.freeze({init:function(n){vari={},t=nn({});returnnu({readState:t,getOrCreate:function(e,o,r){varn=wn(o.others);if(n)returnNn(i,r).getOrThunk(function(){varn=Nn(o.others,r).getOrDie("No information found for coupled component: "+r)(e),t=e.getSystem().build(n);returni[r]=t});thrownewError("Cannot find coupled component: "+r+". Known coupled components: "+JSON.stringify(n,null,2))}})}})}),$y=nn("sink"),Qy=nn(Sl({name:$y(),overrides:nn({dom:{tag:"div"},behaviours:ba([Af.config({useFixed:a})]),events:co([vo(ni()),vo(Yr()),vo(ri())])})}));(_y=Ay=Ay||{})[_y.HighlightFirst=0]="HighlightFirst",_y[_y.HighlightNone=1]="HighlightNone";functionZy(n,t){vare=n.getHotspot(t).getOr(t),o=n.getAnchorOverrides();returnn.layouts.fold(function(){return{anchor:"hotspot",hotspot:e,overrides:o}},function(n){return{anchor:"hotspot",hotspot:e,overrides:o,layouts:n}})}functionnx(n,t,e,o,r,i,u){returnfunction(n,t,r,e,i,o,u){vara=function(n,t,e){return(0,n.fetch)(e).map(t)}(n,t,e),c=Sw(e,n);returna.map(function(n){returnn.bind(function(n){returnon.from(Lg.sketch(N(N({},o.menu()),{uid:Yo(""),data:n,highlightImmediately:u===Ay.HighlightFirst,onOpenMenu:function(n,t){vare=c().getOrDie();Af.position(e,r,t),zf.decloak(i)},onOpenSubmenu:function(n,t,e){varo=c().getOrDie();Af.position(o,{anchor:"submenu",item:t},e),zf.decloak(i)},onRepositionMenu:function(n,t,e){varo=c().getOrDie();Af.position(o,r,t),bn(e,function(n){Af.position(o,{anchor:"submenu",item:n.triggeringItem},n.triggeredMenu)})},onEscape:function(){returnvg.focus(e),zf.close(i),on.some(!0)}})))})})}(n,t,Zy(n,e),e,o,r,u).map(function(n){returnn.fold(function(){zf.isOpen(o)&&zf.close(o)},function(n){zf.cloak(o),zf.open(o,n),i(o)}),o})}functiontx(n,t,e,o,r,i,u){returnzf.close(o),Ny(o)}functionex(n,t,e,o,r,i){varu=Jy.getCoupled(e,"sandbox");return(zf.isOpen(u)?tx:nx)(n,t,e,u,o,r,i)}functionox(n,t,e){varo=Zl.getCurrent(t).getOr(t),r=mu(n.element());e?yr(o.element(),"min-width",r+"px"):function(n,t){Vu.set(n,t)}(o.element(),r)}functionrx(n){zf.getState(n).each(function(n){Lg.repositionMenus(n)})}functionix(o,r,i){varu=Eu(),n=Sw(r,o);return{dom:{tag:"div",classes:o.sandboxClasses,attributes:{id:u.id(),role:"listbox"}},behaviours:tl(o.sandboxBehaviours,[Zf.config({store:{mode:"memory",initialValue:r}}),zf.config({onOpen:function(n,t){vare=Zy(o,r);u.link(r.element()),o.matchWidth&&ox(e.hotspot,t,o.useMinWidth),o.onOpen(e,n,t),i!==undefined&&i.onOpen!==undefined&&i.onOpen(n,t)},onClose:function(n,t){u.unlink(r.element()),i!==undefined&&i.onClose!==undefined&&i.onClose(n,t)},isPartOf:function(n,t,e){returnLu(t,e)||Lu(r,e)},getAttachPoint:function(){returnn().getOrDie()}}),Zl.config({find:function(n){returnzf.getState(n).bind(function(n){returnZl.getCurrent(n)})}}),lc.config({channels:N(N({},Es({isExtraPart:nn(!1)})),Ts({isExtraPart:nn(!1),doReposition:rx}))})])}}functionux(n){vart=Jy.getCoupled(n,"sandbox");rx(t)}functionax(){return[St("sandboxClasses",[]),nl("sandboxBehaviours",[Zl,lc,zf,Zf])]}functioncx(e,t,o){functionr(n,t){ro(n,Bw,{value:t})}varn=vy.parts().field({factory:yy,inputClasses:["tox-textfield"],onSetValue:function(n){returnjy.run(n).get(function(){})},inputBehaviours:ba([Gy.config({}),jy.config({invalidClass:"tox-textbox-field-invalid",getRoot:function(n){returnEo(n.element())},notify:{onValid:function(n){vart=Zf.getValue(n);ro(n,Tw,{color:t})}},validator:{validateOnLoad:!1,validate:function(n){vart=Zf.getValue(n);if(0===t.length)returnNy(an.value(!0));vare=we.fromTag("span");yr(e,"background-color",t);varo=Sr(e,"background-color").fold(function(){returnan.error("blah")},function(n){returnan.value(t)});returnNy(o)}}})]),selectOnFocus:!1}),i=e.label.map(function(n){returnDy(n,t.providers)}),u=vm(function(e,o){returnOw.sketch({dom:e.dom,components:e.components,toggleClass:"mce-active",dropdownBehaviours:ba([Ew.config({}),Gy.config({})]),layouts:e.layouts,sandboxClasses:["tox-dialog__popups"],lazySink:o.getSink,fetch:function(t){returnVy(function(n){returne.fetch(n)}).map(function(n){returnon.from(ub(Dn(Tv(Xo("menu-value"),n,function(n){e.onItemAction(t,n)},e.columns,e.presets,Fh.CLOSE_ON_EXECUTE,function(){return!1},o.providers),{movement:Bv(e.columns,e.presets)})))})},parts:{menu:Sv(0,0,e.presets)}})}({dom:{tag:"span",attributes:{"aria-label":t.providers.translate("Color swatch")}},layouts:on.some({onRtl:function(){return[ua]},onLtr:function(){return[aa]}}),components:[],fetch:Uv.getFetch(o.getColors(),o.hasCustomColors()),columns:o.getColorCols(),presets:"color",onItemAction:function(n,e){u.getOpt(n).each(function(t){"custom"===e?o.colorPicker(function(n){n.fold(function(){returnoo(t,Dw)},function(n){r(t,n),Vv(n)})},"#ffffff"):r(t,"remove"===e?"":e)})}},t));returnvy.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:i.toArray().concat([{dom:{tag:"div",classes:["tox-color-input"]},components:[n,u.asSpec()]}]),fieldBehaviours:ba([Kd("form-field-events",[lo(Tw,function(n,t){u.getOpt(n).each(function(n){yr(n.element(),"background-color",t.event().color())}),ro(n,uy,{name:e.name})}),lo(Bw,function(t,e){vy.getField(t).each(function(n){Zf.setValue(n,e.event().value()),Zl.getCurrent(t).each(vg.focus)})}),lo(Dw,function(t,n){vy.getField(t).each(function(n){Zl.getCurrent(t).each(vg.focus)})})])])})}functionsx(n,t,e){return{hue:nn(n),saturation:nn(t),value:nn(e)}}functionfx(t){returnSl({name:t+"-edge",overrides:function(n){returnn.model.manager.edgeActions[t].fold(function(){return{}},function(o){return{events:co([mo(Ur(),o,[n]),mo(Yr(),o,[n]),mo(qr(),function(n,t,e){e.mouseIsDown.get()&&o(n,e)},[n])])}})}})}functionlx(n){vart=n.event().raw();if(function(n){return-1!==n.type.indexOf("touch")}(t)){vare=t;returne.touches!==undefined&&1===e.touches.length?on.some(e.touches[0]).map(function(n){returnIu(n.clientX,n.clientY)}):on.none()}varo=t;returno.clientX!==undefined?on.some(o).map(function(n){returnIu(n.clientX,n.clientY)}):on.none()}functiondx(n){returnn.model.minX}functionmx(n){returnn.model.minY}functiongx(n){returnn.model.minX-1}functionpx(n){returnn.model.minY-1}functionhx(n){returnn.model.maxX}functionvx(n){returnn.model.maxY}functionbx(n){returnn.model.maxX+1}functionyx(n){returnn.model.maxY+1}functionxx(n,t,e){returnt(n)-e(n)}functionwx(n){returnxx(n,hx,dx)}functionSx(n){returnxx(n,vx,mx)}functionCx(n){returnwx(n)/2}functionkx(n){returnSx(n)/2}functionOx(n){returnn.stepSize}functionEx(n){returnn.snapToGrid}functionTx(n){returnn.snapStart}functionBx(n){returnn.rounded}functionDx(n,t){returnn[t+"-edge"]!==undefined}functionAx(n){returnDx(n,"left")}function_x(n){returnDx(n,"right")}functionMx(n){returnDx(n,"top")}functionFx(n){returnDx(n,"bottom")}functionIx(n){returnn.model.value.get()}functionRx(n){return{x:nn(n)}}functionVx(n){return{y:nn(n)}}functionNx(n,t){return{x:nn(n),y:nn(t)}}functionHx(n,t){ro(n,jw(),{value:t})}functionPx(n,t,e,o){returnn<t?n:e<n?e:n===t?t-1:Math.max(t,n-o)}functionzx(n,t,e,o){returne<n?n:n<t?t:n===e?e+1:Math.min(e,n+o)}functionLx(n,t,e){returnMath.max(t,Math.min(e,n))}functionjx(n){vart=n.min,e=n.max,o=n.range,r=n.value,i=n.step,u=n.snap,a=n.snapStart,c=n.rounded,s=n.hasMinEdge,f=n.hasMaxEdge,l=n.minBound,d=n.maxBound,m=n.screenRange,g=s?t-1:t,p=f?e+1:e;if(r<l)returng;if(d<r)returnp;varh=function(n,t,e){returnMath.min(e,Math.max(n,t))-t}(r,l,d),v=Lx(h/m*o+t,g,p);returnu&&t<=v&&v<=e?function(u,e,a,c,n){returnn.fold(function(){varn=u-e,t=Math.round(n/c)*c;returnLx(e+t,e-1,a+1)},function(n){vart=(u-n)%c,e=Math.round(t/c),o=Math.floor((u-n)/c),r=Math.floor((a-n)/c),i=n+Math.min(r,o+e)*c;returnMath.max(n,i)})}(v,t,e,i,a):c?Math.round(v):v}functionUx(n){vart=n.min,e=n.max,o=n.range,r=n.value,i=n.hasMinEdge,u=n.hasMaxEdge,a=n.maxBound,c=n.maxOffset,s=n.centerMinEdge,f=n.centerMaxEdge;returnr<t?i?0:s:e<r?u?a:f:(r-t)/o*c}functionWx(n){returnn.element().dom().getBoundingClientRect()}functionGx(n,t){returnn[t]}functionXx(n){vart=Wx(n);returnGx(t,Uw)}functionYx(n){vart=Wx(n);returnGx(t,"right")}functionqx(n){vart=Wx(n);returnGx(t,"top")}functionKx(n){vart=Wx(n);returnGx(t,"bottom")}functionJx(n){vart=Wx(n);returnGx(t,"width")}function$x(n){vart=Wx(n);returnGx(t,"height")}functionQx(n,t,e){return(n+t)/2-e}functionZx(n,t){vare=Wx(n),o=Wx(t),r=Gx(e,Uw),i=Gx(e,"right"),u=Gx(o,Uw);returnQx(r,i,u)}functionnw(n,t){vare=Wx(n),o=Wx(t),r=Gx(e,"top"),i=Gx(e,"bottom"),u=Gx(o,"top");returnQx(r,i,u)}functiontw(n,t){ro(n,jw(),{value:t})}functionew(n){return{x:nn(n)}}functionow(n,t,e){varo={min:dx(t),max:hx(t),range:wx(t),value:e,step:Ox(t),snap:Ex(t),snapStart:Tx(t),rounded:Bx(t),hasMinEdge:Ax(t),hasMaxEdge:_x(t),minBound:Xx(n),maxBound:Yx(n),screenRange:Jx(n)};returnjx(o)}functionrw(e){returnfunction(n,t){returnfunction(n,t,e){varo=(0<n?zx:Px)(Ix(e).x(),dx(e),hx(e),Ox(e));returntw(t,ew(o)),on.some(o)}(e,n,t).map(function(){return!0})}}functioniw(n,t,e,o,r,i){varu=function(t,n,e,o,r){vari=Jx(t),u=o.bind(function(n){returnon.some(Zx(n,t))}).getOr(0),a=r.bind(function(n){returnon.some(Zx(n,t))}).getOr(i),c={min:dx(n),max:hx(n),range:wx(n),value:e,hasMinEdge:Ax(n),hasMaxEdge:_x(n),minBound:Xx(t),minOffset:0,maxBound:Yx(t),maxOffset:i,centerMinEdge:u,centerMaxEdge:a};returnUx(c)}(t,i,e,o,r);returnXx(t)-Xx(n)+u}functionuw(n,t){ro(n,jw(),{value:t})}functionaw(n){return{y:nn(n)}}functioncw(n,t,e){varo={min:mx(t),max:vx(t),range:Sx(t),value:e,step:Ox(t),snap:Ex(t),snapStart:Tx(t),rounded:Bx(t),hasMinEdge:Mx(t),hasMaxEdge:Fx(t),minBound:qx(n),maxBound:Kx(n),screenRange:$x(n)};returnjx(o)}functionsw(e){returnfunction(n,t){returnfunction(n,t,e){varo=(0<n?zx:Px)(Ix(e).y(),mx(e),vx(e),Ox(e));returnuw(t,aw(o)),on.some(o)}(e,n,t).map(function(){return!0})}}functionfw(n,t,e,o,r,i){varu=function(t,n,e,o,r){vari=$x(t),u=o.bind(function(n){returnon.some(nw(n,t))}).getOr(0),a=r.bind(function(n){returnon.some(nw(n,t))}).getOr(i),c={min:mx(n),max:vx(n),range:Sx(n),value:e,hasMinEdge:Mx(n),hasMaxEdge:Fx(n),minBound:qx(t),minOffset:0,maxBound:Kx(t),maxOffset:i,centerMinEdge:u,centerMaxEdge:a};returnUx(c)}(t,i,e,o,r);returnqx(t)-qx(n)+u}functionlw(n,t){ro(n,jw(),{value:t})}functiondw(n,t){return{x:nn(n),y:nn(t)}}functionmw(e,o){returnfunction(n,t){returnfunction(n,t,e,o){varr=0<n?zx:Px,i=t?Ix(o).x():r(Ix(o).x(),dx(o),hx(o),Ox(o)),u=t?r(Ix(o).y(),mx(o),vx(o),Ox(o)):Ix(o).y();returnlw(e,dw(i,u)),on.some(i)}(e,o,n,t).map(function(){return!0})}}functiongw(n){return"<alloy.field."+n+">"}functionpw(n){returnfunction(n){returnCS[n]}(n)}functionhw(n,t,e){returnZf.config(Dn({store:{mode:"manual",getValue:t,setValue:e}},n.map(function(n){return{store:{initialValue:n}}}).getOr({})))}functionvw(n,t,e){returnhw(n,function(n){returnt(n.element())},function(n,t){returne(n.element(),t)})}functionbw(e,t){functiono(n,t){t.stop()}functionr(n){returnfunction(t,e){bn(n,function(n){n(t,e)})}}functioni(n,t){if(!Ch.isDisabled(n)){vare=t.event().raw();a(n,e.dataTransfer.files)}}functionu(n,t){vare=t.event().raw().target.files;a(n,e)}vara=function(n,t){Zf.setValue(n,function(n){vart=newRegExp("("+".jpg,.jpeg,.png,.gif".split(/\s*,\s*/).join("|")+")$","i");returnC(xn(n),function(n){returnt.test(n.name)})}(t)),ro(n,uy,{name:e.name})},c=vm({dom:{tag:"input",attributes:{type:"file",accept:"image/*"},styles:{display:"none"}},behaviours:ba([Kd("input-file-events",[vo(ri()),vo(gi())])])}),n=e.label.map(function(n){returnDy(n,t)}),s=vy.parts().field({factory:{sketch:function(n){return{uid:n.uid,dom:{tag:"div",classes:["tox-dropzone-container"]},behaviours:ba([DS([]),xS(),Ch.config({}),Cg.config({toggleClass:"dragenter",toggleOnExecute:!1}),Kd("dropzone-events",[lo("dragenter",r([o,Cg.toggle])),lo("dragleave",r([o,Cg.toggle])),lo("dragover",o),lo("drop",r([o,i])),lo(oi(),u)])]),components:[{dom:{tag:"div",classes:["tox-dropzone"],styles:{}},components:[{dom:{tag:"p",innerHtml:t.translate("Drop an image here")}},Gg.sketch({dom:{tag:"button",innerHtml:t.translate("Browse for an image"),styles:{position:"relative"},classes:["tox-button","tox-button--secondary"]},components:[c.asSpec()],action:function(n){c.get(n).element().dom().click()},buttonBehaviours:ba([Gy.config({})])})]}]}}}});returnBy(n,s,["tox-form__group--stretched"],[])}functionyw(n){return{dom:{tag:"div",styles:{width:"1px",height:"1px",outline:"none"},attributes:{tabindex:"0"},classes:n},behaviours:ba([vg.config({ignore:!0}),Gy.config({})])}}functionxw(n,t){ro(n,ni(),{raw:{which:9,shiftKey:t}})}functionww(n,t){vare=RS&&n.sandboxed,o=N(N({},n.label.map(function(n){return{title:n}}).getOr({})),e?{sandbox:"allow-scripts allow-same-origin"}:{}),r=function(o){varr=ye("");return{getValue:function(n){returnr.get()},setValue:function(n,t){if(o)Po(n.element(),"srcdoc",t);else{Po(n.element(),"src","javascript:''");vare=n.element().dom().contentWindow.document;e.open(),e.write(t),e.close()}r.set(t)}}}(e),i=n.label.map(function(n){returnDy(n,t)}),u=vy.parts().field({factory:{sketch:function(n){returnIS({uid:n.uid,dom:{tag:"iframe",attributes:o},behaviours:ba([Gy.config({}),vg.config({}),TS(on.none(),r.getValue,r.setValue)])})}}});returnBy(i,u,["tox-form__group--stretched"],[])}varSw=function(t,n){returnt.getSystem().getByUid(n.uid+"-"+$y()).map(function(n){returnfunction(){returnan.value(n)}}).getOrThunk(function(){returnn.lazySink.fold(function(){returnfunction(){returnan.error(newError("No internal sink is specified, nor could an external sink be found"))}},function(n){returnfunction(){returnn(t)}})})},Cw=nn([ct("dom"),ct("fetch"),qu("onOpen"),Ku("onExecute"),St("getHotspot",on.some),St("getAnchorOverrides",nn({})),St("layouts",on.none()),Fs("dropdownBehaviours",[Cg,Jy,lg,vg]),ct("toggleClass"),St("eventOrder",{}),ht("lazySink"),St("matchWidth",!1),St("useMinWidth",!1),ht("role")].concat(ax())),kw=nn([wl({schema:[Gu()],name:"menu",defaults:function(n){return{onExecute:n.onExecute}}}),Qy()]),Ow=Al({name:"Dropdown",configFields:Cw(),partFields:kw(),factory:function(t,n,e,o){functionr(n){zf.getState(n).each(function(n){Lg.highlightPrimary(n)})}functioni(n,t){returnio(n),on.some(!0)}varu,a,c={expand:function(n){Cg.isOn(n)||ex(t,function(n){returnn},n,o,Z,Ay.HighlightNone).get(Z)},open:function(n){Cg.isOn(n)||ex(t,function(n){returnn},n,o,Z,Ay.HighlightFirst).get(Z)},isOpen:Cg.isOn,close:function(n){Cg.isOn(n)&&ex(t,function(n){returnn},n,o,Z,Ay.HighlightFirst).get(Z)},repositionMenus:function(n){Cg.isOn(n)&&ux(n)}};return{uid:t.uid,dom:t.dom,components:n,behaviours:Rs(t.dropdownBehaviours,[Cg.config({toggleClass:t.toggleClass,aria:{mode:"expanded"}}),Jy.config({others:{sandbox:function(n){returnix(t,n,{onOpen:function(){Cg.on(n)},onClose:function(){Cg.off(n)}})}}}),lg.config({mode:"special",onSpace:i,onEnter:i,onDown:function(n,t){if(Ow.isOpen(n)){vare=Jy.getCoupled(n,"sandbox");r(e)}elseOw.open(n);returnon.some(!0)},onEscape:function(n,t){returnOw.isOpen(n)?(Ow.close(n),on.some(!0)):on.none()}}),vg.config({})]),events:rm(on.some(function(n){ex(t,function(n){returnn},n,o,r,Ay.HighlightFirst).get(Z)})),eventOrder:N(N({},t.eventOrder),(u={},u[di()]=["disabling","toggling","alloy.base.behaviour"],u)),apis:c,domModification:{attributes:N(N({"aria-haspopup":"true"},t.role.fold(function(){return{}},function(n){return{role:n}})),"button"===t.dom.tag?{type:(a="type",Nn(t.dom,"attributes").bind(function(n){returnNn(n,a)})).getOr("button")}:{})}}},apis:{open:function(n,t){returnn.open(t)},expand:function(n,t){returnn.expand(t)},close:function(n,t){returnn.close(t)},isOpen:function(n,t){returnn.isOpen(t)},repositionMenus:function(n,t){returnn.repositionMenus(t)}}}),Ew=ya({fields:[],name:"unselecting",active:/* */Object.freeze({events:function(n){returnco([so(ui(),nn(!0))])},exhibit:function(n,t){returnZo({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})}})}),Tw=Xo("color-input-change"),Bw=Xo("color-swatch-change"),Dw=Xo("color-picker-cancel"),Aw=nn(Xo("rgb-hex-update")),_w=nn(Xo("slider-update")),Mw=nn(Xo("palette-update")),Fw=Sl({schema:[ct("dom")],name:"label"}),Iw=fx("top-left"),Rw=fx("top"),Vw=fx("top-right"),Nw=fx("right"),Hw=fx("bottom-right"),Pw=fx("bottom"),zw=fx("bottom-left"),Lw=[Fw,fx("left"),Nw,Rw,Pw,Iw,Vw,zw,Hw,xl({name:"thumb",defaults:nn({dom:{styles:{position:"absolute"}}}),overrides:function(n){return{events:co([po(Ur(),n,"spectrum"),po(Wr(),n,"spectrum"),po(Gr(),n,"spectrum"),po(Yr(),n,"spectrum"),po(qr(),n,"spectrum"),po(Jr(),n,"spectrum")])}}}),xl({schema:[At("mouseIsDown",function(){returnye(!1)})],name:"spectrum",overrides:function(e){functiono(t,n){returnr.getValueFromEvent(n).map(function(n){returnr.setValueFrom(t,e,n)})}varr=e.model.manager;return{behaviours:ba([lg.config({mode:"special",onLeft:function(n){returnr.onLeft(n,e)},onRight:function(n){returnr.onRight(n,e)},onUp:function(n){returnr.onUp(n,e)},onDown:function(n){returnr.onDown(n,e)}}),vg.config({})]),events:co([lo(Ur(),o),lo(Wr(),o),lo(Yr(),o),lo(qr(),function(n,t){e.mouseIsDown.get()&&o(n,t)})])}}})],jw=nn("slider.change.value"),Uw="left",Ww=rw(-1),Gw=rw(1),Xw=on.none,Yw=on.none,qw={"top-left":on.none(),top:on.none(),"top-right":on.none(),right:on.some(function(n,t){Hx(n,Rx(bx(t)))}),"bottom-right":on.none(),bottom:on.none(),"bottom-left":on.none(),left:on.some(function(n,t){Hx(n,Rx(gx(t)))})},Kw=/* */Object.freeze({setValueFrom:function(n,t,e){varo=ow(n,t,e),r=ew(o);returntw(n,r),o},setToMin:function(n,t){vare=dx(t);tw(n,ew(e))},setToMax:function(n,t){vare=hx(t);tw(n,ew(e))},findValueOfOffset:ow,getValueFromEvent:function(n){returnlx(n).map(function(n){returnn.left()})},findPositionOfValue:iw,setPositionFromValue:function(n,t,e,o){varr=Ix(e),i=iw(n,o.getSpectrum(n),r.x(),o.getLeftEdge(n),o.getRightEdge(n),e),u=mu(t.element())/2;yr(t.element(),"left",i-u+"px")},onLeft:Ww,onRight:Gw,onUp:Xw,onDown:Yw,edgeActions:qw}),Jw=on.none,$w=on.none,Qw=sw(-1),Zw=sw(1),nS={"top-left":on.none(),top:on.some(function(n,t){Hx(n,Vx(px(t)))}),"top-right":on.none(),right:on.none(),"bottom-right":on.none(),bottom:on.some(function(n,t){Hx(n,Vx(yx(t)))}),"bottom-left":on.none(),left:on.none()},tS=/* */Object.freeze({setValueFrom:function(n,t,e){varo=cw(n,t,e),r=aw(o);returnuw(n,r),o},setToMin:function(n,t){vare=mx(t);uw(n,aw(e))},setToMax:function(n,t){vare=vx(t);uw(n,aw(e))},findValueOfOffset:cw,getValueFromEvent:function(n){returnlx(n).map(function(n){returnn.top()})},findPositionOfValue:fw,setPositionFromValue:function(n,t,e,o){varr=Ix(e),i=fw(n,o.getSpectrum(n),r.y(),o.getTopEdge(n),o.getBottomEdge(n),e),u=su(t.element())/2;yr(t.element(),"top",i-u+"px")},onLeft:Jw,onRight:$w,onUp:Qw,onDown:Zw,edgeActions:nS}),eS=mw(-1,!1),oS=mw(1,!1),rS=mw(-1,!0),iS=mw(1,!0),uS={"top-left":on.some(function(n,t){Hx(n,Nx(gx(t),px(t)))}),top:on.some(function(n,t){Hx(n,Nx(Cx(t),px(t)))}),"top-right":on.some(function(n,t){Hx(n,Nx(bx(t),px(t)))}),right:on.some(function(n,t){Hx(n,Nx(bx(t),kx(t)))}),"bottom-right":on.some(function(n,t){Hx(n,Nx(bx(t),yx(t)))}),bottom:on.some(function(n,t){Hx(n,Nx(Cx(t),yx(t)))}),"bottom-left":on.some(function(n,t){Hx(n,Nx(gx(t),yx(t)))}),left:on.some(function(n,t){Hx(n,Nx(gx(t),kx(t)))})},aS=/* */Object.freeze({setValueFrom:function(n,t,e){varo=ow(n,t,e.left()),r=cw(n,t,e.top()),i=dw(o,r);returnlw(n,i),i},setToMin:function(n,t){vare=dx(t),o=mx(t);lw(n,dw(e,o))},setToMax:function(n,t){vare=hx(t),o=vx(t);lw(n,dw(e,o))},getValueFromEvent:function(n){returnlx(n)},setPositionFromValue:function(n,t,e,o){varr=Ix(e),i=iw(n,o.getSpectrum(n),r.x(),o.getLeftEdge(n),o.getRightEdge(n),e),u=fw(n,o.getSpectrum(n),r.y(),o.getTopEdge(n),o.getBottomEdge(n),e),a=mu(t.element())/2,c=su(t.element())/2;yr(t.element(),"left",i-a+"px"),yr(t.element(),"top",u-c+"px")},onLeft:eS,onRight:oS,onUp:rS,onDown:iS,edgeActions:uS}),cS=Al({name:"Slider",configFields:[St("stepSize",1),St("onChange",Z),St("onChoose",Z),St("onInit",Z),St("onDragStart",Z),St("onDragEnd",Z),St("snapToGrid",!1),St("rounded",!0),ht("snapStart"),st("model",it("mode",{x:[St("minX",0),St("maxX",100),At("value",function(n){returnye(n.mode.minX)}),ct("getInitialValue"),Qu("manager",Kw)],y:[St("minY",0),St("maxY",100),At("value",function(n){returnye(n.mode.minY)}),ct("getInitialValue"),Qu("manager",tS)],xy:[St("minX",0),St("maxX",100),St("minY",0),St("maxY",100),At("value",function(n){returnye({x:nn(n.mode.minX),y:nn(n.mode.minY)})}),ct("getInitialValue"),Qu("manager",aS)]})),Fs("sliderBehaviours",[lg,Zf]),At("mouseIsDown",function(){returnye(!1)})],partFields:Lw,factory:function(i,n,t,e){functionu(n){returnKs(n,i,"thumb")}functiona(n){returnKs(n,i,"spectrum")}functiono(n){returnqs(n,i,"left-edge")}functionr(n){returnqs(n,i,"right-edge")}functionc(n){returnqs(n,i,"top-edge")}functions(n){returnqs(n,i,"bottom-edge")}functionf(n,t){v.setPositionFromValue(n,t,i,{getLeftEdge:o,getRightEdge:r,getTopEdge:c,getBottomEdge:s,getSpectrum:a})}functionl(n,t){h.value.set(t);vare=u(n);returnf(n,e),i.onChange(n,e,t),on.some(!0)}functiond(e){varn=i.mouseIsDown.get();i.mouseIsDown.set(!1),n&&qs(e,i,"thumb").each(function(n){vart=h.value.get();i.onChoose(e,n,t)})}functionm(n,t){t.stop(),i.mouseIsDown.set(!0),i.onDragStart(n,u(n))}functiong(n,t){t.stop(),i.onDragEnd(n,u(n)),d(n)}varp,h=i.model,v=h.manager;return{uid:i.uid,dom:i.dom,components:n,behaviours:Rs(i.sliderBehaviours,[lg.config({mode:"special",focusIn:function(n){returnqs(n,i,"spectrum").map(lg.focusIn).map(nn(!0))}}),Zf.config({store:{mode:"manual",getValue:function(n){returnh.value.get()}}}),lc.config({channels:(p={},p[Uf()]={onReceive:d},p)})]),events:co([lo(jw(),function(n,t){l(n,t.event().value())}),Ii(function(n,t){vare=h.getInitialValue();h.value.set(e);varo=u(n);f(n,o);varr=a(n);i.onInit(n,o,r,h.value.get())}),lo(Ur(),m),lo(Gr(),g),lo(Yr(),m),lo(Jr(),g)]),apis:{resetToMin:function(n){v.setToMin(n,i)},resetToMax:function(n){v.setToMax(n,i)},changeValue:l,refresh:f},domModification:{styles:{position:"relative"}}}},apis:{resetToMin:function(n,t){n.resetToMin(t)},resetToMax:function(n,t){n.resetToMax(t)},refresh:function(n,t){n.refresh(t)}}}),sS=function(n,t){vare=cS.parts().spectrum({dom:{tag:"div",classes:[t("hue-slider-spectrum")],attributes:{role:"presentation"}}}),o=cS.parts().thumb({dom:{tag:"div",classes:[t("hue-slider-thumb")],attributes:{role:"presentation"}}});returncS.sketch({dom:{tag:"div",classes:[t("hue-slider")],attributes:{role:"presentation"}},rounded:!1,model:{mode:"y",getInitialValue:nn({y:nn(0)})},components:[e,o],sliderBehaviours:ba([vg.config({})]),onChange:function(n,t,e){ro(n,_w(),{value:e})}})},fS=[Fs("formBehaviours",[Zf])],lS=function(o,n,t){return{uid:o.uid,dom:o.dom,components:n,behaviours:Rs(o.formBehaviours,[Zf.config({store:{mode:"manual",getValue:function(n){vart=$s(n,o);returnP(t,function(n,t){returnn().bind(function(n){returnfunction(n,t){returnn.fold(function(){returnan.error(t)},an.value)}(Zl.getCurrent(n),"missing current")}).map(Zf.getValue)})},setValue:function(e,n){Cn(n,function(t,n){qs(e,o,n).each(function(n){Zl.getCurrent(n).each(function(n){Zf.setValue(n,t)})})})}}})]),apis:{getField:function(n,t){returnqs(n,o,t).bind(Zl.getCurrent)}}}},dS={getField:$o(function(n,t,e){returnn.getField(t,e)}),sketch:function(n){vare,t=(e=[],{field:function(n,t){returne.push(n),Us("form",gw(n),t)},record:function(){returne}}),o=n(t),r=t.record(),i=S(r,function(n){returnxl({name:n,pname:gw(n)})});returnof("form",fS,i,lS,o)}},mS=Xo("valid-input"),gS=Xo("invalid-input"),pS=Xo("validating-input"),hS="colorcustom.rgb.",vS=function(d,m,g,p){functionh(n,t,e,o,r){vari=d(hS+"range"),u=[vy.parts().label({dom:{tag:"label",innerHtml:e,attributes:{"aria-label":o}}}),vy.parts().field({data:r,factory:yy,inputAttributes:N({type:"text"},"hex"===t?{"aria-live":"polite"}:{}),inputClasses:[m("textfield")],inputBehaviours:ba([function(t,o){returnjy.config({invalidClass:m("invalid"),notify:{onValidate:function(n){ro(n,pS,{type:t})},onValid:function(n){ro(n,mS,{type:t,value:Zf.getValue(n)})},onInvalid:function(n){ro(n,gS,{type:t,value:Zf.getValue(n)})}},validator:{validate:function(n){vart=Zf.getValue(n),e=o(t)?an.value(!0):an.error(d("aria.input.invalid"));returnNy(e)},validateOnLoad:!1}})}(t,n),Gy.config({})]),onSetValue:function(n){jy.isInvalid(n)&&jy.run(n).get(Z)}})],a="hex"!==t?[vy.parts()["aria-descriptor"]({text:i})]:[];return{dom:{tag:"div",attributes:{role:"presentation"}},components:u.concat(a)}}functionv(n,t){vare=t.red(),o=t.green(),r=t.blue();Zf.setValue(n,{red:e,green:o,blue:r})}functionb(n,t){y.getOpt(n).each(function(n){yr(n.element(),"background-color","#"+t.value())})}vary=vm({dom:{tag:"div",classes:[m("rgba-preview")],styles:{"background-color":"white"},attributes:{role:"presentation"}}});returnDl({factory:function(){functionr(n){returnu[n]().get()}functioni(n,t){u[n]().set(t)}functiont(n,t){vare=t.event();"hex"!==e.type()?i(e.type(),on.none()):p(n)}functiono(e,n,t){varo=parseInt(t,10);i(n,on.some(o)),r("red").bind(function(e){returnr("green").bind(function(t){returnr("blue").map(function(n){returnWh(e,t,n,1)})})}).each(function(n){vart=function(t,n){vare=Uh(n);returndS.getField(t,"hex").each(function(n){vg.isFocused(n)||Zf.setValue(t,{hex:e.value()})}),e}(e,n);b(e,t)})}functione(n,t){vare=t.event();!function(n){return"hex"===n.type()}(e)?o(n,e.type(),e.value()):function(n,t){g(n);vare=Ph(t);i("hex",on.some(t));varo=Yh(e);v(n,o),a(o),ro(n,Aw(),{hex:e}),b(n,e)}(n,e.value())}functionn(n){return{label:d(hS+n+".label"),description:d(hS+n+".description")}}varu={red:nn(ye(on.some(255))),green:nn(ye(on.some(255))),blue:nn(ye(on.some(255))),hex:nn(ye(on.some("ffffff")))},a=function(n){vart=n.red(),e=n.green(),o=n.blue();i("red",on.some(t)),i("green",on.some(e)),i("blue",on.some(o))},c=n("red"),s=n("green"),f=n("blue"),l=n("hex");returnDn(dS.sketch(function(n){return{dom:{tag:"form",classes:[m("rgb-form")],attributes:{"aria-label":d("aria.color.picker")}},components:[n.field("red",vy.sketch(h(Gh,"red",c.label,c.description,255))),n.field("green",vy.sketch(h(Gh,"green",s.label,s.description,255))),n.field("blue",vy.sketch(h(Gh,"blue",f.label,f.description,255))),n.field("hex",vy.sketch(h(zh,"hex",l.label,l.description,"ffffff"))),y.asSpec()],formBehaviours:ba([jy.config({invalidClass:m("form-invalid")}),Kd("rgb-form-events",[lo(mS,e),lo(gS,t),lo(pS,t)])])}}),{apis:{updateHex:function(n,t){Zf.setValue(n,{hex:t.value()}),function(n,t){vare=Yh(t);v(n,e),a(e)}(n,t),b(n,t)}}})},name:"RgbForm",configFields:[],apis:{updateHex:function(n,t,e){n.updateHex(t,e)}},extraApis:{}})},bS=function(n,o){functionr(n,t){vare=n.width,o=n.height,r=n.getContext("2d");if(null!==r){r.fillStyle=t,r.fillRect(0,0,e,o);vari=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);varu=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)}}vari=cS.parts().spectrum({dom:{tag:"canvas",attributes:{role:"presentation"},classes:[o("sv-palette-spectrum")]}}),u=cS.parts().thumb({dom:{tag:"div",attributes:{role:"presentation"},classes:[o("sv-palette-thumb")],innerHtml:"<div class="+o("sv-palette-inner-thumb")+' role="presentation"></div>'}});returnDl({factory:function(n){vart=nn({x:nn(0),y:nn(0)}),e=ba([Zl.config({find:on.some}),vg.config({})]);returncS.sketch({dom:{tag:"div",attributes:{role:"presentation"},classes:[o("sv-palette")]},model:{mode:"xy",getInitialValue:t},rounded:!1,components:[i,u],onChange:function(n,t,e){ro(n,Mw(),{value:e})},onInit:function(n,t,e,o){r(e.element().dom(),Kh(ov()))},sliderBehaviours:e})},name:"SaturationBrightnessPalette",configFields:[],apis:{setRgba:function(n,t,e){!function(n,t){vare=n.components()[0].element().dom();r(e,Kh(t))}(t,e)}},extraApis:{}})},yS=function(l,d){returnDl({name:"ColourPicker",configFields:[ct("dom"),St("onValidHex",Z),St("onInvalidHex",Z)],factory:function(n){functiont(n,e){u.getOpt(n).each(function(n){vart=Yh(e);s.paletteRgba().set(t),i.setRgba(n,t)})}functione(n,t){f.getOpt(n).each(function(n){r.updateHex(n,t)})}functiona(t,e,n){bn(n,function(n){n(t,e)})}varo,c,r=vS(l,d,n.onValidHex,n.onInvalidHex),i=bS(l,d),s={paletteRgba:nn(ye(ov()))},u=vm(i.sketch({})),f=vm(r.sketch({}));return{uid:n.uid,dom:n.dom,components:[u.asSpec(),sS(l,d),f.asSpec()],behaviours:ba([Kd("colour-picker-events",[lo(Mw(),(c=[e],function(n,t){vare=t.event().value(),o=function(n){vart,e=0,o=0,r=n.red()/255,i=n.green()/255,u=n.blue()/255,a=Math.min(r,Math.min(i,u)),c=Math.max(r,Math.max(i,u));returna===c?sx(0,0,100*(o=a)):(e=60*((e=r===a?3:u===a?1:5)-(r===a?i-u:u===a?r-i:u-r)/(c-a)),t=(c-a)/c,o=c,sx(Math.round(e),Math.round(100*t),Math.round(100*o)))}(s.paletteRgba().get()),r=sx(o.hue(),e.x(),100-e.y()),i=Xh(r),u=Uh(i);a(n,u,c)})),lo(_w(),(o=[t,e],function(n,t){vare=function(n){vart=sx((100-n)/100*360,100,100),e=Xh(t);returnUh(e)}(t.event().value().y());a(n,e,o)}))]),Zl.config({find:function(n){returnf.getOpt(n)}}),lg.config({mode:"acyclic"})])}}})},xS=function(){returnZl.config({find:on.some})},wS=function(n){returnZl.config({find:n.getOpt})},SS=function(n){returnZl.config({find:function(t){returnDo(t.element(),n).bind(function(n){returnt.getSystem().getByDom(n).toOption()})}})},CS={"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"},kS=tinymce.util.Tools.resolve("tinymce.Resource"),OS=re([St("preprocess",l),St("postprocess",l)]),ES=function(r,n){vari=ot("RepresentingConfigs.memento processors",OS,n);returnZf.config({store:{mode:"manual",getValue:function(n){vart=r.get(n),e=Zf.getValue(t);returni.postprocess(e)},setValue:function(n,t){vare=i.preprocess(t),o=r.get(n);Zf.setValue(o,e)}}})},TS=hw,BS=function(n){returnvw(n,Vo,No)},DS=function(n){returnZf.config({store:{mode:"memory",initialValue:n}})},AS=Xo("alloy-fake-before-tabstop"),_S=Xo("alloy-fake-after-tabstop"),MS=function(n){returnlb(n,["."+AS,"."+_S].join(","),nn(!1))},FS=function(n,t){vare=t.element();mr(e,AS)?xw(n,!0):mr(e,_S)&&xw(n,!1)},IS=function(n){return{dom:{tag:"div",classes:["tox-navobj"]},components:[yw([AS]),n,yw([_S])],behaviours:ba([SS(1)])}},RS=!(Ht().browser.isIE()||Ht().browser.isEdge());functionVS(n,t){returnPS(v.document.createElement("canvas"),n,t)}functionNS(n){vart=VS(n.width,n.height);returnHS(t).drawImage(n,0,0),t}functionHS(n){returnn.getContext("2d")}functionPS(n,t,e){returnn.width=t,n.height=e,n}functionzS(n){returnn.naturalWidth||n.width}functionLS(n){returnn.naturalHeight||n.height}varjS,US,WS=window.Promise?window.Promise:(jS=GS.immediateFn||"function"==typeofwindow.setImmediate&&window.setImmediate||function(n){v.setTimeout(n,1)},US=Array.isArray||function(n){return"[object Array]"===Object.prototype.toString.call(n)},GS.prototype["catch"]=function(n){returnthis.then(null,n)},GS.prototype.then=function(e,o){varr=this;returnnewGS(function(n,t){YS.call(r,new$S(e,o,n,t))})},GS.all=function(){for(varn=[],t=0;t<arguments.length;t++)n[t]=arguments[t];varc=Array.prototype.slice.call(1===n.length&&US(n[0])?n[0]:n);returnnewGS(function(r,i){if(0===c.length)returnr([]);varu=c.length;functiona(t,n){try{if(n&&("object"==typeofn||"function"==typeofn)){vare=n.then;if("function"==typeofe)returnvoide.call(n,function(n){a(t,n)},i)}c[t]=n,0==--u&&r(c)}catch(o){i(o)}}for(varn=0;n<c.length;n++)a(n,c[n])})},GS.resolve=function(t){returnt&&"object"==typeoft&&t.constructor===GS?t:newGS(function(n){n(t)})},GS.reject=function(e){returnnewGS(function(n,t){t(e)})},GS.race=function(r){returnnewGS(function(n,t){for(vare=0,o=r;e<o.length;e++)o[e].then(n,t)})},GS);functionGS(n){if("object"!=typeofthis)thrownewTypeError("Promises must be constructed via new");if("function"!=typeofn)thrownewTypeError("not a function");this._state=null,this._value=null,this._deferreds=[],QS(n,XS(qS,this),XS(KS,this))}functionXS(n,t){returnfunction(){returnn.apply(t,arguments)}}functionYS(o){varr=this;null!==this._state?jS(function(){varn=r._state?o.onFulfilled:o.onRejected;if(null!==n){vart;try{t=n(r._value)}catch(e){returnvoido.reject(e)}o.resolve(t)}else(r._state?o.resolve:o.reject)(r._value)}):this._deferreds.push(o)}functionqS(n){try{if(n===this)thrownewTypeError("A promise cannot be resolved with itself.");if(n&&("object"==typeofn||"function"==typeofn)){vart=n.then;if("function"==typeoft)returnvoidQS(XS(t,n),XS(qS,this),XS(KS,this))}this._state=!0,this._value=n,JS.call(this)}catch(e){KS.call(this,e)}}functionKS(n){this._state=!1,this._value=n,JS.call(this)}functionJS(){for(varn=0,t=this._deferreds;n<t.length;n++){vare=t[n];YS.call(this,e)}this._deferreds=[]}function$S(n,t,e,o){this.onFulfilled="function"==typeofn?n:null,this.onRejected="function"==typeoft?t:null,this.resolve=e,this.reject=o}functionQS(n,t,e){varo=!1;try{n(function(n){o||(o=!0,t(n))},function(n){o||(o=!0,e(n))})}catch(r){if(o)return;o=!0,e(r)}}functionZS(e){returnnewWS(function(n,t){(functionp(n){vart=n.split(","),e=/data:([^;]+)/.exec(t[0]);if(!e)returnon.none();for(varo=e[1],r=t[1],i=v.atob(r),u=i.length,a=Math.ceil(u/1024),c=newArray(a),s=0;s<a;++s){for(varf=1024*s,l=Math.min(1024+f,u),d=newArray(l-f),m=f,g=0;m<l;++g,++m)d[g]=i[m].charCodeAt(0);c[s]=newUint8Array(d)}returnon.some(newv.Blob(c,{type:o}))})(e).fold(function(){t("uri is not base64: "+e)},n)})}functionnC(n,o,r){returno=o||"image/png",v.HTMLCanvasElement.prototype.toBlob?newWS(function(t,e){n.toBlob(function(n){n?t(n):e()},o,r)}):ZS(n.toDataURL(o,r))}functiontC(n){returnfunctiont(a){returnnewWS(function(n,t){vare=v.URL.createObjectURL(a),o=newv.Image,r=function(){o.removeEventListener("load",i),o.removeEventListener("error",u)};functioni(){r(),n(o)}functionu(){r(),t("Unable to load data of type "+a.type+": "+e)}o.addEventListener("load",i),o.addEventListener("error",u),o.src=e,o.complete&&i()})}(n).then(function(n){!functione(n){v.URL.revokeObjectURL(n.src)}(n);vart=VS(zS(n),LS(n));returnHS(t).drawImage(n,0,0),t})}functioneC(n,t,e){varo=t.type;functionr(t,e){returnn.then(function(n){returnfunctiono(n,t,e){returnt=t||"image/png",n.toDataURL(t,e)}(n,t,e)})}return{getType:nn(o),toBlob:functioni(){returnWS.resolve(t)},toDataURL:functionu(){returne},toBase64:functiona(){returne.split(",")[1]},toAdjustedBlob:functionc(t,e){returnn.then(function(n){returnnC(n,t,e)})},toAdjustedDataURL:r,toAdjustedBase64:functions(n,t){returnr(n,t).then(function(n){returnn.split(",")[1]})},toCanvas:functionf(){returnn.then(NS)}}}functionoC(t){returnfunctionn(e){returnnewWS(function(n){vart=newv.FileReader;t.onloadend=function(){n(t.result)},t.readAsDataURL(e)})}(t).then(function(n){returneC(tC(t),t,n)})}functionrC(t,n){returnnC(t,n).then(function(n){returneC(WS.resolve(t),n,t.toDataURL())})}functioniC(n,t,e){varo="string"==typeofn?parseFloat(n):n;returne<o?o=e:o<t&&(o=t),o}varuC=[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];functionaC(n,t){for(vare,o=[],r=newArray(25),i=0;i<5;i++){for(varu=0;u<5;u++)o[u]=t[u+5*i];for(u=0;u<5;u++){for(vara=e=0;a<5;a++)e+=n[u+5*a]*o[a];r[u+5*i]=e}}returnr}functioncC(t,e){returnt.toCanvas().then(function(n){returnfunctioni(n,t,e){varo=HS(n);varr=functionB(n,t){for(vare,o,r,i,u=n.data,a=t[0],c=t[1],s=t[2],f=t[3],l=t[4],d=t[5],m=t[6],g=t[7],p=t[8],h=t[9],v=t[10],b=t[11],y=t[12],x=t[13],w=t[14],S=t[15],C=t[16],k=t[17],O=t[18],E=t[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*C+r*k+i*O+E;returnn}(o.getImageData(0,0,n.width,n.height),e);returno.putImageData(r,0,0),rC(n,t)}(n,t.getType(),e)})}functionsC(t,e){returnt.toCanvas().then(function(n){returnfunctionu(n,t,e){varo=HS(n);varr=o.getImageData(0,0,n.width,n.height),i=o.getImageData(0,0,n.width,n.height);returni=functionw(n,t,e){functiono(n,t,e){returne<n?n=e:n<t&&(n=t),n}for(varr=Math.round(Math.sqrt(e.length)),i=Math.floor(r/2),u=n.data,a=t.data,c=n.width,s=n.height,f=0;f<s;f++)for(varl=0;l<c;l++){for(vard=0,m=0,g=0,p=0;p<r;p++)for(varh=0;h<r;h++){varv=o(l+h-i,0,c-1),b=4*(o(f+p-i,0,s-1)*c+v),y=e[p*r+h];d+=u[b]*y,m+=u[1+b]*y,g+=u[2+b]*y}varx=4*(f*c+l);a[x]=o(d,0,255),a[1+x]=o(m,0,255),a[2+x]=o(g,0,255)}returnt}(r,i,e),o.putImageData(i,0,0),rC(n,t)}(n,t.getType(),e)})}functionfC(e){returnfunction(n,t){returncC(n,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],t))}}functionlC(n,t,e,o){returncC(n,functionr(n,t,e,o){returnaC(n,[t=iC(t,0,2),0,0,0,0,0,e=iC(e,0,2),0,0,0,0,0,o=iC(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],t,e,o))}vardC=functioncI(t){returnfunction(n){returncC(n,t)}}([-1,0,0,0,255,0,-1,0,0,255,0,0,-1,0,255,0,0,0,1,0,0,0,0,0,1]),mC=fC(functionsI(n,t){returnaC(n,[1,0,0,0,t=iC(255*t,-255,255),0,1,0,0,t,0,0,1,0,t,0,0,0,1,0,0,0,0,0,1])}),gC=fC(functionfI(n,t){vare;returnt=iC(t,-1,1),aC(n,[(e=(t*=100)<0?127+t/100*127:127*(e=0===(e=t%1)?uC[t]:uC[Math.floor(t)]*(1-e)+uC[Math.floor(t)+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])}),pC=functionlI(t){returnfunction(n){returnsC(n,t)}}([0,-1,0,-1,5,-1,0,-1,0]),hC=functiondI(c){returnfunction(t,e){returnt.toCanvas().then(function(n){returnfunction(n,t,e){varo=HS(n),r=newArray(256);for(vari=0;i<r.length;i++)r[i]=c(i,e);varu=functiona(n,t){for(vare=n.data,o=0;o<e.length;o+=4)e[o]=t[e[o]],e[o+1]=t[e[o+1]],e[o+2]=t[e[o+2]];returnn}(o.getImageData(0,0,n.width,n.height),r);returno.putImageData(u,0,0),rC(n,t)}(n,t.getType(),e)})}}(function(n,t){return255*Math.pow(n/255,1-t)});functionvC(n,t,e){varo=zS(n),r=LS(n),i=t/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);varc=functions(u,a,c){returnnewWS(function(n){vart=zS(u),e=LS(u),o=Math.floor(t*a),r=Math.floor(e*c),i=VS(o,r);HS(i).drawImage(u,0,0,t,e,0,0,o,r),n(i)})}(n,i,u);returna?c.then(function(n){returnvC(n,t,e)}):c}functionbC(t,e){returnt.toCanvas().then(function(n){returnfunctiona(n,t,e){varo=VS(n.width,n.height),r=HS(o),i=0,u=0;90!==(e=e<0?360+e:e)&&270!==e||PS(o,o.height,o.width);90!==e&&180!==e||(i=o.width);270!==e&&180!==e||(u=o.height);returnr.translate(i,u),r.rotate(e*Math.PI/180),r.drawImage(n,0,0),rC(o,t)}(n,t.getType(),e)})}functionyC(t,e){returnt.toCanvas().then(function(n){returnfunctioni(n,t,e){varo=VS(n.width,n.height),r=HS(o);"v"===e?(r.scale(1,-1),r.drawImage(n,0,-o.height)):(r.scale(-1,1),r.drawImage(n,-o.width,0));returnrC(o,t)}(n,t.getType(),e)})}functionxC(t,e,o,r,i){returnt.toCanvas().then(function(n){returnfunctiona(n,t,e,o,r,i){varu=VS(r,i);returnHS(u).drawImage(n,-e,-o),rC(u,t)}(n,t.getType(),e,o,r,i)})}functionwC(n){returndC(n)}functionSC(n){returnpC(n)}functionCC(n,t){returnhC(n,t)}functionkC(n,t){returnmC(n,t)}functionOC(n,t){returngC(n,t)}functionEC(n,t){returnyC(n,t)}functionTC(n,t,e){returnfunctionr(t,e,o){returnt.toCanvas().then(function(n){returnvC(n,e,o).then(function(n){returnrC(n,t.getType())})})}(n,t,e)}functionBC(n,t){returnbC(n,t)}functionDC(n,t){returnN({dom:{tag:"span",innerHtml:n,classes:["tox-icon","tox-tbtn__icon-wrap"]}},t)}functionAC(n,t){returnDC(ym(n,t),{})}function_C(n,t){returnDC(ym(n,t),{behaviours:ba([mg.config({})])})}functionMC(n,t,e){return{dom:{tag:"span",innerHtml:e.translate(n),classes:[t+"__select-label"]},behaviours:ba([mg.config({})])}}functionFC(n,t,o){functione(n,t){vare=Zf.getValue(n);returnvg.focus(e),ro(e,"keydown",{raw:t.event().raw()}),Ow.close(e),on.some(!0)}varr=ye(Z),i=n.text.map(function(n){returnvm(MC(n,t,o.providers))}),u=n.icon.map(function(n){returnvm(_C(n,o.providers.icons))}),a=n.role.fold(function(){return{}},function(n){return{role:n}}),c=n.tooltip.fold(function(){return{}},function(n){vart=o.providers.translate(n);return{title:t,"aria-label":t}});returnvm(Ow.sketch(N(N({},a),{dom:{tag:"button",classes:[t,t+"--select"].concat(S(n.classes,function(n){returnt+"--"+n})),attributes:N({},c)},components:Bh([u.map(function(n){returnn.asSpec()}),i.map(function(n){returnn.asSpec()}),on.some({dom:{tag:"div",classes:[t+"__select-chevron"],innerHtml:ym("chevron-down",o.providers.icons)}})]),matchWidth:!0,useMinWidth:!0,dropdownBehaviours:ba(g(n.dropdownBehaviours,[Oh(n.disabled),Ew.config({}),mg.config({}),Kd("dropdown-events",[Ep(n,r),Tp(n,r)]),Kd("menubutton-update-display-text",[lo(rk,function(t,e){i.bind(function(n){returnn.getOpt(t)}).each(function(n){mg.set(n,[Ir(o.providers.translate(e.event().text()))])})}),lo(ik,function(t,e){u.bind(function(n){returnn.getOpt(t)}).each(function(n){mg.set(n,[_C(e.event().icon(),o.providers.icons)])})})])])),eventOrder:Dn(ok,{mousedown:["focusing","alloy.base.behaviour","item-type-events","normal-dropdown-events"]}),sandboxBehaviours:ba([lg.config({mode:"special",onLeft:e,onRight:e})]),lazySink:o.getSink,toggleClass:t+"--active",parts:{menu:Sv(0,n.columns,n.presets)},fetch:function(){returnVy(n.fetch)}}))).asSpec()}functionIC(n){return"separator"===n.type}functionRC(n,e){vart=O(n,function(n,t){returnfunction(n){returncn(n)}(t)?""===t?n:"|"===t?0<n.length&&!IC(n[n.length-1])?n.concat([uk]):n:En(e,t.toLowerCase())?n.concat([e[t.toLowerCase()]]):n:n.concat([t])},[]);return0<t.length&&IC(t[t.length-1])&&t.pop(),t}functionVC(n,t){returnfunction(n){returnEn(n,"getSubmenuItems")}(n)?function(n,t){vare=n.getSubmenuItems(),o=ak(e,t);return{item:n,menus:Dn(o.menus,q(n.value,o.items)),expansions:Dn(o.expansions,q(n.value,n.value))}}(n,t):{item:n,menus:{},expansions:{}}}functionNC(n,e,o,t){varr=Xo("primary-menu"),i=ak(n,o.shared.providers.menuItems());if(0===i.items.length)returnon.none();varu=ib(r,i.items,e,o,t),a=P(i.menus,function(n,t){returnib(t,n,e,o,!1)}),c=Dn(a,q(r,u));returnon.from(Lg.tieredData(r,c,i.expansions))}functionHC(e){return{isDisabled:function(){returnCh.isDisabled(e)},setDisabled:function(n){returnCh.set(e,n)},setActive:function(n){vart=e.element();n?(fr(t,"tox-tbtn--enabled"),Po(t,"aria-pressed",!0)):(dr(t,"tox-tbtn--enabled"),jo(t,"aria-pressed"))},isActive:function(){returnmr(e.element(),"tox-tbtn--enabled")}}}functionPC(n,t,e,o){returnFC({text:n.text,icon:n.icon,tooltip:n.tooltip,role:o,fetch:function(t){n.fetch(function(n){t(NC(n,Fh.CLOSE_ON_EXECUTE,e,!1))})},onSetup:n.onSetup,getApi:HC,columns:1,presets:"normal",classes:[],dropdownBehaviours:[Gy.config({})]},t,e.shared)}functionzC(t,o,r){returnfunction(n){n(S(t,function(n){vart=n.text.fold(function(){return{}},function(n){return{text:n}});returnN(N({type:n.type},t),{onAction:function(e){returnfunction(n){vart=!n.isActive();n.setActive(t),e.storage.set(t),r.shared.getSink().each(function(n){o().getOpt(n).each(function(n){wa(n.element()),ro(n,sy,{name:e.name,value:e.storage.get()})})})}}(n),onSetup:function(t){returnfunction(n){n.setActive(t.storage.get())}}(n)})}))}}functionLC(n,t,e,o,r){void0===e&&(e=[]);vari=t.fold(function(){return{}},function(n){return{action:n}}),u=N({buttonBehaviours:ba([Oh(n.disabled),Gy.config({}),Kd("button press",[fo("click"),fo("mousedown")])].concat(e)),eventOrder:{click:["button press","alloy.base.behaviour"],mousedown:["button press","alloy.base.behaviour"]}},i),a=Dn(u,{dom:o});returnDn(a,{components:r})}functionjC(n,t,e,o){void0===o&&(o=[]);varr={tag:"button",classes:["tox-tbtn"],attributes:n.tooltip.map(function(n){return{"aria-label":e.translate(n),title:e.translate(n)}}).getOr({})},i=n.icon.map(function(n){returnAC(n,e.icons)}),u=Bh([i]);returnLC(n,t,o,r,u)}functionUC(n,t,e,o){void0===o&&(o=[]);varr=jC(n,on.some(t),e,o);returnGg.sketch(r)}functionWC(n,t,e,o,r){void0===o&&(o=[]),void0===r&&(r=[]);vari=e.translate(n.text),u=n.icon?n.icon.map(function(n){returnAC(n,e.icons)}):on.none(),a=u.isSome()?Bh([u]):[],c=u.isSome()?{}:{innerHtml:i},s=g(n.primary||n.borderless?["tox-button"]:["tox-button","tox-button--secondary"],u.isSome()?["tox-button--icon"]:[],n.borderless?["tox-button--naked"]:[],r),f=N(N({tag:"button",classes:s},c),{attributes:{title:i}});returnLC(n,t,o,f,a)}functionGC(n,t,e,o,r){void0===o&&(o=[]),void0===r&&(r=[]);vari=WC(n,on.some(t),e,o,r);returnGg.sketch(i)}functionXC(t,e){returnfunction(n){"custom"===e?ro(n,sy,{name:t,value:{}}):"submit"===e?oo(n,fy):"cancel"===e?oo(n,cy):v.console.error("Unknown button type: ",e)}}functionYC(n,t,e){if(function(n,t){return"menu"===t}(0,t)){varo=n,r=N(N({},n),{fetch:zC(o.items,function(){returni},e)}),i=vm(PC(r,"tox-tbtn",e,on.none()));returni.asSpec()}if(function(n,t){return"custom"===t||"cancel"===t||"submit"===t}(0,t)){varu=XC(n.name,t),a=N(N({},n),{borderless:!1});returnGC(a,u,e.shared.providers,[])}v.console.error("Unknown footer button type: ",t)}functionqC(n,t){vare=XC(n.name,"custom");returnfunction(n,t){returnBy(n,t,[],[])}(on.none(),vy.parts().field(N({factory:Gg},WC(n,on.some(e),t,[DS(""),xS()]))))}functionKC(n,t){returnxl({factory:vy,name:n,overrides:function(o){return{fieldBehaviours:ba([Kd("coupled-input-behaviour",[lo(ei(),function(e){(function(n,t,e){returnqs(n,t,e).bind(Zl.getCurrent)})(e,o,t).each(function(t){qs(e,o,"lock").each(function(n){Cg.isOn(n)&&o.onLockedChange(e,t,n)})})})])])}}})}functionJC(n){vart=/^\s*(\d+(?:\.\d+)?)\s*(|cm|mm|in|px|pt|pc|em|ex|ch|rem|vw|vh|vmin|vmax|%)\s*$/.exec(n);if(null===t)returnan.error(n);vare=parseFloat(t[1]),o=t[2];returnan.value({value:e,unit:o})}function$C(n,t){functione(n){returnObject.prototype.hasOwnProperty.call(o,n)}varo={"":96,px:96,pt:72,cm:2.54,pc:12,mm:25.4,"in":1};returnn.unit===t?on.some(n.value):e(n.unit)&&e(t)?o[n.unit]===o[t]?on.some(n.value):on.some(n.value/o[n.unit]*o[t]):on.none()}functionQC(n){returnon.none()}functionZC(n,t){returnfunction(n,t,e){returnn.isSome()&&t.isSome()?on.some(e(n.getOrDie(),t.getOrDie())):on.none()}(JC(n).toOption(),JC(t).toOption(),function(n,t){return$C(n,t.unit).map(function(n){returnt.value/n}).map(function(n){returnfunction(t,e){returnfunction(n){return$C(n,e).map(function(n){return{value:n*t,unit:e}})}}(n,t.unit)}).getOr(QC)}).getOr(QC)}functionnk(o,t){functionn(n){return{dom:{tag:"div",classes:["tox-form__group"]},components:n}}functione(e){returnvy.parts().field({factory:yy,inputClasses:["tox-textfield"],inputBehaviours:ba([Ch.config({disabled:o.disabled}),Gy.config({}),Kd("size-input-events",[lo(Qr(),function(n,t){ro(n,i,{isField1:e})}),lo(oi(),function(n,t){ro(n,uy,{name:o.name})})])]),selectOnFocus:!1})}functionr(n){return{dom:{tag:"label",classes:["tox-label"],innerHtml:t.translate(n)}}}vara=QC,i=Xo("ratio-event"),u=fk.parts().lock({dom:{tag:"button",classes:["tox-lock","tox-button","tox-button--naked","tox-button--icon"],attributes:{title:t.translate(o.label.getOr("Constrain proportions"))}},components:[{dom:{tag:"span",classes:["tox-icon","tox-lock-icon__lock"],innerHtml:ym("lock",t.icons)}},{dom:{tag:"span",classes:["tox-icon","tox-lock-icon__unlock"],innerHtml:ym("unlock",t.icons)}}],buttonBehaviours:ba([Oh(o.disabled),Gy.config({})])}),c=fk.parts().field1(n([vy.parts().label(r("Width")),e(!0)])),s=fk.parts().field2(n([vy.parts().label(r("Height")),e(!1)]));returnfk.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:[{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:[c,s,n([r(" "),u])]}],field1Name:"width",field2Name:"height",locked:!0,markers:{lockClass:"tox-locked"},onLockedChange:function(n,t,e){JC(Zf.getValue(n)).each(function(n){a(n).each(function(n){Zf.setValue(t,function(n){vart,e={"":0,px:0,pt:1,mm:1,pc:2,ex:2,em:2,ch:2,rem:2,cm:3,"in":4,"%":4},o=n.value.toFixed((t=n.unit)ine?e[t]:1);return-1!==o.indexOf(".")&&(o=o.replace(/\.?0*$/,"")),o+n.unit}(n))})})},coupledFieldBehaviours:ba([Ch.config({disabled:o.disabled,onDisabled:function(n){fk.getField1(n).bind(vy.getField).each(Ch.disable),fk.getField2(n).bind(vy.getField).each(Ch.disable),fk.getLock(n).each(Ch.disable)},onEnabled:function(n){fk.getField1(n).bind(vy.getField).each(Ch.enable),fk.getField2(n).bind(vy.getField).each(Ch.enable),fk.getLock(n).each(Ch.enable)}}),Kd("size-input-events2",[lo(i,function(n,t){vare=t.event().isField1(),o=e?fk.getField1(n):fk.getField2(n),r=e?fk.getField2(n):fk.getField1(n),i=o.map(Zf.getValue).getOr(""),u=r.map(Zf.getValue).getOr("");a=ZC(i,u)})])])})}functiontk(r,c){functionn(n,t,e,o){returnvm(GC({name:n,text:n,disabled:e,primary:o,icon:on.none(),borderless:!1},t,c))}functiont(n,t,e,o){returnvm(UC({name:n,icon:on.some(n),tooltip:on.some(t),disabled:o,primary:!1,borderless:!1},e,c))}functionu(n,e){n.map(function(n){vart=n.get(e);t.hasConfigured(Ch)&&Ch.disable(t)})}functiona(n,e){n.map(function(n){vart=n.get(e);t.hasConfigured(Ch)&&Ch.enable(t)})}functioni(n,t,e){ro(n,t,e)}functione(n){returnoo(n,pk.disable())}functiono(n){returnoo(n,pk.enable())}functions(n,t){e(n),i(n,lk.transform(),{transform:t}),o(n)}functionf(n){returnfunction(){Q.getOpt(n).each(function(n){mg.set(n,[J])})}}functionl(n,t){e(n),i(n,lk.transformApply(),{transform:t,swap:f(n)}),o(n)}functiond(){returnn("Back",function(n){returni(n,lk.back(),{swap:f(n)})},!1,!1)}functionm(){returnvm({dom:{tag:"div",classes:["tox-spacer"]},behaviours:ba([Ch.config({})])})}functiong(){returnn("Apply",function(n){returni(n,lk.apply(),{swap:f(n)})},!0,!0)}functionp(){returnfunction(n){vart=r.getRect();returnfunction(n,t,e,o,r){returnxC(n,t,e,o,r)}(n,t.x,t.y,t.w,t.h)}}functionh(t,e){returnfunction(n){returnt(n,e)}}functionv(n,t){!function(n,t){e(n),i(n,lk.tempTransform(),{transform:t}),o(n)}(n,t)}functionb(n,t,e,o,r){vari=cS.parts().label({dom:{tag:"label",classes:["tox-label"],innerHtml:c.translate(n)}}),u=cS.parts().spectrum({dom:{tag:"div",classes:["tox-slider__rail"],attributes:{role:"presentation"}}}),a=cS.parts().thumb({dom:{tag:"div",classes:["tox-slider__handle"],attributes:{role:"presentation"}}});returnvm(cS.sketch({dom:{tag:"div",classes:["tox-slider"],attributes:{role:"presentation"}},model:{mode:"x",minX:e,maxX:r,getInitialValue:nn({x:nn(o)})},components:[i,u,a],sliderBehaviours:ba([vg.config({})]),onChoose:t}))}functiony(n,t,e,o,r){return[d(),function(n,r,t,e,o){returnb(n,function(n,t,e){varo=h(r,e.x()/100);s(n,o)},t,e,o)}(n,t,e,o,r),g()]}functionx(n,t,e,o,r){vari=y(n,t,e,o,r);returnWb.sketch({dom:k,components:i.map(function(n){returnn.asSpec()}),containerBehaviours:ba([Kd("image-tools-filter-panel-buttons-events",[lo(pk.disable(),function(n,t){u(i,n)}),lo(pk.enable(),function(n,t){a(i,n)})])])})}functionw(t,e,o){returnfunction(n){returnfunction(n,t,e,o){returnlC(n,t,e,o)}(n,t,e,o)}}functionS(n){returnb(n,function(a,n,t){vare=j.getOpt(a),o=W.getOpt(a),r=U.getOpt(a);e.each(function(u){o.each(function(i){r.each(function(n){vart=Zf.getValue(u).x()/100,e=Zf.getValue(n).x()/100,o=Zf.getValue(i).x()/100,r=w(t,e,o);s(a,r)})})})},0,100,200)}functionC(t,e,o){returnfunction(n){i(n,lk.swap(),{transform:e,swap:function(){Q.getOpt(n).each(function(n){mg.set(n,[t]),o(n)})}})}}vark={tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools-edit-panel"]},O=Z,E=[d(),m(),n("Apply",function(n){vart=p();l(n,t),r.hideCrop()},!1,!0)],T=Wb.sketch({dom:k,components:E.map(function(n){returnn.asSpec()}),containerBehaviours:ba([Kd("image-tools-crop-buttons-events",[lo(pk.disable(),function(n,t){u(E,n)}),lo(pk.enable(),function(n,t){a(E,n)})])])}),B=vm(nk({name:"size",label:on.none(),constrain:!0,disabled:!1},c)),D=[d(),m(),B,m(),n("Apply",function(o){B.getOpt(o).each(function(n){vart=Zf.getValue(n),e=function(t,e){returnfunction(n){returnTC(n,t,e)}}(parseInt(t.width,10),parseInt(t.height,10));l(o,e)})},!1,!0)],A=Wb.sketch({dom:k,components:D.map(function(n){returnn.asSpec()}),containerBehaviours:ba([Kd("image-tools-resize-buttons-events",[lo(pk.disable(),function(n,t){u(D,n)}),lo(pk.enable(),function(n,t){a(D,n)})])])}),_=h(EC,"h"),M=h(EC,"v"),F=h(BC,-90),I=h(BC,90),R=[d(),m(),t("flip-horizontally","Flip horizontally",function(n){v(n,_)},!1),t("flip-vertically","Flip vertically",function(n){v(n,M)},!1),t("rotate-left","Rotate counterclockwise",function(n){v(n,F)},!1),t("rotate-right","Rotate clockwise",function(n){v(n,I)},!1),m(),g()],V=Wb.sketch({dom:k,components:R.map(function(n){returnn.asSpec()}),containerBehaviours:ba([Kd("image-tools-fliprotate-buttons-events",[lo(pk.disable(),function(n,t){u(R,n)}),lo(pk.enable(),function(n,t){a(R,n)})])])}),N=[d(),m(),g()],H=Wb.sketch({dom:k,components:N.map(function(n){returnn.asSpec()})}),P=x("Brightness",kC,-100,0,100),z=x("Contrast",OC,-100,0,100),L=x("Gamma",CC,-100,0,100),j=S("R"),U=S("G"),W=S("B"),G=[d(),j,U,W,g()],X=Wb.sketch({dom:k,components:G.map(function(n){returnn.asSpec()})}),Y=on.some(SC),q=on.some(wC),K=[t("crop","Crop",C(T,on.none(),function(n){r.showCrop()}),!1),t("resize","Resize",C(A,on.none(),function(n){B.getOpt(n).each(function(n){vart=r.getMeasurements(),e=t.width,o=t.height;Zf.setValue(n,{width:e,height:o})})}),!1),t("orientation","Orientation",C(V,on.none(),O),!1),t("brightness","Brightness",C(P,on.none(),O),!1),t("sharpen","Sharpen",C(H,Y,O),!1),t("contrast","Contrast",C(z,on.none(),O),!1),t("color-levels","Color levels",C(X,on.none(),O),!1),t("gamma","Gamma",C(L,on.none(),O),!1),t("invert","Invert",C(H,q,O),!1)],J=Wb.sketch({dom:k,components:K.map(function(n){returnn.asSpec()})}),$=Wb.sketch({dom:{tag:"div"},components:[J],containerBehaviours:ba([mg.config({})])}),Q=vm($);return{memContainer:Q,getApplyButton:function(n){returnQ.getOpt(n).map(function(n){vart=n.components()[0];returnt.components()[t.components().length-1]})}}}varek=Xo("toolbar.button.execute"),ok={"alloy.execute":["disabling","alloy.base.behaviour","toggling","toolbar-button-events"]},rk=Xo("update-menu-text"),ik=Xo("update-menu-icon"),uk={type:"separator"},ak=function(n,r){vart=RC(cn(n)?n.split(" "):n,r);returnk(t,function(n,t){vare=function(n){if(IC(n))returnn;vart=Nn(n,"value").getOrThunk(function(){returnXo("generated-menu-item")});returnDn({value:t},n)}(t),o=VC(e,r);return{menus:Dn(n.menus,o.menus),items:[o.item].concat(n.items),expansions:Dn(n.expansions,o.expansions)}},{menus:{},expansions:{},items:[]})},ck=nn([St("field1Name","field1"),St("field2Name","field2"),Ju("onLockedChange"),Xu(["lockClass"]),St("locked",!1),nl("coupledFieldBehaviours",[Zl,Zf])]),sk=nn([KC("field1","field2"),KC("field2","field1"),xl({factory:Gg,schema:[ct("dom")],name:"lock",overrides:function(n){return{buttonBehaviours:ba([Cg.config({selected:n.locked,toggleClass:n.markers.lockClass,aria:{mode:"pressed"}})])}}})]),fk=Al({name:"FormCoupledInputs",configFields:ck(),partFields:sk(),factory:function(o,n,t,e){return{uid:o.uid,dom:o.dom,components:n,behaviours:tl(o.coupledFieldBehaviours,[Zl.config({find:on.some}),Zf.config({store:{mode:"manual",getValue:function(n){vart,e=Zs(n,o,["field1","field2"]);return(t={})[o.field1Name]=Zf.getValue(e.field1()),t[o.field2Name]=Zf.getValue(e.field2()),t},setValue:function(n,t){vare=Zs(n,o,["field1","field2"]);$(t,o.field1Name)&&Zf.setValue(e.field1(),t[o.field1Name]),$(t,o.field2Name)&&Zf.setValue(e.field2(),t[o.field2Name])}}})]),apis:{getField1:function(n){returnqs(n,o,"field1")},getField2:function(n){returnqs(n,o,"field2")},getLock:function(n){returnqs(n,o,"lock")}}}},apis:{getField1:function(n,t){returnn.getField1(t)},getField2:function(n,t){returnn.getField2(t)},getLock:function(n,t){returnn.getLock(t)}}}),lk={undo:nn(Xo("undo")),redo:nn(Xo("redo")),zoom:nn(Xo("zoom")),back:nn(Xo("back")),apply:nn(Xo("apply")),swap:nn(Xo("swap")),transform:nn(Xo("transform")),tempTransform:nn(Xo("temp-transform")),transformApply:nn(Xo("transform-apply"))},dk=nn("save-state"),mk=nn("disable"),gk=nn("enable"),pk={formActionEvent:sy,saveState:dk,disable:mk,enable:gk},hk=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),vk=tinymce.util.Tools.resolve("tinymce.geom.Rect"),bk=tinymce.util.Tools.resolve("tinymce.util.Observable"),yk=tinymce.util.Tools.resolve("tinymce.util.Tools"),xk=tinymce.util.Tools.resolve("tinymce.util.VK");functionwk(n){vart,e;if(n.changedTouches)for(t="screenX screenY pageX pageY clientX clientY".split(" "),e=0;e<t.length;e++)n[t[e]]=n.changedTouches[0][t[e]]}functionSk(n,r){vari,u,t,a,c,f,l,d=r.document||v.document;r=r||{};varm=d.getElementById(r.handle||n);t=function(n){vart,e,o=functions(n){vart,e,o,r,i,u,a,c=Math.max;returnt=n.documentElement,e=n.body,o=c(t.scrollWidth,e.scrollWidth),r=c(t.clientWidth,e.clientWidth),i=c(t.offsetWidth,e.offsetWidth),u=c(t.scrollHeight,e.scrollHeight),a=c(t.clientHeight,e.clientHeight),{width:o<i?r:o,height:u<c(t.offsetHeight,e.offsetHeight)?a:u}}(d);wk(n),n.preventDefault(),u=n.button,t=m,f=n.screenX,l=n.screenY,e=v.window.getComputedStyle?v.window.getComputedStyle(t,null).getPropertyValue("cursor"):t.runtimeStyle.cursor,i=hk("<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),hk(d).on("mousemove touchmove",c).on("mouseup touchend",a),r.start(n)},c=function(n){if(wk(n),n.button!==u)returna(n);n.deltaX=n.screenX-f,n.deltaY=n.screenY-l,n.preventDefault(),r.drag(n)},a=function(n){wk(n),hk(d).off("mousemove touchmove",c).off("mouseup touchend",a),i.remove(),r.stop&&r.stop(n)},this.destroy=function(){hk(m).off()},hk(m).on("mousedown touchstart",t)}functionCk(t){functionu(n,s){c.getOpt(n).each(function(n){vare=l.get(),o=mu(n.element()),r=su(n.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),t={left:a.toString()+"px",top:c.toString()+"px",width:i.toString()+"px",height:u.toString()+"px",position:"absolute"};xr(s,t),f.getOpt(n).each(function(n){xr(n.element(),t)}),d.get().each(function(n){vart=m.get();n.setRect({x:t.x*e+a,y:t.y*e+c,w:t.w*e,h:t.h*e}),n.setClampRect({x:a,y:c,w:i,h:u}),n.setViewPortRect({x:0,y:0,w:o,h:r})})})}functione(n,t){vari=we.fromTag("img");returnPo(i,"src",t),function(e){returnnewNp(function(n){vart=function(){e.removeEventListener("load",t),n(e)};e.complete?n(e):e.addEventListener("load",t)})}(i.dom()).then(function(){returnc.getOpt(n).map(function(n){vart=ru({element:i});mg.replaceAt(n,1,on.some(t));vare=a.get(),o={x:0,y:0,w:i.dom().naturalWidth,h:i.dom().naturalHeight};a.set(o);varr=vk.inflate(o,-20,-20);returnm.set(r),e.w===o.w&&e.h===o.h||function(n,u){c.getOpt(n).each(function(n){vart=mu(n.element()),e=su(n.element()),o=u.dom().naturalWidth,r=u.dom().naturalHeight,i=Math.min(t/o,e/r);1<=i?l.set(1):l.set(i)})}(n,i),u(n,i),i})})}varf=vm({dom:{tag:"div",classes:["tox-image-tools__image-bg"],attributes:{role:"presentation"}}}),l=ye(1),d=ye(on.none()),m=ye({x:0,y:0,w:1,h:1}),a=ye({x:0,y:0,w:1,h:1}),n=Wb.sketch({dom:{tag:"div",classes:["tox-image-tools__image"]},components:[f.asSpec(),{dom:{tag:"img",attributes:{src:t}}},{dom:{tag:"div"},behaviours:ba([Kd("image-panel-crop-events",[Ii(function(n){c.getOpt(n).each(function(n){vart=n.element().dom(),e=Tk({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,function(){});e.toggleVisibility(!1),e.on("updateRect",function(n){vart=n.rect,e=l.get(),o={x:Math.round(t.x/e),y:Math.round(t.y/e),w:Math.round(t.w/e),h:Math.round(t.h/e)};m.set(o)}),d.set(on.some(e))})})])])}],containerBehaviours:ba([mg.config({}),Kd("image-panel-events",[Ii(function(n){e(n,t)})])])}),c=vm(n);return{memContainer:c,updateSrc:e,zoom:function(n,t){vare=l.get(),o=0<t?Math.min(2,e+.1):Math.max(.1,e-.1);l.set(o),c.getOpt(n).each(function(n){vart=n.components()[1].element();u(n,t)})},showCrop:function(){d.get().each(function(n){n.toggleVisibility(!0)})},hideCrop:function(){d.get().each(function(n){n.toggleVisibility(!1)})},getRect:function(){returnm.get()},getMeasurements:function(){varn=a.get();return{width:n.w,height:n.h}}}}functionkk(n,t,e,o,r){returnUC({name:n,icon:on.some(t),disabled:e,tooltip:on.some(n),primary:!1,borderless:!1},o,r)}functionOk(n,t){t?Ch.enable(n):Ch.disable(n)}varEk=0,Tk=function(s,e,f,o,r){varl,t,i,u="tox-",a="tox-crid-"+Ek++,c=[{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"];vard=function(n,t){return{x:t.x+n.x,y:t.y+n.y,w:t.w,h:t.h}},m=function(n,t){return{x:t.x-n.x,y:t.y-n.y,w:t.w,h:t.h}};functiong(n,t,e,o){varr,i,u,a,c;r=t.x,i=t.y,u=t.w,a=t.h,r+=e*n.deltaX,i+=o*n.deltaY,(u+=e*n.deltaW)<20&&(u=20),(a+=o*n.deltaH)<20&&(a=20),c=s=vk.clamp({x:r,y:i,w:u,h:a},f,"move"===n.name),c=m(f,c),l.fire("updateRect",{rect:c}),v(c)}functionp(t){functionn(n,t){t.h<0&&(t.h=0),t.w<0&&(t.w=0),hk("#"+a+"-"+n,o).css({left:t.x,top:t.y,width:t.w,height:t.h})}yk.each(c,function(n){hk("#"+a+"-"+n.name,o).css({left:t.w*n.xMul+t.x,top:t.h*n.yMul+t.y})}),n("top",{x:e.x,y:e.y,w:e.w,h:t.y-e.y}),n("right",{x:t.x+t.w,y:t.y,w:e.w-t.x-t.w+e.x,h:t.h}),n("bottom",{x:e.x,y:t.y+t.h,w:e.w,h:e.h-t.y-t.h+e.y}),n("left",{x:e.x,y:t.y,w:t.x-e.x,h:t.h}),n("move",t)}functionh(n){p(s=n)}functionv(n){h(d(f,n))}returnfunctionb(){hk('<div id="'+a+'" class="'+u+'croprect-container" role="grid" aria-dropeffect="execute">').appendTo(o),yk.each(i,function(n){hk("#"+a,o).append('<div id="'+a+"-"+n+'"class="'+u+'croprect-block" style="display: none" data-mce-bogus="all">')}),yk.each(c,function(n){hk("#"+a,o).append('<div id="'+a+"-"+n.name+'" class="'+u+"croprect-handle "+u+"croprect-handle-"+n.name+'"style="display: none" data-mce-bogus="all" role="gridcell" tabindex="-1" aria-label="'+n.label+'" aria-grabbed="false" title="'+n.label+'">')}),t=yk.map(c,functionn(t){vare;returnnewSk(a,{document:o.ownerDocument,handle:a+"-"+t.name,start:function(){e=s},drag:function(n){g(t,e,n.deltaX,n.deltaY)}})}),p(s),hk(o).on("focusin focusout",function(n){hk(n.target).attr("aria-grabbed","focus"===n.type?"true":"false")}),hk(o).on("keydown",function(t){vari;functionn(n,t,e,o,r){n.stopPropagation(),n.preventDefault(),g(i,e,o,r)}switch(yk.each(c,function(n){if(t.target.id===a+"-"+n.name)returni=n,!1}),t.keyCode){casexk.LEFT:n(t,0,s,-10,0);break;casexk.RIGHT:n(t,0,s,10,0);break;casexk.UP:n(t,0,s,0,-10);break;casexk.DOWN:n(t,0,s,0,10);break;casexk.ENTER:casexk.SPACEBAR:t.preventDefault(),r()}})}(),l=yk.extend({toggleVisibility:functiony(n){vart;t=yk.map(c,function(n){return"#"+a+"-"+n.name}).concat(yk.map(i,function(n){return"#"+a+"-"+n})).join(","),n?hk(t,o).show():hk(t,o).hide()},setClampRect:functionx(n){f=n,p(s)},setRect:h,getInnerRect:function(){returnm(f,s)},setInnerRect:v,setViewPortRect:functionw(n){e=n,p(s)},destroy:functionn(){yk.each(t,function(n){n.destroy()}),t=[]}},bk)};functionBk(n){vart=ye(n),e=ye(on.none()),o=functions(){vare=[],o=-1;functionn(){return0<o}functiont(){return-1!==o&&o<e.length-1}return{data:e,add:functionr(n){vart;returnt=e.splice(++o),e.push(n),{state:n,removed:t}},undo:functioni(){if(n())returne[--o]},redo:functionu(){if(t())returne[++o]},canUndo:n,canRedo:t}}();functionr(n){t.set(n)}functioni(n){v.URL.revokeObjectURL(n.url)}functionu(n){vart=a(n);returnr(t),function(n){yk.each(n,i)}(o.add(t).removed),t.url}o.add(n);vara=function(n){return{blob:n,url:v.URL.createObjectURL(n)}},c=function(){e.get().each(i),e.set(on.none())};return{getBlobState:function(){returnt.get()},setBlobState:r,addBlobState:u,getTempState:function(){returne.get().fold(function(){returnt.get()},function(n){returnn})},updateTempState:function(n){vart=a(n);returnc(),e.set(on.some(t)),t.url},addTempState:function(n){vart=a(n);returne.set(on.some(t)),t.url},applyTempState:function(t){returne.get().fold(function(){},function(n){u(n.blob),t()})},destroyTempState:c,undo:function(){varn=o.undo();returnr(n),n.url},redo:function(){varn=o.redo();returnr(n),n.url},getHistoryStates:function(){return{undoEnabled:o.canUndo(),redoEnabled:o.canRedo()}}}}functionDk(n,t){functioni(n){vart=s.getHistoryStates();m.updateButtonUndoStates(n,t.undoEnabled,t.redoEnabled),ro(n,pk.formActionEvent,{name:pk.saveState(),value:t.undoEnabled})}functionu(n){returnn.toBlob()}functiona(n){ro(n,pk.formActionEvent,{name:pk.disable(),value:{}})}functionr(t,n,e,o,r){returna(t),function(n){returnoC(n)}(n).then(e).then(u).then(o).then(function(n){returnl(t,n).then(function(n){returni(t),r(),f(t),n})})["catch"](function(n){returnv.console.log(n),f(t),n})}functionc(n,t,e){varo=s.getBlobState().blob;r(n,o,t,function(n){returns.updateTempState(n)},e)}vars=Bk(n.currentState),f=function(n){e.getApplyButton(n).each(function(n){Ch.enable(n)}),ro(n,pk.formActionEvent,{name:pk.enable(),value:{}})},l=function(n,t){returna(n),o.updateSrc(n,t)},d=function(n){vart=s.getBlobState().url;returns.destroyTempState(),i(n),t},o=Ck(n.currentState.url),m=function(n){varo=vm(kk("Undo","undo",!0,function(n){ro(n,lk.undo(),{direction:1})},n)),r=vm(kk("Redo","redo",!0,function(n){ro(n,lk.redo(),{direction:1})},n));return{container:Wb.sketch({dom:{tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools__sidebar"]},components:[o.asSpec(),r.asSpec(),kk("Zoom in","zoom-in",!1,function(n){ro(n,lk.zoom(),{direction:1})},n),kk("Zoom out","zoom-out",!1,function(n){ro(n,lk.zoom(),{direction:-1})},n)]}),updateButtonUndoStates:function(n,t,e){o.getOpt(n).each(function(n){Ok(n,t)}),r.getOpt(n).each(function(n){Ok(n,e)})}}}(t),e=tk(o,t);return{dom:{tag:"div",attributes:{role:"presentation"}},components:[e.memContainer.asSpec(),o.memContainer.asSpec(),m.container],behaviours:ba([Zf.config({store:{mode:"manual",getValue:function(){returns.getBlobState()}}}),Kd("image-tools-events",[lo(lk.undo(),function(t,n){vare=s.undo();l(t,e).then(function(n){f(t),i(t)})}),lo(lk.redo(),function(t,n){vare=s.redo();l(t,e).then(function(n){f(t),i(t)})}),lo(lk.zoom(),function(n,t){vare=t.event().direction();o.zoom(n,e)}),lo(lk.back(),function(n,t){!function(t){varn=d(t);l(t,n).then(function(n){f(t)})}(n),t.event().swap()(),o.hideCrop()}),lo(lk.apply(),function(n,t){s.applyTempState(function(){d(n),t.event().swap()()})}),lo(lk.transform(),function(n,t){returnc(n,t.event().transform(),Z)}),lo(lk.tempTransform(),function(n,t){returnfunction(n,t){vare=s.getTempState().blob;r(n,e,t,function(n){returns.addTempState(n)},Z)}(n,t.event().transform())}),lo(lk.transformApply(),function(n,t){returnfunction(e,n,t){varo=s.getBlobState().blob;r(e,o,n,function(n){vart=s.addBlobState(n);returnd(e),t},t)}(n,t.event().transform(),t.event().swap())}),lo(lk.swap(),function(t,n){!function(n){m.updateButtonUndoStates(n,!1,!1)}(t);vare=n.event().transform(),o=n.event().swap();e.fold(function(){o()},function(n){c(t,n,o)})})]),xS()])}}functionAk(e,t){varn=e.label.map(function(n){returnDy(n,t)}),o=[Ch.config({disabled:e.disabled}),lg.config({mode:"execution",useEnter:!0!==e.multiline,useControlEnter:!0===e.multiline,execute:function(n){returnoo(n,fy),on.some(!0)}}),Kd("textfield-change",[lo(ei(),function(n,t){ro(n,uy,{name:e.name})}),lo(fi(),function(n,t){ro(n,uy,{name:e.name})})]),Gy.config({})],r=e.validation.map(function(o){returnjy.config({getRoot:function(n){returnEo(n.element())},invalidClass:"tox-invalid",validator:{validate:function(n){vart=Zf.getValue(n),e=o.validator(t);returnNy(!0===e?an.value(t):an.error(e))},validateOnLoad:o.validateOnLoad}})}).toArray(),i=e.placeholder.fold(nn({}),function(n){return{placeholder:t.translate(n)}}),u=e.inputMode.fold(nn({}),function(n){return{inputmode:n}}),a=N(N({},i),u),c=vy.parts().field({tag:!0===e.multiline?"textarea":"input",inputAttributes:a,inputClasses:[e.classname],inputBehaviours:ba(H([o,r])),selectOnFocus:!1,factory:yy}),s=(e.flex?["tox-form__group--stretched"]:[]).concat(e.maximized?["tox-form-group--maximize"]:[]),f=[Ch.config({disabled:e.disabled,onDisabled:function(n){vy.getField(n).each(Ch.disable)},onEnabled:function(n){vy.getField(n).each(Ch.enable)}})];returnBy(n,c,s,f)}function_k(n){vart=ye(null);returnnu({readState:function(){return{timer:null!==t.get()?"set":"unset"}},setTimer:function(n){t.set(n)},cancel:function(){varn=t.get();null!==n&&n.cancel()}})}functionMk(n,t,e){varo=Zf.getValue(e);Zf.setValue(t,o),CE(t)}functionFk(n,t){vare=n.element(),o=Er(e),r=e.dom();"number"!==zo(e,"type")&&t(r,o)}functionIk(n,t,e){if(n.selectsOver){varo=Zf.getValue(t),r=n.getDisplayText(o),i=Zf.getValue(e);return0===n.getDisplayText(i).indexOf(r)?on.some(function(){Mk(0,t,e),function(n,e){Fk(n,function(n,t){returnn.setSelectionRange(e,t.length)})}(t,r.length)}):on.none()}returnon.none()}functionRk(n){returnBE(Vy(n))}functionVk(n){return{type:"menuitem",value:n.url,text:n.title,meta:{attach:n.attach},onAction:function(){}}}functionNk(n,t){return{type:"menuitem",value:t,text:n,meta:{attach:undefined},onAction:function(){}}}functionHk(n,t){returnfunction(n){returnS(n,Vk)}(function(t,n){returnC(n,function(n){returnn.type===t})}(n,t))}functionPk(n,t){vare=n.toLowerCase();returnC(t,function(n){vart=n.meta!==undefined&&n.meta.text!==undefined?n.meta.text:n.text;returnVt(t.toLowerCase(),e)||Vt(n.value.toLowerCase(),e)})}functionzk(e,n,o){vart=Zf.getValue(n),r=t.meta.text!==undefined?t.meta.text:t.value;returno.getLinkInformation().fold(function(){return[]},function(n){vart=Pk(r,function(n){returnS(n,function(n){returnNk(n,n)})}(o.getHistory(e)));return"file"===e?function(n){returnO(n,function(n,t){return0===n.length||0===t.length?n.concat(t):n.concat(AE,t)},[])}([t,Pk(r,function(n){returnHk("header",n.targets)}(n)),Pk(r,H([function(n){returnon.from(n.anchorTop).map(function(n){returnNk("<top>",n)}).toArray()}(n),function(n){returnHk("anchor",n.targets)}(n),function(n){returnon.from(n.anchorBottom).map(function(n){returnNk("<bottom>",n)}).toArray()}(n)]))]):t})}functionLk(r,o,i){functionu(n){vart=Zf.getValue(n);i.addToHistory(t.value,r.filetype)}varn,t,e,a,c,s=o.shared.providers,f=vy.parts().field({factory:TE,dismissOnBlur:!0,inputClasses:["tox-textfield"],sandboxClasses:["tox-dialog__popups"],inputAttributes:{"aria-errormessage":_E,type:"url"},minChars:0,responseTime:0,fetch:function(n){vart=zk(r.filetype,n,i),e=NC(t,Fh.BUBBLE_TO_SANDBOX,o,!1);returnNy(e)},getHotspot:function(n){returnh.getOpt(n)},onSetValue:function(n,t){n.hasConfigured(jy)&&jy.run(n).get(Z)},typeaheadBehaviours:ba(H([i.getValidationHandler().map(function(e){returnjy.config({getRoot:function(n){returnEo(n.element())},invalidClass:"tox-control-wrap--status-invalid",notify:{onInvalid:function(n,t){d.getOpt(n).each(function(n){Po(n.element(),"title",s.translate(t))})}},validator:{validate:function(n){vart=Zf.getValue(n);returnDE(function(o){e({type:r.filetype,url:t.value},function(n){if("invalid"===n.status){vart=an.error(n.message);o(t)}else{vare=an.value(n.message);o(e)}})})},validateOnLoad:!1}})}).toArray(),[Ch.config({disabled:r.disabled}),Gy.config({}),Kd("urlinput-events",H(["file"===r.filetype?[lo(ei(),function(n){ro(n,uy,{name:r.name})})]:[],[lo(oi(),function(n){ro(n,uy,{name:r.name}),u(n)}),lo(fi(),function(n){ro(n,uy,{name:r.name}),u(n)})]]))]])),eventOrder:(n={},n[ei()]=["streaming","urlinput-events","invalidating"],n),model:{getDisplayText:function(n){returnn.value},selectsOver:!1,populateFromBrowse:!1},markers:{openClass:"tox-textfield--popup-open"},lazySink:o.shared.getSink,parts:{menu:Sv(0,0,"normal")},onExecute:function(n,t,e){ro(t,fy,{})},onItemExecute:function(n,t,e,o){u(n),ro(n,uy,{name:r.name})}}),l=r.label.map(function(n){returnDy(n,s)}),d=vm((t="invalid",e=on.some(_E),void0===(a="warning")&&(a=t),void0===c&&(c=t),{dom:{tag:"div",classes:["tox-icon","tox-control-wrap__status-icon-"+t],innerHtml:ym(a,s.icons),attributes:N({title:s.translate(c),"aria-live":"polite"},e.fold(function(){return{}},function(n){return{id:n}}))}})),m=vm({dom:{tag:"div",classes:["tox-control-wrap__status-icon-wrap"]},components:[d.asSpec()]}),g=i.getUrlPicker(r.filetype),p=Xo("browser.url.event"),h=vm({dom:{tag:"div",classes:["tox-control-wrap"]},components:[f,m.asSpec()],behaviours:ba([Ch.config({disabled:r.disabled})])}),v=vm(GC({name:r.name,icon:on.some("browse"),text:r.label.getOr(""),disabled:r.disabled,primary:!1,borderless:!0},function(n){returnoo(n,p)},s,[],["tox-browse-url"]));returnvy.sketch({dom:Yy([]),components:l.toArray().concat([{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:H([[h.asSpec()],g.map(function(){returnv.asSpec()}).toArray()])}]),fieldBehaviours:ba([Ch.config({disabled:r.disabled,onDisabled:function(n){vy.getField(n).each(Ch.disable),v.getOpt(n).each(Ch.disable)},onEnabled:function(n){vy.getField(n).each(Ch.enable),v.getOpt(n).each(Ch.enable)}}),Kd("url-input-events",[lo(p,function(o){Zl.getCurrent(o).each(function(t){vare=Zf.getValue(t);g.each(function(n){n(e).get(function(n){Zf.setValue(t,n),ro(o,uy,{name:r.name})})})})})])])})}functionjk(u,t){functionn(o){returnfunction(t,e){Ou(e.event().target(),"[data-collection-item-value]").each(function(n){o(t,e,n,zo(n,"data-collection-item-value"))})}}vare=u.label.map(function(n){returnDy(n,t)}),o=n(function(n,t,e,o){t.stop(),ro(n,sy,{name:u.name,value:o})}),r=[lo($r(),n(function(n,t,e){wa(e)})),lo(ri(),o),lo(gi(),o),lo(Qr(),n(function(n,t,e){ku(n.element(),"."+mh).each(function(n){dr(n,mh)}),fr(e,mh)})),lo(Zr(),n(function(n){ku(n.element(),"."+mh).each(function(n){dr(n,mh)})})),Ni(n(function(n,t,e,o){ro(n,sy,{name:u.name,value:o})}))],i=vy.parts().field({dom:{tag:"div",classes:["tox-collection"].concat(1!==u.columns?["tox-collection--grid"]:["tox-collection--list"])},components:[],factory:{sketch:l},behaviours:ba([mg.config({}),Zf.config({store:{mode:"memory",initialValue:[]},onSetValue:function(o,n){!function(n,t){vare=S(t,function(n){vart=rh.translate(n.text),e=1===u.columns?'<div class="tox-collection__item-label">'+t+"</div>":"",o='<div class="tox-collection__item-icon">'+n.icon+"</div>",r={_:" "," - ":" ","-":" "},i=t.replace(/\_| \- |\-/g,function(n){returnr[n]});return'<div class="tox-collection__item" tabindex="-1" data-collection-item-value="'+function(n){return'"'===n?""":n}(n.value)+'" title="'+i+'" aria-label="'+i+'">'+o+e+"</div>"}),o=1<u.columns&&"auto"!==u.columns?w(e,u.columns):[e],r=S(o,function(n){return'<div class="tox-collection__group">'+n.join("")+"</div>"});No(n.element(),r.join(""))}(o,n),"auto"===u.columns&&ip(o,5,"tox-collection__item").each(function(n){vart=n.numRows,e=n.numColumns;lg.setGridSize(o,t,e)}),oo(o,gy)}}),Gy.config({}),lg.config(function(n,t){return1===n?{mode:"menu",moveOnTab:!1,selector:".tox-collection__item"}:"auto"===n?{mode:"flatgrid",selector:".tox-collection__item",initSize:{numColumns:1,numRows:1}}:{mode:"matrix",selectors:{row:"color"===t?".tox-swatches__row":".tox-collection__group",cell:"color"===t?"."+ah:"."+uh}}}(u.columns,"normal")),Kd("collection-events",r)])});returnBy(e,i,["tox-form__group--collection"],[])}functionUk(r){returnfunction(t,e,o){returnNn(e,"name").fold(function(){returnr(e,o)},function(n){returnt.field(n,r(e,o))})}}functionWk(t,n,e){varo=Dn(e,{shared:{interpreter:function(n){returnIE(t,n,o)}}});returnIE(t,n,o)}functionGk(n){return{colorPicker:function(e){returnfunction(n,t){Uv.colorPickerDialog(e)(n,t)}}(n),hasCustomColors:function(n){returnfunction(){returnFv(n)}}(n),getColors:function(n){returnfunction(){returnIv(n)}}(n),getColorCols:function(n){returnfunction(){returnUv.getColorCols(n)}}(n)}}functionXk(e){returnfunction(n){returnon.from(n.getParam("style_formats")).filter(fn)}(e).map(function(n){vart=function(t,n){functione(n){bn(n,function(n){t.formatter.has(n.name)||t.formatter.register(n.name,n.format)})}varo=PE(n);returnt.formatter?e(o.customFormats):t.on("init",function(){e(o.customFormats)}),o.formats}(e,n);returnfunction(n){returnn.getParam("style_formats_merge",!1,"boolean")}(e)?HE.concat(t):t}).getOr(HE)}functionYk(n,t,e){varo={type:"formatter",isSelected:t(n.format),getStylePreview:e(n.format)};returnDn(n,o)}functionqk(r,n,i,u){varo=function(n){returnS(n,function(n){vart=wn(n);if($(n,"items")){vare=o(n.items);returnDn(function(n){vart={type:"submenu",isSelected:nn(!1),getStylePreview:function(){returnon.none()}};returnDn(n,t)}(n),{getStyleItems:function(){returne}})}return$(n,"format")?function(n){returnYk(n,i,u)}(n):1===t.length&&vn(t,"title")?Dn(n,{type:"separator"}):function(n){vart=Xo(n.title),e={type:"formatter",format:t,isSelected:i(t),getStylePreview:u(t)},o=Dn(n,e);returnr.formatter.register(t,o),o}(n)})};returno(n)}functionKk(t){returnfunction(n){if(n&&1===n.nodeType){if(n.contentEditable===t)return!0;if(n.getAttribute("data-mce-contenteditable")===t)return!0}return!1}}functionJk(n,t,e,o,r){return{type:n,title:t,url:e,level:o,attach:r}}function$k(n){returnn.innerText||n.textContent}functionQk(n){returnfunction(n){returnn&&"A"===n.nodeName&&(n.id||n.name)!==undefined}(n)&&UE(n)}functionZk(n){returnn&&/^(H[1-6])$/.test(n.nodeName)}functionnO(n){returnZk(n)&&UE(n)}functiontO(n){vart=function(n){returnn.id?n.id:Xo("h")}(n);returnJk("header",$k(n),"#"+t,function(n){returnZk(n)?parseInt(n.nodeName.substr(1),10):0}(n),function(){n.id=t})}functioneO(n){vart=n.id||n.name,e=$k(n);returnJk("anchor",e||"#"+t,"#"+t,0,Z)}functionoO(n){returnfunction(n,t){returnS(zc(we.fromDom(t),n),function(n){returnn.dom()})}("h1,h2,h3,h4,h5,h6,a:not([href])",n)}functionrO(n){return0<zE(n.title).length}functioniO(n){returncn(n)&&/^https?/.test(n)}functionuO(n){returnsn(n)&&I(n,function(n){return!function(n){returnfn(n)&&n.length<=5&&D(n,iO)}(n)}).isNone()}functionaO(){varn,t=v.localStorage.getItem(GE);if(null===t)return{};try{n=JSON.parse(t)}catch(e){if(einstanceofSyntaxError)returnv.console.log("Local storage "+GE+" was not valid JSON",e),{};throwe}returnuO(n)?n:(v.console.log("Local storage "+GE+" was not valid format",n),{})}functioncO(n){vart=aO();returnObject.prototype.hasOwnProperty.call(t,n)?t[n]:[]}functionsO(t,n){if(iO(t)){vare=aO(),o=Object.prototype.hasOwnProperty.call(e,n)?e[n]:[],r=C(o,function(n){returnn!==t});e[n]=[t].concat(r).slice(0,5),function(n){if(!uO(n))thrownewError("Bad format for history:\n"+JSON.stringify(n));v.localStorage.setItem(GE,JSON.stringify(n))}(e)}}functionfO(n){return!!n}functionlO(n){returnP(yk.makeMap(n,/[, ]/),fO)}functiondO(n,t,e){varo=function(n,t){returnXE.call(n,t)?on.some(n[t]):on.none()}(n,t).getOr(e);returncn(o)?on.some(o):on.none()}functionmO(n){returnon.some(n.file_picker_callback).filter(dn)}functiongO(n,t){vare=function(n){vart=on.some(n.file_picker_types).filter(fO),e=on.some(n.file_browser_callback_types).filter(fO),o=t.or(e).map(lO);returnmO(n).fold(function(){return!1},function(n){returno.fold(function(){return!0},function(n){return0<wn(n).length&&n})})}(n);returnln(e)?e?mO(n):on.none():e[t]?mO(n):on.none()}functionpO(t){return{getHistory:cO,addToHistory:sO,getLinkInformation:function(){returnfunction(n){return!1===n.settings.typeahead_urls?on.none():on.some({targets:WE(n.getBody()),anchorTop:dO(n.settings,"anchor_top","#top").getOrUndefined(),anchorBottom:dO(n.settings,"anchor_bottom","#bottom").getOrUndefined()})}(t)},getValidationHandler:function(){returnfunction(n){returnon.from(n.settings.file_picker_validator_handler).filter(dn).orThunk(function(){returnon.from(n.settings.filepicker_validator_handler).filter(dn)})}(t)},getUrlPicker:function(n){returnfunction(r,i){returngO(r.settings,i).map(function(o){returnfunction(t){returnVy(function(e){varn=yk.extend({filetype:i},on.from(t.meta).getOr({}));o.call(r,function(n,t){if(!cn(n))thrownewError("Expected value to be string");if(t!==undefined&&!sn(t))thrownewError("Expected meta to be a object");e({value:n,meta:t})},t.value,n)})}})}(t,n)}}}functionhO(n,t,e,o){varr=ye(!1),i={shared:{providers:{icons:function(){returnt.ui.registry.getAll().icons},menuItems:function(){returnt.ui.registry.getAll().menuItems},translate:rh.translate},interpreter:function(n){returnfunction(n,t){returnIE(FE,n,t)}(n,i)},anchors:NE(t,e,o),getSink:function(){returnan.value(n)}},urlinput:pO(t),styleselect:function(e){functiono(n){returnfunction(){returne.formatter.match(n)}}functionr(t){returnfunction(){varn=e.formatter.get(t);returnn!==undefined?on.some({tag:0<n.length&&(n[0].inline||n[0].block)||"div",styleAttr:e.formatter.getCssText(t)}):on.none()}}vari=function(n){vart=n.items;returnt!==undefined&&0<t.length?B(t,i):[n.format]},u=ye([]),a=ye([]),c=ye([]),s=ye([]),f=ye(!1);e.on("init",function(){varn=Xk(e),t=qk(e,n,o,r);u.set(t),a.set(B(t,i))}),e.on("addStyleModifications",function(n){vart=qk(e,n.items,o,r);c.set(t),f.set(n.replace),s.set(B(t,i))});return{getData:function(){varn=f.get()?[]:u.get(),t=c.get();returnn.concat(t)},getFlattenedKeys:function(){varn=f.get()?[]:a.get(),t=s.get();returnn.concat(t)}}}(t),colorinput:Gk(t),dialog:function(n){return{isDraggableModal:function(n){returnfunction(){returnfunction(n){returnn.getParam("draggable_modal",!1,"boolean")}(n)}}(n)}}(t),isContextMenuOpen:function(){returnr.get()},setContextMenuState:function(n){returnr.set(n)}};returni}functionvO(n,t,o){vare=function(n,e){returnO(n,function(t,n){returne(n,t.len).fold(nn(t),function(n){return{len:n.finish(),list:t.list.concat([n])}})},{len:0,list:[]}).list}(n,function(n,t){vare=o(n);returnon.some({element:nn(n),start:nn(t),finish:nn(t+e),width:nn(e)})}),r=C(e,function(n){returnn.finish()<=t}),i=k(r,function(n,t){returnn+t.width()},0),u=e.slice(r.length);return{within:nn(r),extra:nn(u),withinWidth:nn(i)}}functionbO(n){returnS(n,function(n){returnn.element()})}functionyO(n,t,e,o){varr=function(n,t,e){varo=vO(t,n,e);return0===o.extra().length?on.some(o):on.none()}(n,t,e).getOrThunk(function(){returnvO(t,n-e(o),e)}),i=r.within(),u=r.extra(),a=r.withinWidth();return1===u.length&&u[0].width()<=e(o)?function(n,t,e){varo=bO(n.concat(t));return$E(o,[],e)}(i,u,a):1<=u.length?function(n,t,e,o){varr=bO(n).concat([e]);return$E(r,bO(t),o)}(i,u,o,a):function(n,t,e){return$E(bO(n),[],e)}(i,0,a)}functionxO(n,t){vare=S(t,function(n){returnau(n)});JE.setGroups(n,e)}functionwO(n,t,e,o){varr=Ks(n,t,"primary"),i=qs(n,t,"overflow-button"),u=Jy.getCoupled(n,"overflowGroup");yr(r.element(),"visibility","hidden");vara=function(n,t){returnn.bind(function(t){returnCa(t.element()).bind(function(n){returnt.getSystem().getByDom(n).toOption()})}).orThunk(function(){returnt.filter(vg.isFocused)})}(e,i);e.each(function(n){JE.setGroups(n,[])});varc=t.builtGroups.get();xO(r,c.concat([u]));vars=mu(r.element()),f=yO(s,c,function(n){returnmu(n.element())},u);0===f.extra().length?(mg.remove(r,u),e.each(function(n){JE.setGroups(n,[])})):(xO(r,f.within()),e.each(function(n){xO(n,f.extra())})),kr(r.element(),"visibility"),Or(r.element()),e.each(function(t){i.each(function(n){returnCg.set(n,o(t))}),a.each(vg.focus)})}functionSO(o,n,t,e,r){vari="alloy.toolbar.toggle";return{uid:o.uid,dom:o.dom,components:n,behaviours:Rs(o.splitToolbarBehaviours,[Jy.config({others:N(N({},r.coupling),{overflowGroup:function(t){returnnT.sketch(N(N({},e["overflow-group"]()),{items:[Gg.sketch(N(N({},e["overflow-button"]()),{action:function(n){oo(t,i)}}))]}))}})}),Kd("toolbar-toggle-events",[lo(i,function(n){r.apis.toggle(n)})])]),apis:N({setGroups:function(n,t){!function(n,t){vare=S(t,n.getSystem().build);o.builtGroups.set(e)}(n,t),r.apis.refresh(n)},getMoreButton:function(n){returnfunction(n){returnqs(n,o,"overflow-button")}(n)}},r.apis),domModification:{attributes:{role:"group"}}}}functionCO(n){returnn.getSystem().isConnected()}functionkO(n,t,e){varo=t.lazySink(n).getOrDie(),r=t.getAnchor(n),i=t.getOverflowBounds.map(function(n){returnn()});Af.positionWithinBounds(o,r,e,i)}functionOO(t,e){varn=zf.getState(Jy.getCoupled(t,"sandbox"));wO(t,e,n,CO),n.each(function(n){returnkO(t,e,n)})}functionEO(t,e){zf.getState(Jy.getCoupled(t,"sandbox")).each(function(n){returnkO(t,e,n)})}functionTO(t,n){returnn.getAnimationRoot.fold(function(){returnt.element()},function(n){returnn(t)})}functionBO(n){returnn.dimension.property}functionDO(n,t){returnn.dimension.getDimension(t)}functionAO(n,t){vare=TO(n,t);pr(e,[t.shrinkingClass,t.growingClass])}function_O(n,t){dr(n.element(),t.openClass),fr(n.element(),t.closedClass),yr(n.element(),BO(t),"0px"),Or(n.element())}functionMO(n,t){dr(n.element(),t.closedClass),fr(n.element(),t.openClass),kr(n.element(),BO(t))}functionFO(n,t,e,o){e.setCollapsed(),yr(n.element(),BO(t),DO(t,n.element())),Or(n.element()),AO(n,t),_O(n,t),t.onStartShrink(n),t.onShrunk(n)}functionIO(n,t,e,o){varr=o.getOrThunk(function(){returnDO(t,n.element())});e.setCollapsed(),yr(n.element(),BO(t),r),Or(n.element());vari=TO(n,t);dr(i,t.growingClass),fr(i,t.shrinkingClass),_O(n,t),t.onStartShrink(n)}functionRO(n,t,e){varo=DO(t,n.element());("0px"===o?FO:IO)(n,t,e,on.some(o))}functionVO(n,t,e){varo=TO(n,t),r=mr(o,t.shrinkingClass),i=DO(t,n.element());MO(n,t);varu=DO(t,n.element());(r?function(){yr(n.element(),BO(t),i),Or(n.element())}:function(){_O(n,t)})(),dr(o,t.shrinkingClass),fr(o,t.growingClass),MO(n,t),yr(n.element(),BO(t),u),e.setExpanded(),t.onStartGrow(n)}functionNO(n,t,e){varo=TO(n,t);return!0===mr(o,t.growingClass)}functionHO(n,t,e){varo=TO(n,t);return!0===mr(o,t.shrinkingClass)}functionPO(n){returncT.hasGrown(n)}functionzO(n,t){vare=n.outerContainer;!function(n,t){vare=n.outerContainer.element();t&&(n.mothership.broadcastOn([Lf()],{target:e}),n.uiMothership.broadcastOn([Lf()],{target:e})),n.mothership.broadcastOn([gT],{readonly:t}),n.uiMothership.broadcastOn([gT],{readonly:t})}(n,t),Lt("*",e.element()).forEach(function(n){e.getSystem().getByDom(n).each(function(n){n.hasConfigured(Ch)&&Ch.set(n,t)})})}functionLO(n,t){n.on("init",function(){n.readonly&&zO(t,!0)}),n.on("SwitchMode",function(){returnzO(t,n.readonly)}),function(n){returnn.getParam("readonly",!1,"boolean")}(n)&&n.setMode("readonly")}functionjO(e){varn;returnlc.config({channels:(n={},n[gT]={schema:pT,onReceive:function(n,t){e(n).each(function(n){!function(t,e){Lt("*",t.element()).forEach(function(n){t.getSystem().getByDom(n).each(function(n){n.hasConfigured(Ch)&&Ch.set(n,e)})})}(n,t.readonly)})}},n)})}functionUO(n){vart=n.title.fold(function(){return{}},function(n){return{attributes:{title:n}}});return{dom:N({tag:"div",classes:["tox-toolbar__group"]},t),components:[nT.parts().items({})],items:n.items,markers:{itemSelector:"*:not(.tox-split-button) > .tox-tbtn:not([disabled]), .tox-split-button:not([disabled]), .tox-toolbar-nav-js:not([disabled])"},tgroupBehaviours:ba([Gy.config({}),vg.config({})])}}functionWO(n){returnnT.sketch(UO(n))}functionGO(e,n,t){varo=Ii(function(n){vart=S(e.initGroups,WO);JE.setGroups(n,t)});returnba([lg.config({mode:n,onEscape:e.onEscape,selector:".tox-toolbar__group"}),Kd("toolbar-events",[o]),jO(t)])}functionXO(n,t){vare=n.cyclicKeying?"cyclic":"acyclic";return{uid:n.uid,dom:{tag:"div",classes:["tox-toolbar-overlord"]},parts:{"overflow-group":UO({title:on.none(),items:[]}),"overflow-button":jC({name:"more",icon:on.some("more-drawer"),disabled:!1,tooltip:on.some("More..."),primary:!1,borderless:!1},on.none(),n.backstage.shared.providers)},splitToolbarBehaviours:GO(n,e,t)}}functionYO(r){varn=XO(r,rT.getOverflow),t=rT.parts().primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}});returnrT.sketch(N(N({},n),{lazySink:r.getSink,getAnchor:function(){returnr.backstage.shared.anchors.toolbarOverflow()},getOverflowBounds:function(){varn=r.moreDrawerData.lazyHeader().element(),t=wu(n),e=ko(n),o=wu(e);returnyu(t.x()+4,o.y(),t.width()-8,o.height())},parts:N(N({},n.parts),{overflow:{dom:{tag:"div",classes:["tox-toolbar__overflow"]}}}),components:[t],markers:{overflowToggledClass:"tox-tbtn--enabled"}}))}functionqO(n){vart=dT.parts().primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}}),e=dT.parts().overflow({dom:{tag:"div",classes:["tox-toolbar__overflow"]}}),o=XO(n,dT.getOverflow);returndT.sketch(N(N({},o),{components:[t,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"},onOpened:function(n){n.getSystem().broadcastOn([mT()],{type:"opened"})},onClosed:function(n){n.getSystem().broadcastOn([mT()],{type:"closed"})}}))}functionKO(n){vart=n.cyclicKeying?"cyclic":"acyclic";returnJE.sketch({uid:n.uid,dom:{tag:"div",classes:["tox-toolbar"].concat(n.type===jb.scrolling?["tox-toolbar--scrolling"]:[])},components:[JE.parts().groups({})],toolbarBehaviours:GO(n,t,nn(on.none()))})}functionJO(n){returntt("toolbarbutton",vT,n)}function$O(n){returntt("menubutton",yT,n)}functionQO(n){returntt("ToggleButton",ST,n)}functionZO(t){return{isDisabled:function(){returnCh.isDisabled(t)},setDisabled:function(n){returnCh.set(t,n)}}}functionnE(t){return{setActive:function(n){Cg.set(t,n)},isActive:function(){returnCg.isOn(t)},isDisabled:function(){returnCh.isDisabled(t)},setDisabled:function(n){returnCh.set(t,n)}}}functiontE(n,t){returnn.map(function(n){return{"aria-label":t.translate(n),title:t.translate(n)}}).getOr({})}functioneE(t,e,n,o,r,i){functionu(n){returnrh.isRtl()&&vn(jT,n)?n+"-rtl":n}vara,c=rh.isRtl()&&t.exists(function(n){returnvn(UT,n)});return{dom:{tag:"button",classes:["tox-tbtn"].concat(e.isSome()?["tox-tbtn--select"]:[]).concat(c?["tox-tbtn__icon-rtl"]:[]),attributes:tE(n,i)},components:Bh([t.map(function(n){returnAC(u(n),i.icons)}),e.map(function(n){returnMC(n,"tox-tbtn",i)})]),eventOrder:(a={},a[Yr()]=["focusing","alloy.base.behaviour","common-button-display-events"],a),buttonBehaviours:ba([Kd("common-button-display-events",[lo(Yr(),function(n,t){t.event().prevent(),oo(n,LT)})])].concat(o.map(function(n){returnRT.config({channel:n,initialData:{icon:t,text:e},renderComponents:function(n,t){returnBh([n.icon.map(function(n){returnAC(u(n),i.icons)}),n.text.map(function(n){returnMC(n,"tox-tbtn",i)})])}})}).toArray()).concat(r.getOr([])))}}functionoE(n,t,e){varo=ye(Z),r=eE(n.icon,n.text,n.tooltip,on.none(),on.none(),e);returnGg.sketch({dom:r.dom,components:r.components,eventOrder:ok,buttonBehaviours:ba([Kd("toolbar-button-events",[function(e){returnNi(function(t,n){Op(e,t)(function(n){ro(t,ek,{buttonApi:n}),e.onAction(n)})})}({onAction:n.onAction,getApi:t.getApi}),Ep(t,o),Tp(t,o)]),Th(n.disabled)].concat(t.toolbarButtonBehaviours))})}functionrE(t,n){functione(e){return{isDisabled:function(){returnCh.isDisabled(e)},setDisabled:function(n){returnCh.set(e,n)},setIconFill:function(n,t){ku(e.element(),'svg path[id="'+n+'"], rect[id="'+n+'"]').each(function(n){Po(n,"fill",t)})},setIconStroke:function(n,t){ku(e.element(),'svg path[id="'+n+'"], rect[id="'+n+'"]').each(function(n){Po(n,"stroke",t)})},setActive:function(t){Po(e.element(),"aria-pressed",t),ku(e.element(),"span").each(function(n){e.getSystem().getByDom(n).each(function(n){returnCg.set(n,t)})})},isActive:function(){returnku(e.element(),"span").exists(function(n){returne.getSystem().getByDom(n).exists(Cg.isOn)})}}}varo,r=Xo("channel-update-split-dropdown-display"),i=ye(Z),u={getApi:e,onSetup:t.onSetup};returnzT.sketch({dom:{tag:"div",classes:["tox-split-button"],attributes:An({"aria-pressed":!1},tE(t.tooltip,n.providers))},onExecute:function(n){t.onAction(e(n))},onItemExecute:function(n,t,e){},splitDropdownBehaviours:ba([Eh(!1),Kd("split-dropdown-events",[lo(LT,vg.focus),Ep(u,i),Tp(u,i)]),Ew.config({})]),eventOrder:(o={},o[Ci()]=["alloy.base.behaviour","split-dropdown-events"],o),toggleClass:"tox-tbtn--enabled",lazySink:n.getSink,fetch:function(e,r,o){returnfunction(t){returnVy(function(n){returnr.fetch(n)}).map(function(n){returnon.from(ub(Dn(Tv(Xo("menu-value"),n,function(n){r.onItemAction(e(t),n)},r.columns,r.presets,Fh.CLOSE_ON_EXECUTE,r.select.getOr(function(){return!1}),o),{movement:Bv(r.columns,r.presets),menuBehaviours:Jp("auto"!==r.columns?[]:[Ii(function(o,n){ip(o,4,sp(r.presets)).each(function(n){vart=n.numRows,e=n.numColumns;lg.setGridSize(o,t,e)})})])})))})}}(e,t,n.providers),parts:{menu:Sv(0,t.columns,t.presets)},components:[zT.parts().button(eE(t.icon,t.text,on.none(),on.some(r),on.some([Cg.config({toggleClass:"tox-tbtn--enabled",toggleOnExecute:!1})]),n.providers)),zT.parts().arrow({dom:{tag:"button",classes:["tox-tbtn","tox-split-button__chevron"],innerHtml:ym("chevron-down",n.providers.icons)}}),zT.parts()["aria-descriptor"]({text:n.providers.translate("To open the popup, press Shift+Enter")})]})}functioniE(o,r){returnlo(ek,function(n,t){vare=function(n){return{hide:function(){returnoo(n,hi())},getValue:function(){returnZf.getValue(n)}}}(o.get(n));r.onAction(e,t.event().buttonApi())})}functionuE(n,t,e){varo={backstage:{shared:{providers:e}}};return"contextformtogglebutton"===t.type?function(n,t,e){varo=t.original,r=(o.primary,c(o,["primary"])),i=et(QO(N(N({},r),{type:"togglebutton",onAction:function(){}})));returnGT(i,e.backstage.shared.providers,[iE(n,t)])}(n,t,o):function(n,t,e){varo=t.original,r=(o.primary,c(o,["primary"])),i=et(JO(N(N({},r),{type:"button",onAction:function(){}})));returnWT(i,e.backstage.shared.providers,[iE(n,t)])}(n,t,o)}functionaE(n,t){vare=Math.max(t.x(),n.x()),o=n.right()-e,r=t.width()-(e-t.x());return{x:e,width:Math.min(o,r)}}functioncE(n){vart=Pb(n)||zb(n)||Xb(n),e=vu(v.window),o=xu(we.fromDom(n.getContentAreaContainer()));returnn.inline&&!t?function(n,t,e){varo=aE(t,e),r=o.x,i=o.width;returnyu(r,e.y(),i,e.height())}(0,o,e):n.inline?function(n,t,e){varo=aE(t,e),r=o.x,i=o.width,u=we.fromDom(n.getContainer()),a=ku(u,".tox-editor-header").getOr(u),c=xu(a),s=e.height(),f=e.y();if(c.y()>=t.bottom()){varl=Math.min(s+f,c.y());returnyu(r,f,i,l-f)}vard=Math.max(f,c.bottom());returnyu(r,d,i,s-(d-f))}(n,o,e):function(n,t,e){varo=aE(t,e),r=o.x,i=o.width,u=we.fromDom(n.getContainer()),a=ku(u,".tox-editor-header").getOr(u),c=xu(u),s=xu(a),f=Math.max(e.y(),t.y(),s.bottom()),l=c.bottom()-f,d=e.height()-(f-e.y()),m=Math.min(l,d);returnyu(r,f,i,m)}(n,o,e)}functionsE(t,n){returnDu(n,function(n){returnn.predicate(t.dom())?on.some({toolbarApi:n,elem:t}):on.none()})}functionfE(o,r){returnfunction(t){functionn(){t.setActive(o.formatter.match(r));varn=o.formatter.formatChanged(r,t.setActive).unbind;e.set(on.some(n))}vare=ye(on.none());returno.initialized?n():o.on("init",n),function(){returne.get().each(function(n){returnn()})}}}functionlE(t){returnfunction(n){returnfunction(){t.undoManager.transact(function(){t.focus(),t.execCommand("mceToggleFormat",!1,n.format)})}}}functiondE(n,t,e){varo=e.dataset,r="basic"===o.type?function(){returnS(o.data,function(n){returnYk(n,e.isSelectedFor,e.getPreviewFor)})}:o.getData;return{items:function(n,u,a){functionr(n,t,e,o){varr=u.shared.providers.translate(n.title);if("separator"===n.type)returnon.some({type:"separator",text:r});if("submenu"!==n.type)returnon.some(N({type:"togglemenuitem",text:r,active:n.isSelected(o),disabled:e,onAction:a.onAction(n)},n.getStylePreview().fold(function(){return{}},function(n){return{meta:{style:n}}})));vari=B(n.getStyleItems(),function(n){returnc(n,t,o)});return0===t&&i.length<=0?on.none():on.some({type:"nestedmenuitem",text:r,disabled:i.length<=0,getSubmenuItems:function(){returnB(n.getStyleItems(),function(n){returnc(n,t,o)})}})}functioni(n){vart=a.getCurrentValue(),e=a.shouldHide?0:1;returnB(n,function(n){returnc(n,e,t)})}varc=function(n,t,e){varo="formatter"===n.type&&a.isInvalid(n);return0===t?o?[]:r(n,t,!1,e).toArray():r(n,t,o,e).toArray()};return{validateItems:i,getFetch:function(o,r){returnfunction(n){vart=r(),e=i(t);n(NC(e,Fh.CLOSE_ON_EXECUTE,o,!1))}}}}(0,t,e),getStyleItems:r}}functionmE(o,n,t){vare=dE(0,n,t),r=e.items,i=e.getStyleItems;returnFC({text:t.icon.isSome()?on.none():on.some(""),icon:t.icon,tooltip:on.from(t.tooltip),role:on.none(),fetch:r.getFetch(n,i),onSetup:function(e){returnt.setInitialValue.each(function(n){returnn(e.getComponent())}),t.nodeChangeHandler.map(function(n){vart=n(e.getComponent());returno.on("NodeChange",t),function(){o.off("NodeChange",t)}}).getOr(Z)},getApi:function(n){return{getComponent:function(){returnn}}},columns:1,presets:"normal",classes:t.icon.isSome()?[]:["bespoke"],dropdownBehaviours:[]},"tox-tbtn",n.shared)}vargE,pE,hE,vE,bE=Dl({name:"HtmlSelect",configFields:[ct("options"),Fs("selectBehaviours",[vg,Zf]),St("selectClasses",[]),St("selectAttributes",{}),ht("data")],factory:function(e,n){vart=S(e.options,function(n){return{dom:{tag:"option",value:n.value,innerHtml:n.text}}}),o=e.data.map(function(n){returnq("initialValue",n)}).getOr({});return{uid:e.uid,dom:{tag:"select",classes:e.selectClasses,attributes:e.selectAttributes},components:t,behaviours:Rs(e.selectBehaviours,[vg.config({}),Zf.config({store:N({mode:"manual",getValue:function(n){returnEr(n.element())},setValue:function(n,t){E(e.options,function(n){returnn.value===t}).isSome()&&Tr(n.element(),t)}},o)})])}}}),yE=/* */Object.freeze({events:function(n,t){vare=n.stream.streams.setup(n,t);returnco([lo(n.event,e),Ri(function(){returnt.cancel()})].concat(n.cancelEvent.map(function(n){return[lo(n,function(){returnt.cancel()})]}).getOr([])))}}),xE=/* */Object.freeze({throttle:_k,init:function(n){returnn.stream.streams.state(n)}}),wE=[st("stream",it("mode",{throttle:[ct("delay"),St("stopEvent",!0),Qu("streams",{setup:function(n,t){vare=n.stream,o=Jg(n.onStream,e.delay);returnt.setTimer(o),function(n,t){o.throttle(n,t),e.stopEvent&&t.stop()}},state:_k})]})),St("event","input"),ht("cancelEvent"),Ju("onStream")],SE=ya({fields:wE,name:"streaming",active:yE,state:xE}),CE=function(n){Fk(n,function(n,t){returnn.setSelectionRange(t.length,t.length)})},kE=nn("alloy.typeahead.itemexecute"),OE=nn([ht("lazySink"),ct("fetch"),St("minChars",5),St("responseTime",1e3),qu("onOpen"),St("getHotspot",on.some),St("getAnchorOverrides",nn({})),St("layouts",on.none()),St("eventOrder",{}),Dt("model",{},[St("getDisplayText",function(n){returnn.meta!==undefined&&n.meta.text!==undefined?n.meta.text:n.value}),St("selectsOver",!0),St("populateFromBrowse",!0)]),qu("onSetValue"),Ku("onExecute"),qu("onItemExecute"),St("inputClasses",[]),St("inputAttributes",{}),St("inputStyles",{}),St("matchWidth",!0),St("useMinWidth",!1),St("dismissOnBlur",!0),Xu(["openClass"]),ht("initialData"),Fs("typeaheadBehaviours",[vg,Zf,SE,lg,Cg,Jy]),At("previewing",function(){returnye(!0)})].concat(by()).concat(ax())),EE=nn([wl({schema:[Gu()],name:"menu",overrides:function(o){return{fakeFocus:!0,onHighlight:function(t,e){o.previewing.get()?t.getSystem().getByUid(o.uid).each(function(n){Ik(o.model,n,e).fold(function(){returnad.dehighlight(t,e)},function(n){returnn()})}):t.getSystem().getByUid(o.uid).each(function(n){o.model.populateFromBrowse&&Mk(o.model,n,e)}),o.previewing.set(!1)},onExecute:function(n,t){returnn.getSystem().getByUid(o.uid).toOption().map(function(n){returnro(n,kE(),{item:t}),!0})},onHover:function(n,t){o.previewing.set(!1),n.getSystem().getByUid(o.uid).each(function(n){o.model.populateFromBrowse&&Mk(o.model,n,t)})}}}})]),TE=Al({name:"Typeahead",configFields:OE(),partFields:EE(),factory:function(r,n,t,i){functione(n,t,e){r.previewing.set(!1);varo=Jy.getCoupled(n,"sandbox");if(zf.isOpen(o))Zl.getCurrent(o).each(function(n){ad.getHighlighted(n).fold(function(){e(n)},function(){ao(o,n.element(),"keydown",t)})});else{nx(r,u(n),n,o,i,function(n){Zl.getCurrent(n).each(e)},Ay.HighlightFirst).get(Z)}}varo=Zb(r),u=function(o){returnfunction(n){returnn.map(function(n){vart=R(n.menus),e=B(t,function(n){returnC(n.items,function(n){return"item"===n.type})});returnZf.getState(o).update(S(e,function(n){returnn.data})),n})}},a=[vg.config({}),Zf.config({onSetValue:r.onSetValue,store:N({mode:"dataset",getDataKey:function(n){returnEr(n.element())},getFallbackEntry:function(n){return{value:n,meta:{}}},setValue:function(n,t){Tr(n.element(),r.model.getDisplayText(t))}},r.initialData.map(function(n){returnq("initialValue",n)}).getOr({}))}),SE.config({stream:{mode:"throttle",delay:r.responseTime,stopEvent:!1},onStream:function(n,t){vare=Jy.getCoupled(n,"sandbox");if(vg.isFocused(n)&&Er(n.element()).length>=r.minChars){varo=Zl.getCurrent(e).bind(function(n){returnad.getHighlighted(n).map(Zf.getValue)});r.previewing.set(!0);nx(r,u(n),n,e,i,function(n){Zl.getCurrent(e).each(function(n){o.fold(function(){r.model.selectsOver&&ad.highlightFirst(n)},function(t){ad.highlightBy(n,function(n){returnZf.getValue(n).value===t.value}),ad.getHighlighted(n).orThunk(function(){returnad.highlightFirst(n),on.none()})})})},Ay.HighlightFirst).get(Z)}},cancelEvent:vi()}),lg.config({mode:"special",onDown:function(n,t){returne(n,t,ad.highlightFirst),on.some(!0)},onEscape:function(n){vart=Jy.getCoupled(n,"sandbox");returnzf.isOpen(t)?(zf.close(t),on.some(!0)):on.none()},onUp:function(n,t){returne(n,t,ad.highlightLast),on.some(!0)},onEnter:function(t){varn=Jy.getCoupled(t,"sandbox"),e=zf.isOpen(n);if(e&&!r.previewing.get())returnZl.getCurrent(n).bind(function(n){returnad.getHighlighted(n)}).map(function(n){returnro(t,kE(),{item:n}),!0});varo=Zf.getValue(t);returnoo(t,vi()),r.onExecute(n,t,o),e&&zf.close(n),on.some(!0)}}),Cg.config({toggleClass:r.markers.openClass,aria:{mode:"expanded"}}),Jy.config({others:{sandbox:function(n){returnix(r,n,{onOpen:function(){returnCg.on(n)},onClose:function(){returnCg.off(n)}})}}}),Kd("typeaheadevents",[Ni(function(n){vart=Z;ex(r,u(n),n,i,t,Ay.HighlightFirst).get(Z)}),lo(kE(),function(n,t){vare=Jy.getCoupled(n,"sandbox");Mk(r.model,n,t.event().item()),oo(n,vi()),r.onItemExecute(n,e,t.event().item(),Zf.getValue(n)),zf.close(e),CE(n)})].concat(r.dismissOnBlur?[lo(si(),function(n){vart=Jy.getCoupled(n,"sandbox");Ca(t.element()).isNone()&&zf.close(t)})]:[]))];return{uid:r.uid,dom:ny(Dn(r,{inputAttributes:{role:"combobox","aria-autocomplete":"list","aria-haspopup":"true"}})),behaviours:N(N({},o),Rs(r.typeaheadBehaviours,a)),eventOrder:r.eventOrder}}}),BE=function(i){returnN(N({},i),{toCached:function(){returnBE(i.toCached())},bindFuture:function(t){returnBE(i.bind(function(n){returnn.fold(function(n){returnNy(an.error(n))},function(n){returnt(n)})}))},bindResult:function(t){returnBE(i.map(function(n){returnn.bind(t)}))},mapResult:function(t){returnBE(i.map(function(n){returnn.map(t)}))},mapError:function(t){returnBE(i.map(function(n){returnn.mapError(t)}))},foldResult:function(t,e){returni.map(function(n){returnn.fold(t,e)})},withTimeout:function(n,r){returnBE(Vy(function(t){vare=!1,o=v.setTimeout(function(){e=!0,t(an.error(r()))},n);i.get(function(n){e||(v.clearTimeout(o),t(n))})}))}})},DE=Rk,AE={type:"separator"},_E=Xo("aria-invalid"),ME={bar:Uk(function(n,t){returnfunction(n,t){return{dom:{tag:"div",classes:["tox-bar","tox-form__controls-h-stack"]},components:S(n.items,t.interpreter)}}(n,t.shared)}),collection:Uk(function(n,t){returnjk(n,t.shared.providers)}),alertbanner:Uk(function(n,t){returnfunction(t,n){returnWb.sketch({dom:{tag:"div",attributes:{role:"alert"},classes:["tox-notification","tox-notification--in","tox-notification--"+t.level]},components:[{dom:{tag:"div",classes:["tox-notification__icon"]},components:[Gg.sketch({dom:{tag:"button",classes:["tox-button","tox-button--naked","tox-button--icon"],innerHtml:ym(t.icon,n.icons),attributes:{title:n.translate(t.iconTooltip)}},action:function(n){ro(n,sy,{name:"alert-banner",value:t.url})}})]},{dom:{tag:"div",classes:["tox-notification__body"],innerHtml:n.translate(t.text)}}]})}(n,t.shared.providers)}),input:Uk(function(n,t){returnfunction(n,t){returnAk({name:n.name,multiline:!1,label:n.label,inputMode:n.inputMode,placeholder:n.placeholder,flex:!1,disabled:n.disabled,classname:"tox-textfield",validation:on.none(),maximized:n.maximized},t)}(n,t.shared.providers)}),textarea:Uk(function(n,t){returnfunction(n,t){returnAk({name:n.name,multiline:!0,label:n.label,inputMode:on.none(),placeholder:n.placeholder,flex:!0,disabled:n.disabled,classname:"tox-textarea",validation:on.none(),maximized:n.maximized},t)}(n,t.shared.providers)}),label:Uk(function(n,t){returnfunction(n,t){vare={dom:{tag:"label",innerHtml:t.providers.translate(n.label),classes:["tox-label"]}},o=S(n.items,t.interpreter);return{dom:{tag:"div",classes:["tox-form__group"]},components:[e].concat(o),behaviours:ba([xS(),mg.config({}),BS(on.none()),lg.config({mode:"acyclic"})])}}(n,t.shared)}),iframe:(gE=function(n,t){returnww(n,t.shared.providers)},function(n,t,e){varo=Dn(t,{source:"dynamic"});returnUk(gE)(n,o,e)}),button:Uk(function(n,t){returnqC(n,t.shared.providers)}),checkbox:Uk(function(n,t){returnfunction(e,t){functionn(n){returnn.element().dom().click(),on.some(!0)}functiono(n){return{dom:{tag:"span",classes:["tox-icon","tox-checkbox-icon__"+n],innerHtml:ym("checked"===n?"selected":"unselected",t.icons)}}}varr=Zf.config({store:{mode:"manual",getValue:function(n){returnn.element().dom().checked},setValue:function(n,t){n.element().dom().checked=t}}}),i=vy.parts().field({factory:{sketch:l},dom:{tag:"input",classes:["tox-checkbox__input"],attributes:{type:"checkbox"}},behaviours:ba([xS(),Ch.config({disabled:e.disabled}),Gy.config({}),vg.config({}),r,lg.config({mode:"special",onEnter:n,onSpace:n,stopSpaceKeyup:!0}),Kd("checkbox-events",[lo(oi(),function(n,t){ro(n,uy,{name:e.name})})])])}),u=vy.parts().label({dom:{tag:"span",classes:["tox-checkbox__label"],innerHtml:t.translate(e.label)},behaviours:ba([Ew.config({})])}),a=vm({dom:{tag:"div",classes:["tox-checkbox__icons"]},components:[o("checked"),o("unchecked")]});returnvy.sketch({dom:{tag:"label",classes:["tox-checkbox"]},components:[i,a.asSpec(),u],fieldBehaviours:ba([Ch.config({disabled:e.disabled,disableClass:"tox-checkbox--disabled",onDisabled:function(n){vy.getField(n).each(Ch.disable)},onEnabled:function(n){vy.getField(n).each(Ch.enable)}})])})}(n,t.shared.providers)}),colorinput:Uk(function(n,t){returncx(n,t.shared,t.colorinput)}),colorpicker:Uk(function(n){functiont(n){return"tox-"+n}vare=yS(pw,t),r=vm(e.sketch({dom:{tag:"div",classes:[t("color-picker-container")],attributes:{role:"presentation"}},onValidHex:function(n){ro(n,sy,{name:"hex-valid",value:!0})},onInvalidHex:function(n){ro(n,sy,{name:"hex-valid",value:!1})}}));return{dom:{tag:"div"},components:[r.asSpec()],behaviours:ba([Zf.config({store:{mode:"manual",getValue:function(n){vart=r.get(n);returnZl.getCurrent(t).bind(function(n){returnZf.getValue(n).hex}).map(function(n){return"#"+n}).getOr("")},setValue:function(n,t){vare=/^#([a-fA-F0-9]{3}(?:[a-fA-F0-9]{3})?)/.exec(t),o=r.get(n);Zl.getCurrent(o).fold(function(){v.console.log("Can not find form")},function(n){Zf.setValue(n,{hex:on.from(e[1]).getOr("")}),dS.getField(n,"hex").each(function(n){oo(n,ei())})})}}}),xS()])}}),dropzone:Uk(function(n,t){returnbw(n,t.shared.providers)}),grid:Uk(function(n,t){returnfunction(n,t){return{dom:{tag:"div",classes:["tox-form__grid","tox-form__grid--"+n.columns+"col"]},components:S(n.items,t.interpreter)}}(n,t.shared)}),selectbox:Uk(function(n,t){returnfunction(e,t){varn=S(e.items,function(n){return{text:t.translate(n.text),value:n.value}}),o=e.label.map(function(n){returnDy(n,t)}),r=vy.parts().field({dom:{},selectAttributes:{size:e.size},options:n,factory:bE,selectBehaviours:ba([Ch.config({disabled:e.disabled}),Gy.config({}),Kd("selectbox-change",[lo(oi(),function(n,t){ro(n,uy,{name:e.name})})])])}),i=1<e.size?on.none():on.some({dom:{tag:"div",classes:["tox-selectfield__icon-js"],innerHtml:ym("chevron-down",t.icons)}}),u={dom:{tag:"div",classes:["tox-selectfield"]},components:H([[r],i.toArray()])};returnvy.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:H([o.toArray(),[u]]),fieldBehaviours:ba([Ch.config({disabled:e.disabled,onDisabled:function(n){vy.getField(n).each(Ch.disable)},onEnabled:function(n){vy.getField(n).each(Ch.enable)}})])})}(n,t.shared.providers)}),sizeinput:Uk(function(n,t){returnnk(n,t.shared.providers)}),urlinput:Uk(function(n,t){returnLk(n,t,t.urlinput)}),customeditor:Uk(function(e){varo=ye(on.none()),t=vm({dom:{tag:e.tag}}),r=ye(on.none());return{dom:{tag:"div",classes:["tox-custom-editor"]},behaviours:ba([Kd("editor-foo-events",[Ii(function(n){t.getOpt(n).each(function(t){(!function(n){returnObject.prototype.hasOwnProperty.call(n,"init")}(e)?kS.load(e.scriptId,e.scriptUrl).then(function(n){returnn(t.element().dom(),e.settings)}):e.init(t.element().dom())).then(function(t){r.get().each(function(n){t.setValue(n)}),r.set(on.none()),o.set(on.some(t))})})})]),Zf.config({store:{mode:"manual",getValue:function(){returno.get().fold(function(){returnr.get().getOr("")},function(n){returnn.getValue()})},setValue:function(n,t){o.get().fold(function(){r.set(on.some(t))},function(n){returnn.setValue(t)})}}}),xS()]),components:[t.asSpec()]}}),htmlpanel:Uk(function(n){return"presentation"===n.presets?Wb.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:n.html}}):Wb.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:n.html,attributes:{role:"document"}},containerBehaviours:ba([Gy.config({}),vg.config({})])})}),imagetools:Uk(function(n,t){returnDk(n,t.shared.providers)}),table:Uk(function(n,t){returnfunction(n,t){functione(n){return{dom:{tag:"th",innerHtml:t.translate(n)}}}functiono(n){return{dom:{tag:"td",innerHtml:t.translate(n)}}}functionr(n){return{dom:{tag:"tr"},components:S(n,o)}}vari,u;return{dom:{tag:"table",classes:["tox-dialog__table"]},components:[(u=n.header,{dom:{tag:"thead"},components:[{dom:{tag:"tr"},components:S(u,e)}]}),(i=n.cells,{dom:{tag:"tbody"},components:S(i,r)})],behaviours:ba([Gy.config({}),vg.config({})])}}(n,t.shared.providers)}),panel:Uk(function(n,t){returnfunction(n,t){return{dom:{tag:"div",classes:n.classes},components:S(n.items,t.shared.interpreter)}}(n,t)})},FE={field:function(n,t){returnt}},IE=function(t,e,o){returnNn(ME,e.type).fold(function(){returnv.console.error('Unknown factory type "'+e.type+'", defaulting to container: ',e),e},function(n){returnn(t,e,o)})},RE=nn(function(n,t){!function(n,t){vare=Vu.max(n,t,["margin-left","border-left-width","padding-left","padding-right","border-right-width","margin-right"]);yr(n,"max-width",e+"px")}(n,Math.floor(t))}),VE={valignCentre:[],alignCentre:[],alignLeft:[],alignRight:[],right:[],left:[],bottom:[],top:[]},NE=function(n,t,e){functiono(){returnwe.fromDom(n.getBody())}varr=Kb(n);return{toolbar:function(n,t,e){returne?function(){return{anchor:"node",root:n(),node:on.from(n()),bubble:Oa(-12,-12,VE),layouts:{onRtl:function(){return[pm]},onLtr:function(){return[hm]}},overrides:{maxHeightFunction:Cf()}}}:function(){return{anchor:"hotspot",hotspot:t(),bubble:Oa(-12,12,VE),layouts:{onRtl:function(){return[ua]},onLtr:function(){return[aa]}},overrides:{maxHeightFunction:Cf()}}}}(o,t,r),toolbarOverflow:function(n){returnfunction(){return{anchor:"hotspot",hotspot:n(),overrides:{maxWidthFunction:RE()},layouts:{onRtl:function(){return[ua,aa]},onLtr:function(){return[aa,ua]}}}}}(e),banner:function(n,t,e){returne?function(){return{anchor:"node",root:n(),node:on.from(n()),layouts:{onRtl:function(){return[Ug]},onLtr:function(){return[Ug]}}}}:function(){return{anchor:"hotspot",hotspot:t(),layouts:{onRtl:function(){return[rc]},onLtr:function(){return[rc]}}}}}(o,t,r),cursor:function(t,n){returnfunction(){return{anchor:"selection",root:n(),getSelection:function(){varn=t.selection.getRng();returnon.some(Tc.range(we.fromDom(n.startContainer),n.startOffset,we.fromDom(n.endContainer),n.endOffset))}}}}(n,o),node:function(t){returnfunction(n){return{anchor:"node",root:t(),node:n}}}(o)}},HE=[{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"}]}],PE=function(n){returnO(n,function(n,t){if(function(n){returnEn(n,"items")}(t)){vare=PE(t.items);return{customFormats:n.customFormats.concat(e.customFormats),formats:n.formats.concat([{title:t.title,items:e.formats}])}}if(function(n){returnEn(n,"inline")}(t)||function(n){returnEn(n,"block")}(t)||function(n){returnEn(n,"selector")}(t)){varo="custom-"+t.title.toLowerCase();return{customFormats:n.customFormats.concat([{name:o,format:t}]),formats:n.formats.concat([{title:t.title,format:o,icon:t.icon}])}}returnN(N({},n),{formats:n.formats.concat(t)})},{customFormats:[],formats:[]})},zE=yk.trim,LE=Kk("true"),jE=Kk("false"),UE=function(n){returnfunction(n){for(;n=n.parentNode;){vart=n.contentEditable;if(t&&"inherit"!==t)returnLE(n)}return!1}(n)&&!jE(n)},WE=function(n){vart=oO(n);returnC(function(n){returnS(C(n,nO),tO)}(t).concat(function(n){returnS(C(n,Qk),eO)}(t)),rO)},GE="tinymce-url-history",XE=Object.prototype.hasOwnProperty,YE="contexttoolbar-hide",qE=nn([ct("dom"),St("shell",!0),Fs("toolbarBehaviours",[mg])]),KE=nn([Sl({name:"groups",overrides:function(n){return{behaviours:ba([mg.config({})])}}})]),JE=Al({name:"Toolbar",configFields:qE(),partFields:KE(),factory:function(t,n,e,o){varr=function(n){returnt.shell?on.some(n):qs(n,t,"groups")},i=t.shell?{behaviours:[mg.config({})],components:[]}:{behaviours:[],components:n};return{uid:t.uid,dom:t.dom,components:i.components,behaviours:Rs(t.toolbarBehaviours,i.behaviours),apis:{setGroups:function(n,t){r(n).fold(function(){throwv.console.error("Toolbar was defined to not be a shell, but no groups container was specified in components"),newError("Toolbar was defined to not be a shell, but no groups container was specified in components")},function(n){mg.set(n,t)})}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(n,t,e){n.setGroups(t,e)}}}),$E=yo("within","extra","withinWidth"),QE=nn([ct("items"),Xu(["itemSelector"]),Fs("tgroupBehaviours",[lg])]),ZE=nn([Cl({name:"items",unit:"item"})]),nT=Al({name:"ToolbarGroup",configFields:QE(),partFields:ZE(),factory:function(n,t,e,o){return{uid:n.uid,dom:n.dom,components:t,behaviours:Rs(n.tgroupBehaviours,[lg.config({mode:"flow",selector:n.markers.itemSelector})]),domModification:{attributes:{role:"toolbar"}}}}}),tT=nn([Fs("splitToolbarBehaviours",[Jy]),At("builtGroups",function(){returnye([])})]),eT=nn([Xu(["overflowToggledClass"]),ct("getAnchor"),xt("getOverflowBounds"),ct("lazySink")].concat(tT())),oT=nn([xl({factory:JE,schema:qE(),name:"primary"}),wl({factory:JE,schema:qE(),name:"overflow",overrides:function(t){return{toolbarBehaviours:ba([lg.config({mode:"cyclic",onEscape:function(n){returnqs(n,t,"overflow-button").each(vg.focus),on.none()}})])}}}),wl({name:"overflow-button",overrides:function(n){return{dom:{attributes:{"aria-haspopup":"true"}},buttonBehaviours:ba([Cg.config({toggleClass:n.markers.overflowToggledClass,aria:{mode:"expanded"},toggleOnExecute:!1})])}}}),wl({name:"overflow-group"})]),rT=Al({name:"SplitFloatingToolbar",configFields:eT(),partFields:oT(),factory:function(t,n,e,o){returnSO(t,n,0,o,{coupling:{sandbox:function(n){returnfunction(o,e){varr=Eu();return{dom:{tag:"div",attributes:{id:r.id()}},behaviours:ba([lg.config({mode:"special",onEscape:function(n){returnzf.close(n),on.some(!0)}}),zf.config({onOpen:function(n,t){OO(o,e),qs(o,e,"overflow-button").each(function(n){Cg.on(n),r.link(n.element())}),lg.focusIn(t)},onClose:function(){qs(o,e,"overflow-button").each(function(n){Cg.off(n),vg.focus(n),r.unlink(n.element())})},isPartOf:function(n,t,e){returnLu(t,e)||Lu(o,e)},getAttachPoint:function(){returne.lazySink(o).getOrDie()}}),lc.config({channels:N({},Ts({isExtraPart:nn(!1),doReposition:function(){returnEO(o,e)}}))})])}}(n,t)}},apis:{refresh:function(n){returnOO(n,t)},toggle:function(n){returnfunction(n,t,e){varo=Jy.getCoupled(n,"sandbox");zf.isOpen(o)?zf.close(o):zf.open(o,e.overflow())}(n,0,o)},getOverflow:function(n){returnzf.getState(Jy.getCoupled(n,"sandbox"))},reposition:function(n){returnEO(n,t)}}})},apis:{setGroups:function(n,t,e){n.setGroups(t,e)},refresh:function(n,t){n.refresh(t)},reposition:function(n,t){n.reposition(t)},getMoreButton:function(n,t){returnn.getMoreButton(t)},getOverflow:function(n,t){returnn.getOverflow(t)},toggle:function(n,t){n.toggle(t)}}}),iT=/* */Object.freeze({refresh:function(n,t,e){if(e.isExpanded()){kr(n.element(),BO(t));varo=DO(t,n.element());yr(n.element(),BO(t),o)}},grow:function(n,t,e){e.isExpanded()||VO(n,t,e)},shrink:function(n,t,e){e.isExpanded()&&RO(n,t,e)},immediateShrink:function(n,t,e){e.isExpanded()&&FO(n,t,e)},hasGrown:function(n,t,e){returne.isExpanded()},hasShrunk:function(n,t,e){returne.isCollapsed()},isGrowing:NO,isShrinking:HO,isTransitioning:function(n,t,e){return!0===NO(n,t)||!0===HO(n,t)},toggleGrow:function(n,t,e){(e.isExpanded()?RO:VO)(n,t,e)},disableTransitions:AO}),uT=/* */Object.freeze({exhibit:function(n,t){vare=t.expanded;returnZo(e?{classes:[t.openClass],styles:{}}:{classes:[t.closedClass],styles:q(t.dimension.property,"0px")})},events:function(e,o){returnco([bo(ii(),function(n,t){t.event().raw().propertyName===e.dimension.property&&(AO(n,e),o.isExpanded()&&kr(n.element(),e.dimension.property),(o.isExpanded()?e.onGrown:e.onShrunk)(n))})])}}),aT=[ct("closedClass"),ct("openClass"),ct("shrinkingClass"),ct("growingClass"),ht("getAnimationRoot"),qu("onShrunk"),qu("onStartShrink"),qu("onGrown"),qu("onStartGrow"),St("expanded",!1),st("dimension",it("property",{width:[Qu("property","width"),Qu("getDimension",function(n){returnmu(n)+"px"})],height:[Qu("property","height"),Qu("getDimension",function(n){returnsu(n)+"px"})]}))],cT=ya({fields:aT,name:"sliding",active:uT,apis:iT,state:/* */Object.freeze({init:function(n){vart=ye(n.expanded);returnnu({isExpanded:function(){return!0===t.get()},isCollapsed:function(){return!1===t.get()},setCollapsed:d(t.set,!1),setExpanded:d(t.set,!0),readState:function(){return"expanded: "+t.get()}})}})}),sT=nn([Xu(["closedClass","openClass","shrinkingClass","growingClass","overflowToggledClass"]),qu("onOpened"),qu("onClosed")].concat(tT())),fT=nn([xl({factory:JE,schema:qE(),name:"primary"}),xl({factory:JE,schema:qE(),name:"overflow",overrides:function(t){return{toolbarBehaviours:ba([cT.config({dimension:{property:"height"},closedClass:t.markers.closedClass,openClass:t.markers.openClass,shrinkingClass:t.markers.shrinkingClass,growingClass:t.markers.growingClass,onShrunk:function(n){qs(n,t,"overflow-button").each(function(n){Cg.off(n),vg.focus(n)}),t.onClosed(n)},onGrown:function(n){lg.focusIn(n),t.onOpened(n)},onStartGrow:function(n){qs(n,t,"overflow-button").each(Cg.on)}}),lg.config({mode:"acyclic",onEscape:function(n){returnqs(n,t,"overflow-button").each(vg.focus),on.some(!0)}})])}}}),wl({name:"overflow-button",overrides:function(n){return{buttonBehaviours:ba([Cg.config({toggleClass:n.markers.overflowToggledClass,aria:{mode:"pressed"},toggleOnExecute:!1})])}}}),wl({name:"overflow-group"})]),lT=function(n,t){vare=qs(n,t,"overflow");wO(n,t,e,PO),e.each(cT.refresh)},dT=Al({name:"SplitSlidingToolbar",configFields:sT(),partFields:fT(),factory:function(t,n,e,o){returnSO(t,n,0,o,{coupling:{},apis:{refresh:function(n){returnlT(n,t)},toggle:function(n){returnfunction(t,e){qs(t,e,"overflow").each(function(n){lT(t,e),cT.toggleGrow(n)})}(n,t)},getOverflow:function(n){returnqs(n,t,"overflow")}}})},apis:{setGroups:function(n,t,e){n.setGroups(t,e)},refresh:function(n,t){n.refresh(t)},getMoreButton:function(n,t){returnn.getMoreButton(t)},getOverflow:function(n,t){returnn.getOverflow(t)},toggle:function(n,t){n.toggle(t)}}}),mT=nn(Xo("toolbar-height-change")),gT="silver.readonly",pT=re([(pE="readonly",st(pE,pe))]),hT=[Tt("disabled",!1),yt("tooltip"),yt("icon"),yt("text"),Bt("onSetup",function(){returnZ})],vT=re([ft("type"),dt("onAction")].concat(hT)),bT=[yt("text"),yt("tooltip"),yt("icon"),dt("fetch"),Bt("onSetup",function(){returnZ})],yT=re(g([ft("type")],bT)),xT=re([ft("type"),yt("tooltip"),yt("icon"),yt("text"),xt("select"),dt("fetch"),Bt("onSetup",function(){returnZ}),Et("presets","normal",["normal","color","listpreview"]),St("columns",1),dt("onAction"),dt("onItemAction")]),wT=[Tt("active",!1)].concat(hT),ST=re(wT.concat([ft("type"),dt("onAction")])),CT=[Bt("predicate",function(){return!1}),Et("scope","node",["node","editor"]),Et("position","selection",["node","selection","line"])],kT=hT.concat([St("type","contextformbutton"),St("primary",!1),dt("onAction"),At("original",l)]),OT=wT.concat([St("type","contextformbutton"),St("primary",!1),dt("onAction"),At("original",l)]),ET=hT.concat([St("type","contextformbutton")]),TT=wT.concat([St("type","contextformtogglebutton")]),BT=it("type",{contextformbutton:kT,contextformtogglebutton:OT}),DT=re([St("type","contextform"),Bt("initValue",function(){return""}),yt("label"),pt("commands",BT),vt("launch",it("type",{contextformbutton:ET,contextformtogglebutton:TT}))].concat(CT)),AT=re([St("type","contexttoolbar"),ft("items")].concat(CT)),_T=/* */Object.freeze({getState:function(n,t,e){returne}}),MT=/* */Object.freeze({events:function(i,u){functiono(o,r){i.updateState.each(function(n){vart=n(o,r);u.set(t)}),i.renderComponents.each(function(n){vart=n(r,u.get()),e=S(t,o.getSystem().build);ps(o,e)})}returnco([lo(li(),function(n,t){vare=i.channel;vn(t.channels(),e)&&o(n,t.data())}),Ii(function(t,n){i.initialData.each(function(n){o(t,n)})})])}}),FT=/* */Object.freeze({init:function(n){vart=ye(on.none());return{readState:function(){returnt.get().fold(function(){return"none"},function(n){returnn})},get:function(){returnt.get()},set:function(n){returnt.set(n)},clear:function(){returnt.set(on.none())}}}}),IT=[ct("channel"),ht("renderComponents"),ht("updateState"),ht("initialData")],RT=ya({fields:IT,name:"reflecting",active:MT,apis:_T,state:FT}),VT=nn([ct("toggleClass"),ct("fetch"),Ju("onExecute"),St("getHotspot",on.some),St("getAnchorOverrides",nn({})),St("layouts",on.none()),Ju("onItemExecute"),ht("lazySink"),ct("dom"),qu("onOpen"),Fs("splitDropdownBehaviours",[Jy,lg,vg]),St("matchWidth",!1),St("useMinWidth",!1),St("eventOrder",{}),ht("role")].concat(ax())),NT=xl({factory:Gg,schema:[ct("dom")],name:"arrow",defaults:function(n){return{buttonBehaviours:ba([vg.revoke()])}},overrides:function(t){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(n){n.getSystem().getByUid(t.uid).each(io)},buttonBehaviours:ba([Cg.config({toggleOnExecute:!1,toggleClass:t.toggleClass})])}}}),HT=xl({factory:Gg,schema:[ct("dom")],name:"button",defaults:function(n){return{buttonBehaviours:ba([vg.revoke()])}},overrides:function(e){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(t){t.getSystem().getByUid(e.uid).each(function(n){e.onExecute(n,t)})}}}}),PT=nn([NT,HT,Sl({factory:{sketch:function(n){return{uid:n.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:n.text}}}},schema:[ct("text")],name:"aria-descriptor"}),wl({schema:[Gu()],name:"menu",defaults:function(o){return{onExecute:function(t,e){t.getSystem().getByUid(o.uid).each(function(n){o.onItemExecute(n,t,e)})}}}}),Qy()]),zT=Al({name:"SplitDropdown",configFields:VT(),partFields:PT(),factory:function(o,n,t,e){functionr(n){Zl.getCurrent(n).each(function(n){ad.highlightFirst(n),lg.focusIn(n)})}functioni(n){ex(o,function(n){returnn},n,e,r,Ay.HighlightFirst).get(Z)}functionu(n){vart=Ks(n,o,"button");returnio(t),on.some(!0)}vara=An(co([Ii(function(e,n){qs(e,o,"aria-descriptor").each(function(n){vart=Xo("aria");Po(n.element(),"id",t),Po(e.element(),"aria-describedby",t)})})]),rm(on.some(i))),c={repositionMenus:function(n){Cg.isOn(n)&&ux(n)}};return{uid:o.uid,dom:o.dom,components:n,apis:c,eventOrder:N(N({},o.eventOrder),{"alloy.execute":["disabling","toggling","alloy.base.behaviour"]}),events:a,behaviours:Rs(o.splitDropdownBehaviours,[Jy.config({others:{sandbox:function(n){vart=Ks(n,o,"arrow");returnix(o,n,{onOpen:function(){Cg.on(t),Cg.on(n)},onClose:function(){Cg.off(t),Cg.off(n)}})}}}),lg.config({mode:"special",onSpace:u,onEnter:u,onDown:function(n){returni(n),on.some(!0)}}),vg.config({}),Cg.config({toggleOnExecute:!1,aria:{mode:"expanded"}})]),domModification:{attributes:{role:o.role.getOr("button"),"aria-haspopup":!0}}}},apis:{repositionMenus:function(n,t){returnn.repositionMenus(t)}}}),LT=Xo("focus-button"),jT=["checklist","ordered-list"],UT=["indent","outdent","table-insert-column-after","table-insert-column-before","unordered-list"],WT=function(n,t,e){returnoE(n,{toolbarButtonBehaviours:[].concat(0<e.length?[Kd("toolbarButtonWith",e)]:[]),getApi:ZO,onSetup:n.onSetup},t)},GT=function(n,t,e){returnDn(oE(n,{toolbarButtonBehaviours:[mg.config({}),Cg.config({toggleClass:"tox-tbtn--enabled",aria:{mode:"pressed"},toggleOnExecute:!1})].concat(0<e.length?[Kd("toolbarToggleButtonWith",e)]:[]),getApi:nE,onSetup:n.onSetup},t))},XT=function(n,t,e){varo=t.label.fold(function(){return{}},function(n){return{"aria-label":n}}),r=vm(yy.sketch({inputClasses:["tox-toolbar-textfield","tox-toolbar-nav-js"],data:t.initValue(),inputAttributes:o,selectOnFocus:!0,inputBehaviours:ba([lg.config({mode:"special",onEnter:function(n){returni.findPrimary(n).map(function(n){returnio(n),!0})},onLeft:function(n,t){returnt.cut(),on.none()},onRight:function(n,t){returnt.cut(),on.none()}})])})),i=function(t,n,e){varo=S(n,function(n){returnvm(uE(t,n,e))});return{asSpecs:function(){returnS(o,function(n){returnn.asSpec()})},findPrimary:function(e){returnDu(n,function(n,t){returnn.primary?on.from(o[t]).bind(function(n){returnn.getOpt(e)}).filter(b(Ch.isDisabled)):on.none()})}}}(r,t.commands,e.shared.providers);returnKO({type:n,uid:Xo("context-toolbar"),initGroups:[{title:on.none(),items:[r.asSpec()]},{title:on.none(),items:i.asSpecs()}],onEscape:on.none,cyclicKeying:!0,backstage:e,getSink:function(){returnan.error("")}})},YT=function(t,e){functionn(n){returnn.dom()===e.getBody()}varo=we.fromDom(e.selection.getNode());returnsE(o,t.inNodeScope).orThunk(function(){returnsE(o,t.inEditorScope).orThunk(function(){returnfunction(n,t,e){for(varo=n.dom(),r=dn(e)?e:nn(!1);o.parentNode;){o=o.parentNode;vari=we.fromDom(o),u=t(i);if(u.isSome())returnu;if(r(i))break}returnon.none()}(o,function(n){returnsE(n,t.inNodeScope)},n)})})},qT=function(e,r){functiono(t,e){varo=et(function(n){returntt("ContextForm",DT,n)}(e));(n[t]=o).launch.map(function(n){c["form:"+t]=N(N({},e.launch),{type:"contextformtogglebutton"===n.type?"togglebutton":"button",onAction:function(){r(o)}})}),"editor"===o.scope?a.push(o):u.push(o),s[t]=o}functioni(t,e){(function(n){returntt("ContextToolbar",AT,n)})(e).each(function(n){"editor"===e.scope?a.push(n):u.push(n),s[t]=n})}varn={},u=[],a=[],c={},s={},t=wn(e);returnbn(t,function(n){vart=e[n];"contextform"===t.type?o(n,t):"contexttoolbar"===t.type&&i(n,t)}),{forms:n,inNodeScope:u,inEditorScope:a,lookupTable:s,formNavigators:c}},KT=Xo("forward-slide"),JT=Xo("backward-slide"),$T=Xo("change-slide-event"),QT="tox-pop--resizing";(vE=hE=hE||{})[vE.SemiColon=0]="SemiColon",vE[vE.Space=1]="Space";functionZT(n,t,e,o){return{type:"basic",data:function(n){returnS(n,function(n){vart=n,e=n,o=n.split("=");return1<o.length&&(t=o[0],e=o[1]),{title:t,format:e}})}(function(n,t){returnt===hE.SemiColon?n.replace(/;$/,"").split(";"):n.split(" ")}(Nn(n.settings,t).getOr(e),o))}}functionnB(e){functiont(n){vart=E(RD,function(n){returne.formatter.match(n.format)}).fold(function(){return"left"},function(n){returnn.title.toLowerCase()});ro(n,ik,{icon:"align-"+t})}varn=on.some(function(n){returnfunction(){returnt(n)}}),o=on.some(function(n){returnt(n)}),r=function(n){return{type:"basic",data:n}}(RD);return{tooltip:"Align",icon:on.some("align-left"),isSelectedFor:function(n){returnfunction(){returne.formatter.match(n)}},getCurrentValue:nn(on.none()),getPreviewFor:function(n){returnfunction(){returnon.none()}},onAction:lE(e),setInitialValue:o,nodeChangeHandler:n,dataset:r,shouldHide:!1,isInvalid:function(n){return!e.formatter.canApply(n.format)}}}functiontB(n){vart=n.split(/\s*,\s*/);returnS(t,function(n){returnn.replace(/^['"]+|['"]+$/g,"")})}functioneB(r){functioni(){functione(n){returnn?tB(n)[0]:""}varn=r.queryCommandValue("FontName"),t=u.data,o=n?n.toLowerCase():"";return{matchOpt:E(t,function(n){vart=n.format;returnt.toLowerCase()===o||e(t).toLowerCase()===e(o).toLowerCase()}).orThunk(function(){returnfunction(n){vart;return0===n.indexOf("-apple-system")&&(t=tB(n.toLowerCase()),D(VD,function(n){return-1<t.indexOf(n.toLowerCase())}))}(o)?on.from({title:"System Font",format:o}):on.none()}),font:n}}functiont(n){vart=i(),e=t.matchOpt,o=t.font,r=e.fold(function(){returno},function(n){returnn.title});ro(n,rk,{text:r})}varn=on.some(function(n){returnfunction(){returnt(n)}}),e=on.some(function(n){returnt(n)}),u=ZT(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",hE.SemiColon);return{tooltip:"Fonts",icon:on.none(),isSelectedFor:function(t){returnfunction(n){returnn.exists(function(n){returnn.format===t})}},getCurrentValue:function(){returni().matchOpt},getPreviewFor:function(n){returnfunction(){returnon.some({tag:"div",styleAttr:-1===n.indexOf("dings")?"font-family:"+n:""})}},onAction:function(n){returnfunction(){r.undoManager.transact(function(){r.focus(),r.execCommand("FontName",!1,n.format)})}},setInitialValue:e,nodeChangeHandler:n,dataset:u,shouldHide:!1,isInvalid:function(){return!1}}}functionoB(n,t){return/[0-9.]+px$/.test(n)?function(n,t){vare=Math.pow(10,t);returnMath.round(n*e)/e}(72*parseInt(n,10)/96,t||0)+"pt":n}functionrB(e){functioni(){varo=on.none(),r=u.data,i=e.queryCommandValue("FontSize");if(i)for(varn=function(n){vart=oB(i,n),e=function(n){returnV(ND,n).getOr("")}(t);o=E(r,function(n){returnn.format===i||n.format===t||n.format===e})},t=3;o.isNone()&&0<=t;t--)n(t);return{matchOpt:o,px:i}}functiont(n){vart=i(),e=t.matchOpt,o=t.px,r=e.fold(function(){returno},function(n){returnn.title});ro(n,rk,{text:r})}varn=nn(nn(on.none())),o=on.some(function(n){returnfunction(){returnt(n)}}),r=on.some(function(n){returnt(n)}),u=ZT(e,"fontsize_formats","8pt 10pt 12pt 14pt 18pt 24pt 36pt",hE.Space);return{tooltip:"Font sizes",icon:on.none(),isSelectedFor:function(t){returnfunction(n){returnn.exists(function(n){returnn.format===t})}},getPreviewFor:n,getCurrentValue:function(){returni().matchOpt},onAction:function(n){returnfunction(){e.undoManager.transact(function(){e.focus(),e.execCommand("FontSize",!1,n.format)})}},setInitialValue:r,nodeChangeHandler:o,dataset:u,shouldHide:!1,isInvalid:function(){return!1}}}functioniB(e,n,t){varo=n();returnDu(t,function(t){returnE(o,function(n){returne.formatter.matchNode(t,n.format)})}).orThunk(function(){returne.formatter.match("p")?on.some({title:"Paragraph",format:"p"}):on.none()})}functionuB(n){vart=n.selection.getStart(!0)||n.getBody();returnn.dom.getParents(t,function(){return!0},n.getBody())}functionaB(o){functione(n,t){vare=function(n){returniB(o,function(){returnr.data},n)}(n).fold(function(){return"Paragraph"},function(n){returnn.title});ro(t,rk,{text:e})}varn=on.some(function(t){returnfunction(n){returne(n.parents,t)}}),t=on.some(function(n){vart=uB(o);e(t,n)}),r=ZT(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",hE.SemiColon);return{tooltip:"Blocks",icon:on.none(),isSelectedFor:function(n){returnfunction(){returno.formatter.match(n)}},getCurrentValue:nn(on.none()),getPreviewFor:function(t){returnfunction(){varn=o.formatter.get(t);returnon.some({tag:0<n.length&&(n[0].inline||n[0].block)||"div",styleAttr:o.formatter.getCssText(t)})}},onAction:lE(o),setInitialValue:t,nodeChangeHandler:n,dataset:r,shouldHide:!1,isInvalid:function(n){return!o.formatter.canApply(n.format)}}}functioncB(i,n){functione(n,t){vare=function(n){vart=n.items;returnt!==undefined&&0<t.length?B(t,e):[{title:n.title,format:n.format}]},o=B(Xk(i),e),r=iB(i,function(){returno},n).fold(function(){return"Paragraph"},function(n){returnn.title});ro(t,rk,{text:r})}vart=on.some(function(t){returnfunction(n){returne(n.parents,t)}}),o=on.some(function(n){vart=uB(i);e(t,n)});return{tooltip:"Formats",icon:on.none(),isSelectedFor:function(n){returnfunction(){returni.formatter.match(n)}},getCurrentValue:nn(on.none()),getPreviewFor:function(t){returnfunction(){varn=i.formatter.get(t);returnn!==undefined?on.some({tag:0<n.length&&(n[0].inline||n[0].block)||"div",styleAttr:i.formatter.getCssText(t)}):on.none()}},onAction:lE(i),setInitialValue:o,nodeChangeHandler:t,shouldHide:i.getParam("style_formats_autohide",!1,"boolean"),isInvalid:function(n){return!i.formatter.canApply(n.format)},dataset:n}}functionsB(o,r){returnfunction(n,t){vare=o(n).mapError(function(n){returnle(n)}).getOrDie();returnr(e,t)}}functionfB(n){vart=n.toolbar,e=n.buttons;return!1===t?[]:t===undefined||!0===t?function(e){varn=S(HD,function(n){vart=C(n.items,function(n){returnEn(e,n)||En(zD,n)});return{name:n.name,items:t}});returnC(n,function(n){return0<n.items.length})}(e):cn(t)?function(n){vart=n.split("|");returnS(t,function(n){return{items:n.trim().split(" ")}})}(t):function(n){returnh(n,function(n){returnEn(n,"name")&&En(n,"items")})}(t)?t:(v.console.error("Toolbar type should be string, string[], boolean or ToolbarGroup[]"),[])}functionlB(t,e,o,r,n){returnV(e,o.toLowerCase()).orThunk(function(){returnn.bind(function(n){returnDu(n,function(n){returnV(e,n+o.toLowerCase())})})}).fold(function(){returnV(zD,o.toLowerCase()).map(function(n){returnn(t,r)}).orThunk(function(){returnon.none()})},function(n){returnfunction(t,e){returnV(PD,t.type).fold(function(){returnv.console.error("skipping button defined by",t),on.none()},function(n){returnon.some(n(t,e))})}(n,r)})}functiondB(e,o,r,i){varn=fB(o),t=S(n,function(n){vart=B(n.items,function(n){return0===n.trim().length?[]:lB(e,o.buttons,n,r,i).toArray()});return{title:on.from(e.translate(n.name)),items:t}});returnC(t,function(n){return0<n.items.length})}functionmB(e){return(Sr(e,"position").is("fixed")?on.none():To(e)).orThunk(function(){varn=we.fromTag("span");Ao(e,n);vart=To(n);returnPi(n),t}).map(du).getOrThunk(function(){returnIu(0,0)})}functiongB(t){returnfunction(n){returnn.translate(-t.left(),-t.top())}}functionpB(t){returnfunction(n){returnn.translate(t.left(),t.top())}}functionhB(e){returnfunction(n,t){returnO(e,function(n,t){returnt(n)},Iu(n,t))}}functionvB(n,t,e){returnn.fold(hB([pB(e),gB(t)]),hB([gB(t)]),hB([]))}functionbB(n,t,e){returnn.fold(hB([pB(e)]),hB([]),hB([pB(t)]))}functionyB(n,t,e){returnn.fold(hB([]),hB([gB(e)]),hB([pB(t),gB(e)]))}functionxB(n,t,e){returnn.fold(function(n,t){return{position:"absolute",left:n+"px",top:t+"px"}},function(n,t){return{position:"absolute",left:n-e.left()+"px",top:t-e.top()+"px"}},function(n,t){return{position:"fixed",left:n+"px",top:t+"px"}})}functionwB(n,i,u,a){functiont(o,r){returnfunction(n,t){vare=o(i,u,a);returnr(n.getOr(e.left()),t.getOr(e.top()))}}returnn.fold(t(yB,ZD.offset),t(bB,ZD.absolute),t(vB,ZD.fixed))}functionSB(n,t){vare=n.element();fr(e,t.transitionClass),dr(e,t.fadeOutClass),fr(e,t.fadeInClass),t.onShow(n)}functionCB(n,t){vare=n.element();fr(e,t.transitionClass),dr(e,t.fadeInClass),fr(e,t.fadeOutClass),t.onHide(n)}functionkB(n,t,e){returnD(n,function(n){switch(n){case"bottom":returnfunction(n,t){returnn.bottom()<=t.bottom()}(t,e);case"top":returnfunction(n,t){returnn.y()>=t.y()}(t,e)}})}functionOB(n,t){returnLo(n,t)?on.some(parseInt(zo(n,t),10)):on.none()}functionEB(r,n){returnOB(r,n.leftAttr).bind(function(o){returnOB(r,n.topAttr).map(function(n){vart=mu(r),e=su(r);returnyu(o,n,t,e)})})}functionTB(n,t,e){varo=zo(n,t.positionAttr);switch(function(n,t){jo(n,t.leftAttr),jo(n,t.topAttr),jo(n,t.positionAttr)}(n,t),o){case"static":returnon.some(oA["static"]());case"absolute":returnon.some(oA.absolute(e.x(),e.y()));default:returnon.none()}}functionBB(n,t,e,o,r){vari=xu(n);if(kB(t.modes,i,e))returnon.none();varu=r(),a=wr(n,"position");!function(n,t,e,o,r){Po(n,t.leftAttr,e),Po(n,t.topAttr,o),Po(n,t.positionAttr,r)}(n,t,i.x(),i.y(),a);varc=tA(i.x(),i.y()),s=vB(c,o,u),f=tA(e.x(),e.y()),l=vB(f,o,u),d=i.y()<=e.y()?l.top():l.top()+e.height()-i.height();returnon.some(oA.fixed(s.left(),d))}functionDB(n,t,e,o,r){vari=n.element();returnSr(i,"position").is("fixed")?function(t,e,o){returnEB(t,e).filter(function(n){returnkB(e.modes,n,o)}).bind(function(n){returnTB(t,e,n)})}(i,t,e):BB(i,t,e,o,r)}functionAB(t,n){bn(["left","top","position"],function(n){returnkr(t.element(),n)}),n.onUndocked(t)}function_B(n,t,e,o,r){vari=xB(r,0,o);xr(n.element(),i),("fixed"===i.position?t.onDocked:t.onUndocked)(n)}functionMB(o,n,r,i,u){void0===u&&(u=!1),n.contextual.each(function(e){e.lazyContext(o).each(function(n){vart=function(n,t){returnn.y()<t.bottom()&&n.bottom()>t.y()}(n,i);t!==r.isVisible()&&(r.setVisible(t),u&&!t?(gr(o.element(),[e.fadeOutClass]),e.onHide(o)):(t?SB:CB)(o,e))})})}functionFB(r,i,n){varu=r.element();n.setDocked(!1),function(n,t){vare=n.element();returnEB(e,t).bind(function(n){returnTB(e,t,n)})}(r,i).each(function(n){n.fold(function(){returnAB(r,i)},function(n,t){vare=Co(u),o=(pu(e),mB(u));_B(r,i,0,o,tA(n,t))},Z)}),n.setVisible(!0),i.contextual.each(function(n){pr(u,[n.fadeInClass,n.fadeOutClass,n.transitionClass]),n.onShow(r)}),rA(r,i,n)}functionIB(n,t,e){e.isDocked()&&FB(n,t,e)}functionRB(o){varr=o.element();Eo(r).each(function(n){if(cA.isDocked(o)){vart=mu(n);yr(r,"width",t+"px");vare=fu(r);yr(n,"padding-top",e+"px")}elsekr(r,"width"),kr(n,"padding-top")})}functionVB(n,t){t?(dr(n,sA.fadeOutClass),gr(n,[sA.transitionClass,sA.fadeInClass])):(dr(n,sA.fadeInClass),gr(n,[sA.fadeOutClass,sA.transitionClass]))}functionNB(n,t){vare=we.fromDom(n.getContainer());t?(fr(e,fA),dr(e,lA)):(fr(e,lA),dr(e,fA))}functionHB(i,e){functiono(t){e().each(function(n){returnt(n.element())})}functionn(n){i.inline||RB(n),NB(i,cA.isDocked(n)),n.getSystem().broadcastOn([jf()],{}),e().each(function(n){returnn.getSystem().broadcastOn([jf()],{})})}varr=ye(on.none()),t=i.inline?[]:function(){varn;return[lc.config({channels:(n={},n[mT()]={onReceive:RB},n)})]}();returng([vg.config({}),cA.config({leftAttr:"data-dock-left",topAttr:"data-dock-top",positionAttr:"data-dock-pos",contextual:N({lazyContext:function(n){vart=fu(n.element()),e=i.inline?i.getContentAreaContainer():i.getContainer(),o=xu(we.fromDom(e)),r=o.height()-t;returnon.some(yu(o.x(),o.y(),o.width(),r))},onShow:function(){o(function(n){returnVB(n,!0)})},onShown:function(t){o(function(n){returnpr(n,[sA.transitionClass,sA.fadeInClass])}),r.get().each(function(n){!function(t,e){varo=Co(e);Sa(o).filter(function(n){return!jt(e,n)}).filter(function(n){returnjt(n,we.fromDom(o.dom().body))||Ye(t,n)}).each(function(){returnwa(e)})}(t.element(),n),r.set(on.none())})},onHide:function(n){r.set(function(n,t){returnCa(n).orThunk(function(){returnt().toOption().bind(function(n){returnCa(n.element())})})}(n.element(),e)),o(function(n){returnVB(n,!1)})},onHidden:function(){o(function(n){returnpr(n,[sA.transitionClass])})}},sA),modes:["top"],onDocked:n,onUndocked:n})],t)}functionPB(n){return"<alloy.field."+n+">"}functionzB(n){return{element:function(){returnn.element().dom()}}}functionLB(e,o){varr=S(wn(o),function(n){vart=o[n],e=et(function(n){returntt("sidebar",CA,n)}(t));return{name:n,getApi:zB,onSetup:e.onSetup,onShow:e.onShow,onHide:e.onHide}});returnS(r,function(n){vart=ye(Z);returne.slot(n.name,{dom:{tag:"div",classes:["tox-sidebar__pane"]},behaviours:Jp([Ep(n,t),Tp(n,t),lo(Bi(),function(t,n){vare=n.event();E(r,function(n){returnn.name===e.name()}).each(function(n){(e.visible()?n.onShow:n.onHide)(n.getApi(t))})})])})})}functionjB(n,t){Zl.getCurrent(n).each(function(n){returnmg.set(n,[function(t){returnSA.sketch(function(n){return{dom:{tag:"div",classes:["tox-sidebar__pane-container"]},components:LB(n,t),slotBehaviours:Jp([Ii(function(n){returnSA.hideAllSlots(n)})])}})}(t)])})}functionUB(n){returnZl.getCurrent(n).bind(function(n){returncT.isGrowing(n)||cT.hasGrown(n)?Zl.getCurrent(n).bind(function(t){returnE(SA.getSlotNames(t),function(n){returnSA.isShowing(t,n)})}):on.none()})}functionWB(n,t,e){varo=n.element();!0===t?(mg.set(n,[function(n){return{dom:{tag:"div",attributes:{"aria-label":n.translate("Loading...")},classes:["tox-throbber__busy-spinner"]},components:[{dom:cp('<div class="tox-spinner"><div></div><div></div><div></div></div>')}],behaviours:ba([lg.config({mode:"special",onTab:function(){returnon.some(!0)},onShiftTab:function(){returnon.some(!0)}}),vg.config({})])}}(e)]),kr(o,"display"),jo(o,"aria-hidden")):(mg.set(n,[]),yr(o,"display","none"),Po(o,"aria-hidden","true"))}functionGB(n){return"string"==typeofn?n.split(" "):n}functionXB(e,o){varr=An(IA,o.menus),t=0<wn(o.menus).length,n=o.menubar===undefined||!0===o.menubar?GB("file edit view insert format tools table help"):GB(!1===o.menubar?"":o.menubar),i=C(n,function(n){returnt&&o.menus.hasOwnProperty(n)&&o.menus[n].hasOwnProperty("items")||IA.hasOwnProperty(n)}),u=S(i,function(n){vart=r[n];returnfunction(n,e,t){varo=function(n){returnn.getParam("removed_menuitems","")}(t).split(/[ ,]/);return{text:n.title,getItems:function(){returnB(n.items,function(n){vart=n.toLowerCase();return0===t.trim().length?[]:x(o,function(n){returnn===t})?[]:"separator"===t||"|"===t?[{type:"separator"}]:e.menuItems[t]?[e.menuItems[t]]:[]})}}}({title:t.title,items:GB(t.items)},o,e)});returnC(u,function(n){return0<n.getItems().length&&x(n.getItems(),function(n){return"separator"!==n.type})})}functionYB(n,t){vare,o=function(n){vart=n.settings,e=t.skin,o=t.skin_url;if(!1!==e){varr=e||"oxide";o=o?n.documentBaseURI.toAbsolute(o):Gb.baseURL+"/skins/ui/"+r}returno}(t);o&&(e=o+"/skin.min.css",t.contentCSS.push(o+(n?"/content.inline":"/content")+".min.css")),!1===function(n){return!1===n.getParam("skin")}(t)&&e?Rh.DOM.styleSheetLoader.load(e,RA(t)):RA(t)()}functionqB(t,n,e,o){varr=n.outerContainer,i=e.toolbar,u=e.buttons;if(h(i,cn)){vara=i.map(function(n){returndB(t,{toolbar:n,buttons:u},{backstage:o},on.none())});FA.setToolbars(r,a)}elseFA.setToolbar(r,dB(t,e,{backstage:o},on.none()))}functionKB(n){returnfunction(n){vart=Fb(n),e=Vb(n),o=Hb(n);returnUA(t).map(function(n){returnjA(n,e,o)})}(n).getOr(Fb(n))}functionJB(n){vart=Ib(n),e=Rb(n),o=Nb(n);returnUA(t).map(function(n){returnjA(n,e,o)})}function$B(n,t){returnfunction(){n.execCommand("mceToggleFormat",!1,t)}}functionQB(n){!function(e){yk.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(n,t){e.ui.registry.addToggleButton(n.name,{tooltip:n.text,icon:n.icon,onSetup:fE(e,n.name),onAction:$B(e,n.name)})});for(varn=1;n<=6;n++){vart="h"+n;e.ui.registry.addToggleButton(t,{text:t.toUpperCase(),tooltip:"Heading "+n,onSetup:fE(e,t),onAction:$B(e,t)})}}(n),function(t){yk.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(n){t.ui.registry.addButton(n.name,{tooltip:n.text,icon:n.icon,onAction:function(){returnt.execCommand(n.action)}})})}(n),function(t){yk.each([{name:"blockquote",text:"Blockquote",action:"mceBlockQuote",icon:"quote"}],function(n){t.ui.registry.addToggleButton(n.name,{tooltip:n.text,icon:n.icon,onAction:function(){returnt.execCommand(n.action)},onSetup:fE(t,n.name)})})}(n)}functionZB(n,t,e){functiono(){return!!t.undoManager&&t.undoManager[e]()}functionr(){n.setDisabled(t.readonly||!o())}returnn.setDisabled(!o()),t.on("Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",r),function(){returnt.off("Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",r)}}functionnD(n,t){return{anchor:"makeshift",x:n,y:t}}functiontD(n){return"longpress"===n.type||0===n.type.indexOf("touch")}functioneD(n,t){vare=Rh.DOM.getPos(n);returnfunction(n,t,e){returnnD(n.x+t,n.y+e)}(t,e.x,e.y)}functionoD(n,t){return"contextmenu"===t.type?n.inline?function(n){if(tD(n)){vart=n.touches[0];returnnD(t.pageX,t.pageY)}returnnD(n.pageX,n.pageY)}(t):eD(n.getContentAreaContainer(),function(n){if(tD(n)){vart=n.touches[0];returnnD(t.clientX,t.clientY)}returnnD(n.clientX,n.clientY)}(t)):ZA(n)}functionrD(n){return{anchor:"node",node:on.some(we.fromDom(n.selection.getNode())),root:we.fromDom(n.getBody())}}functioniD(n,t,e,o,r,i){varu=e(),a=function(n,t,e){returne?rD(n):oD(n,t)}(n,t,i);NC(u,Fh.CLOSE_ON_EXECUTE,o,!1).map(function(n){t.preventDefault(),jg.showMenuAt(r,a,{menu:{markers:wv("normal")},data:n})})}functionuD(t,e,n,o,r,i){varu=function(n,t){vare=t?rD(n):ZA(n);returnN({bubble:Oa(0,12,t_),layouts:n_,overrides:{maxWidthFunction:RE(),maxHeightFunction:Cf()}},e)}(t,i);NC(n,Fh.CLOSE_ON_EXECUTE,o,!0).map(function(n){e.preventDefault(),jg.showMenuWithinBounds(r,u,{menu:{markers:wv("normal")},data:n,type:"horizontal"},function(){returnon.some(cE(t))}),t.fire(YE)})}functionaD(t,e,o,r,i,u){functionn(){varn=o();uD(t,e,n,r,i,u)}vara=Ht(),c=a.os.isiOS(),s=a.os.isOSX(),f=a.os.isAndroid();if(!s&&!c||u)f&&!u&&t.selection.setCursorLocation(e.target,0),n();else{varl=function(){!function(n){functiont(){qg.setEditorTimeout(n,function(){n.selection.setRng(e)},10),i()}vare=n.selection.getRng();n.once("touchend",t);functiono(n){n.preventDefault(),n.stopImmediatePropagation()}n.on("mousedown",o,!0);functionr(){returni()}n.once("longpresscancel",r);vari=function(){n.off("touchend",t),n.off("longpresscancel",r),n.off("mousedown",o)}}(t),n()};!function(n,t){vare=n.selection;if(e.isCollapsed()||t.touches.length<1)return!1;varo=t.touches[0],r=e.getRng();returnUc(n.getWin(),Tc.domRange(r)).exists(function(n){returnn.left()<=o.clientX&&n.right()>=o.clientX&&n.top()<=o.clientY&&n.bottom()>=o.clientY})}(t,e)?(t.once("selectionchange",l),t.once("touchend",function(){returnt.off("selectionchange",l)})):l()}}functioncD(n){return"string"==typeofn?n.split(/[ ,]/):n}functionsD(n){returncn(n)?"|"===n:"separator"===n.type}functionfD(n,t){if(0===t.length)returnn;vare=F(n).filter(function(n){return!sD(n)}).fold(function(){return[]},function(n){return[i_]});returnn.concat(e).concat(t).concat([i_])}functionlD(i,n,t){functione(n){returnjg.hide(a)}functiono(o){varn="longpress"===o.type;if(e_(i)&&o.preventDefault(),!function(n,t){returnt.ctrlKey&&!e_(n)}(i,o)&&!r_(i)){varr=!n&&(2!==o.button||o.target===i.getBody());(u()?aD:iD)(i,o,function(){varn=r?i.selection.getStart(!0):o.target,t=i.ui.registry.getAll(),e=o_(i);returnfunction(r,n,i){vart=O(n,function(n,t){if(En(r,t)){vare=r[t].update(i);if(cn(e))returnfD(n,e.split(" "));if(0<e.length){varo=S(e,u_);returnfD(n,o)}returnn}returnn.concat([t])},[]);return0<t.length&&sD(t[t.length-1])&&t.pop(),t}(t.contextMenus,e,n)},t,a,r)}}varu=Ht().deviceType.isTouch,a=uu(jg.sketch({dom:{tag:"div"},lazySink:n,onEscape:function(){returni.focus()},onShow:function(){returnt.setContextMenuState(!0)},onHide:function(){returnt.setContextMenuState(!1)},fireDismissalEventInstead:{},inlineBehaviours:ba([Kd("dismissContextMenu",[lo(Oi(),function(n,t){zf.close(n),i.focus()})])])}));i.on("init",function(){varn="ResizeEditor ScrollContent ScrollWindow longpresscancel"+(u()?"":" ResizeWindow");i.on(n,e),i.on(u()?"longpress":"longpress contextmenu",o)})}functiondD(n,t){n.getSystem().addToGui(t),function(n){Eo(n.element()).filter(Hr).each(function(t){Sr(t,"z-index").each(function(n){Po(t,a_,n)}),yr(t,"z-index",wr(n.element(),"z-index"))})}(t)}functionmD(n){!function(n){Eo(n.element()).filter(Hr).each(function(n){vart=zo(n,a_);Lo(n,a_)?yr(n,"z-index",t):kr(n,"z-index"),jo(n,a_)})}(n),n.getSystem().removeFromGui(n)}functiongD(n,t,e){returnn.getSystem().build(Wb.sketch({dom:{styles:{left:"0px",top:"0px",width:"100%",height:"100%",position:"fixed","z-index":"1000000000000000"},classes:[t]},events:e}))}functionpD(n,t,e,o){returnfunction(n,t){vare=n.element(),o=parseInt(zo(e,t.leftAttr),10),r=parseInt(zo(e,t.topAttr),10);returnisNaN(o)||isNaN(r)?on.none():on.some(Iu(o,r))}(n,t).fold(function(){returne},function(n){returneA(n.left()+o.left(),n.top()+o.top())})}functionhD(n,t,e,o,r,i){varu=pD(n,t,e,o),a=t.mustSnap?f_(n,t,u,r,i):l_(n,t,u,r,i),c=vB(u,r,i);returnfunction(n,t,e){varo=n.element();Po(o,t.leftAttr,e.left()+"px"),Po(o,t.topAttr,e.top()+"px")}(n,t,c),a.fold(function(){return{coord:eA(c.left(),c.top()),extra:on.none()}},function(n){return{coord:n.output(),extra:n.extra()}})}functionvD(n,t){!function(n,t){vare=n.element();jo(e,t.leftAttr),jo(e,t.topAttr)}(n,t)}functionbD(n,e,o,r){returnDu(n,function(n){vart=n.sensor();returnfunction(n,t,e,o,r,i){varu=bB(n,r,i),a=bB(t,r,i);returnMath.abs(u.left()-a.left())<=e&&Math.abs(u.top()-a.top())<=o}(e,t,n.range().left(),n.range().top(),o,r)?on.some({output:nn(wB(n.output(),e,o,r)),extra:n.extra}):on.none()})}functionyD(t){returnfunction(n,t,e,o){returnn.isSome()&&t.isSome()&&e.isSome()?on.some(o(n.getOrDie(),t.getOrDie(),e.getOrDie())):on.none()}(Sr(t,"left"),Sr(t,"top"),Sr(t,"position"),function(n,t,e){return("fixed"===e?eA:nA)(parseInt(n,10),parseInt(t,10))}).getOrThunk(function(){varn=du(t);returntA(n.left(),n.top())})}functionxD(e,n,o,r,i,u,t){returnfunction(n,t,e,o,r){vari=r.bounds,u=bB(t,e,o),a=us(u.left(),i.x(),i.x()+i.width()-r.width),c=us(u.top(),i.y(),i.y()+i.height()-r.height),s=tA(a,c);returnt.fold(function(){varn=yB(s,e,o);returnnA(n.left(),n.top())},function(){returns},function(){varn=vB(s,e,o);returneA(n.left(),n.top())})}(0,n.fold(function(){varn=function(n,e,o){returnn.fold(function(n,t){returnZD.offset(n+e,t+o)},function(n,t){returnZD.absolute(n+e,t+o)},function(n,t){returnZD.fixed(n+e,t+o)})}(o,u.left(),u.top()),t=vB(n,r,i);returneA(t.left(),t.top())},function(t){varn=hD(e,t,o,u,r,i);returnn.extra.each(function(n){t.onSensor(e,n)}),n.coord}),r,i,t)}functionwD(n,t){return{bounds:n.getBounds(),height:fu(t.element()),width:gu(t.element())}}functionSD(t,e,n,o,r){vari=n.update(o,r),u=n.getStartData().getOrThunk(function(){returnwD(e,t)});i.each(function(n){!function(n,t,e,o){varr=t.getTarget(n.element());if(t.repositionTarget){vari=Co(n.element()),u=pu(i),a=mB(r),c=yD(r),s=xD(n,t.snaps,c,u,a,o,e),f=xB(s,0,a);xr(r,f)}t.onDrag(n,r,o)}(t,e,u,n)})}functionCD(t,n,e,o){n.each(mD),e.snaps.each(function(n){vD(t,n)});varr=e.getTarget(t.element());o.reset(),e.onDrop(t,r)}functionkD(n){returnfunction(t,e){functiono(n){e.setStartData(wD(t,n))}returnco(g([lo(wi(),function(n){e.getStartData().each(function(){returno(n)})})],n(t,e,o)))}}functionOD(u,a,c){return[lo(Yr(),function(t,n){if(0===n.event().raw().button){n.stop();vare=function(){returnCD(t,on.some(i),u,a)},o=hb(e,200),r={drop:e,delayDrop:o.schedule,forceDrop:e,move:function(n){o.cancel(),SD(t,u,a,d_,n)}},i=gD(t,u.blockerClass,function(e){returnco([lo(Yr(),e.forceDrop),lo(Jr(),e.drop),lo(qr(),function(n,t){e.move(t.event())}),lo(Kr(),e.delayDrop)])}(r));c(t),dD(t,i)}})]}functionED(i,u,a){varc=ye(on.none());return[lo(Ur(),function(t,n){n.stop();functione(){CD(t,c.get(),i,u),c.set(on.none())}varo={drop:e,delayDrop:function(){},forceDrop:e,move:function(n){SD(t,i,u,g_,n)}},r=gD(t,i.blockerClass,function(e){returnco([lo(Ur(),e.forceDrop),lo(Gr(),e.drop),lo(Xr(),e.drop),lo(Wr(),function(n,t){e.move(t.event())})])}(o));c.set(on.some(r));a(t),dD(t,r)}),lo(Wr(),function(n,t){t.stop(),SD(n,i,u,g_,t.event())}),lo(Gr(),function(n,t){t.stop(),CD(n,c.get(),i,u),c.set(on.none())}),lo(Xr(),function(n){CD(n,c.get(),i,u),c.set(on.none())})]}functionTD(n,r,i,u,t,e){returnn.fold(function(){returnw_.snap({sensor:tA(i-20,u-20),range:Iu(t,e),output:tA(on.some(i),on.some(u)),extra:{td:r}})},function(n){vart=i-20,e=u-20,o=n.element().dom().getBoundingClientRect();returnw_.snap({sensor:tA(t,e),range:Iu(40,40),output:tA(on.some(i-o.width/2),on.some(u-o.height/2)),extra:{td:r}})})}functionBD(n,o,r){return{getSnapPoints:n,leftAttr:"data-drag-left",topAttr:"data-drag-top",onSensor:function(n,t){vare=t.td;!function(n,t){returnn.exists(function(n){returnjt(n,t)})}(o.get(),e)&&(o.set(on.some(e)),r(e))},mustSnap:!0}}functionDD(n){returnvm(Gg.sketch({dom:{tag:"div",classes:["tox-selector"]},buttonBehaviours:ba([w_.config({mode:"mouseOrTouch",blockerClass:"blocker",snaps:n}),Ew.config({})]),eventOrder:{mousedown:["dragging","alloy.base.behaviour"],touchstart:["dragging","alloy.base.behaviour"]}}))}varAD,_D,MD,FD,ID,RD=[{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"}],VD=["-apple-system","Segoe UI","Roboto","Helvetica Neue","sans-serif"],ND={"8pt":"1","10pt":"2","12pt":"3","14pt":"4","18pt":"5","24pt":"6","36pt":"7"},HD=[{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"]}],PD={button:sB(JO,function(n,t){returnfunction(n,t){returnWT(n,t,[])}(n,t.backstage.shared.providers)}),togglebutton:sB(QO,function(n,t){returnfunction(n,t){returnGT(n,t,[])}(n,t.backstage.shared.providers)}),menubutton:sB($O,function(n,t){returnPC(n,"tox-tbtn",t.backstage,on.none())}),splitbutton:sB(function(n){returntt("SplitButton",xT,n)},function(n,t){returnrE(n,t.backstage.shared)}),styleSelectButton:function(n,t){returnfunction(n,t){vare=N({type:"advanced"},t.styleselect);returnmE(n,t,cB(n,e))}(n,t.backstage)},fontsizeSelectButton:function(n,t){returnfunction(n,t){returnmE(n,t,rB(n))}(n,t.backstage)},fontSelectButton:function(n,t){returnfunction(n,t){returnmE(n,t,eB(n))}(n,t.backstage)},formatButton:function(n,t){returnfunction(n,t){returnmE(n,t,aB(n))}(n,t.backstage)},alignMenuButton:function(n,t){returnfunction(n,t){returnmE(n,t,nB(n))}(n,t.backstage)}},zD={styleselect:PD.styleSelectButton,fontsizeselect:PD.fontsizeSelectButton,fontselect:PD.fontSelectButton,formatselect:PD.formatButton,align:PD.alignMenuButton},LD={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"]},jD={maxHeightFunction:Cf(),maxWidthFunction:RE()},UD={onLtr:function(){return[oc,rc,ca,ua,sa,aa,Ug,Wg,pm,mm,hm,gm]},onRtl:function(){return[oc,rc,sa,aa,ca,ua,Ug,Wg,hm,gm,pm,mm]}},WD={onLtr:function(){return[rc,ua,aa,ca,sa,oc,Ug,Wg,pm,mm,hm,gm]},onRtl:function(){return[rc,aa,ua,sa,ca,oc,Ug,Wg,hm,gm,pm,mm]}},GD=function(u,n,e,a){functionc(){returncE(u)}functions(){if(l()&&a.backstage.isContextMenuOpen())return!0;varn=function(){varn=g.get().map(function(n){returnn.getBoundingClientRect()}).getOrThunk(function(){returnu.selection.getRng().getBoundingClientRect()}),t=u.inline?pu().top():wu(we.fromDom(u.getBody())).y();return{y:n.top+t,bottom:n.bottom+t}}(),t=c();return!function(n,t,e,o){returnMath.max(n,e)<=Math.min(t,o)}(n.y,n.bottom,t.y(),t.bottom())}functiont(){jg.hide(d)}functiono(){m.get().each(function(n){vart=d.element();kr(t,"display"),s()?yr(t,"display","none"):Af.positionWithinBounds(e,n,d,on.some(c()))})}functionf(n){return{dom:{tag:"div",classes:["tox-pop__dialog"]},components:[n],behaviours:ba([lg.config({mode:"acyclic"}),Kd("pop-dialog-wrap-events",[Ii(function(n){u.shortcuts.add("ctrl+F9","focus statusbar",function(){returnlg.focusIn(n)})}),Ri(function(n){u.shortcuts.remove("ctrl+F9")})])])}}varl=Ht().deviceType.isTouch,d=uu(function(n){vare=ye([]);returnjg.sketch({dom:{tag:"div",classes:["tox-pop"]},fireDismissalEventInstead:{event:"doNotDismissYet"},onShow:function(n){e.set([]),jg.getContent(n).each(function(n){kr(n.element(),"visibility")}),dr(n.element(),QT),kr(n.element(),"width")},inlineBehaviours:ba([Kd("context-toolbar-events",[bo(ii(),function(n,t){jg.getContent(n).each(function(n){}),dr(n.element(),QT),kr(n.element(),"width")}),lo($T,function(t,e){kr(t.element(),"width");varn=mu(t.element());jg.setContent(t,e.event().contents()),fr(t.element(),QT);varo=mu(t.element());yr(t.element(),"width",n+"px"),jg.getContent(t).each(function(n){e.event().focus().bind(function(n){returnwa(n),Ca(t.element())}).orThunk(function(){returnlg.focusIn(n),Sa()})}),qg.setTimeout(function(){yr(t.element(),"width",o+"px")},0)}),lo(KT,function(n,t){jg.getContent(n).each(function(n){e.set(e.get().concat([{bar:n,focus:Sa()}]))}),ro(n,$T,{contents:t.event().forwardContents(),focus:on.none()})}),lo(JT,function(t,n){F(e.get()).each(function(n){e.set(e.get().slice(0,e.get().length-1)),ro(t,$T,{contents:au(n.bar),focus:n.focus})})})]),lg.config({mode:"special",onEscape:function(t){returnF(e.get()).fold(function(){returnn.onEscape()},function(n){returnoo(t,JT),on.some(!0)})}})]),lazySink:function(){returnan.value(n.sink)}})}({sink:e,onEscape:function(){returnu.focus(),on.some(!0)}})),m=ye(on.none()),g=ye(on.none()),r=ye(null),p=L(function(){returnqT(n,function(n){vart=h(n);ro(d,KT,{forwardContents:f(t)})})}),h=function(n){vart,e,o=u.ui.registry.getAll().buttons,r=Yb(u)===jb.scrolling?jb.scrolling:jb["default"],i=p();return"contexttoolbar"===n.type?(t=An(o,i.formNavigators),e=dB(u,{buttons:t,toolbar:n.items},a,on.some(["form:"])),KO({type:r,uid:Xo("context-toolbar"),initGroups:e,onEscape:on.none,cyclicKeying:!0,backstage:a.backstage,getSink:function(){returnan.error("")}})):XT(r,n,a.backstage)};u.on("contexttoolbar-show",function(t){varn=p();Nn(n.lookupTable,t.toolbarKey).each(function(n){y(n,t.target===u?on.none():on.some(t)),jg.getContent(d).each(lg.focusIn)})});functionv(n,t){vare="node"===n?a.backstage.shared.anchors.node(t):a.backstage.shared.anchors.cursor();returnDn(e,function(n,t){return"line"===n?{bubble:Oa(12,0,LD),layouts:{onLtr:function(){return[fa]},onRtl:function(){return[la]}},overrides:jD}:{bubble:Oa(0,12,LD),layouts:t?WD:UD,overrides:jD}}(n,l()))}functioni(){varn=p();YT(n,u).fold(function(){m.set(on.none()),jg.hide(d)},function(n){y(n.toolbarApi,on.some(n.elem.dom()))})}functionb(n){x(),r.set(n)}vary=function(n,t){if(x(),!l()||!a.backstage.isContextMenuOpen()){vare=h(n),o=t.map(we.fromDom),r=v(n.position,o);m.set(on.some(r)),g.set(t);vari=d.element();kr(i,"display"),jg.showWithinBounds(d,r,f(e),function(){returnon.some(c())}),s()&&yr(i,"display","none")}},x=function(){varn=r.get();null!==n&&(qg.clearTimeout(n),r.set(null))};u.on("init",function(){u.on(YE,t),u.on("ScrollContent ScrollWindow longpress",o),u.on("click keyup SetContent ObjectResized ResizeEditor",function(n){b(qg.setEditorTimeout(u,i,0))}),u.on("focusout",function(n){qg.setEditorTimeout(u,function(){Ca(e.element()).isNone()&&Ca(d.element()).isNone()&&(m.set(on.none()),jg.hide(d))},0)}),u.on("SwitchMode",function(){u.readonly&&(m.set(on.none()),jg.hide(d))}),u.on("NodeChange",function(n){Ca(d.element()).fold(function(){b(qg.setEditorTimeout(u,i,0))},function(n){})})})},XD=function(n,o,r){functiont(t,e){bn([o,r],function(n){n.broadcastEvent(t,e)})}functione(t,e){bn([o,r],function(n){n.broadcastOn([t],e)})}functioni(n){returne(Lf(),{target:n.target()})}functionu(n){returne(Lf(),{target:we.fromDom(n.target)})}functiona(n){0===n.button&&e(Uf(),{target:we.fromDom(n.target)})}functionc(n){returnt(wi(),pb(n))}functions(n){e(jf(),{}),t(Si(),pb(n))}functionf(){returne(jf(),{})}varl=sb(we.fromDom(v.document),"touchstart",i),d=sb(we.fromDom(v.document),"touchmove",function(n){returnt(yi(),n)}),m=sb(we.fromDom(v.document),"touchend",function(n){returnt(xi(),n)}),g=sb(we.fromDom(v.document),"mousedown",i),p=sb(we.fromDom(v.document),"mouseup",function(n){0===n.raw().button&&e(Uf(),{target:n.target()})});n.on("PostRender",function(){n.on("click",u),n.on("tap",u),n.on("mouseup",a),n.on("ScrollWindow",c),n.on("ResizeWindow",s),n.on("ResizeEditor",f)}),n.on("remove",function(){n.off("click",u),n.off("tap",u),n.off("mouseup",a),n.off("ScrollWindow",c),n.off("ResizeWindow",s),n.off("ResizeEditor",f),g.unbind(),l.unbind(),d.unbind(),m.unbind(),p.unbind()}),n.on("detach",function(){ws(o),ws(r),o.destroy(),r.destroy()})},YD=Tl,qD=Ol,KD=nn([St("shell",!1),ct("makeItem"),St("setupItem",Z),nl("listBehaviours",[mg])]),JD=Sl({name:"items",overrides:function(n){return{behaviours:ba([mg.config({})])}}}),$D=nn([JD]),QD=Al({name:nn("CustomList")(),configFields:KD(),partFields:$D(),factory:function(s,n,t,e){varo=s.shell?{behaviours:[mg.config({})],components:[]}:{behaviours:[],components:n},r=function(n){returns.shell?on.some(n):qs(n,s,"items")};return{uid:s.uid,dom:s.dom,components:o.components,behaviours:Rs(s.listBehaviours,o.behaviours),apis:{setItems:function(a,c){r(a).fold(function(){throwv.console.error("Custom List was defined to not be a shell, but no item container was specified in components"),newError("Custom List was defined to not be a shell, but no item container was specified in components")},function(t){varn=mg.contents(t),e=c.length,o=e-n.length,r=0<o?function(n,t){for(vare=[],o=0;o<n;o++)e.push(t(o));returne}(o,function(){returns.makeItem()}):[],i=n.slice(e);bn(i,function(n){returnmg.remove(t,n)}),bn(r,function(n){returnmg.append(t,n)});varu=mg.contents(t);bn(u,function(n,t){s.setupItem(a,n,c[t],t)})})}}}},apis:{setItems:function(n,t,e){n.setItems(t,e)}}}),ZD=Tn([{offset:["x","y"]},{absolute:["x","y"]},{fixed:["x","y"]}]),nA=ZD.offset,tA=ZD.absolute,eA=ZD.fixed,oA=Tn([{"static":[]},{absolute:["x","y"]},{fixed:["x","y"]}]),rA=function(n,t,e){n.getSystem().isConnected()&&function(e,o,r){vari=o.lazyViewport(e),n=e.element(),t=Co(n),u=pu(t),a=L(function(){returnmB(n)}),c=r.isDocked();c&&MB(e,o,r,i),DB(e,o,i,u,a).each(function(n){r.setDocked(!c),n.fold(function(){returnAB(e,o)},function(n,t){return_B(e,o,0,a(),tA(n,t))},function(n,t){MB(e,o,r,i,!0),_B(e,o,0,a(),eA(n,t))})})}(n,t,e)},iA=/* */Object.freeze({refresh:rA,reset:IB,isDocked:function(n,t,e){returne.isDocked()}}),uA=/* */Object.freeze({events:function(o,r){returnco([bo(ii(),function(t,e){o.contextual.each(function(n){mr(t.element(),n.transitionClass)&&(pr(t.element(),[n.transitionClass,n.fadeInClass]),(r.isVisible()?n.onShown:n.onHidden)(t));e.stop()})}),lo(wi(),function(n,t){rA(n,o,r)}),lo(Si(),function(n,t){IB(n,o,r)})])}}),aA=[wt("contextual",[ft("fadeInClass"),ft("fadeOutClass"),ft("transitionClass"),dt("lazyContext"),qu("onShow"),qu("onShown"),qu("onHide"),qu("onHidden")]),Bt("lazyViewport",Su),ft("leftAttr"),ft("topAttr"),ft("positionAttr"),(AD="modes",_D=["top","bottom"],MD=ge,Ct(AD,_D,Kn(MD))),qu("onDocked"),qu("onUndocked")],cA=ya({fields:aA,name:"docking",active:uA,apis:iA,state:/* */Object.freeze({init:function(){vart=ye(!1),e=ye(!0);returnnu({isDocked:function(){returnt.get()},setDocked:function(n){returnt.set(n)},isVisible:function(){returne.get()},setVisible:function(n){returne.set(n)},readState:function(){return"docked: "+t.get()+", visible: "+e.get()}})}})}),sA={fadeInClass:"tox-editor-dock-fadein",fadeOutClass:"tox-editor-dock-fadeout",transitionClass:"tox-editor-dock-transition"},fA="tox-tinymce--toolbar-sticky-on",lA="tox-tinymce--toolbar-sticky-off",dA=/* */Object.freeze({setup:function(n,t){n.inline||(n.on("ResizeWindow ResizeEditor ResizeContent",function(){t().each(RB)}),n.on("SkinLoaded",function(){t().each(cA.reset)}),n.on("FullscreenStateChanged",function(){t().each(cA.refresh)})),n.on("PostRender",function(){NB(n,!1)})},isDocked:function(n){returnn().map(cA.isDocked).getOr(!1)},getBehaviours:HB}),mA=Z,gA=u,pA=nn([]),hA=/* */Object.freeze({setup:mA,isDocked:gA,getBehaviours:pA}),vA=Dl({factory:function(t,o){varn={focus:lg.focusIn,setMenus:function(n,t){vare=S(t,function(t){varn={type:"menubutton",text:t.text,fetch:function(n){n(t.getItems())}},e=$O(n).mapError(function(n){returnle(n)}).getOrDie();returnPC(e,"tox-mbtn",o.backstage,on.some("menuitem"))});mg.set(n,e)}};return{uid:t.uid,dom:t.dom,components:[],behaviours:ba([mg.config({}),Kd("menubar-events",[Ii(function(n){t.onSetup(n)}),lo($r(),function(e,n){ku(e.element(),".tox-mbtn--active").each(function(t){Ou(n.event().target(),".tox-mbtn").each(function(n){jt(t,n)||e.getSystem().getByDom(t).each(function(t){e.getSystem().getByDom(n).each(function(n){Ow.expand(n),Ow.close(t),vg.focus(n)})})})})}),lo(Ti(),function(e,n){n.event().prevFocus().bind(function(n){returne.getSystem().getByDom(n).toOption()}).each(function(t){n.event().newFocus().bind(function(n){returne.getSystem().getByDom(n).toOption()}).each(function(n){Ow.isOpen(t)&&(Ow.expand(n),Ow.close(t))})})})]),lg.config({mode:"flow",selector:".tox-mbtn",onEscape:function(n){returnt.onEscape(n),on.some(!0)}}),Gy.config({})]),apis:n,domModification:{attributes:{role:"menubar"}}}},name:"silver.Menubar",configFields:[ct("dom"),ct("uid"),ct("onEscape"),ct("backstage"),St("onSetup",Z)],apis:{focus:function(n,t){n.focus(t)},setMenus:function(n,t,e){n.setMenus(t,e)}}}),bA="container",yA=[Fs("slotBehaviours",[])],xA=function(r,n,t){functione(n){returnQs(r)}functiono(e,o){returnvoid0===o&&(o=undefined),function(n,t){returnqs(n,r,t).map(function(n){returne(n,t)}).getOr(o)}}functioni(n,t){return"true"!==zo(n.element(),"aria-hidden")}varu,a=o(i,!1),c=o(function(n,t){if(i(n)){vare=n.element();yr(e,"display","none"),Po(e,"aria-hidden","true"),ro(n,Bi(),{name:t,visible:!1})}}),s=(u=c,function(t,n){bn(n,function(n){returnu(t,n)})}),f=o(function(n,t){if(!i(n)){vare=n.element();kr(e,"display"),jo(e,"aria-hidden"),ro(n,Bi(),{name:t,visible:!0})}}),l={getSlotNames:e,getSlot:function(n,t){returnqs(n,r,t)},isShowing:a,hideSlot:c,hideAllSlots:function(n){returns(n,e())},showSlot:f};return{uid:r.uid,dom:r.dom,components:n,behaviours:Is(r.slotBehaviours),apis:l}},wA=P({getSlotNames:function(n,t){returnn.getSlotNames(t)},getSlot:function(n,t,e){returnn.getSlot(t,e)},isShowing:function(n,t,e){returnn.isShowing(t,e)},hideSlot:function(n,t,e){returnn.hideSlot(t,e)},hideAllSlots:function(n,t){returnn.hideAllSlots(t)},showSlot:function(n,t,e){returnn.showSlot(t,e)}},$o),SA=N(N({},wA),{sketch:function(n){vare,t=(e=[],{slot:function(n,t){returne.push(n),Us(bA,PB(n),t)},record:function(){returne}}),o=n(t),r=t.record(),i=S(r,function(n){returnxl({name:n,pname:PB(n)})});returnof(bA,yA,i,xA,o)}}),CA=re([yt("icon"),yt("tooltip"),Bt("onShow",Z),Bt("onHide",Z),Bt("onSetup",function(){returnZ})]),kA=Xo("FixSizeEvent"),OA=Xo("AutoSizeEvent"),EA=qD.optional({factory:vA,name:"menubar",schema:[ct("backstage")]}),TA=qD.optional({factory:{sketch:function(n){returnQD.sketch({uid:n.uid,dom:n.dom,listBehaviours:ba([lg.config({mode:"acyclic",selector:".tox-toolbar"})]),makeItem:function(){returnKO({type:n.split,uid:Xo("multiple-toolbar-item"),backstage:n.backstage,cyclicKeying:!1,getSink:n.getSink,initGroups:[],onEscape:function(){returnon.none()}})},setupItem:function(n,t,e,o){JE.setGroups(t,e)},shell:!0})}},name:"multiple-toolbar",schema:[ct("dom"),ct("onEscape")]}),BA=qD.optional({factory:{sketch:function(n){returnfunction(n){returnn.split===jb.sliding?qO:n.split===jb.floating?YO:KO}(n)({type:n.split,uid:n.uid,onEscape:function(){returnn.onEscape(),on.some(!0)},cyclicKeying:!1,initGroups:[],getSink:n.getSink,backstage:n.backstage,moreDrawerData:{lazyToolbar:n.lazyToolbar,lazyMoreButton:n.lazyMoreButton,lazyHeader:n.lazyHeader}})}},name:"toolbar",schema:[ct("dom"),ct("onEscape"),ct("getSink")]}),DA=qD.optional({factory:{sketch:function(n){vart=n.editor,e=n.sticky?HB:pA;return{uid:n.uid,dom:n.dom,components:n.components,behaviours:ba(e(t,n.getSink))}}},name:"header",schema:[ct("dom")]}),AA=qD.optional({name:"socket",schema:[ct("dom")]}),_A=qD.optional({factory:{sketch:function(n){return{uid:n.uid,dom:{tag:"div",classes:["tox-sidebar"],attributes:{role:"complementary"}},components:[{dom:{tag:"div",classes:["tox-sidebar__slider"]},components:[],behaviours:ba([Gy.config({}),vg.config({}),cT.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(n){Zl.getCurrent(n).each(SA.hideAllSlots),oo(n,OA)},onGrown:function(n){oo(n,OA)},onStartGrow:function(n){ro(n,kA,{width:Sr(n.element(),"width").getOr("")})},onStartShrink:function(n){ro(n,kA,{width:mu(n.element())+"px"})}}),mg.config({}),Zl.config({find:function(n){vart=mg.contents(n);returnyn(t)}})])}],behaviours:ba([SS(0),Kd("sidebar-sliding-events",[lo(kA,function(n,t){yr(n.element(),"width",t.event().width())}),lo(OA,function(n,t){kr(n.element(),"width")})])])}}},name:"sidebar",schema:[ct("dom")]}),MA=qD.optional({factory:{sketch:function(n){return{uid:n.uid,dom:{tag:"div",attributes:{"aria-hidden":"true"},classes:["tox-throbber"],styles:{display:"none"}},behaviours:ba([mg.config({})]),components:[]}}},name:"throbber",schema:[ct("dom")]}),FA=Al({name:"OuterContainer",factory:function(e,n,t){varo={getSocket:function(n){returnYD.getPart(n,e,"socket")},setSidebar:function(n,t){YD.getPart(n,e,"sidebar").each(function(n){returnjB(n,t)})},toggleSidebar:function(n,t){YD.getPart(n,e,"sidebar").each(function(n){returnfunction(n,e){Zl.getCurrent(n).each(function(t){Zl.getCurrent(t).each(function(n){cT.hasGrown(t)?SA.isShowing(n,e)?cT.shrink(t):(SA.hideAllSlots(n),SA.showSlot(n,e)):(SA.hideAllSlots(n),SA.showSlot(n,e),cT.grow(t))})})}(n,t)})},whichSidebar:function(n){returnYD.getPart(n,e,"sidebar").bind(UB).getOrNull()},getHeader:function(n){returnYD.getPart(n,e,"header")},getToolbar:function(n){returnYD.getPart(n,e,"toolbar")},setToolbar:function(n,t){YD.getPart(n,e,"toolbar").each(function(n){n.getApis().setGroups(n,t)})},setToolbars:function(n,t){YD.getPart(n,e,"multiple-toolbar").each(function(n){QD.setItems(n,t)})},refreshToolbar:function(n){YD.getPart(n,e,"toolbar").each(function(n){returnn.getApis().refresh(n)})},getMoreButton:function(n){returnYD.getPart(n,e,"toolbar").bind(function(n){returnn.getApis().getMoreButton(n)})},getThrobber:function(n){returnYD.getPart(n,e,"throbber")},focusToolbar:function(n){YD.getPart(n,e,"toolbar").orThunk(function(){returnYD.getPart(n,e,"multiple-toolbar")}).each(function(n){lg.focusIn(n)})},setMenubar:function(n,t){YD.getPart(n,e,"menubar").each(function(n){vA.setMenus(n,t)})},focusMenubar:function(n){YD.getPart(n,e,"menubar").each(function(n){vA.focus(n)})}};return{uid:e.uid,dom:e.dom,components:n,apis:o,behaviours:e.behaviours}},configFields:[ct("dom"),ct("behaviours")],partFields:[DA,EA,BA,TA,AA,_A,MA],apis:{getSocket:function(n,t){returnn.getSocket(t)},setSidebar:function(n,t,e){n.setSidebar(t,e)},toggleSidebar:function(n,t,e){n.toggleSidebar(t,e)},whichSidebar:function(n,t){returnn.whichSidebar(t)},getHeader:function(n,t){returnn.getHeader(t)},getToolbar:function(n,t){returnn.getToolbar(t)},setToolbar:function(n,t,e){varo=S(e,function(n){returnWO(n)});n.setToolbar(t,o)},setToolbars:function(n,t,e){varo=S(e,function(n){returnS(n,WO)});n.setToolbars(t,o)},getMoreButton:function(n,t){returnn.getMoreButton(t)},refreshToolbar:function(n,t){returnn.refreshToolbar(t)},getThrobber:function(n,t){returnn.getThrobber(t)},setMenubar:function(n,t,e){n.setMenubar(t,e)},focusMenubar:function(n,t){n.focusMenubar(t)},focusToolbar:function(n,t){n.focusToolbar(t)}}}),IA={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 | cell row column | advtablesort | tableprops deletetable"},help:{title:"Help",items:"help"}},RA=function(n){functiont(){n._skinLoaded=!0,Nv(n)}returnfunction(){n.initialized?t():n.on("init",t)}},VA=d(YB,!1),NA=d(YB,!0),HA=Rh.DOM,PA=Ht(),zA=PA.os.isiOS()&&PA.os.version.major<=12,LA={render:function(e,o,n,t,r){vari=ye(0);VA(e),function(n,t){If(n,t,_o)}(we.fromDom(r.targetNode),o.mothership),xs(zr(),o.uiMothership),e.on("PostRender",function(){qB(e,o,n,t),i.set(e.getWin().innerWidth),FA.setMenubar(o.outerContainer,XB(e,n)),FA.setSidebar(o.outerContainer,n.sidebar),function(r){functionn(n){vart=r.getDoc().documentElement,e=u.get(),o=a.get();e.left()!==i.innerWidth||e.top()!==i.innerHeight?(u.set(Iu(i.innerWidth,i.innerHeight)),zv(r,n)):o.left()===t.offsetWidth&&o.top()===t.offsetHeight||(a.set(Iu(t.offsetWidth,t.offsetHeight)),zv(r,n))}functiont(n){returnPv(r,n)}vari=r.getWin(),e=r.getDoc().documentElement,u=ye(Iu(i.innerWidth,i.innerHeight)),a=ye(Iu(e.offsetWidth,e.offsetHeight));HA.bind(i,"resize",n),HA.bind(i,"scroll",t);varo=fb(we.fromDom(r.getBody()),"load",n);r.on("remove",function(){o.unbind(),HA.unbind(i,"resize",n),HA.unbind(i,"scroll",t)})}(e)});varu=FA.getSocket(o.outerContainer).getOrDie("Could not find expected socket element");if(!0===zA){xr(u.element(),{overflow:"scroll","-webkit-overflow-scrolling":"touch"});vara=function(e,o){varr=null;return{cancel:function(){null!==r&&(v.clearTimeout(r),r=null)},throttle:function(){for(varn=[],t=0;t<arguments.length;t++)n[t]=arguments[t];null===r&&(r=v.setTimeout(function(){e.apply(null,n),r=null},o))}}}(function(){e.fire("ScrollContent")},20);sb(u.element(),"scroll",a.throttle)}LO(e,o),e.addCommand("ToggleSidebar",function(n,t){FA.toggleSidebar(o.outerContainer,t),e.fire("ToggleSidebar")}),e.addQueryValueHandler("ToggleSidebar",function(){returnFA.whichSidebar(o.outerContainer)});varc=Yb(e);returnc!==jb.sliding&&c!==jb.floating||e.on("ResizeWindow ResizeEditor ResizeContent",function(){varn=e.getWin().innerWidth;n!==i.get()&&(FA.refreshToolbar(o.outerContainer),i.set(n))}),{iframeContainer:u.element().dom(),editorContainer:o.outerContainer.element().dom()}}},jA=function(t,n,e){varo=n.filter(function(n){returnt<n}),r=e.filter(function(n){returnn<t});returno.or(r).getOr(t)},UA=function(n){return/^[0-9\.]+(|px)$/i.test(""+n)?on.some(parseInt(""+n,10)):on.none()},WA=function(n){returnmn(n)?n+"px":n},GA={render:function(t,i,e,o,n){varu,r=Rh.DOM,a=Kb(t),c=$b(t),s=we.fromDom(n.targetNode),f=Nb(t).or(JB(t)),l=Yb(t),d=l===jb.sliding||l===jb.floating;NA(t);functionm(n){void0===n&&(n=!1),d&&FA.refreshToolbar(i.outerContainer),a||function(n){vart=d?n.fold(function(){return0},function(n){return1<n.components().length?su(n.components()[1].element()):0}):0,e=du(s),o=e.top()-su(u.element())+t;xr(i.outerContainer.element(),{position:"absolute",top:Math.round(o)+"px",left:Math.round(e.left())+"px"});varr=f.getOrThunk(function(){varn=UA(wr(zr(),"margin-left")).getOr(0);returnmu(zr())-e.left()+n});yr(u.element(),"max-width",r+"px")}(FA.getToolbar(i.outerContainer)),c&&(n?cA.reset(u):cA.refresh(u))}functiong(){yr(i.outerContainer.element(),"display","flex"),r.addClass(t.getBody(),"mce-edit-focus"),kr(i.uiMothership.element(),"display"),m()}functionp(){i.outerContainer&&(yr(i.outerContainer.element(),"display","none"),r.removeClass(t.getBody(),"mce-edit-focus")),yr(i.uiMothership.element(),"display","none")}functionh(){if(u)g();else{u=FA.getHeader(i.outerContainer).getOrDie();varn=function(n){returnqb(n).getOr(zr())}(t);xs(n,i.mothership),xs(n,i.uiMothership),qB(t,i,e,o),FA.setMenubar(i.outerContainer,XB(t,e)),g(),t.on("activate",g),t.on("deactivate",p),t.on("NodeChange SkinLoaded ResizeWindow",function(){t.hidden||m(!0)}),t.nodeChanged()}}returnt.on("focus",h),t.on("blur hide",p),t.on("init",function(){t.hasFocus()&&h()}),LO(t,i),{editorContainer:i.outerContainer.element().dom()}}},XA=function(t){yk.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(n){t.ui.registry.addToggleButton(n.name,{tooltip:n.text,onAction:function(){returnt.execCommand(n.cmd)},icon:n.icon,onSetup:fE(t,n.name)})});varn="alignnone",e="No alignment",o="JustifyNone",r="align-none";t.ui.registry.addButton(n,{tooltip:e,onAction:function(){returnt.execCommand(o)},icon:r})},YA=function(n){QB(n),function(t){yk.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(n){t.ui.registry.addMenuItem(n.name,{text:n.text,icon:n.icon,shortcut:n.shortcut,onAction:function(){returnt.execCommand(n.action)}})}),t.ui.registry.addMenuItem("codeformat",{text:"Code",icon:"sourcecode",onAction:$B(t,"code")})}(n)},qA=function(n){!function(t){t.ui.registry.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onSetup:function(n){returnZB(n,t,"hasUndo")},onAction:function(){returnt.execCommand("undo")}}),t.ui.registry.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onSetup:function(n){returnZB(n,t,"hasRedo")},onAction:function(){returnt.execCommand("redo")}})}(n),function(t){t.ui.registry.addButton("undo",{tooltip:"Undo",icon:"undo",onSetup:function(n){returnZB(n,t,"hasUndo")},onAction:function(){returnt.execCommand("undo")}}),t.ui.registry.addButton("redo",{tooltip:"Redo",icon:"redo",onSetup:function(n){returnZB(n,t,"hasRedo")},onAction:function(){returnt.execCommand("redo")}})}(n)},KA=function(n){!function(n){n.ui.registry.addButton("visualaid",{tooltip:"Visual aids",text:"Visual aids",onAction:function(){returnn.execCommand("mceToggleVisualAid")}})}(n),function(t){t.ui.registry.addToggleMenuItem("visualaid",{text:"Visual aids",onSetup:function(n){returnfunction(t,n){t.setActive(n.hasVisual);functione(n){t.setActive(n.hasVisual)}returnn.on("VisualAid",e),function(){returnn.off("VisualAid",e)}}(n,t)},onAction:function(){t.execCommand("mceToggleVisualAid")}})}(n)},JA=function(n){!function(t){t.ui.registry.addButton("outdent",{tooltip:"Decrease indent",icon:"outdent",onSetup:function(n){returnfunction(n,t){n.setDisabled(!t.queryCommandState("outdent"));functione(){n.setDisabled(!t.queryCommandState("outdent"))}returnt.on("NodeChange",e),function(){returnt.off("NodeChange",e)}}(n,t)},onAction:function(){returnt.execCommand("outdent")}}),t.ui.registry.addButton("indent",{tooltip:"Increase indent",icon:"indent",onAction:function(){returnt.execCommand("indent")}})}(n)},$A=function(n,t){!function(n,t){vare=dE(0,t,nB(n));n.ui.registry.addNestedMenuItem("align",{text:t.shared.providers.translate("Align"),getSubmenuItems:function(){returne.items.validateItems(e.getStyleItems())}})}(n,t),function(n,t){vare=dE(0,t,eB(n));n.ui.registry.addNestedMenuItem("fontformats",{text:t.shared.providers.translate("Fonts"),getSubmenuItems:function(){returne.items.validateItems(e.getStyleItems())}})}(n,t),function(n,t){vare=N({type:"advanced"},t.styleselect),o=dE(0,t,cB(n,e));n.ui.registry.addNestedMenuItem("formats",{text:"Formats",getSubmenuItems:function(){returno.items.validateItems(o.getStyleItems())}})}(n,t),function(n,t){vare=dE(0,t,aB(n));n.ui.registry.addNestedMenuItem("blockformats",{text:"Blocks",getSubmenuItems:function(){returne.items.validateItems(e.getStyleItems())}})}(n,t),function(n,t){vare=dE(0,t,rB(n));n.ui.registry.addNestedMenuItem("fontsizes",{text:"Font sizes",getSubmenuItems:function(){returne.items.validateItems(e.getStyleItems())}})}(n,t)},QA=function(n,t){XA(n),YA(n),$A(n,t),qA(n),Uv.register(n),KA(n),JA(n)},ZA=function(n){return{anchor:"selection",root:we.fromDom(n.selection.getNode())}},n_={onLtr:function(){return[rc,ua,aa,ca,sa,oc,Ug,Wg,pm,mm,hm,gm]},onRtl:function(){return[rc,aa,ua,sa,ca,oc,Ug,Wg,hm,gm,pm,mm]}},t_={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"]},e_=function(n){returnn.settings.contextmenu_never_use_native||!1},o_=function(n){returnfunction(n,t,e){varo=n.ui.registry.getAll().contextMenus;returnV(n.settings,t).map(cD).getOrThunk(function(){returnC(cD(e),function(n){returnEn(o,n)})})}(n,"contextmenu","link linkchecker image imagetools table spellchecker configurepermanentpen")},r_=function(n){return!1===n.getParam("contextmenu")},i_={type:"separator"},u_=function(t){if(cn(t))returnt;switch(t.type){case"separator":returni_;case"submenu":return{type:"nestedmenuitem",text:t.text,icon:t.icon,getSubmenuItems:function(){varn=t.getSubmenuItems();returncn(n)?n:S(n,u_)}};default:return{type:"menuitem",text:t.text,icon:t.icon,onAction:function(n){returnfunction(){returnn()}}(t.onAction)}}},a_="data-initial-z-index",c_=wt("snaps",[ct("getSnapPoints"),qu("onSensor"),ct("leftAttr"),ct("topAttr"),St("lazyViewport",Su),St("mustSnap",!1)]),s_=[St("useFixed",u),ct("blockerClass"),St("getTarget",l),St("onDrag",Z),St("repositionTarget",!0),St("onDrop",Z),Bt("getBounds",Su),c_],f_=function(n,t,r,i,u){vare=t.getSnapPoints(n);returnbD(e,r,i,u).orThunk(function(){returnO(e,function(t,e){varn=e.sensor(),o=function(n,t,e,o,r,i){varu=bB(n,r,i),a=bB(t,r,i),c=Math.abs(u.left()-a.left()),s=Math.abs(u.top()-a.top());returnIu(c,s)}(r,n,e.range().left(),e.range().top(),i,u);returnt.deltas.fold(function(){return{deltas:on.some(o),snap:on.some(e)}},function(n){return(o.left()+o.top())/2<=(n.left()+n.top())/2?{deltas:on.some(o),snap:on.some(e)}:t})},{deltas:on.none(),snap:on.none()}).snap.map(function(n){return{output:nn(wB(n.output(),r,i,u)),extra:n.extra}})})},l_=function(n,t,e,o,r){vari=t.getSnapPoints(n);returnbD(i,e,o,r)},d_=/* */Object.freeze({getData:function(n){returnon.from(Iu(n.x(),n.y()))},getDelta:function(n,t){returnIu(t.left()-n.left(),t.top()-n.top())}}),m_=g(s_,[Qu("dragger",{handlers:kD(OD)})]),g_=/* */Object.freeze({getData:function(n){vart=n.raw().touches;return1===t.length?function(n){vart=n[0];returnon.some(Iu(t.clientX,t.clientY))}(t):on.none()},getDelta:function(n,t){returnIu(t.left()-n.left(),t.top()-n.top())}}),p_=m_,h_=g(s_,[Qu("dragger",{handlers:kD(ED)})]),v_=g(s_,[Qu("dragger",{handlers:kD(function(n,t,e){returng(OD(n,t,e),ED(n,t,e))})})]),b_=/* */Object.freeze({mouse:p_,touch:h_,mouseOrTouch:v_}),y_=/* */Object.freeze({init:function(){varo=on.none(),t=on.none(),n=nn({});returnnu({readState:n,reset:function(){o=on.none(),t=on.none()},update:function(t,n){returnt.getData(n).bind(function(n){returnfunction(t,e){varn=o.map(function(n){returnt.getDelta(n,e)});returno=on.some(e),n}(t,n)})},getStartData:function(){returnt},setStartData:function(n){t=on.some(n)}})}}),x_=/* */Object.freeze({snapTo:function(n,t,e,o){varr=t.getTarget(n.element());if(t.repositionTarget){vari=Co(n.element()),u=pu(i),a=mB(r),c=function(n,t,e){return{coord:wB(n.output(),n.output(),t,e),extra:n.extra()}}(o,u,a),s=xB(c.coord,0,a);xr(r,s)}}}),w_=xa({branchKey:"mode",branches:b_,name:"dragging",active:{events:function(n,t){returnn.dragger.handlers(n,t)}},extra:{snap:So(["sensor","range","output"],["extra"])},state:y_,apis:x_}),S_=Ht(),C_=function(c,e){functiont(n){vart=wu(n);returnTD(g.getOpt(e),n,t.x(),t.y(),t.width(),t.height())}functiono(n){vart=wu(n);returnTD(p.getOpt(e),n,t.right(),t.bottom(),t.width(),t.height())}functionr(n,t,e,o){varr=e(t);w_.snapTo(n,r),function(n,t,e,o){varr=t.dom().getBoundingClientRect();kr(n.element(),"display");vari=Oo(we.fromDom(c.getBody())).dom().innerHeight,u=e(r),a=o(r,i);(u||a)&&yr(n.element(),"display","none")}(n,t,function(n){returnn[o]<0},function(n,t){returnn[o]>t})}functioni(n){returnr(h,n,t,"top")}functionu(n){returnr(v,n,o,"bottom")}vara=ye([]),s=ye([]),n=ye(!1),f=ye(on.none()),l=ye(on.none()),d=BD(function(){returnS(a.get(),function(n){returnt(n)})},f,function(t){l.get().each(function(n){c.fire("TableSelectorChange",{start:t,finish:n})})}),m=BD(function(){returnS(s.get(),function(n){returno(n)})},l,function(t){f.get().each(function(n){c.fire("TableSelectorChange",{start:n,finish:t})})}),g=DD(d),p=DD(m),h=uu(g.asSpec()),v=uu(p.asSpec());S_.deviceType.isTouch()&&(c.on("TableSelectionChange",function(t){n.get()||(hs(e,h),hs(e,v),n.set(!0)),f.set(on.some(t.start)),l.set(on.some(t.finish)),t.otherCells.each(function(n){a.set(n.upOrLeftCells),s.set(n.downOrRightCells),i(t.start),u(t.finish)})}),c.on("ResizeEditor ResizeWindow ScrollContent",function(){f.get().each(i),l.get().each(u)}),c.on("TableSelectionClear",function(){n.get()&&(bs(h),bs(v),n.set(!1)),f.set(on.none()),l.set(on.none())}))};(ID=FD=FD||{})[ID.None=0]="None",ID[ID.Both=1]="Both",ID[ID.Vertical=2]="Vertical";functionk_(n,t,e){varo=we.fromDom(n.getContainer()),r=function(n,t,e,o,r){vari={};returni.height=jA(o+t.top(),Vb(n),Hb(n)),e===FD.Both&&(i.width=jA(r+t.left(),Rb(n),Nb(n))),i}(n,t,e,su(o),mu(o));Cn(r,function(n,t){returnyr(o,t,WA(n))}),Hv(n)}functionO_(n){if(1===n.nodeType){if("BR"===n.nodeName||n.getAttribute("data-mce-bogus"))return!0;if("bookmark"===n.getAttribute("data-mce-type"))return!0}return!1}functionE_(o,t){varr,n,e;return{dom:{tag:"div",classes:["tox-statusbar"]},components:(n=function(){varn=[];returno.getParam("elementpath",!0,"boolean")&&n.push(pM(o,{})),Vt(o.settings.plugins,"wordcount")&&n.push(function(n,o){functionr(n,t,e){returnmg.set(n,[Ir(o.translate(["{0} "+e,t[e]]))])}returnGg.sketch({dom:{tag:"button",classes:["tox-statusbar__wordcount"]},components:[],buttonBehaviours:ba([Gy.config({}),mg.config({}),Zf.config({store:{mode:"memory",initialValue:{mode:"words",count:{words:0,characters:0}}}}),Kd("wordcount-events",[Ni(function(n){vart=Zf.getValue(n),e="words"===t.mode?"characters":"words";Zf.setValue(n,{mode:e,count:t.count}),r(n,t.count,e)}),Ii(function(e){n.on("wordCountUpdate",function(n){vart=Zf.getValue(e).mode;Zf.setValue(e,{mode:t,count:n.wordCount}),r(e,n.wordCount,t)})})])])})}(o,t)),o.getParam("branding",!0,"boolean")&&n.push(function(){varn=rh.translate(["Powered by {0}","Tiny"]);return{dom:{tag:"span",classes:["tox-statusbar__branding"],innerHtml:'<a href="https://www.tiny.cloud/?utm_campaign=editor_referral&utm_medium=poweredby&utm_source=tinymce&utm_content=v5" rel="noopener" target="_blank" tabindex="-1" aria-label="'+n+'">'+n+"</a>"}}}()),0<n.length?[{dom:{tag:"div",classes:["tox-statusbar__text-container"]},components:n}]:[]}(),e=function(n){vart=!Vt(n.settings.plugins,"autoresize"),e=n.getParam("resize",t);return!1===e?FD.None:"both"===e?FD.Both:FD.Vertical}(o),e!==FD.None&&n.push((r=e,{dom:{tag:"div",classes:["tox-statusbar__resize-handle"],attributes:{title:t.translate("Resize")},innerHtml:ym("resize-handle",t.icons)},behaviours:ba([w_.config({mode:"mouse",repositionTarget:!1,onDrag:function(n,t,e){k_(o,e,r)},blockerClass:"tox-blocker"})])})),n)}}functionT_(n){return[ft("type"),function(n){returnst(n,me)}("columns"),n]}functionB_(t){returnce("items","items",Mn(),Kn(Zn(function(n){returntt("Checking item of "+t,gF,n).fold(function(n){returnan.error(le(n))},function(n){returnan.value(n)})})))}functionD_(n){returncn(n.type)&&cn(n.name)}functionA_(n){vart=function(n){returnC(DF(n),D_)}(n),e=B(t,function(t){returnfunction(n){returnon.from(AF[n.type])}(t).fold(function(){return[]},function(n){return[st(t.name,n)]})});returnre(e)}function__(n){return{internalDialog:et(function(n){returntt("dialog",BF,n)}(n)),dataValidator:A_(n),initialData:n.initialData}}functionM_(n){vare=[],o={};returnCn(n,function(n,t){n.fold(function(){e.push(t)},function(n){o[t]=n})}),0<e.length?an.error(e):an.value(o)}functionF_(n){returnyn(function(n,t){vare=gn.call(n,0);returne.sort(t),e}(n,function(n,t){returnt<n?-1:n<t?1:0}))}functionI_(n,t){yr(n,"height",t+"px"),Ht().browser.isIE()?kr(n,"flex-basis"):yr(n,"flex-basis",t+"px")}functionR_(n,o,r){Cu(n,'[role="dialog"]').each(function(e){ku(e,'[role="tablist"]').each(function(t){r.get().map(function(n){returnyr(o,"height","0"),yr(o,"flex-basis","0"),Math.min(n,function(n,t,e){varo,r=ko(n).dom(),i=Cu(n,".tox-dialog-wrap").getOr(n);o="fixed"===wr(i,"position")?Math.max(r.clientHeight,v.window.innerHeight):Math.max(r.offsetHeight,r.scrollHeight);varu=su(t),a=t.dom().offsetLeft>=e.dom().offsetLeft+mu(e)?Math.max(su(e),u):u,c=parseInt(wr(n,"margin-top"),10)||0,s=parseInt(wr(n,"margin-bottom"),10)||0;returno-(su(n)+c+s-a)}(e,o,t))}).each(function(n){I_(o,n)})})})}functionV_(n){returnku(n,'[role="tabpanel"]')}functionN_(r){vari;return{smartTabHeight:(i=ye(on.none()),{extraEvents:[Ii(function(n){vart=n.element();V_(t).each(function(o){yr(o,"visibility","hidden"),n.getSystem().getByDom(o).toOption().each(function(n){vart=function(o,r,i){returnS(o,function(n,t){mg.set(i,o[t].view());vare=r.dom().getBoundingClientRect();returnmg.set(i,[]),e.height})}(r,o,n),e=F_(t);i.set(e)}),R_(t,o,i),kr(o,"visibility"),function(n,t){yn(n).each(function(n){returnWF.showTab(t,n.value)})}(r,n),qg.requestAnimationFrame(function(){R_(t,o,i)})})}),lo(Si(),function(n){vart=n.element();V_(t).each(function(n){R_(t,n,i)})}),lo(gy,function(n,t){varr=n.element();V_(r).each(function(t){varn=Sa();yr(t,"visibility","hidden");vare=Sr(t,"height").map(function(n){returnparseInt(n,10)});kr(t,"height"),kr(t,"flex-basis");varo=t.dom().getBoundingClientRect().height;e.forall(function(n){returnn<o})?(i.set(on.from(o)),R_(r,t,i)):e.each(function(n){I_(t,n)}),kr(t,"visibility"),n.each(wa)})})],selectFirst:!1}),naiveTabHeight:{extraEvents:[],selectFirst:!0}}}functionH_(n,t,e,o){return{dom:{tag:"div",classes:["tox-dialog__content-js"],attributes:N(N({},t.map(function(n){return{id:n}}).getOr({})),o?{"aria-live":"polite"}:{})},components:[],behaviours:ba([SS(0),RT.config({channel:KF,updateState:function(n,t){returnon.some({isTabPanel:function(){return"tabpanel"===t.body.type}})},renderComponents:function(n){switch(n.body.type){case"tabpanel":return[function(n,e){functiono(n){vart=Zf.getValue(n),e=M_(t).getOr({}),o=i.get(),r=Dn(o,e);i.set(r)}functionr(n){vart=i.get();Zf.setValue(n,t)}vari=ye({}),u=ye(null),t=S(n.tabs,function(n){return{value:n.name,dom:{tag:"div",classes:["tox-dialog__body-nav-item"],innerHtml:e.shared.providers.translate(n.title)},view:function(){return[dS.sketch(function(t){return{dom:{tag:"div",classes:["tox-form"]},components:S(n.items,function(n){returnWk(t,n,e)}),formBehaviours:ba([lg.config({mode:"acyclic",useTabstopAt:b(MS)}),Kd("TabView.form.events",[Ii(r),Ri(o)]),lc.config({channels:K([{key:GF,value:{onReceive:o}},{key:XF,value:{onReceive:r}}])})])}})]}}}),a=N_(t).smartTabHeight;returnWF.sketch({dom:{tag:"div",classes:["tox-dialog__body"]},onChangeTab:function(n,t,e){varo=Zf.getValue(t);ro(n,my,{name:o,oldName:u.get()}),u.set(o)},tabs:t,components:[WF.parts().tabbar({dom:{tag:"div",classes:["tox-dialog__body-nav"]},components:[HF.parts().tabs({})],markers:{tabClass:"tox-tab",selectedClass:"tox-dialog__body-nav-item--active"},tabbarBehaviours:ba([Gy.config({})])}),WF.parts().tabview({dom:{tag:"div",classes:["tox-dialog__body-content"]}})],selectFirst:a.selectFirst,tabSectionBehaviours:ba([Kd("tabpanel",a.extraEvents),lg.config({mode:"acyclic"}),Zl.config({find:function(n){returnyn(WF.getViewItems(n))}}),Zf.config({store:{mode:"manual",getValue:function(n){returnn.getSystem().broadcastOn([GF],{}),i.get()},setValue:function(n,t){i.set(t),n.getSystem().broadcastOn([XF],{})}}})])})}(n.body,e)];default:return[function(n,e){vart=vm(dS.sketch(function(t){return{dom:{tag:"div",classes:["tox-form"].concat(n.classes)},components:S(n.items,function(n){returnWk(t,n,e)})}}));return{dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[t.asSpec()]}],behaviours:ba([lg.config({mode:"acyclic",useTabstopAt:b(MS)}),wS(t),ES(t,{postprocess:function(n){returnM_(n).fold(function(n){returnv.console.error(n),{}},function(n){returnn})}})])}}(n.body,e)]}},initialData:n})])}}functionP_(n,e){return[ho(Qr(),FS),n(ay,function(n,t){e.onClose(),t.onClose()}),n(cy,function(n,t,e,o){t.onCancel(n),oo(o,ay)}),lo(dy,function(n,t){returne.onUnblock()}),lo(ly,function(n,t){returne.onBlock(t.event())})]}functionz_(n,t){functione(n,t){returnWb.sketch({dom:{tag:"div",classes:["tox-dialog__footer-"+n]},components:S(t,function(n){returnn.memento.asSpec()})})}varo=function(n,t){for(vare=[],o=[],r=0,i=n.length;r<i;r++){varu=n[r];(t(u,r)?e:o).push(u)}return{pass:e,fail:o}}(t.map(function(n){returnn.footerButtons}).getOr([]),function(n){return"start"===n.align});return[e("start",o.pass),e("end",o.fail)]}functionL_(n,o){return{dom:cp('<div class="tox-dialog__footer"></div>'),components:[],behaviours:ba([RT.config({channel:JF,initialData:n,updateState:function(n,t){vare=S(t.buttons,function(n){vart=vm(function(n,t){returnYC(n,n.type,t)}(n,o));return{name:n.name,align:n.align,memento:t}});returnon.some({lookupByName:function(n,t){returnfunction(t,n,e){returnE(n,function(n){returnn.name===e}).bind(function(n){returnn.memento.getOpt(t)})}(n,e,t)},footerButtons:e})},renderComponents:z_})])}}functionj_(n,t){returnwM.parts().footer(L_(n,t))}functionU_(t,e){if(t.getRoot().getSystem().isConnected()){varo=Zl.getCurrent(t.getFormWrapper()).getOr(t.getFormWrapper());returndS.getField(o,e).fold(function(){varn=t.getFooter();returnRT.getState(n).get().bind(function(n){returnn.lookupByName(o,e)})},function(n){returnon.some(n)})}returnon.none()}functionW_(u,o,a){functionn(n){vart=u.getRoot();t.getSystem().isConnected()&&n(t)}varc={getData:function(){varn=u.getRoot(),t=n.getSystem().isConnected()?u.getFormWrapper():n,e=Zf.getValue(t),o=P(a,function(n){returnn.get()});returnN(N({},e),o)},setData:function(i){n(function(n){vart=c.getData(),e=An(t,i),o=function(n,t){vare=n.getRoot();returnRT.getState(e).get().map(function(n){returnet(tt("data",n.dataValidator,t))}).getOr(t)}(u,e),r=u.getFormWrapper();Zf.setValue(r,o),Cn(a,function(n,t){En(e,t)&&n.set(e[t])})})},disable:function(n){U_(u,n).each(Ch.disable)},enable:function(n){U_(u,n).each(Ch.enable)},focus:function(n){U_(u,n).each(vg.focus)},block:function(t){if(!cn(t))thrownewError("The dialogInstanceAPI.block function should be passed a blocking message of type string as an argument");n(function(n){ro(n,ly,{message:t})})},unblock:function(){n(function(n){oo(n,dy)})},showTab:function(e){n(function(n){vart=u.getBody();RT.getState(t).get().exists(function(n){returnn.isTabPanel()})&&Zl.getCurrent(t).each(function(n){WF.showTab(n,e)})})},redial:function(e){n(function(n){vart=o(e);n.getSystem().broadcastOn([YF],t),n.getSystem().broadcastOn([qF],t.internalDialog),n.getSystem().broadcastOn([KF],t.internalDialog),n.getSystem().broadcastOn([JF],t.internalDialog),c.setData(t.initialData)})},close:function(){n(function(n){oo(n,ay)})}};returnc}functionG_(n,t){return{dom:{tag:"div",styles:{display:"none"},classes:["tox-dialog__header"]},components:[n,t]}}functionX_(n,t){returnwM.parts().close(Gg.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":t.translate("Close")}},action:n,buttonBehaviours:ba([Gy.config({})])}))}functionY_(){returnwM.parts().title({dom:{tag:"div",classes:["tox-dialog__title"],innerHtml:"",styles:{display:"none"}}})}functionq_(n,t){returnwM.parts().body({dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[{dom:cp("<p>"+t.translate(n)+"</p>")}]}]})}functionK_(n){returnwM.parts().footer({dom:{tag:"div",classes:["tox-dialog__footer"]},components:n})}functionJ_(n,t){return[Wb.sketch({dom:{tag:"div",classes:["tox-dialog__footer-start"]},components:n}),Wb.sketch({dom:{tag:"div",classes:["tox-dialog__footer-end"]},components:t})]}function$_(t){varn,e="tox-dialog",o=e+"-wrap",r=o+"__backdrop",i=e+"__disable-scroll";returnwM.sketch({lazySink:t.lazySink,onEscape:function(n){returnt.onEscape(n),on.some(!0)},useTabstopAt:function(n){return!MS(n)},dom:{tag:"div",classes:[e].concat(t.extraClasses),styles:N({position:"relative"},t.extraStyles)},components:g([t.header,t.body],t.footer.toArray()),parts:{blocker:{dom:cp('<div class="'+o+'"></div>'),components:[{dom:{tag:"div",classes:nI?[r,r+"--opaque"]:[r]}}]}},dragBlockClass:o,modalBehaviours:ba(g([vg.config({}),Kd("dialog-events",t.dialogEvents.concat([bo(Qr(),function(n,t){lg.focusIn(n)})])),Kd("scroll-lock",[Ii(function(){fr(zr(),i)}),Ri(function(){dr(zr(),i)})])],t.extraBehaviours)),eventOrder:N((n={},n[di()]=["dialog-events"],n[Ci()]=["scroll-lock","dialog-events","alloy.base.behaviour"],n[ki()]=["alloy.base.behaviour","dialog-events","scroll-lock"],n),t.eventOrder)})}functionQ_(n){returnGg.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":n.translate("Close"),title:n.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(n){oo(n,cy)}})}functionZ_(n,t,e){functiono(n){return[Ir(e.translate(n.title))]}return{dom:{tag:"div",classes:["tox-dialog__title"],attributes:N({},t.map(function(n){return{id:n}}).getOr({}))},components:o(n),behaviours:ba([RT.config({channel:qF,renderComponents:o})])}}functionnM(){return{dom:cp('<div class="tox-dialog__draghandle"></div>')}}functiontM(n,t){returnfunction(n,t){vare=wM.parts().title(Z_(n,on.none(),t)),o=wM.parts().draghandle(nM()),r=wM.parts().close(Q_(t)),i=[e].concat(n.draggable?[o]:[]).concat([r]);returnWb.sketch({dom:cp('<div class="tox-dialog__header"></div>'),components:i})}({title:t.shared.providers.translate(n),draggable:t.dialog.isDraggableModal()},t.shared.providers)}functioneM(n,t){return{onClose:function(){returnt.closeWindow()},onBlock:function(e){wM.setBusy(n(),function(n,t){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:t,components:[{dom:cp('<div class="tox-spinner"><div></div><div></div><div></div></div>')}]}})},onUnblock:function(){wM.setIdle(n())}}}functionoM(n,t,e,o){varr;returnuu($_(N(N({},n),{lazySink:o.shared.getSink,extraBehaviours:g([RT.config({channel:YF,updateState:function(n,t){returnon.some(t)},initialData:t}),DS({})],n.extraBehaviours),onEscape:function(n){oo(n,cy)},dialogEvents:e,eventOrder:(r={},r[li()]=["reflecting","receiving"],r[Ci()]=["scroll-lock","reflecting","messages","dialog-events","alloy.base.behaviour"],r[ki()]=["alloy.base.behaviour","dialog-events","messages","reflecting","scroll-lock"],r)})))}functionrM(n){returnS(n,function(n){return"menu"===n.type?function(n){vart=S(n.items,function(n){vart=ye(!1);returnN(N({},n),{storage:t})});returnN(N({},n),{items:t})}(n):n})}functioniM(n){returnO(n,function(n,t){return"menu"!==t.type?n:O(t.items,function(n,t){returnn[t.name]=t.storage,n},n)},{})}functionuM(n,t,e){varo=tM(n.internalDialog.title,e),r=function(n,t){vare=H_(n,on.none(),t,!1);returnwM.parts().body(e)}({body:n.internalDialog.body},e),i=rM(n.internalDialog.buttons),u=iM(i),a=j_({buttons:i},e),c=ZF(function(){returnd},eM(function(){returnl},t)),s="normal"!==n.internalDialog.size?"large"===n.internalDialog.size?["tox-dialog--width-lg"]:["tox-dialog--width-md"]:[],f={header:o,body:r,footer:on.some(a),extraClasses:s,extraBehaviours:[],extraStyles:{}},l=oM(f,n,c,e),d=W_({getRoot:function(){returnl},getBody:function(){returnwM.getBody(l)},getFooter:function(){returnwM.getFooter(l)},getFormWrapper:function(){varn=wM.getBody(l);returnZl.getCurrent(n).getOr(n)}},t.redial,u);return{dialog:l,instanceApi:d}}functionaM(n,t,e,o){varr,i,u=Xo("dialog-label"),a=Xo("dialog-content"),c=vm(function(n,t,e){returnWb.sketch({dom:cp('<div class="tox-dialog__header"></div>'),components:[Z_(n,on.some(t),e),nM(),Q_(e)],containerBehaviours:ba([w_.config({mode:"mouse",blockerClass:"blocker",getTarget:function(n){returnOu(n,'[role="dialog"]').getOrDie()},snaps:{getSnapPoints:function(){return[]},leftAttr:"data-drag-left",topAttr:"data-drag-top"}})])})}({title:n.internalDialog.title,draggable:!0},u,e.shared.providers)),s=vm(function(n,t,e,o){returnH_(n,on.some(t),e,o)}({body:n.internalDialog.body},a,e,o)),f=rM(n.internalDialog.buttons),l=iM(f),d=vm(function(n,t){returnL_(n,t)}({buttons:f},e)),m=ZF(function(){returnp},{onBlock:function(){},onUnblock:function(){},onClose:function(){returnt.closeWindow()}}),g=uu({dom:{tag:"div",classes:["tox-dialog","tox-dialog-inline"],attributes:(r={role:"dialog"},r["aria-labelledby"]=u,r["aria-describedby"]=""+a,r)},eventOrder:(i={},i[li()]=[RT.name(),lc.name()],i[di()]=["execute-on-form"],i[Ci()]=["reflecting","execute-on-form"],i),behaviours:ba([lg.config({mode:"cyclic",onEscape:function(n){returnoo(n,ay),on.some(!0)},useTabstopAt:function(n){return!MS(n)&&("button"!==Ke(n)||"disabled"!==zo(n,"disabled"))}}),RT.config({channel:YF,updateState:function(n,t){returnon.some(t)},initialData:n}),vg.config({}),Kd("execute-on-form",m.concat([bo(Qr(),function(n,t){lg.focusIn(n)})])),DS({})]),components:[c.asSpec(),s.asSpec(),d.asSpec()]}),p=W_({getRoot:function(){returng},getFooter:function(){returnd.get(g)},getBody:function(){returns.get(g)},getFormWrapper:function(){varn=s.get(g);returnZl.getCurrent(n).getOr(n)}},t.redial,l);return{dialog:g,instanceApi:p}}functioncM(n){returnsn(n)&&-1!==eI.indexOf(n.mceAction)}functionsM(e,n,o,t){varr,i=tM(e.title,t),u=function(n){vart={dom:{tag:"div",classes:["tox-dialog__content-js"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-iframe"]},components:[IS({dom:{tag:"iframe",attributes:{src:n.url}},behaviours:ba([Gy.config({}),vg.config({})])})]}],behaviours:ba([lg.config({mode:"acyclic",useTabstopAt:b(MS)})])};returnwM.parts().body(t)}(e),a=e.buttons.bind(function(n){return0===n.length?on.none():on.some(j_({buttons:n},t))}),c=QF(function(){returnh},eM(function(){returnp},n)),s=N(N({},e.height.fold(function(){return{}},function(n){return{height:n+"px","max-height":n+"px"}})),e.width.fold(function(){return{}},function(n){return{width:n+"px","max-width":n+"px"}})),f=e.width.isNone()&&e.height.isNone()?["tox-dialog--width-lg"]:[],l=newtI(e.url,{base_uri:newtI(v.window.location.href)}),d=l.protocol+"://"+l.host+(l.port?":"+l.port:""),m=ye(on.none()),g=[Kd("messages",[Ii(function(){varn=sb(we.fromDom(v.window),"message",function(n){if(l.isSameOrigin(newtI(n.raw().origin))){vart=n.raw().data;cM(t)?function(n,t,e){switch(e.mceAction){case"insertContent":n.insertContent(e.content);break;case"setContent":n.setContent(e.content);break;case"execCommand":varo=!!ln(e.ui)&&e.ui;n.execCommand(e.cmd,o,e.value);break;case"close":t.close();break;case"block":t.block(e.message);break;case"unblock":t.unblock()}}(o,h,t):function(n){return!cM(n)&&sn(n)&&En(n,"mceAction")}(t)&&e.onMessage(h,t)}});m.set(on.some(n))}),Ri(function(){m.get().each(function(n){returnn.unbind()})})]),lc.config({channels:(r={},r[$F]={onReceive:function(n,t){ku(n.element(),"iframe").each(function(n){n.dom().contentWindow.postMessage(t,d)})}},r)})],p=oM({header:i,body:u,footer:a,extraClasses:f,extraBehaviours:g,extraStyles:s},e,c,t),h=function(t){functionn(n){t.getSystem().isConnected()&&n(t)}return{block:function(t){if(!cn(t))thrownewError("The urlDialogInstanceAPI.block function should be passed a blocking message of type string as an argument");n(function(n){ro(n,ly,{message:t})})},unblock:function(){n(function(n){oo(n,dy)})},close:function(){n(function(n){oo(n,ay)})},sendMessage:function(t){n(function(n){n.getSystem().broadcastOn([$F],t)})}}}(p);return{dialog:p,instanceApi:h}}varfM,lM,dM,mM,gM,pM=function(i,r){r.delimiter||(r.delimiter="\xbb");return{dom:{tag:"div",classes:["tox-statusbar__path"],attributes:{role:"navigation"}},behaviours:ba([lg.config({mode:"flow",selector:"div[role=button]"}),Gy.config({}),mg.config({}),Kd("elementPathEvents",[Ii(function(e,n){i.shortcuts.add("alt+F11","focus statusbar elementpath",function(){returnlg.focusIn(e)}),i.on("NodeChange",function(n){vart=function(n){for(vart=[],e=n.length;0<e--;){varo=n[e];if(1===o.nodeType&&!O_(o)){varr=i.fire("ResolveName",{name:o.nodeName.toLowerCase(),target:o});if(r.isDefaultPrevented()||t.push({name:r.name,element:o}),r.isPropagationStopped())break}}returnt}(n.parents);0<t.length&&mg.set(e,function(n){vart=S(n||[],function(t,n){returnGg.sketch({dom:{tag:"div",classes:["tox-statusbar__path-item"],attributes:{role:"button","data-index":n,"tab-index":-1,"aria-level":n+1},innerHtml:t.name},action:function(n){i.focus(),i.selection.select(t.element),i.nodeChanged()}})}),o={dom:{tag:"div",classes:["tox-statusbar__path-divider"],attributes:{"aria-hidden":!0},innerHtml:" "+r.delimiter+" "}};returnO(t.slice(1),function(n,t){vare=n;returne.push(o),e.push(t),e},[t[0]])}(t))})})])]),components:[]}},hM=function(l){functiond(){returne.bind(FA.getHeader)}functionm(){returnan.value(v)}functionn(){returne.bind(function(n){returnFA.getMoreButton(n)}).getOrDie("Could not find more button element")}functiong(){returne.bind(function(n){returnFA.getThrobber(n)}).getOrDie("Could not find throbber element")}vart=l.inline,p=t?GA:LA,h=$b(l)?dA:hA,e=on.none(),o=Ht(),r=o.browser.isIE()?["tox-platform-ie"]:[],i=o.deviceType.isTouch()?["tox-platform-touch"]:[],u=rh.isRtl()?{attributes:{dir:"rtl"}}:{},v=uu({dom:N({tag:"div",classes:["tox","tox-silver-sink","tox-tinymce-aux"].concat(r).concat(i)},u),behaviours:ba([Af.config({useFixed:function(){returnh.isDocked(d)}})])}),a=vm({dom:{tag:"div",classes:["tox-anchorbar"]}}),b=hO(v,l,function(){returne.bind(function(n){returna.getOpt(n)}).getOrDie("Could not find a anchor bar element")},n),c=FA.parts().menubar({dom:{tag:"div",classes:["tox-menubar"]},backstage:b,onEscape:function(){l.focus()}}),s=Yb(l),f=FA.parts().toolbar({dom:{tag:"div",classes:["tox-toolbar"]},getSink:m,backstage:b,onEscape:function(){l.focus()},split:s,lazyToolbar:function(){returne.bind(function(n){returnFA.getToolbar(n)}).getOrDie("Could not find more toolbar element")},lazyMoreButton:n,lazyHeader:function(){returnd().getOrDie("Could not find header element")}}),y=FA.parts()["multiple-toolbar"]({dom:{tag:"div",classes:["tox-toolbar-overlord"]},onEscape:function(){},split:s}),x=FA.parts().socket({dom:{tag:"div",classes:["tox-edit-area"]}}),w=FA.parts().sidebar({dom:{tag:"div",classes:["tox-sidebar"]}}),S=FA.parts().throbber({dom:{tag:"div",classes:["tox-throbber"]},backstage:b}),C=l.getParam("statusbar",!0,"boolean")&&!t?on.some(E_(l,b.shared.providers)):on.none(),k={dom:{tag:"div",classes:["tox-sidebar-wrap"]},components:[x,w]},O=Xb(l),E=zb(l),T=Pb(l),B=FA.parts().header({dom:{tag:"div",classes:["tox-editor-header"]},components:H([T?[c]:[],O?[y]:E?[f]:[],Kb(l)?[]:[a.asSpec()]]),sticky:$b(l),editor:l,getSink:m}),D=H([[B],t?[]:[k]]),A=H([[{dom:{tag:"div",classes:["tox-editor-container"]},components:D}],t?[]:C.toArray(),[S]]),_=Jb(l),M=N(N({role:"application"},rh.isRtl()?{dir:"rtl"}:{}),_?{"aria-hidden":"true"}:{}),F=uu(FA.sketch({dom:{tag:"div",classes:["tox","tox-tinymce"].concat(t?["tox-tinymce-inline"]:[]).concat(i).concat(r),styles:N({visibility:"hidden"},_?{opacity:"0",border:"0"}:{}),attributes:M},components:A,behaviours:ba([lg.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"})])}));e=on.some(F),l.shortcuts.add("alt+F9","focus menubar",function(){FA.focusMenubar(F)}),l.shortcuts.add("alt+F10","focus toolbar",function(){FA.focusToolbar(F)});varI=Mb(F),R=Mb(v);XD(l,I,R),iy(l);functionV(){varn=WA(KB(l)),t=WA(function(n){returnJB(n).getOr(Ib(n))}(l));returnl.inline||(Cr("div","width",t)&&yr(F.element(),"width",t),Cr("div","height",n)?yr(F.element(),"height",n):yr(F.element(),"height","200px")),n}return{mothership:I,uiMothership:R,backstage:b,renderUI:function(){h.setup(l,d),QA(l,b),lD(l,m,b),function(o){varr=o.ui.registry.getAll().sidebars;bn(wn(r),function(t){functione(){returnon.from(o.queryCommandValue("ToggleSidebar")).is(t)}varn=r[t];o.ui.registry.addToggleButton(t,{icon:n.icon,tooltip:n.tooltip,onAction:function(n){o.execCommand("ToggleSidebar",!1,t),n.setActive(e())},onSetup:function(n){functiont(){returnn.setActive(e())}returno.on("ToggleSidebar",t),function(){o.off("ToggleSidebar",t)}}})})}(l),function(e,t,o){functionr(n){n!==i.get()&&(WB(t(),n,o.providers),i.set(n))}vari=ye(!1),u=ye(on.none());e.on("ProgressState",function(n){if(u.get().each(qg.clearTimeout),mn(n.time)){vart=qg.setEditorTimeout(e,function(){returnr(n.state)},n.time);u.set(on.some(t))}elser(n.state),u.set(on.none())})}(l,g,b.shared);varn=l.ui.registry.getAll(),t=n.buttons,e=n.menuItems,o=n.contextToolbars,r=n.sidebars,i=Lb(l),u={menuItems:e,menus:l.settings.menu?P(l.settings.menu,function(n){returnAn(n,{items:n.items})}):{},menubar:l.settings.menubar,toolbar:i.getOrThunk(function(){returnl.getParam("toolbar",!0)}),buttons:t,sidebar:r};GD(l,o,v,{backstage:b}),C_(l,v);vara=l.getElement(),c=V(),s={mothership:I,uiMothership:R,outerContainer:F},f={targetNode:a,height:c};returnp.render(l,s,u,b,f)},getUi:function(){return{channels:{broadcastAll:R.broadcast,broadcastOn:R.broadcastOn,register:function(){}}}}}},vM=function(n,t){vare=on.from(zo(n,"id")).fold(function(){varn=Xo("dialog-label");returnPo(t,"id",n),n},l);Po(n,"aria-labelledby",e)},bM=nn([ct("lazySink"),ht("dragBlockClass"),Bt("getBounds",Su),St("useTabstopAt",nn(!0)),St("eventOrder",{}),Fs("modalBehaviours",[lg]),Ku("onExecute"),$u("onEscape")]),yM={sketch:l},xM=nn([Sl({name:"draghandle",overrides:function(n,t){return{behaviours:ba([w_.config({mode:"mouse",getTarget:function(n){returnCu(n,'[role="dialog"]').getOr(n)},blockerClass:n.dragBlockClass.getOrDie(newError("The drag blocker class was not specified for a dialog with a drag handle: \n"+JSON.stringify(t,null,2)).message),getBounds:n.getDragBounds})])}}}),xl({schema:[ct("dom")],name:"title"}),xl({factory:yM,schema:[ct("dom")],name:"close"}),xl({factory:yM,schema:[ct("dom")],name:"body"}),Sl({factory:yM,schema:[ct("dom")],name:"footer"}),wl({factory:{sketch:function(n,t){returnN(N({},n),{dom:t.dom,components:t.components})}},schema:[St("dom",{tag:"div",styles:{position:"fixed",left:"0px",top:"0px",right:"0px",bottom:"0px"}}),St("components",[])],name:"blocker"})]),wM=Al({name:"ModalDialog",configFields:bM(),partFields:xM(),factory:function(o,n,t,r){vara=Xo("alloy.dialog.busy"),c=Xo("alloy.dialog.idle"),s=ba([lg.config({mode:"special",onTab:function(){returnon.some(!0)},onShiftTab:function(){returnon.some(!0)}}),vg.config({})]),e=Xo("modal-events"),i=N(N({},o.eventOrder),{"alloy.system.attached":[e].concat(o.eventOrder["alloy.system.attached"]||[])});return{uid:o.uid,dom:o.dom,components:n,apis:{show:function(i){varn=o.lazySink(i).getOrDie(),u=ye(on.none()),t=r.blocker(),e=n.getSystem().build(N(N({},t),{components:t.components.concat([au(i)]),behaviours:ba([vg.config({}),Kd("dialog-blocker-events",[bo(Qr(),function(){lg.focusIn(i)}),lo(c,function(n,t){Lo(i.element(),"aria-busy")&&(jo(i.element(),"aria-busy"),u.get().each(function(n){returnmg.remove(i,n)}))}),lo(a,function(n,t){Po(i.element(),"aria-busy","true");vare=t.event().getBusySpec();u.get().each(function(n){mg.remove(i,n)});varo=e(i,s),r=n.getSystem().build(o);u.set(on.some(r)),mg.append(i,au(r)),r.hasConfigured(lg)&&lg.focusIn(r)})])])}));hs(n,e),lg.focusIn(i)},hide:function(t){Eo(t.element()).each(function(n){t.getSystem().getByDom(n).each(function(n){bs(n)})})},getBody:function(n){returnKs(n,o,"body")},getFooter:function(n){returnKs(n,o,"footer")},setIdle:function(n){oo(n,c)},setBusy:function(n,t){ro(n,a,{getBusySpec:t})}},eventOrder:i,domModification:{attributes:{role:"dialog","aria-modal":"true"}},behaviours:Rs(o.modalBehaviours,[mg.config({}),lg.config({mode:"cyclic",onEnter:o.onExecute,onEscape:o.onEscape,useTabstopAt:o.useTabstopAt}),Kd(e,[Ii(function(n){vM(n.element(),Ks(n,o,"title").element()),function(n,t){vare=on.from(zo(n,"id")).fold(function(){varn=Xo("dialog-describe");returnPo(t,"id",n),n},l);Po(n,"aria-describedby",e)}(n.element(),Ks(n,o,"body").element())})])])}},apis:{show:function(n,t){n.show(t)},hide:function(n,t){n.hide(t)},getBody:function(n,t){returnn.getBody(t)},getFooter:function(n,t){returnn.getFooter(t)},setBusy:function(n,t,e){n.setBusy(t,e)},setIdle:function(n,t){n.setIdle(t)}}}),SM=[ft("type"),ft("text"),lt("level",["info","warn","error","success"]),ft("icon"),St("url","")],CM=re(SM),kM=[ft("type"),ft("text"),Tt("disabled",!1),Tt("primary",!1),ce("name","name",In(function(){returnXo("button-name")}),ge),yt("icon"),Tt("borderless",!1)],OM=re(kM),EM=[ft("type"),ft("name"),ft("label"),Tt("disabled",!1)],TM=re(EM),BM=pe,DM=[ft("type"),ft("name")],AM=DM.concat([yt("label")]),_M=re(AM),MM=ge,FM=re(AM),IM=ge,RM=re(AM),VM=Kn(se),NM=AM.concat([Tt("sandboxed",!0)]),HM=re(NM),PM=ge,zM=AM.concat([yt("inputMode"),yt("placeholder"),Tt("maximized",!1),Tt("disabled",!1)]),LM=re(zM),jM=ge,UM=AM.concat([gt("items",[ft("text"),ft("value")]),kt("size",1),Tt("disabled",!1)]),WM=re(UM),GM=ge,XM=AM.concat([Tt("constrain",!0),Tt("disabled",!1)]),YM=re(XM),qM=re([ft("width"),ft("height")]),KM=AM.concat([yt("placeholder"),Tt("maximized",!1),Tt("disabled",!1)]),JM=re(KM),$M=ge,QM=AM.concat([Et("filetype","file",["image","media","file"]),St("disabled",!1)]),ZM=re(QM),nF=re([ft("value"),St("meta",{})]),tF=DM.concat([Ot("tag","textarea"),ft("scriptId"),ft("scriptUrl"),(fM="settings",lM=undefined,Ct(fM,lM,be))]),eF=DM.concat([Ot("tag","textarea"),dt("init")]),oF=Zn(function(n){returntt("customeditor.old",qn(eF),n).orThunk(function(){returntt("customeditor.new",qn(tF),n)})}),rF=ge,iF=[ft("type"),ft("html"),Et("presets","presentation",["presentation","document"])],uF=re(iF),aF=AM.concat([st("currentState",re([ct("blob"),ft("url")]))]),cF=re(aF),sF=AM.concat([St("columns","auto")]),fF=re(sF),lF=(dM=[ft("value"),ft("text"),ft("icon")],ue(dM)),dF=[ft("type"),pt("header",ge),pt("cells",Kn(ge))],mF=re(dF),gF=fe(function(){returnrt("type",{alertbanner:CM,bar:re(function(n){return[ft("type"),n]}(B_("bar"))),button:OM,checkbox:TM,colorinput:_M,colorpicker:FM,dropzone:RM,grid:re(T_(B_("grid"))),iframe:HM,input:LM,selectbox:WM,sizeinput:YM,textarea:JM,urlinput:ZM,customeditor:oF,htmlpanel:uF,imagetools:cF,collection:fF,label:re(function(n){return[ft("type"),ft("label"),n]}(B_("label"))),table:mF,panel:hF})}),pF=[ft("type"),St("classes",[]),pt("items",gF)],hF=re(pF),vF=[ce("name","name",In(function(){returnXo("tab-name")}),ge),ft("title"),pt("items",gF)],bF=[ft("type"),gt("tabs",vF)],yF=re(bF),xF=re([ft("type"),ft("name"),Tt("active",!1)].concat(Wp)),wF=pe,SF=[ce("name","name",In(function(){returnXo("button-name")}),ge),yt("icon"),Et("align","end",["start","end"]),Tt("primary",!1),Tt("disabled",!1)],CF=g(SF,[ft("text")]),kF=g([lt("type",["submit","cancel","custom"])],CF),OF=g([lt("type",["menu"]),yt("text"),yt("tooltip"),yt("icon"),pt("items",xF),Bt("onSetup",function(){returnZ})],SF),EF=CF,TF=it("type",{submit:kF,cancel:kF,custom:kF,menu:OF}),BF=re([ft("title"),st("body",rt("type",{panel:hF,tabpanel:yF})),Ot("size","normal"),pt("buttons",TF),St("initialData",{}),Bt("onAction",Z),Bt("onChange",Z),Bt("onSubmit",Z),Bt("onClose",Z),Bt("onCancel",Z),St("onTabChange",Z)]),DF=function(n){returnsn(n)?[n].concat(B(R(n),DF)):fn(n)?B(n,DF):[]},AF={checkbox:BM,colorinput:MM,colorpicker:IM,dropzone:VM,input:jM,iframe:PM,sizeinput:qM,selectbox:GM,size:qM,textarea:$M,urlinput:nF,customeditor:rF,collection:lF,togglemenuitem:wF},_F=re(g([lt("type",["cancel","custom"])],EF)),MF=re([ft("title"),ft("url"),bt("height"),bt("width"),(mM="buttons",gM=_F,vt(mM,Kn(gM))),Bt("onAction",Z),Bt("onCancel",Z),Bt("onClose",Z),Bt("onMessage",Z)]),FF={open:function(n,t){vare=__(t);returnn(e.internalDialog,e.initialData,e.dataValidator)},openUrl:function(n,t){returnn(et(function(n){returntt("dialog",MF,n)}(t)))},redial:function(n){return__(n)}},IF=Dl({name:"TabButton",configFields:[St("uid",undefined),ct("value"),ce("dom","dom",Rn(function(n){return{attributes:{role:"tab",id:Xo("aria"),"aria-selected":"false"}}}),de()),ht("action"),St("domModification",{}),Fs("tabButtonBehaviours",[vg,lg,Zf]),ct("view")],factory:function(n,t){return{uid:n.uid,dom:n.dom,components:n.components,events:rm(n.action),behaviours:Rs(n.tabButtonBehaviours,[vg.config({}),lg.config({mode:"execution",useSpace:!0,useEnter:!0}),Zf.config({store:{mode:"memory",initialValue:n.value}})]),domModification:n.domModification}}}),RF=nn([ct("tabs"),ct("dom"),St("clickToDismiss",!1),Fs("tabbarBehaviours",[ad,lg]),Xu(["tabClass","selectedClass"])]),VF=Cl({factory:IF,name:"tabs",unit:"tab",overrides:function(o,n){functionr(n,t){ad.dehighlight(n,t),ro(n,Ai(),{tabbar:n,button:t})}functioni(n,t){ad.highlight(n,t),ro(n,Di(),{tabbar:n,button:t})}return{action:function(n){vart=n.getSystem().getByUid(o.uid).getOrDie(),e=ad.isHighlighted(t,n);(e&&o.clickToDismiss?r:e?Z:i)(t,n)},domModification:{classes:[o.markers.tabClass]}}}}),NF=nn([VF]),HF=Al({name:"Tabbar",configFields:RF(),partFields:NF(),factory:function(n,t,e,o){return{uid:n.uid,dom:n.dom,components:t,"debug.sketcher":"Tabbar",domModification:{attributes:{role:"tablist"}},behaviours:Rs(n.tabbarBehaviours,[ad.config({highlightClass:n.markers.selectedClass,itemClass:n.markers.tabClass,onHighlight:function(n,t){Po(t.element(),"aria-selected","true")},onDehighlight:function(n,t){Po(t.element(),"aria-selected","false")}}),lg.config({mode:"flow",getInitial:function(n){returnad.getHighlighted(n).map(function(n){returnn.element()})},selector:"."+n.markers.tabClass,executeOnMove:!0})])}}}),PF=Dl({name:"Tabview",configFields:[Fs("tabviewBehaviours",[mg])],factory:function(n,t){return{uid:n.uid,dom:n.dom,behaviours:Rs(n.tabviewBehaviours,[mg.config({})]),domModification:{attributes:{role:"tabpanel"}}}}}),zF=nn([St("selectFirst",!0),qu("onChangeTab"),qu("onDismissTab"),St("tabs",[]),Fs("tabSectionBehaviours",[])]),LF=xl({factory:HF,schema:[ct("dom"),mt("markers",[ct("tabClass"),ct("selectedClass")])],name:"tabbar",defaults:function(n){return{tabs:n.tabs}}}),jF=xl({factory:PF,name:"tabview"}),UF=nn([LF,jF]),WF=Al({name:"TabSection",configFields:zF(),partFields:UF(),factory:function(r,n,t,e){functiono(n,t){qs(n,r,"tabbar").each(function(n){t(n).each(io)})}return{uid:r.uid,dom:r.dom,components:n,behaviours:Is(r.tabSectionBehaviours),events:co(H([r.selectFirst?[Ii(function(n,t){o(n,ad.getFirst)})]:[],[lo(Di(),function(n,t){!function(o){vart=Zf.getValue(o);qs(o,r,"tabview").each(function(e){E(r.tabs,function(n){returnn.value===t}).each(function(n){vart=n.view();Po(e.element(),"aria-labelledby",zo(o.element(),"id")),mg.set(e,t),r.onChangeTab(e,o,t)})})}(t.event().button())}),lo(Ai(),function(n,t){vare=t.event().button();r.onDismissTab(n,e)})]])),apis:{getViewItems:function(n){returnqs(n,r,"tabview").map(function(n){returnmg.contents(n)}).getOr([])},showTab:function(n,e){o(n,function(t){varn=ad.getCandidates(t);returnE(n,function(n){returnZf.getValue(n)===e}).filter(function(n){return!ad.isHighlighted(t,n)})})}}}},apis:{getViewItems:function(n,t){returnn.getViewItems(t)},showTab:function(n,t,e){n.showTab(t,e)}}}),GF="send-data-to-section",XF="send-data-to-view",YF=Xo("update-dialog"),qF=Xo("update-title"),KF=Xo("update-body"),JF=Xo("update-footer"),$F=Xo("body-send-message"),QF=function(i,n){functiont(n,r){returnlo(n,function(e,o){u(e,function(n,t){r(i(),n,o.event(),e)})})}varu=function(t,e){RT.getState(t).get().each(function(n){e(n,t)})};returng(P_(t,n),[t(sy,function(n,t,e){t.onAction(n,{name:e.name()})})])},ZF=function(i,n){functiont(n,r){returnlo(n,function(e,o){u(e,function(n,t){r(i(),n,o.event(),e)})})}varu=function(t,e){RT.getState(t).get().each(function(n){e(n.internalDialog,t)})};returng(P_(t,n),[t(fy,function(n,t){returnt.onSubmit(n)}),t(uy,function(n,t,e){t.onChange(n,{name:e.name()})}),t(sy,function(n,t,e,o){functionr(){returnlg.focusIn(o)}vari=Sa();t.onAction(n,{name:e.name(),value:e.value()}),Sa().fold(function(){r()},function(n){!Ye(o.element(),n)||Lo(n,"disabled")?r():Ye(n,i.getOrNull())&&Lo(i.getOrDie(),"disabled")&&r()})}),t(my,function(n,t,e){t.onTabChange(n,{newTabName:e.name(),oldTabName:e.oldName()})}),Ri(function(n){vart=i();Zf.setValue(n,t.getData())})])},nI=gh.deviceType.isTouch(),tI=tinymce.util.Tools.resolve("tinymce.util.URI"),eI=["insertContent","setContent","execCommand","close","block","unblock"],oI=function(n){varl=n.backstage,d=n.editor,m=$b(d),e=function(c){vars=c.backstage.shared;return{open:function(n,t){functione(){wM.hide(u),t()}varo=vm(YC({name:"close-alert",text:"OK",primary:!0,align:"end",disabled:!1,icon:on.none()},"cancel",c.backstage)),r=Y_(),i=X_(e,s.providers),u=uu($_({lazySink:function(){returns.getSink()},header:G_(r,i),body:q_(n,s.providers),footer:on.some(K_(J_([],[o.asSpec()]))),onEscape:e,extraClasses:["tox-alert-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[lo(cy,e)],eventOrder:{}}));wM.show(u);vara=o.get(u);vg.focus(a)}}}(n),o=function(s){varf=s.backstage.shared;return{open:function(n,t){functione(n){wM.hide(a),t(n)}varo=vm(YC({name:"yes",text:"Yes",primary:!0,align:"end",disabled:!1,icon:on.none()},"submit",s.backstage)),r=YC({name:"no",text:"No",primary:!0,align:"end",disabled:!1,icon:on.none()},"cancel",s.backstage),i=Y_(),u=X_(function(){returne(!1)},f.providers),a=uu($_({lazySink:function(){returnf.getSink()},header:G_(i,u),body:q_(n,f.providers),footer:on.some(K_(J_([],[r,o.asSpec()]))),onEscape:function(){returne(!1)},extraClasses:["tox-confirm-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[lo(cy,function(){returne(!1)}),lo(fy,function(){returne(!0)})],eventOrder:{}}));wM.show(a);varc=o.get(a);vg.focus(c)}}}(n),r=function(n,e){returnFF.openUrl(function(n){vart=sM(n,{closeWindow:function(){wM.hide(t.dialog),e(t.instanceApi)}},d,l);returnwM.show(t.dialog),t.instanceApi},n)},i=function(n,i){returnFF.open(function(n,t,e){varo=t,r=uM({dataValidator:e,initialData:o,internalDialog:n},{redial:FF.redial,closeWindow:function(){wM.hide(r.dialog),i(r.instanceApi)}},l);returnwM.show(r.dialog),r.instanceApi.setData(o),r.instanceApi},n)},u=function(n,c,s,f){returnFF.open(function(n,t,e){functiono(){returni.on(function(n){cA.refresh(n)})}varr=function(n,t){returnet(tt("data",t,n))}(t,e),i=function(){vart=ye(on.none());return{clear:function(){t.set(on.none())},set:function(n){t.set(on.some(n))},isSet:function(){returnt.get().isSome()},on:function(n){t.get().each(n)}}}(),u=aM({dataValidator:e,initialData:r,internalDialog:n},{redial:FF.redial,closeWindow:function(){i.on(jg.hide),d.off("ResizeEditor",o),i.clear(),s(u.instanceApi)}},l,f),a=uu(jg.sketch({lazySink:l.shared.getSink,dom:{tag:"div",classes:[]},fireDismissalEventInstead:{},inlineBehaviours:ba(g([Kd("window-manager-inline-events",[lo(Oi(),function(n,t){oo(u.dialog,cy)})])],function(n,t){returnt?[]:[cA.config({contextual:{lazyContext:function(){returnon.some(xu(we.fromDom(n.getContentAreaContainer())))},fadeInClass:"tox-dialog-dock-fadein",fadeOutClass:"tox-dialog-dock-fadeout",transitionClass:"tox-dialog-dock-transition"},leftAttr:"data-dock-left",topAttr:"data-dock-top",positionAttr:"data-dock-pos",modes:["top"]})]}(d,m)))}));returni.set(a),jg.showWithin(a,c,au(u.dialog),on.some(zr())),m||(cA.refresh(a),d.on("ResizeEditor",o)),u.instanceApi.setData(r),lg.focusIn(u.dialog),u.instanceApi},n)};return{open:function(n,t,e){returnt!==undefined&&"toolbar"===t.inline?u(n,l.shared.anchors.toolbar(),e,t.ariaAttrs):t!==undefined&&"cursor"===t.inline?u(n,l.shared.anchors.cursor(),e,t.ariaAttrs):i(n,e)},openUrl:function(n,t){returnr(n,t)},alert:function(n,t){e.open(n,function(){t()})},close:function(n){n.close()},confirm:function(n,t){o.open(n,function(n){t(n)})}}};!functionmI(){n.add("silver",function(n){vart=hM(n),e=t.uiMothership,o=t.backstage,r=t.renderUI,i=t.getUi;db(n,o.shared);varu=oI({editor:n,backstage:o});return{renderUI:r,getWindowManagerImpl:nn(u),getNotificationManagerImpl:function(){returnKg(0,{backstage:o},e)},ui:i()}})}()}(window);