/*! * build: Hopaheal * copyright: Mead * time: 2022-7-23 18:51:45 */ (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-1de20c9a"],{"030f":function(t,e,n){(function(t){(function(){"use strict";var e=function(t){var e=typeof t;return null===t?"null":"object"===e&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"===e&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":e},n=function(t){return function(n){return e(n)===t}},r=function(t){return function(e){return typeof e===t}},o=function(t){return function(e){return t===e}},i=n("string"),a=n("object"),u=n("array"),c=o(null),s=r("boolean"),l=o(void 0),f=function(t){return null===t||void 0===t},d=function(t){return!f(t)},h=r("function"),p=r("number"),m=function(t,e){if(u(t)){for(var n=0,r=t.length;n-1},q=function(t,e){for(var n=0,r=t.length;n=0;n--){var r=t[n];e(r,n)}},Y=function(t,e){for(var n=[],r=[],o=0,i=t.length;o=0&&e=e.length&&t.substr(n,n+e.length)===e},It=function(t,e){return qt(t,e)?Rt(t,e.length):t},Vt=function(t,e){return Ut(t,e)?t:Ht(t,e)},Ft=function(t,e){return-1!==t.indexOf(e)},qt=function(t,e){return Bt(t,e,0)},Ut=function(t,e){return Bt(t,e,t.length-e.length)},Wt=function(t){return function(e){return e.replace(t,"")}},Gt=Wt(/^\s+|\s+$/g),$t=function(t){return t.length>0},Kt=function(t){return!$t(t)},Yt=function(t){return void 0!==t.style&&h(t.style.getPropertyValue)},Xt=function(t,e){var n=e||document,r=n.createElement("div");if(r.innerHTML=t,!r.hasChildNodes()||r.childNodes.length>1)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return Qt(r.childNodes[0])},Zt=function(t,e){var n=e||document,r=n.createElement(t);return Qt(r)},Jt=function(t,e){var n=e||document,r=n.createTextNode(t);return Qt(r)},Qt=function(t){if(null===t||void 0===t)throw new Error("Node cannot be null or undefined");return{dom:t}},te=function(t,e,n){return j.from(t.dom.elementFromPoint(e,n)).map(Qt)},ee={fromHtml:Xt,fromTag:Zt,fromText:Jt,fromDom:Qt,fromPoint:te};"undefined"!==typeof window?window:Function("return this;")();var ne,re=9,oe=11,ie=1,ae=3,ue=function(t){var e=t.dom.nodeName;return e.toLowerCase()},ce=function(t){return t.dom.nodeType},se=function(t){return function(e){return ce(e)===t}},le=se(ie),fe=se(ae),de=se(re),he=se(oe),pe=function(t){var e,n=!1;return function(){for(var r=[],o=0;o0&&e0}))},tr=function(t){var e={},n=t.dom;if(Yt(n))for(var r=0;rr?e-r:0;return o};return{set:n,get:r,getOuter:o,aggregate:i,max:a}},ir=or("height",(function(t){var e=t.dom;return jn(t)?e.getBoundingClientRect().height:e.offsetHeight})),ar=function(t){return ir.get(t)},ur=function(t){return ir.getOuter(t)},cr=function(t,e){var n=["margin-top","border-top-width","padding-top","padding-bottom","border-bottom-width","margin-bottom"],r=ir.max(t,e,n);Kn(t,"max-height",r+"px")},sr=function(t,e){var n=function(n,r){return sr(t+n,e+r)};return{left:t,top:e,translate:n}},lr=sr,fr=function(t){var e=t.getBoundingClientRect();return lr(e.left,e.top)},dr=function(t,e){return void 0!==t?t:void 0!==e?e:0},hr=function(t){var e=t.dom.ownerDocument,n=e.body,r=e.defaultView,o=e.documentElement;if(n===t.dom)return lr(n.offsetLeft,n.offsetTop);var i=dr(null===r||void 0===r?void 0:r.pageYOffset,o.scrollTop),a=dr(null===r||void 0===r?void 0:r.pageXOffset,o.scrollLeft),u=dr(o.clientTop,n.clientTop),c=dr(o.clientLeft,n.clientLeft);return pr(t).translate(a-c,i-u)},pr=function(t){var e=t.dom,n=e.ownerDocument,r=n.body;return r===e?lr(r.offsetLeft,r.offsetTop):jn(t)?fr(e):lr(0,0)},mr=or("width",(function(t){return t.dom.offsetWidth})),vr=function(t,e){return mr.set(t,e)},gr=function(t){return mr.get(t)},br=function(t){return mr.getOuter(t)},yr=function(t,e){var n=["margin-left","border-left-width","padding-left","padding-right","border-right-width","margin-right"],r=mr.max(t,e,n);Kn(t,"max-width",r+"px")},xr=function(t,e,n,r,o,i,a){return{target:t,x:e,y:n,stop:r,prevent:o,kill:i,raw:a}},wr=function(t){var e=ee.fromDom(Dn(t).getOr(t.target)),n=function(){return t.stopPropagation()},r=function(){return t.preventDefault()},o=b(r,n);return xr(e,t.clientX,t.clientY,n,r,o,t)},_r=function(t,e){return function(n){t(n)&&e(wr(n))}},Or=function(t,e,n,r,o){var i=_r(n,r);return t.dom.addEventListener(e,i,o),{unbind:O(Cr,t,e,i,o)}},kr=function(t,e,n,r){return Or(t,e,n,r,!1)},Sr=function(t,e,n,r){return Or(t,e,n,r,!0)},Cr=function(t,e,n,r){t.dom.removeEventListener(e,n,r)},Er=function(t,e){var n=gn(t);n.each((function(n){n.dom.insertBefore(e.dom,t.dom)}))},Ar=function(t,e){var n=xn(t);n.fold((function(){var n=gn(t);n.each((function(t){Mr(t,e)}))}),(function(t){Er(t,e)}))},Tr=function(t,e){var n=On(t);n.fold((function(){Mr(t,e)}),(function(n){t.dom.insertBefore(e.dom,n.dom)}))},Mr=function(t,e){t.dom.appendChild(e.dom)},zr=function(t,e,n){_n(t,n).fold((function(){Mr(t,e)}),(function(t){Er(t,e)}))},Pr=function(t,e){$(e,(function(e){Er(t,e)}))},Nr=function(t,e){$(e,(function(e){Mr(t,e)}))},Dr=function(t){t.dom.textContent="",$(wn(t),(function(t){Lr(t)}))},Lr=function(t){var e=t.dom;null!==e.parentNode&&e.parentNode.removeChild(e)},jr=function(t){var e=wn(t);e.length>0&&Pr(t,e),Lr(t)},Hr=function(t){var e=void 0!==t?t.dom:document,n=e.body.scrollLeft||e.documentElement.scrollLeft,r=e.body.scrollTop||e.documentElement.scrollTop;return lr(n,r)},Rr=function(t,e,n){var r=void 0!==n?n.dom:document,o=r.defaultView;o&&o.scrollTo(t,e)},Br=function(t){var e=void 0===t?window:t;return en().browser.isFirefox()?j.none():j.from(e["visualViewport"])},Ir=function(t,e,n,r){return{x:t,y:e,width:n,height:r,right:t+n,bottom:e+r}},Vr=function(t){var e=void 0===t?window:t,n=e.document,r=Hr(ee.fromDom(n));return Br(e).fold((function(){var t=e.document.documentElement,n=t.clientWidth,o=t.clientHeight;return Ir(r.left,r.top,n,o)}),(function(t){return Ir(Math.max(t.pageLeft,r.left),Math.max(t.pageTop,r.top),t.width,t.height)}))},Fr=function(t,e){var n=t.view(e);return n.fold(x([]),(function(e){var n=t.owner(e),r=Fr(t,n);return[e].concat(r)}))},qr=function(t,e){var n=e.owner(t),r=Fr(e,n);return j.some(r)},Ur=function(t){var e,n=t.dom===document?j.none():j.from(null===(e=t.dom.defaultView)||void 0===e?void 0:e.frameElement);return n.map(ee.fromDom)},Wr=function(t){return hn(t)},Gr=Object.freeze({__proto__:null,view:Ur,owner:Wr}),$r=function(t){var e=ee.fromDom(document),n=Hr(e),r=qr(t,Gr);return r.fold(O(hr,t),(function(e){var r=pr(t),o=Z(e,(function(t,e){var n=pr(e);return{left:t.left+n.left,top:t.top+n.top}}),{left:0,top:0});return lr(o.left+r.left+n.left,o.top+r.top+n.top)}))},Kr=function(t,e,n){return{point:t,width:e,height:n}},Yr=function(t,e,n,r){return{x:t,y:e,width:n,height:r}},Xr=function(t,e,n,r){return{x:t,y:e,width:n,height:r,right:t+n,bottom:e+r}},Zr=function(t){var e=hr(t),n=br(t),r=ur(t);return Xr(e.left,e.top,n,r)},Jr=function(t){var e=$r(t),n=br(t),r=ur(t);return Xr(e.left,e.top,n,r)},Qr=function(){return Vr(window)},to=function(t){var e=function(e){return to(t)},n=function(e){return to(t)},r=function(e){return to(e(t))},o=function(e){return to(t)},i=function(e){e(t)},a=function(e){return e(t)},u=function(e,n){return n(t)},c=function(e){return e(t)},s=function(e){return e(t)},l=function(){return j.some(t)};return{isValue:E,isError:C,getOr:x(t),getOrThunk:x(t),getOrDie:x(t),or:e,orThunk:n,fold:u,map:r,mapError:o,each:i,bind:a,exists:c,forall:s,toOptional:l}},eo=function(t){var e=function(t){return t()},n=function(){return S(String(t))()},r=w,o=function(t){return t()},i=function(e){return eo(t)},a=function(e){return eo(e(t))},u=function(e){return eo(t)},c=function(e,n){return e(t)};return{isValue:C,isError:E,getOr:w,getOrThunk:e,getOrDie:n,or:r,orThunk:o,fold:c,map:i,mapError:a,each:v,bind:u,exists:C,forall:E,toOptional:j.none}},no=function(t,e){return t.fold((function(){return eo(e)}),to)},ro={value:to,error:eo,fromOption:no};(function(t){t[t["Error"]=0]="Error",t[t["Value"]=1]="Value"})(ne||(ne={}));var oo=function(t,e,n){return t.stype===ne.Error?e(t.serror):n(t.svalue)},io=function(t){var e=[],n=[];return $(t,(function(t){oo(t,(function(t){return n.push(t)}),(function(t){return e.push(t)}))})),{values:e,errors:n}},ao=function(t,e){return t.stype===ne.Error?{stype:ne.Error,serror:e(t.serror)}:t},uo=function(t,e){return t.stype===ne.Value?{stype:ne.Value,svalue:e(t.svalue)}:t},co=function(t,e){return t.stype===ne.Value?e(t.svalue):t},so=function(t,e){return t.stype===ne.Error?e(t.serror):t},lo=function(t){return{stype:ne.Value,svalue:t}},fo=function(t){return{stype:ne.Error,serror:t}},ho=function(t){return oo(t,ro.error,ro.value)},po=function(t){return t.fold(fo,lo)},mo={fromResult:po,toResult:ho,svalue:lo,partition:io,serror:fo,bind:co,bindError:so,map:uo,mapError:ao,fold:oo},vo=function(t,e,n,r){return{tag:"field",key:t,newKey:e,presence:n,prop:r}},go=function(t,e){return{tag:"custom",newKey:t,instantiator:e}},bo=function(t,e,n){switch(t.tag){case"field":return e(t.key,t.newKey,t.presence,t.prop);case"custom":return n(t.newKey,t.instantiator)}},yo=function(t,e){return e},xo=function(t,e){var n=a(t)&&a(e);return n?_o(t,e):e},wo=function(t){return function(){for(var e=[],n=0;n0?mo.svalue(_o(e,Oo.apply(void 0,t))):mo.svalue(e)},zo=function(t){return b(mo.serror,nt)(t)},Po=function(t,e){var n=mo.partition(t);return n.errors.length>0?zo(n.errors):Mo(n.values,e)},No=function(t){var e=mo.partition(t);return e.errors.length>0?zo(e.errors):mo.svalue(e.values)},Do={consolidateObj:Po,consolidateArr:No},Lo=function(t){return a(t)&&mt(t).length>100?" removed due to size":JSON.stringify(t,null,2)},jo=function(t){var e=t.length>10?t.slice(0,10).concat([{path:[],getErrorInfo:x("... (only showing first ten failures)")}]):t;return G(e,(function(t){return"Failed path: ("+t.path.join(" > ")+")\n"+t.getErrorInfo()}))},Ho=function(t,e){return mo.serror([{path:t,getErrorInfo:e}])},Ro=function(t,e,n){return Ho(t,(function(){return'Could not find valid *required* value for "'+e+'" in '+Lo(n)}))},Bo=function(t,e){return Ho(t,(function(){return'Choice schema did not contain choice key: "'+e+'"'}))},Io=function(t,e,n){return Ho(t,(function(){return'The chosen schema: "'+n+'" did not exist in branches: '+Lo(e)}))},Vo=function(t,e){return Ho(t,(function(){return"There are unsupported fields: ["+e.join(", ")+"] specified"}))},Fo=function(t,e){return Ho(t,x(e))},qo=function(t){var e=function(e,n){return mo.bindError(t(n),(function(t){return Fo(e,t)}))},n=x("val");return{extract:e,toString:n}},Uo=qo(mo.svalue),Wo=function(t,e,n,r){return Ct(e,n).fold((function(){return Ro(t,n,e)}),r)},Go=function(t,e,n,r){var o=Ct(t,e).getOrThunk((function(){return n(t)}));return r(o)},$o=function(t,e,n){return n(Ct(t,e))},Ko=function(t,e,n,r){var o=Ct(t,e).map((function(e){return!0===e?n(t):e}));return r(o)},Yo=function(t,e,n,r,o){var i=function(t){return o.extract(e.concat([r]),t)},a=function(t){return t.fold((function(){return mo.svalue(j.none())}),(function(t){var n=o.extract(e.concat([r]),t);return mo.map(n,j.some)}))};switch(t.tag){case"required":return Wo(e,n,r,i);case"defaultedThunk":return Go(n,r,t.process,i);case"option":return $o(n,r,a);case"defaultedOptionThunk":return Ko(n,r,t.process,a);case"mergeWithThunk":return Go(n,r,x({}),(function(e){var r=_o(t.process(n),e);return i(r)}))}},Xo=function(t,e,n){for(var r={},o=[],i=0,a=n;i0?mo.serror(o):mo.svalue(r)},Zo=function(t){var e=function(e,n){return t().extract(e,n)},n=function(){return t().toString()};return{extract:e,toString:n}},Jo=function(t){return mt(_t(t,d))},Qo=function(t){var e=ti(t),n=Z(t,(function(t,e){return bo(e,(function(e){var n;return _o(t,(n={},n[e]=!0,n))}),x(t))}),{}),r=function(t,r){var o=s(r)?[]:Jo(r),i=X(o,(function(t){return!At(n,t)}));return 0===i.length?e.extract(t,r):Vo(t,i)};return{extract:r,toString:e.toString}},ti=function(t){var e=function(e,n){return Xo(e,n,t)},n=function(){var e=G(t,(function(t){return bo(t,(function(t,e,n,r){return t+" -> "+r.toString()}),(function(t,e){return"state("+t+")"}))}));return"obj{\n"+e.join("\n")+"}"};return{extract:e,toString:n}},ei=function(t){var e=function(e,n){var r=G(n,(function(n,r){return t.extract(e.concat(["["+r+"]"]),n)}));return Do.consolidateArr(r)},n=function(){return"array("+t.toString()+")"};return{extract:e,toString:n}},ni=function(t){var e=function(e,n){for(var r=[],o=0,i=t;o0?va(n.errors):ma(n.values,e)},ba=function(t){return h(t)?t:C},ya=function(t,e,n){var r=t.dom,o=ba(n);while(r.parentNode){r=r.parentNode;var i=ee.fromDom(r),a=e(i);if(a.isSome())return a;if(o(i))break}return j.none()},xa=function(t,e,n){var r=e(t),o=ba(n);return r.orThunk((function(){return o(t)?j.none():ya(t,e,o)}))},wa=function(t,e){return sn(t.element,e.event.target)},_a={can:E,abort:C,run:v},Oa=function(t){if(!At(t,"can")&&!At(t,"abort")&&!At(t,"run"))throw new Error("EventHandler defined by: "+JSON.stringify(t,null,2)+" does not have can, abort, or run!");return T(T({},_a),t)},ka=function(t,e){return function(){for(var n=[],r=0;r1?X(e[n],(function(e){return q(t,(function(t){return t.name===e}))})).join(" > "):t[0].name;return ha(n,Dc(o,i))}))}));return ga(n,{})},Gc="alloy.base.behaviour",$c=ti([Ci("dom","dom",ko(),ti([Ti("tag"),Ki("styles",{}),Ki("classes",[]),Ki("attributes",{}),Ii("value"),Ii("innerHtml")])),Ti("components"),Ti("uid"),Ki("events",{}),Ki("apis",{}),Ci("eventOrder","eventOrder",To((ua={},ua[eu()]=["disabling",Gc,"toggling","typeaheadevents"],ua[Za()]=[Gc,"focusing","keying"],ua[uu()]=[Gc,"disabling","toggling","representing"],ua[Fa()]=[Gc,"representing","streaming","invalidating"],ua[hu()]=[Gc,"representing","item-events","tooltipping"],ua[Na()]=["focusing",Gc,"item-type-events"],ua[Ta()]=["focusing",Gc,"item-type-events"],ua[Ha()]=["item-type-events","tooltipping"],ua[tu()]=["receiving","reflecting","tooltipping"],ua)),ai()),Ii("domModification")]),Kc=function(t){return xi("custom.definition",$c,t)},Yc=function(t){return T(T({},t.dom),{uid:t.uid,domChildren:G(t.components,(function(t){return t.element}))})},Xc=function(t){return t.domModification.fold((function(){return Mc({})}),Mc)},Zc=function(t){return t.events},Jc=function(t,e){var n=Fn(t,e);return void 0===n||""===n?[]:n.split(" ")},Qc=function(t,e,n){var r=Jc(t,e),o=r.concat([n]);return In(t,e,o.join(" ")),!0},ts=function(t,e,n){var r=X(Jc(t,e),(function(t){return t!==n}));return r.length>0?In(t,e,r.join(" ")):Wn(t,e),!1},es=function(t){return void 0!==t.dom.classList},ns=function(t){return Jc(t,"class")},rs=function(t,e){return Qc(t,"class",e)},os=function(t,e){return ts(t,"class",e)},is=function(t,e){es(t)?t.dom.classList.add(e):rs(t,e)},as=function(t){var e=es(t)?t.dom.classList:ns(t);0===e.length&&Wn(t,"class")},us=function(t,e){if(es(t)){var n=t.dom.classList;n.remove(e)}else os(t,e);as(t)},cs=function(t,e){return es(t)&&t.dom.classList.contains(e)},ss=function(t,e){$(e,(function(e){is(t,e)}))},ls=function(t,e){$(e,(function(e){us(t,e)}))},fs=function(t,e){return ot(e,(function(e){return cs(t,e)}))},ds=function(t){return t.dom.value},hs=function(t,e){if(void 0===e)throw new Error("Value.set was undefined");t.dom.value=e},ps=function(t){var e=ee.fromTag(t.tag);Vn(e,t.attributes),ss(e,t.classes),Yn(e,t.styles),t.innerHtml.each((function(t){return Ku(e,t)}));var n=t.domChildren;return Nr(e,n),t.value.each((function(t){hs(e,t)})),t.uid,lc(e,t.uid),e},ms=function(t){var e=Ct(t,"behaviours").getOr({});return rt(mt(e),(function(t){var n=e[t];return d(n)?[n.me]:[]}))},vs=function(t,e){return Cc(t,e)},gs=function(t){var e=ms(t);return vs(t,e)},bs=function(t,e,n){var r=Yc(t),o=Xc(t),i={"alloy.base.modification":o},a=e.length>0?Pc(n,i,e,r):o;return zc(r,a)},ys=function(t,e,n){var r={"alloy.base.behaviour":Zc(t)};return Vc(n,t.eventOrder,e,r).getOrDie()},xs=function(t){var e=function(){return y},n=oa(mc),r=wi(Kc(t)),o=gs(t),i=Ec(o),a=Ac(o),u=bs(r,i,a),c=ps(u),s=ys(r,i,a),l=oa(r.components),f=function(t){n.set(t)},d=function(){n.set(pc(e))},p=function(){var t=wn(c),e=rt(t,(function(t){return n.get().getByDom(t).fold((function(){return[]}),ct)}));l.set(e)},m=function(e){var n=a,r=h(n[e.name()])?n[e.name()]:function(){throw new Error("Could not find "+e.name()+" in "+JSON.stringify(t,null,2))};return r()},v=function(t){return h(a[t.name()])},g=function(){return r.apis},b=function(t){return a[t]().map((function(t){return t.state.readState()})).getOr("not enabled")},y={uid:t.uid,getSystem:n.get,config:m,hasConfigured:v,spec:t,readState:b,getApis:g,connect:f,disconnect:d,element:c,syncComponents:p,components:l.get,events:s};return y},ws=function(t){var e=Ct(t,"components").getOr([]);return G(e,Es)},_s=function(t){var e=hc(t),n=e.events,r=M(e,["events"]),o=ws(r),i=T(T({},r),{events:T(T({},nc),n),components:o});return ro.value(xs(i))},Os=function(t){var e=ee.fromText(t);return ks({element:e})},ks=function(t){var e=_i("external.component",Qo([Ti("element"),Ii("uid")]),t),n=oa(pc()),r=function(t){n.set(t)},o=function(){n.set(pc((function(){return a})))},i=e.uid.getOrThunk((function(){return dc("external")}));lc(e.element,i);var a={uid:i,getSystem:n.get,config:j.none,hasConfigured:C,connect:r,disconnect:o,getApis:function(){return{}},element:e.element,spec:t,readState:x("No state"),syncComponents:v,components:x([]),events:{}};return wc(a)},Ss=dc,Cs=function(t){return Et(t,"uid")},Es=function(t){return _c(t).getOrThunk((function(){var e=Cs(t)?t:T({uid:Ss("")},t);return _s(e).getOrDie()}))},As=wc;function Ts(t,e,n,r,o){return t(n,r)?j.some(n):h(o)&&o(n)?j.none():e(n,r,o)}var Ms,zs=function(t,e,n){var r=t.dom,o=h(n)?n:C;while(r.parentNode){r=r.parentNode;var i=ee.fromDom(r);if(e(i))return j.some(i);if(o(i))break}return j.none()},Ps=function(t,e,n){var r=function(t,e){return e(t)};return Ts(r,zs,t,e,n)},Ns=function(t,e){var n=function(t){return e(ee.fromDom(t))},r=tt(t.dom.childNodes,n);return r.map(ee.fromDom)},Ds=function(t,e){var n=function(t){for(var r=0;r-1}));return e.bind((function(t){var e=Fn(t,"id"),n=Tn(t);return Rs(n,'[aria-owns="'+e+'"]')}))},Vs=function(){var t=oc("aria-owns"),e=function(e){In(e,"aria-owns",t)},n=function(t){Wn(t,"aria-owns")};return{id:t,link:e,unlink:n}},Fs=function(t,e){return Is(e).exists((function(e){return qs(t,e)}))},qs=function(t,e){return Ls(e,(function(e){return sn(e,t.element)}),C)||Fs(t,e)},Us="unknown";(function(t){t[t["STOP"]=0]="STOP",t[t["NORMAL"]=1]="NORMAL",t[t["LOGGING"]=2]="LOGGING"})(Ms||(Ms={}));var Ws=oa({}),Gs=function(t,e){var n=[],r=(new Date).getTime();return{logEventCut:function(t,e,r){n.push({outcome:"cut",target:e,purpose:r})},logEventStopped:function(t,e,r){n.push({outcome:"stopped",target:e,purpose:r})},logNoParent:function(t,e,r){n.push({outcome:"no-parent",target:e,purpose:r})},logEventNoHandlers:function(t,e){n.push({outcome:"no-handlers-left",target:e})},logEventResponse:function(t,e,r){n.push({outcome:"response",purpose:r,target:e})},write:function(){var o=(new Date).getTime();F(["mousemove","mouseover","mouseout",uu()],t)||console.log(t,{event:t,time:o-r,target:e.dom,sequence:G(n,(function(t){return F(["cut","stopped","response"],t.outcome)?"{"+t.purpose+"} "+t.outcome+" at ("+Qu(t.target)+")":t.outcome}))})}}},$s=function(t,e,n){var r=Ct(Ws.get(),t).orThunk((function(){var e=mt(Ws.get());return pt(e,(function(e){return t.indexOf(e)>-1?j.some(Ws.get()[e]):j.none()}))})).getOr(Ms.NORMAL);switch(r){case Ms.NORMAL:return n(Js());case Ms.LOGGING:var o=Gs(t,e),i=n(o);return o.write(),i;case Ms.STOP:return!0}},Ks=["alloy/data/Fields","alloy/debugging/Debugging"],Ys=function(){var t=new Error;if(void 0!==t.stack){var e=t.stack.split("\n");return tt(e,(function(t){return t.indexOf("alloy")>0&&!q(Ks,(function(e){return t.indexOf(e)>-1}))})).getOr(Us)}return Us},Xs={logEventCut:v,logEventStopped:v,logNoParent:v,logEventNoHandlers:v,logEventResponse:v,write:v},Zs=function(t,e,n){return $s(t,e,n)},Js=x(Xs),Qs=x([Ti("menu"),Ti("selectedMenu")]),tl=x([Ti("item"),Ti("selectedItem")]);x(ti(tl().concat(Qs())));var el=x(ti(tl())),nl=Hi("initSize",[Ti("numColumns"),Ti("numRows")]),rl=function(){return Mi("markers",el())},ol=function(){return Hi("markers",[Ti("backgroundMenu")].concat(Qs()).concat(tl()))},il=function(t){return Hi("markers",G(t,Ti))},al=function(t,e,n){return Ys(),Ci(e,e,n,gi((function(t){return ro.value((function(){for(var e=[],n=0;nr?n:o=n&&a<=o,h=u>=r&&u<=i,p=d&&h,m=c<=o&&c>=n,v=s<=i&&s>=r,g=m&&v,b=Math.min(l,a>=n?o-a:c-n),y=Math.min(f,u>=r?i-u:s-r);return{originInBounds:p,sizeInBounds:g,visibleW:b,visibleH:y}},Xf=function(t,e){var n=e.x,r=e.y,o=e.right,i=e.bottom,a=t.x,u=t.y,c=t.width,s=t.height,l=Math.max(n,o-c),f=Math.max(r,i-s),d=Al(a,n,l),h=Al(u,r,f),p=Math.min(d+c,o)-d,m=Math.min(h+s,i)-h;return Xr(d,h,p,m)},Zf=function(t,e,n){var r=x(e.bottom-n.y),o=x(n.bottom-e.y),i=gl(t,o,o,r),a=x(e.right-n.x),u=x(n.right-e.x),c=bl(t,u,u,a);return{maxWidth:c,maxHeight:i}},Jf=function(t,e,n,r){var o=t.bubble,i=o.offset,a=zl(r,t.restriction,i),u=t.x+i.left,c=t.y+i.top,s=Xr(u,c,e,n),l=Yf(s,a),f=l.originInBounds,d=l.sizeInBounds,h=l.visibleW,p=l.visibleH,m=f&&d,v=m?s:Xf(s,a),g=v.width>0&&v.height>0,b=Zf(t.direction,v,r),y=b.maxWidth,x=b.maxHeight,w={rect:v,maxHeight:x,maxWidth:y,direction:t.direction,placement:t.placement,classes:{on:o.classesOn,off:o.classesOff},layout:t.label,testY:c};return m||t.alwaysFit?Kf.fit(w):Kf.nofit(w,h,p,g)},Qf=function(t,e,n,r,o,i){var a=r.width,u=r.height,c=function(e,c,s,l,f){var d=e(n,r,o,t,i),h=Jf(d,a,u,i);return h.fold(x(h),(function(t,e,n,r){var o=f===r?n>l||e>s:!f&&r;return o?h:Kf.nofit(c,s,l,f)}))},s=J(e,(function(t,e){var n=O(c,e);return t.fold(x(t),n)}),Kf.nofit({rect:n,maxHeight:r.height,maxWidth:r.width,direction:yl(),placement:"southeast",classes:{on:[],off:[]},layout:"none",testY:n.y},-1,-1,!1));return s.fold(w,w)},td=function(t){var e=oa(j.none()),n=function(){return e.get().each(t)},r=function(){n(),e.set(j.none())},o=function(){return e.get().isSome()},i=function(){return e.get()},a=function(t){n(),e.set(j.some(t))};return{clear:r,isSet:o,get:i,set:a}},ed=function(){return td((function(t){return t.destroy()}))},nd=function(){return td((function(t){return t.unbind()}))},rd=function(){var t=ed(),e=function(e){return t.get().each(e)};return T(T({},t),{run:e})},od=function(){var t=td(v),e=function(e){return t.get().each(e)};return T(T({},t),{on:e})},id=E,ad=function(t,e,n){return kr(t,e,id,n)},ud=function(t,e,n){return Sr(t,e,id,n)},cd=wr,sd=["top","bottom","right","left"],ld="data-alloy-transition-timer",fd=function(t,e){return fs(t,e.classes)},dd=function(t,e,n){return n.exists((function(n){var r=t.mode;return"all"===r||n[r]!==e[r]}))},hd=function(t,e){var n=function(t){return parseFloat(t).toFixed(3)};return kt(e,(function(e,r){var o=t[r].map(n),i=e.map(n);return!Mt(o,i)})).isSome()},pd=function(t){var e=function(e){var n=Zn(t,e),r=i(n)?n.split(/\s*,\s*/):[];return X(r,$t)},n=function(t){if(i(t)&&/^[\d.]+/.test(t)){var e=parseFloat(t);return Ut(t,"ms")?e:1e3*e}return 0},r=e("transition-delay"),o=e("transition-duration");return J(o,(function(t,e,o){var i=n(r[o])+n(e);return Math.max(t,i)}),0)},md=function(t,e){var n,r=nd(),o=nd(),i=function(e){var n,r=null!==(n=e.raw.pseudoElement)&&void 0!==n?n:"";return sn(e.target,t)&&Kt(r)&&F(sd,e.raw.propertyName)},a=function(a){if(f(a)||i(a)){r.clear(),o.clear();var u=null===a||void 0===a?void 0:a.raw.type;(f(u)||u===Ga())&&(clearTimeout(n),Wn(t,ld),ls(t,e.classes))}},u=function(){r.set(ad(t,Ga(),a)),o.set(ad(t,Wa(),a))};if("ontransitionstart"in t.dom)var c=ad(t,$a(),(function(t){i(t)&&(c.unbind(),u())}));else u();var s=pd(t);requestAnimationFrame((function(){n=setTimeout(a,s+17),In(t,ld,n)}))},vd=function(t,e){ss(t,e.classes),qn(t,ld).each((function(e){clearTimeout(parseInt(e,10)),Wn(t,ld)})),md(t,e)},gd=function(t,e,n,r,o,i){var a=dd(r,o,i);if(a||fd(t,r)){Kn(t,"position",n.position);var u=Lf(e,t),c=Df(e,T(T({},o),{rect:u})),s=ut(sd,(function(t){return c[t]}));hd(n,s)&&(Xn(t,s),a&&vd(t,r),rr(t))}else ls(t,r.classes)},bd=function(t){return{width:br(t),height:ur(t)}},yd=function(t,e,n,r){nr(e,"max-height"),nr(e,"max-width");var o=bd(e);return Qf(e,r.preference,t,o,n,r.bounds)},xd=function(t,e){var n=e.classes;ls(t,n.off),ss(t,n.on)},wd=function(t,e,n){var r=n.maxHeightFunction;r(t,e.maxHeight)},_d=function(t,e,n){var r=n.maxWidthFunction;r(t,e.maxWidth)},Od=function(t,e,n){var r=Df(n.origin,e);n.transition.each((function(o){gd(t,n.origin,r,o,e,n.lastPlacement)})),zf(t,r)},kd=function(t,e){Wf(t,e.placement)},Sd=function(t,e){cr(t,Math.floor(e))},Cd=x((function(t,e){Sd(t,e),Yn(t,{"overflow-x":"hidden","overflow-y":"auto"})})),Ed=x((function(t,e){Sd(t,e)})),Ad=function(t,e,n){return void 0===t[e]?n:t[e]},Td=function(t,e,n,r,o,i,a,u){var c=Ad(a,"maxHeightFunction",Cd()),s=Ad(a,"maxWidthFunction",v),l=t.anchorBox,f=t.origin,d={bounds:jf(f,i),origin:f,preference:r,maxHeightFunction:c,maxWidthFunction:s,lastPlacement:o,transition:u};return Md(l,e,n,d)},Md=function(t,e,n,r){var o=yd(t,e,n,r);return Od(e,o,r),kd(e,o),xd(e,o),wd(e,o,r),_d(e,o,r),{layout:o.layout,placement:o.placement}},zd=["valignCentre","alignLeft","alignRight","alignCentre","top","bottom","left","right","inset"],Pd=function(t,e,n,r){void 0===r&&(r=1);var o=t*r,i=e*r,a=function(t){return Ct(n,t).getOr([])},u=function(t,e,n){var r=at(zd,n);return{offset:lr(t,e),classesOn:rt(n,a),classesOff:rt(r,a)}};return{southeast:function(){return u(-t,e,["top","alignLeft"])},southwest:function(){return u(t,e,["top","alignRight"])},south:function(){return u(-t/2,e,["top","alignCentre"])},northeast:function(){return u(-t,-e,["bottom","alignLeft"])},northwest:function(){return u(t,-e,["bottom","alignRight"])},north:function(){return u(-t/2,-e,["bottom","alignCentre"])},east:function(){return u(t,-e/2,["valignCentre","left"])},west:function(){return u(-t,-e/2,["valignCentre","right"])},insetNortheast:function(){return u(o,i,["top","alignLeft","inset"])},insetNorthwest:function(){return u(-o,i,["top","alignRight","inset"])},insetNorth:function(){return u(-o/2,i,["top","alignCentre","inset"])},insetSoutheast:function(){return u(o,-i,["bottom","alignLeft","inset"])},insetSouthwest:function(){return u(-o,-i,["bottom","alignRight","inset"])},insetSouth:function(){return u(-o/2,-i,["bottom","alignCentre","inset"])},insetEast:function(){return u(-o,-i/2,["valignCentre","right","inset"])},insetWest:function(){return u(o,-i/2,["valignCentre","left","inset"])}}},Nd=function(){return Pd(0,0,{})},Dd=w,Ld=function(t,e){return function(n){return"rtl"===jd(n)?e:t}},jd=function(t){return"rtl"===Zn(t,"direction")?"rtl":"ltr"};(function(t){t["TopToBottom"]="toptobottom",t["BottomToTop"]="bottomtotop"})(Bf||(Bf={}));var Hd="data-alloy-vertical-dir",Rd=function(t){return Ls(t,(function(t){return le(t)&&Fn(t,"data-alloy-vertical-dir")===Bf.BottomToTop}))},Bd=function(){return Gi("layouts",[Ti("onLtr"),Ti("onRtl"),Ii("onBottomLtr"),Ii("onBottomRtl")])},Id=function(t,e,n,r,o,i,a){var u=a.map(Rd).getOr(!1),c=e.layouts.map((function(e){return e.onLtr(t)})),s=e.layouts.map((function(e){return e.onRtl(t)})),l=u?e.layouts.bind((function(e){return e.onBottomLtr.map((function(e){return e(t)}))})).or(c).getOr(o):c.getOr(n),f=u?e.layouts.bind((function(e){return e.onBottomRtl.map((function(e){return e(t)}))})).or(s).getOr(i):s.getOr(r),d=Ld(l,f);return d(t)},Vd=function(t,e,n){var r=e.hotspot,o=Lf(n,r.element),i=Id(t.element,e,Ql(),tf(),Zl(),Jl(),j.some(e.hotspot.element));return j.some(Dd({anchorBox:o,bubble:e.bubble.getOr(Nd()),overrides:e.overrides,layouts:i,placer:j.none()}))},Fd=[Ti("hotspot"),Ii("bubble"),Ki("overrides",{}),Bd(),fl("placement",Vd)],qd=function(t,e,n){var r=Hf(n,e.x,e.y),o=Xr(r.left,r.top,e.width,e.height),i=Id(t.element,e,Yl(),Xl(),Yl(),Xl(),j.none());return j.some(Dd({anchorBox:o,bubble:e.bubble,overrides:e.overrides,layouts:i,placer:j.none()}))},Ud=[Ti("x"),Ti("y"),Ki("height",0),Ki("width",0),Ki("bubble",Nd()),Ki("overrides",{}),Bd(),fl("placement",qd)],Wd=aa.generate([{screen:["point"]},{absolute:["point","scrollLeft","scrollTop"]}]),Gd=function(t){return t.fold(w,(function(t,e,n){return t.translate(-e,-n)}))},$d=function(t){return t.fold(w,w)},Kd=function(t){return J(t,(function(t,e){return t.translate(e.left,e.top)}),lr(0,0))},Yd=function(t){var e=G(t,Gd);return Kd(e)},Xd=function(t){var e=G(t,$d);return Kd(e)},Zd=Wd.screen,Jd=Wd.absolute,Qd=function(t,e,n){var r=vn(n.root).dom,o=function(e){var n=hn(e),r=hn(t.element);return sn(n,r)};return j.from(r.frameElement).map(ee.fromDom).filter(o).map(hr)},th=function(t,e,n){var r=hn(t.element),o=Hr(r),i=Qd(t,e,n).getOr(o);return Jd(i,o.left,o.top)},eh=function(t,e,n,r){var o=Zd(lr(t,e));return j.some(Kr(o,n,r))},nh=function(t,e,n,r,o){return t.map((function(t){var i=[e,t.point],a=Rf(r,(function(){return Xd(i)}),(function(){return Xd(i)}),(function(){return Yd(i)})),u=Yr(a.left,a.top,t.width,t.height),c=n.showAbove?Zl():Ql(),s=n.showAbove?Jl():tf(),l=Id(o,n,c,s,c,s,j.none());return Dd({anchorBox:u,bubble:n.bubble.getOr(Nd()),overrides:n.overrides,layouts:l,placer:j.none()})}))},rh=function(t,e,n){var r=th(t,n,e);return e.node.filter(jn).bind((function(o){var i=o.dom.getBoundingClientRect(),a=eh(i.left,i.top,i.width,i.height),u=e.node.getOr(t.element);return nh(a,r,e,n,u)}))},oh=[Ti("node"),Ti("root"),Ii("bubble"),Bd(),Ki("overrides",{}),Ki("showAbove",!1),fl("placement",rh)],ih="\ufeff",ah=" ",uh=function(t,e,n,r){return{start:t,soffset:e,finish:n,foffset:r}},ch={create:uh},sh=aa.generate([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),lh=function(t,e,n,r){return t.fold(e,n,r)},fh=function(t){return t.fold(w,w,w)},dh=sh.before,hh=sh.on,ph=sh.after,mh={before:dh,on:hh,after:ph,cata:lh,getStart:fh},vh=aa.generate([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),gh=function(t){return vh.exact(t.start,t.soffset,t.finish,t.foffset)},bh=function(t){return t.match({domRange:function(t){return ee.fromDom(t.startContainer)},relative:function(t,e){return mh.getStart(t)},exact:function(t,e,n,r){return t}})},yh=vh.domRange,xh=vh.relative,wh=vh.exact,_h=function(t){var e=bh(t);return vn(e)},Oh=ch.create,kh={domRange:yh,relative:xh,exact:wh,exactFromRange:gh,getWin:_h,range:Oh},Sh=function(t,e){e.fold((function(e){t.setStartBefore(e.dom)}),(function(e,n){t.setStart(e.dom,n)}),(function(e){t.setStartAfter(e.dom)}))},Ch=function(t,e){e.fold((function(e){t.setEndBefore(e.dom)}),(function(e,n){t.setEnd(e.dom,n)}),(function(e){t.setEndAfter(e.dom)}))},Eh=function(t,e,n){var r=t.document.createRange();return Sh(r,e),Ch(r,n),r},Ah=function(t,e,n,r,o){var i=t.document.createRange();return i.setStart(e.dom,n),i.setEnd(r.dom,o),i},Th=function(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom,width:t.width,height:t.height}},Mh=function(t){var e=t.getClientRects(),n=e.length>0?e[0]:t.getBoundingClientRect();return n.width>0||n.height>0?j.some(n).map(Th):j.none()},zh=function(t){var e=t.getBoundingClientRect();return e.width>0||e.height>0?j.some(e).map(Th):j.none()},Ph=aa.generate([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),Nh=function(t,e,n){return e(ee.fromDom(n.startContainer),n.startOffset,ee.fromDom(n.endContainer),n.endOffset)},Dh=function(t,e){return e.match({domRange:function(t){return{ltr:x(t),rtl:j.none}},relative:function(e,n){return{ltr:pe((function(){return Eh(t,e,n)})),rtl:pe((function(){return j.some(Eh(t,n,e))}))}},exact:function(e,n,r,o){return{ltr:pe((function(){return Ah(t,e,n,r,o)})),rtl:pe((function(){return j.some(Ah(t,r,o,e,n))}))}}})},Lh=function(t,e){var n=e.ltr();if(n.collapsed){var r=e.rtl().filter((function(t){return!1===t.collapsed}));return r.map((function(t){return Ph.rtl(ee.fromDom(t.endContainer),t.endOffset,ee.fromDom(t.startContainer),t.startOffset)})).getOrThunk((function(){return Nh(t,Ph.ltr,n)}))}return Nh(t,Ph.ltr,n)},jh=function(t,e){var n=Dh(t,e);return Lh(t,n)},Hh=function(t,e){var n=jh(t,e);return n.match({ltr:function(e,n,r,o){var i=t.document.createRange();return i.setStart(e.dom,n),i.setEnd(r.dom,o),i},rtl:function(e,n,r,o){var i=t.document.createRange();return i.setStart(r.dom,o),i.setEnd(e.dom,n),i}})};Ph.ltr,Ph.rtl;var Rh,Bh=function(t,e){var n=function(n){if(!t(n))throw new Error("Can only get "+e+" value of a "+e+" node");return r(n).getOr("")},r=function(e){return t(e)?j.from(e.dom.nodeValue):j.none()},o=function(n,r){if(!t(n))throw new Error("Can only set raw "+e+" value of a "+e+" node");n.dom.nodeValue=r};return{get:n,getOption:r,set:o}},Ih=Bh(fe,"text"),Vh=function(t){return Ih.get(t)},Fh=function(t){return Ih.getOption(t)},qh=function(t){return"img"===ue(t)?1:Fh(t).fold((function(){return wn(t).length}),(function(t){return t.length}))},Uh=function(t){return Fh(t).filter((function(t){return 0!==t.trim().length||t.indexOf(ah)>-1})).isSome()},Wh=["img","br"],Gh=function(t){var e=Uh(t);return e||F(Wh,ue(t))},$h=function(t){return Kh(t,Gh)},Kh=function(t,e){var n=function(t){for(var r=wn(t),o=r.length-1;o>=0;o--){var i=r[o];if(e(i))return j.some(i);var a=n(i);if(a.isSome())return a}return j.none()};return n(t)},Yh=function(t,e){return un(e,t)},Xh=function(t,e,n,r){var o=hn(t),i=o.dom.createRange();return i.setStart(t.dom,e),i.setEnd(n.dom,r),i},Zh=function(t,e,n,r){var o=Xh(t,e,n,r),i=sn(t,n)&&e===r;return o.collapsed&&!i},Jh=function(t){return j.from(t.getSelection())},Qh=function(t){if(t.rangeCount>0){var e=t.getRangeAt(0),n=t.getRangeAt(t.rangeCount-1);return j.some(ch.create(ee.fromDom(e.startContainer),e.startOffset,ee.fromDom(n.endContainer),n.endOffset))}return j.none()},tp=function(t){if(null===t.anchorNode||null===t.focusNode)return Qh(t);var e=ee.fromDom(t.anchorNode),n=ee.fromDom(t.focusNode);return Zh(e,t.anchorOffset,n,t.focusOffset)?j.some(ch.create(e,t.anchorOffset,n,t.focusOffset)):Qh(t)},ep=function(t){return Jh(t).filter((function(t){return t.rangeCount>0})).bind(tp)},np=function(t,e){var n=Hh(t,e);return Mh(n)},rp=function(t,e){var n=Hh(t,e);return zh(n)},op=function(t,e){return{element:t,offset:e}},ip=function(t,e){var n=wn(t);if(0===n.length)return op(t,e);if(e"})),ai()),_v=Ei("schema",(function(){return[Ii("preprocess")]})),Ov=Ki("defaults",x({})),kv=Ki("overrides",x({})),Sv=ti([bv,yv,xv,wv,Ov,kv]),Cv=ti([bv,yv,xv,Ov,kv]),Ev=ti([bv,yv,xv,wv,Ov,kv]),Av=ti([bv,_v,xv,Ti("unit"),wv,Ov,kv]),Tv=function(t){return t.fold(j.some,j.none,j.some,j.some)},Mv=function(t){var e=function(t){return t.name};return t.fold(e,e,e,e)},zv=function(t){return t.fold(w,w,w,w)},Pv=function(t,e){return function(n){var r=_i("Converting part type",e,n);return t(r)}},Nv=Pv(gv.required,Sv),Dv=Pv(gv.external,Cv),Lv=Pv(gv.optional,Ev),jv=Pv(gv.group,Av),Hv=x("entirety"),Rv=Object.freeze({__proto__:null,required:Nv,external:Dv,optional:Lv,group:jv,asNamedPart:Tv,name:Mv,asCommon:zv,original:Hv}),Bv=function(t,e,n,r){return _o(e.defaults(t,n,r),n,{uid:t.partUids[e.name]},e.overrides(t,n,r))},Iv=function(t,e,n){var r={},o={};return $(n,(function(t){t.fold((function(t){r[t.pname]=pv(!0,(function(e,n,r){return t.factory.sketch(Bv(e,t,n,r))}))}),(function(t){var n=e.parts[t.name];o[t.name]=x(t.factory.sketch(Bv(e,t,n[Hv()]),n))}),(function(t){r[t.pname]=pv(!1,(function(e,n,r){return t.factory.sketch(Bv(e,t,n,r))}))}),(function(t){r[t.pname]=mv(!0,(function(e,n,r){var o=e[t.name];return G(o,(function(n){return t.factory.sketch(_o(t.defaults(e,n,r),n,t.overrides(e,n)))}))}))}))})),{internals:x(r),externals:x(o)}},Vv=function(t,e){var n={};return $(e,(function(e){Tv(e).each((function(e){var r=Fv(t,e.pname);n[e.name]=function(n){var o=_i("Part: "+e.name+" in "+t,ti(e.schema),n);return T(T({},r),{config:n,validated:o})}}))})),n},Fv=function(t,e){return{uiType:vv(),owner:t,name:e}},qv=function(t,e,n){return{uiType:vv(),owner:t,name:e,config:n,validated:{}}},Uv=function(t){return rt(t,(function(t){return t.fold(j.none,j.some,j.none,j.none).map((function(t){return Hi(t.name,t.schema.concat([dl(Hv())]))})).toArray()}))},Wv=function(t){return G(t,Mv)},Gv=function(t,e,n){return Iv(t,e,n)},$v=function(t,e,n){return hv(j.some(t),e,e.components,n)},Kv=function(t,e,n){var r=e.partUids[n];return t.getSystem().getByUid(r).toOptional()},Yv=function(t,e,n){return Kv(t,e,n).getOrDie("Could not find part: "+n)},Xv=function(t,e,n){var r={},o=e.partUids,i=t.getSystem();return $(n,(function(t){r[t]=x(i.getByUid(o[t]))})),r},Zv=function(t,e){var n=t.getSystem();return bt(e.partUids,(function(t,e){return x(n.getByUid(t))}))},Jv=function(t){return mt(t.partUids)},Qv=function(t,e,n){var r={},o=e.partUids,i=t.getSystem();return $(n,(function(t){r[t]=x(i.getByUid(o[t]).getOrDie())})),r},tg=function(t,e){var n=Wv(e);return pa(G(n,(function(e){return{key:e,value:t+"-"+e}})))},eg=function(t){return Ci("partUids","partUids",Ao((function(e){return tg(e.uid,t)})),ai())},ng=Object.freeze({__proto__:null,generate:Vv,generateOne:qv,schemas:Uv,names:Wv,substitutes:Gv,components:$v,defaultUids:tg,defaultUidsSchema:eg,getAllParts:Zv,getAllPartNames:Jv,getPart:Kv,getPartOrDie:Yv,getParts:Xv,getPartsOrDie:Qv}),rg=function(t,e){var n=t.length>0?[Hi("parts",t)]:[];return n.concat([Ti("uid"),Ki("dom",{}),Ki("components",[]),dl("originalSpec"),Ki("debug.sketcher",{})]).concat(e)},og=function(t,e,n,r,o){var i=rg(r,o);return _i(t+" [SpecSchema]",Qo(i.concat(e)),n)},ig=function(t,e,n,r){var o=cg(r),i=og(t,e,o,[],[]);return n(i,o)},ag=function(t,e,n,r,o){var i=cg(o),a=Uv(n),u=eg(n),c=og(t,e,i,a,[u]),s=Gv(t,c,n),l=$v(t,c,s.internals());return r(c,l,i,s.externals())},ug=function(t){return Et(t,"uid")},cg=function(t){return ug(t)?t:T(T({},t),{uid:dc("uid")})},sg=function(t){return void 0!==t.uid},lg=Qo([Ti("name"),Ti("factory"),Ti("configFields"),Ki("apis",{}),Ki("extraApis",{})]),fg=Qo([Ti("name"),Ti("factory"),Ti("configFields"),Ti("partFields"),Ki("apis",{}),Ki("extraApis",{})]),dg=function(t){var e=_i("Sketcher for "+t.name,lg,t),n=function(t){return ig(e.name,e.configFields,e.factory,t)},r=bt(e.apis,Oc),o=bt(e.extraApis,(function(t,e){return bc(t,e)}));return T(T({name:e.name,configFields:e.configFields,sketch:n},r),o)},hg=function(t){var e=_i("Sketcher for "+t.name,fg,t),n=function(t){return ag(e.name,e.configFields,e.partFields,e.factory,t)},r=Vv(e.name,e.partFields),o=bt(e.apis,Oc),i=bt(e.extraApis,(function(t,e){return bc(t,e)}));return T(T({name:e.name,partFields:e.partFields,configFields:e.configFields,sketch:n,parts:r},o),i)},pg=function(t){return"input"===ue(t)&&"radio"!==Fn(t,"type")||"textarea"===ue(t)},mg=function(t,e,n){return e.find(t)},vg=Object.freeze({__proto__:null,getCurrent:mg}),gg=[Ti("find")],bg=mf({fields:gg,name:"composing",apis:vg}),yg=["input","button","textarea","select"],xg=function(t,e,n){var r=e.disabled()?Ag:Tg;r(t,e)},wg=function(t,e){return!0===e.useNative&&F(yg,ue(t.element))},_g=function(t){return Un(t.element,"disabled")},Og=function(t){In(t.element,"disabled","disabled")},kg=function(t){Wn(t.element,"disabled")},Sg=function(t){return"true"===Fn(t.element,"aria-disabled")},Cg=function(t){In(t.element,"aria-disabled","true")},Eg=function(t){In(t.element,"aria-disabled","false")},Ag=function(t,e,n){e.disableClass.each((function(e){is(t.element,e)}));var r=wg(t,e)?Og:Cg;r(t),e.onDisabled(t)},Tg=function(t,e,n){e.disableClass.each((function(e){us(t.element,e)}));var r=wg(t,e)?kg:Eg;r(t),e.onEnabled(t)},Mg=function(t,e){return wg(t,e)?_g(t):Sg(t)},zg=function(t,e,n,r){var o=r?Ag:Tg;o(t,e)},Pg=Object.freeze({__proto__:null,enable:Tg,disable:Ag,isDisabled:Mg,onLoad:xg,set:zg}),Ng=function(t,e){return Mc({classes:e.disabled()?e.disableClass.toArray():[]})},Dg=function(t,e){return Au([Tu(eu(),(function(e,n){return Mg(e,t)})),uf(t,e,xg)])},Lg=Object.freeze({__proto__:null,exhibit:Ng,events:Dg}),jg=[ta("disabled",C),Ki("useNative",!0),Ii("disableClass"),ul("onDisabled"),ul("onEnabled")],Hg=mf({fields:jg,name:"disabling",active:Lg,apis:Pg}),Rg=function(t,e,n,r){var o=Yh(t.element,"."+e.highlightClass);$(o,(function(n){q(r,(function(t){return t.element===n}))||(us(n,e.highlightClass),t.getSystem().getByDom(n).each((function(n){e.onDehighlight(t,n),_u(n,wu())})))}))},Bg=function(t,e,n){return Rg(t,e,n,[])},Ig=function(t,e,n,r){Gg(t,e,n,r)&&(us(r.element,e.highlightClass),e.onDehighlight(t,r),_u(r,wu()))},Vg=function(t,e,n,r){Rg(t,e,n,[r]),Gg(t,e,n,r)||(is(r.element,e.highlightClass),e.onHighlight(t,r),_u(r,xu()))},Fg=function(t,e,n){Yg(t,e).each((function(r){Vg(t,e,n,r)}))},qg=function(t,e,n){Xg(t,e).each((function(r){Vg(t,e,n,r)}))},Ug=function(t,e,n,r){Kg(t,e,n,r).fold((function(t){throw t}),(function(r){Vg(t,e,n,r)}))},Wg=function(t,e,n,r){var o=tb(t,e),i=tt(o,r);i.each((function(r){Vg(t,e,n,r)}))},Gg=function(t,e,n,r){return cs(r.element,e.highlightClass)},$g=function(t,e,n){return Rs(t.element,"."+e.highlightClass).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))},Kg=function(t,e,n,r){var o=Yh(t.element,"."+e.itemClass);return j.from(o[r]).fold((function(){return ro.error(new Error("No element found with index "+r))}),t.getSystem().getByDom)},Yg=function(t,e,n){return Rs(t.element,"."+e.itemClass).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))},Xg=function(t,e,n){var r=Yh(t.element,"."+e.itemClass),o=r.length>0?j.some(r[r.length-1]):j.none();return o.bind((function(e){return t.getSystem().getByDom(e).toOptional()}))},Zg=function(t,e,n,r){var o=Yh(t.element,"."+e.itemClass),i=et(o,(function(t){return cs(t,e.highlightClass)}));return i.bind((function(e){var n=El(e,r,0,o.length-1);return t.getSystem().getByDom(o[n]).toOptional()}))},Jg=function(t,e,n){return Zg(t,e,n,-1)},Qg=function(t,e,n){return Zg(t,e,n,1)},tb=function(t,e,n){var r=Yh(t.element,"."+e.itemClass);return zt(G(r,(function(e){return t.getSystem().getByDom(e).toOptional()})))},eb=Object.freeze({__proto__:null,dehighlightAll:Bg,dehighlight:Ig,highlight:Vg,highlightFirst:Fg,highlightLast:qg,highlightAt:Ug,highlightBy:Wg,isHighlighted:Gg,getHighlighted:$g,getFirst:Yg,getLast:Xg,getPrevious:Jg,getNext:Qg,getCandidates:tb}),nb=[Ti("highlightClass"),Ti("itemClass"),ul("onHighlight"),ul("onDehighlight")],rb=mf({fields:nb,name:"highlighting",apis:eb}),ob=[8],ib=[9],ab=[13],ub=[27],cb=[32],sb=[37],lb=[38],fb=[39],db=[40],hb=function(t,e,n){var r=it(t.slice(0,e)),o=it(t.slice(e+1));return tt(r.concat(o),n)},pb=function(t,e,n){var r=it(t.slice(0,e));return tt(r,n)},mb=function(t,e,n){var r=t.slice(0,e),o=t.slice(e+1);return tt(o.concat(r),n)},vb=function(t,e,n){var r=t.slice(e+1);return tt(r,n)},gb=function(t){return function(e){var n=e.raw;return F(t,n.which)}},bb=function(t){return function(e){return ot(t,(function(t){return t(e)}))}},yb=function(t){var e=t.raw;return!0===e.shiftKey},xb=function(t){var e=t.raw;return!0===e.ctrlKey},wb=k(yb),_b=function(t,e){return{matches:t,classification:e}},Ob=function(t,e){var n=tt(t,(function(t){return t.matches(e)}));return n.map((function(t){return t.classification}))},kb=function(t,e,n){var r=e.exists((function(t){return n.exists((function(e){return sn(e,t)}))}));r||Ou(t,vu(),{prevFocus:e,newFocus:n})},Sb=function(){var t=function(t){return Ef(t.element)},e=function(e,n){var r=t(e);e.getSystem().triggerFocus(n,e.element);var o=t(e);kb(e,r,o)};return{get:t,set:e}},Cb=function(){var t=function(t){return rb.getHighlighted(t).map((function(t){return t.element}))},e=function(e,n){var r=t(e);e.getSystem().getByDom(n).fold(v,(function(t){rb.highlight(e,t)}));var o=t(e);kb(e,r,o)};return{get:t,set:e}};(function(t){t["OnFocusMode"]="onFocus",t["OnEnterOrSpaceMode"]="onEnterOrSpace",t["OnApiMode"]="onApi"})(Rh||(Rh={}));var Eb=function(t,e,n,r,o){var i=function(){return t.concat([Ki("focusManager",Sb()),Yi("focusInside","onFocus",gi((function(t){return F(["onFocus","onEnterOrSpace","onApi"],t)?ro.value(t):ro.error("Invalid value for focusInside")}))),fl("handler",c),fl("state",e),fl("sendFocusIn",o)])},a=function(t,e,n,r,o){var i=n(t,e,r,o);return Ob(i,e.event).bind((function(n){return n(t,e,r,o)}))},u=function(t,e){var i=t.focusInside!==Rh.OnFocusMode?j.none():o(t).map((function(n){return Pu(Za(),(function(r,o){n(r,t,e),o.stop()}))})),u=function(n,r){var i=gb(cb.concat(ab))(r.event);t.focusInside===Rh.OnEnterOrSpaceMode&&i&&wa(n,r)&&o(t).each((function(o){o(n,t,e),r.stop()}))},c=[Pu(Ia(),(function(r,o){a(r,o,n,t,e).fold((function(){u(r,o)}),(function(t){o.stop()}))})),Pu(Va(),(function(n,o){a(n,o,r,t,e).each((function(t){o.stop()}))}))];return Au(i.toArray().concat(c))},c={schema:i,processKey:a,toEvents:u};return c},Ab=function(t){var e=[Ii("onEscape"),Ii("onEnter"),Ki("selector",'[data-alloy-tabstop="true"]:not(:disabled)'),Ki("firstTabstop",0),Ki("useTabstopAt",E),Ii("visibilitySelector")].concat([t]),n=function(t,e){var n=t.visibilitySelector.bind((function(t){return Bs(e,t)})).getOr(e);return ar(n)>0},r=function(t,e){var r=Yh(t.element,e.selector),o=X(r,(function(t){return n(e,t)}));return j.from(o[e.firstTabstop])},o=function(t,e){return e.focusManager.get(t).bind((function(t){return Bs(t,e.selector)}))},i=function(t,e){return n(t,e)&&t.useTabstopAt(e)},a=function(t,e,n){r(t,e).each((function(n){e.focusManager.set(t,n)}))},u=function(t,e,n,r,o){return o(e,n,(function(t){return i(r,t)})).fold((function(){return r.cyclic?j.some(!0):j.none()}),(function(e){return r.focusManager.set(t,e),j.some(!0)}))},c=function(t,e,n,r){var i=Yh(t.element,n.selector);return o(t,n).bind((function(e){var o=et(i,O(sn,e));return o.bind((function(e){return u(t,i,e,n,r)}))}))},s=function(t,e,n){var r=n.cyclic?hb:pb;return c(t,e,n,r)},l=function(t,e,n){var r=n.cyclic?mb:vb;return c(t,e,n,r)},f=function(t,e,n){return n.onEnter.bind((function(n){return n(t,e)}))},d=function(t,e,n){return n.onEscape.bind((function(n){return n(t,e)}))},h=x([_b(bb([yb,gb(ib)]),s),_b(gb(ib),l),_b(gb(ub),d),_b(bb([wb,gb(ab)]),f)]),p=x([]);return Eb(e,kc.init,h,p,(function(){return j.some(a)}))},Tb=Ab(Ei("cyclic",C)),Mb=Ab(Ei("cyclic",E)),zb=function(t,e,n){return Su(t,n,eu()),j.some(!0)},Pb=function(t,e,n){var r=pg(n)&&gb(cb)(e.event);return r?j.none():zb(t,e,n)},Nb=function(t,e){return j.some(!0)},Db=[Ki("execute",Pb),Ki("useSpace",!1),Ki("useEnter",!0),Ki("useControlEnter",!1),Ki("useDown",!1)],Lb=function(t,e,n){return n.execute(t,e,t.element)},jb=function(t,e,n,r){var o=n.useSpace&&!pg(t.element)?cb:[],i=n.useEnter?ab:[],a=n.useDown?db:[],u=o.concat(i).concat(a);return[_b(gb(u),Lb)].concat(n.useControlEnter?[_b(bb([xb,gb(ab)]),Lb)]:[])},Hb=function(t,e,n,r){return n.useSpace&&!pg(t.element)?[_b(gb(cb),Nb)]:[]},Rb=Eb(Db,kc.init,jb,Hb,(function(){return j.none()})),Bb=function(){var t=od(),e=function(e,n){t.set({numRows:e,numColumns:n})},n=function(){return t.get().map((function(t){return t.numRows}))},r=function(){return t.get().map((function(t){return t.numColumns}))};return Sc({readState:function(){return t.get().map((function(t){return{numRows:String(t.numRows),numColumns:String(t.numColumns)}})).getOr({numRows:"?",numColumns:"?"})},setGridSize:e,getNumRows:n,getNumColumns:r})},Ib=function(t){return t.state(t)},Vb=Object.freeze({__proto__:null,flatgrid:Bb,init:Ib}),Fb=function(t){return function(e,n,r,o){var i=t(e.element);return Gb(i,e,n,r,o)}},qb=function(t,e){var n=Ld(t,e);return Fb(n)},Ub=function(t,e){var n=Ld(e,t);return Fb(n)},Wb=function(t){return function(e,n,r,o){return Gb(t,e,n,r,o)}},Gb=function(t,e,n,r,o){var i=r.focusManager.get(e).bind((function(n){return t(e.element,n,r,o)}));return i.map((function(t){return r.focusManager.set(e,t),!0}))},$b=Wb,Kb=Wb,Yb=Wb,Xb=function(t){return t.offsetWidth<=0&&t.offsetHeight<=0},Zb=function(t){return!Xb(t.dom)},Jb=function(t,e){return et(t,e).map((function(e){return{index:e,candidates:t}}))},Qb=function(t,e,n){var r=function(t){return sn(t,e)},o=Yh(t,n),i=X(o,Zb);return Jb(i,r)},ty=function(t,e){return et(t,(function(t){return sn(e,t)}))},ey=function(t,e,n,r){var o=Math.floor(e/n),i=e%n;return r(o,i).bind((function(e){var r=e.row*n+e.column;return r>=0&&r1?j.some(t.slice(1)):j.none()}))},p=function(t){return Ct(n.get(),t)},m=function(t){return v(t).bind(Ww)},v=function(t){return Ct(e.get(),t)},g=function(e){return Ct(t.get(),e)},b=function(t){var e=o.get();return at(mt(e),t)},y=function(){return r.get().bind(m)},x=function(){return e.get()};return{setMenuBuilt:u,setContents:c,expand:d,refresh:p,collapse:h,lookupMenu:v,lookupItem:g,otherMenus:b,getPrimary:y,getMenus:x,clear:i,isClear:a,getTriggeringPath:f}},Ww=function(t){return"prepared"===t.type?j.some(t.menu):j.none()},Gw={init:Uw,extractPreparedMenu:Ww},$w=function(t,e){var n,r=od(),o=function(e,n,r){return bt(r,(function(r,o){var i=function(){return Iw.sketch(T(T({},r),{value:o,markers:t.markers,fakeFocus:t.fakeFocus,onHighlight:t.onHighlight,focusManager:t.fakeFocus?Cb():Sb()}))};return o===n?{type:"prepared",menu:e.getSystem().build(i())}:{type:"notbuilt",nbMenu:i}}))},i=Gw.init(),a=function(e){var n=o(e,t.data.primary,t.data.menus),r=s();return i.setContents(t.data.primary,n,t.data.expansions,r),i.getPrimary()},u=function(t){return tv.getValue(t).value},c=function(t,e,n){return pt(e,(function(t){if(!t.getSystem().isConnected())return j.none();var e=rb.getCandidates(t);return tt(e,(function(t){return u(t)===n}))}))},s=function(e){return bt(t.data.menus,(function(t,e){return rt(t.items,(function(t){return"separator"===t.type?[]:[t.data.value]}))}))},l=function(t,e){rb.highlight(t,e),rb.getHighlighted(e).orThunk((function(){return rb.getFirst(e)})).each((function(e){Su(t,e.element,nu())}))},f=function(t,e){return zt(G(e,(function(e){return t.lookupMenu(e).bind((function(t){return"prepared"===t.type?j.some(t.menu):j.none()}))})))},d=function(e,n,r){var o=f(n,n.otherMenus(r));$(o,(function(n){ls(n.element,[t.markers.backgroundMenu]),t.stayInDom||Bx.remove(e,n)}))},h=function(e){return r.get().getOrThunk((function(){var n={},o=Yh(e.element,"."+t.markers.item),i=X(o,(function(t){return"true"===Fn(t,"aria-haspopup")}));return $(i,(function(t){e.getSystem().getByDom(t).each((function(t){var e=u(t);n[e]=t}))})),r.set(n),n}))},p=function(t,e){var n=h(t);gt(n,(function(t,n){var r=F(e,n);In(t.element,"aria-expanded",r)}))},m=function(e,n,r){return j.from(r[0]).bind((function(o){return n.lookupMenu(o).bind((function(o){if("notbuilt"===o.type)return j.none();var i=o.menu,a=f(n,r.slice(1));return $(a,(function(e){is(e.element,t.markers.backgroundMenu)})),jn(i.element)||Bx.append(e,As(i)),ls(i.element,[t.markers.backgroundMenu]),l(e,i),d(e,n,r),j.some(i)}))}))};(function(t){t[t["HighlightSubmenu"]=0]="HighlightSubmenu",t[t["HighlightParent"]=1]="HighlightParent"})(n||(n={}));var g=function(t,e,n){if("notbuilt"===n.type){var r=t.getSystem().build(n.nbMenu());return i.setMenuBuilt(e,r),r}return n.menu},b=function(e,r,o){if(void 0===o&&(o=n.HighlightSubmenu),r.hasConfigured(Hg)&&Hg.isDisabled(r))return j.some(r);var a=u(r);return i.expand(a).bind((function(a){return p(e,a),j.from(a[0]).bind((function(u){return i.lookupMenu(u).bind((function(c){var s=g(e,u,c);return jn(s.element)||Bx.append(e,As(s)),t.onOpenSubmenu(e,r,s,it(a)),o===n.HighlightSubmenu?(rb.highlightFirst(s),m(e,i,a)):(rb.dehighlightAll(s),j.some(r))}))}))}))},y=function(e,n){var r=u(n);return i.collapse(r).bind((function(r){return p(e,r),m(e,i,r).map((function(r){return t.onCollapseMenu(e,n,r),r}))}))},x=function(t,e){var n=u(e);return i.refresh(n).bind((function(e){return p(t,e),m(t,i,e)}))},w=function(t,e){return pg(e.element)?j.none():b(t,e,n.HighlightSubmenu)},_=function(t,e){return pg(e.element)?j.none():y(t,e)},O=function(e,n){return y(e,n).orThunk((function(){return t.onEscape(e,n).map((function(){return e}))}))},k=function(e){return function(n,r){return Bs(r.getSource(),"."+t.markers.item).bind((function(t){return n.getSystem().getByDom(t).toOptional().bind((function(t){return e(n,t).map(E)}))}))}},S=Au([Pu(Rw(),(function(t,e){var n=e.event.item;i.lookupItem(u(n)).each((function(){var n=e.event.menu;rb.highlight(t,n);var r=u(e.event.item);i.refresh(r).each((function(e){return d(t,i,e)}))}))})),Wu((function(e,r){var o=r.event.target;e.getSystem().getByDom(o).each((function(r){var o=u(r);0===o.indexOf("collapse-item")&&y(e,r),b(e,r,n.HighlightSubmenu).fold((function(){t.onExecute(e,r)}),v)}))})),Fu((function(e,n){a(e).each((function(n){Bx.append(e,As(n)),t.onOpenMenu(e,n),t.highlightImmediately&&l(e,n)}))}))].concat(t.navigateOnHover?[Pu(_w(),(function(e,r){var o=r.event.item;x(e,o),b(e,o,n.HighlightParent),t.onHover(e,o)}))]:[])),C=function(t){return rb.getHighlighted(t).bind(rb.getHighlighted)},A=function(t){C(t).each((function(e){y(t,e)}))},M=function(t){i.getPrimary().each((function(e){l(t,e)}))},z=function(t){return j.from(t.components()[0]).filter((function(t){return"menu"===Fn(t.element,"role")}))},P=function(e){var n=i.getPrimary().bind((function(t){return C(e).bind((function(t){var n=u(t),r=St(i.getMenus()),o=zt(G(r,Gw.extractPreparedMenu));return i.getTriggeringPath(n,(function(t){return c(e,o,t)}))})).map((function(e){return{primary:t,triggeringPath:e}}))}));n.fold((function(){z(e).each((function(n){t.onRepositionMenu(e,n,[])}))}),(function(n){var r=n.primary,o=n.triggeringPath;t.onRepositionMenu(e,r,o)}))},N={collapseMenu:A,highlightPrimary:M,repositionMenus:P};return{uid:t.uid,dom:t.dom,markers:t.markers,behaviours:rv(t.tmenuBehaviours,[Tx.config({mode:"special",onRight:k(w),onLeft:k(_),onEscape:k(O),focusIn:function(t,e){i.getPrimary().each((function(e){Su(t,e.element,nu())}))}}),rb.config({highlightClass:t.markers.selectedMenu,itemClass:t.markers.menu}),bg.config({find:function(t){return rb.getHighlighted(t)}}),Bx.config({})]),eventOrder:t.eventOrder,apis:N,events:S}},Kw=x("collapse-item"),Yw=function(t,e,n){return{primary:t,menus:e,expansions:n}},Xw=function(t,e){return{primary:t,menus:ha(t,e),expansions:{}}},Zw=function(t){return{value:oc(Kw()),meta:{text:t}}},Jw=dg({name:"TieredMenu",configFields:[ll("onExecute"),ll("onEscape"),sl("onOpenMenu"),sl("onOpenSubmenu"),ul("onRepositionMenu"),ul("onCollapseMenu"),Ki("highlightImmediately",!0),Hi("data",[Ti("primary"),Ti("menus"),Ti("expansions")]),Ki("fakeFocus",!1),ul("onHighlight"),ul("onHover"),ol(),Ti("dom"),Ki("navigateOnHover",!0),Ki("stayInDom",!1),ev("tmenuBehaviours",[Tx,rb,bg,Bx]),Ki("eventOrder",{})],apis:{collapseMenu:function(t,e){t.collapseMenu(e)},highlightPrimary:function(t,e){t.highlightPrimary(e)},repositionMenus:function(t,e){t.repositionMenus(e)}},factory:$w,extraApis:{tieredData:Yw,singleData:Xw,collapseItem:Zw}}),Qw=function(t,e,n,r,o){var i=function(){return t.lazySink(e)},a="horizontal"===r.type?{layouts:{onLtr:function(){return Ql()},onRtl:function(){return tf()}}}:{},u=function(t){return 2===t.length},c=function(t){return u(t)?a:{}};return Jw.sketch({dom:{tag:"div"},data:r.data,markers:r.menu.markers,highlightImmediately:r.menu.highlightImmediately,onEscape:function(){return bm.close(e),t.onEscape.map((function(t){return t(e)})),j.some(!0)},onExecute:function(){return j.some(!0)},onOpenMenu:function(t,e){Rp.positionWithinBounds(i().getOrDie(),e,n,o())},onOpenSubmenu:function(t,e,n,r){var o=i().getOrDie();Rp.position(o,n,{anchor:T({type:"submenu",item:e},c(r))})},onRepositionMenu:function(t,e,r){var a=i().getOrDie();Rp.positionWithinBounds(a,e,n,o()),$(r,(function(t){var e=c(t.triggeringPath);Rp.position(a,t.triggeredMenu,{anchor:T({type:"submenu",item:t.triggeringItem},e)})}))}})},t_=function(t,e){var n=function(e,n){var r=t.getRelated(e);return r.exists((function(t){return qs(t,n)}))},r=function(t,e){bm.setContent(t,e)},o=function(t,e,n){i(t,e,n,j.none())},i=function(t,e,n,r){a(t,e,n,(function(){return r.map((function(t){return Zr(t)}))}))},a=function(e,n,r,o){var i=t.lazySink(e).getOrDie();bm.openWhileCloaked(e,n,(function(){return Rp.positionWithinBounds(i,e,r,o())})),tv.setValue(e,j.some({mode:"position",config:r,getBounds:o}))},u=function(t,e,n){c(t,e,n,j.none)},c=function(e,n,r,o){var i=Qw(t,e,n,r,o);bm.open(e,i),tv.setValue(e,j.some({mode:"menu",menu:i}))},s=function(t){bm.isOpen(t)&&(tv.setValue(t,j.none()),bm.close(t))},l=function(t){return bm.getState(t)},f=function(e){bm.isOpen(e)&&tv.getValue(e).each((function(n){switch(n.mode){case"menu":bm.getState(e).each(Jw.repositionMenus);break;case"position":var r=t.lazySink(e).getOrDie();Rp.positionWithinBounds(r,e,n.config,n.getBounds());break}}))},d={setContent:r,showAt:o,showWithin:i,showWithinBounds:a,showMenuAt:u,showMenuWithinBounds:c,hide:s,getContent:l,reposition:f,isOpen:bm.isOpen};return{uid:t.uid,dom:t.dom,behaviours:rv(t.inlineBehaviours,[bm.config({isPartOf:function(t,e,r){return qs(e,r)||n(t,r)},getAttachPoint:function(e){return t.lazySink(e).getOrDie()},onOpen:function(e){t.onShow(e)},onClose:function(e){t.onHide(e)}}),tv.config({store:{mode:"memory",initialValue:j.none()}}),yf.config({channels:T(T({},Om(T({isExtraPart:e.isExtraPart},t.fireDismissalEventInstead.map((function(t){return{fireEventInstead:{event:t.event}}})).getOr({})))),Sm(T(T({},t.fireRepositionEventInstead.map((function(t){return{fireEventInstead:{event:t.event}}})).getOr({})),{doReposition:f})))})]),eventOrder:t.eventOrder,apis:d}},e_=dg({name:"InlineView",configFields:[Ti("lazySink"),ul("onShow"),ul("onHide"),Ui("onEscape"),ev("inlineBehaviours",[bm,tv,yf]),Gi("fireDismissalEventInstead",[Ki("event",pu())]),Gi("fireRepositionEventInstead",[Ki("event",mu())]),Ki("getRelated",j.none),Ki("isExtraPart",C),Ki("eventOrder",j.none)],factory:t_,apis:{showAt:function(t,e,n,r){t.showAt(e,n,r)},showWithin:function(t,e,n,r,o){t.showWithin(e,n,r,o)},showWithinBounds:function(t,e,n,r,o){t.showWithinBounds(e,n,r,o)},showMenuAt:function(t,e,n,r){t.showMenuAt(e,n,r)},showMenuWithinBounds:function(t,e,n,r,o){t.showMenuWithinBounds(e,n,r,o)},hide:function(t,e){t.hide(e)},isOpen:function(t,e){return t.isOpen(e)},getContent:function(t,e){return t.getContent(e)},setContent:function(t,e,n){t.setContent(e,n)},reposition:function(t,e){t.reposition(e)}}}),n_="layout-inset",r_=function(t){return t.x},o_=function(t,e){return t.x+t.width/2-e.width/2},i_=function(t,e){return t.x+t.width-e.width},a_=function(t){return t.y},u_=function(t,e){return t.y+t.height-e.height},c_=function(t,e){return t.y+t.height/2-e.height/2},s_=function(t,e,n){return pl(i_(t,e),u_(t,e),n.insetSouthwest(),_l(),"southwest",Ml(t,{right:0,bottom:3}),n_)},l_=function(t,e,n){return pl(r_(t),u_(t,e),n.insetSoutheast(),wl(),"southeast",Ml(t,{left:1,bottom:3}),n_)},f_=function(t,e,n){return pl(i_(t,e),a_(t),n.insetNorthwest(),xl(),"northwest",Ml(t,{right:0,top:2}),n_)},d_=function(t,e,n){return pl(r_(t),a_(t),n.insetNortheast(),yl(),"northeast",Ml(t,{left:1,top:2}),n_)},h_=function(t,e,n){return pl(o_(t,e),a_(t),n.insetNorth(),Ol(),"north",Ml(t,{top:2}),n_)},p_=function(t,e,n){return pl(o_(t,e),u_(t,e),n.insetSouth(),kl(),"south",Ml(t,{bottom:3}),n_)},m_=function(t,e,n){return pl(i_(t,e),c_(t,e),n.insetEast(),Cl(),"east",Ml(t,{right:0}),n_)},v_=function(t,e,n){return pl(r_(t),c_(t,e),n.insetWest(),Sl(),"west",Ml(t,{left:1}),n_)},g_=function(t){switch(t){case"north":return h_;case"northeast":return d_;case"northwest":return f_;case"south":return p_;case"southeast":return l_;case"southwest":return s_;case"east":return m_;case"west":return v_}},b_=function(t,e,n,r,o){var i=Gf(r).map(g_).getOr(h_);return i(t,e,n,r,o)},y_=function(t){switch(t){case"north":return p_;case"northeast":return l_;case"northwest":return s_;case"south":return h_;case"southeast":return d_;case"southwest":return f_;case"east":return v_;case"west":return m_}},x_=function(t,e,n,r,o){var i=Gf(r).map(y_).getOr(h_);return i(t,e,n,r,o)},w_=tinymce.util.Tools.resolve("tinymce.util.Delay"),__=function(t){var e=gw(t.action),n=t.dom.tag,r=function(e){return Ct(t.dom,"attributes").bind((function(t){return Ct(t,e)}))},o=function(){if("button"===n){var t=r("type").getOr("button"),e=r("role").map((function(t){return{role:t}})).getOr({});return T({type:t},e)}var o=r("role").getOr("button");return{role:o}};return{uid:t.uid,dom:t.dom,components:t.components,events:e,behaviours:ov.augment(t.buttonBehaviours,[Xx.config({}),Tx.config({mode:"execution",useSpace:!0,useEnter:!0})]),domModification:{attributes:o()},eventOrder:t.eventOrder}},O_=dg({name:"Button",factory:__,configFields:[Ki("uid",void 0),Ti("dom"),Ki("components",[]),ov.field("buttonBehaviours",[Xx,Tx]),Ii("action"),Ii("role"),Ki("eventOrder",{})]}),k_=function(t){var e=sg(t)&&At(t,"uid")?t.uid:dc("memento"),n=function(t){return t.getSystem().getByUid(e).getOrDie()},r=function(t){return t.getSystem().getByUid(e).toOptional()},o=function(){return T(T({},t),{uid:e})};return{get:n,getOpt:r,asSpec:o}},S_=tinymce.util.Tools.resolve("tinymce.util.I18n"),C_={indent:!0,outdent:!0,"table-insert-column-after":!0,"table-insert-column-before":!0,"paste-column-after":!0,"paste-column-before":!0,"unordered-list":!0,"list-bull-circle":!0,"list-bull-default":!0,"list-bull-square":!0},E_="temporary-placeholder",A_=function(t){return function(){return Ct(t,E_).getOr("!not found!")}},T_=function(t,e){var n=t.toLowerCase();if(S_.isRtl()){var r=Vt(n,"-rtl");return Et(e,r)?r:n}return n},M_=function(t,e){return Ct(e,T_(t,e))},z_=function(t,e){var n=e();return M_(t,n).getOrThunk(A_(n))},P_=function(t,e,n){var r=e();return M_(t,r).or(n).getOrThunk(A_(r))},N_=function(t){return!!S_.isRtl()&&Et(C_,t)},D_=function(){return Vx("add-focusable",[Fu((function(t){Hs(t.element,"svg").each((function(t){return In(t,"focusable","false")}))}))])},L_=function(t,e,n,r){var o,i,a=N_(e)?["tox-icon--flip"]:[],u=Ct(n,T_(e,n)).or(r).getOrThunk(A_(n));return{dom:{tag:t.tag,attributes:null!==(o=t.attributes)&&void 0!==o?o:{},classes:t.classes.concat(a),innerHtml:u},behaviours:hf(z(z([],null!==(i=t.behaviours)&&void 0!==i?i:[],!0),[D_()],!1))}},j_=function(t,e,n,r){return void 0===r&&(r=j.none()),L_(e,t,n(),r)},H_=function(t,e,n){var r=n(),o=tt(t,(function(t){return Et(r,T_(t,r))}));return L_(e,o.getOr(E_),r,j.none())},R_={success:"checkmark",error:"warning",err:"error",warning:"warning",warn:"warning",info:"info"},B_=function(t){var e=k_({dom:{tag:"p",innerHtml:t.translationProvider(t.text)},behaviours:hf([Bx.config({})])}),n=function(t){return{dom:{tag:"div",classes:["tox-bar"],attributes:{style:"width: "+t+"%"}}}},r=function(t){return{dom:{tag:"div",classes:["tox-text"],innerHtml:t+"%"}}},o=k_({dom:{tag:"div",classes:t.progress?["tox-progress-bar","tox-progress-indicator"]:["tox-progress-bar"]},components:[{dom:{tag:"div",classes:["tox-bar-container"]},components:[n(0)]},r(0)],behaviours:hf([Bx.config({})])}),i=function(t,e){t.getSystem().isConnected()&&o.getOpt(t).each((function(t){Bx.set(t,[{dom:{tag:"div",classes:["tox-bar-container"]},components:[n(e)]},r(e)])}))},a=function(t,n){if(t.getSystem().isConnected()){var r=e.get(t);Bx.set(r,[Os(n)])}},u={updateProgress:i,updateText:a},c=nt([t.icon.toArray(),t.level.toArray(),t.level.bind((function(t){return j.from(R_[t])})).toArray()]),s=k_(O_.sketch({dom:{tag:"button",classes:["tox-notification__dismiss","tox-button","tox-button--naked","tox-button--icon"]},components:[j_("close",{tag:"div",classes:["tox-icon"],attributes:{"aria-label":t.translationProvider("Close")}},t.iconProvider)],action:function(e){t.onAction(e)}})),l=H_(c,{tag:"div",classes:["tox-notification__icon"]},t.iconProvider),f={dom:{tag:"div",classes:["tox-notification__body"]},components:[e.asSpec()],behaviours:hf([Bx.config({})])},d=[l,f];return{uid:t.uid,dom:{tag:"div",attributes:{role:"alert"},classes:t.level.map((function(t){return["tox-notification","tox-notification--in","tox-notification--"+t]})).getOr(["tox-notification","tox-notification--in"])},behaviours:hf([Xx.config({}),Vx("notification-events",[Pu(Ra(),(function(t){s.getOpt(t).each(Xx.focus)}))])]),components:d.concat(t.progress?[o.asSpec()]:[]).concat(t.closeButton?[s.asSpec()]:[]),apis:u}},I_=dg({name:"Notification",factory:B_,configFields:[Ii("level"),Ti("progress"),Ti("icon"),Ti("onAction"),Ti("text"),Ti("iconProvider"),Ti("translationProvider"),Qi("closeButton",!0)],apis:{updateProgress:function(t,e,n){t.updateProgress(e,n)},updateText:function(t,e,n){t.updateText(e,n)}}});function V_(t,e,n){var r=e.backstage.shared,o=function(t){switch(t){case"bc-bc":return p_;case"tc-tc":return h_;case"tc-bc":return Wl;case"bc-tc":default:return Gl}},i=function(t){t.length>0&&$(t,(function(e,n){0===n?e.moveRel(null,"banner"):e.moveRel(t[n-1].getEl(),"bc-tc")}))},a=function(e,i){var a=!e.closeButton&&e.timeout&&(e.timeout>0||e.timeout<0),u=function(){i(),e_.hide(s)},c=Es(I_.sketch({text:e.text,level:F(["success","error","warning","warn","info"],e.type)?e.type:void 0,progress:!0===e.progressBar,icon:j.from(e.icon),closeButton:!a,onAction:u,iconProvider:r.providers.icons,translationProvider:r.providers.translate})),s=Es(e_.sketch(T({dom:{tag:"div",classes:["tox-notifications-container"]},lazySink:r.getSink,fireDismissalEventInstead:{}},r.header.isPositionedAtTop()?{}:{fireRepositionEventInstead:{}})));n.add(s),e.timeout>0&&w_.setTimeout((function(){u()}),e.timeout);var l=function(){var e=Zr(ee.fromDom(t.getContentAreaContainer())),n=Qr(),r=Al(n.x,e.x,e.right),o=Al(n.y,e.y,e.bottom),i=Math.max(e.right,n.right),a=Math.max(e.bottom,n.bottom);return j.some(Xr(r,o,i-r,a-o))};return{close:u,moveTo:function(t,e){e_.showAt(s,As(c),{anchor:{type:"makeshift",x:t,y:e}})},moveRel:function(t,e){var n=As(c),i={maxHeightFunction:Ed()};if("banner"!==e&&d(t)){var a=o(e),u={type:"node",root:Hn(),node:j.some(ee.fromDom(t)),overrides:i,layouts:{onRtl:function(){return[a]},onLtr:function(){return[a]}}};e_.showWithinBounds(s,n,{anchor:u},l)}else{var f=T(T({},r.anchors.banner()),{overrides:i});e_.showWithinBounds(s,n,{anchor:f},l)}},text:function(t){I_.updateText(c,t)},settings:e,getEl:function(){return c.element.dom},progressBar:{value:function(t){I_.updateProgress(c,t)}}}},u=function(t){t.close()},c=function(t){return t.settings};return{open:a,close:u,reposition:i,getArgs:c}}var F_,q_=function(t,e){var n=null,r=function(){c(n)||(clearTimeout(n),n=null)},o=function(){for(var r=[],o=0;o',t.getDoc());return Mr(n,ee.fromDom(e.extractContents())),e.insertNode(n.dom),gn(n).each((function(t){return t.dom.normalize()})),$h(n).map((function(e){t.selection.setCursorLocation(e.dom,qh(e))})),n}))},X_=function(t){return Bs(t,K_)},Z_=function(t){return t.collapsed&&3===t.startContainer.nodeType},J_=function(t){return t.toString().replace(/\u00A0/g," ").replace(/\uFEFF/g,"")},Q_=function(t){return""!==t&&-1!=="  \f\n\r\t\v".indexOf(t)},tO=function(t,e){return t.substring(e.length)},eO=function(t,e,n){var r;for(r=e-1;r>=0;r--){var o=t.charAt(r);if(Q_(o))return j.none();if(o===n)break}return j.some(r)},nO=function(t,e,n,r){if(void 0===r&&(r=0),!Z_(e))return j.none();var o=function(t,e,r){return eO(r,e,n).getOr(e)},i=t.getParent(e.startContainer,t.isBlock)||t.getRoot();return $_(t,e.startContainer,e.startOffset,o,i).bind((function(t){var o=e.cloneRange();if(o.setStart(t.container,t.offset),o.setEnd(e.endContainer,e.endOffset),o.collapsed)return j.none();var i=J_(o),a=i.lastIndexOf(n);return 0!==a||tO(i,n).length0?lO(e[e.length-1]):uO(t,e.length)},fO=function(t,e){var n=t.childNodes;return n.length>0&&e0&&sO(t)&&n.length===e?lO(n[n.length-1]):uO(t,e)},dO=function(t,e){return $_(t,e.container,e.offset,(function(t,e){return 0===e?-1:e}),t.getRoot()).filter((function(t){var e=t.container.data.charAt(t.offset-1);return!Q_(e)})).isSome()},hO=function(t){return function(e){var n=fO(e.startContainer,e.startOffset);return!dO(t,n)}},pO=function(t,e,n){return pt(n.triggerChars,(function(n){return rO(t,e,n)}))},mO=function(t,e){var n=e(),r=t.selection.getRng();return pO(t.dom,r,n).bind((function(n){return vO(t,e,n)}))},vO=function(t,e,n,r){void 0===r&&(r={});var o=e(),i=t.selection.getRng(),a=i.startContainer.nodeValue,u=X(o.lookupByChar(n.triggerChar),(function(e){return n.text.length>=e.minChars&&e.matches.getOrThunk((function(){return hO(t.dom)}))(n.range,a,n.text)}));if(0===u.length)return j.none();var c=aO.all(G(u,(function(t){var e=t.fetch(n.text,t.maxResults,r);return e.then((function(e){return{matchText:n.text,items:e,columns:t.columns,onAction:t.onAction,highlightOn:t.highlightOn}}))})));return j.some({lookupData:c,context:n})},gO=ti([Pi("type"),qi("text")]),bO=function(t){return xi("separatormenuitem",gO,t)},yO=ti([Ki("type","autocompleteitem"),Ki("active",!1),Ki("disabled",!1),Ki("meta",{}),Pi("value"),qi("text"),qi("icon")]),xO=ti([Pi("type"),Pi("ch"),Xi("minChars",1),Ki("columns",1),Xi("maxResults",10),Ui("matches"),Li("fetch"),Li("onAction"),na("highlightOn",[],si)]),wO=function(t){return xi("Autocompleter.Separator",gO,t)},_O=function(t){return xi("Autocompleter.Item",yO,t)},OO=function(t){return xi("Autocompleter",xO,t)},kO=[Qi("disabled",!1),qi("tooltip"),qi("icon"),qi("text"),ta("onSetup",(function(){return v}))],SO=ti([Pi("type"),Li("onAction")].concat(kO)),CO=function(t){return xi("toolbarbutton",SO,t)},EO=[Qi("active",!1)].concat(kO),AO=ti(EO.concat([Pi("type"),Li("onAction")])),TO=function(t){return xi("ToggleButton",AO,t)},MO=[ta("predicate",C),Ji("scope","node",["node","editor"]),Ji("position","selection",["node","selection","line"])],zO=kO.concat([Ki("type","contextformbutton"),Ki("primary",!1),Li("onAction"),Ei("original",w)]),PO=EO.concat([Ki("type","contextformbutton"),Ki("primary",!1),Li("onAction"),Ei("original",w)]),NO=kO.concat([Ki("type","contextformbutton")]),DO=EO.concat([Ki("type","contextformtogglebutton")]),LO=ki("type",{contextformbutton:zO,contextformtogglebutton:PO}),jO=ti([Ki("type","contextform"),ta("initValue",x("")),qi("label"),Bi("commands",LO),Vi("launch",ki("type",{contextformbutton:NO,contextformtogglebutton:DO}))].concat(MO)),HO=function(t){return xi("ContextForm",jO,t)},RO=ti([Ki("type","contexttoolbar"),Pi("items")].concat(MO)),BO=function(t){return xi("ContextToolbar",RO,t)},IO=function(t){var e={};return $(t,(function(t){e[t]={}})),mt(e)},VO=function(t){var e=t.ui.registry.getAll().popups,n=bt(e,(function(t){return OO(t).fold((function(t){throw new Error(Oi(t))}),w)})),r=IO(Ot(n,(function(t){return t.ch}))),o=St(n),i=function(t){return X(o,(function(e){return e.ch===t}))};return{dataset:n,triggerChars:r,lookupByChar:i}};(function(t){t[t["CLOSE_ON_EXECUTE"]=0]="CLOSE_ON_EXECUTE",t[t["BUBBLE_TO_SANDBOX"]=1]="BUBBLE_TO_SANDBOX"})(F_||(F_={}));var FO,qO=F_,UO="tox-menu-nav__js",WO="tox-collection__item",GO="tox-swatch",$O={normal:UO,color:GO},KO="tox-collection__item--enabled",YO="tox-collection__group-heading",XO="tox-collection__item-icon",ZO="tox-collection__item-label",JO="tox-collection__item-accessory",QO="tox-collection__item-caret",tk="tox-collection__item-checkmark",ek="tox-collection__item--active",nk="tox-collection__item-container",rk="tox-collection__item-container--column",ok="tox-collection__item-container--row",ik="tox-collection__item-container--align-right",ak="tox-collection__item-container--align-left",uk="tox-collection__item-container--valign-top",ck="tox-collection__item-container--valign-middle",sk="tox-collection__item-container--valign-bottom",lk=function(t){return Ct($O,t).getOr(UO)},fk=function(t){return"color"===t?"tox-swatches":"tox-menu"},dk=function(t){return{backgroundMenu:"tox-background-menu",selectedMenu:"tox-selected-menu",selectedItem:"tox-collection__item--active",hasIcons:"tox-menu--has-icons",menu:fk(t),tieredMenu:"tox-tiered-menu"}},hk=function(t){var e=dk(t);return{backgroundMenu:e.backgroundMenu,selectedMenu:e.selectedMenu,menu:e.menu,selectedItem:e.selectedItem,item:lk(t)}},pk=function(t,e,n){var r=dk(n);return{tag:"div",classes:nt([[r.menu,"tox-menu-"+e+"-column"],t?[r.hasIcons]:[]])}},mk=[Iw.parts.items({})],vk=function(t,e,n){var r=dk(n),o={tag:"div",classes:nt([[r.tieredMenu]])};return{dom:o,markers:hk(n)}},gk=function(t,e){return function(n){var r=W(n,e);return G(r,(function(e){return{dom:t,components:e}}))}},bk=function(t){return{dom:{tag:"div",classes:["tox-menu","tox-swatches-menu"]},components:[{dom:{tag:"div",classes:["tox-swatches"]},components:[Iw.parts.items({preprocess:"auto"!==t?gk({tag:"div",classes:["tox-swatches__row"]},t):w})]}]}},yk=function(t){return{dom:{tag:"div",classes:["tox-menu","tox-collection","tox-collection--toolbar","tox-collection--toolbar-lg"]},components:[Iw.parts.items({preprocess:gk({tag:"div",classes:["tox-collection__group"]},t)})]}},xk=function(t,e){var n=[],r=[];return $(t,(function(t,o){e(t,o)?(r.length>0&&n.push(r),r=[],Et(t.dom,"innerHtml")&&r.push(t)):r.push(t)})),r.length>0&&n.push(r),G(n,(function(t){return{dom:{tag:"div",classes:["tox-collection__group"]},components:t}}))},wk=function(t,e,n){return{dom:{tag:"div",classes:["tox-menu","tox-collection"].concat(1===t?["tox-collection--list"]:["tox-collection--grid"])},components:[Iw.parts.items({preprocess:function(n){return"auto"!==t&&t>1?gk({tag:"div",classes:["tox-collection__group"]},t)(n):xk(n,(function(t,n){return"separator"===e[n].type}))}})]}},_k=function(t,e){return{dom:{tag:"div",classes:["tox-collection","tox-collection--horizontal"]},components:[Iw.parts.items({preprocess:function(e){return xk(e,(function(e,n){return"separator"===t[n].type}))}})]}},Ok=function(t){return q(t,(function(t){return"icon"in t&&void 0!==t.icon}))},kk=function(t){return console.error(Oi(t)),console.log(t),j.none()},Sk=function(t,e,n,r,o){var i=_k(n);return{value:t,dom:i.dom,components:i.components,items:n}},Ck=function(t,e,n,r,o){if("color"===o){var i=bk(r);return{value:t,dom:i.dom,components:i.components,items:n}}if("normal"===o&&"auto"===r){i=wk(r,n);return{value:t,dom:i.dom,components:i.components,items:n}}if("normal"===o&&1===r){i=wk(1,n);return{value:t,dom:i.dom,components:i.components,items:n}}if("normal"===o){i=wk(r,n);return{value:t,dom:i.dom,components:i.components,items:n}}if("listpreview"===o&&"auto"!==r){i=yk(r);return{value:t,dom:i.dom,components:i.components,items:n}}return{value:t,dom:pk(e,r,o),components:mk,items:n}},Ek=[Pi("type"),Pi("src"),qi("alt"),na("classes",[],si)],Ak=ti(Ek),Tk=[Pi("type"),Pi("text"),qi("name"),na("classes",["tox-collection__item-label"],si)],Mk=ti(Tk),zk=Zo((function(){return mi("type",{cardimage:Ak,cardtext:Mk,cardcontainer:Pk})})),Pk=ti([Pi("type"),Zi("direction","horizontal"),Zi("align","left"),Zi("valign","middle"),Bi("items",zk)]),Nk=[Qi("disabled",!1),qi("text"),qi("shortcut"),Ci("value","value",So((function(){return oc("menuitem-value")})),ai()),Ki("meta",{})],Dk=ti([Pi("type"),qi("label"),Bi("items",zk),ta("onSetup",(function(){return v})),ta("onAction",v)].concat(Nk)),Lk=function(t){return xi("cardmenuitem",Dk,t)},jk=ti([Pi("type"),Qi("active",!1),qi("icon")].concat(Nk)),Hk=function(t){return xi("choicemenuitem",jk,t)},Rk=[Pi("type"),Pi("fancytype"),ta("onAction",v)],Bk=[Ki("initData",{})].concat(Rk),Ik=[ra("initData",{},[Qi("allowCustomColors",!0),Wi("colors",ai())])].concat(Rk),Vk=ki("fancytype",{inserttable:Bk,colorswatch:Ik}),Fk=function(t){return xi("fancymenuitem",Vk,t)},qk=ti([Pi("type"),ta("onSetup",(function(){return v})),ta("onAction",v),qi("icon")].concat(Nk)),Uk=function(t){return xi("menuitem",qk,t)},Wk=ti([Pi("type"),Li("getSubmenuItems"),ta("onSetup",(function(){return v})),qi("icon")].concat(Nk)),Gk=function(t){return xi("nestedmenuitem",Wk,t)},$k=ti([Pi("type"),qi("icon"),Qi("active",!1),ta("onSetup",(function(){return v})),Li("onAction")].concat(Nk)),Kk=function(t){return xi("togglemenuitem",$k,t)},Yk=function(t,e,n){var r=Yh(t.element,"."+n);if(r.length>0){var o=et(r,(function(t){var n=t.dom.getBoundingClientRect().top,o=r[0].dom.getBoundingClientRect().top;return Math.abs(n-o)>e})).getOr(r.length);return j.some({numColumns:o,numRows:Math.ceil(r.length/o)})}return j.none()},Xk=function(t,e){return hf([Vx(t,e)])},Zk=function(t){return Xk(oc("unnamed-events"),t)},Jk={namedEvents:Xk,unnamedEvents:Zk},Qk=oc("tooltip.exclusive"),tS=oc("tooltip.show"),eS=oc("tooltip.hide"),nS=function(t,e,n){t.getSystem().broadcastOn([Qk],{})},rS=function(t,e,n,r){n.getTooltip().each((function(t){t.getSystem().isConnected()&&Bx.set(t,r)}))},oS=Object.freeze({__proto__:null,hideAllExclusive:nS,setComponents:rS}),iS=function(t,e){var n=function(n){e.getTooltip().each((function(r){$p(r),t.onHide(n,r),e.clearTooltip()})),e.clearTimer()},r=function(n){if(!e.isShowing()){nS(n);var r=t.lazySink(n).getOrDie(),o=n.getSystem().build({dom:t.tooltipDom,components:t.tooltipComponents,events:Au("normal"===t.mode?[Pu(Ha(),(function(t){_u(n,tS)})),Pu(La(),(function(t){_u(n,eS)}))]:[]),behaviours:hf([Bx.config({})])});e.setTooltip(o),Up(r,o),t.onShow(n,o),Rp.position(r,o,{anchor:t.anchor(n)})}};return Au(nt([[Pu(tS,(function(n){e.resetTimer((function(){r(n)}),t.delay)})),Pu(eS,(function(r){e.resetTimer((function(){n(r)}),t.delay)})),Pu(tu(),(function(t,e){var r=e;r.universal||F(r.channels,Qk)&&n(t)})),qu((function(t){n(t)}))],"normal"===t.mode?[Pu(Ra(),(function(t){_u(t,tS)})),Pu(Ja(),(function(t){_u(t,eS)})),Pu(Ha(),(function(t){_u(t,tS)})),Pu(La(),(function(t){_u(t,eS)}))]:[Pu(xu(),(function(t,e){_u(t,tS)})),Pu(wu(),(function(t){_u(t,eS)}))]]))},aS=Object.freeze({__proto__:null,events:iS}),uS=[Ti("lazySink"),Ti("tooltipDom"),Ki("exclusive",!0),Ki("tooltipComponents",[]),Ki("delay",300),Ji("mode","normal",["normal","follow-highlight"]),Ki("anchor",(function(t){return{type:"hotspot",hotspot:t,layouts:{onLtr:x([Gl,Wl,Vl,ql,Fl,Ul]),onRtl:x([Gl,Wl,Vl,ql,Fl,Ul])}}})),ul("onHide"),ul("onShow")],cS=function(){var t=od(),e=od(),n=function(){t.on(clearTimeout)},r=function(e,r){n(),t.set(setTimeout(e,r))},o=x("not-implemented");return Sc({getTooltip:e.get,isShowing:e.isSet,setTooltip:e.set,clearTooltip:e.clear,clearTimer:n,resetTimer:r,readState:o})},sS=Object.freeze({__proto__:null,init:cS}),lS=mf({fields:uS,name:"tooltipping",active:aS,state:sS,apis:oS}),fS=function(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")},dS=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),hS=tinymce.util.Tools.resolve("tinymce.EditorManager"),pS=function(t){var e=t.getParam("skin"),n=t.getParam("skin_url");if(!1!==e){var r=e||"oxide";n=n?t.documentBaseURI.toAbsolute(n):hS.baseURL+"/skins/ui/"+r}return n},mS=function(t){return t.getParam("readonly",!1,"boolean")},vS=function(t){return!1===t.getParam("skin")},gS=function(t){return t.getParam("height",Math.max(t.getElement().offsetHeight,200))},bS=function(t){return t.getParam("width",dS.DOM.getStyle(t.getElement(),"width"))},yS=function(t){return j.from(t.getParam("min_width")).filter(p)},xS=function(t){return j.from(t.getParam("min_height")).filter(p)},wS=function(t){return j.from(t.getParam("max_width")).filter(p)},_S=function(t){return j.from(t.getParam("max_height")).filter(p)},OS=function(t){return j.from(t.getParam("style_formats")).filter(u)},kS=function(t){return t.getParam("style_formats_merge",!1,"boolean")},SS=function(t){return t.getParam("lineheight_formats","1 1.1 1.2 1.3 1.4 1.5 2","string").split(" ")},CS=function(t){return t.getParam("content_langs",void 0,"array")},ES=function(t){return t.getParam("removed_menuitems","")},AS=function(t){return!1!==t.getParam("menubar",!0,"boolean")},TS=function(t){var e=t.getParam("toolbar",!0),n=!0===e,r=i(e),o=u(e)&&e.length>0;return!zS(t)&&(o||r||n)},MS=function(t){var e=U(9,(function(e){return t.getParam("toolbar"+(e+1),!1,"string")})),n=X(e,(function(t){return"string"===typeof t}));return n.length>0?j.some(n):j.none()},zS=function(t){return MS(t).fold((function(){var e=t.getParam("toolbar",[],"string[]");return e.length>0}),E)};(function(t){t["default"]="wrap",t["floating"]="floating",t["sliding"]="sliding",t["scrolling"]="scrolling"})(FO||(FO={}));var PS,NS=function(t){return t.getParam("toolbar_mode","","string")};(function(t){t["auto"]="auto",t["top"]="top",t["bottom"]="bottom"})(PS||(PS={}));var DS,LS=function(t){return t.getParam("toolbar_groups",{},"object")},jS=function(t){return t.getParam("toolbar_location",PS.auto,"string")},HS=function(t){return jS(t)===PS.bottom},RS=function(t){return t.getParam("fixed_toolbar_container","","string")},BS=function(t){return t.getParam("fixed_toolbar_container_target")},IS=function(t){return t.getParam("toolbar_persist",!1,"boolean")},VS=function(t){if(!t.inline)return j.none();var e=RS(t);if(e.length>0)return Rs(Hn(),e);var n=BS(t);return d(n)?j.some(ee.fromDom(n)):j.none()},FS=function(t){return t.inline&&VS(t).isSome()},qS=function(t){var e=VS(t);return e.getOrThunk((function(){return Mn(Tn(ee.fromDom(t.getElement())))}))},US=function(t){return t.inline&&!AS(t)&&!TS(t)&&!zS(t)},WS=function(t){var e=t.getParam("toolbar_sticky",!1,"boolean");return(e||t.inline)&&!FS(t)&&!US(t)},GS=function(t){return t.getParam("toolbar_sticky_offset",0,"number")},$S=function(t){return t.getParam("draggable_modal",!1,"boolean")},KS=function(t){var e=t.getParam("menu");return e?bt(e,(function(t){return T(T({},t),{items:t.items})})):{}},YS=function(t){return t.getParam("menubar")},XS=function(t){return t.getParam("toolbar",!0)},ZS=function(t){return t.getParam("file_picker_callback")},JS=function(t){return t.getParam("file_picker_types")},QS=function(t){return t.getParam("file_browser_callback_types")},tC=function(t){return!1===t.getParam("typeahead_urls")},eC=function(t){return t.getParam("anchor_top","#top")},nC=function(t){return t.getParam("anchor_bottom","#bottom")},rC=function(t){var e=t.getParam("file_picker_validator_handler",void 0,"function");return void 0===e?t.getParam("filepicker_validator_handler",void 0,"function"):e},oC="silver.readonly",iC=ti([Di("readonly")]),aC=function(t,e){var n=t.outerContainer,r=n.element;e&&(t.mothership.broadcastOn([ym()],{target:r}),t.uiMothership.broadcastOn([ym()],{target:r})),t.mothership.broadcastOn([oC],{readonly:e}),t.uiMothership.broadcastOn([oC],{readonly:e})},uC=function(t,e){t.on("init",(function(){t.mode.isReadOnly()&&aC(e,!0)})),t.on("SwitchMode",(function(){return aC(e,t.mode.isReadOnly())})),mS(t)&&t.setMode("readonly")},cC=function(){var t;return yf.config({channels:(t={},t[oC]={schema:iC,onReceive:function(t,e){Hg.set(t,e.readonly)}},t)})},sC=function(t){return Hg.config({disabled:t,disableClass:"tox-collection__item--state-disabled"})},lC=function(t){return Hg.config({disabled:t})},fC=function(t){return Hg.config({disabled:t,disableClass:"tox-tbtn--disabled"})},dC=function(t){return Hg.config({disabled:t,disableClass:"tox-tbtn--disabled",useNative:!1})},hC={item:sC,button:lC,splitButton:fC,toolbarButton:dC},pC=function(t,e){var n=t.getApi(e);return function(t){t(n)}},mC=function(t,e){return Fu((function(n){var r=pC(t,n);r((function(n){var r=t.onSetup(n);h(r)&&e.set(r)}))}))},vC=function(t,e){return qu((function(n){return pC(t,n)(e.get())}))},gC=function(t,e){return Wu((function(n,r){pC(t,n)(t.onAction),t.triggersSubmenu||e!==qO.CLOSE_ON_EXECUTE||(_u(n,iu()),r.stop())}))},bC=(DS={},DS[eu()]=["disabling","alloy.base.behaviour","toggling","item-events"],DS),yC=zt,xC=function(t,e,n,r){var o=oa(v);return{type:"item",dom:e.dom,components:yC(e.optComponents),data:t.data,eventOrder:bC,hasSubmenu:t.triggersSubmenu,itemBehaviours:hf([Vx("item-events",[gC(t,n),mC(t,o),vC(t,o)]),hC.item((function(){return t.disabled||r.isDisabled()})),cC(),Bx.config({})].concat(t.itemBehaviours))}},wC=function(t){return{value:t.value,meta:T({text:t.text.getOr("")},t.meta)}},_C=tinymce.util.Tools.resolve("tinymce.Env"),OC=function(t){var e={alt:"⌥",ctrl:"⌃",shift:"⇧",meta:"⌘",access:"⌃⌥"},n={meta:"Ctrl",access:"Shift+Alt"},r=_C.mac?e:n,o=t.split("+"),i=G(o,(function(t){var e=t.toLowerCase().trim();return Et(r,e)?r[e]:t}));return _C.mac?i.join(""):i.join("+")},kC=function(t,e,n){return void 0===n&&(n=[XO]),j_(t,{tag:"div",classes:n},e)},SC=function(t){return{dom:{tag:"div",classes:[ZO]},components:[Os(S_.translate(t))]}},CC=function(t,e){return{dom:{tag:"div",classes:e,innerHtml:t}}},EC=function(t,e){return{dom:{tag:"div",classes:[ZO]},components:[{dom:{tag:t.tag,styles:t.styles},components:[Os(S_.translate(e))]}]}},AC=function(t){return{dom:{tag:"div",classes:[JO],innerHtml:OC(t)}}},TC=function(t){return kC("checkmark",t,[tk])},MC=function(t){return kC("chevron-right",t,[QO])},zC=function(t){return kC("chevron-down",t,[QO])},PC=function(t,e){var n="vertical"===t.direction?rk:ok,r="left"===t.align?ak:ik,o=function(){switch(t.valign){case"top":return uk;case"middle":return ck;case"bottom":return sk}};return{dom:{tag:"div",classes:[nk,n,r,o()]},components:e}},NC=function(t,e,n){return{dom:{tag:"img",classes:e,attributes:{src:t,alt:n.getOr("")}}}},DC=function(t,e,n){var r="custom",o="remove",i=t.ariaLabel,a=t.value,u=t.iconContent.map((function(t){return P_(t,e.icons,n)})),c=function(){var t=GO,n=u.getOr(""),c=i.map((function(t){return{title:e.translate(t)}})).getOr({}),s={tag:"div",attributes:c,classes:[t]};return T(T({},s),a===r?{tag:"button",classes:z(z([],s.classes,!0),["tox-swatches__picker-btn"],!1),innerHtml:n}:a===o?{classes:z(z([],s.classes,!0),["tox-swatch--remove"],!1),innerHtml:n}:{attributes:T(T({},s.attributes),{"data-mce-color":a}),styles:{"background-color":a}})};return{dom:c(),optComponents:[]}},LC=function(t){var e=t.map((function(t){return{attributes:{title:S_.translate(t)}}})).getOr({});return T({tag:"div",classes:[UO,WO]},e)},jC=function(t,e,n,r){var o={tag:"div",classes:[XO]},i=function(t){return j_(t,o,e.icons,r)},a=function(){return j.some({dom:o})},u=n?t.iconContent.map(i).orThunk(a):j.none(),c=t.checkMark,s=j.from(t.meta).fold((function(){return SC}),(function(t){return Et(t,"style")?O(EC,t.style):SC})),l=t.htmlContent.fold((function(){return t.textContent.map(s)}),(function(t){return j.some(CC(t,[ZO]))})),f={dom:LC(t.ariaLabel),optComponents:[u,l,t.shortcutContent.map(AC),c,t.caret]};return f},HC=function(t,e,n,r){return void 0===r&&(r=j.none()),"color"===t.presets?DC(t,e,r):jC(t,e,n,r)},RC=function(t,e){return Ct(t,"tooltipWorker").map((function(t){return[lS.config({lazySink:e.getSink,tooltipDom:{tag:"div",classes:["tox-tooltip-worker-container"]},tooltipComponents:[],anchor:function(t){return{type:"submenu",item:t,overrides:{maxHeightFunction:Ed}}},mode:"follow-highlight",onShow:function(e,n){t((function(t){lS.setComponents(e,[ks({element:ee.fromDom(t)})])}))}})]})).getOr([])},BC=function(t){return dS.DOM.encode(t)},IC=function(t,e){var n=S_.translate(t),r=BC(n);if(e.length>0){var o=new RegExp(fS(e),"gi");return r.replace(o,(function(t){return''+t+""}))}return r},VC=function(t,e,n,r,o,i,a,u){void 0===u&&(u=!0);var c=HC({presets:r,textContent:j.none(),htmlContent:n?t.text.map((function(t){return IC(t,e)})):j.none(),ariaLabel:t.text,iconContent:t.icon,shortcutContent:j.none(),checkMark:j.none(),caret:j.none(),value:t.value},a.providers,u,t.icon);return xC({data:wC(t),disabled:t.disabled,getApi:x({}),onAction:function(e){return o(t.value,t.meta)},onSetup:x(v),triggersSubmenu:!1,itemBehaviours:RC(t.meta,a)},c,i,a.providers)},FC=function(t,e){return G(t,(function(t){switch(t.type){case"cardcontainer":return PC(t,FC(t.items,e));case"cardimage":return NC(t.src,t.classes,t.alt);case"cardtext":var n=t.name.exists((function(t){return F(e.cardText.highlightOn,t)})),r=n?j.from(e.cardText.matchText).getOr(""):"";return CC(IC(t.text,r),t.classes)}}))},qC=function(t,e,n,r){var o=function(t){return{isDisabled:function(){return Hg.isDisabled(t)},setDisabled:function(e){Hg.set(t,e),$(Yh(t.element,"*"),(function(n){t.getSystem().getByDom(n).each((function(t){t.hasConfigured(Hg)&&Hg.set(t,e)}))}))}}},i={dom:LC(t.label),optComponents:[j.some({dom:{tag:"div",classes:[nk,ok]},components:FC(t.items,r)})]};return xC({data:wC(T({text:j.none()},t)),disabled:t.disabled,getApi:o,onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:j.from(r.itemBehaviours).getOr([])},i,e,n.providers)},UC=function(t,e,n,r,o,i,a,u){void 0===u&&(u=!0);var c=function(t){return{setActive:function(e){mw.set(t,e)},isActive:function(){return mw.isOn(t)},isDisabled:function(){return Hg.isDisabled(t)},setDisabled:function(e){return Hg.set(t,e)}}},s=HC({presets:n,textContent:e?t.text:j.none(),htmlContent:j.none(),ariaLabel:t.text,iconContent:t.icon,shortcutContent:e?t.shortcut:j.none(),checkMark:e?j.some(TC(a.icons)):j.none(),caret:j.none(),value:t.value},a,u);return _o(xC({data:wC(t),disabled:t.disabled,getApi:c,onAction:function(e){return r(t.value)},onSetup:function(t){return t.setActive(o),v},triggersSubmenu:!1,itemBehaviours:[]},s,i,a),{toggling:{toggleClass:KO,toggleOnExecute:!1,selected:t.active}})},WC=Vv(Aw(),Tw()),GC=function(t){return{value:t}},$C=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,KC=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,YC=function(t){return $C.test(t)||KC.test(t)},XC=function(t){return It(t,"#").toUpperCase()},ZC=function(t){return YC(t)?j.some({value:XC(t)}):j.none()},JC=function(t){var e=t.value.replace($C,(function(t,e,n,r){return e+e+n+n+r+r}));return{value:e}},QC=function(t){var e=JC(t),n=KC.exec(e.value);return null===n?["FFFFFF","FF","FF","FF"]:n},tE=function(t){var e=t.toString(16);return(1===e.length?"0"+e:e).toUpperCase()},eE=function(t){var e=tE(t.red)+tE(t.green)+tE(t.blue);return GC(e)},nE=Math.min,rE=Math.max,oE=Math.round,iE=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)/,aE=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d?(?:\.\d+)?)\)/,uE=function(t,e,n,r){return{red:t,green:e,blue:n,alpha:r}},cE=function(t){var e=parseInt(t,10);return e.toString()===t&&e>=0&&e<=255},sE=function(t){var e,n,r,o=(t.hue||0)%360,i=t.saturation/100,a=t.value/100;if(i=rE(0,nE(i,1)),a=rE(0,nE(a,1)),0===i)return e=n=r=oE(255*a),uE(e,n,r,1);var u=o/60,c=a*i,s=c*(1-Math.abs(u%2-1)),l=a-c;switch(Math.floor(u)){case 0:e=c,n=s,r=0;break;case 1:e=s,n=c,r=0;break;case 2:e=0,n=c,r=s;break;case 3:e=0,n=s,r=c;break;case 4:e=s,n=0,r=c;break;case 5:e=c,n=0,r=s;break;default:e=n=r=0}return e=oE(255*(e+l)),n=oE(255*(n+l)),r=oE(255*(r+l)),uE(e,n,r,1)},lE=function(t){var e=QC(t),n=parseInt(e[1],16),r=parseInt(e[2],16),o=parseInt(e[3],16);return uE(n,r,o,1)},fE=function(t,e,n,r){var o=parseInt(t,10),i=parseInt(e,10),a=parseInt(n,10),u=parseFloat(r);return uE(o,i,a,u)},dE=function(t){if("transparent"===t)return j.some(uE(0,0,0,0));var e=iE.exec(t);if(null!==e)return j.some(fE(e[1],e[2],e[3],"1"));var n=aE.exec(t);return null!==n?j.some(fE(n[1],n[2],n[3],n[4])):j.none()},hE=function(t){return"rgba("+t.red+","+t.green+","+t.blue+","+t.alpha+")"},pE=uE(255,0,0,1),mE=function(t){return t.fire("SkinLoaded")},vE=function(t,e){return t.fire("SkinLoadError",e)},gE=function(t){return t.fire("ResizeEditor")},bE=function(t,e){return t.fire("ResizeContent",e)},yE=function(t,e){return t.fire("ScrollContent",e)},xE=function(t,e){return t.fire("TextColorChange",e)},wE=function(t,e,n){return{hue:t,saturation:e,value:n}},_E=function(t){var e=0,n=0,r=0,o=t.red/255,i=t.green/255,a=t.blue/255,u=Math.min(o,Math.min(i,a)),c=Math.max(o,Math.max(i,a));if(u===c)return r=u,wE(0,0,100*r);var s=o===u?i-a:a===u?o-i:a-o;return e=o===u?3:a===u?1:5,e=60*(e-s/(c-u)),n=(c-u)/c,r=c,wE(Math.round(e),Math.round(100*n),Math.round(100*r))},OE=function(t){return _E(lE(t))},kE=function(t){return eE(sE(t))},SE=function(t){return ZC(t).orThunk((function(){return dE(t).map(eE)})).getOrThunk((function(){var e=document.createElement("canvas");e.height=1,e.width=1;var n=e.getContext("2d");n.clearRect(0,0,e.width,e.height),n.fillStyle="#FFFFFF",n.fillStyle=t,n.fillRect(0,0,1,1);var r=n.getImageData(0,0,1,1).data,o=r[0],i=r[1],a=r[2],u=r[3];return eE(uE(o,i,a,u))}))},CE=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),EE="tinymce-custom-colors";function AE(t){void 0===t&&(t=10);var e=CE.getItem(EE),n=i(e)?JSON.parse(e):[],r=function(e){var n=t-e.length;return n<0?e.slice(0,t):e},o=r(n),a=function(e){V(o,e).each(u),o.unshift(e),o.length>t&&o.pop(),CE.setItem(EE,JSON.stringify(o))},u=function(t){o.splice(t,1)},c=function(){return o.slice(0)};return{add:a,state:c}}var TE,ME="choiceitem",zE=[{type:ME,text:"Light Green",value:"#BFEDD2"},{type:ME,text:"Light Yellow",value:"#FBEEB8"},{type:ME,text:"Light Red",value:"#F8CAC6"},{type:ME,text:"Light Purple",value:"#ECCAFA"},{type:ME,text:"Light Blue",value:"#C2E0F4"},{type:ME,text:"Green",value:"#2DC26B"},{type:ME,text:"Yellow",value:"#F1C40F"},{type:ME,text:"Red",value:"#E03E2D"},{type:ME,text:"Purple",value:"#B96AD9"},{type:ME,text:"Blue",value:"#3598DB"},{type:ME,text:"Dark Turquoise",value:"#169179"},{type:ME,text:"Orange",value:"#E67E23"},{type:ME,text:"Dark Red",value:"#BA372A"},{type:ME,text:"Dark Purple",value:"#843FA1"},{type:ME,text:"Dark Blue",value:"#236FA1"},{type:ME,text:"Light Gray",value:"#ECF0F1"},{type:ME,text:"Medium Gray",value:"#CED4D9"},{type:ME,text:"Gray",value:"#95A5A6"},{type:ME,text:"Dark Gray",value:"#7E8C8D"},{type:ME,text:"Navy Blue",value:"#34495E"},{type:ME,text:"Black",value:"#000000"},{type:ME,text:"White",value:"#ffffff"}],PE=AE(10),NE=function(t){for(var e=[],n=0;n0?d(n,r,e,o):r.text.length-n.matchLength>=10?c():u()}}))}))}))},m=U_((function(t){27!==t.which&&p()}),50),v={onKeypress:m,cancelIfNecessary:c,isMenuOpen:i,isActive:a,isProcessingAction:r.get,getView:function(){return e_.getContent(o)}};!1===t.hasPlugin("rtc")&&iO.setup(v,t)},LA={register:DA},jA=function(t,e,n){return Bs(t,e,n).isSome()},HA=function(t,e){var n=null,r=function(){for(var r=[],o=0;oRA||r>RA},FA=function(t){var e=od(),n=oa(!1),r=HA((function(e){t.triggerEvent(ou(),e),n.set(!0)}),BA),o=function(t){return IA(t).each((function(o){r.cancel();var i={x:o.clientX,y:o.clientY,target:t.target};r.schedule(t),n.set(!1),e.set(i)})),j.none()},i=function(t){return r.cancel(),IA(t).each((function(t){e.on((function(n){VA(t,n)&&e.clear()}))})),j.none()},a=function(o){r.cancel();var i=function(t){return sn(t.target,o.target)};return e.get().filter(i).map((function(e){return n.get()?(o.prevent(),!1):t.triggerEvent(ru(),o)}))},u=pa([{key:Ta(),value:o},{key:Ma(),value:i},{key:za(),value:a}]),c=function(t,e){return Ct(u,e).bind((function(e){return e(t)}))};return{fireIfReady:c}},qA=function(t){var e=t.raw;return e.which===ob[0]&&!F(["input","textarea"],ue(t.target))&&!jA(t.target,'[contenteditable="true"]')},UA=function(){return en().browser.isFirefox()},WA=function(t,e){return UA()?ud(t,"focus",e):ad(t,"focusin",e)},GA=function(t,e){return UA()?ud(t,"blur",e):ad(t,"focusout",e)},$A=function(t,e){var n=T({stopBackspace:!0},e),r=["touchstart","touchmove","touchend","touchcancel","gesturestart","mousedown","mouseup","mouseover","mousemove","mouseout","click"],o=FA(n),i=G(r.concat(["selectstart","input","contextmenu","change","transitionend","transitioncancel","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","keyup"]),(function(e){return ad(t,e,(function(t){o.fireIfReady(t,e).each((function(e){e&&t.kill()}));var r=n.triggerEvent(e,t);r&&t.kill()}))})),a=od(),u=ad(t,"paste",(function(t){o.fireIfReady(t,"paste").each((function(e){e&&t.kill()}));var e=n.triggerEvent("paste",t);e&&t.kill(),a.set(setTimeout((function(){n.triggerEvent(Qa(),t)}),0))})),c=ad(t,"keydown",(function(t){var e=n.triggerEvent("keydown",t);e?t.kill():n.stopBackspace&&qA(t)&&t.prevent()})),s=WA(t,(function(t){var e=n.triggerEvent("focusin",t);e&&t.kill()})),l=od(),f=GA(t,(function(t){var e=n.triggerEvent("focusout",t);e&&t.kill(),l.set(setTimeout((function(){n.triggerEvent(Ja(),t)}),0))})),d=function(){$(i,(function(t){t.unbind()})),c.unbind(),s.unbind(),f.unbind(),u.unbind(),a.on(clearTimeout),l.on(clearTimeout)};return{unbind:d}},KA=function(t,e){var n=Ct(t,"target").getOr(e);return oa(n)},YA=function(t,e){var n=oa(!1),r=oa(!1),o=function(){n.set(!0)},i=function(){r.set(!0)};return{stop:o,cut:i,isStopped:n.get,isCut:r.get,event:t,setSource:e.set,getSource:e.get}},XA=function(t){var e=oa(!1),n=function(){e.set(!0)};return{stop:n,cut:v,isStopped:e.get,isCut:C,event:t,setSource:S("Cannot set source of a broadcasted event"),getSource:S("Cannot get source of a broadcasted event")}},ZA=aa.generate([{stopped:[]},{resume:["element"]},{complete:[]}]),JA=function(t,e,n,r,o,i){var a=t(e,r),u=YA(n,o);return a.fold((function(){return i.logEventNoHandlers(e,r),ZA.complete()}),(function(t){var n=t.descHandler,r=Hc(n);return r(u),u.isStopped()?(i.logEventStopped(e,t.element,n.purpose),ZA.stopped()):u.isCut()?(i.logEventCut(e,t.element,n.purpose),ZA.complete()):gn(t.element).fold((function(){return i.logNoParent(e,t.element,n.purpose),ZA.complete()}),(function(r){return i.logEventResponse(e,t.element,n.purpose),ZA.resume(r)}))}))},QA=function(t,e,n,r,o,i){return JA(t,e,n,r,o,i).fold(E,(function(r){return QA(t,e,n,r,o,i)}),C)},tT=function(t,e,n,r,o){var i=KA(n,r);return JA(t,e,n,r,i,o)},eT=function(t,e,n){var r=XA(e);return $(t,(function(t){var e=t.descHandler,n=Hc(e);n(r)})),r.isStopped()},nT=function(t,e,n,r){return rT(t,e,n,n.target,r)},rT=function(t,e,n,r,o){var i=KA(n,r);return QA(t,e,n,r,i,o)},oT=function(t,e){return{element:t,descHandler:e}},iT=function(t,e){return{id:t,descHandler:e}},aT=function(){var t={},e=function(e,n,r){gt(r,(function(r,o){var i=void 0!==t[o]?t[o]:{};i[n]=jc(r,e),t[o]=i}))},n=function(t,e){return fc(e).bind((function(e){return Ct(t,e)})).map((function(t){return oT(e,t)}))},r=function(e){return Ct(t,e).map((function(t){return Ot(t,(function(t,e){return iT(e,t)}))})).getOr([])},o=function(e,r,o){return Ct(t,r).bind((function(t){return xa(o,(function(e){return n(t,e)}),e)}))},i=function(e){gt(t,(function(t,n){Et(t,e)&&delete t[e]}))};return{registerId:e,unregisterId:i,filterByType:r,find:o}},uT=function(){var t=aT(),e={},n=function(t){var e=t.element;return fc(e).getOrThunk((function(){return sc("uid-",t.element)}))},r=function(t,n){var r=e[n];if(r!==t)throw new Error('The tagId "'+n+'" is already used by: '+Qu(r.element)+"\nCannot use it for: "+Qu(t.element)+"\nThe conflicting element is"+(jn(r.element)?" ":" not ")+"already in the DOM");i(t)},o=function(o){var i=n(o);At(e,i)&&r(o,i);var a=[o];t.registerId(a,i,o.events),e[i]=o},i=function(n){fc(n.element).each((function(n){delete e[n],t.unregisterId(n)}))},a=function(e){return t.filterByType(e)},u=function(e,n,r){return t.find(e,n,r)},c=function(t){return Ct(e,t)};return{find:u,filter:a,register:o,unregister:i,getById:c}},cT=function(t){var e=t.dom,n=e.attributes,r=M(e,["attributes"]);return{uid:t.uid,dom:T({tag:"div",attributes:T({role:"presentation"},n)},r),components:t.components,behaviours:nv(t.containerBehaviours),events:t.events,domModification:t.domModification,eventOrder:t.eventOrder}},sT=dg({name:"Container",factory:cT,configFields:[Ki("components",[]),ev("containerBehaviours",[]),Ki("events",{}),Ki("domModification",{}),Ki("eventOrder",{})]}),lT=function(t){var e=function(e){return gn(t.element).fold(E,(function(t){return sn(e,t)}))},n=uT(),r=function(t,r){return n.find(e,t,r)},o=$A(t.element,{triggerEvent:function(t,e){return Zs(t,e.target,(function(n){return nT(r,t,e,n)}))}}),i={debugInfo:x("real"),triggerEvent:function(t,e,n){Zs(t,e,(function(o){return rT(r,t,n,e,o)}))},triggerFocus:function(t,e){fc(t).fold((function(){Of(t)}),(function(n){Zs(Za(),t,(function(n){return tT(r,Za(),{originator:e,kill:v,prevent:v,target:t},t,n),!1}))}))},triggerEscape:function(t,e){i.triggerEvent("keydown",t.element,e.event)},getByUid:function(t){return m(t)},getByDom:function(t){return g(t)},build:Es,addToGui:function(t){c(t)},removeFromGui:function(t){s(t)},addToWorld:function(t){a(t)},removeFromWorld:function(t){u(t)},broadcast:function(t){d(t)},broadcastOn:function(t,e){h(t,e)},broadcastEvent:function(t,e){p(t,e)},isConnected:E},a=function(t){t.connect(i),fe(t.element)||(n.register(t),$(t.components(),a),i.triggerEvent(uu(),t.element,{target:t.element}))},u=function(t){fe(t.element)||($(t.components(),u),n.unregister(t)),t.disconnect()},c=function(e){Up(t,e)},s=function(t){$p(t)},l=function(){o.unbind(),Lr(t.element)},f=function(t){var e=n.filter(tu());$(e,(function(e){var n=e.descHandler,r=Hc(n);r(t)}))},d=function(t){f({universal:!0,data:t})},h=function(t,e){f({universal:!1,channels:t,data:e})},p=function(t,e){var r=n.filter(t);return eT(r,e)},m=function(t){return n.getById(t).fold((function(){return ro.error(new Error('Could not find component with uid: "'+t+'" in system.'))}),ro.value)},g=function(t){var e=fc(t).getOr("not found");return m(e)};return a(t),{root:t,element:t.element,destroy:l,add:c,remove:s,getByUid:m,getByDom:g,addToWorld:a,removeFromWorld:u,broadcast:d,broadcastOn:h,broadcastEvent:p}},fT=function(t,e){return{dom:{tag:"div",classes:["tox-bar","tox-form__controls-h-stack"]},components:G(t.items,e.interpreter)}},dT=x([Ki("prefix","form-field"),ev("fieldBehaviours",[bg,tv])]),hT=x([Lv({schema:[Ti("dom")],name:"label"}),Lv({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:t.text}}}},schema:[Ti("text")],name:"aria-descriptor"}),Nv({factory:{sketch:function(t){var e=da(t,["factory"]);return t.factory.sketch(e)}},schema:[Ti("factory")],name:"field"})]),pT=function(t,e,n,r){var o=rv(t.fieldBehaviours,[bg.config({find:function(e){return Kv(e,t,"field")}}),tv.config({store:{mode:"manual",getValue:function(t){return bg.getCurrent(t).bind(tv.getValue)},setValue:function(t,e){bg.getCurrent(t).each((function(t){tv.setValue(t,e)}))}}})]),i=Au([Fu((function(e,n){var r=Xv(e,t,["label","field","aria-descriptor"]);r.field().each((function(e){var n=oc(t.prefix);r.label().each((function(t){In(t.element,"for",n),In(e.element,"id",n)})),r["aria-descriptor"]().each((function(n){var r=oc(t.prefix);In(n.element,"id",r),In(e.element,"aria-describedby",r)}))}))}))]),a={getField:function(e){return Kv(e,t,"field")},getLabel:function(e){return Kv(e,t,"label")}};return{uid:t.uid,dom:t.dom,components:e,behaviours:o,events:i,apis:a}},mT=hg({name:"FormField",configFields:dT(),partFields:hT(),factory:pT,apis:{getField:function(t,e){return t.getField(e)},getLabel:function(t,e){return t.getLabel(e)}}}),vT=function(t,e){return Mc({attributes:pa([{key:e.tabAttr,value:"true"}])})},gT=Object.freeze({__proto__:null,exhibit:vT}),bT=[Ki("tabAttr","data-alloy-tabstop")],yT=mf({fields:bT,name:"tabstopping",active:gT}),xT=tinymce.util.Tools.resolve("tinymce.html.Entities"),wT=function(t,e,n,r){var o=OT(t,e,n,r);return mT.sketch(o)},_T=function(t,e){return wT(t,e,[],[])},OT=function(t,e,n,r){return{dom:ST(n),components:t.toArray().concat([e]),fieldBehaviours:hf(r)}},kT=function(){return ST([])},ST=function(t){return{tag:"div",classes:["tox-form__group"].concat(t)}},CT=function(t,e){return mT.parts.label({dom:{tag:"label",classes:["tox-label"],innerHtml:e.translate(t)}})},ET=oc("form-component-change"),AT=oc("form-close"),TT=oc("form-cancel"),MT=oc("form-action"),zT=oc("form-submit"),PT=oc("form-block"),NT=oc("form-unblock"),DT=oc("form-tabchange"),LT=oc("form-resize"),jT=function(t,e){var n,r=t.label.map((function(t){return CT(t,e)})),o=function(t){return function(e,n){Bs(n.event.target,"[data-collection-item-value]").each((function(r){t(e,n,r,Fn(r,"data-collection-item-value"))}))}},i=function(n,r){var o=G(r,(function(n){var r=S_.translate(n.text),o=1===t.columns?'
'+r+"
":"",i='
'+n.icon+"
",a={_:" "," - ":" ","-":" "},u=r.replace(/\_| \- |\-/g,(function(t){return a[t]})),c=e.isDisabled()?" tox-collection__item--state-disabled":"";return'
'+i+o+"
"})),i="auto"!==t.columns&&t.columns>1?W(o,t.columns):[o],a=G(i,(function(t){return'
'+t.join("")+"
"}));Ku(n.element,a.join(""))},a=o((function(n,r,o,i){r.stop(),e.isDisabled()||Ou(n,MT,{name:t.name,value:i})})),u=[Pu(Ha(),o((function(t,e,n){Of(n)}))),Pu(Ua(),a),Pu(ru(),a),Pu(Ra(),o((function(t,e,n){Rs(t.element,"."+ek).each((function(t){us(t,ek)})),is(n,ek)}))),Pu(Ba(),o((function(t){Rs(t.element,"."+ek).each((function(t){us(t,ek)}))}))),Wu(o((function(e,n,r,o){Ou(e,MT,{name:t.name,value:o})})))],c=function(t,e){return G(Yh(t.element,".tox-collection__item"),e)},s=mT.parts.field({dom:{tag:"div",classes:["tox-collection"].concat(1!==t.columns?["tox-collection--grid"]:["tox-collection--list"])},components:[],factory:{sketch:w},behaviours:hf([Hg.config({disabled:e.isDisabled,onDisabled:function(t){c(t,(function(t){is(t,"tox-collection__item--state-disabled"),In(t,"aria-disabled",!0)}))},onEnabled:function(t){c(t,(function(t){us(t,"tox-collection__item--state-disabled"),Wn(t,"aria-disabled")}))}}),cC(),Bx.config({}),tv.config({store:{mode:"memory",initialValue:[]},onSetValue:function(e,n){i(e,n),"auto"===t.columns&&Yk(e,5,"tox-collection__item").each((function(t){var n=t.numRows,r=t.numColumns;Tx.setGridSize(e,n,r)})),_u(e,LT)}}),yT.config({}),Tx.config(iA(t.columns,"normal")),Vx("collection-events",u)]),eventOrder:(n={},n[eu()]=["disabling","alloy.base.behaviour","collection-events"],n)}),l=["tox-form__group--collection"];return wT(r,s,l,[])},HT=x([Ii("data"),Ki("inputAttributes",{}),Ki("inputStyles",{}),Ki("tag","input"),Ki("inputClasses",[]),ul("onSetValue"),Ki("styles",{}),Ki("eventOrder",{}),ev("inputBehaviours",[tv,Xx]),Ki("selectOnFocus",!0)]),RT=function(t){return hf([Xx.config({onFocus:t.selectOnFocus?function(t){var e=t.element,n=ds(e);e.dom.setSelectionRange(0,n.length)}:v})])},BT=function(t){return T(T({},RT(t)),rv(t.inputBehaviours,[tv.config({store:T(T({mode:"manual"},t.data.map((function(t){return{initialValue:t}})).getOr({})),{getValue:function(t){return ds(t.element)},setValue:function(t,e){var n=ds(t.element);n!==e&&hs(t.element,e)}}),onSetValue:t.onSetValue})]))},IT=function(t){return{tag:t.tag,attributes:T({type:"text"},t.inputAttributes),styles:t.inputStyles,classes:t.inputClasses}},VT=function(t,e){return{uid:t.uid,dom:IT(t),components:[],behaviours:BT(t),eventOrder:t.eventOrder}},FT=dg({name:"Input",configFields:HT(),factory:VT}),qT={},UT={exports:qT};(function(e,n,r,o){(function(t,o){"object"===typeof n&&"undefined"!==typeof r?r.exports=o():"function"===typeof e&&e.amd?e(o):(t="undefined"!==typeof globalThis?globalThis:t||self,t.EphoxContactWrapper=o())})(this,(function(){var e="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof t?t:"undefined"!==typeof self?self:{},n={exports:{}};(function(t){(function(e){var n=setTimeout;function r(){}function o(t,e){return function(){t.apply(e,arguments)}}function i(t){if("object"!==typeof this)throw new TypeError("Promises must be constructed via new");if("function"!==typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],f(t,this)}function a(t,e){while(3===t._state)t=t._value;0!==t._state?(t._handled=!0,i._immediateFn((function(){var n=1===t._state?e.onFulfilled:e.onRejected;if(null!==n){var r;try{r=n(t._value)}catch(o){return void c(e.promise,o)}u(e.promise,r)}else(1===t._state?u:c)(e.promise,t._value)}))):t._deferreds.push(e)}function u(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"===typeof e||"function"===typeof e)){var n=e.then;if(e instanceof i)return t._state=3,t._value=e,void s(t);if("function"===typeof n)return void f(o(n,e),t)}t._state=1,t._value=e,s(t)}catch(r){c(t,r)}}function c(t,e){t._state=2,t._value=e,s(t)}function s(t){2===t._state&&0===t._deferreds.length&&i._immediateFn((function(){t._handled||i._unhandledRejectionFn(t._value)}));for(var e=0,n=t._deferreds.length;en?n:t===e?e-1:Math.max(e,t-r)},tP=function(t,e,n,r){return t>n?t:td)return m;var v=rP(o,f,d),g=eP(v/h*r+e,p,m);return a&&g>=e&&g<=n?nP(g,e,n,i,u):c?Math.round(g):g},iP=function(t){var e=t.min,n=t.max,r=t.range,o=t.value,i=t.hasMinEdge,a=t.hasMaxEdge,u=t.maxBound,c=t.maxOffset,s=t.centerMinEdge,l=t.centerMaxEdge;return on?a?u:l:(o-e)/r*c},aP="top",uP="right",cP="bottom",sP="left",lP="width",fP="height",dP=function(t){return t.element.dom.getBoundingClientRect()},hP=function(t,e){return t[e]},pP=function(t){var e=dP(t);return hP(e,sP)},mP=function(t){var e=dP(t);return hP(e,uP)},vP=function(t){var e=dP(t);return hP(e,aP)},gP=function(t){var e=dP(t);return hP(e,cP)},bP=function(t){var e=dP(t);return hP(e,lP)},yP=function(t){var e=dP(t);return hP(e,fP)},xP=function(t,e,n){return(t+e)/2-n},wP=function(t,e){var n=dP(t),r=dP(e),o=hP(n,sP),i=hP(n,uP),a=hP(r,sP);return xP(o,i,a)},_P=function(t,e){var n=dP(t),r=dP(e),o=hP(n,aP),i=hP(n,cP),a=hP(r,aP);return xP(o,i,a)},OP=function(t,e){Ou(t,uz(),{value:e})},kP=function(t){return{x:t}},SP=function(t,e,n){var r={min:pz(e),max:bz(e),range:Oz(e),value:n,step:Ez(e),snap:Az(e),snapStart:Tz(e),rounded:Mz(e),hasMinEdge:Pz(e),hasMaxEdge:Nz(e),minBound:pP(t),maxBound:mP(t),screenRange:bP(t)};return oP(r)},CP=function(t,e,n){var r=SP(t,e,n),o=kP(r);return OP(t,o),r},EP=function(t,e){var n=pz(e);OP(t,kP(n))},AP=function(t,e){var n=bz(e);OP(t,kP(n))},TP=function(t,e,n){var r=t>0?tP:Qz,o=r(jz(n).x,pz(n),bz(n),Ez(n));return OP(e,kP(o)),j.some(o)},MP=function(t){return function(e,n){return TP(t,e,n).map(E)}},zP=function(t){var e=sz(t);return e.map((function(t){return t.left}))},PP=function(t,e,n,r,o){var i=0,a=bP(t),u=r.bind((function(e){return j.some(wP(e,t))})).getOr(i),c=o.bind((function(e){return j.some(wP(e,t))})).getOr(a),s={min:pz(e),max:bz(e),range:Oz(e),value:n,hasMinEdge:Pz(e),hasMaxEdge:Nz(e),minBound:pP(t),minOffset:i,maxBound:mP(t),maxOffset:a,centerMinEdge:u,centerMaxEdge:c};return iP(s)},NP=function(t,e,n,r,o,i){var a=PP(e,i,n,r,o);return pP(e)-pP(t)+a},DP=function(t,e,n,r){var o=jz(n),i=NP(t,r.getSpectrum(t),o.x,r.getLeftEdge(t),r.getRightEdge(t),n),a=gr(e.element)/2;Kn(e.element,"left",i-a+"px")},LP=MP(-1),jP=MP(1),HP=j.none,RP=j.none,BP={"top-left":j.none(),top:j.none(),"top-right":j.none(),right:j.some(Wz),"bottom-right":j.none(),bottom:j.none(),"bottom-left":j.none(),left:j.some(Zz)},IP=Object.freeze({__proto__:null,setValueFrom:CP,setToMin:EP,setToMax:AP,findValueOfOffset:SP,getValueFromEvent:zP,findPositionOfValue:NP,setPositionFromValue:DP,onLeft:LP,onRight:jP,onUp:HP,onDown:RP,edgeActions:BP}),VP=function(t,e){Ou(t,uz(),{value:e})},FP=function(t){return{y:t}},qP=function(t,e,n){var r={min:mz(e),max:yz(e),range:kz(e),value:n,step:Ez(e),snap:Az(e),snapStart:Tz(e),rounded:Mz(e),hasMinEdge:Dz(e),hasMaxEdge:Lz(e),minBound:vP(t),maxBound:gP(t),screenRange:yP(t)};return oP(r)},UP=function(t,e,n){var r=qP(t,e,n),o=FP(r);return VP(t,o),r},WP=function(t,e){var n=mz(e);VP(t,FP(n))},GP=function(t,e){var n=yz(e);VP(t,FP(n))},$P=function(t,e,n){var r=t>0?tP:Qz,o=r(jz(n).y,mz(n),yz(n),Ez(n));return VP(e,FP(o)),j.some(o)},KP=function(t){return function(e,n){return $P(t,e,n).map(E)}},YP=function(t){var e=sz(t);return e.map((function(t){return t.top}))},XP=function(t,e,n,r,o){var i=0,a=yP(t),u=r.bind((function(e){return j.some(_P(e,t))})).getOr(i),c=o.bind((function(e){return j.some(_P(e,t))})).getOr(a),s={min:mz(e),max:yz(e),range:kz(e),value:n,hasMinEdge:Dz(e),hasMaxEdge:Lz(e),minBound:vP(t),minOffset:i,maxBound:gP(t),maxOffset:a,centerMinEdge:u,centerMaxEdge:c};return iP(s)},ZP=function(t,e,n,r,o,i){var a=XP(e,i,n,r,o);return vP(e)-vP(t)+a},JP=function(t,e,n,r){var o=jz(n),i=ZP(t,r.getSpectrum(t),o.y,r.getTopEdge(t),r.getBottomEdge(t),n),a=ar(e.element)/2;Kn(e.element,"top",i-a+"px")},QP=j.none,tN=j.none,eN=KP(-1),nN=KP(1),rN={"top-left":j.none(),top:j.some(Fz),"top-right":j.none(),right:j.none(),"bottom-right":j.none(),bottom:j.some(Kz),"bottom-left":j.none(),left:j.none()},oN=Object.freeze({__proto__:null,setValueFrom:UP,setToMin:WP,setToMax:GP,findValueOfOffset:qP,getValueFromEvent:YP,findPositionOfValue:ZP,setPositionFromValue:JP,onLeft:QP,onRight:tN,onUp:eN,onDown:nN,edgeActions:rN}),iN=function(t,e){Ou(t,uz(),{value:e})},aN=function(t,e){return{x:t,y:e}},uN=function(t,e,n){var r=SP(t,e,n.left),o=qP(t,e,n.top),i=aN(r,o);return iN(t,i),i},cN=function(t,e,n,r){var o=t>0?tP:Qz,i=e?jz(r).x:o(jz(r).x,pz(r),bz(r),Ez(r)),a=e?o(jz(r).y,mz(r),yz(r),Ez(r)):jz(r).y;return iN(n,aN(i,a)),j.some(i)},sN=function(t,e){return function(n,r){return cN(t,e,n,r).map(E)}},lN=function(t,e){var n=pz(e),r=mz(e);iN(t,aN(n,r))},fN=function(t,e){var n=bz(e),r=yz(e);iN(t,aN(n,r))},dN=function(t){return sz(t)},hN=function(t,e,n,r){var o=jz(n),i=NP(t,r.getSpectrum(t),o.x,r.getLeftEdge(t),r.getRightEdge(t),n),a=ZP(t,r.getSpectrum(t),o.y,r.getTopEdge(t),r.getBottomEdge(t),n),u=gr(e.element)/2,c=ar(e.element)/2;Kn(e.element,"left",i-u+"px"),Kn(e.element,"top",a-c+"px")},pN=sN(-1,!1),mN=sN(1,!1),vN=sN(-1,!0),gN=sN(1,!0),bN={"top-left":j.some(Vz),top:j.some(qz),"top-right":j.some(Uz),right:j.some(Gz),"bottom-right":j.some($z),bottom:j.some(Yz),"bottom-left":j.some(Xz),left:j.some(Jz)},yN=Object.freeze({__proto__:null,setValueFrom:uN,setToMin:lN,setToMax:fN,getValueFromEvent:dN,setPositionFromValue:hN,onLeft:pN,onRight:mN,onUp:vN,onDown:gN,edgeActions:bN}),xN=[Ki("stepSize",1),Ki("onChange",v),Ki("onChoose",v),Ki("onInit",v),Ki("onDragStart",v),Ki("onDragEnd",v),Ki("snapToGrid",!1),Ki("rounded",!0),Ii("snapStart"),Mi("model",ki("mode",{x:[Ki("minX",0),Ki("maxX",100),Ei("value",(function(t){return oa(t.mode.minX)})),Ti("getInitialValue"),fl("manager",IP)],y:[Ki("minY",0),Ki("maxY",100),Ei("value",(function(t){return oa(t.mode.minY)})),Ti("getInitialValue"),fl("manager",oN)],xy:[Ki("minX",0),Ki("maxX",100),Ki("minY",0),Ki("maxY",100),Ei("value",(function(t){return oa({x:t.mode.minX,y:t.mode.minY})})),Ti("getInitialValue"),fl("manager",yN)]})),ev("sliderBehaviours",[Tx,tv]),Ei("mouseIsDown",(function(){return oa(!1)}))],wN=function(t,e,n,r){var o,i=function(e){return Yv(e,t,"thumb")},a=function(e){return Yv(e,t,"spectrum")},u=function(e){return Kv(e,t,"left-edge")},c=function(e){return Kv(e,t,"right-edge")},s=function(e){return Kv(e,t,"top-edge")},l=function(e){return Kv(e,t,"bottom-edge")},f=t.model,d=f.manager,h=function(e,n){d.setPositionFromValue(e,n,t,{getLeftEdge:u,getRightEdge:c,getTopEdge:s,getBottomEdge:l,getSpectrum:a})},p=function(t,e){f.value.set(e);var n=i(t);h(t,n)},m=function(e,n){p(e,n);var r=i(e);return t.onChange(e,r,n),j.some(!0)},v=function(e){d.setToMin(e,t)},g=function(e){d.setToMax(e,t)},b=function(e){var n=function(){Kv(e,t,"thumb").each((function(n){var r=f.value.get();t.onChoose(e,n,r)}))},r=t.mouseIsDown.get();t.mouseIsDown.set(!1),r&&n()},y=function(e,n){n.stop(),t.mouseIsDown.set(!0),t.onDragStart(e,i(e))},x=function(e,n){n.stop(),t.onDragEnd(e,i(e)),b(e)};return{uid:t.uid,dom:t.dom,components:e,behaviours:rv(t.sliderBehaviours,[Tx.config({mode:"special",focusIn:function(e){return Kv(e,t,"spectrum").map(Tx.focusIn).map(E)}}),tv.config({store:{mode:"manual",getValue:function(t){return f.value.get()}}}),yf.config({channels:(o={},o[wm()]={onReceive:b},o)})]),events:Au([Pu(uz(),(function(t,e){m(t,e.event.value)})),Fu((function(e,n){var r=f.getInitialValue();f.value.set(r);var o=i(e);h(e,o);var u=a(e);t.onInit(e,o,u,f.value.get())})),Pu(Ta(),y),Pu(za(),x),Pu(Na(),y),Pu(ja(),x)]),apis:{resetToMin:v,resetToMax:g,setValue:p,refresh:h},domModification:{styles:{position:"relative"}}}},_N=hg({name:"Slider",configFields:xN,partFields:iz,factory:wN,apis:{setValue:function(t,e,n){t.setValue(e,n)},resetToMin:function(t,e){t.resetToMin(e)},resetToMax:function(t,e){t.resetToMax(e)},refresh:function(t,e){t.refresh(e)}}}),ON=oc("rgb-hex-update"),kN=oc("slider-update"),SN=oc("palette-update"),CN=function(t,e){var n=_N.parts.spectrum({dom:{tag:"div",classes:[e("hue-slider-spectrum")],attributes:{role:"presentation"}}}),r=_N.parts.thumb({dom:{tag:"div",classes:[e("hue-slider-thumb")],attributes:{role:"presentation"}}});return _N.sketch({dom:{tag:"div",classes:[e("hue-slider")],attributes:{role:"presentation"}},rounded:!1,model:{mode:"y",getInitialValue:x({y:0})},components:[n,r],sliderBehaviours:hf([Xx.config({})]),onChange:function(t,e,n){Ou(t,kN,{value:n})}})},EN="form",AN=[ev("formBehaviours",[tv])],TN=function(t){return""},MN=function(t){var e=function(){var t=[],e=function(e,n){return t.push(e),qv(EN,TN(e),n)};return{field:e,record:x(t)}}(),n=t(e),r=e.record(),o=G(r,(function(t){return Nv({name:t,pname:TN(t)})}));return ag(EN,AN,o,PN,n)},zN=function(t,e){return t.fold((function(){return ro.error(e)}),ro.value)},PN=function(t,e){return{uid:t.uid,dom:t.dom,components:e,behaviours:rv(t.formBehaviours,[tv.config({store:{mode:"manual",getValue:function(e){var n=Zv(e,t);return bt(n,(function(t,e){return t().bind((function(t){var n=bg.getCurrent(t);return zN(n,new Error("Cannot find a current component to extract the value from for form part '"+e+"': "+Qu(t.element)))})).map(tv.getValue)}))},setValue:function(e,n){gt(n,(function(n,r){Kv(e,t,r).each((function(t){bg.getCurrent(t).each((function(t){tv.setValue(t,n)}))}))}))}}})]),apis:{getField:function(e,n){return Kv(e,t,n).bind(bg.getCurrent)}}}},NN={getField:Oc((function(t,e,n){return t.getField(e,n)})),sketch:MN},DN=oc("valid-input"),LN=oc("invalid-input"),jN=oc("validating-input"),HN="colorcustom.rgb.",RN=function(t,e,n,r){var o=function(n,r){return dM.config({invalidClass:e("invalid"),notify:{onValidate:function(t){Ou(t,jN,{type:n})},onValid:function(t){Ou(t,DN,{type:n,value:tv.getValue(t)})},onInvalid:function(t){Ou(t,LN,{type:n,value:tv.getValue(t)})}},validator:{validate:function(e){var n=tv.getValue(e),o=r(n)?ro.value(!0):ro.error(t("aria.input.invalid"));return tM.pure(o)},validateOnLoad:!1}})},i=function(n,r,i,a,u){var c=t(HN+"range"),s=mT.parts.label({dom:{tag:"label",innerHtml:i,attributes:{"aria-label":a}}}),l=mT.parts.field({data:u,factory:FT,inputAttributes:T({type:"text"},"hex"===r?{"aria-live":"polite"}:{}),inputClasses:[e("textfield")],inputBehaviours:hf([o(r,n),yT.config({})]),onSetValue:function(t){if(dM.isInvalid(t)){var e=dM.run(t);e.get(v)}}}),f=[s,l],d="hex"!==r?[mT.parts["aria-descriptor"]({text:c})]:[],h=f.concat(d);return{dom:{tag:"div",attributes:{role:"presentation"}},components:h}},a=function(t,e){var n=eE(e);return NN.getField(t,"hex").each((function(e){Xx.isFocused(e)||tv.setValue(t,{hex:n.value})})),n},u=function(t,e){var n=e.red,r=e.green,o=e.blue;tv.setValue(t,{red:n,green:r,blue:o})},c=k_({dom:{tag:"div",classes:[e("rgba-preview")],styles:{"background-color":"white"},attributes:{role:"presentation"}}}),s=function(t,e){c.getOpt(t).each((function(t){Kn(t.element,"background-color","#"+e.value)}))},l=function(){var o={red:oa(j.some(255)),green:oa(j.some(255)),blue:oa(j.some(255)),hex:oa(j.some("ffffff"))},l=function(t,e){var n=lE(e);u(t,n),p(n)},f=function(t){return o[t].get()},d=function(t,e){o[t].set(e)},h=function(){return f("red").bind((function(t){return f("green").bind((function(e){return f("blue").map((function(n){return uE(t,e,n,1)}))}))}))},p=function(t){var e=t.red,n=t.green,r=t.blue;d("red",j.some(e)),d("green",j.some(n)),d("blue",j.some(r))},m=function(t,e){var n=e.event;"hex"!==n.type?d(n.type,j.none()):r(t)},v=function(t,e){n(t);var r=GC(e);d("hex",j.some(e));var o=lE(r);u(t,o),p(o),Ou(t,ON,{hex:r}),s(t,r)},g=function(t,e,n){var r=parseInt(n,10);d(e,j.some(r)),h().each((function(e){var n=a(t,e);Ou(t,ON,{hex:n}),s(t,n)}))},b=function(t){return"hex"===t.type},y=function(t,e){var n=e.event;b(n)?v(t,n.value):g(t,n.type,n.value)},x=function(e){return{label:t(HN+e+".label"),description:t(HN+e+".description")}},w=x("red"),_=x("green"),O=x("blue"),k=x("hex");return _o(NN.sketch((function(n){return{dom:{tag:"form",classes:[e("rgb-form")],attributes:{"aria-label":t("aria.color.picker")}},components:[n.field("red",mT.sketch(i(cE,"red",w.label,w.description,255))),n.field("green",mT.sketch(i(cE,"green",_.label,_.description,255))),n.field("blue",mT.sketch(i(cE,"blue",O.label,O.description,255))),n.field("hex",mT.sketch(i(YC,"hex",k.label,k.description,"ffffff"))),c.asSpec()],formBehaviours:hf([dM.config({invalidClass:e("form-invalid")}),Vx("rgb-form-events",[Pu(DN,y),Pu(LN,m),Pu(jN,m)])])}})),{apis:{updateHex:function(t,e){tv.setValue(t,{hex:e.value}),l(t,e),s(t,e)}}})},f=dg({factory:l,name:"RgbForm",configFields:[],apis:{updateHex:function(t,e,n){t.updateHex(e,n)}},extraApis:{}});return f},BN=function(t,e){var n=_N.parts.spectrum({dom:{tag:"canvas",attributes:{role:"presentation"},classes:[e("sv-palette-spectrum")]}}),r=_N.parts.thumb({dom:{tag:"div",attributes:{role:"presentation"},classes:[e("sv-palette-thumb")],innerHtml:"'}}),o=function(t,e){var n=t.width,r=t.height,o=t.getContext("2d");if(null!==o){o.fillStyle=e,o.fillRect(0,0,n,r);var i=o.createLinearGradient(0,0,n,0);i.addColorStop(0,"rgba(255,255,255,1)"),i.addColorStop(1,"rgba(255,255,255,0)"),o.fillStyle=i,o.fillRect(0,0,n,r);var a=o.createLinearGradient(0,0,0,r);a.addColorStop(0,"rgba(0,0,0,0)"),a.addColorStop(1,"rgba(0,0,0,1)"),o.fillStyle=a,o.fillRect(0,0,n,r)}},i=function(t,e){var n=t.components()[0].element.dom,r=wE(e,100,100),i=sE(r);o(n,hE(i))},a=function(t,e){var n=_E(lE(e));_N.setValue(t,{x:n.saturation,y:100-n.value})},u=function(t){var i=x({x:0,y:0}),a=function(t,e,n){Ou(t,SN,{value:n})},u=function(t,e,n,r){o(n.element.dom,hE(pE))},c=hf([bg.config({find:j.some}),Xx.config({})]);return _N.sketch({dom:{tag:"div",attributes:{role:"presentation"},classes:[e("sv-palette")]},model:{mode:"xy",getInitialValue:i},rounded:!1,components:[n,r],onChange:a,onInit:u,sliderBehaviours:c})},c=dg({factory:u,name:"SaturationBrightnessPalette",configFields:[],apis:{setHue:function(t,e,n){i(e,n)},setThumb:function(t,e,n){a(e,n)}},extraApis:{}});return c},IN=function(t,e){var n=function(n){var r=RN(t,e,n.onValidHex,n.onInvalidHex),o=BN(t,e),i=function(t){return(100-t)/100*360},a=function(t){return 100-t/360*100},u={paletteRgba:oa(pE),paletteHue:oa(0)},c=k_(CN(t,e)),s=k_(o.sketch({})),l=k_(r.sketch({})),f=function(t,e,n){s.getOpt(t).each((function(t){o.setHue(t,n)}))},d=function(t,e){l.getOpt(t).each((function(t){r.updateHex(t,e)}))},h=function(t,e,n){c.getOpt(t).each((function(t){_N.setValue(t,{y:a(n)})}))},p=function(t,e){s.getOpt(t).each((function(t){o.setThumb(t,e)}))},m=function(t,e){var n=lE(t);u.paletteRgba.set(n),u.paletteHue.set(e)},v=function(t,e,n,r){m(e,n),$(r,(function(r){r(t,e,n)}))},g=function(){var t=[d];return function(e,n){var r=n.event.value,o=u.paletteHue.get(),i=wE(o,r.x,100-r.y),a=kE(i);v(e,a,o,t)}},b=function(){var t=[f,d];return function(e,n){var r=i(n.event.value.y),o=u.paletteRgba.get(),a=_E(o),c=wE(r,a.saturation,a.value),s=kE(c);v(e,s,r,t)}},y=function(){var t=[f,h,p];return function(e,n){var r=n.event.hex,o=OE(r);v(e,r,o.hue,t)}};return{uid:n.uid,dom:n.dom,components:[s.asSpec(),c.asSpec(),l.asSpec()],behaviours:hf([Vx("colour-picker-events",[Pu(ON,y()),Pu(SN,g()),Pu(kN,b())]),bg.config({find:function(t){return l.getOpt(t)}}),Tx.config({mode:"acyclic"})])}},r=dg({name:"ColourPicker",configFields:[Ti("dom"),Ki("onValidHex",v),Ki("onInvalidHex",v)],factory:n});return r},VN=function(){return bg.config({find:j.some})},FN=function(t){return bg.config({find:t.getOpt})},qN=function(t){return bg.config({find:function(e){return _n(e.element,t).bind((function(t){return e.getSystem().getByDom(t).toOptional()}))}})},UN={self:VN,memento:FN,childAt:qN},WN={"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"},GN=function(t){return WN[t]},$N=function(t){return GN(t)},KN=function(t){var e=function(t){return"tox-"+t},n=IN($N,e),r=function(t){Ou(t,MT,{name:"hex-valid",value:!0})},o=function(t){Ou(t,MT,{name:"hex-valid",value:!1})},i=k_(n.sketch({dom:{tag:"div",classes:[e("color-picker-container")],attributes:{role:"presentation"}},onValidHex:r,onInvalidHex:o}));return{dom:{tag:"div"},components:[i.asSpec()],behaviours:hf([tv.config({store:{mode:"manual",getValue:function(t){var e=i.get(t),n=bg.getCurrent(e),r=n.bind((function(t){var e=tv.getValue(t);return e.hex}));return r.map((function(t){return"#"+t})).getOr("")},setValue:function(t,e){var n=/^#([a-fA-F0-9]{3}(?:[a-fA-F0-9]{3})?)/,r=n.exec(e),o=i.get(t),a=bg.getCurrent(o);a.fold((function(){console.log("Can not find form")}),(function(t){tv.setValue(t,{hex:j.from(r[1]).getOr("")}),NN.getField(t,"hex").each((function(t){_u(t,Fa())}))}))}}}),UN.self()])}},YN=tinymce.util.Tools.resolve("tinymce.Resource"),XN=function(t){return Et(t,"init")},ZN=function(t){var e=od(),n=k_({dom:{tag:t.tag}}),r=od();return{dom:{tag:"div",classes:["tox-custom-editor"]},behaviours:hf([Vx("custom-editor-events",[Fu((function(o){n.getOpt(o).each((function(n){(XN(t)?t.init(n.element.dom):YN.load(t.scriptId,t.scriptUrl).then((function(e){return e(n.element.dom,t.settings)}))).then((function(t){r.on((function(e){t.setValue(e)})),r.clear(),e.set(t)}))}))}))]),tv.config({store:{mode:"manual",getValue:function(){return e.get().fold((function(){return r.get().getOr("")}),(function(t){return t.getValue()}))},setValue:function(t,n){e.get().fold((function(){r.set(n)}),(function(t){return t.setValue(n)}))}}}),UN.self()]),components:[n.asSpec()]}},JN=tinymce.util.Tools.resolve("tinymce.util.Tools"),QN=ti([Ki("preprocess",w),Ki("postprocess",w)]),tD=function(t,e){var n=_i("RepresentingConfigs.memento processors",QN,e);return tv.config({store:{mode:"manual",getValue:function(e){var r=t.get(e),o=tv.getValue(r);return n.postprocess(o)},setValue:function(e,r){var o=n.preprocess(r),i=t.get(e);tv.setValue(i,o)}}})},eD=function(t,e,n){return tv.config(_o({store:{mode:"manual",getValue:e,setValue:n}},t.map((function(t){return{store:{initialValue:t}}})).getOr({})))},nD=function(t,e,n){return eD(t,(function(t){return e(t.element)}),(function(t,e){return n(t.element,e)}))},rD=function(t){return nD(t,ds,hs)},oD=function(t){return nD(t,$u,Ku)},iD=function(t){return tv.config({store:{mode:"memory",initialValue:t}})},aD={memento:tD,withElement:nD,withComp:eD,domValue:rD,domHtml:oD,memory:iD},uD="jpeg,jpg,jpe,jfi,jif,jfif,png,gif,bmp,webp",cD=function(t,e){var n=JN.explode(e.getSetting("images_file_types",uD,"string")),r=function(t){return q(n,(function(e){return Ut(t.name.toLowerCase(),"."+e.toLowerCase())}))};return X(ht(t),r)},sD=function(t,e){var n=function(t,e){e.stop()},r=function(t){return function(e,n){$(t,(function(t){t(e,n)}))}},o=function(t,e){if(!Hg.isDisabled(t)){var n=e.event.raw;a(t,n.dataTransfer.files)}},i=function(t,e){var n=e.event.raw.target;a(t,n.files)},a=function(n,r){tv.setValue(n,cD(r,e)),Ou(n,ET,{name:t.name})},u=k_({dom:{tag:"input",attributes:{type:"file",accept:"image/*"},styles:{display:"none"}},behaviours:hf([Vx("input-file-events",[Bu(Ua()),Bu(ru())])])}),c=function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-dropzone-container"]},behaviours:hf([aD.memory([]),UN.self(),Hg.config({}),mw.config({toggleClass:"dragenter",toggleOnExecute:!1}),Vx("dropzone-events",[Pu("dragenter",r([n,mw.toggle])),Pu("dragleave",r([n,mw.toggle])),Pu("dragover",n),Pu("drop",r([n,o])),Pu(qa(),i)])]),components:[{dom:{tag:"div",classes:["tox-dropzone"],styles:{}},components:[{dom:{tag:"p",innerHtml:e.translate("Drop an image here")}},O_.sketch({dom:{tag:"button",innerHtml:e.translate("Browse for an image"),styles:{position:"relative"},classes:["tox-button","tox-button--secondary"]},components:[u.asSpec()],action:function(t){var e=u.get(t);e.element.dom.click()},buttonBehaviours:hf([yT.config({}),hC.button(e.isDisabled),cC()])})]}]}},s=t.label.map((function(t){return CT(t,e)})),l=mT.parts.field({factory:{sketch:c}});return wT(s,l,["tox-form__group--stretched"],[])},lD=function(t,e){return{dom:{tag:"div",classes:["tox-form__grid","tox-form__grid--"+t.columns+"col"]},components:G(t.items,e.interpreter)}},fD=oc("alloy-fake-before-tabstop"),dD=oc("alloy-fake-after-tabstop"),hD=function(t){return{dom:{tag:"div",styles:{width:"1px",height:"1px",outline:"none"},attributes:{tabindex:"0"},classes:t},behaviours:hf([Xx.config({ignore:!0}),yT.config({})])}},pD=function(t){return{dom:{tag:"div",classes:["tox-navobj"]},components:[hD([fD]),t,hD([dD])],behaviours:hf([UN.childAt(1)])}},mD=function(t,e){Ou(t,Ia(),{raw:{which:9,shiftKey:e}})},vD=function(t,e){var n=e.element;cs(n,fD)?mD(t,!0):cs(n,dD)&&mD(t,!1)},gD=function(t){return jA(t,["."+fD,"."+dD].join(","),C)},bD=!(en().browser.isIE()||en().browser.isEdge()),yD=function(t){var e=oa("");return{getValue:function(t){return e.get()},setValue:function(n,r){if(t)In(n.element,"srcdoc",r);else{In(n.element,"src","javascript:''");var o=n.element.dom.contentWindow.document;o.open(),o.write(r),o.close()}e.set(r)}}},xD=function(t,e){var n=bD&&t.sandboxed,r=T(T({},t.label.map((function(t){return{title:t}})).getOr({})),n?{sandbox:"allow-scripts allow-same-origin"}:{}),o=yD(n),i=t.label.map((function(t){return CT(t,e)})),a=function(t){return pD({uid:t.uid,dom:{tag:"iframe",attributes:r},behaviours:hf([yT.config({}),Xx.config({}),aD.withComp(j.none(),o.getValue,o.setValue)])})},u=mT.parts.field({factory:{sketch:a}});return wT(i,u,["tox-form__group--stretched"],[])},wD=function(t,e){return kD(document.createElement("canvas"),t,e)},_D=function(t){var e=wD(t.width,t.height),n=OD(e);return n.drawImage(t,0,0),e},OD=function(t){return t.getContext("2d")},kD=function(t,e,n){return t.width=e,t.height=n,t},SD=function(t){return t.naturalWidth||t.width},CD=function(t){return t.naturalHeight||t.height},ED=function(t){return new GT((function(e,n){var r=URL.createObjectURL(t),o=new Image,i=function(){o.removeEventListener("load",a),o.removeEventListener("error",u)},a=function(){i(),e(o)},u=function(){i(),n("Unable to load data of type "+t.type+": "+r)};o.addEventListener("load",a),o.addEventListener("error",u),o.src=r,o.complete&&setTimeout(a,0)}))},AD=function(t){var e=t.split(","),n=/data:([^;]+)/.exec(e[0]);if(!n)return j.none();for(var r=n[1],o=e[1],i=1024,a=atob(o),u=a.length,c=Math.ceil(u/i),s=new Array(c),l=0;ln?r=n:rn?t=n:t2)&&(i=i<.5?.5:2,u=!0),(a<.5||a>2)&&(a=a<.5?.5:2,u=!0);var c=uL(t,i,a);return u?c.then((function(t){return aL(t,e,n)})):c},uL=function(t,e,n){return new GT((function(r){var o=SD(t),i=CD(t),a=Math.floor(o*e),u=Math.floor(i*n),c=wD(a,u),s=OD(c);s.drawImage(t,0,0,o,i,0,0,a,u),r(c)}))},cL=function(t,e){void 0===e&&(e=2);var n=Math.pow(10,e),r=Math.round(t*n);return Math.ceil(r/n)},sL=function(t,e){return t.toCanvas().then((function(n){return lL(n,t.getType(),e)}))},lL=function(t,e,n){var r=n<0?360+n:n,o=r*Math.PI/180,i=t.width,a=t.height,u=Math.sin(o),c=Math.cos(o),s=cL(Math.abs(i*c)+Math.abs(a*u)),l=cL(Math.abs(i*u)+Math.abs(a*c)),f=wD(s,l),d=OD(f);return d.translate(s/2,l/2),d.rotate(o),d.drawImage(t,-i/2,-a/2),HD(f,e)},fL=function(t,e){return t.toCanvas().then((function(n){return dL(n,t.getType(),e)}))},dL=function(t,e,n){var r=wD(t.width,t.height),o=OD(r);return"v"===n?(o.scale(1,-1),o.drawImage(t,0,-r.height)):(o.scale(-1,1),o.drawImage(t,-r.width,0)),HD(r,e)},hL=function(t,e,n,r,o){return t.toCanvas().then((function(i){return pL(i,t.getType(),e,n,r,o)}))},pL=function(t,e,n,r,o,i){var a=wD(o,i),u=OD(a);return u.drawImage(t,-n,-r),HD(a,e)},mL=function(t,e,n){return t.toCanvas().then((function(r){return aL(r,e,n).then((function(e){return HD(e,t.getType())}))}))},vL=function(t){return tL(t)},gL=function(t){return oL(t)},bL=function(t,e){return iL(t,e)},yL=function(t,e,n,r){return rL(t,e,n,r)},xL=function(t,e){return eL(t,e)},wL=function(t,e){return nL(t,e)},_L=function(t,e){return fL(t,e)},OL=function(t,e,n,r,o){return hL(t,e,n,r,o)},kL=function(t,e,n){return mL(t,e,n)},SL=function(t,e){return sL(t,e)},CL=function(t,e,n){return j_(t,{tag:"span",classes:["tox-icon","tox-tbtn__icon-wrap"],behaviours:n},e)},EL=function(t,e){return CL(t,e,[])},AL=function(t,e){return CL(t,e,[Bx.config({})])},TL=function(t,e,n){return{dom:{tag:"span",innerHtml:n.translate(t),classes:[e+"__select-label"]},behaviours:hf([Bx.config({})])}},ML=oc("toolbar.button.execute"),zL=function(t){return Wu((function(e,n){pC(t,e)((function(n){Ou(e,ML,{buttonApi:n}),t.onAction(n)}))}))},PL=(wM={},wM[eu()]=["disabling","alloy.base.behaviour","toggling","toolbar-button-events"],wM),NL=oc("update-menu-text"),DL=oc("update-menu-icon"),LL=function(t,e,n){var r=oa(v),o=t.text.map((function(t){return k_(TL(t,e,n.providers))})),i=t.icon.map((function(t){return k_(AL(t,n.providers.icons))})),a=function(t,e){var n=tv.getValue(t);return Xx.focus(n),Ou(n,"keydown",{raw:e.event.raw}),HM.close(n),j.some(!0)},u=t.role.fold((function(){return{}}),(function(t){return{role:t}})),c=t.tooltip.fold((function(){return{}}),(function(t){var e=n.providers.translate(t);return{title:e,"aria-label":e}})),s=j_("chevron-down",{tag:"div",classes:[e+"__select-chevron"]},n.providers.icons),l=k_(HM.sketch(T(T(T({},t.uid?{uid:t.uid}:{}),u),{dom:{tag:"button",classes:[e,e+"--select"].concat(G(t.classes,(function(t){return e+"--"+t}))),attributes:T({},c)},components:yC([i.map((function(t){return t.asSpec()})),o.map((function(t){return t.asSpec()})),j.some(s)]),matchWidth:!0,useMinWidth:!0,dropdownBehaviours:hf(z(z([],t.dropdownBehaviours,!0),[hC.button((function(){return t.disabled||n.providers.isDisabled()})),cC(),VM.config({}),Bx.config({}),Vx("dropdown-events",[mC(t,r),vC(t,r)]),Vx("menubutton-update-display-text",[Pu(NL,(function(t,e){o.bind((function(e){return e.getOpt(t)})).each((function(t){Bx.set(t,[Os(n.providers.translate(e.event.text))])}))})),Pu(DL,(function(t,e){i.bind((function(e){return e.getOpt(t)})).each((function(t){Bx.set(t,[AL(e.event.icon,n.providers.icons)])}))}))])],!1)),eventOrder:_o(PL,{mousedown:["focusing","alloy.base.behaviour","item-type-events","normal-dropdown-events"]}),sandboxBehaviours:hf([Tx.config({mode:"special",onLeft:a,onRight:a})]),lazySink:n.getSink,toggleClass:e+"--active",parts:{menu:vk(!1,t.columns,t.presets)},fetch:function(e){return tM.nu(O(t.fetch,e))}})));return l.asSpec()},jL=function(t){return i(t)},HL=function(t){return"separator"===t.type},RL=function(t){return Et(t,"getSubmenuItems")},BL={type:"separator"},IL=function(t,e){var n=J(t,(function(t,n){return jL(n)?""===n?t:"|"===n?t.length>0&&!HL(t[t.length-1])?t.concat([BL]):t:Et(e,n.toLowerCase())?t.concat([e[n.toLowerCase()]]):t:t.concat([n])}),[]);return n.length>0&&HL(n[n.length-1])&&n.pop(),n},VL=function(t,e){var n=t.getSubmenuItems(),r=UL(n,e),o=_o(r.menus,ha(t.value,r.items)),i=_o(r.expansions,ha(t.value,t.value));return{item:t,menus:o,expansions:i}},FL=function(t,e){return RL(t)?VL(t,e):{item:t,menus:{},expansions:{}}},qL=function(t){if(HL(t))return t;var e=Ct(t,"value").getOrThunk((function(){return oc("generated-menu-item")}));return _o({value:e},t)},UL=function(t,e){var n=IL(i(t)?t.split(" "):t,e);return Z(n,(function(t,n){var r=qL(n),o=FL(r,e);return{menus:_o(t.menus,o.menus),items:[o.item].concat(t.items),expansions:_o(t.expansions,o.expansions)}}),{menus:{},expansions:{},items:[]})},WL=function(t,e,n,r){var o=oc("primary-menu"),i=UL(t,n.shared.providers.menuItems());if(0===i.items.length)return j.none();var a=zA(o,i.items,e,n,r),u=bt(i.menus,(function(t,r){return zA(r,t,e,n,!1)})),c=_o(u,ha(o,a));return j.from(Jw.tieredData(o,c,i.expansions))},GL=function(t){return{isDisabled:function(){return Hg.isDisabled(t)},setDisabled:function(e){return Hg.set(t,e)},setActive:function(e){var n=t.element;e?(is(n,"tox-tbtn--enabled"),In(n,"aria-pressed",!0)):(us(n,"tox-tbtn--enabled"),Wn(n,"aria-pressed"))},isActive:function(){return cs(t.element,"tox-tbtn--enabled")}}},$L=function(t,e,n,r){return LL({text:t.text,icon:t.icon,tooltip:t.tooltip,role:r,fetch:function(e,r){t.fetch((function(t){r(WL(t,qO.CLOSE_ON_EXECUTE,n,!1))}))},onSetup:t.onSetup,getApi:GL,columns:1,presets:"normal",classes:[],dropdownBehaviours:[yT.config({})]},e,n.shared)},KL=function(t,e,n){var r=function(t){return function(r){var o=!r.isActive();r.setActive(o),t.storage.set(o),n.shared.getSink().each((function(n){e().getOpt(n).each((function(e){Of(e.element),Ou(e,MT,{name:t.name,value:t.storage.get()})}))}))}},o=function(t){return function(e){e.setActive(t.storage.get())}};return function(e){e(G(t,(function(t){var e=t.text.fold((function(){return{}}),(function(t){return{text:t}}));return T(T({type:t.type,active:!1},e),{onAction:r(t),onSetup:o(t)})})))}},YL=function(t,e,n,r,o,i){void 0===n&&(n=[]);var a=e.fold((function(){return{}}),(function(t){return{action:t}})),u=T({buttonBehaviours:hf([hC.button((function(){return t.disabled||i.isDisabled()})),cC(),yT.config({}),Vx("button press",[zu("click"),zu("mousedown")])].concat(n)),eventOrder:{click:["button press","alloy.base.behaviour"],mousedown:["button press","alloy.base.behaviour"]}},a),c=_o(u,{dom:r});return _o(c,{components:o})},XL=function(t,e,n,r){void 0===r&&(r=[]);var o=t.tooltip.map((function(t){return{"aria-label":n.translate(t),title:n.translate(t)}})).getOr({}),i={tag:"button",classes:["tox-tbtn"],attributes:o},a=t.icon.map((function(t){return EL(t,n.icons)})),u=yC([a]);return YL(t,e,r,i,u,n)},ZL=function(t,e,n,r){void 0===r&&(r=[]);var o=XL(t,j.some(e),n,r);return O_.sketch(o)},JL=function(t,e,n,r,o){void 0===r&&(r=[]),void 0===o&&(o=[]);var i=n.translate(t.text),a=t.icon?t.icon.map((function(t){return EL(t,n.icons)})):j.none(),u=a.isSome()?yC([a]):[],c=a.isSome()?{}:{innerHtml:i},s=z(z(z(z([],t.primary||t.borderless?["tox-button"]:["tox-button","tox-button--secondary"],!0),a.isSome()?["tox-button--icon"]:[],!0),t.borderless?["tox-button--naked"]:[],!0),o,!0),l=T(T({tag:"button",classes:s},c),{attributes:{title:i}});return YL(t,e,r,l,u,n)},QL=function(t,e,n,r,o){void 0===r&&(r=[]),void 0===o&&(o=[]);var i=JL(t,j.some(e),n,r,o);return O_.sketch(i)},tj=function(t,e){return function(n){"custom"===e?Ou(n,MT,{name:t,value:{}}):"submit"===e?_u(n,zT):"cancel"===e?_u(n,TT):console.error("Unknown button type: ",e)}},ej=function(t,e){return"menu"===e},nj=function(t,e){return"custom"===e||"cancel"===e||"submit"===e},rj=function(t,e,n){if(ej(t,e)){var r=function(){return a},o=t,i=T(T({},t),{onSetup:function(e){return e.setDisabled(t.disabled),v},fetch:KL(o.items,r,n)}),a=k_($L(i,"tox-tbtn",n,j.none()));return a.asSpec()}if(nj(t,e)){var u=tj(t.name,e),c=T(T({},t),{borderless:!1});return QL(c,u,n.shared.providers,[])}console.error("Unknown footer button type: ",e)},oj=function(t,e){var n=tj(t.name,"custom");return _T(j.none(),mT.parts.field(T({factory:O_},JL(t,j.some(n),e,[aD.memory(""),UN.self()]))))},ij=x([Ki("field1Name","field1"),Ki("field2Name","field2"),sl("onLockedChange"),il(["lockClass"]),Ki("locked",!1),ov.field("coupledFieldBehaviours",[bg,tv])]),aj=function(t,e,n){return Kv(t,e,n).bind(bg.getCurrent)},uj=function(t,e){return Nv({factory:mT,name:t,overrides:function(t){return{fieldBehaviours:hf([Vx("coupled-input-behaviour",[Pu(Fa(),(function(n){aj(n,t,e).each((function(e){Kv(n,t,"lock").each((function(r){mw.isOn(r)&&t.onLockedChange(n,e,r)}))}))}))])])}}})},cj=x([uj("field1","field2"),uj("field2","field1"),Nv({factory:O_,schema:[Ti("dom")],name:"lock",overrides:function(t){return{buttonBehaviours:hf([mw.config({selected:t.locked,toggleClass:t.markers.lockClass,aria:{mode:"pressed"}})])}}})]),sj=function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,behaviours:ov.augment(t.coupledFieldBehaviours,[bg.config({find:j.some}),tv.config({store:{mode:"manual",getValue:function(e){var n,r=Qv(e,t,["field1","field2"]);return n={},n[t.field1Name]=tv.getValue(r.field1()),n[t.field2Name]=tv.getValue(r.field2()),n},setValue:function(e,n){var r=Qv(e,t,["field1","field2"]);At(n,t.field1Name)&&tv.setValue(r.field1(),n[t.field1Name]),At(n,t.field2Name)&&tv.setValue(r.field2(),n[t.field2Name])}}})]),apis:{getField1:function(e){return Kv(e,t,"field1")},getField2:function(e){return Kv(e,t,"field2")},getLock:function(e){return Kv(e,t,"lock")}}}},lj=hg({name:"FormCoupledInputs",configFields:ij(),partFields:cj(),factory:sj,apis:{getField1:function(t,e){return t.getField1(e)},getField2:function(t,e){return t.getField2(e)},getLock:function(t,e){return t.getLock(e)}}}),fj=function(t){var e={"":0,px:0,pt:1,mm:1,pc:2,ex:2,em:2,ch:2,rem:2,cm:3,in:4,"%":4},n=function(t){return t in e?e[t]:1},r=t.value.toFixed(n(t.unit));return-1!==r.indexOf(".")&&(r=r.replace(/\.?0*$/,"")),r+t.unit},dj=function(t){var e=/^\s*(\d+(?:\.\d+)?)\s*(|cm|mm|in|px|pt|pc|em|ex|ch|rem|vw|vh|vmin|vmax|%)\s*$/,n=e.exec(t);if(null!==n){var r=parseFloat(n[1]),o=n[2];return ro.value({value:r,unit:o})}return ro.error(t)},hj=function(t,e){var n={"":96,px:96,pt:72,cm:2.54,pc:12,mm:25.4,in:1},r=function(t){return Et(n,t)};return t.unit===e?j.some(t.value):r(t.unit)&&r(e)?n[t.unit]===n[e]?j.some(t.value):j.some(t.value/n[t.unit]*n[e]):j.none()},pj=function(t){return j.none()},mj=function(t,e){return function(n){return hj(n,e).map((function(n){return{value:n*t,unit:e}}))}},vj=function(t,e){var n=dj(t).toOptional(),r=dj(e).toOptional();return Nt(n,r,(function(t,e){return hj(t,e.unit).map((function(t){return e.value/t})).map((function(t){return mj(t,e.unit)})).getOr(pj)})).getOr(pj)},gj=function(t,e){var n=pj,r=oc("ratio-event"),o=function(t){return j_(t,{tag:"span",classes:["tox-icon","tox-lock-icon__"+t]},e.icons)},i=lj.parts.lock({dom:{tag:"button",classes:["tox-lock","tox-button","tox-button--naked","tox-button--icon"],attributes:{title:e.translate(t.label.getOr("Constrain proportions"))}},components:[o("lock"),o("unlock")],buttonBehaviours:hf([Hg.config({disabled:function(){return t.disabled||e.isDisabled()}}),cC(),yT.config({})])}),a=function(t){return{dom:{tag:"div",classes:["tox-form__group"]},components:t}},u=function(n){return mT.parts.field({factory:FT,inputClasses:["tox-textfield"],inputBehaviours:hf([Hg.config({disabled:function(){return t.disabled||e.isDisabled()}}),cC(),yT.config({}),Vx("size-input-events",[Pu(Ra(),(function(t,e){Ou(t,r,{isField1:n})})),Pu(qa(),(function(e,n){Ou(e,ET,{name:t.name})}))])]),selectOnFocus:!1})},c=function(t){return{dom:{tag:"label",classes:["tox-label"],innerHtml:e.translate(t)}}},s=lj.parts.field1(a([mT.parts.label(c("Width")),u(!0)])),l=lj.parts.field2(a([mT.parts.label(c("Height")),u(!1)]));return lj.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:[{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:[s,l,a([c(" "),i])]}],field1Name:"width",field2Name:"height",locked:!0,markers:{lockClass:"tox-locked"},onLockedChange:function(t,e,r){dj(tv.getValue(t)).each((function(t){n(t).each((function(t){tv.setValue(e,fj(t))}))}))},coupledFieldBehaviours:hf([Hg.config({disabled:function(){return t.disabled||e.isDisabled()},onDisabled:function(t){lj.getField1(t).bind(mT.getField).each(Hg.disable),lj.getField2(t).bind(mT.getField).each(Hg.disable),lj.getLock(t).each(Hg.disable)},onEnabled:function(t){lj.getField1(t).bind(mT.getField).each(Hg.enable),lj.getField2(t).bind(mT.getField).each(Hg.enable),lj.getLock(t).each(Hg.enable)}}),cC(),Vx("size-input-events2",[Pu(r,(function(t,e){var r=e.event.isField1,o=r?lj.getField1(t):lj.getField2(t),i=r?lj.getField2(t):lj.getField1(t),a=o.map(tv.getValue).getOr(""),u=i.map(tv.getValue).getOr("");n=vj(a,u)}))])])})},bj=x(oc("undo")),yj=x(oc("redo")),xj=x(oc("zoom")),wj=x(oc("back")),_j=x(oc("apply")),Oj=x(oc("swap")),kj=x(oc("transform")),Sj=x(oc("temp-transform")),Cj=x(oc("transform-apply")),Ej={undo:bj,redo:yj,zoom:xj,back:wj,apply:_j,swap:Oj,transform:kj,tempTransform:Sj,transformApply:Cj},Aj=x("save-state"),Tj=x("disable"),Mj=x("enable"),zj={formActionEvent:MT,saveState:Aj,disable:Tj,enable:Mj},Pj=function(t,e){var n=function(t,n,r,o){return k_(QL({name:t,text:t,disabled:r,primary:o,icon:j.none(),borderless:!1},n,e))},r=function(t,n,r,o){return k_(ZL({name:t,icon:j.some(t),tooltip:j.some(n),disabled:o,primary:!1,borderless:!1},r,e))},o=function(t,e){t.map((function(t){var n=t.get(e);n.hasConfigured(Hg)&&Hg.disable(n)}))},i=function(t,e){t.map((function(t){var n=t.get(e);n.hasConfigured(Hg)&&Hg.enable(n)}))},a={tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools-edit-panel"]},u=v,c=function(t,e,n){Ou(t,e,n)},s=function(t){return _u(t,zj.disable())},l=function(t){return _u(t,zj.enable())},f=function(t,e){s(t),c(t,Ej.transform(),{transform:e}),l(t)},d=function(t,e){s(t),c(t,Ej.tempTransform(),{transform:e}),l(t)},h=function(t){return function(){at.getOpt(t).each((function(t){Bx.set(t,[ot])}))}},p=function(t,e){s(t),c(t,Ej.transformApply(),{transform:e,swap:h(t)}),l(t)},m=function(){return n("Back",(function(t){return c(t,Ej.back(),{swap:h(t)})}),!1,!1)},g=function(){return k_({dom:{tag:"div",classes:["tox-spacer"]},behaviours:hf([Hg.config({})])})},b=function(){return n("Apply",(function(t){return c(t,Ej.apply(),{swap:h(t)})}),!0,!0)},y=function(){return function(e){var n=t.getRect();return OL(e,n.x,n.y,n.w,n.h)}},w=[m(),g(),n("Apply",(function(e){var n=y();p(e,n),t.hideCrop()}),!1,!0)],_=sT.sketch({dom:a,components:w.map((function(t){return t.asSpec()})),containerBehaviours:hf([Vx("image-tools-crop-buttons-events",[Pu(zj.disable(),(function(t,e){o(w,t)})),Pu(zj.enable(),(function(t,e){i(w,t)}))])])}),O=k_(gj({name:"size",label:j.none(),constrain:!0,disabled:!1},e)),k=function(t,e){return function(n){return kL(n,t,e)}},S=[m(),g(),O,g(),n("Apply",(function(t){O.getOpt(t).each((function(e){var n=tv.getValue(e),r=parseInt(n.width,10),o=parseInt(n.height,10),i=k(r,o);p(t,i)}))}),!1,!0)],C=sT.sketch({dom:a,components:S.map((function(t){return t.asSpec()})),containerBehaviours:hf([Vx("image-tools-resize-buttons-events",[Pu(zj.disable(),(function(t,e){o(S,t)})),Pu(zj.enable(),(function(t,e){i(S,t)}))])])}),E=function(t,e){return function(n){return t(n,e)}},A=E(_L,"h"),T=E(_L,"v"),M=E(SL,-90),z=E(SL,90),P=function(t,e){d(t,e)},N=[m(),g(),r("flip-horizontally","Flip horizontally",(function(t){P(t,A)}),!1),r("flip-vertically","Flip vertically",(function(t){P(t,T)}),!1),r("rotate-left","Rotate counterclockwise",(function(t){P(t,M)}),!1),r("rotate-right","Rotate clockwise",(function(t){P(t,z)}),!1),g(),b()],D=sT.sketch({dom:a,components:N.map((function(t){return t.asSpec()})),containerBehaviours:hf([Vx("image-tools-fliprotate-buttons-events",[Pu(zj.disable(),(function(t,e){o(N,t)})),Pu(zj.enable(),(function(t,e){i(N,t)}))])])}),L=function(t,n,r,o,i){var a=_N.parts.label({dom:{tag:"label",classes:["tox-label"],innerHtml:e.translate(t)}}),u=_N.parts.spectrum({dom:{tag:"div",classes:["tox-slider__rail"],attributes:{role:"presentation"}}}),c=_N.parts.thumb({dom:{tag:"div",classes:["tox-slider__handle"],attributes:{role:"presentation"}}});return k_(_N.sketch({dom:{tag:"div",classes:["tox-slider"],attributes:{role:"presentation"}},model:{mode:"x",minX:r,maxX:i,getInitialValue:x({x:o})},components:[a,u,c],sliderBehaviours:hf([Xx.config({})]),onChoose:n}))},H=function(t,e,n,r,o){var i=function(t,n,r){var o=E(e,r.x/100);f(t,o)};return L(t,i,n,r,o)},R=function(t,e,n,r,o){return[m(),H(t,e,n,r,o),b()]},B=function(t,e,n,r,u){var c=R(t,e,n,r,u);return sT.sketch({dom:a,components:c.map((function(t){return t.asSpec()})),containerBehaviours:hf([Vx("image-tools-filter-panel-buttons-events",[Pu(zj.disable(),(function(t,e){o(c,t)})),Pu(zj.enable(),(function(t,e){i(c,t)}))])])})},I=[m(),g(),b()],V=sT.sketch({dom:a,components:I.map((function(t){return t.asSpec()}))}),F=B("Brightness",xL,-100,0,100),q=B("Contrast",wL,-100,0,100),U=B("Gamma",bL,-100,0,100),W=function(t,e,n){return function(r){return yL(r,t,e,n)}},G=function(t){var e=function(t,e,n){var r=$.getOpt(t),o=Y.getOpt(t),i=K.getOpt(t);r.each((function(e){o.each((function(n){i.each((function(r){var o=tv.getValue(e).x/100,i=tv.getValue(r).x/100,a=tv.getValue(n).x/100,u=W(o,i,a);f(t,u)}))}))}))};return L(t,e,0,100,200)},$=G("R"),K=G("G"),Y=G("B"),X=[m(),$,K,Y,b()],Z=sT.sketch({dom:a,components:X.map((function(t){return t.asSpec()}))}),J=function(t,e,n){return function(r){var o=function(){at.getOpt(r).each((function(e){Bx.set(e,[t]),n(e)}))};c(r,Ej.swap(),{transform:e,swap:o})}},Q=function(e){t.showCrop()},tt=function(e){O.getOpt(e).each((function(e){var n=t.getMeasurements(),r=n.width,o=n.height;tv.setValue(e,{width:r,height:o})}))},et=j.some(gL),nt=j.some(vL),rt=[r("crop","Crop",J(_,j.none(),Q),!1),r("resize","Resize",J(C,j.none(),tt),!1),r("orientation","Orientation",J(D,j.none(),u),!1),r("brightness","Brightness",J(F,j.none(),u),!1),r("sharpen","Sharpen",J(V,et,u),!1),r("contrast","Contrast",J(q,j.none(),u),!1),r("color-levels","Color levels",J(Z,j.none(),u),!1),r("gamma","Gamma",J(U,j.none(),u),!1),r("invert","Invert",J(V,nt,u),!1)],ot=sT.sketch({dom:a,components:rt.map((function(t){return t.asSpec()}))}),it=sT.sketch({dom:{tag:"div"},components:[ot],containerBehaviours:hf([Bx.config({})])}),at=k_(it),ut=function(t){return at.getOpt(t).map((function(t){var e=t.components()[0];return e.components()[e.components().length-1]}))};return{memContainer:at,getApplyButton:ut}},Nj=tinymce.util.Tools.resolve("tinymce.geom.Rect"),Dj=tinymce.util.Tools.resolve("tinymce.util.Observable"),Lj=tinymce.util.Tools.resolve("tinymce.util.VK"),jj=function(t){var e=Math.max,n=t.documentElement,r=t.body,o=e(n.scrollWidth,r.scrollWidth),i=e(n.clientWidth,r.clientWidth),a=e(n.offsetWidth,r.offsetWidth),u=e(n.scrollHeight,r.scrollHeight),c=e(n.clientHeight,r.clientHeight),s=e(n.offsetHeight,r.offsetHeight);return{width:o=1?n.set(1):n.set(u)}))},c=function(t,e){var n=ee.fromTag("img");return In(n,"src",e),qj(n.dom).then((function(){t.getSystem().isConnected()&&p.getOpt(t).map((function(t){var e=ks({element:n});Bx.replaceAt(t,1,j.some(e));var r=i.get(),c={x:0,y:0,w:n.dom.naturalWidth,h:n.dom.naturalHeight};i.set(c);var s=Nj.inflate(c,-20,-20);o.set(s),r.w===c.w&&r.h===c.h||u(t,n),a(t,n)}))}))},s=function(t,e){var r=n.get(),o=e>0?Math.min(2,r+.1):Math.max(.1,r-.1);n.set(o),p.getOpt(t).each((function(t){var e=t.components()[1].element;a(t,e)}))},l=function(){r.run((function(t){t.toggleVisibility(!0)}))},f=function(){r.run((function(t){t.toggleVisibility(!1)}))},d=function(){return o.get()},h=sT.sketch({dom:{tag:"div",classes:["tox-image-tools__image"]},components:[e.asSpec(),{dom:{tag:"img",attributes:{src:t}}},{dom:{tag:"div"},behaviours:hf([Vx("image-panel-crop-events",[Fu((function(t){p.getOpt(t).each((function(t){var e=t.element.dom,i=Fj.create({x:10,y:10,w:100,h:100},{x:0,y:0,w:200,h:200},{x:0,y:0,w:200,h:200},e,v);i.toggleVisibility(!1),i.on("updateRect",(function(t){var e=t.rect,r=n.get(),i={x:Math.round(e.x/r),y:Math.round(e.y/r),w:Math.round(e.w/r),h:Math.round(e.h/r)};o.set(i)})),r.set(i)}))})),qu((function(){r.clear()}))])])}],containerBehaviours:hf([Bx.config({}),Vx("image-panel-events",[Fu((function(e){c(e,t)}))])])}),p=k_(h),m=function(){var t=i.get();return{width:t.w,height:t.h}};return{memContainer:p,updateSrc:c,zoom:s,showCrop:l,hideCrop:f,getRect:d,getMeasurements:m}},Wj=function(t,e,n,r,o){return ZL({name:t,icon:j.some(e),disabled:n,tooltip:j.some(t),primary:!1,borderless:!1},r,o)},Gj=function(t,e){e?Hg.enable(t):Hg.disable(t)},$j=function(t){var e=function(t,e,o){n.getOpt(t).each((function(t){Gj(t,e)})),r.getOpt(t).each((function(t){Gj(t,o)}))},n=k_(Wj("Undo","undo",!0,(function(t){Ou(t,Ej.undo(),{direction:1})}),t)),r=k_(Wj("Redo","redo",!0,(function(t){Ou(t,Ej.redo(),{direction:1})}),t)),o=sT.sketch({dom:{tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools__sidebar"]},components:[n.asSpec(),r.asSpec(),Wj("Zoom in","zoom-in",!1,(function(t){Ou(t,Ej.zoom(),{direction:1})}),t),Wj("Zoom out","zoom-out",!1,(function(t){Ou(t,Ej.zoom(),{direction:-1})}),t)]});return{container:o,updateButtonUndoStates:e}};function Kj(){var t=[],e=-1,n=function(n){var r=t.splice(++e);return t.push(n),{state:n,removed:r}},r=function(){if(i())return t[--e]},o=function(){if(a())return t[++e]},i=function(){return e>0},a=function(){return-1!==e&&e1?j.none():j.some(j_("chevron-down",{tag:"div",classes:["tox-selectfield__icon-js"]},e.icons)),a={dom:{tag:"div",classes:["tox-selectfield"]},components:nt([[o],i.toArray()])};return mT.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:nt([r.toArray(),[a]]),fieldBehaviours:hf([Hg.config({disabled:function(){return t.disabled||e.isDisabled()},onDisabled:function(t){mT.getField(t).each(Hg.disable)},onEnabled:function(t){mT.getField(t).each(Hg.enable)}}),cC()])})},cH=function(t,e){var n=function(t){return{dom:{tag:"th",innerHtml:e.translate(t)}}},r=function(t){return{dom:{tag:"thead"},components:[{dom:{tag:"tr"},components:G(t,n)}]}},o=function(t){return{dom:{tag:"td",innerHtml:e.translate(t)}}},i=function(t){return{dom:{tag:"tr"},components:G(t,o)}},a=function(t){return{dom:{tag:"tbody"},components:G(t,i)}};return{dom:{tag:"table",classes:["tox-dialog__table"]},components:[r(t.header),a(t.cells)],behaviours:hf([yT.config({}),Xx.config({})])}},sH=function(t,e){var n=t.label.map((function(t){return CT(t,e)})),r=[Hg.config({disabled:function(){return t.disabled||e.isDisabled()}}),cC(),Tx.config({mode:"execution",useEnter:!0!==t.multiline,useControlEnter:!0===t.multiline,execute:function(t){return _u(t,zT),j.some(!0)}}),Vx("textfield-change",[Pu(Fa(),(function(e,n){Ou(e,ET,{name:t.name})})),Pu(Qa(),(function(e,n){Ou(e,ET,{name:t.name})}))]),yT.config({})],o=t.validation.map((function(t){return dM.config({getRoot:function(t){return gn(t.element)},invalidClass:"tox-invalid",validator:{validate:function(e){var n=tv.getValue(e),r=t.validator(n);return tM.pure(!0===r?ro.value(n):ro.error(r))},validateOnLoad:t.validateOnLoad}})})).toArray(),i=t.placeholder.fold(x({}),(function(t){return{placeholder:e.translate(t)}})),a=t.inputMode.fold(x({}),(function(t){return{inputmode:t}})),u=T(T({},i),a),c=mT.parts.field({tag:!0===t.multiline?"textarea":"input",inputAttributes:u,inputClasses:[t.classname],inputBehaviours:hf(nt([r,o])),selectOnFocus:!1,factory:FT}),s=t.flex?["tox-form__group--stretched"]:[],l=s.concat(t.maximized?["tox-form-group--maximize"]:[]),f=[Hg.config({disabled:function(){return t.disabled||e.isDisabled()},onDisabled:function(t){mT.getField(t).each(Hg.disable)},onEnabled:function(t){mT.getField(t).each(Hg.enable)}}),cC()];return wT(n,c,l,f)},lH=function(t,e){return sH({name:t.name,multiline:!1,label:t.label,inputMode:t.inputMode,placeholder:t.placeholder,flex:!1,disabled:t.disabled,classname:"tox-textfield",validation:j.none(),maximized:t.maximized},e)},fH=function(t,e){return sH({name:t.name,multiline:!0,label:t.label,inputMode:j.none(),placeholder:t.placeholder,flex:!0,disabled:t.disabled,classname:"tox-textarea",validation:j.none(),maximized:t.maximized},e)},dH=function(t,e){var n=t.stream.streams,r=n.setup(t,e);return Au([Pu(t.event,r),qu((function(){return e.cancel()}))].concat(t.cancelEvent.map((function(t){return[Pu(t,(function(){return e.cancel()}))]})).getOr([])))},hH=Object.freeze({__proto__:null,events:dH}),pH=function(t){var e=oa(null),n=function(){return{timer:null!==e.get()?"set":"unset"}},r=function(t){e.set(t)},o=function(){var t=e.get();null!==t&&t.cancel()};return Sc({readState:n,setTimer:r,cancel:o})},mH=function(t){return t.stream.streams.state(t)},vH=Object.freeze({__proto__:null,throttle:pH,init:mH}),gH=function(t,e){var n=t.stream,r=U_(t.onStream,n.delay);return e.setTimer(r),function(t,e){r.throttle(t,e),n.stopEvent&&e.stop()}},bH=[Mi("stream",ki("mode",{throttle:[Ti("delay"),Ki("stopEvent",!0),fl("streams",{setup:gH,state:pH})]})),Ki("event","input"),Ii("cancelEvent"),sl("onStream")],yH=mf({fields:bH,name:"streaming",active:hH,state:vH}),xH=function(t,e,n){var r=tv.getValue(n);tv.setValue(e,r),_H(e)},wH=function(t,e){var n=t.element,r=ds(n),o=n.dom;"number"!==Fn(n,"type")&&e(o,r)},_H=function(t){wH(t,(function(t,e){return t.setSelectionRange(e.length,e.length)}))},OH=function(t,e){wH(t,(function(t,n){return t.setSelectionRange(e,n.length)}))},kH=function(t,e,n){if(t.selectsOver){var r=tv.getValue(e),o=t.getDisplayText(r),i=tv.getValue(n),a=t.getDisplayText(i);return 0===a.indexOf(o)?j.some((function(){xH(t,e,n),OH(e,o.length)})):j.none()}return j.none()},SH=x("alloy.typeahead.itemexecute"),CH=function(t,e,n,r){var o=function(e,n,o){t.previewing.set(!1);var i=bM.getCoupled(e,"sandbox");if(bm.isOpen(i))bg.getCurrent(i).each((function(t){rb.getHighlighted(t).fold((function(){o(t)}),(function(){Eu(i,t.element,"keydown",n)}))}));else{var u=function(t){bg.getCurrent(t).each(o)};SM(t,a(e),e,i,r,u,WT.HighlightFirst).get(v)}},i=RT(t),a=function(t){return function(e){return e.map((function(e){var n=St(e.menus),r=rt(n,(function(t){return X(t.items,(function(t){return"item"===t.type}))})),o=tv.getState(t);return o.update(G(r,(function(t){return t.data}))),e}))}},u=[Xx.config({}),tv.config({onSetValue:t.onSetValue,store:T({mode:"dataset",getDataKey:function(t){return ds(t.element)},getFallbackEntry:function(t){return{value:t,meta:{}}},setValue:function(e,n){hs(e.element,t.model.getDisplayText(n))}},t.initialData.map((function(t){return ha("initialValue",t)})).getOr({}))}),yH.config({stream:{mode:"throttle",delay:t.responseTime,stopEvent:!1},onStream:function(e,n){var o=bM.getCoupled(e,"sandbox"),i=Xx.isFocused(e);if(i&&ds(e.element).length>=t.minChars){var u=bg.getCurrent(o).bind((function(t){return rb.getHighlighted(t).map(tv.getValue)}));t.previewing.set(!0);var c=function(e){bg.getCurrent(o).each((function(e){u.fold((function(){t.model.selectsOver&&rb.highlightFirst(e)}),(function(t){rb.highlightBy(e,(function(e){var n=tv.getValue(e);return n.value===t.value})),rb.getHighlighted(e).orThunk((function(){return rb.highlightFirst(e),j.none()}))}))}))};SM(t,a(e),e,o,r,c,WT.HighlightFirst).get(v)}},cancelEvent:au()}),Tx.config({mode:"special",onDown:function(t,e){return o(t,e,rb.highlightFirst),j.some(!0)},onEscape:function(t){var e=bM.getCoupled(t,"sandbox");return bm.isOpen(e)?(bm.close(e),j.some(!0)):j.none()},onUp:function(t,e){return o(t,e,rb.highlightLast),j.some(!0)},onEnter:function(e){var n=bM.getCoupled(e,"sandbox"),r=bm.isOpen(n);if(r&&!t.previewing.get())return bg.getCurrent(n).bind((function(t){return rb.getHighlighted(t)})).map((function(t){return Ou(e,SH(),{item:t}),!0}));var o=tv.getValue(e);return _u(e,au()),t.onExecute(n,e,o),r&&bm.close(n),j.some(!0)}}),mw.config({toggleClass:t.markers.openClass,aria:{mode:"expanded"}}),bM.config({others:{sandbox:function(e){return zM(t,e,{onOpen:function(){return mw.on(e)},onClose:function(){return mw.off(e)}})}}}),Vx("typeaheadevents",[Wu((function(e){var n=v;EM(t,a(e),e,r,n,WT.HighlightFirst).get(v)})),Pu(SH(),(function(e,n){var r=bM.getCoupled(e,"sandbox");xH(t.model,e,n.event.item),_u(e,au()),t.onItemExecute(e,r,n.event.item,tv.getValue(e)),bm.close(r),_H(e)}))].concat(t.dismissOnBlur?[Pu(Ja(),(function(t){var e=bM.getCoupled(t,"sandbox");Ef(e.element).isNone()&&bm.close(e)}))]:[]))];return{uid:t.uid,dom:IT(_o(t,{inputAttributes:{role:"combobox","aria-autocomplete":"list","aria-haspopup":"true"}})),behaviours:T(T({},i),rv(t.typeaheadBehaviours,u)),eventOrder:t.eventOrder}},EH=x([Ii("lazySink"),Ti("fetch"),Ki("minChars",5),Ki("responseTime",1e3),ul("onOpen"),Ki("getHotspot",j.some),Ki("getAnchorOverrides",x({})),Ki("layouts",j.none()),Ki("eventOrder",{}),ra("model",{},[Ki("getDisplayText",(function(t){return void 0!==t.meta&&void 0!==t.meta.text?t.meta.text:t.value})),Ki("selectsOver",!0),Ki("populateFromBrowse",!0)]),ul("onSetValue"),cl("onExecute"),ul("onItemExecute"),Ki("inputClasses",[]),Ki("inputAttributes",{}),Ki("inputStyles",{}),Ki("matchWidth",!0),Ki("useMinWidth",!1),Ki("dismissOnBlur",!0),il(["openClass"]),Ii("initialData"),ev("typeaheadBehaviours",[Xx,tv,yH,Tx,mw,bM]),Ei("previewing",(function(){return oa(!0)}))].concat(HT()).concat(NM())),AH=x([Dv({schema:[ol()],name:"menu",overrides:function(t){return{fakeFocus:!0,onHighlight:function(e,n){t.previewing.get()?e.getSystem().getByUid(t.uid).each((function(r){kH(t.model,r,n).fold((function(){return rb.dehighlight(e,n)}),(function(t){return t()}))})):e.getSystem().getByUid(t.uid).each((function(e){t.model.populateFromBrowse&&xH(t.model,e,n)})),t.previewing.set(!1)},onExecute:function(e,n){return e.getSystem().getByUid(t.uid).toOptional().map((function(t){return Ou(t,SH(),{item:n}),!0}))},onHover:function(e,n){t.previewing.set(!1),e.getSystem().getByUid(t.uid).each((function(e){t.model.populateFromBrowse&&xH(t.model,e,n)}))}}}})]),TH=hg({name:"Typeahead",configFields:EH(),partFields:AH(),factory:CH}),MH=function(t){var e=function(){return MH(t.toCached())},n=function(e){return MH(t.bind((function(t){return t.fold((function(t){return tM.pure(ro.error(t))}),(function(t){return e(t)}))})))},r=function(e){return MH(t.map((function(t){return t.bind(e)})))},o=function(e){return MH(t.map((function(t){return t.map(e)})))},i=function(e){return MH(t.map((function(t){return t.mapError(e)})))},a=function(e,n){return t.map((function(t){return t.fold(e,n)}))},u=function(e,n){return MH(tM.nu((function(r){var o=!1,i=setTimeout((function(){o=!0,r(ro.error(n()))}),e);t.get((function(t){o||(clearTimeout(i),r(t))}))})))};return T(T({},t),{toCached:e,bindFuture:n,bindResult:r,mapResult:o,mapError:i,foldResult:a,withTimeout:u})},zH=function(t){return MH(tM.nu(t))},PH=function(t){return MH(tM.pure(ro.value(t)))},NH=function(t){return MH(tM.pure(ro.error(t)))},DH=function(t){return MH(tM.pure(t))},LH=function(t){return MH(t.map(ro.value))},jH=function(t){return zH((function(e){t.then((function(t){e(ro.value(t))}),(function(t){e(ro.error(t))}))}))},HH={nu:zH,wrap:MH,pure:PH,value:PH,error:NH,fromResult:DH,fromFuture:LH,fromPromise:jH},RH={type:"separator"},BH=function(t){return{type:"menuitem",value:t.url,text:t.title,meta:{attach:t.attach},onAction:v}},IH=function(t,e){return{type:"menuitem",value:e,text:t,meta:{attach:void 0},onAction:v}},VH=function(t){return G(t,BH)},FH=function(t,e){return X(e,(function(e){return e.type===t}))},qH=function(t,e){return VH(FH(t,e))},UH=function(t){return qH("header",t.targets)},WH=function(t){return qH("anchor",t.targets)},GH=function(t){return j.from(t.anchorTop).map((function(t){return IH("",t)})).toArray()},$H=function(t){return j.from(t.anchorBottom).map((function(t){return IH("",t)})).toArray()},KH=function(t){return G(t,(function(t){return IH(t,t)}))},YH=function(t){return J(t,(function(t,e){var n=0===t.length||0===e.length;return n?t.concat(e):t.concat(RH,e)}),[])},XH=function(t,e){var n=t.toLowerCase();return X(e,(function(t){var e=void 0!==t.meta&&void 0!==t.meta.text?t.meta.text:t.text;return Ft(e.toLowerCase(),n)||Ft(t.value.toLowerCase(),n)}))},ZH=function(t,e,n){var r=tv.getValue(e),o=void 0!==r.meta.text?r.meta.text:r.value,i=n.getLinkInformation();return i.fold((function(){return[]}),(function(e){var r=XH(o,KH(n.getHistory(t)));return"file"===t?YH([r,XH(o,UH(e)),XH(o,nt([GH(e),WH(e),$H(e)]))]):r}))},JH=oc("aria-invalid"),QH=function(t,e,n){var r,o=e.shared.providers,i=function(e){var r=tv.getValue(e);n.addToHistory(r.value,t.filetype)},a=mT.parts.field({factory:TH,dismissOnBlur:!0,inputClasses:["tox-textfield"],sandboxClasses:["tox-dialog__popups"],inputAttributes:{"aria-errormessage":JH,type:"url"},minChars:0,responseTime:0,fetch:function(r){var o=ZH(t.filetype,r,n),i=WL(o,qO.BUBBLE_TO_SANDBOX,e,!1);return tM.pure(i)},getHotspot:function(t){return h.getOpt(t)},onSetValue:function(t,e){t.hasConfigured(dM)&&dM.run(t).get(v)},typeaheadBehaviours:hf(nt([n.getValidationHandler().map((function(e){return dM.config({getRoot:function(t){return gn(t.element)},invalidClass:"tox-control-wrap--status-invalid",notify:{onInvalid:function(t,e){s.getOpt(t).each((function(t){In(t.element,"title",o.translate(e))}))}},validator:{validate:function(n){var r=tv.getValue(n);return HH.nu((function(n){e({type:t.filetype,url:r.value},(function(t){if("invalid"===t.status){var e=ro.error(t.message);n(e)}else{var r=ro.value(t.message);n(r)}}))}))},validateOnLoad:!1}})})).toArray(),[Hg.config({disabled:function(){return t.disabled||o.isDisabled()}}),yT.config({}),Vx("urlinput-events",nt(["file"===t.filetype?[Pu(Fa(),(function(e){Ou(e,ET,{name:t.name})}))]:[],[Pu(qa(),(function(e){Ou(e,ET,{name:t.name}),i(e)})),Pu(Qa(),(function(e){Ou(e,ET,{name:t.name}),i(e)}))]]))]])),eventOrder:(r={},r[Fa()]=["streaming","urlinput-events","invalidating"],r),model:{getDisplayText:function(t){return t.value},selectsOver:!1,populateFromBrowse:!1},markers:{openClass:"tox-textfield--popup-open"},lazySink:e.shared.getSink,parts:{menu:vk(!1,1,"normal")},onExecute:function(t,e,n){Ou(e,zT,{})},onItemExecute:function(e,n,r,o){i(e),Ou(e,ET,{name:t.name})}}),u=t.label.map((function(t){return CT(t,o)})),c=function(t,e,n,r){return void 0===n&&(n=t),void 0===r&&(r=t),j_(n,{tag:"div",classes:["tox-icon","tox-control-wrap__status-icon-"+t],attributes:T({title:o.translate(r),"aria-live":"polite"},e.fold((function(){return{}}),(function(t){return{id:t}})))},o.icons)},s=k_(c("invalid",j.some(JH),"warning")),l=k_({dom:{tag:"div",classes:["tox-control-wrap__status-icon-wrap"]},components:[s.asSpec()]}),f=n.getUrlPicker(t.filetype),d=oc("browser.url.event"),h=k_({dom:{tag:"div",classes:["tox-control-wrap"]},components:[a,l.asSpec()],behaviours:hf([Hg.config({disabled:function(){return t.disabled||o.isDisabled()}})])}),p=k_(QL({name:t.name,icon:j.some("browse"),text:t.label.getOr(""),disabled:t.disabled,primary:!1,borderless:!0},(function(t){return _u(t,d)}),o,[],["tox-browse-url"])),m=function(){return{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:nt([[h.asSpec()],f.map((function(){return p.asSpec()})).toArray()])}},g=function(e){bg.getCurrent(e).each((function(n){var r=tv.getValue(n),o=T({fieldname:t.name},r);f.each((function(r){r(o).get((function(r){tv.setValue(n,r),Ou(e,ET,{name:t.name})}))}))}))};return mT.sketch({dom:kT(),components:u.toArray().concat([m()]),fieldBehaviours:hf([Hg.config({disabled:function(){return t.disabled||o.isDisabled()},onDisabled:function(t){mT.getField(t).each(Hg.disable),p.getOpt(t).each(Hg.disable)},onEnabled:function(t){mT.getField(t).each(Hg.enable),p.getOpt(t).each(Hg.enable)}}),cC(),Vx("url-input-events",[Pu(d,g)])])})},tR=function(t,e){return sT.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:[O_.sketch({dom:{tag:"button",classes:["tox-button","tox-button--naked","tox-button--icon"],innerHtml:z_(t.icon,e.icons),attributes:{title:e.translate(t.iconTooltip)}},action:function(e){Ou(e,MT,{name:"alert-banner",value:t.url})},buttonBehaviours:hf([D_()])})]},{dom:{tag:"div",classes:["tox-notification__body"],innerHtml:e.translate(t.text)}}]})},eR=function(t,e){var n=tv.config({store:{mode:"manual",getValue:function(t){var e=t.element.dom;return e.checked},setValue:function(t,e){var n=t.element.dom;n.checked=e}}}),r=function(t){return t.element.dom.click(),j.some(!0)},o=mT.parts.field({factory:{sketch:w},dom:{tag:"input",classes:["tox-checkbox__input"],attributes:{type:"checkbox"}},behaviours:hf([UN.self(),Hg.config({disabled:function(){return t.disabled||e.isDisabled()}}),yT.config({}),Xx.config({}),n,Tx.config({mode:"special",onEnter:r,onSpace:r,stopSpaceKeyup:!0}),Vx("checkbox-events",[Pu(qa(),(function(e,n){Ou(e,ET,{name:t.name})}))])])}),i=mT.parts.label({dom:{tag:"span",classes:["tox-checkbox__label"],innerHtml:e.translate(t.label)},behaviours:hf([VM.config({})])}),a=function(t){var n="checked"===t?"selected":"unselected";return j_(n,{tag:"span",classes:["tox-icon","tox-checkbox-icon__"+t]},e.icons)},u=k_({dom:{tag:"div",classes:["tox-checkbox__icons"]},components:[a("checked"),a("unchecked")]});return mT.sketch({dom:{tag:"label",classes:["tox-checkbox"]},components:[o,u.asSpec(),i],fieldBehaviours:hf([Hg.config({disabled:function(){return t.disabled||e.isDisabled()},disableClass:"tox-checkbox--disabled",onDisabled:function(t){mT.getField(t).each(Hg.disable)},onEnabled:function(t){mT.getField(t).each(Hg.enable)}}),cC()])})},nR=function(t){return"presentation"===t.presets?sT.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:t.html}}):sT.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:t.html,attributes:{role:"document"}},containerBehaviours:hf([yT.config({}),Xx.config({})])})},rR=function(t){return function(e,n,r){return Ct(n,"name").fold((function(){return t(n,r)}),(function(o){return e.field(o,t(n,r))}))}},oR=function(t){return function(e,n,r){var o=_o(n,{source:"dynamic"});return rR(t)(e,o,r)}},iR={bar:rR((function(t,e){return fT(t,e.shared)})),collection:rR((function(t,e){return jT(t,e.shared.providers)})),alertbanner:rR((function(t,e){return tR(t,e.shared.providers)})),input:rR((function(t,e){return lH(t,e.shared.providers)})),textarea:rR((function(t,e){return fH(t,e.shared.providers)})),label:rR((function(t,e){return Jj(t,e.shared)})),iframe:oR((function(t,e){return xD(t,e.shared.providers)})),button:rR((function(t,e){return oj(t,e.shared.providers)})),checkbox:rR((function(t,e){return eR(t,e.shared.providers)})),colorinput:rR((function(t,e){return GM(t,e.shared,e.colorinput)})),colorpicker:rR(KN),dropzone:rR((function(t,e){return sD(t,e.shared.providers)})),grid:rR((function(t,e){return lD(t,e.shared)})),listbox:rR((function(t,e){return rH(t,e)})),selectbox:rR((function(t,e){return uH(t,e.shared.providers)})),sizeinput:rR((function(t,e){return gj(t,e.shared.providers)})),urlinput:rR((function(t,e){return QH(t,e,e.urlinput)})),customeditor:rR(ZN),htmlpanel:rR(nR),imagetools:rR((function(t,e){return Zj(t,e.shared.providers)})),table:rR((function(t,e){return cH(t,e.shared.providers)})),panel:rR((function(t,e){return oH(t,e)}))},aR={field:function(t,e){return e}},uR=function(t,e,n){var r=_o(n,{shared:{interpreter:function(e){return cR(t,e,r)}}});return cR(t,e,r)},cR=function(t,e,n){return Ct(iR,e.type).fold((function(){return console.error('Unknown factory type "'+e.type+'", defaulting to container: ',e),e}),(function(r){return r(t,e,n)}))},sR=function(t,e){var n=aR;return cR(n,t,e)},lR={valignCentre:[],alignCentre:[],alignLeft:[],alignRight:[],right:[],left:[],bottom:[],top:[]},fR=function(t,e,n){var r=12,o={maxHeightFunction:Ed()},i=function(){return{type:"node",root:Mn(t()),node:j.from(t()),bubble:Pd(r,r,lR),layouts:{onRtl:function(){return[d_]},onLtr:function(){return[f_]}},overrides:o}},a=function(){return{type:"hotspot",hotspot:e(),bubble:Pd(-r,r,lR),layouts:{onRtl:function(){return[Vl]},onLtr:function(){return[Fl]}},overrides:o}};return function(){return n()?i():a()}},dR=function(t,e,n){var r=function(){return{type:"node",root:Mn(t()),node:j.from(t()),layouts:{onRtl:function(){return[h_]},onLtr:function(){return[h_]}}}},o=function(){return{type:"hotspot",hotspot:e(),layouts:{onRtl:function(){return[Gl]},onLtr:function(){return[Gl]}}}};return function(){return n()?r():o()}},hR=function(t,e){return function(){return{type:"selection",root:e(),getSelection:function(){var e=t.selection.getRng();return j.some(kh.range(ee.fromDom(e.startContainer),e.startOffset,ee.fromDom(e.endContainer),e.endOffset))}}}},pR=function(t){return function(e){return{type:"node",root:t(),node:e}}},mR=function(t,e,n){var r=FS(t),o=function(){return ee.fromDom(t.getBody())},i=function(){return ee.fromDom(t.getContentAreaContainer())},a=function(){return r||!n()};return{inlineDialog:fR(i,e,a),banner:dR(i,e,a),cursor:hR(t,o),node:pR(o)}},vR=function(t){return function(e,n){var r=tA(t);r(e,n)}},gR=function(t){return function(){return LE(t)}},bR=function(t){return function(){return HE(t)}},yR=function(t){return function(){return GE(t)}},xR=function(t){return{colorPicker:vR(t),hasCustomColors:gR(t),getColors:bR(t),getColorCols:yR(t)}},wR=function(t){return function(){return $S(t)}},_R=function(t){return{isDraggableModal:wR(t)}},OR=function(t){var e=oa(HS(t)?"bottom":"top");return{isPositionedAtTop:function(){return"top"===e.get()},getDockingMode:e.get,setDockingMode:e.set}},kR=[{title:"Headings",items:[{title:"Heading 1",format:"h1"},{title:"Heading 2",format:"h2"},{title:"Heading 3",format:"h3"},{title:"Heading 4",format:"h4"},{title:"Heading 5",format:"h5"},{title:"Heading 6",format:"h6"}]},{title:"Inline",items:[{title:"Bold",format:"bold"},{title:"Italic",format:"italic"},{title:"Underline",format:"underline"},{title:"Strikethrough",format:"strikethrough"},{title:"Superscript",format:"superscript"},{title:"Subscript",format:"subscript"},{title:"Code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Align",items:[{title:"Left",format:"alignleft"},{title:"Center",format:"aligncenter"},{title:"Right",format:"alignright"},{title:"Justify",format:"alignjustify"}]}],SR=function(t){return Et(t,"items")},CR=function(t){return Et(t,"block")},ER=function(t){return Et(t,"inline")},AR=function(t){return Et(t,"selector")},TR=function(t){return J(t,(function(t,e){if(SR(e)){var n=TR(e.items);return{customFormats:t.customFormats.concat(n.customFormats),formats:t.formats.concat([{title:e.title,items:n.formats}])}}if(ER(e)||CR(e)||AR(e)){var r=i(e.name)?e.name:e.title.toLowerCase(),o="custom-"+r;return{customFormats:t.customFormats.concat([{name:o,format:e}]),formats:t.formats.concat([{title:e.title,format:o,icon:e.icon}])}}return T(T({},t),{formats:t.formats.concat(e)})}),{customFormats:[],formats:[]})},MR=function(t,e){var n=TR(e),r=function(e){$(e,(function(e){t.formatter.has(e.name)||t.formatter.register(e.name,e.format)}))};return t.formatter?r(n.customFormats):t.on("init",(function(){r(n.customFormats)})),n.formats},zR=function(t){return OS(t).map((function(e){var n=MR(t,e);return kS(t)?kR.concat(n):n})).getOr(kR)},PR=function(t,e,n){var r={type:"formatter",isSelected:e(t.format),getStylePreview:n(t.format)};return _o(t,r)},NR=function(t,e,n,r){var o=function(t){return PR(t,n,r)},a=function(t){var e={type:"submenu"};return _o(t,e)},u=function(e){var o=i(e.name)?e.name:oc(e.title),a="custom-"+o,u={type:"formatter",format:a,isSelected:n(a),getStylePreview:r(a)},c=_o(e,u);return t.formatter.register(o,c),c},c=function(t){return G(t,(function(t){var e=mt(t);if(At(t,"items")){var n=c(t.items);return _o(a(t),{getStyleItems:x(n)})}return At(t,"format")?o(t):1===e.length&&F(e,"title")?_o(t,{type:"separator"}):u(t)}))};return c(e)},DR=function(t){var e=function(e){return function(){return t.formatter.match(e)}},n=function(e){return function(){var n=t.formatter.get(e);return void 0!==n?j.some({tag:n.length>0&&(n[0].inline||n[0].block)||"div",styles:t.dom.parseStyle(t.formatter.getCssText(e))}):j.none()}},r=function(t){var e=t.items;return void 0!==e&&e.length>0?rt(e,r):[t.format]},o=oa([]),i=oa([]),a=oa([]),u=oa([]),c=oa(!1);t.on("PreInit",(function(a){var u=zR(t),c=NR(t,u,e,n);o.set(c),i.set(rt(c,r))})),t.on("addStyleModifications",(function(o){var i=NR(t,o.items,e,n);a.set(i),c.set(o.replace),u.set(rt(i,r))}));var s=function(){var t=c.get()?[]:o.get(),e=a.get();return t.concat(e)},l=function(){var t=c.get()?[]:i.get(),e=u.get();return t.concat(e)};return{getData:s,getFlattenedKeys:l}},LR=function(t){return d(t)&&1===t.nodeType},jR=JN.trim,HR=function(t){return function(e){if(LR(e)){if(e.contentEditable===t)return!0;if(e.getAttribute("data-mce-contenteditable")===t)return!0}return!1}},RR=HR("true"),BR=HR("false"),IR=function(t,e,n,r,o){return{type:t,title:e,url:n,level:r,attach:o}},VR=function(t){while(t=t.parentNode){var e=t.contentEditable;if(e&&"inherit"!==e)return RR(t)}return!1},FR=function(t,e){return G(Yh(ee.fromDom(e),t),(function(t){return t.dom}))},qR=function(t){return t.innerText||t.textContent},UR=function(t){return t.id?t.id:oc("h")},WR=function(t){return t&&"A"===t.nodeName&&void 0!==(t.id||t.name)},GR=function(t){return WR(t)&&KR(t)},$R=function(t){return t&&/^(H[1-6])$/.test(t.nodeName)},KR=function(t){return VR(t)&&!BR(t)},YR=function(t){return $R(t)&&KR(t)},XR=function(t){return $R(t)?parseInt(t.nodeName.substr(1),10):0},ZR=function(t){var e=UR(t),n=function(){t.id=e};return IR("header",qR(t),"#"+e,XR(t),n)},JR=function(t){var e=t.id||t.name,n=qR(t);return IR("anchor",n||"#"+e,"#"+e,0,v)},QR=function(t){return G(X(t,YR),ZR)},tB=function(t){return G(X(t,GR),JR)},eB=function(t){var e=FR("h1,h2,h3,h4,h5,h6,a:not([href])",t);return e},nB=function(t){return jR(t.title).length>0},rB=function(t){var e=eB(t);return X(QR(e).concat(tB(e)),nB)},oB={find:rB},iB="tinymce-url-history",aB=5,uB=function(t){return i(t)&&/^https?/.test(t)},cB=function(t){return u(t)&&t.length<=aB&&ot(t,uB)},sB=function(t){return a(t)&&kt(t,(function(t){return!cB(t)})).isNone()},lB=function(){var t,e=CE.getItem(iB);if(null===e)return{};try{t=JSON.parse(e)}catch(n){if(n instanceof SyntaxError)return console.log("Local storage "+iB+" was not valid JSON",n),{};throw n}return sB(t)?t:(console.log("Local storage "+iB+" was not valid format",t),{})},fB=function(t){if(!sB(t))throw new Error("Bad format for history:\n"+JSON.stringify(t));CE.setItem(iB,JSON.stringify(t))},dB=function(t){var e=lB();return Ct(e,t).getOr([])},hB=function(t,e){if(uB(t)){var n=lB(),r=Ct(n,e).getOr([]),o=X(r,(function(e){return e!==t}));n[e]=[t].concat(o).slice(0,aB),fB(n)}},pB=function(t){return!!t},mB=function(t){return bt(JN.makeMap(t,/[, ]/),pB)},vB=function(t){return j.from(ZS(t)).filter(h)},gB=function(t){var e=j.some(JS(t)).filter(pB),n=j.some(QS(t)).filter(pB),r=e.or(n).map(mB);return vB(t).fold(C,(function(t){return r.fold(E,(function(t){return mt(t).length>0&&t}))}))},bB=function(t,e){var n=gB(t);return s(n)?n?vB(t):j.none():n[e]?vB(t):j.none()},yB=function(t,e){return bB(t,e).map((function(n){return function(r){return tM.nu((function(o){var u=function(t,e){if(!i(t))throw new Error("Expected value to be string");if(void 0!==e&&!a(e))throw new Error("Expected meta to be a object");var n={value:t,meta:e};o(n)},c=T({filetype:e,fieldname:r.fieldname},j.from(r.meta).getOr({}));n.call(t,u,r.value,c)}))}}))},xB=function(t){return j.from(t).filter(i).getOrUndefined()},wB=function(t){return tC(t)?j.none():j.some({targets:oB.find(t.getBody()),anchorTop:xB(eC(t)),anchorBottom:xB(nC(t))})},_B=function(t){return j.from(rC(t))},OB=function(t){return{getHistory:dB,addToHistory:hB,getLinkInformation:function(){return wB(t)},getValidationHandler:function(){return _B(t)},getUrlPicker:function(e){return yB(t,e)}}},kB=function(t,e,n){var r=oa(!1),o=OR(e),i={shared:{providers:{icons:function(){return e.ui.registry.getAll().icons},menuItems:function(){return e.ui.registry.getAll().menuItems},translate:S_.translate,isDisabled:function(){return e.mode.isReadOnly()||e.ui.isDisabled()},getSetting:e.getParam.bind(e)},interpreter:function(t){return sR(t,i)},anchors:mR(e,n,o.isPositionedAtTop),header:o,getSink:function(){return ro.value(t)}},urlinput:OB(e),styleselect:DR(e),colorinput:xR(e),dialog:_R(e),isContextMenuOpen:function(){return r.get()},setContextMenuState:function(t){return r.set(t)}};return i},SB=function(t,e,n){var r=function(t,r){$([e,n],(function(e){e.broadcastEvent(t,r)}))},o=function(t,r){$([e,n],(function(e){e.broadcastOn([t],r)}))},i=function(t){return o(ym(),{target:t.target})},a=_f(),u=ad(a,"touchstart",i),c=ad(a,"touchmove",(function(t){return r(cu(),t)})),s=ad(a,"touchend",(function(t){return r(su(),t)})),l=ad(a,"mousedown",i),f=ad(a,"mouseup",(function(t){0===t.raw.button&&o(wm(),{target:t.target})})),d=function(t){return o(ym(),{target:ee.fromDom(t.target)})},h=function(t){0===t.button&&o(wm(),{target:ee.fromDom(t.target)})},p=function(){$(t.editorManager.get(),(function(e){t!==e&&e.fire("DismissPopups",{relatedTarget:t})}))},m=function(t){return r(lu(),cd(t))},v=function(t){o(xm(),{}),r(fu(),cd(t))},g=function(){return o(xm(),{})},b=function(e){e.state&&o(ym(),{target:ee.fromDom(t.getContainer())})},y=function(t){o(ym(),{target:ee.fromDom(t.relatedTarget.getContainer())})};t.on("PostRender",(function(){t.on("click",d),t.on("tap",d),t.on("mouseup",h),t.on("mousedown",p),t.on("ScrollWindow",m),t.on("ResizeWindow",v),t.on("ResizeEditor",g),t.on("AfterProgressState",b),t.on("DismissPopups",y)})),t.on("remove",(function(){t.off("click",d),t.off("tap",d),t.off("mouseup",h),t.off("mousedown",p),t.off("ScrollWindow",m),t.off("ResizeWindow",v),t.off("ResizeEditor",g),t.off("AfterProgressState",b),t.off("DismissPopups",y),l.unbind(),u.unbind(),c.unbind(),s.unbind(),f.unbind()})),t.on("detach",(function(){Jp(e),Jp(n),e.destroy(),n.destroy()}))},CB=ng,EB=Rv,AB=x([Ki("shell",!1),Ti("makeItem"),Ki("setupItem",v),ov.field("listBehaviours",[Bx])]),TB=function(){return{behaviours:hf([Bx.config({})])}},MB=Lv({name:"items",overrides:TB}),zB=x([MB]),PB=x("CustomList"),NB=function(t,e,n,r){var o=function(e,n){a(e).fold((function(){throw console.error("Custom List was defined to not be a shell, but no item container was specified in components"),new Error("Custom List was defined to not be a shell, but no item container was specified in components")}),(function(r){var o=Bx.contents(r),i=n.length,a=i-o.length,u=a>0?U(a,(function(){return t.makeItem()})):[],c=o.slice(i);$(c,(function(t){return Bx.remove(r,t)})),$(u,(function(t){return Bx.append(r,t)}));var s=Bx.contents(r);$(s,(function(r,o){t.setupItem(e,r,n[o],o)}))}))},i=t.shell?{behaviours:[Bx.config({})],components:[]}:{behaviours:[],components:e},a=function(e){return t.shell?j.some(e):Kv(e,t,"items")};return{uid:t.uid,dom:t.dom,components:i.components,behaviours:rv(t.listBehaviours,i.behaviours),apis:{setItems:o}}},DB=hg({name:PB(),configFields:AB(),partFields:zB(),factory:NB,apis:{setItems:function(t,e,n){t.setItems(e,n)}}}),LB=x([Ti("dom"),Ki("shell",!0),ev("toolbarBehaviours",[Bx])]),jB=function(){return{behaviours:hf([Bx.config({})])}},HB=x([Lv({name:"groups",overrides:jB})]),RB=function(t,e,n,r){var o=function(t,e){i(t).fold((function(){throw console.error("Toolbar was defined to not be a shell, but no groups container was specified in components"),new Error("Toolbar was defined to not be a shell, but no groups container was specified in components")}),(function(t){Bx.set(t,e)}))},i=function(e){return t.shell?j.some(e):Kv(e,t,"groups")},a=t.shell?{behaviours:[Bx.config({})],components:[]}:{behaviours:[],components:e};return{uid:t.uid,dom:t.dom,components:a.components,behaviours:rv(t.toolbarBehaviours,a.behaviours),apis:{setGroups:o},domModification:{attributes:{role:"group"}}}},BB=hg({name:"Toolbar",configFields:LB(),partFields:HB(),factory:RB,apis:{setGroups:function(t,e,n){t.setGroups(e,n)}}}),IB=v,VB=C,FB=x([]),qB=Object.freeze({__proto__:null,setup:IB,isDocked:VB,getBehaviours:FB}),UB=function(t){var e=Tt(Qn(t,"position"),"fixed"),n=e?j.none():yn(t);return n.orThunk((function(){var e=ee.fromTag("span");return gn(t).bind((function(t){Mr(t,e);var n=yn(e);return Lr(e),n}))}))},WB=function(t){return UB(t).map(hr).getOrThunk((function(){return lr(0,0)}))},GB=aa.generate([{static:[]},{absolute:["positionCss"]},{fixed:["positionCss"]}]),$B=function(t,e){var n=t.element;is(n,e.transitionClass),us(n,e.fadeOutClass),is(n,e.fadeInClass),e.onShow(t)},KB=function(t,e){var n=t.element;is(n,e.transitionClass),us(n,e.fadeInClass),is(n,e.fadeOutClass),e.onHide(t)},YB=function(t,e){return t.ye.y},XB=function(t,e){return t.y>=e.y},ZB=function(t,e){return t.bottom<=e.bottom},JB=function(t,e,n){return ot(t,(function(t){switch(t){case"bottom":return ZB(e,n);case"top":return XB(e,n)}}))},QB=function(t,e){return e.getInitialPos().map((function(e){return Xr(e.bounds.x,e.bounds.y,gr(t),ar(t))}))},tI=function(t,e,n){n.setInitialPos({style:tr(t),position:Zn(t,"position")||"static",bounds:e})},eI=function(t,e,n){return n.getInitialPos().bind((function(r){switch(n.clearInitialPos(),r.position){case"static":return j.some(GB.static());case"absolute":var o=UB(t).map(Zr).getOrThunk((function(){return Zr(Hn())}));return j.some(GB.absolute(Tf("absolute",Ct(r.style,"left").map((function(t){return e.x-o.x})),Ct(r.style,"top").map((function(t){return e.y-o.y})),Ct(r.style,"right").map((function(t){return o.right-e.right})),Ct(r.style,"bottom").map((function(t){return o.bottom-e.bottom})))));default:return j.none()}}))},nI=function(t,e,n){return QB(t,n).filter((function(t){return JB(n.getModes(),t,e)})).bind((function(e){return eI(t,e,n)}))},rI=function(t,e,n){var r=Zr(t);if(JB(n.getModes(),r,e))return j.none();tI(t,r,n);var o=Qr(),i=r.x-o.x,a=e.y-o.y,u=o.bottom-e.bottom,c=r.y<=e.y;return j.some(GB.fixed(Tf("fixed",j.some(i),c?j.some(a):j.none(),j.none(),c?j.none():j.some(u))))},oI=function(t,e,n){var r=t.element,o=Tt(Qn(r,"position"),"fixed");return o?nI(r,e,n):rI(r,e,n)},iI=function(t,e){var n=t.element;return QB(n,e).bind((function(t){return eI(n,t,e)}))},aI=function(t,e,n){n.setDocked(!1),$(["left","right","top","bottom","position"],(function(e){return nr(t.element,e)})),e.onUndocked(t)},uI=function(t,e,n,r){var o="fixed"===r.position;n.setDocked(o),zf(t.element,r);var i=o?e.onDocked:e.onUndocked;i(t)},cI=function(t,e,n,r,o){void 0===o&&(o=!1),e.contextual.each((function(e){e.lazyContext(t).each((function(i){var a=YB(i,r);if(a!==n.isVisible())if(n.setVisible(a),o&&!a)ss(t.element,[e.fadeOutClass]),e.onHide(t);else{var u=a?$B:KB;u(t,e)}}))}))},sI=function(t,e,n){var r=e.lazyViewport(t),o=n.isDocked();o&&cI(t,e,n,r),oI(t,r,n).each((function(o){o.fold((function(){return aI(t,e,n)}),(function(r){return uI(t,e,n,r)}),(function(o){cI(t,e,n,r,!0),uI(t,e,n,o)}))}))},lI=function(t,e,n){var r=t.element;n.setDocked(!1),iI(t,n).each((function(r){r.fold((function(){return aI(t,e,n)}),(function(r){return uI(t,e,n,r)}),v)})),n.setVisible(!0),e.contextual.each((function(e){ls(r,[e.fadeInClass,e.fadeOutClass,e.transitionClass]),e.onShow(t)})),fI(t,e,n)},fI=function(t,e,n){t.getSystem().isConnected()&&sI(t,e,n)},dI=function(t,e,n){n.isDocked()&&lI(t,e,n)},hI=function(t,e,n){return n.isDocked()},pI=function(t,e,n,r){return n.setModes(r)},mI=function(t,e,n){return n.getModes()},vI=Object.freeze({__proto__:null,refresh:fI,reset:dI,isDocked:hI,getModes:mI,setModes:pI}),gI=function(t,e){return Au([Vu(Ga(),(function(n,r){t.contextual.each((function(t){if(cs(n.element,t.transitionClass)){ls(n.element,[t.transitionClass,t.fadeInClass]);var o=e.isVisible()?t.onShown:t.onHidden;o(n)}r.stop()}))})),Pu(lu(),(function(n,r){fI(n,t,e)})),Pu(fu(),(function(n,r){dI(n,t,e)}))])},bI=Object.freeze({__proto__:null,events:gI}),yI=[Gi("contextual",[Pi("fadeInClass"),Pi("fadeOutClass"),Pi("transitionClass"),Li("lazyContext"),ul("onShow"),ul("onShown"),ul("onHide"),ul("onHidden")]),ta("lazyViewport",Qr),na("modes",["top","bottom"],si),ul("onDocked"),ul("onUndocked")],xI=function(t){var e=oa(!1),n=oa(!0),r=od(),o=oa(t.modes),i=function(){return"docked: "+e.get()+", visible: "+n.get()+", modes: "+o.get().join(",")};return Sc({isDocked:e.get,setDocked:e.set,getInitialPos:r.get,setInitialPos:r.set,clearInitialPos:r.clear,isVisible:n.get,setVisible:n.set,getModes:o.get,setModes:o.set,readState:i})},wI=Object.freeze({__proto__:null,init:xI}),_I=mf({fields:yI,name:"docking",active:bI,apis:vI,state:wI}),OI=x(oc("toolbar-height-change")),kI={fadeInClass:"tox-editor-dock-fadein",fadeOutClass:"tox-editor-dock-fadeout",transitionClass:"tox-editor-dock-transition"},SI="tox-tinymce--toolbar-sticky-on",CI="tox-tinymce--toolbar-sticky-off",EI=function(t,e){var n=hn(e),r=n.dom.defaultView.innerHeight,o=Hr(n),i=ee.fromDom(t.elm),a=Jr(i),u=ar(i),c=a.y,s=c+u,l=hr(e),f=ar(e),d=l.top,h=d+f,p=Math.abs(d-o.top)<2,m=Math.abs(h-(o.top+r))<2;if(p&&cd){var v=c-r+u+f;Rr(o.left,v,n)}},AI=function(t,e){return F(_I.getModes(t),e)},TI=function(t){var e=function(t){return ur(t)+(parseInt(Zn(t,"margin-top"),10)||0)+(parseInt(Zn(t,"margin-bottom"),10)||0)},n=t.element;gn(n).each((function(r){var o="padding-"+_I.getModes(t)[0];if(_I.isDocked(t)){var i=gr(r);Kn(n,"width",i+"px"),Kn(r,o,e(n)+"px")}else nr(n,"width"),nr(r,o)}))},MI=function(t,e){e?(us(t,kI.fadeOutClass),ss(t,[kI.transitionClass,kI.fadeInClass])):(us(t,kI.fadeInClass),ss(t,[kI.fadeOutClass,kI.transitionClass]))},zI=function(t,e){var n=ee.fromDom(t.getContainer());e?(is(n,SI),us(n,CI)):(is(n,CI),us(n,SI))},PI=function(t,e){var n=hn(e);Cf(n).filter((function(t){return!sn(e,t)})).filter((function(e){return sn(e,ee.fromDom(n.dom.body))||dn(t,e)})).each((function(){return Of(e)}))},NI=function(t,e){return Ef(t).orThunk((function(){return e().toOptional().bind((function(t){return Ef(t.element)}))}))},DI=function(t,e,n){t.inline||(e.header.isPositionedAtTop()||t.on("ResizeEditor",(function(){n().each(_I.reset)})),t.on("ResizeWindow ResizeEditor",(function(){n().each(TI)})),t.on("SkinLoaded",(function(){n().each((function(t){_I.isDocked(t)?_I.reset(t):_I.refresh(t)}))})),t.on("FullscreenStateChanged",(function(){n().each(_I.reset)}))),t.on("AfterScrollIntoView",(function(t){n().each((function(e){_I.refresh(e);var n=e.element;Zb(n)&&EI(t,n)}))})),t.on("PostRender",(function(){zI(t,!1)}))},LI=function(t){return t().map(_I.isDocked).getOr(!1)},jI=function(){var t;return[yf.config({channels:(t={},t[OI()]={onReceive:TI},t)})]},HI=function(t,e){var n=od(),r=e.getSink,o=function(t){r().each((function(e){return t(e.element)}))},i=function(e){t.inline||TI(e),zI(t,_I.isDocked(e)),e.getSystem().broadcastOn([xm()],{}),r().each((function(t){return t.getSystem().broadcastOn([xm()],{})}))},a=t.inline?[]:jI();return z([Xx.config({}),_I.config({contextual:T({lazyContext:function(e){var n=ur(e.element),r=t.inline?t.getContentAreaContainer():t.getContainer(),o=Zr(ee.fromDom(r)),i=o.height-n,a=o.y+(AI(e,"top")?0:n);return j.some(Xr(o.x,a,o.width,i))},onShow:function(){o((function(t){return MI(t,!0)}))},onShown:function(t){o((function(t){return ls(t,[kI.transitionClass,kI.fadeInClass])})),n.get().each((function(e){PI(t.element,e),n.clear()}))},onHide:function(t){NI(t.element,r).fold(n.clear,n.set),o((function(t){return MI(t,!1)}))},onHidden:function(){o((function(t){return ls(t,[kI.transitionClass])}))}},kI),lazyViewport:function(e){var n=Qr(),r=GS(t),o=n.y+(AI(e,"top")?r:0),i=n.height-(AI(e,"bottom")?r:0);return Xr(n.x,o,n.width,i)},modes:[e.header.getDockingMode()],onDocked:i,onUndocked:i})],a,!0)},RI=Object.freeze({__proto__:null,setup:DI,isDocked:LI,getBehaviours:HI}),BI=function(t){var e=t.editor,n=t.sticky?HI:FB;return{uid:t.uid,dom:t.dom,components:t.components,behaviours:hf(n(e,t.sharedBackstage))}},II=ti([Pi("type"),Mi("items",ni([ii([Pi("name"),Bi("items",si)]),si]))].concat(kO)),VI=function(t){return xi("GroupToolbarButton",II,t)},FI=[qi("text"),qi("tooltip"),qi("icon"),Li("fetch"),ta("onSetup",(function(){return v}))],qI=ti(z([Pi("type")],FI,!0)),UI=function(t){return xi("menubutton",qI,t)},WI=ti([Pi("type"),qi("tooltip"),qi("icon"),qi("text"),Ui("select"),Li("fetch"),ta("onSetup",(function(){return v})),Ji("presets","normal",["normal","color","listpreview"]),Ki("columns",1),Li("onAction"),Li("onItemAction")]),GI=function(t){return xi("SplitButton",WI,t)},$I=function(t,e){var n=function(t,n){var r=G(n,(function(t){var n={type:"menubutton",text:t.text,fetch:function(e){e(t.getItems())}},r=UI(n).mapError((function(t){return Oi(t)})).getOrDie();return $L(r,"tox-mbtn",e.backstage,j.some("menuitem"))}));Bx.set(t,r)},r={focus:Tx.focusIn,setMenus:n};return{uid:t.uid,dom:t.dom,components:[],behaviours:hf([Bx.config({}),Vx("menubar-events",[Fu((function(e){t.onSetup(e)})),Pu(Ha(),(function(t,e){Rs(t.element,".tox-mbtn--active").each((function(n){Bs(e.event.target,".tox-mbtn").each((function(e){sn(n,e)||t.getSystem().getByDom(n).each((function(n){t.getSystem().getByDom(e).each((function(t){HM.expand(t),HM.close(n),Xx.focus(t)}))}))}))}))})),Pu(vu(),(function(t,e){e.event.prevFocus.bind((function(e){return t.getSystem().getByDom(e).toOptional()})).each((function(n){e.event.newFocus.bind((function(e){return t.getSystem().getByDom(e).toOptional()})).each((function(t){HM.isOpen(n)&&(HM.expand(t),HM.close(n))}))}))}))]),Tx.config({mode:"flow",selector:".tox-mbtn",onEscape:function(e){return t.onEscape(e),j.some(!0)}}),yT.config({})]),apis:r,domModification:{attributes:{role:"menubar"}}}},KI=dg({factory:$I,name:"silver.Menubar",configFields:[Ti("dom"),Ti("uid"),Ti("onEscape"),Ti("backstage"),Ki("onSetup",v)],apis:{focus:function(t,e){t.focus(e)},setMenus:function(t,e,n){t.setMenus(e,n)}}}),YI=function(t,e){return e.getAnimationRoot.fold((function(){return t.element}),(function(e){return e(t)}))},XI=function(t){return t.dimension.property},ZI=function(t,e){return t.dimension.getDimension(e)},JI=function(t,e){var n=YI(t,e);ls(n,[e.shrinkingClass,e.growingClass])},QI=function(t,e){us(t.element,e.openClass),is(t.element,e.closedClass),Kn(t.element,XI(e),"0px"),rr(t.element)},tV=function(t,e){us(t.element,e.closedClass),is(t.element,e.openClass),nr(t.element,XI(e))},eV=function(t,e,n,r){n.setCollapsed(),Kn(t.element,XI(e),ZI(e,t.element)),rr(t.element),JI(t,e),QI(t,e),e.onStartShrink(t),e.onShrunk(t)},nV=function(t,e,n,r){var o=r.getOrThunk((function(){return ZI(e,t.element)}));n.setCollapsed(),Kn(t.element,XI(e),o),rr(t.element);var i=YI(t,e);us(i,e.growingClass),is(i,e.shrinkingClass),QI(t,e),e.onStartShrink(t)},rV=function(t,e,n){var r=ZI(e,t.element),o="0px"===r?eV:nV;o(t,e,n,j.some(r))},oV=function(t,e,n){var r=YI(t,e),o=cs(r,e.shrinkingClass),i=ZI(e,t.element);tV(t,e);var a=ZI(e,t.element),u=function(){Kn(t.element,XI(e),i),rr(t.element)},c=function(){QI(t,e)},s=o?u:c;s(),us(r,e.shrinkingClass),is(r,e.growingClass),tV(t,e),Kn(t.element,XI(e),a),n.setExpanded(),e.onStartGrow(t)},iV=function(t,e,n){if(n.isExpanded()){nr(t.element,XI(e));var r=ZI(e,t.element);Kn(t.element,XI(e),r)}},aV=function(t,e,n){n.isExpanded()||oV(t,e,n)},uV=function(t,e,n){n.isExpanded()&&rV(t,e,n)},cV=function(t,e,n){n.isExpanded()&&eV(t,e,n)},sV=function(t,e,n){return n.isExpanded()},lV=function(t,e,n){return n.isCollapsed()},fV=function(t,e,n){var r=YI(t,e);return!0===cs(r,e.growingClass)},dV=function(t,e,n){var r=YI(t,e);return!0===cs(r,e.shrinkingClass)},hV=function(t,e,n){return fV(t,e)||dV(t,e)},pV=function(t,e,n){var r=n.isExpanded()?rV:oV;r(t,e,n)},mV=Object.freeze({__proto__:null,refresh:iV,grow:aV,shrink:uV,immediateShrink:cV,hasGrown:sV,hasShrunk:lV,isGrowing:fV,isShrinking:dV,isTransitioning:hV,toggleGrow:pV,disableTransitions:JI}),vV=function(t,e,n){var r=e.expanded;return Mc(r?{classes:[e.openClass],styles:{}}:{classes:[e.closedClass],styles:ha(e.dimension.property,"0px")})},gV=function(t,e){return Au([Vu(Ga(),(function(n,r){var o=r.event.raw;if(o.propertyName===t.dimension.property){JI(n,t),e.isExpanded()&&nr(n.element,t.dimension.property);var i=e.isExpanded()?t.onGrown:t.onShrunk;i(n)}}))])},bV=Object.freeze({__proto__:null,exhibit:vV,events:gV}),yV=[Ti("closedClass"),Ti("openClass"),Ti("shrinkingClass"),Ti("growingClass"),Ii("getAnimationRoot"),ul("onShrunk"),ul("onStartShrink"),ul("onGrown"),ul("onStartGrow"),Ki("expanded",!1),Mi("dimension",ki("property",{width:[fl("property","width"),fl("getDimension",(function(t){return gr(t)+"px"}))],height:[fl("property","height"),fl("getDimension",(function(t){return ar(t)+"px"}))]}))],xV=function(t){var e=oa(t.expanded),n=function(){return"expanded: "+e.get()};return Sc({isExpanded:function(){return!0===e.get()},isCollapsed:function(){return!1===e.get()},setCollapsed:O(e.set,!1),setExpanded:O(e.set,!0),readState:n})},wV=Object.freeze({__proto__:null,init:xV}),_V=mf({fields:yV,name:"sliding",active:bV,apis:mV,state:wV}),OV="container",kV=[ev("slotBehaviours",[])],SV=function(t){return""},CV=function(t){var e=function(){var t=[],e=function(e,n){return t.push(e),qv(OV,SV(e),n)};return{slot:e,record:x(t)}}(),n=t(e),r=e.record(),o=G(r,(function(t){return Nv({name:t,pname:SV(t)})}));return ag(OV,kV,o,EV,n)},EV=function(t,e){var n=function(e){return Jv(t)},r=function(e,n){return Kv(e,t,n)},o=function(e,n){return function(r,o){return Kv(r,t,o).map((function(t){return e(t,o)})).getOr(n)}},i=function(t){return function(e,n){$(n,(function(n){return t(e,n)}))}},a=function(t,e){return"true"!==Fn(t.element,"aria-hidden")},u=function(t,e){if(!a(t)){var n=t.element;nr(n,"display"),Wn(n,"aria-hidden"),Ou(t,gu(),{name:e,visible:!0})}},c=function(t,e){if(a(t)){var n=t.element;Kn(n,"display","none"),In(n,"aria-hidden","true"),Ou(t,gu(),{name:e,visible:!1})}},s=o(a,!1),l=o(c),f=i(l),d=function(t){return f(t,n())},h=o(u),p={getSlotNames:n,getSlot:r,isShowing:s,hideSlot:l,hideAllSlots:d,showSlot:h};return{uid:t.uid,dom:t.dom,components:e,behaviours:nv(t.slotBehaviours),apis:p}},AV=bt({getSlotNames:function(t,e){return t.getSlotNames(e)},getSlot:function(t,e,n){return t.getSlot(e,n)},isShowing:function(t,e,n){return t.isShowing(e,n)},hideSlot:function(t,e,n){return t.hideSlot(e,n)},hideAllSlots:function(t,e){return t.hideAllSlots(e)},showSlot:function(t,e,n){return t.showSlot(e,n)}},(function(t){return Oc(t)})),TV=T(T({},AV),{sketch:CV}),MV=ti([qi("icon"),qi("tooltip"),ta("onShow",v),ta("onHide",v),ta("onSetup",(function(){return v}))]),zV=function(t){return xi("sidebar",MV,t)},PV=function(t){var e=t.ui.registry.getAll().sidebars;$(mt(e),(function(n){var r=e[n],o=function(){return Tt(j.from(t.queryCommandValue("ToggleSidebar")),n)};t.ui.registry.addToggleButton(n,{icon:r.icon,tooltip:r.tooltip,onAction:function(e){t.execCommand("ToggleSidebar",!1,n),e.setActive(o())},onSetup:function(e){var n=function(){return e.setActive(o())};return t.on("ToggleSidebar",n),function(){t.off("ToggleSidebar",n)}}})}))},NV=function(t){return{element:function(){return t.element.dom}}},DV=function(t,e){var n=G(mt(e),(function(t){var n=e[t],r=wi(zV(n));return{name:t,getApi:NV,onSetup:r.onSetup,onShow:r.onShow,onHide:r.onHide}}));return G(n,(function(e){var r=oa(v);return t.slot(e.name,{dom:{tag:"div",classes:["tox-sidebar__pane"]},behaviours:Jk.unnamedEvents([mC(e,r),vC(e,r),Pu(gu(),(function(t,e){var r=e.event,o=tt(n,(function(t){return t.name===r.name}));o.each((function(e){var n=r.visible?e.onShow:e.onHide;n(e.getApi(t))}))}))])})}))},LV=function(t){return TV.sketch((function(e){return{dom:{tag:"div",classes:["tox-sidebar__pane-container"]},components:DV(e,t),slotBehaviours:Jk.unnamedEvents([Fu((function(t){return TV.hideAllSlots(t)}))])}}))},jV=function(t,e){var n=bg.getCurrent(t);n.each((function(t){return Bx.set(t,[LV(e)])}))},HV=function(t,e){var n=bg.getCurrent(t);n.each((function(t){var n=bg.getCurrent(t);n.each((function(n){_V.hasGrown(t)?TV.isShowing(n,e)?_V.shrink(t):(TV.hideAllSlots(n),TV.showSlot(n,e)):(TV.hideAllSlots(n),TV.showSlot(n,e),_V.grow(t))}))}))},RV=function(t){var e=bg.getCurrent(t);return e.bind((function(t){var e=_V.isGrowing(t)||_V.hasGrown(t);if(e){var n=bg.getCurrent(t);return n.bind((function(t){return tt(TV.getSlotNames(t),(function(e){return TV.isShowing(t,e)}))}))}return j.none()}))},BV=oc("FixSizeEvent"),IV=oc("AutoSizeEvent"),VV=function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-sidebar"],attributes:{role:"complementary"}},components:[{dom:{tag:"div",classes:["tox-sidebar__slider"]},components:[],behaviours:hf([yT.config({}),Xx.config({}),_V.config({dimension:{property:"width"},closedClass:"tox-sidebar--sliding-closed",openClass:"tox-sidebar--sliding-open",shrinkingClass:"tox-sidebar--sliding-shrinking",growingClass:"tox-sidebar--sliding-growing",onShrunk:function(t){var e=bg.getCurrent(t);e.each(TV.hideAllSlots),_u(t,IV)},onGrown:function(t){_u(t,IV)},onStartGrow:function(t){Ou(t,BV,{width:Qn(t.element,"width").getOr("")})},onStartShrink:function(t){Ou(t,BV,{width:gr(t.element)+"px"})}}),Bx.config({}),bg.config({find:function(t){var e=Bx.contents(t);return ft(e)}})])}],behaviours:hf([UN.childAt(0),Vx("sidebar-sliding-events",[Pu(BV,(function(t,e){Kn(t.element,"width",e.event.width)})),Pu(IV,(function(t,e){nr(t.element,"width")}))])])}},FV=function(t,e,n,r){In(t.element,"aria-busy",!0);var o=e.getRoot(t).getOr(t),i=hf([Tx.config({mode:"special",onTab:function(){return j.some(!0)},onShiftTab:function(){return j.some(!0)}}),Xx.config({})]),a=r(o,i),u=o.getSystem().build(a);Bx.append(o,As(u)),u.hasConfigured(Tx)&&e.focus&&Tx.focusIn(u),n.isBlocked()||e.onBlock(t),n.blockWith((function(){return Bx.remove(o,u)}))},qV=function(t,e,n){Wn(t.element,"aria-busy"),n.isBlocked()&&e.onUnblock(t),n.clear()},UV=Object.freeze({__proto__:null,block:FV,unblock:qV}),WV=[ta("getRoot",j.none),Qi("focus",!0),ul("onBlock"),ul("onUnblock")],GV=function(){var t=ed(),e=function(e){t.set({destroy:e})};return Sc({readState:t.isSet,blockWith:e,clear:t.clear,isBlocked:t.isSet})},$V=Object.freeze({__proto__:null,init:GV}),KV=mf({fields:WV,name:"blocking",apis:UV,state:$V}),YV=function(t){var e=void 0!==t.dom.attributes?t.dom.attributes:[];return J(e,(function(t,e){var n;return"class"===e.name?t:T(T({},t),(n={},n[e.name]=e.value,n))}),{})},XV=function(t){return Array.prototype.slice.call(t.dom.classList,0)},ZV=function(t){var e=ee.fromHtml(t),n=wn(e),r=YV(e),o=XV(e),i=0===n.length?{}:{innerHtml:$u(e)};return T({tag:ue(e),classes:o,attributes:r},i)},JV=function(t){return function(e,n){return{dom:{tag:"div",attributes:{"aria-label":t.translate("Loading..."),tabindex:"0"},classes:["tox-throbber__busy-spinner"]},components:[{dom:ZV('
')}]}}},QV=function(t){return bg.getCurrent(t).each((function(t){return Of(t.element)}))},tF=function(t,e){var n="tabindex",r="data-mce-"+n;j.from(t.iframeElement).map(ee.fromDom).each((function(t){e?(qn(t,n).each((function(e){return In(t,r,e)})),In(t,n,-1)):(Wn(t,n),qn(t,r).each((function(e){In(t,n,e),Wn(t,r)})))}))},eF=function(t,e,n,r){var o=e.element;if(tF(t,n),n)KV.block(e,JV(r)),nr(o,"display"),Wn(o,"aria-hidden"),t.hasFocus()&&QV(e);else{var i=bg.getCurrent(e).exists((function(t){return Sf(t.element)}));KV.unblock(e),Kn(o,"display","none"),In(o,"aria-hidden","true"),i&&t.focus()}},nF=function(t){return{uid:t.uid,dom:{tag:"div",attributes:{"aria-hidden":"true"},classes:["tox-throbber"],styles:{display:"none"}},behaviours:hf([Bx.config({}),KV.config({focus:!1}),bg.config({find:function(t){return ft(t.components())}})]),components:[]}},rF=function(t){return"focusin"===t.type},oF=function(t){if(rF(t)){var e=t.composed?ft(t.composedPath()):j.from(t.target);return e.map(ee.fromDom).filter(le).exists((function(t){return cs(t,"mce-pastebin")}))}return!1},iF=function(t,e,n){var r=oa(!1),o=od(),i=function(n){r.get()&&!oF(n)&&(n.preventDefault(),QV(e()),t.editorManager.setActive(t))};t.inline||t.on("PreInit",(function(){t.dom.bind(t.getWin(),"focusin",i),t.on("BeforeExecCommand",(function(t){"mcefocus"===t.command.toLowerCase()&&!0!==t.value&&i(t)}))}));var a=function(o){o!==r.get()&&(r.set(o),eF(t,e(),o,n.providers),t.fire("AfterProgressState",{state:o}))};t.on("ProgressState",(function(e){if(o.on(w_.clearTimeout),p(e.time)){var n=w_.setEditorTimeout(t,(function(){return a(e.state)}),e.time);o.set(n)}else a(e.state),o.clear()}))},aF=function(t,e){var n={len:0,list:[]},r=J(t,(function(t,n){var r=e(n,t.len);return r.fold(x(t),(function(e){return{len:e.finish,list:t.list.concat([e])}}))}),n);return r.list},uF=function(t,e,n){return{within:t,extra:e,withinWidth:n}},cF=function(t,e,n){var r=aF(t,(function(t,e){var r=n(t);return j.some({element:t,start:e,finish:e+r,width:r})})),o=X(r,(function(t){return t.finish<=e})),i=Z(o,(function(t,e){return t+e.width}),0),a=r.slice(o.length);return{within:o,extra:a,withinWidth:i}},sF=function(t){return G(t,(function(t){return t.element}))},lF=function(t,e,n){var r=sF(t.concat(e));return uF(r,[],n)},fF=function(t,e,n,r){var o=sF(t).concat([n]);return uF(o,sF(e),r)},dF=function(t,e,n){return uF(sF(t),[],n)},hF=function(t,e,n){var r=cF(e,t,n);return 0===r.extra.length?j.some(r):j.none()},pF=function(t,e,n,r){var o=hF(t,e,n).getOrThunk((function(){return cF(e,t-n(r),n)})),i=o.within,a=o.extra,u=o.withinWidth;return 1===a.length&&a[0].width<=n(r)?lF(i,a,u):a.length>=1?fF(i,a,r,u):dF(i,a,u)},mF=function(t,e){var n=G(e,(function(t){return As(t)}));BB.setGroups(t,n)},vF=function(t){return pt(t,(function(t){return Ef(t.element).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))}))},gF=function(t,e,n){var r=e.builtGroups.get();if(0!==r.length){var o=Yv(t,e,"primary"),i=bM.getCoupled(t,"overflowGroup");Kn(o.element,"visibility","hidden");var a=r.concat([i]),u=vF(a);n([]),mF(o,a);var c=gr(o.element),s=pF(c,e.builtGroups.get(),(function(t){return gr(t.element)}),i);0===s.extra.length?(Bx.remove(o,i),n([])):(mF(o,s.within),n(s.extra)),nr(o.element,"visibility"),rr(o.element),u.each(Xx.focus)}},bF=x([ev("splitToolbarBehaviours",[bM]),Ei("builtGroups",(function(){return oa([])}))]),yF=x([il(["overflowToggledClass"]),Ui("getOverflowBounds"),Ti("lazySink"),Ei("overflowGroups",(function(){return oa([])}))].concat(bF())),xF=x([Nv({factory:BB,schema:LB(),name:"primary"}),Dv({schema:LB(),name:"overflow"}),Dv({name:"overflow-button"}),Dv({name:"overflow-group"})]),wF=x((function(t,e){yr(t,Math.floor(e))})),_F=x([il(["toggledClass"]),Ti("lazySink"),Li("fetch"),Ui("getBounds"),Gi("fireDismissalEventInstead",[Ki("event",pu())]),Bd()]),OF=x([Dv({name:"button",overrides:function(t){return{dom:{attributes:{"aria-haspopup":"true"}},buttonBehaviours:hf([mw.config({toggleClass:t.markers.toggledClass,aria:{mode:"expanded"},toggleOnExecute:!1})])}}}),Dv({factory:BB,schema:LB(),name:"toolbar",overrides:function(t){return{toolbarBehaviours:hf([Tx.config({mode:"cyclic",onEscape:function(e){return Kv(e,t,"button").each(Xx.focus),j.none()}})])}}})]),kF=function(t,e){var n=bM.getCoupled(t,"toolbarSandbox");bm.isOpen(n)?bm.close(n):bm.open(n,e.toolbar())},SF=function(t,e,n,r){var o=n.getBounds.map((function(t){return t()})),i=n.lazySink(t).getOrDie();Rp.positionWithinBounds(i,e,{anchor:{type:"hotspot",hotspot:t,layouts:r,overrides:{maxWidthFunction:wF()}}},o)},CF=function(t,e,n,r,o){BB.setGroups(e,o),SF(t,e,n,r),mw.on(t)},EF=function(t,e,n){var r=Vs(),o=function(o,i){n.fetch().get((function(o){CF(t,i,n,e.layouts,o),r.link(t.element),Tx.focusIn(i)}))},i=function(){mw.off(t),Xx.focus(t),r.unlink(t.element)};return{dom:{tag:"div",attributes:{id:r.id}},behaviours:hf([Tx.config({mode:"special",onEscape:function(t){return bm.close(t),j.some(!0)}}),bm.config({onOpen:o,onClose:i,isPartOf:function(e,n,r){return qs(n,r)||qs(t,r)},getAttachPoint:function(){return n.lazySink(t).getOrDie()}}),yf.config({channels:T(T({},Om(T({isExtraPart:C},n.fireDismissalEventInstead.map((function(t){return{fireEventInstead:{event:t.event}}})).getOr({})))),Sm({doReposition:function(){bm.getState(bM.getCoupled(t,"toolbarSandbox")).each((function(r){SF(t,r,n,e.layouts)}))}}))})])}},AF=function(t,e,n,r){return T(T({},O_.sketch(T(T({},r.button()),{action:function(t){kF(t,r)},buttonBehaviours:ov.augment({dump:r.button().buttonBehaviours},[bM.config({others:{toolbarSandbox:function(e){return EF(e,n,t)}}})])}))),{apis:{setGroups:function(e,r){bm.getState(bM.getCoupled(e,"toolbarSandbox")).each((function(o){CF(e,o,t,n.layouts,r)}))},reposition:function(e){bm.getState(bM.getCoupled(e,"toolbarSandbox")).each((function(r){SF(e,r,t,n.layouts)}))},toggle:function(t){kF(t,r)},getToolbar:function(t){return bm.getState(bM.getCoupled(t,"toolbarSandbox"))},isOpen:function(t){return bm.isOpen(bM.getCoupled(t,"toolbarSandbox"))}}})},TF=hg({name:"FloatingToolbarButton",factory:AF,configFields:_F(),partFields:OF(),apis:{setGroups:function(t,e,n){t.setGroups(e,n)},reposition:function(t,e){t.reposition(e)},toggle:function(t,e){t.toggle(e)},getToolbar:function(t,e){return t.getToolbar(e)},isOpen:function(t,e){return t.isOpen(e)}}}),MF=x([Ti("items"),il(["itemSelector"]),ev("tgroupBehaviours",[Tx])]),zF=x([jv({name:"items",unit:"item"})]),PF=function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,behaviours:rv(t.tgroupBehaviours,[Tx.config({mode:"flow",selector:t.markers.itemSelector})]),domModification:{attributes:{role:"toolbar"}}}},NF=hg({name:"ToolbarGroup",configFields:MF(),partFields:zF(),factory:PF}),DF=function(t){return G(t,(function(t){return As(t)}))},LF=function(t,e,n){gF(t,n,(function(r){n.overflowGroups.set(r),e.getOpt(t).each((function(t){TF.setGroups(t,DF(r))}))}))},jF=function(t,e,n,r){var o=k_(TF.sketch({fetch:function(){return tM.nu((function(e){e(DF(t.overflowGroups.get()))}))},layouts:{onLtr:function(){return[Fl,Vl]},onRtl:function(){return[Vl,Fl]},onBottomLtr:function(){return[Ul,ql]},onBottomRtl:function(){return[ql,Ul]}},getBounds:n.getOverflowBounds,lazySink:t.lazySink,fireDismissalEventInstead:{},markers:{toggledClass:t.markers.overflowToggledClass},parts:{button:r["overflow-button"](),toolbar:r.overflow()}}));return{uid:t.uid,dom:t.dom,components:e,behaviours:rv(t.splitToolbarBehaviours,[bM.config({others:{overflowGroup:function(){return NF.sketch(T(T({},r["overflow-group"]()),{items:[o.asSpec()]}))}}})]),apis:{setGroups:function(e,n){t.builtGroups.set(G(n,e.getSystem().build)),LF(e,o,t)},refresh:function(e){return LF(e,o,t)},toggle:function(t){o.getOpt(t).each((function(t){TF.toggle(t)}))},isOpen:function(t){return o.getOpt(t).map(TF.isOpen).getOr(!1)},reposition:function(t){o.getOpt(t).each((function(t){TF.reposition(t)}))},getOverflow:function(t){return o.getOpt(t).bind(TF.getToolbar)}},domModification:{attributes:{role:"group"}}}},HF=hg({name:"SplitFloatingToolbar",configFields:yF(),partFields:xF(),factory:jF,apis:{setGroups:function(t,e,n){t.setGroups(e,n)},refresh:function(t,e){t.refresh(e)},reposition:function(t,e){t.reposition(e)},toggle:function(t,e){t.toggle(e)},isOpen:function(t,e){return t.isOpen(e)},getOverflow:function(t,e){return t.getOverflow(e)}}}),RF=x([il(["closedClass","openClass","shrinkingClass","growingClass","overflowToggledClass"]),ul("onOpened"),ul("onClosed")].concat(bF())),BF=x([Nv({factory:BB,schema:LB(),name:"primary"}),Nv({factory:BB,schema:LB(),name:"overflow",overrides:function(t){return{toolbarBehaviours:hf([_V.config({dimension:{property:"height"},closedClass:t.markers.closedClass,openClass:t.markers.openClass,shrinkingClass:t.markers.shrinkingClass,growingClass:t.markers.growingClass,onShrunk:function(e){Kv(e,t,"overflow-button").each((function(t){mw.off(t),Xx.focus(t)})),t.onClosed(e)},onGrown:function(e){Tx.focusIn(e),t.onOpened(e)},onStartGrow:function(e){Kv(e,t,"overflow-button").each(mw.on)}}),Tx.config({mode:"acyclic",onEscape:function(e){return Kv(e,t,"overflow-button").each(Xx.focus),j.some(!0)}})])}}}),Dv({name:"overflow-button",overrides:function(t){return{buttonBehaviours:hf([mw.config({toggleClass:t.markers.overflowToggledClass,aria:{mode:"pressed"},toggleOnExecute:!1})])}}}),Dv({name:"overflow-group"})]),IF=function(t,e){return Kv(t,e,"overflow").map(_V.hasGrown).getOr(!1)},VF=function(t,e){Kv(t,e,"overflow-button").bind((function(){return Kv(t,e,"overflow")})).each((function(n){FF(t,e),_V.toggleGrow(n)}))},FF=function(t,e){Kv(t,e,"overflow").each((function(n){gF(t,e,(function(t){var e=G(t,(function(t){return As(t)}));BB.setGroups(n,e)})),Kv(t,e,"overflow-button").each((function(t){_V.hasGrown(n)&&mw.on(t)})),_V.refresh(n)}))},qF=function(t,e,n,r){var o="alloy.toolbar.toggle",i=function(e,n){var r=G(n,e.getSystem().build);t.builtGroups.set(r)};return{uid:t.uid,dom:t.dom,components:e,behaviours:rv(t.splitToolbarBehaviours,[bM.config({others:{overflowGroup:function(t){return NF.sketch(T(T({},r["overflow-group"]()),{items:[O_.sketch(T(T({},r["overflow-button"]()),{action:function(e){_u(t,o)}}))]}))}}}),Vx("toolbar-toggle-events",[Pu(o,(function(e){VF(e,t)}))])]),apis:{setGroups:function(e,n){i(e,n),FF(e,t)},refresh:function(e){return FF(e,t)},toggle:function(e){return VF(e,t)},isOpen:function(e){return IF(e,t)}},domModification:{attributes:{role:"group"}}}},UF=hg({name:"SplitSlidingToolbar",configFields:RF(),partFields:BF(),factory:qF,apis:{setGroups:function(t,e,n){t.setGroups(e,n)},refresh:function(t,e){t.refresh(e)},toggle:function(t,e){t.toggle(e)},isOpen:function(t,e){return t.isOpen(e)}}}),WF=function(t){var e=t.title.fold((function(){return{}}),(function(t){return{attributes:{title:t}}}));return{dom:T({tag:"div",classes:["tox-toolbar__group"]},e),components:[NF.parts.items({})],items:t.items,markers:{itemSelector:"*:not(.tox-split-button) > .tox-tbtn:not([disabled]), .tox-split-button:not([disabled]), .tox-toolbar-nav-js:not([disabled])"},tgroupBehaviours:hf([yT.config({}),Xx.config({})])}},GF=function(t){return NF.sketch(WF(t))},$F=function(t,e){var n=Fu((function(e){var n=G(t.initGroups,GF);BB.setGroups(e,n)}));return hf([hC.toolbarButton(t.providers.isDisabled),cC(),Tx.config({mode:e,onEscape:t.onEscape,selector:".tox-toolbar__group"}),Vx("toolbar-events",[n])])},KF=function(t){var e=t.cyclicKeying?"cyclic":"acyclic";return{uid:t.uid,dom:{tag:"div",classes:["tox-toolbar-overlord"]},parts:{"overflow-group":WF({title:j.none(),items:[]}),"overflow-button":XL({name:"more",icon:j.some("more-drawer"),disabled:!1,tooltip:j.some("More..."),primary:!1,borderless:!1},j.none(),t.providers)},splitToolbarBehaviours:$F(t,e)}},YF=function(t){var e=KF(t),n=4,r=HF.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}});return HF.sketch(T(T({},e),{lazySink:t.getSink,getOverflowBounds:function(){var e=t.moreDrawerData.lazyHeader().element,r=Jr(e),o=mn(e),i=Jr(o),a=Math.max(o.dom.scrollHeight,i.height);return Xr(r.x+n,i.y,r.width-2*n,a)},parts:T(T({},e.parts),{overflow:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:t.attributes}}}),components:[r],markers:{overflowToggledClass:"tox-tbtn--enabled"}}))},XF=function(t){var e=UF.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}}),n=UF.parts.overflow({dom:{tag:"div",classes:["tox-toolbar__overflow"]}}),r=KF(t);return UF.sketch(T(T({},r),{components:[e,n],markers:{openClass:"tox-toolbar__overflow--open",closedClass:"tox-toolbar__overflow--closed",growingClass:"tox-toolbar__overflow--growing",shrinkingClass:"tox-toolbar__overflow--shrinking",overflowToggledClass:"tox-tbtn--enabled"},onOpened:function(t){t.getSystem().broadcastOn([OI()],{type:"opened"})},onClosed:function(t){t.getSystem().broadcastOn([OI()],{type:"closed"})}}))},ZF=function(t){var e=t.cyclicKeying?"cyclic":"acyclic";return BB.sketch({uid:t.uid,dom:{tag:"div",classes:["tox-toolbar"].concat(t.type===FO.scrolling?["tox-toolbar--scrolling"]:[])},components:[BB.parts.groups({})],toolbarBehaviours:$F(t,e)})},JF=function(t,e,n){var r={getSocket:function(e){return CB.getPart(e,t,"socket")},setSidebar:function(e,n){CB.getPart(e,t,"sidebar").each((function(t){return jV(t,n)}))},toggleSidebar:function(e,n){CB.getPart(e,t,"sidebar").each((function(t){return HV(t,n)}))},whichSidebar:function(e){return CB.getPart(e,t,"sidebar").bind(RV).getOrNull()},getHeader:function(e){return CB.getPart(e,t,"header")},getToolbar:function(e){return CB.getPart(e,t,"toolbar")},setToolbar:function(e,n){CB.getPart(e,t,"toolbar").each((function(t){t.getApis().setGroups(t,n)}))},setToolbars:function(e,n){CB.getPart(e,t,"multiple-toolbar").each((function(t){DB.setItems(t,n)}))},refreshToolbar:function(e){var n=CB.getPart(e,t,"toolbar");n.each((function(t){return t.getApis().refresh(t)}))},toggleToolbarDrawer:function(e){CB.getPart(e,t,"toolbar").each((function(t){Lt(t.getApis().toggle,(function(e){return e(t)}))}))},isToolbarDrawerToggled:function(e){return CB.getPart(e,t,"toolbar").bind((function(t){return j.from(t.getApis().isOpen).map((function(e){return e(t)}))})).getOr(!1)},getThrobber:function(e){return CB.getPart(e,t,"throbber")},focusToolbar:function(e){var n=CB.getPart(e,t,"toolbar").orThunk((function(){return CB.getPart(e,t,"multiple-toolbar")}));n.each((function(t){Tx.focusIn(t)}))},setMenubar:function(e,n){CB.getPart(e,t,"menubar").each((function(t){KI.setMenus(t,n)}))},focusMenubar:function(e){CB.getPart(e,t,"menubar").each((function(t){KI.focus(t)}))}};return{uid:t.uid,dom:t.dom,components:e,apis:r,behaviours:t.behaviours}},QF=EB.optional({factory:KI,name:"menubar",schema:[Ti("backstage")]}),tq=function(t){return t.type===FO.sliding?XF:t.type===FO.floating?YF:ZF},eq=EB.optional({factory:{sketch:function(t){return DB.sketch({uid:t.uid,dom:t.dom,listBehaviours:hf([Tx.config({mode:"acyclic",selector:".tox-toolbar"})]),makeItem:function(){return ZF({type:t.type,uid:oc("multiple-toolbar-item"),cyclicKeying:!1,initGroups:[],providers:t.providers,onEscape:function(){return t.onEscape(),j.some(!0)}})},setupItem:function(t,e,n,r){BB.setGroups(e,n)},shell:!0})}},name:"multiple-toolbar",schema:[Ti("dom"),Ti("onEscape")]}),nq=EB.optional({factory:{sketch:function(t){var e=tq(t),n={type:t.type,uid:t.uid,onEscape:function(){return t.onEscape(),j.some(!0)},cyclicKeying:!1,initGroups:[],getSink:t.getSink,providers:t.providers,moreDrawerData:{lazyToolbar:t.lazyToolbar,lazyMoreButton:t.lazyMoreButton,lazyHeader:t.lazyHeader},attributes:t.attributes};return e(n)}},name:"toolbar",schema:[Ti("dom"),Ti("onEscape"),Ti("getSink")]}),rq=EB.optional({factory:{sketch:BI},name:"header",schema:[Ti("dom")]}),oq=EB.optional({name:"socket",schema:[Ti("dom")]}),iq=EB.optional({factory:{sketch:VV},name:"sidebar",schema:[Ti("dom")]}),aq=EB.optional({factory:{sketch:nF},name:"throbber",schema:[Ti("dom")]}),uq=hg({name:"OuterContainer",factory:JF,configFields:[Ti("dom"),Ti("behaviours")],partFields:[rq,QF,nq,eq,oq,iq,aq],apis:{getSocket:function(t,e){return t.getSocket(e)},setSidebar:function(t,e,n){t.setSidebar(e,n)},toggleSidebar:function(t,e,n){t.toggleSidebar(e,n)},whichSidebar:function(t,e){return t.whichSidebar(e)},getHeader:function(t,e){return t.getHeader(e)},getToolbar:function(t,e){return t.getToolbar(e)},setToolbar:function(t,e,n){var r=G(n,(function(t){return GF(t)}));t.setToolbar(e,r)},setToolbars:function(t,e,n){var r=G(n,(function(t){return G(t,GF)}));t.setToolbars(e,r)},refreshToolbar:function(t,e){return t.refreshToolbar(e)},toggleToolbarDrawer:function(t,e){t.toggleToolbarDrawer(e)},isToolbarDrawerToggled:function(t,e){return t.isToolbarDrawerToggled(e)},getThrobber:function(t,e){return t.getThrobber(e)},setMenubar:function(t,e,n){t.setMenubar(e,n)},focusMenubar:function(t,e){t.focusMenubar(e)},focusToolbar:function(t,e){t.focusToolbar(e)}}}),cq="file edit view insert format tools table help",sq={file:{title:"File",items:"newdocument restoredraft | preview | export print | deleteallconversations"},edit:{title:"Edit",items:"undo redo | cut copy paste pastetext | selectall | searchreplace"},view:{title:"View",items:"code | visualaid visualchars visualblocks | spellchecker | preview fullscreen | showcomments"},insert:{title:"Insert",items:"image link media addcomment pageembed template codesample inserttable | charmap emoticons hr | pagebreak nonbreaking anchor toc | insertdatetime"},format:{title:"Format",items:"bold italic underline strikethrough superscript subscript codeformat | formats blockformats fontformats fontsizes align lineheight | forecolor backcolor | language | removeformat"},tools:{title:"Tools",items:"spellchecker spellcheckerlanguage | a11ycheck code wordcount"},table:{title:"Table",items:"inserttable | cell row column | advtablesort | tableprops deletetable"},help:{title:"Help",items:"help"}},lq=function(t,e,n){var r=ES(n).split(/[ ,]/);return{text:t.title,getItems:function(){return rt(t.items,(function(t){var n=t.toLowerCase();return 0===n.trim().length||q(r,(function(t){return t===n}))?[]:"separator"===n||"|"===n?[{type:"separator"}]:e.menuItems[n]?[e.menuItems[n]]:[]}))}}},fq=function(t){return"string"===typeof t?t.split(" "):t},dq=function(t,e){var n=T(T({},sq),e.menus),r=mt(e.menus).length>0,o=void 0===e.menubar||!0===e.menubar?fq(cq):fq(!1===e.menubar?"":e.menubar),i=X(o,(function(t){var n=Et(sq,t);return r?n||Ct(e.menus,t).exists((function(t){return Et(t,"items")})):n})),a=G(i,(function(r){var o=n[r];return lq({title:o.title,items:fq(o.items)},e,t)}));return X(a,(function(t){var e=function(t){return"separator"!==t.type};return t.getItems().length>0&&q(t.getItems(),e)}))},hq=function(t){var e=function(){t._skinLoaded=!0,mE(t)};return function(){t.initialized?e():t.on("init",e)}},pq=function(t,e){return function(){return vE(t,{message:e})}},mq=function(t,e,n){return new aO((function(r,o){n.load(e,r,o),t.on("remove",(function(){return n.unload(e)}))}))},vq=function(t,e){var n=e+"/skin.min.css";return mq(t,n,t.ui.styleSheetLoader)},gq=function(t,e){var n=zn(ee.fromDom(t.getElement()));if(n){var r=e+"/skin.shadowdom.min.css";return mq(t,r,dS.DOM.styleSheetLoader)}return aO.resolve()},bq=function(t,e){var n=pS(e);n&&e.contentCSS.push(n+(t?"/content.inline":"/content")+".min.css"),!1===vS(e)&&i(n)?aO.all([vq(e,n),gq(e,n)]).then(hq(e),pq(e,"Skin could not be loaded")):hq(e)()},yq=O(bq,!1),xq=O(bq,!0),wq=function(t,e){return function(n){var r=nd(),o=function(){n.setActive(t.formatter.match(e));var o=t.formatter.formatChanged(e,n.setActive);r.set(o)};return t.initialized?o():t.once("init",o),function(){t.off("init",o),r.clear()}}},_q=function(t,e,n){return function(r){var o=function(){return n(r)},i=function(){n(r),t.on(e,o)};return t.initialized?i():t.once("init",i),function(){t.off("init",i),t.off(e,o)}}},Oq=function(t){return function(e){return function(){t.undoManager.transact((function(){t.focus(),t.execCommand("mceToggleFormat",!1,e.format)}))}}},kq=function(t,e){return function(){return t.execCommand(e)}},Sq=function(t,e,n){var r=function(t,r,i,a){var u=e.shared.providers.translate(t.title);if("separator"===t.type)return j.some({type:"separator",text:u});if("submenu"===t.type){var c=rt(t.getStyleItems(),(function(t){return o(t,r,a)}));return 0===r&&c.length<=0?j.none():j.some({type:"nestedmenuitem",text:u,disabled:c.length<=0,getSubmenuItems:function(){return rt(t.getStyleItems(),(function(t){return o(t,r,a)}))}})}return j.some(T({type:"togglemenuitem",text:u,icon:t.icon,active:t.isSelected(a),disabled:i,onAction:n.onAction(t)},t.getStylePreview().fold((function(){return{}}),(function(t){return{meta:{style:t}}}))))},o=function(t,e,o){var i="formatter"===t.type&&n.isInvalid(t);return 0===e?i?[]:r(t,e,!1,o).toArray():r(t,e,i,o).toArray()},i=function(t){var e=n.getCurrentValue(),r=n.shouldHide?0:1;return rt(t,(function(t){return o(t,r,e)}))},a=function(t,e){return function(n,r){var o=e(),a=i(o),u=WL(a,qO.CLOSE_ON_EXECUTE,t,!1);r(u)}};return{validateItems:i,getFetch:a}},Cq=function(t,e,n){var r=n.dataset,o="basic"===r.type?function(){return G(r.data,(function(t){return PR(t,n.isSelectedFor,n.getPreviewFor)}))}:r.getData;return{items:Sq(t,e,n),getStyleItems:o}},Eq=function(t,e,n){var r=Cq(t,e,n),o=r.items,i=r.getStyleItems,a=function(t){return{getComponent:x(t)}},u=_q(t,"NodeChange",(function(t){var e=t.getComponent();n.updateText(e)}));return LL({text:n.icon.isSome()?j.none():n.text,icon:n.icon,tooltip:j.from(n.tooltip),role:j.none(),fetch:o.getFetch(e,i),onSetup:u,getApi:a,columns:1,presets:"normal",classes:n.icon.isSome()?[]:["bespoke"],dropdownBehaviours:[]},"tox-tbtn",e.shared)},Aq=function(t){return G(t,(function(t){var e=t,n=t,r=t.split("=");return r.length>1&&(e=r[0],n=r[1]),{title:e,format:n}}))},Tq=function(t){return{type:"basic",data:t}};(function(t){t[t["SemiColon"]=0]="SemiColon",t[t["Space"]=1]="Space"})(Yj||(Yj={}));var Mq,zq=function(t,e){return e===Yj.SemiColon?t.replace(/;$/,"").split(";"):t.split(" ")},Pq=function(t,e,n,r){var o=t.getParam(e,n,"string"),i=Aq(zq(o,r));return{type:"basic",data:i}},Nq=[{title:"Left",icon:"align-left",format:"alignleft",command:"JustifyLeft"},{title:"Center",icon:"align-center",format:"aligncenter",command:"JustifyCenter"},{title:"Right",icon:"align-right",format:"alignright",command:"JustifyRight"},{title:"Justify",icon:"align-justify",format:"alignjustify",command:"JustifyFull"}],Dq=function(t){var e=function(){return tt(Nq,(function(e){return t.formatter.match(e.format)}))},n=function(e){return function(){return t.formatter.match(e)}},r=function(t){return j.none},o=function(t){var n=e(),r=n.fold(x("left"),(function(t){return t.title.toLowerCase()}));Ou(t,DL,{icon:"align-"+r})},i=Tq(Nq),a=function(e){return function(){return tt(Nq,(function(t){return t.format===e.format})).each((function(e){return t.execCommand(e.command)}))}};return{tooltip:"Align",text:j.none(),icon:j.some("align-left"),isSelectedFor:n,getCurrentValue:j.none,getPreviewFor:r,onAction:a,updateText:o,dataset:i,shouldHide:!1,isInvalid:function(e){return!t.formatter.canApply(e.format)}}},Lq=function(t,e){return Eq(t,e,Dq(t))},jq=function(t,e){var n=Cq(t,e,Dq(t));t.ui.registry.addNestedMenuItem("align",{text:e.shared.providers.translate("Align"),getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})},Hq="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",Rq=["-apple-system","Segoe UI","Roboto","Helvetica Neue","sans-serif"],Bq=function(t){var e=t.split(/\s*,\s*/);return G(e,(function(t){return t.replace(/^['"]+|['"]+$/g,"")}))},Iq=function(t){var e=function(){var e=Bq(t.toLowerCase());return ot(Rq,(function(t){return e.indexOf(t.toLowerCase())>-1}))};return 0===t.indexOf("-apple-system")&&e()},Vq=function(t){var e="System Font",n=function(){var n=function(t){return t?Bq(t)[0]:""},r=t.queryCommandValue("FontName"),o=c.data,i=r?r.toLowerCase():"",a=tt(o,(function(t){var e=t.format;return e.toLowerCase()===i||n(e).toLowerCase()===n(i).toLowerCase()})).orThunk((function(){return jt(Iq(i),{title:e,format:i})}));return{matchOpt:a,font:r}},r=function(t){return function(e){return e.exists((function(e){return e.format===t}))}},o=function(){var t=n().matchOpt;return t},i=function(t){return function(){return j.some({tag:"div",styles:-1===t.indexOf("dings")?{"font-family":t}:{}})}},a=function(e){return function(){t.undoManager.transact((function(){t.focus(),t.execCommand("FontName",!1,e.format)}))}},u=function(t){var e=n(),r=e.matchOpt,o=e.font,i=r.fold(x(o),(function(t){return t.title}));Ou(t,NL,{text:i})},c=Pq(t,"font_formats",Hq,Yj.SemiColon);return{tooltip:"Fonts",text:j.some(e),icon:j.none(),isSelectedFor:r,getCurrentValue:o,getPreviewFor:i,onAction:a,updateText:u,dataset:c,shouldHide:!1,isInvalid:C}},Fq=function(t,e){return Eq(t,e,Vq(t))},qq=function(t,e){var n=Cq(t,e,Vq(t));t.ui.registry.addNestedMenuItem("fontformats",{text:e.shared.providers.translate("Fonts"),getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})},Uq="8pt 10pt 12pt 14pt 18pt 24pt 36pt",Wq={"8pt":"1","10pt":"2","12pt":"3","14pt":"4","18pt":"5","24pt":"6","36pt":"7"},Gq={"xx-small":"7pt","x-small":"8pt",small:"10pt",medium:"12pt",large:"14pt","x-large":"18pt","xx-large":"24pt"},$q=function(t,e){var n=Math.pow(10,e);return Math.round(t*n)/n},Kq=function(t,e){return/[0-9.]+px$/.test(t)?$q(72*parseInt(t,10)/96,e||0)+"pt":Ct(Gq,t).getOr(t)},Yq=function(t){return Ct(Wq,t).getOr("")},Xq=function(t){var e=function(){var e=j.none(),n=u.data,r=t.queryCommandValue("FontSize");if(r)for(var o=function(t){var o=Kq(r,t),i=Yq(o);e=tt(n,(function(t){return t.format===r||t.format===o||t.format===i}))},i=3;e.isNone()&&i>=0;i--)o(i);return{matchOpt:e,size:r}},n=function(t){return function(e){return e.exists((function(e){return e.format===t}))}},r=function(){var t=e().matchOpt;return t},o=x(j.none),i=function(e){return function(){t.undoManager.transact((function(){t.focus(),t.execCommand("FontSize",!1,e.format)}))}},a=function(t){var n=e(),r=n.matchOpt,o=n.size,i=r.fold(x(o),(function(t){return t.title}));Ou(t,NL,{text:i})},u=Pq(t,"fontsize_formats",Uq,Yj.Space);return{tooltip:"Font sizes",text:j.some("12pt"),icon:j.none(),isSelectedFor:n,getPreviewFor:o,getCurrentValue:r,onAction:i,updateText:a,dataset:u,shouldHide:!1,isInvalid:C}},Zq=function(t,e){return Eq(t,e,Xq(t))},Jq=function(t,e){var n=Cq(t,e,Xq(t));t.ui.registry.addNestedMenuItem("fontsizes",{text:"Font sizes",getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})},Qq=function(t,e){var n=e(),r=G(n,(function(t){return t.format}));return j.from(t.formatter.closest(r)).bind((function(t){return tt(n,(function(e){return e.format===t}))})).orThunk((function(){return jt(t.formatter.match("p"),{title:"Paragraph",format:"p"})}))},tU="Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre",eU=function(t){var e="Paragraph",n=function(e){return function(){return t.formatter.match(e)}},r=function(e){return function(){var n=t.formatter.get(e);return j.some({tag:n.length>0&&(n[0].inline||n[0].block)||"div",styles:t.dom.parseStyle(t.formatter.getCssText(e))})}},o=function(n){var r=Qq(t,(function(){return i.data})),o=r.fold(x(e),(function(t){return t.title}));Ou(n,NL,{text:o})},i=Pq(t,"block_formats",tU,Yj.SemiColon);return{tooltip:"Blocks",text:j.some(e),icon:j.none(),isSelectedFor:n,getCurrentValue:j.none,getPreviewFor:r,onAction:Oq(t),updateText:o,dataset:i,shouldHide:!1,isInvalid:function(e){return!t.formatter.canApply(e.format)}}},nU=function(t,e){return Eq(t,e,eU(t))},rU=function(t,e){var n=Cq(t,e,eU(t));t.ui.registry.addNestedMenuItem("blockformats",{text:"Blocks",getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})},oU=function(t,e){var n="Paragraph",r=function(e){return function(){return t.formatter.match(e)}},o=function(e){return function(){var n=t.formatter.get(e);return void 0!==n?j.some({tag:n.length>0&&(n[0].inline||n[0].block)||"div",styles:t.dom.parseStyle(t.formatter.getCssText(e))}):j.none()}},i=function(e){var r=function(t){var e=t.items;return void 0!==e&&e.length>0?rt(e,r):[{title:t.title,format:t.format}]},o=rt(zR(t),r),i=Qq(t,x(o)),a=i.fold(x(n),(function(t){return t.title}));Ou(e,NL,{text:a})};return{tooltip:"Formats",text:j.some(n),icon:j.none(),isSelectedFor:r,getCurrentValue:j.none,getPreviewFor:o,onAction:Oq(t),updateText:i,shouldHide:t.getParam("style_formats_autohide",!1,"boolean"),isInvalid:function(e){return!t.formatter.canApply(e.format)},dataset:e}},iU=function(t,e){var n=T({type:"advanced"},e.styleselect);return Eq(t,e,oU(t,n))},aU=function(t,e){var n=T({type:"advanced"},e.styleselect),r=Cq(t,e,oU(t,n));t.ui.registry.addNestedMenuItem("formats",{text:"Formats",getSubmenuItems:function(){return r.items.validateItems(r.getStyleItems())}})},uU=function(t,e){var n=function(n,r){t.updateState.each((function(t){var o=t(n,r);e.set(o)})),t.renderComponents.each((function(t){var o=t(r,e.get()),i=G(o,n.getSystem().build);qp(n,i)}))};return Au([Pu(tu(),(function(e,r){var o=r;if(!o.universal){var i=t.channel;F(o.channels,i)&&n(e,o.data)}})),Fu((function(e,r){t.initialData.each((function(t){n(e,t)}))}))])},cU=Object.freeze({__proto__:null,events:uU}),sU=function(t,e,n){return n},lU=Object.freeze({__proto__:null,getState:sU}),fU=[Ti("channel"),Ii("renderComponents"),Ii("updateState"),Ii("initialData")],dU=function(){var t=oa(j.none()),e=function(){return t.set(j.none())},n=function(){return t.get().getOr("none")};return{readState:n,get:t.get,set:t.set,clear:e}},hU=Object.freeze({__proto__:null,init:dU}),pU=mf({fields:fU,name:"reflecting",active:cU,apis:lU,state:hU}),mU=x([Ti("toggleClass"),Ti("fetch"),sl("onExecute"),Ki("getHotspot",j.some),Ki("getAnchorOverrides",x({})),Bd(),sl("onItemExecute"),Ii("lazySink"),Ti("dom"),ul("onOpen"),ev("splitDropdownBehaviours",[bM,Tx,Xx]),Ki("matchWidth",!1),Ki("useMinWidth",!1),Ki("eventOrder",{}),Ii("role")].concat(NM())),vU=Nv({factory:O_,schema:[Ti("dom")],name:"arrow",defaults:function(){return{buttonBehaviours:hf([Xx.revoke()])}},overrides:function(t){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(e){e.getSystem().getByUid(t.uid).each(ku)},buttonBehaviours:hf([mw.config({toggleOnExecute:!1,toggleClass:t.toggleClass})])}}}),gU=Nv({factory:O_,schema:[Ti("dom")],name:"button",defaults:function(){return{buttonBehaviours:hf([Xx.revoke()])}},overrides:function(t){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(e){e.getSystem().getByUid(t.uid).each((function(n){t.onExecute(n,e)}))}}}}),bU=x([vU,gU,Lv({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:t.text}}}},schema:[Ti("text")],name:"aria-descriptor"}),Dv({schema:[ol()],name:"menu",defaults:function(t){return{onExecute:function(e,n){e.getSystem().getByUid(t.uid).each((function(r){t.onItemExecute(r,e,n)}))}}}}),xM()]),yU=function(t,e,n,r){var o,i=function(t){bg.getCurrent(t).each((function(t){rb.highlightFirst(t),Tx.focusIn(t)}))},a=function(e){var n=i;EM(t,w,e,r,n,WT.HighlightFirst).get(v)},u=function(t){return a(t),j.some(!0)},c=function(e){var n=Yv(e,t,"button");return ku(n),j.some(!0)},s=T(T({},Au([Fu((function(e,n){var r=Kv(e,t,"aria-descriptor");r.each((function(t){var n=oc("aria");In(t.element,"id",n),In(e.element,"aria-describedby",n)}))}))])),gw(j.some(a))),l={repositionMenus:function(t){mw.isOn(t)&&PM(t)}};return{uid:t.uid,dom:t.dom,components:e,apis:l,eventOrder:T(T({},t.eventOrder),(o={},o[eu()]=["disabling","toggling","alloy.base.behaviour"],o)),events:s,behaviours:rv(t.splitDropdownBehaviours,[bM.config({others:{sandbox:function(e){var n=Yv(e,t,"arrow"),r={onOpen:function(){mw.on(n),mw.on(e)},onClose:function(){mw.off(n),mw.off(e)}};return zM(t,e,r)}}}),Tx.config({mode:"special",onSpace:c,onEnter:c,onDown:u}),Xx.config({}),mw.config({toggleOnExecute:!1,aria:{mode:"expanded"}})]),domModification:{attributes:{role:t.role.getOr("button"),"aria-haspopup":!0}}}},xU=hg({name:"SplitDropdown",configFields:mU(),partFields:bU(),factory:yU,apis:{repositionMenus:function(t,e){return t.repositionMenus(e)}}}),wU=function(t){return{isDisabled:function(){return Hg.isDisabled(t)},setDisabled:function(e){return Hg.set(t,e)}}},_U=function(t){return{setActive:function(e){mw.set(t,e)},isActive:function(){return mw.isOn(t)},isDisabled:function(){return Hg.isDisabled(t)},setDisabled:function(e){return Hg.set(t,e)}}},OU=function(t,e){return t.map((function(t){return{"aria-label":e.translate(t),title:e.translate(t)}})).getOr({})},kU=oc("focus-button"),SU=function(t,e,n,r,o,i){var a;return{dom:{tag:"button",classes:["tox-tbtn"].concat(e.isSome()?["tox-tbtn--select"]:[]),attributes:OU(n,i)},components:yC([t.map((function(t){return EL(t,i.icons)})),e.map((function(t){return TL(t,"tox-tbtn",i)}))]),eventOrder:(a={},a[Na()]=["focusing","alloy.base.behaviour","common-button-display-events"],a),buttonBehaviours:hf([hC.toolbarButton(i.isDisabled),cC(),Vx("common-button-display-events",[Pu(Na(),(function(t,e){e.event.prevent(),_u(t,kU)}))])].concat(r.map((function(n){return pU.config({channel:n,initialData:{icon:t,text:e},renderComponents:function(t,e){return yC([t.icon.map((function(t){return EL(t,i.icons)})),t.text.map((function(t){return TL(t,"tox-tbtn",i)}))])}})})).toArray()).concat(o.getOr([])))}},CU=function(t,e,n,r){var o=e.shared;return TF.sketch({lazySink:o.getSink,fetch:function(){return tM.nu((function(e){e(G(n(t.items),GF))}))},markers:{toggledClass:"tox-tbtn--enabled"},parts:{button:SU(t.icon,t.text,t.tooltip,j.none(),j.none(),o.providers),toolbar:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:r}}}})},EU=function(t,e,n){var r=oa(v),o=SU(t.icon,t.text,t.tooltip,j.none(),j.none(),n);return O_.sketch({dom:o.dom,components:o.components,eventOrder:PL,buttonBehaviours:hf([Vx("toolbar-button-events",[zL({onAction:t.onAction,getApi:e.getApi}),mC(e,r),vC(e,r)]),hC.toolbarButton((function(){return t.disabled||n.isDisabled()})),cC()].concat(e.toolbarButtonBehaviours))})},AU=function(t,e){return TU(t,e,[])},TU=function(t,e,n){return EU(t,{toolbarButtonBehaviours:[].concat(n.length>0?[Vx("toolbarButtonWith",n)]:[]),getApi:wU,onSetup:t.onSetup},e)},MU=function(t,e){return zU(t,e,[])},zU=function(t,e,n){return _o(EU(t,{toolbarButtonBehaviours:[Bx.config({}),mw.config({toggleClass:"tox-tbtn--enabled",aria:{mode:"pressed"},toggleOnExecute:!1})].concat(n.length>0?[Vx("toolbarToggleButtonWith",n)]:[]),getApi:_U,onSetup:t.onSetup},e))},PU=function(t,e,n){return function(r){return tM.nu((function(t){return e.fetch(t)})).map((function(o){return j.from(PA(_o(nA(oc("menu-value"),o,(function(n){e.onItemAction(t(r),n)}),e.columns,e.presets,qO.CLOSE_ON_EXECUTE,e.select.getOr(C),n),{movement:oA(e.columns,e.presets),menuBehaviours:Jk.unnamedEvents("auto"!==e.columns?[]:[Fu((function(t,n){Yk(t,4,lk(e.presets)).each((function(e){var n=e.numRows,r=e.numColumns;Tx.setGridSize(t,n,r)}))}))])})))}))}},NU=function(t,e){var n,r=oc("channel-update-split-dropdown-display"),o=function(t){return{isDisabled:function(){return Hg.isDisabled(t)},setDisabled:function(e){return Hg.set(t,e)},setIconFill:function(e,n){Rs(t.element,'svg path[id="'+e+'"], rect[id="'+e+'"]').each((function(t){In(t,"fill",n)}))},setIconStroke:function(e,n){Rs(t.element,'svg path[id="'+e+'"], rect[id="'+e+'"]').each((function(t){In(t,"stroke",n)}))},setActive:function(e){In(t.element,"aria-pressed",e),Rs(t.element,"span").each((function(n){t.getSystem().getByDom(n).each((function(t){return mw.set(t,e)}))}))},isActive:function(){return Rs(t.element,"span").exists((function(e){return t.getSystem().getByDom(e).exists(mw.isOn)}))}}},i=oa(v),a={getApi:o,onSetup:t.onSetup};return xU.sketch({dom:{tag:"div",classes:["tox-split-button"],attributes:T({"aria-pressed":!1},OU(t.tooltip,e.providers))},onExecute:function(e){t.onAction(o(e))},onItemExecute:function(t,e,n){},splitDropdownBehaviours:hf([hC.splitButton(e.providers.isDisabled),cC(),Vx("split-dropdown-events",[Pu(kU,Xx.focus),mC(a,i),vC(a,i)]),VM.config({})]),eventOrder:(n={},n[du()]=["alloy.base.behaviour","split-dropdown-events"],n),toggleClass:"tox-tbtn--enabled",lazySink:e.getSink,fetch:PU(o,t,e.providers),parts:{menu:vk(!1,t.columns,t.presets)},components:[xU.parts.button(SU(t.icon,t.text,j.none(),j.some(r),j.some([mw.config({toggleClass:"tox-tbtn--enabled",toggleOnExecute:!1})]),e.providers)),xU.parts.arrow({dom:{tag:"button",classes:["tox-tbtn","tox-split-button__chevron"],innerHtml:z_("chevron-down",e.providers.icons)},buttonBehaviours:hf([hC.splitButton(e.providers.isDisabled),cC(),D_()])}),xU.parts["aria-descriptor"]({text:e.providers.translate("To open the popup, press Shift+Enter")})]})},DU=[{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"]}],LU=function(t,e){return function(n,r,o){var i=t(n).mapError((function(t){return Oi(t)})).getOrDie();return e(i,r,o)}},jU={button:LU(CO,(function(t,e){return AU(t,e.backstage.shared.providers)})),togglebutton:LU(TO,(function(t,e){return MU(t,e.backstage.shared.providers)})),menubutton:LU(UI,(function(t,e){return $L(t,"tox-tbtn",e.backstage,j.none())})),splitbutton:LU(GI,(function(t,e){return NU(t,e.backstage.shared)})),grouptoolbarbutton:LU(VI,(function(t,e,n){var r,o=n.ui.registry.getAll().buttons,i=function(t){return UU(n,{buttons:o,toolbar:t,allowToolbarGroups:!1},e,j.none())},a=(r={},r[Hd]=e.backstage.shared.header.isPositionedAtTop()?Bf.TopToBottom:Bf.BottomToTop,r);switch(NS(n)){case FO.floating:return CU(t,e.backstage,i,a);default:throw new Error("Toolbar groups are only supported when using floating toolbar mode")}})),styleSelectButton:function(t,e){return iU(t,e.backstage)},fontsizeSelectButton:function(t,e){return Zq(t,e.backstage)},fontSelectButton:function(t,e){return Fq(t,e.backstage)},formatButton:function(t,e){return nU(t,e.backstage)},alignMenuButton:function(t,e){return Lq(t,e.backstage)}},HU=function(t,e,n){return Ct(jU,t.type).fold((function(){return console.error("skipping button defined by",t),j.none()}),(function(r){return j.some(r(t,e,n))}))},RU={styleselect:jU.styleSelectButton,fontsizeselect:jU.fontsizeSelectButton,fontselect:jU.fontSelectButton,formatselect:jU.formatButton,align:jU.alignMenuButton},BU=function(t){var e=G(DU,(function(e){var n=X(e.items,(function(e){return Et(t,e)||Et(RU,e)}));return{name:e.name,items:n}}));return X(e,(function(t){return t.items.length>0}))},IU=function(t){var e=t.split("|");return G(e,(function(t){return{items:t.trim().split(" ")}}))},VU=function(t){return m(t,(function(t){return Et(t,"name")&&Et(t,"items")}))},FU=function(t){var e=t.toolbar,n=t.buttons;return!1===e?[]:void 0===e||!0===e?BU(n):i(e)?IU(e):VU(e)?e:(console.error("Toolbar type should be string, string[], boolean or ToolbarGroup[]"),[])},qU=function(t,e,n,r,o,i){return Ct(e,n.toLowerCase()).orThunk((function(){return i.bind((function(t){return pt(t,(function(t){return Ct(e,t+n.toLowerCase())}))}))})).fold((function(){return Ct(RU,n.toLowerCase()).map((function(e){return e(t,o)})).orThunk((function(){return j.none()}))}),(function(e){return"grouptoolbarbutton"!==e.type||r?HU(e,o,t):(console.warn("Ignoring the '"+n+"' toolbar button. Group toolbar buttons are only supported when using floating toolbar mode and cannot be nested."),j.none())}))},UU=function(t,e,n,r){var o=FU(e),i=G(o,(function(o){var i=rt(o.items,(function(o){return 0===o.trim().length?[]:qU(t,e.buttons,o,e.allowToolbarGroups,n,r).toArray()}));return{title:j.from(t.translate(o.name)),items:i}}));return X(i,(function(t){return t.items.length>0}))},WU=function(t,e,n,r){var o=e.outerContainer,a=n.toolbar,u=n.buttons;if(m(a,i)){var c=a.map((function(e){var o={toolbar:e,buttons:u,allowToolbarGroups:n.allowToolbarGroups};return UU(t,o,{backstage:r},j.none())}));uq.setToolbars(o,c)}else uq.setToolbar(o,UU(t,n,{backstage:r},j.none()))},GU=en(),$U=GU.os.isiOS()&&GU.os.version.major<=12,KU=function(t,e){var n=t.dom,r=t.getWin(),o=t.getDoc().documentElement,i=oa(lr(r.innerWidth,r.innerHeight)),a=oa(lr(o.offsetWidth,o.offsetHeight)),u=function(){var e=i.get();e.left===r.innerWidth&&e.top===r.innerHeight||(i.set(lr(r.innerWidth,r.innerHeight)),bE(t))},c=function(){var e=t.getDoc().documentElement,n=a.get();n.left===e.offsetWidth&&n.top===e.offsetHeight||(a.set(lr(e.offsetWidth,e.offsetHeight)),bE(t))},s=function(e){return yE(t,e)};n.bind(r,"resize",u),n.bind(r,"scroll",s);var l=ud(ee.fromDom(t.getBody()),"load",c),f=e.uiMothership.element;t.on("hide",(function(){Kn(f,"display","none")})),t.on("show",(function(){nr(f,"display")})),t.on("NodeChange",c),t.on("remove",(function(){l.unbind(),n.unbind(r,"resize",u),n.unbind(r,"scroll",s),r=null}))},YU=function(t,e,n,r,o){var i=oa(0),a=e.outerContainer;yq(t);var u=ee.fromDom(o.targetNode),c=Mn(Tn(u));Xp(u,e.mothership),Yp(c,e.uiMothership),t.on("PostRender",(function(){WU(t,e,n,r),i.set(t.getWin().innerWidth),uq.setMenubar(a,dq(t,n)),uq.setSidebar(a,n.sidebar),KU(t,e)}));var s=uq.getSocket(a).getOrDie("Could not find expected socket element");if($U){Yn(s.element,{overflow:"scroll","-webkit-overflow-scrolling":"touch"});var l=q_((function(){t.fire("ScrollContent")}),20),f=ad(s.element,"scroll",l.throttle);t.on("remove",f.unbind)}uC(t,e),t.addCommand("ToggleSidebar",(function(e,n){uq.toggleSidebar(a,n),t.fire("ToggleSidebar")})),t.addQueryValueHandler("ToggleSidebar",(function(){return uq.whichSidebar(a)}));var d=NS(t),h=function(){uq.refreshToolbar(e.outerContainer)};d!==FO.sliding&&d!==FO.floating||t.on("ResizeWindow ResizeEditor ResizeContent",(function(){var e=t.getWin().innerWidth;e!==i.get()&&(h(),i.set(e))}));var p={enable:function(){aC(e,!1)},disable:function(){aC(e,!0)},isDisabled:function(){return Hg.isDisabled(a)}};return{iframeContainer:s.element.dom,editorContainer:a.element.dom,api:p}},XU=Object.freeze({__proto__:null,render:YU}),ZU=function(t){var e=/^[0-9\.]+(|px)$/i;return e.test(""+t)?j.some(parseInt(""+t,10)):j.none()},JU=function(t){return p(t)?t+"px":t},QU=function(t,e,n){var r=e.filter((function(e){return te}));return r.or(o).getOr(t)},tW=function(t){var e=gS(t),n=xS(t),r=_S(t);return ZU(e).map((function(t){return QU(t,n,r)}))},eW=function(t){var e=tW(t);return e.getOr(gS(t))},nW=function(t){var e=bS(t),n=yS(t),r=wS(t);return ZU(e).map((function(t){return QU(t,n,r)}))},rW=function(t){var e=nW(t);return e.getOr(bS(t))},oW=function(t,e,n,r,o){var i=n.uiMothership,a=n.outerContainer,u=dS.DOM,c=FS(t),s=WS(t),l=wS(t).or(nW(t)),f=r.shared.header,d=f.isPositionedAtTop,h=NS(t),p=h===FO.sliding||h===FO.floating,m=oa(!1),v=function(){return m.get()&&!t.removed},g=function(t){return p?t.fold(x(0),(function(t){return t.components().length>1?ar(t.components()[1].element):0})):0},b=function(n){switch(jS(t)){case PS.auto:var r=uq.getToolbar(a),o=g(r),i=ar(n.element)-o,u=Zr(e),c=u.y>i;if(c)return"top";var s=mn(e),l=Math.max(s.dom.scrollHeight,ar(s)),f=u.bottom=n&&t.bottom-e.y>=n},wW=function(t){var e=t.getBoundingClientRect();if(e.height<=0&&e.width<=0){var n=Sn(ee.fromDom(t.startContainer),t.startOffset).element,r=fe(n)?gn(n):j.some(n);return r.filter(le).map((function(t){return t.dom.getBoundingClientRect()})).getOr(e)}return e},_W=function(t){var e=t.selection.getRng(),n=wW(e);if(t.inline){var r=Hr();return Xr(r.left+n.left,r.top+n.top,n.width,n.height)}var o=Jr(ee.fromDom(t.getBody()));return Xr(o.x+n.left,o.y+n.top,n.width,n.height)},OW=function(t,e){return e.filter(jn).map(Jr).getOrThunk((function(){return _W(t)}))},kW=function(t,e,n){var r=Math.max(t.x+n,e.x),o=Math.min(t.right-n,e.right);return{x:r,width:o-r}},SW=function(t,e,n,r,o,i){var a=ee.fromDom(t.getContainer()),u=Rs(a,".tox-editor-header").getOr(a),c=Zr(u),s=c.y>=e.bottom,l=r&&!s;if(t.inline&&l)return{y:Math.max(c.bottom+i,n.y),bottom:n.bottom};if(t.inline&&!l)return{y:n.y,bottom:Math.min(c.y-i,n.bottom)};var f="line"===o?Zr(a):e;return l?{y:Math.max(c.bottom+i,n.y),bottom:Math.min(f.bottom-i,n.bottom)}:{y:Math.max(f.y+i,n.y),bottom:Math.min(c.y-i,n.bottom)}},CW=function(t,e,n,r){void 0===r&&(r=0);var o=Vr(window),i=Zr(ee.fromDom(t.getContentAreaContainer())),a=AS(t)||TS(t)||zS(t),u=kW(i,o,r),c=u.x,s=u.width;if(t.inline&&!a)return Xr(c,o.y,s,o.height);var l=e.header.isPositionedAtTop(),f=SW(t,i,o,l,n,r),d=f.y,h=f.bottom;return Xr(c,d,s,h-d)},EW=12,AW={valignCentre:[],alignCentre:[],alignLeft:["tox-pop--align-left"],alignRight:["tox-pop--align-right"],right:["tox-pop--right"],left:["tox-pop--left"],bottom:["tox-pop--bottom"],top:["tox-pop--top"],inset:["tox-pop--inset"]},TW={maxHeightFunction:Ed(),maxWidthFunction:wF()},MW=function(t,e){var n=t.selection.getRng(),r=Sn(ee.fromDom(n.startContainer),n.startOffset);return n.startContainer===n.endContainer&&n.startOffset===n.endOffset-1&&sn(r.element,e)},zW=function(t,e,n){var r=Qn(t,"position");Kn(t,"position",e);var o=n(t);return r.each((function(e){return Kn(t,"position",e)})),o},PW=function(t){return"node"===t},NW=function(t,e,n,r,o){var i=_W(t),a=r.lastElement().exists((function(t){return sn(n,t)}));if(MW(t,n))return a?b_:h_;if(a)return zW(e,r.getMode(),(function(){var t=xW(i,Zr(e));return t&&!r.isReposition()?x_:b_}));var u="fixed"===r.getMode()?o.y+Hr().top:o.y,c=ar(e)+EW;return u+c<=i.y?h_:p_},DW=function(t,e,n,r){var o=function(e){return function(r,o,i,a,u){var c=NW(t,a,e,n,u),s=T(T({},r),{y:u.y,height:u.height});return T(T({},c(s,o,i,a,u)),{alwaysFit:!0})}},i=function(t){return PW(r)?[o(t)]:[]},a={onLtr:function(t){return[Wl,Gl,ql,Vl,Ul,Fl].concat(i(t))},onRtl:function(t){return[Wl,Gl,Ul,Fl,ql,Vl].concat(i(t))}},u={onLtr:function(t){return[Gl,Vl,Fl,ql,Ul,Wl].concat(i(t))},onRtl:function(t){return[Gl,Fl,Vl,Ul,ql,Wl].concat(i(t))}};return e?u:a},LW=function(t,e,n,r){return"line"===e?{bubble:Pd(EW,0,AW),layouts:{onLtr:function(){return[$l]},onRtl:function(){return[Kl]}},overrides:TW}:{bubble:Pd(0,EW,AW,1/EW),layouts:DW(t,n,r,e),overrides:TW}},jW=function(t,e){var n=X(e,(function(e){return e.predicate(t.dom)})),r=Y(n,(function(t){return"contexttoolbar"===t.type})),o=r.pass,i=r.fail;return{contextToolbars:o,contextForms:i}},HW=function(t){if(t.length<=1)return t;var e=function(e){return q(t,(function(t){return t.position===e}))},n=function(e){return X(t,(function(t){return t.position===e}))},r=e("selection"),o=e("node");if(r||o){if(o&&r){var i=n("node"),a=G(n("selection"),(function(t){return T(T({},t),{position:"node"})}));return i.concat(a)}return n(r?"selection":"node")}return n("line")},RW=function(t){if(t.length<=1)return t;var e=function(e){return tt(t,(function(t){return t.position===e}))},n=e("selection").orThunk((function(){return e("node")})).orThunk((function(){return e("line")})).map((function(t){return t.position}));return n.fold((function(){return[]}),(function(e){return X(t,(function(t){return t.position===e}))}))},BW=function(t,e,n){var r=jW(t,e);if(r.contextForms.length>0)return j.some({elem:t,toolbars:[r.contextForms[0]]});var o=jW(t,n);if(o.contextForms.length>0)return j.some({elem:t,toolbars:[o.contextForms[0]]});if(r.contextToolbars.length>0||o.contextToolbars.length>0){var i=HW(r.contextToolbars.concat(o.contextToolbars));return j.some({elem:t,toolbars:i})}return j.none()},IW=function(t,e,n){return t(e)?j.none():ya(e,(function(t){if(le(t)){var e=jW(t,n.inNodeScope),r=e.contextToolbars,o=e.contextForms,i=o.length>0?o:RW(r);return i.length>0?j.some({elem:t,toolbars:i}):j.none()}return j.none()}),t)},VW=function(t,e){var n=ee.fromDom(e.getBody()),r=function(t){return sn(t,n)},o=function(t){return!r(t)&&!dn(n,t)},i=ee.fromDom(e.selection.getNode());return o(i)?j.none():BW(i,t.inNodeScope,t.inEditorScope).orThunk((function(){return IW(r,i,t)}))},FW=function(t,e){var n={},r=[],o=[],i={},a={},u=function(t,u){var c=wi(HO(u));n[t]=c,c.launch.map((function(n){i["form:"+t]=T(T({},u.launch),{type:"contextformtogglebutton"===n.type?"togglebutton":"button",onAction:function(){e(c)}})})),"editor"===c.scope?o.push(c):r.push(c),a[t]=c},c=function(t,e){BO(e).each((function(n){"editor"===e.scope?o.push(n):r.push(n),a[t]=n}))},s=mt(t);return $(s,(function(e){var n=t[e];"contextform"===n.type?u(e,n):"contexttoolbar"===n.type&&c(e,n)})),{forms:n,inNodeScope:r,inEditorScope:o,lookupTable:a,formNavigators:i}},qW=oc("forward-slide"),UW=oc("backward-slide"),WW=oc("change-slide-event"),GW="tox-pop--resizing",$W=function(t){var e=oa([]);return e_.sketch({dom:{tag:"div",classes:["tox-pop"]},fireDismissalEventInstead:{event:"doNotDismissYet"},onShow:function(t){e.set([]),e_.getContent(t).each((function(t){nr(t.element,"visibility")})),us(t.element,GW),nr(t.element,"width")},inlineBehaviours:hf([Vx("context-toolbar-events",[Vu(Ga(),(function(t,e){"width"===e.event.raw.propertyName&&(us(t.element,GW),nr(t.element,"width"))})),Pu(WW,(function(t,e){var n=t.element;nr(n,"width");var r=gr(n);e_.setContent(t,e.event.contents),is(n,GW);var o=gr(n);Kn(n,"width",r+"px"),e_.getContent(t).each((function(t){e.event.focus.bind((function(t){return Of(t),Ef(n)})).orThunk((function(){return Tx.focusIn(t),Cf(Tn(n))}))})),w_.setTimeout((function(){Kn(t.element,"width",o+"px")}),0)})),Pu(qW,(function(t,n){e_.getContent(t).each((function(n){e.set(e.get().concat([{bar:n,focus:Cf(Tn(t.element))}]))})),Ou(t,WW,{contents:n.event.forwardContents,focus:j.none()})})),Pu(UW,(function(t,n){dt(e.get()).each((function(n){e.set(e.get().slice(0,e.get().length-1)),Ou(t,WW,{contents:As(n.bar),focus:n.focus})}))}))]),Tx.config({mode:"special",onEscape:function(n){return dt(e.get()).fold((function(){return t.onEscape()}),(function(t){return _u(n,UW),j.some(!0)}))}})]),lazySink:function(){return ro.value(t.sink)}})},KW="tox-pop--transition",YW=function(t,e,n,r){var o=r.backstage,i=o.shared,a=en().deviceType.isTouch,u=od(),c=od(),s=od(),l=Es($W({sink:n,onEscape:function(){return t.focus(),j.some(!0)}})),f=function(){var e=s.get().getOr("node"),n=PW(e)?1:0;return CW(t,i,e,n)},d=function(){return!t.removed&&!(a()&&o.isContextMenuOpen())},h=function(t){return Tt(Nt(t,u.get(),sn),!0)},p=function(){if(d()){var e=f(),n=Tt(s.get(),"node")?OW(t,u.get()):_W(t);return e.height<=0||!xW(n,e)}return!0},m=function(){u.clear(),c.clear(),s.clear(),e_.hide(l)},g=function(){if(e_.isOpen(l)){var t=l.element;nr(t,"display"),p()?Kn(t,"display","none"):(c.set(0),e_.reposition(l))}},b=function(e){return{dom:{tag:"div",classes:["tox-pop__dialog"]},components:[e],behaviours:hf([Tx.config({mode:"acyclic"}),Vx("pop-dialog-wrap-events",[Fu((function(e){t.shortcuts.add("ctrl+F9","focus statusbar",(function(){return Tx.focusIn(e)}))})),qu((function(e){t.shortcuts.remove("ctrl+F9")}))])])}},y=pe((function(){return FW(e,(function(t){var e=_([t]);Ou(l,qW,{forwardContents:b(e)})}))})),x=function(e,n){return UU(t,{buttons:e,toolbar:n.items,allowToolbarGroups:!1},r,j.some(["form:"]))},w=function(t,e){return yW.buildInitGroups(t,e)},_=function(e){var n=t.ui.registry.getAll().buttons,r=y(),o=T(T({},n),r.formNavigators),a=NS(t)===FO.scrolling?FO.scrolling:FO.default,u=nt(G(e,(function(t){return"contexttoolbar"===t.type?x(o,t):w(t,i.providers)})));return ZF({type:a,uid:oc("context-toolbar"),initGroups:u,onEscape:j.none,cyclicKeying:!0,providers:i.providers})},O=function(e,r){var o="node"===e?i.anchors.node(r):i.anchors.cursor(),s=LW(t,e,a(),{lastElement:u.get,isReposition:function(){return Tt(c.get(),0)},getMode:function(){return Rp.getMode(n)}});return _o(o,s)},k=function(t,e){if(S.cancel(),d()){var r=_(t),o=t[0].position,i=O(o,e);s.set(o),c.set(1);var a=l.element;nr(a,"display"),h(e)||(us(a,KW),Rp.reset(n,l)),e_.showWithinBounds(l,b(r),{anchor:i,transition:{classes:[KW],mode:"placement"}},(function(){return j.some(f())})),e.fold(u.clear,u.set),p()&&Kn(a,"display","none")}},S=U_((function(){if(t.hasFocus()&&!t.removed)if(cs(l.element,KW))S.throttle();else{var e=y();VW(e,t).fold(m,(function(t){k(t.toolbars,j.some(t.elem))}))}}),17);t.on("init",(function(){t.on("remove",m),t.on("ScrollContent ScrollWindow ObjectResized ResizeEditor longpress",g),t.on("click keyup focus SetContent",S.throttle),t.on(lW,m),t.on(sW,(function(e){var n=y();Ct(n.lookupTable,e.toolbarKey).each((function(n){k([n],jt(e.target!==t,e.target)),e_.getContent(l).each(Tx.focusIn)}))})),t.on("focusout",(function(e){w_.setEditorTimeout(t,(function(){Ef(n.element).isNone()&&Ef(l.element).isNone()&&m()}),0)})),t.on("SwitchMode",(function(){t.mode.isReadOnly()&&m()})),t.on("AfterProgressState",(function(e){e.state?m():t.hasFocus()&&S.throttle()})),t.on("NodeChange",(function(t){Ef(l.element).fold(S.throttle,v)}))}))},XW=function(t){var e=[{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"}];$(e,(function(e){t.ui.registry.addToggleButton(e.name,{tooltip:e.text,icon:e.icon,onAction:kq(t,e.cmd),onSetup:wq(t,e.name)})})),t.ui.registry.addButton("alignnone",{tooltip:"No alignment",icon:"align-none",onAction:kq(t,"JustifyNone")})},ZW={unsupportedLength:["em","ex","cap","ch","ic","rem","lh","rlh","vw","vh","vi","vb","vmin","vmax","cm","mm","Q","in","pc","pt","px"],fixed:["px","pt"],relative:["%"],empty:[""]},JW=function(){var t="[0-9]+",e="[+-]?"+t,n="[eE]"+e,r="\\.",o=function(t){return"(?:"+t+")?"},i=["Infinity",t+r+o(t)+o(n),r+t+o(n),t+o(n)].join("|"),a="[+-]?(?:"+i+")";return new RegExp("^("+a+")(.*)$")}(),QW=function(t,e){return q(e,(function(e){return q(ZW[e],(function(e){return t===e}))}))},tG=function(t,e){var n=j.from(JW.exec(t));return n.bind((function(t){var n=Number(t[1]),r=t[2];return QW(r,e)?j.some({value:n,unit:r}):j.none()}))},eG=function(t,e){return tG(t,e).map((function(t){var e=t.value,n=t.unit;return e+n}))},nG=function(t,e){var n=function(){var n=e.getOptions(t),r=e.getCurrent(t).map(e.hash),o=od();return G(n,(function(n){return{type:"togglemenuitem",text:e.display(n),onSetup:function(i){var a=function(t){t&&(o.on((function(t){return t.setActive(!1)})),o.set(i)),i.setActive(t)};a(Tt(r,e.hash(n)));var u=e.watcher(t,n,a);return function(){o.clear(),u()}},onAction:function(){return e.setCurrent(t,n)}}}))};t.ui.registry.addMenuButton(e.name,{tooltip:e.text,icon:e.icon,fetch:function(t){return t(n())},onSetup:e.onToolbarSetup}),t.ui.registry.addNestedMenuItem(e.name,{type:"nestedmenuitem",text:e.text,getSubmenuItems:n,onSetup:e.onMenuSetup})},rG={name:"lineheight",text:"Line height",icon:"line-height",getOptions:SS,hash:function(t){return eG(t,["fixed","relative","empty"]).getOr(t)},display:w,watcher:function(t,e,n){return t.formatter.formatChanged("lineheight",n,!1,{value:e}).unbind},getCurrent:function(t){return j.from(t.queryCommandValue("LineHeight"))},setCurrent:function(t,e){return t.execCommand("LineHeight",!1,e)}},oG=function(t){var e=j.from(CS(t));return e.map((function(e){return{name:"language",text:"Language",icon:"language",getOptions:x(e),hash:function(t){return l(t.customCode)?t.code:t.code+"/"+t.customCode},display:function(t){return t.title},watcher:function(t,e,n){return t.formatter.formatChanged("lang",n,!1,{value:e.code,customValue:e.customCode}).unbind},getCurrent:function(t){var e=ee.fromDom(t.selection.getNode());return xa(e,(function(t){return j.some(t).filter(le).bind((function(t){var e=qn(t,"lang");return e.map((function(e){var n=qn(t,"data-mce-lang").getOrUndefined();return{code:e,customCode:n,title:""}}))}))}))},setCurrent:function(t,e){return t.execCommand("Lang",!1,e)},onToolbarSetup:function(e){var n=nd();return e.setActive(t.formatter.match("lang",{},void 0,!0)),n.set(t.formatter.formatChanged("lang",e.setActive,!0)),n.clear}}}))},iG=function(t){nG(t,rG),oG(t).each((function(e){return nG(t,e)}))},aG=function(t,e){jq(t,e),qq(t,e),aU(t,e),rU(t,e),Jq(t,e)},uG=function(t){return _q(t,"NodeChange",(function(e){e.setDisabled(!t.queryCommandState("outdent"))}))},cG=function(t){t.ui.registry.addButton("outdent",{tooltip:"Decrease indent",icon:"outdent",onSetup:uG(t),onAction:kq(t,"outdent")}),t.ui.registry.addButton("indent",{tooltip:"Increase indent",icon:"indent",onAction:kq(t,"indent")})},sG=function(t){cG(t)},lG=function(t,e){return function(){t.execCommand("mceToggleFormat",!1,e)}},fG=function(t){JN.each([{name:"bold",text:"Bold",icon:"bold"},{name:"italic",text:"Italic",icon:"italic"},{name:"underline",text:"Underline",icon:"underline"},{name:"strikethrough",text:"Strikethrough",icon:"strike-through"},{name:"subscript",text:"Subscript",icon:"subscript"},{name:"superscript",text:"Superscript",icon:"superscript"}],(function(e,n){t.ui.registry.addToggleButton(e.name,{tooltip:e.text,icon:e.icon,onSetup:wq(t,e.name),onAction:lG(t,e.name)})}));for(var e=1;e<=6;e++){var n="h"+e;t.ui.registry.addToggleButton(n,{text:n.toUpperCase(),tooltip:"Heading "+e,onSetup:wq(t,n),onAction:lG(t,n)})}},dG=function(t){JN.each([{name:"cut",text:"Cut",action:"Cut",icon:"cut"},{name:"copy",text:"Copy",action:"Copy",icon:"copy"},{name:"paste",text:"Paste",action:"Paste",icon:"paste"},{name:"help",text:"Help",action:"mceHelp",icon:"help"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all"},{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document"},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting"},{name:"remove",text:"Remove",action:"Delete",icon:"remove"}],(function(e){t.ui.registry.addButton(e.name,{tooltip:e.text,icon:e.icon,onAction:kq(t,e.action)})}))},hG=function(t){JN.each([{name:"blockquote",text:"Blockquote",action:"mceBlockQuote",icon:"quote"}],(function(e){t.ui.registry.addToggleButton(e.name,{tooltip:e.text,icon:e.icon,onAction:kq(t,e.action),onSetup:wq(t,e.name)})}))},pG=function(t){fG(t),dG(t),hG(t)},mG=function(t){JN.each([{name:"bold",text:"Bold",action:"Bold",icon:"bold",shortcut:"Meta+B"},{name:"italic",text:"Italic",action:"Italic",icon:"italic",shortcut:"Meta+I"},{name:"underline",text:"Underline",action:"Underline",icon:"underline",shortcut:"Meta+U"},{name:"strikethrough",text:"Strikethrough",action:"Strikethrough",icon:"strike-through",shortcut:""},{name:"subscript",text:"Subscript",action:"Subscript",icon:"subscript",shortcut:""},{name:"superscript",text:"Superscript",action:"Superscript",icon:"superscript",shortcut:""},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting",shortcut:""},{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document",shortcut:""},{name:"cut",text:"Cut",action:"Cut",icon:"cut",shortcut:"Meta+X"},{name:"copy",text:"Copy",action:"Copy",icon:"copy",shortcut:"Meta+C"},{name:"paste",text:"Paste",action:"Paste",icon:"paste",shortcut:"Meta+V"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all",shortcut:"Meta+A"}],(function(e){t.ui.registry.addMenuItem(e.name,{text:e.text,icon:e.icon,shortcut:e.shortcut,onAction:kq(t,e.action)})})),t.ui.registry.addMenuItem("codeformat",{text:"Code",icon:"sourcecode",onAction:lG(t,"code")})},vG=function(t){pG(t),mG(t)},gG=function(t,e){return _q(t,"Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",(function(n){n.setDisabled(t.mode.isReadOnly()||!t.undoManager[e]())}))},bG=function(t){t.ui.registry.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onSetup:gG(t,"hasUndo"),onAction:kq(t,"undo")}),t.ui.registry.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onSetup:gG(t,"hasRedo"),onAction:kq(t,"redo")})},yG=function(t){t.ui.registry.addButton("undo",{tooltip:"Undo",icon:"undo",disabled:!0,onSetup:gG(t,"hasUndo"),onAction:kq(t,"undo")}),t.ui.registry.addButton("redo",{tooltip:"Redo",icon:"redo",disabled:!0,onSetup:gG(t,"hasRedo"),onAction:kq(t,"redo")})},xG=function(t){bG(t),yG(t)},wG=function(t){return _q(t,"VisualAid",(function(e){e.setActive(t.hasVisual)}))},_G=function(t){t.ui.registry.addToggleMenuItem("visualaid",{text:"Visual aids",onSetup:wG(t),onAction:kq(t,"mceToggleVisualAid")})},OG=function(t){t.ui.registry.addButton("visualaid",{tooltip:"Visual aids",text:"Visual aids",onAction:kq(t,"mceToggleVisualAid")})},kG=function(t){OG(t),_G(t)},SG=function(t,e){XW(t),vG(t),aG(t,e),xG(t),eA(t),kG(t),sG(t),iG(t)},CG=function(t,e){return{type:"makeshift",x:t,y:e}},EG=function(t,e,n){return CG(t.x+e,t.y+n)},AG=function(t){return"longpress"===t.type||0===t.type.indexOf("touch")},TG=function(t){if(AG(t)){var e=t.touches[0];return CG(e.pageX,e.pageY)}return CG(t.pageX,t.pageY)},MG=function(t){if(AG(t)){var e=t.touches[0];return CG(e.clientX,e.clientY)}return CG(t.clientX,t.clientY)},zG=function(t,e){var n=dS.DOM.getPos(t);return EG(e,n.x,n.y)},PG=function(t,e){return"contextmenu"===e.type||"longpress"===e.type?t.inline?TG(e):zG(t.getContentAreaContainer(),MG(e)):NG(t)},NG=function(t){return{type:"selection",root:ee.fromDom(t.selection.getNode())}},DG=function(t){return{type:"node",node:j.some(ee.fromDom(t.selection.getNode())),root:ee.fromDom(t.getBody())}},LG=function(t,e,n){switch(n){case"node":return DG(t);case"point":return PG(t,e);case"selection":return NG(t)}},jG=function(t,e,n,r,o,i){var a=n(),u=LG(t,e,i);WL(a,qO.CLOSE_ON_EXECUTE,r,!1).map((function(t){e.preventDefault(),e_.showMenuAt(o,{anchor:u},{menu:{markers:hk("normal")},data:t})}))},HG={onLtr:function(){return[Gl,Vl,Fl,ql,Ul,Wl,h_,p_,d_,l_,f_,s_]},onRtl:function(){return[Gl,Fl,Vl,Ul,ql,Wl,h_,p_,f_,s_,d_,l_]}},RG=12,BG={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"]},IG=function(t,e){var n=t.selection;if(n.isCollapsed()||e.touches.length<1)return!1;var r=e.touches[0],o=n.getRng(),i=np(t.getWin(),kh.domRange(o));return i.exists((function(t){return t.left<=r.clientX&&t.right>=r.clientX&&t.top<=r.clientY&&t.bottom>=r.clientY}))},VG=function(t){var e=t.selection.getRng(),n=function(){w_.setEditorTimeout(t,(function(){t.selection.setRng(e)}),10),i()};t.once("touchend",n);var r=function(t){t.preventDefault(),t.stopImmediatePropagation()};t.on("mousedown",r,!0);var o=function(){return i()};t.once("longpresscancel",o);var i=function(){t.off("touchend",n),t.off("longpresscancel",o),t.off("mousedown",r)}},FG=function(t,e,n){var r=LG(t,e,n),o="point"===n?RG:0;return T({bubble:Pd(0,o,BG),layouts:HG,overrides:{maxWidthFunction:wF(),maxHeightFunction:Ed()}},r)},qG=function(t,e,n,r,o,i,a){var u=FG(t,e,i);WL(n,qO.CLOSE_ON_EXECUTE,r,!0).map((function(n){e.preventDefault(),e_.showMenuWithinBounds(o,{anchor:u},{menu:{markers:hk("normal"),highlightImmediately:a},data:n,type:"horizontal"},(function(){return j.some(CW(t,r.shared,"node"===i?"node":"selection"))})),t.fire(lW)}))},UG=function(t,e,n,r,o,i){var a=en(),u=a.os.isiOS(),c=a.os.isOSX(),s=a.os.isAndroid(),l=a.deviceType.isTouch(),f=function(){return!(s||u||c&&l)},d=function(){var a=n();qG(t,e,a,r,o,i,f())};if((c||u)&&"node"!==i){var h=function(){VG(t),d()};IG(t,e)?h():(t.once("selectionchange",h),t.once("touchend",(function(){return t.off("selectionchange",h)})))}else d()},WG=function(t){return"string"===typeof t?t.split(/[ ,]/):t},GG=function(t){return t.getParam("contextmenu_never_use_native",!1,"boolean")},$G=function(t,e,n){var r=t.ui.registry.getAll().contextMenus;return j.from(t.getParam(e)).map(WG).getOrThunk((function(){return X(WG(n),(function(t){return Et(r,t)}))}))},KG=function(t){return!1===t.getParam("contextmenu")},YG=function(t){return $G(t,"contextmenu","link linkchecker image imagetools table spellchecker configurepermanentpen")},XG=function(t){return t.getParam("contextmenu_avoid_overlap","","string")},ZG=function(t){return i(t)?"|"===t:"separator"===t.type},JG={type:"separator"},QG=function(t){var e=function(t){return{text:t.text,icon:t.icon,disabled:t.disabled,shortcut:t.shortcut}};if(i(t))return t;switch(t.type){case"separator":return JG;case"submenu":return T(T({type:"nestedmenuitem"},e(t)),{getSubmenuItems:function(){var e=t.getSubmenuItems();return i(e)?e:G(e,QG)}});default:return T(T({type:"menuitem"},e(t)),{onAction:g(t.onAction)})}},t$=function(t,e){if(0===e.length)return t;var n=dt(t).filter((function(t){return!ZG(t)})),r=n.fold((function(){return[]}),(function(t){return[JG]}));return t.concat(r).concat(e).concat([JG])},e$=function(t,e,n){var r=J(e,(function(e,r){return Ct(t,r.toLowerCase()).map((function(t){var r=t.update(n);if(i(r))return t$(e,r.split(" "));if(r.length>0){var o=G(r,QG);return t$(e,o)}return e})).getOrThunk((function(){return e.concat([r])}))}),[]);return r.length>0&&ZG(r[r.length-1])&&r.pop(),r},n$=function(t,e){return e.ctrlKey&&!GG(t)},r$=function(t,e){return"longpress"!==e.type&&(2!==e.button||e.target===t.getBody()&&""===e.pointerType)},o$=function(t,e){return r$(t,e)?t.selection.getStart(!0):e.target},i$=function(t,e){var n=XG(t),r=r$(t,e)?"selection":"point";if($t(n)){var o=o$(t,e),i=jA(ee.fromDom(o),n);return i?"node":r}return r},a$=function(t,e,n){var r=en(),o=r.deviceType.isTouch,i=Es(e_.sketch({dom:{tag:"div"},lazySink:e,onEscape:function(){return t.focus()},onShow:function(){return n.setContextMenuState(!0)},onHide:function(){return n.setContextMenuState(!1)},fireDismissalEventInstead:{},inlineBehaviours:hf([Vx("dismissContextMenu",[Pu(pu(),(function(e,n){bm.close(e),t.focus()}))])])})),a=function(t){return e_.hide(i)},u=function(e){if(GG(t)&&e.preventDefault(),!n$(t,e)&&!KG(t)){var r=i$(t,e),a=function(){var n=o$(t,e),r=t.ui.registry.getAll(),o=YG(t);return e$(r.contextMenus,o,n)},u=o()?UG:jG;u(t,e,a,n,i,r)}};t.on("init",(function(){var e="ResizeEditor ScrollContent ScrollWindow longpresscancel"+(o()?"":" ResizeWindow");t.on(e,a),t.on("longpress contextmenu",u)}))},u$=aa.generate([{offset:["x","y"]},{absolute:["x","y"]},{fixed:["x","y"]}]),c$=function(t){return function(e){return e.translate(-t.left,-t.top)}},s$=function(t){return function(e){return e.translate(t.left,t.top)}},l$=function(t){return function(e,n){return J(t,(function(t,e){return e(t)}),lr(e,n))}},f$=function(t,e,n){return t.fold(l$([s$(n),c$(e)]),l$([c$(e)]),l$([]))},d$=function(t,e,n){return t.fold(l$([s$(n)]),l$([]),l$([s$(e)]))},h$=function(t,e,n){return t.fold(l$([]),l$([c$(n)]),l$([s$(e),c$(n)]))},p$=function(t,e,n,r,o,i){var a=d$(t,o,i),u=d$(e,o,i);return Math.abs(a.left-u.left)<=n&&Math.abs(a.top-u.top)<=r},m$=function(t,e,n,r,o,i){var a=d$(t,o,i),u=d$(e,o,i),c=Math.abs(a.left-u.left),s=Math.abs(a.top-u.top);return lr(c,s)},v$=function(t,e,n){var r=t.fold((function(t,e){return{position:j.some("absolute"),left:j.some(t+"px"),top:j.some(e+"px")}}),(function(t,e){return{position:j.some("absolute"),left:j.some(t-n.left+"px"),top:j.some(e-n.top+"px")}}),(function(t,e){return{position:j.some("fixed"),left:j.some(t+"px"),top:j.some(e+"px")}}));return T({right:j.none(),bottom:j.none()},r)},g$=function(t,e,n){return t.fold((function(t,r){return y$(t+e,r+n)}),(function(t,r){return x$(t+e,r+n)}),(function(t,r){return w$(t+e,r+n)}))},b$=function(t,e,n,r){var o=function(t,o){return function(i,a){var u=t(e,n,r);return o(i.getOr(u.left),a.getOr(u.top))}};return t.fold(o(h$,y$),o(d$,x$),o(f$,w$))},y$=u$.offset,x$=u$.absolute,w$=u$.fixed,_$=function(t,e){var n=Fn(t,e);return l(n)?NaN:parseInt(n,10)},O$=function(t,e){var n=t.element,r=_$(n,e.leftAttr),o=_$(n,e.topAttr);return isNaN(r)||isNaN(o)?j.none():j.some(lr(r,o))},k$=function(t,e,n){var r=t.element;In(r,e.leftAttr,n.left+"px"),In(r,e.topAttr,n.top+"px")},S$=function(t,e){var n=t.element;Wn(n,e.leftAttr),Wn(n,e.topAttr)},C$=function(t,e,n,r){return O$(t,e).fold((function(){return n}),(function(t){return w$(t.left+r.left,t.top+r.top)}))},E$=function(t,e,n,r,o,i){var a=C$(t,e,n,r),u=e.mustSnap?M$(t,e,a,o,i):z$(t,e,a,o,i),c=f$(a,o,i);return k$(t,e,c),u.fold((function(){return{coord:w$(c.left,c.top),extra:j.none()}}),(function(t){return{coord:t.output,extra:t.extra}}))},A$=function(t,e){S$(t,e)},T$=function(t,e,n,r){return pt(t,(function(t){var o=t.sensor,i=p$(e,o,t.range.left,t.range.top,n,r);return i?j.some({output:b$(t.output,e,n,r),extra:t.extra}):j.none()}))},M$=function(t,e,n,r,o){var i=e.getSnapPoints(t),a=T$(i,n,r,o);return a.orThunk((function(){var t=J(i,(function(t,e){var i=e.sensor,a=m$(n,i,e.range.left,e.range.top,r,o);return t.deltas.fold((function(){return{deltas:j.some(a),snap:j.some(e)}}),(function(n){var r=(a.left+a.top)/2,o=(n.left+n.top)/2;return r<=o?{deltas:j.some(a),snap:j.some(e)}:t}))}),{deltas:j.none(),snap:j.none()});return t.snap.map((function(t){return{output:b$(t.output,n,r,o),extra:t.extra}}))}))},z$=function(t,e,n,r,o){var i=e.getSnapPoints(t);return T$(i,n,r,o)},P$=function(t,e,n){return{coord:b$(t.output,t.output,e,n),extra:t.extra}},N$=function(t,e,n,r){var o=e.getTarget(t.element);if(e.repositionTarget){var i=hn(t.element),a=Hr(i),u=WB(o),c=P$(r,a,u),s=v$(c.coord,a,u);Xn(o,s)}},D$=Object.freeze({__proto__:null,snapTo:N$}),L$="data-initial-z-index",j$=function(t){gn(t.element).filter(le).each((function(t){qn(t,L$).fold((function(){return nr(t,"z-index")}),(function(e){return Kn(t,"z-index",e)})),Wn(t,L$)}))},H$=function(t){gn(t.element).filter(le).each((function(e){Qn(e,"z-index").each((function(t){In(e,L$,t)})),Kn(e,"z-index",Zn(t.element,"z-index"))}))},R$=function(t,e){t.getSystem().addToGui(e),H$(e)},B$=function(t){j$(t),t.getSystem().removeFromGui(t)},I$=function(t,e,n){return t.getSystem().build(sT.sketch({dom:{styles:{left:"0px",top:"0px",width:"100%",height:"100%",position:"fixed","z-index":"1000000000000000"},classes:[e]},events:n}))},V$=Gi("snaps",[Ti("getSnapPoints"),ul("onSensor"),Ti("leftAttr"),Ti("topAttr"),Ki("lazyViewport",Qr),Ki("mustSnap",!1)]),F$=[Ki("useFixed",C),Ti("blockerClass"),Ki("getTarget",w),Ki("onDrag",v),Ki("repositionTarget",!0),Ki("onDrop",v),ta("getBounds",Qr),V$],q$=function(t){return Dt(Qn(t,"left"),Qn(t,"top"),Qn(t,"position"),(function(t,e,n){var r="fixed"===n?w$:y$;return r(parseInt(t,10),parseInt(e,10))})).getOrThunk((function(){var e=hr(t);return x$(e.left,e.top)}))},U$=function(t,e,n,r,o){var i=o.bounds,a=d$(e,n,r),u=Al(a.left,i.x,i.x+i.width-o.width),c=Al(a.top,i.y,i.y+i.height-o.height),s=x$(u,c);return e.fold((function(){var t=h$(s,n,r);return y$(t.left,t.top)}),x(s),(function(){var t=f$(s,n,r);return w$(t.left,t.top)}))},W$=function(t,e,n,r,o,i,a){var u=e.fold((function(){var t=g$(n,i.left,i.top),e=f$(t,r,o);return w$(e.left,e.top)}),(function(e){var a=E$(t,e,n,i,r,o);return a.extra.each((function(n){e.onSensor(t,n)})),a.coord}));return U$(t,u,r,o,a)},G$=function(t,e,n,r){var o=e.getTarget(t.element);if(e.repositionTarget){var i=hn(t.element),a=Hr(i),u=WB(o),c=q$(o),s=W$(t,e.snaps,c,a,u,r,n),l=v$(s,a,u);Xn(o,l)}e.onDrag(t,o,r)},$$=function(t,e){return{bounds:t.getBounds(),height:ur(e.element),width:br(e.element)}},K$=function(t,e,n,r,o){var i=n.update(r,o),a=n.getStartData().getOrThunk((function(){return $$(e,t)}));i.each((function(n){G$(t,e,a,n)}))},Y$=function(t,e,n,r){e.each(B$),n.snaps.each((function(e){A$(t,e)}));var o=n.getTarget(t.element);r.reset(),n.onDrop(t,o)},X$=function(t){return function(e,n){var r=function(t){n.setStartData($$(e,t))};return Au(z([Pu(lu(),(function(t){n.getStartData().each((function(){return r(t)}))}))],t(e,n,r),!0))}},Z$=function(t){return Au([Pu(Na(),t.forceDrop),Pu(ja(),t.drop),Pu(Da(),(function(e,n){t.move(n.event)})),Pu(La(),t.delayDrop)])},J$=function(t){return j.from(lr(t.x,t.y))},Q$=function(t,e){return lr(e.left-t.left,e.top-t.top)},tK=Object.freeze({__proto__:null,getData:J$,getDelta:Q$}),eK=function(t,e,n){return[Pu(Na(),(function(r,o){var i=o.event.raw;if(0===i.button){o.stop();var a=function(){return Y$(r,j.some(s),t,e)},u=HA(a,200),c={drop:a,delayDrop:u.schedule,forceDrop:a,move:function(n){u.cancel(),K$(r,t,e,tK,n)}},s=I$(r,t.blockerClass,Z$(c)),l=function(){n(r),R$(r,s)};l()}}))]},nK=z(z([],F$,!0),[fl("dragger",{handlers:X$(eK)})],!1),rK=function(t){return Au([Pu(Ta(),t.forceDrop),Pu(za(),t.drop),Pu(Pa(),t.drop),Pu(Ma(),(function(e,n){t.move(n.event)}))])},oK=function(t){var e=t[0];return j.some(lr(e.clientX,e.clientY))},iK=function(t){var e=t.raw,n=e.touches;return 1===n.length?oK(n):j.none()},aK=function(t,e){return lr(e.left-t.left,e.top-t.top)},uK=Object.freeze({__proto__:null,getData:iK,getDelta:aK}),cK=function(t,e,n){var r=od(),o=function(n){Y$(n,r.get(),t,e),r.clear()};return[Pu(Ta(),(function(i,a){a.stop();var u=function(){return o(i)},c={drop:u,delayDrop:v,forceDrop:u,move:function(n){K$(i,t,e,uK,n)}},s=I$(i,t.blockerClass,rK(c));r.set(s);var l=function(){n(i),R$(i,s)};l()})),Pu(Ma(),(function(n,r){r.stop(),K$(n,t,e,uK,r.event)})),Pu(za(),(function(t,e){e.stop(),o(t)})),Pu(Pa(),o)]},sK=z(z([],F$,!0),[fl("dragger",{handlers:X$(cK)})],!1),lK=function(t,e,n){return z(z([],eK(t,e,n),!0),cK(t,e,n),!0)},fK=z(z([],F$,!0),[fl("dragger",{handlers:X$(lK)})],!1),dK=nK,hK=sK,pK=fK,mK=Object.freeze({__proto__:null,mouse:dK,touch:hK,mouseOrTouch:pK}),vK=function(){var t=j.none(),e=j.none(),n=function(){t=j.none(),e=j.none()},r=function(e,n){var r=t.map((function(t){return e.getDelta(t,n)}));return t=j.some(n),r},o=function(t,e){return t.getData(e).bind((function(e){return r(t,e)}))},i=function(t){e=j.some(t)},a=function(){return e},u=x({});return Sc({readState:u,reset:n,update:o,getStartData:a,setStartData:i})},gK=Object.freeze({__proto__:null,init:vK}),bK=gf({branchKey:"mode",branches:mK,name:"dragging",active:{events:function(t,e){var n=t.dragger;return n.handlers(t,e)}},extra:{snap:function(t){return{sensor:t.sensor,range:t.range,output:t.output,extra:j.from(t.extra)}}},state:gK,apis:D$}),yK=40,xK=yK/2,wK=function(t,e,n,r,o,i){return t.fold((function(){return bK.snap({sensor:x$(n-xK,r-xK),range:lr(o,i),output:x$(j.some(n),j.some(r)),extra:{td:e}})}),(function(t){var o=n-xK,i=r-xK,a=yK,u=yK,c=t.element.dom.getBoundingClientRect();return bK.snap({sensor:x$(o,i),range:lr(a,u),output:x$(j.some(n-c.width/2),j.some(r-c.height/2)),extra:{td:e}})}))},_K=function(t,e,n){var r=function(t,e){return t.exists((function(t){return sn(t,e)}))};return{getSnapPoints:t,leftAttr:"data-drag-left",topAttr:"data-drag-top",onSensor:function(t,o){var i=o.td;r(e.get(),i)||(e.set(i),n(i))},mustSnap:!0}},OK=function(t){return k_(O_.sketch({dom:{tag:"div",classes:["tox-selector"]},buttonBehaviours:hf([bK.config({mode:"mouseOrTouch",blockerClass:"blocker",snaps:t}),VM.config({})]),eventOrder:{mousedown:["dragging","alloy.base.behaviour"],touchstart:["dragging","alloy.base.behaviour"]}}))},kK=function(t,e){var n=oa([]),r=oa([]),o=oa(!1),i=od(),a=od(),u=function(t){var n=Jr(t);return wK(h.getOpt(e),t,n.x,n.y,n.width,n.height)},c=function(){return G(n.get(),(function(t){return u(t)}))},s=function(t){var n=Jr(t);return wK(p.getOpt(e),t,n.right,n.bottom,n.width,n.height)},l=function(){return G(r.get(),(function(t){return s(t)}))},f=_K(c,i,(function(e){a.get().each((function(n){t.fire("TableSelectorChange",{start:e,finish:n})}))})),d=_K(l,a,(function(e){i.get().each((function(n){t.fire("TableSelectorChange",{start:n,finish:e})}))})),h=OK(f),p=OK(d),m=Es(h.asSpec()),v=Es(p.asSpec()),g=function(e,n,r,o){var i=n.dom.getBoundingClientRect();nr(e.element,"display");var a=vn(ee.fromDom(t.getBody())).dom.innerHeight,u=r(i),c=o(i,a);(u||c)&&Kn(e.element,"display","none")},b=function(t,e,n,r){var o=n(e);bK.snapTo(t,o);var i=function(t){return t[r]<0},a=function(t,e){return t[r]>e};g(t,e,i,a)},y=function(t){return b(m,t,u,"top")},x=function(){return i.get().each(y)},w=function(t){return b(v,t,s,"bottom")},_=function(){return a.get().each(w)};en().deviceType.isTouch()&&(t.on("TableSelectionChange",(function(t){o.get()||(Up(e,m),Up(e,v),o.set(!0)),i.set(t.start),a.set(t.finish),t.otherCells.each((function(e){n.set(e.upOrLeftCells),r.set(e.downOrRightCells),y(t.start),w(t.finish)}))})),t.on("ResizeEditor ResizeWindow ScrollContent",(function(){x(),_()})),t.on("TableSelectionClear",(function(){o.get()&&($p(m),$p(v),o.set(!1)),i.clear(),a.clear()})))},SK=function(t){if(1===t.nodeType){if("BR"===t.nodeName||t.getAttribute("data-mce-bogus"))return!0;if("bookmark"===t.getAttribute("data-mce-type"))return!0}return!1},CK=function(t,e,n){e.delimiter||(e.delimiter="»");var r=function(r){var o=r||[],i=G(o,(function(e,r){return O_.sketch({dom:{tag:"div",classes:["tox-statusbar__path-item"],attributes:{role:"button","data-index":r,"tab-index":-1,"aria-level":r+1},innerHtml:e.name},action:function(n){t.focus(),t.selection.select(e.element),t.nodeChanged()},buttonBehaviours:hf([hC.button(n.isDisabled),cC()])})})),a={dom:{tag:"div",classes:["tox-statusbar__path-divider"],attributes:{"aria-hidden":!0},innerHtml:" "+e.delimiter+" "}};return J(i.slice(1),(function(t,e){var n=t;return n.push(a),n.push(e),n}),[i[0]])},o=function(e){var n=[],r=e.length;while(r-- >0){var o=e[r];if(1===o.nodeType&&!SK(o)){var i=t.fire("ResolveName",{name:o.nodeName.toLowerCase(),target:o});if(i.isDefaultPrevented()||n.push({name:i.name,element:o}),i.isPropagationStopped())break}}return n};return{dom:{tag:"div",classes:["tox-statusbar__path"],attributes:{role:"navigation"}},behaviours:hf([Tx.config({mode:"flow",selector:"div[role=button]"}),Hg.config({disabled:n.isDisabled}),cC(),yT.config({}),Bx.config({}),Vx("elementPathEvents",[Fu((function(e,n){t.shortcuts.add("alt+F11","focus statusbar elementpath",(function(){return Tx.focusIn(e)})),t.on("NodeChange",(function(t){var n=o(t.parents);n.length>0?Bx.set(e,r(n)):Bx.set(e,[])}))}))])]),components:[]}};(function(t){t[t["None"]=0]="None",t[t["Both"]=1]="Both",t[t["Vertical"]=2]="Vertical"})(Mq||(Mq={}));var EK=function(t,e,n,r,o){var i={};return i.height=QU(r+e.top,xS(t),_S(t)),n===Mq.Both&&(i.width=QU(o+e.left,yS(t),wS(t))),i},AK=function(t,e,n){var r=ee.fromDom(t.getContainer()),o=EK(t,e,n,ar(r),gr(r));gt(o,(function(t,e){return Kn(r,e,JU(t))})),gE(t)},TK=function(t){var e=!t.hasPlugin("autoresize"),n=t.getParam("resize",e);return!1===n?Mq.None:"both"===n?Mq.Both:Mq.Vertical},MK=function(t,e,n,r){var o=20,i=lr(n*o,r*o);return AK(t,i,e),j.some(!0)},zK=function(t,e){var n=TK(t);return n===Mq.None?j.none():j.some(j_("resize-handle",{tag:"div",classes:["tox-statusbar__resize-handle"],attributes:{title:e.translate("Resize")},behaviours:[bK.config({mode:"mouse",repositionTarget:!1,onDrag:function(e,r,o){return AK(t,o,n)},blockerClass:"tox-blocker"}),Tx.config({mode:"special",onLeft:function(){return MK(t,n,-1,0)},onRight:function(){return MK(t,n,1,0)},onUp:function(){return MK(t,n,0,-1)},onDown:function(){return MK(t,n,0,1)}}),yT.config({}),Xx.config({})]},e.icons))},PK=function(t,e){var n,r=function(t,n,r){return Bx.set(t,[Os(e.translate(["{0} "+r,n[r]]))])};return O_.sketch({dom:{tag:"button",classes:["tox-statusbar__wordcount"]},components:[],buttonBehaviours:hf([hC.button(e.isDisabled),cC(),yT.config({}),Bx.config({}),tv.config({store:{mode:"memory",initialValue:{mode:"words",count:{words:0,characters:0}}}}),Vx("wordcount-events",[Wu((function(t){var e=tv.getValue(t),n="words"===e.mode?"characters":"words";tv.setValue(t,{mode:n,count:e.count}),r(t,e.count,n)})),Fu((function(e){t.on("wordCountUpdate",(function(t){var n=tv.getValue(e).mode;tv.setValue(e,{mode:n,count:t.wordCount}),r(e,t.wordCount,n)}))}))])]),eventOrder:(n={},n[eu()]=["disabling","alloy.base.behaviour","wordcount-events"],n)})},NK=function(t,e){var n=function(){var t=S_.translate(["Powered by {0}","Tiny"]),e=''+t+"";return{dom:{tag:"span",classes:["tox-statusbar__branding"],innerHtml:e}}},r=function(){var r=[];return t.getParam("elementpath",!0,"boolean")&&r.push(CK(t,{},e)),t.hasPlugin("wordcount")&&r.push(PK(t,e)),t.getParam("branding",!0,"boolean")&&r.push(n()),r.length>0?[{dom:{tag:"div",classes:["tox-statusbar__text-container"]},components:r}]:[]},o=function(){var n=r(),o=zK(t,e);return n.concat(o.toArray())};return{dom:{tag:"div",classes:["tox-statusbar"]},components:o()}},DK=function(t){var e,n=t.inline,r=n?cW:XU,o=WS(t)?RI:qB,i=j.none(),a=en(),u=a.browser.isIE(),c=u?["tox-platform-ie"]:[],s=a.deviceType.isTouch(),l="tox-platform-touch",f=s?[l]:[],d=HS(t),h=qS(t),p=S_.isRtl()?{attributes:{dir:"rtl"}}:{},m={attributes:(e={},e[Hd]=d?Bf.BottomToTop:Bf.TopToBottom,e)},g=function(){return i.bind(uq.getHeader)},b=function(){return o.isDocked(g)},y=function(){Kn(J.element,"width",document.body.clientWidth+"px")},x=function(){var t=sn(Hn(),h)&&"grid"===Zn(h,"display"),e={dom:T({tag:"div",classes:["tox","tox-silver-sink","tox-tinymce-aux"].concat(c).concat(f)},p),behaviours:hf([Rp.config({useFixed:function(){return b()}})])},n={dom:{styles:{width:document.body.clientWidth+"px"}},events:Au([Pu(fu(),y)])};return _o(e,t?n:{})},w=Es(x()),_=function(){return ro.value(w)},O=k_({dom:{tag:"div",classes:["tox-anchorbar"]}}),k=function(){return i.bind((function(t){return O.getOpt(t)})).getOrDie("Could not find a anchor bar element")},S=function(){return i.bind((function(t){return uq.getToolbar(t)})).getOrDie("Could not find more toolbar element")},C=function(){return i.bind((function(t){return uq.getThrobber(t)})).getOrDie("Could not find throbber element")},E=kB(w,t,k),A=uq.parts.menubar({dom:{tag:"div",classes:["tox-menubar"]},backstage:E,onEscape:function(){t.focus()}}),M=NS(t),z=uq.parts.toolbar(T({dom:{tag:"div",classes:["tox-toolbar"]},getSink:_,providers:E.shared.providers,onEscape:function(){t.focus()},type:M,lazyToolbar:S,lazyHeader:function(){return g().getOrDie("Could not find header element")}},m)),P=uq.parts["multiple-toolbar"]({dom:{tag:"div",classes:["tox-toolbar-overlord"]},providers:E.shared.providers,onEscape:function(){t.focus()},type:M}),N=uq.parts.socket({dom:{tag:"div",classes:["tox-edit-area"]}}),D=uq.parts.sidebar({dom:{tag:"div",classes:["tox-sidebar"]}}),L=uq.parts.throbber({dom:{tag:"div",classes:["tox-throbber"]},backstage:E}),H=t.getParam("statusbar",!0,"boolean"),R=H&&!n?j.some(NK(t,E.shared.providers)):j.none(),B={dom:{tag:"div",classes:["tox-sidebar-wrap"]},components:[N,D]},I=zS(t),V=TS(t),F=AS(t),q=function(){return I?[P]:V?[z]:[]},U=uq.parts.header({dom:T({tag:"div",classes:["tox-editor-header"]},m),components:nt([F?[A]:[],q(),FS(t)?[]:[O.asSpec()]]),sticky:WS(t),editor:t,sharedBackstage:E.shared}),W=nt([d?[]:[U],n?[]:[B],d?[U]:[]]),G={dom:{tag:"div",classes:["tox-editor-container"]},components:W},$=nt([[G],n?[]:R.toArray(),[L]]),K=US(t),Y=T(T({role:"application"},S_.isRtl()?{dir:"rtl"}:{}),K?{"aria-hidden":"true"}:{}),X=Es(uq.sketch({dom:{tag:"div",classes:["tox","tox-tinymce"].concat(n?["tox-tinymce-inline"]:[]).concat(d?["tox-tinymce--toolbar-bottom"]:[]).concat(f).concat(c),styles:T({visibility:"hidden"},K?{opacity:"0",border:"0"}:{}),attributes:Y},components:$,behaviours:hf([cC(),Hg.config({disableClass:"tox-tinymce--disabled"}),Tx.config({mode:"cyclic",selector:".tox-menubar, .tox-toolbar, .tox-toolbar__primary, .tox-toolbar__overflow--open, .tox-sidebar__overflow--open, .tox-statusbar__path, .tox-statusbar__wordcount, .tox-statusbar__branding a, .tox-statusbar__resize-handle"})])}));i=j.some(X),t.shortcuts.add("alt+F9","focus menubar",(function(){uq.focusMenubar(X)})),t.shortcuts.add("alt+F10","focus toolbar",(function(){uq.focusToolbar(X)})),t.addCommand("ToggleToolbarDrawer",(function(){uq.toggleToolbarDrawer(X)})),t.addQueryStateHandler("ToggleToolbarDrawer",(function(){return uq.isToolbarDrawerToggled(X)}));var Z=lT(X),J=lT(w);SB(t,Z,J);var Q=function(){var t={broadcastAll:J.broadcast,broadcastOn:J.broadcastOn,register:v};return{channels:t}},tt=function(){var e=JU(eW(t)),n=JU(rW(t));return t.inline||(er("div","width",n)&&Kn(X.element,"width",n),er("div","height",e)?Kn(X.element,"height",e):Kn(X.element,"height","200px")),e},et=function(){o.setup(t,E.shared,g),SG(t,E),a$(t,_,E),PV(t),iF(t,C,E.shared),bt(LS(t),(function(e,n){t.ui.registry.addGroupToolbarButton(n,e)}));var e=t.ui.registry.getAll(),n=e.buttons,i=e.menuItems,a=e.contextToolbars,u=e.sidebars,c=MS(t),s={menuItems:i,menus:KS(t),menubar:YS(t),toolbar:c.getOrThunk((function(){return XS(t)})),allowToolbarGroups:M===FO.floating,buttons:n,sidebar:u};YW(t,a,w,{backstage:E}),kK(t,w);var l=t.getElement(),f=tt(),d={mothership:Z,uiMothership:J,outerContainer:X},h={targetNode:l,height:f};return r.render(t,d,s,E,h)};return{mothership:Z,uiMothership:J,backstage:E,renderUI:et,getUi:Q}},LK=function(t,e){var n=j.from(Fn(t,"id")).fold((function(){var t=oc("dialog-describe");return In(e,"id",t),t}),w);In(t,"aria-describedby",n)},jK=function(t,e){var n=qn(t,"id").fold((function(){var t=oc("dialog-label");return In(e,"id",t),t}),w);In(t,"aria-labelledby",n)},HK=x([Ti("lazySink"),Ii("dragBlockClass"),ta("getBounds",Qr),Ki("useTabstopAt",E),Ki("eventOrder",{}),ev("modalBehaviours",[Tx]),cl("onExecute"),ll("onEscape")]),RK={sketch:w},BK=x([Lv({name:"draghandle",overrides:function(t,e){return{behaviours:hf([bK.config({mode:"mouse",getTarget:function(t){return js(t,'[role="dialog"]').getOr(t)},blockerClass:t.dragBlockClass.getOrDie(new Error("The drag blocker class was not specified for a dialog with a drag handle: \n"+JSON.stringify(e,null,2)).message),getBounds:t.getDragBounds})])}}}),Nv({schema:[Ti("dom")],name:"title"}),Nv({factory:RK,schema:[Ti("dom")],name:"close"}),Nv({factory:RK,schema:[Ti("dom")],name:"body"}),Lv({factory:RK,schema:[Ti("dom")],name:"footer"}),Dv({factory:{sketch:function(t,e){return T(T({},t),{dom:e.dom,components:e.components})}},schema:[Ki("dom",{tag:"div",styles:{position:"fixed",left:"0px",top:"0px",right:"0px",bottom:"0px"}}),Ki("components",[])],name:"blocker"})]),IK=function(t,e,n,r){var o,i=od(),a=function(e){i.set(e);var n=t.lazySink(e).getOrDie(),o=r.blocker(),a=n.getSystem().build(T(T({},o),{components:o.components.concat([As(e)]),behaviours:hf([Xx.config({}),Vx("dialog-blocker-events",[Vu(Ra(),(function(){Tx.focusIn(e)}))])])}));Up(n,a),Tx.focusIn(e)},u=function(t){i.clear(),gn(t.element).each((function(e){t.getSystem().getByDom(e).each((function(t){$p(t)}))}))},c=function(e){return Yv(e,t,"body")},s=function(e){return Yv(e,t,"footer")},l=function(t,e){KV.block(t,e)},f=function(t){KV.unblock(t)},d=oc("modal-events"),h=T(T({},t.eventOrder),(o={},o[du()]=[d].concat(t.eventOrder["alloy.system.attached"]||[]),o));return{uid:t.uid,dom:t.dom,components:e,apis:{show:a,hide:u,getBody:c,getFooter:s,setIdle:f,setBusy:l},eventOrder:h,domModification:{attributes:{role:"dialog","aria-modal":"true"}},behaviours:rv(t.modalBehaviours,[Bx.config({}),Tx.config({mode:"cyclic",onEnter:t.onExecute,onEscape:t.onEscape,useTabstopAt:t.useTabstopAt}),KV.config({getRoot:i.get}),Vx(d,[Fu((function(e){jK(e.element,Yv(e,t,"title").element),LK(e.element,Yv(e,t,"body").element)}))])])}},VK=hg({name:"ModalDialog",configFields:HK(),partFields:BK(),factory:IK,apis:{show:function(t,e){t.show(e)},hide:function(t,e){t.hide(e)},getBody:function(t,e){return t.getBody(e)},getFooter:function(t,e){return t.getFooter(e)},setBusy:function(t,e,n){t.setBusy(e,n)},setIdle:function(t,e){t.setIdle(e)}}}),FK=ti([Pi("type"),Pi("name")].concat(Nk)),qK=li,UK=[Ci("name","name",So((function(){return oc("button-name")})),si),qi("icon"),Ji("align","end",["start","end"]),Qi("primary",!1),Qi("disabled",!1)],WK=z(z([],UK,!0),[Pi("text")],!1),GK=z([Ni("type",["submit","cancel","custom"])],WK,!0),$K=z([Ni("type",["menu"]),qi("text"),qi("tooltip"),qi("icon"),Bi("items",FK)],UK,!0),KK=ki("type",{submit:GK,cancel:GK,custom:GK,menu:$K}),YK=[Pi("type"),Pi("text"),Ni("level",["info","warn","error","success"]),Pi("icon"),Ki("url","")],XK=ti(YK),ZK=function(t){return[Pi("type"),t]},JK=[Pi("type"),Pi("text"),Qi("disabled",!1),Qi("primary",!1),Ci("name","name",So((function(){return oc("button-name")})),si),qi("icon"),Qi("borderless",!1)],QK=ti(JK),tY=[Pi("type"),Pi("name"),Pi("label"),Qi("disabled",!1)],eY=ti(tY),nY=li,rY=[Pi("type"),Pi("name")],oY=rY.concat([qi("label")]),iY=oY.concat([Ki("columns","auto")]),aY=ti(iY),uY=ii([Pi("value"),Pi("text"),Pi("icon")]),cY=oY,sY=ti(cY),lY=si,fY=oY,dY=ti(fY),hY=si,pY=rY.concat([Zi("tag","textarea"),Pi("scriptId"),Pi("scriptUrl"),ea("settings",void 0)]),mY=rY.concat([Zi("tag","textarea"),Li("init")]),vY=gi((function(t){return xi("customeditor.old",Qo(mY),t).orThunk((function(){return xi("customeditor.new",Qo(pY),t)}))})),gY=si,bY=oY,yY=ti(bY),xY=vi(),wY=function(t){return[Pi("type"),zi("columns"),t]},_Y=[Pi("type"),Pi("html"),Ji("presets","presentation",["presentation","document"])],OY=ti(_Y),kY=oY.concat([Qi("sandboxed",!0)]),SY=ti(kY),CY=si,EY=oY.concat([Mi("currentState",ti([Ti("blob"),Pi("url")]))]),AY=ti(EY),TY=oY.concat([qi("inputMode"),qi("placeholder"),Qi("maximized",!1),Qi("disabled",!1)]),MY=ti(TY),zY=si,PY=function(t){return[Pi("type"),Pi("label"),t]},NY=[Pi("text"),Pi("value")],DY=[Pi("text"),Bi("items",Si("items",(function(){return LY})))],LY=ni([ti(NY),ti(DY)]),jY=oY.concat([Bi("items",LY),Qi("disabled",!1)]),HY=ti(jY),RY=si,BY=oY.concat([Ri("items",[Pi("text"),Pi("value")]),Xi("size",1),Qi("disabled",!1)]),IY=ti(BY),VY=si,FY=oY.concat([Qi("constrain",!0),Qi("disabled",!1)]),qY=ti(FY),UY=ti([Pi("width"),Pi("height")]),WY=[Pi("type"),Bi("header",si),Bi("cells",ei(si))],GY=ti(WY),$Y=oY.concat([qi("placeholder"),Qi("maximized",!1),Qi("disabled",!1)]),KY=ti($Y),YY=si,XY=oY.concat([Ji("filetype","file",["image","media","file"]),Ki("disabled",!1)]),ZY=ti(XY),JY=ti([Pi("value"),Ki("meta",{})]),QY=function(t){return Ci("items","items",ko(),ei(gi((function(e){return xi("Checking item of "+t,tX,e).fold((function(t){return ro.error(Oi(t))}),(function(t){return ro.value(t)}))}))))},tX=Zo((function(){return mi("type",{alertbanner:XK,bar:ti(ZK(QY("bar"))),button:QK,checkbox:eY,colorinput:sY,colorpicker:dY,dropzone:yY,grid:ti(wY(QY("grid"))),iframe:SY,input:MY,listbox:HY,selectbox:IY,sizeinput:qY,textarea:KY,urlinput:ZY,customeditor:vY,htmlpanel:OY,imagetools:AY,collection:aY,label:ti(PY(QY("label"))),table:GY,panel:nX})})),eX=[Pi("type"),Ki("classes",[]),Bi("items",tX)],nX=ti(eX),rX=[Ci("name","name",So((function(){return oc("tab-name")})),si),Pi("title"),Bi("items",tX)],oX=[Pi("type"),Ri("tabs",rX)],iX=ti(oX),aX=WK,uX=KK,cX=ti([Pi("title"),Mi("body",mi("type",{panel:nX,tabpanel:iX})),Zi("size","normal"),Bi("buttons",uX),Ki("initialData",{}),ta("onAction",v),ta("onChange",v),ta("onSubmit",v),ta("onClose",v),ta("onCancel",v),Ki("onTabChange",v)]),sX=function(t){return xi("dialog",cX,t)},lX=ti(z([Ni("type",["cancel","custom"])],aX,!0)),fX=ti([Pi("title"),Pi("url"),Fi("height"),Fi("width"),Wi("buttons",lX),ta("onAction",v),ta("onCancel",v),ta("onClose",v),ta("onMessage",v)]),dX=function(t){return xi("dialog",fX,t)},hX=function(t){return a(t)?[t].concat(rt(St(t),hX)):u(t)?rt(t,hX):[]},pX=function(t){return i(t.type)&&i(t.name)},mX={checkbox:nY,colorinput:lY,colorpicker:hY,dropzone:xY,input:zY,iframe:CY,sizeinput:UY,selectbox:VY,listbox:RY,size:UY,textarea:YY,urlinput:JY,customeditor:gY,collection:uY,togglemenuitem:qK},vX=function(t){return j.from(mX[t.type])},gX=function(t){return X(hX(t),pX)},bX=function(t){var e=gX(t),n=rt(e,(function(t){return vX(t).fold((function(){return[]}),(function(e){return[Mi(t.name,e)]}))}));return ti(n)},yX=function(t){var e=wi(sX(t)),n=bX(t),r=t.initialData;return{internalDialog:e,dataValidator:n,initialData:r}},xX={open:function(t,e){var n=yX(e);return t(n.internalDialog,n.initialData,n.dataValidator)},openUrl:function(t,e){var n=wi(dX(e));return t(n)},redial:function(t){return yX(t)}},wX=function(t){var e=[],n={};return gt(t,(function(t,r){t.fold((function(){e.push(r)}),(function(t){n[r]=t}))})),e.length>0?ro.error(e):ro.value(n)},_X=function(t,e){var n=k_(NN.sketch((function(n){return{dom:{tag:"div",classes:["tox-form"].concat(t.classes)},components:G(t.items,(function(t){return uR(n,t,e)}))}})));return{dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[n.asSpec()]}],behaviours:hf([Tx.config({mode:"acyclic",useTabstopAt:k(gD)}),UN.memento(n),aD.memento(n,{postprocess:function(t){return wX(t).fold((function(t){return console.error(t),{}}),w)}})])}},OX=function(t,e){return{uid:t.uid,dom:t.dom,components:t.components,events:gw(t.action),behaviours:rv(t.tabButtonBehaviours,[Xx.config({}),Tx.config({mode:"execution",useSpace:!0,useEnter:!0}),tv.config({store:{mode:"memory",initialValue:t.value}})]),domModification:t.domModification}},kX=dg({name:"TabButton",configFields:[Ki("uid",void 0),Ti("value"),Ci("dom","dom",Ao((function(){return{attributes:{role:"tab",id:oc("aria"),"aria-selected":"false"}}})),ai()),Ii("action"),Ki("domModification",{}),ev("tabButtonBehaviours",[Xx,Tx,tv]),Ti("view")],factory:OX}),SX=x([Ti("tabs"),Ti("dom"),Ki("clickToDismiss",!1),ev("tabbarBehaviours",[rb,Tx]),il(["tabClass","selectedClass"])]),CX=jv({factory:kX,name:"tabs",unit:"tab",overrides:function(t){var e=function(t,e){rb.dehighlight(t,e),Ou(t,yu(),{tabbar:t,button:e})},n=function(t,e){rb.highlight(t,e),Ou(t,bu(),{tabbar:t,button:e})};return{action:function(r){var o=r.getSystem().getByUid(t.uid).getOrDie(),i=rb.isHighlighted(o,r),a=function(){return i&&t.clickToDismiss?e:i?v:n}();a(o,r)},domModification:{classes:[t.markers.tabClass]}}}}),EX=x([CX]),AX=function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,"debug.sketcher":"Tabbar",domModification:{attributes:{role:"tablist"}},behaviours:rv(t.tabbarBehaviours,[rb.config({highlightClass:t.markers.selectedClass,itemClass:t.markers.tabClass,onHighlight:function(t,e){In(e.element,"aria-selected","true")},onDehighlight:function(t,e){In(e.element,"aria-selected","false")}}),Tx.config({mode:"flow",getInitial:function(t){return rb.getHighlighted(t).map((function(t){return t.element}))},selector:"."+t.markers.tabClass,executeOnMove:!0})])}},TX=hg({name:"Tabbar",configFields:SX(),partFields:EX(),factory:AX}),MX=function(t,e){return{uid:t.uid,dom:t.dom,behaviours:rv(t.tabviewBehaviours,[Bx.config({})]),domModification:{attributes:{role:"tabpanel"}}}},zX=dg({name:"Tabview",configFields:[ev("tabviewBehaviours",[Bx])],factory:MX}),PX=x([Ki("selectFirst",!0),ul("onChangeTab"),ul("onDismissTab"),Ki("tabs",[]),ev("tabSectionBehaviours",[])]),NX=Nv({factory:TX,schema:[Ti("dom"),Hi("markers",[Ti("tabClass"),Ti("selectedClass")])],name:"tabbar",defaults:function(t){return{tabs:t.tabs}}}),DX=Nv({factory:zX,name:"tabview"}),LX=x([NX,DX]),jX=function(t,e,n,r){var o=function(e){var n=tv.getValue(e);Kv(e,t,"tabview").each((function(r){var o=tt(t.tabs,(function(t){return t.value===n}));o.each((function(n){var o=n.view();qn(e.element,"id").each((function(t){In(r.element,"aria-labelledby",t)})),Bx.set(r,o),t.onChangeTab(r,e,o)}))}))},i=function(e,n){Kv(e,t,"tabbar").each((function(t){n(t).each(ku)}))};return{uid:t.uid,dom:t.dom,components:e,behaviours:nv(t.tabSectionBehaviours),events:Au(nt([t.selectFirst?[Fu((function(t,e){i(t,rb.getFirst)}))]:[],[Pu(bu(),(function(t,e){var n=e.event.button;o(n)})),Pu(yu(),(function(e,n){var r=n.event.button;t.onDismissTab(e,r)}))]])),apis:{getViewItems:function(e){return Kv(e,t,"tabview").map((function(t){return Bx.contents(t)})).getOr([])},showTab:function(t,e){var n=function(t){var n=rb.getCandidates(t),r=tt(n,(function(t){return tv.getValue(t)===e}));return r.filter((function(e){return!rb.isHighlighted(t,e)}))};i(t,n)}}}},HX=hg({name:"TabSection",configFields:PX(),partFields:LX(),factory:jX,apis:{getViewItems:function(t,e){return t.getViewItems(e)},showTab:function(t,e,n){t.showTab(e,n)}}}),RX=function(t,e,n){return G(t,(function(r,o){Bx.set(n,t[o].view());var i=e.dom.getBoundingClientRect();return Bx.set(n,[]),i.height}))},BX=function(t){return ft(st(t,(function(t,e){return t>e?-1:t=n.dom.offsetLeft+gr(n),s=c?Math.max(ar(n),u):u,l=parseInt(Zn(t,"margin-top"),10)||0,f=parseInt(Zn(t,"margin-bottom"),10)||0,d=ar(t)+l+f,h=d-s;return r-h},VX=function(t,e){ft(t).each((function(t){return HX.showTab(e,t.value)}))},FX=function(t,e){Kn(t,"height",e+"px"),en().browser.isIE()?nr(t,"flex-basis"):Kn(t,"flex-basis",e+"px")},qX=function(t,e,n){js(t,'[role="dialog"]').each((function(t){Rs(t,'[role="tablist"]').each((function(r){n.get().map((function(n){return Kn(e,"height","0"),Kn(e,"flex-basis","0"),Math.min(n,IX(t,e,r))})).each((function(t){FX(e,t)}))}))}))},UX=function(t){return Rs(t,'[role="tabpanel"]')},WX=function(t){var e=function(){var e=od(),n=[Fu((function(n){var r=n.element;UX(r).each((function(o){Kn(o,"visibility","hidden"),n.getSystem().getByDom(o).toOptional().each((function(n){var r=RX(t,o,n),i=BX(r);i.fold(e.clear,e.set)})),qX(r,o,e),nr(o,"visibility"),VX(t,n),w_.requestAnimationFrame((function(){qX(r,o,e)}))}))})),Pu(fu(),(function(t){var n=t.element;UX(n).each((function(t){qX(n,t,e)}))})),Pu(LT,(function(t,n){var r=t.element;UX(r).each((function(t){var n=Cf(Tn(t));Kn(t,"visibility","hidden");var o=Qn(t,"height").map((function(t){return parseInt(t,10)}));nr(t,"height"),nr(t,"flex-basis");var i=t.dom.getBoundingClientRect().height,a=o.forall((function(t){return i>t}));a?(e.set(i),qX(r,t,e)):o.each((function(e){FX(t,e)})),nr(t,"visibility"),n.each(Of)}))}))],r=!1;return{extraEvents:n,selectFirst:r}}(),n=function(){var t=[],e=!0;return{extraEvents:t,selectFirst:e}}();return{smartTabHeight:e,naiveTabHeight:n}},GX="send-data-to-section",$X="send-data-to-view",KX=function(t,e){var n=oa({}),r=function(t){var e=tv.getValue(t),r=wX(e).getOr({}),o=n.get(),i=_o(o,r);n.set(i)},o=function(t){var e=n.get();tv.setValue(t,e)},i=oa(null),a=G(t.tabs,(function(t){return{value:t.name,dom:{tag:"div",classes:["tox-dialog__body-nav-item"],innerHtml:e.shared.providers.translate(t.title)},view:function(){return[NN.sketch((function(n){return{dom:{tag:"div",classes:["tox-form"]},components:G(t.items,(function(t){return uR(n,t,e)})),formBehaviours:hf([Tx.config({mode:"acyclic",useTabstopAt:k(gD)}),Vx("TabView.form.events",[Fu(o),qu(r)]),yf.config({channels:pa([{key:GX,value:{onReceive:r}},{key:$X,value:{onReceive:o}}])})])}}))]}}})),u=WX(a).smartTabHeight;return HX.sketch({dom:{tag:"div",classes:["tox-dialog__body"]},onChangeTab:function(t,e,n){var r=tv.getValue(e);Ou(t,DT,{name:r,oldName:i.get()}),i.set(r)},tabs:a,components:[HX.parts.tabbar({dom:{tag:"div",classes:["tox-dialog__body-nav"]},components:[TX.parts.tabs({})],markers:{tabClass:"tox-tab",selectedClass:"tox-dialog__body-nav-item--active"},tabbarBehaviours:hf([yT.config({})])}),HX.parts.tabview({dom:{tag:"div",classes:["tox-dialog__body-content"]}})],selectFirst:u.selectFirst,tabSectionBehaviours:hf([Vx("tabpanel",u.extraEvents),Tx.config({mode:"acyclic"}),bg.config({find:function(t){return ft(HX.getViewItems(t))}}),tv.config({store:{mode:"manual",getValue:function(t){return t.getSystem().broadcastOn([GX],{}),n.get()},setValue:function(t,e){n.set(e),t.getSystem().broadcastOn([$X],{})}}})])})},YX=oc("update-dialog"),XX=oc("update-title"),ZX=oc("update-body"),JX=oc("update-footer"),QX=oc("body-send-message"),tZ=function(t,e,n,r){var o=function(t){switch(t.body.type){case"tabpanel":return[KX(t.body,n)];default:return[_X(t.body,n)]}},i=function(t,e){return j.some({isTabPanel:function(){return"tabpanel"===e.body.type}})},a={"aria-live":"polite"};return{dom:{tag:"div",classes:["tox-dialog__content-js"],attributes:T(T({},e.map((function(t){return{id:t}})).getOr({})),r?a:{})},components:[],behaviours:hf([UN.childAt(0),pU.config({channel:ZX,updateState:i,renderComponents:o,initialData:t})])}},eZ=function(t,e,n,r){return tZ(t,j.some(e),n,r)},nZ=function(t,e){var n=tZ(t,j.none(),e,!1);return VK.parts.body(n)},rZ=function(t){var e={dom:{tag:"div",classes:["tox-dialog__content-js"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-iframe"]},components:[pD({dom:{tag:"iframe",attributes:{src:t.url}},behaviours:hf([yT.config({}),Xx.config({})])})]}],behaviours:hf([Tx.config({mode:"acyclic",useTabstopAt:k(gD)})])};return VK.parts.body(e)},oZ=_C.deviceType.isTouch(),iZ=function(t,e){return{dom:{tag:"div",styles:{display:"none"},classes:["tox-dialog__header"]},components:[t,e]}},aZ=function(t,e){return VK.parts.close(O_.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":e.translate("Close")}},action:t,buttonBehaviours:hf([yT.config({})])}))},uZ=function(){return VK.parts.title({dom:{tag:"div",classes:["tox-dialog__title"],innerHtml:"",styles:{display:"none"}}})},cZ=function(t,e){return VK.parts.body({dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[{dom:ZV("

"+e.translate(t)+"

")}]}]})},sZ=function(t){return VK.parts.footer({dom:{tag:"div",classes:["tox-dialog__footer"]},components:t})},lZ=function(t,e){return[sT.sketch({dom:{tag:"div",classes:["tox-dialog__footer-start"]},components:t}),sT.sketch({dom:{tag:"div",classes:["tox-dialog__footer-end"]},components:e})]},fZ=function(t){var e,n="tox-dialog",r=n+"-wrap",o=r+"__backdrop",i=n+"__disable-scroll";return VK.sketch({lazySink:t.lazySink,onEscape:function(e){return t.onEscape(e),j.some(!0)},useTabstopAt:function(t){return!gD(t)},dom:{tag:"div",classes:[n].concat(t.extraClasses),styles:T({position:"relative"},t.extraStyles)},components:z([t.header,t.body],t.footer.toArray(),!0),parts:{blocker:{dom:ZV('
'),components:[{dom:{tag:"div",classes:oZ?[o,o+"--opaque"]:[o]}}]}},dragBlockClass:r,modalBehaviours:hf(z([Xx.config({}),Vx("dialog-events",t.dialogEvents.concat([Vu(Ra(),(function(t,e){Tx.focusIn(t)}))])),Vx("scroll-lock",[Fu((function(){is(Hn(),i)})),qu((function(){us(Hn(),i)}))])],t.extraBehaviours,!0)),eventOrder:T((e={},e[eu()]=["dialog-events"],e[du()]=["scroll-lock","dialog-events","alloy.base.behaviour"],e[hu()]=["alloy.base.behaviour","dialog-events","scroll-lock"],e),t.eventOrder)})},dZ=function(t){return O_.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":t.translate("Close"),title:t.translate("Close")}},components:[j_("close",{tag:"div",classes:["tox-icon"]},t.icons)],action:function(t){_u(t,TT)}})},hZ=function(t,e,n){var r=function(t){return[Os(n.translate(t.title))]};return{dom:{tag:"div",classes:["tox-dialog__title"],attributes:T({},e.map((function(t){return{id:t}})).getOr({}))},components:r(t),behaviours:hf([pU.config({channel:XX,renderComponents:r})])}},pZ=function(){return{dom:ZV('
')}},mZ=function(t,e,n){return sT.sketch({dom:ZV('
'),components:[hZ(t,j.some(e),n),pZ(),dZ(n)],containerBehaviours:hf([bK.config({mode:"mouse",blockerClass:"blocker",getTarget:function(t){return Bs(t,'[role="dialog"]').getOrDie()},snaps:{getSnapPoints:function(){return[]},leftAttr:"data-drag-left",topAttr:"data-drag-top"}})])})},vZ=function(t,e){var n=VK.parts.title(hZ(t,j.none(),e)),r=VK.parts.draghandle(pZ()),o=VK.parts.close(dZ(e)),i=[n].concat(t.draggable?[r]:[]).concat([o]);return sT.sketch({dom:ZV('
'),components:i})},gZ=function(t,e){return vZ({title:e.shared.providers.translate(t),draggable:e.dialog.isDraggableModal()},e.shared.providers)},bZ=function(t,e,n){return{dom:{tag:"div",classes:["tox-dialog__busy-spinner"],attributes:{"aria-label":n.translate(t)},styles:{left:"0px",right:"0px",bottom:"0px",top:"0px",position:"absolute"}},behaviours:e,components:[{dom:ZV('
')}]}},yZ=function(t,e,n){return{onClose:function(){return n.closeWindow()},onBlock:function(n){VK.setBusy(t(),(function(t,r){return bZ(n.message,r,e)}))},onUnblock:function(){VK.setIdle(t())}}},xZ=function(t,e,n,r){var o,i=function(t,e){return j.some(e)};return Es(fZ(T(T({},t),{lazySink:r.shared.getSink,extraBehaviours:z([pU.config({channel:YX,updateState:i,initialData:e}),aD.memory({})],t.extraBehaviours,!0),onEscape:function(t){_u(t,TT)},dialogEvents:n,eventOrder:(o={},o[tu()]=[pU.name(),yf.name()],o[du()]=["scroll-lock",pU.name(),"messages","dialog-events","alloy.base.behaviour"],o[hu()]=["alloy.base.behaviour","dialog-events","messages",pU.name(),"scroll-lock"],o)})))},wZ=function(t){var e=function(t){var e=G(t.items,(function(t){var e=oa(!1);return T(T({},t),{storage:e})}));return T(T({},t),{items:e})};return G(t,(function(t){return"menu"===t.type?e(t):t}))},_Z=function(t){return J(t,(function(t,e){if("menu"===e.type){var n=e;return J(n.items,(function(t,e){return t[e.name]=e.storage,t}),t)}return t}),{})},OZ=function(t,e){return[Ru(Ra(),vD),t(AT,(function(t,n){e.onClose(),n.onClose()})),t(TT,(function(t,e,n,r){e.onCancel(t),_u(r,AT)})),Pu(NT,(function(t,n){return e.onUnblock()})),Pu(PT,(function(t,n){return e.onBlock(n.event)}))]},kZ=function(t,e){var n=function(e,n){return Pu(e,(function(e,o){r(e,(function(r,i){n(t(),r,o.event,e)}))}))},r=function(t,e){pU.getState(t).get().each((function(n){e(n,t)}))};return z(z([],OZ(n,e),!0),[n(MT,(function(t,e,n){e.onAction(t,{name:n.name})}))],!1)},SZ=function(t,e,n){var r=function(e,n){return Pu(e,(function(e,r){o(e,(function(o,i){n(t(),o,r.event,e)}))}))},o=function(t,e){pU.getState(t).get().each((function(n){e(n.internalDialog,t)}))};return z(z([],OZ(r,e),!0),[r(zT,(function(t,e){return e.onSubmit(t)})),r(ET,(function(t,e,n){e.onChange(t,{name:n.name})})),r(MT,(function(t,e,r,o){var i=function(){return Tx.focusIn(o)},a=function(t){return Un(t,"disabled")||qn(t,"aria-disabled").exists((function(t){return"true"===t}))},u=Tn(o.element),c=Cf(u);e.onAction(t,{name:r.name,value:r.value}),Cf(u).fold(i,(function(t){a(t)||c.exists((function(e){return dn(t,e)&&a(e)}))?i():n().toOptional().filter((function(e){return!dn(e.element,t)})).each(i)}))})),r(DT,(function(t,e,n){e.onTabChange(t,{newTabName:n.name,oldTabName:n.oldName})})),qu((function(e){var n=t();tv.setValue(e,n.getData())}))],!1)},CZ={initUrlDialog:kZ,initDialog:SZ},EZ=function(t,e){return rj(t,t.type,e)},AZ=function(t,e,n){return tt(e,(function(t){return t.name===n})).bind((function(e){return e.memento.getOpt(t)}))},TZ=function(t,e){var n=e.map((function(t){return t.footerButtons})).getOr([]),r=Y(n,(function(t){return"start"===t.align})),o=function(t,e){return sT.sketch({dom:{tag:"div",classes:["tox-dialog__footer-"+t]},components:G(e,(function(t){return t.memento.asSpec()}))})},i=o("start",r.pass),a=o("end",r.fail);return[i,a]},MZ=function(t,e){var n=function(t,n){var r=G(n.buttons,(function(t){var n=k_(EZ(t,e));return{name:t.name,align:t.align,memento:n}})),o=function(t,e){return AZ(t,r,e)};return j.some({lookupByName:o,footerButtons:r})};return{dom:ZV(''),components:[],behaviours:hf([pU.config({channel:JX,initialData:t,updateState:n,renderComponents:TZ})])}},zZ=function(t,e){return MZ(t,e)},PZ=function(t,e){return VK.parts.footer(MZ(t,e))},NZ=function(t,e){var n=t.getRoot();if(n.getSystem().isConnected()){var r=bg.getCurrent(t.getFormWrapper()).getOr(t.getFormWrapper());return NN.getField(r,e).fold((function(){var n=t.getFooter(),o=pU.getState(n);return o.get().bind((function(t){return t.lookupByName(r,e)}))}),(function(t){return j.some(t)}))}return j.none()},DZ=function(t,e){var n=t.getRoot();return pU.getState(n).get().map((function(t){return wi(xi("data",t.dataValidator,e))})).getOr(e)},LZ=function(t,e,n){var r=function(e){var n=t.getRoot();n.getSystem().isConnected()&&e(n)},o=function(){var e=t.getRoot(),r=e.getSystem().isConnected()?t.getFormWrapper():e,o=tv.getValue(r),i=bt(n,(function(t){return t.get()}));return T(T({},o),i)},a=function(e){r((function(r){var o=m.getData(),i=T(T({},o),e),a=DZ(t,i),u=t.getFormWrapper();tv.setValue(u,a),gt(n,(function(t,e){Et(i,e)&&t.set(i[e])}))}))},u=function(e){NZ(t,e).each(Hg.disable)},c=function(e){NZ(t,e).each(Hg.enable)},s=function(e){NZ(t,e).each(Xx.focus)},l=function(t){if(!i(t))throw new Error("The dialogInstanceAPI.block function should be passed a blocking message of type string as an argument");r((function(e){Ou(e,PT,{message:t})}))},f=function(){r((function(t){_u(t,NT)}))},d=function(e){r((function(n){var r=t.getBody(),o=pU.getState(r);o.get().exists((function(t){return t.isTabPanel()}))&&bg.getCurrent(r).each((function(t){HX.showTab(t,e)}))}))},h=function(t){r((function(n){var r=e(t);n.getSystem().broadcastOn([YX],r),n.getSystem().broadcastOn([XX],r.internalDialog),n.getSystem().broadcastOn([ZX],r.internalDialog),n.getSystem().broadcastOn([JX],r.internalDialog),m.setData(r.initialData)}))},p=function(){r((function(t){_u(t,AT)}))},m={getData:o,setData:a,disable:u,enable:c,focus:s,block:l,unblock:f,showTab:d,redial:h,close:p};return m},jZ=function(t){switch(t){case"large":return["tox-dialog--width-lg"];case"medium":return["tox-dialog--width-md"];default:return[]}},HZ=function(t,e,n){var r=gZ(t.internalDialog.title,n),o=nZ({body:t.internalDialog.body},n),i=wZ(t.internalDialog.buttons),a=_Z(i),u=PZ({buttons:i},n),c=CZ.initDialog((function(){return h}),yZ((function(){return f}),n.shared.providers,e),n.shared.getSink),s=jZ(t.internalDialog.size),l={header:r,body:o,footer:j.some(u),extraClasses:s,extraBehaviours:[],extraStyles:{}},f=xZ(l,t,c,n),d=function(){var t=function(){var t=VK.getBody(f);return bg.getCurrent(t).getOr(t)};return{getRoot:x(f),getBody:function(){return VK.getBody(f)},getFooter:function(){return VK.getFooter(f)},getFormWrapper:t}}(),h=LZ(d,e.redial,a);return{dialog:f,instanceApi:h}},RZ=function(t,e,n,r){var o,i,a=oc("dialog-label"),u=oc("dialog-content"),c=function(t,e){return j.some(e)},s=k_(mZ({title:t.internalDialog.title,draggable:!0},a,n.shared.providers)),l=k_(eZ({body:t.internalDialog.body},u,n,r)),f=wZ(t.internalDialog.buttons),d=_Z(f),h=k_(zZ({buttons:f},n)),p=CZ.initDialog((function(){return v}),{onBlock:function(t){KV.block(m,(function(e,r){return bZ(t.message,r,n.shared.providers)}))},onUnblock:function(){KV.unblock(m)},onClose:function(){return e.closeWindow()}},n.shared.getSink),m=Es({dom:{tag:"div",classes:["tox-dialog","tox-dialog-inline"],attributes:(o={role:"dialog"},o["aria-labelledby"]=a,o["aria-describedby"]=u,o)},eventOrder:(i={},i[tu()]=[pU.name(),yf.name()],i[eu()]=["execute-on-form"],i[du()]=["reflecting","execute-on-form"],i),behaviours:hf([Tx.config({mode:"cyclic",onEscape:function(t){return _u(t,AT),j.some(!0)},useTabstopAt:function(t){return!gD(t)&&("button"!==ue(t)||"disabled"!==Fn(t,"disabled"))}}),pU.config({channel:YX,updateState:c,initialData:t}),Xx.config({}),Vx("execute-on-form",p.concat([Vu(Ra(),(function(t,e){Tx.focusIn(t)}))])),KV.config({getRoot:function(){return j.some(m)}}),Bx.config({}),aD.memory({})]),components:[s.asSpec(),l.asSpec(),h.asSpec()]}),v=LZ({getRoot:x(m),getFooter:function(){return h.get(m)},getBody:function(){return l.get(m)},getFormWrapper:function(){var t=l.get(m);return bg.getCurrent(t).getOr(t)}},e.redial,d);return{dialog:m,instanceApi:v}},BZ=tinymce.util.Tools.resolve("tinymce.util.URI"),IZ=function(t){var e=function(e){t.getSystem().isConnected()&&e(t)},n=function(t){if(!i(t))throw new Error("The urlDialogInstanceAPI.block function should be passed a blocking message of type string as an argument");e((function(e){Ou(e,PT,{message:t})}))},r=function(){e((function(t){_u(t,NT)}))},o=function(){e((function(t){_u(t,AT)}))},a=function(t){e((function(e){e.getSystem().broadcastOn([QX],t)}))};return{block:n,unblock:r,close:o,sendMessage:a}},VZ=["insertContent","setContent","execCommand","close","block","unblock"],FZ=function(t){return a(t)&&-1!==VZ.indexOf(t.mceAction)},qZ=function(t){return!FZ(t)&&a(t)&&Et(t,"mceAction")},UZ=function(t,e,n){switch(n.mceAction){case"insertContent":t.insertContent(n.content);break;case"setContent":t.setContent(n.content);break;case"execCommand":var r=!!s(n.ui)&&n.ui;t.execCommand(n.cmd,r,n.value);break;case"close":e.close();break;case"block":e.block(n.message);break;case"unblock":e.unblock();break}},WZ=function(t,e,n,r){var o,i=gZ(t.title,r),a=rZ(t),u=t.buttons.bind((function(t){return 0===t.length?j.none():j.some(PZ({buttons:t},r))})),c=CZ.initUrlDialog((function(){return g}),yZ((function(){return v}),r.shared.providers,e)),s=T(T({},t.height.fold((function(){return{}}),(function(t){return{height:t+"px","max-height":t+"px"}}))),t.width.fold((function(){return{}}),(function(t){return{width:t+"px","max-width":t+"px"}}))),l=t.width.isNone()&&t.height.isNone()?["tox-dialog--width-lg"]:[],f=new BZ(t.url,{base_uri:new BZ(window.location.href)}),d=f.protocol+"://"+f.host+(f.port?":"+f.port:""),h=nd(),p=[Vx("messages",[Fu((function(){var e=ad(ee.fromDom(window),"message",(function(e){if(f.isSameOrigin(new BZ(e.raw.origin))){var r=e.raw.data;FZ(r)?UZ(n,g,r):qZ(r)&&t.onMessage(g,r)}}));h.set(e)})),qu(h.clear)]),yf.config({channels:(o={},o[QX]={onReceive:function(t,e){Rs(t.element,"iframe").each((function(t){var n=t.dom.contentWindow;n.postMessage(e,d)}))}},o)})],m={header:i,body:a,footer:u,extraClasses:l,extraBehaviours:p,extraStyles:s},v=xZ(m,t,c,r),g=IZ(v);return{dialog:v,instanceApi:g}},GZ=function(t){var e=t.backstage.shared,n=function(n,r){var o=function(){VK.hide(c),r()},i=k_(rj({name:"close-alert",text:"OK",primary:!0,align:"end",disabled:!1,icon:j.none()},"cancel",t.backstage)),a=uZ(),u=aZ(o,e.providers),c=Es(fZ({lazySink:function(){return e.getSink()},header:iZ(a,u),body:cZ(n,e.providers),footer:j.some(sZ(lZ([],[i.asSpec()]))),onEscape:o,extraClasses:["tox-alert-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[Pu(TT,o)],eventOrder:{}}));VK.show(c);var s=i.get(c);Xx.focus(s)};return{open:n}},$Z=function(t){var e=t.backstage.shared,n=function(n,r){var o=function(t){VK.hide(s),r(t)},i=k_(rj({name:"yes",text:"Yes",primary:!0,align:"end",disabled:!1,icon:j.none()},"submit",t.backstage)),a=rj({name:"no",text:"No",primary:!1,align:"end",disabled:!1,icon:j.none()},"cancel",t.backstage),u=uZ(),c=aZ((function(){return o(!1)}),e.providers),s=Es(fZ({lazySink:function(){return e.getSink()},header:iZ(u,c),body:cZ(n,e.providers),footer:j.some(sZ(lZ([],[a,i.asSpec()]))),onEscape:function(){return o(!1)},extraClasses:["tox-confirm-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[Pu(TT,(function(){return o(!1)})),Pu(zT,(function(){return o(!0)}))],eventOrder:{}}));VK.show(s);var l=i.get(s);Xx.focus(l)};return{open:n}},KZ=function(t,e){return wi(xi("data",e,t))},YZ=function(t){return jA(t,".tox-alert-dialog")||jA(t,".tox-confirm-dialog")},XZ=function(t,e,n){return e&&n?[]:[_I.config({contextual:{lazyContext:function(){return j.some(Zr(ee.fromDom(t.getContentAreaContainer())))},fadeInClass:"tox-dialog-dock-fadein",fadeOutClass:"tox-dialog-dock-fadeout",transitionClass:"tox-dialog-dock-transition"},modes:["top"]})]},ZZ=function(t){var e=t.backstage,n=t.editor,r=WS(n),o=GZ(t),i=$Z(t),a=function(t,n,r){return void 0!==n&&"toolbar"===n.inline?l(t,e.shared.anchors.inlineDialog(),r,n.ariaAttrs):void 0!==n&&"cursor"===n.inline?l(t,e.shared.anchors.cursor(),r,n.ariaAttrs):s(t,r)},u=function(t,e){return c(t,e)},c=function(t,r){var o=function(t){var o=WZ(t,{closeWindow:function(){VK.hide(o.dialog),r(o.instanceApi)}},n,e);return VK.show(o.dialog),o.instanceApi};return xX.openUrl(o,t)},s=function(t,n){var r=function(t,r,o){var i=r,a={dataValidator:o,initialData:i,internalDialog:t},u=HZ(a,{redial:xX.redial,closeWindow:function(){VK.hide(u.dialog),n(u.instanceApi)}},e);return VK.show(u.dialog),u.instanceApi.setData(i),u.instanceApi};return xX.open(r,t)},l=function(t,o,i,a){var u=function(t,u,c){var s=KZ(u,c),l=od(),f=e.shared.header.isPositionedAtTop(),d={dataValidator:c,initialData:s,internalDialog:t},h=function(){return l.on((function(t){e_.reposition(t),_I.refresh(t)}))},p=RZ(d,{redial:xX.redial,closeWindow:function(){l.on(e_.hide),n.off("ResizeEditor",h),l.clear(),i(p.instanceApi)}},e,a),m=Es(e_.sketch(T(T({lazySink:e.shared.getSink,dom:{tag:"div",classes:[]},fireDismissalEventInstead:{}},f?{}:{fireRepositionEventInstead:{}}),{inlineBehaviours:hf(z([Vx("window-manager-inline-events",[Pu(pu(),(function(t,e){_u(p.dialog,TT)}))])],XZ(n,r,f),!0)),isExtraPart:function(t,e){return YZ(e)}})));return l.set(m),e_.showWithin(m,As(p.dialog),{anchor:o},j.some(Hn())),r&&f||(_I.refresh(m),n.on("ResizeEditor",h)),p.instanceApi.setData(s),Tx.focusIn(p.dialog),p.instanceApi};return xX.open(u,t)},f=function(t,e){i.open(t,(function(t){e(t)}))},d=function(t,e){o.open(t,(function(){e()}))},h=function(t){t.close()};return{open:a,openUrl:u,alert:d,close:h,confirm:f}};function JZ(){A.add("silver",(function(t){var e=DK(t),n=e.uiMothership,r=e.backstage,o=e.renderUI,i=e.getUi;LA.register(t,r.shared);var a=ZZ({editor:t,backstage:r});return{renderUI:o,getWindowManagerImpl:x(a),getNotificationManagerImpl:function(){return V_(t,{backstage:r},n)},ui:i()}}))}JZ()})()}).call(this,n("c8ba"))},"0d68":function(t,e,n){n("030f")},"16f1":function(t,e){(function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=function(t,e){return t.fire("insertCustomChar",{chr:e})},n=function(t,n){var r=e(t,n).chr;t.execCommand("mceInsertContent",!1,r)},r=function(t){var e=typeof t;return null===t?"null":"object"===e&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"===e&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":e},o=function(t){return function(e){return r(e)===t}},i=function(t){return function(e){return t===e}},a=o("array"),u=i(null),c=function(){},s=function(t){return function(){return t}},l=function(t){return t},f=s(!1),d=s(!0),h=function(){return p},p=function(){var t=function(t){return t()},e=l,n={fold:function(t,e){return t()},isSome:f,isNone:d,getOr:e,getOrThunk:t,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:s(null),getOrUndefined:s(void 0),or:e,orThunk:t,map:h,each:c,bind:h,exists:f,forall:d,filter:function(){return h()},toArray:function(){return[]},toString:s("none()")};return n}(),m=function(t){var e=s(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},isSome:d,isNone:f,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return m(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:p},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},v=function(t){return null===t||void 0===t?p:m(t)},g={some:m,none:h,from:v},b=Array.prototype.push,y=function(t,e){for(var n=t.length,r=new Array(n),o=0;o1?[{name:"All",characters:k(e,(function(t){return t.characters}))}].concat(e):e},L=function(t){var e=function(){return D(t)},r=function(e){n(t,e)};return{getCharMap:e,insertChar:r}},j=function(t){var e=t,n=function(){return e},r=function(t){e=t};return{get:n,set:r}},H=function(t,e){var n=null,r=function(){u(n)||(clearTimeout(n),n=null)},o=function(){for(var o=[],i=0;i>>0===u))throw RangeError("Invalid code point: "+u);u<=65535?r=n.push(u):(u-=65536,r=n.push(55296+(u>>10),u%1024+56320)),r>=16383&&(o+=String.fromCharCode.apply(null,n),n.length=0)}return o+String.fromCharCode.apply(null,n)},V=function(t,e,n){return!!B(I(t).toLowerCase(),n)||(B(e.toLowerCase(),n)||B(e.toLowerCase().replace(/\s+/g,""),n))},F=function(t,e){var n=[],r=e.toLowerCase();return x(t.characters,(function(t){V(t[0],t[1],r)&&n.push(t)})),y(n,(function(t){return{text:t[1],value:I(t[0]),icon:I(t[0])}}))},q="pattern",U=function(t,e){var r=function(){return[{label:"Search",type:"input",name:q},{type:"collection",name:"results"}]},o=function(){return y(e,(function(t){return{title:t.name,name:t.name,items:r()}}))},i=function(){return{type:"panel",items:r()}},a=function(){return{type:"tabpanel",tabs:o()}},u=1===e.length?j(T):j("All"),c=function(t,n){_(e,(function(t){return t.name===u.get()})).each((function(e){var r=F(e,n);t.setData({results:r})}))},s=40,l=H((function(t){var e=t.getData().pattern;c(t,e)}),s),f=1===e.length?i():a(),d={pattern:"",results:F(e[0],"")},h={title:"Special Character",size:"normal",body:f,buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}],initialData:d,onAction:function(e,r){"results"===r.name&&(n(t,r.value),e.close())},onTabChange:function(t,e){u.set(e.newTabName),l.throttle(t)},onChange:function(t,e){e.name===q&&l.throttle(t)}},p=t.windowManager.open(h);p.focus(q)},W=function(t,e){t.addCommand("mceShowCharmap",(function(){U(t,e)}))},G=tinymce.util.Tools.resolve("tinymce.util.Promise"),$=function(t,e){t.ui.registry.addAutocompleter("charmap",{ch:":",columns:"auto",minChars:2,fetch:function(t,n){return new G((function(n,r){n(F(e,t))}))},onAction:function(e,n,r){t.selection.setRng(n),t.insertContent(r),e.hide()}})},K=function(t){t.ui.registry.addButton("charmap",{icon:"insert-character",tooltip:"Special character",onAction:function(){return t.execCommand("mceShowCharmap")}}),t.ui.registry.addMenuItem("charmap",{icon:"insert-character",text:"Special character...",onAction:function(){return t.execCommand("mceShowCharmap")}})};function Y(){t.add("charmap",(function(t){var e=D(t);return W(t,e),K(t),$(t,e[0]),L(t)}))}Y()})()},2401:function(t,e){(function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=function(t){var e=typeof t;return null===t?"null":"object"===e&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"===e&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":e},n=function(t){return function(n){return e(n)===t}},r=function(t){return function(e){return typeof e===t}},o=n("string"),i=n("object"),a=n("array"),u=r("boolean"),c=r("function"),s=r("number"),l=function(){},f=function(t){return function(){return t}},d=function(t){return t},h=function(t,e){return t===e},p=function(t){return function(e){return!t(e)}},m=f(!1),v=f(!0),g=function(){return b},b=function(){var t=function(t){return t()},e=d,n={fold:function(t,e){return t()},isSome:m,isNone:v,getOr:e,getOrThunk:t,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:f(null),getOrUndefined:f(void 0),or:e,orThunk:t,map:g,each:l,bind:g,exists:m,forall:v,filter:function(){return g()},toArray:function(){return[]},toString:f("none()")};return n}(),y=function(t){var e=f(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},isSome:v,isNone:m,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return y(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:b},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},x=function(t){return null===t||void 0===t?b:y(t)},w={some:y,none:g,from:x},_=Array.prototype.slice,O=Array.prototype.push,k=function(t,e){for(var n=t.length,r=new Array(n),o=0;o=0&&e0},nt=function(t){return!et(t)},rt=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,ot=function(t){return function(e){return J(e,t)}},it=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return J(t,"edge/")&&J(t,"chrome")&&J(t,"safari")&&J(t,"applewebkit")}},{name:"Chrome",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,rt],search:function(t){return J(t,"chrome")&&!J(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return J(t,"msie")||J(t,"trident")}},{name:"Opera",versionRegexes:[rt,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:ot("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:ot("firefox")},{name:"Safari",versionRegexes:[rt,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(J(t,"safari")||J(t,"mobile/"))&&J(t,"applewebkit")}}],at=[{name:"Windows",search:ot("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return J(t,"iphone")||J(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:ot("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:ot("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:ot("linux"),versionRegexes:[]},{name:"Solaris",search:ot("sunos"),versionRegexes:[]},{name:"FreeBSD",search:ot("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:ot("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],ut={browsers:f(it),oses:f(at)},ct="Edge",st="Chrome",lt="IE",ft="Opera",dt="Firefox",ht="Safari",pt=function(){return mt({current:void 0,version:$.unknown()})},mt=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isEdge:r(ct),isChrome:r(st),isIE:r(lt),isOpera:r(ft),isFirefox:r(dt),isSafari:r(ht)}},vt={unknown:pt,nu:mt,edge:f(ct),chrome:f(st),ie:f(lt),opera:f(ft),firefox:f(dt),safari:f(ht)},gt="Windows",bt="iOS",yt="Android",xt="Linux",wt="OSX",_t="Solaris",Ot="FreeBSD",kt="ChromeOS",St=function(){return Ct({current:void 0,version:$.unknown()})},Ct=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isWindows:r(gt),isiOS:r(bt),isAndroid:r(yt),isOSX:r(wt),isLinux:r(xt),isSolaris:r(_t),isFreeBSD:r(Ot),isChromeOS:r(kt)}},Et={unknown:St,nu:Ct,windows:f(gt),ios:f(bt),android:f(yt),linux:f(xt),osx:f(wt),solaris:f(_t),freebsd:f(Ot),chromeos:f(kt)},At=function(t,e,n){var r=ut.browsers(),o=ut.oses(),i=e.bind((function(t){return K(r,t)})).orThunk((function(){return X(r,t)})).fold(vt.unknown,vt.nu),a=Z(o,t).fold(Et.unknown,Et.nu),u=V(a,i,t,n);return{browser:i,os:a,deviceType:u}},Tt={detect:At},Mt=function(t){return window.matchMedia(t).matches},zt=I((function(){return Tt.detect(navigator.userAgent,w.from(navigator.userAgentData),Mt)})),Pt=function(){return zt()},Nt=function(t,e,n){return 0!==(t.compareDocumentPosition(e)&n)},Dt=function(t,e){return Nt(t,e,Node.DOCUMENT_POSITION_CONTAINED_BY)},Lt=1,jt=function(t,e){var n=e||document,r=n.createElement("div");if(r.innerHTML=t,!r.hasChildNodes()||r.childNodes.length>1)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return Bt(r.childNodes[0])},Ht=function(t,e){var n=e||document,r=n.createElement(t);return Bt(r)},Rt=function(t,e){var n=e||document,r=n.createTextNode(t);return Bt(r)},Bt=function(t){if(null===t||void 0===t)throw new Error("Node cannot be null or undefined");return{dom:t}},It=function(t,e,n){return w.from(t.dom.elementFromPoint(e,n)).map(Bt)},Vt={fromHtml:jt,fromTag:Ht,fromText:Rt,fromDom:Bt,fromPoint:It},Ft=function(t,e){var n=t.dom;if(n.nodeType!==Lt)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},qt=function(t,e){return t.dom===e.dom},Ut=function(t,e){var n=t.dom,r=e.dom;return n!==r&&n.contains(r)},Wt=function(t,e){return Dt(t.dom,e.dom)},Gt=function(t,e){return Pt().browser.isIE()?Wt(t,e):Ut(t,e)},$t=Ft,Kt=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),Yt=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),Xt=tinymce.util.Tools.resolve("tinymce.util.VK"),Zt=Object.keys,Jt=function(t,e){for(var n=Zt(t),r=0,o=n.length;r0)&&r},Ve=function(t,e){return t.isChildOf(e,t.getRoot())},Fe=function(t){return t.getParam("lists_indent_on_tab",!0)},qe=function(t){var e=t.getParam("forced_root_block","p");return!1===e?"":!0===e?"p":e},Ue=function(t){return t.getParam("forced_root_block_attrs",{})},We=function(t,e){var n,r,o,i=t.dom,a=t.schema.getBlockElements(),u=i.createFragment(),c=qe(t);if(c&&(r=i.create(c),r.tagName===c.toUpperCase()&&i.setAttribs(r,Ue(t)),Re(e.firstChild,a)||u.appendChild(r)),e)while(n=e.firstChild){var s=n.nodeName;o||"SPAN"===s&&"bookmark"===n.getAttribute("data-mce-type")||(o=!0),Re(n,a)?(u.appendChild(n),r=null):c?(r||(r=i.create(c),u.appendChild(r)),r.appendChild(n)):u.appendChild(n)}return c?o||r.appendChild(i.create("br",{"data-mce-bogus":"1"})):u.appendChild(i.create("br")),u},Ge=ke.DOM,$e=function(t,e,n){var r=function(t){Se.each(o,(function(e){t.parentNode.insertBefore(e,n.parentNode)})),Ge.remove(t)},o=Ge.select('span[data-mce-type="bookmark"]',e),i=We(t,n),a=Ge.createRng();a.setStartAfter(n),a.setEndAfter(e);for(var u=a.extractContents(),c=u.firstChild;c;c=c.firstChild)if("LI"===c.nodeName&&t.dom.isEmpty(c)){Ge.remove(c);break}t.dom.isEmpty(u)||Ge.insertAfter(u,e),Ge.insertAfter(i,e),Ie(t.dom,n.parentNode)&&r(n.parentNode),Ge.remove(n),Ie(t.dom,e)&&Ge.remove(e)},Ke=ae("dd"),Ye=ae("dt"),Xe=function(t,e){Ke(e)?Oe(e,"dt"):Ye(e)&&le(e).each((function(n){return $e(t,n.dom,e.dom)}))},Ze=function(t){Ye(t)&&Oe(t,"dd")},Je=function(t,e,n){S(n,"Indent"===e?Ze:function(e){return Xe(t,e)})},Qe=function(t,e){if(Ae(t))return{container:t,offset:e};var n=Kt.getNode(t,e);return Ae(n)?{container:n,offset:e>=t.childNodes.length?n.data.length:0}:n.previousSibling&&Ae(n.previousSibling)?{container:n.previousSibling,offset:n.previousSibling.data.length}:n.nextSibling&&Ae(n.nextSibling)?{container:n.nextSibling,offset:0}:{container:t,offset:e}},tn=function(t){var e=t.cloneRange(),n=Qe(t.startContainer,t.startOffset);e.setStart(n.container,n.offset);var r=Qe(t.endContainer,t.endOffset);return e.setEnd(r.container,r.offset),e},en=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),nn=function(t,e){var n=e||t.selection.getStart(!0);return t.dom.getParent(n,"OL,UL,DL",ln(t,n))},rn=function(t,e){return t&&1===e.length&&e[0]===t},on=function(t){return C(t.querySelectorAll("ol,ul,dl"),Te)},an=function(t){var e=nn(t),n=t.selection.getSelectedBlocks();return rn(e,n)?on(e):C(n,(function(t){return Te(t)&&e!==t}))},un=function(t,e){var n=Se.map(e,(function(e){var n=t.dom.getParent(e,"li,dd,dt",ln(t,e));return n||e}));return en.unique(n)},cn=function(t){var e=t.selection.getSelectedBlocks();return C(un(t,e),Pe)},sn=function(t){return C(cn(t),Ne)},ln=function(t,e){var n=t.dom.getParents(e,"TD,TH");return n.length>0?n[0]:t.getBody()},fn=function(t,e){var n=t.dom.getParents(e,"ol,ul",ln(t,e));return j(n)},dn=function(t){var e=fn(t,t.selection.getStart()),n=C(t.selection.getSelectedBlocks(),Me);return e.toArray().concat(n)},hn=function(t){var e=dn(t);return pn(t,e)},pn=function(t,e){var n=k(e,(function(e){return fn(t,e).getOr(e)}));return en.unique(n)},mn=function(t,e,n){return void 0===n&&(n=h),t.exists((function(t){return n(t,e)}))},vn=function(t,e,n){return t.isSome()&&e.isSome()?w.some(n(t.getOrDie(),e.getOrDie())):w.none()},gn=function(t,e){var n=e||document,r=n.createDocumentFragment();return S(t,(function(t){r.appendChild(t.dom)})),Vt.fromDom(r)},bn=function(t,e,n){return t.fire("ListMutation",{action:e,element:n})},yn=function(t){return void 0!==t.style&&c(t.style.getPropertyValue)},xn=function(t,e,n){if(!o(n))throw console.error("Invalid call to CSS.set. Property ",e,":: Value ",n,":: Element ",t),new Error("CSS value must be a string: "+n);yn(t)&&t.style.setProperty(e,n)},wn=function(t,e,n){var r=t.dom;xn(r,e,n)},_n=function(t,e){ve(t.item,e.list)},On=function(t){for(var e=1;ee.length?Pn(t,e,n):zn(t,e,n)}),[]);return L(n).map((function(t){return t.list}))},Dn=function(t){return $t(t,"OL,UL")},Ln=function(t){return he(t).exists(Dn)},jn=function(t){return pe(t).exists(Dn)},Hn=function(t){return t.depth>0},Rn=function(t){return t.isSelected},Bn=function(t){var e=fe(t),n=jn(t)?e.slice(0,-1):e;return k(n,we)},In=function(t,e,n){return le(t).filter(ie).map((function(r){return{depth:e,dirty:!1,isSelected:n,content:Bn(t),itemAttributes:se(t),listAttributes:se(r),listType:ne(r)}}))},Vn=function(t,e){switch(t){case"Indent":e.depth++;break;case"Outdent":e.depth--;break;case"Flatten":e.depth=0}e.dirty=!0},Fn=function(t,e){t.listType=e.listType,t.listAttributes=R({},e.listAttributes)},qn=function(t){t.listAttributes=ee(t.listAttributes,(function(t,e){return"start"!==e}))},Un=function(t,e){var n=t[e].depth,r=function(t){return t.depth===n&&!t.dirty},o=function(t){return t.depth0?Ar(t,r,o,e,a):Mr(t,r,e,a)},Pr=ke.DOM,Nr=function(t,e){var n=e.parentNode;if("LI"===n.nodeName&&n.firstChild===e){var r=n.previousSibling;r&&"LI"===r.nodeName?(r.appendChild(e),Ie(t,n)&&Pr.remove(n)):Pr.setStyle(n,"listStyleType","none")}if(Te(n)){r=n.previousSibling;r&&"LI"===r.nodeName&&r.appendChild(e)}},Dr=function(t,e){var n=Se.grep(t.select("ol,ul",e));Se.each(n,(function(e){Nr(t,e)}))},Lr=function(t,e,n,r){var o=e.startContainer,i=e.startOffset;if(Ae(o)&&(n?i0))return o;var a=t.schema.getNonEmptyElements();1===o.nodeType&&(o=Kt.getNode(o,i));var u=new Yt(o,r);n&&Be(t.dom,o)&&u.next();while(o=u[n?"next":"prev2"]()){if("LI"===o.nodeName&&!o.hasChildNodes())return o;if(a[o.nodeName])return o;if(Ae(o)&&o.data.length>0)return o}},jr=function(t,e){var n=e.childNodes;return 1===n.length&&!Te(n[0])&&t.isBlock(n[0])},Hr=function(t,e){jr(t,e)&&t.remove(e.firstChild,!0)},Rr=function(t,e,n){var r,o=jr(t,n)?n.firstChild:n;if(Hr(t,e),!Ie(t,e,!0))while(r=e.firstChild)o.appendChild(r)},Br=function(t,e,n){var r,o=e.parentNode;if(Ve(t,e)&&Ve(t,n)){Te(n.lastChild)&&(r=n.lastChild),o===n.lastChild&&Le(o.previousSibling)&&t.remove(o.previousSibling);var i=n.lastChild;i&&Le(i)&&e.hasChildNodes()&&t.remove(i),Ie(t,n,!0)&&t.$(n).empty(),Rr(t,e,n),r&&n.appendChild(r);var a=Gt(Vt.fromDom(n),Vt.fromDom(e)),u=a?t.getParents(e,Te,n):[];t.remove(e),S(u,(function(e){Ie(t,e)&&e!==t.getRoot()&&t.remove(e)}))}},Ir=function(t,e,n){t.dom.$(n).empty(),Br(t.dom,e,n),t.selection.setCursorLocation(n,0)},Vr=function(t,e,n,r){var o=t.dom;if(o.isEmpty(r))Ir(t,n,r);else{var i=cr(e);Br(o,n,r),t.selection.setRng(sr(i))}},Fr=function(t,e,n,r){var o=cr(e);Br(t.dom,n,r);var i=sr(o);t.selection.setRng(i)},qr=function(t,e){var n=t.dom,r=t.selection,o=r.getStart(),i=ln(t,o),a=n.getParent(r.getStart(),"LI",i);if(a){var u=a.parentNode;if(u===t.getBody()&&Ie(n,u))return!0;var c=tn(r.getRng()),s=n.getParent(Lr(t,c,e,i),"LI",i);if(s&&s!==a)return t.undoManager.transact((function(){e?Vr(t,c,s,a):je(a)?or(t):Fr(t,c,a,s)})),!0;if(!s&&!e&&0===c.startOffset&&0===c.endOffset)return t.undoManager.transact((function(){ir(t)})),!0}return!1},Ur=function(t,e,n){var r=t.getParent(e.parentNode,t.isBlock,n);t.remove(e),r&&t.isEmpty(r)&&t.remove(r)},Wr=function(t,e){var n=t.dom,r=t.selection.getStart(),o=ln(t,r),i=n.getParent(r,n.isBlock,o);if(i&&n.isEmpty(i)){var a=tn(t.selection.getRng()),u=n.getParent(Lr(t,a,e,o),"LI",o);if(u)return t.undoManager.transact((function(){Ur(n,i,o),Cr(n,u.parentNode),t.selection.select(u,!0),t.selection.collapse(e)})),!0}return!1},Gr=function(t,e){return qr(t,e)||Wr(t,e)},$r=function(t){var e=t.selection.getStart(),n=ln(t,e),r=t.dom.getParent(e,"LI,DT,DD",n);return!!(r||cn(t).length>0)&&(t.undoManager.transact((function(){t.execCommand("Delete"),Dr(t.dom,t.getBody())})),!0)},Kr=function(t,e){return t.selection.isCollapsed()?Gr(t,e):$r(t)},Yr=function(t){t.on("keydown",(function(e){e.keyCode===Xt.BACKSPACE?Kr(t,!1)&&e.preventDefault():e.keyCode===Xt.DELETE&&Kr(t,!0)&&e.preventDefault()}))},Xr=function(t){return{backspaceDelete:function(e){Kr(t,e)}}},Zr=function(t,e){var n=nn(t);t.undoManager.transact((function(){i(e.styles)&&t.dom.setStyles(n,e.styles),i(e.attrs)&&Jt(e.attrs,(function(e,r){return t.dom.setAttrib(n,r,e)}))}))},Jr=function(t){var e=N(tt(t).split("")),n=k(e,(function(t,e){var n=t.toUpperCase().charCodeAt(0)-"A".charCodeAt(0)+1;return Math.pow(26,e)*n}));return A(n,(function(t,e){return t+e}),0)},Qr=function(t){if(t--,t<0)return"";var e=t%26,n=Math.floor(t/26),r=Qr(n),o=String.fromCharCode("A".charCodeAt(0)+e);return r+o},to=function(t){return/^[A-Z]+$/.test(t)},eo=function(t){return/^[a-z]+$/.test(t)},no=function(t){return/^[0-9]+$/.test(t)},ro=function(t){return no(t)?2:to(t)?0:eo(t)?1:nt(t)?3:4},oo=function(t){switch(ro(t)){case 2:return w.some({listStyleType:w.none(),start:t});case 0:return w.some({listStyleType:w.some("upper-alpha"),start:Jr(t).toString()});case 1:return w.some({listStyleType:w.some("lower-alpha"),start:Jr(t).toString()});case 3:return w.some({listStyleType:w.none(),start:""});case 4:return w.none()}},io=function(t){var e=parseInt(t.start,10);return mn(t.listStyleType,"upper-alpha")?Qr(e):mn(t.listStyleType,"lower-alpha")?Qr(e).toLowerCase():t.start},ao=function(t){var e=nn(t);ze(e)&&t.windowManager.open({title:"List Properties",body:{type:"panel",items:[{type:"input",name:"start",label:"Start list at number",inputMode:"numeric"}]},initialData:{start:io({start:t.dom.getAttrib(e,"start","1"),listStyleType:w.some(t.dom.getStyle(e,"list-style-type"))})},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:function(e){var n=e.getData();oo(n.start).each((function(e){t.execCommand("mceListUpdate",!1,{attrs:{start:"1"===e.start?"":e.start},styles:{"list-style-type":e.listStyleType.getOr("")}})})),e.close()}})},uo=function(t,e){return function(){var n=nn(t);return n&&n.nodeName===e}},co=function(t){t.addCommand("mceListProps",(function(){ao(t)}))},so=function(t){t.on("BeforeExecCommand",(function(e){var n=e.command.toLowerCase();"indent"===n?rr(t):"outdent"===n&&or(t)})),t.addCommand("InsertUnorderedList",(function(e,n){zr(t,"UL",n)})),t.addCommand("InsertOrderedList",(function(e,n){zr(t,"OL",n)})),t.addCommand("InsertDefinitionList",(function(e,n){zr(t,"DL",n)})),t.addCommand("RemoveList",(function(){ir(t)})),co(t),t.addCommand("mceListUpdate",(function(e,n){i(n)&&Zr(t,n)})),t.addQueryStateHandler("InsertUnorderedList",uo(t,"UL")),t.addQueryStateHandler("InsertOrderedList",uo(t,"OL")),t.addQueryStateHandler("InsertDefinitionList",uo(t,"DL"))},lo=function(t){t.on("keydown",(function(e){e.keyCode!==Xt.TAB||Xt.metaKeyPressed(e)||t.undoManager.transact((function(){(e.shiftKey?or(t):rr(t))&&e.preventDefault()}))}))},fo=function(t){Fe(t)&&lo(t),Yr(t)},ho=function(t){var e=function(e){return function(){return t.execCommand(e)}};t.hasPlugin("advlist")||(t.ui.registry.addToggleButton("numlist",{icon:"ordered-list",active:!1,tooltip:"Numbered list",onAction:e("InsertOrderedList"),onSetup:function(e){return dr(t,"OL",e.setActive)}}),t.ui.registry.addToggleButton("bullist",{icon:"unordered-list",active:!1,tooltip:"Bullet list",onAction:e("InsertUnorderedList"),onSetup:function(e){return dr(t,"UL",e.setActive)}}))},po=function(t){var e={text:"List properties...",icon:"ordered-list",onAction:function(){return t.execCommand("mceListProps")},onSetup:function(e){return dr(t,"OL",(function(t){return e.setDisabled(!t)}))}};t.ui.registry.addMenuItem("listprops",e),t.ui.registry.addContextMenu("lists",{update:function(e){var n=nn(t,e);return ze(n)?["listprops"]:[]}})};function mo(){t.add("lists",(function(t){return!1===t.hasPlugin("rtc",!0)?(fo(t),so(t)):co(t),ho(t),po(t),Xr(t)}))}mo()})()},"24e8":function(t,e){(function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=function(t,e,n){return""===e||t.length>=e.length&&t.substr(n,n+e.length)===e},n=function(t,e){return-1!==t.indexOf(e)},r=function(t,n){return e(t,n,0)},o=tinymce.util.Tools.resolve("tinymce.Env"),i=function(){return/(?:[A-Za-z][A-Za-z\d.+-]{0,14}:\/\/(?:[-.~*+=!&;:'%@?^${}(),\w]+@)?|www\.|[-;:&=+$,.\w]+@)[A-Za-z\d-]+(?:\.[A-Za-z\d-]+)*(?::\d+)?(?:\/(?:[-+~=.,%()\/\w]*[-+~=%()\/\w])?)?(?:\?(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?(?:#(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?/g},a=new RegExp("^"+i().source+"$","i"),u=function(t){return t.getParam("autolink_pattern",a)},c=function(t){return t.getParam("default_link_target",!1)},s=function(t){return t.getParam("link_default_protocol","http","string")},l=function(t){return/^[(\[{ \u00a0]$/.test(t)},f=function(t){return 3===t.nodeType},d=function(t){return 1===t.nodeType},h=function(t){return w(t,-1)},p=function(t){return w(t,0)},m=function(t){return w(t,-1)},v=function(t,e){if(e<0&&(e=0),f(t)){var n=t.data.length;e>n&&(e=n)}return e},g=function(t,e,n){!d(e)||e.hasChildNodes()?t.setStart(e,v(e,n)):t.setStartBefore(e)},b=function(t,e,n){!d(e)||e.hasChildNodes()?t.setEnd(e,v(e,n)):t.setEndAfter(e)},y=function(t){return/^([A-Za-z][A-Za-z\d.+-]*:\/\/)|mailto:/.test(t)},x=function(t){return/[?!,.;:]/.test(t)},w=function(t,e){var o,i,a,d,h,p,m,v=u(t),w=c(t);if(null===t.dom.getParent(t.selection.getNode(),"a[href]")){var _=t.selection.getRng().cloneRange();if(_.startOffset<5){if(h=_.endContainer.previousSibling,!h){if(!_.endContainer.firstChild||!_.endContainer.firstChild.nextSibling)return;h=_.endContainer.firstChild.nextSibling}if(p=h.length,g(_,h,p),b(_,h,p),_.endOffset<5)return;o=_.endOffset,i=h}else{if(i=_.endContainer,!f(i)&&i.firstChild){while(!f(i)&&i.firstChild)i=i.firstChild;f(i)&&(g(_,i,0),b(_,i,i.nodeValue.length))}o=1===_.endOffset?2:_.endOffset-1-e}var O=o;do{g(_,i,o>=2?o-2:0),b(_,i,o>=1?o-1:0),o-=1,m=_.toString()}while(!l(m)&&o-2>=0);l(_.toString())?(g(_,i,o),b(_,i,O),o+=1):0===_.startOffset?(g(_,i,0),b(_,i,O)):(g(_,i,o),b(_,i,O)),d=_.toString(),x(d.charAt(d.length-1))&&b(_,i,O-1),d=_.toString().trim();var k=d.match(v),S=s(t);if(k){var C=k[0];r(C,"www.")?C=S+"://"+C:n(C,"@")&&!y(C)&&(C="mailto:"+C),a=t.selection.getBookmark(),t.selection.setRng(_),t.execCommand("createlink",!1,C),!1!==w&&t.dom.setAttrib(t.selection.getNode(),"target",w),t.selection.moveToBookmark(a),t.nodeChanged()}}},_=function(t){var e;t.on("keydown",(function(e){if(13===e.keyCode)return m(t)})),o.browser.isIE()?t.on("focus",(function(){if(!e){e=!0;try{t.execCommand("AutoUrlDetect",!1,!0)}catch(n){}}})):(t.on("keypress",(function(e){if(41===e.keyCode||93===e.keyCode||125===e.keyCode)return h(t)})),t.on("keyup",(function(e){if(32===e.keyCode)return p(t)})))};function O(){t.add("autolink",(function(t){_(t)}))}O()})()},"2fec":function(t,e,n){n("24e8")},3699:function(t,e){(function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=function(){return e=Object.assign||function(t){for(var e,n=1,r=arguments.length;n1?"www."===e[1]?"https://":e[1]:"https://"},nt=function(t,e){for(var n=et(e),r=t.regex.exec(e),o=n+t.url,i=function(t){o=o.replace("$"+t,(function(){return r[t]?r[t]:""}))},a=0;a0?H.extend({},e[0],{url:nt(e[0],t)}):null},ot=function(t){var e=t.allowfullscreen?' allowFullscreen="1"':"";return'"},it=function(t){var e='';return t.poster&&(e+=''),e+="",e},at=function(t,e){return e?e(t):'"},ut=function(t,e){return e?e(t):'"},ct=function(t){return'