/** * Copyright (c) Tiny Technologies, Inc. All rights reserved. * Licensed under the LGPL or a commercial license. * For LGPL see License.txt in the project root for license information. * For commercial licenses see https://www.tiny.cloud/ * * Version: 5.1.5 (2019-12-19) */ !function(v){"use strict";function Z(){}function i(e,o){return function(){for(var n=[],t=0;t "+o.toString()},function(n,t){return"state("+n+")"})}).join("\n")+"}"},toDsl:function(){return te.objOf(S(o,function(n){return n.fold(function(n,t,e,o){return ee.field(n,e,o)},function(n,t){return ee.state(n)})}))}}},ie=nn(Yn(Xt)),ue=i(Kn,re),ae=oe.state,ce=oe.field,se=Yn(Xt),fe=function(o){return{extract:function(n,t,e){return o().extract(n,t,e)},toString:function(){return o().toString()},toDsl:function(){return o().toDsl()}}},le=function(n){return"Errors: \n"+function(n){var t=10 ")+")\n"+n.getErrorInfo()})}(n.errors)+"\n\nInput object: "+jn(n.input)},de=nn(se),me=ut(mn,"number"),ge=ut(cn,"string"),pe=ut(ln,"boolean"),he=ut(dn,"function"),ve=function(t){function n(n,t){for(var e=n.next();!e.done;){if(!t(e.value))return!1;e=n.next()}return!0}if(Object(t)!==t)return!0;switch({}.toString.call(t).slice(8,-1)){case"Boolean":case"Number":case"String":case"Date":case"RegExp":case"Blob":case"FileList":case"ImageData":case"ImageBitmap":case"ArrayBuffer":return!0;case"Array":case"Object":return Object.keys(t).every(function(n){return ve(t[n])});case"Map":return n(t.keys(),ve)&&n(t.values(),ve);case"Set":return n(t.keys(),ve);default:return!1}},be=Yn(function(n){return ve(n)?Xt(n):qt("Expected value to be acceptable for sending via postMessage")}),ye=function(n){function t(){return e}var e=n;return{get:t,set:function(n){e=n},clone:function(){return ye(t())}}},xe=function(n){if(null===n||n===undefined)throw new Error("Node cannot be null or undefined");return{dom:nn(n)}},we={fromHtml:function(n,t){var e=(t||v.document).createElement("div");if(e.innerHTML=n,!e.hasChildNodes()||1 "):o[0].name();return q(r,function(n,t){return{handler:n,purpose:nn(t)}}(t,e))})});return J(t,{})},ou=function(n,t){return hr(n)?n.style.getPropertyValue(t):""},ru=function(n){var t=ot("external.component",qn([ct("element"),ht("uid")]),n),e=ye(qo());t.uid.each(function(n){Yi(t.element,n)});var o={getSystem:e.get,config:on.none,hasConfigured:nn(!1),connect:function(n){e.set(n)},disconnect:function(){e.set(qo(function(){return o}))},getApis:function(){return{}},element:nn(t.element),spec:nn(n),readState:nn("No state"),syncComponents:Z,components:nn([]),events:nn({})};return Jo(o)},iu=Yo,uu=function(t){return function(n){return Nn(n,Qi)}(t).fold(function(){var n=t.hasOwnProperty("uid")?t:N({uid:iu("")},t);return Fr(n).getOrDie()},function(n){return n})},au=Jo;function cu(o,r){function n(n){var t=r(n);if(t<=0||null===t){var e=wr(n,o);return parseFloat(e)||0}return t}function i(r,n){return O(n,function(n,t){var e=wr(r,t),o=e===undefined?0:parseInt(e,10);return isNaN(o)?n:n+o},0)}return{set:function(n,t){if(!mn(t)&&!t.match(/^[0-9]+$/))throw new Error(o+".set accepts only positive integer values. Value was "+t);var e=n.dom();hr(e)&&(e.style[o]=t+"px")},get:n,getOuter:n,aggregate:i,max:function(n,t,e){var o=i(n,e);return o=n.left&&t<=n.right&&e>=n.top&&e<=n.bottom}var Pa=ye({}),za=["alloy/data/Fields","alloy/debugging/Debugging"],La=nn({logEventCut:Z,logEventStopped:Z,logNoParent:Z,logEventNoHandlers:Z,logEventResponse:Z,write:Z}),ja=nn([ct("menu"),ct("selectedMenu")]),Ua=nn([ct("item"),ct("selectedItem")]),Wa=(nn(re(Ua().concat(ja()))),nn(re(Ua()))),Ga=mt("initSize",[ct("numColumns"),ct("numRows")]),Xa=nn(Ga),Ya=yo("x","y","bubble","direction","label"),qa=Tn([{southeast:[]},{southwest:[]},{northeast:[]},{northwest:[]},{south:[]},{north:[]},{east:[]},{west:[]}]),Ka=qa.southeast,Ja=qa.southwest,$a=qa.northeast,Qa=qa.northwest,Za=qa.south,nc=qa.north,tc=qa.east,ec=qa.west,oc=function(n,t,e){return Ya(ta(n,t),oa(n,t),e.north(),nc(),"layout-n")},rc=function(n,t,e){return Ya(ta(n,t),ra(n),e.south(),Za(),"layout-s")},ic=function(e,n,o,r,t,i,u){function a(n){return $(n,o)?n[o]():on.none()}var c=P(t,function(n,t){return ha(o,n,t)}),s=P(i,function(n,t){return Ko(n,t)}),f=N(N(N({},s),c),{revoke:d(va,o),config:function(n){var t=ot(o+"-config",e,n);return{key:o,value:{config:t,me:f,configAsRaw:L(function(){return ot(o+"-config",e,n)}),initialConfig:n,state:u}}},schema:function(){return n},exhibit:function(n,e){return a(n).bind(function(t){return Nn(r,"exhibit").map(function(n){return n(e,t.config,t.state)})}).getOr(Zo({}))},name:function(){return o},handlers:function(n){return a(n).map(function(n){return Y("events",function(n,t){return{}})(r)(n.config,n.state)}).getOr({})}});return f},uc=qn([ct("fields"),ct("name"),St("active",{}),St("apis",{}),St("state",Zi),St("extra",{})]),ac=qn([ct("branchKey"),ct("branches"),ct("name"),St("active",{}),St("apis",{}),St("state",Zi),St("extra",{})]),cc=nn(undefined),sc=/* */Object.freeze({events:function(t){return co([lo(li(),function(r,i){var u=t.channels,n=function(n,t){return t.universal()?n:C(n,function(n){return vn(t.channels(),n)})}(wn(u),i);bn(n,function(n){var t=u[n],e=t.schema,o=ot("channel["+n+"] data\nReceiver: "+Go(r.element()),e,i.data());t.onReceive(r,o)})})])}}),fc=[st("channels",nt(an.value,qn([Ju("onReceive"),St("schema",de())])))],lc=ya({fields:fc,name:"receiving",active:sc}),dc=/* */Object.freeze({exhibit:function(n,t){return Zo({classes:[],styles:t.useFixed()?{}:{position:"relative"}})}}),mc=["valignCentre","alignLeft","alignRight","alignCentre","top","bottom","left","right"],gc=So(["x","y","width","height","maxHeight","maxWidth","direction","classes","label","candidateYforTest"],[]),pc=yo("position","left","top","right","bottom"),hc=Tn([{none:[]},{relative:["x","y","width","height"]},{fixed:["x","y","width","height"]}]),vc=function(n,t,e){var o=Iu(t,e);return n.fold(nn(o),nn(o),function(){var n=pu();return o.translate(-n.left(),-n.top())})},bc=hc.relative,yc=hc.fixed,xc=function(n){return"rtl"===wr(n,"direction")?"rtl":"ltr"},wc=[ct("hotspot"),ht("bubble"),St("overrides",{}),_a(),Qu("placement",function(n,t,e){var o=t.hotspot,r=Ba(e,o.element()),i=Ma(n.element(),t,da(),ma());return on.some(Da({anchorBox:r,bubble:t.bubble.getOr(Ea()),overrides:t.overrides,layouts:i,placer:on.none()}))})],Sc=[ct("x"),ct("y"),St("height",0),St("width",0),St("bubble",Ea()),St("overrides",{}),_a(),Qu("placement",function(n,t,e){var o=vc(e,t.x,t.y),r=yu(o.left(),o.top(),t.width,t.height),i=Ma(n.element(),t,[ua,aa,ca,sa,rc,oc,fa,la],[aa,ua,sa,ca,rc,oc,fa,la]);return on.some(Da({anchorBox:r,bubble:t.bubble,overrides:t.overrides,layouts:i,placer:on.none()}))})],Cc={create:yo("start","soffset","finish","foffset")},kc=Tn([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Oc=(kc.before,kc.on,kc.after,function(n){return n.fold(l,l,l)}),Ec=Tn([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Tc={domRange:Ec.domRange,relative:Ec.relative,exact:Ec.exact,exactFromRange:function(n){return Ec.exact(n.start(),n.soffset(),n.finish(),n.foffset())},getWin:function(n){var t=function(n){return n.match({domRange:function(n){return we.fromDom(n.startContainer)},relative:function(n,t){return Oc(n)},exact:function(n,t,e,o){return n}})}(n);return Oo(t)},range:Cc.create},Bc=Tn([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]);function Dc(n){return rf.get(n)}function Ac(n){return rf.getOption(n)}function _c(e,o,n,t,r){function i(n){var t=e.dom().createRange();return t.setStart(o.dom(),n),t.collapse(!0),t}var u=Dc(o).length,a=function(n,t,e,o,r){if(0===r)return 0;if(t===o)return r-1;for(var i=o,u=1;u"}),de()),ml=At("schema",function(){return[ht("preprocess")]}),gl=St("defaults",nn({})),pl=St("overrides",nn({})),hl=re([sl,fl,ll,dl,gl,pl]),vl=re([sl,fl,ll,gl,pl]),bl=re([sl,fl,ll,dl,gl,pl]),yl=re([sl,ml,ll,ct("unit"),dl,gl,pl]),xl=zs(cl.required,hl),wl=zs(cl.external,vl),Sl=zs(cl.optional,bl),Cl=zs(cl.group,yl),kl=nn("entirety"),Ol=/* */Object.freeze({required:xl,external:wl,optional:Sl,group:Cl,asNamedPart:Hs,name:Ps,asCommon:function(n){return n.fold(l,l,l,l)},original:kl}),El=function(n,t){return{uiType:al(),owner:n,name:t}},Tl=/* */Object.freeze({generate:js,generateOne:Us,schemas:Ws,names:Gs,substitutes:Xs,components:Ys,defaultUids:nf,defaultUidsSchema:tf,getAllParts:$s,getAllPartNames:Qs,getPart:qs,getPartOrDie:Ks,getParts:Js,getPartsOrDie:Zs}),Bl=function(n){return n.hasOwnProperty("uid")?n:N(N({},n),{uid:Yo("uid")})};function Dl(n){var t=ot("Sketcher for "+n.name,Kl,n),e=P(t.apis,$o),o=P(t.extraApis,function(n,t){return Ko(n,t)});return N(N({name:nn(t.name),partFields:nn([]),configFields:nn(t.configFields),sketch:function(n){return function(n,t,e,o){var r=Bl(o);return e(ef(n,t,r,[],[]),r)}(t.name,t.configFields,t.factory,n)}},e),o)}function Al(n){var t=ot("Sketcher for "+n.name,Jl,n),e=js(t.name,t.partFields),o=P(t.apis,$o),r=P(t.extraApis,function(n,t){return Ko(n,t)});return N(N({name:nn(t.name),partFields:nn(t.partFields),configFields:nn(t.configFields),sketch:function(n){return of(t.name,t.configFields,t.partFields,t.factory,n)},parts:nn(e)},o),r)}function _l(n){return"input"===Ke(n)&&"radio"!==zo(n,"type")||"textarea"===Ke(n)}function Ml(e,o,n,r){var t=zc(e.element(),"."+o.highlightClass);bn(t,function(t){x(r,function(n){return n.element()===t})||(dr(t,o.highlightClass),e.getSystem().getByDom(t).each(function(n){o.onDehighlight(e,n),oo(n,Mi())}))})}function Fl(n,t,e,o){Ml(n,t,0,[o]),nd(n,t,e,o)||(fr(o.element(),t.highlightClass),t.onHighlight(n,o),oo(o,_i()))}function Il(e,t,n,o){var r=zc(e.element(),"."+t.itemClass);return T(r,function(n){return mr(n,t.highlightClass)}).bind(function(n){var t=is(n,o,0,r.length-1);return e.getSystem().getByDom(r[t]).toOption()})}function Rl(n,t,e){var o=A(n.slice(0,t)),r=A(n.slice(t+1));return E(o.concat(r),e)}function Vl(n,t,e){var o=A(n.slice(0,t));return E(o,e)}function Nl(n,t,e){var o=n.slice(0,t),r=n.slice(t+1);return E(r.concat(o),e)}function Hl(n,t,e){var o=n.slice(t+1);return E(o,e)}function Pl(e){return function(n){var t=n.raw();return vn(e,t.which)}}function zl(n){return function(t){return D(n,function(n){return n(t)})}}function Ll(n){return!0===n.raw().shiftKey}function jl(n){return!0===n.raw().ctrlKey}function Ul(n,t){return{matches:n,classification:t}}function Wl(n,t,e){t.exists(function(t){return e.exists(function(n){return jt(n,t)})})||ro(n,Ti(),{prevFocus:t,newFocus:e})}function Gl(){function r(n){return Ca(n.element())}return{get:r,set:function(n,t){var e=r(n);n.getSystem().triggerFocus(t,n.element());var o=r(n);Wl(n,e,o)}}}function Xl(){function r(n){return ad.getHighlighted(n).map(function(n){return n.element()})}return{get:r,set:function(t,n){var e=r(t);t.getSystem().getByDom(n).fold(Z,function(n){ad.highlight(t,n)});var o=r(t);Wl(t,e,o)}}}var Yl,ql,Kl=qn([ct("name"),ct("factory"),ct("configFields"),St("apis",{}),St("extraApis",{})]),Jl=qn([ct("name"),ct("factory"),ct("configFields"),ct("partFields"),St("apis",{}),St("extraApis",{})]),$l=/* */Object.freeze({getCurrent:function(n,t,e){return t.find(n)}}),Ql=[ct("find")],Zl=ya({fields:Ql,name:"composing",apis:$l}),nd=function(n,t,e,o){return mr(o.element(),t.highlightClass)},td=function(n,t,e,o){var r=zc(n.element(),"."+t.itemClass);return on.from(r[o]).fold(function(){return an.error("No element found with index "+o)},n.getSystem().getByDom)},ed=function(t,n,e){return ku(t.element(),"."+n.itemClass).bind(function(n){return t.getSystem().getByDom(n).toOption()})},od=function(t,n,e){var o=zc(t.element(),"."+n.itemClass);return(0',t.getDoc());return Hi(n,we.fromDom(e.extractContents())),e.insertNode(n.dom()),Eo(n).each(function(n){return n.dom().normalize()}),Ic(n).map(function(n){t.selection.setCursorLocation(n.dom(),function(n){return"img"===Ke(n)?1:Ac(n).fold(function(){return Bo(n).length},function(n){return n.length})}(n))}),n})}function Zg(n,t){return n.toString().substring(t.length).replace(/\u00A0/g," ").replace(/\uFEFF/g,"")}function np(n,u,a,c){return void 0===c&&(c=0),function(n){return n.collapsed&&3===n.startContainer.nodeType}(u)?$g(n,u.startContainer,u.startOffset,function(e,o,r,n){var i=n.getOr(r.length);return function(n,t,e,o){var r;for(r=t-1;0<=r;r--){var i=n.charAt(r);if(Rp.test(i))return on.none();if(i===e)break}return-1===r||t-ro}).getOr(r.length);return on.some({numColumns:e,numRows:Math.ceil(r.length/e)})}return on.none()}function up(n,t){return ba([Kd(n,t)])}function ap(n,t,e){n.getSystem().broadcastOn([Zp],{})}function cp(n){var t=we.fromHtml(n),e=Bo(t),o=function(n){var t=n.dom().attributes!==undefined?n.dom().attributes:[];return O(t,function(n,t){var e;return"class"===t.name?n:N(N({},n),((e={})[t.name]=t.value,e))},{})}(t),r=function(n){return Array.prototype.slice.call(n.dom().classList,0)}(t),i=0===e.length?{}:{innerHtml:Vo(t)};return N({tag:Ke(t),classes:r,attributes:o},i)}function sp(n){return Nn(ch,n).getOr(ih)}function fp(n){return{dom:{tag:"div",classes:[fh],innerHtml:n}}}function lp(n){return{dom:{tag:"div",classes:[lh]},components:[Ir(rh.translate(n))]}}function dp(n,t){return{dom:{tag:"div",classes:[lh]},components:[{dom:{tag:n.tag,attributes:{style:n.styleAttr}},components:[Ir(rh.translate(t))]}]}}function mp(n){return{dom:{tag:"div",classes:["tox-collection__item-accessory"],innerHtml:ph(n)}}}function gp(n){return{dom:{tag:"div",classes:[fh,"tox-collection__item-checkmark"],innerHtml:ym("checkmark",n)}}}function pp(n,t,e,o,r){var i=e?n.checkMark.orThunk(function(){return t.or(on.some("")).map(fp)}):on.none(),u=n.ariaLabel.map(function(n){return{attributes:{title:rh.translate(n)}}}).getOr({});return{dom:An({tag:"div",classes:[ih,uh].concat(r?["tox-collection__item-icon-rtl"]:[])},u),optComponents:[i,n.htmlContent.fold(function(){return n.textContent.map(o)},function(n){return on.some(function(n){return{dom:{tag:"div",classes:[lh],innerHtml:n}}}(n))}),n.shortcutContent.map(mp),n.caret]}}function hp(n,t,e,o){void 0===o&&(o=on.none());var r=rh.isRtl()&&n.iconContent.exists(function(n){return vn(vh,n)}),i=n.iconContent.map(function(n){return rh.isRtl()&&vn(hh,n)?n+"-rtl":n}).map(function(n){return function(n,t,e){return on.from(t()[n]).or(e).getOrThunk(function(){return bm(t)})}(n,t.icons,o)}),u=on.from(n.meta).fold(function(){return lp},function(n){return En(n,"style")?d(dp,n.style):lp});return"color"===n.presets?function(n,t,e,o){var r,i,u;return{dom:(r=ah,i=e.getOr(""),u=n.map(function(n){return' title="'+o.translate(n)+'"'}).getOr(""),cp("custom"===t?'":"remove"===t?'
"+i+"
":'
")),optComponents:[]}}(n.ariaLabel,n.value,i,t):pp(n,i,e,u,r)}function vp(n,t,e){t.disabled&&yh(n,t)}function bp(n,t){return!0===t.useNative&&vn(bh,Ke(n.element()))}function yp(n){Po(n.element(),"disabled","disabled")}function xp(n){jo(n.element(),"disabled")}function wp(n){Po(n.element(),"aria-disabled","true")}function Sp(n){Po(n.element(),"aria-disabled","false")}function Cp(t,n,e){n.disableClass.each(function(n){dr(t.element(),n)}),(bp(t,n)?xp:Sp)(t),n.onEnabled(t)}function kp(n,t){return bp(n,t)?function(n){return Lo(n.element(),"disabled")}(n):function(n){return"true"===zo(n.element(),"aria-disabled")}(n)}function Op(n,t){var e=n.getApi(t);return function(n){n(e)}}function Ep(e,o){return Ii(function(n){Op(e,n)(function(n){var t=e.onSetup(n);null!==t&&t!==undefined&&o.set(t)})})}function Tp(t,e){return Ri(function(n){return Op(t,n)(e.get())})}var Bp,Dp,Ap=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),_p=Tn([{aborted:[]},{edge:["element"]},{success:["info"]}]),Mp=Tn([{abort:[]},{kontinue:[]},{finish:["info"]}]),Fp=function(t,e,n,o,r,i){function u(){return i.fold(_p.aborted,_p.edge)}function a(){var n=r();return n?Fp(t,n,on.none(),o,r,on.some(e)):u()}if(function(n,t){return n.isBlock(t)||vn(["BR","IMG","HR","INPUT"],t.nodeName)||"false"===n.getContentEditable(t)}(t,e))return u();if(function(n){return n.nodeType===v.Node.TEXT_NODE}(e)){var c=e.textContent;return o(Mp,e,c,n).fold(_p.aborted,function(){return a()},_p.success)}return a()},Ip=function(n){return Ou(n,"[data-mce-autocompleter]")},Rp=/[\u00a0 \t\r\n]/,Vp=function(e,n){n.on("keypress compositionend",e.onKeypress.throttle),n.on("remove",e.onKeypress.cancel);function o(n,t){ro(n,ni(),{raw:t})}n.on("keydown",function(t){function n(){return e.getView().bind(ad.getHighlighted)}8===t.which&&e.onKeypress.throttle(t),e.isActive()&&(27===t.which&&e.cancelIfNecessary(),e.isMenuOpen()?13===t.which?(n().each(io),t.preventDefault()):40===t.which?(n().fold(function(){e.getView().each(ad.highlightFirst)},function(n){o(n,t)}),t.preventDefault(),t.stopImmediatePropagation()):37!==t.which&&38!==t.which&&39!==t.which||n().each(function(n){o(n,t),t.preventDefault(),t.stopImmediatePropagation()}):13!==t.which&&38!==t.which&&40!==t.which||e.cancelIfNecessary())}),n.on("NodeChange",function(n){e.isActive()&&!e.isProcessingAction()&&Ip(we.fromDom(n.element)).isNone()&&e.cancelIfNecessary()})},Np=tinymce.util.Tools.resolve("tinymce.util.Promise"),Hp=function(n){if(function(n){return n.nodeType===v.Node.TEXT_NODE}(n))return ep(n,n.data.length);var t=n.childNodes;return 0=n.minChars&&n.matches.getOrThunk(function(){return function(e){function o(n,t,e,o){var r=o.getOr(e.length);return 0===r?n.kontinue():n.finish(/\s/.test(e.charAt(r-1)))}return function(n){var t=Pp(n.startContainer,n.startOffset);return $g(e,t.element,t.offset,o).fold(nn(!0),nn(!0),l)}}(t.dom)})(e.range,i,e.text)});if(0===u.length)return on.none();var a=Np.all(S(u,function(t){return t.fetch(e.text,t.maxResults,o).then(function(n){return{matchText:e.text,items:n,columns:t.columns,onAction:t.onAction}})}));return on.some({lookupData:a,context:e})},Lp=re([ft("type"),yt("text")]),jp=re([At("type",function(){return"autocompleteitem"}),At("active",function(){return!1}),At("disabled",function(){return!1}),St("meta",{}),ft("value"),yt("text"),yt("icon")]),Up=re([ft("type"),ft("ch"),kt("minChars",1),St("columns",1),kt("maxResults",10),xt("matches"),dt("fetch"),dt("onAction")]),Wp=[Tt("disabled",!1),yt("text"),yt("shortcut"),ce("value","value",In(function(){return Xo("menuitem-value")}),de()),St("meta",{})],Gp=re([ft("type"),Bt("onSetup",function(){return Z}),Bt("onAction",Z),yt("icon")].concat(Wp)),Xp=re([ft("type"),dt("getSubmenuItems"),Bt("onSetup",function(){return Z}),yt("icon")].concat(Wp)),Yp=re([ft("type"),Tt("active",!1),Bt("onSetup",function(){return Z}),dt("onAction")].concat(Wp)),qp=re([ft("type"),Tt("active",!1),yt("icon")].concat(Wp)),Kp=re([ft("type"),lt("fancytype",["inserttable","colorswatch"]),Bt("onAction",Z)]),Jp=function(n){return up(Xo("unnamed-events"),n)},$p=[ct("lazySink"),ct("tooltipDom"),St("exclusive",!0),St("tooltipComponents",[]),St("delay",300),Et("mode","normal",["normal","follow-highlight"]),St("anchor",function(n){return{anchor:"hotspot",hotspot:n,layouts:{onLtr:nn([rc,oc,ua,ca,aa,sa]),onRtl:nn([rc,oc,ua,ca,aa,sa])}}}),qu("onHide"),qu("onShow")],Qp=/* */Object.freeze({init:function(){function e(){o.get().each(function(n){v.clearTimeout(n)})}var o=ye(on.none()),t=ye(on.none()),n=nn("not-implemented");return nu({getTooltip:function(){return t.get()},isShowing:function(){return t.get().isSome()},setTooltip:function(n){t.set(on.some(n))},clearTooltip:function(){t.set(on.none())},clearTimer:e,resetTimer:function(n,t){e(),o.set(on.some(v.setTimeout(function(){n()},t)))},readState:n})}}),Zp=Xo("tooltip.exclusive"),nh=Xo("tooltip.show"),th=Xo("tooltip.hide"),eh=/* */Object.freeze({hideAllExclusive:ap,setComponents:function(n,t,e,o){e.getTooltip().each(function(n){n.getSystem().isConnected()&&mg.set(n,o)})}}),oh=ya({fields:$p,name:"tooltipping",active:/* */Object.freeze({events:function(o,r){function e(t){r.getTooltip().each(function(n){bs(n),o.onHide(t,n),r.clearTooltip()}),r.clearTimer()}return co(H([[lo(nh,function(n){r.resetTimer(function(){!function(t){if(!r.isShowing()){ap(t);var n=o.lazySink(t).getOrDie(),e=t.getSystem().build({dom:o.tooltipDom,components:o.tooltipComponents,events:co("normal"===o.mode?[lo($r(),function(n){oo(t,nh)}),lo(Kr(),function(n){oo(t,th)})]:[]),behaviours:ba([mg.config({})])});r.setTooltip(e),hs(n,e),o.onShow(t,e),Af.position(n,o.anchor(t),e)}}(n)},o.delay)}),lo(th,function(n){r.resetTimer(function(){e(n)},o.delay)}),lo(li(),function(n,t){vn(t.channels(),Zp)&&e(n)}),Ri(function(n){e(n)})],"normal"===o.mode?[lo(Qr(),function(n){oo(n,nh)}),lo(si(),function(n){oo(n,th)}),lo($r(),function(n){oo(n,nh)}),lo(Kr(),function(n){oo(n,th)})]:[lo(_i(),function(n,t){oo(n,nh)}),lo(Mi(),function(n){oo(n,th)})]]))}}),state:Qp,apis:eh}),rh=tinymce.util.Tools.resolve("tinymce.util.I18n"),ih="tox-menu-nav__js",uh="tox-collection__item",ah="tox-swatch",ch={normal:ih,color:ah},sh="tox-collection__item--enabled",fh="tox-collection__item-icon",lh="tox-collection__item-label",dh="tox-collection__item-caret",mh="tox-collection__item--active",gh=tinymce.util.Tools.resolve("tinymce.Env"),ph=function(n){var e=gh.mac?{alt:"⌥",ctrl:"⌃",shift:"⇧",meta:"⌘",access:"⌃⌥"}:{meta:"Ctrl",access:"Shift+Alt"},t=n.split("+"),o=S(t,function(n){var t=n.toLowerCase().trim();return En(e,t)?e[t]:n});return gh.mac?o.join(""):o.join("+")},hh=["list-num-default","list-num-lower-alpha","list-num-lower-greek","list-num-lower-roman","list-num-upper-alpha","list-num-upper-roman"],vh=["list-bull-circle","list-bull-default","list-bull-square"],bh=["input","button","textarea","select"],yh=function(t,n,e){n.disableClass.each(function(n){fr(t.element(),n)}),(bp(t,n)?yp:wp)(t),n.onDisabled(t)},xh=/* */Object.freeze({enable:Cp,disable:yh,isDisabled:kp,onLoad:vp,set:function(n,t,e,o){(o?yh:Cp)(n,t,e)}}),wh=/* */Object.freeze({exhibit:function(n,t,e){return Zo({classes:t.disabled?t.disableClass.map(M).getOr([]):[]})},events:function(e,n){return co([so(di(),function(n,t){return kp(n,e)}),ga(e,n,vp)])}}),Sh=[St("disabled",!1),St("useNative",!0),ht("disableClass"),qu("onDisabled"),qu("onEnabled")],Ch=ya({fields:Sh,name:"disabling",active:wh,apis:xh}),kh=function(n){return Ch.config({disabled:n,disableClass:"tox-collection__item--state-disabled"})},Oh=function(n){return Ch.config({disabled:n})},Eh=function(n){return Ch.config({disabled:n,disableClass:"tox-tbtn--disabled"})},Th=function(n){return Ch.config({disabled:n,disableClass:"tox-tbtn--disabled",useNative:!1})};(Dp=Bp=Bp||{})[Dp.CLOSE_ON_EXECUTE=0]="CLOSE_ON_EXECUTE",Dp[Dp.BUBBLE_TO_SANDBOX=1]="BUBBLE_TO_SANDBOX";function Bh(n){return B(n,function(n){return n.toArray()})}function Dh(n,t,e){var o=ye(Z);return{type:"item",dom:t.dom,components:Bh(t.optComponents),data:n.data,eventOrder:Ih,hasSubmenu:n.triggersSubmenu,itemBehaviours:ba([Kd("item-events",[function(e,o){return Ni(function(n,t){Op(e,n)(e.onAction),e.triggersSubmenu||o!==Fh.CLOSE_ON_EXECUTE||(oo(n,hi()),t.stop())})}(n,e),Ep(n,o),Tp(n,o)]),kh(n.disabled),mg.config({})].concat(n.itemBehaviours))}}function Ah(n){return{value:n.value,meta:An({text:n.text.getOr("")},n.meta)}}function _h(n,t){var e=function(n){return Rh.DOM.encode(n)}(rh.translate(n));if(0'+n+""})}return e}function Mh(t,e,n){function o(n){return ro(n,Hh,{row:t,col:e})}function r(n,t){t.stop(),o(n)}var i;return uu({dom:{tag:"div",attributes:(i={role:"button"},i["aria-labelledby"]=n,i)},behaviours:ba([Kd("insert-table-picker-cell",[lo($r(),vg.focus),lo(di(),o),lo(ri(),r),lo(gi(),r)]),Cg.config({toggleClass:"tox-insert-table-picker__selected",toggleOnExecute:!1}),vg.config({onFocus:function(n){return ro(n,Nh,{row:t,col:e})}})])})}var Fh=Bp,Ih={"alloy.execute":["disabling","alloy.base.behaviour","toggling","item-events"]},Rh=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),Vh=nn(js("item-widget",Ag())),Nh=Xo("cell-over"),Hh=Xo("cell-execute");function Ph(n){return{value:nn(n)}}function zh(n){return Jh.test(n)||$h.test(n)}function Lh(n){var t=function(n){var t=n.value().replace(Jh,function(n,t,e,o){return t+t+e+e+o+o});return{value:nn(t)}}(n),e=$h.exec(t.value());return null===e?["FFFFFF","FF","FF","FF"]:e}function jh(n){var t=n.toString(16);return 1===t.length?"0"+t:t}function Uh(n){var t=jh(n.red())+jh(n.green())+jh(n.blue());return Ph(t)}function Wh(n,t,e,o){return{red:nn(n),green:nn(t),blue:nn(e),alpha:nn(o)}}function Gh(n){var t=parseInt(n,10);return t.toString()===n&&0<=t&&t<=255}function Xh(n){var t,e,o,r=(n.hue()||0)%360,i=n.saturation()/100,u=n.value()/100;if(i=Zh(0,Qh(i,1)),u=Zh(0,Qh(u,1)),0===i)return t=e=o=nv(255*u),Wh(t,e,o,1);var a=r/60,c=u*i,s=c*(1-Math.abs(a%2-1)),f=u-c;switch(Math.floor(a)){case 0:t=c,e=s,o=0;break;case 1:t=s,e=c,o=0;break;case 2:t=0,e=c,o=s;break;case 3:t=0,e=s,o=c;break;case 4:t=s,e=0,o=c;break;case 5:t=c,e=0,o=s;break;default:t=e=o=0}return t=nv(255*(t+f)),e=nv(255*(e+f)),o=nv(255*(o+f)),Wh(t,e,o,1)}function Yh(n){var t=Lh(n),e=parseInt(t[1],16),o=parseInt(t[2],16),r=parseInt(t[3],16);return Wh(e,o,r,1)}function qh(n,t,e,o){var r=parseInt(n,10),i=parseInt(t,10),u=parseInt(e,10),a=parseFloat(o);return Wh(r,i,u,a)}function Kh(n){return"rgba("+n.red()+","+n.green()+","+n.blue()+","+n.alpha()+")"}var Jh=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,$h=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,Qh=Math.min,Zh=Math.max,nv=Math.round,tv=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)/,ev=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d?(?:\.\d+)?)\)/,ov=nn(Wh(255,0,0,1)),rv=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),iv="tinymce-custom-colors";function uv(n){var t=[],u=v.document.createElement("canvas");u.height=1,u.width=1;for(var a=u.getContext("2d"),c=function(n,t){var e=t/255;return("0"+Math.round(n*e+255*(1-e)).toString(16)).slice(-2).toUpperCase()},e=function(n){if(/^[0-9A-Fa-f]{6}$/.test(n))return"#"+n.toUpperCase();a.clearRect(0,0,u.width,u.height),a.fillStyle="#FFFFFF",a.fillStyle=n,a.fillRect(0,0,1,1);var t=a.getImageData(0,0,1,1).data,e=t[0],o=t[1],r=t[2],i=t[3];return"#"+c(e,i)+c(o,i)+c(r,i)},o=0;ot&&r.pop(),rv.setItem(iv,JSON.stringify(r))},state:function(){return r.slice(0)}}}(10),Mv=function(n,t){return n.getParam("color_cols",t,"number")},Fv=function(n){return!1!==n.getParam("custom_colors")},Iv=function(n){var t=av(n);return t!==undefined?uv(t):Av},Rv=function(){return S(_v.state(),function(n){return{type:Dv,text:n,value:n}})},Vv=function(n){_v.add(n)},Nv=function(n){return n.fire("SkinLoaded")},Hv=function(n){return n.fire("ResizeEditor")},Pv=function(n,t){return n.fire("ScrollContent",t)},zv=function(n,t){return n.fire("ResizeContent",t)},Lv=function(n,t){return n.fire("TextColorChange",t)},jv=function(i){return function(n,t){var e,o={colorpicker:t},r=(e=n,function(n){var t=n.getData();e(on.from(t.colorpicker)),n.close()});i.windowManager.open({title:"Color Picker",size:"normal",body:{type:"panel",items:[{type:"colorpicker",name:"colorpicker",label:"Color"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:o,onAction:function(n,t){"hex-valid"===t.name&&(t.value?n.enable("ok"):n.disable("ok"))},onSubmit:r,onClose:function(){},onCancel:function(){n(on.none())}})}},Uv={register:function(n){!function(e){e.addCommand("mceApplyTextcolor",function(n,t){!function(n,t,e){n.undoManager.transact(function(){n.focus(),n.formatter.apply(t,{value:e}),n.nodeChanged()})}(e,n,t)}),e.addCommand("mceRemoveTextcolor",function(n){!function(n,t){n.undoManager.transact(function(){n.focus(),n.formatter.remove(t,{value:null},null,!0),n.nodeChanged()})}(e,n)})}(n);var t=ye(null),e=ye(null);pv(n,"forecolor","forecolor","Text color",t),pv(n,"backcolor","hilitecolor","Background color",e),hv(n,"forecolor","forecolor","Text color"),hv(n,"backcolor","hilitecolor","Background color")},getColors:dv,getFetch:mv,colorPickerDialog:jv,getCurrentColor:cv,getColorCols:fv,calcCols:sv},Wv=[Vg.parts().items({})],Gv=function(n,e,o,r,i,u,a){return Bu(S(n,function(t){return"choiceitem"===t.type?function(n){return tt("choicemenuitem",qp,n)}(t).fold(kv,function(n){return on.some(function(t,n,e,o,r,i,u){var a=hp({presets:e,textContent:n?t.text:on.none(),htmlContent:on.none(),ariaLabel:t.text,iconContent:t.icon,shortcutContent:n?t.shortcut:on.none(),checkMark:n?on.some(gp(u.icons)):on.none(),caret:on.none(),value:t.value},u,!0);return Dn(Dh({data:Ah(t),disabled:t.disabled,getApi:function(t){return{setActive:function(n){Cg.set(t,n)},isActive:function(){return Cg.isOn(t)},isDisabled:function(){return Ch.isDisabled(t)},setDisabled:function(n){return Ch.set(t,n)}}},onAction:function(n){return o(t.value)},onSetup:function(n){return n.setActive(r),function(){}},triggersSubmenu:!1,itemBehaviours:[]},a,i),{toggling:{toggleClass:sh,toggleOnExecute:!1,selected:t.active}})}(n,1===o,r,e,u(t.value),i,a))}):on.none()}))};var Xv,Yv,qv={inserttable:function uI(o){var n=Xo("size-label"),i=function(n,t,e){for(var o=[],r=0;r"}function pw(n){return function(n){return CS[n]}(n)}function hw(n,t,e){return Zf.config(Dn({store:{mode:"manual",getValue:t,setValue:e}},n.map(function(n){return{store:{initialValue:n}}}).getOr({})))}function vw(n,t,e){return hw(n,function(n){return t(n.element())},function(n,t){return e(n.element(),t)})}function bw(e,t){function o(n,t){t.stop()}function r(n){return function(t,e){bn(n,function(n){n(t,e)})}}function i(n,t){if(!Ch.isDisabled(n)){var e=t.event().raw();a(n,e.dataTransfer.files)}}function u(n,t){var e=t.event().raw().target.files;a(n,e)}var a=function(n,t){Zf.setValue(n,function(n){var t=new RegExp("("+".jpg,.jpeg,.png,.gif".split(/\s*,\s*/).join("|")+")$","i");return C(xn(n),function(n){return t.test(n.name)})}(t)),ro(n,uy,{name:e.name})},c=vm({dom:{tag:"input",attributes:{type:"file",accept:"image/*"},styles:{display:"none"}},behaviours:ba([Kd("input-file-events",[vo(ri()),vo(gi())])])}),n=e.label.map(function(n){return Dy(n,t)}),s=vy.parts().field({factory:{sketch:function(n){return{uid:n.uid,dom:{tag:"div",classes:["tox-dropzone-container"]},behaviours:ba([DS([]),xS(),Ch.config({}),Cg.config({toggleClass:"dragenter",toggleOnExecute:!1}),Kd("dropzone-events",[lo("dragenter",r([o,Cg.toggle])),lo("dragleave",r([o,Cg.toggle])),lo("dragover",o),lo("drop",r([o,i])),lo(oi(),u)])]),components:[{dom:{tag:"div",classes:["tox-dropzone"],styles:{}},components:[{dom:{tag:"p",innerHtml:t.translate("Drop an image here")}},Gg.sketch({dom:{tag:"button",innerHtml:t.translate("Browse for an image"),styles:{position:"relative"},classes:["tox-button","tox-button--secondary"]},components:[c.asSpec()],action:function(n){c.get(n).element().dom().click()},buttonBehaviours:ba([Gy.config({})])})]}]}}}});return By(n,s,["tox-form__group--stretched"],[])}function yw(n){return{dom:{tag:"div",styles:{width:"1px",height:"1px",outline:"none"},attributes:{tabindex:"0"},classes:n},behaviours:ba([vg.config({ignore:!0}),Gy.config({})])}}function xw(n,t){ro(n,ni(),{raw:{which:9,shiftKey:t}})}function ww(n,t){var e=RS&&n.sandboxed,o=N(N({},n.label.map(function(n){return{title:n}}).getOr({})),e?{sandbox:"allow-scripts allow-same-origin"}:{}),r=function(o){var r=ye("");return{getValue:function(n){return r.get()},setValue:function(n,t){if(o)Po(n.element(),"srcdoc",t);else{Po(n.element(),"src","javascript:''");var e=n.element().dom().contentWindow.document;e.open(),e.write(t),e.close()}r.set(t)}}}(e),i=n.label.map(function(n){return Dy(n,t)}),u=vy.parts().field({factory:{sketch:function(n){return IS({uid:n.uid,dom:{tag:"iframe",attributes:o},behaviours:ba([Gy.config({}),vg.config({}),TS(on.none(),r.getValue,r.setValue)])})}}});return By(i,u,["tox-form__group--stretched"],[])}var Sw=function(t,n){return t.getSystem().getByUid(n.uid+"-"+$y()).map(function(n){return function(){return an.value(n)}}).getOrThunk(function(){return n.lazySink.fold(function(){return function(){return an.error(new Error("No internal sink is specified, nor could an external sink be found"))}},function(n){return function(){return n(t)}})})},Cw=nn([ct("dom"),ct("fetch"),qu("onOpen"),Ku("onExecute"),St("getHotspot",on.some),St("getAnchorOverrides",nn({})),St("layouts",on.none()),Fs("dropdownBehaviours",[Cg,Jy,lg,vg]),ct("toggleClass"),St("eventOrder",{}),ht("lazySink"),St("matchWidth",!1),St("useMinWidth",!1),ht("role")].concat(ax())),kw=nn([wl({schema:[Gu()],name:"menu",defaults:function(n){return{onExecute:n.onExecute}}}),Qy()]),Ow=Al({name:"Dropdown",configFields:Cw(),partFields:kw(),factory:function(t,n,e,o){function r(n){zf.getState(n).each(function(n){Lg.highlightPrimary(n)})}function i(n,t){return io(n),on.some(!0)}var u,a,c={expand:function(n){Cg.isOn(n)||ex(t,function(n){return n},n,o,Z,Ay.HighlightNone).get(Z)},open:function(n){Cg.isOn(n)||ex(t,function(n){return n},n,o,Z,Ay.HighlightFirst).get(Z)},isOpen:Cg.isOn,close:function(n){Cg.isOn(n)&&ex(t,function(n){return n},n,o,Z,Ay.HighlightFirst).get(Z)},repositionMenus:function(n){Cg.isOn(n)&&ux(n)}};return{uid:t.uid,dom:t.dom,components:n,behaviours:Rs(t.dropdownBehaviours,[Cg.config({toggleClass:t.toggleClass,aria:{mode:"expanded"}}),Jy.config({others:{sandbox:function(n){return ix(t,n,{onOpen:function(){Cg.on(n)},onClose:function(){Cg.off(n)}})}}}),lg.config({mode:"special",onSpace:i,onEnter:i,onDown:function(n,t){if(Ow.isOpen(n)){var e=Jy.getCoupled(n,"sandbox");r(e)}else Ow.open(n);return on.some(!0)},onEscape:function(n,t){return Ow.isOpen(n)?(Ow.close(n),on.some(!0)):on.none()}}),vg.config({})]),events:rm(on.some(function(n){ex(t,function(n){return n},n,o,r,Ay.HighlightFirst).get(Z)})),eventOrder:N(N({},t.eventOrder),(u={},u[di()]=["disabling","toggling","alloy.base.behaviour"],u)),apis:c,domModification:{attributes:N(N({"aria-haspopup":"true"},t.role.fold(function(){return{}},function(n){return{role:n}})),"button"===t.dom.tag?{type:(a="type",Nn(t.dom,"attributes").bind(function(n){return Nn(n,a)})).getOr("button")}:{})}}},apis:{open:function(n,t){return n.open(t)},expand:function(n,t){return n.expand(t)},close:function(n,t){return n.close(t)},isOpen:function(n,t){return n.isOpen(t)},repositionMenus:function(n,t){return n.repositionMenus(t)}}}),Ew=ya({fields:[],name:"unselecting",active:/* */Object.freeze({events:function(n){return co([so(ui(),nn(!0))])},exhibit:function(n,t){return Zo({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})}})}),Tw=Xo("color-input-change"),Bw=Xo("color-swatch-change"),Dw=Xo("color-picker-cancel"),Aw=nn(Xo("rgb-hex-update")),_w=nn(Xo("slider-update")),Mw=nn(Xo("palette-update")),Fw=Sl({schema:[ct("dom")],name:"label"}),Iw=fx("top-left"),Rw=fx("top"),Vw=fx("top-right"),Nw=fx("right"),Hw=fx("bottom-right"),Pw=fx("bottom"),zw=fx("bottom-left"),Lw=[Fw,fx("left"),Nw,Rw,Pw,Iw,Vw,zw,Hw,xl({name:"thumb",defaults:nn({dom:{styles:{position:"absolute"}}}),overrides:function(n){return{events:co([po(Ur(),n,"spectrum"),po(Wr(),n,"spectrum"),po(Gr(),n,"spectrum"),po(Yr(),n,"spectrum"),po(qr(),n,"spectrum"),po(Jr(),n,"spectrum")])}}}),xl({schema:[At("mouseIsDown",function(){return ye(!1)})],name:"spectrum",overrides:function(e){function o(t,n){return r.getValueFromEvent(n).map(function(n){return r.setValueFrom(t,e,n)})}var r=e.model.manager;return{behaviours:ba([lg.config({mode:"special",onLeft:function(n){return r.onLeft(n,e)},onRight:function(n){return r.onRight(n,e)},onUp:function(n){return r.onUp(n,e)},onDown:function(n){return r.onDown(n,e)}}),vg.config({})]),events:co([lo(Ur(),o),lo(Wr(),o),lo(Yr(),o),lo(qr(),function(n,t){e.mouseIsDown.get()&&o(n,t)})])}}})],jw=nn("slider.change.value"),Uw="left",Ww=rw(-1),Gw=rw(1),Xw=on.none,Yw=on.none,qw={"top-left":on.none(),top:on.none(),"top-right":on.none(),right:on.some(function(n,t){Hx(n,Rx(bx(t)))}),"bottom-right":on.none(),bottom:on.none(),"bottom-left":on.none(),left:on.some(function(n,t){Hx(n,Rx(gx(t)))})},Kw=/* */Object.freeze({setValueFrom:function(n,t,e){var o=ow(n,t,e),r=ew(o);return tw(n,r),o},setToMin:function(n,t){var e=dx(t);tw(n,ew(e))},setToMax:function(n,t){var e=hx(t);tw(n,ew(e))},findValueOfOffset:ow,getValueFromEvent:function(n){return lx(n).map(function(n){return n.left()})},findPositionOfValue:iw,setPositionFromValue:function(n,t,e,o){var r=Ix(e),i=iw(n,o.getSpectrum(n),r.x(),o.getLeftEdge(n),o.getRightEdge(n),e),u=mu(t.element())/2;yr(t.element(),"left",i-u+"px")},onLeft:Ww,onRight:Gw,onUp:Xw,onDown:Yw,edgeActions:qw}),Jw=on.none,$w=on.none,Qw=sw(-1),Zw=sw(1),nS={"top-left":on.none(),top:on.some(function(n,t){Hx(n,Vx(px(t)))}),"top-right":on.none(),right:on.none(),"bottom-right":on.none(),bottom:on.some(function(n,t){Hx(n,Vx(yx(t)))}),"bottom-left":on.none(),left:on.none()},tS=/* */Object.freeze({setValueFrom:function(n,t,e){var o=cw(n,t,e),r=aw(o);return uw(n,r),o},setToMin:function(n,t){var e=mx(t);uw(n,aw(e))},setToMax:function(n,t){var e=vx(t);uw(n,aw(e))},findValueOfOffset:cw,getValueFromEvent:function(n){return lx(n).map(function(n){return n.top()})},findPositionOfValue:fw,setPositionFromValue:function(n,t,e,o){var r=Ix(e),i=fw(n,o.getSpectrum(n),r.y(),o.getTopEdge(n),o.getBottomEdge(n),e),u=su(t.element())/2;yr(t.element(),"top",i-u+"px")},onLeft:Jw,onRight:$w,onUp:Qw,onDown:Zw,edgeActions:nS}),eS=mw(-1,!1),oS=mw(1,!1),rS=mw(-1,!0),iS=mw(1,!0),uS={"top-left":on.some(function(n,t){Hx(n,Nx(gx(t),px(t)))}),top:on.some(function(n,t){Hx(n,Nx(Cx(t),px(t)))}),"top-right":on.some(function(n,t){Hx(n,Nx(bx(t),px(t)))}),right:on.some(function(n,t){Hx(n,Nx(bx(t),kx(t)))}),"bottom-right":on.some(function(n,t){Hx(n,Nx(bx(t),yx(t)))}),bottom:on.some(function(n,t){Hx(n,Nx(Cx(t),yx(t)))}),"bottom-left":on.some(function(n,t){Hx(n,Nx(gx(t),yx(t)))}),left:on.some(function(n,t){Hx(n,Nx(gx(t),kx(t)))})},aS=/* */Object.freeze({setValueFrom:function(n,t,e){var o=ow(n,t,e.left()),r=cw(n,t,e.top()),i=dw(o,r);return lw(n,i),i},setToMin:function(n,t){var e=dx(t),o=mx(t);lw(n,dw(e,o))},setToMax:function(n,t){var e=hx(t),o=vx(t);lw(n,dw(e,o))},getValueFromEvent:function(n){return lx(n)},setPositionFromValue:function(n,t,e,o){var r=Ix(e),i=iw(n,o.getSpectrum(n),r.x(),o.getLeftEdge(n),o.getRightEdge(n),e),u=fw(n,o.getSpectrum(n),r.y(),o.getTopEdge(n),o.getBottomEdge(n),e),a=mu(t.element())/2,c=su(t.element())/2;yr(t.element(),"left",i-a+"px"),yr(t.element(),"top",u-c+"px")},onLeft:eS,onRight:oS,onUp:rS,onDown:iS,edgeActions:uS}),cS=Al({name:"Slider",configFields:[St("stepSize",1),St("onChange",Z),St("onChoose",Z),St("onInit",Z),St("onDragStart",Z),St("onDragEnd",Z),St("snapToGrid",!1),St("rounded",!0),ht("snapStart"),st("model",it("mode",{x:[St("minX",0),St("maxX",100),At("value",function(n){return ye(n.mode.minX)}),ct("getInitialValue"),Qu("manager",Kw)],y:[St("minY",0),St("maxY",100),At("value",function(n){return ye(n.mode.minY)}),ct("getInitialValue"),Qu("manager",tS)],xy:[St("minX",0),St("maxX",100),St("minY",0),St("maxY",100),At("value",function(n){return ye({x:nn(n.mode.minX),y:nn(n.mode.minY)})}),ct("getInitialValue"),Qu("manager",aS)]})),Fs("sliderBehaviours",[lg,Zf]),At("mouseIsDown",function(){return ye(!1)})],partFields:Lw,factory:function(i,n,t,e){function u(n){return Ks(n,i,"thumb")}function a(n){return Ks(n,i,"spectrum")}function o(n){return qs(n,i,"left-edge")}function r(n){return qs(n,i,"right-edge")}function c(n){return qs(n,i,"top-edge")}function s(n){return qs(n,i,"bottom-edge")}function f(n,t){v.setPositionFromValue(n,t,i,{getLeftEdge:o,getRightEdge:r,getTopEdge:c,getBottomEdge:s,getSpectrum:a})}function l(n,t){h.value.set(t);var e=u(n);return f(n,e),i.onChange(n,e,t),on.some(!0)}function d(e){var n=i.mouseIsDown.get();i.mouseIsDown.set(!1),n&&qs(e,i,"thumb").each(function(n){var t=h.value.get();i.onChoose(e,n,t)})}function m(n,t){t.stop(),i.mouseIsDown.set(!0),i.onDragStart(n,u(n))}function g(n,t){t.stop(),i.onDragEnd(n,u(n)),d(n)}var p,h=i.model,v=h.manager;return{uid:i.uid,dom:i.dom,components:n,behaviours:Rs(i.sliderBehaviours,[lg.config({mode:"special",focusIn:function(n){return qs(n,i,"spectrum").map(lg.focusIn).map(nn(!0))}}),Zf.config({store:{mode:"manual",getValue:function(n){return h.value.get()}}}),lc.config({channels:(p={},p[Uf()]={onReceive:d},p)})]),events:co([lo(jw(),function(n,t){l(n,t.event().value())}),Ii(function(n,t){var e=h.getInitialValue();h.value.set(e);var o=u(n);f(n,o);var r=a(n);i.onInit(n,o,r,h.value.get())}),lo(Ur(),m),lo(Gr(),g),lo(Yr(),m),lo(Jr(),g)]),apis:{resetToMin:function(n){v.setToMin(n,i)},resetToMax:function(n){v.setToMax(n,i)},changeValue:l,refresh:f},domModification:{styles:{position:"relative"}}}},apis:{resetToMin:function(n,t){n.resetToMin(t)},resetToMax:function(n,t){n.resetToMax(t)},refresh:function(n,t){n.refresh(t)}}}),sS=function(n,t){var e=cS.parts().spectrum({dom:{tag:"div",classes:[t("hue-slider-spectrum")],attributes:{role:"presentation"}}}),o=cS.parts().thumb({dom:{tag:"div",classes:[t("hue-slider-thumb")],attributes:{role:"presentation"}}});return cS.sketch({dom:{tag:"div",classes:[t("hue-slider")],attributes:{role:"presentation"}},rounded:!1,model:{mode:"y",getInitialValue:nn({y:nn(0)})},components:[e,o],sliderBehaviours:ba([vg.config({})]),onChange:function(n,t,e){ro(n,_w(),{value:e})}})},fS=[Fs("formBehaviours",[Zf])],lS=function(o,n,t){return{uid:o.uid,dom:o.dom,components:n,behaviours:Rs(o.formBehaviours,[Zf.config({store:{mode:"manual",getValue:function(n){var t=$s(n,o);return P(t,function(n,t){return n().bind(function(n){return function(n,t){return n.fold(function(){return an.error(t)},an.value)}(Zl.getCurrent(n),"missing current")}).map(Zf.getValue)})},setValue:function(e,n){Cn(n,function(t,n){qs(e,o,n).each(function(n){Zl.getCurrent(n).each(function(n){Zf.setValue(n,t)})})})}}})]),apis:{getField:function(n,t){return qs(n,o,t).bind(Zl.getCurrent)}}}},dS={getField:$o(function(n,t,e){return n.getField(t,e)}),sketch:function(n){var e,t=(e=[],{field:function(n,t){return e.push(n),Us("form",gw(n),t)},record:function(){return e}}),o=n(t),r=t.record(),i=S(r,function(n){return xl({name:n,pname:gw(n)})});return of("form",fS,i,lS,o)}},mS=Xo("valid-input"),gS=Xo("invalid-input"),pS=Xo("validating-input"),hS="colorcustom.rgb.",vS=function(d,m,g,p){function h(n,t,e,o,r){var i=d(hS+"range"),u=[vy.parts().label({dom:{tag:"label",innerHtml:e,attributes:{"aria-label":o}}}),vy.parts().field({data:r,factory:yy,inputAttributes:N({type:"text"},"hex"===t?{"aria-live":"polite"}:{}),inputClasses:[m("textfield")],inputBehaviours:ba([function(t,o){return jy.config({invalidClass:m("invalid"),notify:{onValidate:function(n){ro(n,pS,{type:t})},onValid:function(n){ro(n,mS,{type:t,value:Zf.getValue(n)})},onInvalid:function(n){ro(n,gS,{type:t,value:Zf.getValue(n)})}},validator:{validate:function(n){var t=Zf.getValue(n),e=o(t)?an.value(!0):an.error(d("aria.input.invalid"));return Ny(e)},validateOnLoad:!1}})}(t,n),Gy.config({})]),onSetValue:function(n){jy.isInvalid(n)&&jy.run(n).get(Z)}})],a="hex"!==t?[vy.parts()["aria-descriptor"]({text:i})]:[];return{dom:{tag:"div",attributes:{role:"presentation"}},components:u.concat(a)}}function v(n,t){var e=t.red(),o=t.green(),r=t.blue();Zf.setValue(n,{red:e,green:o,blue:r})}function b(n,t){y.getOpt(n).each(function(n){yr(n.element(),"background-color","#"+t.value())})}var y=vm({dom:{tag:"div",classes:[m("rgba-preview")],styles:{"background-color":"white"},attributes:{role:"presentation"}}});return Dl({factory:function(){function r(n){return u[n]().get()}function i(n,t){u[n]().set(t)}function t(n,t){var e=t.event();"hex"!==e.type()?i(e.type(),on.none()):p(n)}function o(e,n,t){var o=parseInt(t,10);i(n,on.some(o)),r("red").bind(function(e){return r("green").bind(function(t){return r("blue").map(function(n){return Wh(e,t,n,1)})})}).each(function(n){var t=function(t,n){var e=Uh(n);return dS.getField(t,"hex").each(function(n){vg.isFocused(n)||Zf.setValue(t,{hex:e.value()})}),e}(e,n);b(e,t)})}function e(n,t){var e=t.event();!function(n){return"hex"===n.type()}(e)?o(n,e.type(),e.value()):function(n,t){g(n);var e=Ph(t);i("hex",on.some(t));var o=Yh(e);v(n,o),a(o),ro(n,Aw(),{hex:e}),b(n,e)}(n,e.value())}function n(n){return{label:d(hS+n+".label"),description:d(hS+n+".description")}}var u={red:nn(ye(on.some(255))),green:nn(ye(on.some(255))),blue:nn(ye(on.some(255))),hex:nn(ye(on.some("ffffff")))},a=function(n){var t=n.red(),e=n.green(),o=n.blue();i("red",on.some(t)),i("green",on.some(e)),i("blue",on.some(o))},c=n("red"),s=n("green"),f=n("blue"),l=n("hex");return Dn(dS.sketch(function(n){return{dom:{tag:"form",classes:[m("rgb-form")],attributes:{"aria-label":d("aria.color.picker")}},components:[n.field("red",vy.sketch(h(Gh,"red",c.label,c.description,255))),n.field("green",vy.sketch(h(Gh,"green",s.label,s.description,255))),n.field("blue",vy.sketch(h(Gh,"blue",f.label,f.description,255))),n.field("hex",vy.sketch(h(zh,"hex",l.label,l.description,"ffffff"))),y.asSpec()],formBehaviours:ba([jy.config({invalidClass:m("form-invalid")}),Kd("rgb-form-events",[lo(mS,e),lo(gS,t),lo(pS,t)])])}}),{apis:{updateHex:function(n,t){Zf.setValue(n,{hex:t.value()}),function(n,t){var e=Yh(t);v(n,e),a(e)}(n,t),b(n,t)}}})},name:"RgbForm",configFields:[],apis:{updateHex:function(n,t,e){n.updateHex(t,e)}},extraApis:{}})},bS=function(n,o){function r(n,t){var e=n.width,o=n.height,r=n.getContext("2d");if(null!==r){r.fillStyle=t,r.fillRect(0,0,e,o);var i=r.createLinearGradient(0,0,e,0);i.addColorStop(0,"rgba(255,255,255,1)"),i.addColorStop(1,"rgba(255,255,255,0)"),r.fillStyle=i,r.fillRect(0,0,e,o);var u=r.createLinearGradient(0,0,0,o);u.addColorStop(0,"rgba(0,0,0,0)"),u.addColorStop(1,"rgba(0,0,0,1)"),r.fillStyle=u,r.fillRect(0,0,e,o)}}var i=cS.parts().spectrum({dom:{tag:"canvas",attributes:{role:"presentation"},classes:[o("sv-palette-spectrum")]}}),u=cS.parts().thumb({dom:{tag:"div",attributes:{role:"presentation"},classes:[o("sv-palette-thumb")],innerHtml:"'}});return Dl({factory:function(n){var t=nn({x:nn(0),y:nn(0)}),e=ba([Zl.config({find:on.some}),vg.config({})]);return cS.sketch({dom:{tag:"div",attributes:{role:"presentation"},classes:[o("sv-palette")]},model:{mode:"xy",getInitialValue:t},rounded:!1,components:[i,u],onChange:function(n,t,e){ro(n,Mw(),{value:e})},onInit:function(n,t,e,o){r(e.element().dom(),Kh(ov()))},sliderBehaviours:e})},name:"SaturationBrightnessPalette",configFields:[],apis:{setRgba:function(n,t,e){!function(n,t){var e=n.components()[0].element().dom();r(e,Kh(t))}(t,e)}},extraApis:{}})},yS=function(l,d){return Dl({name:"ColourPicker",configFields:[ct("dom"),St("onValidHex",Z),St("onInvalidHex",Z)],factory:function(n){function t(n,e){u.getOpt(n).each(function(n){var t=Yh(e);s.paletteRgba().set(t),i.setRgba(n,t)})}function e(n,t){f.getOpt(n).each(function(n){r.updateHex(n,t)})}function a(t,e,n){bn(n,function(n){n(t,e)})}var o,c,r=vS(l,d,n.onValidHex,n.onInvalidHex),i=bS(l,d),s={paletteRgba:nn(ye(ov()))},u=vm(i.sketch({})),f=vm(r.sketch({}));return{uid:n.uid,dom:n.dom,components:[u.asSpec(),sS(l,d),f.asSpec()],behaviours:ba([Kd("colour-picker-events",[lo(Mw(),(c=[e],function(n,t){var e=t.event().value(),o=function(n){var t,e=0,o=0,r=n.red()/255,i=n.green()/255,u=n.blue()/255,a=Math.min(r,Math.min(i,u)),c=Math.max(r,Math.max(i,u));return a===c?sx(0,0,100*(o=a)):(e=60*((e=r===a?3:u===a?1:5)-(r===a?i-u:u===a?r-i:u-r)/(c-a)),t=(c-a)/c,o=c,sx(Math.round(e),Math.round(100*t),Math.round(100*o)))}(s.paletteRgba().get()),r=sx(o.hue(),e.x(),100-e.y()),i=Xh(r),u=Uh(i);a(n,u,c)})),lo(_w(),(o=[t,e],function(n,t){var e=function(n){var t=sx((100-n)/100*360,100,100),e=Xh(t);return Uh(e)}(t.event().value().y());a(n,e,o)}))]),Zl.config({find:function(n){return f.getOpt(n)}}),lg.config({mode:"acyclic"})])}}})},xS=function(){return Zl.config({find:on.some})},wS=function(n){return Zl.config({find:n.getOpt})},SS=function(n){return Zl.config({find:function(t){return Do(t.element(),n).bind(function(n){return t.getSystem().getByDom(n).toOption()})}})},CS={"colorcustom.rgb.red.label":"R","colorcustom.rgb.red.description":"Red component","colorcustom.rgb.green.label":"G","colorcustom.rgb.green.description":"Green component","colorcustom.rgb.blue.label":"B","colorcustom.rgb.blue.description":"Blue component","colorcustom.rgb.hex.label":"#","colorcustom.rgb.hex.description":"Hex color code","colorcustom.rgb.range":"Range 0 to 255","colorcustom.sb.saturation":"Saturation","colorcustom.sb.brightness":"Brightness","colorcustom.sb.picker":"Saturation and Brightness Picker","colorcustom.sb.palette":"Saturation and Brightness Palette","colorcustom.sb.instructions":"Use arrow keys to select saturation and brightness, on x and y axes","colorcustom.hue.hue":"Hue","colorcustom.hue.slider":"Hue Slider","colorcustom.hue.palette":"Hue Palette","colorcustom.hue.instructions":"Use arrow keys to select a hue","aria.color.picker":"Color Picker","aria.input.invalid":"Invalid input"},kS=tinymce.util.Tools.resolve("tinymce.Resource"),OS=re([St("preprocess",l),St("postprocess",l)]),ES=function(r,n){var i=ot("RepresentingConfigs.memento processors",OS,n);return Zf.config({store:{mode:"manual",getValue:function(n){var t=r.get(n),e=Zf.getValue(t);return i.postprocess(e)},setValue:function(n,t){var e=i.preprocess(t),o=r.get(n);Zf.setValue(o,e)}}})},TS=hw,BS=function(n){return vw(n,Vo,No)},DS=function(n){return Zf.config({store:{mode:"memory",initialValue:n}})},AS=Xo("alloy-fake-before-tabstop"),_S=Xo("alloy-fake-after-tabstop"),MS=function(n){return lb(n,["."+AS,"."+_S].join(","),nn(!1))},FS=function(n,t){var e=t.element();mr(e,AS)?xw(n,!0):mr(e,_S)&&xw(n,!1)},IS=function(n){return{dom:{tag:"div",classes:["tox-navobj"]},components:[yw([AS]),n,yw([_S])],behaviours:ba([SS(1)])}},RS=!(Ht().browser.isIE()||Ht().browser.isEdge());function VS(n,t){return PS(v.document.createElement("canvas"),n,t)}function NS(n){var t=VS(n.width,n.height);return HS(t).drawImage(n,0,0),t}function HS(n){return n.getContext("2d")}function PS(n,t,e){return n.width=t,n.height=e,n}function zS(n){return n.naturalWidth||n.width}function LS(n){return n.naturalHeight||n.height}var jS,US,WS=window.Promise?window.Promise:(jS=GS.immediateFn||"function"==typeof window.setImmediate&&window.setImmediate||function(n){v.setTimeout(n,1)},US=Array.isArray||function(n){return"[object Array]"===Object.prototype.toString.call(n)},GS.prototype["catch"]=function(n){return this.then(null,n)},GS.prototype.then=function(e,o){var r=this;return new GS(function(n,t){YS.call(r,new $S(e,o,n,t))})},GS.all=function(){for(var n=[],t=0;t").css({position:"absolute",top:0,left:0,width:o.width,height:o.height,zIndex:2147483647,opacity:1e-4,cursor:e}).appendTo(d.body),hk(d).on("mousemove touchmove",c).on("mouseup touchend",a),r.start(n)},c=function(n){if(wk(n),n.button!==u)return a(n);n.deltaX=n.screenX-f,n.deltaY=n.screenY-l,n.preventDefault(),r.drag(n)},a=function(n){wk(n),hk(d).off("mousemove touchmove",c).off("mouseup touchend",a),i.remove(),r.stop&&r.stop(n)},this.destroy=function(){hk(m).off()},hk(m).on("mousedown touchstart",t)}function Ck(t){function u(n,s){c.getOpt(n).each(function(n){var e=l.get(),o=mu(n.element()),r=su(n.element()),i=s.dom().naturalWidth*e,u=s.dom().naturalHeight*e,a=Math.max(0,o/2-i/2),c=Math.max(0,r/2-u/2),t={left:a.toString()+"px",top:c.toString()+"px",width:i.toString()+"px",height:u.toString()+"px",position:"absolute"};xr(s,t),f.getOpt(n).each(function(n){xr(n.element(),t)}),d.get().each(function(n){var t=m.get();n.setRect({x:t.x*e+a,y:t.y*e+c,w:t.w*e,h:t.h*e}),n.setClampRect({x:a,y:c,w:i,h:u}),n.setViewPortRect({x:0,y:0,w:o,h:r})})})}function e(n,t){var i=we.fromTag("img");return Po(i,"src",t),function(e){return new Np(function(n){var t=function(){e.removeEventListener("load",t),n(e)};e.complete?n(e):e.addEventListener("load",t)})}(i.dom()).then(function(){return c.getOpt(n).map(function(n){var t=ru({element:i});mg.replaceAt(n,1,on.some(t));var e=a.get(),o={x:0,y:0,w:i.dom().naturalWidth,h:i.dom().naturalHeight};a.set(o);var r=vk.inflate(o,-20,-20);return m.set(r),e.w===o.w&&e.h===o.h||function(n,u){c.getOpt(n).each(function(n){var t=mu(n.element()),e=su(n.element()),o=u.dom().naturalWidth,r=u.dom().naturalHeight,i=Math.min(t/o,e/r);1<=i?l.set(1):l.set(i)})}(n,i),u(n,i),i})})}var f=vm({dom:{tag:"div",classes:["tox-image-tools__image-bg"],attributes:{role:"presentation"}}}),l=ye(1),d=ye(on.none()),m=ye({x:0,y:0,w:1,h:1}),a=ye({x:0,y:0,w:1,h:1}),n=Wb.sketch({dom:{tag:"div",classes:["tox-image-tools__image"]},components:[f.asSpec(),{dom:{tag:"img",attributes:{src:t}}},{dom:{tag:"div"},behaviours:ba([Kd("image-panel-crop-events",[Ii(function(n){c.getOpt(n).each(function(n){var t=n.element().dom(),e=Tk({x:10,y:10,w:100,h:100},{x:0,y:0,w:200,h:200},{x:0,y:0,w:200,h:200},t,function(){});e.toggleVisibility(!1),e.on("updateRect",function(n){var t=n.rect,e=l.get(),o={x:Math.round(t.x/e),y:Math.round(t.y/e),w:Math.round(t.w/e),h:Math.round(t.h/e)};m.set(o)}),d.set(on.some(e))})})])])}],containerBehaviours:ba([mg.config({}),Kd("image-panel-events",[Ii(function(n){e(n,t)})])])}),c=vm(n);return{memContainer:c,updateSrc:e,zoom:function(n,t){var e=l.get(),o=0').appendTo(o),yk.each(i,function(n){hk("#"+a,o).append(''),components:[],behaviours:ba([RT.config({channel:JF,initialData:n,updateState:function(n,t){var e=S(t.buttons,function(n){var t=vm(function(n,t){return YC(n,n.type,t)}(n,o));return{name:n.name,align:n.align,memento:t}});return on.some({lookupByName:function(n,t){return function(t,n,e){return E(n,function(n){return n.name===e}).bind(function(n){return n.memento.getOpt(t)})}(n,e,t)},footerButtons:e})},renderComponents:z_})])}}function j_(n,t){return wM.parts().footer(L_(n,t))}function U_(t,e){if(t.getRoot().getSystem().isConnected()){var o=Zl.getCurrent(t.getFormWrapper()).getOr(t.getFormWrapper());return dS.getField(o,e).fold(function(){var n=t.getFooter();return RT.getState(n).get().bind(function(n){return n.lookupByName(o,e)})},function(n){return on.some(n)})}return on.none()}function W_(u,o,a){function n(n){var t=u.getRoot();t.getSystem().isConnected()&&n(t)}var c={getData:function(){var n=u.getRoot(),t=n.getSystem().isConnected()?u.getFormWrapper():n,e=Zf.getValue(t),o=P(a,function(n){return n.get()});return N(N({},e),o)},setData:function(i){n(function(n){var t=c.getData(),e=An(t,i),o=function(n,t){var e=n.getRoot();return RT.getState(e).get().map(function(n){return et(tt("data",n.dataValidator,t))}).getOr(t)}(u,e),r=u.getFormWrapper();Zf.setValue(r,o),Cn(a,function(n,t){En(e,t)&&n.set(e[t])})})},disable:function(n){U_(u,n).each(Ch.disable)},enable:function(n){U_(u,n).each(Ch.enable)},focus:function(n){U_(u,n).each(vg.focus)},block:function(t){if(!cn(t))throw new Error("The dialogInstanceAPI.block function should be passed a blocking message of type string as an argument");n(function(n){ro(n,ly,{message:t})})},unblock:function(){n(function(n){oo(n,dy)})},showTab:function(e){n(function(n){var t=u.getBody();RT.getState(t).get().exists(function(n){return n.isTabPanel()})&&Zl.getCurrent(t).each(function(n){WF.showTab(n,e)})})},redial:function(e){n(function(n){var t=o(e);n.getSystem().broadcastOn([YF],t),n.getSystem().broadcastOn([qF],t.internalDialog),n.getSystem().broadcastOn([KF],t.internalDialog),n.getSystem().broadcastOn([JF],t.internalDialog),c.setData(t.initialData)})},close:function(){n(function(n){oo(n,ay)})}};return c}function G_(n,t){return{dom:{tag:"div",styles:{display:"none"},classes:["tox-dialog__header"]},components:[n,t]}}function X_(n,t){return wM.parts().close(Gg.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":t.translate("Close")}},action:n,buttonBehaviours:ba([Gy.config({})])}))}function Y_(){return wM.parts().title({dom:{tag:"div",classes:["tox-dialog__title"],innerHtml:"",styles:{display:"none"}}})}function q_(n,t){return wM.parts().body({dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[{dom:cp("

"+t.translate(n)+"

")}]}]})}function K_(n){return wM.parts().footer({dom:{tag:"div",classes:["tox-dialog__footer"]},components:n})}function J_(n,t){return[Wb.sketch({dom:{tag:"div",classes:["tox-dialog__footer-start"]},components:n}),Wb.sketch({dom:{tag:"div",classes:["tox-dialog__footer-end"]},components:t})]}function $_(t){var n,e="tox-dialog",o=e+"-wrap",r=o+"__backdrop",i=e+"__disable-scroll";return wM.sketch({lazySink:t.lazySink,onEscape:function(n){return t.onEscape(n),on.some(!0)},useTabstopAt:function(n){return!MS(n)},dom:{tag:"div",classes:[e].concat(t.extraClasses),styles:N({position:"relative"},t.extraStyles)},components:g([t.header,t.body],t.footer.toArray()),parts:{blocker:{dom:cp('
'),components:[{dom:{tag:"div",classes:nI?[r,r+"--opaque"]:[r]}}]}},dragBlockClass:o,modalBehaviours:ba(g([vg.config({}),Kd("dialog-events",t.dialogEvents.concat([bo(Qr(),function(n,t){lg.focusIn(n)})])),Kd("scroll-lock",[Ii(function(){fr(zr(),i)}),Ri(function(){dr(zr(),i)})])],t.extraBehaviours)),eventOrder:N((n={},n[di()]=["dialog-events"],n[Ci()]=["scroll-lock","dialog-events","alloy.base.behaviour"],n[ki()]=["alloy.base.behaviour","dialog-events","scroll-lock"],n),t.eventOrder)})}function Q_(n){return Gg.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":n.translate("Close"),title:n.translate("Close")}},components:[{dom:{tag:"div",classes:["tox-icon"],innerHtml:''}}],action:function(n){oo(n,cy)}})}function Z_(n,t,e){function o(n){return[Ir(e.translate(n.title))]}return{dom:{tag:"div",classes:["tox-dialog__title"],attributes:N({},t.map(function(n){return{id:n}}).getOr({}))},components:o(n),behaviours:ba([RT.config({channel:qF,renderComponents:o})])}}function nM(){return{dom:cp('
')}}function tM(n,t){return function(n,t){var e=wM.parts().title(Z_(n,on.none(),t)),o=wM.parts().draghandle(nM()),r=wM.parts().close(Q_(t)),i=[e].concat(n.draggable?[o]:[]).concat([r]);return Wb.sketch({dom:cp('
'),components:i})}({title:t.shared.providers.translate(n),draggable:t.dialog.isDraggableModal()},t.shared.providers)}function eM(n,t){return{onClose:function(){return t.closeWindow()},onBlock:function(e){wM.setBusy(n(),function(n,t){return{dom:{tag:"div",classes:["tox-dialog__busy-spinner"],attributes:{"aria-label":e.message()},styles:{left:"0px",right:"0px",bottom:"0px",top:"0px",position:"absolute"}},behaviours:t,components:[{dom:cp('
')}]}})},onUnblock:function(){wM.setIdle(n())}}}function oM(n,t,e,o){var r;return uu($_(N(N({},n),{lazySink:o.shared.getSink,extraBehaviours:g([RT.config({channel:YF,updateState:function(n,t){return on.some(t)},initialData:t}),DS({})],n.extraBehaviours),onEscape:function(n){oo(n,cy)},dialogEvents:e,eventOrder:(r={},r[li()]=["reflecting","receiving"],r[Ci()]=["scroll-lock","reflecting","messages","dialog-events","alloy.base.behaviour"],r[ki()]=["alloy.base.behaviour","dialog-events","messages","reflecting","scroll-lock"],r)})))}function rM(n){return S(n,function(n){return"menu"===n.type?function(n){var t=S(n.items,function(n){var t=ye(!1);return N(N({},n),{storage:t})});return N(N({},n),{items:t})}(n):n})}function iM(n){return O(n,function(n,t){return"menu"!==t.type?n:O(t.items,function(n,t){return n[t.name]=t.storage,n},n)},{})}function uM(n,t,e){var o=tM(n.internalDialog.title,e),r=function(n,t){var e=H_(n,on.none(),t,!1);return wM.parts().body(e)}({body:n.internalDialog.body},e),i=rM(n.internalDialog.buttons),u=iM(i),a=j_({buttons:i},e),c=ZF(function(){return d},eM(function(){return l},t)),s="normal"!==n.internalDialog.size?"large"===n.internalDialog.size?["tox-dialog--width-lg"]:["tox-dialog--width-md"]:[],f={header:o,body:r,footer:on.some(a),extraClasses:s,extraBehaviours:[],extraStyles:{}},l=oM(f,n,c,e),d=W_({getRoot:function(){return l},getBody:function(){return wM.getBody(l)},getFooter:function(){return wM.getFooter(l)},getFormWrapper:function(){var n=wM.getBody(l);return Zl.getCurrent(n).getOr(n)}},t.redial,u);return{dialog:l,instanceApi:d}}function aM(n,t,e,o){var r,i,u=Xo("dialog-label"),a=Xo("dialog-content"),c=vm(function(n,t,e){return Wb.sketch({dom:cp('
'),components:[Z_(n,on.some(t),e),nM(),Q_(e)],containerBehaviours:ba([w_.config({mode:"mouse",blockerClass:"blocker",getTarget:function(n){return Ou(n,'[role="dialog"]').getOrDie()},snaps:{getSnapPoints:function(){return[]},leftAttr:"data-drag-left",topAttr:"data-drag-top"}})])})}({title:n.internalDialog.title,draggable:!0},u,e.shared.providers)),s=vm(function(n,t,e,o){return H_(n,on.some(t),e,o)}({body:n.internalDialog.body},a,e,o)),f=rM(n.internalDialog.buttons),l=iM(f),d=vm(function(n,t){return L_(n,t)}({buttons:f},e)),m=ZF(function(){return p},{onBlock:function(){},onUnblock:function(){},onClose:function(){return t.closeWindow()}}),g=uu({dom:{tag:"div",classes:["tox-dialog","tox-dialog-inline"],attributes:(r={role:"dialog"},r["aria-labelledby"]=u,r["aria-describedby"]=""+a,r)},eventOrder:(i={},i[li()]=[RT.name(),lc.name()],i[di()]=["execute-on-form"],i[Ci()]=["reflecting","execute-on-form"],i),behaviours:ba([lg.config({mode:"cyclic",onEscape:function(n){return oo(n,ay),on.some(!0)},useTabstopAt:function(n){return!MS(n)&&("button"!==Ke(n)||"disabled"!==zo(n,"disabled"))}}),RT.config({channel:YF,updateState:function(n,t){return on.some(t)},initialData:n}),vg.config({}),Kd("execute-on-form",m.concat([bo(Qr(),function(n,t){lg.focusIn(n)})])),DS({})]),components:[c.asSpec(),s.asSpec(),d.asSpec()]}),p=W_({getRoot:function(){return g},getFooter:function(){return d.get(g)},getBody:function(){return s.get(g)},getFormWrapper:function(){var n=s.get(g);return Zl.getCurrent(n).getOr(n)}},t.redial,l);return{dialog:g,instanceApi:p}}function cM(n){return sn(n)&&-1!==eI.indexOf(n.mceAction)}function sM(e,n,o,t){var r,i=tM(e.title,t),u=function(n){var t={dom:{tag:"div",classes:["tox-dialog__content-js"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-iframe"]},components:[IS({dom:{tag:"iframe",attributes:{src:n.url}},behaviours:ba([Gy.config({}),vg.config({})])})]}],behaviours:ba([lg.config({mode:"acyclic",useTabstopAt:b(MS)})])};return wM.parts().body(t)}(e),a=e.buttons.bind(function(n){return 0===n.length?on.none():on.some(j_({buttons:n},t))}),c=QF(function(){return h},eM(function(){return p},n)),s=N(N({},e.height.fold(function(){return{}},function(n){return{height:n+"px","max-height":n+"px"}})),e.width.fold(function(){return{}},function(n){return{width:n+"px","max-width":n+"px"}})),f=e.width.isNone()&&e.height.isNone()?["tox-dialog--width-lg"]:[],l=new tI(e.url,{base_uri:new tI(v.window.location.href)}),d=l.protocol+"://"+l.host+(l.port?":"+l.port:""),m=ye(on.none()),g=[Kd("messages",[Ii(function(){var n=sb(we.fromDom(v.window),"message",function(n){if(l.isSameOrigin(new tI(n.raw().origin))){var t=n.raw().data;cM(t)?function(n,t,e){switch(e.mceAction){case"insertContent":n.insertContent(e.content);break;case"setContent":n.setContent(e.content);break;case"execCommand":var o=!!ln(e.ui)&&e.ui;n.execCommand(e.cmd,o,e.value);break;case"close":t.close();break;case"block":t.block(e.message);break;case"unblock":t.unblock()}}(o,h,t):function(n){return!cM(n)&&sn(n)&&En(n,"mceAction")}(t)&&e.onMessage(h,t)}});m.set(on.some(n))}),Ri(function(){m.get().each(function(n){return n.unbind()})})]),lc.config({channels:(r={},r[$F]={onReceive:function(n,t){ku(n.element(),"iframe").each(function(n){n.dom().contentWindow.postMessage(t,d)})}},r)})],p=oM({header:i,body:u,footer:a,extraClasses:f,extraBehaviours:g,extraStyles:s},e,c,t),h=function(t){function n(n){t.getSystem().isConnected()&&n(t)}return{block:function(t){if(!cn(t))throw new Error("The urlDialogInstanceAPI.block function should be passed a blocking message of type string as an argument");n(function(n){ro(n,ly,{message:t})})},unblock:function(){n(function(n){oo(n,dy)})},close:function(){n(function(n){oo(n,ay)})},sendMessage:function(t){n(function(n){n.getSystem().broadcastOn([$F],t)})}}}(p);return{dialog:p,instanceApi:h}}var fM,lM,dM,mM,gM,pM=function(i,r){r.delimiter||(r.delimiter="\xbb");return{dom:{tag:"div",classes:["tox-statusbar__path"],attributes:{role:"navigation"}},behaviours:ba([lg.config({mode:"flow",selector:"div[role=button]"}),Gy.config({}),mg.config({}),Kd("elementPathEvents",[Ii(function(e,n){i.shortcuts.add("alt+F11","focus statusbar elementpath",function(){return lg.focusIn(e)}),i.on("NodeChange",function(n){var t=function(n){for(var t=[],e=n.length;0