(()=>{var t={8785:()=>{tinymce.IconManager.add("default",{icons:{"accessibility-check":'',"action-next":'',"action-prev":'',"align-center":'',"align-justify":'',"align-left":'',"align-none":'',"align-right":'',"arrow-left":'',"arrow-right":'',bold:'',bookmark:'',"border-style":'',"border-width":'',brightness:'',browse:'',cancel:'',"cell-background-color":'',"cell-border-color":'',"change-case":'',"character-count":'',"checklist-rtl":'',checklist:'',checkmark:'',"chevron-down":'',"chevron-left":'',"chevron-right":'',"chevron-up":'',close:'',"code-sample":'',"color-levels":'',"color-picker":'',"color-swatch-remove-color":'',"color-swatch":'',"comment-add":'',comment:'',contrast:'',copy:'',crop:'',"cut-column":'',"cut-row":'',cut:'',"document-properties":'',drag:'',"duplicate-column":'',"duplicate-row":'',duplicate:'',"edit-block":'',"edit-image":'',"embed-page":'',embed:'',emoji:'',export:'',fill:'',"flip-horizontally":'',"flip-vertically":'',"format-painter":'',format:'',fullscreen:'',gallery:'',gamma:'',help:'',"highlight-bg-color":'',home:'',"horizontal-rule":'',"image-options":'',image:'',indent:'',info:'',"insert-character":'',"insert-time":'',invert:'',italic:'',language:'',"line-height":'',line:'',link:'',"list-bull-circle":'',"list-bull-default":'',"list-bull-square":'',"list-num-default-rtl":'',"list-num-default":'',"list-num-lower-alpha-rtl":'',"list-num-lower-alpha":'',"list-num-lower-greek-rtl":'',"list-num-lower-greek":'',"list-num-lower-roman-rtl":'',"list-num-lower-roman":'',"list-num-upper-alpha-rtl":'',"list-num-upper-alpha":'',"list-num-upper-roman-rtl":'',"list-num-upper-roman":'',lock:'',ltr:'',"more-drawer":'',"new-document":'',"new-tab":'',"non-breaking":'',notice:'',"ordered-list-rtl":'',"ordered-list":'',orientation:'',outdent:'',"page-break":'',paragraph:'',"paste-column-after":'',"paste-column-before":'',"paste-row-after":'',"paste-row-before":'',"paste-text":'',paste:'',"permanent-pen":'',plus:'',preferences:'',preview:'',print:'',quote:'',redo:'',reload:'',"remove-formatting":'',remove:'',"resize-handle":'',resize:'',"restore-draft":'',"rotate-left":'',"rotate-right":'',rtl:'',save:'',search:'',"select-all":'',selected:'',settings:'',sharpen:'',sourcecode:'',"spell-check":'',"strike-through":'',subscript:'',superscript:'',"table-caption":'',"table-cell-classes":'',"table-cell-properties":'',"table-cell-select-all":'',"table-cell-select-inner":'',"table-classes":'',"table-delete-column":'',"table-delete-row":'',"table-delete-table":'',"table-insert-column-after":'',"table-insert-column-before":'',"table-insert-row-above":'',"table-insert-row-after":'',"table-left-header":'',"table-merge-cells":'',"table-row-numbering-rtl":'',"table-row-numbering":'',"table-row-properties":'',"table-split-cells":'',"table-top-header":'',table:'',template:'',"temporary-placeholder":'',"text-color":'',toc:'',translate:'',underline:'',undo:'',unlink:'',unlock:'',"unordered-list":'',unselected:'',upload:'',user:'',"vertical-align":'',visualblocks:'',visualchars:'',warning:'',"zoom-in":'',"zoom-out":''}})},6890:(t,e,n)=>{n(8785)},8190:(t,e,n)=>{n(7440)},7440:()=>{!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager");t.add("code",(function(t){return function(t){t.addCommand("mceCodeEditor",(function(){!function(t){var e=function(t){return t.getContent({source_view:!0})}(t);t.windowManager.open({title:"Source Code",size:"large",body:{type:"panel",items:[{type:"textarea",name:"code"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{code:e},onSubmit:function(e){!function(t,e){t.focus(),t.undoManager.transact((function(){t.setContent(e)})),t.selection.setCursorLocation(),t.nodeChanged()}(t,e.getData().code),e.close()}})}(t)}))}(t),function(t){var e=function(){return t.execCommand("mceCodeEditor")};t.ui.registry.addButton("code",{icon:"sourcecode",tooltip:"Source code",onAction:e}),t.ui.registry.addMenuItem("code",{icon:"sourcecode",text:"Source code",onAction:e})}(t),{}}))}()},8860:(t,e,n)=>{n(1768)},1768:(t,e,n)=>{!function(){"use strict";var t=function(t){return function(e){return 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}(e)===t}},e=function(t){return function(e){return typeof e===t}},r=function(t){return function(e){return t===e}},o=t("string"),i=t("object"),a=t("array"),u=r(null),c=e("boolean"),s=r(void 0),l=function(t){return null==t},f=function(t){return!l(t)},d=e("function"),m=e("number"),g=function(t,e){if(a(t)){for(var n=0,r=t.length;n-1},I=function(t,e){for(var n=0,r=t.length;n=0;n--)e(t[n],n)}(t,(function(t,r){n=e(n,t,r)})),n},X=function(t,e,n){return W(t,(function(t,r){n=e(n,t,r)})),n},K=function(t,e){return function(t,e,n){for(var r=0,o=t.length;r=0&&e=e.length&&t.substr(n,n+e.length)===e},Et=function(t,e){return-1!==t.indexOf(e)},zt=function(t,e){return Ot(t,e,0)},Tt=function(t,e){return Ot(t,e,t.length-e.length)},Mt=function(t){return function(e){return e.replace(t,"")}}(/^\s+|\s+$/g),Dt=function(t){return t.length>0},At=function(t){return void 0!==t.style&&d(t.style.getPropertyValue)},Nt=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},Bt={fromHtml:function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return Nt(n.childNodes[0])},fromTag:function(t,e){var n=(e||document).createElement(t);return Nt(n)},fromText:function(t,e){var n=(e||document).createTextNode(t);return Nt(n)},fromDom:Nt,fromPoint:function(t,e,n){return B.from(t.dom.elementFromPoint(e,n)).map(Nt)}};"undefined"!=typeof window?window:Function("return this;")();var Rt,Ht=function(t){return t.dom.nodeName.toLowerCase()},Lt=function(t){return function(e){return function(t){return t.dom.nodeType}(e)===t}},Vt=Lt(1),Pt=Lt(3),It=Lt(9),Ft=Lt(11),Ut=function(t){var e,n=!1;return function(){for(var r=[],o=0;o0&&e0}))},on=function(t){var e={},n=t.dom;if(At(n))for(var r=0;ro?e-o:0}}},ln=sn("height",(function(t){var e=t.dom;return Ie(t)?e.getBoundingClientRect().height:e.offsetHeight})),fn=function(t){return ln.get(t)},dn=function(t){return ln.getOuter(t)},mn=function(t,e){return{left:t,top:e,translate:function(n,r){return mn(t+n,e+r)}}},gn=mn,hn=function(t,e){return void 0!==t?t:void 0!==e?e:0},pn=function(t){var e=t.dom.ownerDocument,n=e.body,r=e.defaultView,o=e.documentElement;if(n===t.dom)return gn(n.offsetLeft,n.offsetTop);var i=hn(null==r?void 0:r.pageYOffset,o.scrollTop),a=hn(null==r?void 0:r.pageXOffset,o.scrollLeft),u=hn(o.clientTop,n.clientTop),c=hn(o.clientLeft,n.clientLeft);return vn(t).translate(a-c,i-u)},vn=function(t){var e=t.dom,n=e.ownerDocument.body;return n===e?gn(n.offsetLeft,n.offsetTop):Ie(t)?function(t){var e=t.getBoundingClientRect();return gn(e.left,e.top)}(e):gn(0,0)},bn=sn("width",(function(t){return t.dom.offsetWidth})),yn=function(t){return bn.get(t)},xn=function(t){return bn.getOuter(t)},wn=function(t){var e=Bt.fromDom(function(t){if(Be()&&f(t.target)){var e=Bt.fromDom(t.target);if(Vt(e)&&Pe(e)&&t.composed&&t.composedPath){var n=t.composedPath();if(n)return at(n)}}return B.from(t.target)}(t).getOr(t.target)),n=function(){return t.stopPropagation()},r=function(){return t.preventDefault()},o=p(r,n);return function(t,e,n,r,o,i,a){return{target:t,x:e,y:n,stop:r,prevent:o,kill:i,raw:a}}(e,t.clientX,t.clientY,n,r,o,t)},Cn=function(t,e,n,r,o){var i=function(t,e){return function(n){t(n)&&e(wn(n))}}(n,r);return t.dom.addEventListener(e,i,o),{unbind:x(Sn,t,e,i,o)}},Sn=function(t,e,n,r){t.dom.removeEventListener(e,n,r)},kn=function(t,e){Oe(t).each((function(n){n.dom.insertBefore(e.dom,t.dom)}))},_n=function(t,e){(function(t){return B.from(t.dom.nextSibling).map(Bt.fromDom)})(t).fold((function(){Oe(t).each((function(t){En(t,e)}))}),(function(t){kn(t,e)}))},On=function(t,e){(function(t){return Te(t,0)})(t).fold((function(){En(t,e)}),(function(n){t.dom.insertBefore(e.dom,n.dom)}))},En=function(t,e){t.dom.appendChild(e.dom)},zn=function(t,e){W(e,(function(e){En(t,e)}))},Tn=function(t){t.dom.textContent="",W(ze(t),(function(t){Mn(t)}))},Mn=function(t){var e=t.dom;null!==e.parentNode&&e.parentNode.removeChild(e)},Dn=function(t){var e,n=ze(t);n.length>0&&(e=t,W(n,(function(t){kn(e,t)}))),Mn(t)},An=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 gn(n,r)},Nn=function(t,e,n){var r=(void 0!==n?n.dom:document).defaultView;r&&r.scrollTo(t,e)},Bn=function(t,e,n,r){return{x:t,y:e,width:n,height:r,right:t+n,bottom:e+r}},Rn=function(t){var e=void 0===t?window:t,n=e.document,r=An(Bt.fromDom(n));return function(t){var e=void 0===t?window:t;return pe().browser.isFirefox()?B.none():B.from(e.visualViewport)}(e).fold((function(){var t=e.document.documentElement,n=t.clientWidth,o=t.clientHeight;return Bn(r.left,r.top,n,o)}),(function(t){return Bn(Math.max(t.pageLeft,r.left),Math.max(t.pageTop,r.top),t.width,t.height)}))},Hn=function(t,e){return t.view(e).fold(v([]),(function(e){var n=t.owner(e),r=Hn(t,n);return[e].concat(r)}))},Ln=Object.freeze({__proto__:null,view:function(t){var e;return(t.dom===document?B.none():B.from(null===(e=t.dom.defaultView)||void 0===e?void 0:e.frameElement)).map(Bt.fromDom)},owner:function(t){return Ce(t)}}),Vn=function(t){var e=Bt.fromDom(document),n=An(e);return function(t,e){var n=e.owner(t),r=Hn(e,n);return B.some(r)}(t,Ln).fold(x(pn,t),(function(e){var r=vn(t),o=$(e,(function(t,e){var n=vn(e);return{left:t.left+n.left,top:t.top+n.top}}),{left:0,top:0});return gn(o.left+r.left+n.left,o.top+r.top+n.top)}))},Pn=function(t,e,n,r){return{x:t,y:e,width:n,height:r,right:t+n,bottom:e+r}},In=function(t){var e=pn(t),n=xn(t),r=dn(t);return Pn(e.left,e.top,n,r)},Fn=function(t){var e=Vn(t),n=xn(t),r=dn(t);return Pn(e.left,e.top,n,r)},Un=function(){return Rn(window)},jn=function(t){return{isValue:k,isError:S,getOr:v(t),getOrThunk:v(t),getOrDie:v(t),or:function(e){return jn(t)},orThunk:function(e){return jn(t)},fold:function(e,n){return n(t)},map:function(e){return jn(e(t))},mapError:function(e){return jn(t)},each:function(e){e(t)},bind:function(e){return e(t)},exists:function(e){return e(t)},forall:function(e){return e(t)},toOptional:function(){return B.some(t)}}},Wn=function(t){return{isValue:S,isError:k,getOr:b,getOrThunk:function(t){return t()},getOrDie:function(){return C(String(t))()},or:b,orThunk:function(t){return t()},fold:function(e,n){return e(t)},map:function(e){return Wn(t)},mapError:function(e){return Wn(e(t))},each:h,bind:function(e){return Wn(t)},exists:S,forall:k,toOptional:B.none}},qn={value:jn,error:Wn,fromOption:function(t,e){return t.fold((function(){return Wn(e)}),jn)}};!function(t){t[t.Error=0]="Error",t[t.Value=1]="Value"}(Rt||(Rt={}));var Gn=function(t,e,n){return t.stype===Rt.Error?e(t.serror):n(t.svalue)},$n=function(t){return{stype:Rt.Value,svalue:t}},Xn=function(t){return{stype:Rt.Error,serror:t}},Kn=function(t){return t.fold(Xn,$n)},Yn=function(t){return Gn(t,qn.error,qn.value)},Jn=$n,Qn=function(t){var e=[],n=[];return W(t,(function(t){Gn(t,(function(t){return n.push(t)}),(function(t){return e.push(t)}))})),{values:e,errors:n}},Zn=Xn,tr=function(t,e){return t.stype===Rt.Value?e(t.svalue):t},er=function(t,e){return t.stype===Rt.Error?e(t.serror):t},nr=function(t,e){return t.stype===Rt.Value?{stype:Rt.Value,svalue:e(t.svalue)}:t},rr=function(t,e){return t.stype===Rt.Error?{stype:Rt.Error,serror:e(t.serror)}:t},or=Gn,ir=function(t,e,n,r){return{tag:"field",key:t,newKey:e,presence:n,prop:r}},ar=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)}},ur=function(t){return function(){for(var e=[],n=0;n0?mr(e.errors):Jn(e.values)},hr=function(t){return i(t)&<(t).length>100?" removed due to size":JSON.stringify(t,null,2)},pr=function(t,e){return Zn([{path:t,getErrorInfo:e}])},vr=function(t){return{extract:function(e,n){return er(t(n),(function(t){return function(t,e){return pr(t,v(e))}(e,t)}))},toString:v("val")}},br=vr(Jn),yr=function(t,e,n,r){return yt(e,n).fold((function(){return function(t,e,n){return pr(t,(function(){return'Could not find valid *required* value for "'+e+'" in '+hr(n)}))}(t,n,e)}),r)},xr=function(t,e,n,r){return r(yt(t,e).getOrThunk((function(){return n(t)})))},wr=function(t,e,n,r,o){var i=function(t){return o.extract(e.concat([r]),t)},a=function(t){return t.fold((function(){return Jn(B.none())}),(function(t){var n=o.extract(e.concat([r]),t);return nr(n,B.some)}))};switch(t.tag){case"required":return yr(e,n,r,i);case"defaultedThunk":return xr(n,r,t.process,i);case"option":return function(t,e,n){return n(yt(t,e))}(n,r,a);case"defaultedOptionThunk":return function(t,e,n,r){return r(yt(t,e).map((function(e){return!0===e?n(t):e})))}(n,r,t.process,a);case"mergeWithThunk":return xr(n,r,v({}),(function(e){var r=cr(t.process(n),e);return i(r)}))}},Cr=function(t){return{extract:function(e,n){return t().extract(e,n)},toString:function(){return t().toString()}}},Sr=function(t){return lt(ht(t,f))},kr=function(t){var e=_r(t),n=$(t,(function(t,e){return ar(e,(function(e){var n;return cr(t,((n={})[e]=!0,n))}),v(t))}),{});return{extract:function(t,r){var o=c(r)?[]:Sr(r),i=G(o,(function(t){return!wt(n,t)}));return 0===i.length?e.extract(t,r):function(t,e){return pr(t,(function(){return"There are unsupported fields: ["+e.join(", ")+"] specified"}))}(t,i)},toString:e.toString}},_r=function(t){return{extract:function(e,n){return function(t,e,n){for(var r={},o=[],i=0,a=n;i0?Zn(o):Jn(r)}(e,n,t)},toString:function(){return"obj{\n"+j(t,(function(t){return ar(t,(function(t,e,n,r){return t+" -> "+r.toString()}),(function(t,e){return"state("+t+")"}))})).join("\n")+"}"}}},Or=function(t){return{extract:function(e,n){var r=j(n,(function(n,r){return t.extract(e.concat(["["+r+"]"]),n)}));return gr(r)},toString:function(){return"array("+t.toString()+")"}}},Er=function(t){return{extract:function(e,n){for(var r=[],o=0,i=t;o10?e.slice(0,10).concat([{path:[],getErrorInfo:v("... (only showing first ten failures)")}]):e,j(n,(function(t){return"Failed path: ("+t.path.join(" > ")+")\n"+t.getErrorInfo()}))).join("\n")+"\n\nInput object: "+hr(t.input);var e,n},Gr=function(t,e){return Pr(t,mt(e,_r))},$r=ir,Xr=function(t,e){return{tag:"custom",newKey:t,instantiator:e}},Kr=function(t){return Ir((function(e){return P(t,e)?qn.value(e):qn.error('Unsupported value: "'+e+'", choose one of "'+t.join(", ")+'".')}))},Yr=function(t){return $r(t,t,{tag:"required",process:{}},Mr())},Jr=function(t,e){return $r(t,t,{tag:"required",process:{}},e)},Qr=function(t){return Jr(t,Ar)},Zr=function(t){return Jr(t,Nr)},to=function(t,e){return $r(t,t,{tag:"required",process:{}},Kr(e))},eo=function(t){return Jr(t,Rr)},no=function(t,e){return $r(t,t,{tag:"required",process:{}},_r(e))},ro=function(t,e){return $r(t,t,{tag:"required",process:{}},Tr(e))},oo=function(t,e){return $r(t,t,{tag:"required",process:{}},Or(e))},io=function(t){return $r(t,t,{tag:"option",process:{}},Mr())},ao=function(t,e){return $r(t,t,{tag:"option",process:{}},e)},uo=function(t){return ao(t,Ar)},co=function(t){return ao(t,Nr)},so=function(t){return ao(t,Rr)},lo=function(t,e){return ao(t,Or(e))},fo=function(t,e){return ao(t,_r(e))},mo=function(t,e){return $r(t,t,fr(e),Mr())},go=function(t,e,n){return $r(t,t,fr(e),n)},ho=function(t,e){return go(t,e,Ar)},po=function(t,e){return go(t,e,Nr)},vo=function(t,e,n){return go(t,e,Kr(n))},bo=function(t,e){return go(t,e,Br)},yo=function(t,e){return go(t,e,Rr)},xo=function(t,e,n){return go(t,e,Or(n))},wo=function(t,e,n){return go(t,e,_r(n))},Co=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},So=function(t){if(!a(t))throw new Error("cases must be an array");if(0===t.length)throw new Error("there must be at least one case");var e=[],n={};return W(t,(function(r,o){var i=lt(r);if(1!==i.length)throw new Error("one and only one name per case");var u=i[0],c=r[u];if(void 0!==n[u])throw new Error("duplicate key detected:"+u);if("cata"===u)throw new Error("cannot have a case named cata (sorry)");if(!a(c))throw new Error("case arguments must be an array");e.push(u),n[u]=function(){for(var n=[],r=0;r0?(n=r.errors,qn.error(J(n))):function(t,e){return 0===t.length?qn.value(e):qn.value(cr(e,sr.apply(void 0,t)))}(r.values,e)},To=function(t){return d(t)?t:S},Mo=function(t,e,n){for(var r=t.dom,o=To(n);r.parentNode;){r=r.parentNode;var i=Bt.fromDom(r),a=e(i);if(a.isSome())return a;if(o(i))break}return B.none()},Do=function(t,e,n){var r=e(t),o=To(n);return r.orThunk((function(){return o(t)?B.none():Mo(t,e,o)}))},Ao=function(t,e){return ye(t.element,e.event.target)},No={can:k,abort:S,run:h},Bo=function(t){if(!wt(t,"can")&&!wt(t,"abort")&&!wt(t,"run"))throw new Error("EventHandler defined by: "+JSON.stringify(t,null,2)+" does not have can, abort, or run!");return O(O({},No),t)},Ro=function(t){return{can:function(t,e){return function(){for(var n=[],r=0;r1?G(e[n],(function(e){return I(t,(function(t){return t.name===e}))})).join(" > "):t[0].name;return Oo(n,function(t,e){return{handler:t,purpose:e}}(o,i))}))}));return zo(n,{})},Da="alloy.base.behaviour",Aa=_r([$r("dom","dom",{tag:"required",process:{}},_r([Yr("tag"),mo("styles",{}),mo("classes",[]),mo("attributes",{}),io("value"),io("innerHtml")])),Yr("components"),Yr("uid"),mo("events",{}),mo("apis",{}),$r("eventOrder","eventOrder",function(t){return dr(v(t))}((ko={},ko[si()]=["disabling",Da,"toggling","typeaheadevents"],ko[ii()]=[Da,"focusing","keying"],ko[hi()]=[Da,"disabling","toggling","representing"],ko[Yo()]=[Da,"representing","streaming","invalidating"],ko[wi()]=[Da,"representing","item-events","tooltipping"],ko[Fo()]=["focusing",Da,"item-type-events"],ko[Lo()]=["focusing",Da,"item-type-events"],ko[qo()]=["item-type-events","tooltipping"],ko[ci()]=["receiving","reflecting","tooltipping"],ko)),Mr()),io("domModification")]),Na=function(t){return t.events},Ba=function(t,e){var n=Ge(t,e);return void 0===n||""===n?[]:n.split(" ")},Ra=function(t){return void 0!==t.dom.classList},Ha=function(t,e){return function(t,e,n){var r=Ba(t,e).concat([n]);return We(t,e,r.join(" ")),!0}(t,"class",e)},La=function(t,e){return function(t,e,n){var r=G(Ba(t,e),(function(t){return t!==n}));return r.length>0?We(t,e,r.join(" ")):Ke(t,e),!1}(t,"class",e)},Va=function(t,e){Ra(t)?t.dom.classList.add(e):Ha(t,e)},Pa=function(t){0===(Ra(t)?t.dom.classList:function(t){return Ba(t,"class")}(t)).length&&Ke(t,"class")},Ia=function(t,e){Ra(t)?t.dom.classList.remove(e):La(t,e);Pa(t)},Fa=function(t,e){return Ra(t)&&t.dom.classList.contains(e)},Ua=function(t,e){W(e,(function(e){Va(t,e)}))},ja=function(t,e){W(e,(function(e){Ia(t,e)}))},Wa=function(t){return t.dom.value},qa=function(t,e){if(void 0===e)throw new Error("Value.set was undefined");t.dom.value=e},Ga=function(t,e){return function(t,e){var n=j(e,(function(t){return fo(t.name(),[Yr("config"),mo("state",wa)])})),r=Ur("component.behaviours",_r(n),t.behaviours).fold((function(e){throw new Error(qr(e)+"\nComplete spec:\n"+JSON.stringify(t,null,2))}),b);return{list:e,data:mt(r,(function(t){var e=t.map((function(t){return{config:t.config,state:t.state.init(t.config)}}));return v(e)}))}}(t,e)},$a=function(t){var e=function(t){var e=yt(t,"behaviours").getOr({});return Q(lt(e),(function(t){var n=e[t];return f(n)?[n.me]:[]}))}(t);return Ga(t,e)},Xa=function(t,e,n){var r,o,i,a=O(O({},(r=t).dom),{uid:r.uid,domChildren:j(r.components,(function(t){return t.element}))}),u=function(t){return t.domModification.fold((function(){return ka({})}),ka)}(t),c={"alloy.base.modification":u},s=e.length>0?function(t,e,n,r){var o=O({},e);W(n,(function(e){o[e.name()]=e.exhibit(t,r)}));var i=Sa(o,(function(t,e){return{name:t,modification:e}})),a=function(t){return $(t,(function(t,e){return O(O({},e.modification),t)}),{})},u=$(i.classes,(function(t,e){return e.modification.concat(t)}),[]),c=a(i.attributes),s=a(i.styles);return ka({classes:u,attributes:c,styles:s})}(n,c,e,a):u;return i=s,O(O({},o=a),{attributes:O(O({},o.attributes),i.attributes),styles:O(O({},o.styles),i.styles),classes:o.classes.concat(i.classes)})},Ka=function(t,e,n){var r={"alloy.base.behaviour":Na(t)};return function(t,e,n,r){var o=Ea(t,n,r);return Ma(o,e)}(n,t.eventOrder,e,r).getOrDie()},Ya=function(t){var e=function(){return l},n=Co(ha),r=jr(function(t){return Ur("custom.definition",Aa,t)}(t)),o=$a(t),i=function(t){return t.list}(o),a=function(t){return t.data}(o),u=function(t){var e=Bt.fromTag(t.tag);qe(e,t.attributes),Ua(e,t.classes),Ze(e,t.styles),t.innerHtml.each((function(t){return Qi(e,t)}));var n=t.domChildren;return zn(e,n),t.value.each((function(t){qa(e,t)})),t.uid,la(e,t.uid),e}(Xa(r,i,a)),c=Ka(r,i,a),s=Co(r.components),l={uid:t.uid,getSystem:n.get,config:function(e){var n=a;return(d(n[e.name()])?n[e.name()]:function(){throw new Error("Could not find "+e.name()+" in "+JSON.stringify(t,null,2))})()},hasConfigured:function(t){return d(a[t.name()])},spec:t,readState:function(t){return a[t]().map((function(t){return t.state.readState()})).getOr("not enabled")},getApis:function(){return r.apis},connect:function(t){n.set(t)},disconnect:function(){n.set(ga(e))},element:u,syncComponents:function(){var t=ze(u),e=Q(t,(function(t){return n.get().getByDom(t).fold((function(){return[]}),rt)}));s.set(e)},components:s.get,events:c};return l},Ja=function(t){var e=ma(t),n=e.events,r=E(e,["events"]),o=function(t){var e=yt(t,"components").getOr([]);return j(e,eu)}(r),i=O(O({},r),{events:O(O({},ra),n),components:o});return qn.value(Ya(i))},Qa=function(t){var e=Bt.fromText(t);return Za({element:e})},Za=function(t){var e=Wr("external.component",kr([Yr("element"),io("uid")]),t),n=Co(ga()),r=e.uid.getOrThunk((function(){return da("external")}));la(e.element,r);var o={uid:r,getSystem:n.get,config:B.none,hasConfigured:S,connect:function(t){n.set(t)},disconnect:function(){n.set(ga((function(){return o})))},getApis:function(){return{}},element:e.element,spec:t,readState:v("No state"),syncComponents:h,components:v([]),events:{}};return ya(o)},tu=da,eu=function(t){return function(t){return yt(t,ba)}(t).getOrThunk((function(){var e=function(t){return xt(t,"uid")}(t)?t:O({uid:tu("")},t);return Ja(e).getOrDie()}))},nu=ya;function ru(t,e,n,r,o){return t(n,r)?B.some(n):d(o)&&o(n)?B.none():e(n,r,o)}var ou,iu=function(t,e,n){for(var r=t.dom,o=d(n)?n:S;r.parentNode;){r=r.parentNode;var i=Bt.fromDom(r);if(e(i))return B.some(i);if(o(i))break}return B.none()},au=function(t,e,n){return ru((function(t,e){return e(t)}),iu,t,e,n)},uu=function(t,e,n){return au(t,e,n).isSome()},cu=function(t,e,n){return iu(t,(function(t){return ve(t,e)}),n)},su=function(t,e){return function(t,e){return K(t.dom.childNodes,(function(t){return e(Bt.fromDom(t))})).map(Bt.fromDom)}(t,(function(t){return ve(t,e)}))},lu=function(t,e){return function(t,e){var n=void 0===e?document:e.dom;return be(n)?B.none():B.from(n.querySelector(t)).map(Bt.fromDom)}(e,t)},fu=function(t,e,n){return ru((function(t,e){return ve(t,e)}),cu,t,e,n)},du=function(){var t=ia("aria-owns");return{id:t,link:function(e){We(e,"aria-owns",t)},unlink:function(t){Ke(t,"aria-owns")}}},mu=function(t,e){return function(t){return au(t,(function(t){if(!Vt(t))return!1;var e=Ge(t,"id");return void 0!==e&&e.indexOf("aria-owns")>-1})).bind((function(t){var e=Ge(t,"id"),n=Re(t);return lu(n,'[aria-owns="'+e+'"]')}))}(e).exists((function(e){return gu(t,e)}))},gu=function(t,e){return uu(e,(function(e){return ye(e,t.element)}),S)||mu(t,e)},hu="unknown";!function(t){t[t.STOP=0]="STOP",t[t.NORMAL=1]="NORMAL",t[t.LOGGING=2]="LOGGING"}(ou||(ou={}));var pu=Co({}),vu=function(t,e,n){switch(yt(pu.get(),t).orThunk((function(){var e=lt(pu.get());return st(e,(function(e){return t.indexOf(e)>-1?B.some(pu.get()[e]):B.none()}))})).getOr(ou.NORMAL)){case ou.NORMAL:return n(xu());case ou.LOGGING:var r=function(t,e){var n=[],r=(new Date).getTime();return{logEventCut:function(t,e,r){n.push({outcome:"cut",target:e,purpose:r})},logEventStopped:function(t,e,r){n.push({outcome:"stopped",target:e,purpose:r})},logNoParent:function(t,e,r){n.push({outcome:"no-parent",target:e,purpose:r})},logEventNoHandlers:function(t,e){n.push({outcome:"no-handlers-left",target:e})},logEventResponse:function(t,e,r){n.push({outcome:"response",purpose:r,target:e})},write:function(){var o=(new Date).getTime();P(["mousemove","mouseover","mouseout",hi()],t)||console.log(t,{event:t,time:o-r,target:e.dom,sequence:j(n,(function(t){return P(["cut","stopped","response"],t.outcome)?"{"+t.purpose+"} "+t.outcome+" at ("+ea(t.target)+")":t.outcome}))})}}}(t,e),o=n(r);return r.write(),o;case ou.STOP:return!0}},bu=["alloy/data/Fields","alloy/debugging/Debugging"],yu=function(t,e,n){return vu(t,e,n)},xu=v({logEventCut:h,logEventStopped:h,logNoParent:h,logEventNoHandlers:h,logEventResponse:h,write:h}),wu=v([Yr("menu"),Yr("selectedMenu")]),Cu=v([Yr("item"),Yr("selectedItem")]);v(_r(Cu().concat(wu())));var Su=v(_r(Cu())),ku=no("initSize",[Yr("numColumns"),Yr("numRows")]),_u=function(){return no("markers",[Yr("backgroundMenu")].concat(wu()).concat(Cu()))},Ou=function(t){return no("markers",j(t,Yr))},Eu=function(t,e,n){return function(){var t=new Error;if(void 0!==t.stack){var e=t.stack.split("\n");return K(e,(function(t){return t.indexOf("alloy")>0&&!I(bu,(function(e){return t.indexOf(e)>-1}))})).getOr(hu)}}(),$r(e,e,n,Ir((function(t){return qn.value((function(){for(var e=[],n=0;nr?n:o=n&&a<=o&&u>=r&&u<=i,sizeInBounds:c<=o&&c>=n&&s<=i&&s>=r,visibleW:Math.min(l,a>=n?o-a:c-n),visibleH:Math.min(f,u>=r?i-u:s-r)}}(s,a),f=l.originInBounds,d=l.sizeInBounds,m=l.visibleW,g=l.visibleH,h=f&&d,p=h?s:function(t,e){var n=e.x,r=e.y,o=e.right,i=e.bottom,a=t.x,u=t.y,c=t.width,s=t.height,l=Math.max(n,o-c),f=Math.max(r,i-s),d=Gu(a,n,l),m=Gu(u,r,f),g=Math.min(d+c,o)-d,h=Math.min(m+s,i)-m;return Pn(d,m,g,h)}(s,a),b=p.width>0&&p.height>0,y=function(t,e,n){var r=v(e.bottom-n.y),o=v(n.bottom-e.y),i=function(t,e,n,r){return t.fold(e,e,r,r,e,r,n,n)}(t,o,o,r),a=v(e.right-n.x),u=v(n.right-e.x);return{maxWidth:function(t,e,n,r){return t.fold(e,r,e,r,n,n,e,r)}(t,u,u,a),maxHeight:i}}(t.direction,p,r),x=y.maxWidth,w={rect:p,maxHeight:y.maxHeight,maxWidth:x,direction:t.direction,placement:t.placement,classes:{on:o.classesOn,off:o.classesOff},layout:t.label,testY:c};return h||t.alwaysFit?Kc.fit(w):Kc.nofit(w,m,g,b)},Jc=function(t){var e=Co(B.none()),n=function(){return e.get().each(t)};return{clear:function(){n(),e.set(B.none())},isSet:function(){return e.get().isSome()},get:function(){return e.get()},set:function(t){n(),e.set(B.some(t))}}},Qc=function(){return Jc((function(t){return t.destroy()}))},Zc=function(){return Jc((function(t){return t.unbind()}))},ts=function(){var t=Jc(h);return O(O({},t),{on:function(e){return t.get().each(e)}})},es=k,ns=function(t,e,n){return function(t,e,n,r){return Cn(t,e,n,r,!1)}(t,e,es,n)},rs=function(t,e,n){return function(t,e,n,r){return Cn(t,e,n,r,!0)}(t,e,es,n)},os=wn,is=["top","bottom","right","left"],as="data-alloy-transition-timer",us=function(t,e){return function(t,e){return Z(e,(function(e){return Fa(t,e)}))}(t,e.classes)},cs=function(t,e){var n=function(t){return parseFloat(t).toFixed(3)};return vt(e,(function(e,r){var o,i,a,u=t[r].map(n),c=e.map(n);return void 0===a&&(a=y),!kt(o=u,i=c,a).getOr(o.isNone()&&i.isNone())})).isSome()},ss=function(t,e){var n,r=Zc(),i=Zc(),a=function(e){var n,r=null!==(n=e.raw.pseudoElement)&&void 0!==n?n:"";return ye(e.target,t)&&!Dt(r)&&P(is,e.raw.propertyName)},u=function(o){if(l(o)||a(o)){r.clear(),i.clear();var u=null==o?void 0:o.raw.type;(l(u)||u===ti())&&(clearTimeout(n),Ke(t,as),ja(t,e.classes))}},c=function(){r.set(ns(t,ti(),u)),i.set(ns(t,Zo(),u))};if("ontransitionstart"in t.dom)var s=ns(t,ei(),(function(t){a(t)&&(s.unbind(),c())}));else c();var f=function(t){var e=function(e){var n=en(t,e),r=o(n)?n.split(/\s*,\s*/):[];return G(r,Dt)},n=function(t){if(o(t)&&/^[\d.]+/.test(t)){var e=parseFloat(t);return Tt(t,"ms")?e:1e3*e}return 0},r=e("transition-delay"),i=e("transition-duration");return X(i,(function(t,e,o){var i=n(r[o])+n(e);return Math.max(t,i)}),0)}(t);requestAnimationFrame((function(){n=setTimeout(u,f+17),We(t,as,n)}))},ls=function(t,e,n,r,o,i){var a=function(t,e,n){return n.exists((function(n){var r=t.mode;return"all"===r||n[r]!==e[r]}))}(r,o,i);if(a||us(t,r)){Qe(t,"position",n.position);var u=Ic(e,t),c=Pc(e,O(O({},o),{rect:u})),s=nt(is,(function(t){return c[t]}));cs(n,s)&&(tn(t,s),a&&function(t,e){Ua(t,e.classes),$e(t,as).each((function(e){clearTimeout(parseInt(e,10)),Ke(t,as)})),ss(t,e)}(t,r),cn(t))}else ja(t,r.classes)},fs=function(t,e,n,r){un(e,"max-height"),un(e,"max-width");var o,i={width:xn(o=e),height:dn(o)};return function(t,e,n,r,o,i){var a=r.width,u=r.height,c=function(e,c,s,l,f){var d=e(n,r,o,t,i),m=Yc(d,a,u,i);return m.fold(v(m),(function(t,e,n,r){return(f===r?n>l||e>s:!f&&r)?m:Kc.nofit(c,s,l,f)}))};return X(e,(function(t,e){var n=x(c,e);return t.fold(v(t),n)}),Kc.nofit({rect:n,maxHeight:r.height,maxWidth:r.width,direction:Lu(),placement:"southeast",classes:{on:[],off:[]},layout:"none",testY:n.y},-1,-1,!1)).fold(b,b)}(e,r.preference,t,i,n,r.bounds)},ds=function(t,e){!function(t,e){We(t,$c,e)}(t,e.placement)},ms=function(t,e){!function(t,e){var n=ln.max(t,e,["margin-top","border-top-width","padding-top","padding-bottom","border-bottom-width","margin-bottom"]);Qe(t,"max-height",n+"px")}(t,Math.floor(e))},gs=v((function(t,e){ms(t,e),Ze(t,{"overflow-x":"hidden","overflow-y":"auto"})})),hs=v((function(t,e){ms(t,e)})),ps=function(t,e,n){return void 0===t[e]?n:t[e]},vs=function(t,e,n,r){var o=fs(t,e,n,r);return function(t,e,n){var r=Pc(n.origin,e);n.transition.each((function(o){ls(t,n.origin,r,o,e,n.lastPlacement)})),Hc(t,r)}(e,o,r),ds(e,o),function(t,e){var n=e.classes;ja(t,n.off),Ua(t,n.on)}(e,o),function(t,e,n){(0,n.maxHeightFunction)(t,e.maxHeight)}(e,o,r),function(t,e,n){(0,n.maxWidthFunction)(t,e.maxWidth)}(e,o,r),{layout:o.layout,placement:o.placement}},bs=["valignCentre","alignLeft","alignRight","alignCentre","top","bottom","left","right","inset"],ys=function(t,e,n,r){void 0===r&&(r=1);var o=t*r,i=e*r,a=function(t){return yt(n,t).getOr([])},u=function(t,e,n){var r=et(bs,n);return{offset:gn(t,e),classesOn:Q(n,a),classesOff:Q(r,a)}};return{southeast:function(){return u(-t,e,["top","alignLeft"])},southwest:function(){return u(t,e,["top","alignRight"])},south:function(){return u(-t/2,e,["top","alignCentre"])},northeast:function(){return u(-t,-e,["bottom","alignLeft"])},northwest:function(){return u(t,-e,["bottom","alignRight"])},north:function(){return u(-t/2,-e,["bottom","alignCentre"])},east:function(){return u(t,-e/2,["valignCentre","left"])},west:function(){return u(-t,-e/2,["valignCentre","right"])},insetNortheast:function(){return u(o,i,["top","alignLeft","inset"])},insetNorthwest:function(){return u(-o,i,["top","alignRight","inset"])},insetNorth:function(){return u(-o/2,i,["top","alignCentre","inset"])},insetSoutheast:function(){return u(o,-i,["bottom","alignLeft","inset"])},insetSouthwest:function(){return u(-o,-i,["bottom","alignRight","inset"])},insetSouth:function(){return u(-o/2,-i,["bottom","alignCentre","inset"])},insetEast:function(){return u(-o,-i/2,["valignCentre","right","inset"])},insetWest:function(){return u(o,-i/2,["valignCentre","left","inset"])}}},xs=function(){return ys(0,0,{})},ws=b,Cs=function(t,e){return function(n){return"rtl"===Ss(n)?e:t}},Ss=function(t){return"rtl"===en(t,"direction")?"rtl":"ltr"};!function(t){t.TopToBottom="toptobottom",t.BottomToTop="bottomtotop"}(jc||(jc={}));var ks="data-alloy-vertical-dir",_s=function(t){return uu(t,(function(t){return Vt(t)&&Ge(t,"data-alloy-vertical-dir")===jc.BottomToTop}))},Os=function(){return fo("layouts",[Yr("onLtr"),Yr("onRtl"),io("onBottomLtr"),io("onBottomRtl")])},Es=function(t,e,n,r,o,i,a){var u=a.map(_s).getOr(!1),c=e.layouts.map((function(e){return e.onLtr(t)})),s=e.layouts.map((function(e){return e.onRtl(t)})),l=u?e.layouts.bind((function(e){return e.onBottomLtr.map((function(e){return e(t)}))})).or(c).getOr(o):c.getOr(n),f=u?e.layouts.bind((function(e){return e.onBottomRtl.map((function(e){return e(t)}))})).or(s).getOr(i):s.getOr(r);return Cs(l,f)(t)},zs=[Yr("hotspot"),io("bubble"),mo("overrides",{}),Os(),Au("placement",(function(t,e,n){var r=e.hotspot,o=Ic(n,r.element),i=Es(t.element,e,mc(),gc(),fc(),dc(),B.some(e.hotspot.element));return B.some(ws({anchorBox:o,bubble:e.bubble.getOr(xs()),overrides:e.overrides,layouts:i,placer:B.none()}))}))],Ts=[Yr("x"),Yr("y"),mo("height",0),mo("width",0),mo("bubble",xs()),mo("overrides",{}),Os(),Au("placement",(function(t,e,n){var r=Uc(n,e.x,e.y),o=Pn(r.left,r.top,e.width,e.height),i=Es(t.element,e,sc(),lc(),sc(),lc(),B.none());return B.some(ws({anchorBox:o,bubble:e.bubble,overrides:e.overrides,layouts:i,placer:B.none()}))}))],Ms=So([{screen:["point"]},{absolute:["point","scrollLeft","scrollTop"]}]),Ds=function(t){return t.fold(b,(function(t,e,n){return t.translate(-e,-n)}))},As=function(t){return t.fold(b,b)},Ns=function(t){return X(t,(function(t,e){return t.translate(e.left,e.top)}),gn(0,0))},Bs=function(t){var e=j(t,As);return Ns(e)},Rs=Ms.screen,Hs=Ms.absolute,Ls=function(t,e,n){var r=Ce(t.element),o=An(r),i=function(t,e,n){var r=_e(n.root).dom;return B.from(r.frameElement).map(Bt.fromDom).filter((function(e){var n=Ce(e),r=Ce(t.element);return ye(n,r)})).map(pn)}(t,0,n).getOr(o);return Hs(i,o.left,o.top)},Vs=function(t,e,n,r){var o=Rs(gn(t,e));return B.some(function(t,e,n){return{point:t,width:e,height:n}}(o,n,r))},Ps=function(t,e,n,r,o){return t.map((function(t){var i,a,u,c=[e,t.point],s=(i=function(){return Bs(c)},a=function(){return Bs(c)},u=function(){return function(t){var e=j(t,Ds);return Ns(e)}(c)},r.fold(i,a,u)),l=function(t,e,n,r){return{x:t,y:e,width:n,height:r}}(s.left,s.top,t.width,t.height),f=n.showAbove?fc():mc(),d=n.showAbove?dc():gc(),m=Es(o,n,f,d,f,d,B.none());return ws({anchorBox:l,bubble:n.bubble.getOr(xs()),overrides:n.overrides,layouts:m,placer:B.none()})}))},Is=[Yr("node"),Yr("root"),io("bubble"),Os(),mo("overrides",{}),mo("showAbove",!1),Au("placement",(function(t,e,n){var r=Ls(t,0,e);return e.node.filter(Ie).bind((function(o){var i=o.dom.getBoundingClientRect(),a=Vs(i.left,i.top,i.width,i.height),u=e.node.getOr(t.element);return Ps(a,r,e,n,u)}))}))],Fs=function(t,e,n,r){return{start:t,soffset:e,finish:n,foffset:r}},Us=So([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),js=(Us.before,Us.on,Us.after,function(t){return t.fold(b,b,b)}),Ws=So([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),qs={domRange:Ws.domRange,relative:Ws.relative,exact:Ws.exact,exactFromRange:function(t){return Ws.exact(t.start,t.soffset,t.finish,t.foffset)},getWin:function(t){var e=function(t){return t.match({domRange:function(t){return Bt.fromDom(t.startContainer)},relative:function(t,e){return js(t)},exact:function(t,e,n,r){return t}})}(t);return _e(e)},range:Fs},Gs=function(t,e,n){var r,o=t.document.createRange();return r=o,e.fold((function(t){r.setStartBefore(t.dom)}),(function(t,e){r.setStart(t.dom,e)}),(function(t){r.setStartAfter(t.dom)})),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)}))}(o,n),o},$s=function(t,e,n,r,o){var i=t.document.createRange();return i.setStart(e.dom,n),i.setEnd(r.dom,o),i},Xs=function(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom,width:t.width,height:t.height}},Ks=So([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),Ys=function(t,e,n){return e(Bt.fromDom(n.startContainer),n.startOffset,Bt.fromDom(n.endContainer),n.endOffset)},Js=function(t,e){return function(t,e){var n=e.ltr();return n.collapsed?e.rtl().filter((function(t){return!1===t.collapsed})).map((function(t){return Ks.rtl(Bt.fromDom(t.endContainer),t.endOffset,Bt.fromDom(t.startContainer),t.startOffset)})).getOrThunk((function(){return Ys(0,Ks.ltr,n)})):Ys(0,Ks.ltr,n)}(0,function(t,e){return e.match({domRange:function(t){return{ltr:v(t),rtl:B.none}},relative:function(e,n){return{ltr:Ut((function(){return Gs(t,e,n)})),rtl:Ut((function(){return B.some(Gs(t,n,e))}))}},exact:function(e,n,r,o){return{ltr:Ut((function(){return $s(t,e,n,r,o)})),rtl:Ut((function(){return B.some($s(t,r,o,e,n))}))}}})}(t,e))},Qs=function(t,e){return Js(t,e).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}})};Ks.ltr,Ks.rtl;var Zs,tl=function(t,e){var n=function(e){return t(e)?B.from(e.dom.nodeValue):B.none()};return{get:function(r){if(!t(r))throw new Error("Can only get "+e+" value of a "+e+" node");return n(r).getOr("")},getOption:n,set:function(n,r){if(!t(n))throw new Error("Can only set raw "+e+" value of a "+e+" node");n.dom.nodeValue=r}}}(Pt,"text"),el=function(t){return tl.getOption(t)},nl=["img","br"],rl=function(t){return el(t).filter((function(t){return 0!==t.trim().length||t.indexOf(" ")>-1})).isSome()||P(nl,Ht(t))},ol=function(t,e){var n=function(t){for(var r=ze(t),o=r.length-1;o>=0;o--){var i=r[o];if(e(i))return B.some(i);var a=n(i);if(a.isSome())return a}return B.none()};return n(t)},il=function(t,e){return function(t,e){var n=void 0===e?document:e.dom;return be(n)?[]:j(n.querySelectorAll(t),Bt.fromDom)}(e,t)},al=function(t,e,n,r){var o=function(t,e,n,r){var o=Ce(t).dom.createRange();return o.setStart(t.dom,e),o.setEnd(n.dom,r),o}(t,e,n,r),i=ye(t,n)&&e===r;return o.collapsed&&!i},ul=function(t){if(t.rangeCount>0){var e=t.getRangeAt(0),n=t.getRangeAt(t.rangeCount-1);return B.some(Fs(Bt.fromDom(e.startContainer),e.startOffset,Bt.fromDom(n.endContainer),n.endOffset))}return B.none()},cl=function(t){if(null===t.anchorNode||null===t.focusNode)return ul(t);var e=Bt.fromDom(t.anchorNode),n=Bt.fromDom(t.focusNode);return al(e,t.anchorOffset,n,t.focusOffset)?B.some(Fs(e,t.anchorOffset,n,t.focusOffset)):ul(t)},sl=function(t){return function(t){return B.from(t.getSelection())}(t).filter((function(t){return t.rangeCount>0})).bind(cl)},ll=function(t,e){return function(t){var e=t.getClientRects(),n=e.length>0?e[0]:t.getBoundingClientRect();return n.width>0||n.height>0?B.some(n).map(Xs):B.none()}(Qs(t,e))},fl=function(t,e){return function(t){var e=t.getBoundingClientRect();return e.width>0||e.height>0?B.some(e).map(Xs):B.none()}(Qs(t,e))},dl=function(t,e){return{element:t,offset:e}},ml=function(t,e){var n=ze(t);if(0===n.length)return dl(t,e);if(e"})),Mr()),$f=Xr("schema",(function(){return[io("preprocess")]})),Xf=mo("defaults",v({})),Kf=mo("overrides",v({})),Yf=_r([jf,Wf,qf,Gf,Xf,Kf]),Jf=_r([jf,Wf,qf,Xf,Kf]),Qf=_r([jf,Wf,qf,Gf,Xf,Kf]),Zf=_r([jf,$f,qf,Yr("unit"),Gf,Xf,Kf]),td=function(t){return t.fold(B.some,B.none,B.some,B.some)},ed=function(t){var e=function(t){return t.name};return t.fold(e,e,e,e)},nd=function(t,e){return function(n){var r=Wr("Converting part type",e,n);return t(r)}},rd=nd(Uf.required,Yf),od=nd(Uf.external,Jf),id=nd(Uf.optional,Qf),ad=nd(Uf.group,Zf),ud=v("entirety"),cd=Object.freeze({__proto__:null,required:rd,external:od,optional:id,group:ad,asNamedPart:td,name:ed,asCommon:function(t){return t.fold(b,b,b,b)},original:ud}),sd=function(t,e,n,r){return cr(e.defaults(t,n,r),n,{uid:t.partUids[e.name]},e.overrides(t,n,r))},ld=function(t,e){var n={};return W(e,(function(e){td(e).each((function(e){var r=fd(t,e.pname);n[e.name]=function(n){var o=Wr("Part: "+e.name+" in "+t,_r(e.schema),n);return O(O({},r),{config:n,validated:o})}}))})),n},fd=function(t,e){return{uiType:Ff(),owner:t,name:e}},dd=function(t,e,n){return{uiType:Ff(),owner:t,name:e,config:n,validated:{}}},md=function(t){return Q(t,(function(t){return t.fold(B.none,B.some,B.none,B.none).map((function(t){return no(t.name,t.schema.concat([Nu(ud())]))})).toArray()}))},gd=function(t){return j(t,ed)},hd=function(t,e,n){return function(t,e,n){var r={},o={};return W(n,(function(t){t.fold((function(t){r[t.pname]=Pf(!0,(function(e,n,r){return t.factory.sketch(sd(e,t,n,r))}))}),(function(t){var n=e.parts[t.name];o[t.name]=v(t.factory.sketch(sd(e,t,n[ud()]),n))}),(function(t){r[t.pname]=Pf(!1,(function(e,n,r){return t.factory.sketch(sd(e,t,n,r))}))}),(function(t){r[t.pname]=If(!0,(function(e,n,r){var o=e[t.name];return j(o,(function(n){return t.factory.sketch(cr(t.defaults(e,n,r),n,t.overrides(e,n)))}))}))}))})),{internals:v(r),externals:v(o)}}(0,e,n)},pd=function(t,e,n){return Vf(B.some(t),e,e.components,n)},vd=function(t,e,n){var r=e.partUids[n];return t.getSystem().getByUid(r).toOptional()},bd=function(t,e,n){return vd(t,e,n).getOrDie("Could not find part: "+n)},yd=function(t,e,n){var r={},o=e.partUids,i=t.getSystem();return W(n,(function(t){r[t]=v(i.getByUid(o[t]))})),r},xd=function(t,e){var n=t.getSystem();return mt(e.partUids,(function(t,e){return v(n.getByUid(t))}))},wd=function(t){return lt(t.partUids)},Cd=function(t,e,n){var r={},o=e.partUids,i=t.getSystem();return W(n,(function(t){r[t]=v(i.getByUid(o[t]).getOrDie())})),r},Sd=function(t,e){var n=gd(e);return Eo(j(n,(function(e){return{key:e,value:t+"-"+e}})))},kd=function(t){return $r("partUids","partUids",dr((function(e){return Sd(e.uid,t)})),Mr())},_d=Object.freeze({__proto__:null,generate:ld,generateOne:dd,schemas:md,names:gd,substitutes:hd,components:pd,defaultUids:Sd,defaultUidsSchema:kd,getAllParts:xd,getAllPartNames:wd,getPart:vd,getPartOrDie:bd,getParts:yd,getPartsOrDie:Cd}),Od=function(t,e,n,r,o){var i=function(t,e){return(t.length>0?[no("parts",t)]:[]).concat([Yr("uid"),mo("dom",{}),mo("components",[]),Nu("originalSpec"),mo("debug.sketcher",{})]).concat(e)}(r,o);return Wr(t+" [SpecSchema]",kr(i.concat(e)),n)},Ed=function(t,e,n,r,o){var i=zd(o),a=md(n),u=kd(n),c=Od(t,e,i,a,[u]),s=hd(0,c,n);return r(c,pd(t,c,s.internals()),i,s.externals())},zd=function(t){return function(t){return xt(t,"uid")}(t)?t:O(O({},t),{uid:da("uid")})},Td=kr([Yr("name"),Yr("factory"),Yr("configFields"),mo("apis",{}),mo("extraApis",{})]),Md=kr([Yr("name"),Yr("factory"),Yr("configFields"),Yr("partFields"),mo("apis",{}),mo("extraApis",{})]),Dd=function(t){var e=Wr("Sketcher for "+t.name,Td,t),n=mt(e.apis,xa),r=mt(e.extraApis,(function(t,e){return va(t,e)}));return O(O({name:e.name,configFields:e.configFields,sketch:function(t){return function(t,e,n,r){var o=zd(r);return n(Od(t,e,o,[],[]),o)}(e.name,e.configFields,e.factory,t)}},n),r)},Ad=function(t){var e=Wr("Sketcher for "+t.name,Md,t),n=ld(e.name,e.partFields),r=mt(e.apis,xa),o=mt(e.extraApis,(function(t,e){return va(t,e)}));return O(O({name:e.name,partFields:e.partFields,configFields:e.configFields,sketch:function(t){return Ed(e.name,e.configFields,e.partFields,e.factory,t)},parts:n},r),o)},Nd=function(t){return"input"===Ht(t)&&"radio"!==Ge(t,"type")||"textarea"===Ht(t)},Bd=Object.freeze({__proto__:null,getCurrent:function(t,e,n){return e.find(t)}}),Rd=[Yr("find")],Hd=Sc({fields:Rd,name:"composing",apis:Bd}),Ld=["input","button","textarea","select"],Vd=function(t,e,n){(e.disabled()?Wd:qd)(t,e)},Pd=function(t,e){return!0===e.useNative&&P(Ld,Ht(t.element))},Id=function(t){We(t.element,"disabled","disabled")},Fd=function(t){Ke(t.element,"disabled")},Ud=function(t){We(t.element,"aria-disabled","true")},jd=function(t){We(t.element,"aria-disabled","false")},Wd=function(t,e,n){e.disableClass.each((function(e){Va(t.element,e)})),(Pd(t,e)?Id:Ud)(t),e.onDisabled(t)},qd=function(t,e,n){e.disableClass.each((function(e){Ia(t.element,e)})),(Pd(t,e)?Fd:jd)(t),e.onEnabled(t)},Gd=function(t,e){return Pd(t,e)?function(t){return Xe(t.element,"disabled")}(t):function(t){return"true"===Ge(t.element,"aria-disabled")}(t)},$d=Object.freeze({__proto__:null,enable:qd,disable:Wd,isDisabled:Gd,onLoad:Vd,set:function(t,e,n,r){(r?Wd:qd)(t,e)}}),Xd=Object.freeze({__proto__:null,exhibit:function(t,e){return ka({classes:e.disabled()?e.disableClass.toArray():[]})},events:function(t,e){return Hi([Li(si(),(function(e,n){return Gd(e,t)})),vc(t,e,Vd)])}}),Kd=[yo("disabled",S),mo("useNative",!0),io("disableClass"),zu("onDisabled"),zu("onEnabled")],Yd=Sc({fields:Kd,name:"disabling",active:Xd,apis:$d}),Jd=function(t,e,n,r){var o=il(t.element,"."+e.highlightClass);W(o,(function(n){I(r,(function(t){return t.element===n}))||(Ia(n,e.highlightClass),t.getSystem().getByDom(n).each((function(n){e.onDehighlight(t,n),Mi(n,Ti())})))}))},Qd=function(t,e,n,r){Jd(t,e,0,[r]),Zd(t,e,n,r)||(Va(r.element,e.highlightClass),e.onHighlight(t,r),Mi(r,zi()))},Zd=function(t,e,n,r){return Fa(r.element,e.highlightClass)},tm=function(t,e,n,r){var o=il(t.element,"."+e.itemClass);return B.from(o[r]).fold((function(){return qn.error(new Error("No element found with index "+r))}),t.getSystem().getByDom)},em=function(t,e,n){return lu(t.element,"."+e.itemClass).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))},nm=function(t,e,n){var r=il(t.element,"."+e.itemClass);return(r.length>0?B.some(r[r.length-1]):B.none()).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))},rm=function(t,e,n,r){var o=il(t.element,"."+e.itemClass);return Y(o,(function(t){return Fa(t,e.highlightClass)})).bind((function(e){var n=qu(e,r,0,o.length-1);return t.getSystem().getByDom(o[n]).toOptional()}))},om=function(t,e,n){var r=il(t.element,"."+e.itemClass);return St(j(r,(function(e){return t.getSystem().getByDom(e).toOptional()})))},im=Object.freeze({__proto__:null,dehighlightAll:function(t,e,n){return Jd(t,e,0,[])},dehighlight:function(t,e,n,r){Zd(t,e,n,r)&&(Ia(r.element,e.highlightClass),e.onDehighlight(t,r),Mi(r,Ti()))},highlight:Qd,highlightFirst:function(t,e,n){em(t,e).each((function(r){Qd(t,e,n,r)}))},highlightLast:function(t,e,n){nm(t,e).each((function(r){Qd(t,e,n,r)}))},highlightAt:function(t,e,n,r){tm(t,e,n,r).fold((function(t){throw t}),(function(r){Qd(t,e,n,r)}))},highlightBy:function(t,e,n,r){var o=om(t,e);K(o,r).each((function(r){Qd(t,e,n,r)}))},isHighlighted:Zd,getHighlighted:function(t,e,n){return lu(t.element,"."+e.highlightClass).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))},getFirst:em,getLast:nm,getPrevious:function(t,e,n){return rm(t,e,0,-1)},getNext:function(t,e,n){return rm(t,e,0,1)},getCandidates:om}),am=[Yr("highlightClass"),Yr("itemClass"),zu("onHighlight"),zu("onDehighlight")],um=Sc({fields:am,name:"highlighting",apis:im}),cm=[8],sm=[9],lm=[13],fm=[27],dm=[32],mm=[37],gm=[38],hm=[39],pm=[40],vm=function(t,e,n){var r=tt(t.slice(0,e)),o=tt(t.slice(e+1));return K(r.concat(o),n)},bm=function(t,e,n){var r=tt(t.slice(0,e));return K(r,n)},ym=function(t,e,n){var r=t.slice(0,e),o=t.slice(e+1);return K(o.concat(r),n)},xm=function(t,e,n){var r=t.slice(e+1);return K(r,n)},wm=function(t){return function(e){var n=e.raw;return P(t,n.which)}},Cm=function(t){return function(e){return Z(t,(function(t){return t(e)}))}},Sm=function(t){return!0===t.raw.shiftKey},km=function(t){return!0===t.raw.ctrlKey},_m=w(Sm),Om=function(t,e){return{matches:t,classification:e}},Em=function(t,e,n){e.exists((function(t){return n.exists((function(e){return ye(e,t)}))}))||Di(t,ki(),{prevFocus:e,newFocus:n})},zm=function(){var t=function(t){return Nc(t.element)};return{get:t,set:function(e,n){var r=t(e);e.getSystem().triggerFocus(n,e.element);var o=t(e);Em(e,r,o)}}},Tm=function(){var t=function(t){return um.getHighlighted(t).map((function(t){return t.element}))};return{get:t,set:function(e,n){var r=t(e);e.getSystem().getByDom(n).fold(h,(function(t){um.highlight(e,t)}));var o=t(e);Em(e,r,o)}}};!function(t){t.OnFocusMode="onFocus",t.OnEnterOrSpaceMode="onEnterOrSpace",t.OnApiMode="onApi"}(Zs||(Zs={}));var Mm,Dm=function(t,e,n,r,o){var i=function(t,e,n,r,o){var i,a,u=n(t,e,r,o);return(i=u,a=e.event,K(i,(function(t){return t.matches(a)})).map((function(t){return t.classification}))).bind((function(n){return n(t,e,r,o)}))},a={schema:function(){return t.concat([mo("focusManager",zm()),go("focusInside","onFocus",Ir((function(t){return P(["onFocus","onEnterOrSpace","onApi"],t)?qn.value(t):qn.error("Invalid value for focusInside")}))),Au("handler",a),Au("state",e),Au("sendFocusIn",o)])},processKey:i,toEvents:function(t,e){var a=t.focusInside!==Zs.OnFocusMode?B.none():o(t).map((function(n){return Pi(ii(),(function(r,o){n(r,t,e),o.stop()}))})),u=[Pi(Xo(),(function(r,a){i(r,a,n,t,e).fold((function(){!function(n,r){var i=wm(dm.concat(lm))(r.event);t.focusInside===Zs.OnEnterOrSpaceMode&&i&&Ao(n,r)&&o(t).each((function(o){o(n,t,e),r.stop()}))}(r,a)}),(function(t){a.stop()}))})),Pi(Ko(),(function(n,o){i(n,o,r,t,e).each((function(t){o.stop()}))}))];return Hi(a.toArray().concat(u))}};return a},Am=function(t){var e=[io("onEscape"),io("onEnter"),mo("selector",'[data-alloy-tabstop="true"]:not(:disabled)'),mo("firstTabstop",0),mo("useTabstopAt",k),io("visibilitySelector")].concat([t]),n=function(t,e){var n=t.visibilitySelector.bind((function(t){return fu(e,t)})).getOr(e);return fn(n)>0},r=function(t,e,r){(function(t,e){var r=il(t.element,e.selector),o=G(r,(function(t){return n(e,t)}));return B.from(o[e.firstTabstop])})(t,e).each((function(n){e.focusManager.set(t,n)}))},o=function(t,e,r,o,i){return i(e,r,(function(t){return function(t,e){return n(t,e)&&t.useTabstopAt(e)}(o,t)})).fold((function(){return o.cyclic?B.some(!0):B.none()}),(function(e){return o.focusManager.set(t,e),B.some(!0)}))},i=function(t,e,n,r){var i=il(t.element,n.selector);return function(t,e){return e.focusManager.get(t).bind((function(t){return fu(t,e.selector)}))}(t,n).bind((function(e){return Y(i,x(ye,e)).bind((function(e){return o(t,i,e,n,r)}))}))},a=v([Om(Cm([Sm,wm(sm)]),(function(t,e,n){var r=n.cyclic?vm:bm;return i(t,0,n,r)})),Om(wm(sm),(function(t,e,n){var r=n.cyclic?ym:xm;return i(t,0,n,r)})),Om(wm(fm),(function(t,e,n){return n.onEscape.bind((function(n){return n(t,e)}))})),Om(Cm([_m,wm(lm)]),(function(t,e,n){return n.onEnter.bind((function(n){return n(t,e)}))}))]),u=v([]);return Dm(e,wa.init,a,u,(function(){return B.some(r)}))},Nm=Am(Xr("cyclic",S)),Bm=Am(Xr("cyclic",k)),Rm=function(t,e,n){return Nd(n)&&wm(dm)(e.event)?B.none():function(t,e,n){return Ni(t,n,si()),B.some(!0)}(t,0,n)},Hm=function(t,e){return B.some(!0)},Lm=[mo("execute",Rm),mo("useSpace",!1),mo("useEnter",!0),mo("useControlEnter",!1),mo("useDown",!1)],Vm=function(t,e,n){return n.execute(t,e,t.element)},Pm=Dm(Lm,wa.init,(function(t,e,n,r){var o=n.useSpace&&!Nd(t.element)?dm:[],i=n.useEnter?lm:[],a=n.useDown?pm:[],u=o.concat(i).concat(a);return[Om(wm(u),Vm)].concat(n.useControlEnter?[Om(Cm([km,wm(lm)]),Vm)]:[])}),(function(t,e,n,r){return n.useSpace&&!Nd(t.element)?[Om(wm(dm),Hm)]:[]}),(function(){return B.none()})),Im=function(){var t=ts();return Ca({readState:function(){return t.get().map((function(t){return{numRows:String(t.numRows),numColumns:String(t.numColumns)}})).getOr({numRows:"?",numColumns:"?"})},setGridSize:function(e,n){t.set({numRows:e,numColumns:n})},getNumRows:function(){return t.get().map((function(t){return t.numRows}))},getNumColumns:function(){return t.get().map((function(t){return t.numColumns}))}})},Fm=Object.freeze({__proto__:null,flatgrid:Im,init:function(t){return t.state(t)}}),Um=function(t){return function(e,n,r,o){var i=t(e.element);return Gm(i,e,n,r,o)}},jm=function(t,e){var n=Cs(t,e);return Um(n)},Wm=function(t,e){var n=Cs(e,t);return Um(n)},qm=function(t){return function(e,n,r,o){return Gm(t,e,n,r,o)}},Gm=function(t,e,n,r,o){return r.focusManager.get(e).bind((function(n){return t(e.element,n,r,o)})).map((function(t){return r.focusManager.set(e,t),!0}))},$m=qm,Xm=qm,Km=qm,Ym=function(t){return!function(t){return t.offsetWidth<=0&&t.offsetHeight<=0}(t.dom)},Jm=function(t,e,n){var r=il(t,n);return function(t,e){return Y(t,e).map((function(e){return{index:e,candidates:t}}))}(G(r,Ym),(function(t){return ye(t,e)}))},Qm=function(t,e){return Y(t,(function(t){return ye(e,t)}))},Zm=function(t,e,n,r){return r(Math.floor(e/n),e%n).bind((function(e){var r=e.row*n+e.column;return r>=0&&r1?B.some(t.slice(1)):B.none()}))},lookupMenu:u,lookupItem:c,otherMenus:function(t){var e=o.get();return et(lt(e),t)},getPrimary:function(){return r.get().bind(a)},getMenus:function(){return e.get()},clear:function(){t.set({}),e.set({}),n.set({}),r.clear()},isClear:function(){return r.get().isNone()},getTriggeringPath:function(t,e){var o=G(c(t).toArray(),(function(t){return a(t).isSome()}));return yt(n.get(),t).bind((function(t){var n=tt(o.concat(t));return function(t){for(var e=[],n=0;n0||e.timeout<0),a=function(){o(),Yh.hide(c)},u=eu(Mp.sketch({text:e.text,level:P(["success","error","warning","warn","info"],e.type)?e.type:void 0,progress:!0===e.progressBar,icon:B.from(e.icon),closeButton:!i,onAction:a,iconProvider:r.providers.icons,translationProvider:r.providers.translate})),c=eu(Yh.sketch(O({dom:{tag:"div",classes:["tox-notifications-container"]},lazySink:r.getSink,fireDismissalEventInstead:{}},r.header.isPositionedAtTop()?{}:{fireRepositionEventInstead:{}})));n.add(c),e.timeout>0&&pp.setTimeout((function(){a()}),e.timeout);var s=function(){var e=In(Bt.fromDom(t.getContentAreaContainer())),n=Un(),r=Gu(n.x,e.x,e.right),o=Gu(n.y,e.y,e.bottom),i=Math.max(e.right,n.right),a=Math.max(e.bottom,n.bottom);return B.some(Pn(r,o,i-r,a-o))};return{close:a,moveTo:function(t,e){Yh.showAt(c,nu(u),{anchor:{type:"makeshift",x:t,y:e}})},moveRel:function(t,e){var n=nu(u),o={maxHeightFunction:hs()};if("banner"!==e&&f(t)){var i=function(t){switch(t){case"bc-bc":return sp;case"tc-tc":return cp;case"tc-bc":return ic;case"bc-tc":default:return ac}}(e),a={type:"node",root:Fe(),node:B.some(Bt.fromDom(t)),overrides:o,layouts:{onRtl:function(){return[i]},onLtr:function(){return[i]}}};Yh.showWithinBounds(c,n,{anchor:a},s)}else{var l=O(O({},r.anchors.banner()),{overrides:o});Yh.showWithinBounds(c,n,{anchor:l},s)}},text:function(t){Mp.updateText(u,t)},settings:e,getEl:function(){return u.element.dom},progressBar:{value:function(t){Mp.updateProgress(u,t)}}}},close:function(t){t.close()},reposition:function(t){t.length>0&&W(t,(function(e,n){0===n?e.moveRel(null,"banner"):e.moveRel(t[n-1].getEl(),"bc-tc")}))},getArgs:function(t){return t.settings}}}var Ap,Np=function(t,e){var n=null,r=function(){u(n)||(clearTimeout(n),n=null)};return{cancel:r,throttle:function(){for(var o=[],i=0;i',t.getDoc());return En(n,Bt.fromDom(e.extractContents())),e.insertNode(n.dom),Oe(n).each((function(t){return t.dom.normalize()})),function(t){return ol(t,rl)}(n).map((function(e){t.selection.setCursorLocation(e.dom,function(t){return"img"===Ht(t)?1:el(t).fold((function(){return ze(t).length}),(function(t){return t.length}))}(e))})),n}))},Lp=function(t){return fu(t,"[data-mce-autocompleter]")},Vp=function(t){return t.toString().replace(/\u00A0/g," ").replace(/\uFEFF/g,"")},Pp=function(t){return""!==t&&-1!=="  \f\n\r\t\v".indexOf(t)},Ip=function(t,e){return t.substring(e.length)},Fp=function(t,e,n,r){if(void 0===r&&(r=0),!(o=e).collapsed||3!==o.startContainer.nodeType)return B.none();var o,i=t.getParent(e.startContainer,t.isBlock)||t.getRoot();return Rp(t,e.startContainer,e.startOffset,(function(t,e,r){return function(t,e,n){var r;for(r=e-1;r>=0;r--){var o=t.charAt(r);if(Pp(o))return B.none();if(o===n)break}return B.some(r)}(r,e,n).getOr(e)}),i).bind((function(t){var o=e.cloneRange();if(o.setStart(t.container,t.offset),o.setEnd(e.endContainer,e.endOffset),o.collapsed)return B.none();var i=Vp(o);return 0!==i.lastIndexOf(n)||Ip(i,n).length0?Gp(e[e.length-1]):qp(t,e.length)},$p=function(t,e){var n=t.childNodes;return n.length>0&&e0&&function(t){return 1===t.nodeType}(t)&&n.length===e?Gp(n[n.length-1]):qp(t,e)},Xp=function(t){return function(e){var n=$p(e.startContainer,e.startOffset);return!function(t,e){return Rp(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!Pp(e)})).isSome()}(t,n)}},Kp=function(t,e){var n=e(),r=t.selection.getRng();return function(t,e,n){return st(n.triggerChars,(function(n){return Up(t,e,n)}))}(t.dom,r,n).bind((function(n){return Yp(t,e,n)}))},Yp=function(t,e,n,r){void 0===r&&(r={});var o=e(),i=t.selection.getRng().startContainer.nodeValue,a=G(o.lookupByChar(n.triggerChar),(function(e){return n.text.length>=e.minChars&&e.matches.getOrThunk((function(){return Xp(t.dom)}))(n.range,i,n.text)}));if(0===a.length)return B.none();var u=Wp.all(j(a,(function(t){return t.fetch(n.text,t.maxResults,r).then((function(e){return{matchText:n.text,items:e,columns:t.columns,onAction:t.onAction,highlightOn:t.highlightOn}}))})));return B.some({lookupData:u,context:n})},Jp=_r([Zr("type"),co("text")]),Qp=_r([mo("type","autocompleteitem"),mo("active",!1),mo("disabled",!1),mo("meta",{}),Zr("value"),co("text"),co("icon")]),Zp=_r([Zr("type"),Zr("ch"),ho("minChars",1),mo("columns",1),ho("maxResults",10),so("matches"),eo("fetch"),eo("onAction"),xo("highlightOn",[],Nr)]),tv=[bo("disabled",!1),co("tooltip"),co("icon"),co("text"),yo("onSetup",(function(){return h}))],ev=_r([Zr("type"),eo("onAction")].concat(tv)),nv=function(t){return Ur("toolbarbutton",ev,t)},rv=[bo("active",!1)].concat(tv),ov=_r(rv.concat([Zr("type"),eo("onAction")])),iv=function(t){return Ur("ToggleButton",ov,t)},av=[yo("predicate",S),vo("scope","node",["node","editor"]),vo("position","selection",["node","selection","line"])],uv=tv.concat([mo("type","contextformbutton"),mo("primary",!1),eo("onAction"),Xr("original",b)]),cv=rv.concat([mo("type","contextformbutton"),mo("primary",!1),eo("onAction"),Xr("original",b)]),sv=tv.concat([mo("type","contextformbutton")]),lv=rv.concat([mo("type","contextformtogglebutton")]),fv=Gr("type",{contextformbutton:uv,contextformtogglebutton:cv}),dv=_r([mo("type","contextform"),yo("initValue",v("")),co("label"),oo("commands",fv),ao("launch",Gr("type",{contextformbutton:sv,contextformtogglebutton:lv}))].concat(av)),mv=_r([mo("type","contexttoolbar"),Zr("items")].concat(av)),gv=function(t){var e=t.ui.registry.getAll().popups,n=mt(e,(function(t){return(e=t,Ur("Autocompleter",Zp,e)).fold((function(t){throw new Error(qr(t))}),b);var e})),r=function(t){var e={};return W(t,(function(t){e[t]={}})),lt(e)}(pt(n,(function(t){return t.ch}))),o=bt(n);return{dataset:n,triggerChars:r,lookupByChar:function(t){return G(o,(function(e){return e.ch===t}))}}};!function(t){t[t.CLOSE_ON_EXECUTE=0]="CLOSE_ON_EXECUTE",t[t.BUBBLE_TO_SANDBOX=1]="BUBBLE_TO_SANDBOX"}(Ap||(Ap={}));var hv,pv=Ap,vv="tox-menu-nav__js",bv="tox-collection__item",yv="tox-swatch",xv={normal:vv,color:yv},wv="tox-collection__item--enabled",Cv="tox-collection__item-icon",Sv="tox-collection__item-label",kv="tox-collection__item-caret",_v="tox-collection__item--active",Ov="tox-collection__item-container",Ev="tox-collection__item-container--row",zv=function(t){return yt(xv,t).getOr(vv)},Tv=function(t){return"color"===t?"tox-swatches":"tox-menu"},Mv=function(t){return{backgroundMenu:"tox-background-menu",selectedMenu:"tox-selected-menu",selectedItem:"tox-collection__item--active",hasIcons:"tox-menu--has-icons",menu:Tv(t),tieredMenu:"tox-tiered-menu"}},Dv=function(t){var e=Mv(t);return{backgroundMenu:e.backgroundMenu,selectedMenu:e.selectedMenu,menu:e.menu,selectedItem:e.selectedItem,item:zv(t)}},Av=function(t,e,n){var r=Mv(n);return{tag:"div",classes:J([[r.menu,"tox-menu-"+e+"-column"],t?[r.hasIcons]:[]])}},Nv=[jh.parts.items({})],Bv=function(t,e,n){var r=Mv(n);return{dom:{tag:"div",classes:J([[r.tieredMenu]])},markers:Dv(n)}},Rv=function(t,e){return function(n){var r=U(n,e);return j(r,(function(e){return{dom:t,components:e}}))}},Hv=function(t,e){var n=[],r=[];return W(t,(function(t,o){e(t,o)?(r.length>0&&n.push(r),r=[],xt(t.dom,"innerHtml")&&r.push(t)):r.push(t)})),r.length>0&&n.push(r),j(n,(function(t){return{dom:{tag:"div",classes:["tox-collection__group"]},components:t}}))},Lv=function(t,e,n){return{dom:{tag:"div",classes:["tox-menu","tox-collection"].concat(1===t?["tox-collection--list"]:["tox-collection--grid"])},components:[jh.parts.items({preprocess:function(n){return"auto"!==t&&t>1?Rv({tag:"div",classes:["tox-collection__group"]},t)(n):Hv(n,(function(t,n){return"separator"===e[n].type}))}})]}},Vv=function(t){return I(t,(function(t){return"icon"in t&&void 0!==t.icon}))},Pv=function(t){return console.error(qr(t)),console.log(t),B.none()},Iv=function(t,e,n,r,o){var i,a=(i=n,{dom:{tag:"div",classes:["tox-collection","tox-collection--horizontal"]},components:[jh.parts.items({preprocess:function(t){return Hv(t,(function(t,e){return"separator"===i[e].type}))}})]});return{value:t,dom:a.dom,components:a.components,items:n}},Fv=function(t,e,n,r,o){var i;return"color"===o?{value:t,dom:(i=function(t){return{dom:{tag:"div",classes:["tox-menu","tox-swatches-menu"]},components:[{dom:{tag:"div",classes:["tox-swatches"]},components:[jh.parts.items({preprocess:"auto"!==t?Rv({tag:"div",classes:["tox-swatches__row"]},t):b})]}]}}(r)).dom,components:i.components,items:n}:"normal"===o&&"auto"===r?{value:t,dom:(i=Lv(r,n)).dom,components:i.components,items:n}:"normal"===o&&1===r?{value:t,dom:(i=Lv(1,n)).dom,components:i.components,items:n}:"normal"===o?{value:t,dom:(i=Lv(r,n)).dom,components:i.components,items:n}:"listpreview"===o&&"auto"!==r?{value:t,dom:(i=function(t){return{dom:{tag:"div",classes:["tox-menu","tox-collection","tox-collection--toolbar","tox-collection--toolbar-lg"]},components:[jh.parts.items({preprocess:Rv({tag:"div",classes:["tox-collection__group"]},t)})]}}(r)).dom,components:i.components,items:n}:{value:t,dom:Av(e,r,o),components:Nv,items:n}},Uv=[Zr("type"),Zr("src"),co("alt"),xo("classes",[],Nr)],jv=_r(Uv),Wv=[Zr("type"),Zr("text"),co("name"),xo("classes",["tox-collection__item-label"],Nr)],qv=_r(Wv),Gv=Cr((function(){return Pr("type",{cardimage:jv,cardtext:qv,cardcontainer:$v})})),$v=_r([Zr("type"),po("direction","horizontal"),po("align","left"),po("valign","middle"),oo("items",Gv)]),Xv=[bo("disabled",!1),co("text"),co("shortcut"),$r("value","value",lr((function(){return ia("menuitem-value")})),Mr()),mo("meta",{})],Kv=_r([Zr("type"),co("label"),oo("items",Gv),yo("onSetup",(function(){return h})),yo("onAction",h)].concat(Xv)),Yv=_r([Zr("type"),bo("active",!1),co("icon")].concat(Xv)),Jv=[Zr("type"),Zr("fancytype"),yo("onAction",h)],Qv=[mo("initData",{})].concat(Jv),Zv=[wo("initData",{},[bo("allowCustomColors",!0),lo("colors",Mr())])].concat(Jv),tb=Gr("fancytype",{inserttable:Qv,colorswatch:Zv}),eb=_r([Zr("type"),yo("onSetup",(function(){return h})),yo("onAction",h),co("icon")].concat(Xv)),nb=_r([Zr("type"),eo("getSubmenuItems"),yo("onSetup",(function(){return h})),co("icon")].concat(Xv)),rb=_r([Zr("type"),co("icon"),bo("active",!1),yo("onSetup",(function(){return h})),eo("onAction")].concat(Xv)),ob=function(t,e,n){var r=il(t.element,"."+n);if(r.length>0){var o=Y(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 B.some({numColumns:o,numRows:Math.ceil(r.length/o)})}return B.none()},ib=function(t,e){return wc([ch(t,e)])},ab=function(t){return ib(ia("unnamed-events"),t)},ub=ia("tooltip.exclusive"),cb=ia("tooltip.show"),sb=ia("tooltip.hide"),lb=function(t,e,n){t.getSystem().broadcastOn([ub],{})},fb=Object.freeze({__proto__:null,hideAllExclusive:lb,setComponents:function(t,e,n,r){n.getTooltip().each((function(t){t.getSystem().isConnected()&&uh.set(t,r)}))}}),db=Object.freeze({__proto__:null,events:function(t,e){var n=function(n){e.getTooltip().each((function(r){Gl(r),t.onHide(n,r),e.clearTooltip()})),e.clearTimer()};return Hi(J([[Pi(cb,(function(n){e.resetTimer((function(){!function(n){if(!e.isShowing()){lb(n);var r=t.lazySink(n).getOrDie(),o=n.getSystem().build({dom:t.tooltipDom,components:t.tooltipComponents,events:Hi("normal"===t.mode?[Pi(qo(),(function(t){Mi(n,cb)})),Pi(jo(),(function(t){Mi(n,sb)}))]:[]),behaviours:wc([uh.config({})])});e.setTooltip(o),jl(r,o),t.onShow(n,o),Vl.position(r,o,{anchor:t.anchor(n)})}}(n)}),t.delay)})),Pi(sb,(function(r){e.resetTimer((function(){n(r)}),t.delay)})),Pi(ci(),(function(t,e){var r=e;r.universal||P(r.channels,ub)&&n(t)})),Xi((function(t){n(t)}))],"normal"===t.mode?[Pi(Go(),(function(t){Mi(t,cb)})),Pi(ai(),(function(t){Mi(t,sb)})),Pi(qo(),(function(t){Mi(t,cb)})),Pi(jo(),(function(t){Mi(t,sb)}))]:[Pi(zi(),(function(t,e){Mi(t,cb)})),Pi(Ti(),(function(t){Mi(t,sb)}))]]))}}),mb=[Yr("lazySink"),Yr("tooltipDom"),mo("exclusive",!0),mo("tooltipComponents",[]),mo("delay",300),vo("mode","normal",["normal","follow-highlight"]),mo("anchor",(function(t){return{type:"hotspot",hotspot:t,layouts:{onLtr:v([ac,ic,ec,rc,nc,oc]),onRtl:v([ac,ic,ec,rc,nc,oc])}}})),zu("onHide"),zu("onShow")],gb=Sc({fields:mb,name:"tooltipping",active:db,state:Object.freeze({__proto__:null,init:function(){var t=ts(),e=ts(),n=function(){t.on(clearTimeout)},r=v("not-implemented");return Ca({getTooltip:e.get,isShowing:e.isSet,setTooltip:e.set,clearTooltip:e.clear,clearTimer:n,resetTimer:function(e,r){n(),t.set(setTimeout(e,r))},readState:r})}}),apis:fb}),hb=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),pb=tinymce.util.Tools.resolve("tinymce.EditorManager"),vb=function(t){return t.getParam("height",Math.max(t.getElement().offsetHeight,200))},bb=function(t){return t.getParam("width",hb.DOM.getStyle(t.getElement(),"width"))},yb=function(t){return B.from(t.getParam("min_width")).filter(m)},xb=function(t){return B.from(t.getParam("min_height")).filter(m)},wb=function(t){return B.from(t.getParam("max_width")).filter(m)},Cb=function(t){return B.from(t.getParam("max_height")).filter(m)},Sb=function(t){return!1!==t.getParam("menubar",!0,"boolean")},kb=function(t){var e=t.getParam("toolbar",!0),n=!0===e,r=o(e),i=a(e)&&e.length>0;return!Ob(t)&&(i||r||n)},_b=function(t){var e=F(9,(function(e){return t.getParam("toolbar"+(e+1),!1,"string")})),n=G(e,(function(t){return"string"==typeof t}));return n.length>0?B.some(n):B.none()},Ob=function(t){return _b(t).fold((function(){return t.getParam("toolbar",[],"string[]").length>0}),k)};!function(t){t.default="wrap",t.floating="floating",t.sliding="sliding",t.scrolling="scrolling"}(hv||(hv={}));var Eb,zb=function(t){return t.getParam("toolbar_mode","","string")};!function(t){t.auto="auto",t.top="top",t.bottom="bottom"}(Eb||(Eb={}));var Tb,Mb,Db=function(t){return t.getParam("toolbar_location",Eb.auto,"string")},Ab=function(t){return Db(t)===Eb.bottom},Nb=function(t){if(!t.inline)return B.none();var e=function(t){return t.getParam("fixed_toolbar_container","","string")}(t);if(e.length>0)return lu(Fe(),e);var n=function(t){return t.getParam("fixed_toolbar_container_target")}(t);return f(n)?B.some(Bt.fromDom(n)):B.none()},Bb=function(t){return t.inline&&Nb(t).isSome()},Rb=function(t){return Nb(t).getOrThunk((function(){return He(Re(Bt.fromDom(t.getElement())))}))},Hb=function(t){return t.inline&&!Sb(t)&&!kb(t)&&!Ob(t)},Lb=function(t){return(t.getParam("toolbar_sticky",!1,"boolean")||t.inline)&&!Bb(t)&&!Hb(t)},Vb=function(t){var e=t.getParam("menu");return e?mt(e,(function(t){return O(O({},t),{items:t.items})})):{}},Pb=function(t){return t.getParam("menubar")},Ib=function(t){return t.getParam("anchor_top","#top")},Fb=function(t){return t.getParam("anchor_bottom","#bottom")},Ub="silver.readonly",jb=_r([(Tb="readonly",Jr(Tb,Br))]),Wb=function(t,e){var n=t.outerContainer.element;e&&(t.mothership.broadcastOn([cf()],{target:n}),t.uiMothership.broadcastOn([cf()],{target:n})),t.mothership.broadcastOn([Ub],{readonly:e}),t.uiMothership.broadcastOn([Ub],{readonly:e})},qb=function(t,e){t.on("init",(function(){t.mode.isReadOnly()&&Wb(e,!0)})),t.on("SwitchMode",(function(){return Wb(e,t.mode.isReadOnly())})),function(t){return t.getParam("readonly",!1,"boolean")}(t)&&t.setMode("readonly")},Gb=function(){var t;return Ec.config({channels:(t={},t[Ub]={schema:jb,onReceive:function(t,e){Yd.set(t,e.readonly)}},t)})},$b=function(t){return Yd.config({disabled:t,disableClass:"tox-collection__item--state-disabled"})},Xb=function(t){return Yd.config({disabled:t})},Kb=function(t){return Yd.config({disabled:t,disableClass:"tox-tbtn--disabled"})},Yb=function(t){return Yd.config({disabled:t,disableClass:"tox-tbtn--disabled",useNative:!1})},Jb=function(t,e){var n=t.getApi(e);return function(t){t(n)}},Qb=function(t,e){return $i((function(n){Jb(t,n)((function(n){var r=t.onSetup(n);d(r)&&e.set(r)}))}))},Zb=function(t,e){return Xi((function(n){return Jb(t,n)(e.get())}))},ty=function(t,e){return Yi((function(n,r){Jb(t,n)(t.onAction),t.triggersSubmenu||e!==pv.CLOSE_ON_EXECUTE||(Mi(n,mi()),r.stop())}))},ey=((Mb={})[si()]=["disabling","alloy.base.behaviour","toggling","item-events"],Mb),ny=St,ry=function(t,e,n,r){var o=Co(h);return{type:"item",dom:e.dom,components:ny(e.optComponents),data:t.data,eventOrder:ey,hasSubmenu:t.triggersSubmenu,itemBehaviours:wc([ch("item-events",[ty(t,n),Qb(t,o),Zb(t,o)]),$b((function(){return t.disabled||r.isDisabled()})),Gb(),uh.config({})].concat(t.itemBehaviours))}},oy=function(t){return{value:t.value,meta:O({text:t.text.getOr("")},t.meta)}},iy=tinymce.util.Tools.resolve("tinymce.Env"),ay=function(t){var e=iy.mac?{alt:"⌥",ctrl:"⌃",shift:"⇧",meta:"⌘",access:"⌃⌥"}:{meta:"Ctrl",access:"Shift+Alt"},n=t.split("+"),r=j(n,(function(t){var n=t.toLowerCase().trim();return xt(e,n)?e[n]:t}));return iy.mac?r.join(""):r.join("+")},uy=function(t,e,n){return void 0===n&&(n=[Cv]),zp(t,{tag:"div",classes:n},e)},cy=function(t){return{dom:{tag:"div",classes:[Sv]},components:[Qa(yp.translate(t))]}},sy=function(t,e){return{dom:{tag:"div",classes:e,innerHtml:t}}},ly=function(t,e){return{dom:{tag:"div",classes:[Sv]},components:[{dom:{tag:t.tag,styles:t.styles},components:[Qa(yp.translate(e))]}]}},fy=function(t){return{dom:{tag:"div",classes:["tox-collection__item-accessory"],innerHtml:ay(t)}}},dy=function(t){return uy("checkmark",t,["tox-collection__item-checkmark"])},my=function(t,e,n){var r,o,i=t.ariaLabel,a=t.value,u=t.iconContent.map((function(t){return function(t,e,n){var r=e();return kp(t,r).or(n).getOrThunk(Cp(r))}(t,e.icons,n)}));return{dom:(r=u.getOr(""),o={tag:"div",attributes:i.map((function(t){return{title:e.translate(t)}})).getOr({}),classes:["tox-swatch"]},O(O({},o),"custom"===a?{tag:"button",classes:z(z([],o.classes,!0),["tox-swatches__picker-btn"],!1),innerHtml:r}:"remove"===a?{classes:z(z([],o.classes,!0),["tox-swatch--remove"],!1),innerHtml:r}:{attributes:O(O({},o.attributes),{"data-mce-color":a}),styles:{"background-color":a}})),optComponents:[]}},gy=function(t){var e=t.map((function(t){return{attributes:{title:yp.translate(t)}}})).getOr({});return O({tag:"div",classes:[vv,bv]},e)},hy=function(t,e,n,r){return void 0===r&&(r=B.none()),"color"===t.presets?my(t,e,r):function(t,e,n,r){var o={tag:"div",classes:[Cv]},i=n?t.iconContent.map((function(t){return zp(t,o,e.icons,r)})).orThunk((function(){return B.some({dom:o})})):B.none(),a=t.checkMark,u=B.from(t.meta).fold((function(){return cy}),(function(t){return xt(t,"style")?x(ly,t.style):cy})),c=t.htmlContent.fold((function(){return t.textContent.map(u)}),(function(t){return B.some(sy(t,[Sv]))}));return{dom:gy(t.ariaLabel),optComponents:[i,c,t.shortcutContent.map(fy),a,t.caret]}}(t,e,n,r)},py=function(t,e){return yt(t,"tooltipWorker").map((function(t){return[gb.config({lazySink:e.getSink,tooltipDom:{tag:"div",classes:["tox-tooltip-worker-container"]},tooltipComponents:[],anchor:function(t){return{type:"submenu",item:t,overrides:{maxHeightFunction:hs}}},mode:"follow-highlight",onShow:function(e,n){t((function(t){gb.setComponents(e,[Za({element:Bt.fromDom(t)})])}))}})]})).getOr([])},vy=function(t,e){var n=function(t){return hb.DOM.encode(t)}(yp.translate(t));if(e.length>0){var r=new RegExp(function(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(e),"gi");return n.replace(r,(function(t){return''+t+""}))}return n},by=function(t,e){return j(t,(function(t){switch(t.type){case"cardcontainer":return function(t,e){var n="vertical"===t.direction?"tox-collection__item-container--column":Ev,r="left"===t.align?"tox-collection__item-container--align-left":"tox-collection__item-container--align-right";return{dom:{tag:"div",classes:[Ov,n,r,function(){switch(t.valign){case"top":return"tox-collection__item-container--valign-top";case"middle":return"tox-collection__item-container--valign-middle";case"bottom":return"tox-collection__item-container--valign-bottom"}}()]},components:e}}(t,by(t.items,e));case"cardimage":return function(t,e,n){return{dom:{tag:"img",classes:e,attributes:{src:t,alt:n.getOr("")}}}}(t.src,t.classes,t.alt);case"cardtext":var n=t.name.exists((function(t){return P(e.cardText.highlightOn,t)}))?B.from(e.cardText.matchText).getOr(""):"";return sy(vy(t.text,n),t.classes)}}))},yy=ld(Hh(),Lh()),xy=function(t){return{value:t}},wy=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,Cy=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,Sy=function(t){return wy.test(t)||Cy.test(t)},ky=function(t){return function(t,e){return zt(t,e)?function(t,e){return t.substring(e)}(t,e.length):t}(t,"#").toUpperCase()},_y=function(t){var e=function(t){return{value:t.value.replace(wy,(function(t,e,n,r){return e+e+n+n+r+r}))}}(t),n=Cy.exec(e.value);return null===n?["FFFFFF","FF","FF","FF"]:n},Oy=function(t){var e=t.toString(16);return(1===e.length?"0"+e:e).toUpperCase()},Ey=function(t){var e=Oy(t.red)+Oy(t.green)+Oy(t.blue);return xy(e)},zy=Math.min,Ty=Math.max,My=Math.round,Dy=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)/,Ay=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d?(?:\.\d+)?)\)/,Ny=function(t,e,n,r){return{red:t,green:e,blue:n,alpha:r}},By=function(t){var e=parseInt(t,10);return e.toString()===t&&e>=0&&e<=255},Ry=function(t){var e,n,r,o=(t.hue||0)%360,i=t.saturation/100,a=t.value/100;if(i=Ty(0,zy(i,1)),a=Ty(0,zy(a,1)),0===i)return e=n=r=My(255*a),Ny(e,n,r,1);var u=o/60,c=a*i,s=c*(1-Math.abs(u%2-1)),l=a-c;switch(Math.floor(u)){case 0:e=c,n=s,r=0;break;case 1:e=s,n=c,r=0;break;case 2:e=0,n=c,r=s;break;case 3:e=0,n=s,r=c;break;case 4:e=s,n=0,r=c;break;case 5:e=c,n=0,r=s;break;default:e=n=r=0}return e=My(255*(e+l)),n=My(255*(n+l)),r=My(255*(r+l)),Ny(e,n,r,1)},Hy=function(t){var e=_y(t),n=parseInt(e[1],16),r=parseInt(e[2],16),o=parseInt(e[3],16);return Ny(n,r,o,1)},Ly=function(t,e,n,r){var o=parseInt(t,10),i=parseInt(e,10),a=parseInt(n,10),u=parseFloat(r);return Ny(o,i,a,u)},Vy=function(t){if("transparent"===t)return B.some(Ny(0,0,0,0));var e=Dy.exec(t);if(null!==e)return B.some(Ly(e[1],e[2],e[3],"1"));var n=Ay.exec(t);return null!==n?B.some(Ly(n[1],n[2],n[3],n[4])):B.none()},Py=function(t){return"rgba("+t.red+","+t.green+","+t.blue+","+t.alpha+")"},Iy=Ny(255,0,0,1),Fy=function(t,e){return t.fire("ResizeContent",e)},Uy=function(t,e,n){return{hue:t,saturation:e,value:n}},jy=function(t){var e,n=0,r=0,o=t.red/255,i=t.green/255,a=t.blue/255,u=Math.min(o,Math.min(i,a)),c=Math.max(o,Math.max(i,a));return u===c?Uy(0,0,100*(r=u)):(n=60*((n=o===u?3:a===u?1:5)-(o===u?i-a:a===u?o-i:a-o)/(c-u)),e=(c-u)/c,r=c,Uy(Math.round(n),Math.round(100*e),Math.round(100*r)))},Wy=function(t){return Ey(Ry(t))},qy=function(t){return(e=t,Sy(e)?B.some({value:ky(e)}):B.none()).orThunk((function(){return Vy(t).map(Ey)})).getOrThunk((function(){var e=document.createElement("canvas");e.height=1,e.width=1;var n=e.getContext("2d");n.clearRect(0,0,e.width,e.height),n.fillStyle="#FFFFFF",n.fillStyle=t,n.fillRect(0,0,1,1);var r=n.getImageData(0,0,1,1).data,o=r[0],i=r[1],a=r[2],u=r[3];return Ey(Ny(o,i,a,u))}));var e},Gy=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),$y="tinymce-custom-colors";var Xy,Ky="choiceitem",Yy=[{type:Ky,text:"Light Green",value:"#BFEDD2"},{type:Ky,text:"Light Yellow",value:"#FBEEB8"},{type:Ky,text:"Light Red",value:"#F8CAC6"},{type:Ky,text:"Light Purple",value:"#ECCAFA"},{type:Ky,text:"Light Blue",value:"#C2E0F4"},{type:Ky,text:"Green",value:"#2DC26B"},{type:Ky,text:"Yellow",value:"#F1C40F"},{type:Ky,text:"Red",value:"#E03E2D"},{type:Ky,text:"Purple",value:"#B96AD9"},{type:Ky,text:"Blue",value:"#3598DB"},{type:Ky,text:"Dark Turquoise",value:"#169179"},{type:Ky,text:"Orange",value:"#E67E23"},{type:Ky,text:"Dark Red",value:"#BA372A"},{type:Ky,text:"Dark Purple",value:"#843FA1"},{type:Ky,text:"Dark Blue",value:"#236FA1"},{type:Ky,text:"Light Gray",value:"#ECF0F1"},{type:Ky,text:"Medium Gray",value:"#CED4D9"},{type:Ky,text:"Gray",value:"#95A5A6"},{type:Ky,text:"Dark Gray",value:"#7E8C8D"},{type:Ky,text:"Navy Blue",value:"#34495E"},{type:Ky,text:"Black",value:"#000000"},{type:Ky,text:"White",value:"#ffffff"}],Jy=function(t){void 0===t&&(t=10);var e,n=Gy.getItem($y),r=o(n)?JSON.parse(n):[],i=t-(e=r).length<0?e.slice(0,t):e,a=function(t){i.splice(t,1)};return{add:function(e){(function(t,e){var n=V(t,e);return-1===n?B.none():B.some(n)})(i,e).each(a),i.unshift(e),i.length>t&&i.pop(),Gy.setItem($y,JSON.stringify(i))},state:function(){return i.slice(0)}}}(10),Qy=function(t){return!1!==t.getParam("custom_colors")},Zy=function(t){var e=function(t){return t.getParam("color_map")}(t);return void 0!==e?function(t){for(var e=[],n=0;n0?s(n,m,i,g):m.text.length-n.matchLength>=10?u():a()}}))}))}))},f={onKeypress:Np((function(t){27!==t.which&&l()}),50),cancelIfNecessary:u,isMenuOpen:function(){return Yh.isOpen(o)},isActive:i,isProcessingAction:r.get,getView:function(){return Yh.getContent(o)}};!1===t.hasPlugin("rtc")&&jp(f,t)},Nx=function(t,e,n){return fu(t,e,n).isSome()},Bx=function(t,e){var n=null;return{cancel:function(){null!==n&&(clearTimeout(n),n=null)},schedule:function(){for(var r=[],o=0;o5||r>5})(t,n)&&e.clear()}))})),B.none()}},{key:Po(),value:function(o){r.cancel();return e.get().filter((function(t){return ye(t.target,o.target)})).map((function(e){return n.get()?(o.prevent(),!1):t.triggerEvent(fi(),o)}))}}]);return{fireIfReady:function(t,e){return yt(o,e).bind((function(e){return e(t)}))}}},Lx=function(){return pe().browser.isFirefox()},Vx=function(t,e){var n=O({stopBackspace:!0},e),r=Hx(n),o=j(["touchstart","touchmove","touchend","touchcancel","gesturestart","mousedown","mouseup","mouseover","mousemove","mouseout","click"].concat(["selectstart","input","contextmenu","change","transitionend","transitioncancel","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","keyup"]),(function(e){return ns(t,e,(function(t){r.fireIfReady(t,e).each((function(e){e&&t.kill()})),n.triggerEvent(e,t)&&t.kill()}))})),i=ts(),a=ns(t,"paste",(function(t){r.fireIfReady(t,"paste").each((function(e){e&&t.kill()})),n.triggerEvent("paste",t)&&t.kill(),i.set(setTimeout((function(){n.triggerEvent(ui(),t)}),0))})),u=ns(t,"keydown",(function(t){n.triggerEvent("keydown",t)?t.kill():n.stopBackspace&&function(t){return t.raw.which===cm[0]&&!P(["input","textarea"],Ht(t.target))&&!Nx(t.target,'[contenteditable="true"]')}(t)&&t.prevent()})),c=function(t,e){return Lx()?rs(t,"focus",e):ns(t,"focusin",e)}(t,(function(t){n.triggerEvent("focusin",t)&&t.kill()})),s=ts(),l=function(t,e){return Lx()?rs(t,"blur",e):ns(t,"focusout",e)}(t,(function(t){n.triggerEvent("focusout",t)&&t.kill(),s.set(setTimeout((function(){n.triggerEvent(ai(),t)}),0))}));return{unbind:function(){W(o,(function(t){t.unbind()})),u.unbind(),c.unbind(),l.unbind(),a.unbind(),i.on(clearTimeout),s.on(clearTimeout)}}},Px=function(t,e){var n=yt(t,"target").getOr(e);return Co(n)},Ix=So([{stopped:[]},{resume:["element"]},{complete:[]}]),Fx=function(t,e,n,r,o,i){var a=t(e,r),u=function(t,e){var n=Co(!1),r=Co(!1);return{stop:function(){n.set(!0)},cut:function(){r.set(!0)},isStopped:n.get,isCut:r.get,event:t,setSource:e.set,getSource:e.get}}(n,o);return a.fold((function(){return i.logEventNoHandlers(e,r),Ix.complete()}),(function(t){var n=t.descHandler;return _a(n)(u),u.isStopped()?(i.logEventStopped(e,t.element,n.purpose),Ix.stopped()):u.isCut()?(i.logEventCut(e,t.element,n.purpose),Ix.complete()):Oe(t.element).fold((function(){return i.logNoParent(e,t.element,n.purpose),Ix.complete()}),(function(r){return i.logEventResponse(e,t.element,n.purpose),Ix.resume(r)}))}))},Ux=function(t,e,n,r,o,i){return Fx(t,e,n,r,o,i).fold(k,(function(r){return Ux(t,e,n,r,o,i)}),S)},jx=function(t,e,n){var r=function(t){var e=Co(!1);return{stop:function(){e.set(!0)},cut:h,isStopped:e.get,isCut:S,event:t,setSource:C("Cannot set source of a broadcasted event"),getSource:C("Cannot get source of a broadcasted event")}}(e);return W(t,(function(t){var e=t.descHandler;_a(e)(r)})),r.isStopped()},Wx=function(t,e,n,r,o){var i=Px(n,r);return Ux(t,e,n,r,i,o)},qx=function(){var t={};return{registerId:function(e,n,r){dt(r,(function(r,o){var i=void 0!==t[o]?t[o]:{};i[n]=function(t,e){return n=x.apply(void 0,[t.handler].concat(e)),r=t.purpose,{cHandler:n,purpose:r};var n,r}(r,e),t[o]=i}))},unregisterId:function(e){dt(t,(function(t,n){xt(t,e)&&delete t[e]}))},filterByType:function(e){return yt(t,e).map((function(t){return pt(t,(function(t,e){return function(t,e){return{id:t,descHandler:e}}(e,t)}))})).getOr([])},find:function(e,n,r){return yt(t,n).bind((function(t){return Do(r,(function(e){return function(t,e){return fa(e).bind((function(e){return yt(t,e)})).map((function(t){return function(t,e){return{element:t,descHandler:e}}(e,t)}))}(t,e)}),e)}))}}},Gx=function(){var t=qx(),e={},n=function(t){var e=t.element;return fa(e).getOrThunk((function(){return function(t,e){var n=ia(ca+t);return la(e,n),n}("uid-",t.element)}))},r=function(n){fa(n.element).each((function(n){delete e[n],t.unregisterId(n)}))};return{find:function(e,n,r){return t.find(e,n,r)},filter:function(e){return t.filterByType(e)},register:function(o){var i=n(o);wt(e,i)&&function(t,n){var o=e[n];if(o!==t)throw new Error('The tagId "'+n+'" is already used by: '+ea(o.element)+"\nCannot use it for: "+ea(t.element)+"\nThe conflicting element is"+(Ie(o.element)?" ":" not ")+"already in the DOM");r(t)}(o,i);var a=[o];t.registerId(a,i,o.events),e[i]=o},unregister:r,getById:function(t){return yt(e,t)}}},$x=Dd({name:"Container",factory:function(t){var e=t.dom,n=e.attributes,r=E(e,["attributes"]);return{uid:t.uid,dom:O({tag:"div",attributes:O({role:"presentation"},n)},r),components:t.components,behaviours:Tf(t.containerBehaviours),events:t.events,domModification:t.domModification,eventOrder:t.eventOrder}},configFields:[mo("components",[]),zf("containerBehaviours",[]),mo("events",{}),mo("domModification",{}),mo("eventOrder",{})]}),Xx=function(t){var e=function(e){return Oe(t.element).fold(k,(function(t){return ye(e,t)}))},n=Gx(),r=function(t,r){return n.find(e,t,r)},o=Vx(t.element,{triggerEvent:function(t,e){return yu(t,e.target,(function(n){return function(t,e,n,r){return Wx(t,e,n,n.target,r)}(r,t,e,n)}))}}),i={debugInfo:v("real"),triggerEvent:function(t,e,n){yu(t,e,(function(o){return Wx(r,t,n,e,o)}))},triggerFocus:function(t,e){fa(t).fold((function(){Mc(t)}),(function(n){yu(ii(),t,(function(n){return function(t,e,n,r,o){var i=Px(n,r);Fx(t,e,n,r,i,o)}(r,ii(),{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 g(t)},getByDom:function(t){return p(t)},build:eu,addToGui:function(t){c(t)},removeFromGui:function(t){s(t)},addToWorld:function(t){a(t)},removeFromWorld:function(t){u(t)},broadcast:function(t){f(t)},broadcastOn:function(t,e){d(t,e)},broadcastEvent:function(t,e){m(t,e)},isConnected:k},a=function(t){t.connect(i),Pt(t.element)||(n.register(t),W(t.components(),a),i.triggerEvent(hi(),t.element,{target:t.element}))},u=function(t){Pt(t.element)||(W(t.components(),u),n.unregister(t)),t.disconnect()},c=function(e){jl(t,e)},s=function(t){Gl(t)},l=function(t){var e=n.filter(ci());W(e,(function(e){var n=e.descHandler;_a(n)(t)}))},f=function(t){l({universal:!0,data:t})},d=function(t,e){l({universal:!1,channels:t,data:e})},m=function(t,e){var r=n.filter(t);return jx(r,e)},g=function(t){return n.getById(t).fold((function(){return qn.error(new Error('Could not find component with uid: "'+t+'" in system.'))}),qn.value)},p=function(t){var e=fa(t).getOr("not found");return g(e)};return a(t),{root:t,element:t.element,destroy:function(){o.unbind(),Mn(t.element)},add:c,remove:s,getByUid:g,getByDom:p,addToWorld:a,removeFromWorld:u,broadcast:f,broadcastOn:d,broadcastEvent:m}},Kx=v([mo("prefix","form-field"),zf("fieldBehaviours",[Hd,Ef])]),Yx=v([id({schema:[Yr("dom")],name:"label"}),id({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:t.text}}}},schema:[Yr("text")],name:"aria-descriptor"}),rd({factory:{sketch:function(t){var e=_o(t,["factory"]);return t.factory.sketch(e)}},schema:[Yr("factory")],name:"field"})]),Jx=Ad({name:"FormField",configFields:Kx(),partFields:Yx(),factory:function(t,e,n,r){var o=Mf(t.fieldBehaviours,[Hd.config({find:function(e){return vd(e,t,"field")}}),Ef.config({store:{mode:"manual",getValue:function(t){return Hd.getCurrent(t).bind(Ef.getValue)},setValue:function(t,e){Hd.getCurrent(t).each((function(t){Ef.setValue(t,e)}))}}})]),i=Hi([$i((function(e,n){var r=yd(e,t,["label","field","aria-descriptor"]);r.field().each((function(e){var n=ia(t.prefix);r.label().each((function(t){We(t.element,"for",n),We(e.element,"id",n)})),r["aria-descriptor"]().each((function(n){var r=ia(t.prefix);We(n.element,"id",r),We(e.element,"aria-describedby",r)}))}))}))]),a={getField:function(e){return vd(e,t,"field")},getLabel:function(e){return vd(e,t,"label")}};return{uid:t.uid,dom:t.dom,components:e,behaviours:o,events:i,apis:a}},apis:{getField:function(t,e){return t.getField(e)},getLabel:function(t,e){return t.getLabel(e)}}}),Qx=Object.freeze({__proto__:null,exhibit:function(t,e){return ka({attributes:Eo([{key:e.tabAttr,value:"true"}])})}}),Zx=[mo("tabAttr","data-alloy-tabstop")],tw=Sc({fields:Zx,name:"tabstopping",active:Qx}),ew=tinymce.util.Tools.resolve("tinymce.html.Entities"),nw=function(t,e,n,r){var o=rw(t,e,n,r);return Jx.sketch(o)},rw=function(t,e,n,r){return{dom:ow(n),components:t.toArray().concat([e]),fieldBehaviours:wc(r)}},ow=function(t){return{tag:"div",classes:["tox-form__group"].concat(t)}},iw=function(t,e){return Jx.parts.label({dom:{tag:"label",classes:["tox-label"],innerHtml:e.translate(t)}})},aw=ia("form-component-change"),uw=ia("form-close"),cw=ia("form-cancel"),sw=ia("form-action"),lw=ia("form-submit"),fw=ia("form-block"),dw=ia("form-unblock"),mw=ia("form-tabchange"),gw=ia("form-resize"),hw=function(t,e){var n,r,o,i=t.label.map((function(t){return iw(t,e)})),a=function(t){return function(e,n){fu(n.event.target,"[data-collection-item-value]").each((function(r){t(e,n,r,Ge(r,"data-collection-item-value"))}))}},u=a((function(n,r,o,i){r.stop(),e.isDisabled()||Di(n,sw,{name:t.name,value:i})})),c=[Pi(qo(),a((function(t,e,n){Mc(n)}))),Pi(Qo(),u),Pi(fi(),u),Pi(Go(),a((function(t,e,n){lu(t.element,"."+_v).each((function(t){Ia(t,_v)})),Va(n,_v)}))),Pi($o(),a((function(t){lu(t.element,"."+_v).each((function(t){Ia(t,_v)}))}))),Yi(a((function(e,n,r,o){Di(e,sw,{name:t.name,value:o})})))],s=function(t,e){return j(il(t.element,".tox-collection__item"),e)},l=Jx.parts.field({dom:{tag:"div",classes:["tox-collection"].concat(1!==t.columns?["tox-collection--grid"]:["tox-collection--list"])},components:[],factory:{sketch:b},behaviours:wc([Yd.config({disabled:e.isDisabled,onDisabled:function(t){s(t,(function(t){Va(t,"tox-collection__item--state-disabled"),We(t,"aria-disabled",!0)}))},onEnabled:function(t){s(t,(function(t){Ia(t,"tox-collection__item--state-disabled"),Ke(t,"aria-disabled")}))}}),Gb(),uh.config({}),Ef.config({store:{mode:"memory",initialValue:[]},onSetValue:function(n,r){!function(n,r){var o=j(r,(function(n){var r=yp.translate(n.text),o=1===t.columns?'
'+r+"
":"",i='
'+n.icon+"
",a={_:" "," - ":" ","-":" "},u=r.replace(/\_| \- |\-/g,(function(t){return a[t]}));return'
'+i+o+"
"})),i="auto"!==t.columns&&t.columns>1?U(o,t.columns):[o],a=j(i,(function(t){return'
'+t.join("")+"
"}));Qi(n.element,a.join(""))}(n,r),"auto"===t.columns&&ob(n,5,"tox-collection__item").each((function(t){var e=t.numRows,r=t.numColumns;nh.setGridSize(n,e,r)})),Mi(n,gw)}}),tw.config({}),nh.config((r=t.columns,o="normal",1===r?{mode:"menu",moveOnTab:!1,selector:".tox-collection__item"}:"auto"===r?{mode:"flatgrid",selector:".tox-collection__item",initSize:{numColumns:1,numRows:1}}:{mode:"matrix",selectors:{row:"color"===o?".tox-swatches__row":".tox-collection__group",cell:"color"===o?".tox-swatch":"."+bv}})),ch("collection-events",c)]),eventOrder:(n={},n[si()]=["disabling","alloy.base.behaviour","collection-events"],n)});return nw(i,l,["tox-form__group--collection"],[])},pw=v([io("data"),mo("inputAttributes",{}),mo("inputStyles",{}),mo("tag","input"),mo("inputClasses",[]),zu("onSetValue"),mo("styles",{}),mo("eventOrder",{}),zf("inputBehaviours",[Ef,mh]),mo("selectOnFocus",!0)]),vw=function(t){return wc([mh.config({onFocus:t.selectOnFocus?function(t){var e=t.element,n=Wa(e);e.dom.setSelectionRange(0,n.length)}:h})])},bw=function(t){return O(O({},vw(t)),Mf(t.inputBehaviours,[Ef.config({store:O(O({mode:"manual"},t.data.map((function(t){return{initialValue:t}})).getOr({})),{getValue:function(t){return Wa(t.element)},setValue:function(t,e){Wa(t.element)!==e&&qa(t.element,e)}}),onSetValue:t.onSetValue})]))},yw=function(t){return{tag:t.tag,attributes:O({type:"text"},t.inputAttributes),styles:t.inputStyles,classes:t.inputClasses}},xw=Dd({name:"Input",configFields:pw(),factory:function(t,e){return{uid:t.uid,dom:yw(t),components:[],behaviours:bw(t),eventOrder:t.eventOrder}}}),ww={},Cw={exports:ww};!function(t,e,r,o){!function(n,o){"object"==typeof e&&void 0!==r?r.exports=o():"function"==typeof t&&t.amd?t(o):(n="undefined"!=typeof globalThis?globalThis:n||self).EphoxContactWrapper=o()}(this,(function(){var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{},e={exports:{}};!function(e){!function(t){var n=setTimeout;function r(){}function o(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 i(t,e){for(;3===t._state;)t=t._value;0!==t._state?(t._handled=!0,o._immediateFn((function(){var n=1===t._state?e.onFulfilled:e.onRejected;if(null!==n){var r;try{r=n(t._value)}catch(t){return void u(e.promise,t)}a(e.promise,r)}else(1===t._state?a:u)(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 o)return t._state=3,t._value=e,void c(t);if("function"==typeof n)return void l((r=n,i=e,function(){r.apply(i,arguments)}),t)}t._state=1,t._value=e,c(t)}catch(e){u(t,e)}var r,i}function u(t,e){t._state=2,t._value=e,c(t)}function c(t){2===t._state&&0===t._deferreds.length&&o._immediateFn((function(){t._handled||o._unhandledRejectionFn(t._value)}));for(var e=0,n=t._deferreds.length;en?n:t===e?e-1:Math.max(e,t-r)},rS=function(t,e,n,r){return t>n?t:td)return h;var p=function(t,e,n){return Math.min(n,Math.max(t,e))-e}(o,f,d),v=oS(p/m*r+e,g,h);return a&&v>=e&&v<=n?function(t,e,n,r,o){return o.fold((function(){var o=t-e,i=Math.round(o/r)*r;return oS(e+i,e-1,n+1)}),(function(e){var o=(t-e)%r,i=Math.round(o/r),a=Math.floor((t-e)/r),u=Math.floor((n-e)/r),c=e+Math.min(u,a+i)*r;return Math.max(e,c)}))}(v,e,n,i,u):c?Math.round(v):v},aS=function(t){var e=t.min,n=t.max,r=t.range,o=t.value,i=t.hasMinEdge,a=t.hasMaxEdge,u=t.maxBound,c=t.maxOffset,s=t.centerMinEdge,l=t.centerMaxEdge;return on?a?u:l:(o-e)/r*c},uS="top",cS="right",sS="bottom",lS="left",fS=function(t){return t.element.dom.getBoundingClientRect()},dS=function(t,e){return t[e]},mS=function(t){var e=fS(t);return dS(e,lS)},gS=function(t){var e=fS(t);return dS(e,cS)},hS=function(t){var e=fS(t);return dS(e,uS)},pS=function(t){var e=fS(t);return dS(e,sS)},vS=function(t){var e=fS(t);return dS(e,"width")},bS=function(t){var e=fS(t);return dS(e,"height")},yS=function(t,e,n){return(t+e)/2-n},xS=function(t,e){var n=fS(t),r=fS(e),o=dS(n,lS),i=dS(n,cS),a=dS(r,lS);return yS(o,i,a)},wS=function(t,e){var n=fS(t),r=fS(e),o=dS(n,uS),i=dS(n,sS),a=dS(r,uS);return yS(o,i,a)},CS=function(t,e){Di(t,EC(),{value:e})},SS=function(t){return{x:t}},kS=function(t,e,n){var r={min:TC(e),max:NC(e),range:VC(e),value:n,step:UC(e),snap:jC(e),snapStart:WC(e),rounded:qC(e),hasMinEdge:$C(e),hasMaxEdge:XC(e),minBound:mS(t),maxBound:gS(t),screenRange:vS(t)};return iS(r)},_S=function(t){return function(e,n){return function(t,e,n){var r=(t>0?rS:nS)(JC(n).x,TC(n),NC(n),UC(n));return CS(e,SS(r)),B.some(r)}(t,e,n).map(k)}},OS=function(t,e,n,r,o,i){var a=function(t,e,n,r,o){var i=vS(t),a=r.bind((function(e){return B.some(xS(e,t))})).getOr(0),u=o.bind((function(e){return B.some(xS(e,t))})).getOr(i),c={min:TC(e),max:NC(e),range:VC(e),value:n,hasMinEdge:$C(e),hasMaxEdge:XC(e),minBound:mS(t),minOffset:0,maxBound:gS(t),maxOffset:i,centerMinEdge:a,centerMaxEdge:u};return aS(c)}(e,i,n,r,o);return mS(e)-mS(t)+a},ES=_S(-1),zS=_S(1),TS=B.none,MS=B.none,DS={"top-left":B.none(),top:B.none(),"top-right":B.none(),right:B.some((function(t,e){eS(t,QC(RC(e)))})),"bottom-right":B.none(),bottom:B.none(),"bottom-left":B.none(),left:B.some((function(t,e){eS(t,QC(DC(e)))}))},AS=Object.freeze({__proto__:null,setValueFrom:function(t,e,n){var r=kS(t,e,n),o=SS(r);return CS(t,o),r},setToMin:function(t,e){var n=TC(e);CS(t,SS(n))},setToMax:function(t,e){var n=NC(e);CS(t,SS(n))},findValueOfOffset:kS,getValueFromEvent:function(t){return zC(t).map((function(t){return t.left}))},findPositionOfValue:OS,setPositionFromValue:function(t,e,n,r){var o=JC(n),i=OS(t,r.getSpectrum(t),o.x,r.getLeftEdge(t),r.getRightEdge(t),n),a=yn(e.element)/2;Qe(e.element,"left",i-a+"px")},onLeft:ES,onRight:zS,onUp:TS,onDown:MS,edgeActions:DS}),NS=function(t,e){Di(t,EC(),{value:e})},BS=function(t){return{y:t}},RS=function(t,e,n){var r={min:MC(e),max:BC(e),range:PC(e),value:n,step:UC(e),snap:jC(e),snapStart:WC(e),rounded:qC(e),hasMinEdge:KC(e),hasMaxEdge:YC(e),minBound:hS(t),maxBound:pS(t),screenRange:bS(t)};return iS(r)},HS=function(t){return function(e,n){return function(t,e,n){var r=(t>0?rS:nS)(JC(n).y,MC(n),BC(n),UC(n));return NS(e,BS(r)),B.some(r)}(t,e,n).map(k)}},LS=function(t,e,n,r,o,i){var a=function(t,e,n,r,o){var i=bS(t),a=r.bind((function(e){return B.some(wS(e,t))})).getOr(0),u=o.bind((function(e){return B.some(wS(e,t))})).getOr(i),c={min:MC(e),max:BC(e),range:PC(e),value:n,hasMinEdge:KC(e),hasMaxEdge:YC(e),minBound:hS(t),minOffset:0,maxBound:pS(t),maxOffset:i,centerMinEdge:a,centerMaxEdge:u};return aS(c)}(e,i,n,r,o);return hS(e)-hS(t)+a},VS=B.none,PS=B.none,IS=HS(-1),FS=HS(1),US={"top-left":B.none(),top:B.some((function(t,e){eS(t,ZC(AC(e)))})),"top-right":B.none(),right:B.none(),"bottom-right":B.none(),bottom:B.some((function(t,e){eS(t,ZC(HC(e)))})),"bottom-left":B.none(),left:B.none()},jS=Object.freeze({__proto__:null,setValueFrom:function(t,e,n){var r=RS(t,e,n),o=BS(r);return NS(t,o),r},setToMin:function(t,e){var n=MC(e);NS(t,BS(n))},setToMax:function(t,e){var n=BC(e);NS(t,BS(n))},findValueOfOffset:RS,getValueFromEvent:function(t){return zC(t).map((function(t){return t.top}))},findPositionOfValue:LS,setPositionFromValue:function(t,e,n,r){var o=JC(n),i=LS(t,r.getSpectrum(t),o.y,r.getTopEdge(t),r.getBottomEdge(t),n),a=fn(e.element)/2;Qe(e.element,"top",i-a+"px")},onLeft:VS,onRight:PS,onUp:IS,onDown:FS,edgeActions:US}),WS=function(t,e){Di(t,EC(),{value:e})},qS=function(t,e){return{x:t,y:e}},GS=function(t,e){return function(n,r){return function(t,e,n,r){var o=t>0?rS:nS,i=e?JC(r).x:o(JC(r).x,TC(r),NC(r),UC(r)),a=e?o(JC(r).y,MC(r),BC(r),UC(r)):JC(r).y;return WS(n,qS(i,a)),B.some(i)}(t,e,n,r).map(k)}},$S=GS(-1,!1),XS=GS(1,!1),KS=GS(-1,!0),YS=GS(1,!0),JS={"top-left":B.some((function(t,e){eS(t,tS(DC(e),AC(e)))})),top:B.some((function(t,e){eS(t,tS(IC(e),AC(e)))})),"top-right":B.some((function(t,e){eS(t,tS(RC(e),AC(e)))})),right:B.some((function(t,e){eS(t,tS(RC(e),FC(e)))})),"bottom-right":B.some((function(t,e){eS(t,tS(RC(e),HC(e)))})),bottom:B.some((function(t,e){eS(t,tS(IC(e),HC(e)))})),"bottom-left":B.some((function(t,e){eS(t,tS(DC(e),HC(e)))})),left:B.some((function(t,e){eS(t,tS(DC(e),FC(e)))}))},QS=Object.freeze({__proto__:null,setValueFrom:function(t,e,n){var r=kS(t,e,n.left),o=RS(t,e,n.top),i=qS(r,o);return WS(t,i),i},setToMin:function(t,e){var n=TC(e),r=MC(e);WS(t,qS(n,r))},setToMax:function(t,e){var n=NC(e),r=BC(e);WS(t,qS(n,r))},getValueFromEvent:function(t){return zC(t)},setPositionFromValue:function(t,e,n,r){var o=JC(n),i=OS(t,r.getSpectrum(t),o.x,r.getLeftEdge(t),r.getRightEdge(t),n),a=LS(t,r.getSpectrum(t),o.y,r.getTopEdge(t),r.getBottomEdge(t),n),u=yn(e.element)/2,c=fn(e.element)/2;Qe(e.element,"left",i-u+"px"),Qe(e.element,"top",a-c+"px")},onLeft:$S,onRight:XS,onUp:KS,onDown:YS,edgeActions:JS}),ZS=Ad({name:"Slider",configFields:[mo("stepSize",1),mo("onChange",h),mo("onChoose",h),mo("onInit",h),mo("onDragStart",h),mo("onDragEnd",h),mo("snapToGrid",!1),mo("rounded",!0),io("snapStart"),Jr("model",Gr("mode",{x:[mo("minX",0),mo("maxX",100),Xr("value",(function(t){return Co(t.mode.minX)})),Yr("getInitialValue"),Au("manager",AS)],y:[mo("minY",0),mo("maxY",100),Xr("value",(function(t){return Co(t.mode.minY)})),Yr("getInitialValue"),Au("manager",jS)],xy:[mo("minX",0),mo("maxX",100),mo("minY",0),mo("maxY",100),Xr("value",(function(t){return Co({x:t.mode.minX,y:t.mode.minY})})),Yr("getInitialValue"),Au("manager",QS)]})),zf("sliderBehaviours",[nh,Ef]),Xr("mouseIsDown",(function(){return Co(!1)}))],partFields:OC,factory:function(t,e,n,r){var o,i=function(e){return bd(e,t,"thumb")},a=function(e){return bd(e,t,"spectrum")},u=function(e){return vd(e,t,"left-edge")},c=function(e){return vd(e,t,"right-edge")},s=function(e){return vd(e,t,"top-edge")},l=function(e){return vd(e,t,"bottom-edge")},f=t.model,d=f.manager,m=function(e,n){d.setPositionFromValue(e,n,t,{getLeftEdge:u,getRightEdge:c,getTopEdge:s,getBottomEdge:l,getSpectrum:a})},g=function(t,e){f.value.set(e);var n=i(t);m(t,n)},h=function(e){var n=t.mouseIsDown.get();t.mouseIsDown.set(!1),n&&vd(e,t,"thumb").each((function(n){var r=f.value.get();t.onChoose(e,n,r)}))},p=function(e,n){n.stop(),t.mouseIsDown.set(!0),t.onDragStart(e,i(e))},v=function(e,n){n.stop(),t.onDragEnd(e,i(e)),h(e)};return{uid:t.uid,dom:t.dom,components:e,behaviours:Mf(t.sliderBehaviours,[nh.config({mode:"special",focusIn:function(e){return vd(e,t,"spectrum").map(nh.focusIn).map(k)}}),Ef.config({store:{mode:"manual",getValue:function(t){return f.value.get()}}}),Ec.config({channels:(o={},o[lf()]={onReceive:h},o)})]),events:Hi([Pi(EC(),(function(e,n){!function(e,n){g(e,n);var r=i(e);t.onChange(e,r,n),B.some(!0)}(e,n.event.value)})),$i((function(e,n){var r=f.getInitialValue();f.value.set(r);var o=i(e);m(e,o);var u=a(e);t.onInit(e,o,u,f.value.get())})),Pi(Lo(),p),Pi(Po(),v),Pi(Fo(),p),Pi(Wo(),v)]),apis:{resetToMin:function(e){d.setToMin(e,t)},resetToMax:function(e){d.setToMax(e,t)},setValue:g,refresh:m},domModification:{styles:{position:"relative"}}}},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)}}}),tk=ia("rgb-hex-update"),ek=ia("slider-update"),nk=ia("palette-update"),rk="form",ok=[zf("formBehaviours",[Ef])],ik=function(t){return""},ak=function(t,e){return{uid:t.uid,dom:t.dom,components:e,behaviours:Mf(t.formBehaviours,[Ef.config({store:{mode:"manual",getValue:function(e){var n=xd(e,t);return mt(n,(function(t,e){return t().bind((function(t){var n,r,o=Hd.getCurrent(t);return n=o,r=new Error("Cannot find a current component to extract the value from for form part '"+e+"': "+ea(t.element)),n.fold((function(){return qn.error(r)}),qn.value)})).map(Ef.getValue)}))},setValue:function(e,n){dt(n,(function(n,r){vd(e,t,r).each((function(t){Hd.getCurrent(t).each((function(t){Ef.setValue(t,n)}))}))}))}}})]),apis:{getField:function(e,n){return vd(e,t,n).bind(Hd.getCurrent)}}}},uk={getField:xa((function(t,e,n){return t.getField(e,n)})),sketch:function(t){var e=function(){var t=[];return{field:function(e,n){return t.push(e),dd(rk,ik(e),n)},record:v(t)}}(),n=t(e),r=e.record(),o=j(r,(function(t){return rd({name:t,pname:ik(t)})}));return Ed(rk,ok,o,ak,n)}},ck=ia("valid-input"),sk=ia("invalid-input"),lk=ia("validating-input"),fk="colorcustom.rgb.",dk=function(t,e,n,r){var o=function(n,r){return Iw.config({invalidClass:e("invalid"),notify:{onValidate:function(t){Di(t,lk,{type:n})},onValid:function(t){Di(t,ck,{type:n,value:Ef.getValue(t)})},onInvalid:function(t){Di(t,sk,{type:n,value:Ef.getValue(t)})}},validator:{validate:function(e){var n=Ef.getValue(e),o=r(n)?qn.value(!0):qn.error(t("aria.input.invalid"));return Mw(o)},validateOnLoad:!1}})},i=function(n,r,i,a,u){var c=t("colorcustom.rgb.range"),s=[Jx.parts.label({dom:{tag:"label",innerHtml:i,attributes:{"aria-label":a}}}),Jx.parts.field({data:u,factory:xw,inputAttributes:O({type:"text"},"hex"===r?{"aria-live":"polite"}:{}),inputClasses:[e("textfield")],inputBehaviours:wc([o(r,n),tw.config({})]),onSetValue:function(t){Iw.isInvalid(t)&&Iw.run(t).get(h)}})],l="hex"!==r?[Jx.parts["aria-descriptor"]({text:c})]:[];return{dom:{tag:"div",attributes:{role:"presentation"}},components:s.concat(l)}},a=function(t,e){var n=e.red,r=e.green,o=e.blue;Ef.setValue(t,{red:n,green:r,blue:o})},u=bp({dom:{tag:"div",classes:[e("rgba-preview")],styles:{"background-color":"white"},attributes:{role:"presentation"}}}),c=function(t,e){u.getOpt(t).each((function(t){Qe(t.element,"background-color","#"+e.value)}))};return Dd({factory:function(){var o={red:Co(B.some(255)),green:Co(B.some(255)),blue:Co(B.some(255)),hex:Co(B.some("ffffff"))},s=function(t){return o[t].get()},l=function(t,e){o[t].set(e)},f=function(t){var e=t.red,n=t.green,r=t.blue;l("red",B.some(e)),l("green",B.some(n)),l("blue",B.some(r))},d=function(t,e){var n=e.event;"hex"!==n.type?l(n.type,B.none()):r(t)},m=function(t,e,n){var r=parseInt(n,10);l(e,B.some(r)),s("red").bind((function(t){return s("green").bind((function(e){return s("blue").map((function(n){return Ny(t,e,n,1)}))}))})).each((function(e){var n=function(t,e){var n=Ey(e);return uk.getField(t,"hex").each((function(e){mh.isFocused(e)||Ef.setValue(t,{hex:n.value})})),n}(t,e);Di(t,tk,{hex:n}),c(t,n)}))},g=function(t,e){var r=e.event;!function(t){return"hex"===t.type}(r)?m(t,r.type,r.value):function(t,e){n(t);var r=xy(e);l("hex",B.some(e));var o=Hy(r);a(t,o),f(o),Di(t,tk,{hex:r}),c(t,r)}(t,r.value)},h=function(e){return{label:t(fk+e+".label"),description:t(fk+e+".description")}},p=h("red"),v=h("green"),b=h("blue"),y=h("hex");return cr(uk.sketch((function(n){return{dom:{tag:"form",classes:[e("rgb-form")],attributes:{"aria-label":t("aria.color.picker")}},components:[n.field("red",Jx.sketch(i(By,"red",p.label,p.description,255))),n.field("green",Jx.sketch(i(By,"green",v.label,v.description,255))),n.field("blue",Jx.sketch(i(By,"blue",b.label,b.description,255))),n.field("hex",Jx.sketch(i(Sy,"hex",y.label,y.description,"ffffff"))),u.asSpec()],formBehaviours:wc([Iw.config({invalidClass:e("form-invalid")}),ch("rgb-form-events",[Pi(ck,g),Pi(sk,d),Pi(lk,d)])])}})),{apis:{updateHex:function(t,e){Ef.setValue(t,{hex:e.value}),function(t,e){var n=Hy(e);a(t,n),f(n)}(t,e),c(t,e)}}})},name:"RgbForm",configFields:[],apis:{updateHex:function(t,e,n){t.updateHex(e,n)}},extraApis:{}})},mk=function(t,e){var n=ZS.parts.spectrum({dom:{tag:"canvas",attributes:{role:"presentation"},classes:[e("sv-palette-spectrum")]}}),r=ZS.parts.thumb({dom:{tag:"div",attributes:{role:"presentation"},classes:[e("sv-palette-thumb")],innerHtml:"'}}),o=function(t,e){var n=t.width,r=t.height,o=t.getContext("2d");if(null!==o){o.fillStyle=e,o.fillRect(0,0,n,r);var i=o.createLinearGradient(0,0,n,0);i.addColorStop(0,"rgba(255,255,255,1)"),i.addColorStop(1,"rgba(255,255,255,0)"),o.fillStyle=i,o.fillRect(0,0,n,r);var a=o.createLinearGradient(0,0,0,r);a.addColorStop(0,"rgba(0,0,0,0)"),a.addColorStop(1,"rgba(0,0,0,1)"),o.fillStyle=a,o.fillRect(0,0,n,r)}};return Dd({factory:function(t){var i=v({x:0,y:0}),a=wc([Hd.config({find:B.some}),mh.config({})]);return ZS.sketch({dom:{tag:"div",attributes:{role:"presentation"},classes:[e("sv-palette")]},model:{mode:"xy",getInitialValue:i},rounded:!1,components:[n,r],onChange:function(t,e,n){Di(t,nk,{value:n})},onInit:function(t,e,n,r){o(n.element.dom,Py(Iy))},sliderBehaviours:a})},name:"SaturationBrightnessPalette",configFields:[],apis:{setHue:function(t,e,n){!function(t,e){var n=t.components()[0].element.dom,r=Uy(e,100,100),i=Ry(r);o(n,Py(i))}(e,n)},setThumb:function(t,e,n){!function(t,e){var n=jy(Hy(e));ZS.setValue(t,{x:n.saturation,y:100-n.value})}(e,n)}},extraApis:{}})},gk=function(t,e){return Dd({name:"ColourPicker",configFields:[Yr("dom"),mo("onValidHex",h),mo("onInvalidHex",h)],factory:function(n){var r,o=dk(t,e,n.onValidHex,n.onInvalidHex),i=mk(0,e),a=function(t){return 100-t/360*100},u={paletteRgba:Co(Iy),paletteHue:Co(0)},c=bp(function(t,e){var n=ZS.parts.spectrum({dom:{tag:"div",classes:[e("hue-slider-spectrum")],attributes:{role:"presentation"}}}),r=ZS.parts.thumb({dom:{tag:"div",classes:[e("hue-slider-thumb")],attributes:{role:"presentation"}}});return ZS.sketch({dom:{tag:"div",classes:[e("hue-slider")],attributes:{role:"presentation"}},rounded:!1,model:{mode:"y",getInitialValue:v({y:0})},components:[n,r],sliderBehaviours:wc([mh.config({})]),onChange:function(t,e,n){Di(t,ek,{value:n})}})}(0,e)),s=bp(i.sketch({})),l=bp(o.sketch({})),f=function(t,e,n){s.getOpt(t).each((function(t){i.setHue(t,n)}))},d=function(t,e){l.getOpt(t).each((function(t){o.updateHex(t,e)}))},m=function(t,e,n){c.getOpt(t).each((function(t){ZS.setValue(t,{y:a(n)})}))},g=function(t,e){s.getOpt(t).each((function(t){i.setThumb(t,e)}))},h=function(t,e,n,r){!function(t,e){var n=Hy(t);u.paletteRgba.set(n),u.paletteHue.set(e)}(e,n),W(r,(function(r){r(t,e,n)}))};return{uid:n.uid,dom:n.dom,components:[s.asSpec(),c.asSpec(),l.asSpec()],behaviours:wc([ch("colour-picker-events",[Pi(tk,(r=[f,m,g],function(t,e){var n=e.event.hex,o=function(t){return jy(Hy(t))}(n);h(t,n,o.hue,r)})),Pi(nk,function(){var t=[d];return function(e,n){var r=n.event.value,o=u.paletteHue.get(),i=Uy(o,r.x,100-r.y),a=Wy(i);h(e,a,o,t)}}()),Pi(ek,function(){var t=[f,d];return function(e,n){var r=function(t){return(100-t)/100*360}(n.event.value.y),o=u.paletteRgba.get(),i=jy(o),a=Uy(r,i.saturation,i.value),c=Wy(a);h(e,c,r,t)}}())]),Hd.config({find:function(t){return l.getOpt(t)}}),nh.config({mode:"acyclic"})])}}})},hk=function(){return Hd.config({find:B.some})},pk=function(t){return Hd.config({find:t.getOpt})},vk=function(t){return Hd.config({find:function(e){return Te(e.element,t).bind((function(t){return e.getSystem().getByDom(t).toOptional()}))}})},bk={"colorcustom.rgb.red.label":"R","colorcustom.rgb.red.description":"Red component","colorcustom.rgb.green.label":"G","colorcustom.rgb.green.description":"Green component","colorcustom.rgb.blue.label":"B","colorcustom.rgb.blue.description":"Blue component","colorcustom.rgb.hex.label":"#","colorcustom.rgb.hex.description":"Hex color code","colorcustom.rgb.range":"Range 0 to 255","colorcustom.sb.saturation":"Saturation","colorcustom.sb.brightness":"Brightness","colorcustom.sb.picker":"Saturation and Brightness Picker","colorcustom.sb.palette":"Saturation and Brightness Palette","colorcustom.sb.instructions":"Use arrow keys to select saturation and brightness, on x and y axes","colorcustom.hue.hue":"Hue","colorcustom.hue.slider":"Hue Slider","colorcustom.hue.palette":"Hue Palette","colorcustom.hue.instructions":"Use arrow keys to select a hue","aria.color.picker":"Color Picker","aria.input.invalid":"Invalid input"},yk=function(t){return function(t){return bk[t]}(t)},xk=tinymce.util.Tools.resolve("tinymce.Resource"),wk=tinymce.util.Tools.resolve("tinymce.util.Tools"),Ck=_r([mo("preprocess",b),mo("postprocess",b)]),Sk=function(t,e,n){return Ef.config(cr({store:{mode:"manual",getValue:e,setValue:n}},t.map((function(t){return{store:{initialValue:t}}})).getOr({})))},kk=function(t,e,n){return Sk(t,(function(t){return e(t.element)}),(function(t,e){return n(t.element,e)}))},_k=function(t,e){var n=Wr("RepresentingConfigs.memento processors",Ck,e);return Ef.config({store:{mode:"manual",getValue:function(e){var r=t.get(e),o=Ef.getValue(r);return n.postprocess(o)},setValue:function(e,r){var o=n.preprocess(r),i=t.get(e);Ef.setValue(i,o)}}})},Ok=Sk,Ek=function(t){return kk(t,Ji,Qi)},zk=function(t){return Ef.config({store:{mode:"memory",initialValue:t}})},Tk=function(t,e){var n=function(t,e){e.stop()},r=function(t){return function(e,n){W(t,(function(t){t(e,n)}))}},o=function(t,e){if(!Yd.isDisabled(t)){var n=e.event.raw;a(t,n.dataTransfer.files)}},i=function(t,e){var n=e.event.raw.target;a(t,n.files)},a=function(n,r){Ef.setValue(n,function(t,e){var n=wk.explode(e.getSetting("images_file_types","jpeg,jpg,jpe,jfi,jif,jfif,png,gif,bmp,webp","string"));return G(ct(t),(function(t){return I(n,(function(e){return Tt(t.name.toLowerCase(),"."+e.toLowerCase())}))}))}(r,e)),Di(n,aw,{name:t.name})},u=bp({dom:{tag:"input",attributes:{type:"file",accept:"image/*"},styles:{display:"none"}},behaviours:wc([ch("input-file-events",[Wi(Qo()),Wi(fi())])])}),c=t.label.map((function(t){return iw(t,e)})),s=Jx.parts.field({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-dropzone-container"]},behaviours:wc([zk([]),hk(),Yd.config({}),_h.config({toggleClass:"dragenter",toggleOnExecute:!1}),ch("dropzone-events",[Pi("dragenter",r([n,_h.toggle])),Pi("dragleave",r([n,_h.toggle])),Pi("dragover",n),Pi("drop",r([n,o])),Pi(Jo(),i)])]),components:[{dom:{tag:"div",classes:["tox-dropzone"],styles:{}},components:[{dom:{tag:"p",innerHtml:e.translate("Drop an image here")}},vp.sketch({dom:{tag:"button",innerHtml:e.translate("Browse for an image"),styles:{position:"relative"},classes:["tox-button","tox-button--secondary"]},components:[u.asSpec()],action:function(t){u.get(t).element.dom.click()},buttonBehaviours:wc([tw.config({}),Xb(e.isDisabled),Gb()])})]}]}}}});return nw(c,s,["tox-form__group--stretched"],[])},Mk=ia("alloy-fake-before-tabstop"),Dk=ia("alloy-fake-after-tabstop"),Ak=function(t){return{dom:{tag:"div",styles:{width:"1px",height:"1px",outline:"none"},attributes:{tabindex:"0"},classes:t},behaviours:wc([mh.config({ignore:!0}),tw.config({})])}},Nk=function(t){return{dom:{tag:"div",classes:["tox-navobj"]},components:[Ak([Mk]),t,Ak([Dk])],behaviours:wc([vk(1)])}},Bk=function(t,e){Di(t,Xo(),{raw:{which:9,shiftKey:e}})},Rk=function(t,e){var n=e.element;Fa(n,Mk)?Bk(t,!0):Fa(n,Dk)&&Bk(t,!1)},Hk=function(t){return Nx(t,["."+Mk,"."+Dk].join(","),S)},Lk=!(pe().browser.isIE()||pe().browser.isEdge()),Vk=function(t,e){var n=Lk&&t.sandboxed,r=O(O({},t.label.map((function(t){return{title:t}})).getOr({})),n?{sandbox:"allow-scripts allow-same-origin"}:{}),o=function(t){var e=Co("");return{getValue:function(t){return e.get()},setValue:function(n,r){if(t)We(n.element,"srcdoc",r);else{We(n.element,"src","javascript:''");var o=n.element.dom.contentWindow.document;o.open(),o.write(r),o.close()}e.set(r)}}}(n),i=t.label.map((function(t){return iw(t,e)})),a=Jx.parts.field({factory:{sketch:function(t){return Nk({uid:t.uid,dom:{tag:"iframe",attributes:r},behaviours:wc([tw.config({}),mh.config({}),Ok(B.none(),o.getValue,o.setValue)])})}}});return nw(i,a,["tox-form__group--stretched"],[])},Pk=function(t,e){return Uk(document.createElement("canvas"),t,e)},Ik=function(t){var e=Pk(t.width,t.height);return Fk(e).drawImage(t,0,0),e},Fk=function(t){return t.getContext("2d")},Uk=function(t,e,n){return t.width=e,t.height=n,t},jk=function(t){return t.naturalWidth||t.width},Wk=function(t){return t.naturalHeight||t.height},qk=function(t){return new kw((function(e,n){(function(t){var e=t.split(","),n=/data:([^;]+)/.exec(e[0]);if(!n)return B.none();for(var r=n[1],o=e[1],i=1024,a=atob(o),u=a.length,c=Math.ceil(u/i),s=new Array(c),l=0;ln?r=n:rn?t=n:t2)&&(i=i<.5?.5:2,u=!0),(a<.5||a>2)&&(a=a<.5?.5:2,u=!0);var c=d_(t,i,a);return u?c.then((function(t){return f_(t,e,n)})):c},d_=function(t,e,n){return new kw((function(r){var o=jk(t),i=Wk(t),a=Math.floor(o*e),u=Math.floor(i*n),c=Pk(a,u);Fk(c).drawImage(t,0,0,o,i,0,0,a,u),r(c)}))},m_=function(t,e){void 0===e&&(e=2);var n=Math.pow(10,e),r=Math.round(t*n);return Math.ceil(r/n)},g_=function(t,e,n){var r=(n<0?360+n:n)*Math.PI/180,o=t.width,i=t.height,a=Math.sin(r),u=Math.cos(r),c=m_(Math.abs(o*u)+Math.abs(i*a)),s=m_(Math.abs(o*a)+Math.abs(i*u)),l=Pk(c,s),f=Fk(l);return f.translate(c/2,s/2),f.rotate(r),f.drawImage(t,-o/2,-i/2),Jk(l,e)},h_=function(t,e,n){var r=Pk(t.width,t.height),o=Fk(r);return"v"===n?(o.scale(1,-1),o.drawImage(t,0,-r.height)):(o.scale(-1,1),o.drawImage(t,-r.width,0)),Jk(r,e)},p_=function(t,e,n,r,o,i){var a=Pk(o,i);return Fk(a).drawImage(t,-n,-r),Jk(a,e)},v_=function(t){return i_(t)},b_=function(t){return s_(t)},y_=function(t,e){return l_(t,e)},x_=function(t,e){return a_(t,e)},w_=function(t,e){return u_(t,e)},C_=function(t,e){return function(t,e){return t.toCanvas().then((function(n){return h_(n,t.getType(),e)}))}(t,e)},S_=function(t,e,n,r,o){return function(t,e,n,r,o){return t.toCanvas().then((function(i){return p_(i,t.getType(),e,n,r,o)}))}(t,e,n,r,o)},k_=function(t,e,n){return function(t,e,n){return t.toCanvas().then((function(r){return f_(r,e,n).then((function(e){return Jk(e,t.getType())}))}))}(t,e,n)},__=function(t,e){return function(t,e){return t.toCanvas().then((function(n){return g_(n,t.getType(),e)}))}(t,e)},O_=function(t,e,n){return zp(t,{tag:"span",classes:["tox-icon","tox-tbtn__icon-wrap"],behaviours:n},e)},E_=function(t,e){return O_(t,e,[])},z_=function(t,e){return O_(t,e,[uh.config({})])},T_=function(t,e,n){return{dom:{tag:"span",innerHtml:n.translate(t),classes:[e+"__select-label"]},behaviours:wc([uh.config({})])}},M_=ia("toolbar.button.execute"),D_=((Xw={})[si()]=["disabling","alloy.base.behaviour","toggling","toolbar-button-events"],Xw),A_=ia("update-menu-text"),N_=ia("update-menu-icon"),B_=function(t,e,n){var r=Co(h),o=t.text.map((function(t){return bp(T_(t,e,n.providers))})),i=t.icon.map((function(t){return bp(z_(t,n.providers.icons))})),a=function(t,e){var n=Ef.getValue(t);return mh.focus(n),Di(n,"keydown",{raw:e.event.raw}),uC.close(n),B.some(!0)},u=t.role.fold((function(){return{}}),(function(t){return{role:t}})),c=t.tooltip.fold((function(){return{}}),(function(t){var e=n.providers.translate(t);return{title:e,"aria-label":e}})),s=zp("chevron-down",{tag:"div",classes:[e+"__select-chevron"]},n.providers.icons);return bp(uC.sketch(O(O(O({},t.uid?{uid:t.uid}:{}),u),{dom:{tag:"button",classes:[e,e+"--select"].concat(j(t.classes,(function(t){return e+"--"+t}))),attributes:O({},c)},components:ny([i.map((function(t){return t.asSpec()})),o.map((function(t){return t.asSpec()})),B.some(s)]),matchWidth:!0,useMinWidth:!0,dropdownBehaviours:wc(z(z([],t.dropdownBehaviours,!0),[Xb((function(){return t.disabled||n.providers.isDisabled()})),Gb(),sC.config({}),uh.config({}),ch("dropdown-events",[Qb(t,r),Zb(t,r)]),ch("menubutton-update-display-text",[Pi(A_,(function(t,e){o.bind((function(e){return e.getOpt(t)})).each((function(t){uh.set(t,[Qa(n.providers.translate(e.event.text))])}))})),Pi(N_,(function(t,e){i.bind((function(e){return e.getOpt(t)})).each((function(t){uh.set(t,[z_(e.event.icon,n.providers.icons)])}))}))])],!1)),eventOrder:cr(D_,{mousedown:["focusing","alloy.base.behaviour","item-type-events","normal-dropdown-events"]}),sandboxBehaviours:wc([nh.config({mode:"special",onLeft:a,onRight:a})]),lazySink:n.getSink,toggleClass:e+"--active",parts:{menu:Bv(0,t.columns,t.presets)},fetch:function(e){return Tw(x(t.fetch,e))}}))).asSpec()},R_=function(t){return"separator"===t.type},H_={type:"separator"},L_=function(t,e){var n=X(t,(function(t,n){return function(t){return o(t)}(n)?""===n?t:"|"===n?t.length>0&&!R_(t[t.length-1])?t.concat([H_]):t:xt(e,n.toLowerCase())?t.concat([e[n.toLowerCase()]]):t:t.concat([n])}),[]);return n.length>0&&R_(n[n.length-1])&&n.pop(),n},V_=function(t,e){return function(t){return xt(t,"getSubmenuItems")}(t)?function(t,e){var n=t.getSubmenuItems(),r=P_(n,e);return{item:t,menus:cr(r.menus,Oo(t.value,r.items)),expansions:cr(r.expansions,Oo(t.value,t.value))}}(t,e):{item:t,menus:{},expansions:{}}},P_=function(t,e){var n=L_(o(t)?t.split(" "):t,e);return $(n,(function(t,n){var r=function(t){if(R_(t))return t;var e=yt(t,"value").getOrThunk((function(){return ia("generated-menu-item")}));return cr({value:e},t)}(n),o=V_(r,e);return{menus:cr(t.menus,o.menus),items:[o.item].concat(t.items),expansions:cr(t.expansions,o.expansions)}}),{menus:{},expansions:{},items:[]})},I_=function(t,e,n,r){var o=ia("primary-menu"),i=P_(t,n.shared.providers.menuItems());if(0===i.items.length)return B.none();var a=Mx(o,i.items,e,n,r),u=mt(i.menus,(function(t,r){return Mx(r,t,e,n,!1)})),c=cr(u,Oo(o,a));return B.from(Kh.tieredData(o,c,i.expansions))},F_=function(t){return{isDisabled:function(){return Yd.isDisabled(t)},setDisabled:function(e){return Yd.set(t,e)},setActive:function(e){var n=t.element;e?(Va(n,"tox-tbtn--enabled"),We(n,"aria-pressed",!0)):(Ia(n,"tox-tbtn--enabled"),Ke(n,"aria-pressed"))},isActive:function(){return Fa(t.element,"tox-tbtn--enabled")}}},U_=function(t,e,n,r){return B_({text:t.text,icon:t.icon,tooltip:t.tooltip,role:r,fetch:function(e,r){t.fetch((function(t){r(I_(t,pv.CLOSE_ON_EXECUTE,n,!1))}))},onSetup:t.onSetup,getApi:F_,columns:1,presets:"normal",classes:[],dropdownBehaviours:[tw.config({})]},e,n.shared)},j_=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){Mc(e.element),Di(e,sw,{name:t.name,value:t.storage.get()})}))}))}},o=function(t){return function(e){e.setActive(t.storage.get())}};return function(e){e(j(t,(function(t){var e=t.text.fold((function(){return{}}),(function(t){return{text:t}}));return O(O({type:t.type,active:!1},e),{onAction:r(t),onSetup:o(t)})})))}},W_=function(t,e,n,r,o,i){void 0===n&&(n=[]);var a=e.fold((function(){return{}}),(function(t){return{action:t}})),u=O({buttonBehaviours:wc([Xb((function(){return t.disabled||i.isDisabled()})),Gb(),tw.config({}),ch("button press",[Vi("click"),Vi("mousedown")])].concat(n)),eventOrder:{click:["button press","alloy.base.behaviour"],mousedown:["button press","alloy.base.behaviour"]}},a),c=cr(u,{dom:r});return cr(c,{components:o})},q_=function(t,e,n,r){void 0===r&&(r=[]);var o={tag:"button",classes:["tox-tbtn"],attributes:t.tooltip.map((function(t){return{"aria-label":n.translate(t),title:n.translate(t)}})).getOr({})},i=t.icon.map((function(t){return E_(t,n.icons)})),a=ny([i]);return W_(t,e,r,o,a,n)},G_=function(t,e,n,r){void 0===r&&(r=[]);var o=q_(t,B.some(e),n,r);return vp.sketch(o)},$_=function(t,e,n,r,o){void 0===r&&(r=[]),void 0===o&&(o=[]);var i=n.translate(t.text),a=t.icon?t.icon.map((function(t){return E_(t,n.icons)})):B.none(),u=a.isSome()?ny([a]):[],c=a.isSome()?{}:{innerHtml:i},s=z(z(z(z([],t.primary||t.borderless?["tox-button"]:["tox-button","tox-button--secondary"],!0),a.isSome()?["tox-button--icon"]:[],!0),t.borderless?["tox-button--naked"]:[],!0),o,!0),l=O(O({tag:"button",classes:s},c),{attributes:{title:i}});return W_(t,e,r,l,u,n)},X_=function(t,e,n,r,o){void 0===r&&(r=[]),void 0===o&&(o=[]);var i=$_(t,B.some(e),n,r,o);return vp.sketch(i)},K_=function(t,e){return function(n){"custom"===e?Di(n,sw,{name:t,value:{}}):"submit"===e?Mi(n,lw):"cancel"===e?Mi(n,cw):console.error("Unknown button type: ",e)}},Y_=function(t,e,n){if(function(t,e){return"menu"===e}(0,e)){var r=t,o=O(O({},t),{onSetup:function(e){return e.setDisabled(t.disabled),h},fetch:j_(r.items,(function(){return i}),n)}),i=bp(U_(o,"tox-tbtn",n,B.none()));return i.asSpec()}if(function(t,e){return"custom"===e||"cancel"===e||"submit"===e}(0,e)){var a=K_(t.name,e),u=O(O({},t),{borderless:!1});return X_(u,a,n.shared.providers,[])}console.error("Unknown footer button type: ",e)},J_=function(t,e){var n,r,o=K_(t.name,"custom");return n=B.none(),r=Jx.parts.field(O({factory:vp},$_(t,B.some(o),e,[zk(""),hk()]))),nw(n,r,[],[])},Q_=v([mo("field1Name","field1"),mo("field2Name","field2"),Mu("onLockedChange"),Ou(["lockClass"]),mo("locked",!1),Df("coupledFieldBehaviours",[Hd,Ef])]),Z_=function(t,e){return rd({factory:Jx,name:t,overrides:function(t){return{fieldBehaviours:wc([ch("coupled-input-behaviour",[Pi(Yo(),(function(n){(function(t,e,n){return vd(t,e,n).bind(Hd.getCurrent)})(n,t,e).each((function(e){vd(n,t,"lock").each((function(r){_h.isOn(r)&&t.onLockedChange(n,e,r)}))}))}))])])}}})},tO=v([Z_("field1","field2"),Z_("field2","field1"),rd({factory:vp,schema:[Yr("dom")],name:"lock",overrides:function(t){return{buttonBehaviours:wc([_h.config({selected:t.locked,toggleClass:t.markers.lockClass,aria:{mode:"pressed"}})])}}})]),eO=Ad({name:"FormCoupledInputs",configFields:Q_(),partFields:tO(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,behaviours:Af(t.coupledFieldBehaviours,[Hd.config({find:B.some}),Ef.config({store:{mode:"manual",getValue:function(e){var n,r=Cd(e,t,["field1","field2"]);return(n={})[t.field1Name]=Ef.getValue(r.field1()),n[t.field2Name]=Ef.getValue(r.field2()),n},setValue:function(e,n){var r=Cd(e,t,["field1","field2"]);wt(n,t.field1Name)&&Ef.setValue(r.field1(),n[t.field1Name]),wt(n,t.field2Name)&&Ef.setValue(r.field2(),n[t.field2Name])}}})]),apis:{getField1:function(e){return vd(e,t,"field1")},getField2:function(e){return vd(e,t,"field2")},getLock:function(e){return vd(e,t,"lock")}}}},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)}}}),nO=function(t){var e=/^\s*(\d+(?:\.\d+)?)\s*(|cm|mm|in|px|pt|pc|em|ex|ch|rem|vw|vh|vmin|vmax|%)\s*$/.exec(t);if(null!==e){var n=parseFloat(e[1]),r=e[2];return qn.value({value:n,unit:r})}return qn.error(t)},rO=function(t,e){var n={"":96,px:96,pt:72,cm:2.54,pc:12,mm:25.4,in:1},r=function(t){return xt(n,t)};return t.unit===e?B.some(t.value):r(t.unit)&&r(e)?n[t.unit]===n[e]?B.some(t.value):B.some(t.value/n[t.unit]*n[e]):B.none()},oO=function(t){return B.none()},iO=function(t,e){var n=nO(t).toOptional(),r=nO(e).toOptional();return kt(n,r,(function(t,e){return rO(t,e.unit).map((function(t){return e.value/t})).map((function(t){return function(t,e){return function(n){return rO(n,e).map((function(n){return{value:n*t,unit:e}}))}}(t,e.unit)})).getOr(oO)})).getOr(oO)},aO=function(t,e){var n=oO,r=ia("ratio-event"),o=function(t){return zp(t,{tag:"span",classes:["tox-icon","tox-lock-icon__"+t]},e.icons)},i=eO.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:wc([Yd.config({disabled:function(){return t.disabled||e.isDisabled()}}),Gb(),tw.config({})])}),a=function(t){return{dom:{tag:"div",classes:["tox-form__group"]},components:t}},u=function(n){return Jx.parts.field({factory:xw,inputClasses:["tox-textfield"],inputBehaviours:wc([Yd.config({disabled:function(){return t.disabled||e.isDisabled()}}),Gb(),tw.config({}),ch("size-input-events",[Pi(Go(),(function(t,e){Di(t,r,{isField1:n})})),Pi(Jo(),(function(e,n){Di(e,aw,{name:t.name})}))])]),selectOnFocus:!1})},c=function(t){return{dom:{tag:"label",classes:["tox-label"],innerHtml:e.translate(t)}}},s=eO.parts.field1(a([Jx.parts.label(c("Width")),u(!0)])),l=eO.parts.field2(a([Jx.parts.label(c("Height")),u(!1)]));return eO.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:[{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:[s,l,a([c(" "),i])]}],field1Name:"width",field2Name:"height",locked:!0,markers:{lockClass:"tox-locked"},onLockedChange:function(t,e,r){nO(Ef.getValue(t)).each((function(t){n(t).each((function(t){Ef.setValue(e,function(t){var e,n={"":0,px:0,pt:1,mm:1,pc:2,ex:2,em:2,ch:2,rem:2,cm:3,in:4,"%":4},r=t.value.toFixed((e=t.unit)in n?n[e]:1);return-1!==r.indexOf(".")&&(r=r.replace(/\.?0*$/,"")),r+t.unit}(t))}))}))},coupledFieldBehaviours:wc([Yd.config({disabled:function(){return t.disabled||e.isDisabled()},onDisabled:function(t){eO.getField1(t).bind(Jx.getField).each(Yd.disable),eO.getField2(t).bind(Jx.getField).each(Yd.disable),eO.getLock(t).each(Yd.disable)},onEnabled:function(t){eO.getField1(t).bind(Jx.getField).each(Yd.enable),eO.getField2(t).bind(Jx.getField).each(Yd.enable),eO.getLock(t).each(Yd.enable)}}),Gb(),ch("size-input-events2",[Pi(r,(function(t,e){var r=e.event.isField1,o=r?eO.getField1(t):eO.getField2(t),i=r?eO.getField2(t):eO.getField1(t),a=o.map(Ef.getValue).getOr(""),u=i.map(Ef.getValue).getOr("");n=iO(a,u)}))])])})},uO={undo:v(ia("undo")),redo:v(ia("redo")),zoom:v(ia("zoom")),back:v(ia("back")),apply:v(ia("apply")),swap:v(ia("swap")),transform:v(ia("transform")),tempTransform:v(ia("temp-transform")),transformApply:v(ia("transform-apply"))},cO=v("save-state"),sO=v("disable"),lO=v("enable"),fO={formActionEvent:sw,saveState:cO,disable:sO,enable:lO},dO=function(t,e){var n=function(t,n,r,o){return bp(X_({name:t,text:t,disabled:r,primary:o,icon:B.none(),borderless:!1},n,e))},r=function(t,n,r,o){return bp(G_({name:t,icon:B.some(t),tooltip:B.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(Yd)&&Yd.disable(n)}))},i=function(t,e){t.map((function(t){var n=t.get(e);n.hasConfigured(Yd)&&Yd.enable(n)}))},a={tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools-edit-panel"]},u=h,c=function(t,e,n){Di(t,e,n)},s=function(t){return Mi(t,fO.disable())},l=function(t){return Mi(t,fO.enable())},f=function(t,e){s(t),c(t,uO.transform(),{transform:e}),l(t)},d=function(t){return function(){tt.getOpt(t).each((function(t){uh.set(t,[Q])}))}},m=function(t,e){s(t),c(t,uO.transformApply(),{transform:e,swap:d(t)}),l(t)},g=function(){return n("Back",(function(t){return c(t,uO.back(),{swap:d(t)})}),!1,!1)},p=function(){return bp({dom:{tag:"div",classes:["tox-spacer"]},behaviours:wc([Yd.config({})])})},b=function(){return n("Apply",(function(t){return c(t,uO.apply(),{swap:d(t)})}),!0,!0)},y=[g(),p(),n("Apply",(function(e){m(e,(function(e){var n=t.getRect();return S_(e,n.x,n.y,n.w,n.h)})),t.hideCrop()}),!1,!0)],x=$x.sketch({dom:a,components:y.map((function(t){return t.asSpec()})),containerBehaviours:wc([ch("image-tools-crop-buttons-events",[Pi(fO.disable(),(function(t,e){o(y,t)})),Pi(fO.enable(),(function(t,e){i(y,t)}))])])}),w=bp(aO({name:"size",label:B.none(),constrain:!0,disabled:!1},e)),C=[g(),p(),w,p(),n("Apply",(function(t){w.getOpt(t).each((function(e){var n=Ef.getValue(e),r=function(t,e){return function(n){return k_(n,t,e)}}(parseInt(n.width,10),parseInt(n.height,10));m(t,r)}))}),!1,!0)],S=$x.sketch({dom:a,components:C.map((function(t){return t.asSpec()})),containerBehaviours:wc([ch("image-tools-resize-buttons-events",[Pi(fO.disable(),(function(t,e){o(C,t)})),Pi(fO.enable(),(function(t,e){i(C,t)}))])])}),k=function(t,e){return function(n){return t(n,e)}},_=k(C_,"h"),O=k(C_,"v"),E=k(__,-90),z=k(__,90),T=function(t,e){!function(t,e){s(t),c(t,uO.tempTransform(),{transform:e}),l(t)}(t,e)},M=[g(),p(),r("flip-horizontally","Flip horizontally",(function(t){T(t,_)}),!1),r("flip-vertically","Flip vertically",(function(t){T(t,O)}),!1),r("rotate-left","Rotate counterclockwise",(function(t){T(t,E)}),!1),r("rotate-right","Rotate clockwise",(function(t){T(t,z)}),!1),p(),b()],D=$x.sketch({dom:a,components:M.map((function(t){return t.asSpec()})),containerBehaviours:wc([ch("image-tools-fliprotate-buttons-events",[Pi(fO.disable(),(function(t,e){o(M,t)})),Pi(fO.enable(),(function(t,e){i(M,t)}))])])}),A=function(t,n,r,o,i){var a=ZS.parts.label({dom:{tag:"label",classes:["tox-label"],innerHtml:e.translate(t)}}),u=ZS.parts.spectrum({dom:{tag:"div",classes:["tox-slider__rail"],attributes:{role:"presentation"}}}),c=ZS.parts.thumb({dom:{tag:"div",classes:["tox-slider__handle"],attributes:{role:"presentation"}}});return bp(ZS.sketch({dom:{tag:"div",classes:["tox-slider"],attributes:{role:"presentation"}},model:{mode:"x",minX:r,maxX:i,getInitialValue:v({x:o})},components:[a,u,c],sliderBehaviours:wc([mh.config({})]),onChoose:n}))},N=function(t,e,n,r,o){return A(t,(function(t,n,r){var o=k(e,r.x/100);f(t,o)}),n,r,o)},R=function(t,e,n,r,u){var c=function(t,e,n,r,o){return[g(),N(t,e,n,r,o),b()]}(t,e,n,r,u);return $x.sketch({dom:a,components:c.map((function(t){return t.asSpec()})),containerBehaviours:wc([ch("image-tools-filter-panel-buttons-events",[Pi(fO.disable(),(function(t,e){o(c,t)})),Pi(fO.enable(),(function(t,e){i(c,t)}))])])})},H=[g(),p(),b()],L=$x.sketch({dom:a,components:H.map((function(t){return t.asSpec()}))}),V=R("Brightness",x_,-100,0,100),P=R("Contrast",w_,-100,0,100),I=R("Gamma",y_,-100,0,100),F=function(t,e,n){return function(r){return function(t,e,n,r){return c_(t,e,n,r)}(r,t,e,n)}},U=function(t){return A(t,(function(t,e,n){var r=j.getOpt(t),o=q.getOpt(t),i=W.getOpt(t);r.each((function(e){o.each((function(n){i.each((function(r){var o=Ef.getValue(e).x/100,i=Ef.getValue(r).x/100,a=Ef.getValue(n).x/100,u=F(o,i,a);f(t,u)}))}))}))}),0,100,200)},j=U("R"),W=U("G"),q=U("B"),G=[g(),j,W,q,b()],$=$x.sketch({dom:a,components:G.map((function(t){return t.asSpec()}))}),X=function(t,e,n){return function(r){c(r,uO.swap(),{transform:e,swap:function(){tt.getOpt(r).each((function(e){uh.set(e,[t]),n(e)}))}})}},K=B.some(b_),Y=B.some(v_),J=[r("crop","Crop",X(x,B.none(),(function(e){t.showCrop()})),!1),r("resize","Resize",X(S,B.none(),(function(e){w.getOpt(e).each((function(e){var n=t.getMeasurements(),r=n.width,o=n.height;Ef.setValue(e,{width:r,height:o})}))})),!1),r("orientation","Orientation",X(D,B.none(),u),!1),r("brightness","Brightness",X(V,B.none(),u),!1),r("sharpen","Sharpen",X(L,K,u),!1),r("contrast","Contrast",X(P,B.none(),u),!1),r("color-levels","Color levels",X($,B.none(),u),!1),r("gamma","Gamma",X(I,B.none(),u),!1),r("invert","Invert",X(L,Y,u),!1)],Q=$x.sketch({dom:a,components:J.map((function(t){return t.asSpec()}))}),Z=$x.sketch({dom:{tag:"div"},components:[Q],containerBehaviours:wc([uh.config({})])}),tt=bp(Z);return{memContainer:tt,getApplyButton:function(t){return tt.getOpt(t).map((function(t){var e=t.components()[0];return e.components()[e.components().length-1]}))}}},mO=tinymce.util.Tools.resolve("tinymce.geom.Rect"),gO=tinymce.util.Tools.resolve("tinymce.util.Observable"),hO=tinymce.util.Tools.resolve("tinymce.util.VK"),pO=function(t){if(function(t){return f(t.changedTouches)}(t))for(var e="screenX screenY pageX pageY clientX clientY".split(" "),n=0;n=1?r.set(1):r.set(u)}))}(t,o),u(t,o)}))}))},s=$x.sketch({dom:{tag:"div",classes:["tox-image-tools__image"]},components:[n.asSpec(),{dom:{tag:"img",attributes:{src:t}}},{dom:{tag:"div"},behaviours:wc([ch("image-panel-crop-events",[$i((function(t){l.getOpt(t).each((function(t){var e=t.element.dom,n=yO({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);n.toggleVisibility(!1),n.on("updateRect",(function(t){var e=t.rect,n=r.get(),o={x:Math.round(e.x/n),y:Math.round(e.y/n),w:Math.round(e.w/n),h:Math.round(e.h/n)};i.set(o)})),o.set(n)}))})),Xi((function(){o.clear()}))])])}],containerBehaviours:wc([uh.config({}),ch("image-panel-events",[$i((function(e){c(e,t)}))])])}),l=bp(s);return{memContainer:l,updateSrc:c,zoom:function(t,e){var n=r.get(),o=e>0?Math.min(2,n+.1):Math.max(.1,n-.1);r.set(o),l.getOpt(t).each((function(t){var e=t.components()[1].element;u(t,e)}))},showCrop:function(){o.run((function(t){t.toggleVisibility(!0)}))},hideCrop:function(){o.run((function(t){t.toggleVisibility(!1)}))},getRect:function(){return i.get()},getMeasurements:function(){var t=a.get();return{width:t.w,height:t.h}}}},wO=function(t,e,n,r,o){return G_({name:t,icon:B.some(e),disabled:n,tooltip:B.some(t),primary:!1,borderless:!1},r,o)},CO=function(t,e){e?Yd.enable(t):Yd.disable(t)};var SO,kO=function(t){var e,n,r,o,i=Co(t),a=ts(),u=(n=-1,{data:e=[],add:function(t){var r=e.splice(++n);return e.push(t),{state:t,removed:r}},undo:function(){if(r())return e[--n]},redo:function(){if(o())return e[++n]},canUndo:r=function(){return n>0},canRedo:o=function(){return-1!==n&&n=t.minChars){var i=Hd.getCurrent(o).bind((function(t){return um.getHighlighted(t).map(Ef.getValue)}));t.previewing.set(!0);Yw(t,a(e),e,o,r,(function(e){Hd.getCurrent(o).each((function(e){i.fold((function(){t.model.selectsOver&&um.highlightFirst(e)}),(function(t){um.highlightBy(e,(function(e){return Ef.getValue(e).value===t.value})),um.getHighlighted(e).orThunk((function(){return um.highlightFirst(e),B.none()}))}))}))}),Sw.HighlightFirst).get(h)}},cancelEvent:gi()}),nh.config({mode:"special",onDown:function(t,e){return o(t,e,um.highlightFirst),B.some(!0)},onEscape:function(t){var e=jw.getCoupled(t,"sandbox");return uf.isOpen(e)?(uf.close(e),B.some(!0)):B.none()},onUp:function(t,e){return o(t,e,um.highlightLast),B.some(!0)},onEnter:function(e){var n=jw.getCoupled(e,"sandbox"),r=uf.isOpen(n);if(r&&!t.previewing.get())return Hd.getCurrent(n).bind((function(t){return um.getHighlighted(t)})).map((function(t){return Di(e,FO(),{item:t}),!0}));var o=Ef.getValue(e);return Mi(e,gi()),t.onExecute(n,e,o),r&&uf.close(n),B.some(!0)}}),_h.config({toggleClass:t.markers.openClass,aria:{mode:"expanded"}}),jw.config({others:{sandbox:function(e){return nC(t,e,{onOpen:function(){return _h.on(e)},onClose:function(){return _h.off(e)}})}}}),ch("typeaheadevents",[Yi((function(e){var n=h;Qw(t,a(e),e,r,n,Sw.HighlightFirst).get(h)})),Pi(FO(),(function(e,n){var r=jw.getCoupled(e,"sandbox");LO(t.model,e,n.event.item),Mi(e,gi()),t.onItemExecute(e,r,n.event.item,Ef.getValue(e)),uf.close(r),PO(e)}))].concat(t.dismissOnBlur?[Pi(ai(),(function(t){var e=jw.getCoupled(t,"sandbox");Nc(e.element).isNone()&&uf.close(e)}))]:[]))];return{uid:t.uid,dom:yw(cr(t,{inputAttributes:{role:"combobox","aria-autocomplete":"list","aria-haspopup":"true"}})),behaviours:O(O({},i),Mf(t.typeaheadBehaviours,u)),eventOrder:t.eventOrder}}}),qO=function(t){return O(O({},t),{toCached:function(){return qO(t.toCached())},bindFuture:function(e){return qO(t.bind((function(t){return t.fold((function(t){return Mw(qn.error(t))}),(function(t){return e(t)}))})))},bindResult:function(e){return qO(t.map((function(t){return t.bind(e)})))},mapResult:function(e){return qO(t.map((function(t){return t.map(e)})))},mapError:function(e){return qO(t.map((function(t){return t.mapError(e)})))},foldResult:function(e,n){return t.map((function(t){return t.fold(e,n)}))},withTimeout:function(e,n){return qO(Tw((function(r){var o=!1,i=setTimeout((function(){o=!0,r(qn.error(n()))}),e);t.get((function(t){o||(clearTimeout(i),r(t))}))})))}})},GO=function(t){return qO(Tw(t))},$O=GO,XO={type:"separator"},KO=function(t){return{type:"menuitem",value:t.url,text:t.title,meta:{attach:t.attach},onAction:h}},YO=function(t,e){return{type:"menuitem",value:e,text:t,meta:{attach:void 0},onAction:h}},JO=function(t,e){return function(t){return j(t,KO)}(function(t,e){return G(e,(function(e){return e.type===t}))}(t,e))},QO=function(t){return JO("header",t.targets)},ZO=function(t){return JO("anchor",t.targets)},tE=function(t){return B.from(t.anchorTop).map((function(t){return YO("",t)})).toArray()},eE=function(t){return B.from(t.anchorBottom).map((function(t){return YO("",t)})).toArray()},nE=function(t,e){var n=t.toLowerCase();return G(e,(function(t){var e=void 0!==t.meta&&void 0!==t.meta.text?t.meta.text:t.text;return Et(e.toLowerCase(),n)||Et(t.value.toLowerCase(),n)}))},rE=function(t,e,n){var r=Ef.getValue(e),o=void 0!==r.meta.text?r.meta.text:r.value;return n.getLinkInformation().fold((function(){return[]}),(function(e){var r,i=nE(o,function(t){return j(t,(function(t){return YO(t,t)}))}(n.getHistory(t)));return"file"===t?(r=[i,nE(o,QO(e)),nE(o,J([tE(e),ZO(e),eE(e)]))],X(r,(function(t,e){return 0===t.length||0===e.length?t.concat(e):t.concat(XO,e)}),[])):i}))},oE=ia("aria-invalid"),iE=function(t){return function(e,n,r){return yt(n,"name").fold((function(){return t(n,r)}),(function(o){return e.field(o,t(n,r))}))}},aE={bar:iE((function(t,e){return function(t,e){return{dom:{tag:"div",classes:["tox-bar","tox-form__controls-h-stack"]},components:j(t.items,e.interpreter)}}(t,e.shared)})),collection:iE((function(t,e){return hw(t,e.shared.providers)})),alertbanner:iE((function(t,e){return function(t,e){return $x.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:[vp.sketch({dom:{tag:"button",classes:["tox-button","tox-button--naked","tox-button--icon"],innerHtml:_p(t.icon,e.icons),attributes:{title:e.translate(t.iconTooltip)}},action:function(e){Di(e,sw,{name:"alert-banner",value:t.url})},buttonBehaviours:wc([Op()])})]},{dom:{tag:"div",classes:["tox-notification__body"],innerHtml:e.translate(t.text)}}]})}(t,e.shared.providers)})),input:iE((function(t,e){return function(t,e){return DO({name:t.name,multiline:!1,label:t.label,inputMode:t.inputMode,placeholder:t.placeholder,flex:!1,disabled:t.disabled,classname:"tox-textfield",validation:B.none(),maximized:t.maximized},e)}(t,e.shared.providers)})),textarea:iE((function(t,e){return function(t,e){return DO({name:t.name,multiline:!0,label:t.label,inputMode:B.none(),placeholder:t.placeholder,flex:!0,disabled:t.disabled,classname:"tox-textarea",validation:B.none(),maximized:t.maximized},e)}(t,e.shared.providers)})),label:iE((function(t,e){return function(t,e){var n={dom:{tag:"label",innerHtml:e.providers.translate(t.label),classes:["tox-label"]}},r=j(t.items,e.interpreter);return{dom:{tag:"div",classes:["tox-form__group"]},components:[n].concat(r),behaviours:wc([hk(),uh.config({}),Ek(B.none()),nh.config({mode:"acyclic"})])}}(t,e.shared)})),iframe:function(t){return function(e,n,r){var o=cr(n,{source:"dynamic"});return iE(t)(e,o,r)}}((function(t,e){return Vk(t,e.shared.providers)})),button:iE((function(t,e){return J_(t,e.shared.providers)})),checkbox:iE((function(t,e){return function(t,e){var n=Ef.config({store:{mode:"manual",getValue:function(t){return t.element.dom.checked},setValue:function(t,e){t.element.dom.checked=e}}}),r=function(t){return t.element.dom.click(),B.some(!0)},o=Jx.parts.field({factory:{sketch:b},dom:{tag:"input",classes:["tox-checkbox__input"],attributes:{type:"checkbox"}},behaviours:wc([hk(),Yd.config({disabled:function(){return t.disabled||e.isDisabled()}}),tw.config({}),mh.config({}),n,nh.config({mode:"special",onEnter:r,onSpace:r,stopSpaceKeyup:!0}),ch("checkbox-events",[Pi(Jo(),(function(e,n){Di(e,aw,{name:t.name})}))])])}),i=Jx.parts.label({dom:{tag:"span",classes:["tox-checkbox__label"],innerHtml:e.translate(t.label)},behaviours:wc([sC.config({})])}),a=function(t){return zp("checked"===t?"selected":"unselected",{tag:"span",classes:["tox-icon","tox-checkbox-icon__"+t]},e.icons)},u=bp({dom:{tag:"div",classes:["tox-checkbox__icons"]},components:[a("checked"),a("unchecked")]});return Jx.sketch({dom:{tag:"label",classes:["tox-checkbox"]},components:[o,u.asSpec(),i],fieldBehaviours:wc([Yd.config({disabled:function(){return t.disabled||e.isDisabled()},disableClass:"tox-checkbox--disabled",onDisabled:function(t){Jx.getField(t).each(Yd.disable)},onEnabled:function(t){Jx.getField(t).each(Yd.enable)}}),Gb()])})}(t,e.shared.providers)})),colorinput:iE((function(t,e){return mC(t,e.shared,e.colorinput)})),colorpicker:iE((function(t){var e=function(t){return"tox-"+t},n=gk(yk,e),r=bp(n.sketch({dom:{tag:"div",classes:[e("color-picker-container")],attributes:{role:"presentation"}},onValidHex:function(t){Di(t,sw,{name:"hex-valid",value:!0})},onInvalidHex:function(t){Di(t,sw,{name:"hex-valid",value:!1})}}));return{dom:{tag:"div"},components:[r.asSpec()],behaviours:wc([Ef.config({store:{mode:"manual",getValue:function(t){var e=r.get(t);return Hd.getCurrent(e).bind((function(t){return Ef.getValue(t).hex})).map((function(t){return"#"+t})).getOr("")},setValue:function(t,e){var n=/^#([a-fA-F0-9]{3}(?:[a-fA-F0-9]{3})?)/.exec(e),o=r.get(t);Hd.getCurrent(o).fold((function(){console.log("Can not find form")}),(function(t){Ef.setValue(t,{hex:B.from(n[1]).getOr("")}),uk.getField(t,"hex").each((function(t){Mi(t,Yo())}))}))}}}),hk()])}})),dropzone:iE((function(t,e){return Tk(t,e.shared.providers)})),grid:iE((function(t,e){return function(t,e){return{dom:{tag:"div",classes:["tox-form__grid","tox-form__grid--"+t.columns+"col"]},components:j(t.items,e.interpreter)}}(t,e.shared)})),listbox:iE((function(t,e){return function(t,e){var n=e.shared.providers,r=at(t.items).filter(OO),o=t.label.map((function(t){return iw(t,n)})),i={dom:{tag:"div",classes:["tox-listboxfield"]},components:[Jx.parts.field({dom:{},factory:{sketch:function(n){return B_({uid:n.uid,text:r.map((function(t){return t.text})),icon:B.none(),tooltip:t.label,role:B.none(),fetch:function(n,r){var o=zO(n,t.name,t.items,Ef.getValue(n));r(I_(o,pv.CLOSE_ON_EXECUTE,e,!1))},onSetup:v(h),getApi:v({}),columns:1,presets:"normal",classes:[],dropdownBehaviours:[tw.config({}),Ef.config({store:{mode:"manual",initialValue:r.map((function(t){return t.value})).getOr(""),getValue:function(t){return Ge(t.element,EO)},setValue:function(e,n){TO(t.items,n).each((function(t){We(e.element,EO,t.value),Di(e,A_,{text:t.text})}))}}})]},"tox-listbox",e.shared)}}})]};return Jx.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:J([o.toArray(),[i]]),fieldBehaviours:wc([Yd.config({disabled:v(t.disabled),onDisabled:function(t){Jx.getField(t).each(Yd.disable)},onEnabled:function(t){Jx.getField(t).each(Yd.enable)}})])})}(t,e)})),selectbox:iE((function(t,e){return function(t,e){var n=j(t.items,(function(t){return{text:e.translate(t.text),value:t.value}})),r=t.label.map((function(t){return iw(t,e)})),o=Jx.parts.field({dom:{},selectAttributes:{size:t.size},options:n,factory:MO,selectBehaviours:wc([Yd.config({disabled:function(){return t.disabled||e.isDisabled()}}),tw.config({}),ch("selectbox-change",[Pi(Jo(),(function(e,n){Di(e,aw,{name:t.name})}))])])}),i=t.size>1?B.none():B.some(zp("chevron-down",{tag:"div",classes:["tox-selectfield__icon-js"]},e.icons)),a={dom:{tag:"div",classes:["tox-selectfield"]},components:J([[o],i.toArray()])};return Jx.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:J([r.toArray(),[a]]),fieldBehaviours:wc([Yd.config({disabled:function(){return t.disabled||e.isDisabled()},onDisabled:function(t){Jx.getField(t).each(Yd.disable)},onEnabled:function(t){Jx.getField(t).each(Yd.enable)}}),Gb()])})}(t,e.shared.providers)})),sizeinput:iE((function(t,e){return aO(t,e.shared.providers)})),urlinput:iE((function(t,e){return function(t,e,n){var r,o=e.shared.providers,i=function(e){var r=Ef.getValue(e);n.addToHistory(r.value,t.filetype)},a=Jx.parts.field({factory:WO,dismissOnBlur:!0,inputClasses:["tox-textfield"],sandboxClasses:["tox-dialog__popups"],inputAttributes:{"aria-errormessage":oE,type:"url"},minChars:0,responseTime:0,fetch:function(r){var o=rE(t.filetype,r,n),i=I_(o,pv.BUBBLE_TO_SANDBOX,e,!1);return Mw(i)},getHotspot:function(t){return d.getOpt(t)},onSetValue:function(t,e){t.hasConfigured(Iw)&&Iw.run(t).get(h)},typeaheadBehaviours:wc(J([n.getValidationHandler().map((function(e){return Iw.config({getRoot:function(t){return Oe(t.element)},invalidClass:"tox-control-wrap--status-invalid",notify:{onInvalid:function(t,e){c.getOpt(t).each((function(t){We(t.element,"title",o.translate(e))}))}},validator:{validate:function(n){var r=Ef.getValue(n);return $O((function(n){e({type:t.filetype,url:r.value},(function(t){if("invalid"===t.status){var e=qn.error(t.message);n(e)}else{var r=qn.value(t.message);n(r)}}))}))},validateOnLoad:!1}})})).toArray(),[Yd.config({disabled:function(){return t.disabled||o.isDisabled()}}),tw.config({}),ch("urlinput-events",J(["file"===t.filetype?[Pi(Yo(),(function(e){Di(e,aw,{name:t.name})}))]:[],[Pi(Jo(),(function(e){Di(e,aw,{name:t.name}),i(e)})),Pi(ui(),(function(e){Di(e,aw,{name:t.name}),i(e)}))]]))]])),eventOrder:(r={},r[Yo()]=["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:Bv(0,0,"normal")},onExecute:function(t,e,n){Di(e,lw,{})},onItemExecute:function(e,n,r,o){i(e),Di(e,aw,{name:t.name})}}),u=t.label.map((function(t){return iw(t,o)})),c=bp(function(t,e,n,r){return void 0===n&&(n=t),void 0===r&&(r=t),zp(n,{tag:"div",classes:["tox-icon","tox-control-wrap__status-icon-"+t],attributes:O({title:o.translate(r),"aria-live":"polite"},e.fold((function(){return{}}),(function(t){return{id:t}})))},o.icons)}("invalid",B.some(oE),"warning")),s=bp({dom:{tag:"div",classes:["tox-control-wrap__status-icon-wrap"]},components:[c.asSpec()]}),l=n.getUrlPicker(t.filetype),f=ia("browser.url.event"),d=bp({dom:{tag:"div",classes:["tox-control-wrap"]},components:[a,s.asSpec()],behaviours:wc([Yd.config({disabled:function(){return t.disabled||o.isDisabled()}})])}),m=bp(X_({name:t.name,icon:B.some("browse"),text:t.label.getOr(""),disabled:t.disabled,primary:!1,borderless:!0},(function(t){return Mi(t,f)}),o,[],["tox-browse-url"]));return Jx.sketch({dom:ow([]),components:u.toArray().concat([{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:J([[d.asSpec()],l.map((function(){return m.asSpec()})).toArray()])}]),fieldBehaviours:wc([Yd.config({disabled:function(){return t.disabled||o.isDisabled()},onDisabled:function(t){Jx.getField(t).each(Yd.disable),m.getOpt(t).each(Yd.disable)},onEnabled:function(t){Jx.getField(t).each(Yd.enable),m.getOpt(t).each(Yd.enable)}}),Gb(),ch("url-input-events",[Pi(f,(function(e){Hd.getCurrent(e).each((function(n){var r=Ef.getValue(n),o=O({fieldname:t.name},r);l.each((function(r){r(o).get((function(r){Ef.setValue(n,r),Di(e,aw,{name:t.name})}))}))}))}))])])})}(t,e,e.urlinput)})),customeditor:iE((function(t){var e=ts(),n=bp({dom:{tag:t.tag}}),r=ts();return{dom:{tag:"div",classes:["tox-custom-editor"]},behaviours:wc([ch("custom-editor-events",[$i((function(o){n.getOpt(o).each((function(n){(!function(t){return xt(t,"init")}(t)?xk.load(t.scriptId,t.scriptUrl).then((function(e){return e(n.element.dom,t.settings)})):t.init(n.element.dom)).then((function(t){r.on((function(e){t.setValue(e)})),r.clear(),e.set(t)}))}))}))]),Ef.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)}))}}}),hk()]),components:[n.asSpec()]}})),htmlpanel:iE((function(t){return"presentation"===t.presets?$x.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:t.html}}):$x.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:t.html,attributes:{role:"document"}},containerBehaviours:wc([tw.config({}),mh.config({})])})})),imagetools:iE((function(t,e){return _O(t,e.shared.providers)})),table:iE((function(t,e){return function(t,e){var n,r,o=function(t){return{dom:{tag:"th",innerHtml:e.translate(t)}}},i=function(t){return{dom:{tag:"td",innerHtml:e.translate(t)}}},a=function(t){return{dom:{tag:"tr"},components:j(t,i)}};return{dom:{tag:"table",classes:["tox-dialog__table"]},components:[(r=t.header,{dom:{tag:"thead"},components:[{dom:{tag:"tr"},components:j(r,o)}]}),(n=t.cells,{dom:{tag:"tbody"},components:j(n,a)})],behaviours:wc([tw.config({}),mh.config({})])}}(t,e.shared.providers)})),panel:iE((function(t,e){return function(t,e){return{dom:{tag:"div",classes:t.classes},components:j(t.items,e.shared.interpreter)}}(t,e)}))},uE={field:function(t,e){return e}},cE=function(t,e,n){var r=cr(n,{shared:{interpreter:function(e){return sE(t,e,r)}}});return sE(t,e,r)},sE=function(t,e,n){return yt(aE,e.type).fold((function(){return console.error('Unknown factory type "'+e.type+'", defaulting to container: ',e),e}),(function(r){return r(t,e,n)}))},lE={valignCentre:[],alignCentre:[],alignLeft:[],alignRight:[],right:[],left:[],bottom:[],top:[]},fE=function(t,e,n){var r={maxHeightFunction:hs()};return function(){return n()?{type:"node",root:He(t()),node:B.from(t()),bubble:ys(12,12,lE),layouts:{onRtl:function(){return[up]},onLtr:function(){return[ap]}},overrides:r}:{type:"hotspot",hotspot:e(),bubble:ys(-12,12,lE),layouts:{onRtl:function(){return[ec]},onLtr:function(){return[nc]}},overrides:r}}},dE=function(t,e,n){return function(){return n()?{type:"node",root:He(t()),node:B.from(t()),layouts:{onRtl:function(){return[cp]},onLtr:function(){return[cp]}}}:{type:"hotspot",hotspot:e(),layouts:{onRtl:function(){return[ac]},onLtr:function(){return[ac]}}}}},mE=function(t,e){return function(){return{type:"selection",root:e(),getSelection:function(){var e=t.selection.getRng();return B.some(qs.range(Bt.fromDom(e.startContainer),e.startOffset,Bt.fromDom(e.endContainer),e.endOffset))}}}},gE=function(t){return function(e){return{type:"node",root:t(),node:e}}},hE=function(t,e,n){var r=Bb(t),o=function(){return Bt.fromDom(t.getBody())},i=function(){return Bt.fromDom(t.getContentAreaContainer())},a=function(){return r||!n()};return{inlineDialog:fE(i,e,a),banner:dE(i,e,a),cursor:mE(t,o),node:gE(o)}},pE=function(t){return function(e,n){lx(t)(e,n)}},vE=function(t){return function(){return Qy(t)}},bE=function(t){return function(){return Zy(t)}},yE=function(t){return function(){return nx(t)}},xE=function(t){return{colorPicker:pE(t),hasCustomColors:vE(t),getColors:bE(t),getColorCols:yE(t)}},wE=function(t){return function(){return function(t){return t.getParam("draggable_modal",!1,"boolean")}(t)}},CE=function(t){return{isDraggableModal:wE(t)}},SE=[{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"}]}],kE=function(t){return X(t,(function(t,e){if(xt(e,"items")){var n=kE(e.items);return{customFormats:t.customFormats.concat(n.customFormats),formats:t.formats.concat([{title:e.title,items:n.formats}])}}if(function(t){return xt(t,"inline")}(e)||function(t){return xt(t,"block")}(e)||function(t){return xt(t,"selector")}(e)){var r="custom-"+(o(e.name)?e.name:e.title.toLowerCase());return{customFormats:t.customFormats.concat([{name:r,format:e}]),formats:t.formats.concat([{title:e.title,format:r,icon:e.icon}])}}return O(O({},t),{formats:t.formats.concat(e)})}),{customFormats:[],formats:[]})},_E=function(t){return function(t){return B.from(t.getParam("style_formats")).filter(a)}(t).map((function(e){var n=function(t,e){var n=kE(e),r=function(e){W(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}(t,e);return function(t){return t.getParam("style_formats_merge",!1,"boolean")}(t)?SE.concat(n):n})).getOr(SE)},OE=function(t,e,n){var r={type:"formatter",isSelected:e(t.format),getStylePreview:n(t.format)};return cr(t,r)},EE=function(t,e,n,r){var i=function(e){return j(e,(function(e){var a=lt(e);if(wt(e,"items")){var u=i(e.items);return cr(function(t){return cr(t,{type:"submenu"})}(e),{getStyleItems:v(u)})}return wt(e,"format")?function(t){return OE(t,n,r)}(e):1===a.length&&P(a,"title")?cr(e,{type:"separator"}):function(e){var i=o(e.name)?e.name:ia(e.title),a="custom-"+i,u={type:"formatter",format:a,isSelected:n(a),getStylePreview:r(a)},c=cr(e,u);return t.formatter.register(i,c),c}(e)}))};return i(e)},zE=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?B.some({tag:n.length>0&&(n[0].inline||n[0].block)||"div",styles:t.dom.parseStyle(t.formatter.getCssText(e))}):B.none()}},r=function(t){var e=t.items;return void 0!==e&&e.length>0?Q(e,r):[t.format]},o=Co([]),i=Co([]),a=Co([]),u=Co([]),c=Co(!1);t.on("PreInit",(function(a){var u=_E(t),c=EE(t,u,e,n);o.set(c),i.set(Q(c,r))})),t.on("addStyleModifications",(function(o){var i=EE(t,o.items,e,n);a.set(i),c.set(o.replace),u.set(Q(i,r))}));return{getData:function(){var t=c.get()?[]:o.get(),e=a.get();return t.concat(e)},getFlattenedKeys:function(){var t=c.get()?[]:i.get(),e=u.get();return t.concat(e)}}},TE=wk.trim,ME=function(t){return function(e){if(function(t){return f(t)&&1===t.nodeType}(e)){if(e.contentEditable===t)return!0;if(e.getAttribute("data-mce-contenteditable")===t)return!0}return!1}},DE=ME("true"),AE=ME("false"),NE=function(t,e,n,r,o){return{type:t,title:e,url:n,level:r,attach:o}},BE=function(t){return t.innerText||t.textContent},RE=function(t){return function(t){return t&&"A"===t.nodeName&&void 0!==(t.id||t.name)}(t)&&LE(t)},HE=function(t){return t&&/^(H[1-6])$/.test(t.nodeName)},LE=function(t){return function(t){for(;t=t.parentNode;){var e=t.contentEditable;if(e&&"inherit"!==e)return DE(t)}return!1}(t)&&!AE(t)},VE=function(t){return HE(t)&&LE(t)},PE=function(t){var e=function(t){return t.id?t.id:ia("h")}(t);return NE("header",BE(t),"#"+e,function(t){return HE(t)?parseInt(t.nodeName.substr(1),10):0}(t),(function(){t.id=e}))},IE=function(t){var e=t.id||t.name,n=BE(t);return NE("anchor",n||"#"+e,"#"+e,0,h)},FE=function(t){var e,n;return e="h1,h2,h3,h4,h5,h6,a:not([href])",n=t,j(il(Bt.fromDom(n),e),(function(t){return t.dom}))},UE=function(t){return TE(t.title).length>0},jE=function(t){var e=FE(t);return G(function(t){return j(G(t,VE),PE)}(e).concat(function(t){return j(G(t,RE),IE)}(e)),UE)},WE="tinymce-url-history",qE=function(t){return o(t)&&/^https?/.test(t)},GE=function(t){return i(t)&&vt(t,(function(t){return!(a(e=t)&&e.length<=5&&Z(e,qE));var e})).isNone()},$E=function(){var t,e=Gy.getItem(WE);if(null===e)return{};try{t=JSON.parse(e)}catch(t){if(t instanceof SyntaxError)return console.log("Local storage "+WE+" was not valid JSON",t),{};throw t}return GE(t)?t:(console.log("Local storage "+WE+" was not valid format",t),{})},XE=function(t){var e=$E();return yt(e,t).getOr([])},KE=function(t,e){if(qE(t)){var n=$E(),r=yt(n,e).getOr([]),o=G(r,(function(e){return e!==t}));n[e]=[t].concat(o).slice(0,5),function(t){if(!GE(t))throw new Error("Bad format for history:\n"+JSON.stringify(t));Gy.setItem(WE,JSON.stringify(t))}(n)}},YE=function(t){return!!t},JE=function(t){return mt(wk.makeMap(t,/[, ]/),YE)},QE=function(t){return B.from(function(t){return t.getParam("file_picker_callback")}(t)).filter(d)},ZE=function(t,e){var n=function(t){var e=B.some(function(t){return t.getParam("file_picker_types")}(t)).filter(YE),n=B.some(function(t){return t.getParam("file_browser_callback_types")}(t)).filter(YE),r=e.or(n).map(JE);return QE(t).fold(S,(function(t){return r.fold(k,(function(t){return lt(t).length>0&&t}))}))}(t);return c(n)?n?QE(t):B.none():n[e]?QE(t):B.none()},tz=function(t){return B.from(t).filter(o).getOrUndefined()},ez=function(t){return{getHistory:XE,addToHistory:KE,getLinkInformation:function(){return function(t){return function(t){return!1===t.getParam("typeahead_urls")}(t)?B.none():B.some({targets:jE(t.getBody()),anchorTop:tz(Ib(t)),anchorBottom:tz(Fb(t))})}(t)},getValidationHandler:function(){return function(t){return B.from(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}(t))}(t)},getUrlPicker:function(e){return function(t,e){return ZE(t,e).map((function(n){return function(r){return Tw((function(a){var u=O({filetype:e,fieldname:r.fieldname},B.from(r.meta).getOr({}));n.call(t,(function(t,e){if(!o(t))throw new Error("Expected value to be string");if(void 0!==e&&!i(e))throw new Error("Expected meta to be a object");a({value:t,meta:e})}),r.value,u)}))}}))}(t,e)}}},nz=function(t,e,n){var r=Co(!1),o=function(t){var e=Co(Ab(t)?"bottom":"top");return{isPositionedAtTop:function(){return"top"===e.get()},getDockingMode:e.get,setDockingMode:e.set}}(e),i={shared:{providers:{icons:function(){return e.ui.registry.getAll().icons},menuItems:function(){return e.ui.registry.getAll().menuItems},translate:yp.translate,isDisabled:function(){return e.mode.isReadOnly()||e.ui.isDisabled()},getSetting:e.getParam.bind(e)},interpreter:function(t){return function(t,e){return sE(uE,t,e)}(t,i)},anchors:hE(e,n,o.isPositionedAtTop),header:o,getSink:function(){return qn.value(t)}},urlinput:ez(e),styleselect:zE(e),colorinput:xE(e),dialog:CE(e),isContextMenuOpen:function(){return r.get()},setContextMenuState:function(t){return r.set(t)}};return i},rz=_d,oz=cd,iz=v([mo("shell",!1),Yr("makeItem"),mo("setupItem",h),Df("listBehaviours",[uh])]),az=id({name:"items",overrides:function(){return{behaviours:wc([uh.config({})])}}}),uz=v([az]),cz=v("CustomList"),sz=Ad({name:cz(),configFields:iz(),partFields:uz(),factory:function(t,e,n,r){var o=t.shell?{behaviours:[uh.config({})],components:[]}:{behaviours:[],components:e},i=function(e){return t.shell?B.some(e):vd(e,t,"items")};return{uid:t.uid,dom:t.dom,components:o.components,behaviours:Mf(t.listBehaviours,o.behaviours),apis:{setItems:function(e,n){i(e).fold((function(){throw console.error("Custom List was defined to not be a shell, but no item container was specified in components"),new Error("Custom List was defined to not be a shell, but no item container was specified in components")}),(function(r){var o=uh.contents(r),i=n.length,a=i-o.length,u=a>0?F(a,(function(){return t.makeItem()})):[],c=o.slice(i);W(c,(function(t){return uh.remove(r,t)})),W(u,(function(t){return uh.append(r,t)}));var s=uh.contents(r);W(s,(function(r,o){t.setupItem(e,r,n[o],o)}))}))}}}},apis:{setItems:function(t,e,n){t.setItems(e,n)}}}),lz=v([Yr("dom"),mo("shell",!0),zf("toolbarBehaviours",[uh])]),fz=v([id({name:"groups",overrides:function(){return{behaviours:wc([uh.config({})])}}})]),dz=Ad({name:"Toolbar",configFields:lz(),partFields:fz(),factory:function(t,e,n,r){var o=function(e){return t.shell?B.some(e):vd(e,t,"groups")},i=t.shell?{behaviours:[uh.config({})],components:[]}:{behaviours:[],components:e};return{uid:t.uid,dom:t.dom,components:i.components,behaviours:Mf(t.toolbarBehaviours,i.behaviours),apis:{setGroups:function(t,e){o(t).fold((function(){throw console.error("Toolbar was defined to not be a shell, but no groups container was specified in components"),new Error("Toolbar was defined to not be a shell, but no groups container was specified in components")}),(function(t){uh.set(t,e)}))}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,e,n){t.setGroups(e,n)}}}),mz=h,gz=S,hz=v([]),pz=Object.freeze({__proto__:null,setup:mz,isDocked:gz,getBehaviours:hz}),vz=function(t){return(Ct(rn(t,"position"),"fixed")?B.none():Ee(t)).orThunk((function(){var e=Bt.fromTag("span");return Oe(t).bind((function(t){En(t,e);var n=Ee(e);return Mn(e),n}))}))},bz=function(t){return vz(t).map(pn).getOrThunk((function(){return gn(0,0)}))},yz=So([{static:[]},{absolute:["positionCss"]},{fixed:["positionCss"]}]),xz=function(t,e){var n=t.element;Va(n,e.transitionClass),Ia(n,e.fadeOutClass),Va(n,e.fadeInClass),e.onShow(t)},wz=function(t,e){var n=t.element;Va(n,e.transitionClass),Ia(n,e.fadeInClass),Va(n,e.fadeOutClass),e.onHide(t)},Cz=function(t,e,n){return Z(t,(function(t){switch(t){case"bottom":return function(t,e){return t.bottom<=e.bottom}(e,n);case"top":return function(t,e){return t.y>=e.y}(e,n)}}))},Sz=function(t,e){return e.getInitialPos().map((function(e){return Pn(e.bounds.x,e.bounds.y,yn(t),fn(t))}))},kz=function(t,e,n){return n.getInitialPos().bind((function(r){switch(n.clearInitialPos(),r.position){case"static":return B.some(yz.static());case"absolute":var o=vz(t).map(In).getOrThunk((function(){return In(Fe())}));return B.some(yz.absolute(Rc("absolute",yt(r.style,"left").map((function(t){return e.x-o.x})),yt(r.style,"top").map((function(t){return e.y-o.y})),yt(r.style,"right").map((function(t){return o.right-e.right})),yt(r.style,"bottom").map((function(t){return o.bottom-e.bottom})))));default:return B.none()}}))},_z=function(t,e,n){var r=In(t);if(Cz(n.getModes(),r,e))return B.none();!function(t,e,n){n.setInitialPos({style:on(t),position:en(t,"position")||"static",bounds:e})}(t,r,n);var o=Un(),i=r.x-o.x,a=e.y-o.y,u=o.bottom-e.bottom,c=r.y<=e.y;return B.some(yz.fixed(Rc("fixed",B.some(i),c?B.some(a):B.none(),B.none(),c?B.none():B.some(u))))},Oz=function(t,e,n){var r=t.element;return Ct(rn(r,"position"),"fixed")?function(t,e,n){return Sz(t,n).filter((function(t){return Cz(n.getModes(),t,e)})).bind((function(e){return kz(t,e,n)}))}(r,e,n):_z(r,e,n)},Ez=function(t,e,n){n.setDocked(!1),W(["left","right","top","bottom","position"],(function(e){return un(t.element,e)})),e.onUndocked(t)},zz=function(t,e,n,r){var o="fixed"===r.position;n.setDocked(o),Hc(t.element,r),(o?e.onDocked:e.onUndocked)(t)},Tz=function(t,e,n,r,o){void 0===o&&(o=!1),e.contextual.each((function(e){e.lazyContext(t).each((function(i){var a=function(t,e){return t.ye.y}(i,r);a!==n.isVisible()&&(n.setVisible(a),o&&!a?(Ua(t.element,[e.fadeOutClass]),e.onHide(t)):(a?xz:wz)(t,e))}))}))},Mz=function(t,e,n){var r=t.element;n.setDocked(!1),function(t,e){var n=t.element;return Sz(n,e).bind((function(t){return kz(n,t,e)}))}(t,n).each((function(r){r.fold((function(){return Ez(t,e,n)}),(function(r){return zz(t,e,n,r)}),h)})),n.setVisible(!0),e.contextual.each((function(e){ja(r,[e.fadeInClass,e.fadeOutClass,e.transitionClass]),e.onShow(t)})),Dz(t,e,n)},Dz=function(t,e,n){t.getSystem().isConnected()&&function(t,e,n){var r=e.lazyViewport(t);n.isDocked()&&Tz(t,e,n,r),Oz(t,r,n).each((function(o){o.fold((function(){return Ez(t,e,n)}),(function(r){return zz(t,e,n,r)}),(function(o){Tz(t,e,n,r,!0),zz(t,e,n,o)}))}))}(t,e,n)},Az=function(t,e,n){n.isDocked()&&Mz(t,e,n)},Nz=Object.freeze({__proto__:null,refresh:Dz,reset:Az,isDocked:function(t,e,n){return n.isDocked()},getModes:function(t,e,n){return n.getModes()},setModes:function(t,e,n,r){return n.setModes(r)}}),Bz=Object.freeze({__proto__:null,events:function(t,e){return Hi([Gi(ti(),(function(n,r){t.contextual.each((function(t){Fa(n.element,t.transitionClass)&&(ja(n.element,[t.transitionClass,t.fadeInClass]),(e.isVisible()?t.onShown:t.onHidden)(n));r.stop()}))})),Pi(bi(),(function(n,r){Dz(n,t,e)})),Pi(yi(),(function(n,r){Az(n,t,e)}))])}}),Rz=[fo("contextual",[Zr("fadeInClass"),Zr("fadeOutClass"),Zr("transitionClass"),eo("lazyContext"),zu("onShow"),zu("onShown"),zu("onHide"),zu("onHidden")]),yo("lazyViewport",Un),xo("modes",["top","bottom"],Nr),zu("onDocked"),zu("onUndocked")],Hz=Sc({fields:Rz,name:"docking",active:Bz,apis:Nz,state:Object.freeze({__proto__:null,init:function(t){var e=Co(!1),n=Co(!0),r=ts(),o=Co(t.modes);return Ca({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:function(){return"docked: "+e.get()+", visible: "+n.get()+", modes: "+o.get().join(",")}})}})}),Lz=v(ia("toolbar-height-change")),Vz={fadeInClass:"tox-editor-dock-fadein",fadeOutClass:"tox-editor-dock-fadeout",transitionClass:"tox-editor-dock-transition"},Pz="tox-tinymce--toolbar-sticky-on",Iz="tox-tinymce--toolbar-sticky-off",Fz=function(t,e){return P(Hz.getModes(t),e)},Uz=function(t){var e=t.element;Oe(e).each((function(n){var r="padding-"+Hz.getModes(t)[0];if(Hz.isDocked(t)){var o=yn(n);Qe(e,"width",o+"px"),Qe(n,r,function(t){return dn(t)+(parseInt(en(t,"margin-top"),10)||0)+(parseInt(en(t,"margin-bottom"),10)||0)}(e)+"px")}else un(e,"width"),un(n,r)}))},jz=function(t,e){e?(Ia(t,Vz.fadeOutClass),Ua(t,[Vz.transitionClass,Vz.fadeInClass])):(Ia(t,Vz.fadeInClass),Ua(t,[Vz.fadeOutClass,Vz.transitionClass]))},Wz=function(t,e){var n=Bt.fromDom(t.getContainer());e?(Va(n,Pz),Ia(n,Iz)):(Va(n,Iz),Ia(n,Pz))},qz=function(t,e){var n=ts(),r=e.getSink,o=function(t){r().each((function(e){return t(e.element)}))},i=function(e){t.inline||Uz(e),Wz(t,Hz.isDocked(e)),e.getSystem().broadcastOn([sf()],{}),r().each((function(t){return t.getSystem().broadcastOn([sf()],{})}))},a=t.inline?[]:function(){var t;return[Ec.config({channels:(t={},t[Lz()]={onReceive:Uz},t)})]}();return z([mh.config({}),Hz.config({contextual:O({lazyContext:function(e){var n=dn(e.element),r=t.inline?t.getContentAreaContainer():t.getContainer(),o=In(Bt.fromDom(r)),i=o.height-n,a=o.y+(Fz(e,"top")?0:n);return B.some(Pn(o.x,a,o.width,i))},onShow:function(){o((function(t){return jz(t,!0)}))},onShown:function(t){o((function(t){return ja(t,[Vz.transitionClass,Vz.fadeInClass])})),n.get().each((function(e){var r,o,i;r=t.element,i=Ce(o=e),Ac(i).filter((function(t){return!ye(o,t)})).filter((function(t){return ye(t,Bt.fromDom(i.dom.body))||we(r,t)})).each((function(){return Mc(o)})),n.clear()}))},onHide:function(t){(function(t,e){return Nc(t).orThunk((function(){return e().toOptional().bind((function(t){return Nc(t.element)}))}))})(t.element,r).fold(n.clear,n.set),o((function(t){return jz(t,!1)}))},onHidden:function(){o((function(t){return ja(t,[Vz.transitionClass])}))}},Vz),lazyViewport:function(e){var n=Un(),r=function(t){return t.getParam("toolbar_sticky_offset",0,"number")}(t),o=n.y+(Fz(e,"top")?r:0),i=n.height-(Fz(e,"bottom")?r:0);return Pn(n.x,o,n.width,i)},modes:[e.header.getDockingMode()],onDocked:i,onUndocked:i})],a,!0)},Gz=Object.freeze({__proto__:null,setup:function(t,e,n){t.inline||(e.header.isPositionedAtTop()||t.on("ResizeEditor",(function(){n().each(Hz.reset)})),t.on("ResizeWindow ResizeEditor",(function(){n().each(Uz)})),t.on("SkinLoaded",(function(){n().each((function(t){Hz.isDocked(t)?Hz.reset(t):Hz.refresh(t)}))})),t.on("FullscreenStateChanged",(function(){n().each(Hz.reset)}))),t.on("AfterScrollIntoView",(function(t){n().each((function(e){Hz.refresh(e);var n=e.element;Ym(n)&&function(t,e){var n=Ce(e),r=n.dom.defaultView.innerHeight,o=An(n),i=Bt.fromDom(t.elm),a=Fn(i),u=fn(i),c=a.y,s=c+u,l=pn(e),f=fn(e),d=l.top,m=d+f,g=Math.abs(d-o.top)<2,h=Math.abs(m-(o.top+r))<2;if(g&&cd){var p=c-r+u+f;Nn(o.left,p,n)}}(t,n)}))})),t.on("PostRender",(function(){Wz(t,!1)}))},isDocked:function(t){return t().map(Hz.isDocked).getOr(!1)},getBehaviours:qz}),$z=_r([Zr("type"),Jr("items",Er([Tr([Zr("name"),oo("items",Nr)]),Nr]))].concat(tv)),Xz=[co("text"),co("tooltip"),co("icon"),eo("fetch"),yo("onSetup",(function(){return h}))],Kz=_r(z([Zr("type")],Xz,!0)),Yz=function(t){return Ur("menubutton",Kz,t)},Jz=_r([Zr("type"),co("tooltip"),co("icon"),co("text"),so("select"),eo("fetch"),yo("onSetup",(function(){return h})),vo("presets","normal",["normal","color","listpreview"]),mo("columns",1),eo("onAction"),eo("onItemAction")]),Qz=Dd({factory:function(t,e){var n={focus:nh.focusIn,setMenus:function(t,n){var r=j(n,(function(t){var n={type:"menubutton",text:t.text,fetch:function(e){e(t.getItems())}},r=Yz(n).mapError((function(t){return qr(t)})).getOrDie();return U_(r,"tox-mbtn",e.backstage,B.some("menuitem"))}));uh.set(t,r)}};return{uid:t.uid,dom:t.dom,components:[],behaviours:wc([uh.config({}),ch("menubar-events",[$i((function(e){t.onSetup(e)})),Pi(qo(),(function(t,e){lu(t.element,".tox-mbtn--active").each((function(n){fu(e.event.target,".tox-mbtn").each((function(e){ye(n,e)||t.getSystem().getByDom(n).each((function(n){t.getSystem().getByDom(e).each((function(t){uC.expand(t),uC.close(n),mh.focus(t)}))}))}))}))})),Pi(ki(),(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){uC.isOpen(n)&&(uC.expand(t),uC.close(n))}))}))}))]),nh.config({mode:"flow",selector:".tox-mbtn",onEscape:function(e){return t.onEscape(e),B.some(!0)}}),tw.config({})]),apis:n,domModification:{attributes:{role:"menubar"}}}},name:"silver.Menubar",configFields:[Yr("dom"),Yr("uid"),Yr("onEscape"),Yr("backstage"),mo("onSetup",h)],apis:{focus:function(t,e){t.focus(e)},setMenus:function(t,e,n){t.setMenus(e,n)}}}),Zz=function(t,e){return e.getAnimationRoot.fold((function(){return t.element}),(function(e){return e(t)}))},tT=function(t){return t.dimension.property},eT=function(t,e){return t.dimension.getDimension(e)},nT=function(t,e){var n=Zz(t,e);ja(n,[e.shrinkingClass,e.growingClass])},rT=function(t,e){Ia(t.element,e.openClass),Va(t.element,e.closedClass),Qe(t.element,tT(e),"0px"),cn(t.element)},oT=function(t,e){Ia(t.element,e.closedClass),Va(t.element,e.openClass),un(t.element,tT(e))},iT=function(t,e,n,r){n.setCollapsed(),Qe(t.element,tT(e),eT(e,t.element)),cn(t.element),nT(t,e),rT(t,e),e.onStartShrink(t),e.onShrunk(t)},aT=function(t,e,n,r){var o=r.getOrThunk((function(){return eT(e,t.element)}));n.setCollapsed(),Qe(t.element,tT(e),o),cn(t.element);var i=Zz(t,e);Ia(i,e.growingClass),Va(i,e.shrinkingClass),rT(t,e),e.onStartShrink(t)},uT=function(t,e,n){var r=eT(e,t.element);("0px"===r?iT:aT)(t,e,n,B.some(r))},cT=function(t,e,n){var r=Zz(t,e),o=Fa(r,e.shrinkingClass),i=eT(e,t.element);oT(t,e);var a=eT(e,t.element);(o?function(){Qe(t.element,tT(e),i),cn(t.element)}:function(){rT(t,e)})(),Ia(r,e.shrinkingClass),Va(r,e.growingClass),oT(t,e),Qe(t.element,tT(e),a),n.setExpanded(),e.onStartGrow(t)},sT=function(t,e,n){var r=Zz(t,e);return!0===Fa(r,e.growingClass)},lT=function(t,e,n){var r=Zz(t,e);return!0===Fa(r,e.shrinkingClass)},fT=Object.freeze({__proto__:null,refresh:function(t,e,n){if(n.isExpanded()){un(t.element,tT(e));var r=eT(e,t.element);Qe(t.element,tT(e),r)}},grow:function(t,e,n){n.isExpanded()||cT(t,e,n)},shrink:function(t,e,n){n.isExpanded()&&uT(t,e,n)},immediateShrink:function(t,e,n){n.isExpanded()&&iT(t,e,n)},hasGrown:function(t,e,n){return n.isExpanded()},hasShrunk:function(t,e,n){return n.isCollapsed()},isGrowing:sT,isShrinking:lT,isTransitioning:function(t,e,n){return sT(t,e)||lT(t,e)},toggleGrow:function(t,e,n){(n.isExpanded()?uT:cT)(t,e,n)},disableTransitions:nT}),dT=Object.freeze({__proto__:null,exhibit:function(t,e,n){var r=e.expanded;return ka(r?{classes:[e.openClass],styles:{}}:{classes:[e.closedClass],styles:Oo(e.dimension.property,"0px")})},events:function(t,e){return Hi([Gi(ti(),(function(n,r){r.event.raw.propertyName===t.dimension.property&&(nT(n,t),e.isExpanded()&&un(n.element,t.dimension.property),(e.isExpanded()?t.onGrown:t.onShrunk)(n))}))])}}),mT=[Yr("closedClass"),Yr("openClass"),Yr("shrinkingClass"),Yr("growingClass"),io("getAnimationRoot"),zu("onShrunk"),zu("onStartShrink"),zu("onGrown"),zu("onStartGrow"),mo("expanded",!1),Jr("dimension",Gr("property",{width:[Au("property","width"),Au("getDimension",(function(t){return yn(t)+"px"}))],height:[Au("property","height"),Au("getDimension",(function(t){return fn(t)+"px"}))]}))],gT=Sc({fields:mT,name:"sliding",active:dT,apis:fT,state:Object.freeze({__proto__:null,init:function(t){var e=Co(t.expanded);return Ca({isExpanded:function(){return!0===e.get()},isCollapsed:function(){return!1===e.get()},setCollapsed:x(e.set,!1),setExpanded:x(e.set,!0),readState:function(){return"expanded: "+e.get()}})}})}),hT="container",pT=[zf("slotBehaviours",[])],vT=function(t){return""},bT=function(t,e){var n,r=function(e){return wd(t)},o=function(e,n){return function(r,o){return vd(r,t,o).map((function(t){return e(t,o)})).getOr(n)}},i=function(t,e){return"true"!==Ge(t.element,"aria-hidden")},a=o(i,!1),u=o((function(t,e){if(i(t)){var n=t.element;Qe(n,"display","none"),We(n,"aria-hidden","true"),Di(t,_i(),{name:e,visible:!1})}})),c=(n=u,function(t,e){W(e,(function(e){return n(t,e)}))}),s=o((function(t,e){if(!i(t)){var n=t.element;un(n,"display"),Ke(n,"aria-hidden"),Di(t,_i(),{name:e,visible:!0})}})),l={getSlotNames:r,getSlot:function(e,n){return vd(e,t,n)},isShowing:a,hideSlot:u,hideAllSlots:function(t){return c(t,r())},showSlot:s};return{uid:t.uid,dom:t.dom,components:e,behaviours:Tf(t.slotBehaviours),apis:l}},yT=mt({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 xa(t)})),xT=O(O({},yT),{sketch:function(t){var e=function(){var t=[];return{slot:function(e,n){return t.push(e),dd(hT,vT(e),n)},record:v(t)}}(),n=t(e),r=e.record(),o=j(r,(function(t){return rd({name:t,pname:vT(t)})}));return Ed(hT,pT,o,bT,n)}}),wT=_r([co("icon"),co("tooltip"),yo("onShow",h),yo("onHide",h),yo("onSetup",(function(){return h}))]),CT=function(t){return{element:function(){return t.element.dom}}},ST=function(t,e){var n=j(lt(e),(function(t){var n=e[t],r=jr(function(t){return Ur("sidebar",wT,t)}(n));return{name:t,getApi:CT,onSetup:r.onSetup,onShow:r.onShow,onHide:r.onHide}}));return j(n,(function(e){var r=Co(h);return t.slot(e.name,{dom:{tag:"div",classes:["tox-sidebar__pane"]},behaviours:ab([Qb(e,r),Zb(e,r),Pi(_i(),(function(t,e){var r=e.event;K(n,(function(t){return t.name===r.name})).each((function(e){(r.visible?e.onShow:e.onHide)(e.getApi(t))}))}))])})}))},kT=function(t){return xT.sketch((function(e){return{dom:{tag:"div",classes:["tox-sidebar__pane-container"]},components:ST(e,t),slotBehaviours:ab([$i((function(t){return xT.hideAllSlots(t)}))])}}))},_T=function(t){return Hd.getCurrent(t).bind((function(t){return gT.isGrowing(t)||gT.hasGrown(t)?Hd.getCurrent(t).bind((function(t){return K(xT.getSlotNames(t),(function(e){return xT.isShowing(t,e)}))})):B.none()}))},OT=ia("FixSizeEvent"),ET=ia("AutoSizeEvent"),zT=Object.freeze({__proto__:null,block:function(t,e,n,r){We(t.element,"aria-busy",!0);var o=e.getRoot(t).getOr(t),i=wc([nh.config({mode:"special",onTab:function(){return B.some(!0)},onShiftTab:function(){return B.some(!0)}}),mh.config({})]),a=r(o,i),u=o.getSystem().build(a);uh.append(o,nu(u)),u.hasConfigured(nh)&&e.focus&&nh.focusIn(u),n.isBlocked()||e.onBlock(t),n.blockWith((function(){return uh.remove(o,u)}))},unblock:function(t,e,n){Ke(t.element,"aria-busy"),n.isBlocked()&&e.onUnblock(t),n.clear()}}),TT=[yo("getRoot",B.none),bo("focus",!0),zu("onBlock"),zu("onUnblock")],MT=Sc({fields:TT,name:"blocking",apis:zT,state:Object.freeze({__proto__:null,init:function(){var t=Qc();return Ca({readState:t.isSet,blockWith:function(e){t.set({destroy:e})},clear:t.clear,isBlocked:t.isSet})}})}),DT=function(t){var e=Bt.fromHtml(t),n=ze(e),r=function(t){var e=void 0!==t.dom.attributes?t.dom.attributes:[];return X(e,(function(t,e){var n;return"class"===e.name?t:O(O({},t),((n={})[e.name]=e.value,n))}),{})}(e),o=function(t){return Array.prototype.slice.call(t.dom.classList,0)}(e),i=0===n.length?{}:{innerHtml:Ji(e)};return O({tag:Ht(e),classes:o,attributes:r},i)},AT=function(t){return Hd.getCurrent(t).each((function(t){return Mc(t.element)}))},NT=function(t,e,n,r){var o=e.element;if(function(t,e){var n="tabindex",r="data-mce-tabindex";B.from(t.iframeElement).map(Bt.fromDom).each((function(t){e?($e(t,n).each((function(e){return We(t,r,e)})),We(t,n,-1)):(Ke(t,n),$e(t,r).each((function(e){We(t,n,e),Ke(t,r)})))}))}(t,n),n)MT.block(e,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:DT('
')}]}}}(r)),un(o,"display"),Ke(o,"aria-hidden"),t.hasFocus()&&AT(e);else{var i=Hd.getCurrent(e).exists((function(t){return Dc(t.element)}));MT.unblock(e),Qe(o,"display","none"),We(o,"aria-hidden","true"),i&&t.focus()}},BT=function(t,e,n){var r=Co(!1),o=ts(),i=function(n){var o;!r.get()||function(t){return"focusin"===t.type}(o=n)&&(o.composed?at(o.composedPath()):B.from(o.target)).map(Bt.fromDom).filter(Vt).exists((function(t){return Fa(t,"mce-pastebin")}))||(n.preventDefault(),AT(e()),t.editorManager.setActive(t))};t.inline||t.on("PreInit",(function(){t.dom.bind(t.getWin(),"focusin",i),t.on("BeforeExecCommand",(function(t){"mcefocus"===t.command.toLowerCase()&&!0!==t.value&&i(t)}))}));var a=function(o){o!==r.get()&&(r.set(o),NT(t,e(),o,n.providers),t.fire("AfterProgressState",{state:o}))};t.on("ProgressState",(function(e){if(o.on(pp.clearTimeout),m(e.time)){var n=pp.setEditorTimeout(t,(function(){return a(e.state)}),e.time);o.set(n)}else a(e.state),o.clear()}))},RT=function(t,e,n){return{within:t,extra:e,withinWidth:n}},HT=function(t,e,n){var r,o=(r=function(t,e){var r=n(t);return B.some({element:t,start:e,finish:e+r,width:r})},X(t,(function(t,e){return r(e,t.len).fold(v(t),(function(e){return{len:e.finish,list:t.list.concat([e])}}))}),{len:0,list:[]}).list),i=G(o,(function(t){return t.finish<=e})),a=$(i,(function(t,e){return t+e.width}),0);return{within:i,extra:o.slice(i.length),withinWidth:a}},LT=function(t){return j(t,(function(t){return t.element}))},VT=function(t,e,n,r){var o=function(t,e,n){var r=HT(e,t,n);return 0===r.extra.length?B.some(r):B.none()}(t,e,n).getOrThunk((function(){return HT(e,t-n(r),n)})),i=o.within,a=o.extra,u=o.withinWidth;return 1===a.length&&a[0].width<=n(r)?function(t,e,n){var r=LT(t.concat(e));return RT(r,[],n)}(i,a,u):a.length>=1?function(t,e,n,r){var o=LT(t).concat([n]);return RT(o,LT(e),r)}(i,a,r,u):function(t,e,n){return RT(LT(t),[],n)}(i,0,u)},PT=function(t,e){var n=j(e,(function(t){return nu(t)}));dz.setGroups(t,n)},IT=function(t,e,n){var r=e.builtGroups.get();if(0!==r.length){var o=bd(t,e,"primary"),i=jw.getCoupled(t,"overflowGroup");Qe(o.element,"visibility","hidden");var a=r.concat([i]),u=st(a,(function(t){return Nc(t.element).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))}));n([]),PT(o,a);var c=yn(o.element),s=VT(c,e.builtGroups.get(),(function(t){return yn(t.element)}),i);0===s.extra.length?(uh.remove(o,i),n([])):(PT(o,s.within),n(s.extra)),un(o.element,"visibility"),cn(o.element),u.each(mh.focus)}},FT=v([zf("splitToolbarBehaviours",[jw]),Xr("builtGroups",(function(){return Co([])}))]),UT=v([Ou(["overflowToggledClass"]),so("getOverflowBounds"),Yr("lazySink"),Xr("overflowGroups",(function(){return Co([])}))].concat(FT())),jT=v([rd({factory:dz,schema:lz(),name:"primary"}),od({schema:lz(),name:"overflow"}),od({name:"overflow-button"}),od({name:"overflow-group"})]),WT=v((function(t,e){!function(t,e){var n=bn.max(t,e,["margin-left","border-left-width","padding-left","padding-right","border-right-width","margin-right"]);Qe(t,"max-width",n+"px")}(t,Math.floor(e))})),qT=v([Ou(["toggledClass"]),Yr("lazySink"),eo("fetch"),so("getBounds"),fo("fireDismissalEventInstead",[mo("event",Ci())]),Os()]),GT=v([od({name:"button",overrides:function(t){return{dom:{attributes:{"aria-haspopup":"true"}},buttonBehaviours:wc([_h.config({toggleClass:t.markers.toggledClass,aria:{mode:"expanded"},toggleOnExecute:!1})])}}}),od({factory:dz,schema:lz(),name:"toolbar",overrides:function(t){return{toolbarBehaviours:wc([nh.config({mode:"cyclic",onEscape:function(e){return vd(e,t,"button").each(mh.focus),B.none()}})])}}})]),$T=function(t,e){var n=jw.getCoupled(t,"toolbarSandbox");uf.isOpen(n)?uf.close(n):uf.open(n,e.toolbar())},XT=function(t,e,n,r){var o=n.getBounds.map((function(t){return t()})),i=n.lazySink(t).getOrDie();Vl.positionWithinBounds(i,e,{anchor:{type:"hotspot",hotspot:t,layouts:r,overrides:{maxWidthFunction:WT()}}},o)},KT=function(t,e,n,r,o){dz.setGroups(e,o),XT(t,e,n,r),_h.on(t)},YT=Ad({name:"FloatingToolbarButton",factory:function(t,e,n,r){return O(O({},vp.sketch(O(O({},r.button()),{action:function(t){$T(t,r)},buttonBehaviours:Af({dump:r.button().buttonBehaviours},[jw.config({others:{toolbarSandbox:function(e){return function(t,e,n){var r=du();return{dom:{tag:"div",attributes:{id:r.id}},behaviours:wc([nh.config({mode:"special",onEscape:function(t){return uf.close(t),B.some(!0)}}),uf.config({onOpen:function(o,i){n.fetch().get((function(o){KT(t,i,n,e.layouts,o),r.link(t.element),nh.focusIn(i)}))},onClose:function(){_h.off(t),mh.focus(t),r.unlink(t.element)},isPartOf:function(e,n,r){return gu(n,r)||gu(t,r)},getAttachPoint:function(){return n.lazySink(t).getOrDie()}}),Ec.config({channels:O(O({},df(O({isExtraPart:S},n.fireDismissalEventInstead.map((function(t){return{fireEventInstead:{event:t.event}}})).getOr({})))),gf({doReposition:function(){uf.getState(jw.getCoupled(t,"toolbarSandbox")).each((function(r){XT(t,r,n,e.layouts)}))}}))})])}}(e,n,t)}}})])}))),{apis:{setGroups:function(e,r){uf.getState(jw.getCoupled(e,"toolbarSandbox")).each((function(o){KT(e,o,t,n.layouts,r)}))},reposition:function(e){uf.getState(jw.getCoupled(e,"toolbarSandbox")).each((function(r){XT(e,r,t,n.layouts)}))},toggle:function(t){$T(t,r)},getToolbar:function(t){return uf.getState(jw.getCoupled(t,"toolbarSandbox"))},isOpen:function(t){return uf.isOpen(jw.getCoupled(t,"toolbarSandbox"))}}})},configFields:qT(),partFields:GT(),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)}}}),JT=v([Yr("items"),Ou(["itemSelector"]),zf("tgroupBehaviours",[nh])]),QT=v([ad({name:"items",unit:"item"})]),ZT=Ad({name:"ToolbarGroup",configFields:JT(),partFields:QT(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,behaviours:Mf(t.tgroupBehaviours,[nh.config({mode:"flow",selector:t.markers.itemSelector})]),domModification:{attributes:{role:"toolbar"}}}}}),tM=function(t){return j(t,(function(t){return nu(t)}))},eM=function(t,e,n){IT(t,n,(function(r){n.overflowGroups.set(r),e.getOpt(t).each((function(t){YT.setGroups(t,tM(r))}))}))},nM=Ad({name:"SplitFloatingToolbar",configFields:UT(),partFields:jT(),factory:function(t,e,n,r){var o=bp(YT.sketch({fetch:function(){return Tw((function(e){e(tM(t.overflowGroups.get()))}))},layouts:{onLtr:function(){return[nc,ec]},onRtl:function(){return[ec,nc]},onBottomLtr:function(){return[oc,rc]},onBottomRtl:function(){return[rc,oc]}},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:Mf(t.splitToolbarBehaviours,[jw.config({others:{overflowGroup:function(){return ZT.sketch(O(O({},r["overflow-group"]()),{items:[o.asSpec()]}))}}})]),apis:{setGroups:function(e,n){t.builtGroups.set(j(n,e.getSystem().build)),eM(e,o,t)},refresh:function(e){return eM(e,o,t)},toggle:function(t){o.getOpt(t).each((function(t){YT.toggle(t)}))},isOpen:function(t){return o.getOpt(t).map(YT.isOpen).getOr(!1)},reposition:function(t){o.getOpt(t).each((function(t){YT.reposition(t)}))},getOverflow:function(t){return o.getOpt(t).bind(YT.getToolbar)}},domModification:{attributes:{role:"group"}}}},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)}}}),rM=v([Ou(["closedClass","openClass","shrinkingClass","growingClass","overflowToggledClass"]),zu("onOpened"),zu("onClosed")].concat(FT())),oM=v([rd({factory:dz,schema:lz(),name:"primary"}),rd({factory:dz,schema:lz(),name:"overflow",overrides:function(t){return{toolbarBehaviours:wc([gT.config({dimension:{property:"height"},closedClass:t.markers.closedClass,openClass:t.markers.openClass,shrinkingClass:t.markers.shrinkingClass,growingClass:t.markers.growingClass,onShrunk:function(e){vd(e,t,"overflow-button").each((function(t){_h.off(t),mh.focus(t)})),t.onClosed(e)},onGrown:function(e){nh.focusIn(e),t.onOpened(e)},onStartGrow:function(e){vd(e,t,"overflow-button").each(_h.on)}}),nh.config({mode:"acyclic",onEscape:function(e){return vd(e,t,"overflow-button").each(mh.focus),B.some(!0)}})])}}}),od({name:"overflow-button",overrides:function(t){return{buttonBehaviours:wc([_h.config({toggleClass:t.markers.overflowToggledClass,aria:{mode:"pressed"},toggleOnExecute:!1})])}}}),od({name:"overflow-group"})]),iM=function(t,e){vd(t,e,"overflow-button").bind((function(){return vd(t,e,"overflow")})).each((function(n){aM(t,e),gT.toggleGrow(n)}))},aM=function(t,e){vd(t,e,"overflow").each((function(n){IT(t,e,(function(t){var e=j(t,(function(t){return nu(t)}));dz.setGroups(n,e)})),vd(t,e,"overflow-button").each((function(t){gT.hasGrown(n)&&_h.on(t)})),gT.refresh(n)}))},uM=Ad({name:"SplitSlidingToolbar",configFields:rM(),partFields:oM(),factory:function(t,e,n,r){var o="alloy.toolbar.toggle";return{uid:t.uid,dom:t.dom,components:e,behaviours:Mf(t.splitToolbarBehaviours,[jw.config({others:{overflowGroup:function(t){return ZT.sketch(O(O({},r["overflow-group"]()),{items:[vp.sketch(O(O({},r["overflow-button"]()),{action:function(e){Mi(t,o)}}))]}))}}}),ch("toolbar-toggle-events",[Pi(o,(function(e){iM(e,t)}))])]),apis:{setGroups:function(e,n){!function(e,n){var r=j(n,e.getSystem().build);t.builtGroups.set(r)}(e,n),aM(e,t)},refresh:function(e){return aM(e,t)},toggle:function(e){return iM(e,t)},isOpen:function(e){return function(t,e){return vd(t,e,"overflow").map(gT.hasGrown).getOr(!1)}(e,t)}},domModification:{attributes:{role:"group"}}}},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)}}}),cM=function(t){var e=t.title.fold((function(){return{}}),(function(t){return{attributes:{title:t}}}));return{dom:O({tag:"div",classes:["tox-toolbar__group"]},e),components:[ZT.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:wc([tw.config({}),mh.config({})])}},sM=function(t){return ZT.sketch(cM(t))},lM=function(t,e){var n=$i((function(e){var n=j(t.initGroups,sM);dz.setGroups(e,n)}));return wc([Yb(t.providers.isDisabled),Gb(),nh.config({mode:e,onEscape:t.onEscape,selector:".tox-toolbar__group"}),ch("toolbar-events",[n])])},fM=function(t){var e=t.cyclicKeying?"cyclic":"acyclic";return{uid:t.uid,dom:{tag:"div",classes:["tox-toolbar-overlord"]},parts:{"overflow-group":cM({title:B.none(),items:[]}),"overflow-button":q_({name:"more",icon:B.some("more-drawer"),disabled:!1,tooltip:B.some("More..."),primary:!1,borderless:!1},B.none(),t.providers)},splitToolbarBehaviours:lM(t,e)}},dM=function(t){var e=fM(t),n=nM.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}});return nM.sketch(O(O({},e),{lazySink:t.getSink,getOverflowBounds:function(){var e=t.moreDrawerData.lazyHeader().element,n=Fn(e),r=ke(e),o=Fn(r),i=Math.max(r.dom.scrollHeight,o.height);return Pn(n.x+4,o.y,n.width-8,i)},parts:O(O({},e.parts),{overflow:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:t.attributes}}}),components:[n],markers:{overflowToggledClass:"tox-tbtn--enabled"}}))},mM=function(t){var e=uM.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}}),n=uM.parts.overflow({dom:{tag:"div",classes:["tox-toolbar__overflow"]}}),r=fM(t);return uM.sketch(O(O({},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([Lz()],{type:"opened"})},onClosed:function(t){t.getSystem().broadcastOn([Lz()],{type:"closed"})}}))},gM=function(t){var e=t.cyclicKeying?"cyclic":"acyclic";return dz.sketch({uid:t.uid,dom:{tag:"div",classes:["tox-toolbar"].concat(t.type===hv.scrolling?["tox-toolbar--scrolling"]:[])},components:[dz.parts.groups({})],toolbarBehaviours:lM(t,e)})},hM=oz.optional({factory:Qz,name:"menubar",schema:[Yr("backstage")]}),pM=oz.optional({factory:{sketch:function(t){return sz.sketch({uid:t.uid,dom:t.dom,listBehaviours:wc([nh.config({mode:"acyclic",selector:".tox-toolbar"})]),makeItem:function(){return gM({type:t.type,uid:ia("multiple-toolbar-item"),cyclicKeying:!1,initGroups:[],providers:t.providers,onEscape:function(){return t.onEscape(),B.some(!0)}})},setupItem:function(t,e,n,r){dz.setGroups(e,n)},shell:!0})}},name:"multiple-toolbar",schema:[Yr("dom"),Yr("onEscape")]}),vM=oz.optional({factory:{sketch:function(t){return function(t){return t.type===hv.sliding?mM:t.type===hv.floating?dM:gM}(t)({type:t.type,uid:t.uid,onEscape:function(){return t.onEscape(),B.some(!0)},cyclicKeying:!1,initGroups:[],getSink:t.getSink,providers:t.providers,moreDrawerData:{lazyToolbar:t.lazyToolbar,lazyMoreButton:t.lazyMoreButton,lazyHeader:t.lazyHeader},attributes:t.attributes})}},name:"toolbar",schema:[Yr("dom"),Yr("onEscape"),Yr("getSink")]}),bM=oz.optional({factory:{sketch:function(t){var e=t.editor,n=t.sticky?qz:hz;return{uid:t.uid,dom:t.dom,components:t.components,behaviours:wc(n(e,t.sharedBackstage))}}},name:"header",schema:[Yr("dom")]}),yM=oz.optional({name:"socket",schema:[Yr("dom")]}),xM=oz.optional({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-sidebar"],attributes:{role:"complementary"}},components:[{dom:{tag:"div",classes:["tox-sidebar__slider"]},components:[],behaviours:wc([tw.config({}),mh.config({}),gT.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){Hd.getCurrent(t).each(xT.hideAllSlots),Mi(t,ET)},onGrown:function(t){Mi(t,ET)},onStartGrow:function(t){Di(t,OT,{width:rn(t.element,"width").getOr("")})},onStartShrink:function(t){Di(t,OT,{width:yn(t.element)+"px"})}}),uh.config({}),Hd.config({find:function(t){var e=uh.contents(t);return at(e)}})])}],behaviours:wc([vk(0),ch("sidebar-sliding-events",[Pi(OT,(function(t,e){Qe(t.element,"width",e.event.width)})),Pi(ET,(function(t,e){un(t.element,"width")}))])])}}},name:"sidebar",schema:[Yr("dom")]}),wM=oz.optional({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",attributes:{"aria-hidden":"true"},classes:["tox-throbber"],styles:{display:"none"}},behaviours:wc([uh.config({}),MT.config({focus:!1}),Hd.config({find:function(t){return at(t.components())}})]),components:[]}}},name:"throbber",schema:[Yr("dom")]}),CM=Ad({name:"OuterContainer",factory:function(t,e,n){var r={getSocket:function(e){return rz.getPart(e,t,"socket")},setSidebar:function(e,n){rz.getPart(e,t,"sidebar").each((function(t){return function(t,e){Hd.getCurrent(t).each((function(t){return uh.set(t,[kT(e)])}))}(t,n)}))},toggleSidebar:function(e,n){rz.getPart(e,t,"sidebar").each((function(t){return function(t,e){Hd.getCurrent(t).each((function(t){Hd.getCurrent(t).each((function(n){gT.hasGrown(t)?xT.isShowing(n,e)?gT.shrink(t):(xT.hideAllSlots(n),xT.showSlot(n,e)):(xT.hideAllSlots(n),xT.showSlot(n,e),gT.grow(t))}))}))}(t,n)}))},whichSidebar:function(e){return rz.getPart(e,t,"sidebar").bind(_T).getOrNull()},getHeader:function(e){return rz.getPart(e,t,"header")},getToolbar:function(e){return rz.getPart(e,t,"toolbar")},setToolbar:function(e,n){rz.getPart(e,t,"toolbar").each((function(t){t.getApis().setGroups(t,n)}))},setToolbars:function(e,n){rz.getPart(e,t,"multiple-toolbar").each((function(t){sz.setItems(t,n)}))},refreshToolbar:function(e){rz.getPart(e,t,"toolbar").each((function(t){return t.getApis().refresh(t)}))},toggleToolbarDrawer:function(e){rz.getPart(e,t,"toolbar").each((function(t){var e,n;e=t.getApis().toggle,n=function(e){return e(t)},null!=e?B.some(n(e)):B.none()}))},isToolbarDrawerToggled:function(e){return rz.getPart(e,t,"toolbar").bind((function(t){return B.from(t.getApis().isOpen).map((function(e){return e(t)}))})).getOr(!1)},getThrobber:function(e){return rz.getPart(e,t,"throbber")},focusToolbar:function(e){rz.getPart(e,t,"toolbar").orThunk((function(){return rz.getPart(e,t,"multiple-toolbar")})).each((function(t){nh.focusIn(t)}))},setMenubar:function(e,n){rz.getPart(e,t,"menubar").each((function(t){Qz.setMenus(t,n)}))},focusMenubar:function(e){rz.getPart(e,t,"menubar").each((function(t){Qz.focus(t)}))}};return{uid:t.uid,dom:t.dom,components:e,apis:r,behaviours:t.behaviours}},configFields:[Yr("dom"),Yr("behaviours")],partFields:[bM,hM,vM,pM,yM,xM,wM],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=j(n,(function(t){return sM(t)}));t.setToolbar(e,r)},setToolbars:function(t,e,n){var r=j(n,(function(t){return j(t,sM)}));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)}}}),SM={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"}},kM=function(t){return"string"==typeof t?t.split(" "):t},_M=function(t,e){var n=O(O({},SM),e.menus),r=lt(e.menus).length>0,o=void 0===e.menubar||!0===e.menubar?kM("file edit view insert format tools table help"):kM(!1===e.menubar?"":e.menubar),i=G(o,(function(t){var n=xt(SM,t);return r?n||yt(e.menus,t).exists((function(t){return xt(t,"items")})):n})),a=j(i,(function(r){var o=n[r];return function(t,e,n){var r=function(t){return t.getParam("removed_menuitems","")}(n).split(/[ ,]/);return{text:t.title,getItems:function(){return Q(t.items,(function(t){var n=t.toLowerCase();return 0===n.trim().length||I(r,(function(t){return t===n}))?[]:"separator"===n||"|"===n?[{type:"separator"}]:e.menuItems[n]?[e.menuItems[n]]:[]}))}}}({title:o.title,items:kM(o.items)},e,t)}));return G(a,(function(t){return t.getItems().length>0&&I(t.getItems(),(function(t){return"separator"!==t.type}))}))},OM=function(t){var e=function(){t._skinLoaded=!0,function(t){t.fire("SkinLoaded")}(t)};return function(){t.initialized?e():t.on("init",e)}},EM=function(t,e,n){return new Wp((function(r,o){n.load(e,r,o),t.on("remove",(function(){return n.unload(e)}))}))},zM=function(t,e){return EM(t,e+"/skin.min.css",t.ui.styleSheetLoader)},TM=function(t,e){var n;return(n=Bt.fromDom(t.getElement()),Le(n).isSome())?EM(t,e+"/skin.shadowdom.min.css",hb.DOM.styleSheetLoader):Wp.resolve()},MM=function(t,e){var n=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):pb.baseURL+"/skins/ui/"+r}return n}(e);n&&e.contentCSS.push(n+(t?"/content.inline":"/content")+".min.css"),!1===function(t){return!1===t.getParam("skin")}(e)&&o(n)?Wp.all([zM(e,n),TM(e,n)]).then(OM(e),function(t,e){return function(){return function(t,e){return t.fire("SkinLoadError",e)}(t,{message:e})}}(e,"Skin could not be loaded")):OM(e)()},DM=x(MM,!1),AM=x(MM,!0),NM=function(t,e){return function(n){var r=Zc(),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()}}},BM=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)}}},RM=function(t){return function(e){return function(){t.undoManager.transact((function(){t.focus(),t.execCommand("mceToggleFormat",!1,e.format)}))}}},HM=function(t,e){return function(){return t.execCommand(e)}},LM=function(t,e,n){var r=function(t,r,i,a){var u=e.shared.providers.translate(t.title);if("separator"===t.type)return B.some({type:"separator",text:u});if("submenu"===t.type){var c=Q(t.getStyleItems(),(function(t){return o(t,r,a)}));return 0===r&&c.length<=0?B.none():B.some({type:"nestedmenuitem",text:u,disabled:c.length<=0,getSubmenuItems:function(){return Q(t.getStyleItems(),(function(t){return o(t,r,a)}))}})}return B.some(O({type:"togglemenuitem",text:u,icon:t.icon,active:t.isSelected(a),disabled:i,onAction:n.onAction(t)},t.getStylePreview().fold((function(){return{}}),(function(t){return{meta:{style:t}}}))))},o=function(t,e,o){var i="formatter"===t.type&&n.isInvalid(t);return 0===e?i?[]:r(t,e,!1,o).toArray():r(t,e,i,o).toArray()},i=function(t){var e=n.getCurrentValue(),r=n.shouldHide?0:1;return Q(t,(function(t){return o(t,r,e)}))};return{validateItems:i,getFetch:function(t,e){return function(n,r){var o=e(),a=i(o);r(I_(a,pv.CLOSE_ON_EXECUTE,t,!1))}}}},VM=function(t,e,n){var r=n.dataset,o="basic"===r.type?function(){return j(r.data,(function(t){return OE(t,n.isSelectedFor,n.getPreviewFor)}))}:r.getData;return{items:LM(0,e,n),getStyleItems:o}},PM=function(t,e,n){var r=VM(0,e,n),o=r.items,i=r.getStyleItems,a=BM(t,"NodeChange",(function(t){var e=t.getComponent();n.updateText(e)}));return B_({text:n.icon.isSome()?B.none():n.text,icon:n.icon,tooltip:B.from(n.tooltip),role:B.none(),fetch:o.getFetch(e,i),onSetup:a,getApi:function(t){return{getComponent:v(t)}},columns:1,presets:"normal",classes:n.icon.isSome()?[]:["bespoke"],dropdownBehaviours:[]},"tox-tbtn",e.shared)};!function(t){t[t.SemiColon=0]="SemiColon",t[t.Space=1]="Space"}(SO||(SO={}));var IM,FM,UM,jM,WM,qM=function(t,e,n,r){return{type:"basic",data:function(t){return j(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}}))}(function(t,e){return e===SO.SemiColon?t.replace(/;$/,"").split(";"):t.split(" ")}(t.getParam(e,n,"string"),r))}},GM=[{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"}],$M=function(t){var e={type:"basic",data:GM};return{tooltip:"Align",text:B.none(),icon:B.some("align-left"),isSelectedFor:function(e){return function(){return t.formatter.match(e)}},getCurrentValue:B.none,getPreviewFor:function(t){return B.none},onAction:function(e){return function(){return K(GM,(function(t){return t.format===e.format})).each((function(e){return t.execCommand(e.command)}))}},updateText:function(e){var n=K(GM,(function(e){return t.formatter.match(e.format)})).fold(v("left"),(function(t){return t.title.toLowerCase()}));Di(e,N_,{icon:"align-"+n})},dataset:e,shouldHide:!1,isInvalid:function(e){return!t.formatter.canApply(e.format)}}},XM=["-apple-system","Segoe UI","Roboto","Helvetica Neue","sans-serif"],KM=function(t){var e=t.split(/\s*,\s*/);return j(e,(function(t){return t.replace(/^['"]+|['"]+$/g,"")}))},YM=function(t){var e="System Font",n=function(){var n=function(t){return t?KM(t)[0]:""},o=t.queryCommandValue("FontName"),i=r.data,a=o?o.toLowerCase():"";return{matchOpt:K(i,(function(t){var e=t.format;return e.toLowerCase()===a||n(e).toLowerCase()===n(a).toLowerCase()})).orThunk((function(){return _t(function(t){var e;return 0===t.indexOf("-apple-system")&&(e=KM(t.toLowerCase()),Z(XM,(function(t){return e.indexOf(t.toLowerCase())>-1})))}(a),{title:e,format:a})})),font:o}},r=qM(t,"font_formats","Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats",SO.SemiColon);return{tooltip:"Fonts",text:B.some(e),icon:B.none(),isSelectedFor:function(t){return function(e){return e.exists((function(e){return e.format===t}))}},getCurrentValue:function(){return n().matchOpt},getPreviewFor:function(t){return function(){return B.some({tag:"div",styles:-1===t.indexOf("dings")?{"font-family":t}:{}})}},onAction:function(e){return function(){t.undoManager.transact((function(){t.focus(),t.execCommand("FontName",!1,e.format)}))}},updateText:function(t){var e=n(),r=e.matchOpt,o=e.font,i=r.fold(v(o),(function(t){return t.title}));Di(t,A_,{text:i})},dataset:r,shouldHide:!1,isInvalid:S}},JM={"8pt":"1","10pt":"2","12pt":"3","14pt":"4","18pt":"5","24pt":"6","36pt":"7"},QM={"xx-small":"7pt","x-small":"8pt",small:"10pt",medium:"12pt",large:"14pt","x-large":"18pt","xx-large":"24pt"},ZM=function(t,e){return/[0-9.]+px$/.test(t)?function(t,e){var n=Math.pow(10,e);return Math.round(t*n)/n}(72*parseInt(t,10)/96,e||0)+"pt":yt(QM,t).getOr(t)},tD=function(t){var e=function(){var e=B.none(),n=r.data,o=t.queryCommandValue("FontSize");if(o)for(var i=function(t){var r=ZM(o,t),i=function(t){return yt(JM,t).getOr("")}(r);e=K(n,(function(t){return t.format===o||t.format===r||t.format===i}))},a=3;e.isNone()&&a>=0;a--)i(a);return{matchOpt:e,size:o}},n=v(B.none),r=qM(t,"fontsize_formats","8pt 10pt 12pt 14pt 18pt 24pt 36pt",SO.Space);return{tooltip:"Font sizes",text:B.some("12pt"),icon:B.none(),isSelectedFor:function(t){return function(e){return e.exists((function(e){return e.format===t}))}},getPreviewFor:n,getCurrentValue:function(){return e().matchOpt},onAction:function(e){return function(){t.undoManager.transact((function(){t.focus(),t.execCommand("FontSize",!1,e.format)}))}},updateText:function(t){var n=e(),r=n.matchOpt,o=n.size,i=r.fold(v(o),(function(t){return t.title}));Di(t,A_,{text:i})},dataset:r,shouldHide:!1,isInvalid:S}},eD=function(t,e){var n=e(),r=j(n,(function(t){return t.format}));return B.from(t.formatter.closest(r)).bind((function(t){return K(n,(function(e){return e.format===t}))})).orThunk((function(){return _t(t.formatter.match("p"),{title:"Paragraph",format:"p"})}))},nD=function(t){var e="Paragraph",n=qM(t,"block_formats","Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre",SO.SemiColon);return{tooltip:"Blocks",text:B.some(e),icon:B.none(),isSelectedFor:function(e){return function(){return t.formatter.match(e)}},getCurrentValue:B.none,getPreviewFor:function(e){return function(){var n=t.formatter.get(e);return B.some({tag:n.length>0&&(n[0].inline||n[0].block)||"div",styles:t.dom.parseStyle(t.formatter.getCssText(e))})}},onAction:RM(t),updateText:function(r){var o=eD(t,(function(){return n.data})).fold(v(e),(function(t){return t.title}));Di(r,A_,{text:o})},dataset:n,shouldHide:!1,isInvalid:function(e){return!t.formatter.canApply(e.format)}}},rD=function(t,e){var n="Paragraph";return{tooltip:"Formats",text:B.some(n),icon:B.none(),isSelectedFor:function(e){return function(){return t.formatter.match(e)}},getCurrentValue:B.none,getPreviewFor:function(e){return function(){var n=t.formatter.get(e);return void 0!==n?B.some({tag:n.length>0&&(n[0].inline||n[0].block)||"div",styles:t.dom.parseStyle(t.formatter.getCssText(e))}):B.none()}},onAction:RM(t),updateText:function(e){var r=function(t){var e=t.items;return void 0!==e&&e.length>0?Q(e,r):[{title:t.title,format:t.format}]},o=Q(_E(t),r),i=eD(t,v(o)).fold(v(n),(function(t){return t.title}));Di(e,A_,{text:i})},shouldHide:t.getParam("style_formats_autohide",!1,"boolean"),isInvalid:function(e){return!t.formatter.canApply(e.format)},dataset:e}},oD=Object.freeze({__proto__:null,events: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=j(o,n.getSystem().build);Ul(n,i)}))};return Hi([Pi(ci(),(function(e,r){var o=r;if(!o.universal){var i=t.channel;P(o.channels,i)&&n(e,o.data)}})),$i((function(e,r){t.initialData.each((function(t){n(e,t)}))}))])}}),iD=Object.freeze({__proto__:null,getState:function(t,e,n){return n}}),aD=[Yr("channel"),io("renderComponents"),io("updateState"),io("initialData")],uD=Object.freeze({__proto__:null,init:function(){var t=Co(B.none());return{readState:function(){return t.get().getOr("none")},get:t.get,set:t.set,clear:function(){return t.set(B.none())}}}}),cD=Sc({fields:aD,name:"reflecting",active:oD,apis:iD,state:uD}),sD=v([Yr("toggleClass"),Yr("fetch"),Mu("onExecute"),mo("getHotspot",B.some),mo("getAnchorOverrides",v({})),Os(),Mu("onItemExecute"),io("lazySink"),Yr("dom"),zu("onOpen"),zf("splitDropdownBehaviours",[jw,nh,mh]),mo("matchWidth",!1),mo("useMinWidth",!1),mo("eventOrder",{}),io("role")].concat(oC())),lD=rd({factory:vp,schema:[Yr("dom")],name:"arrow",defaults:function(){return{buttonBehaviours:wc([mh.revoke()])}},overrides:function(t){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(e){e.getSystem().getByUid(t.uid).each(Ai)},buttonBehaviours:wc([_h.config({toggleOnExecute:!1,toggleClass:t.toggleClass})])}}}),fD=rd({factory:vp,schema:[Yr("dom")],name:"button",defaults:function(){return{buttonBehaviours:wc([mh.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)}))}}}}),dD=v([lD,fD,id({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:t.text}}}},schema:[Yr("text")],name:"aria-descriptor"}),od({schema:[_u()],name:"menu",defaults:function(t){return{onExecute:function(e,n){e.getSystem().getByUid(t.uid).each((function(r){t.onItemExecute(r,e,n)}))}}}}),qw()]),mD=Ad({name:"SplitDropdown",configFields:sD(),partFields:dD(),factory:function(t,e,n,r){var o,i=function(t){Hd.getCurrent(t).each((function(t){um.highlightFirst(t),nh.focusIn(t)}))},a=function(e){Qw(t,b,e,r,i,Sw.HighlightFirst).get(h)},u=function(e){var n=bd(e,t,"button");return Ai(n),B.some(!0)},c=O(O({},Hi([$i((function(e,n){vd(e,t,"aria-descriptor").each((function(t){var n=ia("aria");We(t.element,"id",n),We(e.element,"aria-describedby",n)}))}))])),Eh(B.some(a))),s={repositionMenus:function(t){_h.isOn(t)&&rC(t)}};return{uid:t.uid,dom:t.dom,components:e,apis:s,eventOrder:O(O({},t.eventOrder),(o={},o[si()]=["disabling","toggling","alloy.base.behaviour"],o)),events:c,behaviours:Mf(t.splitDropdownBehaviours,[jw.config({others:{sandbox:function(e){var n=bd(e,t,"arrow");return nC(t,e,{onOpen:function(){_h.on(n),_h.on(e)},onClose:function(){_h.off(n),_h.off(e)}})}}}),nh.config({mode:"special",onSpace:u,onEnter:u,onDown:function(t){return a(t),B.some(!0)}}),mh.config({}),_h.config({toggleOnExecute:!1,aria:{mode:"expanded"}})]),domModification:{attributes:{role:t.role.getOr("button"),"aria-haspopup":!0}}}},apis:{repositionMenus:function(t,e){return t.repositionMenus(e)}}}),gD=function(t){return{isDisabled:function(){return Yd.isDisabled(t)},setDisabled:function(e){return Yd.set(t,e)}}},hD=function(t){return{setActive:function(e){_h.set(t,e)},isActive:function(){return _h.isOn(t)},isDisabled:function(){return Yd.isDisabled(t)},setDisabled:function(e){return Yd.set(t,e)}}},pD=function(t,e){return t.map((function(t){return{"aria-label":e.translate(t),title:e.translate(t)}})).getOr({})},vD=ia("focus-button"),bD=function(t,e,n,r,o,i){var a;return{dom:{tag:"button",classes:["tox-tbtn"].concat(e.isSome()?["tox-tbtn--select"]:[]),attributes:pD(n,i)},components:ny([t.map((function(t){return E_(t,i.icons)})),e.map((function(t){return T_(t,"tox-tbtn",i)}))]),eventOrder:(a={},a[Fo()]=["focusing","alloy.base.behaviour","common-button-display-events"],a),buttonBehaviours:wc([Yb(i.isDisabled),Gb(),ch("common-button-display-events",[Pi(Fo(),(function(t,e){e.event.prevent(),Mi(t,vD)}))])].concat(r.map((function(n){return cD.config({channel:n,initialData:{icon:t,text:e},renderComponents:function(t,e){return ny([t.icon.map((function(t){return E_(t,i.icons)})),t.text.map((function(t){return T_(t,"tox-tbtn",i)}))])}})})).toArray()).concat(o.getOr([])))}},yD=function(t,e,n){var r,o=Co(h),i=bD(t.icon,t.text,t.tooltip,B.none(),B.none(),n);return vp.sketch({dom:i.dom,components:i.components,eventOrder:D_,buttonBehaviours:wc([ch("toolbar-button-events",[(r={onAction:t.onAction,getApi:e.getApi},Yi((function(t,e){Jb(r,t)((function(e){Di(t,M_,{buttonApi:e}),r.onAction(e)}))}))),Qb(e,o),Zb(e,o)]),Yb((function(){return t.disabled||n.isDisabled()})),Gb()].concat(e.toolbarButtonBehaviours))})},xD=function(t,e,n){return yD(t,{toolbarButtonBehaviours:[].concat(n.length>0?[ch("toolbarButtonWith",n)]:[]),getApi:gD,onSetup:t.onSetup},e)},wD=function(t,e,n){return cr(yD(t,{toolbarButtonBehaviours:[uh.config({}),_h.config({toggleClass:"tox-tbtn--enabled",aria:{mode:"pressed"},toggleOnExecute:!1})].concat(n.length>0?[ch("toolbarToggleButtonWith",n)]:[]),getApi:hD,onSetup:t.onSetup},e))},CD=function(t,e,n){return function(r){return Tw((function(t){return e.fetch(t)})).map((function(o){return B.from(Dx(cr(fx(ia("menu-value"),o,(function(n){e.onItemAction(t(r),n)}),e.columns,e.presets,pv.CLOSE_ON_EXECUTE,e.select.getOr(S),n),{movement:mx(e.columns,e.presets),menuBehaviours:ab("auto"!==e.columns?[]:[$i((function(t,n){ob(t,4,zv(e.presets)).each((function(e){var n=e.numRows,r=e.numColumns;nh.setGridSize(t,n,r)}))}))])})))}))}},SD=[{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"]}],kD=function(t,e){return function(n,r,o){var i=t(n).mapError((function(t){return qr(t)})).getOrDie();return e(i,r,o)}},_D={button:kD(nv,(function(t,e){return n=t,r=e.backstage.shared.providers,xD(n,r,[]);var n,r})),togglebutton:kD(iv,(function(t,e){return n=t,r=e.backstage.shared.providers,wD(n,r,[]);var n,r})),menubutton:kD(Yz,(function(t,e){return U_(t,"tox-tbtn",e.backstage,B.none())})),splitbutton:kD((function(t){return Ur("SplitButton",Jz,t)}),(function(t,e){return function(t,e){var n,r=ia("channel-update-split-dropdown-display"),o=function(t){return{isDisabled:function(){return Yd.isDisabled(t)},setDisabled:function(e){return Yd.set(t,e)},setIconFill:function(e,n){lu(t.element,'svg path[id="'+e+'"], rect[id="'+e+'"]').each((function(t){We(t,"fill",n)}))},setIconStroke:function(e,n){lu(t.element,'svg path[id="'+e+'"], rect[id="'+e+'"]').each((function(t){We(t,"stroke",n)}))},setActive:function(e){We(t.element,"aria-pressed",e),lu(t.element,"span").each((function(n){t.getSystem().getByDom(n).each((function(t){return _h.set(t,e)}))}))},isActive:function(){return lu(t.element,"span").exists((function(e){return t.getSystem().getByDom(e).exists(_h.isOn)}))}}},i=Co(h),a={getApi:o,onSetup:t.onSetup};return mD.sketch({dom:{tag:"div",classes:["tox-split-button"],attributes:O({"aria-pressed":!1},pD(t.tooltip,e.providers))},onExecute:function(e){t.onAction(o(e))},onItemExecute:function(t,e,n){},splitDropdownBehaviours:wc([Kb(e.providers.isDisabled),Gb(),ch("split-dropdown-events",[Pi(vD,mh.focus),Qb(a,i),Zb(a,i)]),sC.config({})]),eventOrder:(n={},n[xi()]=["alloy.base.behaviour","split-dropdown-events"],n),toggleClass:"tox-tbtn--enabled",lazySink:e.getSink,fetch:CD(o,t,e.providers),parts:{menu:Bv(0,t.columns,t.presets)},components:[mD.parts.button(bD(t.icon,t.text,B.none(),B.some(r),B.some([_h.config({toggleClass:"tox-tbtn--enabled",toggleOnExecute:!1})]),e.providers)),mD.parts.arrow({dom:{tag:"button",classes:["tox-tbtn","tox-split-button__chevron"],innerHtml:_p("chevron-down",e.providers.icons)},buttonBehaviours:wc([Kb(e.providers.isDisabled),Gb(),Op()])}),mD.parts["aria-descriptor"]({text:e.providers.translate("To open the popup, press Shift+Enter")})]})}(t,e.backstage.shared)})),grouptoolbarbutton:kD((function(t){return Ur("GroupToolbarButton",$z,t)}),(function(t,e,n){var r,o=n.ui.registry.getAll().buttons,i=((r={})[ks]=e.backstage.shared.header.isPositionedAtTop()?jc.TopToBottom:jc.BottomToTop,r);switch(zb(n)){case hv.floating:return function(t,e,n,r){var o=e.shared;return YT.sketch({lazySink:o.getSink,fetch:function(){return Tw((function(e){e(j(n(t.items),sM))}))},markers:{toggledClass:"tox-tbtn--enabled"},parts:{button:bD(t.icon,t.text,t.tooltip,B.none(),B.none(),o.providers),toolbar:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:r}}}})}(t,e.backstage,(function(t){return TD(n,{buttons:o,toolbar:t,allowToolbarGroups:!1},e,B.none())}),i);default:throw new Error("Toolbar groups are only supported when using floating toolbar mode")}})),styleSelectButton:function(t,e){return function(t,e){var n=O({type:"advanced"},e.styleselect);return PM(t,e,rD(t,n))}(t,e.backstage)},fontsizeSelectButton:function(t,e){return function(t,e){return PM(t,e,tD(t))}(t,e.backstage)},fontSelectButton:function(t,e){return function(t,e){return PM(t,e,YM(t))}(t,e.backstage)},formatButton:function(t,e){return function(t,e){return PM(t,e,nD(t))}(t,e.backstage)},alignMenuButton:function(t,e){return function(t,e){return PM(t,e,$M(t))}(t,e.backstage)}},OD={styleselect:_D.styleSelectButton,fontsizeselect:_D.fontsizeSelectButton,fontselect:_D.fontSelectButton,formatselect:_D.formatButton,align:_D.alignMenuButton},ED=function(t){var e,n=t.toolbar,r=t.buttons;return!1===n?[]:void 0===n||!0===n?function(t){var e=j(SD,(function(e){var n=G(e.items,(function(e){return xt(t,e)||xt(OD,e)}));return{name:e.name,items:n}}));return G(e,(function(t){return t.items.length>0}))}(r):o(n)?(e=n.split("|"),j(e,(function(t){return{items:t.trim().split(" ")}}))):function(t){return g(t,(function(t){return xt(t,"name")&&xt(t,"items")}))}(n)?n:(console.error("Toolbar type should be string, string[], boolean or ToolbarGroup[]"),[])},zD=function(t,e,n,r,o,i){return yt(e,n.toLowerCase()).orThunk((function(){return i.bind((function(t){return st(t,(function(t){return yt(e,t+n.toLowerCase())}))}))})).fold((function(){return yt(OD,n.toLowerCase()).map((function(e){return e(t,o)})).orThunk((function(){return B.none()}))}),(function(e){return"grouptoolbarbutton"!==e.type||r?function(t,e,n){return yt(_D,t.type).fold((function(){return console.error("skipping button defined by",t),B.none()}),(function(r){return B.some(r(t,e,n))}))}(e,o,t):(console.warn("Ignoring the '"+n+"' toolbar button. Group toolbar buttons are only supported when using floating toolbar mode and cannot be nested."),B.none())}))},TD=function(t,e,n,r){var o=ED(e),i=j(o,(function(o){var i=Q(o.items,(function(o){return 0===o.trim().length?[]:zD(t,e.buttons,o,e.allowToolbarGroups,n,r).toArray()}));return{title:B.from(t.translate(o.name)),items:i}}));return G(i,(function(t){return t.items.length>0}))},MD=function(t,e,n,r){var i=e.outerContainer,a=n.toolbar,u=n.buttons;if(g(a,o)){var c=a.map((function(e){var o={toolbar:e,buttons:u,allowToolbarGroups:n.allowToolbarGroups};return TD(t,o,{backstage:r},B.none())}));CM.setToolbars(i,c)}else CM.setToolbar(i,TD(t,n,{backstage:r},B.none()))},DD=pe(),AD=DD.os.isiOS()&&DD.os.version.major<=12,ND=Object.freeze({__proto__:null,render:function(t,e,n,r,o){var i=Co(0),a=e.outerContainer;DM(t);var c=Bt.fromDom(o.targetNode),s=He(Re(c));!function(t,e){Kl(t,e,_n)}(c,e.mothership),Xl(s,e.uiMothership),t.on("PostRender",(function(){MD(t,e,n,r),i.set(t.getWin().innerWidth),CM.setMenubar(a,_M(t,n)),CM.setSidebar(a,n.sidebar),function(t,e){var n=t.dom,r=t.getWin(),o=t.getDoc().documentElement,i=Co(gn(r.innerWidth,r.innerHeight)),a=Co(gn(o.offsetWidth,o.offsetHeight)),u=function(){var e=i.get();e.left===r.innerWidth&&e.top===r.innerHeight||(i.set(gn(r.innerWidth,r.innerHeight)),Fy(t))},c=function(){var e=t.getDoc().documentElement,n=a.get();n.left===e.offsetWidth&&n.top===e.offsetHeight||(a.set(gn(e.offsetWidth,e.offsetHeight)),Fy(t))},s=function(e){return function(t,e){return t.fire("ScrollContent",e)}(t,e)};n.bind(r,"resize",u),n.bind(r,"scroll",s);var l=rs(Bt.fromDom(t.getBody()),"load",c),f=e.uiMothership.element;t.on("hide",(function(){Qe(f,"display","none")})),t.on("show",(function(){un(f,"display")})),t.on("NodeChange",c),t.on("remove",(function(){l.unbind(),n.unbind(r,"resize",u),n.unbind(r,"scroll",s),r=null}))}(t,e)}));var l,f,d,m=CM.getSocket(a).getOrDie("Could not find expected socket element");if(AD){Ze(m.element,{overflow:"scroll","-webkit-overflow-scrolling":"touch"});var g=(l=function(){t.fire("ScrollContent")},f=20,d=null,{cancel:function(){u(d)||(clearTimeout(d),d=null)},throttle:function(){for(var t=[],e=0;ee}));return r.or(o).getOr(t)},LD=function(t){return function(t){var e=vb(t),n=xb(t),r=Cb(t);return BD(e).map((function(t){return HD(t,n,r)}))}(t).getOr(vb(t))},VD=function(t){var e=bb(t),n=yb(t),r=wb(t);return BD(e).map((function(t){return HD(t,n,r)}))},PD=function(t,e,n,r,o){var i=n.uiMothership,a=n.outerContainer,u=hb.DOM,c=Bb(t),s=Lb(t),l=wb(t).or(VD(t)),f=r.shared.header,d=f.isPositionedAtTop,m=zb(t),g=m===hv.sliding||m===hv.floating,h=Co(!1),p=function(){return h.get()&&!t.removed},b=function(t){return g?t.fold(v(0),(function(t){return t.components().length>1?fn(t.components()[1].element):0})):0},y=function(){i.broadcastOn([sf()],{})},x=function(t){if(void 0===t&&(t=!1),p()){var n;if(c||(n=l.getOrThunk((function(){var t=BD(en(Fe(),"margin-left")).getOr(0);return yn(Fe())-pn(e).left+t})),Qe(o.get().element,"max-width",n+"px")),g&&CM.refreshToolbar(a),c||function(){var t=CM.getToolbar(a),n=b(t),r=In(e),i=d()?Math.max(r.y-fn(o.get().element)+n,0):r.bottom;Ze(a.element,{position:"absolute",top:Math.round(i)+"px",left:Math.round(r.x)+"px"})}(),s){var r=o.get();t?Hz.reset(r):Hz.refresh(r)}y()}},w=function(n){if(void 0===n&&(n=!0),!c&&s&&p()){var r=f.getDockingMode(),i=function(n){switch(Db(t)){case Eb.auto:var r=CM.getToolbar(a),o=b(r),i=fn(n.element)-o,u=In(e);if(u.y>i)return"top";var c=ke(e),s=Math.max(c.dom.scrollHeight,fn(c));return u.bottom=n&&t.bottom-e.y>=n},XD=function(t){var e=function(t){var e=t.getBoundingClientRect();if(e.height<=0&&e.width<=0){var n=De(Bt.fromDom(t.startContainer),t.startOffset).element;return(Pt(n)?Oe(n):B.some(n)).filter(Vt).map((function(t){return t.dom.getBoundingClientRect()})).getOr(e)}return e}(t.selection.getRng());if(t.inline){var n=An();return Pn(n.left+e.left,n.top+e.top,e.width,e.height)}var r=Fn(Bt.fromDom(t.getBody()));return Pn(r.x+e.left,r.y+e.top,e.width,e.height)},KD=function(t,e,n,r){void 0===r&&(r=0);var o=Rn(window),i=In(Bt.fromDom(t.getContentAreaContainer())),a=Sb(t)||kb(t)||Ob(t),u=function(t,e,n){var r=Math.max(t.x+n,e.x);return{x:r,width:Math.min(t.right-n,e.right)-r}}(i,o,r),c=u.x,s=u.width;if(t.inline&&!a)return Pn(c,o.y,s,o.height);var l=function(t,e,n,r,o,i){var a=Bt.fromDom(t.getContainer()),u=lu(a,".tox-editor-header").getOr(a),c=In(u),s=c.y>=e.bottom,l=r&&!s;if(t.inline&&l)return{y:Math.max(c.bottom+i,n.y),bottom:n.bottom};if(t.inline&&!l)return{y:n.y,bottom:Math.min(c.y-i,n.bottom)};var f="line"===o?In(a):e;return l?{y:Math.max(c.bottom+i,n.y),bottom:Math.min(f.bottom-i,n.bottom)}:{y:Math.max(f.y+i,n.y),bottom:Math.min(c.y-i,n.bottom)}}(t,i,o,e.header.isPositionedAtTop(),n,r),f=l.y,d=l.bottom;return Pn(c,f,s,d-f)},YD={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"]},JD={maxHeightFunction:hs(),maxWidthFunction:WT()},QD=function(t){return"node"===t},ZD=function(t,e,n,r,o){var i=XD(t),a=r.lastElement().exists((function(t){return ye(n,t)}));return function(t,e){var n=t.selection.getRng(),r=De(Bt.fromDom(n.startContainer),n.startOffset);return n.startContainer===n.endContainer&&n.startOffset===n.endOffset-1&&ye(r.element,e)}(t,n)?a?mp:cp:a?function(t,e,n){var r=rn(t,"position");Qe(t,"position",e);var o=n(t);return r.each((function(e){return Qe(t,"position",e)})),o}(e,r.getMode(),(function(){return $D(i,In(e))&&!r.isReposition()?hp:mp})):("fixed"===r.getMode()?o.y+An().top:o.y)+(fn(e)+12)<=i.y?cp:sp},tA=function(t,e,n,r){var o=function(e){return function(r,o,i,a,u){var c=ZD(t,a,e,n,u),s=O(O({},r),{y:u.y,height:u.height});return O(O({},c(s,o,i,a,u)),{alwaysFit:!0})}},i=function(t){return QD(r)?[o(t)]:[]};return e?{onLtr:function(t){return[ac,ec,nc,rc,oc,ic].concat(i(t))},onRtl:function(t){return[ac,nc,ec,oc,rc,ic].concat(i(t))}}:{onLtr:function(t){return[ic,ac,rc,ec,oc,nc].concat(i(t))},onRtl:function(t){return[ic,ac,oc,nc,rc,ec].concat(i(t))}}},eA=function(t,e){var n=G(e,(function(e){return e.predicate(t.dom)})),r=q(n,(function(t){return"contexttoolbar"===t.type}));return{contextToolbars:r.pass,contextForms:r.fail}},nA=function(t,e,n){var r=eA(t,e);if(r.contextForms.length>0)return B.some({elem:t,toolbars:[r.contextForms[0]]});var o=eA(t,n);if(o.contextForms.length>0)return B.some({elem:t,toolbars:[o.contextForms[0]]});if(r.contextToolbars.length>0||o.contextToolbars.length>0){var i=function(t){if(t.length<=1)return t;var e=function(e){return I(t,(function(t){return t.position===e}))},n=function(e){return G(t,(function(t){return t.position===e}))},r=e("selection"),o=e("node");if(r||o){if(o&&r){var i=n("node"),a=j(n("selection"),(function(t){return O(O({},t),{position:"node"})}));return i.concat(a)}return n(r?"selection":"node")}return n("line")}(r.contextToolbars.concat(o.contextToolbars));return B.some({elem:t,toolbars:i})}return B.none()},rA=function(t,e,n){return t(e)?B.none():Mo(e,(function(t){if(Vt(t)){var e=eA(t,n.inNodeScope),r=e.contextToolbars,o=e.contextForms,i=o.length>0?o:function(t){if(t.length<=1)return t;var e=function(e){return K(t,(function(t){return t.position===e}))};return e("selection").orThunk((function(){return e("node")})).orThunk((function(){return e("line")})).map((function(t){return t.position})).fold((function(){return[]}),(function(e){return G(t,(function(t){return t.position===e}))}))}(r);return i.length>0?B.some({elem:t,toolbars:i}):B.none()}return B.none()}),t)},oA=function(t,e){var n={},r=[],o=[],i={},a={},u=function(t,u){var c=jr(Ur("ContextForm",dv,u));n[t]=c,c.launch.map((function(n){i["form:"+t]=O(O({},u.launch),{type:"contextformtogglebutton"===n.type?"togglebutton":"button",onAction:function(){e(c)}})})),"editor"===c.scope?o.push(c):r.push(c),a[t]=c},c=function(t,e){var n;(n=e,Ur("ContextToolbar",mv,n)).each((function(n){"editor"===e.scope?o.push(n):r.push(n),a[t]=n}))},s=lt(t);return W(s,(function(e){var n=t[e];"contextform"===n.type?u(e,n):"contexttoolbar"===n.type&&c(e,n)})),{forms:n,inNodeScope:r,inEditorScope:o,lookupTable:a,formNavigators:i}},iA=ia("forward-slide"),aA=ia("backward-slide"),uA=ia("change-slide-event"),cA="tox-pop--resizing",sA="tox-pop--transition",lA=function(t,e,n,r){var o,i,a=r.backstage,u=a.shared,c=pe().deviceType.isTouch,s=ts(),l=ts(),f=ts(),d=eu((o={sink:n,onEscape:function(){return t.focus(),B.some(!0)}},i=Co([]),Yh.sketch({dom:{tag:"div",classes:["tox-pop"]},fireDismissalEventInstead:{event:"doNotDismissYet"},onShow:function(t){i.set([]),Yh.getContent(t).each((function(t){un(t.element,"visibility")})),Ia(t.element,cA),un(t.element,"width")},inlineBehaviours:wc([ch("context-toolbar-events",[Gi(ti(),(function(t,e){"width"===e.event.raw.propertyName&&(Ia(t.element,cA),un(t.element,"width"))})),Pi(uA,(function(t,e){var n=t.element;un(n,"width");var r=yn(n);Yh.setContent(t,e.event.contents),Va(n,cA);var o=yn(n);Qe(n,"width",r+"px"),Yh.getContent(t).each((function(t){e.event.focus.bind((function(t){return Mc(t),Nc(n)})).orThunk((function(){return nh.focusIn(t),Ac(Re(n))}))})),pp.setTimeout((function(){Qe(t.element,"width",o+"px")}),0)})),Pi(iA,(function(t,e){Yh.getContent(t).each((function(e){i.set(i.get().concat([{bar:e,focus:Ac(Re(t.element))}]))})),Di(t,uA,{contents:e.event.forwardContents,focus:B.none()})})),Pi(aA,(function(t,e){ut(i.get()).each((function(e){i.set(i.get().slice(0,i.get().length-1)),Di(t,uA,{contents:nu(e.bar),focus:e.focus})}))}))]),nh.config({mode:"special",onEscape:function(t){return ut(i.get()).fold((function(){return o.onEscape()}),(function(e){return Mi(t,aA),B.some(!0)}))}})]),lazySink:function(){return qn.value(o.sink)}}))),m=function(){var e=f.get().getOr("node"),n=QD(e)?1:0;return KD(t,u,e,n)},g=function(){return!(t.removed||c()&&a.isContextMenuOpen())},p=function(){if(g()){var e=m(),n=Ct(f.get(),"node")?function(t,e){return e.filter(Ie).map(Fn).getOrThunk((function(){return XD(t)}))}(t,s.get()):XD(t);return e.height<=0||!$D(n,e)}return!0},v=function(){s.clear(),l.clear(),f.clear(),Yh.hide(d)},b=function(){if(Yh.isOpen(d)){var t=d.element;un(t,"display"),p()?Qe(t,"display","none"):(l.set(0),Yh.reposition(d))}},y=function(e){return{dom:{tag:"div",classes:["tox-pop__dialog"]},components:[e],behaviours:wc([nh.config({mode:"acyclic"}),ch("pop-dialog-wrap-events",[$i((function(e){t.shortcuts.add("ctrl+F9","focus statusbar",(function(){return nh.focusIn(e)}))})),Xi((function(e){t.shortcuts.remove("ctrl+F9")}))])])}},x=Ut((function(){return oA(e,(function(t){var e=w([t]);Di(d,iA,{forwardContents:y(e)})}))})),w=function(e){var n=t.ui.registry.getAll().buttons,o=x(),i=O(O({},n),o.formNavigators),a=zb(t)===hv.scrolling?hv.scrolling:hv.default,c=J(j(e,(function(e){return"contexttoolbar"===e.type?function(e,n){return TD(t,{buttons:e,toolbar:n.items,allowToolbarGroups:!1},r,B.some(["form:"]))}(i,e):function(t,e){return GD(t,e)}(e,u.providers)})));return gM({type:a,uid:ia("context-toolbar"),initGroups:c,onEscape:B.none,cyclicKeying:!0,providers:u.providers})},C=function(e,r){var o="node"===e?u.anchors.node(r):u.anchors.cursor(),i=function(t,e,n,r){return"line"===e?{bubble:ys(12,0,YD),layouts:{onLtr:function(){return[uc]},onRtl:function(){return[cc]}},overrides:JD}:{bubble:ys(0,12,YD,1/12),layouts:tA(t,n,r,e),overrides:JD}}(t,e,c(),{lastElement:s.get,isReposition:function(){return Ct(l.get(),0)},getMode:function(){return Vl.getMode(n)}});return cr(o,i)},S=function(t,e){if(k.cancel(),g()){var r=w(t),o=t[0].position,i=C(o,e);f.set(o),l.set(1);var a=d.element;un(a,"display"),function(t){return Ct(kt(t,s.get(),ye),!0)}(e)||(Ia(a,sA),Vl.reset(n,d)),Yh.showWithinBounds(d,y(r),{anchor:i,transition:{classes:[sA],mode:"placement"}},(function(){return B.some(m())})),e.fold(s.clear,s.set),p()&&Qe(a,"display","none")}},k=Np((function(){t.hasFocus()&&!t.removed&&(Fa(d.element,sA)?k.throttle():function(t,e){var n=Bt.fromDom(e.getBody()),r=function(t){return ye(t,n)},o=Bt.fromDom(e.selection.getNode());return function(t){return!r(t)&&!we(n,t)}(o)?B.none():nA(o,t.inNodeScope,t.inEditorScope).orThunk((function(){return rA(r,o,t)}))}(x(),t).fold(v,(function(t){S(t.toolbars,B.some(t.elem))})))}),17);t.on("init",(function(){t.on("remove",v),t.on("ScrollContent ScrollWindow ObjectResized ResizeEditor longpress",b),t.on("click keyup focus SetContent",k.throttle),t.on(UD,v),t.on("contexttoolbar-show",(function(e){var n=x();yt(n.lookupTable,e.toolbarKey).each((function(n){S([n],_t(e.target!==t,e.target)),Yh.getContent(d).each(nh.focusIn)}))})),t.on("focusout",(function(e){pp.setEditorTimeout(t,(function(){Nc(n.element).isNone()&&Nc(d.element).isNone()&&v()}),0)})),t.on("SwitchMode",(function(){t.mode.isReadOnly()&&v()})),t.on("AfterProgressState",(function(e){e.state?v():t.hasFocus()&&k.throttle()})),t.on("NodeChange",(function(t){Nc(d.element).fold(k.throttle,h)}))}))},fA={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:[""]},dA=(FM="[eE][+-]?[0-9]+",jM=["Infinity","[0-9]+\\."+(UM=function(t){return"(?:"+t+")?"})(IM="[0-9]+")+UM(FM),"\\.[0-9]+"+UM(FM),IM+UM(FM)].join("|"),new RegExp("^([+-]?(?:"+jM+"))(.*)$")),mA=function(t,e){return B.from(dA.exec(t)).bind((function(t){var n=Number(t[1]),r=t[2];return function(t,e){return I(e,(function(e){return I(fA[e],(function(e){return t===e}))}))}(r,e)?B.some({value:n,unit:r}):B.none()}))},gA=function(t,e){var n=function(){var n=e.getOptions(t),r=e.getCurrent(t).map(e.hash),o=ts();return j(n,(function(n){return{type:"togglemenuitem",text:e.display(n),onSetup:function(i){var a=function(t){t&&(o.on((function(t){return t.setActive(!1)})),o.set(i)),i.setActive(t)};a(Ct(r,e.hash(n)));var u=e.watcher(t,n,a);return function(){o.clear(),u()}},onAction:function(){return e.setCurrent(t,n)}}}))};t.ui.registry.addMenuButton(e.name,{tooltip:e.text,icon:e.icon,fetch:function(t){return t(n())},onSetup:e.onToolbarSetup}),t.ui.registry.addNestedMenuItem(e.name,{type:"nestedmenuitem",text:e.text,getSubmenuItems:n,onSetup:e.onMenuSetup})},hA={name:"lineheight",text:"Line height",icon:"line-height",getOptions:function(t){return t.getParam("lineheight_formats","1 1.1 1.2 1.3 1.4 1.5 2","string").split(" ")},hash:function(t){return function(t,e){return mA(t,e).map((function(t){return t.value+t.unit}))}(t,["fixed","relative","empty"]).getOr(t)},display:b,watcher:function(t,e,n){return t.formatter.formatChanged("lineheight",n,!1,{value:e}).unbind},getCurrent:function(t){return B.from(t.queryCommandValue("LineHeight"))},setCurrent:function(t,e){return t.execCommand("LineHeight",!1,e)}},pA=function(t){gA(t,hA),function(t){return B.from(function(t){return t.getParam("content_langs",void 0,"array")}(t)).map((function(e){return{name:"language",text:"Language",icon:"language",getOptions:v(e),hash:function(t){return s(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=Bt.fromDom(t.selection.getNode());return Do(e,(function(t){return B.some(t).filter(Vt).bind((function(t){return $e(t,"lang").map((function(e){return{code:e,customCode:$e(t,"data-mce-lang").getOrUndefined(),title:""}}))}))}))},setCurrent:function(t,e){return t.execCommand("Lang",!1,e)},onToolbarSetup:function(e){var n=Zc();return e.setActive(t.formatter.match("lang",{},void 0,!0)),n.set(t.formatter.formatChanged("lang",e.setActive,!0)),n.clear}}}))}(t).each((function(e){return gA(t,e)}))},vA=function(t,e){!function(t,e){var n=VM(0,e,$M(t));t.ui.registry.addNestedMenuItem("align",{text:e.shared.providers.translate("Align"),getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})}(t,e),function(t,e){var n=VM(0,e,YM(t));t.ui.registry.addNestedMenuItem("fontformats",{text:e.shared.providers.translate("Fonts"),getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})}(t,e),function(t,e){var n=O({type:"advanced"},e.styleselect),r=VM(0,e,rD(t,n));t.ui.registry.addNestedMenuItem("formats",{text:"Formats",getSubmenuItems:function(){return r.items.validateItems(r.getStyleItems())}})}(t,e),function(t,e){var n=VM(0,e,nD(t));t.ui.registry.addNestedMenuItem("blockformats",{text:"Blocks",getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})}(t,e),function(t,e){var n=VM(0,e,tD(t));t.ui.registry.addNestedMenuItem("fontsizes",{text:"Font sizes",getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})}(t,e)},bA=function(t){return BM(t,"NodeChange",(function(e){e.setDisabled(!t.queryCommandState("outdent"))}))},yA=function(t){!function(t){t.ui.registry.addButton("outdent",{tooltip:"Decrease indent",icon:"outdent",onSetup:bA(t),onAction:HM(t,"outdent")}),t.ui.registry.addButton("indent",{tooltip:"Increase indent",icon:"indent",onAction:HM(t,"indent")})}(t)},xA=function(t,e){return function(){t.execCommand("mceToggleFormat",!1,e)}},wA=function(t){!function(t){wk.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:NM(t,e.name),onAction:xA(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:NM(t,n),onAction:xA(t,n)})}}(t),function(t){wk.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:HM(t,e.action)})}))}(t),function(t){wk.each([{name:"blockquote",text:"Blockquote",action:"mceBlockQuote",icon:"quote"}],(function(e){t.ui.registry.addToggleButton(e.name,{tooltip:e.text,icon:e.icon,onAction:HM(t,e.action),onSetup:NM(t,e.name)})}))}(t)},CA=function(t){wA(t),function(t){wk.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:HM(t,e.action)})})),t.ui.registry.addMenuItem("codeformat",{text:"Code",icon:"sourcecode",onAction:xA(t,"code")})}(t)},SA=function(t,e){return BM(t,"Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",(function(n){n.setDisabled(t.mode.isReadOnly()||!t.undoManager[e]())}))},kA=function(t){!function(t){t.ui.registry.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onSetup:SA(t,"hasUndo"),onAction:HM(t,"undo")}),t.ui.registry.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onSetup:SA(t,"hasRedo"),onAction:HM(t,"redo")})}(t),function(t){t.ui.registry.addButton("undo",{tooltip:"Undo",icon:"undo",disabled:!0,onSetup:SA(t,"hasUndo"),onAction:HM(t,"undo")}),t.ui.registry.addButton("redo",{tooltip:"Redo",icon:"redo",disabled:!0,onSetup:SA(t,"hasRedo"),onAction:HM(t,"redo")})}(t)},_A=function(t){return BM(t,"VisualAid",(function(e){e.setActive(t.hasVisual)}))},OA=function(t){!function(t){t.ui.registry.addButton("visualaid",{tooltip:"Visual aids",text:"Visual aids",onAction:HM(t,"mceToggleVisualAid")})}(t),function(t){t.ui.registry.addToggleMenuItem("visualaid",{text:"Visual aids",onSetup:_A(t),onAction:HM(t,"mceToggleVisualAid")})}(t)},EA=function(t,e){!function(t){W([{name:"alignleft",text:"Align left",cmd:"JustifyLeft",icon:"align-left"},{name:"aligncenter",text:"Align center",cmd:"JustifyCenter",icon:"align-center"},{name:"alignright",text:"Align right",cmd:"JustifyRight",icon:"align-right"},{name:"alignjustify",text:"Justify",cmd:"JustifyFull",icon:"align-justify"}],(function(e){t.ui.registry.addToggleButton(e.name,{tooltip:e.text,icon:e.icon,onAction:HM(t,e.cmd),onSetup:NM(t,e.name)})})),t.ui.registry.addButton("alignnone",{tooltip:"No alignment",icon:"align-none",onAction:HM(t,"JustifyNone")})}(t),CA(t),vA(t,e),kA(t),function(t){!function(t){t.addCommand("mceApplyTextcolor",(function(e,n){!function(t,e,n){t.undoManager.transact((function(){t.focus(),t.formatter.apply(e,{value:n}),t.nodeChanged()}))}(t,e,n)})),t.addCommand("mceRemoveTextcolor",(function(e){!function(t,e){t.undoManager.transact((function(){t.focus(),t.formatter.remove(e,{value:null},null,!0),t.nodeChanged()}))}(t,e)}))}(t);var e=Co(ex),n=Co(ex);cx(t,"forecolor","forecolor","Text color",e),cx(t,"backcolor","hilitecolor","Background color",n),sx(t,"forecolor","forecolor","Text color"),sx(t,"backcolor","hilitecolor","Background color")}(t),OA(t),yA(t),pA(t)},zA=function(t,e){return{type:"makeshift",x:t,y:e}},TA=function(t){return"longpress"===t.type||0===t.type.indexOf("touch")},MA=function(t,e){var n=hb.DOM.getPos(t);return function(t,e,n){return zA(t.x+e,t.y+n)}(e,n.x,n.y)},DA=function(t,e){return"contextmenu"===e.type||"longpress"===e.type?t.inline?function(t){if(TA(t)){var e=t.touches[0];return zA(e.pageX,e.pageY)}return zA(t.pageX,t.pageY)}(e):MA(t.getContentAreaContainer(),function(t){if(TA(t)){var e=t.touches[0];return zA(e.clientX,e.clientY)}return zA(t.clientX,t.clientY)}(e)):AA(t)},AA=function(t){return{type:"selection",root:Bt.fromDom(t.selection.getNode())}},NA=function(t,e,n){switch(n){case"node":return function(t){return{type:"node",node:B.some(Bt.fromDom(t.selection.getNode())),root:Bt.fromDom(t.getBody())}}(t);case"point":return DA(t,e);case"selection":return AA(t)}},BA=function(t,e,n,r,o,i){var a=n(),u=NA(t,e,i);I_(a,pv.CLOSE_ON_EXECUTE,r,!1).map((function(t){e.preventDefault(),Yh.showMenuAt(o,{anchor:u},{menu:{markers:Dv("normal")},data:t})}))},RA={onLtr:function(){return[ac,ec,nc,rc,oc,ic,cp,sp,up,ip,ap,op]},onRtl:function(){return[ac,nc,ec,oc,rc,ic,cp,sp,ap,op,up,ip]}},HA={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"]},LA=function(t,e,n,r,o,i,a){var u=function(t,e,n){var r=NA(t,e,n);return O({bubble:ys(0,"point"===n?12:0,HA),layouts:RA,overrides:{maxWidthFunction:WT(),maxHeightFunction:hs()}},r)}(t,e,i);I_(n,pv.CLOSE_ON_EXECUTE,r,!0).map((function(n){e.preventDefault(),Yh.showMenuWithinBounds(o,{anchor:u},{menu:{markers:Dv("normal"),highlightImmediately:a},data:n,type:"horizontal"},(function(){return B.some(KD(t,r.shared,"node"===i?"node":"selection"))})),t.fire(UD)}))},VA=function(t,e,n,r,o,i){var a=pe(),u=a.os.isiOS(),c=a.os.isOSX(),s=a.os.isAndroid(),l=a.deviceType.isTouch(),f=function(){var a=n();LA(t,e,a,r,o,i,!(s||u||c&&l))};if((c||u)&&"node"!==i){var d=function(){!function(t){var e=t.selection.getRng(),n=function(){pp.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)}}(t),f()};!function(t,e){var n=t.selection;if(n.isCollapsed()||e.touches.length<1)return!1;var r=e.touches[0],o=n.getRng();return ll(t.getWin(),qs.domRange(o)).exists((function(t){return t.left<=r.clientX&&t.right>=r.clientX&&t.top<=r.clientY&&t.bottom>=r.clientY}))}(t,e)?(t.once("selectionchange",d),t.once("touchend",(function(){return t.off("selectionchange",d)}))):d()}else f()},PA=function(t){return"string"==typeof t?t.split(/[ ,]/):t},IA=function(t){return t.getParam("contextmenu_never_use_native",!1,"boolean")},FA=function(t){return function(t,e,n){var r=t.ui.registry.getAll().contextMenus;return B.from(t.getParam(e)).map(PA).getOrThunk((function(){return G(PA(n),(function(t){return xt(r,t)}))}))}(t,"contextmenu","link linkchecker image imagetools table spellchecker configurepermanentpen")},UA=function(t){return o(t)?"|"===t:"separator"===t.type},jA={type:"separator"},WA=function(t){var e,n=function(t){return{text:t.text,icon:t.icon,disabled:t.disabled,shortcut:t.shortcut}};if(o(t))return t;switch(t.type){case"separator":return jA;case"submenu":return O(O({type:"nestedmenuitem"},n(t)),{getSubmenuItems:function(){var e=t.getSubmenuItems();return o(e)?e:j(e,WA)}});default:return O(O({type:"menuitem"},n(t)),{onAction:(e=t.onAction,function(){return e()})})}},qA=function(t,e){if(0===e.length)return t;var n=ut(t).filter((function(t){return!UA(t)})).fold((function(){return[]}),(function(t){return[jA]}));return t.concat(n).concat(e).concat([jA])},GA=function(t,e){return"longpress"!==e.type&&(2!==e.button||e.target===t.getBody()&&""===e.pointerType)},$A=function(t,e){return GA(t,e)?t.selection.getStart(!0):e.target},XA=function(t,e,n){var r=pe().deviceType.isTouch,i=eu(Yh.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:wc([ch("dismissContextMenu",[Pi(Ci(),(function(e,n){uf.close(e),t.focus()}))])])})),a=function(t){return Yh.hide(i)},u=function(e){if(IA(t)&&e.preventDefault(),!function(t,e){return e.ctrlKey&&!IA(t)}(t,e)&&!function(t){return!1===t.getParam("contextmenu")}(t)){var a=function(t,e){var n=function(t){return t.getParam("contextmenu_avoid_overlap","","string")}(t),r=GA(t,e)?"selection":"point";if(Dt(n)){var o=$A(t,e);return Nx(Bt.fromDom(o),n)?"node":r}return r}(t,e);(r()?VA:BA)(t,e,(function(){var n=$A(t,e),r=t.ui.registry.getAll(),i=FA(t);return function(t,e,n){var r=X(e,(function(e,r){return yt(t,r.toLowerCase()).map((function(t){var r=t.update(n);if(o(r))return qA(e,r.split(" "));if(r.length>0){var i=j(r,WA);return qA(e,i)}return e})).getOrThunk((function(){return e.concat([r])}))}),[]);return r.length>0&&UA(r[r.length-1])&&r.pop(),r}(r.contextMenus,i,n)}),n,i,a)}};t.on("init",(function(){var e="ResizeEditor ScrollContent ScrollWindow longpresscancel"+(r()?"":" ResizeWindow");t.on(e,a),t.on("longpress contextmenu",u)}))},KA=So([{offset:["x","y"]},{absolute:["x","y"]},{fixed:["x","y"]}]),YA=function(t){return function(e){return e.translate(-t.left,-t.top)}},JA=function(t){return function(e){return e.translate(t.left,t.top)}},QA=function(t){return function(e,n){return X(t,(function(t,e){return e(t)}),gn(e,n))}},ZA=function(t,e,n){return t.fold(QA([JA(n),YA(e)]),QA([YA(e)]),QA([]))},tN=function(t,e,n){return t.fold(QA([JA(n)]),QA([]),QA([JA(e)]))},eN=function(t,e,n){return t.fold(QA([]),QA([YA(n)]),QA([JA(e),YA(n)]))},nN=function(t,e,n){var r=t.fold((function(t,e){return{position:B.some("absolute"),left:B.some(t+"px"),top:B.some(e+"px")}}),(function(t,e){return{position:B.some("absolute"),left:B.some(t-n.left+"px"),top:B.some(e-n.top+"px")}}),(function(t,e){return{position:B.some("fixed"),left:B.some(t+"px"),top:B.some(e+"px")}}));return O({right:B.none(),bottom:B.none()},r)},rN=function(t,e,n,r){var o=function(t,o){return function(i,a){var u=t(e,n,r);return o(i.getOr(u.left),a.getOr(u.top))}};return t.fold(o(eN,oN),o(tN,iN),o(ZA,aN))},oN=KA.offset,iN=KA.absolute,aN=KA.fixed,uN=function(t,e){var n=Ge(t,e);return s(n)?NaN:parseInt(n,10)},cN=function(t,e,n,r){return function(t,e){var n=t.element,r=uN(n,e.leftAttr),o=uN(n,e.topAttr);return isNaN(r)||isNaN(o)?B.none():B.some(gn(r,o))}(t,e).fold((function(){return n}),(function(t){return aN(t.left+r.left,t.top+r.top)}))},sN=function(t,e,n,r,o,i){var a=cN(t,e,n,r),u=e.mustSnap?dN(t,e,a,o,i):mN(t,e,a,o,i),c=ZA(a,o,i);return function(t,e,n){var r=t.element;We(r,e.leftAttr,n.left+"px"),We(r,e.topAttr,n.top+"px")}(t,e,c),u.fold((function(){return{coord:aN(c.left,c.top),extra:B.none()}}),(function(t){return{coord:t.output,extra:t.extra}}))},lN=function(t,e){!function(t,e){var n=t.element;Ke(n,e.leftAttr),Ke(n,e.topAttr)}(t,e)},fN=function(t,e,n,r){return st(t,(function(t){var o=t.sensor;return function(t,e,n,r,o,i){var a=tN(t,o,i),u=tN(e,o,i);return Math.abs(a.left-u.left)<=n&&Math.abs(a.top-u.top)<=r}(e,o,t.range.left,t.range.top,n,r)?B.some({output:rN(t.output,e,n,r),extra:t.extra}):B.none()}))},dN=function(t,e,n,r,o){var i=e.getSnapPoints(t);return fN(i,n,r,o).orThunk((function(){return X(i,(function(t,e){var i=e.sensor,a=function(t,e,n,r,o,i){var a=tN(t,o,i),u=tN(e,o,i),c=Math.abs(a.left-u.left),s=Math.abs(a.top-u.top);return gn(c,s)}(n,i,e.range.left,e.range.top,r,o);return t.deltas.fold((function(){return{deltas:B.some(a),snap:B.some(e)}}),(function(n){return(a.left+a.top)/2<=(n.left+n.top)/2?{deltas:B.some(a),snap:B.some(e)}:t}))}),{deltas:B.none(),snap:B.none()}).snap.map((function(t){return{output:rN(t.output,n,r,o),extra:t.extra}}))}))},mN=function(t,e,n,r,o){var i=e.getSnapPoints(t);return fN(i,n,r,o)},gN=Object.freeze({__proto__:null,snapTo:function(t,e,n,r){var o=e.getTarget(t.element);if(e.repositionTarget){var i=Ce(t.element),a=An(i),u=bz(o),c=function(t,e,n){return{coord:rN(t.output,t.output,e,n),extra:t.extra}}(r,a,u),s=nN(c.coord,0,u);tn(o,s)}}}),hN="data-initial-z-index",pN=function(t,e){t.getSystem().addToGui(e),function(t){Oe(t.element).filter(Vt).each((function(e){rn(e,"z-index").each((function(t){We(e,hN,t)})),Qe(e,"z-index",en(t.element,"z-index"))}))}(e)},vN=function(t){!function(t){Oe(t.element).filter(Vt).each((function(t){$e(t,hN).fold((function(){return un(t,"z-index")}),(function(e){return Qe(t,"z-index",e)})),Ke(t,hN)}))}(t),t.getSystem().removeFromGui(t)},bN=function(t,e,n){return t.getSystem().build($x.sketch({dom:{styles:{left:"0px",top:"0px",width:"100%",height:"100%",position:"fixed","z-index":"1000000000000000"},classes:[e]},events:n}))},yN=fo("snaps",[Yr("getSnapPoints"),zu("onSensor"),Yr("leftAttr"),Yr("topAttr"),mo("lazyViewport",Un),mo("mustSnap",!1)]),xN=[mo("useFixed",S),Yr("blockerClass"),mo("getTarget",b),mo("onDrag",h),mo("repositionTarget",!0),mo("onDrop",h),yo("getBounds",Un),yN],wN=function(t){return(e=rn(t,"left"),n=rn(t,"top"),r=rn(t,"position"),o=function(t,e,n){return("fixed"===n?aN:oN)(parseInt(t,10),parseInt(e,10))},e.isSome()&&n.isSome()&&r.isSome()?B.some(o(e.getOrDie(),n.getOrDie(),r.getOrDie())):B.none()).getOrThunk((function(){var e=pn(t);return iN(e.left,e.top)}));var e,n,r,o},CN=function(t,e,n,r,o,i,a){return function(t,e,n,r,o){var i=o.bounds,a=tN(e,n,r),u=Gu(a.left,i.x,i.x+i.width-o.width),c=Gu(a.top,i.y,i.y+i.height-o.height),s=iN(u,c);return e.fold((function(){var t=eN(s,n,r);return oN(t.left,t.top)}),v(s),(function(){var t=ZA(s,n,r);return aN(t.left,t.top)}))}(0,e.fold((function(){var t,e,a,u=(t=n,e=i.left,a=i.top,t.fold((function(t,n){return oN(t+e,n+a)}),(function(t,n){return iN(t+e,n+a)}),(function(t,n){return aN(t+e,n+a)}))),c=ZA(u,r,o);return aN(c.left,c.top)}),(function(e){var a=sN(t,e,n,i,r,o);return a.extra.each((function(n){e.onSensor(t,n)})),a.coord})),r,o,a)},SN=function(t,e){return{bounds:t.getBounds(),height:dn(e.element),width:xn(e.element)}},kN=function(t,e,n,r,o){var i=n.update(r,o),a=n.getStartData().getOrThunk((function(){return SN(e,t)}));i.each((function(n){!function(t,e,n,r){var o=e.getTarget(t.element);if(e.repositionTarget){var i=Ce(t.element),a=An(i),u=bz(o),c=wN(o),s=CN(t,e.snaps,c,a,u,r,n),l=nN(s,0,u);tn(o,l)}e.onDrag(t,o,r)}(t,e,a,n)}))},_N=function(t,e,n,r){e.each(vN),n.snaps.each((function(e){lN(t,e)}));var o=n.getTarget(t.element);r.reset(),n.onDrop(t,o)},ON=function(t){return function(e,n){var r=function(t){n.setStartData(SN(e,t))};return Hi(z([Pi(bi(),(function(t){n.getStartData().each((function(){return r(t)}))}))],t(e,n,r),!0))}},EN=Object.freeze({__proto__:null,getData:function(t){return B.from(gn(t.x,t.y))},getDelta:function(t,e){return gn(e.left-t.left,e.top-t.top)}}),zN=function(t,e,n){return[Pi(Fo(),(function(r,o){if(0===o.event.raw.button){o.stop();var i=function(){return _N(r,B.some(c),t,e)},a=Bx(i,200),u={drop:i,delayDrop:a.schedule,forceDrop:i,move:function(n){a.cancel(),kN(r,t,e,EN,n)}},c=bN(r,t.blockerClass,function(t){return Hi([Pi(Fo(),t.forceDrop),Pi(Wo(),t.drop),Pi(Uo(),(function(e,n){t.move(n.event)})),Pi(jo(),t.delayDrop)])}(u));n(r),pN(r,c)}}))]},TN=z(z([],xN,!0),[Au("dragger",{handlers:ON(zN)})],!1),MN=Object.freeze({__proto__:null,getData:function(t){var e=t.raw.touches;return 1===e.length?function(t){var e=t[0];return B.some(gn(e.clientX,e.clientY))}(e):B.none()},getDelta:function(t,e){return gn(e.left-t.left,e.top-t.top)}}),DN=function(t,e,n){var r=ts(),o=function(n){_N(n,r.get(),t,e),r.clear()};return[Pi(Lo(),(function(i,a){a.stop();var u=function(){return o(i)},c={drop:u,delayDrop:h,forceDrop:u,move:function(n){kN(i,t,e,MN,n)}},s=bN(i,t.blockerClass,function(t){return Hi([Pi(Lo(),t.forceDrop),Pi(Po(),t.drop),Pi(Io(),t.drop),Pi(Vo(),(function(e,n){t.move(n.event)}))])}(c));r.set(s);n(i),pN(i,s)})),Pi(Vo(),(function(n,r){r.stop(),kN(n,t,e,MN,r.event)})),Pi(Po(),(function(t,e){e.stop(),o(t)})),Pi(Io(),o)]},AN=TN,NN=z(z([],xN,!0),[Au("dragger",{handlers:ON(DN)})],!1),BN=z(z([],xN,!0),[Au("dragger",{handlers:ON((function(t,e,n){return z(z([],zN(t,e,n),!0),DN(t,e,n),!0)}))})],!1),RN=_c({branchKey:"mode",branches:Object.freeze({__proto__:null,mouse:AN,touch:NN,mouseOrTouch:BN}),name:"dragging",active:{events:function(t,e){return t.dragger.handlers(t,e)}},extra:{snap:function(t){return{sensor:t.sensor,range:t.range,output:t.output,extra:B.from(t.extra)}}},state:Object.freeze({__proto__:null,init:function(){var t=B.none(),e=B.none(),n=v({});return Ca({readState:n,reset:function(){t=B.none(),e=B.none()},update:function(e,n){return e.getData(n).bind((function(n){return function(e,n){var r=t.map((function(t){return e.getDelta(t,n)}));return t=B.some(n),r}(e,n)}))},getStartData:function(){return e},setStartData:function(t){e=B.some(t)}})}}),apis:gN}),HN=function(t,e,n,r,o,i){return t.fold((function(){return RN.snap({sensor:iN(n-20,r-20),range:gn(o,i),output:iN(B.some(n),B.some(r)),extra:{td:e}})}),(function(t){var o=n-20,i=r-20,a=t.element.dom.getBoundingClientRect();return RN.snap({sensor:iN(o,i),range:gn(40,40),output:iN(B.some(n-a.width/2),B.some(r-a.height/2)),extra:{td:e}})}))},LN=function(t,e,n){return{getSnapPoints:t,leftAttr:"data-drag-left",topAttr:"data-drag-top",onSensor:function(t,r){var o=r.td;(function(t,e){return t.exists((function(t){return ye(t,e)}))})(e.get(),o)||(e.set(o),n(o))},mustSnap:!0}},VN=function(t){return bp(vp.sketch({dom:{tag:"div",classes:["tox-selector"]},buttonBehaviours:wc([RN.config({mode:"mouseOrTouch",blockerClass:"blocker",snaps:t}),sC.config({})]),eventOrder:{mousedown:["dragging","alloy.base.behaviour"],touchstart:["dragging","alloy.base.behaviour"]}}))},PN=function(t,e){var n=Co([]),r=Co([]),o=Co(!1),i=ts(),a=ts(),u=function(t){var n=Fn(t);return HN(f.getOpt(e),t,n.x,n.y,n.width,n.height)},c=function(t){var n=Fn(t);return HN(d.getOpt(e),t,n.right,n.bottom,n.width,n.height)},s=LN((function(){return j(n.get(),(function(t){return u(t)}))}),i,(function(e){a.get().each((function(n){t.fire("TableSelectorChange",{start:e,finish:n})}))})),l=LN((function(){return j(r.get(),(function(t){return c(t)}))}),a,(function(e){i.get().each((function(n){t.fire("TableSelectorChange",{start:n,finish:e})}))})),f=VN(s),d=VN(l),m=eu(f.asSpec()),g=eu(d.asSpec()),h=function(e,n,r,o){var i=r(n);RN.snapTo(e,i);!function(e,n,r,o){var i=n.dom.getBoundingClientRect();un(e.element,"display");var a=_e(Bt.fromDom(t.getBody())).dom.innerHeight,u=r(i),c=o(i,a);(u||c)&&Qe(e.element,"display","none")}(e,n,(function(t){return t[o]<0}),(function(t,e){return t[o]>e}))},p=function(t){return h(m,t,u,"top")},v=function(t){return h(g,t,c,"bottom")};pe().deviceType.isTouch()&&(t.on("TableSelectionChange",(function(t){o.get()||(jl(e,m),jl(e,g),o.set(!0)),i.set(t.start),a.set(t.finish),t.otherCells.each((function(e){n.set(e.upOrLeftCells),r.set(e.downOrRightCells),p(t.start),v(t.finish)}))})),t.on("ResizeEditor ResizeWindow ScrollContent",(function(){i.get().each(p),a.get().each(v)})),t.on("TableSelectionClear",(function(){o.get()&&(Gl(m),Gl(g),o.set(!1)),i.clear(),a.clear()})))},IN=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},FN=function(t,e,n){e.delimiter||(e.delimiter="»");return{dom:{tag:"div",classes:["tox-statusbar__path"],attributes:{role:"navigation"}},behaviours:wc([nh.config({mode:"flow",selector:"div[role=button]"}),Yd.config({disabled:n.isDisabled}),Gb(),tw.config({}),uh.config({}),ch("elementPathEvents",[$i((function(r,o){t.shortcuts.add("alt+F11","focus statusbar elementpath",(function(){return nh.focusIn(r)})),t.on("NodeChange",(function(o){var i,a,u=function(e){for(var n=[],r=e.length;r-- >0;){var o=e[r];if(1===o.nodeType&&!IN(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}(o.parents);u.length>0?uh.set(r,(i=j(u||[],(function(e,r){return vp.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:wc([Xb(n.isDisabled),Gb()])})})),a={dom:{tag:"div",classes:["tox-statusbar__path-divider"],attributes:{"aria-hidden":!0},innerHtml:" "+e.delimiter+" "}},X(i.slice(1),(function(t,e){var n=t;return n.push(a),n.push(e),n}),[i[0]]))):uh.set(r,[])}))}))])]),components:[]}};!function(t){t[t.None=0]="None",t[t.Both=1]="Both",t[t.Vertical=2]="Vertical"}(WM||(WM={}));var UN=function(t,e,n){var r=Bt.fromDom(t.getContainer()),o=function(t,e,n,r,o){var i={};return i.height=HD(r+e.top,xb(t),Cb(t)),n===WM.Both&&(i.width=HD(o+e.left,yb(t),wb(t))),i}(t,e,n,fn(r),yn(r));dt(o,(function(t,e){return Qe(r,e,RD(t))})),function(t){t.fire("ResizeEditor")}(t)},jN=function(t,e,n,r){var o=gn(20*n,20*r);return UN(t,o,e),B.some(!0)},WN=function(t,e){var n=function(t){var e=!t.hasPlugin("autoresize"),n=t.getParam("resize",e);return!1===n?WM.None:"both"===n?WM.Both:WM.Vertical}(t);return n===WM.None?B.none():B.some(zp("resize-handle",{tag:"div",classes:["tox-statusbar__resize-handle"],attributes:{title:e.translate("Resize")},behaviours:[RN.config({mode:"mouse",repositionTarget:!1,onDrag:function(e,r,o){return UN(t,o,n)},blockerClass:"tox-blocker"}),nh.config({mode:"special",onLeft:function(){return jN(t,n,-1,0)},onRight:function(){return jN(t,n,1,0)},onUp:function(){return jN(t,n,0,-1)},onDown:function(){return jN(t,n,0,1)}}),tw.config({}),mh.config({})]},e.icons))},qN=function(t,e){var n=function(){var n,r=[];return t.getParam("elementpath",!0,"boolean")&&r.push(FN(t,{},e)),t.hasPlugin("wordcount")&&r.push(function(t,e){var n,r=function(t,n,r){return uh.set(t,[Qa(e.translate(["{0} "+r,n[r]]))])};return vp.sketch({dom:{tag:"button",classes:["tox-statusbar__wordcount"]},components:[],buttonBehaviours:wc([Xb(e.isDisabled),Gb(),tw.config({}),uh.config({}),Ef.config({store:{mode:"memory",initialValue:{mode:"words",count:{words:0,characters:0}}}}),ch("wordcount-events",[Yi((function(t){var e=Ef.getValue(t),n="words"===e.mode?"characters":"words";Ef.setValue(t,{mode:n,count:e.count}),r(t,e.count,n)})),$i((function(e){t.on("wordCountUpdate",(function(t){var n=Ef.getValue(e).mode;Ef.setValue(e,{mode:n,count:t.wordCount}),r(e,t.wordCount,n)}))}))])]),eventOrder:(n={},n[si()]=["disabling","alloy.base.behaviour","wordcount-events"],n)})}(t,e)),t.getParam("branding",!0,"boolean")&&r.push({dom:{tag:"span",classes:["tox-statusbar__branding"],innerHtml:''+n+""}}),r.length>0?[{dom:{tag:"div",classes:["tox-statusbar__text-container"]},components:r}]:[]};return{dom:{tag:"div",classes:["tox-statusbar"]},components:function(){var r=n(),o=WN(t,e);return r.concat(o.toArray())}()}},GN=function(t){var e,n,r,o,i=t.inline,a=i?FD:ND,u=Lb(t)?Gz:pz,c=B.none(),s=pe(),l=s.browser.isIE()?["tox-platform-ie"]:[],f=s.deviceType.isTouch()?["tox-platform-touch"]:[],d=Ab(t),m=Rb(t),g=yp.isRtl()?{attributes:{dir:"rtl"}}:{},p={attributes:(e={},e[ks]=d?jc.BottomToTop:jc.TopToBottom,e)},v=function(){return c.bind(CM.getHeader)},b=function(){Qe(G.element,"width",document.body.clientWidth+"px")},y=eu((n=ye(Fe(),m)&&"grid"===en(m,"display"),r={dom:O({tag:"div",classes:["tox","tox-silver-sink","tox-tinymce-aux"].concat(l).concat(f)},g),behaviours:wc([Vl.config({useFixed:function(){return u.isDocked(v)}})])},o={dom:{styles:{width:document.body.clientWidth+"px"}},events:Hi([Pi(yi(),b)])},cr(r,n?o:{}))),x=function(){return qn.value(y)},w=bp({dom:{tag:"div",classes:["tox-anchorbar"]}}),C=function(){return c.bind((function(t){return CM.getThrobber(t)})).getOrDie("Could not find throbber element")},S=nz(y,t,(function(){return c.bind((function(t){return w.getOpt(t)})).getOrDie("Could not find a anchor bar element")})),k=CM.parts.menubar({dom:{tag:"div",classes:["tox-menubar"]},backstage:S,onEscape:function(){t.focus()}}),_=zb(t),E=CM.parts.toolbar(O({dom:{tag:"div",classes:["tox-toolbar"]},getSink:x,providers:S.shared.providers,onEscape:function(){t.focus()},type:_,lazyToolbar:function(){return c.bind((function(t){return CM.getToolbar(t)})).getOrDie("Could not find more toolbar element")},lazyHeader:function(){return v().getOrDie("Could not find header element")}},p)),z=CM.parts["multiple-toolbar"]({dom:{tag:"div",classes:["tox-toolbar-overlord"]},providers:S.shared.providers,onEscape:function(){t.focus()},type:_}),T=CM.parts.socket({dom:{tag:"div",classes:["tox-edit-area"]}}),M=CM.parts.sidebar({dom:{tag:"div",classes:["tox-sidebar"]}}),D=CM.parts.throbber({dom:{tag:"div",classes:["tox-throbber"]},backstage:S}),A=t.getParam("statusbar",!0,"boolean")&&!i?B.some(qN(t,S.shared.providers)):B.none(),N={dom:{tag:"div",classes:["tox-sidebar-wrap"]},components:[T,M]},R=Ob(t),H=kb(t),L=Sb(t),V=CM.parts.header({dom:O({tag:"div",classes:["tox-editor-header"]},p),components:J([L?[k]:[],R?[z]:H?[E]:[],Bb(t)?[]:[w.asSpec()]]),sticky:Lb(t),editor:t,sharedBackstage:S.shared}),P=J([d?[]:[V],i?[]:[N],d?[V]:[]]),I=J([[{dom:{tag:"div",classes:["tox-editor-container"]},components:P}],i?[]:A.toArray(),[D]]),F=Hb(t),U=O(O({role:"application"},yp.isRtl()?{dir:"rtl"}:{}),F?{"aria-hidden":"true"}:{}),j=eu(CM.sketch({dom:{tag:"div",classes:["tox","tox-tinymce"].concat(i?["tox-tinymce-inline"]:[]).concat(d?["tox-tinymce--toolbar-bottom"]:[]).concat(f).concat(l),styles:O({visibility:"hidden"},F?{opacity:"0",border:"0"}:{}),attributes:U},components:I,behaviours:wc([Gb(),Yd.config({disableClass:"tox-tinymce--disabled"}),nh.config({mode:"cyclic",selector:".tox-menubar, .tox-toolbar, .tox-toolbar__primary, .tox-toolbar__overflow--open, .tox-sidebar__overflow--open, .tox-statusbar__path, .tox-statusbar__wordcount, .tox-statusbar__branding a, .tox-statusbar__resize-handle"})])}));c=B.some(j),t.shortcuts.add("alt+F9","focus menubar",(function(){CM.focusMenubar(j)})),t.shortcuts.add("alt+F10","focus toolbar",(function(){CM.focusToolbar(j)})),t.addCommand("ToggleToolbarDrawer",(function(){CM.toggleToolbarDrawer(j)})),t.addQueryStateHandler("ToggleToolbarDrawer",(function(){return CM.isToolbarDrawerToggled(j)}));var q=Xx(j),G=Xx(y);!function(t,e,n){var r=function(t,r){W([e,n],(function(e){e.broadcastEvent(t,r)}))},o=function(t,r){W([e,n],(function(e){e.broadcastOn([t],r)}))},i=function(t){return o(cf(),{target:t.target})},a=Tc(),u=ns(a,"touchstart",i),c=ns(a,"touchmove",(function(t){return r(pi(),t)})),s=ns(a,"touchend",(function(t){return r(vi(),t)})),l=ns(a,"mousedown",i),f=ns(a,"mouseup",(function(t){0===t.raw.button&&o(lf(),{target:t.target})})),d=function(t){return o(cf(),{target:Bt.fromDom(t.target)})},m=function(t){0===t.button&&o(lf(),{target:Bt.fromDom(t.target)})},g=function(){W(t.editorManager.get(),(function(e){t!==e&&e.fire("DismissPopups",{relatedTarget:t})}))},h=function(t){return r(bi(),os(t))},p=function(t){o(sf(),{}),r(yi(),os(t))},v=function(){return o(sf(),{})},b=function(e){e.state&&o(cf(),{target:Bt.fromDom(t.getContainer())})},y=function(t){o(cf(),{target:Bt.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",h),t.on("ResizeWindow",p),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",h),t.off("ResizeWindow",p),t.off("ResizeEditor",v),t.off("AfterProgressState",b),t.off("DismissPopups",y),l.unbind(),u.unbind(),c.unbind(),s.unbind(),f.unbind()})),t.on("detach",(function(){Yl(e),Yl(n),e.destroy(),n.destroy()}))}(t,q,G);var $=function(){var e=RD(LD(t)),n=RD(function(t){return VD(t).getOr(bb(t))}(t));return t.inline||(an("div","width",n)&&Qe(j.element,"width",n),an("div","height",e)?Qe(j.element,"height",e):Qe(j.element,"height","200px")),e};return{mothership:q,uiMothership:G,backstage:S,renderUI:function(){u.setup(t,S.shared,v),EA(t,S),XA(t,x,S),function(t){var e=t.ui.registry.getAll().sidebars;W(lt(e),(function(n){var r=e[n],o=function(){return Ct(B.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)}}})}))}(t),BT(t,C,S.shared),mt(function(t){return t.getParam("toolbar_groups",{},"object")}(t),(function(e,n){t.ui.registry.addGroupToolbarButton(n,e)}));var e=t.ui.registry.getAll(),n=e.buttons,r=e.menuItems,o=e.contextToolbars,i=e.sidebars,c=_b(t),s={menuItems:r,menus:Vb(t),menubar:Pb(t),toolbar:c.getOrThunk((function(){return function(t){return t.getParam("toolbar",!0)}(t)})),allowToolbarGroups:_===hv.floating,buttons:n,sidebar:i};lA(t,o,y,{backstage:S}),PN(t,y);var l=t.getElement(),f=$(),d={mothership:q,uiMothership:G,outerContainer:j},m={targetNode:l,height:f};return a.render(t,d,s,S,m)},getUi:function(){return{channels:{broadcastAll:G.broadcast,broadcastOn:G.broadcastOn,register:h}}}}},$N=v([Yr("lazySink"),io("dragBlockClass"),yo("getBounds",Un),mo("useTabstopAt",k),mo("eventOrder",{}),zf("modalBehaviours",[nh]),Tu("onExecute"),Du("onEscape")]),XN={sketch:b},KN=v([id({name:"draghandle",overrides:function(t,e){return{behaviours:wc([RN.config({mode:"mouse",getTarget:function(t){return cu(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})])}}}),rd({schema:[Yr("dom")],name:"title"}),rd({factory:XN,schema:[Yr("dom")],name:"close"}),rd({factory:XN,schema:[Yr("dom")],name:"body"}),id({factory:XN,schema:[Yr("dom")],name:"footer"}),od({factory:{sketch:function(t,e){return O(O({},t),{dom:e.dom,components:e.components})}},schema:[mo("dom",{tag:"div",styles:{position:"fixed",left:"0px",top:"0px",right:"0px",bottom:"0px"}}),mo("components",[])],name:"blocker"})]),YN=Ad({name:"ModalDialog",configFields:$N(),partFields:KN(),factory:function(t,e,n,r){var o,i=ts(),a=ia("modal-events"),u=O(O({},t.eventOrder),((o={})[xi()]=[a].concat(t.eventOrder["alloy.system.attached"]||[]),o));return{uid:t.uid,dom:t.dom,components:e,apis:{show:function(e){i.set(e);var n=t.lazySink(e).getOrDie(),o=r.blocker(),a=n.getSystem().build(O(O({},o),{components:o.components.concat([nu(e)]),behaviours:wc([mh.config({}),ch("dialog-blocker-events",[Gi(Go(),(function(){nh.focusIn(e)}))])])}));jl(n,a),nh.focusIn(e)},hide:function(t){i.clear(),Oe(t.element).each((function(e){t.getSystem().getByDom(e).each((function(t){Gl(t)}))}))},getBody:function(e){return bd(e,t,"body")},getFooter:function(e){return bd(e,t,"footer")},setIdle:function(t){MT.unblock(t)},setBusy:function(t,e){MT.block(t,e)}},eventOrder:u,domModification:{attributes:{role:"dialog","aria-modal":"true"}},behaviours:Mf(t.modalBehaviours,[uh.config({}),nh.config({mode:"cyclic",onEnter:t.onExecute,onEscape:t.onEscape,useTabstopAt:t.useTabstopAt}),MT.config({getRoot:i.get}),ch(a,[$i((function(e){var n,r,o,i,a,u;n=e.element,r=bd(e,t,"title").element,o=$e(n,"id").fold((function(){var t=ia("dialog-label");return We(r,"id",t),t}),b),We(n,"aria-labelledby",o),i=e.element,a=bd(e,t,"body").element,u=B.from(Ge(i,"id")).fold((function(){var t=ia("dialog-describe");return We(a,"id",t),t}),b),We(i,"aria-describedby",u)}))])])}},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)}}}),JN=_r([Zr("type"),Zr("name")].concat(Xv)),QN=Br,ZN=[$r("name","name",lr((function(){return ia("button-name")})),Nr),co("icon"),vo("align","end",["start","end"]),bo("primary",!1),bo("disabled",!1)],tB=z(z([],ZN,!0),[Zr("text")],!1),eB=z([to("type",["submit","cancel","custom"])],tB,!0),nB=z([to("type",["menu"]),co("text"),co("tooltip"),co("icon"),oo("items",JN)],ZN,!0),rB=Gr("type",{submit:eB,cancel:eB,custom:eB,menu:nB}),oB=[Zr("type"),Zr("text"),to("level",["info","warn","error","success"]),Zr("icon"),mo("url","")],iB=_r(oB),aB=[Zr("type"),Zr("text"),bo("disabled",!1),bo("primary",!1),$r("name","name",lr((function(){return ia("button-name")})),Nr),co("icon"),bo("borderless",!1)],uB=_r(aB),cB=[Zr("type"),Zr("name"),Zr("label"),bo("disabled",!1)],sB=_r(cB),lB=Br,fB=[Zr("type"),Zr("name")],dB=fB.concat([co("label")]),mB=dB.concat([mo("columns","auto")]),gB=_r(mB),hB=Tr([Zr("value"),Zr("text"),Zr("icon")]),pB=_r(dB),vB=Nr,bB=_r(dB),yB=Nr,xB=fB.concat([po("tag","textarea"),Zr("scriptId"),Zr("scriptUrl"),function(t,e){return go(t,e,Lr)}("settings",void 0)]),wB=fB.concat([po("tag","textarea"),eo("init")]),CB=Ir((function(t){return Ur("customeditor.old",kr(wB),t).orThunk((function(){return Ur("customeditor.new",kr(xB),t)}))})),SB=Nr,kB=_r(dB),_B=Or(br),OB=function(t){return[Zr("type"),Qr("columns"),t]},EB=[Zr("type"),Zr("html"),vo("presets","presentation",["presentation","document"])],zB=_r(EB),TB=dB.concat([bo("sandboxed",!0)]),MB=_r(TB),DB=Nr,AB=dB.concat([Jr("currentState",_r([Yr("blob"),Zr("url")]))]),NB=_r(AB),BB=dB.concat([co("inputMode"),co("placeholder"),bo("maximized",!1),bo("disabled",!1)]),RB=_r(BB),HB=Nr,LB=function(t){return[Zr("type"),Zr("label"),t]},VB=[Zr("text"),Zr("value")],PB=[Zr("text"),oo("items",function(t,e){return n=Ut(e),{extract:function(t,e){return n().extract(t,e)},toString:function(){return n().toString()}};var n}(0,(function(){return IB})))],IB=Er([_r(VB),_r(PB)]),FB=dB.concat([oo("items",IB),bo("disabled",!1)]),UB=_r(FB),jB=Nr,WB=dB.concat([ro("items",[Zr("text"),Zr("value")]),ho("size",1),bo("disabled",!1)]),qB=_r(WB),GB=Nr,$B=dB.concat([bo("constrain",!0),bo("disabled",!1)]),XB=_r($B),KB=_r([Zr("width"),Zr("height")]),YB=[Zr("type"),oo("header",Nr),oo("cells",Or(Nr))],JB=_r(YB),QB=dB.concat([co("placeholder"),bo("maximized",!1),bo("disabled",!1)]),ZB=_r(QB),tR=Nr,eR=dB.concat([vo("filetype","file",["image","media","file"]),mo("disabled",!1)]),nR=_r(eR),rR=_r([Zr("value"),mo("meta",{})]),oR=function(t){return $r("items","items",{tag:"required",process:{}},Or(Ir((function(e){return Ur("Checking item of "+t,iR,e).fold((function(t){return qn.error(qr(t))}),(function(t){return qn.value(t)}))}))))},iR=Cr((function(){return Pr("type",{alertbanner:iB,bar:_r((t=oR("bar"),[Zr("type"),t])),button:uB,checkbox:sB,colorinput:pB,colorpicker:bB,dropzone:kB,grid:_r(OB(oR("grid"))),iframe:MB,input:RB,listbox:UB,selectbox:qB,sizeinput:XB,textarea:ZB,urlinput:nR,customeditor:CB,htmlpanel:zB,imagetools:NB,collection:gB,label:_r(LB(oR("label"))),table:JB,panel:uR});var t})),aR=[Zr("type"),mo("classes",[]),oo("items",iR)],uR=_r(aR),cR=[$r("name","name",lr((function(){return ia("tab-name")})),Nr),Zr("title"),oo("items",iR)],sR=[Zr("type"),ro("tabs",cR)],lR=_r(sR),fR=tB,dR=rB,mR=_r([Zr("title"),Jr("body",Pr("type",{panel:uR,tabpanel:lR})),po("size","normal"),oo("buttons",dR),mo("initialData",{}),yo("onAction",h),yo("onChange",h),yo("onSubmit",h),yo("onClose",h),yo("onCancel",h),mo("onTabChange",h)]),gR=_r(z([to("type",["cancel","custom"])],fR,!0)),hR=_r([Zr("title"),Zr("url"),uo("height"),uo("width"),lo("buttons",gR),yo("onAction",h),yo("onCancel",h),yo("onClose",h),yo("onMessage",h)]),pR=function(t){return i(t)?[t].concat(Q(bt(t),pR)):a(t)?Q(t,pR):[]},vR=function(t){return o(t.type)&&o(t.name)},bR={checkbox:lB,colorinput:vB,colorpicker:yB,dropzone:_B,input:HB,iframe:DB,sizeinput:KB,selectbox:GB,listbox:jB,size:KB,textarea:tR,urlinput:rR,customeditor:SB,collection:hB,togglemenuitem:QN},yR=function(t){var e=function(t){return G(pR(t),vR)}(t),n=Q(e,(function(t){return function(t){return B.from(bR[t.type])}(t).fold((function(){return[]}),(function(e){return[Jr(t.name,e)]}))}));return _r(n)},xR=function(t){return{internalDialog:jr(Ur("dialog",mR,t)),dataValidator:yR(t),initialData:t.initialData}},wR={open:function(t,e){var n=xR(e);return t(n.internalDialog,n.initialData,n.dataValidator)},openUrl:function(t,e){return t(jr(Ur("dialog",hR,e)))},redial:function(t){return xR(t)}},CR=function(t){var e=[],n={};return dt(t,(function(t,r){t.fold((function(){e.push(r)}),(function(t){n[r]=t}))})),e.length>0?qn.error(e):qn.value(n)},SR=function(t,e){var n=bp(uk.sketch((function(n){return{dom:{tag:"div",classes:["tox-form"].concat(t.classes)},components:j(t.items,(function(t){return cE(n,t,e)}))}})));return{dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[n.asSpec()]}],behaviours:wc([nh.config({mode:"acyclic",useTabstopAt:w(Hk)}),pk(n),_k(n,{postprocess:function(t){return CR(t).fold((function(t){return console.error(t),{}}),b)}})])}},kR=Dd({name:"TabButton",configFields:[mo("uid",void 0),Yr("value"),$r("dom","dom",dr((function(){return{attributes:{role:"tab",id:ia("aria"),"aria-selected":"false"}}})),Mr()),io("action"),mo("domModification",{}),zf("tabButtonBehaviours",[mh,nh,Ef]),Yr("view")],factory:function(t,e){return{uid:t.uid,dom:t.dom,components:t.components,events:Eh(t.action),behaviours:Mf(t.tabButtonBehaviours,[mh.config({}),nh.config({mode:"execution",useSpace:!0,useEnter:!0}),Ef.config({store:{mode:"memory",initialValue:t.value}})]),domModification:t.domModification}}}),_R=v([Yr("tabs"),Yr("dom"),mo("clickToDismiss",!1),zf("tabbarBehaviours",[um,nh]),Ou(["tabClass","selectedClass"])]),OR=ad({factory:kR,name:"tabs",unit:"tab",overrides:function(t){var e=function(t,e){um.dehighlight(t,e),Di(t,Ei(),{tabbar:t,button:e})},n=function(t,e){um.highlight(t,e),Di(t,Oi(),{tabbar:t,button:e})};return{action:function(r){var o=r.getSystem().getByUid(t.uid).getOrDie(),i=um.isHighlighted(o,r);(i&&t.clickToDismiss?e:i?h:n)(o,r)},domModification:{classes:[t.markers.tabClass]}}}}),ER=v([OR]),zR=Ad({name:"Tabbar",configFields:_R(),partFields:ER(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,"debug.sketcher":"Tabbar",domModification:{attributes:{role:"tablist"}},behaviours:Mf(t.tabbarBehaviours,[um.config({highlightClass:t.markers.selectedClass,itemClass:t.markers.tabClass,onHighlight:function(t,e){We(e.element,"aria-selected","true")},onDehighlight:function(t,e){We(e.element,"aria-selected","false")}}),nh.config({mode:"flow",getInitial:function(t){return um.getHighlighted(t).map((function(t){return t.element}))},selector:"."+t.markers.tabClass,executeOnMove:!0})])}}}),TR=Dd({name:"Tabview",configFields:[zf("tabviewBehaviours",[uh])],factory:function(t,e){return{uid:t.uid,dom:t.dom,behaviours:Mf(t.tabviewBehaviours,[uh.config({})]),domModification:{attributes:{role:"tabpanel"}}}}}),MR=v([mo("selectFirst",!0),zu("onChangeTab"),zu("onDismissTab"),mo("tabs",[]),zf("tabSectionBehaviours",[])]),DR=rd({factory:zR,schema:[Yr("dom"),no("markers",[Yr("tabClass"),Yr("selectedClass")])],name:"tabbar",defaults:function(t){return{tabs:t.tabs}}}),AR=rd({factory:TR,name:"tabview"}),NR=v([DR,AR]),BR=Ad({name:"TabSection",configFields:MR(),partFields:NR(),factory:function(t,e,n,r){var o=function(e,n){vd(e,t,"tabbar").each((function(t){n(t).each(Ai)}))};return{uid:t.uid,dom:t.dom,components:e,behaviours:Tf(t.tabSectionBehaviours),events:Hi(J([t.selectFirst?[$i((function(t,e){o(t,um.getFirst)}))]:[],[Pi(Oi(),(function(e,n){!function(e){var n=Ef.getValue(e);vd(e,t,"tabview").each((function(r){K(t.tabs,(function(t){return t.value===n})).each((function(n){var o=n.view();$e(e.element,"id").each((function(t){We(r.element,"aria-labelledby",t)})),uh.set(r,o),t.onChangeTab(r,e,o)}))}))}(n.event.button)})),Pi(Ei(),(function(e,n){var r=n.event.button;t.onDismissTab(e,r)}))]])),apis:{getViewItems:function(e){return vd(e,t,"tabview").map((function(t){return uh.contents(t)})).getOr([])},showTab:function(t,e){o(t,(function(t){var n=um.getCandidates(t);return K(n,(function(t){return Ef.getValue(t)===e})).filter((function(e){return!um.isHighlighted(t,e)}))}))}}}},apis:{getViewItems:function(t,e){return t.getViewItems(e)},showTab:function(t,e,n){t.showTab(e,n)}}}),RR=function(t,e){Qe(t,"height",e+"px"),pe().browser.isIE()?un(t,"flex-basis"):Qe(t,"flex-basis",e+"px")},HR=function(t,e,n){cu(t,'[role="dialog"]').each((function(t){lu(t,'[role="tablist"]').each((function(r){n.get().map((function(n){return Qe(e,"height","0"),Qe(e,"flex-basis","0"),Math.min(n,function(t,e,n){var r,o=ke(t).dom,i=cu(t,".tox-dialog-wrap").getOr(t);r="fixed"===en(i,"position")?Math.max(o.clientHeight,window.innerHeight):Math.max(o.offsetHeight,o.scrollHeight);var a=fn(e),u=e.dom.offsetLeft>=n.dom.offsetLeft+yn(n)?Math.max(fn(n),a):a,c=parseInt(en(t,"margin-top"),10)||0,s=parseInt(en(t,"margin-bottom"),10)||0;return r-(fn(t)+c+s-u)}(t,e,r))})).each((function(t){RR(e,t)}))}))}))},LR=function(t){return lu(t,'[role="tabpanel"]')},VR=function(t){var e;return{smartTabHeight:(e=ts(),{extraEvents:[$i((function(n){var r=n.element;LR(r).each((function(o){Qe(o,"visibility","hidden"),n.getSystem().getByDom(o).toOptional().each((function(n){(function(t){return at(ot(t,(function(t,e){return t>e?-1:tt}))?(e.set(i),HR(r,t,e)):o.each((function(e){RR(t,e)})),un(t,"visibility"),n.each(Mc)}))}))],selectFirst:!1}),naiveTabHeight:{extraEvents:[],selectFirst:!0}}},PR="send-data-to-section",IR="send-data-to-view",FR=function(t,e){var n=Co({}),r=function(t){var e=Ef.getValue(t),r=CR(e).getOr({}),o=n.get(),i=cr(o,r);n.set(i)},o=function(t){var e=n.get();Ef.setValue(t,e)},i=Co(null),a=j(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[uk.sketch((function(n){return{dom:{tag:"div",classes:["tox-form"]},components:j(t.items,(function(t){return cE(n,t,e)})),formBehaviours:wc([nh.config({mode:"acyclic",useTabstopAt:w(Hk)}),ch("TabView.form.events",[$i(o),Xi(r)]),Ec.config({channels:Eo([{key:PR,value:{onReceive:r}},{key:IR,value:{onReceive:o}}])})])}}))]}}})),u=VR(a).smartTabHeight;return BR.sketch({dom:{tag:"div",classes:["tox-dialog__body"]},onChangeTab:function(t,e,n){var r=Ef.getValue(e);Di(t,mw,{name:r,oldName:i.get()}),i.set(r)},tabs:a,components:[BR.parts.tabbar({dom:{tag:"div",classes:["tox-dialog__body-nav"]},components:[zR.parts.tabs({})],markers:{tabClass:"tox-tab",selectedClass:"tox-dialog__body-nav-item--active"},tabbarBehaviours:wc([tw.config({})])}),BR.parts.tabview({dom:{tag:"div",classes:["tox-dialog__body-content"]}})],selectFirst:u.selectFirst,tabSectionBehaviours:wc([ch("tabpanel",u.extraEvents),nh.config({mode:"acyclic"}),Hd.config({find:function(t){return at(BR.getViewItems(t))}}),Ef.config({store:{mode:"manual",getValue:function(t){return t.getSystem().broadcastOn([PR],{}),n.get()},setValue:function(t,e){n.set(e),t.getSystem().broadcastOn([IR],{})}}})])})},UR=ia("update-dialog"),jR=ia("update-title"),WR=ia("update-body"),qR=ia("update-footer"),GR=ia("body-send-message"),$R=function(t,e,n,r){return{dom:{tag:"div",classes:["tox-dialog__content-js"],attributes:O(O({},e.map((function(t){return{id:t}})).getOr({})),r?{"aria-live":"polite"}:{})},components:[],behaviours:wc([vk(0),cD.config({channel:WR,updateState:function(t,e){return B.some({isTabPanel:function(){return"tabpanel"===e.body.type}})},renderComponents:function(t){switch(t.body.type){case"tabpanel":return[FR(t.body,n)];default:return[SR(t.body,n)]}},initialData:t})])}},XR=iy.deviceType.isTouch(),KR=function(t,e){return{dom:{tag:"div",styles:{display:"none"},classes:["tox-dialog__header"]},components:[t,e]}},YR=function(t,e){return YN.parts.close(vp.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":e.translate("Close")}},action:t,buttonBehaviours:wc([tw.config({})])}))},JR=function(){return YN.parts.title({dom:{tag:"div",classes:["tox-dialog__title"],innerHtml:"",styles:{display:"none"}}})},QR=function(t,e){return YN.parts.body({dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[{dom:DT("

"+e.translate(t)+"

")}]}]})},ZR=function(t){return YN.parts.footer({dom:{tag:"div",classes:["tox-dialog__footer"]},components:t})},tH=function(t,e){return[$x.sketch({dom:{tag:"div",classes:["tox-dialog__footer-start"]},components:t}),$x.sketch({dom:{tag:"div",classes:["tox-dialog__footer-end"]},components:e})]},eH=function(t){var e,n="tox-dialog",r=n+"-wrap",o=r+"__backdrop",i=n+"__disable-scroll";return YN.sketch({lazySink:t.lazySink,onEscape:function(e){return t.onEscape(e),B.some(!0)},useTabstopAt:function(t){return!Hk(t)},dom:{tag:"div",classes:[n].concat(t.extraClasses),styles:O({position:"relative"},t.extraStyles)},components:z([t.header,t.body],t.footer.toArray(),!0),parts:{blocker:{dom:DT('
'),components:[{dom:{tag:"div",classes:XR?[o,o+"--opaque"]:[o]}}]}},dragBlockClass:r,modalBehaviours:wc(z([mh.config({}),ch("dialog-events",t.dialogEvents.concat([Gi(Go(),(function(t,e){nh.focusIn(t)}))])),ch("scroll-lock",[$i((function(){Va(Fe(),i)})),Xi((function(){Ia(Fe(),i)}))])],t.extraBehaviours,!0)),eventOrder:O((e={},e[si()]=["dialog-events"],e[xi()]=["scroll-lock","dialog-events","alloy.base.behaviour"],e[wi()]=["alloy.base.behaviour","dialog-events","scroll-lock"],e),t.eventOrder)})},nH=function(t){return vp.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:[zp("close",{tag:"div",classes:["tox-icon"]},t.icons)],action:function(t){Mi(t,cw)}})},rH=function(t,e,n){var r=function(t){return[Qa(n.translate(t.title))]};return{dom:{tag:"div",classes:["tox-dialog__title"],attributes:O({},e.map((function(t){return{id:t}})).getOr({}))},components:r(t),behaviours:wc([cD.config({channel:jR,renderComponents:r})])}},oH=function(){return{dom:DT('
')}},iH=function(t,e){return function(t,e){var n=YN.parts.title(rH(t,B.none(),e)),r=YN.parts.draghandle(oH()),o=YN.parts.close(nH(e)),i=[n].concat(t.draggable?[r]:[]).concat([o]);return $x.sketch({dom:DT('
'),components:i})}({title:e.shared.providers.translate(t),draggable:e.dialog.isDraggableModal()},e.shared.providers)},aH=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:DT('
')}]}},uH=function(t,e,n){return{onClose:function(){return n.closeWindow()},onBlock:function(n){YN.setBusy(t(),(function(t,r){return aH(n.message,r,e)}))},onUnblock:function(){YN.setIdle(t())}}},cH=function(t,e,n,r){var o;return eu(eH(O(O({},t),{lazySink:r.shared.getSink,extraBehaviours:z([cD.config({channel:UR,updateState:function(t,e){return B.some(e)},initialData:e}),zk({})],t.extraBehaviours,!0),onEscape:function(t){Mi(t,cw)},dialogEvents:n,eventOrder:(o={},o[ci()]=[cD.name(),Ec.name()],o[xi()]=["scroll-lock",cD.name(),"messages","dialog-events","alloy.base.behaviour"],o[wi()]=["alloy.base.behaviour","dialog-events","messages",cD.name(),"scroll-lock"],o)})))},sH=function(t){return j(t,(function(t){return"menu"===t.type?function(t){var e=j(t.items,(function(t){var e=Co(!1);return O(O({},t),{storage:e})}));return O(O({},t),{items:e})}(t):t}))},lH=function(t){return X(t,(function(t,e){return"menu"===e.type?X(e.items,(function(t,e){return t[e.name]=e.storage,t}),t):t}),{})},fH=function(t,e){return[ji(Go(),Rk),t(uw,(function(t,n){e.onClose(),n.onClose()})),t(cw,(function(t,e,n,r){e.onCancel(t),Mi(r,uw)})),Pi(dw,(function(t,n){return e.onUnblock()})),Pi(fw,(function(t,n){return e.onBlock(n.event)}))]},dH=function(t,e){var n=function(e,n){return Pi(e,(function(e,o){r(e,(function(r,i){n(t(),r,o.event,e)}))}))},r=function(t,e){cD.getState(t).get().each((function(n){e(n,t)}))};return z(z([],fH(n,e),!0),[n(sw,(function(t,e,n){e.onAction(t,{name:n.name})}))],!1)},mH=function(t,e,n){var r=function(e,n){return Pi(e,(function(e,r){o(e,(function(o,i){n(t(),o,r.event,e)}))}))},o=function(t,e){cD.getState(t).get().each((function(n){e(n.internalDialog,t)}))};return z(z([],fH(r,e),!0),[r(lw,(function(t,e){return e.onSubmit(t)})),r(aw,(function(t,e,n){e.onChange(t,{name:n.name})})),r(sw,(function(t,e,r,o){var i=function(){return nh.focusIn(o)},a=function(t){return Xe(t,"disabled")||$e(t,"aria-disabled").exists((function(t){return"true"===t}))},u=Re(o.element),c=Ac(u);e.onAction(t,{name:r.name,value:r.value}),Ac(u).fold(i,(function(t){a(t)||c.exists((function(e){return we(t,e)&&a(e)}))?i():n().toOptional().filter((function(e){return!we(e.element,t)})).each(i)}))})),r(mw,(function(t,e,n){e.onTabChange(t,{newTabName:n.name,oldTabName:n.oldName})})),Xi((function(e){var n=t();Ef.setValue(e,n.getData())}))],!1)},gH=function(t,e){var n=e.map((function(t){return t.footerButtons})).getOr([]),r=q(n,(function(t){return"start"===t.align})),o=function(t,e){return $x.sketch({dom:{tag:"div",classes:["tox-dialog__footer-"+t]},components:j(e,(function(t){return t.memento.asSpec()}))})};return[o("start",r.pass),o("end",r.fail)]},hH=function(t,e){return{dom:DT(''),components:[],behaviours:wc([cD.config({channel:qR,initialData:t,updateState:function(t,n){var r=j(n.buttons,(function(t){var n=bp(function(t,e){return Y_(t,t.type,e)}(t,e));return{name:t.name,align:t.align,memento:n}}));return B.some({lookupByName:function(t,e){return function(t,e,n){return K(e,(function(t){return t.name===n})).bind((function(e){return e.memento.getOpt(t)}))}(t,r,e)},footerButtons:r})},renderComponents:gH})])}},pH=function(t,e){return YN.parts.footer(hH(t,e))},vH=function(t,e){if(t.getRoot().getSystem().isConnected()){var n=Hd.getCurrent(t.getFormWrapper()).getOr(t.getFormWrapper());return uk.getField(n,e).fold((function(){var r=t.getFooter();return cD.getState(r).get().bind((function(t){return t.lookupByName(n,e)}))}),(function(t){return B.some(t)}))}return B.none()},bH=function(t,e,n){var r=function(e){var n=t.getRoot();n.getSystem().isConnected()&&e(n)},i={getData:function(){var e=t.getRoot(),r=e.getSystem().isConnected()?t.getFormWrapper():e,o=Ef.getValue(r),i=mt(n,(function(t){return t.get()}));return O(O({},o),i)},setData:function(e){r((function(r){var o=i.getData(),a=O(O({},o),e),u=function(t,e){var n=t.getRoot();return cD.getState(n).get().map((function(t){return jr(Ur("data",t.dataValidator,e))})).getOr(e)}(t,a),c=t.getFormWrapper();Ef.setValue(c,u),dt(n,(function(t,e){xt(a,e)&&t.set(a[e])}))}))},disable:function(e){vH(t,e).each(Yd.disable)},enable:function(e){vH(t,e).each(Yd.enable)},focus:function(e){vH(t,e).each(mh.focus)},block:function(t){if(!o(t))throw new Error("The dialogInstanceAPI.block function should be passed a blocking message of type string as an argument");r((function(e){Di(e,fw,{message:t})}))},unblock:function(){r((function(t){Mi(t,dw)}))},showTab:function(e){r((function(n){var r=t.getBody();cD.getState(r).get().exists((function(t){return t.isTabPanel()}))&&Hd.getCurrent(r).each((function(t){BR.showTab(t,e)}))}))},redial:function(t){r((function(n){var r=e(t);n.getSystem().broadcastOn([UR],r),n.getSystem().broadcastOn([jR],r.internalDialog),n.getSystem().broadcastOn([WR],r.internalDialog),n.getSystem().broadcastOn([qR],r.internalDialog),i.setData(r.initialData)}))},close:function(){r((function(t){Mi(t,uw)}))}};return i},yH=function(t,e,n){var r=iH(t.internalDialog.title,n),o=function(t,e){var n=$R(t,B.none(),e,!1);return YN.parts.body(n)}({body:t.internalDialog.body},n),i=sH(t.internalDialog.buttons),a=lH(i),u=pH({buttons:i},n),c=mH((function(){return m}),uH((function(){return f}),n.shared.providers,e),n.shared.getSink),s=function(t){switch(t){case"large":return["tox-dialog--width-lg"];case"medium":return["tox-dialog--width-md"];default:return[]}}(t.internalDialog.size),l={header:r,body:o,footer:B.some(u),extraClasses:s,extraBehaviours:[],extraStyles:{}},f=cH(l,t,c,n),d={getRoot:v(f),getBody:function(){return YN.getBody(f)},getFooter:function(){return YN.getFooter(f)},getFormWrapper:function(){var t=YN.getBody(f);return Hd.getCurrent(t).getOr(t)}},m=bH(d,e.redial,a);return{dialog:f,instanceApi:m}},xH=function(t,e,n,r){var o,i,a,u,c,s=ia("dialog-label"),l=ia("dialog-content"),f=bp((a={title:t.internalDialog.title,draggable:!0},u=s,c=n.shared.providers,$x.sketch({dom:DT('
'),components:[rH(a,B.some(u),c),oH(),nH(c)],containerBehaviours:wc([RN.config({mode:"mouse",blockerClass:"blocker",getTarget:function(t){return fu(t,'[role="dialog"]').getOrDie()},snaps:{getSnapPoints:function(){return[]},leftAttr:"data-drag-left",topAttr:"data-drag-top"}})])}))),d=bp(function(t,e,n,r){return $R(t,B.some(e),n,r)}({body:t.internalDialog.body},l,n,r)),m=sH(t.internalDialog.buttons),g=lH(m),h=bp(function(t,e){return hH(t,e)}({buttons:m},n)),p=mH((function(){return y}),{onBlock:function(t){MT.block(b,(function(e,r){return aH(t.message,r,n.shared.providers)}))},onUnblock:function(){MT.unblock(b)},onClose:function(){return e.closeWindow()}},n.shared.getSink),b=eu({dom:{tag:"div",classes:["tox-dialog","tox-dialog-inline"],attributes:(o={role:"dialog"},o["aria-labelledby"]=s,o["aria-describedby"]=l,o)},eventOrder:(i={},i[ci()]=[cD.name(),Ec.name()],i[si()]=["execute-on-form"],i[xi()]=["reflecting","execute-on-form"],i),behaviours:wc([nh.config({mode:"cyclic",onEscape:function(t){return Mi(t,uw),B.some(!0)},useTabstopAt:function(t){return!Hk(t)&&("button"!==Ht(t)||"disabled"!==Ge(t,"disabled"))}}),cD.config({channel:UR,updateState:function(t,e){return B.some(e)},initialData:t}),mh.config({}),ch("execute-on-form",p.concat([Gi(Go(),(function(t,e){nh.focusIn(t)}))])),MT.config({getRoot:function(){return B.some(b)}}),uh.config({}),zk({})]),components:[f.asSpec(),d.asSpec(),h.asSpec()]}),y=bH({getRoot:v(b),getFooter:function(){return h.get(b)},getBody:function(){return d.get(b)},getFormWrapper:function(){var t=d.get(b);return Hd.getCurrent(t).getOr(t)}},e.redial,g);return{dialog:b,instanceApi:y}},wH=tinymce.util.Tools.resolve("tinymce.util.URI"),CH=["insertContent","setContent","execCommand","close","block","unblock"],SH=function(t){return i(t)&&-1!==CH.indexOf(t.mceAction)},kH=function(t,e,n,r){var a,u,s,l=iH(t.title,r),f=function(t){var e={dom:{tag:"div",classes:["tox-dialog__content-js"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-iframe"]},components:[Nk({dom:{tag:"iframe",attributes:{src:t.url}},behaviours:wc([tw.config({}),mh.config({})])})]}],behaviours:wc([nh.config({mode:"acyclic",useTabstopAt:w(Hk)})])};return YN.parts.body(e)}(t),d=t.buttons.bind((function(t){return 0===t.length?B.none():B.some(pH({buttons:t},r))})),m=dH((function(){return C}),uH((function(){return x}),r.shared.providers,e)),g=O(O({},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"}}))),h=t.width.isNone()&&t.height.isNone()?["tox-dialog--width-lg"]:[],p=new wH(t.url,{base_uri:new wH(window.location.href)}),v=p.protocol+"://"+p.host+(p.port?":"+p.port:""),b=Zc(),y=[ch("messages",[$i((function(){var e=ns(Bt.fromDom(window),"message",(function(e){if(p.isSameOrigin(new wH(e.raw.origin))){var r=e.raw.data;SH(r)?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=!!c(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()}}(n,C,r):function(t){return!SH(t)&&i(t)&&xt(t,"mceAction")}(r)&&t.onMessage(C,r)}}));b.set(e)})),Xi(b.clear)]),Ec.config({channels:(a={},a[GR]={onReceive:function(t,e){lu(t.element,"iframe").each((function(t){t.dom.contentWindow.postMessage(e,v)}))}},a)})],x=cH({header:l,body:f,footer:d,extraClasses:h,extraBehaviours:y,extraStyles:g},t,m,r),C=(u=x,s=function(t){u.getSystem().isConnected()&&t(u)},{block:function(t){if(!o(t))throw new Error("The urlDialogInstanceAPI.block function should be passed a blocking message of type string as an argument");s((function(e){Di(e,fw,{message:t})}))},unblock:function(){s((function(t){Mi(t,dw)}))},close:function(){s((function(t){Mi(t,uw)}))},sendMessage:function(t){s((function(e){e.getSystem().broadcastOn([GR],t)}))}});return{dialog:x,instanceApi:C}},_H=function(t,e,n){return e&&n?[]:[Hz.config({contextual:{lazyContext:function(){return B.some(In(Bt.fromDom(t.getContentAreaContainer())))},fadeInClass:"tox-dialog-dock-fadein",fadeOutClass:"tox-dialog-dock-fadeout",transitionClass:"tox-dialog-dock-transition"},modes:["top"]})]},OH=function(t){var e=t.backstage,n=t.editor,r=Lb(n),o=function(t){var e=t.backstage.shared;return{open:function(n,r){var o=function(){YN.hide(c),r()},i=bp(Y_({name:"close-alert",text:"OK",primary:!0,align:"end",disabled:!1,icon:B.none()},"cancel",t.backstage)),a=JR(),u=YR(o,e.providers),c=eu(eH({lazySink:function(){return e.getSink()},header:KR(a,u),body:QR(n,e.providers),footer:B.some(ZR(tH([],[i.asSpec()]))),onEscape:o,extraClasses:["tox-alert-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[Pi(cw,o)],eventOrder:{}}));YN.show(c);var s=i.get(c);mh.focus(s)}}}(t),i=function(t){var e=t.backstage.shared;return{open:function(n,r){var o=function(t){YN.hide(s),r(t)},i=bp(Y_({name:"yes",text:"Yes",primary:!0,align:"end",disabled:!1,icon:B.none()},"submit",t.backstage)),a=Y_({name:"no",text:"No",primary:!1,align:"end",disabled:!1,icon:B.none()},"cancel",t.backstage),u=JR(),c=YR((function(){return o(!1)}),e.providers),s=eu(eH({lazySink:function(){return e.getSink()},header:KR(u,c),body:QR(n,e.providers),footer:B.some(ZR(tH([],[a,i.asSpec()]))),onEscape:function(){return o(!1)},extraClasses:["tox-confirm-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[Pi(cw,(function(){return o(!1)})),Pi(lw,(function(){return o(!0)}))],eventOrder:{}}));YN.show(s);var l=i.get(s);mh.focus(l)}}}(t),a=function(t,r){return wR.openUrl((function(t){var o=kH(t,{closeWindow:function(){YN.hide(o.dialog),r(o.instanceApi)}},n,e);return YN.show(o.dialog),o.instanceApi}),t)},u=function(t,n){return wR.open((function(t,r,o){var i=r,a=yH({dataValidator:o,initialData:i,internalDialog:t},{redial:wR.redial,closeWindow:function(){YN.hide(a.dialog),n(a.instanceApi)}},e);return YN.show(a.dialog),a.instanceApi.setData(i),a.instanceApi}),t)},c=function(t,o,i,a){return wR.open((function(t,u,c){var s=jr(Ur("data",c,u)),l=ts(),f=e.shared.header.isPositionedAtTop(),d=function(){return l.on((function(t){Yh.reposition(t),Hz.refresh(t)}))},m=xH({dataValidator:c,initialData:s,internalDialog:t},{redial:wR.redial,closeWindow:function(){l.on(Yh.hide),n.off("ResizeEditor",d),l.clear(),i(m.instanceApi)}},e,a),g=eu(Yh.sketch(O(O({lazySink:e.shared.getSink,dom:{tag:"div",classes:[]},fireDismissalEventInstead:{}},f?{}:{fireRepositionEventInstead:{}}),{inlineBehaviours:wc(z([ch("window-manager-inline-events",[Pi(Ci(),(function(t,e){Mi(m.dialog,cw)}))])],_H(n,r,f),!0)),isExtraPart:function(t,e){return function(t){return Nx(t,".tox-alert-dialog")||Nx(t,".tox-confirm-dialog")}(e)}})));return l.set(g),Yh.showWithin(g,nu(m.dialog),{anchor:o},B.some(Fe())),r&&f||(Hz.refresh(g),n.on("ResizeEditor",d)),m.instanceApi.setData(s),nh.focusIn(m.dialog),m.instanceApi}),t)};return{open:function(t,n,r){return void 0!==n&&"toolbar"===n.inline?c(t,e.shared.anchors.inlineDialog(),r,n.ariaAttrs):void 0!==n&&"cursor"===n.inline?c(t,e.shared.anchors.cursor(),r,n.ariaAttrs):u(t,r)},openUrl:function(t,e){return a(t,e)},alert:function(t,e){o.open(t,(function(){e()}))},close:function(t){t.close()},confirm:function(t,e){i.open(t,(function(t){e(t)}))}}};_.add("silver",(function(t){var e=GN(t),n=e.uiMothership,r=e.backstage,o=e.renderUI,i=e.getUi;Ax(t,r.shared);var a=OH({editor:t,backstage:r});return{renderUI:o,getWindowManagerImpl:v(a),getNotificationManagerImpl:function(){return Dp(t,{backstage:r},n)},ui:i()}}))}()},7575:(t,e,n)=>{!function(){"use strict";var e=function(t){if(null===t)return"null";if(void 0===t)return"undefined";var e=typeof t;return"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},r=function(t){return{eq:t}},o=r((function(t,e){return t===e})),i=function(t){return r((function(e,n){if(e.length!==n.length)return!1;for(var r=e.length,o=0;o-1},j=function(t,e){for(var n=0,r=t.length;n=0;n--){e(t[n],n)}},$=function(t,e){for(var n=[],r=[],o=0,i=t.length;o=0&&e=e.length&&t.substr(n,n+e.length)===e}(t,e,0)},Pt=function(t){return function(e){return e.replace(t,"")}},It=Pt(/^\s+|\s+$/g),Ft=Pt(/^\s+/g),Ut=Pt(/\s+$/g),jt=function(t){return t.length>0},Wt=function(t){return!jt(t)},qt=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Gt=function(t){return function(e){return Lt(e,t)}},$t=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return Lt(t,"edge/")&&Lt(t,"chrome")&&Lt(t,"safari")&&Lt(t,"applewebkit")}},{name:"Chrome",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,qt],search:function(t){return Lt(t,"chrome")&&!Lt(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return Lt(t,"msie")||Lt(t,"trident")}},{name:"Opera",versionRegexes:[qt,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Gt("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Gt("firefox")},{name:"Safari",versionRegexes:[qt,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(Lt(t,"safari")||Lt(t,"mobile/"))&&Lt(t,"applewebkit")}}],Xt=[{name:"Windows",search:Gt("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return Lt(t,"iphone")||Lt(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Gt("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:Gt("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Gt("linux"),versionRegexes:[]},{name:"Solaris",search:Gt("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Gt("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:Gt("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],Kt={browsers:_($t),oses:_(Xt)},Yt="Edge",Jt="Chrome",Qt="Opera",Zt="Firefox",te="Safari",ee=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isEdge:r(Yt),isChrome:r(Jt),isIE:r("IE"),isOpera:r(Qt),isFirefox:r(Zt),isSafari:r(te)}},ne={unknown:function(){return ee({current:void 0,version:Rt.unknown()})},nu:ee,edge:_(Yt),chrome:_(Jt),ie:_("IE"),opera:_(Qt),firefox:_(Zt),safari:_(te)},re="Windows",oe="Android",ie="Linux",ae="Solaris",ue="FreeBSD",ce="ChromeOS",se=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isWindows:r(re),isiOS:r("iOS"),isAndroid:r(oe),isOSX:r("OSX"),isLinux:r(ie),isSolaris:r(ae),isFreeBSD:r(ue),isChromeOS:r(ce)}},le={unknown:function(){return se({current:void 0,version:Rt.unknown()})},nu:se,windows:_(re),ios:_("iOS"),android:_(oe),linux:_(ie),osx:_("OSX"),solaris:_(ae),freebsd:_(ue),chromeos:_(ce)},fe=function(t,e,n){var r=Kt.browsers(),o=Kt.oses(),i=e.bind((function(t){return function(t,e){return st(e.brands,(function(e){var n=e.brand.toLowerCase();return Q(t,(function(t){var e;return n===(null===(e=t.brand)||void 0===e?void 0:e.toLowerCase())})).map((function(t){return{current:t.name,version:Rt.nu(parseInt(e.version,10),0)}}))}))}(r,t)})).orThunk((function(){return function(t,e){return Ht(t,e).map((function(t){var n=Rt.detect(t.versionRegexes,e);return{current:t.name,version:n}}))}(r,t)})).fold(ne.unknown,ne.nu),a=function(t,e){return Ht(t,e).map((function(t){var n=Rt.detect(t.versionRegexes,e);return{current:t.name,version:n}}))}(o,t).fold(le.unknown,le.nu),u=function(t,e,n,r){var o=t.isiOS()&&!0===/ipad/i.test(n),i=t.isiOS()&&!o,a=t.isiOS()||t.isAndroid(),u=a||r("(pointer:coarse)"),c=o||!i&&a&&r("(min-device-width:768px)"),s=i||a&&!c,l=e.isSafari()&&t.isiOS()&&!1===/safari/i.test(n),f=!s&&!c&&!l;return{isiPad:_(o),isiPhone:_(i),isTablet:_(c),isPhone:_(s),isTouch:_(u),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:_(l),isDesktop:_(f)}}(a,i,t,n);return{browser:i,os:a,deviceType:u}},de=function(t){return window.matchMedia(t).matches},me=At((function(){return fe(navigator.userAgent,L.from(navigator.userAgentData),de)})),ge=function(){return me()},he=navigator.userAgent,pe=ge(),ve=pe.browser,be=pe.os,ye=pe.deviceType,xe=/WebKit/.test(he)&&!ve.isEdge(),we="FormData"in window&&"FileReader"in window&&"URL"in window&&!!URL.createObjectURL,Ce=-1!==he.indexOf("Windows Phone"),Se={opera:ve.isOpera(),webkit:xe,ie:!(!ve.isIE()&&!ve.isEdge())&&ve.version.major,gecko:ve.isFirefox(),mac:be.isOSX()||be.isiOS(),iOS:ye.isiPad()||ye.isiPhone(),android:be.isAndroid(),contentEditable:!0,transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",caretAfter:!0,range:window.getSelection&&"Range"in window,documentMode:ve.isIE()?document.documentMode||7:10,fileApi:we,ceFalse:!0,cacheSuffix:null,container:null,experimentalShadowDom:!1,canHaveCSP:!ve.isIE(),desktop:ye.isDesktop(),windowsPhone:Ce,browser:{current:ve.current,version:ve.version,isChrome:ve.isChrome,isEdge:ve.isEdge,isFirefox:ve.isFirefox,isIE:ve.isIE,isOpera:ve.isOpera,isSafari:ve.isSafari},os:{current:be.current,version:be.version,isAndroid:be.isAndroid,isChromeOS:be.isChromeOS,isFreeBSD:be.isFreeBSD,isiOS:be.isiOS,isLinux:be.isLinux,isOSX:be.isOSX,isSolaris:be.isSolaris,isWindows:be.isWindows},deviceType:{isDesktop:ye.isDesktop,isiPad:ye.isiPad,isiPhone:ye.isiPhone,isPhone:ye.isPhone,isTablet:ye.isTablet,isTouch:ye.isTouch,isWebView:ye.isWebView}},ke=/^\s*|\s*$/g,_e=function(t){return null==t?"":(""+t).replace(ke,"")},Oe=function(t,e){return e?!("array"!==e||!Ct(t))||typeof t===e:void 0!==t},Ee=function(t,e,n,r){r=r||this,t&&(n&&(t=t[n]),St(t,(function(t,o){if(!1===e.call(r,t,o,n))return!1;Ee(t,e,n,r)})))},ze={trim:_e,isArray:Ct,is:Oe,toArray:function(t){if(Ct(t))return t;for(var e=[],n=0,r=t.length;n1)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return Te(n.childNodes[0])},fromTag:function(t,e){var n=(e||document).createElement(t);return Te(n)},fromText:function(t,e){var n=(e||document).createTextNode(t);return Te(n)},fromDom:Te,fromPoint:function(t,e,n){return L.from(t.dom.elementFromPoint(e,n)).map(Te)}},De=function(t,e){var n=[],r=function(t){return n.push(t),e(t)},o=e(t);do{o=o.bind(r)}while(o.isSome());return n},Ae=function(t,e){var n=t.dom;if(1!==n.nodeType)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")},Ne=function(t){return 1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType||0===t.childElementCount},Be=function(t,e){return t.dom===e.dom},Re=function(t,e){return n=t.dom,r=e.dom,function(t,e,n){return 0!=(t.compareDocumentPosition(e)&n)}(n,r,Node.DOCUMENT_POSITION_CONTAINED_BY);var n,r},He=function(t,e){return ge().browser.isIE()?Re(t,e):function(t,e){var n=t.dom,r=e.dom;return n!==r&&n.contains(r)}(t,e)};"undefined"!=typeof window?window:Function("return this;")();var Le=function(t){return t.dom.nodeName.toLowerCase()},Ve=function(t){return t.dom.nodeType},Pe=function(t){return function(e){return Ve(e)===t}},Ie=Pe(1),Fe=Pe(3),Ue=Pe(9),je=Pe(11),We=function(t){return Me.fromDom(t.dom.ownerDocument)},qe=function(t){return Ue(t)?t:We(t)},Ge=function(t){return Me.fromDom(qe(t).dom.defaultView)},$e=function(t){return L.from(t.dom.parentNode).map(Me.fromDom)},Xe=function(t){return L.from(t.dom.previousSibling).map(Me.fromDom)},Ke=function(t){return L.from(t.dom.nextSibling).map(Me.fromDom)},Ye=function(t){return nt(De(t,Xe))},Je=function(t){return De(t,Ke)},Qe=function(t){return W(t.dom.childNodes,Me.fromDom)},Ze=function(t,e){var n=t.dom.childNodes;return L.from(n[e]).map(Me.fromDom)},tn=function(t){return Ze(t,0)},en=function(t){return Ze(t,t.dom.childNodes.length-1)},nn=function(t){return t.dom.childNodes.length},rn=function(t){return je(t)&&y(t.dom.host)},on=x(Element.prototype.attachShadow)&&x(Node.prototype.getRootNode),an=_(on),un=on?function(t){return Me.fromDom(t.dom.getRootNode())}:qe,cn=function(t){return rn(t)?t:function(t){var e=t.dom.head;if(null==e)throw new Error("Head is not available yet");return Me.fromDom(e)}(qe(t))},sn=function(t){return Me.fromDom(t.dom.host)},ln=function(t){return y(t.dom.shadowRoot)},fn=function(t,e){$e(t).each((function(n){n.dom.insertBefore(e.dom,t.dom)}))},dn=function(t,e){Ke(t).fold((function(){$e(t).each((function(t){gn(t,e)}))}),(function(t){fn(t,e)}))},mn=function(t,e){tn(t).fold((function(){gn(t,e)}),(function(n){t.dom.insertBefore(e.dom,n.dom)}))},gn=function(t,e){t.dom.appendChild(e.dom)},hn=function(t,e){q(e,(function(e){gn(t,e)}))},pn=function(t){t.dom.textContent="",q(Qe(t),(function(t){vn(t)}))},vn=function(t){var e=t.dom;null!==e.parentNode&&e.parentNode.removeChild(e)},bn=function(t){var e,n=Qe(t);n.length>0&&(e=t,q(n,(function(t){fn(e,t)}))),vn(t)},yn=function(t){var e=Fe(t)?t.dom.parentNode:t.dom;if(null==e||null===e.ownerDocument)return!1;var n=e.ownerDocument;return function(t){var e=un(t);return rn(e)?L.some(e):L.none()}(Me.fromDom(e)).fold((function(){return n.body.contains(e)}),k(yn,sn))},xn=function(t,e){return{left:t,top:e,translate:function(n,r){return xn(t+n,e+r)}}},wn=xn,Cn=function(t,e){return void 0!==t?t:void 0!==e?e:0},Sn=function(t){var e=t.dom,n=e.ownerDocument.body;return n===e?wn(n.offsetLeft,n.offsetTop):yn(t)?function(t){var e=t.getBoundingClientRect();return wn(e.left,e.top)}(e):wn(0,0)},kn=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 wn(n,r)},_n=function(t,e,n){var r=(void 0!==n?n.dom:document).defaultView;r&&r.scrollTo(t,e)},On=function(t,e){ge().browser.isSafari()&&x(t.dom.scrollIntoViewIfNeeded)?t.dom.scrollIntoViewIfNeeded(!1):t.dom.scrollIntoView(e)},En=function(t,e,n,r){return{x:t,y:e,width:n,height:r,right:t+n,bottom:e+r}},zn=function(t){var e=void 0===t?window:t,n=e.document,r=kn(Me.fromDom(n));return function(t){var e=void 0===t?window:t;return ge().browser.isFirefox()?L.none():L.from(e.visualViewport)}(e).fold((function(){var t=e.document.documentElement,n=t.clientWidth,o=t.clientHeight;return En(r.left,r.top,n,o)}),(function(t){return En(Math.max(t.pageLeft,r.left),Math.max(t.pageTop,r.top),t.width,t.height)}))},Tn=function(t){return function(e){return!!e&&e.nodeType===t}},Mn=function(t){return!!t&&!Object.getPrototypeOf(t)},Dn=Tn(1),An=function(t){var e=t.map((function(t){return t.toLowerCase()}));return function(t){if(t&&t.nodeName){var n=t.nodeName.toLowerCase();return U(e,n)}return!1}},Nn=function(t,e){var n=e.toLowerCase().split(" ");return function(e){if(Dn(e))for(var r=0;r0}))},cr=function(t){var e={},n=t.dom;if(Jn(n))for(var r=0;r=t.length&&e(n)}}(i))}))}))},Cr=function(t){return{isValue:N,isError:A,getOr:_(t),getOrThunk:_(t),getOrDie:_(t),or:function(e){return Cr(t)},orThunk:function(e){return Cr(t)},fold:function(e,n){return n(t)},map:function(e){return Cr(e(t))},mapError:function(e){return Cr(t)},each:function(e){e(t)},bind:function(e){return e(t)},exists:function(e){return e(t)},forall:function(e){return e(t)},toOptional:function(){return L.some(t)}}},Sr=function(t){return{isValue:A,isError:N,getOr:O,getOrThunk:function(t){return t()},getOrDie:function(){return(e=String(t),function(){throw new Error(e)})();var e},or:O,orThunk:function(t){return t()},fold:function(e,n){return e(t)},map:function(e){return Sr(t)},mapError:function(e){return Sr(e(t))},each:C,bind:function(e){return Sr(t)},exists:A,forall:N,toOptional:L.none}},kr={value:Cr,error:Sr,fromOption:function(t,e){return t.fold((function(){return Sr(e)}),Cr)}},_r=function(t){if(!g(t))throw new Error("cases must be an array");if(0===t.length)throw new Error("there must be at least one case");var e=[],n={};return q(t,(function(r,o){var i=lt(r);if(1!==i.length)throw new Error("one and only one name per case");var a=i[0],u=r[a];if(void 0!==n[a])throw new Error("duplicate key detected:"+a);if("cata"===a)throw new Error("cannot have a case named cata (sorry)");if(!g(u))throw new Error("case arguments must be an array");e.push(a),n[a]=function(){for(var n=[],r=0;r0?n(r.fail.map(Or)):e(r.pass.map(Or))}))},unload:s,unloadAll:function(t){q(t,(function(t){s(t)}))},_setReferrerPolicy:function(t){e.referrerPolicy=t}}},ao=function(){var t=new WeakMap;return{forElement:function(e,n){var r=un(e).dom;return L.from(t.get(r)).getOrThunk((function(){var e=io(r,n);return t.set(r,e),e}))}}}(),uo=function(){function t(t,e){this.node=t,this.rootNode=e,this.current=this.current.bind(this),this.next=this.next.bind(this),this.prev=this.prev.bind(this),this.prev2=this.prev2.bind(this)}return t.prototype.current=function(){return this.node},t.prototype.next=function(t){return this.node=this.findSibling(this.node,"firstChild","nextSibling",t),this.node},t.prototype.prev=function(t){return this.node=this.findSibling(this.node,"lastChild","previousSibling",t),this.node},t.prototype.prev2=function(t){return this.node=this.findPreviousNode(this.node,"lastChild","previousSibling",t),this.node},t.prototype.findSibling=function(t,e,n,r){var o,i;if(t){if(!r&&t[e])return t[e];if(t!==this.rootNode){if(o=t[n])return o;for(i=t.parentNode;i&&i!==this.rootNode;i=i.parentNode)if(o=i[n])return o}}},t.prototype.findPreviousNode=function(t,e,n,r){var o,i,a;if(t){if(o=t[n],this.rootNode&&o===this.rootNode)return;if(o){if(!r)for(a=o[e];a;a=a[e])if(!a[e])return a;return o}if((i=t.parentNode)&&i!==this.rootNode)return i}},t}(),co=function(t){var e;return function(n){return e=e||function(t,e){for(var n={},r=0,o=t.length;r0&&function(t,e){var n=new uo(t,e).prev(!1),r=new uo(t,e).next(!1),o=v(n)||ni(n,e),i=v(r)||ni(r,e);return o&&i}(t,e)},ii=function(t,e,n){var r=n||e;if(Dn(e)&&ri(e))return e;for(var o=e.childNodes,i=o.length-1;i>=0;i--)ii(t,o[i],r);if(Dn(e)){var a=e.childNodes;1===a.length&&ri(a[0])&&e.parentNode.insertBefore(a[0],e)}return function(t){return Un(t)||Fn(t)}(e)||Jo(e,r)||function(t){return!!Dn(t)&&t.childNodes.length>0}(e)||oi(e,r)||t.remove(e),e},ai=ze.makeMap,ui=/[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,ci=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,si=/[<>&\"\']/g,li=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,fi={128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"},di={'"':""","'":"'","<":"<",">":">","&":"&","`":"`"},mi={"<":"<",">":">","&":"&",""":'"',"'":"'"},gi=function(t,e){var n,r,o,i={};if(t){for(t=t.split(","),e=e||10,n=0;n1?"&#"+(1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320)+65536)+";":di[t]||"&#"+t.charCodeAt(0)+";"}))},bi=function(t,e,n){return n=n||hi,t.replace(e?ui:ci,(function(t){return di[t]||n[t]||t}))},yi={encodeRaw:pi,encodeAllRaw:function(t){return(""+t).replace(si,(function(t){return di[t]||t}))},encodeNumeric:vi,encodeNamed:bi,getEncodeFunc:function(t,e){var n=gi(e)||hi,r=ai(t.replace(/\+/g,","));return r.named&&r.numeric?function(t,e){return t.replace(e?ui:ci,(function(t){return void 0!==di[t]?di[t]:void 0!==n[t]?n[t]:t.length>1?"&#"+(1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320)+65536)+";":"&#"+t.charCodeAt(0)+";"}))}:r.named?e?function(t,e){return bi(t,e,n)}:bi:r.numeric?vi:pi},decode:function(t){return t.replace(li,(function(t,e){return e?(e="x"===e.charAt(0).toLowerCase()?parseInt(e.substr(1),16):parseInt(e,10))>65535?(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e))):fi[e]||String.fromCharCode(e):mi[t]||hi[t]||function(t){var e=Me.fromTag("div").dom;return e.innerHTML=t,e.textContent||e.innerText||t}(t)}))}},xi={},wi={},Ci=ze.makeMap,Si=ze.each,ki=ze.extend,_i=ze.explode,Oi=ze.inArray,Ei=function(t,e){return(t=ze.trim(t))?t.split(e||" "):[]},zi=function(t,e){var n;return t&&(n={},"string"==typeof t&&(t={"*":t}),Si(t,(function(t,r){n[r]=n[r.toUpperCase()]="map"===e?Ci(t,/[, ]/):_i(t,/[, ]/)}))),n},Ti=function(t){var e={},n={},r=[],o={},i={},a=function(e,n,r){var o=t[e];return o?o=Ci(o,/[, ]/,Ci(o.toUpperCase(),/[, ]/)):(o=xi[e])||(o=Ci(n," ",Ci(n.toUpperCase()," ")),o=ki(o,r),xi[e]=o),o},u=function(t){var e,n,r,o,i,a,u={},c=function(t,n,r){var o,i,a,c=function(t,e){var n,r,o={};for(n=0,r=t.length;n