(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-7e8d6eaa"],{"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"),u=n("object"),a=n("array"),c=o(null),s=r("boolean"),f=o(void 0),l=function(t){return null===t||void 0===t},d=function(t){return!l(t)},m=r("function"),g=r("number"),p=function(t,e){if(a(t)){for(var n=0,r=t.length;n-1},j=function(t,e){for(var n=0,r=t.length;n=0;n--){var r=t[n];e(r,n)}},X=function(t,e){for(var n=[],r=[],o=0,i=t.length;o=0&&e=e.length&&t.substr(n,n+e.length)===e},Ht=function(t,e){return jt(t,e)?Ft(t,e.length):t},Vt=function(t,e){return Wt(t,e)?t:Lt(t,e)},Ut=function(t,e){return-1!==t.indexOf(e)},jt=function(t,e){return zt(t,e,0)},Wt=function(t,e){return zt(t,e,t.length-e.length)},qt=function(t){return function(e){return e.replace(t,"")}},$t=qt(/^\s+|\s+$/g),Gt=function(t){return t.length>0},Kt=function(t){return!Gt(t)},Xt=function(t){return void 0!==t.style&&m(t.style.getPropertyValue)},Yt=function(t,e){var n=e||document,r=n.createElement("div");if(r.innerHTML=t,!r.hasChildNodes()||r.childNodes.length>1)throw new Error("HTML must have a single root node");return Zt(r.childNodes[0])},Jt=function(t,e){var n=e||document,r=n.createElement(t);return Zt(r)},Qt=function(t,e){var n=e||document,r=n.createTextNode(t);return Zt(r)},Zt=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 I.from(t.dom.elementFromPoint(e,n)).map(Zt)},ee={fromHtml:Yt,fromTag:Jt,fromText:Qt,fromDom:Zt,fromPoint:te};"undefined"!==typeof window?window:Function("return this;")();var ne,re=9,oe=11,ie=1,ue=3,ae=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}},fe=se(ie),le=se(ue),de=se(re),me=se(oe),ge=function(t){var e,n=!1;return function(){for(var r=[],o=0;o0&&e0}))},tr=function(t){var e={},n=t.dom;if(Xt(n))for(var r=0;rr?e-r:0;return o};return{set:n,get:r,getOuter:o,aggregate:i,max:u}},ir=or("height",(function(t){var e=t.dom;return In(t)?e.getBoundingClientRect().height:e.offsetHeight})),ur=function(t){return ir.get(t)},ar=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}},fr=sr,lr=function(t){var e=t.getBoundingClientRect();return fr(e.left,e.top)},dr=function(t,e){return void 0!==t?t:void 0!==e?e:0},mr=function(t){var e=t.dom.ownerDocument,n=e.body,r=e.defaultView,o=e.documentElement;if(n===t.dom)return fr(n.offsetLeft,n.offsetTop);var i=dr(null===r||void 0===r?void 0:r.pageYOffset,o.scrollTop),u=dr(null===r||void 0===r?void 0:r.pageXOffset,o.scrollLeft),a=dr(o.clientTop,n.clientTop),c=dr(o.clientLeft,n.clientLeft);return gr(t).translate(u-c,i-a)},gr=function(t){var e=t.dom,n=e.ownerDocument,r=n.body;return r===e?fr(r.offsetLeft,r.offsetTop):In(t)?lr(e):fr(0,0)},pr=or("width",(function(t){return t.dom.offsetWidth})),hr=function(t,e){return pr.set(t,e)},vr=function(t){return pr.get(t)},br=function(t){return pr.getOuter(t)},yr=function(t,e){var n=["margin-left","border-left-width","padding-left","padding-right","border-right-width","margin-right"],r=pr.max(t,e,n);Kn(t,"max-width",r+"px")},wr=function(t,e,n,r,o,i,u){return{target:t,x:e,y:n,stop:r,prevent:o,kill:i,raw:u}},xr=function(t){var e=ee.fromDom(Mn(t).getOr(t.target)),n=function(){return t.stopPropagation()},r=function(){return t.preventDefault()},o=b(r,n);return wr(e,t.clientX,t.clientY,n,r,o,t)},Cr=function(t,e){return function(n){t(n)&&e(xr(n))}},Sr=function(t,e,n,r,o){var i=Cr(n,r);return t.dom.addEventListener(e,i,o),{unbind:S(Tr,t,e,i,o)}},kr=function(t,e,n,r){return Sr(t,e,n,r,!1)},Or=function(t,e,n,r){return Sr(t,e,n,r,!0)},Tr=function(t,e,n,r){t.dom.removeEventListener(e,n,r)},Er=function(t,e){var n=vn(t);n.each((function(n){n.dom.insertBefore(e.dom,t.dom)}))},_r=function(t,e){var n=wn(t);n.fold((function(){var n=vn(t);n.each((function(t){Ar(t,e)}))}),(function(t){Er(t,e)}))},Dr=function(t,e){var n=Sn(t);n.fold((function(){Ar(t,e)}),(function(n){t.dom.insertBefore(e.dom,n.dom)}))},Ar=function(t,e){t.dom.appendChild(e.dom)},Rr=function(t,e,n){Cn(t,n).fold((function(){Ar(t,e)}),(function(t){Er(t,e)}))},Nr=function(t,e){G(e,(function(e){Er(t,e)}))},Br=function(t,e){G(e,(function(e){Ar(t,e)}))},Mr=function(t){t.dom.textContent="",G(xn(t),(function(t){Pr(t)}))},Pr=function(t){var e=t.dom;null!==e.parentNode&&e.parentNode.removeChild(e)},Ir=function(t){var e=xn(t);e.length>0&&Nr(t,e),Pr(t)},Lr=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 fr(n,r)},Fr=function(t,e,n){var r=void 0!==n?n.dom:document,o=r.defaultView;o&&o.scrollTo(t,e)},zr=function(t){var e=void 0===t?window:t;return en().browser.isFirefox()?I.none():I.from(e["visualViewport"])},Hr=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=Lr(ee.fromDom(n));return zr(e).fold((function(){var t=e.document.documentElement,n=t.clientWidth,o=t.clientHeight;return Hr(r.left,r.top,n,o)}),(function(t){return Hr(Math.max(t.pageLeft,r.left),Math.max(t.pageTop,r.top),t.width,t.height)}))},Ur=function(t,e){var n=t.view(e);return n.fold(w([]),(function(e){var n=t.owner(e),r=Ur(t,n);return[e].concat(r)}))},jr=function(t,e){var n=e.owner(t),r=Ur(e,n);return I.some(r)},Wr=function(t){var e,n=t.dom===document?I.none():I.from(null===(e=t.dom.defaultView)||void 0===e?void 0:e.frameElement);return n.map(ee.fromDom)},qr=function(t){return mn(t)},$r=Object.freeze({__proto__:null,view:Wr,owner:qr}),Gr=function(t){var e=ee.fromDom(document),n=Lr(e),r=jr(t,$r);return r.fold(S(mr,t),(function(e){var r=gr(t),o=J(e,(function(t,e){var n=gr(e);return{left:t.left+n.left,top:t.top+n.top}}),{left:0,top:0});return fr(o.left+r.left+n.left,o.top+r.top+n.top)}))},Kr=function(t,e,n){return{point:t,width:e,height:n}},Xr=function(t,e,n,r){return{x:t,y:e,width:n,height:r}},Yr=function(t,e,n,r){return{x:t,y:e,width:n,height:r,right:t+n,bottom:e+r}},Jr=function(t){var e=mr(t),n=br(t),r=ar(t);return Yr(e.left,e.top,n,r)},Qr=function(t){var e=Gr(t),n=br(t),r=ar(t);return Yr(e.left,e.top,n,r)},Zr=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)},u=function(e){return e(t)},a=function(e,n){return n(t)},c=function(e){return e(t)},s=function(e){return e(t)},f=function(){return I.some(t)};return{isValue:E,isError:T,getOr:w(t),getOrThunk:w(t),getOrDie:w(t),or:e,orThunk:n,fold:a,map:r,mapError:o,each:i,bind:u,exists:c,forall:s,toOptional:f}},eo=function(t){var e=function(t){return t()},n=function(){return O(String(t))()},r=x,o=function(t){return t()},i=function(e){return eo(t)},u=function(e){return eo(e(t))},a=function(e){return eo(t)},c=function(e,n){return e(t)};return{isValue:T,isError:E,getOr:x,getOrThunk:e,getOrDie:n,or:r,orThunk:o,fold:c,map:i,mapError:u,each:h,bind:a,exists:T,forall:E,toOptional:I.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 G(t,(function(t){oo(t,(function(t){return n.push(t)}),(function(t){return e.push(t)}))})),{values:e,errors:n}},uo=function(t,e){return t.stype===ne.Error?{stype:ne.Error,serror:e(t.serror)}:t},ao=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},fo=function(t){return{stype:ne.Value,svalue:t}},lo=function(t){return{stype:ne.Error,serror:t}},mo=function(t){return oo(t,ro.error,ro.value)},go=function(t){return t.fold(lo,fo)},po={fromResult:go,toResult:mo,svalue:fo,partition:io,serror:lo,bind:co,bindError:so,map:ao,mapError:uo,fold:oo},ho=function(t,e,n,r){return{tag:"field",key:t,newKey:e,presence:n,prop:r}},vo=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},wo=function(t,e){var n=u(t)&&u(e);return n?Co(t,e):e},xo=function(t){return function(){for(var e=[],n=0;n0?po.svalue(Co(e,So.apply(void 0,t))):po.svalue(e)},Ro=function(t){return b(po.serror,nt)(t)},No=function(t,e){var n=po.partition(t);return n.errors.length>0?Ro(n.errors):Ao(n.values,e)},Bo=function(t){var e=po.partition(t);return e.errors.length>0?Ro(e.errors):po.svalue(e.values)},Mo={consolidateObj:No,consolidateArr:Bo},Po=function(t){return u(t)&&pt(t).length>100?" removed due to size":JSON.stringify(t,null,2)},Io=function(t){var e=t.length>10?t.slice(0,10).concat([{path:[],getErrorInfo:w("... (only showing first ten failures)")}]):t;return $(e,(function(t){return"Failed path: ("+t.path.join(" > ")+")\n"+t.getErrorInfo()}))},Lo=function(t,e){return po.serror([{path:t,getErrorInfo:e}])},Fo=function(t,e,n){return Lo(t,(function(){return'Could not find valid *required* value for "'+e+'" in '+Po(n)}))},zo=function(t,e){return Lo(t,(function(){return'Choice schema did not contain choice key: "'+e+'"'}))},Ho=function(t,e,n){return Lo(t,(function(){return'The chosen schema: "'+n+'" did not exist in branches: '+Po(e)}))},Vo=function(t,e){return Lo(t,(function(){return"There are unsupported fields: ["+e.join(", ")+"] specified"}))},Uo=function(t,e){return Lo(t,w(e))},jo=function(t){var e=function(e,n){return po.bindError(t(n),(function(t){return Uo(e,t)}))},n=w("val");return{extract:e,toString:n}},Wo=jo(po.svalue),qo=function(t,e,n,r){return Tt(e,n).fold((function(){return Fo(t,n,e)}),r)},$o=function(t,e,n,r){var o=Tt(t,e).getOrThunk((function(){return n(t)}));return r(o)},Go=function(t,e,n){return n(Tt(t,e))},Ko=function(t,e,n,r){var o=Tt(t,e).map((function(e){return!0===e?n(t):e}));return r(o)},Xo=function(t,e,n,r,o){var i=function(t){return o.extract(e.concat([r]),t)},u=function(t){return t.fold((function(){return po.svalue(I.none())}),(function(t){var n=o.extract(e.concat([r]),t);return po.map(n,I.some)}))};switch(t.tag){case"required":return qo(e,n,r,i);case"defaultedThunk":return $o(n,r,t.process,i);case"option":return Go(n,r,u);case"defaultedOptionThunk":return Ko(n,r,t.process,u);case"mergeWithThunk":return $o(n,r,w({}),(function(e){var r=Co(t.process(n),e);return i(r)}))}},Yo=function(t,e,n){for(var r={},o=[],i=0,u=n;i0?po.serror(o):po.svalue(r)},Jo=function(t){var e=function(e,n){return t().extract(e,n)},n=function(){return t().toString()};return{extract:e,toString:n}},Qo=function(t){return pt(Ct(t,d))},Zo=function(t){var e=ti(t),n=J(t,(function(t,e){return bo(e,(function(e){var n;return Co(t,(n={},n[e]=!0,n))}),w(t))}),{}),r=function(t,r){var o=s(r)?[]:Qo(r),i=Y(o,(function(t){return!_t(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 Yo(e,n,t)},n=function(){var e=$(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=$(n,(function(n,r){return t.extract(e.concat(["["+r+"]"]),n)}));return Mo.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?hu(n.errors):pu(n.values,e)},bu=function(t){return m(t)?t:T},yu=function(t,e,n){var r=t.dom,o=bu(n);while(r.parentNode){r=r.parentNode;var i=ee.fromDom(r),u=e(i);if(u.isSome())return u;if(o(i))break}return I.none()},wu=function(t,e,n){var r=e(t),o=bu(n);return r.orThunk((function(){return o(t)?I.none():yu(t,e,o)}))},xu=function(t,e){return sn(t.element,e.event.target)},Cu={can:E,abort:T,run:h},Su=function(t){if(!_t(t,"can")&&!_t(t,"abort")&&!_t(t,"run"))throw new Error("EventHandler defined by: "+JSON.stringify(t,null,2)+" does not have can, abort, or run!");return D(D({},Cu),t)},ku=function(t,e){return function(){for(var n=[],r=0;r1?Y(e[n],(function(e){return j(t,(function(t){return t.name===e}))})).join(" > "):t[0].name;return mu(n,Mc(o,i))}))}));return vu(n,{})},$c="alloy.base.behaviour",Gc=ti([Ti("dom","dom",ko(),ti([Di("tag"),Ki("styles",{}),Ki("classes",[]),Ki("attributes",{}),Hi("value"),Hi("innerHtml")])),Di("components"),Di("uid"),Ki("events",{}),Ki("apis",{}),Ti("eventOrder","eventOrder",Do((au={},au[ea()]=["disabling",$c,"toggling","typeaheadevents"],au[Ju()]=[$c,"focusing","keying"],au[aa()]=[$c,"disabling","toggling","representing"],au[Uu()]=[$c,"representing","streaming","invalidating"],au[ma()]=[$c,"representing","item-events","tooltipping"],au[Bu()]=["focusing",$c,"item-type-events"],au[Du()]=["focusing",$c,"item-type-events"],au[Lu()]=["item-type-events","tooltipping"],au[ta()]=["receiving","reflecting","tooltipping"],au)),ui()),Hi("domModification")]),Kc=function(t){return wi("custom.definition",Gc,t)},Xc=function(t){return D(D({},t.dom),{uid:t.uid,domChildren:$(t.components,(function(t){return t.element}))})},Yc=function(t){return t.domModification.fold((function(){return Ac({})}),Ac)},Jc=function(t){return t.events},Qc=function(t,e){var n=Un(t,e);return void 0===n||""===n?[]:n.split(" ")},Zc=function(t,e,n){var r=Qc(t,e),o=r.concat([n]);return Hn(t,e,o.join(" ")),!0},ts=function(t,e,n){var r=Y(Qc(t,e),(function(t){return t!==n}));return r.length>0?Hn(t,e,r.join(" ")):qn(t,e),!1},es=function(t){return void 0!==t.dom.classList},ns=function(t){return Qc(t,"class")},rs=function(t,e){return Zc(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)},us=function(t){var e=es(t)?t.dom.classList:ns(t);0===e.length&&qn(t,"class")},as=function(t,e){if(es(t)){var n=t.dom.classList;n.remove(e)}else os(t,e);us(t)},cs=function(t,e){return es(t)&&t.dom.classList.contains(e)},ss=function(t,e){G(e,(function(e){is(t,e)}))},fs=function(t,e){G(e,(function(e){as(t,e)}))},ls=function(t,e){return ot(e,(function(e){return cs(t,e)}))},ds=function(t){return t.dom.value},ms=function(t,e){if(void 0===e)throw new Error("Value.set was undefined");t.dom.value=e},gs=function(t){var e=ee.fromTag(t.tag);Vn(e,t.attributes),ss(e,t.classes),Xn(e,t.styles),t.innerHtml.each((function(t){return Ka(e,t)}));var n=t.domChildren;return Br(e,n),t.value.each((function(t){ms(e,t)})),t.uid,fc(e,t.uid),e},ps=function(t){var e=Tt(t,"behaviours").getOr({});return rt(pt(e),(function(t){var n=e[t];return d(n)?[n.me]:[]}))},hs=function(t,e){return Tc(t,e)},vs=function(t){var e=ps(t);return hs(t,e)},bs=function(t,e,n){var r=Xc(t),o=Yc(t),i={"alloy.base.modification":o},u=e.length>0?Nc(n,i,e,r):o;return Rc(r,u)},ys=function(t,e,n){var r={"alloy.base.behaviour":Jc(t)};return Vc(n,t.eventOrder,e,r).getOrDie()},ws=function(t){var e=function(){return y},n=ou(pc),r=xi(Kc(t)),o=vs(t),i=Ec(o),u=_c(o),a=bs(r,i,u),c=gs(a),s=ys(r,i,u),f=ou(r.components),l=function(t){n.set(t)},d=function(){n.set(gc(e))},g=function(){var t=xn(c),e=rt(t,(function(t){return n.get().getByDom(t).fold((function(){return[]}),ct)}));f.set(e)},p=function(e){var n=u,r=m(n[e.name()])?n[e.name()]:function(){throw new Error("Could not find "+e.name()+" in "+JSON.stringify(t,null,2))};return r()},h=function(t){return m(u[t.name()])},v=function(){return r.apis},b=function(t){return u[t]().map((function(t){return t.state.readState()})).getOr("not enabled")},y={uid:t.uid,getSystem:n.get,config:p,hasConfigured:h,spec:t,readState:b,getApis:v,connect:l,disconnect:d,element:c,syncComponents:g,components:f.get,events:s};return y},xs=function(t){var e=Tt(t,"components").getOr([]);return $(e,Es)},Cs=function(t){var e=mc(t),n=e.events,r=A(e,["events"]),o=xs(r),i=D(D({},r),{events:D(D({},nc),n),components:o});return ro.value(ws(i))},Ss=function(t){var e=ee.fromText(t);return ks({element:e})},ks=function(t){var e=Ci("external.component",Zo([Di("element"),Hi("uid")]),t),n=ou(gc()),r=function(t){n.set(t)},o=function(){n.set(gc((function(){return u})))},i=e.uid.getOrThunk((function(){return dc("external")}));fc(e.element,i);var u={uid:i,getSystem:n.get,config:I.none,hasConfigured:T,connect:r,disconnect:o,getApis:function(){return{}},element:e.element,spec:t,readState:w("No state"),syncComponents:h,components:w([]),events:{}};return xc(u)},Os=dc,Ts=function(t){return Et(t,"uid")},Es=function(t){return Cc(t).getOrThunk((function(){var e=Ts(t)?t:D({uid:Os("")},t);return Cs(e).getOrDie()}))},_s=xc;function Ds(t,e,n,r,o){return t(n,r)?I.some(n):m(o)&&o(n)?I.none():e(n,r,o)}var As,Rs=function(t,e,n){var r=t.dom,o=m(n)?n:T;while(r.parentNode){r=r.parentNode;var i=ee.fromDom(r);if(e(i))return I.some(i);if(o(i))break}return I.none()},Ns=function(t,e,n){var r=function(t,e){return e(t)};return Ds(r,Rs,t,e,n)},Bs=function(t,e){var n=function(t){return e(ee.fromDom(t))},r=tt(t.dom.childNodes,n);return r.map(ee.fromDom)},Ms=function(t,e){var n=function(t){for(var r=0;r-1}));return e.bind((function(t){var e=Un(t,"id"),n=Dn(t);return Fs(n,'[aria-owns="'+e+'"]')}))},Vs=function(){var t=oc("aria-owns"),e=function(e){Hn(e,"aria-owns",t)},n=function(t){qn(t,"aria-owns")};return{id:t,link:e,unlink:n}},Us=function(t,e){return Hs(e).exists((function(e){return js(t,e)}))},js=function(t,e){return Ps(e,(function(e){return sn(e,t.element)}),T)||Us(t,e)},Ws="unknown";(function(t){t[t["STOP"]=0]="STOP",t[t["NORMAL"]=1]="NORMAL",t[t["LOGGING"]=2]="LOGGING"})(As||(As={}));var qs=ou({}),$s=function(t,e){var n=[];(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(){(new Date).getTime();U(["mousemove","mouseover","mouseout",aa()],t)}}},Gs=function(t,e,n){var r=Tt(qs.get(),t).orThunk((function(){var e=pt(qs.get());return gt(e,(function(e){return t.indexOf(e)>-1?I.some(qs.get()[e]):I.none()}))})).getOr(As.NORMAL);switch(r){case As.NORMAL:return n(Qs());case As.LOGGING:var o=$s(t,e),i=n(o);return o.write(),i;case As.STOP:return!0}},Ks=["alloy/data/Fields","alloy/debugging/Debugging"],Xs=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&&!j(Ks,(function(e){return t.indexOf(e)>-1}))})).getOr(Ws)}return Ws},Ys={logEventCut:h,logEventStopped:h,logNoParent:h,logEventNoHandlers:h,logEventResponse:h,write:h},Js=function(t,e,n){return Gs(t,e,n)},Qs=w(Ys),Zs=w([Di("menu"),Di("selectedMenu")]),tf=w([Di("item"),Di("selectedItem")]);w(ti(tf().concat(Zs())));var ef=w(ti(tf())),nf=Li("initSize",[Di("numColumns"),Di("numRows")]),rf=function(){return Ai("markers",ef())},of=function(){return Li("markers",[Di("backgroundMenu")].concat(Zs()).concat(tf()))},uf=function(t){return Li("markers",$(t,Di))},af=function(t,e,n){return Xs(),Ti(e,e,n,vi((function(t){return ro.value((function(){for(var e=[],n=0;nr?n:o=n&&u<=o,m=a>=r&&a<=i,g=d&&m,p=c<=o&&c>=n,h=s<=i&&s>=r,v=p&&h,b=Math.min(f,u>=n?o-u:c-n),y=Math.min(l,a>=r?i-a:s-r);return{originInBounds:g,sizeInBounds:v,visibleW:b,visibleH:y}},Yl=function(t,e){var n=e.x,r=e.y,o=e.right,i=e.bottom,u=t.x,a=t.y,c=t.width,s=t.height,f=Math.max(n,o-c),l=Math.max(r,i-s),d=Df(u,n,f),m=Df(a,r,l),g=Math.min(d+c,o)-d,p=Math.min(m+s,i)-m;return Yr(d,m,g,p)},Jl=function(t,e,n){var r=w(e.bottom-n.y),o=w(n.bottom-e.y),i=bf(t,o,o,r),u=w(e.right-n.x),a=w(n.right-e.x),c=yf(t,a,a,u);return{maxWidth:c,maxHeight:i}},Ql=function(t,e,n,r){var o=t.bubble,i=o.offset,u=Nf(r,t.restriction,i),a=t.x+i.left,c=t.y+i.top,s=Yr(a,c,e,n),f=Xl(s,u),l=f.originInBounds,d=f.sizeInBounds,m=f.visibleW,g=f.visibleH,p=l&&d,h=p?s:Yl(s,u),v=h.width>0&&h.height>0,b=Jl(t.direction,h,r),y=b.maxWidth,w=b.maxHeight,x={rect:h,maxHeight:w,maxWidth:y,direction:t.direction,placement:t.placement,classes:{on:o.classesOn,off:o.classesOff},layout:t.label,testY:c};return p||t.alwaysFit?Kl.fit(x):Kl.nofit(x,m,g,v)},Zl=function(t,e,n,r,o,i){var u=r.width,a=r.height,c=function(e,c,s,f,l){var d=e(n,r,o,t,i),m=Ql(d,u,a,i);return m.fold(w(m),(function(t,e,n,r){var o=l===r?n>f||e>s:!l&&r;return o?m:Kl.nofit(c,s,f,l)}))},s=Q(e,(function(t,e){var n=S(c,e);return t.fold(w(t),n)}),Kl.nofit({rect:n,maxHeight:r.height,maxWidth:r.width,direction:wf(),placement:"southeast",classes:{on:[],off:[]},layout:"none",testY:n.y},-1,-1,!1));return s.fold(x,x)},td=function(t){var e=ou(I.none()),n=function(){return e.get().each(t)},r=function(){n(),e.set(I.none())},o=function(){return e.get().isSome()},i=function(){return e.get()},u=function(t){n(),e.set(I.some(t))};return{clear:r,isSet:o,get:i,set:u}},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 D(D({},t),{run:e})},od=function(){var t=td(h),e=function(e){return t.get().each(e)};return D(D({},t),{on:e})},id=E,ud=function(t,e,n){return kr(t,e,id,n)},ad=function(t,e,n){return Or(t,e,id,n)},cd=xr,sd=["top","bottom","right","left"],fd="data-alloy-transition-timer",ld=function(t,e){return ls(t,e.classes)},dd=function(t,e,n){return n.exists((function(n){var r=t.mode;return"all"===r||n[r]!==e[r]}))},md=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!At(o,i)})).isSome()},gd=function(t){var e=function(e){var n=Jn(t,e),r=i(n)?n.split(/\s*,\s*/):[];return Y(r,Gt)},n=function(t){if(i(t)&&/^[\d.]+/.test(t)){var e=parseFloat(t);return Wt(t,"ms")?e:1e3*e}return 0},r=e("transition-delay"),o=e("transition-duration");return Q(o,(function(t,e,o){var i=n(r[o])+n(e);return Math.max(t,i)}),0)},pd=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)&&U(sd,e.raw.propertyName)},u=function(u){if(l(u)||i(u)){r.clear(),o.clear();var a=null===u||void 0===u?void 0:u.raw.type;(l(a)||a===$u())&&(clearTimeout(n),qn(t,fd),fs(t,e.classes))}},a=function(){r.set(ud(t,$u(),u)),o.set(ud(t,qu(),u))};if("ontransitionstart"in t.dom)var c=ud(t,Gu(),(function(t){i(t)&&(c.unbind(),a())}));else a();var s=gd(t);requestAnimationFrame((function(){n=setTimeout(u,s+17),Hn(t,fd,n)}))},hd=function(t,e){ss(t,e.classes),jn(t,fd).each((function(e){clearTimeout(parseInt(e,10)),qn(t,fd)})),pd(t,e)},vd=function(t,e,n,r,o,i){var u=dd(r,o,i);if(u||ld(t,r)){Kn(t,"position",n.position);var a=Pl(e,t),c=Ml(e,D(D({},o),{rect:a})),s=at(sd,(function(t){return c[t]}));md(n,s)&&(Yn(t,s),u&&hd(t,r),rr(t))}else fs(t,r.classes)},bd=function(t){return{width:br(t),height:ar(t)}},yd=function(t,e,n,r){nr(e,"max-height"),nr(e,"max-width");var o=bd(e);return Zl(e,r.preference,t,o,n,r.bounds)},wd=function(t,e){var n=e.classes;fs(t,n.off),ss(t,n.on)},xd=function(t,e,n){var r=n.maxHeightFunction;r(t,e.maxHeight)},Cd=function(t,e,n){var r=n.maxWidthFunction;r(t,e.maxWidth)},Sd=function(t,e,n){var r=Ml(n.origin,e);n.transition.each((function(o){vd(t,n.origin,r,o,e,n.lastPlacement)})),Rl(t,r)},kd=function(t,e){ql(t,e.placement)},Od=function(t,e){cr(t,Math.floor(e))},Td=w((function(t,e){Od(t,e),Xn(t,{"overflow-x":"hidden","overflow-y":"auto"})})),Ed=w((function(t,e){Od(t,e)})),_d=function(t,e,n){return void 0===t[e]?n:t[e]},Dd=function(t,e,n,r,o,i,u,a){var c=_d(u,"maxHeightFunction",Td()),s=_d(u,"maxWidthFunction",h),f=t.anchorBox,l=t.origin,d={bounds:Il(l,i),origin:l,preference:r,maxHeightFunction:c,maxWidthFunction:s,lastPlacement:o,transition:a};return Ad(f,e,n,d)},Ad=function(t,e,n,r){var o=yd(t,e,n,r);return Sd(e,o,r),kd(e,o),wd(e,o),xd(e,o,r),Cd(e,o,r),{layout:o.layout,placement:o.placement}},Rd=["valignCentre","alignLeft","alignRight","alignCentre","top","bottom","left","right","inset"],Nd=function(t,e,n,r){void 0===r&&(r=1);var o=t*r,i=e*r,u=function(t){return Tt(n,t).getOr([])},a=function(t,e,n){var r=ut(Rd,n);return{offset:fr(t,e),classesOn:rt(n,u),classesOff:rt(r,u)}};return{southeast:function(){return a(-t,e,["top","alignLeft"])},southwest:function(){return a(t,e,["top","alignRight"])},south:function(){return a(-t/2,e,["top","alignCentre"])},northeast:function(){return a(-t,-e,["bottom","alignLeft"])},northwest:function(){return a(t,-e,["bottom","alignRight"])},north:function(){return a(-t/2,-e,["bottom","alignCentre"])},east:function(){return a(t,-e/2,["valignCentre","left"])},west:function(){return a(-t,-e/2,["valignCentre","right"])},insetNortheast:function(){return a(o,i,["top","alignLeft","inset"])},insetNorthwest:function(){return a(-o,i,["top","alignRight","inset"])},insetNorth:function(){return a(-o/2,i,["top","alignCentre","inset"])},insetSoutheast:function(){return a(o,-i,["bottom","alignLeft","inset"])},insetSouthwest:function(){return a(-o,-i,["bottom","alignRight","inset"])},insetSouth:function(){return a(-o/2,-i,["bottom","alignCentre","inset"])},insetEast:function(){return a(-o,-i/2,["valignCentre","right","inset"])},insetWest:function(){return a(o,-i/2,["valignCentre","left","inset"])}}},Bd=function(){return Nd(0,0,{})},Md=x,Pd=function(t,e){return function(n){return"rtl"===Id(n)?e:t}},Id=function(t){return"rtl"===Jn(t,"direction")?"rtl":"ltr"};(function(t){t["TopToBottom"]="toptobottom",t["BottomToTop"]="bottomtotop"})(zl||(zl={}));var Ld="data-alloy-vertical-dir",Fd=function(t){return Ps(t,(function(t){return fe(t)&&Un(t,"data-alloy-vertical-dir")===zl.BottomToTop}))},zd=function(){return $i("layouts",[Di("onLtr"),Di("onRtl"),Hi("onBottomLtr"),Hi("onBottomRtl")])},Hd=function(t,e,n,r,o,i,u){var a=u.map(Fd).getOr(!1),c=e.layouts.map((function(e){return e.onLtr(t)})),s=e.layouts.map((function(e){return e.onRtl(t)})),f=a?e.layouts.bind((function(e){return e.onBottomLtr.map((function(e){return e(t)}))})).or(c).getOr(o):c.getOr(n),l=a?e.layouts.bind((function(e){return e.onBottomRtl.map((function(e){return e(t)}))})).or(s).getOr(i):s.getOr(r),d=Pd(f,l);return d(t)},Vd=function(t,e,n){var r=e.hotspot,o=Pl(n,r.element),i=Hd(t.element,e,tl(),el(),Qf(),Zf(),I.some(e.hotspot.element));return I.some(Md({anchorBox:o,bubble:e.bubble.getOr(Bd()),overrides:e.overrides,layouts:i,placer:I.none()}))},Ud=[Di("hotspot"),Hi("bubble"),Ki("overrides",{}),zd(),df("placement",Vd)],jd=function(t,e,n){var r=Ll(n,e.x,e.y),o=Yr(r.left,r.top,e.width,e.height),i=Hd(t.element,e,Yf(),Jf(),Yf(),Jf(),I.none());return I.some(Md({anchorBox:o,bubble:e.bubble,overrides:e.overrides,layouts:i,placer:I.none()}))},Wd=[Di("x"),Di("y"),Ki("height",0),Ki("width",0),Ki("bubble",Bd()),Ki("overrides",{}),zd(),df("placement",jd)],qd=uu.generate([{screen:["point"]},{absolute:["point","scrollLeft","scrollTop"]}]),$d=function(t){return t.fold(x,(function(t,e,n){return t.translate(-e,-n)}))},Gd=function(t){return t.fold(x,x)},Kd=function(t){return Q(t,(function(t,e){return t.translate(e.left,e.top)}),fr(0,0))},Xd=function(t){var e=$(t,$d);return Kd(e)},Yd=function(t){var e=$(t,Gd);return Kd(e)},Jd=qd.screen,Qd=qd.absolute,Zd=function(t,e,n){var r=hn(n.root).dom,o=function(e){var n=mn(e),r=mn(t.element);return sn(n,r)};return I.from(r.frameElement).map(ee.fromDom).filter(o).map(mr)},tm=function(t,e,n){var r=mn(t.element),o=Lr(r),i=Zd(t,e,n).getOr(o);return Qd(i,o.left,o.top)},em=function(t,e,n,r){var o=Jd(fr(t,e));return I.some(Kr(o,n,r))},nm=function(t,e,n,r,o){return t.map((function(t){var i=[e,t.point],u=Fl(r,(function(){return Yd(i)}),(function(){return Yd(i)}),(function(){return Xd(i)})),a=Xr(u.left,u.top,t.width,t.height),c=n.showAbove?Qf():tl(),s=n.showAbove?Zf():el(),f=Hd(o,n,c,s,c,s,I.none());return Md({anchorBox:a,bubble:n.bubble.getOr(Bd()),overrides:n.overrides,layouts:f,placer:I.none()})}))},rm=function(t,e,n){var r=tm(t,n,e);return e.node.filter(In).bind((function(o){var i=o.dom.getBoundingClientRect(),u=em(i.left,i.top,i.width,i.height),a=e.node.getOr(t.element);return nm(u,r,e,n,a)}))},om=[Di("node"),Di("root"),Hi("bubble"),zd(),Ki("overrides",{}),Ki("showAbove",!1),df("placement",rm)],im="\ufeff",um=" ",am=function(t,e,n,r){return{start:t,soffset:e,finish:n,foffset:r}},cm={create:am},sm=uu.generate([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),fm=function(t,e,n,r){return t.fold(e,n,r)},lm=function(t){return t.fold(x,x,x)},dm=sm.before,mm=sm.on,gm=sm.after,pm={before:dm,on:mm,after:gm,cata:fm,getStart:lm},hm=uu.generate([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),vm=function(t){return hm.exact(t.start,t.soffset,t.finish,t.foffset)},bm=function(t){return t.match({domRange:function(t){return ee.fromDom(t.startContainer)},relative:function(t,e){return pm.getStart(t)},exact:function(t,e,n,r){return t}})},ym=hm.domRange,wm=hm.relative,xm=hm.exact,Cm=function(t){var e=bm(t);return hn(e)},Sm=cm.create,km={domRange:ym,relative:wm,exact:xm,exactFromRange:vm,getWin:Cm,range:Sm},Om=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)}))},Tm=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)}))},Em=function(t,e,n){var r=t.document.createRange();return Om(r,e),Tm(r,n),r},_m=function(t,e,n,r,o){var i=t.document.createRange();return i.setStart(e.dom,n),i.setEnd(r.dom,o),i},Dm=function(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom,width:t.width,height:t.height}},Am=function(t){var e=t.getClientRects(),n=e.length>0?e[0]:t.getBoundingClientRect();return n.width>0||n.height>0?I.some(n).map(Dm):I.none()},Rm=function(t){var e=t.getBoundingClientRect();return e.width>0||e.height>0?I.some(e).map(Dm):I.none()},Nm=uu.generate([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),Bm=function(t,e,n){return e(ee.fromDom(n.startContainer),n.startOffset,ee.fromDom(n.endContainer),n.endOffset)},Mm=function(t,e){return e.match({domRange:function(t){return{ltr:w(t),rtl:I.none}},relative:function(e,n){return{ltr:ge((function(){return Em(t,e,n)})),rtl:ge((function(){return I.some(Em(t,n,e))}))}},exact:function(e,n,r,o){return{ltr:ge((function(){return _m(t,e,n,r,o)})),rtl:ge((function(){return I.some(_m(t,r,o,e,n))}))}}})},Pm=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 Nm.rtl(ee.fromDom(t.endContainer),t.endOffset,ee.fromDom(t.startContainer),t.startOffset)})).getOrThunk((function(){return Bm(t,Nm.ltr,n)}))}return Bm(t,Nm.ltr,n)},Im=function(t,e){var n=Mm(t,e);return Pm(t,n)},Lm=function(t,e){var n=Im(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}})};Nm.ltr,Nm.rtl;var Fm,zm=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)?I.from(e.dom.nodeValue):I.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}},Hm=zm(le,"text"),Vm=function(t){return Hm.get(t)},Um=function(t){return Hm.getOption(t)},jm=function(t){return"img"===ae(t)?1:Um(t).fold((function(){return xn(t).length}),(function(t){return t.length}))},Wm=function(t){return Um(t).filter((function(t){return 0!==t.trim().length||t.indexOf(um)>-1})).isSome()},qm=["img","br"],$m=function(t){var e=Wm(t);return e||U(qm,ae(t))},Gm=function(t){return Km(t,$m)},Km=function(t,e){var n=function(t){for(var r=xn(t),o=r.length-1;o>=0;o--){var i=r[o];if(e(i))return I.some(i);var u=n(i);if(u.isSome())return u}return I.none()};return n(t)},Xm=function(t,e){return an(e,t)},Ym=function(t,e,n,r){var o=mn(t),i=o.dom.createRange();return i.setStart(t.dom,e),i.setEnd(n.dom,r),i},Jm=function(t,e,n,r){var o=Ym(t,e,n,r),i=sn(t,n)&&e===r;return o.collapsed&&!i},Qm=function(t){return I.from(t.getSelection())},Zm=function(t){if(t.rangeCount>0){var e=t.getRangeAt(0),n=t.getRangeAt(t.rangeCount-1);return I.some(cm.create(ee.fromDom(e.startContainer),e.startOffset,ee.fromDom(n.endContainer),n.endOffset))}return I.none()},tg=function(t){if(null===t.anchorNode||null===t.focusNode)return Zm(t);var e=ee.fromDom(t.anchorNode),n=ee.fromDom(t.focusNode);return Jm(e,t.anchorOffset,n,t.focusOffset)?I.some(cm.create(e,t.anchorOffset,n,t.focusOffset)):Zm(t)},eg=function(t){return Qm(t).filter((function(t){return t.rangeCount>0})).bind(tg)},ng=function(t,e){var n=Lm(t,e);return Am(n)},rg=function(t,e){var n=Lm(t,e);return Rm(n)},og=function(t,e){return{element:t,offset:e}},ig=function(t,e){var n=xn(t);if(0===n.length)return og(t,e);if(e"})),ui()),Ch=Ei("schema",(function(){return[Hi("preprocess")]})),Sh=Ki("defaults",w({})),kh=Ki("overrides",w({})),Oh=ti([bh,yh,wh,xh,Sh,kh]),Th=ti([bh,yh,wh,Sh,kh]),Eh=ti([bh,yh,wh,xh,Sh,kh]),_h=ti([bh,Ch,wh,Di("unit"),xh,Sh,kh]),Dh=function(t){return t.fold(I.some,I.none,I.some,I.some)},Ah=function(t){var e=function(t){return t.name};return t.fold(e,e,e,e)},Rh=function(t){return t.fold(x,x,x,x)},Nh=function(t,e){return function(n){var r=Ci("Converting part type",e,n);return t(r)}},Bh=Nh(vh.required,Oh),Mh=Nh(vh.external,Th),Ph=Nh(vh.optional,Eh),Ih=Nh(vh.group,_h),Lh=w("entirety"),Fh=Object.freeze({__proto__:null,required:Bh,external:Mh,optional:Ph,group:Ih,asNamedPart:Dh,name:Ah,asCommon:Rh,original:Lh}),zh=function(t,e,n,r){return Co(e.defaults(t,n,r),n,{uid:t.partUids[e.name]},e.overrides(t,n,r))},Hh=function(t,e,n){var r={},o={};return G(n,(function(t){t.fold((function(t){r[t.pname]=gh(!0,(function(e,n,r){return t.factory.sketch(zh(e,t,n,r))}))}),(function(t){var n=e.parts[t.name];o[t.name]=w(t.factory.sketch(zh(e,t,n[Lh()]),n))}),(function(t){r[t.pname]=gh(!1,(function(e,n,r){return t.factory.sketch(zh(e,t,n,r))}))}),(function(t){r[t.pname]=ph(!0,(function(e,n,r){var o=e[t.name];return $(o,(function(n){return t.factory.sketch(Co(t.defaults(e,n,r),n,t.overrides(e,n)))}))}))}))})),{internals:w(r),externals:w(o)}},Vh=function(t,e){var n={};return G(e,(function(e){Dh(e).each((function(e){var r=Uh(t,e.pname);n[e.name]=function(n){var o=Ci("Part: "+e.name+" in "+t,ti(e.schema),n);return D(D({},r),{config:n,validated:o})}}))})),n},Uh=function(t,e){return{uiType:hh(),owner:t,name:e}},jh=function(t,e,n){return{uiType:hh(),owner:t,name:e,config:n,validated:{}}},Wh=function(t){return rt(t,(function(t){return t.fold(I.none,I.some,I.none,I.none).map((function(t){return Li(t.name,t.schema.concat([mf(Lh())]))})).toArray()}))},qh=function(t){return $(t,Ah)},$h=function(t,e,n){return Hh(t,e,n)},Gh=function(t,e,n){return mh(I.some(t),e,e.components,n)},Kh=function(t,e,n){var r=e.partUids[n];return t.getSystem().getByUid(r).toOptional()},Xh=function(t,e,n){return Kh(t,e,n).getOrDie("Could not find part: "+n)},Yh=function(t,e,n){var r={},o=e.partUids,i=t.getSystem();return G(n,(function(t){r[t]=w(i.getByUid(o[t]))})),r},Jh=function(t,e){var n=t.getSystem();return bt(e.partUids,(function(t,e){return w(n.getByUid(t))}))},Qh=function(t){return pt(t.partUids)},Zh=function(t,e,n){var r={},o=e.partUids,i=t.getSystem();return G(n,(function(t){r[t]=w(i.getByUid(o[t]).getOrDie())})),r},tv=function(t,e){var n=qh(e);return gu($(n,(function(e){return{key:e,value:t+"-"+e}})))},ev=function(t){return Ti("partUids","partUids",_o((function(e){return tv(e.uid,t)})),ui())},nv=Object.freeze({__proto__:null,generate:Vh,generateOne:jh,schemas:Wh,names:qh,substitutes:$h,components:Gh,defaultUids:tv,defaultUidsSchema:ev,getAllParts:Jh,getAllPartNames:Qh,getPart:Kh,getPartOrDie:Xh,getParts:Yh,getPartsOrDie:Zh}),rv=function(t,e){var n=t.length>0?[Li("parts",t)]:[];return n.concat([Di("uid"),Ki("dom",{}),Ki("components",[]),mf("originalSpec"),Ki("debug.sketcher",{})]).concat(e)},ov=function(t,e,n,r,o){var i=rv(r,o);return Ci(t+" [SpecSchema]",Zo(i.concat(e)),n)},iv=function(t,e,n,r){var o=cv(r),i=ov(t,e,o,[],[]);return n(i,o)},uv=function(t,e,n,r,o){var i=cv(o),u=Wh(n),a=ev(n),c=ov(t,e,i,u,[a]),s=$h(t,c,n),f=Gh(t,c,s.internals());return r(c,f,i,s.externals())},av=function(t){return Et(t,"uid")},cv=function(t){return av(t)?t:D(D({},t),{uid:dc("uid")})},sv=function(t){return void 0!==t.uid},fv=Zo([Di("name"),Di("factory"),Di("configFields"),Ki("apis",{}),Ki("extraApis",{})]),lv=Zo([Di("name"),Di("factory"),Di("configFields"),Di("partFields"),Ki("apis",{}),Ki("extraApis",{})]),dv=function(t){var e=Ci("Sketcher for "+t.name,fv,t),n=function(t){return iv(e.name,e.configFields,e.factory,t)},r=bt(e.apis,Sc),o=bt(e.extraApis,(function(t,e){return bc(t,e)}));return D(D({name:e.name,configFields:e.configFields,sketch:n},r),o)},mv=function(t){var e=Ci("Sketcher for "+t.name,lv,t),n=function(t){return uv(e.name,e.configFields,e.partFields,e.factory,t)},r=Vh(e.name,e.partFields),o=bt(e.apis,Sc),i=bt(e.extraApis,(function(t,e){return bc(t,e)}));return D(D({name:e.name,partFields:e.partFields,configFields:e.configFields,sketch:n,parts:r},o),i)},gv=function(t){return"input"===ae(t)&&"radio"!==Un(t,"type")||"textarea"===ae(t)},pv=function(t,e,n){return e.find(t)},hv=Object.freeze({__proto__:null,getCurrent:pv}),vv=[Di("find")],bv=pl({fields:vv,name:"composing",apis:hv}),yv=["input","button","textarea","select"],wv=function(t,e,n){var r=e.disabled()?_v:Dv;r(t,e)},xv=function(t,e){return!0===e.useNative&&U(yv,ae(t.element))},Cv=function(t){return Wn(t.element,"disabled")},Sv=function(t){Hn(t.element,"disabled","disabled")},kv=function(t){qn(t.element,"disabled")},Ov=function(t){return"true"===Un(t.element,"aria-disabled")},Tv=function(t){Hn(t.element,"aria-disabled","true")},Ev=function(t){Hn(t.element,"aria-disabled","false")},_v=function(t,e,n){e.disableClass.each((function(e){is(t.element,e)}));var r=xv(t,e)?Sv:Tv;r(t),e.onDisabled(t)},Dv=function(t,e,n){e.disableClass.each((function(e){as(t.element,e)}));var r=xv(t,e)?kv:Ev;r(t),e.onEnabled(t)},Av=function(t,e){return xv(t,e)?Cv(t):Ov(t)},Rv=function(t,e,n,r){var o=r?_v:Dv;o(t,e)},Nv=Object.freeze({__proto__:null,enable:Dv,disable:_v,isDisabled:Av,onLoad:wv,set:Rv}),Bv=function(t,e){return Ac({classes:e.disabled()?e.disableClass.toArray():[]})},Mv=function(t,e){return _a([Da(ea(),(function(e,n){return Av(e,t)})),al(t,e,wv)])},Pv=Object.freeze({__proto__:null,exhibit:Bv,events:Mv}),Iv=[tu("disabled",T),Ki("useNative",!0),Hi("disableClass"),cf("onDisabled"),cf("onEnabled")],Lv=pl({fields:Iv,name:"disabling",active:Pv,apis:Nv}),Fv=function(t,e,n,r){var o=Xm(t.element,"."+e.highlightClass);G(o,(function(n){j(r,(function(t){return t.element===n}))||(as(n,e.highlightClass),t.getSystem().getByDom(n).each((function(n){e.onDehighlight(t,n),Ca(n,xa())})))}))},zv=function(t,e,n){return Fv(t,e,n,[])},Hv=function(t,e,n,r){$v(t,e,n,r)&&(as(r.element,e.highlightClass),e.onDehighlight(t,r),Ca(r,xa()))},Vv=function(t,e,n,r){Fv(t,e,n,[r]),$v(t,e,n,r)||(is(r.element,e.highlightClass),e.onHighlight(t,r),Ca(r,wa()))},Uv=function(t,e,n){Xv(t,e).each((function(r){Vv(t,e,n,r)}))},jv=function(t,e,n){Yv(t,e).each((function(r){Vv(t,e,n,r)}))},Wv=function(t,e,n,r){Kv(t,e,n,r).fold((function(t){throw t}),(function(r){Vv(t,e,n,r)}))},qv=function(t,e,n,r){var o=tb(t,e),i=tt(o,r);i.each((function(r){Vv(t,e,n,r)}))},$v=function(t,e,n,r){return cs(r.element,e.highlightClass)},Gv=function(t,e,n){return Fs(t.element,"."+e.highlightClass).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))},Kv=function(t,e,n,r){var o=Xm(t.element,"."+e.itemClass);return I.from(o[r]).fold((function(){return ro.error(new Error("No element found with index "+r))}),t.getSystem().getByDom)},Xv=function(t,e,n){return Fs(t.element,"."+e.itemClass).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))},Yv=function(t,e,n){var r=Xm(t.element,"."+e.itemClass),o=r.length>0?I.some(r[r.length-1]):I.none();return o.bind((function(e){return t.getSystem().getByDom(e).toOptional()}))},Jv=function(t,e,n,r){var o=Xm(t.element,"."+e.itemClass),i=et(o,(function(t){return cs(t,e.highlightClass)}));return i.bind((function(e){var n=_f(e,r,0,o.length-1);return t.getSystem().getByDom(o[n]).toOptional()}))},Qv=function(t,e,n){return Jv(t,e,n,-1)},Zv=function(t,e,n){return Jv(t,e,n,1)},tb=function(t,e,n){var r=Xm(t.element,"."+e.itemClass);return Rt($(r,(function(e){return t.getSystem().getByDom(e).toOptional()})))},eb=Object.freeze({__proto__:null,dehighlightAll:zv,dehighlight:Hv,highlight:Vv,highlightFirst:Uv,highlightLast:jv,highlightAt:Wv,highlightBy:qv,isHighlighted:$v,getHighlighted:Gv,getFirst:Xv,getLast:Yv,getPrevious:Qv,getNext:Zv,getCandidates:tb}),nb=[Di("highlightClass"),Di("itemClass"),cf("onHighlight"),cf("onDehighlight")],rb=pl({fields:nb,name:"highlighting",apis:eb}),ob=[8],ib=[9],ub=[13],ab=[27],cb=[32],sb=[37],fb=[38],lb=[39],db=[40],mb=function(t,e,n){var r=it(t.slice(0,e)),o=it(t.slice(e+1));return tt(r.concat(o),n)},gb=function(t,e,n){var r=it(t.slice(0,e));return tt(r,n)},pb=function(t,e,n){var r=t.slice(0,e),o=t.slice(e+1);return tt(o.concat(r),n)},hb=function(t,e,n){var r=t.slice(e+1);return tt(r,n)},vb=function(t){return function(e){var n=e.raw;return U(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},wb=function(t){var e=t.raw;return!0===e.ctrlKey},xb=k(yb),Cb=function(t,e){return{matches:t,classification:e}},Sb=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||Sa(t,ha(),{prevFocus:e,newFocus:n})},Ob=function(){var t=function(t){return El(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}},Tb=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(h,(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"})(Fm||(Fm={}));var Eb=function(t,e,n,r,o){var i=function(){return t.concat([Ki("focusManager",Ob()),Xi("focusInside","onFocus",vi((function(t){return U(["onFocus","onEnterOrSpace","onApi"],t)?ro.value(t):ro.error("Invalid value for focusInside")}))),df("handler",c),df("state",e),df("sendFocusIn",o)])},u=function(t,e,n,r,o){var i=n(t,e,r,o);return Sb(i,e.event).bind((function(n){return n(t,e,r,o)}))},a=function(t,e){var i=t.focusInside!==Fm.OnFocusMode?I.none():o(t).map((function(n){return Na(Ju(),(function(r,o){n(r,t,e),o.stop()}))})),a=function(n,r){var i=vb(cb.concat(ub))(r.event);t.focusInside===Fm.OnEnterOrSpaceMode&&i&&xu(n,r)&&o(t).each((function(o){o(n,t,e),r.stop()}))},c=[Na(Hu(),(function(r,o){u(r,o,n,t,e).fold((function(){a(r,o)}),(function(t){o.stop()}))})),Na(Vu(),(function(n,o){u(n,o,r,t,e).each((function(t){o.stop()}))}))];return _a(i.toArray().concat(c))},c={schema:i,processKey:u,toEvents:a};return c},_b=function(t){var e=[Hi("onEscape"),Hi("onEnter"),Ki("selector",'[data-alloy-tabstop="true"]:not(:disabled)'),Ki("firstTabstop",0),Ki("useTabstopAt",E),Hi("visibilitySelector")].concat([t]),n=function(t,e){var n=t.visibilitySelector.bind((function(t){return zs(e,t)})).getOr(e);return ur(n)>0},r=function(t,e){var r=Xm(t.element,e.selector),o=Y(r,(function(t){return n(e,t)}));return I.from(o[e.firstTabstop])},o=function(t,e){return e.focusManager.get(t).bind((function(t){return zs(t,e.selector)}))},i=function(t,e){return n(t,e)&&t.useTabstopAt(e)},u=function(t,e,n){r(t,e).each((function(n){e.focusManager.set(t,n)}))},a=function(t,e,n,r,o){return o(e,n,(function(t){return i(r,t)})).fold((function(){return r.cyclic?I.some(!0):I.none()}),(function(e){return r.focusManager.set(t,e),I.some(!0)}))},c=function(t,e,n,r){var i=Xm(t.element,n.selector);return o(t,n).bind((function(e){var o=et(i,S(sn,e));return o.bind((function(e){return a(t,i,e,n,r)}))}))},s=function(t,e,n){var r=n.cyclic?mb:gb;return c(t,e,n,r)},f=function(t,e,n){var r=n.cyclic?pb:hb;return c(t,e,n,r)},l=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)}))},m=w([Cb(bb([yb,vb(ib)]),s),Cb(vb(ib),f),Cb(vb(ab),d),Cb(bb([xb,vb(ub)]),l)]),g=w([]);return Eb(e,kc.init,m,g,(function(){return I.some(u)}))},Db=_b(Ei("cyclic",T)),Ab=_b(Ei("cyclic",E)),Rb=function(t,e,n){return Oa(t,n,ea()),I.some(!0)},Nb=function(t,e,n){var r=gv(n)&&vb(cb)(e.event);return r?I.none():Rb(t,e,n)},Bb=function(t,e){return I.some(!0)},Mb=[Ki("execute",Nb),Ki("useSpace",!1),Ki("useEnter",!0),Ki("useControlEnter",!1),Ki("useDown",!1)],Pb=function(t,e,n){return n.execute(t,e,t.element)},Ib=function(t,e,n,r){var o=n.useSpace&&!gv(t.element)?cb:[],i=n.useEnter?ub:[],u=n.useDown?db:[],a=o.concat(i).concat(u);return[Cb(vb(a),Pb)].concat(n.useControlEnter?[Cb(bb([wb,vb(ub)]),Pb)]:[])},Lb=function(t,e,n,r){return n.useSpace&&!gv(t.element)?[Cb(vb(cb),Bb)]:[]},Fb=Eb(Mb,kc.init,Ib,Lb,(function(){return I.none()})),zb=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 Oc({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})},Hb=function(t){return t.state(t)},Vb=Object.freeze({__proto__:null,flatgrid:zb,init:Hb}),Ub=function(t){return function(e,n,r,o){var i=t(e.element);return $b(i,e,n,r,o)}},jb=function(t,e){var n=Pd(t,e);return Ub(n)},Wb=function(t,e){var n=Pd(e,t);return Ub(n)},qb=function(t){return function(e,n,r,o){return $b(t,e,n,r,o)}},$b=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}))},Gb=qb,Kb=qb,Xb=qb,Yb=function(t){return t.offsetWidth<=0&&t.offsetHeight<=0},Jb=function(t){return!Yb(t.dom)},Qb=function(t,e){return et(t,e).map((function(e){return{index:e,candidates:t}}))},Zb=function(t,e,n){var r=function(t){return sn(t,e)},o=Xm(t,n),i=Y(o,Jb);return Qb(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?I.some(t.slice(1)):I.none()}))},g=function(t){return Tt(n.get(),t)},p=function(t){return h(t).bind(qx)},h=function(t){return Tt(e.get(),t)},v=function(e){return Tt(t.get(),e)},b=function(t){var e=o.get();return ut(pt(e),t)},y=function(){return r.get().bind(p)},w=function(){return e.get()};return{setMenuBuilt:a,setContents:c,expand:d,refresh:g,collapse:m,lookupMenu:h,lookupItem:v,otherMenus:b,getPrimary:y,getMenus:w,clear:i,isClear:u,getTriggeringPath:l}},qx=function(t){return"prepared"===t.type?I.some(t.menu):I.none()},$x={init:Wx,extractPreparedMenu:qx},Gx=function(t,e){var n,r=od(),o=function(e,n,r){return bt(r,(function(r,o){var i=function(){return Hx.sketch(D(D({},r),{value:o,markers:t.markers,fakeFocus:t.fakeFocus,onHighlight:t.onHighlight,focusManager:t.fakeFocus?Tb():Ob()}))};return o===n?{type:"prepared",menu:e.getSystem().build(i())}:{type:"notbuilt",nbMenu:i}}))},i=$x.init(),u=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()},a=function(t){return th.getValue(t).value},c=function(t,e,n){return gt(e,(function(t){if(!t.getSystem().isConnected())return I.none();var e=rb.getCandidates(t);return tt(e,(function(t){return a(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]}))}))},f=function(t,e){rb.highlight(t,e),rb.getHighlighted(e).orThunk((function(){return rb.getFirst(e)})).each((function(e){Oa(t,e.element,na())}))},l=function(t,e){return Rt($(e,(function(e){return t.lookupMenu(e).bind((function(t){return"prepared"===t.type?I.some(t.menu):I.none()}))})))},d=function(e,n,r){var o=l(n,n.otherMenus(r));G(o,(function(n){fs(n.element,[t.markers.backgroundMenu]),t.stayInDom||zw.remove(e,n)}))},m=function(e){return r.get().getOrThunk((function(){var n={},o=Xm(e.element,"."+t.markers.item),i=Y(o,(function(t){return"true"===Un(t,"aria-haspopup")}));return G(i,(function(t){e.getSystem().getByDom(t).each((function(t){var e=a(t);n[e]=t}))})),r.set(n),n}))},g=function(t,e){var n=m(t);vt(n,(function(t,n){var r=U(e,n);Hn(t.element,"aria-expanded",r)}))},p=function(e,n,r){return I.from(r[0]).bind((function(o){return n.lookupMenu(o).bind((function(o){if("notbuilt"===o.type)return I.none();var i=o.menu,u=l(n,r.slice(1));return G(u,(function(e){is(e.element,t.markers.backgroundMenu)})),In(i.element)||zw.append(e,_s(i)),fs(i.element,[t.markers.backgroundMenu]),f(e,i),d(e,n,r),I.some(i)}))}))};(function(t){t[t["HighlightSubmenu"]=0]="HighlightSubmenu",t[t["HighlightParent"]=1]="HighlightParent"})(n||(n={}));var v=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(Lv)&&Lv.isDisabled(r))return I.some(r);var u=a(r);return i.expand(u).bind((function(u){return g(e,u),I.from(u[0]).bind((function(a){return i.lookupMenu(a).bind((function(c){var s=v(e,a,c);return In(s.element)||zw.append(e,_s(s)),t.onOpenSubmenu(e,r,s,it(u)),o===n.HighlightSubmenu?(rb.highlightFirst(s),p(e,i,u)):(rb.dehighlightAll(s),I.some(r))}))}))}))},y=function(e,n){var r=a(n);return i.collapse(r).bind((function(r){return g(e,r),p(e,i,r).map((function(r){return t.onCollapseMenu(e,n,r),r}))}))},w=function(t,e){var n=a(e);return i.refresh(n).bind((function(e){return g(t,e),p(t,i,e)}))},x=function(t,e){return gv(e.element)?I.none():b(t,e,n.HighlightSubmenu)},C=function(t,e){return gv(e.element)?I.none():y(t,e)},S=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 zs(r.getSource(),"."+t.markers.item).bind((function(t){return n.getSystem().getByDom(t).toOptional().bind((function(t){return e(n,t).map(E)}))}))}},O=_a([Na(Fx(),(function(t,e){var n=e.event.item;i.lookupItem(a(n)).each((function(){var n=e.event.menu;rb.highlight(t,n);var r=a(e.event.item);i.refresh(r).each((function(e){return d(t,i,e)}))}))})),qa((function(e,r){var o=r.event.target;e.getSystem().getByDom(o).each((function(r){var o=a(r);0===o.indexOf("collapse-item")&&y(e,r),b(e,r,n.HighlightSubmenu).fold((function(){t.onExecute(e,r)}),h)}))})),Ua((function(e,n){u(e).each((function(n){zw.append(e,_s(n)),t.onOpenMenu(e,n),t.highlightImmediately&&f(e,n)}))}))].concat(t.navigateOnHover?[Na(Cx(),(function(e,r){var o=r.event.item;w(e,o),b(e,o,n.HighlightParent),t.onHover(e,o)}))]:[])),T=function(t){return rb.getHighlighted(t).bind(rb.getHighlighted)},_=function(t){T(t).each((function(e){y(t,e)}))},A=function(t){i.getPrimary().each((function(e){f(t,e)}))},R=function(t){return I.from(t.components()[0]).filter((function(t){return"menu"===Un(t.element,"role")}))},N=function(e){var n=i.getPrimary().bind((function(t){return T(e).bind((function(t){var n=a(t),r=Ot(i.getMenus()),o=Rt($(r,$x.extractPreparedMenu));return i.getTriggeringPath(n,(function(t){return c(e,o,t)}))})).map((function(e){return{primary:t,triggeringPath:e}}))}));n.fold((function(){R(e).each((function(n){t.onRepositionMenu(e,n,[])}))}),(function(n){var r=n.primary,o=n.triggeringPath;t.onRepositionMenu(e,r,o)}))},B={collapseMenu:_,highlightPrimary:A,repositionMenus:N};return{uid:t.uid,dom:t.dom,markers:t.markers,behaviours:rh(t.tmenuBehaviours,[Dw.config({mode:"special",onRight:k(x),onLeft:k(C),onEscape:k(S),focusIn:function(t,e){i.getPrimary().each((function(e){Oa(t,e.element,na())}))}}),rb.config({highlightClass:t.markers.selectedMenu,itemClass:t.markers.menu}),bv.config({find:function(t){return rb.getHighlighted(t)}}),zw.config({})]),eventOrder:t.eventOrder,apis:B,events:O}},Kx=w("collapse-item"),Xx=function(t,e,n){return{primary:t,menus:e,expansions:n}},Yx=function(t,e){return{primary:t,menus:mu(t,e),expansions:{}}},Jx=function(t){return{value:oc(Kx()),meta:{text:t}}},Qx=dv({name:"TieredMenu",configFields:[lf("onExecute"),lf("onEscape"),ff("onOpenMenu"),ff("onOpenSubmenu"),cf("onRepositionMenu"),cf("onCollapseMenu"),Ki("highlightImmediately",!0),Li("data",[Di("primary"),Di("menus"),Di("expansions")]),Ki("fakeFocus",!1),cf("onHighlight"),cf("onHover"),of(),Di("dom"),Ki("navigateOnHover",!0),Ki("stayInDom",!1),eh("tmenuBehaviours",[Dw,rb,bv,zw]),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:Gx,extraApis:{tieredData:Xx,singleData:Yx,collapseItem:Jx}}),Zx=function(t,e,n,r,o){var i=function(){return t.lazySink(e)},u="horizontal"===r.type?{layouts:{onLtr:function(){return tl()},onRtl:function(){return el()}}}:{},a=function(t){return 2===t.length},c=function(t){return a(t)?u:{}};return Qx.sketch({dom:{tag:"div"},data:r.data,markers:r.menu.markers,highlightImmediately:r.menu.highlightImmediately,onEscape:function(){return bp.close(e),t.onEscape.map((function(t){return t(e)})),I.some(!0)},onExecute:function(){return I.some(!0)},onOpenMenu:function(t,e){Fg.positionWithinBounds(i().getOrDie(),e,n,o())},onOpenSubmenu:function(t,e,n,r){var o=i().getOrDie();Fg.position(o,n,{anchor:D({type:"submenu",item:e},c(r))})},onRepositionMenu:function(t,e,r){var u=i().getOrDie();Fg.positionWithinBounds(u,e,n,o()),G(r,(function(t){var e=c(t.triggeringPath);Fg.position(u,t.triggeredMenu,{anchor:D({type:"submenu",item:t.triggeringItem},e)})}))}})},tC=function(t,e){var n=function(e,n){var r=t.getRelated(e);return r.exists((function(t){return js(t,n)}))},r=function(t,e){bp.setContent(t,e)},o=function(t,e,n){i(t,e,n,I.none())},i=function(t,e,n,r){u(t,e,n,(function(){return r.map((function(t){return Jr(t)}))}))},u=function(e,n,r,o){var i=t.lazySink(e).getOrDie();bp.openWhileCloaked(e,n,(function(){return Fg.positionWithinBounds(i,e,r,o())})),th.setValue(e,I.some({mode:"position",config:r,getBounds:o}))},a=function(t,e,n){c(t,e,n,I.none)},c=function(e,n,r,o){var i=Zx(t,e,n,r,o);bp.open(e,i),th.setValue(e,I.some({mode:"menu",menu:i}))},s=function(t){bp.isOpen(t)&&(th.setValue(t,I.none()),bp.close(t))},f=function(t){return bp.getState(t)},l=function(e){bp.isOpen(e)&&th.getValue(e).each((function(n){switch(n.mode){case"menu":bp.getState(e).each(Qx.repositionMenus);break;case"position":var r=t.lazySink(e).getOrDie();Fg.positionWithinBounds(r,e,n.config,n.getBounds());break}}))},d={setContent:r,showAt:o,showWithin:i,showWithinBounds:u,showMenuAt:a,showMenuWithinBounds:c,hide:s,getContent:f,reposition:l,isOpen:bp.isOpen};return{uid:t.uid,dom:t.dom,behaviours:rh(t.inlineBehaviours,[bp.config({isPartOf:function(t,e,r){return js(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)}}),th.config({store:{mode:"memory",initialValue:I.none()}}),yl.config({channels:D(D({},Sp(D({isExtraPart:e.isExtraPart},t.fireDismissalEventInstead.map((function(t){return{fireEventInstead:{event:t.event}}})).getOr({})))),Op(D(D({},t.fireRepositionEventInstead.map((function(t){return{fireEventInstead:{event:t.event}}})).getOr({})),{doReposition:l})))})]),eventOrder:t.eventOrder,apis:d}},eC=dv({name:"InlineView",configFields:[Di("lazySink"),cf("onShow"),cf("onHide"),Wi("onEscape"),eh("inlineBehaviours",[bp,th,yl]),$i("fireDismissalEventInstead",[Ki("event",ga())]),$i("fireRepositionEventInstead",[Ki("event",pa())]),Ki("getRelated",I.none),Ki("isExtraPart",T),Ki("eventOrder",I.none)],factory:tC,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)}}}),nC="layout-inset",rC=function(t){return t.x},oC=function(t,e){return t.x+t.width/2-e.width/2},iC=function(t,e){return t.x+t.width-e.width},uC=function(t){return t.y},aC=function(t,e){return t.y+t.height-e.height},cC=function(t,e){return t.y+t.height/2-e.height/2},sC=function(t,e,n){return pf(iC(t,e),aC(t,e),n.insetSouthwest(),Sf(),"southwest",Rf(t,{right:0,bottom:3}),nC)},fC=function(t,e,n){return pf(rC(t),aC(t,e),n.insetSoutheast(),Cf(),"southeast",Rf(t,{left:1,bottom:3}),nC)},lC=function(t,e,n){return pf(iC(t,e),uC(t),n.insetNorthwest(),xf(),"northwest",Rf(t,{right:0,top:2}),nC)},dC=function(t,e,n){return pf(rC(t),uC(t),n.insetNortheast(),wf(),"northeast",Rf(t,{left:1,top:2}),nC)},mC=function(t,e,n){return pf(oC(t,e),uC(t),n.insetNorth(),kf(),"north",Rf(t,{top:2}),nC)},gC=function(t,e,n){return pf(oC(t,e),aC(t,e),n.insetSouth(),Of(),"south",Rf(t,{bottom:3}),nC)},pC=function(t,e,n){return pf(iC(t,e),cC(t,e),n.insetEast(),Ef(),"east",Rf(t,{right:0}),nC)},hC=function(t,e,n){return pf(rC(t),cC(t,e),n.insetWest(),Tf(),"west",Rf(t,{left:1}),nC)},vC=function(t){switch(t){case"north":return mC;case"northeast":return dC;case"northwest":return lC;case"south":return gC;case"southeast":return fC;case"southwest":return sC;case"east":return pC;case"west":return hC}},bC=function(t,e,n,r,o){var i=$l(r).map(vC).getOr(mC);return i(t,e,n,r,o)},yC=function(t){switch(t){case"north":return gC;case"northeast":return fC;case"northwest":return sC;case"south":return mC;case"southeast":return dC;case"southwest":return lC;case"east":return hC;case"west":return pC}},wC=function(t,e,n,r,o){var i=$l(r).map(yC).getOr(mC);return i(t,e,n,r,o)},xC=tinymce.util.Tools.resolve("tinymce.util.Delay"),CC=function(t){var e=vx(t.action),n=t.dom.tag,r=function(e){return Tt(t.dom,"attributes").bind((function(t){return Tt(t,e)}))},o=function(){if("button"===n){var t=r("type").getOr("button"),e=r("role").map((function(t){return{role:t}})).getOr({});return D({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:oh.augment(t.buttonBehaviours,[Yw.config({}),Dw.config({mode:"execution",useSpace:!0,useEnter:!0})]),domModification:{attributes:o()},eventOrder:t.eventOrder}},SC=dv({name:"Button",factory:CC,configFields:[Ki("uid",void 0),Di("dom"),Ki("components",[]),oh.field("buttonBehaviours",[Yw,Dw]),Hi("action"),Hi("role"),Ki("eventOrder",{})]}),kC=function(t){var e=sv(t)&&_t(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 D(D({},t),{uid:e})};return{get:n,getOpt:r,asSpec:o}},OC=tinymce.util.Tools.resolve("tinymce.util.I18n"),TC={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},EC="temporary-placeholder",_C=function(t){return function(){return Tt(t,EC).getOr("!not found!")}},DC=function(t,e){var n=t.toLowerCase();if(OC.isRtl()){var r=Vt(n,"-rtl");return Et(e,r)?r:n}return n},AC=function(t,e){return Tt(e,DC(t,e))},RC=function(t,e){var n=e();return AC(t,n).getOrThunk(_C(n))},NC=function(t,e,n){var r=e();return AC(t,r).or(n).getOrThunk(_C(r))},BC=function(t){return!!OC.isRtl()&&Et(TC,t)},MC=function(){return Vw("add-focusable",[Ua((function(t){Ls(t.element,"svg").each((function(t){return Hn(t,"focusable","false")}))}))])},PC=function(t,e,n,r){var o,i,u=BC(e)?["tox-icon--flip"]:[],a=Tt(n,DC(e,n)).or(r).getOrThunk(_C(n));return{dom:{tag:t.tag,attributes:null!==(o=t.attributes)&&void 0!==o?o:{},classes:t.classes.concat(u),innerHtml:a},behaviours:ml(R(R([],null!==(i=t.behaviours)&&void 0!==i?i:[],!0),[MC()],!1))}},IC=function(t,e,n,r){return void 0===r&&(r=I.none()),PC(e,t,n(),r)},LC=function(t,e,n){var r=n(),o=tt(t,(function(t){return Et(r,DC(t,r))}));return PC(e,o.getOr(EC),r,I.none())},FC={success:"checkmark",error:"warning",err:"error",warning:"warning",warn:"warning",info:"info"},zC=function(t){var e=kC({dom:{tag:"p",innerHtml:t.translationProvider(t.text)},behaviours:ml([zw.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=kC({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:ml([zw.config({})])}),i=function(t,e){t.getSystem().isConnected()&&o.getOpt(t).each((function(t){zw.set(t,[{dom:{tag:"div",classes:["tox-bar-container"]},components:[n(e)]},r(e)])}))},u=function(t,n){if(t.getSystem().isConnected()){var r=e.get(t);zw.set(r,[Ss(n)])}},a={updateProgress:i,updateText:u},c=nt([t.icon.toArray(),t.level.toArray(),t.level.bind((function(t){return I.from(FC[t])})).toArray()]),s=kC(SC.sketch({dom:{tag:"button",classes:["tox-notification__dismiss","tox-button","tox-button--naked","tox-button--icon"]},components:[IC("close",{tag:"div",classes:["tox-icon"],attributes:{"aria-label":t.translationProvider("Close")}},t.iconProvider)],action:function(e){t.onAction(e)}})),f=LC(c,{tag:"div",classes:["tox-notification__icon"]},t.iconProvider),l={dom:{tag:"div",classes:["tox-notification__body"]},components:[e.asSpec()],behaviours:ml([zw.config({})])},d=[f,l];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:ml([Yw.config({}),Vw("notification-events",[Na(Fu(),(function(t){s.getOpt(t).each(Yw.focus)}))])]),components:d.concat(t.progress?[o.asSpec()]:[]).concat(t.closeButton?[s.asSpec()]:[]),apis:a}},HC=dv({name:"Notification",factory:zC,configFields:[Hi("level"),Di("progress"),Di("icon"),Di("onAction"),Di("text"),Di("iconProvider"),Di("translationProvider"),Zi("closeButton",!0)],apis:{updateProgress:function(t,e,n){t.updateProgress(e,n)},updateText:function(t,e,n){t.updateText(e,n)}}});function VC(t,e,n){var r=e.backstage.shared,o=function(t){switch(t){case"bc-bc":return gC;case"tc-tc":return mC;case"tc-bc":return $f;case"bc-tc":default:return Gf}},i=function(t){t.length>0&&G(t,(function(e,n){0===n?e.moveRel(null,"banner"):e.moveRel(t[n-1].getEl(),"bc-tc")}))},u=function(e,i){var u=!e.closeButton&&e.timeout&&(e.timeout>0||e.timeout<0),a=function(){i(),eC.hide(s)},c=Es(HC.sketch({text:e.text,level:U(["success","error","warning","warn","info"],e.type)?e.type:void 0,progress:!0===e.progressBar,icon:I.from(e.icon),closeButton:!u,onAction:a,iconProvider:r.providers.icons,translationProvider:r.providers.translate})),s=Es(eC.sketch(D({dom:{tag:"div",classes:["tox-notifications-container"]},lazySink:r.getSink,fireDismissalEventInstead:{}},r.header.isPositionedAtTop()?{}:{fireRepositionEventInstead:{}})));n.add(s),e.timeout>0&&xC.setTimeout((function(){a()}),e.timeout);var f=function(){var e=Jr(ee.fromDom(t.getContentAreaContainer())),n=Zr(),r=Df(n.x,e.x,e.right),o=Df(n.y,e.y,e.bottom),i=Math.max(e.right,n.right),u=Math.max(e.bottom,n.bottom);return I.some(Yr(r,o,i-r,u-o))};return{close:a,moveTo:function(t,e){eC.showAt(s,_s(c),{anchor:{type:"makeshift",x:t,y:e}})},moveRel:function(t,e){var n=_s(c),i={maxHeightFunction:Ed()};if("banner"!==e&&d(t)){var u=o(e),a={type:"node",root:Ln(),node:I.some(ee.fromDom(t)),overrides:i,layouts:{onRtl:function(){return[u]},onLtr:function(){return[u]}}};eC.showWithinBounds(s,n,{anchor:a},f)}else{var l=D(D({},r.anchors.banner()),{overrides:i});eC.showWithinBounds(s,n,{anchor:l},f)}},text:function(t){HC.updateText(c,t)},settings:e,getEl:function(){return c.element.dom},progressBar:{value:function(t){HC.updateProgress(c,t)}}}},a=function(t){t.close()},c=function(t){return t.settings};return{open:u,close:a,reposition:i,getArgs:c}}var UC,jC=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 Ar(n,ee.fromDom(e.extractContents())),e.insertNode(n.dom),vn(n).each((function(t){return t.dom.normalize()})),Gm(n).map((function(e){t.selection.setCursorLocation(e.dom,jm(e))})),n}))},YC=function(t){return zs(t,KC)},JC=function(t){return t.collapsed&&3===t.startContainer.nodeType},QC=function(t){return t.toString().replace(/\u00A0/g," ").replace(/\uFEFF/g,"")},ZC=function(t){return""!==t&&-1!=="  \f\n\r\t\v".indexOf(t)},tS=function(t,e){return t.substring(e.length)},eS=function(t,e,n){var r;for(r=e-1;r>=0;r--){var o=t.charAt(r);if(ZC(o))return I.none();if(o===n)break}return I.some(r)},nS=function(t,e,n,r){if(void 0===r&&(r=0),!JC(e))return I.none();var o=function(t,e,r){return eS(r,e,n).getOr(e)},i=t.getParent(e.startContainer,t.isBlock)||t.getRoot();return GC(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 I.none();var i=QC(o),u=i.lastIndexOf(n);return 0!==u||tS(i,n).length0?fS(e[e.length-1]):aS(t,e.length)},lS=function(t,e){var n=t.childNodes;return n.length>0&&e0&&sS(t)&&n.length===e?fS(n[n.length-1]):aS(t,e)},dS=function(t,e){return GC(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!ZC(e)})).isSome()},mS=function(t){return function(e){var n=lS(e.startContainer,e.startOffset);return!dS(t,n)}},gS=function(t,e,n){return gt(n.triggerChars,(function(n){return rS(t,e,n)}))},pS=function(t,e){var n=e(),r=t.selection.getRng();return gS(t.dom,r,n).bind((function(n){return hS(t,e,n)}))},hS=function(t,e,n,r){void 0===r&&(r={});var o=e(),i=t.selection.getRng(),u=i.startContainer.nodeValue,a=Y(o.lookupByChar(n.triggerChar),(function(e){return n.text.length>=e.minChars&&e.matches.getOrThunk((function(){return mS(t.dom)}))(n.range,u,n.text)}));if(0===a.length)return I.none();var c=uS.all($(a,(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 I.some({lookupData:c,context:n})},vS=ti([Ni("type"),ji("text")]),bS=function(t){return wi("separatormenuitem",vS,t)},yS=ti([Ki("type","autocompleteitem"),Ki("active",!1),Ki("disabled",!1),Ki("meta",{}),Ni("value"),ji("text"),ji("icon")]),wS=ti([Ni("type"),Ni("ch"),Yi("minChars",1),Ki("columns",1),Yi("maxResults",10),Wi("matches"),Pi("fetch"),Pi("onAction"),nu("highlightOn",[],si)]),xS=function(t){return wi("Autocompleter.Separator",vS,t)},CS=function(t){return wi("Autocompleter.Item",yS,t)},SS=function(t){return wi("Autocompleter",wS,t)},kS=[Zi("disabled",!1),ji("tooltip"),ji("icon"),ji("text"),tu("onSetup",(function(){return h}))],OS=ti([Ni("type"),Pi("onAction")].concat(kS)),TS=function(t){return wi("toolbarbutton",OS,t)},ES=[Zi("active",!1)].concat(kS),_S=ti(ES.concat([Ni("type"),Pi("onAction")])),DS=function(t){return wi("ToggleButton",_S,t)},AS=[tu("predicate",T),Qi("scope","node",["node","editor"]),Qi("position","selection",["node","selection","line"])],RS=kS.concat([Ki("type","contextformbutton"),Ki("primary",!1),Pi("onAction"),Ei("original",x)]),NS=ES.concat([Ki("type","contextformbutton"),Ki("primary",!1),Pi("onAction"),Ei("original",x)]),BS=kS.concat([Ki("type","contextformbutton")]),MS=ES.concat([Ki("type","contextformtogglebutton")]),PS=ki("type",{contextformbutton:RS,contextformtogglebutton:NS}),IS=ti([Ki("type","contextform"),tu("initValue",w("")),ji("label"),zi("commands",PS),Vi("launch",ki("type",{contextformbutton:BS,contextformtogglebutton:MS}))].concat(AS)),LS=function(t){return wi("ContextForm",IS,t)},FS=ti([Ki("type","contexttoolbar"),Ni("items")].concat(AS)),zS=function(t){return wi("ContextToolbar",FS,t)},HS=function(t){var e={};return G(t,(function(t){e[t]={}})),pt(e)},VS=function(t){var e=t.ui.registry.getAll().popups,n=bt(e,(function(t){return SS(t).fold((function(t){throw new Error(Si(t))}),x)})),r=HS(St(n,(function(t){return t.ch}))),o=Ot(n),i=function(t){return Y(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"})(UC||(UC={}));var US,jS=UC,WS="tox-menu-nav__js",qS="tox-collection__item",$S="tox-swatch",GS={normal:WS,color:$S},KS="tox-collection__item--enabled",XS="tox-collection__group-heading",YS="tox-collection__item-icon",JS="tox-collection__item-label",QS="tox-collection__item-accessory",ZS="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",uk="tox-collection__item-container--align-left",ak="tox-collection__item-container--valign-top",ck="tox-collection__item-container--valign-middle",sk="tox-collection__item-container--valign-bottom",fk=function(t){return Tt(GS,t).getOr(WS)},lk=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:lk(t),tieredMenu:"tox-tiered-menu"}},mk=function(t){var e=dk(t);return{backgroundMenu:e.backgroundMenu,selectedMenu:e.selectedMenu,menu:e.menu,selectedItem:e.selectedItem,item:fk(t)}},gk=function(t,e,n){var r=dk(n);return{tag:"div",classes:nt([[r.menu,"tox-menu-"+e+"-column"],t?[r.hasIcons]:[]])}},pk=[Hx.parts.items({})],hk=function(t,e,n){var r=dk(n),o={tag:"div",classes:nt([[r.tieredMenu]])};return{dom:o,markers:mk(n)}},vk=function(t,e){return function(n){var r=q(n,e);return $(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:[Hx.parts.items({preprocess:"auto"!==t?vk({tag:"div",classes:["tox-swatches__row"]},t):x})]}]}},yk=function(t){return{dom:{tag:"div",classes:["tox-menu","tox-collection","tox-collection--toolbar","tox-collection--toolbar-lg"]},components:[Hx.parts.items({preprocess:vk({tag:"div",classes:["tox-collection__group"]},t)})]}},wk=function(t,e){var n=[],r=[];return G(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),$(n,(function(t){return{dom:{tag:"div",classes:["tox-collection__group"]},components:t}}))},xk=function(t,e,n){return{dom:{tag:"div",classes:["tox-menu","tox-collection"].concat(1===t?["tox-collection--list"]:["tox-collection--grid"])},components:[Hx.parts.items({preprocess:function(n){return"auto"!==t&&t>1?vk({tag:"div",classes:["tox-collection__group"]},t)(n):wk(n,(function(t,n){return"separator"===e[n].type}))}})]}},Ck=function(t,e){return{dom:{tag:"div",classes:["tox-collection","tox-collection--horizontal"]},components:[Hx.parts.items({preprocess:function(e){return wk(e,(function(e,n){return"separator"===t[n].type}))}})]}},Sk=function(t){return j(t,(function(t){return"icon"in t&&void 0!==t.icon}))},kk=function(t){return I.none()},Ok=function(t,e,n,r,o){var i=Ck(n);return{value:t,dom:i.dom,components:i.components,items:n}},Tk=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=xk(r,n);return{value:t,dom:i.dom,components:i.components,items:n}}if("normal"===o&&1===r){i=xk(1,n);return{value:t,dom:i.dom,components:i.components,items:n}}if("normal"===o){i=xk(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:gk(e,r,o),components:pk,items:n}},Ek=[Ni("type"),Ni("src"),ji("alt"),nu("classes",[],si)],_k=ti(Ek),Dk=[Ni("type"),Ni("text"),ji("name"),nu("classes",["tox-collection__item-label"],si)],Ak=ti(Dk),Rk=Jo((function(){return pi("type",{cardimage:_k,cardtext:Ak,cardcontainer:Nk})})),Nk=ti([Ni("type"),Ji("direction","horizontal"),Ji("align","left"),Ji("valign","middle"),zi("items",Rk)]),Bk=[Zi("disabled",!1),ji("text"),ji("shortcut"),Ti("value","value",Oo((function(){return oc("menuitem-value")})),ui()),Ki("meta",{})],Mk=ti([Ni("type"),ji("label"),zi("items",Rk),tu("onSetup",(function(){return h})),tu("onAction",h)].concat(Bk)),Pk=function(t){return wi("cardmenuitem",Mk,t)},Ik=ti([Ni("type"),Zi("active",!1),ji("icon")].concat(Bk)),Lk=function(t){return wi("choicemenuitem",Ik,t)},Fk=[Ni("type"),Ni("fancytype"),tu("onAction",h)],zk=[Ki("initData",{})].concat(Fk),Hk=[ru("initData",{},[Zi("allowCustomColors",!0),qi("colors",ui())])].concat(Fk),Vk=ki("fancytype",{inserttable:zk,colorswatch:Hk}),Uk=function(t){return wi("fancymenuitem",Vk,t)},jk=ti([Ni("type"),tu("onSetup",(function(){return h})),tu("onAction",h),ji("icon")].concat(Bk)),Wk=function(t){return wi("menuitem",jk,t)},qk=ti([Ni("type"),Pi("getSubmenuItems"),tu("onSetup",(function(){return h})),ji("icon")].concat(Bk)),$k=function(t){return wi("nestedmenuitem",qk,t)},Gk=ti([Ni("type"),ji("icon"),Zi("active",!1),tu("onSetup",(function(){return h})),Pi("onAction")].concat(Bk)),Kk=function(t){return wi("togglemenuitem",Gk,t)},Xk=function(t,e,n){var r=Xm(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 I.some({numColumns:o,numRows:Math.ceil(r.length/o)})}return I.none()},Yk=function(t,e){return ml([Vw(t,e)])},Jk=function(t){return Yk(oc("unnamed-events"),t)},Qk={namedEvents:Yk,unnamedEvents:Jk},Zk=oc("tooltip.exclusive"),tO=oc("tooltip.show"),eO=oc("tooltip.hide"),nO=function(t,e,n){t.getSystem().broadcastOn([Zk],{})},rO=function(t,e,n,r){n.getTooltip().each((function(t){t.getSystem().isConnected()&&zw.set(t,r)}))},oO=Object.freeze({__proto__:null,hideAllExclusive:nO,setComponents:rO}),iO=function(t,e){var n=function(n){e.getTooltip().each((function(r){Gg(r),t.onHide(n,r),e.clearTooltip()})),e.clearTimer()},r=function(n){if(!e.isShowing()){nO(n);var r=t.lazySink(n).getOrDie(),o=n.getSystem().build({dom:t.tooltipDom,components:t.tooltipComponents,events:_a("normal"===t.mode?[Na(Lu(),(function(t){Ca(n,tO)})),Na(Pu(),(function(t){Ca(n,eO)}))]:[]),behaviours:ml([zw.config({})])});e.setTooltip(o),Wg(r,o),t.onShow(n,o),Fg.position(r,o,{anchor:t.anchor(n)})}};return _a(nt([[Na(tO,(function(n){e.resetTimer((function(){r(n)}),t.delay)})),Na(eO,(function(r){e.resetTimer((function(){n(r)}),t.delay)})),Na(ta(),(function(t,e){var r=e;r.universal||U(r.channels,Zk)&&n(t)})),ja((function(t){n(t)}))],"normal"===t.mode?[Na(Fu(),(function(t){Ca(t,tO)})),Na(Qu(),(function(t){Ca(t,eO)})),Na(Lu(),(function(t){Ca(t,tO)})),Na(Pu(),(function(t){Ca(t,eO)}))]:[Na(wa(),(function(t,e){Ca(t,tO)})),Na(xa(),(function(t){Ca(t,eO)}))]]))},uO=Object.freeze({__proto__:null,events:iO}),aO=[Di("lazySink"),Di("tooltipDom"),Ki("exclusive",!0),Ki("tooltipComponents",[]),Ki("delay",300),Qi("mode","normal",["normal","follow-highlight"]),Ki("anchor",(function(t){return{type:"hotspot",hotspot:t,layouts:{onLtr:w([Gf,$f,Uf,Wf,jf,qf]),onRtl:w([Gf,$f,Uf,Wf,jf,qf])}}})),cf("onHide"),cf("onShow")],cO=function(){var t=od(),e=od(),n=function(){t.on(clearTimeout)},r=function(e,r){n(),t.set(setTimeout(e,r))},o=w("not-implemented");return Oc({getTooltip:e.get,isShowing:e.isSet,setTooltip:e.set,clearTooltip:e.clear,clearTimer:n,resetTimer:r,readState:o})},sO=Object.freeze({__proto__:null,init:cO}),fO=pl({fields:aO,name:"tooltipping",active:uO,state:sO,apis:oO}),lO=function(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")},dO=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),mO=tinymce.util.Tools.resolve("tinymce.EditorManager"),gO=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):mO.baseURL+"/skins/ui/"+r}return n},pO=function(t){return t.getParam("readonly",!1,"boolean")},hO=function(t){return!1===t.getParam("skin")},vO=function(t){return t.getParam("height",Math.max(t.getElement().offsetHeight,200))},bO=function(t){return t.getParam("width",dO.DOM.getStyle(t.getElement(),"width"))},yO=function(t){return I.from(t.getParam("min_width")).filter(g)},wO=function(t){return I.from(t.getParam("min_height")).filter(g)},xO=function(t){return I.from(t.getParam("max_width")).filter(g)},CO=function(t){return I.from(t.getParam("max_height")).filter(g)},SO=function(t){return I.from(t.getParam("style_formats")).filter(a)},kO=function(t){return t.getParam("style_formats_merge",!1,"boolean")},OO=function(t){return t.getParam("lineheight_formats","1 1.1 1.2 1.3 1.4 1.5 2","string").split(" ")},TO=function(t){return t.getParam("content_langs",void 0,"array")},EO=function(t){return t.getParam("removed_menuitems","")},_O=function(t){return!1!==t.getParam("menubar",!0,"boolean")},DO=function(t){var e=t.getParam("toolbar",!0),n=!0===e,r=i(e),o=a(e)&&e.length>0;return!RO(t)&&(o||r||n)},AO=function(t){var e=W(9,(function(e){return t.getParam("toolbar"+(e+1),!1,"string")})),n=Y(e,(function(t){return"string"===typeof t}));return n.length>0?I.some(n):I.none()},RO=function(t){return AO(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"})(US||(US={}));var NO,BO=function(t){return t.getParam("toolbar_mode","","string")};(function(t){t["auto"]="auto",t["top"]="top",t["bottom"]="bottom"})(NO||(NO={}));var MO,PO=function(t){return t.getParam("toolbar_groups",{},"object")},IO=function(t){return t.getParam("toolbar_location",NO.auto,"string")},LO=function(t){return IO(t)===NO.bottom},FO=function(t){return t.getParam("fixed_toolbar_container","","string")},zO=function(t){return t.getParam("fixed_toolbar_container_target")},HO=function(t){return t.getParam("toolbar_persist",!1,"boolean")},VO=function(t){if(!t.inline)return I.none();var e=FO(t);if(e.length>0)return Fs(Ln(),e);var n=zO(t);return d(n)?I.some(ee.fromDom(n)):I.none()},UO=function(t){return t.inline&&VO(t).isSome()},jO=function(t){var e=VO(t);return e.getOrThunk((function(){return An(Dn(ee.fromDom(t.getElement())))}))},WO=function(t){return t.inline&&!_O(t)&&!DO(t)&&!RO(t)},qO=function(t){var e=t.getParam("toolbar_sticky",!1,"boolean");return(e||t.inline)&&!UO(t)&&!WO(t)},$O=function(t){return t.getParam("toolbar_sticky_offset",0,"number")},GO=function(t){return t.getParam("draggable_modal",!1,"boolean")},KO=function(t){var e=t.getParam("menu");return e?bt(e,(function(t){return D(D({},t),{items:t.items})})):{}},XO=function(t){return t.getParam("menubar")},YO=function(t){return t.getParam("toolbar",!0)},JO=function(t){return t.getParam("file_picker_callback")},QO=function(t){return t.getParam("file_picker_types")},ZO=function(t){return t.getParam("file_browser_callback_types")},tT=function(t){return!1===t.getParam("typeahead_urls")},eT=function(t){return t.getParam("anchor_top","#top")},nT=function(t){return t.getParam("anchor_bottom","#bottom")},rT=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},oT="silver.readonly",iT=ti([Mi("readonly")]),uT=function(t,e){var n=t.outerContainer,r=n.element;e&&(t.mothership.broadcastOn([yp()],{target:r}),t.uiMothership.broadcastOn([yp()],{target:r})),t.mothership.broadcastOn([oT],{readonly:e}),t.uiMothership.broadcastOn([oT],{readonly:e})},aT=function(t,e){t.on("init",(function(){t.mode.isReadOnly()&&uT(e,!0)})),t.on("SwitchMode",(function(){return uT(e,t.mode.isReadOnly())})),pO(t)&&t.setMode("readonly")},cT=function(){var t;return yl.config({channels:(t={},t[oT]={schema:iT,onReceive:function(t,e){Lv.set(t,e.readonly)}},t)})},sT=function(t){return Lv.config({disabled:t,disableClass:"tox-collection__item--state-disabled"})},fT=function(t){return Lv.config({disabled:t})},lT=function(t){return Lv.config({disabled:t,disableClass:"tox-tbtn--disabled"})},dT=function(t){return Lv.config({disabled:t,disableClass:"tox-tbtn--disabled",useNative:!1})},mT={item:sT,button:fT,splitButton:lT,toolbarButton:dT},gT=function(t,e){var n=t.getApi(e);return function(t){t(n)}},pT=function(t,e){return Ua((function(n){var r=gT(t,n);r((function(n){var r=t.onSetup(n);m(r)&&e.set(r)}))}))},hT=function(t,e){return ja((function(n){return gT(t,n)(e.get())}))},vT=function(t,e){return qa((function(n,r){gT(t,n)(t.onAction),t.triggersSubmenu||e!==jS.CLOSE_ON_EXECUTE||(Ca(n,ia()),r.stop())}))},bT=(MO={},MO[ea()]=["disabling","alloy.base.behaviour","toggling","item-events"],MO),yT=Rt,wT=function(t,e,n,r){var o=ou(h);return{type:"item",dom:e.dom,components:yT(e.optComponents),data:t.data,eventOrder:bT,hasSubmenu:t.triggersSubmenu,itemBehaviours:ml([Vw("item-events",[vT(t,n),pT(t,o),hT(t,o)]),mT.item((function(){return t.disabled||r.isDisabled()})),cT(),zw.config({})].concat(t.itemBehaviours))}},xT=function(t){return{value:t.value,meta:D({text:t.text.getOr("")},t.meta)}},CT=tinymce.util.Tools.resolve("tinymce.Env"),ST=function(t){var e={alt:"⌥",ctrl:"⌃",shift:"⇧",meta:"⌘",access:"⌃⌥"},n={meta:"Ctrl",access:"Shift+Alt"},r=CT.mac?e:n,o=t.split("+"),i=$(o,(function(t){var e=t.toLowerCase().trim();return Et(r,e)?r[e]:t}));return CT.mac?i.join(""):i.join("+")},kT=function(t,e,n){return void 0===n&&(n=[YS]),IC(t,{tag:"div",classes:n},e)},OT=function(t){return{dom:{tag:"div",classes:[JS]},components:[Ss(OC.translate(t))]}},TT=function(t,e){return{dom:{tag:"div",classes:e,innerHtml:t}}},ET=function(t,e){return{dom:{tag:"div",classes:[JS]},components:[{dom:{tag:t.tag,styles:t.styles},components:[Ss(OC.translate(e))]}]}},_T=function(t){return{dom:{tag:"div",classes:[QS],innerHtml:ST(t)}}},DT=function(t){return kT("checkmark",t,[tk])},AT=function(t){return kT("chevron-right",t,[ZS])},RT=function(t){return kT("chevron-down",t,[ZS])},NT=function(t,e){var n="vertical"===t.direction?rk:ok,r="left"===t.align?uk:ik,o=function(){switch(t.valign){case"top":return ak;case"middle":return ck;case"bottom":return sk}};return{dom:{tag:"div",classes:[nk,n,r,o()]},components:e}},BT=function(t,e,n){return{dom:{tag:"img",classes:e,attributes:{src:t,alt:n.getOr("")}}}},MT=function(t,e,n){var r="custom",o="remove",i=t.ariaLabel,u=t.value,a=t.iconContent.map((function(t){return NC(t,e.icons,n)})),c=function(){var t=$S,n=a.getOr(""),c=i.map((function(t){return{title:e.translate(t)}})).getOr({}),s={tag:"div",attributes:c,classes:[t]};return D(D({},s),u===r?{tag:"button",classes:R(R([],s.classes,!0),["tox-swatches__picker-btn"],!1),innerHtml:n}:u===o?{classes:R(R([],s.classes,!0),["tox-swatch--remove"],!1),innerHtml:n}:{attributes:D(D({},s.attributes),{"data-mce-color":u}),styles:{"background-color":u}})};return{dom:c(),optComponents:[]}},PT=function(t){var e=t.map((function(t){return{attributes:{title:OC.translate(t)}}})).getOr({});return D({tag:"div",classes:[WS,qS]},e)},IT=function(t,e,n,r){var o={tag:"div",classes:[YS]},i=function(t){return IC(t,o,e.icons,r)},u=function(){return I.some({dom:o})},a=n?t.iconContent.map(i).orThunk(u):I.none(),c=t.checkMark,s=I.from(t.meta).fold((function(){return OT}),(function(t){return Et(t,"style")?S(ET,t.style):OT})),f=t.htmlContent.fold((function(){return t.textContent.map(s)}),(function(t){return I.some(TT(t,[JS]))})),l={dom:PT(t.ariaLabel),optComponents:[a,f,t.shortcutContent.map(_T),c,t.caret]};return l},LT=function(t,e,n,r){return void 0===r&&(r=I.none()),"color"===t.presets?MT(t,e,r):IT(t,e,n,r)},FT=function(t,e){return Tt(t,"tooltipWorker").map((function(t){return[fO.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){fO.setComponents(e,[ks({element:ee.fromDom(t)})])}))}})]})).getOr([])},zT=function(t){return dO.DOM.encode(t)},HT=function(t,e){var n=OC.translate(t),r=zT(n);if(e.length>0){var o=new RegExp(lO(e),"gi");return r.replace(o,(function(t){return''+t+""}))}return r},VT=function(t,e,n,r,o,i,u,a){void 0===a&&(a=!0);var c=LT({presets:r,textContent:I.none(),htmlContent:n?t.text.map((function(t){return HT(t,e)})):I.none(),ariaLabel:t.text,iconContent:t.icon,shortcutContent:I.none(),checkMark:I.none(),caret:I.none(),value:t.value},u.providers,a,t.icon);return wT({data:xT(t),disabled:t.disabled,getApi:w({}),onAction:function(e){return o(t.value,t.meta)},onSetup:w(h),triggersSubmenu:!1,itemBehaviours:FT(t.meta,u)},c,i,u.providers)},UT=function(t,e){return $(t,(function(t){switch(t.type){case"cardcontainer":return NT(t,UT(t.items,e));case"cardimage":return BT(t.src,t.classes,t.alt);case"cardtext":var n=t.name.exists((function(t){return U(e.cardText.highlightOn,t)})),r=n?I.from(e.cardText.matchText).getOr(""):"";return TT(HT(t.text,r),t.classes)}}))},jT=function(t,e,n,r){var o=function(t){return{isDisabled:function(){return Lv.isDisabled(t)},setDisabled:function(e){Lv.set(t,e),G(Xm(t.element,"*"),(function(n){t.getSystem().getByDom(n).each((function(t){t.hasConfigured(Lv)&&Lv.set(t,e)}))}))}}},i={dom:PT(t.label),optComponents:[I.some({dom:{tag:"div",classes:[nk,ok]},components:UT(t.items,r)})]};return wT({data:xT(D({text:I.none()},t)),disabled:t.disabled,getApi:o,onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:I.from(r.itemBehaviours).getOr([])},i,e,n.providers)},WT=function(t,e,n,r,o,i,u,a){void 0===a&&(a=!0);var c=function(t){return{setActive:function(e){px.set(t,e)},isActive:function(){return px.isOn(t)},isDisabled:function(){return Lv.isDisabled(t)},setDisabled:function(e){return Lv.set(t,e)}}},s=LT({presets:n,textContent:e?t.text:I.none(),htmlContent:I.none(),ariaLabel:t.text,iconContent:t.icon,shortcutContent:e?t.shortcut:I.none(),checkMark:e?I.some(DT(u.icons)):I.none(),caret:I.none(),value:t.value},u,a);return Co(wT({data:xT(t),disabled:t.disabled,getApi:c,onAction:function(e){return r(t.value)},onSetup:function(t){return t.setActive(o),h},triggersSubmenu:!1,itemBehaviours:[]},s,i,u),{toggling:{toggleClass:KS,toggleOnExecute:!1,selected:t.active}})},qT=Vh(_x(),Dx()),$T=function(t){return{value:t}},GT=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,KT=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,XT=function(t){return GT.test(t)||KT.test(t)},YT=function(t){return Ht(t,"#").toUpperCase()},JT=function(t){return XT(t)?I.some({value:YT(t)}):I.none()},QT=function(t){var e=t.value.replace(GT,(function(t,e,n,r){return e+e+n+n+r+r}));return{value:e}},ZT=function(t){var e=QT(t),n=KT.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 $T(e)},nE=Math.min,rE=Math.max,oE=Math.round,iE=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)/,uE=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d?(?:\.\d+)?)\)/,aE=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,u=t.value/100;if(i=rE(0,nE(i,1)),u=rE(0,nE(u,1)),0===i)return e=n=r=oE(255*u),aE(e,n,r,1);var a=o/60,c=u*i,s=c*(1-Math.abs(a%2-1)),f=u-c;switch(Math.floor(a)){case 0:e=c,n=s,r=0;break;case 1:e=s,n=c,r=0;break;case 2:e=0,n=c,r=s;break;case 3:e=0,n=s,r=c;break;case 4:e=s,n=0,r=c;break;case 5:e=c,n=0,r=s;break;default:e=n=r=0}return e=oE(255*(e+f)),n=oE(255*(n+f)),r=oE(255*(r+f)),aE(e,n,r,1)},fE=function(t){var e=ZT(t),n=parseInt(e[1],16),r=parseInt(e[2],16),o=parseInt(e[3],16);return aE(n,r,o,1)},lE=function(t,e,n,r){var o=parseInt(t,10),i=parseInt(e,10),u=parseInt(n,10),a=parseFloat(r);return aE(o,i,u,a)},dE=function(t){if("transparent"===t)return I.some(aE(0,0,0,0));var e=iE.exec(t);if(null!==e)return I.some(lE(e[1],e[2],e[3],"1"));var n=uE.exec(t);return null!==n?I.some(lE(n[1],n[2],n[3],n[4])):I.none()},mE=function(t){return"rgba("+t.red+","+t.green+","+t.blue+","+t.alpha+")"},gE=aE(255,0,0,1),pE=function(t){return t.fire("SkinLoaded")},hE=function(t,e){return t.fire("SkinLoadError",e)},vE=function(t){return t.fire("ResizeEditor")},bE=function(t,e){return t.fire("ResizeContent",e)},yE=function(t,e){return t.fire("ScrollContent",e)},wE=function(t,e){return t.fire("TextColorChange",e)},xE=function(t,e,n){return{hue:t,saturation:e,value:n}},CE=function(t){var e=0,n=0,r=0,o=t.red/255,i=t.green/255,u=t.blue/255,a=Math.min(o,Math.min(i,u)),c=Math.max(o,Math.max(i,u));if(a===c)return r=a,xE(0,0,100*r);var s=o===a?i-u:u===a?o-i:u-o;return e=o===a?3:u===a?1:5,e=60*(e-s/(c-a)),n=(c-a)/c,r=c,xE(Math.round(e),Math.round(100*n),Math.round(100*r))},SE=function(t){return CE(fE(t))},kE=function(t){return eE(sE(t))},OE=function(t){return JT(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],u=r[2],a=r[3];return eE(aE(o,i,u,a))}))},TE=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),EE="tinymce-custom-colors";function _E(t){void 0===t&&(t=10);var e=TE.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),u=function(e){V(o,e).each(a),o.unshift(e),o.length>t&&o.pop(),TE.setItem(EE,JSON.stringify(o))},a=function(t){o.splice(t,1)},c=function(){return o.slice(0)};return{add:u,state:c}}var DE,AE="choiceitem",RE=[{type:AE,text:"Light Green",value:"#BFEDD2"},{type:AE,text:"Light Yellow",value:"#FBEEB8"},{type:AE,text:"Light Red",value:"#F8CAC6"},{type:AE,text:"Light Purple",value:"#ECCAFA"},{type:AE,text:"Light Blue",value:"#C2E0F4"},{type:AE,text:"Green",value:"#2DC26B"},{type:AE,text:"Yellow",value:"#F1C40F"},{type:AE,text:"Red",value:"#E03E2D"},{type:AE,text:"Purple",value:"#B96AD9"},{type:AE,text:"Blue",value:"#3598DB"},{type:AE,text:"Dark Turquoise",value:"#169179"},{type:AE,text:"Orange",value:"#E67E23"},{type:AE,text:"Dark Red",value:"#BA372A"},{type:AE,text:"Dark Purple",value:"#843FA1"},{type:AE,text:"Dark Blue",value:"#236FA1"},{type:AE,text:"Light Gray",value:"#ECF0F1"},{type:AE,text:"Medium Gray",value:"#CED4D9"},{type:AE,text:"Gray",value:"#95A5A6"},{type:AE,text:"Dark Gray",value:"#7E8C8D"},{type:AE,text:"Navy Blue",value:"#34495E"},{type:AE,text:"Black",value:"#000000"},{type:AE,text:"White",value:"#ffffff"}],NE=_E(10),BE=function(t){for(var e=[],n=0;n0?d(n,r,e,o):r.text.length-n.matchLength>=10?c():a()}}))}))}))},p=WC((function(t){27!==t.which&&g()}),50),h={onKeypress:p,cancelIfNecessary:c,isMenuOpen:i,isActive:u,isProcessingAction:r.get,getView:function(){return eC.getContent(o)}};!1===t.hasPlugin("rtc")&&iS.setup(h,t)},P_={register:M_},I_=function(t,e,n){return zs(t,e,n).isSome()},L_=function(t,e){var n=null,r=function(){for(var r=[],o=0;oF_||r>F_},U_=function(t){var e=od(),n=ou(!1),r=L_((function(e){t.triggerEvent(oa(),e),n.set(!0)}),z_),o=function(t){return H_(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)})),I.none()},i=function(t){return r.cancel(),H_(t).each((function(t){e.on((function(n){V_(t,n)&&e.clear()}))})),I.none()},u=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(ra(),o)}))},a=gu([{key:Du(),value:o},{key:Au(),value:i},{key:Ru(),value:u}]),c=function(t,e){return Tt(a,e).bind((function(e){return e(t)}))};return{fireIfReady:c}},j_=function(t){var e=t.raw;return e.which===ob[0]&&!U(["input","textarea"],ae(t.target))&&!I_(t.target,'[contenteditable="true"]')},W_=function(){return en().browser.isFirefox()},q_=function(t,e){return W_()?ad(t,"focus",e):ud(t,"focusin",e)},$_=function(t,e){return W_()?ad(t,"blur",e):ud(t,"focusout",e)},G_=function(t,e){var n=D({stopBackspace:!0},e),r=["touchstart","touchmove","touchend","touchcancel","gesturestart","mousedown","mouseup","mouseover","mousemove","mouseout","click"],o=U_(n),i=$(r.concat(["selectstart","input","contextmenu","change","transitionend","transitioncancel","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","keyup"]),(function(e){return ud(t,e,(function(t){o.fireIfReady(t,e).each((function(e){e&&t.kill()}));var r=n.triggerEvent(e,t);r&&t.kill()}))})),u=od(),a=ud(t,"paste",(function(t){o.fireIfReady(t,"paste").each((function(e){e&&t.kill()}));var e=n.triggerEvent("paste",t);e&&t.kill(),u.set(setTimeout((function(){n.triggerEvent(Zu(),t)}),0))})),c=ud(t,"keydown",(function(t){var e=n.triggerEvent("keydown",t);e?t.kill():n.stopBackspace&&j_(t)&&t.prevent()})),s=q_(t,(function(t){var e=n.triggerEvent("focusin",t);e&&t.kill()})),f=od(),l=$_(t,(function(t){var e=n.triggerEvent("focusout",t);e&&t.kill(),f.set(setTimeout((function(){n.triggerEvent(Qu(),t)}),0))})),d=function(){G(i,(function(t){t.unbind()})),c.unbind(),s.unbind(),l.unbind(),a.unbind(),u.on(clearTimeout),f.on(clearTimeout)};return{unbind:d}},K_=function(t,e){var n=Tt(t,"target").getOr(e);return ou(n)},X_=function(t,e){var n=ou(!1),r=ou(!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}},Y_=function(t){var e=ou(!1),n=function(){e.set(!0)};return{stop:n,cut:h,isStopped:e.get,isCut:T,event:t,setSource:O("Cannot set source of a broadcasted event"),getSource:O("Cannot get source of a broadcasted event")}},J_=uu.generate([{stopped:[]},{resume:["element"]},{complete:[]}]),Q_=function(t,e,n,r,o,i){var u=t(e,r),a=X_(n,o);return u.fold((function(){return i.logEventNoHandlers(e,r),J_.complete()}),(function(t){var n=t.descHandler,r=Lc(n);return r(a),a.isStopped()?(i.logEventStopped(e,t.element,n.purpose),J_.stopped()):a.isCut()?(i.logEventCut(e,t.element,n.purpose),J_.complete()):vn(t.element).fold((function(){return i.logNoParent(e,t.element,n.purpose),J_.complete()}),(function(r){return i.logEventResponse(e,t.element,n.purpose),J_.resume(r)}))}))},Z_=function(t,e,n,r,o,i){return Q_(t,e,n,r,o,i).fold(E,(function(r){return Z_(t,e,n,r,o,i)}),T)},tD=function(t,e,n,r,o){var i=K_(n,r);return Q_(t,e,n,r,i,o)},eD=function(t,e,n){var r=Y_(e);return G(t,(function(t){var e=t.descHandler,n=Lc(e);n(r)})),r.isStopped()},nD=function(t,e,n,r){return rD(t,e,n,n.target,r)},rD=function(t,e,n,r,o){var i=K_(n,r);return Z_(t,e,n,r,i,o)},oD=function(t,e){return{element:t,descHandler:e}},iD=function(t,e){return{id:t,descHandler:e}},uD=function(){var t={},e=function(e,n,r){vt(r,(function(r,o){var i=void 0!==t[o]?t[o]:{};i[n]=Ic(r,e),t[o]=i}))},n=function(t,e){return lc(e).bind((function(e){return Tt(t,e)})).map((function(t){return oD(e,t)}))},r=function(e){return Tt(t,e).map((function(t){return St(t,(function(t,e){return iD(e,t)}))})).getOr([])},o=function(e,r,o){return Tt(t,r).bind((function(t){return wu(o,(function(e){return n(t,e)}),e)}))},i=function(e){vt(t,(function(t,n){Et(t,e)&&delete t[e]}))};return{registerId:e,unregisterId:i,filterByType:r,find:o}},aD=function(){var t=uD(),e={},n=function(t){var e=t.element;return lc(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: '+Za(r.element)+"\nCannot use it for: "+Za(t.element)+"\nThe conflicting element is"+(In(r.element)?" ":" not ")+"already in the DOM");i(t)},o=function(o){var i=n(o);_t(e,i)&&r(o,i);var u=[o];t.registerId(u,i,o.events),e[i]=o},i=function(n){lc(n.element).each((function(n){delete e[n],t.unregisterId(n)}))},u=function(e){return t.filterByType(e)},a=function(e,n,r){return t.find(e,n,r)},c=function(t){return Tt(e,t)};return{find:a,filter:u,register:o,unregister:i,getById:c}},cD=function(t){var e=t.dom,n=e.attributes,r=A(e,["attributes"]);return{uid:t.uid,dom:D({tag:"div",attributes:D({role:"presentation"},n)},r),components:t.components,behaviours:nh(t.containerBehaviours),events:t.events,domModification:t.domModification,eventOrder:t.eventOrder}},sD=dv({name:"Container",factory:cD,configFields:[Ki("components",[]),eh("containerBehaviours",[]),Ki("events",{}),Ki("domModification",{}),Ki("eventOrder",{})]}),fD=function(t){var e=function(e){return vn(t.element).fold(E,(function(t){return sn(e,t)}))},n=aD(),r=function(t,r){return n.find(e,t,r)},o=G_(t.element,{triggerEvent:function(t,e){return Js(t,e.target,(function(n){return nD(r,t,e,n)}))}}),i={debugInfo:w("real"),triggerEvent:function(t,e,n){Js(t,e,(function(o){return rD(r,t,n,e,o)}))},triggerFocus:function(t,e){lc(t).fold((function(){Sl(t)}),(function(n){Js(Ju(),t,(function(n){return tD(r,Ju(),{originator:e,kill:h,prevent:h,target:t},t,n),!1}))}))},triggerEscape:function(t,e){i.triggerEvent("keydown",t.element,e.event)},getByUid:function(t){return p(t)},getByDom:function(t){return v(t)},build:Es,addToGui:function(t){c(t)},removeFromGui:function(t){s(t)},addToWorld:function(t){u(t)},removeFromWorld:function(t){a(t)},broadcast:function(t){d(t)},broadcastOn:function(t,e){m(t,e)},broadcastEvent:function(t,e){g(t,e)},isConnected:E},u=function(t){t.connect(i),le(t.element)||(n.register(t),G(t.components(),u),i.triggerEvent(aa(),t.element,{target:t.element}))},a=function(t){le(t.element)||(G(t.components(),a),n.unregister(t)),t.disconnect()},c=function(e){Wg(t,e)},s=function(t){Gg(t)},f=function(){o.unbind(),Pr(t.element)},l=function(t){var e=n.filter(ta());G(e,(function(e){var n=e.descHandler,r=Lc(n);r(t)}))},d=function(t){l({universal:!0,data:t})},m=function(t,e){l({universal:!1,channels:t,data:e})},g=function(t,e){var r=n.filter(t);return eD(r,e)},p=function(t){return n.getById(t).fold((function(){return ro.error(new Error('Could not find component with uid: "'+t+'" in system.'))}),ro.value)},v=function(t){var e=lc(t).getOr("not found");return p(e)};return u(t),{root:t,element:t.element,destroy:f,add:c,remove:s,getByUid:p,getByDom:v,addToWorld:u,removeFromWorld:a,broadcast:d,broadcastOn:m,broadcastEvent:g}},lD=function(t,e){return{dom:{tag:"div",classes:["tox-bar","tox-form__controls-h-stack"]},components:$(t.items,e.interpreter)}},dD=w([Ki("prefix","form-field"),eh("fieldBehaviours",[bv,th])]),mD=w([Ph({schema:[Di("dom")],name:"label"}),Ph({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:t.text}}}},schema:[Di("text")],name:"aria-descriptor"}),Bh({factory:{sketch:function(t){var e=du(t,["factory"]);return t.factory.sketch(e)}},schema:[Di("factory")],name:"field"})]),gD=function(t,e,n,r){var o=rh(t.fieldBehaviours,[bv.config({find:function(e){return Kh(e,t,"field")}}),th.config({store:{mode:"manual",getValue:function(t){return bv.getCurrent(t).bind(th.getValue)},setValue:function(t,e){bv.getCurrent(t).each((function(t){th.setValue(t,e)}))}}})]),i=_a([Ua((function(e,n){var r=Yh(e,t,["label","field","aria-descriptor"]);r.field().each((function(e){var n=oc(t.prefix);r.label().each((function(t){Hn(t.element,"for",n),Hn(e.element,"id",n)})),r["aria-descriptor"]().each((function(n){var r=oc(t.prefix);Hn(n.element,"id",r),Hn(e.element,"aria-describedby",r)}))}))}))]),u={getField:function(e){return Kh(e,t,"field")},getLabel:function(e){return Kh(e,t,"label")}};return{uid:t.uid,dom:t.dom,components:e,behaviours:o,events:i,apis:u}},pD=mv({name:"FormField",configFields:dD(),partFields:mD(),factory:gD,apis:{getField:function(t,e){return t.getField(e)},getLabel:function(t,e){return t.getLabel(e)}}}),hD=function(t,e){return Ac({attributes:gu([{key:e.tabAttr,value:"true"}])})},vD=Object.freeze({__proto__:null,exhibit:hD}),bD=[Ki("tabAttr","data-alloy-tabstop")],yD=pl({fields:bD,name:"tabstopping",active:vD}),wD=tinymce.util.Tools.resolve("tinymce.html.Entities"),xD=function(t,e,n,r){var o=SD(t,e,n,r);return pD.sketch(o)},CD=function(t,e){return xD(t,e,[],[])},SD=function(t,e,n,r){return{dom:OD(n),components:t.toArray().concat([e]),fieldBehaviours:ml(r)}},kD=function(){return OD([])},OD=function(t){return{tag:"div",classes:["tox-form__group"].concat(t)}},TD=function(t,e){return pD.parts.label({dom:{tag:"label",classes:["tox-label"],innerHtml:e.translate(t)}})},ED=oc("form-component-change"),_D=oc("form-close"),DD=oc("form-cancel"),AD=oc("form-action"),RD=oc("form-submit"),ND=oc("form-block"),BD=oc("form-unblock"),MD=oc("form-tabchange"),PD=oc("form-resize"),ID=function(t,e){var n,r=t.label.map((function(t){return TD(t,e)})),o=function(t){return function(e,n){zs(n.event.target,"[data-collection-item-value]").each((function(r){t(e,n,r,Un(r,"data-collection-item-value"))}))}},i=function(n,r){var o=$(r,(function(n){var r=OC.translate(n.text),o=1===t.columns?'
'+r+"
":"",i='
'+n.icon+"
",u={_:" "," - ":" ","-":" "},a=r.replace(/\_| \- |\-/g,(function(t){return u[t]})),c=e.isDisabled()?" tox-collection__item--state-disabled":"";return'
'+i+o+"
"})),i="auto"!==t.columns&&t.columns>1?q(o,t.columns):[o],u=$(i,(function(t){return'
'+t.join("")+"
"}));Ka(n.element,u.join(""))},u=o((function(n,r,o,i){r.stop(),e.isDisabled()||Sa(n,AD,{name:t.name,value:i})})),a=[Na(Lu(),o((function(t,e,n){Sl(n)}))),Na(Wu(),u),Na(ra(),u),Na(Fu(),o((function(t,e,n){Fs(t.element,"."+ek).each((function(t){as(t,ek)})),is(n,ek)}))),Na(zu(),o((function(t){Fs(t.element,"."+ek).each((function(t){as(t,ek)}))}))),qa(o((function(e,n,r,o){Sa(e,AD,{name:t.name,value:o})})))],c=function(t,e){return $(Xm(t.element,".tox-collection__item"),e)},s=pD.parts.field({dom:{tag:"div",classes:["tox-collection"].concat(1!==t.columns?["tox-collection--grid"]:["tox-collection--list"])},components:[],factory:{sketch:x},behaviours:ml([Lv.config({disabled:e.isDisabled,onDisabled:function(t){c(t,(function(t){is(t,"tox-collection__item--state-disabled"),Hn(t,"aria-disabled",!0)}))},onEnabled:function(t){c(t,(function(t){as(t,"tox-collection__item--state-disabled"),qn(t,"aria-disabled")}))}}),cT(),zw.config({}),th.config({store:{mode:"memory",initialValue:[]},onSetValue:function(e,n){i(e,n),"auto"===t.columns&&Xk(e,5,"tox-collection__item").each((function(t){var n=t.numRows,r=t.numColumns;Dw.setGridSize(e,n,r)})),Ca(e,PD)}}),yD.config({}),Dw.config(i_(t.columns,"normal")),Vw("collection-events",a)]),eventOrder:(n={},n[ea()]=["disabling","alloy.base.behaviour","collection-events"],n)}),f=["tox-form__group--collection"];return xD(r,s,f,[])},LD=w([Hi("data"),Ki("inputAttributes",{}),Ki("inputStyles",{}),Ki("tag","input"),Ki("inputClasses",[]),cf("onSetValue"),Ki("styles",{}),Ki("eventOrder",{}),eh("inputBehaviours",[th,Yw]),Ki("selectOnFocus",!0)]),FD=function(t){return ml([Yw.config({onFocus:t.selectOnFocus?function(t){var e=t.element,n=ds(e);e.dom.setSelectionRange(0,n.length)}:h})])},zD=function(t){return D(D({},FD(t)),rh(t.inputBehaviours,[th.config({store:D(D({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&&ms(t.element,e)}}),onSetValue:t.onSetValue})]))},HD=function(t){return{tag:t.tag,attributes:D({type:"text"},t.inputAttributes),styles:t.inputStyles,classes:t.inputClasses}},VD=function(t,e){return{uid:t.uid,dom:HD(t),components:[],behaviours:zD(t),eventOrder:t.eventOrder}},UD=dv({name:"Input",configFields:LD(),factory:VD}),jD={},WD={exports:jD};(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=[],l(t,this)}function u(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)}a(e.promise,r)}else(1===t._state?a:c)(e.promise,t._value)}))):t._deferreds.push(e)}function a(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 l(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)},tN=function(t,e,n,r){return t>n?t:td)return p;var h=rN(o,l,d),v=eN(h/m*r+e,g,p);return u&&v>=e&&v<=n?nN(v,e,n,i,a):c?Math.round(v):v},iN=function(t){var e=t.min,n=t.max,r=t.range,o=t.value,i=t.hasMinEdge,u=t.hasMaxEdge,a=t.maxBound,c=t.maxOffset,s=t.centerMinEdge,f=t.centerMaxEdge;return on?u?a:f:(o-e)/r*c},uN="top",aN="right",cN="bottom",sN="left",fN="width",lN="height",dN=function(t){return t.element.dom.getBoundingClientRect()},mN=function(t,e){return t[e]},gN=function(t){var e=dN(t);return mN(e,sN)},pN=function(t){var e=dN(t);return mN(e,aN)},hN=function(t){var e=dN(t);return mN(e,uN)},vN=function(t){var e=dN(t);return mN(e,cN)},bN=function(t){var e=dN(t);return mN(e,fN)},yN=function(t){var e=dN(t);return mN(e,lN)},wN=function(t,e,n){return(t+e)/2-n},xN=function(t,e){var n=dN(t),r=dN(e),o=mN(n,sN),i=mN(n,aN),u=mN(r,sN);return wN(o,i,u)},CN=function(t,e){var n=dN(t),r=dN(e),o=mN(n,uN),i=mN(n,cN),u=mN(r,uN);return wN(o,i,u)},SN=function(t,e){Sa(t,aR(),{value:e})},kN=function(t){return{x:t}},ON=function(t,e,n){var r={min:gR(e),max:bR(e),range:SR(e),value:n,step:ER(e),snap:_R(e),snapStart:DR(e),rounded:AR(e),hasMinEdge:NR(e),hasMaxEdge:BR(e),minBound:gN(t),maxBound:pN(t),screenRange:bN(t)};return oN(r)},TN=function(t,e,n){var r=ON(t,e,n),o=kN(r);return SN(t,o),r},EN=function(t,e){var n=gR(e);SN(t,kN(n))},_N=function(t,e){var n=bR(e);SN(t,kN(n))},DN=function(t,e,n){var r=t>0?tN:ZR,o=r(IR(n).x,gR(n),bR(n),ER(n));return SN(e,kN(o)),I.some(o)},AN=function(t){return function(e,n){return DN(t,e,n).map(E)}},RN=function(t){var e=sR(t);return e.map((function(t){return t.left}))},NN=function(t,e,n,r,o){var i=0,u=bN(t),a=r.bind((function(e){return I.some(xN(e,t))})).getOr(i),c=o.bind((function(e){return I.some(xN(e,t))})).getOr(u),s={min:gR(e),max:bR(e),range:SR(e),value:n,hasMinEdge:NR(e),hasMaxEdge:BR(e),minBound:gN(t),minOffset:i,maxBound:pN(t),maxOffset:u,centerMinEdge:a,centerMaxEdge:c};return iN(s)},BN=function(t,e,n,r,o,i){var u=NN(e,i,n,r,o);return gN(e)-gN(t)+u},MN=function(t,e,n,r){var o=IR(n),i=BN(t,r.getSpectrum(t),o.x,r.getLeftEdge(t),r.getRightEdge(t),n),u=vr(e.element)/2;Kn(e.element,"left",i-u+"px")},PN=AN(-1),IN=AN(1),LN=I.none,FN=I.none,zN={"top-left":I.none(),top:I.none(),"top-right":I.none(),right:I.some(qR),"bottom-right":I.none(),bottom:I.none(),"bottom-left":I.none(),left:I.some(JR)},HN=Object.freeze({__proto__:null,setValueFrom:TN,setToMin:EN,setToMax:_N,findValueOfOffset:ON,getValueFromEvent:RN,findPositionOfValue:BN,setPositionFromValue:MN,onLeft:PN,onRight:IN,onUp:LN,onDown:FN,edgeActions:zN}),VN=function(t,e){Sa(t,aR(),{value:e})},UN=function(t){return{y:t}},jN=function(t,e,n){var r={min:pR(e),max:yR(e),range:kR(e),value:n,step:ER(e),snap:_R(e),snapStart:DR(e),rounded:AR(e),hasMinEdge:MR(e),hasMaxEdge:PR(e),minBound:hN(t),maxBound:vN(t),screenRange:yN(t)};return oN(r)},WN=function(t,e,n){var r=jN(t,e,n),o=UN(r);return VN(t,o),r},qN=function(t,e){var n=pR(e);VN(t,UN(n))},$N=function(t,e){var n=yR(e);VN(t,UN(n))},GN=function(t,e,n){var r=t>0?tN:ZR,o=r(IR(n).y,pR(n),yR(n),ER(n));return VN(e,UN(o)),I.some(o)},KN=function(t){return function(e,n){return GN(t,e,n).map(E)}},XN=function(t){var e=sR(t);return e.map((function(t){return t.top}))},YN=function(t,e,n,r,o){var i=0,u=yN(t),a=r.bind((function(e){return I.some(CN(e,t))})).getOr(i),c=o.bind((function(e){return I.some(CN(e,t))})).getOr(u),s={min:pR(e),max:yR(e),range:kR(e),value:n,hasMinEdge:MR(e),hasMaxEdge:PR(e),minBound:hN(t),minOffset:i,maxBound:vN(t),maxOffset:u,centerMinEdge:a,centerMaxEdge:c};return iN(s)},JN=function(t,e,n,r,o,i){var u=YN(e,i,n,r,o);return hN(e)-hN(t)+u},QN=function(t,e,n,r){var o=IR(n),i=JN(t,r.getSpectrum(t),o.y,r.getTopEdge(t),r.getBottomEdge(t),n),u=ur(e.element)/2;Kn(e.element,"top",i-u+"px")},ZN=I.none,tB=I.none,eB=KN(-1),nB=KN(1),rB={"top-left":I.none(),top:I.some(UR),"top-right":I.none(),right:I.none(),"bottom-right":I.none(),bottom:I.some(KR),"bottom-left":I.none(),left:I.none()},oB=Object.freeze({__proto__:null,setValueFrom:WN,setToMin:qN,setToMax:$N,findValueOfOffset:jN,getValueFromEvent:XN,findPositionOfValue:JN,setPositionFromValue:QN,onLeft:ZN,onRight:tB,onUp:eB,onDown:nB,edgeActions:rB}),iB=function(t,e){Sa(t,aR(),{value:e})},uB=function(t,e){return{x:t,y:e}},aB=function(t,e,n){var r=ON(t,e,n.left),o=jN(t,e,n.top),i=uB(r,o);return iB(t,i),i},cB=function(t,e,n,r){var o=t>0?tN:ZR,i=e?IR(r).x:o(IR(r).x,gR(r),bR(r),ER(r)),u=e?o(IR(r).y,pR(r),yR(r),ER(r)):IR(r).y;return iB(n,uB(i,u)),I.some(i)},sB=function(t,e){return function(n,r){return cB(t,e,n,r).map(E)}},fB=function(t,e){var n=gR(e),r=pR(e);iB(t,uB(n,r))},lB=function(t,e){var n=bR(e),r=yR(e);iB(t,uB(n,r))},dB=function(t){return sR(t)},mB=function(t,e,n,r){var o=IR(n),i=BN(t,r.getSpectrum(t),o.x,r.getLeftEdge(t),r.getRightEdge(t),n),u=JN(t,r.getSpectrum(t),o.y,r.getTopEdge(t),r.getBottomEdge(t),n),a=vr(e.element)/2,c=ur(e.element)/2;Kn(e.element,"left",i-a+"px"),Kn(e.element,"top",u-c+"px")},gB=sB(-1,!1),pB=sB(1,!1),hB=sB(-1,!0),vB=sB(1,!0),bB={"top-left":I.some(VR),top:I.some(jR),"top-right":I.some(WR),right:I.some($R),"bottom-right":I.some(GR),bottom:I.some(XR),"bottom-left":I.some(YR),left:I.some(QR)},yB=Object.freeze({__proto__:null,setValueFrom:aB,setToMin:fB,setToMax:lB,getValueFromEvent:dB,setPositionFromValue:mB,onLeft:gB,onRight:pB,onUp:hB,onDown:vB,edgeActions:bB}),wB=[Ki("stepSize",1),Ki("onChange",h),Ki("onChoose",h),Ki("onInit",h),Ki("onDragStart",h),Ki("onDragEnd",h),Ki("snapToGrid",!1),Ki("rounded",!0),Hi("snapStart"),Ai("model",ki("mode",{x:[Ki("minX",0),Ki("maxX",100),Ei("value",(function(t){return ou(t.mode.minX)})),Di("getInitialValue"),df("manager",HN)],y:[Ki("minY",0),Ki("maxY",100),Ei("value",(function(t){return ou(t.mode.minY)})),Di("getInitialValue"),df("manager",oB)],xy:[Ki("minX",0),Ki("maxX",100),Ki("minY",0),Ki("maxY",100),Ei("value",(function(t){return ou({x:t.mode.minX,y:t.mode.minY})})),Di("getInitialValue"),df("manager",yB)]})),eh("sliderBehaviours",[Dw,th]),Ei("mouseIsDown",(function(){return ou(!1)}))],xB=function(t,e,n,r){var o,i=function(e){return Xh(e,t,"thumb")},u=function(e){return Xh(e,t,"spectrum")},a=function(e){return Kh(e,t,"left-edge")},c=function(e){return Kh(e,t,"right-edge")},s=function(e){return Kh(e,t,"top-edge")},f=function(e){return Kh(e,t,"bottom-edge")},l=t.model,d=l.manager,m=function(e,n){d.setPositionFromValue(e,n,t,{getLeftEdge:a,getRightEdge:c,getTopEdge:s,getBottomEdge:f,getSpectrum:u})},g=function(t,e){l.value.set(e);var n=i(t);m(t,n)},p=function(e,n){g(e,n);var r=i(e);return t.onChange(e,r,n),I.some(!0)},h=function(e){d.setToMin(e,t)},v=function(e){d.setToMax(e,t)},b=function(e){var n=function(){Kh(e,t,"thumb").each((function(n){var r=l.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))},w=function(e,n){n.stop(),t.onDragEnd(e,i(e)),b(e)};return{uid:t.uid,dom:t.dom,components:e,behaviours:rh(t.sliderBehaviours,[Dw.config({mode:"special",focusIn:function(e){return Kh(e,t,"spectrum").map(Dw.focusIn).map(E)}}),th.config({store:{mode:"manual",getValue:function(t){return l.value.get()}}}),yl.config({channels:(o={},o[xp()]={onReceive:b},o)})]),events:_a([Na(aR(),(function(t,e){p(t,e.event.value)})),Ua((function(e,n){var r=l.getInitialValue();l.value.set(r);var o=i(e);m(e,o);var a=u(e);t.onInit(e,o,a,l.value.get())})),Na(Du(),y),Na(Ru(),w),Na(Bu(),y),Na(Iu(),w)]),apis:{resetToMin:h,resetToMax:v,setValue:g,refresh:m},domModification:{styles:{position:"relative"}}}},CB=mv({name:"Slider",configFields:wB,partFields:iR,factory:xB,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)}}}),SB=oc("rgb-hex-update"),kB=oc("slider-update"),OB=oc("palette-update"),TB=function(t,e){var n=CB.parts.spectrum({dom:{tag:"div",classes:[e("hue-slider-spectrum")],attributes:{role:"presentation"}}}),r=CB.parts.thumb({dom:{tag:"div",classes:[e("hue-slider-thumb")],attributes:{role:"presentation"}}});return CB.sketch({dom:{tag:"div",classes:[e("hue-slider")],attributes:{role:"presentation"}},rounded:!1,model:{mode:"y",getInitialValue:w({y:0})},components:[n,r],sliderBehaviours:ml([Yw.config({})]),onChange:function(t,e,n){Sa(t,kB,{value:n})}})},EB="form",_B=[eh("formBehaviours",[th])],DB=function(t){return""},AB=function(t){var e=function(){var t=[],e=function(e,n){return t.push(e),jh(EB,DB(e),n)};return{field:e,record:w(t)}}(),n=t(e),r=e.record(),o=$(r,(function(t){return Bh({name:t,pname:DB(t)})}));return uv(EB,_B,o,NB,n)},RB=function(t,e){return t.fold((function(){return ro.error(e)}),ro.value)},NB=function(t,e){return{uid:t.uid,dom:t.dom,components:e,behaviours:rh(t.formBehaviours,[th.config({store:{mode:"manual",getValue:function(e){var n=Jh(e,t);return bt(n,(function(t,e){return t().bind((function(t){var n=bv.getCurrent(t);return RB(n,new Error("Cannot find a current component to extract the value from for form part '"+e+"': "+Za(t.element)))})).map(th.getValue)}))},setValue:function(e,n){vt(n,(function(n,r){Kh(e,t,r).each((function(t){bv.getCurrent(t).each((function(t){th.setValue(t,n)}))}))}))}}})]),apis:{getField:function(e,n){return Kh(e,t,n).bind(bv.getCurrent)}}}},BB={getField:Sc((function(t,e,n){return t.getField(e,n)})),sketch:AB},MB=oc("valid-input"),PB=oc("invalid-input"),IB=oc("validating-input"),LB="colorcustom.rgb.",FB=function(t,e,n,r){var o=function(n,r){return dA.config({invalidClass:e("invalid"),notify:{onValidate:function(t){Sa(t,IB,{type:n})},onValid:function(t){Sa(t,MB,{type:n,value:th.getValue(t)})},onInvalid:function(t){Sa(t,PB,{type:n,value:th.getValue(t)})}},validator:{validate:function(e){var n=th.getValue(e),o=r(n)?ro.value(!0):ro.error(t("aria.input.invalid"));return tA.pure(o)},validateOnLoad:!1}})},i=function(n,r,i,u,a){var c=t(LB+"range"),s=pD.parts.label({dom:{tag:"label",innerHtml:i,attributes:{"aria-label":u}}}),f=pD.parts.field({data:a,factory:UD,inputAttributes:D({type:"text"},"hex"===r?{"aria-live":"polite"}:{}),inputClasses:[e("textfield")],inputBehaviours:ml([o(r,n),yD.config({})]),onSetValue:function(t){if(dA.isInvalid(t)){var e=dA.run(t);e.get(h)}}}),l=[s,f],d="hex"!==r?[pD.parts["aria-descriptor"]({text:c})]:[],m=l.concat(d);return{dom:{tag:"div",attributes:{role:"presentation"}},components:m}},u=function(t,e){var n=eE(e);return BB.getField(t,"hex").each((function(e){Yw.isFocused(e)||th.setValue(t,{hex:n.value})})),n},a=function(t,e){var n=e.red,r=e.green,o=e.blue;th.setValue(t,{red:n,green:r,blue:o})},c=kC({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)}))},f=function(){var o={red:ou(I.some(255)),green:ou(I.some(255)),blue:ou(I.some(255)),hex:ou(I.some("ffffff"))},f=function(t,e){var n=fE(e);a(t,n),g(n)},l=function(t){return o[t].get()},d=function(t,e){o[t].set(e)},m=function(){return l("red").bind((function(t){return l("green").bind((function(e){return l("blue").map((function(n){return aE(t,e,n,1)}))}))}))},g=function(t){var e=t.red,n=t.green,r=t.blue;d("red",I.some(e)),d("green",I.some(n)),d("blue",I.some(r))},p=function(t,e){var n=e.event;"hex"!==n.type?d(n.type,I.none()):r(t)},h=function(t,e){n(t);var r=$T(e);d("hex",I.some(e));var o=fE(r);a(t,o),g(o),Sa(t,SB,{hex:r}),s(t,r)},v=function(t,e,n){var r=parseInt(n,10);d(e,I.some(r)),m().each((function(e){var n=u(t,e);Sa(t,SB,{hex:n}),s(t,n)}))},b=function(t){return"hex"===t.type},y=function(t,e){var n=e.event;b(n)?h(t,n.value):v(t,n.type,n.value)},w=function(e){return{label:t(LB+e+".label"),description:t(LB+e+".description")}},x=w("red"),C=w("green"),S=w("blue"),k=w("hex");return Co(BB.sketch((function(n){return{dom:{tag:"form",classes:[e("rgb-form")],attributes:{"aria-label":t("aria.color.picker")}},components:[n.field("red",pD.sketch(i(cE,"red",x.label,x.description,255))),n.field("green",pD.sketch(i(cE,"green",C.label,C.description,255))),n.field("blue",pD.sketch(i(cE,"blue",S.label,S.description,255))),n.field("hex",pD.sketch(i(XT,"hex",k.label,k.description,"ffffff"))),c.asSpec()],formBehaviours:ml([dA.config({invalidClass:e("form-invalid")}),Vw("rgb-form-events",[Na(MB,y),Na(PB,p),Na(IB,p)])])}})),{apis:{updateHex:function(t,e){th.setValue(t,{hex:e.value}),f(t,e),s(t,e)}}})},l=dv({factory:f,name:"RgbForm",configFields:[],apis:{updateHex:function(t,e,n){t.updateHex(e,n)}},extraApis:{}});return l},zB=function(t,e){var n=CB.parts.spectrum({dom:{tag:"canvas",attributes:{role:"presentation"},classes:[e("sv-palette-spectrum")]}}),r=CB.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 u=o.createLinearGradient(0,0,0,r);u.addColorStop(0,"rgba(0,0,0,0)"),u.addColorStop(1,"rgba(0,0,0,1)"),o.fillStyle=u,o.fillRect(0,0,n,r)}},i=function(t,e){var n=t.components()[0].element.dom,r=xE(e,100,100),i=sE(r);o(n,mE(i))},u=function(t,e){var n=CE(fE(e));CB.setValue(t,{x:n.saturation,y:100-n.value})},a=function(t){var i=w({x:0,y:0}),u=function(t,e,n){Sa(t,OB,{value:n})},a=function(t,e,n,r){o(n.element.dom,mE(gE))},c=ml([bv.config({find:I.some}),Yw.config({})]);return CB.sketch({dom:{tag:"div",attributes:{role:"presentation"},classes:[e("sv-palette")]},model:{mode:"xy",getInitialValue:i},rounded:!1,components:[n,r],onChange:u,onInit:a,sliderBehaviours:c})},c=dv({factory:a,name:"SaturationBrightnessPalette",configFields:[],apis:{setHue:function(t,e,n){i(e,n)},setThumb:function(t,e,n){u(e,n)}},extraApis:{}});return c},HB=function(t,e){var n=function(n){var r=FB(t,e,n.onValidHex,n.onInvalidHex),o=zB(t,e),i=function(t){return(100-t)/100*360},u=function(t){return 100-t/360*100},a={paletteRgba:ou(gE),paletteHue:ou(0)},c=kC(TB(t,e)),s=kC(o.sketch({})),f=kC(r.sketch({})),l=function(t,e,n){s.getOpt(t).each((function(t){o.setHue(t,n)}))},d=function(t,e){f.getOpt(t).each((function(t){r.updateHex(t,e)}))},m=function(t,e,n){c.getOpt(t).each((function(t){CB.setValue(t,{y:u(n)})}))},g=function(t,e){s.getOpt(t).each((function(t){o.setThumb(t,e)}))},p=function(t,e){var n=fE(t);a.paletteRgba.set(n),a.paletteHue.set(e)},h=function(t,e,n,r){p(e,n),G(r,(function(r){r(t,e,n)}))},v=function(){var t=[d];return function(e,n){var r=n.event.value,o=a.paletteHue.get(),i=xE(o,r.x,100-r.y),u=kE(i);h(e,u,o,t)}},b=function(){var t=[l,d];return function(e,n){var r=i(n.event.value.y),o=a.paletteRgba.get(),u=CE(o),c=xE(r,u.saturation,u.value),s=kE(c);h(e,s,r,t)}},y=function(){var t=[l,m,g];return function(e,n){var r=n.event.hex,o=SE(r);h(e,r,o.hue,t)}};return{uid:n.uid,dom:n.dom,components:[s.asSpec(),c.asSpec(),f.asSpec()],behaviours:ml([Vw("colour-picker-events",[Na(SB,y()),Na(OB,v()),Na(kB,b())]),bv.config({find:function(t){return f.getOpt(t)}}),Dw.config({mode:"acyclic"})])}},r=dv({name:"ColourPicker",configFields:[Di("dom"),Ki("onValidHex",h),Ki("onInvalidHex",h)],factory:n});return r},VB=function(){return bv.config({find:I.some})},UB=function(t){return bv.config({find:t.getOpt})},jB=function(t){return bv.config({find:function(e){return Cn(e.element,t).bind((function(t){return e.getSystem().getByDom(t).toOptional()}))}})},WB={self:VB,memento:UB,childAt:jB},qB={"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"},$B=function(t){return qB[t]},GB=function(t){return $B(t)},KB=function(t){var e=function(t){return"tox-"+t},n=HB(GB,e),r=function(t){Sa(t,AD,{name:"hex-valid",value:!0})},o=function(t){Sa(t,AD,{name:"hex-valid",value:!1})},i=kC(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:ml([th.config({store:{mode:"manual",getValue:function(t){var e=i.get(t),n=bv.getCurrent(e),r=n.bind((function(t){var e=th.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),u=bv.getCurrent(o);u.fold((function(){}),(function(t){th.setValue(t,{hex:I.from(r[1]).getOr("")}),BB.getField(t,"hex").each((function(t){Ca(t,Uu())}))}))}}}),WB.self()])}},XB=tinymce.util.Tools.resolve("tinymce.Resource"),YB=function(t){return Et(t,"init")},JB=function(t){var e=od(),n=kC({dom:{tag:t.tag}}),r=od();return{dom:{tag:"div",classes:["tox-custom-editor"]},behaviours:ml([Vw("custom-editor-events",[Ua((function(o){n.getOpt(o).each((function(n){(YB(t)?t.init(n.element.dom):XB.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)}))}))}))]),th.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)}))}}}),WB.self()]),components:[n.asSpec()]}},QB=tinymce.util.Tools.resolve("tinymce.util.Tools"),ZB=ti([Ki("preprocess",x),Ki("postprocess",x)]),tM=function(t,e){var n=Ci("RepresentingConfigs.memento processors",ZB,e);return th.config({store:{mode:"manual",getValue:function(e){var r=t.get(e),o=th.getValue(r);return n.postprocess(o)},setValue:function(e,r){var o=n.preprocess(r),i=t.get(e);th.setValue(i,o)}}})},eM=function(t,e,n){return th.config(Co({store:{mode:"manual",getValue:e,setValue:n}},t.map((function(t){return{store:{initialValue:t}}})).getOr({})))},nM=function(t,e,n){return eM(t,(function(t){return e(t.element)}),(function(t,e){return n(t.element,e)}))},rM=function(t){return nM(t,ds,ms)},oM=function(t){return nM(t,Ga,Ka)},iM=function(t){return th.config({store:{mode:"memory",initialValue:t}})},uM={memento:tM,withElement:nM,withComp:eM,domValue:rM,domHtml:oM,memory:iM},aM="jpeg,jpg,jpe,jfi,jif,jfif,png,gif,bmp,webp",cM=function(t,e){var n=QB.explode(e.getSetting("images_file_types",aM,"string")),r=function(t){return j(n,(function(e){return Wt(t.name.toLowerCase(),"."+e.toLowerCase())}))};return Y(mt(t),r)},sM=function(t,e){var n=function(t,e){e.stop()},r=function(t){return function(e,n){G(t,(function(t){t(e,n)}))}},o=function(t,e){if(!Lv.isDisabled(t)){var n=e.event.raw;u(t,n.dataTransfer.files)}},i=function(t,e){var n=e.event.raw.target;u(t,n.files)},u=function(n,r){th.setValue(n,cM(r,e)),Sa(n,ED,{name:t.name})},a=kC({dom:{tag:"input",attributes:{type:"file",accept:"image/*"},styles:{display:"none"}},behaviours:ml([Vw("input-file-events",[za(Wu()),za(ra())])])}),c=function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-dropzone-container"]},behaviours:ml([uM.memory([]),WB.self(),Lv.config({}),px.config({toggleClass:"dragenter",toggleOnExecute:!1}),Vw("dropzone-events",[Na("dragenter",r([n,px.toggle])),Na("dragleave",r([n,px.toggle])),Na("dragover",n),Na("drop",r([n,o])),Na(ju(),i)])]),components:[{dom:{tag:"div",classes:["tox-dropzone"],styles:{}},components:[{dom:{tag:"p",innerHtml:e.translate("Drop an image here")}},SC.sketch({dom:{tag:"button",innerHtml:e.translate("Browse for an image"),styles:{position:"relative"},classes:["tox-button","tox-button--secondary"]},components:[a.asSpec()],action:function(t){var e=a.get(t);e.element.dom.click()},buttonBehaviours:ml([yD.config({}),mT.button(e.isDisabled),cT()])})]}]}},s=t.label.map((function(t){return TD(t,e)})),f=pD.parts.field({factory:{sketch:c}});return xD(s,f,["tox-form__group--stretched"],[])},fM=function(t,e){return{dom:{tag:"div",classes:["tox-form__grid","tox-form__grid--"+t.columns+"col"]},components:$(t.items,e.interpreter)}},lM=oc("alloy-fake-before-tabstop"),dM=oc("alloy-fake-after-tabstop"),mM=function(t){return{dom:{tag:"div",styles:{width:"1px",height:"1px",outline:"none"},attributes:{tabindex:"0"},classes:t},behaviours:ml([Yw.config({ignore:!0}),yD.config({})])}},gM=function(t){return{dom:{tag:"div",classes:["tox-navobj"]},components:[mM([lM]),t,mM([dM])],behaviours:ml([WB.childAt(1)])}},pM=function(t,e){Sa(t,Hu(),{raw:{which:9,shiftKey:e}})},hM=function(t,e){var n=e.element;cs(n,lM)?pM(t,!0):cs(n,dM)&&pM(t,!1)},vM=function(t){return I_(t,["."+lM,"."+dM].join(","),T)},bM=!(en().browser.isIE()||en().browser.isEdge()),yM=function(t){var e=ou("");return{getValue:function(t){return e.get()},setValue:function(n,r){if(t)Hn(n.element,"srcdoc",r);else{Hn(n.element,"src","javascript:''");var o=n.element.dom.contentWindow.document;o.open(),o.write(r),o.close()}e.set(r)}}},wM=function(t,e){var n=bM&&t.sandboxed,r=D(D({},t.label.map((function(t){return{title:t}})).getOr({})),n?{sandbox:"allow-scripts allow-same-origin"}:{}),o=yM(n),i=t.label.map((function(t){return TD(t,e)})),u=function(t){return gM({uid:t.uid,dom:{tag:"iframe",attributes:r},behaviours:ml([yD.config({}),Yw.config({}),uM.withComp(I.none(),o.getValue,o.setValue)])})},a=pD.parts.field({factory:{sketch:u}});return xD(i,a,["tox-form__group--stretched"],[])},xM=function(t,e){return kM(document.createElement("canvas"),t,e)},CM=function(t){var e=xM(t.width,t.height),n=SM(e);return n.drawImage(t,0,0),e},SM=function(t){return t.getContext("2d")},kM=function(t,e,n){return t.width=e,t.height=n,t},OM=function(t){return t.naturalWidth||t.width},TM=function(t){return t.naturalHeight||t.height},EM=function(t){return new $D((function(e,n){var r=URL.createObjectURL(t),o=new Image,i=function(){o.removeEventListener("load",u),o.removeEventListener("error",a)},u=function(){i(),e(o)},a=function(){i(),n("Unable to load data of type "+t.type+": "+r)};o.addEventListener("load",u),o.addEventListener("error",a),o.src=r,o.complete&&setTimeout(u,0)}))},_M=function(t){var e=t.split(","),n=/data:([^;]+)/.exec(e[0]);if(!n)return I.none();for(var r=n[1],o=e[1],i=1024,u=atob(o),a=u.length,c=Math.ceil(a/i),s=new Array(c),f=0;fn?r=n:rn?t=n:t2)&&(i=i<.5?.5:2,a=!0),(u<.5||u>2)&&(u=u<.5?.5:2,a=!0);var c=aP(t,i,u);return a?c.then((function(t){return uP(t,e,n)})):c},aP=function(t,e,n){return new $D((function(r){var o=OM(t),i=TM(t),u=Math.floor(o*e),a=Math.floor(i*n),c=xM(u,a),s=SM(c);s.drawImage(t,0,0,o,i,0,0,u,a),r(c)}))},cP=function(t,e){void 0===e&&(e=2);var n=Math.pow(10,e),r=Math.round(t*n);return Math.ceil(r/n)},sP=function(t,e){return t.toCanvas().then((function(n){return fP(n,t.getType(),e)}))},fP=function(t,e,n){var r=n<0?360+n:n,o=r*Math.PI/180,i=t.width,u=t.height,a=Math.sin(o),c=Math.cos(o),s=cP(Math.abs(i*c)+Math.abs(u*a)),f=cP(Math.abs(i*a)+Math.abs(u*c)),l=xM(s,f),d=SM(l);return d.translate(s/2,f/2),d.rotate(o),d.drawImage(t,-i/2,-u/2),LM(l,e)},lP=function(t,e){return t.toCanvas().then((function(n){return dP(n,t.getType(),e)}))},dP=function(t,e,n){var r=xM(t.width,t.height),o=SM(r);return"v"===n?(o.scale(1,-1),o.drawImage(t,0,-r.height)):(o.scale(-1,1),o.drawImage(t,-r.width,0)),LM(r,e)},mP=function(t,e,n,r,o){return t.toCanvas().then((function(i){return gP(i,t.getType(),e,n,r,o)}))},gP=function(t,e,n,r,o,i){var u=xM(o,i),a=SM(u);return a.drawImage(t,-n,-r),LM(u,e)},pP=function(t,e,n){return t.toCanvas().then((function(r){return uP(r,e,n).then((function(e){return LM(e,t.getType())}))}))},hP=function(t){return tP(t)},vP=function(t){return oP(t)},bP=function(t,e){return iP(t,e)},yP=function(t,e,n,r){return rP(t,e,n,r)},wP=function(t,e){return eP(t,e)},xP=function(t,e){return nP(t,e)},CP=function(t,e){return lP(t,e)},SP=function(t,e,n,r,o){return mP(t,e,n,r,o)},kP=function(t,e,n){return pP(t,e,n)},OP=function(t,e){return sP(t,e)},TP=function(t,e,n){return IC(t,{tag:"span",classes:["tox-icon","tox-tbtn__icon-wrap"],behaviours:n},e)},EP=function(t,e){return TP(t,e,[])},_P=function(t,e){return TP(t,e,[zw.config({})])},DP=function(t,e,n){return{dom:{tag:"span",innerHtml:n.translate(t),classes:[e+"__select-label"]},behaviours:ml([zw.config({})])}},AP=oc("toolbar.button.execute"),RP=function(t){return qa((function(e,n){gT(t,e)((function(n){Sa(e,AP,{buttonApi:n}),t.onAction(n)}))}))},NP=(xA={},xA[ea()]=["disabling","alloy.base.behaviour","toggling","toolbar-button-events"],xA),BP=oc("update-menu-text"),MP=oc("update-menu-icon"),PP=function(t,e,n){var r=ou(h),o=t.text.map((function(t){return kC(DP(t,e,n.providers))})),i=t.icon.map((function(t){return kC(_P(t,n.providers.icons))})),u=function(t,e){var n=th.getValue(t);return Yw.focus(n),Sa(n,"keydown",{raw:e.event.raw}),LA.close(n),I.some(!0)},a=t.role.fold((function(){return{}}),(function(t){return{role:t}})),c=t.tooltip.fold((function(){return{}}),(function(t){var e=n.providers.translate(t);return{title:e,"aria-label":e}})),s=IC("chevron-down",{tag:"div",classes:[e+"__select-chevron"]},n.providers.icons),f=kC(LA.sketch(D(D(D({},t.uid?{uid:t.uid}:{}),a),{dom:{tag:"button",classes:[e,e+"--select"].concat($(t.classes,(function(t){return e+"--"+t}))),attributes:D({},c)},components:yT([i.map((function(t){return t.asSpec()})),o.map((function(t){return t.asSpec()})),I.some(s)]),matchWidth:!0,useMinWidth:!0,dropdownBehaviours:ml(R(R([],t.dropdownBehaviours,!0),[mT.button((function(){return t.disabled||n.providers.isDisabled()})),cT(),VA.config({}),zw.config({}),Vw("dropdown-events",[pT(t,r),hT(t,r)]),Vw("menubutton-update-display-text",[Na(BP,(function(t,e){o.bind((function(e){return e.getOpt(t)})).each((function(t){zw.set(t,[Ss(n.providers.translate(e.event.text))])}))})),Na(MP,(function(t,e){i.bind((function(e){return e.getOpt(t)})).each((function(t){zw.set(t,[_P(e.event.icon,n.providers.icons)])}))}))])],!1)),eventOrder:Co(NP,{mousedown:["focusing","alloy.base.behaviour","item-type-events","normal-dropdown-events"]}),sandboxBehaviours:ml([Dw.config({mode:"special",onLeft:u,onRight:u})]),lazySink:n.getSink,toggleClass:e+"--active",parts:{menu:hk(!1,t.columns,t.presets)},fetch:function(e){return tA.nu(S(t.fetch,e))}})));return f.asSpec()},IP=function(t){return i(t)},LP=function(t){return"separator"===t.type},FP=function(t){return Et(t,"getSubmenuItems")},zP={type:"separator"},HP=function(t,e){var n=Q(t,(function(t,n){return IP(n)?""===n?t:"|"===n?t.length>0&&!LP(t[t.length-1])?t.concat([zP]):t:Et(e,n.toLowerCase())?t.concat([e[n.toLowerCase()]]):t:t.concat([n])}),[]);return n.length>0&&LP(n[n.length-1])&&n.pop(),n},VP=function(t,e){var n=t.getSubmenuItems(),r=WP(n,e),o=Co(r.menus,mu(t.value,r.items)),i=Co(r.expansions,mu(t.value,t.value));return{item:t,menus:o,expansions:i}},UP=function(t,e){return FP(t)?VP(t,e):{item:t,menus:{},expansions:{}}},jP=function(t){if(LP(t))return t;var e=Tt(t,"value").getOrThunk((function(){return oc("generated-menu-item")}));return Co({value:e},t)},WP=function(t,e){var n=HP(i(t)?t.split(" "):t,e);return J(n,(function(t,n){var r=jP(n),o=UP(r,e);return{menus:Co(t.menus,o.menus),items:[o.item].concat(t.items),expansions:Co(t.expansions,o.expansions)}}),{menus:{},expansions:{},items:[]})},qP=function(t,e,n,r){var o=oc("primary-menu"),i=WP(t,n.shared.providers.menuItems());if(0===i.items.length)return I.none();var u=R_(o,i.items,e,n,r),a=bt(i.menus,(function(t,r){return R_(r,t,e,n,!1)})),c=Co(a,mu(o,u));return I.from(Qx.tieredData(o,c,i.expansions))},$P=function(t){return{isDisabled:function(){return Lv.isDisabled(t)},setDisabled:function(e){return Lv.set(t,e)},setActive:function(e){var n=t.element;e?(is(n,"tox-tbtn--enabled"),Hn(n,"aria-pressed",!0)):(as(n,"tox-tbtn--enabled"),qn(n,"aria-pressed"))},isActive:function(){return cs(t.element,"tox-tbtn--enabled")}}},GP=function(t,e,n,r){return PP({text:t.text,icon:t.icon,tooltip:t.tooltip,role:r,fetch:function(e,r){t.fetch((function(t){r(qP(t,jS.CLOSE_ON_EXECUTE,n,!1))}))},onSetup:t.onSetup,getApi:$P,columns:1,presets:"normal",classes:[],dropdownBehaviours:[yD.config({})]},e,n.shared)},KP=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){Sl(e.element),Sa(e,AD,{name:t.name,value:t.storage.get()})}))}))}},o=function(t){return function(e){e.setActive(t.storage.get())}};return function(e){e($(t,(function(t){var e=t.text.fold((function(){return{}}),(function(t){return{text:t}}));return D(D({type:t.type,active:!1},e),{onAction:r(t),onSetup:o(t)})})))}},XP=function(t,e,n,r,o,i){void 0===n&&(n=[]);var u=e.fold((function(){return{}}),(function(t){return{action:t}})),a=D({buttonBehaviours:ml([mT.button((function(){return t.disabled||i.isDisabled()})),cT(),yD.config({}),Vw("button press",[Ra("click"),Ra("mousedown")])].concat(n)),eventOrder:{click:["button press","alloy.base.behaviour"],mousedown:["button press","alloy.base.behaviour"]}},u),c=Co(a,{dom:r});return Co(c,{components:o})},YP=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},u=t.icon.map((function(t){return EP(t,n.icons)})),a=yT([u]);return XP(t,e,r,i,a,n)},JP=function(t,e,n,r){void 0===r&&(r=[]);var o=YP(t,I.some(e),n,r);return SC.sketch(o)},QP=function(t,e,n,r,o){void 0===r&&(r=[]),void 0===o&&(o=[]);var i=n.translate(t.text),u=t.icon?t.icon.map((function(t){return EP(t,n.icons)})):I.none(),a=u.isSome()?yT([u]):[],c=u.isSome()?{}:{innerHtml:i},s=R(R(R(R([],t.primary||t.borderless?["tox-button"]:["tox-button","tox-button--secondary"],!0),u.isSome()?["tox-button--icon"]:[],!0),t.borderless?["tox-button--naked"]:[],!0),o,!0),f=D(D({tag:"button",classes:s},c),{attributes:{title:i}});return XP(t,e,r,f,a,n)},ZP=function(t,e,n,r,o){void 0===r&&(r=[]),void 0===o&&(o=[]);var i=QP(t,I.some(e),n,r,o);return SC.sketch(i)},tI=function(t,e){return function(n){"custom"===e?Sa(n,AD,{name:t,value:{}}):"submit"===e?Ca(n,RD):"cancel"===e&&Ca(n,DD)}},eI=function(t,e){return"menu"===e},nI=function(t,e){return"custom"===e||"cancel"===e||"submit"===e},rI=function(t,e,n){if(eI(t,e)){var r=function(){return u},o=t,i=D(D({},t),{onSetup:function(e){return e.setDisabled(t.disabled),h},fetch:KP(o.items,r,n)}),u=kC(GP(i,"tox-tbtn",n,I.none()));return u.asSpec()}if(nI(t,e)){var a=tI(t.name,e),c=D(D({},t),{borderless:!1});return ZP(c,a,n.shared.providers,[])}},oI=function(t,e){var n=tI(t.name,"custom");return CD(I.none(),pD.parts.field(D({factory:SC},QP(t,I.some(n),e,[uM.memory(""),WB.self()]))))},iI=w([Ki("field1Name","field1"),Ki("field2Name","field2"),ff("onLockedChange"),uf(["lockClass"]),Ki("locked",!1),oh.field("coupledFieldBehaviours",[bv,th])]),uI=function(t,e,n){return Kh(t,e,n).bind(bv.getCurrent)},aI=function(t,e){return Bh({factory:pD,name:t,overrides:function(t){return{fieldBehaviours:ml([Vw("coupled-input-behaviour",[Na(Uu(),(function(n){uI(n,t,e).each((function(e){Kh(n,t,"lock").each((function(r){px.isOn(r)&&t.onLockedChange(n,e,r)}))}))}))])])}}})},cI=w([aI("field1","field2"),aI("field2","field1"),Bh({factory:SC,schema:[Di("dom")],name:"lock",overrides:function(t){return{buttonBehaviours:ml([px.config({selected:t.locked,toggleClass:t.markers.lockClass,aria:{mode:"pressed"}})])}}})]),sI=function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,behaviours:oh.augment(t.coupledFieldBehaviours,[bv.config({find:I.some}),th.config({store:{mode:"manual",getValue:function(e){var n,r=Zh(e,t,["field1","field2"]);return n={},n[t.field1Name]=th.getValue(r.field1()),n[t.field2Name]=th.getValue(r.field2()),n},setValue:function(e,n){var r=Zh(e,t,["field1","field2"]);_t(n,t.field1Name)&&th.setValue(r.field1(),n[t.field1Name]),_t(n,t.field2Name)&&th.setValue(r.field2(),n[t.field2Name])}}})]),apis:{getField1:function(e){return Kh(e,t,"field1")},getField2:function(e){return Kh(e,t,"field2")},getLock:function(e){return Kh(e,t,"lock")}}}},fI=mv({name:"FormCoupledInputs",configFields:iI(),partFields:cI(),factory:sI,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)}}}),lI=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},dI=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)},mI=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?I.some(t.value):r(t.unit)&&r(e)?n[t.unit]===n[e]?I.some(t.value):I.some(t.value/n[t.unit]*n[e]):I.none()},gI=function(t){return I.none()},pI=function(t,e){return function(n){return mI(n,e).map((function(n){return{value:n*t,unit:e}}))}},hI=function(t,e){var n=dI(t).toOptional(),r=dI(e).toOptional();return Bt(n,r,(function(t,e){return mI(t,e.unit).map((function(t){return e.value/t})).map((function(t){return pI(t,e.unit)})).getOr(gI)})).getOr(gI)},vI=function(t,e){var n=gI,r=oc("ratio-event"),o=function(t){return IC(t,{tag:"span",classes:["tox-icon","tox-lock-icon__"+t]},e.icons)},i=fI.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:ml([Lv.config({disabled:function(){return t.disabled||e.isDisabled()}}),cT(),yD.config({})])}),u=function(t){return{dom:{tag:"div",classes:["tox-form__group"]},components:t}},a=function(n){return pD.parts.field({factory:UD,inputClasses:["tox-textfield"],inputBehaviours:ml([Lv.config({disabled:function(){return t.disabled||e.isDisabled()}}),cT(),yD.config({}),Vw("size-input-events",[Na(Fu(),(function(t,e){Sa(t,r,{isField1:n})})),Na(ju(),(function(e,n){Sa(e,ED,{name:t.name})}))])]),selectOnFocus:!1})},c=function(t){return{dom:{tag:"label",classes:["tox-label"],innerHtml:e.translate(t)}}},s=fI.parts.field1(u([pD.parts.label(c("Width")),a(!0)])),f=fI.parts.field2(u([pD.parts.label(c("Height")),a(!1)]));return fI.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:[{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:[s,f,u([c(" "),i])]}],field1Name:"width",field2Name:"height",locked:!0,markers:{lockClass:"tox-locked"},onLockedChange:function(t,e,r){dI(th.getValue(t)).each((function(t){n(t).each((function(t){th.setValue(e,lI(t))}))}))},coupledFieldBehaviours:ml([Lv.config({disabled:function(){return t.disabled||e.isDisabled()},onDisabled:function(t){fI.getField1(t).bind(pD.getField).each(Lv.disable),fI.getField2(t).bind(pD.getField).each(Lv.disable),fI.getLock(t).each(Lv.disable)},onEnabled:function(t){fI.getField1(t).bind(pD.getField).each(Lv.enable),fI.getField2(t).bind(pD.getField).each(Lv.enable),fI.getLock(t).each(Lv.enable)}}),cT(),Vw("size-input-events2",[Na(r,(function(t,e){var r=e.event.isField1,o=r?fI.getField1(t):fI.getField2(t),i=r?fI.getField2(t):fI.getField1(t),u=o.map(th.getValue).getOr(""),a=i.map(th.getValue).getOr("");n=hI(u,a)}))])])})},bI=w(oc("undo")),yI=w(oc("redo")),wI=w(oc("zoom")),xI=w(oc("back")),CI=w(oc("apply")),SI=w(oc("swap")),kI=w(oc("transform")),OI=w(oc("temp-transform")),TI=w(oc("transform-apply")),EI={undo:bI,redo:yI,zoom:wI,back:xI,apply:CI,swap:SI,transform:kI,tempTransform:OI,transformApply:TI},_I=w("save-state"),DI=w("disable"),AI=w("enable"),RI={formActionEvent:AD,saveState:_I,disable:DI,enable:AI},NI=function(t,e){var n=function(t,n,r,o){return kC(ZP({name:t,text:t,disabled:r,primary:o,icon:I.none(),borderless:!1},n,e))},r=function(t,n,r,o){return kC(JP({name:t,icon:I.some(t),tooltip:I.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(Lv)&&Lv.disable(n)}))},i=function(t,e){t.map((function(t){var n=t.get(e);n.hasConfigured(Lv)&&Lv.enable(n)}))},u={tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools-edit-panel"]},a=h,c=function(t,e,n){Sa(t,e,n)},s=function(t){return Ca(t,RI.disable())},f=function(t){return Ca(t,RI.enable())},l=function(t,e){s(t),c(t,EI.transform(),{transform:e}),f(t)},d=function(t,e){s(t),c(t,EI.tempTransform(),{transform:e}),f(t)},m=function(t){return function(){ut.getOpt(t).each((function(t){zw.set(t,[ot])}))}},g=function(t,e){s(t),c(t,EI.transformApply(),{transform:e,swap:m(t)}),f(t)},p=function(){return n("Back",(function(t){return c(t,EI.back(),{swap:m(t)})}),!1,!1)},v=function(){return kC({dom:{tag:"div",classes:["tox-spacer"]},behaviours:ml([Lv.config({})])})},b=function(){return n("Apply",(function(t){return c(t,EI.apply(),{swap:m(t)})}),!0,!0)},y=function(){return function(e){var n=t.getRect();return SP(e,n.x,n.y,n.w,n.h)}},x=[p(),v(),n("Apply",(function(e){var n=y();g(e,n),t.hideCrop()}),!1,!0)],C=sD.sketch({dom:u,components:x.map((function(t){return t.asSpec()})),containerBehaviours:ml([Vw("image-tools-crop-buttons-events",[Na(RI.disable(),(function(t,e){o(x,t)})),Na(RI.enable(),(function(t,e){i(x,t)}))])])}),S=kC(vI({name:"size",label:I.none(),constrain:!0,disabled:!1},e)),k=function(t,e){return function(n){return kP(n,t,e)}},O=[p(),v(),S,v(),n("Apply",(function(t){S.getOpt(t).each((function(e){var n=th.getValue(e),r=parseInt(n.width,10),o=parseInt(n.height,10),i=k(r,o);g(t,i)}))}),!1,!0)],T=sD.sketch({dom:u,components:O.map((function(t){return t.asSpec()})),containerBehaviours:ml([Vw("image-tools-resize-buttons-events",[Na(RI.disable(),(function(t,e){o(O,t)})),Na(RI.enable(),(function(t,e){i(O,t)}))])])}),E=function(t,e){return function(n){return t(n,e)}},_=E(CP,"h"),D=E(CP,"v"),A=E(OP,-90),R=E(OP,90),N=function(t,e){d(t,e)},B=[p(),v(),r("flip-horizontally","Flip horizontally",(function(t){N(t,_)}),!1),r("flip-vertically","Flip vertically",(function(t){N(t,D)}),!1),r("rotate-left","Rotate counterclockwise",(function(t){N(t,A)}),!1),r("rotate-right","Rotate clockwise",(function(t){N(t,R)}),!1),v(),b()],M=sD.sketch({dom:u,components:B.map((function(t){return t.asSpec()})),containerBehaviours:ml([Vw("image-tools-fliprotate-buttons-events",[Na(RI.disable(),(function(t,e){o(B,t)})),Na(RI.enable(),(function(t,e){i(B,t)}))])])}),P=function(t,n,r,o,i){var u=CB.parts.label({dom:{tag:"label",classes:["tox-label"],innerHtml:e.translate(t)}}),a=CB.parts.spectrum({dom:{tag:"div",classes:["tox-slider__rail"],attributes:{role:"presentation"}}}),c=CB.parts.thumb({dom:{tag:"div",classes:["tox-slider__handle"],attributes:{role:"presentation"}}});return kC(CB.sketch({dom:{tag:"div",classes:["tox-slider"],attributes:{role:"presentation"}},model:{mode:"x",minX:r,maxX:i,getInitialValue:w({x:o})},components:[u,a,c],sliderBehaviours:ml([Yw.config({})]),onChoose:n}))},L=function(t,e,n,r,o){var i=function(t,n,r){var o=E(e,r.x/100);l(t,o)};return P(t,i,n,r,o)},F=function(t,e,n,r,o){return[p(),L(t,e,n,r,o),b()]},z=function(t,e,n,r,a){var c=F(t,e,n,r,a);return sD.sketch({dom:u,components:c.map((function(t){return t.asSpec()})),containerBehaviours:ml([Vw("image-tools-filter-panel-buttons-events",[Na(RI.disable(),(function(t,e){o(c,t)})),Na(RI.enable(),(function(t,e){i(c,t)}))])])})},H=[p(),v(),b()],V=sD.sketch({dom:u,components:H.map((function(t){return t.asSpec()}))}),U=z("Brightness",wP,-100,0,100),j=z("Contrast",xP,-100,0,100),W=z("Gamma",bP,-100,0,100),q=function(t,e,n){return function(r){return yP(r,t,e,n)}},$=function(t){var e=function(t,e,n){var r=G.getOpt(t),o=X.getOpt(t),i=K.getOpt(t);r.each((function(e){o.each((function(n){i.each((function(r){var o=th.getValue(e).x/100,i=th.getValue(r).x/100,u=th.getValue(n).x/100,a=q(o,i,u);l(t,a)}))}))}))};return P(t,e,0,100,200)},G=$("R"),K=$("G"),X=$("B"),Y=[p(),G,K,X,b()],J=sD.sketch({dom:u,components:Y.map((function(t){return t.asSpec()}))}),Q=function(t,e,n){return function(r){var o=function(){ut.getOpt(r).each((function(e){zw.set(e,[t]),n(e)}))};c(r,EI.swap(),{transform:e,swap:o})}},Z=function(e){t.showCrop()},tt=function(e){S.getOpt(e).each((function(e){var n=t.getMeasurements(),r=n.width,o=n.height;th.setValue(e,{width:r,height:o})}))},et=I.some(vP),nt=I.some(hP),rt=[r("crop","Crop",Q(C,I.none(),Z),!1),r("resize","Resize",Q(T,I.none(),tt),!1),r("orientation","Orientation",Q(M,I.none(),a),!1),r("brightness","Brightness",Q(U,I.none(),a),!1),r("sharpen","Sharpen",Q(V,et,a),!1),r("contrast","Contrast",Q(j,I.none(),a),!1),r("color-levels","Color levels",Q(J,I.none(),a),!1),r("gamma","Gamma",Q(W,I.none(),a),!1),r("invert","Invert",Q(V,nt,a),!1)],ot=sD.sketch({dom:u,components:rt.map((function(t){return t.asSpec()}))}),it=sD.sketch({dom:{tag:"div"},components:[ot],containerBehaviours:ml([zw.config({})])}),ut=kC(it),at=function(t){return ut.getOpt(t).map((function(t){var e=t.components()[0];return e.components()[e.components().length-1]}))};return{memContainer:ut,getApplyButton:at}},BI=tinymce.util.Tools.resolve("tinymce.geom.Rect"),MI=tinymce.util.Tools.resolve("tinymce.util.Observable"),PI=tinymce.util.Tools.resolve("tinymce.util.VK"),II=function(t){var e=Math.max,n=t.documentElement,r=t.body,o=e(n.scrollWidth,r.scrollWidth),i=e(n.clientWidth,r.clientWidth),u=e(n.offsetWidth,r.offsetWidth),a=e(n.scrollHeight,r.scrollHeight),c=e(n.clientHeight,r.clientHeight),s=e(n.offsetHeight,r.offsetHeight);return{width:o=1?n.set(1):n.set(a)}))},c=function(t,e){var n=ee.fromTag("img");return Hn(n,"src",e),jI(n.dom).then((function(){t.getSystem().isConnected()&&g.getOpt(t).map((function(t){var e=ks({element:n});zw.replaceAt(t,1,I.some(e));var r=i.get(),c={x:0,y:0,w:n.dom.naturalWidth,h:n.dom.naturalHeight};i.set(c);var s=BI.inflate(c,-20,-20);o.set(s),r.w===c.w&&r.h===c.h||a(t,n),u(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),g.getOpt(t).each((function(t){var e=t.components()[1].element;u(t,e)}))},f=function(){r.run((function(t){t.toggleVisibility(!0)}))},l=function(){r.run((function(t){t.toggleVisibility(!1)}))},d=function(){return o.get()},m=sD.sketch({dom:{tag:"div",classes:["tox-image-tools__image"]},components:[e.asSpec(),{dom:{tag:"img",attributes:{src:t}}},{dom:{tag:"div"},behaviours:ml([Vw("image-panel-crop-events",[Ua((function(t){g.getOpt(t).each((function(t){var e=t.element.dom,i=UI.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,h);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)}))})),ja((function(){r.clear()}))])])}],containerBehaviours:ml([zw.config({}),Vw("image-panel-events",[Ua((function(e){c(e,t)}))])])}),g=kC(m),p=function(){var t=i.get();return{width:t.w,height:t.h}};return{memContainer:g,updateSrc:c,zoom:s,showCrop:f,hideCrop:l,getRect:d,getMeasurements:p}},qI=function(t,e,n,r,o){return JP({name:t,icon:I.some(e),disabled:n,tooltip:I.some(t),primary:!1,borderless:!1},r,o)},$I=function(t,e){e?Lv.enable(t):Lv.disable(t)},GI=function(t){var e=function(t,e,o){n.getOpt(t).each((function(t){$I(t,e)})),r.getOpt(t).each((function(t){$I(t,o)}))},n=kC(qI("Undo","undo",!0,(function(t){Sa(t,EI.undo(),{direction:1})}),t)),r=kC(qI("Redo","redo",!0,(function(t){Sa(t,EI.redo(),{direction:1})}),t)),o=sD.sketch({dom:{tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools__sidebar"]},components:[n.asSpec(),r.asSpec(),qI("Zoom in","zoom-in",!1,(function(t){Sa(t,EI.zoom(),{direction:1})}),t),qI("Zoom out","zoom-out",!1,(function(t){Sa(t,EI.zoom(),{direction:-1})}),t)]});return{container:o,updateButtonUndoStates:e}};function KI(){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(u())return t[++e]},i=function(){return e>0},u=function(){return-1!==e&&e1?I.none():I.some(IC("chevron-down",{tag:"div",classes:["tox-selectfield__icon-js"]},e.icons)),u={dom:{tag:"div",classes:["tox-selectfield"]},components:nt([[o],i.toArray()])};return pD.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:nt([r.toArray(),[u]]),fieldBehaviours:ml([Lv.config({disabled:function(){return t.disabled||e.isDisabled()},onDisabled:function(t){pD.getField(t).each(Lv.disable)},onEnabled:function(t){pD.getField(t).each(Lv.enable)}}),cT()])})},cL=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:$(t,n)}]}},o=function(t){return{dom:{tag:"td",innerHtml:e.translate(t)}}},i=function(t){return{dom:{tag:"tr"},components:$(t,o)}},u=function(t){return{dom:{tag:"tbody"},components:$(t,i)}};return{dom:{tag:"table",classes:["tox-dialog__table"]},components:[r(t.header),u(t.cells)],behaviours:ml([yD.config({}),Yw.config({})])}},sL=function(t,e){var n=t.label.map((function(t){return TD(t,e)})),r=[Lv.config({disabled:function(){return t.disabled||e.isDisabled()}}),cT(),Dw.config({mode:"execution",useEnter:!0!==t.multiline,useControlEnter:!0===t.multiline,execute:function(t){return Ca(t,RD),I.some(!0)}}),Vw("textfield-change",[Na(Uu(),(function(e,n){Sa(e,ED,{name:t.name})})),Na(Zu(),(function(e,n){Sa(e,ED,{name:t.name})}))]),yD.config({})],o=t.validation.map((function(t){return dA.config({getRoot:function(t){return vn(t.element)},invalidClass:"tox-invalid",validator:{validate:function(e){var n=th.getValue(e),r=t.validator(n);return tA.pure(!0===r?ro.value(n):ro.error(r))},validateOnLoad:t.validateOnLoad}})})).toArray(),i=t.placeholder.fold(w({}),(function(t){return{placeholder:e.translate(t)}})),u=t.inputMode.fold(w({}),(function(t){return{inputmode:t}})),a=D(D({},i),u),c=pD.parts.field({tag:!0===t.multiline?"textarea":"input",inputAttributes:a,inputClasses:[t.classname],inputBehaviours:ml(nt([r,o])),selectOnFocus:!1,factory:UD}),s=t.flex?["tox-form__group--stretched"]:[],f=s.concat(t.maximized?["tox-form-group--maximize"]:[]),l=[Lv.config({disabled:function(){return t.disabled||e.isDisabled()},onDisabled:function(t){pD.getField(t).each(Lv.disable)},onEnabled:function(t){pD.getField(t).each(Lv.enable)}}),cT()];return xD(n,c,f,l)},fL=function(t,e){return sL({name:t.name,multiline:!1,label:t.label,inputMode:t.inputMode,placeholder:t.placeholder,flex:!1,disabled:t.disabled,classname:"tox-textfield",validation:I.none(),maximized:t.maximized},e)},lL=function(t,e){return sL({name:t.name,multiline:!0,label:t.label,inputMode:I.none(),placeholder:t.placeholder,flex:!0,disabled:t.disabled,classname:"tox-textarea",validation:I.none(),maximized:t.maximized},e)},dL=function(t,e){var n=t.stream.streams,r=n.setup(t,e);return _a([Na(t.event,r),ja((function(){return e.cancel()}))].concat(t.cancelEvent.map((function(t){return[Na(t,(function(){return e.cancel()}))]})).getOr([])))},mL=Object.freeze({__proto__:null,events:dL}),gL=function(t){var e=ou(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 Oc({readState:n,setTimer:r,cancel:o})},pL=function(t){return t.stream.streams.state(t)},hL=Object.freeze({__proto__:null,throttle:gL,init:pL}),vL=function(t,e){var n=t.stream,r=WC(t.onStream,n.delay);return e.setTimer(r),function(t,e){r.throttle(t,e),n.stopEvent&&e.stop()}},bL=[Ai("stream",ki("mode",{throttle:[Di("delay"),Ki("stopEvent",!0),df("streams",{setup:vL,state:gL})]})),Ki("event","input"),Hi("cancelEvent"),ff("onStream")],yL=pl({fields:bL,name:"streaming",active:mL,state:hL}),wL=function(t,e,n){var r=th.getValue(n);th.setValue(e,r),CL(e)},xL=function(t,e){var n=t.element,r=ds(n),o=n.dom;"number"!==Un(n,"type")&&e(o,r)},CL=function(t){xL(t,(function(t,e){return t.setSelectionRange(e.length,e.length)}))},SL=function(t,e){xL(t,(function(t,n){return t.setSelectionRange(e,n.length)}))},kL=function(t,e,n){if(t.selectsOver){var r=th.getValue(e),o=t.getDisplayText(r),i=th.getValue(n),u=t.getDisplayText(i);return 0===u.indexOf(o)?I.some((function(){wL(t,e,n),SL(e,o.length)})):I.none()}return I.none()},OL=w("alloy.typeahead.itemexecute"),TL=function(t,e,n,r){var o=function(e,n,o){t.previewing.set(!1);var i=bA.getCoupled(e,"sandbox");if(bp.isOpen(i))bv.getCurrent(i).each((function(t){rb.getHighlighted(t).fold((function(){o(t)}),(function(){Ea(i,t.element,"keydown",n)}))}));else{var a=function(t){bv.getCurrent(t).each(o)};OA(t,u(e),e,i,r,a,qD.HighlightFirst).get(h)}},i=FD(t),u=function(t){return function(e){return e.map((function(e){var n=Ot(e.menus),r=rt(n,(function(t){return Y(t.items,(function(t){return"item"===t.type}))})),o=th.getState(t);return o.update($(r,(function(t){return t.data}))),e}))}},a=[Yw.config({}),th.config({onSetValue:t.onSetValue,store:D({mode:"dataset",getDataKey:function(t){return ds(t.element)},getFallbackEntry:function(t){return{value:t,meta:{}}},setValue:function(e,n){ms(e.element,t.model.getDisplayText(n))}},t.initialData.map((function(t){return mu("initialValue",t)})).getOr({}))}),yL.config({stream:{mode:"throttle",delay:t.responseTime,stopEvent:!1},onStream:function(e,n){var o=bA.getCoupled(e,"sandbox"),i=Yw.isFocused(e);if(i&&ds(e.element).length>=t.minChars){var a=bv.getCurrent(o).bind((function(t){return rb.getHighlighted(t).map(th.getValue)}));t.previewing.set(!0);var c=function(e){bv.getCurrent(o).each((function(e){a.fold((function(){t.model.selectsOver&&rb.highlightFirst(e)}),(function(t){rb.highlightBy(e,(function(e){var n=th.getValue(e);return n.value===t.value})),rb.getHighlighted(e).orThunk((function(){return rb.highlightFirst(e),I.none()}))}))}))};OA(t,u(e),e,o,r,c,qD.HighlightFirst).get(h)}},cancelEvent:ua()}),Dw.config({mode:"special",onDown:function(t,e){return o(t,e,rb.highlightFirst),I.some(!0)},onEscape:function(t){var e=bA.getCoupled(t,"sandbox");return bp.isOpen(e)?(bp.close(e),I.some(!0)):I.none()},onUp:function(t,e){return o(t,e,rb.highlightLast),I.some(!0)},onEnter:function(e){var n=bA.getCoupled(e,"sandbox"),r=bp.isOpen(n);if(r&&!t.previewing.get())return bv.getCurrent(n).bind((function(t){return rb.getHighlighted(t)})).map((function(t){return Sa(e,OL(),{item:t}),!0}));var o=th.getValue(e);return Ca(e,ua()),t.onExecute(n,e,o),r&&bp.close(n),I.some(!0)}}),px.config({toggleClass:t.markers.openClass,aria:{mode:"expanded"}}),bA.config({others:{sandbox:function(e){return RA(t,e,{onOpen:function(){return px.on(e)},onClose:function(){return px.off(e)}})}}}),Vw("typeaheadevents",[qa((function(e){var n=h;EA(t,u(e),e,r,n,qD.HighlightFirst).get(h)})),Na(OL(),(function(e,n){var r=bA.getCoupled(e,"sandbox");wL(t.model,e,n.event.item),Ca(e,ua()),t.onItemExecute(e,r,n.event.item,th.getValue(e)),bp.close(r),CL(e)}))].concat(t.dismissOnBlur?[Na(Qu(),(function(t){var e=bA.getCoupled(t,"sandbox");El(e.element).isNone()&&bp.close(e)}))]:[]))];return{uid:t.uid,dom:HD(Co(t,{inputAttributes:{role:"combobox","aria-autocomplete":"list","aria-haspopup":"true"}})),behaviours:D(D({},i),rh(t.typeaheadBehaviours,a)),eventOrder:t.eventOrder}},EL=w([Hi("lazySink"),Di("fetch"),Ki("minChars",5),Ki("responseTime",1e3),cf("onOpen"),Ki("getHotspot",I.some),Ki("getAnchorOverrides",w({})),Ki("layouts",I.none()),Ki("eventOrder",{}),ru("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)]),cf("onSetValue"),sf("onExecute"),cf("onItemExecute"),Ki("inputClasses",[]),Ki("inputAttributes",{}),Ki("inputStyles",{}),Ki("matchWidth",!0),Ki("useMinWidth",!1),Ki("dismissOnBlur",!0),uf(["openClass"]),Hi("initialData"),eh("typeaheadBehaviours",[Yw,th,yL,Dw,px,bA]),Ei("previewing",(function(){return ou(!0)}))].concat(LD()).concat(BA())),_L=w([Mh({schema:[of()],name:"menu",overrides:function(t){return{fakeFocus:!0,onHighlight:function(e,n){t.previewing.get()?e.getSystem().getByUid(t.uid).each((function(r){kL(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&&wL(t.model,e,n)})),t.previewing.set(!1)},onExecute:function(e,n){return e.getSystem().getByUid(t.uid).toOptional().map((function(t){return Sa(t,OL(),{item:n}),!0}))},onHover:function(e,n){t.previewing.set(!1),e.getSystem().getByUid(t.uid).each((function(e){t.model.populateFromBrowse&&wL(t.model,e,n)}))}}}})]),DL=mv({name:"Typeahead",configFields:EL(),partFields:_L(),factory:TL}),AL=function(t){var e=function(){return AL(t.toCached())},n=function(e){return AL(t.bind((function(t){return t.fold((function(t){return tA.pure(ro.error(t))}),(function(t){return e(t)}))})))},r=function(e){return AL(t.map((function(t){return t.bind(e)})))},o=function(e){return AL(t.map((function(t){return t.map(e)})))},i=function(e){return AL(t.map((function(t){return t.mapError(e)})))},u=function(e,n){return t.map((function(t){return t.fold(e,n)}))},a=function(e,n){return AL(tA.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 D(D({},t),{toCached:e,bindFuture:n,bindResult:r,mapResult:o,mapError:i,foldResult:u,withTimeout:a})},RL=function(t){return AL(tA.nu(t))},NL=function(t){return AL(tA.pure(ro.value(t)))},BL=function(t){return AL(tA.pure(ro.error(t)))},ML=function(t){return AL(tA.pure(t))},PL=function(t){return AL(t.map(ro.value))},IL=function(t){return RL((function(e){t.then((function(t){e(ro.value(t))}),(function(t){e(ro.error(t))}))}))},LL={nu:RL,wrap:AL,pure:NL,value:NL,error:BL,fromResult:ML,fromFuture:PL,fromPromise:IL},FL={type:"separator"},zL=function(t){return{type:"menuitem",value:t.url,text:t.title,meta:{attach:t.attach},onAction:h}},HL=function(t,e){return{type:"menuitem",value:e,text:t,meta:{attach:void 0},onAction:h}},VL=function(t){return $(t,zL)},UL=function(t,e){return Y(e,(function(e){return e.type===t}))},jL=function(t,e){return VL(UL(t,e))},WL=function(t){return jL("header",t.targets)},qL=function(t){return jL("anchor",t.targets)},$L=function(t){return I.from(t.anchorTop).map((function(t){return HL("",t)})).toArray()},GL=function(t){return I.from(t.anchorBottom).map((function(t){return HL("",t)})).toArray()},KL=function(t){return $(t,(function(t){return HL(t,t)}))},XL=function(t){return Q(t,(function(t,e){var n=0===t.length||0===e.length;return n?t.concat(e):t.concat(FL,e)}),[])},YL=function(t,e){var n=t.toLowerCase();return Y(e,(function(t){var e=void 0!==t.meta&&void 0!==t.meta.text?t.meta.text:t.text;return Ut(e.toLowerCase(),n)||Ut(t.value.toLowerCase(),n)}))},JL=function(t,e,n){var r=th.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=YL(o,KL(n.getHistory(t)));return"file"===t?XL([r,YL(o,WL(e)),YL(o,nt([$L(e),qL(e),GL(e)]))]):r}))},QL=oc("aria-invalid"),ZL=function(t,e,n){var r,o=e.shared.providers,i=function(e){var r=th.getValue(e);n.addToHistory(r.value,t.filetype)},u=pD.parts.field({factory:DL,dismissOnBlur:!0,inputClasses:["tox-textfield"],sandboxClasses:["tox-dialog__popups"],inputAttributes:{"aria-errormessage":QL,type:"url"},minChars:0,responseTime:0,fetch:function(r){var o=JL(t.filetype,r,n),i=qP(o,jS.BUBBLE_TO_SANDBOX,e,!1);return tA.pure(i)},getHotspot:function(t){return m.getOpt(t)},onSetValue:function(t,e){t.hasConfigured(dA)&&dA.run(t).get(h)},typeaheadBehaviours:ml(nt([n.getValidationHandler().map((function(e){return dA.config({getRoot:function(t){return vn(t.element)},invalidClass:"tox-control-wrap--status-invalid",notify:{onInvalid:function(t,e){s.getOpt(t).each((function(t){Hn(t.element,"title",o.translate(e))}))}},validator:{validate:function(n){var r=th.getValue(n);return LL.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(),[Lv.config({disabled:function(){return t.disabled||o.isDisabled()}}),yD.config({}),Vw("urlinput-events",nt(["file"===t.filetype?[Na(Uu(),(function(e){Sa(e,ED,{name:t.name})}))]:[],[Na(ju(),(function(e){Sa(e,ED,{name:t.name}),i(e)})),Na(Zu(),(function(e){Sa(e,ED,{name:t.name}),i(e)}))]]))]])),eventOrder:(r={},r[Uu()]=["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:hk(!1,1,"normal")},onExecute:function(t,e,n){Sa(e,RD,{})},onItemExecute:function(e,n,r,o){i(e),Sa(e,ED,{name:t.name})}}),a=t.label.map((function(t){return TD(t,o)})),c=function(t,e,n,r){return void 0===n&&(n=t),void 0===r&&(r=t),IC(n,{tag:"div",classes:["tox-icon","tox-control-wrap__status-icon-"+t],attributes:D({title:o.translate(r),"aria-live":"polite"},e.fold((function(){return{}}),(function(t){return{id:t}})))},o.icons)},s=kC(c("invalid",I.some(QL),"warning")),f=kC({dom:{tag:"div",classes:["tox-control-wrap__status-icon-wrap"]},components:[s.asSpec()]}),l=n.getUrlPicker(t.filetype),d=oc("browser.url.event"),m=kC({dom:{tag:"div",classes:["tox-control-wrap"]},components:[u,f.asSpec()],behaviours:ml([Lv.config({disabled:function(){return t.disabled||o.isDisabled()}})])}),g=kC(ZP({name:t.name,icon:I.some("browse"),text:t.label.getOr(""),disabled:t.disabled,primary:!1,borderless:!0},(function(t){return Ca(t,d)}),o,[],["tox-browse-url"])),p=function(){return{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:nt([[m.asSpec()],l.map((function(){return g.asSpec()})).toArray()])}},v=function(e){bv.getCurrent(e).each((function(n){var r=th.getValue(n),o=D({fieldname:t.name},r);l.each((function(r){r(o).get((function(r){th.setValue(n,r),Sa(e,ED,{name:t.name})}))}))}))};return pD.sketch({dom:kD(),components:a.toArray().concat([p()]),fieldBehaviours:ml([Lv.config({disabled:function(){return t.disabled||o.isDisabled()},onDisabled:function(t){pD.getField(t).each(Lv.disable),g.getOpt(t).each(Lv.disable)},onEnabled:function(t){pD.getField(t).each(Lv.enable),g.getOpt(t).each(Lv.enable)}}),cT(),Vw("url-input-events",[Na(d,v)])])})},tF=function(t,e){return sD.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:[SC.sketch({dom:{tag:"button",classes:["tox-button","tox-button--naked","tox-button--icon"],innerHtml:RC(t.icon,e.icons),attributes:{title:e.translate(t.iconTooltip)}},action:function(e){Sa(e,AD,{name:"alert-banner",value:t.url})},buttonBehaviours:ml([MC()])})]},{dom:{tag:"div",classes:["tox-notification__body"],innerHtml:e.translate(t.text)}}]})},eF=function(t,e){var n=th.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(),I.some(!0)},o=pD.parts.field({factory:{sketch:x},dom:{tag:"input",classes:["tox-checkbox__input"],attributes:{type:"checkbox"}},behaviours:ml([WB.self(),Lv.config({disabled:function(){return t.disabled||e.isDisabled()}}),yD.config({}),Yw.config({}),n,Dw.config({mode:"special",onEnter:r,onSpace:r,stopSpaceKeyup:!0}),Vw("checkbox-events",[Na(ju(),(function(e,n){Sa(e,ED,{name:t.name})}))])])}),i=pD.parts.label({dom:{tag:"span",classes:["tox-checkbox__label"],innerHtml:e.translate(t.label)},behaviours:ml([VA.config({})])}),u=function(t){var n="checked"===t?"selected":"unselected";return IC(n,{tag:"span",classes:["tox-icon","tox-checkbox-icon__"+t]},e.icons)},a=kC({dom:{tag:"div",classes:["tox-checkbox__icons"]},components:[u("checked"),u("unchecked")]});return pD.sketch({dom:{tag:"label",classes:["tox-checkbox"]},components:[o,a.asSpec(),i],fieldBehaviours:ml([Lv.config({disabled:function(){return t.disabled||e.isDisabled()},disableClass:"tox-checkbox--disabled",onDisabled:function(t){pD.getField(t).each(Lv.disable)},onEnabled:function(t){pD.getField(t).each(Lv.enable)}}),cT()])})},nF=function(t){return"presentation"===t.presets?sD.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:t.html}}):sD.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:t.html,attributes:{role:"document"}},containerBehaviours:ml([yD.config({}),Yw.config({})])})},rF=function(t){return function(e,n,r){return Tt(n,"name").fold((function(){return t(n,r)}),(function(o){return e.field(o,t(n,r))}))}},oF=function(t){return function(e,n,r){var o=Co(n,{source:"dynamic"});return rF(t)(e,o,r)}},iF={bar:rF((function(t,e){return lD(t,e.shared)})),collection:rF((function(t,e){return ID(t,e.shared.providers)})),alertbanner:rF((function(t,e){return tF(t,e.shared.providers)})),input:rF((function(t,e){return fL(t,e.shared.providers)})),textarea:rF((function(t,e){return lL(t,e.shared.providers)})),label:rF((function(t,e){return QI(t,e.shared)})),iframe:oF((function(t,e){return wM(t,e.shared.providers)})),button:rF((function(t,e){return oI(t,e.shared.providers)})),checkbox:rF((function(t,e){return eF(t,e.shared.providers)})),colorinput:rF((function(t,e){return $A(t,e.shared,e.colorinput)})),colorpicker:rF(KB),dropzone:rF((function(t,e){return sM(t,e.shared.providers)})),grid:rF((function(t,e){return fM(t,e.shared)})),listbox:rF((function(t,e){return rL(t,e)})),selectbox:rF((function(t,e){return aL(t,e.shared.providers)})),sizeinput:rF((function(t,e){return vI(t,e.shared.providers)})),urlinput:rF((function(t,e){return ZL(t,e,e.urlinput)})),customeditor:rF(JB),htmlpanel:rF(nF),imagetools:rF((function(t,e){return JI(t,e.shared.providers)})),table:rF((function(t,e){return cL(t,e.shared.providers)})),panel:rF((function(t,e){return oL(t,e)}))},uF={field:function(t,e){return e}},aF=function(t,e,n){var r=Co(n,{shared:{interpreter:function(e){return cF(t,e,r)}}});return cF(t,e,r)},cF=function(t,e,n){return Tt(iF,e.type).fold((function(){return e}),(function(r){return r(t,e,n)}))},sF=function(t,e){var n=uF;return cF(n,t,e)},fF={valignCentre:[],alignCentre:[],alignLeft:[],alignRight:[],right:[],left:[],bottom:[],top:[]},lF=function(t,e,n){var r=12,o={maxHeightFunction:Ed()},i=function(){return{type:"node",root:An(t()),node:I.from(t()),bubble:Nd(r,r,fF),layouts:{onRtl:function(){return[dC]},onLtr:function(){return[lC]}},overrides:o}},u=function(){return{type:"hotspot",hotspot:e(),bubble:Nd(-r,r,fF),layouts:{onRtl:function(){return[Uf]},onLtr:function(){return[jf]}},overrides:o}};return function(){return n()?i():u()}},dF=function(t,e,n){var r=function(){return{type:"node",root:An(t()),node:I.from(t()),layouts:{onRtl:function(){return[mC]},onLtr:function(){return[mC]}}}},o=function(){return{type:"hotspot",hotspot:e(),layouts:{onRtl:function(){return[Gf]},onLtr:function(){return[Gf]}}}};return function(){return n()?r():o()}},mF=function(t,e){return function(){return{type:"selection",root:e(),getSelection:function(){var e=t.selection.getRng();return I.some(km.range(ee.fromDom(e.startContainer),e.startOffset,ee.fromDom(e.endContainer),e.endOffset))}}}},gF=function(t){return function(e){return{type:"node",root:t(),node:e}}},pF=function(t,e,n){var r=UO(t),o=function(){return ee.fromDom(t.getBody())},i=function(){return ee.fromDom(t.getContentAreaContainer())},u=function(){return r||!n()};return{inlineDialog:lF(i,e,u),banner:dF(i,e,u),cursor:mF(t,o),node:gF(o)}},hF=function(t){return function(e,n){var r=t_(t);r(e,n)}},vF=function(t){return function(){return PE(t)}},bF=function(t){return function(){return LE(t)}},yF=function(t){return function(){return $E(t)}},wF=function(t){return{colorPicker:hF(t),hasCustomColors:vF(t),getColors:bF(t),getColorCols:yF(t)}},xF=function(t){return function(){return GO(t)}},CF=function(t){return{isDraggableModal:xF(t)}},SF=function(t){var e=ou(LO(t)?"bottom":"top");return{isPositionedAtTop:function(){return"top"===e.get()},getDockingMode:e.get,setDockingMode:e.set}},kF=[{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"}]}],OF=function(t){return Et(t,"items")},TF=function(t){return Et(t,"block")},EF=function(t){return Et(t,"inline")},_F=function(t){return Et(t,"selector")},DF=function(t){return Q(t,(function(t,e){if(OF(e)){var n=DF(e.items);return{customFormats:t.customFormats.concat(n.customFormats),formats:t.formats.concat([{title:e.title,items:n.formats}])}}if(EF(e)||TF(e)||_F(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 D(D({},t),{formats:t.formats.concat(e)})}),{customFormats:[],formats:[]})},AF=function(t,e){var n=DF(e),r=function(e){G(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},RF=function(t){return SO(t).map((function(e){var n=AF(t,e);return kO(t)?kF.concat(n):n})).getOr(kF)},NF=function(t,e,n){var r={type:"formatter",isSelected:e(t.format),getStylePreview:n(t.format)};return Co(t,r)},BF=function(t,e,n,r){var o=function(t){return NF(t,n,r)},u=function(t){var e={type:"submenu"};return Co(t,e)},a=function(e){var o=i(e.name)?e.name:oc(e.title),u="custom-"+o,a={type:"formatter",format:u,isSelected:n(u),getStylePreview:r(u)},c=Co(e,a);return t.formatter.register(o,c),c},c=function(t){return $(t,(function(t){var e=pt(t);if(_t(t,"items")){var n=c(t.items);return Co(u(t),{getStyleItems:w(n)})}return _t(t,"format")?o(t):1===e.length&&U(e,"title")?Co(t,{type:"separator"}):a(t)}))};return c(e)},MF=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?I.some({tag:n.length>0&&(n[0].inline||n[0].block)||"div",styles:t.dom.parseStyle(t.formatter.getCssText(e))}):I.none()}},r=function(t){var e=t.items;return void 0!==e&&e.length>0?rt(e,r):[t.format]},o=ou([]),i=ou([]),u=ou([]),a=ou([]),c=ou(!1);t.on("PreInit",(function(u){var a=RF(t),c=BF(t,a,e,n);o.set(c),i.set(rt(c,r))})),t.on("addStyleModifications",(function(o){var i=BF(t,o.items,e,n);u.set(i),c.set(o.replace),a.set(rt(i,r))}));var s=function(){var t=c.get()?[]:o.get(),e=u.get();return t.concat(e)},f=function(){var t=c.get()?[]:i.get(),e=a.get();return t.concat(e)};return{getData:s,getFlattenedKeys:f}},PF=function(t){return d(t)&&1===t.nodeType},IF=QB.trim,LF=function(t){return function(e){if(PF(e)){if(e.contentEditable===t)return!0;if(e.getAttribute("data-mce-contenteditable")===t)return!0}return!1}},FF=LF("true"),zF=LF("false"),HF=function(t,e,n,r,o){return{type:t,title:e,url:n,level:r,attach:o}},VF=function(t){while(t=t.parentNode){var e=t.contentEditable;if(e&&"inherit"!==e)return FF(t)}return!1},UF=function(t,e){return $(Xm(ee.fromDom(e),t),(function(t){return t.dom}))},jF=function(t){return t.innerText||t.textContent},WF=function(t){return t.id?t.id:oc("h")},qF=function(t){return t&&"A"===t.nodeName&&void 0!==(t.id||t.name)},$F=function(t){return qF(t)&&KF(t)},GF=function(t){return t&&/^(H[1-6])$/.test(t.nodeName)},KF=function(t){return VF(t)&&!zF(t)},XF=function(t){return GF(t)&&KF(t)},YF=function(t){return GF(t)?parseInt(t.nodeName.substr(1),10):0},JF=function(t){var e=WF(t),n=function(){t.id=e};return HF("header",jF(t),"#"+e,YF(t),n)},QF=function(t){var e=t.id||t.name,n=jF(t);return HF("anchor",n||"#"+e,"#"+e,0,h)},ZF=function(t){return $(Y(t,XF),JF)},tz=function(t){return $(Y(t,$F),QF)},ez=function(t){var e=UF("h1,h2,h3,h4,h5,h6,a:not([href])",t);return e},nz=function(t){return IF(t.title).length>0},rz=function(t){var e=ez(t);return Y(ZF(e).concat(tz(e)),nz)},oz={find:rz},iz="tinymce-url-history",uz=5,az=function(t){return i(t)&&/^https?/.test(t)},cz=function(t){return a(t)&&t.length<=uz&&ot(t,az)},sz=function(t){return u(t)&&kt(t,(function(t){return!cz(t)})).isNone()},fz=function(){var t,e=TE.getItem(iz);if(null===e)return{};try{t=JSON.parse(e)}catch(n){if(n instanceof SyntaxError)return{};throw n}return sz(t)?t:{}},lz=function(t){if(!sz(t))throw new Error("Bad format for history:\n"+JSON.stringify(t));TE.setItem(iz,JSON.stringify(t))},dz=function(t){var e=fz();return Tt(e,t).getOr([])},mz=function(t,e){if(az(t)){var n=fz(),r=Tt(n,e).getOr([]),o=Y(r,(function(e){return e!==t}));n[e]=[t].concat(o).slice(0,uz),lz(n)}},gz=function(t){return!!t},pz=function(t){return bt(QB.makeMap(t,/[, ]/),gz)},hz=function(t){return I.from(JO(t)).filter(m)},vz=function(t){var e=I.some(QO(t)).filter(gz),n=I.some(ZO(t)).filter(gz),r=e.or(n).map(pz);return hz(t).fold(T,(function(t){return r.fold(E,(function(t){return pt(t).length>0&&t}))}))},bz=function(t,e){var n=vz(t);return s(n)?n?hz(t):I.none():n[e]?hz(t):I.none()},yz=function(t,e){return bz(t,e).map((function(n){return function(r){return tA.nu((function(o){var a=function(t,e){if(!i(t))throw new Error("Expected value to be string");if(void 0!==e&&!u(e))throw new Error("Expected meta to be a object");var n={value:t,meta:e};o(n)},c=D({filetype:e,fieldname:r.fieldname},I.from(r.meta).getOr({}));n.call(t,a,r.value,c)}))}}))},wz=function(t){return I.from(t).filter(i).getOrUndefined()},xz=function(t){return tT(t)?I.none():I.some({targets:oz.find(t.getBody()),anchorTop:wz(eT(t)),anchorBottom:wz(nT(t))})},Cz=function(t){return I.from(rT(t))},Sz=function(t){return{getHistory:dz,addToHistory:mz,getLinkInformation:function(){return xz(t)},getValidationHandler:function(){return Cz(t)},getUrlPicker:function(e){return yz(t,e)}}},kz=function(t,e,n){var r=ou(!1),o=SF(e),i={shared:{providers:{icons:function(){return e.ui.registry.getAll().icons},menuItems:function(){return e.ui.registry.getAll().menuItems},translate:OC.translate,isDisabled:function(){return e.mode.isReadOnly()||e.ui.isDisabled()},getSetting:e.getParam.bind(e)},interpreter:function(t){return sF(t,i)},anchors:pF(e,n,o.isPositionedAtTop),header:o,getSink:function(){return ro.value(t)}},urlinput:Sz(e),styleselect:MF(e),colorinput:wF(e),dialog:CF(e),isContextMenuOpen:function(){return r.get()},setContextMenuState:function(t){return r.set(t)}};return i},Oz=function(t,e,n){var r=function(t,r){G([e,n],(function(e){e.broadcastEvent(t,r)}))},o=function(t,r){G([e,n],(function(e){e.broadcastOn([t],r)}))},i=function(t){return o(yp(),{target:t.target})},u=Cl(),a=ud(u,"touchstart",i),c=ud(u,"touchmove",(function(t){return r(ca(),t)})),s=ud(u,"touchend",(function(t){return r(sa(),t)})),f=ud(u,"mousedown",i),l=ud(u,"mouseup",(function(t){0===t.raw.button&&o(xp(),{target:t.target})})),d=function(t){return o(yp(),{target:ee.fromDom(t.target)})},m=function(t){0===t.button&&o(xp(),{target:ee.fromDom(t.target)})},g=function(){G(t.editorManager.get(),(function(e){t!==e&&e.fire("DismissPopups",{relatedTarget:t})}))},p=function(t){return r(fa(),cd(t))},h=function(t){o(wp(),{}),r(la(),cd(t))},v=function(){return o(wp(),{})},b=function(e){e.state&&o(yp(),{target:ee.fromDom(t.getContainer())})},y=function(t){o(yp(),{target:ee.fromDom(t.relatedTarget.getContainer())})};t.on("PostRender",(function(){t.on("click",d),t.on("tap",d),t.on("mouseup",m),t.on("mousedown",g),t.on("ScrollWindow",p),t.on("ResizeWindow",h),t.on("ResizeEditor",v),t.on("AfterProgressState",b),t.on("DismissPopups",y)})),t.on("remove",(function(){t.off("click",d),t.off("tap",d),t.off("mouseup",m),t.off("mousedown",g),t.off("ScrollWindow",p),t.off("ResizeWindow",h),t.off("ResizeEditor",v),t.off("AfterProgressState",b),t.off("DismissPopups",y),f.unbind(),a.unbind(),c.unbind(),s.unbind(),l.unbind()})),t.on("detach",(function(){Qg(e),Qg(n),e.destroy(),n.destroy()}))},Tz=nv,Ez=Fh,_z=w([Ki("shell",!1),Di("makeItem"),Ki("setupItem",h),oh.field("listBehaviours",[zw])]),Dz=function(){return{behaviours:ml([zw.config({})])}},Az=Ph({name:"items",overrides:Dz}),Rz=w([Az]),Nz=w("CustomList"),Bz=function(t,e,n,r){var o=function(e,n){u(e).fold((function(){throw new Error("Custom List was defined to not be a shell, but no item container was specified in components")}),(function(r){var o=zw.contents(r),i=n.length,u=i-o.length,a=u>0?W(u,(function(){return t.makeItem()})):[],c=o.slice(i);G(c,(function(t){return zw.remove(r,t)})),G(a,(function(t){return zw.append(r,t)}));var s=zw.contents(r);G(s,(function(r,o){t.setupItem(e,r,n[o],o)}))}))},i=t.shell?{behaviours:[zw.config({})],components:[]}:{behaviours:[],components:e},u=function(e){return t.shell?I.some(e):Kh(e,t,"items")};return{uid:t.uid,dom:t.dom,components:i.components,behaviours:rh(t.listBehaviours,i.behaviours),apis:{setItems:o}}},Mz=mv({name:Nz(),configFields:_z(),partFields:Rz(),factory:Bz,apis:{setItems:function(t,e,n){t.setItems(e,n)}}}),Pz=w([Di("dom"),Ki("shell",!0),eh("toolbarBehaviours",[zw])]),Iz=function(){return{behaviours:ml([zw.config({})])}},Lz=w([Ph({name:"groups",overrides:Iz})]),Fz=function(t,e,n,r){var o=function(t,e){i(t).fold((function(){throw new Error("Toolbar was defined to not be a shell, but no groups container was specified in components")}),(function(t){zw.set(t,e)}))},i=function(e){return t.shell?I.some(e):Kh(e,t,"groups")},u=t.shell?{behaviours:[zw.config({})],components:[]}:{behaviours:[],components:e};return{uid:t.uid,dom:t.dom,components:u.components,behaviours:rh(t.toolbarBehaviours,u.behaviours),apis:{setGroups:o},domModification:{attributes:{role:"group"}}}},zz=mv({name:"Toolbar",configFields:Pz(),partFields:Lz(),factory:Fz,apis:{setGroups:function(t,e,n){t.setGroups(e,n)}}}),Hz=h,Vz=T,Uz=w([]),jz=Object.freeze({__proto__:null,setup:Hz,isDocked:Vz,getBehaviours:Uz}),Wz=function(t){var e=Dt(Zn(t,"position"),"fixed"),n=e?I.none():yn(t);return n.orThunk((function(){var e=ee.fromTag("span");return vn(t).bind((function(t){Ar(t,e);var n=yn(e);return Pr(e),n}))}))},qz=function(t){return Wz(t).map(mr).getOrThunk((function(){return fr(0,0)}))},$z=uu.generate([{static:[]},{absolute:["positionCss"]},{fixed:["positionCss"]}]),Gz=function(t,e){var n=t.element;is(n,e.transitionClass),as(n,e.fadeOutClass),is(n,e.fadeInClass),e.onShow(t)},Kz=function(t,e){var n=t.element;is(n,e.transitionClass),as(n,e.fadeInClass),is(n,e.fadeOutClass),e.onHide(t)},Xz=function(t,e){return t.ye.y},Yz=function(t,e){return t.y>=e.y},Jz=function(t,e){return t.bottom<=e.bottom},Qz=function(t,e,n){return ot(t,(function(t){switch(t){case"bottom":return Jz(e,n);case"top":return Yz(e,n)}}))},Zz=function(t,e){return e.getInitialPos().map((function(e){return Yr(e.bounds.x,e.bounds.y,vr(t),ur(t))}))},tH=function(t,e,n){n.setInitialPos({style:tr(t),position:Jn(t,"position")||"static",bounds:e})},eH=function(t,e,n){return n.getInitialPos().bind((function(r){switch(n.clearInitialPos(),r.position){case"static":return I.some($z.static());case"absolute":var o=Wz(t).map(Jr).getOrThunk((function(){return Jr(Ln())}));return I.some($z.absolute(Dl("absolute",Tt(r.style,"left").map((function(t){return e.x-o.x})),Tt(r.style,"top").map((function(t){return e.y-o.y})),Tt(r.style,"right").map((function(t){return o.right-e.right})),Tt(r.style,"bottom").map((function(t){return o.bottom-e.bottom})))));default:return I.none()}}))},nH=function(t,e,n){return Zz(t,n).filter((function(t){return Qz(n.getModes(),t,e)})).bind((function(e){return eH(t,e,n)}))},rH=function(t,e,n){var r=Jr(t);if(Qz(n.getModes(),r,e))return I.none();tH(t,r,n);var o=Zr(),i=r.x-o.x,u=e.y-o.y,a=o.bottom-e.bottom,c=r.y<=e.y;return I.some($z.fixed(Dl("fixed",I.some(i),c?I.some(u):I.none(),I.none(),c?I.none():I.some(a))))},oH=function(t,e,n){var r=t.element,o=Dt(Zn(r,"position"),"fixed");return o?nH(r,e,n):rH(r,e,n)},iH=function(t,e){var n=t.element;return Zz(n,e).bind((function(t){return eH(n,t,e)}))},uH=function(t,e,n){n.setDocked(!1),G(["left","right","top","bottom","position"],(function(e){return nr(t.element,e)})),e.onUndocked(t)},aH=function(t,e,n,r){var o="fixed"===r.position;n.setDocked(o),Rl(t.element,r);var i=o?e.onDocked:e.onUndocked;i(t)},cH=function(t,e,n,r,o){void 0===o&&(o=!1),e.contextual.each((function(e){e.lazyContext(t).each((function(i){var u=Xz(i,r);if(u!==n.isVisible())if(n.setVisible(u),o&&!u)ss(t.element,[e.fadeOutClass]),e.onHide(t);else{var a=u?Gz:Kz;a(t,e)}}))}))},sH=function(t,e,n){var r=e.lazyViewport(t),o=n.isDocked();o&&cH(t,e,n,r),oH(t,r,n).each((function(o){o.fold((function(){return uH(t,e,n)}),(function(r){return aH(t,e,n,r)}),(function(o){cH(t,e,n,r,!0),aH(t,e,n,o)}))}))},fH=function(t,e,n){var r=t.element;n.setDocked(!1),iH(t,n).each((function(r){r.fold((function(){return uH(t,e,n)}),(function(r){return aH(t,e,n,r)}),h)})),n.setVisible(!0),e.contextual.each((function(e){fs(r,[e.fadeInClass,e.fadeOutClass,e.transitionClass]),e.onShow(t)})),lH(t,e,n)},lH=function(t,e,n){t.getSystem().isConnected()&&sH(t,e,n)},dH=function(t,e,n){n.isDocked()&&fH(t,e,n)},mH=function(t,e,n){return n.isDocked()},gH=function(t,e,n,r){return n.setModes(r)},pH=function(t,e,n){return n.getModes()},hH=Object.freeze({__proto__:null,refresh:lH,reset:dH,isDocked:mH,getModes:pH,setModes:gH}),vH=function(t,e){return _a([Va($u(),(function(n,r){t.contextual.each((function(t){if(cs(n.element,t.transitionClass)){fs(n.element,[t.transitionClass,t.fadeInClass]);var o=e.isVisible()?t.onShown:t.onHidden;o(n)}r.stop()}))})),Na(fa(),(function(n,r){lH(n,t,e)})),Na(la(),(function(n,r){dH(n,t,e)}))])},bH=Object.freeze({__proto__:null,events:vH}),yH=[$i("contextual",[Ni("fadeInClass"),Ni("fadeOutClass"),Ni("transitionClass"),Pi("lazyContext"),cf("onShow"),cf("onShown"),cf("onHide"),cf("onHidden")]),tu("lazyViewport",Zr),nu("modes",["top","bottom"],si),cf("onDocked"),cf("onUndocked")],wH=function(t){var e=ou(!1),n=ou(!0),r=od(),o=ou(t.modes),i=function(){return"docked: "+e.get()+", visible: "+n.get()+", modes: "+o.get().join(",")};return Oc({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})},xH=Object.freeze({__proto__:null,init:wH}),CH=pl({fields:yH,name:"docking",active:bH,apis:hH,state:xH}),SH=w(oc("toolbar-height-change")),kH={fadeInClass:"tox-editor-dock-fadein",fadeOutClass:"tox-editor-dock-fadeout",transitionClass:"tox-editor-dock-transition"},OH="tox-tinymce--toolbar-sticky-on",TH="tox-tinymce--toolbar-sticky-off",EH=function(t,e){var n=mn(e),r=n.dom.defaultView.innerHeight,o=Lr(n),i=ee.fromDom(t.elm),u=Qr(i),a=ur(i),c=u.y,s=c+a,f=mr(e),l=ur(e),d=f.top,m=d+l,g=Math.abs(d-o.top)<2,p=Math.abs(m-(o.top+r))<2;if(g&&cd){var h=c-r+a+l;Fr(o.left,h,n)}},_H=function(t,e){return U(CH.getModes(t),e)},DH=function(t){var e=function(t){return ar(t)+(parseInt(Jn(t,"margin-top"),10)||0)+(parseInt(Jn(t,"margin-bottom"),10)||0)},n=t.element;vn(n).each((function(r){var o="padding-"+CH.getModes(t)[0];if(CH.isDocked(t)){var i=vr(r);Kn(n,"width",i+"px"),Kn(r,o,e(n)+"px")}else nr(n,"width"),nr(r,o)}))},AH=function(t,e){e?(as(t,kH.fadeOutClass),ss(t,[kH.transitionClass,kH.fadeInClass])):(as(t,kH.fadeInClass),ss(t,[kH.fadeOutClass,kH.transitionClass]))},RH=function(t,e){var n=ee.fromDom(t.getContainer());e?(is(n,OH),as(n,TH)):(is(n,TH),as(n,OH))},NH=function(t,e){var n=mn(e);Tl(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 Sl(e)}))},BH=function(t,e){return El(t).orThunk((function(){return e().toOptional().bind((function(t){return El(t.element)}))}))},MH=function(t,e,n){t.inline||(e.header.isPositionedAtTop()||t.on("ResizeEditor",(function(){n().each(CH.reset)})),t.on("ResizeWindow ResizeEditor",(function(){n().each(DH)})),t.on("SkinLoaded",(function(){n().each((function(t){CH.isDocked(t)?CH.reset(t):CH.refresh(t)}))})),t.on("FullscreenStateChanged",(function(){n().each(CH.reset)}))),t.on("AfterScrollIntoView",(function(t){n().each((function(e){CH.refresh(e);var n=e.element;Jb(n)&&EH(t,n)}))})),t.on("PostRender",(function(){RH(t,!1)}))},PH=function(t){return t().map(CH.isDocked).getOr(!1)},IH=function(){var t;return[yl.config({channels:(t={},t[SH()]={onReceive:DH},t)})]},LH=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||DH(e),RH(t,CH.isDocked(e)),e.getSystem().broadcastOn([wp()],{}),r().each((function(t){return t.getSystem().broadcastOn([wp()],{})}))},u=t.inline?[]:IH();return R([Yw.config({}),CH.config({contextual:D({lazyContext:function(e){var n=ar(e.element),r=t.inline?t.getContentAreaContainer():t.getContainer(),o=Jr(ee.fromDom(r)),i=o.height-n,u=o.y+(_H(e,"top")?0:n);return I.some(Yr(o.x,u,o.width,i))},onShow:function(){o((function(t){return AH(t,!0)}))},onShown:function(t){o((function(t){return fs(t,[kH.transitionClass,kH.fadeInClass])})),n.get().each((function(e){NH(t.element,e),n.clear()}))},onHide:function(t){BH(t.element,r).fold(n.clear,n.set),o((function(t){return AH(t,!1)}))},onHidden:function(){o((function(t){return fs(t,[kH.transitionClass])}))}},kH),lazyViewport:function(e){var n=Zr(),r=$O(t),o=n.y+(_H(e,"top")?r:0),i=n.height-(_H(e,"bottom")?r:0);return Yr(n.x,o,n.width,i)},modes:[e.header.getDockingMode()],onDocked:i,onUndocked:i})],u,!0)},FH=Object.freeze({__proto__:null,setup:MH,isDocked:PH,getBehaviours:LH}),zH=function(t){var e=t.editor,n=t.sticky?LH:Uz;return{uid:t.uid,dom:t.dom,components:t.components,behaviours:ml(n(e,t.sharedBackstage))}},HH=ti([Ni("type"),Ai("items",ni([ii([Ni("name"),zi("items",si)]),si]))].concat(kS)),VH=function(t){return wi("GroupToolbarButton",HH,t)},UH=[ji("text"),ji("tooltip"),ji("icon"),Pi("fetch"),tu("onSetup",(function(){return h}))],jH=ti(R([Ni("type")],UH,!0)),WH=function(t){return wi("menubutton",jH,t)},qH=ti([Ni("type"),ji("tooltip"),ji("icon"),ji("text"),Wi("select"),Pi("fetch"),tu("onSetup",(function(){return h})),Qi("presets","normal",["normal","color","listpreview"]),Ki("columns",1),Pi("onAction"),Pi("onItemAction")]),$H=function(t){return wi("SplitButton",qH,t)},GH=function(t,e){var n=function(t,n){var r=$(n,(function(t){var n={type:"menubutton",text:t.text,fetch:function(e){e(t.getItems())}},r=WH(n).mapError((function(t){return Si(t)})).getOrDie();return GP(r,"tox-mbtn",e.backstage,I.some("menuitem"))}));zw.set(t,r)},r={focus:Dw.focusIn,setMenus:n};return{uid:t.uid,dom:t.dom,components:[],behaviours:ml([zw.config({}),Vw("menubar-events",[Ua((function(e){t.onSetup(e)})),Na(Lu(),(function(t,e){Fs(t.element,".tox-mbtn--active").each((function(n){zs(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){LA.expand(t),LA.close(n),Yw.focus(t)}))}))}))}))})),Na(ha(),(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){LA.isOpen(n)&&(LA.expand(t),LA.close(n))}))}))}))]),Dw.config({mode:"flow",selector:".tox-mbtn",onEscape:function(e){return t.onEscape(e),I.some(!0)}}),yD.config({})]),apis:r,domModification:{attributes:{role:"menubar"}}}},KH=dv({factory:GH,name:"silver.Menubar",configFields:[Di("dom"),Di("uid"),Di("onEscape"),Di("backstage"),Ki("onSetup",h)],apis:{focus:function(t,e){t.focus(e)},setMenus:function(t,e,n){t.setMenus(e,n)}}}),XH=function(t,e){return e.getAnimationRoot.fold((function(){return t.element}),(function(e){return e(t)}))},YH=function(t){return t.dimension.property},JH=function(t,e){return t.dimension.getDimension(e)},QH=function(t,e){var n=XH(t,e);fs(n,[e.shrinkingClass,e.growingClass])},ZH=function(t,e){as(t.element,e.openClass),is(t.element,e.closedClass),Kn(t.element,YH(e),"0px"),rr(t.element)},tV=function(t,e){as(t.element,e.closedClass),is(t.element,e.openClass),nr(t.element,YH(e))},eV=function(t,e,n,r){n.setCollapsed(),Kn(t.element,YH(e),JH(e,t.element)),rr(t.element),QH(t,e),ZH(t,e),e.onStartShrink(t),e.onShrunk(t)},nV=function(t,e,n,r){var o=r.getOrThunk((function(){return JH(e,t.element)}));n.setCollapsed(),Kn(t.element,YH(e),o),rr(t.element);var i=XH(t,e);as(i,e.growingClass),is(i,e.shrinkingClass),ZH(t,e),e.onStartShrink(t)},rV=function(t,e,n){var r=JH(e,t.element),o="0px"===r?eV:nV;o(t,e,n,I.some(r))},oV=function(t,e,n){var r=XH(t,e),o=cs(r,e.shrinkingClass),i=JH(e,t.element);tV(t,e);var u=JH(e,t.element),a=function(){Kn(t.element,YH(e),i),rr(t.element)},c=function(){ZH(t,e)},s=o?a:c;s(),as(r,e.shrinkingClass),is(r,e.growingClass),tV(t,e),Kn(t.element,YH(e),u),n.setExpanded(),e.onStartGrow(t)},iV=function(t,e,n){if(n.isExpanded()){nr(t.element,YH(e));var r=JH(e,t.element);Kn(t.element,YH(e),r)}},uV=function(t,e,n){n.isExpanded()||oV(t,e,n)},aV=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()},fV=function(t,e,n){return n.isCollapsed()},lV=function(t,e,n){var r=XH(t,e);return!0===cs(r,e.growingClass)},dV=function(t,e,n){var r=XH(t,e);return!0===cs(r,e.shrinkingClass)},mV=function(t,e,n){return lV(t,e)||dV(t,e)},gV=function(t,e,n){var r=n.isExpanded()?rV:oV;r(t,e,n)},pV=Object.freeze({__proto__:null,refresh:iV,grow:uV,shrink:aV,immediateShrink:cV,hasGrown:sV,hasShrunk:fV,isGrowing:lV,isShrinking:dV,isTransitioning:mV,toggleGrow:gV,disableTransitions:QH}),hV=function(t,e,n){var r=e.expanded;return Ac(r?{classes:[e.openClass],styles:{}}:{classes:[e.closedClass],styles:mu(e.dimension.property,"0px")})},vV=function(t,e){return _a([Va($u(),(function(n,r){var o=r.event.raw;if(o.propertyName===t.dimension.property){QH(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:hV,events:vV}),yV=[Di("closedClass"),Di("openClass"),Di("shrinkingClass"),Di("growingClass"),Hi("getAnimationRoot"),cf("onShrunk"),cf("onStartShrink"),cf("onGrown"),cf("onStartGrow"),Ki("expanded",!1),Ai("dimension",ki("property",{width:[df("property","width"),df("getDimension",(function(t){return vr(t)+"px"}))],height:[df("property","height"),df("getDimension",(function(t){return ur(t)+"px"}))]}))],wV=function(t){var e=ou(t.expanded),n=function(){return"expanded: "+e.get()};return Oc({isExpanded:function(){return!0===e.get()},isCollapsed:function(){return!1===e.get()},setCollapsed:S(e.set,!1),setExpanded:S(e.set,!0),readState:n})},xV=Object.freeze({__proto__:null,init:wV}),CV=pl({fields:yV,name:"sliding",active:bV,apis:pV,state:xV}),SV="container",kV=[eh("slotBehaviours",[])],OV=function(t){return""},TV=function(t){var e=function(){var t=[],e=function(e,n){return t.push(e),jh(SV,OV(e),n)};return{slot:e,record:w(t)}}(),n=t(e),r=e.record(),o=$(r,(function(t){return Bh({name:t,pname:OV(t)})}));return uv(SV,kV,o,EV,n)},EV=function(t,e){var n=function(e){return Qh(t)},r=function(e,n){return Kh(e,t,n)},o=function(e,n){return function(r,o){return Kh(r,t,o).map((function(t){return e(t,o)})).getOr(n)}},i=function(t){return function(e,n){G(n,(function(n){return t(e,n)}))}},u=function(t,e){return"true"!==Un(t.element,"aria-hidden")},a=function(t,e){if(!u(t)){var n=t.element;nr(n,"display"),qn(n,"aria-hidden"),Sa(t,va(),{name:e,visible:!0})}},c=function(t,e){if(u(t)){var n=t.element;Kn(n,"display","none"),Hn(n,"aria-hidden","true"),Sa(t,va(),{name:e,visible:!1})}},s=o(u,!1),f=o(c),l=i(f),d=function(t){return l(t,n())},m=o(a),g={getSlotNames:n,getSlot:r,isShowing:s,hideSlot:f,hideAllSlots:d,showSlot:m};return{uid:t.uid,dom:t.dom,components:e,behaviours:nh(t.slotBehaviours),apis:g}},_V=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 Sc(t)})),DV=D(D({},_V),{sketch:TV}),AV=ti([ji("icon"),ji("tooltip"),tu("onShow",h),tu("onHide",h),tu("onSetup",(function(){return h}))]),RV=function(t){return wi("sidebar",AV,t)},NV=function(t){var e=t.ui.registry.getAll().sidebars;G(pt(e),(function(n){var r=e[n],o=function(){return Dt(I.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)}}})}))},BV=function(t){return{element:function(){return t.element.dom}}},MV=function(t,e){var n=$(pt(e),(function(t){var n=e[t],r=xi(RV(n));return{name:t,getApi:BV,onSetup:r.onSetup,onShow:r.onShow,onHide:r.onHide}}));return $(n,(function(e){var r=ou(h);return t.slot(e.name,{dom:{tag:"div",classes:["tox-sidebar__pane"]},behaviours:Qk.unnamedEvents([pT(e,r),hT(e,r),Na(va(),(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))}))}))])})}))},PV=function(t){return DV.sketch((function(e){return{dom:{tag:"div",classes:["tox-sidebar__pane-container"]},components:MV(e,t),slotBehaviours:Qk.unnamedEvents([Ua((function(t){return DV.hideAllSlots(t)}))])}}))},IV=function(t,e){var n=bv.getCurrent(t);n.each((function(t){return zw.set(t,[PV(e)])}))},LV=function(t,e){var n=bv.getCurrent(t);n.each((function(t){var n=bv.getCurrent(t);n.each((function(n){CV.hasGrown(t)?DV.isShowing(n,e)?CV.shrink(t):(DV.hideAllSlots(n),DV.showSlot(n,e)):(DV.hideAllSlots(n),DV.showSlot(n,e),CV.grow(t))}))}))},FV=function(t){var e=bv.getCurrent(t);return e.bind((function(t){var e=CV.isGrowing(t)||CV.hasGrown(t);if(e){var n=bv.getCurrent(t);return n.bind((function(t){return tt(DV.getSlotNames(t),(function(e){return DV.isShowing(t,e)}))}))}return I.none()}))},zV=oc("FixSizeEvent"),HV=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:ml([yD.config({}),Yw.config({}),CV.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=bv.getCurrent(t);e.each(DV.hideAllSlots),Ca(t,HV)},onGrown:function(t){Ca(t,HV)},onStartGrow:function(t){Sa(t,zV,{width:Zn(t.element,"width").getOr("")})},onStartShrink:function(t){Sa(t,zV,{width:vr(t.element)+"px"})}}),zw.config({}),bv.config({find:function(t){var e=zw.contents(t);return lt(e)}})])}],behaviours:ml([WB.childAt(0),Vw("sidebar-sliding-events",[Na(zV,(function(t,e){Kn(t.element,"width",e.event.width)})),Na(HV,(function(t,e){nr(t.element,"width")}))])])}},UV=function(t,e,n,r){Hn(t.element,"aria-busy",!0);var o=e.getRoot(t).getOr(t),i=ml([Dw.config({mode:"special",onTab:function(){return I.some(!0)},onShiftTab:function(){return I.some(!0)}}),Yw.config({})]),u=r(o,i),a=o.getSystem().build(u);zw.append(o,_s(a)),a.hasConfigured(Dw)&&e.focus&&Dw.focusIn(a),n.isBlocked()||e.onBlock(t),n.blockWith((function(){return zw.remove(o,a)}))},jV=function(t,e,n){qn(t.element,"aria-busy"),n.isBlocked()&&e.onUnblock(t),n.clear()},WV=Object.freeze({__proto__:null,block:UV,unblock:jV}),qV=[tu("getRoot",I.none),Zi("focus",!0),cf("onBlock"),cf("onUnblock")],$V=function(){var t=ed(),e=function(e){t.set({destroy:e})};return Oc({readState:t.isSet,blockWith:e,clear:t.clear,isBlocked:t.isSet})},GV=Object.freeze({__proto__:null,init:$V}),KV=pl({fields:qV,name:"blocking",apis:WV,state:GV}),XV=function(t){var e=void 0!==t.dom.attributes?t.dom.attributes:[];return Q(e,(function(t,e){var n;return"class"===e.name?t:D(D({},t),(n={},n[e.name]=e.value,n))}),{})},YV=function(t){return Array.prototype.slice.call(t.dom.classList,0)},JV=function(t){var e=ee.fromHtml(t),n=xn(e),r=XV(e),o=YV(e),i=0===n.length?{}:{innerHtml:Ga(e)};return D({tag:ae(e),classes:o,attributes:r},i)},QV=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:JV('
')}]}}},ZV=function(t){return bv.getCurrent(t).each((function(t){return Sl(t.element)}))},tU=function(t,e){var n="tabindex",r="data-mce-"+n;I.from(t.iframeElement).map(ee.fromDom).each((function(t){e?(jn(t,n).each((function(e){return Hn(t,r,e)})),Hn(t,n,-1)):(qn(t,n),jn(t,r).each((function(e){Hn(t,n,e),qn(t,r)})))}))},eU=function(t,e,n,r){var o=e.element;if(tU(t,n),n)KV.block(e,QV(r)),nr(o,"display"),qn(o,"aria-hidden"),t.hasFocus()&&ZV(e);else{var i=bv.getCurrent(e).exists((function(t){return Ol(t.element)}));KV.unblock(e),Kn(o,"display","none"),Hn(o,"aria-hidden","true"),i&&t.focus()}},nU=function(t){return{uid:t.uid,dom:{tag:"div",attributes:{"aria-hidden":"true"},classes:["tox-throbber"],styles:{display:"none"}},behaviours:ml([zw.config({}),KV.config({focus:!1}),bv.config({find:function(t){return lt(t.components())}})]),components:[]}},rU=function(t){return"focusin"===t.type},oU=function(t){if(rU(t)){var e=t.composed?lt(t.composedPath()):I.from(t.target);return e.map(ee.fromDom).filter(fe).exists((function(t){return cs(t,"mce-pastebin")}))}return!1},iU=function(t,e,n){var r=ou(!1),o=od(),i=function(n){r.get()&&!oU(n)&&(n.preventDefault(),ZV(e()),t.editorManager.setActive(t))};t.inline||t.on("PreInit",(function(){t.dom.bind(t.getWin(),"focusin",i),t.on("BeforeExecCommand",(function(t){"mcefocus"===t.command.toLowerCase()&&!0!==t.value&&i(t)}))}));var u=function(o){o!==r.get()&&(r.set(o),eU(t,e(),o,n.providers),t.fire("AfterProgressState",{state:o}))};t.on("ProgressState",(function(e){if(o.on(xC.clearTimeout),g(e.time)){var n=xC.setEditorTimeout(t,(function(){return u(e.state)}),e.time);o.set(n)}else u(e.state),o.clear()}))},uU=function(t,e){var n={len:0,list:[]},r=Q(t,(function(t,n){var r=e(n,t.len);return r.fold(w(t),(function(e){return{len:e.finish,list:t.list.concat([e])}}))}),n);return r.list},aU=function(t,e,n){return{within:t,extra:e,withinWidth:n}},cU=function(t,e,n){var r=uU(t,(function(t,e){var r=n(t);return I.some({element:t,start:e,finish:e+r,width:r})})),o=Y(r,(function(t){return t.finish<=e})),i=J(o,(function(t,e){return t+e.width}),0),u=r.slice(o.length);return{within:o,extra:u,withinWidth:i}},sU=function(t){return $(t,(function(t){return t.element}))},fU=function(t,e,n){var r=sU(t.concat(e));return aU(r,[],n)},lU=function(t,e,n,r){var o=sU(t).concat([n]);return aU(o,sU(e),r)},dU=function(t,e,n){return aU(sU(t),[],n)},mU=function(t,e,n){var r=cU(e,t,n);return 0===r.extra.length?I.some(r):I.none()},gU=function(t,e,n,r){var o=mU(t,e,n).getOrThunk((function(){return cU(e,t-n(r),n)})),i=o.within,u=o.extra,a=o.withinWidth;return 1===u.length&&u[0].width<=n(r)?fU(i,u,a):u.length>=1?lU(i,u,r,a):dU(i,u,a)},pU=function(t,e){var n=$(e,(function(t){return _s(t)}));zz.setGroups(t,n)},hU=function(t){return gt(t,(function(t){return El(t.element).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))}))},vU=function(t,e,n){var r=e.builtGroups.get();if(0!==r.length){var o=Xh(t,e,"primary"),i=bA.getCoupled(t,"overflowGroup");Kn(o.element,"visibility","hidden");var u=r.concat([i]),a=hU(u);n([]),pU(o,u);var c=vr(o.element),s=gU(c,e.builtGroups.get(),(function(t){return vr(t.element)}),i);0===s.extra.length?(zw.remove(o,i),n([])):(pU(o,s.within),n(s.extra)),nr(o.element,"visibility"),rr(o.element),a.each(Yw.focus)}},bU=w([eh("splitToolbarBehaviours",[bA]),Ei("builtGroups",(function(){return ou([])}))]),yU=w([uf(["overflowToggledClass"]),Wi("getOverflowBounds"),Di("lazySink"),Ei("overflowGroups",(function(){return ou([])}))].concat(bU())),wU=w([Bh({factory:zz,schema:Pz(),name:"primary"}),Mh({schema:Pz(),name:"overflow"}),Mh({name:"overflow-button"}),Mh({name:"overflow-group"})]),xU=w((function(t,e){yr(t,Math.floor(e))})),CU=w([uf(["toggledClass"]),Di("lazySink"),Pi("fetch"),Wi("getBounds"),$i("fireDismissalEventInstead",[Ki("event",ga())]),zd()]),SU=w([Mh({name:"button",overrides:function(t){return{dom:{attributes:{"aria-haspopup":"true"}},buttonBehaviours:ml([px.config({toggleClass:t.markers.toggledClass,aria:{mode:"expanded"},toggleOnExecute:!1})])}}}),Mh({factory:zz,schema:Pz(),name:"toolbar",overrides:function(t){return{toolbarBehaviours:ml([Dw.config({mode:"cyclic",onEscape:function(e){return Kh(e,t,"button").each(Yw.focus),I.none()}})])}}})]),kU=function(t,e){var n=bA.getCoupled(t,"toolbarSandbox");bp.isOpen(n)?bp.close(n):bp.open(n,e.toolbar())},OU=function(t,e,n,r){var o=n.getBounds.map((function(t){return t()})),i=n.lazySink(t).getOrDie();Fg.positionWithinBounds(i,e,{anchor:{type:"hotspot",hotspot:t,layouts:r,overrides:{maxWidthFunction:xU()}}},o)},TU=function(t,e,n,r,o){zz.setGroups(e,o),OU(t,e,n,r),px.on(t)},EU=function(t,e,n){var r=Vs(),o=function(o,i){n.fetch().get((function(o){TU(t,i,n,e.layouts,o),r.link(t.element),Dw.focusIn(i)}))},i=function(){px.off(t),Yw.focus(t),r.unlink(t.element)};return{dom:{tag:"div",attributes:{id:r.id}},behaviours:ml([Dw.config({mode:"special",onEscape:function(t){return bp.close(t),I.some(!0)}}),bp.config({onOpen:o,onClose:i,isPartOf:function(e,n,r){return js(n,r)||js(t,r)},getAttachPoint:function(){return n.lazySink(t).getOrDie()}}),yl.config({channels:D(D({},Sp(D({isExtraPart:T},n.fireDismissalEventInstead.map((function(t){return{fireEventInstead:{event:t.event}}})).getOr({})))),Op({doReposition:function(){bp.getState(bA.getCoupled(t,"toolbarSandbox")).each((function(r){OU(t,r,n,e.layouts)}))}}))})])}},_U=function(t,e,n,r){return D(D({},SC.sketch(D(D({},r.button()),{action:function(t){kU(t,r)},buttonBehaviours:oh.augment({dump:r.button().buttonBehaviours},[bA.config({others:{toolbarSandbox:function(e){return EU(e,n,t)}}})])}))),{apis:{setGroups:function(e,r){bp.getState(bA.getCoupled(e,"toolbarSandbox")).each((function(o){TU(e,o,t,n.layouts,r)}))},reposition:function(e){bp.getState(bA.getCoupled(e,"toolbarSandbox")).each((function(r){OU(e,r,t,n.layouts)}))},toggle:function(t){kU(t,r)},getToolbar:function(t){return bp.getState(bA.getCoupled(t,"toolbarSandbox"))},isOpen:function(t){return bp.isOpen(bA.getCoupled(t,"toolbarSandbox"))}}})},DU=mv({name:"FloatingToolbarButton",factory:_U,configFields:CU(),partFields:SU(),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)}}}),AU=w([Di("items"),uf(["itemSelector"]),eh("tgroupBehaviours",[Dw])]),RU=w([Ih({name:"items",unit:"item"})]),NU=function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,behaviours:rh(t.tgroupBehaviours,[Dw.config({mode:"flow",selector:t.markers.itemSelector})]),domModification:{attributes:{role:"toolbar"}}}},BU=mv({name:"ToolbarGroup",configFields:AU(),partFields:RU(),factory:NU}),MU=function(t){return $(t,(function(t){return _s(t)}))},PU=function(t,e,n){vU(t,n,(function(r){n.overflowGroups.set(r),e.getOpt(t).each((function(t){DU.setGroups(t,MU(r))}))}))},IU=function(t,e,n,r){var o=kC(DU.sketch({fetch:function(){return tA.nu((function(e){e(MU(t.overflowGroups.get()))}))},layouts:{onLtr:function(){return[jf,Uf]},onRtl:function(){return[Uf,jf]},onBottomLtr:function(){return[qf,Wf]},onBottomRtl:function(){return[Wf,qf]}},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:rh(t.splitToolbarBehaviours,[bA.config({others:{overflowGroup:function(){return BU.sketch(D(D({},r["overflow-group"]()),{items:[o.asSpec()]}))}}})]),apis:{setGroups:function(e,n){t.builtGroups.set($(n,e.getSystem().build)),PU(e,o,t)},refresh:function(e){return PU(e,o,t)},toggle:function(t){o.getOpt(t).each((function(t){DU.toggle(t)}))},isOpen:function(t){return o.getOpt(t).map(DU.isOpen).getOr(!1)},reposition:function(t){o.getOpt(t).each((function(t){DU.reposition(t)}))},getOverflow:function(t){return o.getOpt(t).bind(DU.getToolbar)}},domModification:{attributes:{role:"group"}}}},LU=mv({name:"SplitFloatingToolbar",configFields:yU(),partFields:wU(),factory:IU,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)}}}),FU=w([uf(["closedClass","openClass","shrinkingClass","growingClass","overflowToggledClass"]),cf("onOpened"),cf("onClosed")].concat(bU())),zU=w([Bh({factory:zz,schema:Pz(),name:"primary"}),Bh({factory:zz,schema:Pz(),name:"overflow",overrides:function(t){return{toolbarBehaviours:ml([CV.config({dimension:{property:"height"},closedClass:t.markers.closedClass,openClass:t.markers.openClass,shrinkingClass:t.markers.shrinkingClass,growingClass:t.markers.growingClass,onShrunk:function(e){Kh(e,t,"overflow-button").each((function(t){px.off(t),Yw.focus(t)})),t.onClosed(e)},onGrown:function(e){Dw.focusIn(e),t.onOpened(e)},onStartGrow:function(e){Kh(e,t,"overflow-button").each(px.on)}}),Dw.config({mode:"acyclic",onEscape:function(e){return Kh(e,t,"overflow-button").each(Yw.focus),I.some(!0)}})])}}}),Mh({name:"overflow-button",overrides:function(t){return{buttonBehaviours:ml([px.config({toggleClass:t.markers.overflowToggledClass,aria:{mode:"pressed"},toggleOnExecute:!1})])}}}),Mh({name:"overflow-group"})]),HU=function(t,e){return Kh(t,e,"overflow").map(CV.hasGrown).getOr(!1)},VU=function(t,e){Kh(t,e,"overflow-button").bind((function(){return Kh(t,e,"overflow")})).each((function(n){UU(t,e),CV.toggleGrow(n)}))},UU=function(t,e){Kh(t,e,"overflow").each((function(n){vU(t,e,(function(t){var e=$(t,(function(t){return _s(t)}));zz.setGroups(n,e)})),Kh(t,e,"overflow-button").each((function(t){CV.hasGrown(n)&&px.on(t)})),CV.refresh(n)}))},jU=function(t,e,n,r){var o="alloy.toolbar.toggle",i=function(e,n){var r=$(n,e.getSystem().build);t.builtGroups.set(r)};return{uid:t.uid,dom:t.dom,components:e,behaviours:rh(t.splitToolbarBehaviours,[bA.config({others:{overflowGroup:function(t){return BU.sketch(D(D({},r["overflow-group"]()),{items:[SC.sketch(D(D({},r["overflow-button"]()),{action:function(e){Ca(t,o)}}))]}))}}}),Vw("toolbar-toggle-events",[Na(o,(function(e){VU(e,t)}))])]),apis:{setGroups:function(e,n){i(e,n),UU(e,t)},refresh:function(e){return UU(e,t)},toggle:function(e){return VU(e,t)},isOpen:function(e){return HU(e,t)}},domModification:{attributes:{role:"group"}}}},WU=mv({name:"SplitSlidingToolbar",configFields:FU(),partFields:zU(),factory:jU,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)}}}),qU=function(t){var e=t.title.fold((function(){return{}}),(function(t){return{attributes:{title:t}}}));return{dom:D({tag:"div",classes:["tox-toolbar__group"]},e),components:[BU.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:ml([yD.config({}),Yw.config({})])}},$U=function(t){return BU.sketch(qU(t))},GU=function(t,e){var n=Ua((function(e){var n=$(t.initGroups,$U);zz.setGroups(e,n)}));return ml([mT.toolbarButton(t.providers.isDisabled),cT(),Dw.config({mode:e,onEscape:t.onEscape,selector:".tox-toolbar__group"}),Vw("toolbar-events",[n])])},KU=function(t){var e=t.cyclicKeying?"cyclic":"acyclic";return{uid:t.uid,dom:{tag:"div",classes:["tox-toolbar-overlord"]},parts:{"overflow-group":qU({title:I.none(),items:[]}),"overflow-button":YP({name:"more",icon:I.some("more-drawer"),disabled:!1,tooltip:I.some("More..."),primary:!1,borderless:!1},I.none(),t.providers)},splitToolbarBehaviours:GU(t,e)}},XU=function(t){var e=KU(t),n=4,r=LU.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}});return LU.sketch(D(D({},e),{lazySink:t.getSink,getOverflowBounds:function(){var e=t.moreDrawerData.lazyHeader().element,r=Qr(e),o=pn(e),i=Qr(o),u=Math.max(o.dom.scrollHeight,i.height);return Yr(r.x+n,i.y,r.width-2*n,u)},parts:D(D({},e.parts),{overflow:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:t.attributes}}}),components:[r],markers:{overflowToggledClass:"tox-tbtn--enabled"}}))},YU=function(t){var e=WU.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}}),n=WU.parts.overflow({dom:{tag:"div",classes:["tox-toolbar__overflow"]}}),r=KU(t);return WU.sketch(D(D({},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([SH()],{type:"opened"})},onClosed:function(t){t.getSystem().broadcastOn([SH()],{type:"closed"})}}))},JU=function(t){var e=t.cyclicKeying?"cyclic":"acyclic";return zz.sketch({uid:t.uid,dom:{tag:"div",classes:["tox-toolbar"].concat(t.type===US.scrolling?["tox-toolbar--scrolling"]:[])},components:[zz.parts.groups({})],toolbarBehaviours:GU(t,e)})},QU=function(t,e,n){var r={getSocket:function(e){return Tz.getPart(e,t,"socket")},setSidebar:function(e,n){Tz.getPart(e,t,"sidebar").each((function(t){return IV(t,n)}))},toggleSidebar:function(e,n){Tz.getPart(e,t,"sidebar").each((function(t){return LV(t,n)}))},whichSidebar:function(e){return Tz.getPart(e,t,"sidebar").bind(FV).getOrNull()},getHeader:function(e){return Tz.getPart(e,t,"header")},getToolbar:function(e){return Tz.getPart(e,t,"toolbar")},setToolbar:function(e,n){Tz.getPart(e,t,"toolbar").each((function(t){t.getApis().setGroups(t,n)}))},setToolbars:function(e,n){Tz.getPart(e,t,"multiple-toolbar").each((function(t){Mz.setItems(t,n)}))},refreshToolbar:function(e){var n=Tz.getPart(e,t,"toolbar");n.each((function(t){return t.getApis().refresh(t)}))},toggleToolbarDrawer:function(e){Tz.getPart(e,t,"toolbar").each((function(t){Pt(t.getApis().toggle,(function(e){return e(t)}))}))},isToolbarDrawerToggled:function(e){return Tz.getPart(e,t,"toolbar").bind((function(t){return I.from(t.getApis().isOpen).map((function(e){return e(t)}))})).getOr(!1)},getThrobber:function(e){return Tz.getPart(e,t,"throbber")},focusToolbar:function(e){var n=Tz.getPart(e,t,"toolbar").orThunk((function(){return Tz.getPart(e,t,"multiple-toolbar")}));n.each((function(t){Dw.focusIn(t)}))},setMenubar:function(e,n){Tz.getPart(e,t,"menubar").each((function(t){KH.setMenus(t,n)}))},focusMenubar:function(e){Tz.getPart(e,t,"menubar").each((function(t){KH.focus(t)}))}};return{uid:t.uid,dom:t.dom,components:e,apis:r,behaviours:t.behaviours}},ZU=Ez.optional({factory:KH,name:"menubar",schema:[Di("backstage")]}),tj=function(t){return t.type===US.sliding?YU:t.type===US.floating?XU:JU},ej=Ez.optional({factory:{sketch:function(t){return Mz.sketch({uid:t.uid,dom:t.dom,listBehaviours:ml([Dw.config({mode:"acyclic",selector:".tox-toolbar"})]),makeItem:function(){return JU({type:t.type,uid:oc("multiple-toolbar-item"),cyclicKeying:!1,initGroups:[],providers:t.providers,onEscape:function(){return t.onEscape(),I.some(!0)}})},setupItem:function(t,e,n,r){zz.setGroups(e,n)},shell:!0})}},name:"multiple-toolbar",schema:[Di("dom"),Di("onEscape")]}),nj=Ez.optional({factory:{sketch:function(t){var e=tj(t),n={type:t.type,uid:t.uid,onEscape:function(){return t.onEscape(),I.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:[Di("dom"),Di("onEscape"),Di("getSink")]}),rj=Ez.optional({factory:{sketch:zH},name:"header",schema:[Di("dom")]}),oj=Ez.optional({name:"socket",schema:[Di("dom")]}),ij=Ez.optional({factory:{sketch:VV},name:"sidebar",schema:[Di("dom")]}),uj=Ez.optional({factory:{sketch:nU},name:"throbber",schema:[Di("dom")]}),aj=mv({name:"OuterContainer",factory:QU,configFields:[Di("dom"),Di("behaviours")],partFields:[rj,ZU,nj,ej,oj,ij,uj],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=$(n,(function(t){return $U(t)}));t.setToolbar(e,r)},setToolbars:function(t,e,n){var r=$(n,(function(t){return $(t,$U)}));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)}}}),cj="file edit view insert format tools table help",sj={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"}},fj=function(t,e,n){var r=EO(n).split(/[ ,]/);return{text:t.title,getItems:function(){return rt(t.items,(function(t){var n=t.toLowerCase();return 0===n.trim().length||j(r,(function(t){return t===n}))?[]:"separator"===n||"|"===n?[{type:"separator"}]:e.menuItems[n]?[e.menuItems[n]]:[]}))}}},lj=function(t){return"string"===typeof t?t.split(" "):t},dj=function(t,e){var n=D(D({},sj),e.menus),r=pt(e.menus).length>0,o=void 0===e.menubar||!0===e.menubar?lj(cj):lj(!1===e.menubar?"":e.menubar),i=Y(o,(function(t){var n=Et(sj,t);return r?n||Tt(e.menus,t).exists((function(t){return Et(t,"items")})):n})),u=$(i,(function(r){var o=n[r];return fj({title:o.title,items:lj(o.items)},e,t)}));return Y(u,(function(t){var e=function(t){return"separator"!==t.type};return t.getItems().length>0&&j(t.getItems(),e)}))},mj=function(t){var e=function(){t._skinLoaded=!0,pE(t)};return function(){t.initialized?e():t.on("init",e)}},gj=function(t,e){return function(){return hE(t,{message:e})}},pj=function(t,e,n){return new uS((function(r,o){n.load(e,r,o),t.on("remove",(function(){return n.unload(e)}))}))},hj=function(t,e){var n=e+"/skin.min.css";return pj(t,n,t.ui.styleSheetLoader)},vj=function(t,e){var n=Rn(ee.fromDom(t.getElement()));if(n){var r=e+"/skin.shadowdom.min.css";return pj(t,r,dO.DOM.styleSheetLoader)}return uS.resolve()},bj=function(t,e){var n=gO(e);n&&e.contentCSS.push(n+(t?"/content.inline":"/content")+".min.css"),!1===hO(e)&&i(n)?uS.all([hj(e,n),vj(e,n)]).then(mj(e),gj(e,"Skin could not be loaded")):mj(e)()},yj=S(bj,!1),wj=S(bj,!0),xj=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()}}},Cj=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)}}},Sj=function(t){return function(e){return function(){t.undoManager.transact((function(){t.focus(),t.execCommand("mceToggleFormat",!1,e.format)}))}}},kj=function(t,e){return function(){return t.execCommand(e)}},Oj=function(t,e,n){var r=function(t,r,i,u){var a=e.shared.providers.translate(t.title);if("separator"===t.type)return I.some({type:"separator",text:a});if("submenu"===t.type){var c=rt(t.getStyleItems(),(function(t){return o(t,r,u)}));return 0===r&&c.length<=0?I.none():I.some({type:"nestedmenuitem",text:a,disabled:c.length<=0,getSubmenuItems:function(){return rt(t.getStyleItems(),(function(t){return o(t,r,u)}))}})}return I.some(D({type:"togglemenuitem",text:a,icon:t.icon,active:t.isSelected(u),disabled:i,onAction:n.onAction(t)},t.getStylePreview().fold((function(){return{}}),(function(t){return{meta:{style:t}}}))))},o=function(t,e,o){var i="formatter"===t.type&&n.isInvalid(t);return 0===e?i?[]:r(t,e,!1,o).toArray():r(t,e,i,o).toArray()},i=function(t){var e=n.getCurrentValue(),r=n.shouldHide?0:1;return rt(t,(function(t){return o(t,r,e)}))},u=function(t,e){return function(n,r){var o=e(),u=i(o),a=qP(u,jS.CLOSE_ON_EXECUTE,t,!1);r(a)}};return{validateItems:i,getFetch:u}},Tj=function(t,e,n){var r=n.dataset,o="basic"===r.type?function(){return $(r.data,(function(t){return NF(t,n.isSelectedFor,n.getPreviewFor)}))}:r.getData;return{items:Oj(t,e,n),getStyleItems:o}},Ej=function(t,e,n){var r=Tj(t,e,n),o=r.items,i=r.getStyleItems,u=function(t){return{getComponent:w(t)}},a=Cj(t,"NodeChange",(function(t){var e=t.getComponent();n.updateText(e)}));return PP({text:n.icon.isSome()?I.none():n.text,icon:n.icon,tooltip:I.from(n.tooltip),role:I.none(),fetch:o.getFetch(e,i),onSetup:a,getApi:u,columns:1,presets:"normal",classes:n.icon.isSome()?[]:["bespoke"],dropdownBehaviours:[]},"tox-tbtn",e.shared)},_j=function(t){return $(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}}))},Dj=function(t){return{type:"basic",data:t}};(function(t){t[t["SemiColon"]=0]="SemiColon",t[t["Space"]=1]="Space"})(XI||(XI={}));var Aj,Rj=function(t,e){return e===XI.SemiColon?t.replace(/;$/,"").split(";"):t.split(" ")},Nj=function(t,e,n,r){var o=t.getParam(e,n,"string"),i=_j(Rj(o,r));return{type:"basic",data:i}},Bj=[{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"}],Mj=function(t){var e=function(){return tt(Bj,(function(e){return t.formatter.match(e.format)}))},n=function(e){return function(){return t.formatter.match(e)}},r=function(t){return I.none},o=function(t){var n=e(),r=n.fold(w("left"),(function(t){return t.title.toLowerCase()}));Sa(t,MP,{icon:"align-"+r})},i=Dj(Bj),u=function(e){return function(){return tt(Bj,(function(t){return t.format===e.format})).each((function(e){return t.execCommand(e.command)}))}};return{tooltip:"Align",text:I.none(),icon:I.some("align-left"),isSelectedFor:n,getCurrentValue:I.none,getPreviewFor:r,onAction:u,updateText:o,dataset:i,shouldHide:!1,isInvalid:function(e){return!t.formatter.canApply(e.format)}}},Pj=function(t,e){return Ej(t,e,Mj(t))},Ij=function(t,e){var n=Tj(t,e,Mj(t));t.ui.registry.addNestedMenuItem("align",{text:e.shared.providers.translate("Align"),getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})},Lj="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",Fj=["-apple-system","Segoe UI","Roboto","Helvetica Neue","sans-serif"],zj=function(t){var e=t.split(/\s*,\s*/);return $(e,(function(t){return t.replace(/^['"]+|['"]+$/g,"")}))},Hj=function(t){var e=function(){var e=zj(t.toLowerCase());return ot(Fj,(function(t){return e.indexOf(t.toLowerCase())>-1}))};return 0===t.indexOf("-apple-system")&&e()},Vj=function(t){var e="System Font",n=function(){var n=function(t){return t?zj(t)[0]:""},r=t.queryCommandValue("FontName"),o=c.data,i=r?r.toLowerCase():"",u=tt(o,(function(t){var e=t.format;return e.toLowerCase()===i||n(e).toLowerCase()===n(i).toLowerCase()})).orThunk((function(){return It(Hj(i),{title:e,format:i})}));return{matchOpt:u,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 I.some({tag:"div",styles:-1===t.indexOf("dings")?{"font-family":t}:{}})}},u=function(e){return function(){t.undoManager.transact((function(){t.focus(),t.execCommand("FontName",!1,e.format)}))}},a=function(t){var e=n(),r=e.matchOpt,o=e.font,i=r.fold(w(o),(function(t){return t.title}));Sa(t,BP,{text:i})},c=Nj(t,"font_formats",Lj,XI.SemiColon);return{tooltip:"Fonts",text:I.some(e),icon:I.none(),isSelectedFor:r,getCurrentValue:o,getPreviewFor:i,onAction:u,updateText:a,dataset:c,shouldHide:!1,isInvalid:T}},Uj=function(t,e){return Ej(t,e,Vj(t))},jj=function(t,e){var n=Tj(t,e,Vj(t));t.ui.registry.addNestedMenuItem("fontformats",{text:e.shared.providers.translate("Fonts"),getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})},Wj="8pt 10pt 12pt 14pt 18pt 24pt 36pt",qj={"8pt":"1","10pt":"2","12pt":"3","14pt":"4","18pt":"5","24pt":"6","36pt":"7"},$j={"xx-small":"7pt","x-small":"8pt",small:"10pt",medium:"12pt",large:"14pt","x-large":"18pt","xx-large":"24pt"},Gj=function(t,e){var n=Math.pow(10,e);return Math.round(t*n)/n},Kj=function(t,e){return/[0-9.]+px$/.test(t)?Gj(72*parseInt(t,10)/96,e||0)+"pt":Tt($j,t).getOr(t)},Xj=function(t){return Tt(qj,t).getOr("")},Yj=function(t){var e=function(){var e=I.none(),n=a.data,r=t.queryCommandValue("FontSize");if(r)for(var o=function(t){var o=Kj(r,t),i=Xj(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=w(I.none),i=function(e){return function(){t.undoManager.transact((function(){t.focus(),t.execCommand("FontSize",!1,e.format)}))}},u=function(t){var n=e(),r=n.matchOpt,o=n.size,i=r.fold(w(o),(function(t){return t.title}));Sa(t,BP,{text:i})},a=Nj(t,"fontsize_formats",Wj,XI.Space);return{tooltip:"Font sizes",text:I.some("12pt"),icon:I.none(),isSelectedFor:n,getPreviewFor:o,getCurrentValue:r,onAction:i,updateText:u,dataset:a,shouldHide:!1,isInvalid:T}},Jj=function(t,e){return Ej(t,e,Yj(t))},Qj=function(t,e){var n=Tj(t,e,Yj(t));t.ui.registry.addNestedMenuItem("fontsizes",{text:"Font sizes",getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})},Zj=function(t,e){var n=e(),r=$(n,(function(t){return t.format}));return I.from(t.formatter.closest(r)).bind((function(t){return tt(n,(function(e){return e.format===t}))})).orThunk((function(){return It(t.formatter.match("p"),{title:"Paragraph",format:"p"})}))},tW="Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre",eW=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 I.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=Zj(t,(function(){return i.data})),o=r.fold(w(e),(function(t){return t.title}));Sa(n,BP,{text:o})},i=Nj(t,"block_formats",tW,XI.SemiColon);return{tooltip:"Blocks",text:I.some(e),icon:I.none(),isSelectedFor:n,getCurrentValue:I.none,getPreviewFor:r,onAction:Sj(t),updateText:o,dataset:i,shouldHide:!1,isInvalid:function(e){return!t.formatter.canApply(e.format)}}},nW=function(t,e){return Ej(t,e,eW(t))},rW=function(t,e){var n=Tj(t,e,eW(t));t.ui.registry.addNestedMenuItem("blockformats",{text:"Blocks",getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})},oW=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?I.some({tag:n.length>0&&(n[0].inline||n[0].block)||"div",styles:t.dom.parseStyle(t.formatter.getCssText(e))}):I.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(RF(t),r),i=Zj(t,w(o)),u=i.fold(w(n),(function(t){return t.title}));Sa(e,BP,{text:u})};return{tooltip:"Formats",text:I.some(n),icon:I.none(),isSelectedFor:r,getCurrentValue:I.none,getPreviewFor:o,onAction:Sj(t),updateText:i,shouldHide:t.getParam("style_formats_autohide",!1,"boolean"),isInvalid:function(e){return!t.formatter.canApply(e.format)},dataset:e}},iW=function(t,e){var n=D({type:"advanced"},e.styleselect);return Ej(t,e,oW(t,n))},uW=function(t,e){var n=D({type:"advanced"},e.styleselect),r=Tj(t,e,oW(t,n));t.ui.registry.addNestedMenuItem("formats",{text:"Formats",getSubmenuItems:function(){return r.items.validateItems(r.getStyleItems())}})},aW=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=$(o,n.getSystem().build);jg(n,i)}))};return _a([Na(ta(),(function(e,r){var o=r;if(!o.universal){var i=t.channel;U(o.channels,i)&&n(e,o.data)}})),Ua((function(e,r){t.initialData.each((function(t){n(e,t)}))}))])},cW=Object.freeze({__proto__:null,events:aW}),sW=function(t,e,n){return n},fW=Object.freeze({__proto__:null,getState:sW}),lW=[Di("channel"),Hi("renderComponents"),Hi("updateState"),Hi("initialData")],dW=function(){var t=ou(I.none()),e=function(){return t.set(I.none())},n=function(){return t.get().getOr("none")};return{readState:n,get:t.get,set:t.set,clear:e}},mW=Object.freeze({__proto__:null,init:dW}),gW=pl({fields:lW,name:"reflecting",active:cW,apis:fW,state:mW}),pW=w([Di("toggleClass"),Di("fetch"),ff("onExecute"),Ki("getHotspot",I.some),Ki("getAnchorOverrides",w({})),zd(),ff("onItemExecute"),Hi("lazySink"),Di("dom"),cf("onOpen"),eh("splitDropdownBehaviours",[bA,Dw,Yw]),Ki("matchWidth",!1),Ki("useMinWidth",!1),Ki("eventOrder",{}),Hi("role")].concat(BA())),hW=Bh({factory:SC,schema:[Di("dom")],name:"arrow",defaults:function(){return{buttonBehaviours:ml([Yw.revoke()])}},overrides:function(t){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(e){e.getSystem().getByUid(t.uid).each(ka)},buttonBehaviours:ml([px.config({toggleOnExecute:!1,toggleClass:t.toggleClass})])}}}),vW=Bh({factory:SC,schema:[Di("dom")],name:"button",defaults:function(){return{buttonBehaviours:ml([Yw.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)}))}}}}),bW=w([hW,vW,Ph({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:t.text}}}},schema:[Di("text")],name:"aria-descriptor"}),Mh({schema:[of()],name:"menu",defaults:function(t){return{onExecute:function(e,n){e.getSystem().getByUid(t.uid).each((function(r){t.onItemExecute(r,e,n)}))}}}}),wA()]),yW=function(t,e,n,r){var o,i=function(t){bv.getCurrent(t).each((function(t){rb.highlightFirst(t),Dw.focusIn(t)}))},u=function(e){var n=i;EA(t,x,e,r,n,qD.HighlightFirst).get(h)},a=function(t){return u(t),I.some(!0)},c=function(e){var n=Xh(e,t,"button");return ka(n),I.some(!0)},s=D(D({},_a([Ua((function(e,n){var r=Kh(e,t,"aria-descriptor");r.each((function(t){var n=oc("aria");Hn(t.element,"id",n),Hn(e.element,"aria-describedby",n)}))}))])),vx(I.some(u))),f={repositionMenus:function(t){px.isOn(t)&&NA(t)}};return{uid:t.uid,dom:t.dom,components:e,apis:f,eventOrder:D(D({},t.eventOrder),(o={},o[ea()]=["disabling","toggling","alloy.base.behaviour"],o)),events:s,behaviours:rh(t.splitDropdownBehaviours,[bA.config({others:{sandbox:function(e){var n=Xh(e,t,"arrow"),r={onOpen:function(){px.on(n),px.on(e)},onClose:function(){px.off(n),px.off(e)}};return RA(t,e,r)}}}),Dw.config({mode:"special",onSpace:c,onEnter:c,onDown:a}),Yw.config({}),px.config({toggleOnExecute:!1,aria:{mode:"expanded"}})]),domModification:{attributes:{role:t.role.getOr("button"),"aria-haspopup":!0}}}},wW=mv({name:"SplitDropdown",configFields:pW(),partFields:bW(),factory:yW,apis:{repositionMenus:function(t,e){return t.repositionMenus(e)}}}),xW=function(t){return{isDisabled:function(){return Lv.isDisabled(t)},setDisabled:function(e){return Lv.set(t,e)}}},CW=function(t){return{setActive:function(e){px.set(t,e)},isActive:function(){return px.isOn(t)},isDisabled:function(){return Lv.isDisabled(t)},setDisabled:function(e){return Lv.set(t,e)}}},SW=function(t,e){return t.map((function(t){return{"aria-label":e.translate(t),title:e.translate(t)}})).getOr({})},kW=oc("focus-button"),OW=function(t,e,n,r,o,i){var u;return{dom:{tag:"button",classes:["tox-tbtn"].concat(e.isSome()?["tox-tbtn--select"]:[]),attributes:SW(n,i)},components:yT([t.map((function(t){return EP(t,i.icons)})),e.map((function(t){return DP(t,"tox-tbtn",i)}))]),eventOrder:(u={},u[Bu()]=["focusing","alloy.base.behaviour","common-button-display-events"],u),buttonBehaviours:ml([mT.toolbarButton(i.isDisabled),cT(),Vw("common-button-display-events",[Na(Bu(),(function(t,e){e.event.prevent(),Ca(t,kW)}))])].concat(r.map((function(n){return gW.config({channel:n,initialData:{icon:t,text:e},renderComponents:function(t,e){return yT([t.icon.map((function(t){return EP(t,i.icons)})),t.text.map((function(t){return DP(t,"tox-tbtn",i)}))])}})})).toArray()).concat(o.getOr([])))}},TW=function(t,e,n,r){var o=e.shared;return DU.sketch({lazySink:o.getSink,fetch:function(){return tA.nu((function(e){e($(n(t.items),$U))}))},markers:{toggledClass:"tox-tbtn--enabled"},parts:{button:OW(t.icon,t.text,t.tooltip,I.none(),I.none(),o.providers),toolbar:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:r}}}})},EW=function(t,e,n){var r=ou(h),o=OW(t.icon,t.text,t.tooltip,I.none(),I.none(),n);return SC.sketch({dom:o.dom,components:o.components,eventOrder:NP,buttonBehaviours:ml([Vw("toolbar-button-events",[RP({onAction:t.onAction,getApi:e.getApi}),pT(e,r),hT(e,r)]),mT.toolbarButton((function(){return t.disabled||n.isDisabled()})),cT()].concat(e.toolbarButtonBehaviours))})},_W=function(t,e){return DW(t,e,[])},DW=function(t,e,n){return EW(t,{toolbarButtonBehaviours:[].concat(n.length>0?[Vw("toolbarButtonWith",n)]:[]),getApi:xW,onSetup:t.onSetup},e)},AW=function(t,e){return RW(t,e,[])},RW=function(t,e,n){return Co(EW(t,{toolbarButtonBehaviours:[zw.config({}),px.config({toggleClass:"tox-tbtn--enabled",aria:{mode:"pressed"},toggleOnExecute:!1})].concat(n.length>0?[Vw("toolbarToggleButtonWith",n)]:[]),getApi:CW,onSetup:t.onSetup},e))},NW=function(t,e,n){return function(r){return tA.nu((function(t){return e.fetch(t)})).map((function(o){return I.from(N_(Co(n_(oc("menu-value"),o,(function(n){e.onItemAction(t(r),n)}),e.columns,e.presets,jS.CLOSE_ON_EXECUTE,e.select.getOr(T),n),{movement:o_(e.columns,e.presets),menuBehaviours:Qk.unnamedEvents("auto"!==e.columns?[]:[Ua((function(t,n){Xk(t,4,fk(e.presets)).each((function(e){var n=e.numRows,r=e.numColumns;Dw.setGridSize(t,n,r)}))}))])})))}))}},BW=function(t,e){var n,r=oc("channel-update-split-dropdown-display"),o=function(t){return{isDisabled:function(){return Lv.isDisabled(t)},setDisabled:function(e){return Lv.set(t,e)},setIconFill:function(e,n){Fs(t.element,'svg path[id="'+e+'"], rect[id="'+e+'"]').each((function(t){Hn(t,"fill",n)}))},setIconStroke:function(e,n){Fs(t.element,'svg path[id="'+e+'"], rect[id="'+e+'"]').each((function(t){Hn(t,"stroke",n)}))},setActive:function(e){Hn(t.element,"aria-pressed",e),Fs(t.element,"span").each((function(n){t.getSystem().getByDom(n).each((function(t){return px.set(t,e)}))}))},isActive:function(){return Fs(t.element,"span").exists((function(e){return t.getSystem().getByDom(e).exists(px.isOn)}))}}},i=ou(h),u={getApi:o,onSetup:t.onSetup};return wW.sketch({dom:{tag:"div",classes:["tox-split-button"],attributes:D({"aria-pressed":!1},SW(t.tooltip,e.providers))},onExecute:function(e){t.onAction(o(e))},onItemExecute:function(t,e,n){},splitDropdownBehaviours:ml([mT.splitButton(e.providers.isDisabled),cT(),Vw("split-dropdown-events",[Na(kW,Yw.focus),pT(u,i),hT(u,i)]),VA.config({})]),eventOrder:(n={},n[da()]=["alloy.base.behaviour","split-dropdown-events"],n),toggleClass:"tox-tbtn--enabled",lazySink:e.getSink,fetch:NW(o,t,e.providers),parts:{menu:hk(!1,t.columns,t.presets)},components:[wW.parts.button(OW(t.icon,t.text,I.none(),I.some(r),I.some([px.config({toggleClass:"tox-tbtn--enabled",toggleOnExecute:!1})]),e.providers)),wW.parts.arrow({dom:{tag:"button",classes:["tox-tbtn","tox-split-button__chevron"],innerHtml:RC("chevron-down",e.providers.icons)},buttonBehaviours:ml([mT.splitButton(e.providers.isDisabled),cT(),MC()])}),wW.parts["aria-descriptor"]({text:e.providers.translate("To open the popup, press Shift+Enter")})]})},MW=[{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"]}],PW=function(t,e){return function(n,r,o){var i=t(n).mapError((function(t){return Si(t)})).getOrDie();return e(i,r,o)}},IW={button:PW(TS,(function(t,e){return _W(t,e.backstage.shared.providers)})),togglebutton:PW(DS,(function(t,e){return AW(t,e.backstage.shared.providers)})),menubutton:PW(WH,(function(t,e){return GP(t,"tox-tbtn",e.backstage,I.none())})),splitbutton:PW($H,(function(t,e){return BW(t,e.backstage.shared)})),grouptoolbarbutton:PW(VH,(function(t,e,n){var r,o=n.ui.registry.getAll().buttons,i=function(t){return WW(n,{buttons:o,toolbar:t,allowToolbarGroups:!1},e,I.none())},u=(r={},r[Ld]=e.backstage.shared.header.isPositionedAtTop()?zl.TopToBottom:zl.BottomToTop,r);switch(BO(n)){case US.floating:return TW(t,e.backstage,i,u);default:throw new Error("Toolbar groups are only supported when using floating toolbar mode")}})),styleSelectButton:function(t,e){return iW(t,e.backstage)},fontsizeSelectButton:function(t,e){return Jj(t,e.backstage)},fontSelectButton:function(t,e){return Uj(t,e.backstage)},formatButton:function(t,e){return nW(t,e.backstage)},alignMenuButton:function(t,e){return Pj(t,e.backstage)}},LW=function(t,e,n){return Tt(IW,t.type).fold((function(){return I.none()}),(function(r){return I.some(r(t,e,n))}))},FW={styleselect:IW.styleSelectButton,fontsizeselect:IW.fontsizeSelectButton,fontselect:IW.fontSelectButton,formatselect:IW.formatButton,align:IW.alignMenuButton},zW=function(t){var e=$(MW,(function(e){var n=Y(e.items,(function(e){return Et(t,e)||Et(FW,e)}));return{name:e.name,items:n}}));return Y(e,(function(t){return t.items.length>0}))},HW=function(t){var e=t.split("|");return $(e,(function(t){return{items:t.trim().split(" ")}}))},VW=function(t){return p(t,(function(t){return Et(t,"name")&&Et(t,"items")}))},UW=function(t){var e=t.toolbar,n=t.buttons;return!1===e?[]:void 0===e||!0===e?zW(n):i(e)?HW(e):VW(e)?e:[]},jW=function(t,e,n,r,o,i){return Tt(e,n.toLowerCase()).orThunk((function(){return i.bind((function(t){return gt(t,(function(t){return Tt(e,t+n.toLowerCase())}))}))})).fold((function(){return Tt(FW,n.toLowerCase()).map((function(e){return e(t,o)})).orThunk((function(){return I.none()}))}),(function(e){return"grouptoolbarbutton"!==e.type||r?LW(e,o,t):I.none()}))},WW=function(t,e,n,r){var o=UW(e),i=$(o,(function(o){var i=rt(o.items,(function(o){return 0===o.trim().length?[]:jW(t,e.buttons,o,e.allowToolbarGroups,n,r).toArray()}));return{title:I.from(t.translate(o.name)),items:i}}));return Y(i,(function(t){return t.items.length>0}))},qW=function(t,e,n,r){var o=e.outerContainer,u=n.toolbar,a=n.buttons;if(p(u,i)){var c=u.map((function(e){var o={toolbar:e,buttons:a,allowToolbarGroups:n.allowToolbarGroups};return WW(t,o,{backstage:r},I.none())}));aj.setToolbars(o,c)}else aj.setToolbar(o,WW(t,n,{backstage:r},I.none()))},$W=en(),GW=$W.os.isiOS()&&$W.os.version.major<=12,KW=function(t,e){var n=t.dom,r=t.getWin(),o=t.getDoc().documentElement,i=ou(fr(r.innerWidth,r.innerHeight)),u=ou(fr(o.offsetWidth,o.offsetHeight)),a=function(){var e=i.get();e.left===r.innerWidth&&e.top===r.innerHeight||(i.set(fr(r.innerWidth,r.innerHeight)),bE(t))},c=function(){var e=t.getDoc().documentElement,n=u.get();n.left===e.offsetWidth&&n.top===e.offsetHeight||(u.set(fr(e.offsetWidth,e.offsetHeight)),bE(t))},s=function(e){return yE(t,e)};n.bind(r,"resize",a),n.bind(r,"scroll",s);var f=ad(ee.fromDom(t.getBody()),"load",c),l=e.uiMothership.element;t.on("hide",(function(){Kn(l,"display","none")})),t.on("show",(function(){nr(l,"display")})),t.on("NodeChange",c),t.on("remove",(function(){f.unbind(),n.unbind(r,"resize",a),n.unbind(r,"scroll",s),r=null}))},XW=function(t,e,n,r,o){var i=ou(0),u=e.outerContainer;yj(t);var a=ee.fromDom(o.targetNode),c=An(Dn(a));Yg(a,e.mothership),Xg(c,e.uiMothership),t.on("PostRender",(function(){qW(t,e,n,r),i.set(t.getWin().innerWidth),aj.setMenubar(u,dj(t,n)),aj.setSidebar(u,n.sidebar),KW(t,e)}));var s=aj.getSocket(u).getOrDie("Could not find expected socket element");if(GW){Xn(s.element,{overflow:"scroll","-webkit-overflow-scrolling":"touch"});var f=jC((function(){t.fire("ScrollContent")}),20),l=ud(s.element,"scroll",f.throttle);t.on("remove",l.unbind)}aT(t,e),t.addCommand("ToggleSidebar",(function(e,n){aj.toggleSidebar(u,n),t.fire("ToggleSidebar")})),t.addQueryValueHandler("ToggleSidebar",(function(){return aj.whichSidebar(u)}));var d=BO(t),m=function(){aj.refreshToolbar(e.outerContainer)};d!==US.sliding&&d!==US.floating||t.on("ResizeWindow ResizeEditor ResizeContent",(function(){var e=t.getWin().innerWidth;e!==i.get()&&(m(),i.set(e))}));var g={enable:function(){uT(e,!1)},disable:function(){uT(e,!0)},isDisabled:function(){return Lv.isDisabled(u)}};return{iframeContainer:s.element.dom,editorContainer:u.element.dom,api:g}},YW=Object.freeze({__proto__:null,render:XW}),JW=function(t){var e=/^[0-9\.]+(|px)$/i;return e.test(""+t)?I.some(parseInt(""+t,10)):I.none()},QW=function(t){return g(t)?t+"px":t},ZW=function(t,e,n){var r=e.filter((function(e){return te}));return r.or(o).getOr(t)},tq=function(t){var e=vO(t),n=wO(t),r=CO(t);return JW(e).map((function(t){return ZW(t,n,r)}))},eq=function(t){var e=tq(t);return e.getOr(vO(t))},nq=function(t){var e=bO(t),n=yO(t),r=xO(t);return JW(e).map((function(t){return ZW(t,n,r)}))},rq=function(t){var e=nq(t);return e.getOr(bO(t))},oq=function(t,e,n,r,o){var i=n.uiMothership,u=n.outerContainer,a=dO.DOM,c=UO(t),s=qO(t),f=xO(t).or(nq(t)),l=r.shared.header,d=l.isPositionedAtTop,m=BO(t),g=m===US.sliding||m===US.floating,p=ou(!1),h=function(){return p.get()&&!t.removed},v=function(t){return g?t.fold(w(0),(function(t){return t.components().length>1?ur(t.components()[1].element):0})):0},b=function(n){switch(IO(t)){case NO.auto:var r=aj.getToolbar(u),o=v(r),i=ur(n.element)-o,a=Jr(e),c=a.y>i;if(c)return"top";var s=pn(e),f=Math.max(s.dom.scrollHeight,ur(s)),l=a.bottom=n&&t.bottom-e.y>=n},xq=function(t){var e=t.getBoundingClientRect();if(e.height<=0&&e.width<=0){var n=On(ee.fromDom(t.startContainer),t.startOffset).element,r=le(n)?vn(n):I.some(n);return r.filter(fe).map((function(t){return t.dom.getBoundingClientRect()})).getOr(e)}return e},Cq=function(t){var e=t.selection.getRng(),n=xq(e);if(t.inline){var r=Lr();return Yr(r.left+n.left,r.top+n.top,n.width,n.height)}var o=Qr(ee.fromDom(t.getBody()));return Yr(o.x+n.left,o.y+n.top,n.width,n.height)},Sq=function(t,e){return e.filter(In).map(Qr).getOrThunk((function(){return Cq(t)}))},kq=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}},Oq=function(t,e,n,r,o,i){var u=ee.fromDom(t.getContainer()),a=Fs(u,".tox-editor-header").getOr(u),c=Jr(a),s=c.y>=e.bottom,f=r&&!s;if(t.inline&&f)return{y:Math.max(c.bottom+i,n.y),bottom:n.bottom};if(t.inline&&!f)return{y:n.y,bottom:Math.min(c.y-i,n.bottom)};var l="line"===o?Jr(u):e;return f?{y:Math.max(c.bottom+i,n.y),bottom:Math.min(l.bottom-i,n.bottom)}:{y:Math.max(l.y+i,n.y),bottom:Math.min(c.y-i,n.bottom)}},Tq=function(t,e,n,r){void 0===r&&(r=0);var o=Vr(window),i=Jr(ee.fromDom(t.getContentAreaContainer())),u=_O(t)||DO(t)||RO(t),a=kq(i,o,r),c=a.x,s=a.width;if(t.inline&&!u)return Yr(c,o.y,s,o.height);var f=e.header.isPositionedAtTop(),l=Oq(t,i,o,f,n,r),d=l.y,m=l.bottom;return Yr(c,d,s,m-d)},Eq=12,_q={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"]},Dq={maxHeightFunction:Ed(),maxWidthFunction:xU()},Aq=function(t,e){var n=t.selection.getRng(),r=On(ee.fromDom(n.startContainer),n.startOffset);return n.startContainer===n.endContainer&&n.startOffset===n.endOffset-1&&sn(r.element,e)},Rq=function(t,e,n){var r=Zn(t,"position");Kn(t,"position",e);var o=n(t);return r.each((function(e){return Kn(t,"position",e)})),o},Nq=function(t){return"node"===t},Bq=function(t,e,n,r,o){var i=Cq(t),u=r.lastElement().exists((function(t){return sn(n,t)}));if(Aq(t,n))return u?bC:mC;if(u)return Rq(e,r.getMode(),(function(){var t=wq(i,Jr(e));return t&&!r.isReposition()?wC:bC}));var a="fixed"===r.getMode()?o.y+Lr().top:o.y,c=ur(e)+Eq;return a+c<=i.y?mC:gC},Mq=function(t,e,n,r){var o=function(e){return function(r,o,i,u,a){var c=Bq(t,u,e,n,a),s=D(D({},r),{y:a.y,height:a.height});return D(D({},c(s,o,i,u,a)),{alwaysFit:!0})}},i=function(t){return Nq(r)?[o(t)]:[]},u={onLtr:function(t){return[$f,Gf,Wf,Uf,qf,jf].concat(i(t))},onRtl:function(t){return[$f,Gf,qf,jf,Wf,Uf].concat(i(t))}},a={onLtr:function(t){return[Gf,Uf,jf,Wf,qf,$f].concat(i(t))},onRtl:function(t){return[Gf,jf,Uf,qf,Wf,$f].concat(i(t))}};return e?a:u},Pq=function(t,e,n,r){return"line"===e?{bubble:Nd(Eq,0,_q),layouts:{onLtr:function(){return[Kf]},onRtl:function(){return[Xf]}},overrides:Dq}:{bubble:Nd(0,Eq,_q,1/Eq),layouts:Mq(t,n,r,e),overrides:Dq}},Iq=function(t,e){var n=Y(e,(function(e){return e.predicate(t.dom)})),r=X(n,(function(t){return"contexttoolbar"===t.type})),o=r.pass,i=r.fail;return{contextToolbars:o,contextForms:i}},Lq=function(t){if(t.length<=1)return t;var e=function(e){return j(t,(function(t){return t.position===e}))},n=function(e){return Y(t,(function(t){return t.position===e}))},r=e("selection"),o=e("node");if(r||o){if(o&&r){var i=n("node"),u=$(n("selection"),(function(t){return D(D({},t),{position:"node"})}));return i.concat(u)}return n(r?"selection":"node")}return n("line")},Fq=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 Y(t,(function(t){return t.position===e}))}))},zq=function(t,e,n){var r=Iq(t,e);if(r.contextForms.length>0)return I.some({elem:t,toolbars:[r.contextForms[0]]});var o=Iq(t,n);if(o.contextForms.length>0)return I.some({elem:t,toolbars:[o.contextForms[0]]});if(r.contextToolbars.length>0||o.contextToolbars.length>0){var i=Lq(r.contextToolbars.concat(o.contextToolbars));return I.some({elem:t,toolbars:i})}return I.none()},Hq=function(t,e,n){return t(e)?I.none():yu(e,(function(t){if(fe(t)){var e=Iq(t,n.inNodeScope),r=e.contextToolbars,o=e.contextForms,i=o.length>0?o:Fq(r);return i.length>0?I.some({elem:t,toolbars:i}):I.none()}return I.none()}),t)},Vq=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)?I.none():zq(i,t.inNodeScope,t.inEditorScope).orThunk((function(){return Hq(r,i,t)}))},Uq=function(t,e){var n={},r=[],o=[],i={},u={},a=function(t,a){var c=xi(LS(a));n[t]=c,c.launch.map((function(n){i["form:"+t]=D(D({},a.launch),{type:"contextformtogglebutton"===n.type?"togglebutton":"button",onAction:function(){e(c)}})})),"editor"===c.scope?o.push(c):r.push(c),u[t]=c},c=function(t,e){zS(e).each((function(n){"editor"===e.scope?o.push(n):r.push(n),u[t]=n}))},s=pt(t);return G(s,(function(e){var n=t[e];"contextform"===n.type?a(e,n):"contexttoolbar"===n.type&&c(e,n)})),{forms:n,inNodeScope:r,inEditorScope:o,lookupTable:u,formNavigators:i}},jq=oc("forward-slide"),Wq=oc("backward-slide"),qq=oc("change-slide-event"),$q="tox-pop--resizing",Gq=function(t){var e=ou([]);return eC.sketch({dom:{tag:"div",classes:["tox-pop"]},fireDismissalEventInstead:{event:"doNotDismissYet"},onShow:function(t){e.set([]),eC.getContent(t).each((function(t){nr(t.element,"visibility")})),as(t.element,$q),nr(t.element,"width")},inlineBehaviours:ml([Vw("context-toolbar-events",[Va($u(),(function(t,e){"width"===e.event.raw.propertyName&&(as(t.element,$q),nr(t.element,"width"))})),Na(qq,(function(t,e){var n=t.element;nr(n,"width");var r=vr(n);eC.setContent(t,e.event.contents),is(n,$q);var o=vr(n);Kn(n,"width",r+"px"),eC.getContent(t).each((function(t){e.event.focus.bind((function(t){return Sl(t),El(n)})).orThunk((function(){return Dw.focusIn(t),Tl(Dn(n))}))})),xC.setTimeout((function(){Kn(t.element,"width",o+"px")}),0)})),Na(jq,(function(t,n){eC.getContent(t).each((function(n){e.set(e.get().concat([{bar:n,focus:Tl(Dn(t.element))}]))})),Sa(t,qq,{contents:n.event.forwardContents,focus:I.none()})})),Na(Wq,(function(t,n){dt(e.get()).each((function(n){e.set(e.get().slice(0,e.get().length-1)),Sa(t,qq,{contents:_s(n.bar),focus:n.focus})}))}))]),Dw.config({mode:"special",onEscape:function(n){return dt(e.get()).fold((function(){return t.onEscape()}),(function(t){return Ca(n,Wq),I.some(!0)}))}})]),lazySink:function(){return ro.value(t.sink)}})},Kq="tox-pop--transition",Xq=function(t,e,n,r){var o=r.backstage,i=o.shared,u=en().deviceType.isTouch,a=od(),c=od(),s=od(),f=Es(Gq({sink:n,onEscape:function(){return t.focus(),I.some(!0)}})),l=function(){var e=s.get().getOr("node"),n=Nq(e)?1:0;return Tq(t,i,e,n)},d=function(){return!t.removed&&!(u()&&o.isContextMenuOpen())},m=function(t){return Dt(Bt(t,a.get(),sn),!0)},g=function(){if(d()){var e=l(),n=Dt(s.get(),"node")?Sq(t,a.get()):Cq(t);return e.height<=0||!wq(n,e)}return!0},p=function(){a.clear(),c.clear(),s.clear(),eC.hide(f)},v=function(){if(eC.isOpen(f)){var t=f.element;nr(t,"display"),g()?Kn(t,"display","none"):(c.set(0),eC.reposition(f))}},b=function(e){return{dom:{tag:"div",classes:["tox-pop__dialog"]},components:[e],behaviours:ml([Dw.config({mode:"acyclic"}),Vw("pop-dialog-wrap-events",[Ua((function(e){t.shortcuts.add("ctrl+F9","focus statusbar",(function(){return Dw.focusIn(e)}))})),ja((function(e){t.shortcuts.remove("ctrl+F9")}))])])}},y=ge((function(){return Uq(e,(function(t){var e=C([t]);Sa(f,jq,{forwardContents:b(e)})}))})),w=function(e,n){return WW(t,{buttons:e,toolbar:n.items,allowToolbarGroups:!1},r,I.some(["form:"]))},x=function(t,e){return yq.buildInitGroups(t,e)},C=function(e){var n=t.ui.registry.getAll().buttons,r=y(),o=D(D({},n),r.formNavigators),u=BO(t)===US.scrolling?US.scrolling:US.default,a=nt($(e,(function(t){return"contexttoolbar"===t.type?w(o,t):x(t,i.providers)})));return JU({type:u,uid:oc("context-toolbar"),initGroups:a,onEscape:I.none,cyclicKeying:!0,providers:i.providers})},S=function(e,r){var o="node"===e?i.anchors.node(r):i.anchors.cursor(),s=Pq(t,e,u(),{lastElement:a.get,isReposition:function(){return Dt(c.get(),0)},getMode:function(){return Fg.getMode(n)}});return Co(o,s)},k=function(t,e){if(O.cancel(),d()){var r=C(t),o=t[0].position,i=S(o,e);s.set(o),c.set(1);var u=f.element;nr(u,"display"),m(e)||(as(u,Kq),Fg.reset(n,f)),eC.showWithinBounds(f,b(r),{anchor:i,transition:{classes:[Kq],mode:"placement"}},(function(){return I.some(l())})),e.fold(a.clear,a.set),g()&&Kn(u,"display","none")}},O=WC((function(){if(t.hasFocus()&&!t.removed)if(cs(f.element,Kq))O.throttle();else{var e=y();Vq(e,t).fold(p,(function(t){k(t.toolbars,I.some(t.elem))}))}}),17);t.on("init",(function(){t.on("remove",p),t.on("ScrollContent ScrollWindow ObjectResized ResizeEditor longpress",v),t.on("click keyup focus SetContent",O.throttle),t.on(fq,p),t.on(sq,(function(e){var n=y();Tt(n.lookupTable,e.toolbarKey).each((function(n){k([n],It(e.target!==t,e.target)),eC.getContent(f).each(Dw.focusIn)}))})),t.on("focusout",(function(e){xC.setEditorTimeout(t,(function(){El(n.element).isNone()&&El(f.element).isNone()&&p()}),0)})),t.on("SwitchMode",(function(){t.mode.isReadOnly()&&p()})),t.on("AfterProgressState",(function(e){e.state?p():t.hasFocus()&&O.throttle()})),t.on("NodeChange",(function(t){El(f.element).fold(O.throttle,h)}))}))},Yq=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"}];G(e,(function(e){t.ui.registry.addToggleButton(e.name,{tooltip:e.text,icon:e.icon,onAction:kj(t,e.cmd),onSetup:xj(t,e.name)})})),t.ui.registry.addButton("alignnone",{tooltip:"No alignment",icon:"align-none",onAction:kj(t,"JustifyNone")})},Jq={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:[""]},Qq=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("|"),u="[+-]?(?:"+i+")";return new RegExp("^("+u+")(.*)$")}(),Zq=function(t,e){return j(e,(function(e){return j(Jq[e],(function(e){return t===e}))}))},t$=function(t,e){var n=I.from(Qq.exec(t));return n.bind((function(t){var n=Number(t[1]),r=t[2];return Zq(r,e)?I.some({value:n,unit:r}):I.none()}))},e$=function(t,e){return t$(t,e).map((function(t){var e=t.value,n=t.unit;return e+n}))},n$=function(t,e){var n=function(){var n=e.getOptions(t),r=e.getCurrent(t).map(e.hash),o=od();return $(n,(function(n){return{type:"togglemenuitem",text:e.display(n),onSetup:function(i){var u=function(t){t&&(o.on((function(t){return t.setActive(!1)})),o.set(i)),i.setActive(t)};u(Dt(r,e.hash(n)));var a=e.watcher(t,n,u);return function(){o.clear(),a()}},onAction:function(){return e.setCurrent(t,n)}}}))};t.ui.registry.addMenuButton(e.name,{tooltip:e.text,icon:e.icon,fetch:function(t){return t(n())},onSetup:e.onToolbarSetup}),t.ui.registry.addNestedMenuItem(e.name,{type:"nestedmenuitem",text:e.text,getSubmenuItems:n,onSetup:e.onMenuSetup})},r$={name:"lineheight",text:"Line height",icon:"line-height",getOptions:OO,hash:function(t){return e$(t,["fixed","relative","empty"]).getOr(t)},display:x,watcher:function(t,e,n){return t.formatter.formatChanged("lineheight",n,!1,{value:e}).unbind},getCurrent:function(t){return I.from(t.queryCommandValue("LineHeight"))},setCurrent:function(t,e){return t.execCommand("LineHeight",!1,e)}},o$=function(t){var e=I.from(TO(t));return e.map((function(e){return{name:"language",text:"Language",icon:"language",getOptions:w(e),hash:function(t){return f(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 wu(e,(function(t){return I.some(t).filter(fe).bind((function(t){var e=jn(t,"lang");return e.map((function(e){var n=jn(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}}}))},i$=function(t){n$(t,r$),o$(t).each((function(e){return n$(t,e)}))},u$=function(t,e){Ij(t,e),jj(t,e),uW(t,e),rW(t,e),Qj(t,e)},a$=function(t){return Cj(t,"NodeChange",(function(e){e.setDisabled(!t.queryCommandState("outdent"))}))},c$=function(t){t.ui.registry.addButton("outdent",{tooltip:"Decrease indent",icon:"outdent",onSetup:a$(t),onAction:kj(t,"outdent")}),t.ui.registry.addButton("indent",{tooltip:"Increase indent",icon:"indent",onAction:kj(t,"indent")})},s$=function(t){c$(t)},f$=function(t,e){return function(){t.execCommand("mceToggleFormat",!1,e)}},l$=function(t){QB.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:xj(t,e.name),onAction:f$(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:xj(t,n),onAction:f$(t,n)})}},d$=function(t){QB.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:kj(t,e.action)})}))},m$=function(t){QB.each([{name:"blockquote",text:"Blockquote",action:"mceBlockQuote",icon:"quote"}],(function(e){t.ui.registry.addToggleButton(e.name,{tooltip:e.text,icon:e.icon,onAction:kj(t,e.action),onSetup:xj(t,e.name)})}))},g$=function(t){l$(t),d$(t),m$(t)},p$=function(t){QB.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:kj(t,e.action)})})),t.ui.registry.addMenuItem("codeformat",{text:"Code",icon:"sourcecode",onAction:f$(t,"code")})},h$=function(t){g$(t),p$(t)},v$=function(t,e){return Cj(t,"Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",(function(n){n.setDisabled(t.mode.isReadOnly()||!t.undoManager[e]())}))},b$=function(t){t.ui.registry.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onSetup:v$(t,"hasUndo"),onAction:kj(t,"undo")}),t.ui.registry.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onSetup:v$(t,"hasRedo"),onAction:kj(t,"redo")})},y$=function(t){t.ui.registry.addButton("undo",{tooltip:"Undo",icon:"undo",disabled:!0,onSetup:v$(t,"hasUndo"),onAction:kj(t,"undo")}),t.ui.registry.addButton("redo",{tooltip:"Redo",icon:"redo",disabled:!0,onSetup:v$(t,"hasRedo"),onAction:kj(t,"redo")})},w$=function(t){b$(t),y$(t)},x$=function(t){return Cj(t,"VisualAid",(function(e){e.setActive(t.hasVisual)}))},C$=function(t){t.ui.registry.addToggleMenuItem("visualaid",{text:"Visual aids",onSetup:x$(t),onAction:kj(t,"mceToggleVisualAid")})},S$=function(t){t.ui.registry.addButton("visualaid",{tooltip:"Visual aids",text:"Visual aids",onAction:kj(t,"mceToggleVisualAid")})},k$=function(t){S$(t),C$(t)},O$=function(t,e){Yq(t),h$(t),u$(t,e),w$(t),e_(t),k$(t),s$(t),i$(t)},T$=function(t,e){return{type:"makeshift",x:t,y:e}},E$=function(t,e,n){return T$(t.x+e,t.y+n)},_$=function(t){return"longpress"===t.type||0===t.type.indexOf("touch")},D$=function(t){if(_$(t)){var e=t.touches[0];return T$(e.pageX,e.pageY)}return T$(t.pageX,t.pageY)},A$=function(t){if(_$(t)){var e=t.touches[0];return T$(e.clientX,e.clientY)}return T$(t.clientX,t.clientY)},R$=function(t,e){var n=dO.DOM.getPos(t);return E$(e,n.x,n.y)},N$=function(t,e){return"contextmenu"===e.type||"longpress"===e.type?t.inline?D$(e):R$(t.getContentAreaContainer(),A$(e)):B$(t)},B$=function(t){return{type:"selection",root:ee.fromDom(t.selection.getNode())}},M$=function(t){return{type:"node",node:I.some(ee.fromDom(t.selection.getNode())),root:ee.fromDom(t.getBody())}},P$=function(t,e,n){switch(n){case"node":return M$(t);case"point":return N$(t,e);case"selection":return B$(t)}},I$=function(t,e,n,r,o,i){var u=n(),a=P$(t,e,i);qP(u,jS.CLOSE_ON_EXECUTE,r,!1).map((function(t){e.preventDefault(),eC.showMenuAt(o,{anchor:a},{menu:{markers:mk("normal")},data:t})}))},L$={onLtr:function(){return[Gf,Uf,jf,Wf,qf,$f,mC,gC,dC,fC,lC,sC]},onRtl:function(){return[Gf,jf,Uf,qf,Wf,$f,mC,gC,lC,sC,dC,fC]}},F$=12,z$={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"]},H$=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=ng(t.getWin(),km.domRange(o));return i.exists((function(t){return t.left<=r.clientX&&t.right>=r.clientX&&t.top<=r.clientY&&t.bottom>=r.clientY}))},V$=function(t){var e=t.selection.getRng(),n=function(){xC.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)}},U$=function(t,e,n){var r=P$(t,e,n),o="point"===n?F$:0;return D({bubble:Nd(0,o,z$),layouts:L$,overrides:{maxWidthFunction:xU(),maxHeightFunction:Ed()}},r)},j$=function(t,e,n,r,o,i,u){var a=U$(t,e,i);qP(n,jS.CLOSE_ON_EXECUTE,r,!0).map((function(n){e.preventDefault(),eC.showMenuWithinBounds(o,{anchor:a},{menu:{markers:mk("normal"),highlightImmediately:u},data:n,type:"horizontal"},(function(){return I.some(Tq(t,r.shared,"node"===i?"node":"selection"))})),t.fire(fq)}))},W$=function(t,e,n,r,o,i){var u=en(),a=u.os.isiOS(),c=u.os.isOSX(),s=u.os.isAndroid(),f=u.deviceType.isTouch(),l=function(){return!(s||a||c&&f)},d=function(){var u=n();j$(t,e,u,r,o,i,l())};if((c||a)&&"node"!==i){var m=function(){V$(t),d()};H$(t,e)?m():(t.once("selectionchange",m),t.once("touchend",(function(){return t.off("selectionchange",m)})))}else d()},q$=function(t){return"string"===typeof t?t.split(/[ ,]/):t},$$=function(t){return t.getParam("contextmenu_never_use_native",!1,"boolean")},G$=function(t,e,n){var r=t.ui.registry.getAll().contextMenus;return I.from(t.getParam(e)).map(q$).getOrThunk((function(){return Y(q$(n),(function(t){return Et(r,t)}))}))},K$=function(t){return!1===t.getParam("contextmenu")},X$=function(t){return G$(t,"contextmenu","link linkchecker image imagetools table spellchecker configurepermanentpen")},Y$=function(t){return t.getParam("contextmenu_avoid_overlap","","string")},J$=function(t){return i(t)?"|"===t:"separator"===t.type},Q$={type:"separator"},Z$=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 Q$;case"submenu":return D(D({type:"nestedmenuitem"},e(t)),{getSubmenuItems:function(){var e=t.getSubmenuItems();return i(e)?e:$(e,Z$)}});default:return D(D({type:"menuitem"},e(t)),{onAction:v(t.onAction)})}},tG=function(t,e){if(0===e.length)return t;var n=dt(t).filter((function(t){return!J$(t)})),r=n.fold((function(){return[]}),(function(t){return[Q$]}));return t.concat(r).concat(e).concat([Q$])},eG=function(t,e,n){var r=Q(e,(function(e,r){return Tt(t,r.toLowerCase()).map((function(t){var r=t.update(n);if(i(r))return tG(e,r.split(" "));if(r.length>0){var o=$(r,Z$);return tG(e,o)}return e})).getOrThunk((function(){return e.concat([r])}))}),[]);return r.length>0&&J$(r[r.length-1])&&r.pop(),r},nG=function(t,e){return e.ctrlKey&&!$$(t)},rG=function(t,e){return"longpress"!==e.type&&(2!==e.button||e.target===t.getBody()&&""===e.pointerType)},oG=function(t,e){return rG(t,e)?t.selection.getStart(!0):e.target},iG=function(t,e){var n=Y$(t),r=rG(t,e)?"selection":"point";if(Gt(n)){var o=oG(t,e),i=I_(ee.fromDom(o),n);return i?"node":r}return r},uG=function(t,e,n){var r=en(),o=r.deviceType.isTouch,i=Es(eC.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:ml([Vw("dismissContextMenu",[Na(ga(),(function(e,n){bp.close(e),t.focus()}))])])})),u=function(t){return eC.hide(i)},a=function(e){if($$(t)&&e.preventDefault(),!nG(t,e)&&!K$(t)){var r=iG(t,e),u=function(){var n=oG(t,e),r=t.ui.registry.getAll(),o=X$(t);return eG(r.contextMenus,o,n)},a=o()?W$:I$;a(t,e,u,n,i,r)}};t.on("init",(function(){var e="ResizeEditor ScrollContent ScrollWindow longpresscancel"+(o()?"":" ResizeWindow");t.on(e,u),t.on("longpress contextmenu",a)}))},aG=uu.generate([{offset:["x","y"]},{absolute:["x","y"]},{fixed:["x","y"]}]),cG=function(t){return function(e){return e.translate(-t.left,-t.top)}},sG=function(t){return function(e){return e.translate(t.left,t.top)}},fG=function(t){return function(e,n){return Q(t,(function(t,e){return e(t)}),fr(e,n))}},lG=function(t,e,n){return t.fold(fG([sG(n),cG(e)]),fG([cG(e)]),fG([]))},dG=function(t,e,n){return t.fold(fG([sG(n)]),fG([]),fG([sG(e)]))},mG=function(t,e,n){return t.fold(fG([]),fG([cG(n)]),fG([sG(e),cG(n)]))},gG=function(t,e,n,r,o,i){var u=dG(t,o,i),a=dG(e,o,i);return Math.abs(u.left-a.left)<=n&&Math.abs(u.top-a.top)<=r},pG=function(t,e,n,r,o,i){var u=dG(t,o,i),a=dG(e,o,i),c=Math.abs(u.left-a.left),s=Math.abs(u.top-a.top);return fr(c,s)},hG=function(t,e,n){var r=t.fold((function(t,e){return{position:I.some("absolute"),left:I.some(t+"px"),top:I.some(e+"px")}}),(function(t,e){return{position:I.some("absolute"),left:I.some(t-n.left+"px"),top:I.some(e-n.top+"px")}}),(function(t,e){return{position:I.some("fixed"),left:I.some(t+"px"),top:I.some(e+"px")}}));return D({right:I.none(),bottom:I.none()},r)},vG=function(t,e,n){return t.fold((function(t,r){return yG(t+e,r+n)}),(function(t,r){return wG(t+e,r+n)}),(function(t,r){return xG(t+e,r+n)}))},bG=function(t,e,n,r){var o=function(t,o){return function(i,u){var a=t(e,n,r);return o(i.getOr(a.left),u.getOr(a.top))}};return t.fold(o(mG,yG),o(dG,wG),o(lG,xG))},yG=aG.offset,wG=aG.absolute,xG=aG.fixed,CG=function(t,e){var n=Un(t,e);return f(n)?NaN:parseInt(n,10)},SG=function(t,e){var n=t.element,r=CG(n,e.leftAttr),o=CG(n,e.topAttr);return isNaN(r)||isNaN(o)?I.none():I.some(fr(r,o))},kG=function(t,e,n){var r=t.element;Hn(r,e.leftAttr,n.left+"px"),Hn(r,e.topAttr,n.top+"px")},OG=function(t,e){var n=t.element;qn(n,e.leftAttr),qn(n,e.topAttr)},TG=function(t,e,n,r){return SG(t,e).fold((function(){return n}),(function(t){return xG(t.left+r.left,t.top+r.top)}))},EG=function(t,e,n,r,o,i){var u=TG(t,e,n,r),a=e.mustSnap?AG(t,e,u,o,i):RG(t,e,u,o,i),c=lG(u,o,i);return kG(t,e,c),a.fold((function(){return{coord:xG(c.left,c.top),extra:I.none()}}),(function(t){return{coord:t.output,extra:t.extra}}))},_G=function(t,e){OG(t,e)},DG=function(t,e,n,r){return gt(t,(function(t){var o=t.sensor,i=gG(e,o,t.range.left,t.range.top,n,r);return i?I.some({output:bG(t.output,e,n,r),extra:t.extra}):I.none()}))},AG=function(t,e,n,r,o){var i=e.getSnapPoints(t),u=DG(i,n,r,o);return u.orThunk((function(){var t=Q(i,(function(t,e){var i=e.sensor,u=pG(n,i,e.range.left,e.range.top,r,o);return t.deltas.fold((function(){return{deltas:I.some(u),snap:I.some(e)}}),(function(n){var r=(u.left+u.top)/2,o=(n.left+n.top)/2;return r<=o?{deltas:I.some(u),snap:I.some(e)}:t}))}),{deltas:I.none(),snap:I.none()});return t.snap.map((function(t){return{output:bG(t.output,n,r,o),extra:t.extra}}))}))},RG=function(t,e,n,r,o){var i=e.getSnapPoints(t);return DG(i,n,r,o)},NG=function(t,e,n){return{coord:bG(t.output,t.output,e,n),extra:t.extra}},BG=function(t,e,n,r){var o=e.getTarget(t.element);if(e.repositionTarget){var i=mn(t.element),u=Lr(i),a=qz(o),c=NG(r,u,a),s=hG(c.coord,u,a);Yn(o,s)}},MG=Object.freeze({__proto__:null,snapTo:BG}),PG="data-initial-z-index",IG=function(t){vn(t.element).filter(fe).each((function(t){jn(t,PG).fold((function(){return nr(t,"z-index")}),(function(e){return Kn(t,"z-index",e)})),qn(t,PG)}))},LG=function(t){vn(t.element).filter(fe).each((function(e){Zn(e,"z-index").each((function(t){Hn(e,PG,t)})),Kn(e,"z-index",Jn(t.element,"z-index"))}))},FG=function(t,e){t.getSystem().addToGui(e),LG(e)},zG=function(t){IG(t),t.getSystem().removeFromGui(t)},HG=function(t,e,n){return t.getSystem().build(sD.sketch({dom:{styles:{left:"0px",top:"0px",width:"100%",height:"100%",position:"fixed","z-index":"1000000000000000"},classes:[e]},events:n}))},VG=$i("snaps",[Di("getSnapPoints"),cf("onSensor"),Di("leftAttr"),Di("topAttr"),Ki("lazyViewport",Zr),Ki("mustSnap",!1)]),UG=[Ki("useFixed",T),Di("blockerClass"),Ki("getTarget",x),Ki("onDrag",h),Ki("repositionTarget",!0),Ki("onDrop",h),tu("getBounds",Zr),VG],jG=function(t){return Mt(Zn(t,"left"),Zn(t,"top"),Zn(t,"position"),(function(t,e,n){var r="fixed"===n?xG:yG;return r(parseInt(t,10),parseInt(e,10))})).getOrThunk((function(){var e=mr(t);return wG(e.left,e.top)}))},WG=function(t,e,n,r,o){var i=o.bounds,u=dG(e,n,r),a=Df(u.left,i.x,i.x+i.width-o.width),c=Df(u.top,i.y,i.y+i.height-o.height),s=wG(a,c);return e.fold((function(){var t=mG(s,n,r);return yG(t.left,t.top)}),w(s),(function(){var t=lG(s,n,r);return xG(t.left,t.top)}))},qG=function(t,e,n,r,o,i,u){var a=e.fold((function(){var t=vG(n,i.left,i.top),e=lG(t,r,o);return xG(e.left,e.top)}),(function(e){var u=EG(t,e,n,i,r,o);return u.extra.each((function(n){e.onSensor(t,n)})),u.coord}));return WG(t,a,r,o,u)},$G=function(t,e,n,r){var o=e.getTarget(t.element);if(e.repositionTarget){var i=mn(t.element),u=Lr(i),a=qz(o),c=jG(o),s=qG(t,e.snaps,c,u,a,r,n),f=hG(s,u,a);Yn(o,f)}e.onDrag(t,o,r)},GG=function(t,e){return{bounds:t.getBounds(),height:ar(e.element),width:br(e.element)}},KG=function(t,e,n,r,o){var i=n.update(r,o),u=n.getStartData().getOrThunk((function(){return GG(e,t)}));i.each((function(n){$G(t,e,u,n)}))},XG=function(t,e,n,r){e.each(zG),n.snaps.each((function(e){_G(t,e)}));var o=n.getTarget(t.element);r.reset(),n.onDrop(t,o)},YG=function(t){return function(e,n){var r=function(t){n.setStartData(GG(e,t))};return _a(R([Na(fa(),(function(t){n.getStartData().each((function(){return r(t)}))}))],t(e,n,r),!0))}},JG=function(t){return _a([Na(Bu(),t.forceDrop),Na(Iu(),t.drop),Na(Mu(),(function(e,n){t.move(n.event)})),Na(Pu(),t.delayDrop)])},QG=function(t){return I.from(fr(t.x,t.y))},ZG=function(t,e){return fr(e.left-t.left,e.top-t.top)},tK=Object.freeze({__proto__:null,getData:QG,getDelta:ZG}),eK=function(t,e,n){return[Na(Bu(),(function(r,o){var i=o.event.raw;if(0===i.button){o.stop();var u=function(){return XG(r,I.some(s),t,e)},a=L_(u,200),c={drop:u,delayDrop:a.schedule,forceDrop:u,move:function(n){a.cancel(),KG(r,t,e,tK,n)}},s=HG(r,t.blockerClass,JG(c)),f=function(){n(r),FG(r,s)};f()}}))]},nK=R(R([],UG,!0),[df("dragger",{handlers:YG(eK)})],!1),rK=function(t){return _a([Na(Du(),t.forceDrop),Na(Ru(),t.drop),Na(Nu(),t.drop),Na(Au(),(function(e,n){t.move(n.event)}))])},oK=function(t){var e=t[0];return I.some(fr(e.clientX,e.clientY))},iK=function(t){var e=t.raw,n=e.touches;return 1===n.length?oK(n):I.none()},uK=function(t,e){return fr(e.left-t.left,e.top-t.top)},aK=Object.freeze({__proto__:null,getData:iK,getDelta:uK}),cK=function(t,e,n){var r=od(),o=function(n){XG(n,r.get(),t,e),r.clear()};return[Na(Du(),(function(i,u){u.stop();var a=function(){return o(i)},c={drop:a,delayDrop:h,forceDrop:a,move:function(n){KG(i,t,e,aK,n)}},s=HG(i,t.blockerClass,rK(c));r.set(s);var f=function(){n(i),FG(i,s)};f()})),Na(Au(),(function(n,r){r.stop(),KG(n,t,e,aK,r.event)})),Na(Ru(),(function(t,e){e.stop(),o(t)})),Na(Nu(),o)]},sK=R(R([],UG,!0),[df("dragger",{handlers:YG(cK)})],!1),fK=function(t,e,n){return R(R([],eK(t,e,n),!0),cK(t,e,n),!0)},lK=R(R([],UG,!0),[df("dragger",{handlers:YG(fK)})],!1),dK=nK,mK=sK,gK=lK,pK=Object.freeze({__proto__:null,mouse:dK,touch:mK,mouseOrTouch:gK}),hK=function(){var t=I.none(),e=I.none(),n=function(){t=I.none(),e=I.none()},r=function(e,n){var r=t.map((function(t){return e.getDelta(t,n)}));return t=I.some(n),r},o=function(t,e){return t.getData(e).bind((function(e){return r(t,e)}))},i=function(t){e=I.some(t)},u=function(){return e},a=w({});return Oc({readState:a,reset:n,update:o,getStartData:u,setStartData:i})},vK=Object.freeze({__proto__:null,init:hK}),bK=vl({branchKey:"mode",branches:pK,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:I.from(t.extra)}}},state:vK,apis:MG}),yK=40,wK=yK/2,xK=function(t,e,n,r,o,i){return t.fold((function(){return bK.snap({sensor:wG(n-wK,r-wK),range:fr(o,i),output:wG(I.some(n),I.some(r)),extra:{td:e}})}),(function(t){var o=n-wK,i=r-wK,u=yK,a=yK,c=t.element.dom.getBoundingClientRect();return bK.snap({sensor:wG(o,i),range:fr(u,a),output:wG(I.some(n-c.width/2),I.some(r-c.height/2)),extra:{td:e}})}))},CK=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}},SK=function(t){return kC(SC.sketch({dom:{tag:"div",classes:["tox-selector"]},buttonBehaviours:ml([bK.config({mode:"mouseOrTouch",blockerClass:"blocker",snaps:t}),VA.config({})]),eventOrder:{mousedown:["dragging","alloy.base.behaviour"],touchstart:["dragging","alloy.base.behaviour"]}}))},kK=function(t,e){var n=ou([]),r=ou([]),o=ou(!1),i=od(),u=od(),a=function(t){var n=Qr(t);return xK(m.getOpt(e),t,n.x,n.y,n.width,n.height)},c=function(){return $(n.get(),(function(t){return a(t)}))},s=function(t){var n=Qr(t);return xK(g.getOpt(e),t,n.right,n.bottom,n.width,n.height)},f=function(){return $(r.get(),(function(t){return s(t)}))},l=CK(c,i,(function(e){u.get().each((function(n){t.fire("TableSelectorChange",{start:e,finish:n})}))})),d=CK(f,u,(function(e){i.get().each((function(n){t.fire("TableSelectorChange",{start:n,finish:e})}))})),m=SK(l),g=SK(d),p=Es(m.asSpec()),h=Es(g.asSpec()),v=function(e,n,r,o){var i=n.dom.getBoundingClientRect();nr(e.element,"display");var u=hn(ee.fromDom(t.getBody())).dom.innerHeight,a=r(i),c=o(i,u);(a||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},u=function(t,e){return t[r]>e};v(t,e,i,u)},y=function(t){return b(p,t,a,"top")},w=function(){return i.get().each(y)},x=function(t){return b(h,t,s,"bottom")},C=function(){return u.get().each(x)};en().deviceType.isTouch()&&(t.on("TableSelectionChange",(function(t){o.get()||(Wg(e,p),Wg(e,h),o.set(!0)),i.set(t.start),u.set(t.finish),t.otherCells.each((function(e){n.set(e.upOrLeftCells),r.set(e.downOrRightCells),y(t.start),x(t.finish)}))})),t.on("ResizeEditor ResizeWindow ScrollContent",(function(){w(),C()})),t.on("TableSelectionClear",(function(){o.get()&&(Gg(p),Gg(h),o.set(!1)),i.clear(),u.clear()})))},OK=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},TK=function(t,e,n){e.delimiter||(e.delimiter="»");var r=function(r){var o=r||[],i=$(o,(function(e,r){return SC.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:ml([mT.button(n.isDisabled),cT()])})})),u={dom:{tag:"div",classes:["tox-statusbar__path-divider"],attributes:{"aria-hidden":!0},innerHtml:" "+e.delimiter+" "}};return Q(i.slice(1),(function(t,e){var n=t;return n.push(u),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&&!OK(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:ml([Dw.config({mode:"flow",selector:"div[role=button]"}),Lv.config({disabled:n.isDisabled}),cT(),yD.config({}),zw.config({}),Vw("elementPathEvents",[Ua((function(e,n){t.shortcuts.add("alt+F11","focus statusbar elementpath",(function(){return Dw.focusIn(e)})),t.on("NodeChange",(function(t){var n=o(t.parents);n.length>0?zw.set(e,r(n)):zw.set(e,[])}))}))])]),components:[]}};(function(t){t[t["None"]=0]="None",t[t["Both"]=1]="Both",t[t["Vertical"]=2]="Vertical"})(Aj||(Aj={}));var EK=function(t,e,n,r,o){var i={};return i.height=ZW(r+e.top,wO(t),CO(t)),n===Aj.Both&&(i.width=ZW(o+e.left,yO(t),xO(t))),i},_K=function(t,e,n){var r=ee.fromDom(t.getContainer()),o=EK(t,e,n,ur(r),vr(r));vt(o,(function(t,e){return Kn(r,e,QW(t))})),vE(t)},DK=function(t){var e=!t.hasPlugin("autoresize"),n=t.getParam("resize",e);return!1===n?Aj.None:"both"===n?Aj.Both:Aj.Vertical},AK=function(t,e,n,r){var o=20,i=fr(n*o,r*o);return _K(t,i,e),I.some(!0)},RK=function(t,e){var n=DK(t);return n===Aj.None?I.none():I.some(IC("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 _K(t,o,n)},blockerClass:"tox-blocker"}),Dw.config({mode:"special",onLeft:function(){return AK(t,n,-1,0)},onRight:function(){return AK(t,n,1,0)},onUp:function(){return AK(t,n,0,-1)},onDown:function(){return AK(t,n,0,1)}}),yD.config({}),Yw.config({})]},e.icons))},NK=function(t,e){var n,r=function(t,n,r){return zw.set(t,[Ss(e.translate(["{0} "+r,n[r]]))])};return SC.sketch({dom:{tag:"button",classes:["tox-statusbar__wordcount"]},components:[],buttonBehaviours:ml([mT.button(e.isDisabled),cT(),yD.config({}),zw.config({}),th.config({store:{mode:"memory",initialValue:{mode:"words",count:{words:0,characters:0}}}}),Vw("wordcount-events",[qa((function(t){var e=th.getValue(t),n="words"===e.mode?"characters":"words";th.setValue(t,{mode:n,count:e.count}),r(t,e.count,n)})),Ua((function(e){t.on("wordCountUpdate",(function(t){var n=th.getValue(e).mode;th.setValue(e,{mode:n,count:t.wordCount}),r(e,t.wordCount,n)}))}))])]),eventOrder:(n={},n[ea()]=["disabling","alloy.base.behaviour","wordcount-events"],n)})},BK=function(t,e){var n=function(){var t=OC.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(TK(t,{},e)),t.hasPlugin("wordcount")&&r.push(NK(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=RK(t,e);return n.concat(o.toArray())};return{dom:{tag:"div",classes:["tox-statusbar"]},components:o()}},MK=function(t){var e,n=t.inline,r=n?cq:YW,o=qO(t)?FH:jz,i=I.none(),u=en(),a=u.browser.isIE(),c=a?["tox-platform-ie"]:[],s=u.deviceType.isTouch(),f="tox-platform-touch",l=s?[f]:[],d=LO(t),m=jO(t),g=OC.isRtl()?{attributes:{dir:"rtl"}}:{},p={attributes:(e={},e[Ld]=d?zl.BottomToTop:zl.TopToBottom,e)},v=function(){return i.bind(aj.getHeader)},b=function(){return o.isDocked(v)},y=function(){Kn(Q.element,"width",document.body.clientWidth+"px")},w=function(){var t=sn(Ln(),m)&&"grid"===Jn(m,"display"),e={dom:D({tag:"div",classes:["tox","tox-silver-sink","tox-tinymce-aux"].concat(c).concat(l)},g),behaviours:ml([Fg.config({useFixed:function(){return b()}})])},n={dom:{styles:{width:document.body.clientWidth+"px"}},events:_a([Na(la(),y)])};return Co(e,t?n:{})},x=Es(w()),C=function(){return ro.value(x)},S=kC({dom:{tag:"div",classes:["tox-anchorbar"]}}),k=function(){return i.bind((function(t){return S.getOpt(t)})).getOrDie("Could not find a anchor bar element")},O=function(){return i.bind((function(t){return aj.getToolbar(t)})).getOrDie("Could not find more toolbar element")},T=function(){return i.bind((function(t){return aj.getThrobber(t)})).getOrDie("Could not find throbber element")},E=kz(x,t,k),_=aj.parts.menubar({dom:{tag:"div",classes:["tox-menubar"]},backstage:E,onEscape:function(){t.focus()}}),A=BO(t),R=aj.parts.toolbar(D({dom:{tag:"div",classes:["tox-toolbar"]},getSink:C,providers:E.shared.providers,onEscape:function(){t.focus()},type:A,lazyToolbar:O,lazyHeader:function(){return v().getOrDie("Could not find header element")}},p)),N=aj.parts["multiple-toolbar"]({dom:{tag:"div",classes:["tox-toolbar-overlord"]},providers:E.shared.providers,onEscape:function(){t.focus()},type:A}),B=aj.parts.socket({dom:{tag:"div",classes:["tox-edit-area"]}}),M=aj.parts.sidebar({dom:{tag:"div",classes:["tox-sidebar"]}}),P=aj.parts.throbber({dom:{tag:"div",classes:["tox-throbber"]},backstage:E}),L=t.getParam("statusbar",!0,"boolean"),F=L&&!n?I.some(BK(t,E.shared.providers)):I.none(),z={dom:{tag:"div",classes:["tox-sidebar-wrap"]},components:[B,M]},H=RO(t),V=DO(t),U=_O(t),j=function(){return H?[N]:V?[R]:[]},W=aj.parts.header({dom:D({tag:"div",classes:["tox-editor-header"]},p),components:nt([U?[_]:[],j(),UO(t)?[]:[S.asSpec()]]),sticky:qO(t),editor:t,sharedBackstage:E.shared}),q=nt([d?[]:[W],n?[]:[z],d?[W]:[]]),$={dom:{tag:"div",classes:["tox-editor-container"]},components:q},G=nt([[$],n?[]:F.toArray(),[P]]),K=WO(t),X=D(D({role:"application"},OC.isRtl()?{dir:"rtl"}:{}),K?{"aria-hidden":"true"}:{}),Y=Es(aj.sketch({dom:{tag:"div",classes:["tox","tox-tinymce"].concat(n?["tox-tinymce-inline"]:[]).concat(d?["tox-tinymce--toolbar-bottom"]:[]).concat(l).concat(c),styles:D({visibility:"hidden"},K?{opacity:"0",border:"0"}:{}),attributes:X},components:G,behaviours:ml([cT(),Lv.config({disableClass:"tox-tinymce--disabled"}),Dw.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=I.some(Y),t.shortcuts.add("alt+F9","focus menubar",(function(){aj.focusMenubar(Y)})),t.shortcuts.add("alt+F10","focus toolbar",(function(){aj.focusToolbar(Y)})),t.addCommand("ToggleToolbarDrawer",(function(){aj.toggleToolbarDrawer(Y)})),t.addQueryStateHandler("ToggleToolbarDrawer",(function(){return aj.isToolbarDrawerToggled(Y)}));var J=fD(Y),Q=fD(x);Oz(t,J,Q);var Z=function(){var t={broadcastAll:Q.broadcast,broadcastOn:Q.broadcastOn,register:h};return{channels:t}},tt=function(){var e=QW(eq(t)),n=QW(rq(t));return t.inline||(er("div","width",n)&&Kn(Y.element,"width",n),er("div","height",e)?Kn(Y.element,"height",e):Kn(Y.element,"height","200px")),e},et=function(){o.setup(t,E.shared,v),O$(t,E),uG(t,C,E),NV(t),iU(t,T,E.shared),bt(PO(t),(function(e,n){t.ui.registry.addGroupToolbarButton(n,e)}));var e=t.ui.registry.getAll(),n=e.buttons,i=e.menuItems,u=e.contextToolbars,a=e.sidebars,c=AO(t),s={menuItems:i,menus:KO(t),menubar:XO(t),toolbar:c.getOrThunk((function(){return YO(t)})),allowToolbarGroups:A===US.floating,buttons:n,sidebar:a};Xq(t,u,x,{backstage:E}),kK(t,x);var f=t.getElement(),l=tt(),d={mothership:J,uiMothership:Q,outerContainer:Y},m={targetNode:f,height:l};return r.render(t,d,s,E,m)};return{mothership:J,uiMothership:Q,backstage:E,renderUI:et,getUi:Z}},PK=function(t,e){var n=I.from(Un(t,"id")).fold((function(){var t=oc("dialog-describe");return Hn(e,"id",t),t}),x);Hn(t,"aria-describedby",n)},IK=function(t,e){var n=jn(t,"id").fold((function(){var t=oc("dialog-label");return Hn(e,"id",t),t}),x);Hn(t,"aria-labelledby",n)},LK=w([Di("lazySink"),Hi("dragBlockClass"),tu("getBounds",Zr),Ki("useTabstopAt",E),Ki("eventOrder",{}),eh("modalBehaviours",[Dw]),sf("onExecute"),lf("onEscape")]),FK={sketch:x},zK=w([Ph({name:"draghandle",overrides:function(t,e){return{behaviours:ml([bK.config({mode:"mouse",getTarget:function(t){return Is(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})])}}}),Bh({schema:[Di("dom")],name:"title"}),Bh({factory:FK,schema:[Di("dom")],name:"close"}),Bh({factory:FK,schema:[Di("dom")],name:"body"}),Ph({factory:FK,schema:[Di("dom")],name:"footer"}),Mh({factory:{sketch:function(t,e){return D(D({},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"})]),HK=function(t,e,n,r){var o,i=od(),u=function(e){i.set(e);var n=t.lazySink(e).getOrDie(),o=r.blocker(),u=n.getSystem().build(D(D({},o),{components:o.components.concat([_s(e)]),behaviours:ml([Yw.config({}),Vw("dialog-blocker-events",[Va(Fu(),(function(){Dw.focusIn(e)}))])])}));Wg(n,u),Dw.focusIn(e)},a=function(t){i.clear(),vn(t.element).each((function(e){t.getSystem().getByDom(e).each((function(t){Gg(t)}))}))},c=function(e){return Xh(e,t,"body")},s=function(e){return Xh(e,t,"footer")},f=function(t,e){KV.block(t,e)},l=function(t){KV.unblock(t)},d=oc("modal-events"),m=D(D({},t.eventOrder),(o={},o[da()]=[d].concat(t.eventOrder["alloy.system.attached"]||[]),o));return{uid:t.uid,dom:t.dom,components:e,apis:{show:u,hide:a,getBody:c,getFooter:s,setIdle:l,setBusy:f},eventOrder:m,domModification:{attributes:{role:"dialog","aria-modal":"true"}},behaviours:rh(t.modalBehaviours,[zw.config({}),Dw.config({mode:"cyclic",onEnter:t.onExecute,onEscape:t.onEscape,useTabstopAt:t.useTabstopAt}),KV.config({getRoot:i.get}),Vw(d,[Ua((function(e){IK(e.element,Xh(e,t,"title").element),PK(e.element,Xh(e,t,"body").element)}))])])}},VK=mv({name:"ModalDialog",configFields:LK(),partFields:zK(),factory:HK,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)}}}),UK=ti([Ni("type"),Ni("name")].concat(Bk)),jK=fi,WK=[Ti("name","name",Oo((function(){return oc("button-name")})),si),ji("icon"),Qi("align","end",["start","end"]),Zi("primary",!1),Zi("disabled",!1)],qK=R(R([],WK,!0),[Ni("text")],!1),$K=R([Bi("type",["submit","cancel","custom"])],qK,!0),GK=R([Bi("type",["menu"]),ji("text"),ji("tooltip"),ji("icon"),zi("items",UK)],WK,!0),KK=ki("type",{submit:$K,cancel:$K,custom:$K,menu:GK}),XK=[Ni("type"),Ni("text"),Bi("level",["info","warn","error","success"]),Ni("icon"),Ki("url","")],YK=ti(XK),JK=function(t){return[Ni("type"),t]},QK=[Ni("type"),Ni("text"),Zi("disabled",!1),Zi("primary",!1),Ti("name","name",Oo((function(){return oc("button-name")})),si),ji("icon"),Zi("borderless",!1)],ZK=ti(QK),tX=[Ni("type"),Ni("name"),Ni("label"),Zi("disabled",!1)],eX=ti(tX),nX=fi,rX=[Ni("type"),Ni("name")],oX=rX.concat([ji("label")]),iX=oX.concat([Ki("columns","auto")]),uX=ti(iX),aX=ii([Ni("value"),Ni("text"),Ni("icon")]),cX=oX,sX=ti(cX),fX=si,lX=oX,dX=ti(lX),mX=si,gX=rX.concat([Ji("tag","textarea"),Ni("scriptId"),Ni("scriptUrl"),eu("settings",void 0)]),pX=rX.concat([Ji("tag","textarea"),Pi("init")]),hX=vi((function(t){return wi("customeditor.old",Zo(pX),t).orThunk((function(){return wi("customeditor.new",Zo(gX),t)}))})),vX=si,bX=oX,yX=ti(bX),wX=hi(),xX=function(t){return[Ni("type"),Ri("columns"),t]},CX=[Ni("type"),Ni("html"),Qi("presets","presentation",["presentation","document"])],SX=ti(CX),kX=oX.concat([Zi("sandboxed",!0)]),OX=ti(kX),TX=si,EX=oX.concat([Ai("currentState",ti([Di("blob"),Ni("url")]))]),_X=ti(EX),DX=oX.concat([ji("inputMode"),ji("placeholder"),Zi("maximized",!1),Zi("disabled",!1)]),AX=ti(DX),RX=si,NX=function(t){return[Ni("type"),Ni("label"),t]},BX=[Ni("text"),Ni("value")],MX=[Ni("text"),zi("items",Oi("items",(function(){return PX})))],PX=ni([ti(BX),ti(MX)]),IX=oX.concat([zi("items",PX),Zi("disabled",!1)]),LX=ti(IX),FX=si,zX=oX.concat([Fi("items",[Ni("text"),Ni("value")]),Yi("size",1),Zi("disabled",!1)]),HX=ti(zX),VX=si,UX=oX.concat([Zi("constrain",!0),Zi("disabled",!1)]),jX=ti(UX),WX=ti([Ni("width"),Ni("height")]),qX=[Ni("type"),zi("header",si),zi("cells",ei(si))],$X=ti(qX),GX=oX.concat([ji("placeholder"),Zi("maximized",!1),Zi("disabled",!1)]),KX=ti(GX),XX=si,YX=oX.concat([Qi("filetype","file",["image","media","file"]),Ki("disabled",!1)]),JX=ti(YX),QX=ti([Ni("value"),Ki("meta",{})]),ZX=function(t){return Ti("items","items",ko(),ei(vi((function(e){return wi("Checking item of "+t,tY,e).fold((function(t){return ro.error(Si(t))}),(function(t){return ro.value(t)}))}))))},tY=Jo((function(){return pi("type",{alertbanner:YK,bar:ti(JK(ZX("bar"))),button:ZK,checkbox:eX,colorinput:sX,colorpicker:dX,dropzone:yX,grid:ti(xX(ZX("grid"))),iframe:OX,input:AX,listbox:LX,selectbox:HX,sizeinput:jX,textarea:KX,urlinput:JX,customeditor:hX,htmlpanel:SX,imagetools:_X,collection:uX,label:ti(NX(ZX("label"))),table:$X,panel:nY})})),eY=[Ni("type"),Ki("classes",[]),zi("items",tY)],nY=ti(eY),rY=[Ti("name","name",Oo((function(){return oc("tab-name")})),si),Ni("title"),zi("items",tY)],oY=[Ni("type"),Fi("tabs",rY)],iY=ti(oY),uY=qK,aY=KK,cY=ti([Ni("title"),Ai("body",pi("type",{panel:nY,tabpanel:iY})),Ji("size","normal"),zi("buttons",aY),Ki("initialData",{}),tu("onAction",h),tu("onChange",h),tu("onSubmit",h),tu("onClose",h),tu("onCancel",h),Ki("onTabChange",h)]),sY=function(t){return wi("dialog",cY,t)},fY=ti(R([Bi("type",["cancel","custom"])],uY,!0)),lY=ti([Ni("title"),Ni("url"),Ui("height"),Ui("width"),qi("buttons",fY),tu("onAction",h),tu("onCancel",h),tu("onClose",h),tu("onMessage",h)]),dY=function(t){return wi("dialog",lY,t)},mY=function(t){return u(t)?[t].concat(rt(Ot(t),mY)):a(t)?rt(t,mY):[]},gY=function(t){return i(t.type)&&i(t.name)},pY={checkbox:nX,colorinput:fX,colorpicker:mX,dropzone:wX,input:RX,iframe:TX,sizeinput:WX,selectbox:VX,listbox:FX,size:WX,textarea:XX,urlinput:QX,customeditor:vX,collection:aX,togglemenuitem:jK},hY=function(t){return I.from(pY[t.type])},vY=function(t){return Y(mY(t),gY)},bY=function(t){var e=vY(t),n=rt(e,(function(t){return hY(t).fold((function(){return[]}),(function(e){return[Ai(t.name,e)]}))}));return ti(n)},yY=function(t){var e=xi(sY(t)),n=bY(t),r=t.initialData;return{internalDialog:e,dataValidator:n,initialData:r}},wY={open:function(t,e){var n=yY(e);return t(n.internalDialog,n.initialData,n.dataValidator)},openUrl:function(t,e){var n=xi(dY(e));return t(n)},redial:function(t){return yY(t)}},xY=function(t){var e=[],n={};return vt(t,(function(t,r){t.fold((function(){e.push(r)}),(function(t){n[r]=t}))})),e.length>0?ro.error(e):ro.value(n)},CY=function(t,e){var n=kC(BB.sketch((function(n){return{dom:{tag:"div",classes:["tox-form"].concat(t.classes)},components:$(t.items,(function(t){return aF(n,t,e)}))}})));return{dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[n.asSpec()]}],behaviours:ml([Dw.config({mode:"acyclic",useTabstopAt:k(vM)}),WB.memento(n),uM.memento(n,{postprocess:function(t){return xY(t).fold((function(t){return{}}),x)}})])}},SY=function(t,e){return{uid:t.uid,dom:t.dom,components:t.components,events:vx(t.action),behaviours:rh(t.tabButtonBehaviours,[Yw.config({}),Dw.config({mode:"execution",useSpace:!0,useEnter:!0}),th.config({store:{mode:"memory",initialValue:t.value}})]),domModification:t.domModification}},kY=dv({name:"TabButton",configFields:[Ki("uid",void 0),Di("value"),Ti("dom","dom",_o((function(){return{attributes:{role:"tab",id:oc("aria"),"aria-selected":"false"}}})),ui()),Hi("action"),Ki("domModification",{}),eh("tabButtonBehaviours",[Yw,Dw,th]),Di("view")],factory:SY}),OY=w([Di("tabs"),Di("dom"),Ki("clickToDismiss",!1),eh("tabbarBehaviours",[rb,Dw]),uf(["tabClass","selectedClass"])]),TY=Ih({factory:kY,name:"tabs",unit:"tab",overrides:function(t){var e=function(t,e){rb.dehighlight(t,e),Sa(t,ya(),{tabbar:t,button:e})},n=function(t,e){rb.highlight(t,e),Sa(t,ba(),{tabbar:t,button:e})};return{action:function(r){var o=r.getSystem().getByUid(t.uid).getOrDie(),i=rb.isHighlighted(o,r),u=function(){return i&&t.clickToDismiss?e:i?h:n}();u(o,r)},domModification:{classes:[t.markers.tabClass]}}}}),EY=w([TY]),_Y=function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,"debug.sketcher":"Tabbar",domModification:{attributes:{role:"tablist"}},behaviours:rh(t.tabbarBehaviours,[rb.config({highlightClass:t.markers.selectedClass,itemClass:t.markers.tabClass,onHighlight:function(t,e){Hn(e.element,"aria-selected","true")},onDehighlight:function(t,e){Hn(e.element,"aria-selected","false")}}),Dw.config({mode:"flow",getInitial:function(t){return rb.getHighlighted(t).map((function(t){return t.element}))},selector:"."+t.markers.tabClass,executeOnMove:!0})])}},DY=mv({name:"Tabbar",configFields:OY(),partFields:EY(),factory:_Y}),AY=function(t,e){return{uid:t.uid,dom:t.dom,behaviours:rh(t.tabviewBehaviours,[zw.config({})]),domModification:{attributes:{role:"tabpanel"}}}},RY=dv({name:"Tabview",configFields:[eh("tabviewBehaviours",[zw])],factory:AY}),NY=w([Ki("selectFirst",!0),cf("onChangeTab"),cf("onDismissTab"),Ki("tabs",[]),eh("tabSectionBehaviours",[])]),BY=Bh({factory:DY,schema:[Di("dom"),Li("markers",[Di("tabClass"),Di("selectedClass")])],name:"tabbar",defaults:function(t){return{tabs:t.tabs}}}),MY=Bh({factory:RY,name:"tabview"}),PY=w([BY,MY]),IY=function(t,e,n,r){var o=function(e){var n=th.getValue(e);Kh(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();jn(e.element,"id").each((function(t){Hn(r.element,"aria-labelledby",t)})),zw.set(r,o),t.onChangeTab(r,e,o)}))}))},i=function(e,n){Kh(e,t,"tabbar").each((function(t){n(t).each(ka)}))};return{uid:t.uid,dom:t.dom,components:e,behaviours:nh(t.tabSectionBehaviours),events:_a(nt([t.selectFirst?[Ua((function(t,e){i(t,rb.getFirst)}))]:[],[Na(ba(),(function(t,e){var n=e.event.button;o(n)})),Na(ya(),(function(e,n){var r=n.event.button;t.onDismissTab(e,r)}))]])),apis:{getViewItems:function(e){return Kh(e,t,"tabview").map((function(t){return zw.contents(t)})).getOr([])},showTab:function(t,e){var n=function(t){var n=rb.getCandidates(t),r=tt(n,(function(t){return th.getValue(t)===e}));return r.filter((function(e){return!rb.isHighlighted(t,e)}))};i(t,n)}}}},LY=mv({name:"TabSection",configFields:NY(),partFields:PY(),factory:IY,apis:{getViewItems:function(t,e){return t.getViewItems(e)},showTab:function(t,e,n){t.showTab(e,n)}}}),FY=function(t,e,n){return $(t,(function(r,o){zw.set(n,t[o].view());var i=e.dom.getBoundingClientRect();return zw.set(n,[]),i.height}))},zY=function(t){return lt(st(t,(function(t,e){return t>e?-1:t=n.dom.offsetLeft+vr(n),s=c?Math.max(ur(n),a):a,f=parseInt(Jn(t,"margin-top"),10)||0,l=parseInt(Jn(t,"margin-bottom"),10)||0,d=ur(t)+f+l,m=d-s;return r-m},VY=function(t,e){lt(t).each((function(t){return LY.showTab(e,t.value)}))},UY=function(t,e){Kn(t,"height",e+"px"),en().browser.isIE()?nr(t,"flex-basis"):Kn(t,"flex-basis",e+"px")},jY=function(t,e,n){Is(t,'[role="dialog"]').each((function(t){Fs(t,'[role="tablist"]').each((function(r){n.get().map((function(n){return Kn(e,"height","0"),Kn(e,"flex-basis","0"),Math.min(n,HY(t,e,r))})).each((function(t){UY(e,t)}))}))}))},WY=function(t){return Fs(t,'[role="tabpanel"]')},qY=function(t){var e=function(){var e=od(),n=[Ua((function(n){var r=n.element;WY(r).each((function(o){Kn(o,"visibility","hidden"),n.getSystem().getByDom(o).toOptional().each((function(n){var r=FY(t,o,n),i=zY(r);i.fold(e.clear,e.set)})),jY(r,o,e),nr(o,"visibility"),VY(t,n),xC.requestAnimationFrame((function(){jY(r,o,e)}))}))})),Na(la(),(function(t){var n=t.element;WY(n).each((function(t){jY(n,t,e)}))})),Na(PD,(function(t,n){var r=t.element;WY(r).each((function(t){var n=Tl(Dn(t));Kn(t,"visibility","hidden");var o=Zn(t,"height").map((function(t){return parseInt(t,10)}));nr(t,"height"),nr(t,"flex-basis");var i=t.dom.getBoundingClientRect().height,u=o.forall((function(t){return i>t}));u?(e.set(i),jY(r,t,e)):o.each((function(e){UY(t,e)})),nr(t,"visibility"),n.each(Sl)}))}))],r=!1;return{extraEvents:n,selectFirst:r}}(),n=function(){var t=[],e=!0;return{extraEvents:t,selectFirst:e}}();return{smartTabHeight:e,naiveTabHeight:n}},$Y="send-data-to-section",GY="send-data-to-view",KY=function(t,e){var n=ou({}),r=function(t){var e=th.getValue(t),r=xY(e).getOr({}),o=n.get(),i=Co(o,r);n.set(i)},o=function(t){var e=n.get();th.setValue(t,e)},i=ou(null),u=$(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[BB.sketch((function(n){return{dom:{tag:"div",classes:["tox-form"]},components:$(t.items,(function(t){return aF(n,t,e)})),formBehaviours:ml([Dw.config({mode:"acyclic",useTabstopAt:k(vM)}),Vw("TabView.form.events",[Ua(o),ja(r)]),yl.config({channels:gu([{key:$Y,value:{onReceive:r}},{key:GY,value:{onReceive:o}}])})])}}))]}}})),a=qY(u).smartTabHeight;return LY.sketch({dom:{tag:"div",classes:["tox-dialog__body"]},onChangeTab:function(t,e,n){var r=th.getValue(e);Sa(t,MD,{name:r,oldName:i.get()}),i.set(r)},tabs:u,components:[LY.parts.tabbar({dom:{tag:"div",classes:["tox-dialog__body-nav"]},components:[DY.parts.tabs({})],markers:{tabClass:"tox-tab",selectedClass:"tox-dialog__body-nav-item--active"},tabbarBehaviours:ml([yD.config({})])}),LY.parts.tabview({dom:{tag:"div",classes:["tox-dialog__body-content"]}})],selectFirst:a.selectFirst,tabSectionBehaviours:ml([Vw("tabpanel",a.extraEvents),Dw.config({mode:"acyclic"}),bv.config({find:function(t){return lt(LY.getViewItems(t))}}),th.config({store:{mode:"manual",getValue:function(t){return t.getSystem().broadcastOn([$Y],{}),n.get()},setValue:function(t,e){n.set(e),t.getSystem().broadcastOn([GY],{})}}})])})},XY=oc("update-dialog"),YY=oc("update-title"),JY=oc("update-body"),QY=oc("update-footer"),ZY=oc("body-send-message"),tJ=function(t,e,n,r){var o=function(t){switch(t.body.type){case"tabpanel":return[KY(t.body,n)];default:return[CY(t.body,n)]}},i=function(t,e){return I.some({isTabPanel:function(){return"tabpanel"===e.body.type}})},u={"aria-live":"polite"};return{dom:{tag:"div",classes:["tox-dialog__content-js"],attributes:D(D({},e.map((function(t){return{id:t}})).getOr({})),r?u:{})},components:[],behaviours:ml([WB.childAt(0),gW.config({channel:JY,updateState:i,renderComponents:o,initialData:t})])}},eJ=function(t,e,n,r){return tJ(t,I.some(e),n,r)},nJ=function(t,e){var n=tJ(t,I.none(),e,!1);return VK.parts.body(n)},rJ=function(t){var e={dom:{tag:"div",classes:["tox-dialog__content-js"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-iframe"]},components:[gM({dom:{tag:"iframe",attributes:{src:t.url}},behaviours:ml([yD.config({}),Yw.config({})])})]}],behaviours:ml([Dw.config({mode:"acyclic",useTabstopAt:k(vM)})])};return VK.parts.body(e)},oJ=CT.deviceType.isTouch(),iJ=function(t,e){return{dom:{tag:"div",styles:{display:"none"},classes:["tox-dialog__header"]},components:[t,e]}},uJ=function(t,e){return VK.parts.close(SC.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":e.translate("Close")}},action:t,buttonBehaviours:ml([yD.config({})])}))},aJ=function(){return VK.parts.title({dom:{tag:"div",classes:["tox-dialog__title"],innerHtml:"",styles:{display:"none"}}})},cJ=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:JV("

"+e.translate(t)+"

")}]}]})},sJ=function(t){return VK.parts.footer({dom:{tag:"div",classes:["tox-dialog__footer"]},components:t})},fJ=function(t,e){return[sD.sketch({dom:{tag:"div",classes:["tox-dialog__footer-start"]},components:t}),sD.sketch({dom:{tag:"div",classes:["tox-dialog__footer-end"]},components:e})]},lJ=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),I.some(!0)},useTabstopAt:function(t){return!vM(t)},dom:{tag:"div",classes:[n].concat(t.extraClasses),styles:D({position:"relative"},t.extraStyles)},components:R([t.header,t.body],t.footer.toArray(),!0),parts:{blocker:{dom:JV('
'),components:[{dom:{tag:"div",classes:oJ?[o,o+"--opaque"]:[o]}}]}},dragBlockClass:r,modalBehaviours:ml(R([Yw.config({}),Vw("dialog-events",t.dialogEvents.concat([Va(Fu(),(function(t,e){Dw.focusIn(t)}))])),Vw("scroll-lock",[Ua((function(){is(Ln(),i)})),ja((function(){as(Ln(),i)}))])],t.extraBehaviours,!0)),eventOrder:D((e={},e[ea()]=["dialog-events"],e[da()]=["scroll-lock","dialog-events","alloy.base.behaviour"],e[ma()]=["alloy.base.behaviour","dialog-events","scroll-lock"],e),t.eventOrder)})},dJ=function(t){return SC.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:[IC("close",{tag:"div",classes:["tox-icon"]},t.icons)],action:function(t){Ca(t,DD)}})},mJ=function(t,e,n){var r=function(t){return[Ss(n.translate(t.title))]};return{dom:{tag:"div",classes:["tox-dialog__title"],attributes:D({},e.map((function(t){return{id:t}})).getOr({}))},components:r(t),behaviours:ml([gW.config({channel:YY,renderComponents:r})])}},gJ=function(){return{dom:JV('
')}},pJ=function(t,e,n){return sD.sketch({dom:JV('
'),components:[mJ(t,I.some(e),n),gJ(),dJ(n)],containerBehaviours:ml([bK.config({mode:"mouse",blockerClass:"blocker",getTarget:function(t){return zs(t,'[role="dialog"]').getOrDie()},snaps:{getSnapPoints:function(){return[]},leftAttr:"data-drag-left",topAttr:"data-drag-top"}})])})},hJ=function(t,e){var n=VK.parts.title(mJ(t,I.none(),e)),r=VK.parts.draghandle(gJ()),o=VK.parts.close(dJ(e)),i=[n].concat(t.draggable?[r]:[]).concat([o]);return sD.sketch({dom:JV('
'),components:i})},vJ=function(t,e){return hJ({title:e.shared.providers.translate(t),draggable:e.dialog.isDraggableModal()},e.shared.providers)},bJ=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:JV('
')}]}},yJ=function(t,e,n){return{onClose:function(){return n.closeWindow()},onBlock:function(n){VK.setBusy(t(),(function(t,r){return bJ(n.message,r,e)}))},onUnblock:function(){VK.setIdle(t())}}},wJ=function(t,e,n,r){var o,i=function(t,e){return I.some(e)};return Es(lJ(D(D({},t),{lazySink:r.shared.getSink,extraBehaviours:R([gW.config({channel:XY,updateState:i,initialData:e}),uM.memory({})],t.extraBehaviours,!0),onEscape:function(t){Ca(t,DD)},dialogEvents:n,eventOrder:(o={},o[ta()]=[gW.name(),yl.name()],o[da()]=["scroll-lock",gW.name(),"messages","dialog-events","alloy.base.behaviour"],o[ma()]=["alloy.base.behaviour","dialog-events","messages",gW.name(),"scroll-lock"],o)})))},xJ=function(t){var e=function(t){var e=$(t.items,(function(t){var e=ou(!1);return D(D({},t),{storage:e})}));return D(D({},t),{items:e})};return $(t,(function(t){return"menu"===t.type?e(t):t}))},CJ=function(t){return Q(t,(function(t,e){if("menu"===e.type){var n=e;return Q(n.items,(function(t,e){return t[e.name]=e.storage,t}),t)}return t}),{})},SJ=function(t,e){return[Fa(Fu(),hM),t(_D,(function(t,n){e.onClose(),n.onClose()})),t(DD,(function(t,e,n,r){e.onCancel(t),Ca(r,_D)})),Na(BD,(function(t,n){return e.onUnblock()})),Na(ND,(function(t,n){return e.onBlock(n.event)}))]},kJ=function(t,e){var n=function(e,n){return Na(e,(function(e,o){r(e,(function(r,i){n(t(),r,o.event,e)}))}))},r=function(t,e){gW.getState(t).get().each((function(n){e(n,t)}))};return R(R([],SJ(n,e),!0),[n(AD,(function(t,e,n){e.onAction(t,{name:n.name})}))],!1)},OJ=function(t,e,n){var r=function(e,n){return Na(e,(function(e,r){o(e,(function(o,i){n(t(),o,r.event,e)}))}))},o=function(t,e){gW.getState(t).get().each((function(n){e(n.internalDialog,t)}))};return R(R([],SJ(r,e),!0),[r(RD,(function(t,e){return e.onSubmit(t)})),r(ED,(function(t,e,n){e.onChange(t,{name:n.name})})),r(AD,(function(t,e,r,o){var i=function(){return Dw.focusIn(o)},u=function(t){return Wn(t,"disabled")||jn(t,"aria-disabled").exists((function(t){return"true"===t}))},a=Dn(o.element),c=Tl(a);e.onAction(t,{name:r.name,value:r.value}),Tl(a).fold(i,(function(t){u(t)||c.exists((function(e){return dn(t,e)&&u(e)}))?i():n().toOptional().filter((function(e){return!dn(e.element,t)})).each(i)}))})),r(MD,(function(t,e,n){e.onTabChange(t,{newTabName:n.name,oldTabName:n.oldName})})),ja((function(e){var n=t();th.setValue(e,n.getData())}))],!1)},TJ={initUrlDialog:kJ,initDialog:OJ},EJ=function(t,e){return rI(t,t.type,e)},_J=function(t,e,n){return tt(e,(function(t){return t.name===n})).bind((function(e){return e.memento.getOpt(t)}))},DJ=function(t,e){var n=e.map((function(t){return t.footerButtons})).getOr([]),r=X(n,(function(t){return"start"===t.align})),o=function(t,e){return sD.sketch({dom:{tag:"div",classes:["tox-dialog__footer-"+t]},components:$(e,(function(t){return t.memento.asSpec()}))})},i=o("start",r.pass),u=o("end",r.fail);return[i,u]},AJ=function(t,e){var n=function(t,n){var r=$(n.buttons,(function(t){var n=kC(EJ(t,e));return{name:t.name,align:t.align,memento:n}})),o=function(t,e){return _J(t,r,e)};return I.some({lookupByName:o,footerButtons:r})};return{dom:JV(''),components:[],behaviours:ml([gW.config({channel:QY,initialData:t,updateState:n,renderComponents:DJ})])}},RJ=function(t,e){return AJ(t,e)},NJ=function(t,e){return VK.parts.footer(AJ(t,e))},BJ=function(t,e){var n=t.getRoot();if(n.getSystem().isConnected()){var r=bv.getCurrent(t.getFormWrapper()).getOr(t.getFormWrapper());return BB.getField(r,e).fold((function(){var n=t.getFooter(),o=gW.getState(n);return o.get().bind((function(t){return t.lookupByName(r,e)}))}),(function(t){return I.some(t)}))}return I.none()},MJ=function(t,e){var n=t.getRoot();return gW.getState(n).get().map((function(t){return xi(wi("data",t.dataValidator,e))})).getOr(e)},PJ=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=th.getValue(r),i=bt(n,(function(t){return t.get()}));return D(D({},o),i)},u=function(e){r((function(r){var o=p.getData(),i=D(D({},o),e),u=MJ(t,i),a=t.getFormWrapper();th.setValue(a,u),vt(n,(function(t,e){Et(i,e)&&t.set(i[e])}))}))},a=function(e){BJ(t,e).each(Lv.disable)},c=function(e){BJ(t,e).each(Lv.enable)},s=function(e){BJ(t,e).each(Yw.focus)},f=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){Sa(e,ND,{message:t})}))},l=function(){r((function(t){Ca(t,BD)}))},d=function(e){r((function(n){var r=t.getBody(),o=gW.getState(r);o.get().exists((function(t){return t.isTabPanel()}))&&bv.getCurrent(r).each((function(t){LY.showTab(t,e)}))}))},m=function(t){r((function(n){var r=e(t);n.getSystem().broadcastOn([XY],r),n.getSystem().broadcastOn([YY],r.internalDialog),n.getSystem().broadcastOn([JY],r.internalDialog),n.getSystem().broadcastOn([QY],r.internalDialog),p.setData(r.initialData)}))},g=function(){r((function(t){Ca(t,_D)}))},p={getData:o,setData:u,disable:a,enable:c,focus:s,block:f,unblock:l,showTab:d,redial:m,close:g};return p},IJ=function(t){switch(t){case"large":return["tox-dialog--width-lg"];case"medium":return["tox-dialog--width-md"];default:return[]}},LJ=function(t,e,n){var r=vJ(t.internalDialog.title,n),o=nJ({body:t.internalDialog.body},n),i=xJ(t.internalDialog.buttons),u=CJ(i),a=NJ({buttons:i},n),c=TJ.initDialog((function(){return m}),yJ((function(){return l}),n.shared.providers,e),n.shared.getSink),s=IJ(t.internalDialog.size),f={header:r,body:o,footer:I.some(a),extraClasses:s,extraBehaviours:[],extraStyles:{}},l=wJ(f,t,c,n),d=function(){var t=function(){var t=VK.getBody(l);return bv.getCurrent(t).getOr(t)};return{getRoot:w(l),getBody:function(){return VK.getBody(l)},getFooter:function(){return VK.getFooter(l)},getFormWrapper:t}}(),m=PJ(d,e.redial,u);return{dialog:l,instanceApi:m}},FJ=function(t,e,n,r){var o,i,u=oc("dialog-label"),a=oc("dialog-content"),c=function(t,e){return I.some(e)},s=kC(pJ({title:t.internalDialog.title,draggable:!0},u,n.shared.providers)),f=kC(eJ({body:t.internalDialog.body},a,n,r)),l=xJ(t.internalDialog.buttons),d=CJ(l),m=kC(RJ({buttons:l},n)),g=TJ.initDialog((function(){return h}),{onBlock:function(t){KV.block(p,(function(e,r){return bJ(t.message,r,n.shared.providers)}))},onUnblock:function(){KV.unblock(p)},onClose:function(){return e.closeWindow()}},n.shared.getSink),p=Es({dom:{tag:"div",classes:["tox-dialog","tox-dialog-inline"],attributes:(o={role:"dialog"},o["aria-labelledby"]=u,o["aria-describedby"]=a,o)},eventOrder:(i={},i[ta()]=[gW.name(),yl.name()],i[ea()]=["execute-on-form"],i[da()]=["reflecting","execute-on-form"],i),behaviours:ml([Dw.config({mode:"cyclic",onEscape:function(t){return Ca(t,_D),I.some(!0)},useTabstopAt:function(t){return!vM(t)&&("button"!==ae(t)||"disabled"!==Un(t,"disabled"))}}),gW.config({channel:XY,updateState:c,initialData:t}),Yw.config({}),Vw("execute-on-form",g.concat([Va(Fu(),(function(t,e){Dw.focusIn(t)}))])),KV.config({getRoot:function(){return I.some(p)}}),zw.config({}),uM.memory({})]),components:[s.asSpec(),f.asSpec(),m.asSpec()]}),h=PJ({getRoot:w(p),getFooter:function(){return m.get(p)},getBody:function(){return f.get(p)},getFormWrapper:function(){var t=f.get(p);return bv.getCurrent(t).getOr(t)}},e.redial,d);return{dialog:p,instanceApi:h}},zJ=tinymce.util.Tools.resolve("tinymce.util.URI"),HJ=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){Sa(e,ND,{message:t})}))},r=function(){e((function(t){Ca(t,BD)}))},o=function(){e((function(t){Ca(t,_D)}))},u=function(t){e((function(e){e.getSystem().broadcastOn([ZY],t)}))};return{block:n,unblock:r,close:o,sendMessage:u}},VJ=["insertContent","setContent","execCommand","close","block","unblock"],UJ=function(t){return u(t)&&-1!==VJ.indexOf(t.mceAction)},jJ=function(t){return!UJ(t)&&u(t)&&Et(t,"mceAction")},WJ=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}},qJ=function(t,e,n,r){var o,i=vJ(t.title,r),u=rJ(t),a=t.buttons.bind((function(t){return 0===t.length?I.none():I.some(NJ({buttons:t},r))})),c=TJ.initUrlDialog((function(){return v}),yJ((function(){return h}),r.shared.providers,e)),s=D(D({},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"}}))),f=t.width.isNone()&&t.height.isNone()?["tox-dialog--width-lg"]:[],l=new zJ(t.url,{base_uri:new zJ(window.location.href)}),d=l.protocol+"://"+l.host+(l.port?":"+l.port:""),m=nd(),g=[Vw("messages",[Ua((function(){var e=ud(ee.fromDom(window),"message",(function(e){if(l.isSameOrigin(new zJ(e.raw.origin))){var r=e.raw.data;UJ(r)?WJ(n,v,r):jJ(r)&&t.onMessage(v,r)}}));m.set(e)})),ja(m.clear)]),yl.config({channels:(o={},o[ZY]={onReceive:function(t,e){Fs(t.element,"iframe").each((function(t){var n=t.dom.contentWindow;n.postMessage(e,d)}))}},o)})],p={header:i,body:u,footer:a,extraClasses:f,extraBehaviours:g,extraStyles:s},h=wJ(p,t,c,r),v=HJ(h);return{dialog:h,instanceApi:v}},$J=function(t){var e=t.backstage.shared,n=function(n,r){var o=function(){VK.hide(c),r()},i=kC(rI({name:"close-alert",text:"OK",primary:!0,align:"end",disabled:!1,icon:I.none()},"cancel",t.backstage)),u=aJ(),a=uJ(o,e.providers),c=Es(lJ({lazySink:function(){return e.getSink()},header:iJ(u,a),body:cJ(n,e.providers),footer:I.some(sJ(fJ([],[i.asSpec()]))),onEscape:o,extraClasses:["tox-alert-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[Na(DD,o)],eventOrder:{}}));VK.show(c);var s=i.get(c);Yw.focus(s)};return{open:n}},GJ=function(t){var e=t.backstage.shared,n=function(n,r){var o=function(t){VK.hide(s),r(t)},i=kC(rI({name:"yes",text:"Yes",primary:!0,align:"end",disabled:!1,icon:I.none()},"submit",t.backstage)),u=rI({name:"no",text:"No",primary:!1,align:"end",disabled:!1,icon:I.none()},"cancel",t.backstage),a=aJ(),c=uJ((function(){return o(!1)}),e.providers),s=Es(lJ({lazySink:function(){return e.getSink()},header:iJ(a,c),body:cJ(n,e.providers),footer:I.some(sJ(fJ([],[u,i.asSpec()]))),onEscape:function(){return o(!1)},extraClasses:["tox-confirm-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[Na(DD,(function(){return o(!1)})),Na(RD,(function(){return o(!0)}))],eventOrder:{}}));VK.show(s);var f=i.get(s);Yw.focus(f)};return{open:n}},KJ=function(t,e){return xi(wi("data",e,t))},XJ=function(t){return I_(t,".tox-alert-dialog")||I_(t,".tox-confirm-dialog")},YJ=function(t,e,n){return e&&n?[]:[CH.config({contextual:{lazyContext:function(){return I.some(Jr(ee.fromDom(t.getContentAreaContainer())))},fadeInClass:"tox-dialog-dock-fadein",fadeOutClass:"tox-dialog-dock-fadeout",transitionClass:"tox-dialog-dock-transition"},modes:["top"]})]},JJ=function(t){var e=t.backstage,n=t.editor,r=qO(n),o=$J(t),i=GJ(t),u=function(t,n,r){return void 0!==n&&"toolbar"===n.inline?f(t,e.shared.anchors.inlineDialog(),r,n.ariaAttrs):void 0!==n&&"cursor"===n.inline?f(t,e.shared.anchors.cursor(),r,n.ariaAttrs):s(t,r)},a=function(t,e){return c(t,e)},c=function(t,r){var o=function(t){var o=qJ(t,{closeWindow:function(){VK.hide(o.dialog),r(o.instanceApi)}},n,e);return VK.show(o.dialog),o.instanceApi};return wY.openUrl(o,t)},s=function(t,n){var r=function(t,r,o){var i=r,u={dataValidator:o,initialData:i,internalDialog:t},a=LJ(u,{redial:wY.redial,closeWindow:function(){VK.hide(a.dialog),n(a.instanceApi)}},e);return VK.show(a.dialog),a.instanceApi.setData(i),a.instanceApi};return wY.open(r,t)},f=function(t,o,i,u){var a=function(t,a,c){var s=KJ(a,c),f=od(),l=e.shared.header.isPositionedAtTop(),d={dataValidator:c,initialData:s,internalDialog:t},m=function(){return f.on((function(t){eC.reposition(t),CH.refresh(t)}))},g=FJ(d,{redial:wY.redial,closeWindow:function(){f.on(eC.hide),n.off("ResizeEditor",m),f.clear(),i(g.instanceApi)}},e,u),p=Es(eC.sketch(D(D({lazySink:e.shared.getSink,dom:{tag:"div",classes:[]},fireDismissalEventInstead:{}},l?{}:{fireRepositionEventInstead:{}}),{inlineBehaviours:ml(R([Vw("window-manager-inline-events",[Na(ga(),(function(t,e){Ca(g.dialog,DD)}))])],YJ(n,r,l),!0)),isExtraPart:function(t,e){return XJ(e)}})));return f.set(p),eC.showWithin(p,_s(g.dialog),{anchor:o},I.some(Ln())),r&&l||(CH.refresh(p),n.on("ResizeEditor",m)),g.instanceApi.setData(s),Dw.focusIn(g.dialog),g.instanceApi};return wY.open(a,t)},l=function(t,e){i.open(t,(function(t){e(t)}))},d=function(t,e){o.open(t,(function(){e()}))},m=function(t){t.close()};return{open:u,openUrl:a,alert:d,close:m,confirm:l}};function QJ(){_.add("silver",(function(t){var e=MK(t),n=e.uiMothership,r=e.backstage,o=e.renderUI,i=e.getUi;P_.register(t,r.shared);var u=JJ({editor:t,backstage:r});return{renderUI:o,getWindowManagerImpl:w(u),getNotificationManagerImpl:function(){return VC(t,{backstage:r},n)},ui:i()}}))}QJ()})()}).call(this,n("c8ba"))},"07d1":function(t,e,n){n("94ce")},"09cf":function(t,e){(function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager");function e(){t.add("textcolor",(function(){}))}e()})()},"1f38":function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return o}));var r=function(){return"undefined"!==typeof window?window:t},o=function(){var t=r();return t&&t.tinymce?t.tinymce:null}}).call(this,n("c8ba"))},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"),u=n("array"),a=r("boolean"),c=r("function"),s=r("number"),f=function(){},l=function(t){return function(){return t}},d=function(t){return t},m=function(t,e){return t===e},g=function(t){return function(e){return!t(e)}},p=l(!1),h=l(!0),v=function(){return b},b=function(){var t=function(t){return t()},e=d,n={fold:function(t,e){return t()},isSome:p,isNone:h,getOr:e,getOrThunk:t,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:l(null),getOrUndefined:l(void 0),or:e,orThunk:t,map:v,each:f,bind:v,exists:p,forall:h,filter:function(){return v()},toArray:function(){return[]},toString:l("none()")};return n}(),y=function(t){var e=l(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},isSome:h,isNone:p,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},w=function(t){return null===t||void 0===t?b:y(t)},x={some:y,none:v,from:w},C=Array.prototype.slice,S=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 Q(e,t)}},it=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return Q(t,"edge/")&&Q(t,"chrome")&&Q(t,"safari")&&Q(t,"applewebkit")}},{name:"Chrome",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,rt],search:function(t){return Q(t,"chrome")&&!Q(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return Q(t,"msie")||Q(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(Q(t,"safari")||Q(t,"mobile/"))&&Q(t,"applewebkit")}}],ut=[{name:"Windows",search:ot("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return Q(t,"iphone")||Q(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]+).*/]}],at={browsers:l(it),oses:l(ut)},ct="Edge",st="Chrome",ft="IE",lt="Opera",dt="Firefox",mt="Safari",gt=function(){return pt({current:void 0,version:G.unknown()})},pt=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(ft),isOpera:r(lt),isFirefox:r(dt),isSafari:r(mt)}},ht={unknown:gt,nu:pt,edge:l(ct),chrome:l(st),ie:l(ft),opera:l(lt),firefox:l(dt),safari:l(mt)},vt="Windows",bt="iOS",yt="Android",wt="Linux",xt="OSX",Ct="Solaris",St="FreeBSD",kt="ChromeOS",Ot=function(){return Tt({current:void 0,version:G.unknown()})},Tt=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isWindows:r(vt),isiOS:r(bt),isAndroid:r(yt),isOSX:r(xt),isLinux:r(wt),isSolaris:r(Ct),isFreeBSD:r(St),isChromeOS:r(kt)}},Et={unknown:Ot,nu:Tt,windows:l(vt),ios:l(bt),android:l(yt),linux:l(wt),osx:l(xt),solaris:l(Ct),freebsd:l(St),chromeos:l(kt)},_t=function(t,e,n){var r=at.browsers(),o=at.oses(),i=e.bind((function(t){return K(r,t)})).orThunk((function(){return Y(r,t)})).fold(ht.unknown,ht.nu),u=J(o,t).fold(Et.unknown,Et.nu),a=V(u,i,t,n);return{browser:i,os:u,deviceType:a}},Dt={detect:_t},At=function(t){return window.matchMedia(t).matches},Rt=H((function(){return Dt.detect(navigator.userAgent,x.from(navigator.userAgentData),At)})),Nt=function(){return Rt()},Bt=function(t,e,n){return 0!==(t.compareDocumentPosition(e)&n)},Mt=function(t,e){return Bt(t,e,Node.DOCUMENT_POSITION_CONTAINED_BY)},Pt=1,It=function(t,e){var n=e||document,r=n.createElement("div");if(r.innerHTML=t,!r.hasChildNodes()||r.childNodes.length>1)throw new Error("HTML must have a single root node");return zt(r.childNodes[0])},Lt=function(t,e){var n=e||document,r=n.createElement(t);return zt(r)},Ft=function(t,e){var n=e||document,r=n.createTextNode(t);return zt(r)},zt=function(t){if(null===t||void 0===t)throw new Error("Node cannot be null or undefined");return{dom:t}},Ht=function(t,e,n){return x.from(t.dom.elementFromPoint(e,n)).map(zt)},Vt={fromHtml:It,fromTag:Lt,fromText:Ft,fromDom:zt,fromPoint:Ht},Ut=function(t,e){var n=t.dom;if(n.nodeType!==Pt)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")},jt=function(t,e){return t.dom===e.dom},Wt=function(t,e){var n=t.dom,r=e.dom;return n!==r&&n.contains(r)},qt=function(t,e){return Mt(t.dom,e.dom)},$t=function(t,e){return Nt().browser.isIE()?qt(t,e):Wt(t,e)},Gt=Ut,Kt=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),Xt=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),Yt=tinymce.util.Tools.resolve("tinymce.util.VK"),Jt=Object.keys,Qt=function(t,e){for(var n=Jt(t),r=0,o=n.length;r0)&&r},Ve=function(t,e){return t.isChildOf(e,t.getRoot())},Ue=function(t){return t.getParam("lists_indent_on_tab",!0)},je=function(t){var e=t.getParam("forced_root_block","p");return!1===e?"":!0===e?"p":e},We=function(t){return t.getParam("forced_root_block_attrs",{})},qe=function(t,e){var n,r,o,i=t.dom,u=t.schema.getBlockElements(),a=i.createFragment(),c=je(t);if(c&&(r=i.create(c),r.tagName===c.toUpperCase()&&i.setAttribs(r,We(t)),Fe(e.firstChild,u)||a.appendChild(r)),e)while(n=e.firstChild){var s=n.nodeName;o||"SPAN"===s&&"bookmark"===n.getAttribute("data-mce-type")||(o=!0),Fe(n,u)?(a.appendChild(n),r=null):c?(r||(r=i.create(c),a.appendChild(r)),r.appendChild(n)):a.appendChild(n)}return c?o||r.appendChild(i.create("br",{"data-mce-bogus":"1"})):a.appendChild(i.create("br")),a},$e=ke.DOM,Ge=function(t,e,n){var r=function(t){Oe.each(o,(function(e){t.parentNode.insertBefore(e,n.parentNode)})),$e.remove(t)},o=$e.select('span[data-mce-type="bookmark"]',e),i=qe(t,n),u=$e.createRng();u.setStartAfter(n),u.setEndAfter(e);for(var a=u.extractContents(),c=a.firstChild;c;c=c.firstChild)if("LI"===c.nodeName&&t.dom.isEmpty(c)){$e.remove(c);break}t.dom.isEmpty(a)||$e.insertAfter(a,e),$e.insertAfter(i,e),He(t.dom,n.parentNode)&&r(n.parentNode),$e.remove(n),He(t.dom,e)&&$e.remove(e)},Ke=ue("dd"),Xe=ue("dt"),Ye=function(t,e){Ke(e)?Se(e,"dt"):Xe(e)&&fe(e).each((function(n){return Ge(t,n.dom,e.dom)}))},Je=function(t){Xe(t)&&Se(t,"dd")},Qe=function(t,e,n){O(n,"Indent"===e?Je:function(e){return Ye(t,e)})},Ze=function(t,e){if(_e(t))return{container:t,offset:e};var n=Kt.getNode(t,e);return _e(n)?{container:n,offset:e>=t.childNodes.length?n.data.length:0}:n.previousSibling&&_e(n.previousSibling)?{container:n.previousSibling,offset:n.previousSibling.data.length}:n.nextSibling&&_e(n.nextSibling)?{container:n.nextSibling,offset:0}:{container:t,offset:e}},tn=function(t){var e=t.cloneRange(),n=Ze(t.startContainer,t.startOffset);e.setStart(n.container,n.offset);var r=Ze(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",fn(t,n))},rn=function(t,e){return t&&1===e.length&&e[0]===t},on=function(t){return T(t.querySelectorAll("ol,ul,dl"),De)},un=function(t){var e=nn(t),n=t.selection.getSelectedBlocks();return rn(e,n)?on(e):T(n,(function(t){return De(t)&&e!==t}))},an=function(t,e){var n=Oe.map(e,(function(e){var n=t.dom.getParent(e,"li,dd,dt",fn(t,e));return n||e}));return en.unique(n)},cn=function(t){var e=t.selection.getSelectedBlocks();return T(an(t,e),Ne)},sn=function(t){return T(cn(t),Be)},fn=function(t,e){var n=t.dom.getParents(e,"TD,TH");return n.length>0?n[0]:t.getBody()},ln=function(t,e){var n=t.dom.getParents(e,"ol,ul",fn(t,e));return I(n)},dn=function(t){var e=ln(t,t.selection.getStart()),n=T(t.selection.getSelectedBlocks(),Ae);return e.toArray().concat(n)},mn=function(t){var e=dn(t);return gn(t,e)},gn=function(t,e){var n=k(e,(function(e){return ln(t,e).getOr(e)}));return en.unique(n)},pn=function(t,e,n){return void 0===n&&(n=m),t.exists((function(t){return n(t,e)}))},hn=function(t,e,n){return t.isSome()&&e.isSome()?x.some(n(t.getOrDie(),e.getOrDie())):x.none()},vn=function(t,e){var n=e||document,r=n.createDocumentFragment();return O(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)},wn=function(t,e,n){if(!o(n))throw new Error("CSS value must be a string: "+n);yn(t)&&t.style.setProperty(e,n)},xn=function(t,e,n){var r=t.dom;wn(r,e,n)},Cn=function(t,e){he(t.item,e.list)},Sn=function(t){for(var e=1;ee.length?Nn(t,e,n):Rn(t,e,n)}),[]);return P(n).map((function(t){return t.list}))},Mn=function(t){return Gt(t,"OL,UL")},Pn=function(t){return me(t).exists(Mn)},In=function(t){return ge(t).exists(Mn)},Ln=function(t){return t.depth>0},Fn=function(t){return t.isSelected},zn=function(t){var e=le(t),n=In(t)?e.slice(0,-1):e;return k(n,xe)},Hn=function(t,e,n){return fe(t).filter(ie).map((function(r){return{depth:e,dirty:!1,isSelected:n,content:zn(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},Un=function(t,e){t.listType=e.listType,t.listAttributes=F({},e.listAttributes)},jn=function(t){t.listAttributes=ee(t.listAttributes,(function(t,e){return"start"!==e}))},Wn=function(t,e){var n=t[e].depth,r=function(t){return t.depth===n&&!t.dirty},o=function(t){return t.depth0?_r(t,r,o,e,u):Ar(t,r,e,u)},Nr=ke.DOM,Br=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),He(t,n)&&Nr.remove(n)):Nr.setStyle(n,"listStyleType","none")}if(De(n)){r=n.previousSibling;r&&"LI"===r.nodeName&&r.appendChild(e)}},Mr=function(t,e){var n=Oe.grep(t.select("ol,ul",e));Oe.each(n,(function(e){Br(t,e)}))},Pr=function(t,e,n,r){var o=e.startContainer,i=e.startOffset;if(_e(o)&&(n?i0))return o;var u=t.schema.getNonEmptyElements();1===o.nodeType&&(o=Kt.getNode(o,i));var a=new Xt(o,r);n&&ze(t.dom,o)&&a.next();while(o=a[n?"next":"prev2"]()){if("LI"===o.nodeName&&!o.hasChildNodes())return o;if(u[o.nodeName])return o;if(_e(o)&&o.data.length>0)return o}},Ir=function(t,e){var n=e.childNodes;return 1===n.length&&!De(n[0])&&t.isBlock(n[0])},Lr=function(t,e){Ir(t,e)&&t.remove(e.firstChild,!0)},Fr=function(t,e,n){var r,o=Ir(t,n)?n.firstChild:n;if(Lr(t,e),!He(t,e,!0))while(r=e.firstChild)o.appendChild(r)},zr=function(t,e,n){var r,o=e.parentNode;if(Ve(t,e)&&Ve(t,n)){De(n.lastChild)&&(r=n.lastChild),o===n.lastChild&&Pe(o.previousSibling)&&t.remove(o.previousSibling);var i=n.lastChild;i&&Pe(i)&&e.hasChildNodes()&&t.remove(i),He(t,n,!0)&&t.$(n).empty(),Fr(t,e,n),r&&n.appendChild(r);var u=$t(Vt.fromDom(n),Vt.fromDom(e)),a=u?t.getParents(e,De,n):[];t.remove(e),O(a,(function(e){He(t,e)&&e!==t.getRoot()&&t.remove(e)}))}},Hr=function(t,e,n){t.dom.$(n).empty(),zr(t.dom,e,n),t.selection.setCursorLocation(n,0)},Vr=function(t,e,n,r){var o=t.dom;if(o.isEmpty(r))Hr(t,n,r);else{var i=cr(e);zr(o,n,r),t.selection.setRng(sr(i))}},Ur=function(t,e,n,r){var o=cr(e);zr(t.dom,n,r);var i=sr(o);t.selection.setRng(i)},jr=function(t,e){var n=t.dom,r=t.selection,o=r.getStart(),i=fn(t,o),u=n.getParent(r.getStart(),"LI",i);if(u){var a=u.parentNode;if(a===t.getBody()&&He(n,a))return!0;var c=tn(r.getRng()),s=n.getParent(Pr(t,c,e,i),"LI",i);if(s&&s!==u)return t.undoManager.transact((function(){e?Vr(t,c,s,u):Ie(u)?or(t):Ur(t,c,u,s)})),!0;if(!s&&!e&&0===c.startOffset&&0===c.endOffset)return t.undoManager.transact((function(){ir(t)})),!0}return!1},Wr=function(t,e,n){var r=t.getParent(e.parentNode,t.isBlock,n);t.remove(e),r&&t.isEmpty(r)&&t.remove(r)},qr=function(t,e){var n=t.dom,r=t.selection.getStart(),o=fn(t,r),i=n.getParent(r,n.isBlock,o);if(i&&n.isEmpty(i)){var u=tn(t.selection.getRng()),a=n.getParent(Pr(t,u,e,o),"LI",o);if(a)return t.undoManager.transact((function(){Wr(n,i,o),Tr(n,a.parentNode),t.selection.select(a,!0),t.selection.collapse(e)})),!0}return!1},$r=function(t,e){return jr(t,e)||qr(t,e)},Gr=function(t){var e=t.selection.getStart(),n=fn(t,e),r=t.dom.getParent(e,"LI,DT,DD",n);return!!(r||cn(t).length>0)&&(t.undoManager.transact((function(){t.execCommand("Delete"),Mr(t.dom,t.getBody())})),!0)},Kr=function(t,e){return t.selection.isCollapsed()?$r(t,e):Gr(t)},Xr=function(t){t.on("keydown",(function(e){e.keyCode===Yt.BACKSPACE?Kr(t,!1)&&e.preventDefault():e.keyCode===Yt.DELETE&&Kr(t,!0)&&e.preventDefault()}))},Yr=function(t){return{backspaceDelete:function(e){Kr(t,e)}}},Jr=function(t,e){var n=nn(t);t.undoManager.transact((function(){i(e.styles)&&t.dom.setStyles(n,e.styles),i(e.attrs)&&Qt(e.attrs,(function(e,r){return t.dom.setAttrib(n,r,e)}))}))},Qr=function(t){var e=B(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 _(n,(function(t,e){return t+e}),0)},Zr=function(t){if(t--,t<0)return"";var e=t%26,n=Math.floor(t/26),r=Zr(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 x.some({listStyleType:x.none(),start:t});case 0:return x.some({listStyleType:x.some("upper-alpha"),start:Qr(t).toString()});case 1:return x.some({listStyleType:x.some("lower-alpha"),start:Qr(t).toString()});case 3:return x.some({listStyleType:x.none(),start:""});case 4:return x.none()}},io=function(t){var e=parseInt(t.start,10);return pn(t.listStyleType,"upper-alpha")?Zr(e):pn(t.listStyleType,"lower-alpha")?Zr(e).toLowerCase():t.start},uo=function(t){var e=nn(t);Re(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:x.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()}})},ao=function(t,e){return function(){var n=nn(t);return n&&n.nodeName===e}},co=function(t){t.addCommand("mceListProps",(function(){uo(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){Rr(t,"UL",n)})),t.addCommand("InsertOrderedList",(function(e,n){Rr(t,"OL",n)})),t.addCommand("InsertDefinitionList",(function(e,n){Rr(t,"DL",n)})),t.addCommand("RemoveList",(function(){ir(t)})),co(t),t.addCommand("mceListUpdate",(function(e,n){i(n)&&Jr(t,n)})),t.addQueryStateHandler("InsertUnorderedList",ao(t,"UL")),t.addQueryStateHandler("InsertOrderedList",ao(t,"OL")),t.addQueryStateHandler("InsertDefinitionList",ao(t,"DL"))},fo=function(t){t.on("keydown",(function(e){e.keyCode!==Yt.TAB||Yt.metaKeyPressed(e)||t.undoManager.transact((function(){(e.shiftKey?or(t):rr(t))&&e.preventDefault()}))}))},lo=function(t){Ue(t)&&fo(t),Xr(t)},mo=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)}}))},go=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 Re(n)?["listprops"]:[]}})};function po(){t.add("lists",(function(t){return!1===t.hasPlugin("rtc",!0)?(lo(t),so(t)):co(t),mo(t),go(t),Yr(t)}))}po()})()},"2d33":function(t,e,n){n("303c7")},"303c7":function(t,e){(function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager");function e(){t.add("colorpicker",(function(){}))}e()})()},3154:function(t,e,n){n("f034")},"34de":function(t,e,n){n("09cf")},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]:""}))},u=0;u0?L.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},ut=function(t,e){return e?e(t):'"},at=function(t,e){return e?e(t):'"},ct=function(t){return'