/** * 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.0.12 (2019-07-18) */ !function(F){"use strict";var tt=function(){},p=function(e,o){return function(){for(var t=[],n=0;n "+o.toString()},function(t,n){return"state("+t+")"})}).join("\n")+"}"},toDsl:function(){return Zt.objOf(P(a,function(t){return t.fold(function(t,n,e,o){return tn.field(t,e,o)},function(t,n){return tn.state(t)})}))}}},hn=function(r){return{extract:function(e,o,t){var n=P(t,function(t,n){return r.extract(e.concat(["["+n+"]"]),o,t)});return Qt(n)},toString:function(){return"array("+r.toString()+")"},toDsl:function(){return Zt.arrOf(r)}}},vn=function(a,c){return{extract:function(e,o,r){var t,n,i=ut(r),u=(t=e,n=i,hn(mn(a)).extract(t,d,n));return Xt(u,function(t){var n=P(t,function(t){return sn.field(t,t,Ct(),c)});return pn(n).extract(e,o,r)})},toString:function(){return"setOf("+c.toString()+")"},toDsl:function(){return Zt.setOf(a,c)}}},bn=nt(mn(Ut)),yn=p(hn,pn),xn=sn.state,wn=sn.field,Sn=function(e,n,o,r,i){return Ft(r,i).fold(function(){return t=r,n=i,cn(e,function(){return'The chosen schema: "'+n+'" did not exist in branches: '+an(t)});var t,n},function(t){return pn(t).extract(e.concat(["branch: "+i]),n,o)})},Cn=function(r,i){return{extract:function(n,e,o){return Ft(o,r).fold(function(){return t=r,cn(n,function(){return'Choice schema did not contain choice key: "'+t+'"'});var t},function(t){return Sn(n,e,o,i,t)})},toString:function(){return"chooseOn("+r+"). Possible values: "+ut(i)},toDsl:function(){return Zt.choiceOf(r,i)}}},kn=mn(Ut),On=function(o){return{extract:function(t,n,e){return o().extract(t,n,e)},toString:function(){return o().toString()},toDsl:function(){return o().toDsl()}}},En=function(n){return mn(function(t){return n(t).fold(Gt,Ut)})},Tn=function(n,t){return vn(function(t){return Lt(n(t))},t)},Bn=function(t,n,e){return jt((o=t,r=d,i=e,u=n.extract([o],r,i),Kt(u,function(t){return{input:i,errors:t}})));var o,r,i,u},Dn=function(t){return t.fold(function(t){throw new Error(_n(t))},d)},An=function(t,n,e){return Dn(Bn(t,n,e))},_n=function(t){return"Errors: \n"+(n=t.errors,e=10 ")+")\n"+t.getErrorInfo()}))+"\n\nInput object: "+an(t.input);var n,e},Mn=function(t,n){return Cn(t,n)},Fn=nt(kn),In=function(e,o){return mn(function(t){var n=typeof t;return e(t)?Ut(t):Gt("Expected type: "+o+" but got: "+n)})},Rn=In(V,"number"),Vn=In(k,"string"),Nn=In(T,"boolean"),Hn=In(B,"function"),Pn=function(n){return En(function(t){return M(n,t)?R.value(t):R.error('Unsupported value: "'+t+'", choose one of "'+n.join(", ")+'".')})},zn=function(t){return wn(t,t,Ct(),bn())},Ln=function(t,n){return wn(t,t,Ct(),n)},jn=function(t){return Ln(t,Vn)},Un=function(t,n){return wn(t,t,Ct(),Pn(n))},Wn=function(t){return Ln(t,Hn)},Gn=function(t,n){return wn(t,t,Ct(),pn(n))},Xn=function(t,n){return wn(t,t,Ct(),yn(n))},Yn=function(t,n){return wn(t,t,Ct(),hn(n))},qn=function(t){return wn(t,t,kt(),bn())},Kn=function(t,n){return wn(t,t,kt(),n)},$n=function(t){return Kn(t,Rn)},Jn=function(t){return Kn(t,Vn)},Qn=function(t){return Kn(t,Hn)},Zn=function(t,n){return Kn(t,pn(n))},te=function(t,n){return wn(t,t,St(n),bn())},ne=function(t,n,e){return wn(t,t,St(n),e)},ee=function(t,n){return ne(t,n,Rn)},oe=function(t,n){return ne(t,n,Vn)},re=function(t,n,e){return ne(t,n,Pn(e))},ie=function(t,n){return ne(t,n,Nn)},ue=function(t,n){return ne(t,n,Hn)},ae=function(t,n,e){return ne(t,n,pn(e))},ce=function(t,n){return xn(t,n)},se=function(t){var n=t,e=function(){return n};return{get:e,set:function(t){n=t},clone:function(){return se(e())}}},le=function(t){if(null===t||t===undefined)throw new Error("Node cannot be null or undefined");return{dom:nt(t)}},fe={fromHtml:function(t,n){var e=(n||F.document).createElement("div");if(e.innerHTML=t,!e.hasChildNodes()||1 "):o[0].name();return It(r,{handler:n,purpose:nt(e)})})});return Vt(n,{})},_i=function(t){return Bn("custom.definition",pn([wn("dom","dom",Ct(),pn([zn("tag"),te("styles",{}),te("classes",[]),te("attributes",{}),qn("value"),qn("innerHtml")])),zn("components"),zn("uid"),te("events",{}),te("apis",{}),wn("eventOrder","eventOrder",(n={"alloy.execute":["disabling","alloy.base.behaviour","toggling","typeaheadevents"],"alloy.focus":["alloy.base.behaviour","focusing","keying"],"alloy.system.init":["alloy.base.behaviour","disabling","toggling","representing"],input:["alloy.base.behaviour","representing","streaming","invalidating"],"alloy.system.detached":["alloy.base.behaviour","representing","item-events","tooltipping"],mousedown:["focusing","alloy.base.behaviour","item-type-events"],mouseover:["item-type-events","tooltipping"]},wt.mergeWithThunk(nt(n))),Fn()),qn("domModification")]),t);var n},Mi=function(t,n){var e=Kr(t,n);return e===undefined||""===e?[]:e.split(" ")},Fi=function(t){return t.dom().classList!==undefined},Ii=function(t,n){return r=n,i=Mi(e=t,o="class").concat([r]),Yr(e,o,i.join(" ")),!0;var e,o,r,i},Ri=function(t,n){return r=n,0<(i=L(Mi(e=t,o="class"),function(t){return t!==r})).length?Yr(e,o,i.join(" ")):Jr(e,o),!1;var e,o,r,i},Vi=function(t,n){Fi(t)?t.dom().classList.add(n):Ii(t,n)},Ni=function(t){0===(Fi(t)?t.dom().classList:Mi(t,"class")).length&&Jr(t,"class")},Hi=function(t,n){Fi(t)?t.dom().classList.remove(n):Ri(t,n);Ni(t)},Pi=function(t,n){return Fi(t)&&t.dom().classList.contains(n)},zi=function(n,t){z(t,function(t){Vi(n,t)})},Li=function(n,t){z(t,function(t){Hi(n,t)})},ji=function(t){return t.style!==undefined&&B(t.style.getPropertyValue)},Ui=function(t,n,e){if(!k(e))throw F.console.error("Invalid call to CSS.set. Property ",n,":: Value ",e,":: Element ",t),new Error("CSS value must be a string: "+e);ji(t)&&t.style.setProperty(n,e)},Wi=function(t,n){ji(t)&&t.style.removeProperty(n)},Gi=function(t,n,e){var o=t.dom();Ui(o,n,e)},Xi=function(t,n){var e=t.dom();ct(n,function(t,n){Ui(e,n,t)})},Yi=function(t,n){var e=t.dom(),o=F.window.getComputedStyle(e).getPropertyValue(n),r=""!==o||rr(t)?o:qi(e,n);return null===r?undefined:r},qi=function(t,n){return ji(t)?t.style.getPropertyValue(n):""},Ki=function(t,n){var e=t.dom(),o=qi(e,n);return et.from(o).filter(function(t){return 0=t.left&&n<=t.right&&e>=t.top&&e<=t.bottom};var Cc=function L_(e,o){var r=function(t){return e(t)?et.from(t.dom().nodeValue):et.none()},t=ze.detect().browser,n=t.isIE()&&10===t.version.major?function(t){try{return r(t)}catch(n){return et.none()}}:r;return{get:function(t){if(!e(t))throw new Error("Can only get "+o+" value of a "+o+" node");return n(t).getOr("")},getOption:n,set:function(t,n){if(!e(t))throw new Error("Can only set raw "+o+" value of a "+o+" node");t.dom().nodeValue=n}}}(er,"text"),kc=function(t){return Cc.get(t)},Oc=function(t){return Cc.getOption(t)},Ec=function(e,o,t,n,r){var i=function(t){var n=e.dom().createRange();return n.setStart(o.dom(),t),n.collapse(!0),n},u=kc(o).length,a=function(t,n,e,o,r){if(0===r)return 0;if(n===o)return r-1;for(var i=o,u=1;u"}),Fn()),wl=ce("schema",function(){return[qn("preprocess")]}),Sl=te("defaults",nt({})),Cl=te("overrides",nt({})),kl=pn([vl,bl,yl,xl,Sl,Cl]),Ol=pn([vl,bl,yl,Sl,Cl]),El=pn([vl,bl,yl,xl,Sl,Cl]),Tl=pn([vl,wl,yl,zn("unit"),xl,Sl,Cl]),Bl=function(t){return t.fold(et.some,et.none,et.some,et.some)},Dl=function(t){var n=function(t){return t.name};return t.fold(n,n,n,n)},Al=function(e,o){return function(t){var n=An("Converting part type",o,t);return e(n)}},_l=Al(hl.required,kl),Ml=Al(hl.external,Ol),Fl=Al(hl.optional,El),Il=Al(hl.group,Tl),Rl=nt("entirety"),Vl=/* */Object.freeze({required:_l,external:Ml,optional:Fl,group:Il,asNamedPart:Bl,name:Dl,asCommon:function(t){return t.fold(d,d,d,d)},original:Rl}),Nl=function(t,n,e,o){return bt(n.defaults(t,e,o),e,{uid:t.partUids[n.name]},n.overrides(t,e,o))},Hl=function(r,t){var n={};return z(t,function(t){Bl(t).each(function(e){var o=Pl(r,e.pname);n[e.name]=function(t){var n=An("Part: "+e.name+" in "+r,pn(e.schema),t);return I({},o,{config:t,validated:n})}})}),n},Pl=function(t,n){return{uiType:pl(),owner:t,name:n}},zl=function(t,n,e){return{uiType:pl(),owner:t,name:n,config:e,validated:{}}},Ll=function(t){return K(t,function(t){return t.fold(et.none,et.some,et.none,et.none).map(function(t){return Gn(t.name,t.schema.concat([Hu(Rl())]))}).toArray()})},jl=function(t){return P(t,Dl)},Ul=function(t,n,e){return o=n,i={},r={},z(e,function(t){t.fold(function(o){i[o.pname]=ml(!0,function(t,n,e){return o.factory.sketch(Nl(t,o,n,e))})},function(t){var n=o.parts[t.name];r[t.name]=nt(t.factory.sketch(Nl(o,t,n[Rl()]),n))},function(o){i[o.pname]=ml(!1,function(t,n,e){return o.factory.sketch(Nl(t,o,n,e))})},function(r){i[r.pname]=gl(!0,function(n,t,e){var o=n[r.name];return P(o,function(t){return r.factory.sketch(bt(r.defaults(n,t,e),t,r.overrides(n,t)))})})})}),{internals:nt(i),externals:nt(r)};var o,i,r},Wl=function(t,n,e){return dl(et.some(t),n,n.components,e)},Gl=function(t,n,e){var o=n.partUids[e];return t.getSystem().getByUid(o).toOption()},Xl=function(t,n,e){return Gl(t,n,e).getOrDie("Could not find part: "+e)},Yl=function(t,n,e){var o={},r=n.partUids,i=t.getSystem();return z(e,function(t){o[t]=i.getByUid(r[t])}),st(o,nt)},ql=function(t,n){var e=t.getSystem();return st(n.partUids,function(t,n){return nt(e.getByUid(t))})},Kl=function(t){return ut(t.partUids)},$l=function(t,n,e){var o={},r=n.partUids,i=t.getSystem();return z(e,function(t){o[t]=i.getByUid(r[t]).getOrDie()}),st(o,nt)},Jl=function(n,t){var e=jl(t);return Rt(P(e,function(t){return{key:t,value:n+"-"+t}}))},Ql=function(n){return wn("partUids","partUids",Et(function(t){return Jl(t.uid,n)}),Fn())},Zl=/* */Object.freeze({generate:Hl,generateOne:zl,schemas:Ll,names:jl,substitutes:Ul,components:Wl,defaultUids:Jl,defaultUidsSchema:Ql,getAllParts:ql,getAllPartNames:Kl,getPart:Gl,getPartOrDie:Xl,getParts:Yl,getPartsOrDie:$l}),tf=function(t,n,e,o,r){var i,u,a=(u=r,(0<(i=o).length?[Gn("parts",i)]:[]).concat([zn("uid"),te("dom",{}),te("components",[]),Hu("originalSpec"),te("debug.sketcher",{})]).concat(u));return An(t+" [SpecSchema]",gn(a.concat(n)),e)},nf=function(t,n,e,o,r){var i=ef(r),u=Ll(e),a=Ql(e),c=tf(t,n,i,u,[a]),s=Ul(0,c,e);return o(c,Wl(t,c,s.internals()),i,s.externals())},ef=function(t){return t.hasOwnProperty("uid")?t:I({},t,{uid:fi("uid")})};var of,rf,uf=gn([zn("name"),zn("factory"),zn("configFields"),te("apis",{}),te("extraApis",{})]),af=gn([zn("name"),zn("factory"),zn("configFields"),zn("partFields"),te("apis",{}),te("extraApis",{})]),cf=function(t){var i=An("Sketcher for "+t.name,uf,t),n=st(i.apis,yi),e=st(i.extraApis,function(t,n){return hi(t,n)});return I({name:nt(i.name),partFields:nt([]),configFields:nt(i.configFields),sketch:function(t){return n=i.name,e=i.configFields,o=i.factory,r=ef(t),o(tf(n,e,r,[],[]),r);var n,e,o,r}},n,e)},sf=function(t){var n=An("Sketcher for "+t.name,af,t),e=Hl(n.name,n.partFields),o=st(n.apis,yi),r=st(n.extraApis,function(t,n){return hi(t,n)});return I({name:nt(n.name),partFields:nt(n.partFields),configFields:nt(n.configFields),sketch:function(t){return nf(n.name,n.configFields,n.partFields,n.factory,t)},parts:nt(e)},o,r)},lf=function(t){return"input"===Zo(t)&&"radio"!==Kr(t,"type")||"textarea"===Zo(t)},ff=/* */Object.freeze({getCurrent:function(t,n,e){return n.find(t)}}),df=[zn("find")],mf=Yu({fields:df,name:"composing",apis:ff}),gf=function(t,n,e,o){var r=t+n;return o',e.getDoc());return Pr(t,fe.fromDom(n.extractContents())),n.insertNode(t.dom()),Mr(t).each(function(t){return t.dom().normalize()}),Fc(t).map(function(t){var n;e.selection.setCursorLocation(t.dom(),"img"===Zo(n=t)?1:Oc(n).fold(function(){return Ir(n).length},function(t){return t.length}))}),t})},Pg=function(t){return gu(t,"[data-mce-autocompleter]")},zg=/[\u00a0 \t\r\n]/,Lg=function(t,n){return t.toString().substring(n.length).replace(/\u00A0/g," ").replace(/\uFEFF/g,"")},jg=function(t,u,a,c){if(void 0===c&&(c=0),!(n=u).collapsed||3!==n.startContainer.nodeType)return et.none();var n;return Ng(t,u.startContainer,u.startOffset,function(e,o,r,t){var i=t.getOr(r.length);return function(t,n,e,o){var r;for(r=n-1;0<=r;r--){var i=t.charAt(r);if(zg.test(i))return et.none();if(i===e)break}return-1===r||n-r=t.minChars&&t.matches.getOrThunk(function(){return e=n.dom,o=function(t,n,e,o){var r=o.getOr(e.length);return 0===r?t.kontinue():t.finish(/\s/.test(e.charAt(r-1)))},function(t){var n=qg(t.startContainer,t.startOffset);return Ng(e,n.element,n.offset,o).fold(nt(!0),nt(!0),d)};var e,o})(e.range,r,e.text)});if(0===i.length)return et.none();var u=Gg.all(P(i,function(n){return n.fetch(e.text,n.maxResults).then(function(t){return{matchText:e.text,items:t,columns:n.columns,onAction:n.onAction}})}));return et.some({lookupData:u,context:e})},Jg=pn([ce("type",function(){return"autocompleteitem"}),ce("active",function(){return!1}),ce("disabled",function(){return!1}),te("meta",{}),jn("value"),Jn("text"),Jn("icon")]),Qg=pn([jn("type"),jn("ch"),ee("minChars",1),te("columns",1),ee("maxResults",10),Qn("matches"),Wn("fetch"),Wn("onAction")]),Zg=function(t){var n,e,o=t.ui.registry.getAll().popups,r=st(o,function(t){return(n=t,Bn("Autocompleter",Qg,n)).fold(function(t){throw new Error(_n(t))},function(t){return t});var n}),i=(n=ft(r,function(t){return t.ch}),e={},z(n,function(t){e[t]={}}),ut(e)),u=dt(r);return{dataset:r,triggerChars:i,lookupByChar:function(n){return L(u,function(t){return t.ch===n})}}},tp=[ie("disabled",!1),Jn("text"),Jn("shortcut"),wn("value","value",Ot(function(){return ri("menuitem-value")}),Fn()),te("meta",{})],np=pn([jn("type"),ue("onSetup",function(){return tt}),ue("onAction",tt),Jn("icon")].concat(tp)),ep=pn([jn("type"),Wn("getSubmenuItems"),ue("onSetup",function(){return tt}),Jn("icon")].concat(tp)),op=pn([jn("type"),ie("active",!1),ue("onSetup",function(){return tt}),Wn("onAction")].concat(tp)),rp=pn([jn("type"),ie("active",!1),Jn("icon")].concat(tp)),ip=pn([jn("type"),Jn("text")]),up=pn([jn("type"),Un("fancytype",["inserttable","colorswatch"]),ue("onAction",tt)]),ap=function(t,o,n){var r=zc(t.element(),"."+n);if(0o}).getOr(r.length);return et.some({numColumns:e,numRows:Math.ceil(r.length/e)})}return et.none()},cp=function(t,n){return Gu([Vm(t,n)])},sp=function(t){return cp(ri("unnamed-events"),t)},lp=[zn("lazySink"),zn("tooltipDom"),te("exclusive",!0),te("tooltipComponents",[]),te("delay",300),re("mode","normal",["normal","follow-highlight"]),te("anchor",function(t){return{anchor:"hotspot",hotspot:t,layouts:{onLtr:nt([La,za,Va,Ha,Na,Pa]),onRtl:nt([La,za,Va,Ha,Na,Pa])}}}),Fu("onHide"),Fu("onShow")],fp=/* */Object.freeze({init:function(){var e=se(et.none()),n=se(et.none()),o=function(){e.get().each(function(t){F.clearTimeout(t)})},t=nt("not-implemented");return wi({getTooltip:function(){return n.get()},isShowing:function(){return n.get().isSome()},setTooltip:function(t){n.set(et.some(t))},clearTooltip:function(){n.set(et.none())},clearTimer:o,resetTimer:function(t,n){o(),e.set(et.some(F.setTimeout(function(){t()},n)))},readState:t})}}),dp=ri("tooltip.exclusive"),mp=ri("tooltip.show"),gp=ri("tooltip.hide"),pp=function(t,n,e){t.getSystem().broadcastOn([dp],{})},hp=/* */Object.freeze({hideAllExclusive:pp,setComponents:function(t,n,e,o){e.getTooltip().each(function(t){t.getSystem().isConnected()&&Sm.set(t,o)})}}),vp=Yu({fields:lp,name:"tooltipping",active:/* */Object.freeze({events:function(o,r){var e=function(n){r.getTooltip().each(function(t){Hs(t),o.onHide(n,t),r.clearTooltip()}),r.clearTimer()};return fr(q([[gr(mp,function(t){r.resetTimer(function(){!function(n){if(!r.isShowing()){pp(n);var t=o.lazySink(n).getOrDie(),e=n.getSystem().build({dom:o.tooltipDom,components:o.tooltipComponents,events:fr("normal"===o.mode?[gr(uo(),function(t){Lo(n,mp)}),gr(ro(),function(t){Lo(n,gp)})]:[]),behaviours:Gu([Sm.config({})])});r.setTooltip(e),Rs(t,e),o.onShow(n,e),Ms.position(t,o.anchor(n),e)}}(t)},o.delay)}),gr(gp,function(t){r.resetTimer(function(){e(t)},o.delay)}),gr(wo(),function(t,n){M(n.channels(),dp)&&e(t)}),Cr(function(t){e(t)})],"normal"===o.mode?[gr(ao(),function(t){Lo(t,mp)}),gr(yo(),function(t){Lo(t,gp)}),gr(uo(),function(t){Lo(t,mp)}),gr(ro(),function(t){Lo(t,gp)})]:[gr(Po(),function(t,n){Lo(t,mp)}),gr(zo(),function(t){Lo(t,gp)})]]))}}),state:fp,apis:hp}),bp=function(t){var n,e,o,r=fe.fromHtml(t),i=Ir(r),u=(e=(n=r).dom().attributes!==undefined?n.dom().attributes:[],U(e,function(t,n){var e;return"class"===n.name?t:I({},t,((e={})[n.name]=n.value,e))},{})),a=(o=r,Array.prototype.slice.call(o.dom().classList,0)),c=0===i.length?{}:{innerHtml:Wr(r)};return I({tag:Zo(r),classes:a,attributes:u},c)},yp=tinymce.util.Tools.resolve("tinymce.util.I18n"),xp="tox-menu-nav__js",wp="tox-collection__item",Sp="tox-swatch",Cp={normal:xp,color:Sp},kp="tox-collection__item--enabled",Op="tox-collection__item-icon",Ep="tox-collection__item-label",Tp="tox-collection__item--active",Bp=function(t){return Ft(Cp,t).getOr(xp)},Dp=tinymce.util.Tools.resolve("tinymce.Env"),Ap=function(t){var e=Dp.mac?{alt:"⌥",ctrl:"⌃",shift:"⇧",meta:"⌘",access:"⌃⌥"}:{meta:"Ctrl",access:"Shift+Alt"},n=t.split("+"),o=P(n,function(t){var n=t.toLowerCase().trim();return gt(e,n)?e[n]:t});return Dp.mac?o.join(""):o.join("+")},_p=function(t){return{dom:{tag:"div",classes:[Op],innerHtml:t}}},Mp=function(t){return{dom:{tag:"div",classes:[Ep]},components:[au(yp.translate(t))]}},Fp=function(t,n){return{dom:{tag:"div",classes:[Ep]},components:[{dom:{tag:t.tag,attributes:{style:t.styleAttr}},components:[au(yp.translate(n))]}]}},Ip=function(t){return{dom:{tag:"div",classes:["tox-collection__item-accessory"],innerHtml:Ap(t)}}},Rp=function(t){return{dom:{tag:"div",classes:[Op,"tox-collection__item-checkmark"],innerHtml:Og("checkmark",t)}}},Vp=function(t,n,e,o,r){var i=e?t.checkMark.orThunk(function(){return n.or(et.some("")).map(_p)}):et.none(),u=t.ariaLabel.map(function(t){return{attributes:{title:yp.translate(t)}}}).getOr({});return{dom:yt({tag:"div",classes:[xp,wp].concat(r?["tox-collection__item-icon-rtl"]:[])},u),optComponents:[i,t.htmlContent.fold(function(){return t.textContent.map(o)},function(t){return et.some({dom:{tag:"div",classes:[Ep],innerHtml:t}})}),t.shortcutContent.map(Ip),t.caret]}},Np=["list-num-default","list-num-lower-alpha","list-num-lower-greek","list-num-lower-roman","list-num-upper-alpha","list-num-upper-roman"],Hp=["list-bull-circle","list-bull-default","list-bull-square"],Pp=function(t,r,n,i){void 0===i&&(i=et.none());var e,o,u,a,c,s,l,f=yp.isRtl()&&t.iconContent.exists(function(t){return M(Hp,t)}),d=(e=t.iconContent,e.map(function(t){return yp.isRtl()&&M(Np,t)?t+"-rtl":t})).map(function(t){return n=t,e=r.icons,o=i,et.from(e()[n]).or(o).getOrThunk(function(){return kg(e)});var n,e,o}),m=et.from(t.meta).fold(function(){return Mp},function(t){return gt(t,"style")?g(Fp,t.style):Mp});return"color"===t.presets?(o=t.ariaLabel,u=t.value,a=r,{dom:(c=Sp,s=d.getOr(""),l=o.map(function(t){return' title="'+a.translate(t)+'"'}).getOr(""),bp("custom"===u?'":"remove"===u?'
"+s+"
":'
")),optComponents:[]}):Vp(t,d,n,m,f)},zp=["input","button","textarea","select"],Lp=function(t,n,e){n.disabled&&Yp(t,n)},jp=function(t){return M(zp,Zo(t.element()))},Up=function(t){Yr(t.element(),"disabled","disabled")},Wp=function(t){Jr(t.element(),"disabled")},Gp=function(t){Yr(t.element(),"aria-disabled","true")},Xp=function(t){Yr(t.element(),"aria-disabled","false")},Yp=function(n,t,e){t.disableClass.each(function(t){Vi(n.element(),t)}),(jp(n)?Up:Gp)(n),t.onDisabled(n)},qp=function(n,t,e){t.disableClass.each(function(t){Hi(n.element(),t)}),(jp(n)?Wp:Xp)(n),t.onEnabled(n)},Kp=function(t){return jp(t)?$r(t.element(),"disabled"):"true"===Kr(t.element(),"aria-disabled")},$p=/* */Object.freeze({enable:qp,disable:Yp,isDisabled:Kp,onLoad:Lp,set:function(t,n,e,o){(o?Yp:qp)(t,n,e)}}),Jp=/* */Object.freeze({exhibit:function(t,n,e){return Ci({classes:n.disabled?n.disableClass.map(Z).getOr([]):[]})},events:function(t,n){return fr([dr(So(),function(t,n){return Kp(t)}),zu(t,n,Lp)])}}),Qp=[te("disabled",!1),qn("disableClass"),Fu("onDisabled"),Fu("onEnabled")],Zp=Yu({fields:Qp,name:"disabling",active:Jp,apis:$p}),th=function(t){return Zp.config({disabled:t,disableClass:"tox-collection__item--state-disabled"})},nh=function(t){return Zp.config({disabled:t})},eh=function(t){return Zp.config({disabled:t,disableClass:"tox-tbtn--disabled"})},oh=function(t,n){var e=t.getApi(n);return function(t){t(e)}},rh=function(e,o){return Sr(function(t){oh(e,t)(function(t){var n=e.onSetup(t);null!==n&&n!==undefined&&o.set(n)})})},ih=function(n,e){return Cr(function(t){return oh(n,t)(e.get())})};(_g=Ag||(Ag={}))[_g.CLOSE_ON_EXECUTE=0]="CLOSE_ON_EXECUTE",_g[_g.BUBBLE_TO_SANDBOX=1]="BUBBLE_TO_SANDBOX";var uh=Ag,ah={"alloy.execute":["disabling","alloy.base.behaviour","toggling","item-events"]},ch=function(t){return K(t,function(t){return t.toArray()})},sh=function(t,n,e){var o,r,i=se(tt);return{type:"item",dom:n.dom,components:ch(n.optComponents),data:t.data,eventOrder:ah,hasSubmenu:t.triggersSubmenu,itemBehaviours:Gu([Vm("item-events",[(o=t,r=e,Or(function(t,n){oh(o,t)(o.onAction),o.triggersSubmenu||r!==uh.CLOSE_ON_EXECUTE||(Lo(t,To()),n.stop())})),rh(t,i),ih(t,i)]),th(t.disabled),Sm.config({})].concat(t.itemBehaviours))}},lh=function(t){return{value:t.value,meta:yt({text:t.text.getOr("")},t.meta)}},fh=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),dh=function(t,n){var e,o=yp.translate(t),r=(e=o,fh.DOM.encode(e));if(0'+t+""})}return r},mh=nt(Hl("item-widget",cg())),gh=ri("cell-over"),ph=ri("cell-execute"),hh=function(n,e,t){var o,r=function(t){return jo(t,ph,{row:n,col:e})};return lu({dom:{tag:"div",attributes:(o={role:"button"},o["aria-labelledby"]=t,o)},behaviours:Gu([Vm("insert-table-picker-cell",[gr(uo(),Lm.focus),gr(So(),r),gr(Oo(),r)]),Zm.config({toggleClass:"tox-insert-table-picker__selected",toggleOnExecute:!1}),Lm.config({onFocus:function(t){return jo(t,gh,{row:n,col:e})}})])})};var vh=function(t){return{value:nt(t)}},bh=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,yh=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,xh=function(t){return bh.test(t)||yh.test(t)},wh=function(t){var n,e=(n=t.value().replace(bh,function(t,n,e,o){return n+n+e+e+o+o}),{value:nt(n)}),o=yh.exec(e.value());return null===o?["FFFFFF","FF","FF","FF"]:o},Sh=function(t){var n=t.toString(16);return 1===n.length?"0"+n:n},Ch=function(t){var n=Sh(t.red())+Sh(t.green())+Sh(t.blue());return vh(n)},kh=Math.min,Oh=Math.max,Eh=Math.round,Th=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)/,Bh=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d?(?:\.\d+)?)\)/,Dh=function(t,n,e,o){return{red:nt(t),green:nt(n),blue:nt(e),alpha:nt(o)}},Ah=function(t){var n=parseInt(t,10);return n.toString()===t&&0<=n&&n<=255},_h=function(t){var n,e,o,r=(t.hue()||0)%360,i=t.saturation()/100,u=t.value()/100;if(i=Oh(0,kh(i,1)),u=Oh(0,kh(u,1)),0===i)return n=e=o=Eh(255*u),Dh(n,e,o,1);var a=r/60,c=u*i,s=c*(1-Math.abs(a%2-1)),l=u-c;switch(Math.floor(a)){case 0:n=c,e=s,o=0;break;case 1:n=s,e=c,o=0;break;case 2:n=0,e=c,o=s;break;case 3:n=0,e=s,o=c;break;case 4:n=s,e=0,o=c;break;case 5:n=c,e=0,o=s;break;default:n=e=o=0}return n=Eh(255*(n+l)),e=Eh(255*(e+l)),o=Eh(255*(o+l)),Dh(n,e,o,1)},Mh=function(t){var n=wh(t),e=parseInt(n[1],16),o=parseInt(n[2],16),r=parseInt(n[3],16);return Dh(e,o,r,1)},Fh=function(t,n,e,o){var r=parseInt(t,10),i=parseInt(n,10),u=parseInt(e,10),a=parseFloat(o);return Dh(r,i,u,a)},Ih=function(t){return"rgba("+t.red()+","+t.green()+","+t.blue()+","+t.alpha()+")"},Rh=nt(Dh(255,0,0,1)),Vh=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),Nh="tinymce-custom-colors";var Hh="choiceitem",Ph=[{type:Hh,text:"Light Green",value:"#BFEDD2"},{type:Hh,text:"Light Yellow",value:"#FBEEB8"},{type:Hh,text:"Light Red",value:"#F8CAC6"},{type:Hh,text:"Light Purple",value:"#ECCAFA"},{type:Hh,text:"Light Blue",value:"#C2E0F4"},{type:Hh,text:"Green",value:"#2DC26B"},{type:Hh,text:"Yellow",value:"#F1C40F"},{type:Hh,text:"Red",value:"#E03E2D"},{type:Hh,text:"Purple",value:"#B96AD9"},{type:Hh,text:"Blue",value:"#3598DB"},{type:Hh,text:"Dark Turquoise",value:"#169179"},{type:Hh,text:"Orange",value:"#E67E23"},{type:Hh,text:"Dark Red",value:"#BA372A"},{type:Hh,text:"Dark Purple",value:"#843FA1"},{type:Hh,text:"Dark Blue",value:"#236FA1"},{type:Hh,text:"Light Gray",value:"#ECF0F1"},{type:Hh,text:"Medium Gray",value:"#CED4D9"},{type:Hh,text:"Gray",value:"#95A5A6"},{type:Hh,text:"Dark Gray",value:"#7E8C8D"},{type:Hh,text:"Navy Blue",value:"#34495E"},{type:Hh,text:"Black",value:"#000000"},{type:Hh,text:"White",value:"#ffffff"}],zh=function j_(r){void 0===r&&(r=10);var t,n=Vh.getItem(Nh),e=k(n)?JSON.parse(n):[],i=r-(t=e).length<0?t.slice(0,r):t,u=function(t){i.splice(t,1)};return{add:function(t){var n,e,o;(n=i,e=t,o=_(n,e),-1===o?et.none():et.some(o)).each(u),i.unshift(t),i.length>r&&i.pop(),Vh.setItem(Nh,JSON.stringify(i))},state:function(){return i.slice(0)}}}(10),Lh=function(t){var n=[],u=F.document.createElement("canvas");u.height=1,u.width=1;for(var a=u.getContext("2d"),c=function(t,n){var e=n/255;return("0"+Math.round(t*e+255*(1-e)).toString(16)).slice(-2).toUpperCase()},e=function(t){if(/^[0-9A-Fa-f]{6}$/.test(t))return"#"+t.toUpperCase();a.clearRect(0,0,u.width,u.height),a.fillStyle="#FFFFFF",a.fillStyle=t,a.fillRect(0,0,1,1);var n=a.getImageData(0,0,1,1).data,e=n[0],o=n[1],r=n[2],i=n[3];return"#"+c(e,i)+c(o,i)+c(r,i)},o=0;o=r.minChars){var o=mf.getCurrent(e).bind(function(t){return Ef.getHighlighted(t).map(Rm.getValue)});r.previewing.set(!0),Kb(r,u(t),t,e,i,function(t){mf.getCurrent(e).each(function(t){o.fold(function(){r.model.selectsOver&&Ef.highlightFirst(t)},function(n){Ef.highlightBy(t,function(t){return Rm.getValue(t).value===n.value}),Ef.getHighlighted(t).orThunk(function(){return Ef.highlightFirst(t),et.none()})})})},vb.HighlightFirst).get(tt)}},cancelEvent:Bo()}),vm.config({mode:"special",onDown:function(t,n){return e(t,n,Ef.highlightFirst),et.some(!0)},onEscape:function(t){var n=Vb.getCoupled(t,"sandbox");return Js.isOpen(n)?(Js.close(n),et.some(!0)):et.none()},onUp:function(t,n){return e(t,n,Ef.highlightLast),et.some(!0)},onEnter:function(n){var t=Vb.getCoupled(n,"sandbox"),e=Js.isOpen(t);if(e&&!r.previewing.get())return mf.getCurrent(t).bind(function(t){return Ef.getHighlighted(t)}).map(function(t){return jo(n,cy(),{item:t}),!0});var o=Rm.getValue(n);return Lo(n,Bo()),r.onExecute(t,n,o),e&&Js.close(t),et.some(!0)}}),Zm.config({toggleClass:r.markers.openClass,aria:{mode:"expanded"}}),Vb.config({others:{sandbox:function(t){return ty(r,t,{onOpen:function(){return Zm.on(t)},onClose:function(){return Zm.off(t)}})}}}),Vm("typeaheadevents",[Or(function(t){var n=tt;Jb(r,u(t),t,i,n,vb.HighlightFirst).get(tt)}),gr(cy(),function(t,n){var e=Vb.getCoupled(t,"sandbox");ny(r.model,t,n.event().item()),Lo(t,Bo()),r.onItemExecute(t,e,n.event().item(),Rm.getValue(t)),Js.close(e),oy(t)})].concat(r.dismissOnBlur?[gr(yo(),function(t){var n=Vb.getCoupled(t,"sandbox");Pf(n.element()).isNone()&&Js.close(n)})]:[]))];return{uid:r.uid,dom:ay(bt(r,{inputAttributes:{role:"combobox","aria-autocomplete":"list","aria-haspopup":"true"}})),behaviours:I({},o,il(r.typeaheadBehaviours,a)),eventOrder:r.eventOrder}}}),my=function(t,n,e,o){var r=py(t,n,e,o);return Fb.sketch(r)},gy=function(t,n){return my(t,n,[],[])},py=function(t,n,e,o){return{dom:hy(e),components:t.toArray().concat([n]),fieldBehaviours:Gu(o)}},hy=function(t){return{tag:"div",classes:["tox-form__group"].concat(t)}},vy=function(t,n){return Fb.parts().label({dom:{tag:"label",classes:["tox-label"],innerHtml:n.translate(t)}})},by=function(t){return"separator"===t.type},yy={type:"separator"},xy=function(t,e){var n=U(t,function(t,n){return k(n)?""===n?t:"|"===n?0"},Hw=function(o,t,n){return{uid:o.uid,dom:o.dom,components:t,behaviours:il(o.formBehaviours,[Rm.config({store:{mode:"manual",getValue:function(t){var n=ql(t,o);return st(n,function(t,n){return t().bind(function(t){var n,e=mf.getCurrent(t);return n="missing current",e.fold(function(){return R.error(n)},R.value)}).map(Rm.getValue)})},setValue:function(e,t){ct(t,function(n,t){Gl(e,o,t).each(function(t){mf.getCurrent(t).each(function(t){Rm.setValue(t,n)})})})}}})]),apis:{getField:function(t,n){return Gl(t,o,n).bind(mf.getCurrent)}}}},Pw={getField:yi(function(t,n,e){return t.getField(n,e)}),sketch:function(t){var e,n=(e=[],{field:function(t,n){return e.push(t),zl("form",Nw(t),n)},record:function(){return e}}),o=t(n),r=n.record(),i=P(r,function(t){return _l({name:t,pname:Nw(t)})});return nf("form",Vw,i,Hw,o)}},zw=ri("valid-input"),Lw=ri("invalid-input"),jw=ri("validating-input"),Uw="colorcustom.rgb.",Ww=function(d,m,g,p){var h=function(t,n,e,o,r){var i,u,a=d(Uw+"range"),c=[Fb.parts().label({dom:{tag:"label",innerHtml:e,attributes:{"aria-label":o}}}),Fb.parts().field({data:r,factory:ky,inputAttributes:I({type:"text"},"hex"===n?{"aria-live":"polite"}:{}),inputClasses:[m("textfield")],inputBehaviours:Gu([(i=n,u=t,Iy.config({invalidClass:m("invalid"),notify:{onValidate:function(t){jo(t,jw,{type:i})},onValid:function(t){jo(t,zw,{type:i,value:Rm.getValue(t)})},onInvalid:function(t){jo(t,Lw,{type:i,value:Rm.getValue(t)})}},validator:{validate:function(t){var n=Rm.getValue(t),e=u(n)?R.value(!0):R.error(d("aria.input.invalid"));return Gb.pure(e)},validateOnLoad:!1}})),Ny.config({})]),onSetValue:function(t){Iy.isInvalid(t)&&Iy.run(t).get(tt)}})],s="hex"!==n?[Fb.parts()["aria-descriptor"]({text:a})]:[];return{dom:{tag:"div",attributes:{role:"presentation"}},components:c.concat(s)}},v=function(t,n){var e=n.red(),o=n.green(),r=n.blue();Rm.setValue(t,{red:e,green:o,blue:r})},b=Cg({dom:{tag:"div",classes:[m("rgba-preview")],styles:{"background-color":"white"},attributes:{role:"presentation"}}}),y=function(t,n){b.getOpt(t).each(function(t){Gi(t.element(),"background-color","#"+n.value())})};return cf({factory:function(){var e={red:nt(se(et.some(255))),green:nt(se(et.some(255))),blue:nt(se(et.some(255))),hex:nt(se(et.some("ffffff")))},o=function(t){return e[t]().get()},i=function(t,n){e[t]().set(n)},r=function(t){var n=t.red(),e=t.green(),o=t.blue();i("red",et.some(n)),i("green",et.some(e)),i("blue",et.some(o))},n=function(t,n){var e=n.event();"hex"!==e.type()?i(e.type(),et.none()):p(t)},u=function(r,t,n){var e=parseInt(n,10);i(t,et.some(e)),o("red").bind(function(e){return o("green").bind(function(n){return o("blue").map(function(t){return Dh(e,n,t,1)})})}).each(function(t){var n,e,o=(n=r,e=Ch(t),Pw.getField(n,"hex").each(function(t){Lm.isFocused(t)||Rm.setValue(n,{hex:e.value()})}),e);y(r,o)})},a=function(t,n){var e=n.event();"hex"===e.type()?function(t,n){g(t);var e=vh(n);i("hex",et.some(n));var o=Mh(e);v(t,o),r(o),jo(t,Yy(),{hex:e}),y(t,e)}(t,e.value()):u(t,e.type(),e.value())},t=function(t){return{label:d(Uw+t+".label"),description:d(Uw+t+".description")}},c=t("red"),s=t("green"),l=t("blue"),f=t("hex");return bt(Pw.sketch(function(t){return{dom:{tag:"form",classes:[m("rgb-form")],attributes:{"aria-label":d("aria.color.picker")}},components:[t.field("red",Fb.sketch(h(Ah,"red",c.label,c.description,255))),t.field("green",Fb.sketch(h(Ah,"green",s.label,s.description,255))),t.field("blue",Fb.sketch(h(Ah,"blue",l.label,l.description,255))),t.field("hex",Fb.sketch(h(xh,"hex",f.label,f.description,"ffffff"))),b.asSpec()],formBehaviours:Gu([Iy.config({invalidClass:m("form-invalid")}),Vm("rgb-form-events",[gr(zw,a),gr(Lw,n),gr(jw,n)])])}}),{apis:{updateHex:function(t,n){var e,o;Rm.setValue(t,{hex:n.value()}),e=t,o=Mh(n),v(e,o),r(o),y(t,n)}}})},name:"RgbForm",configFields:[],apis:{updateHex:function(t,n,e){t.updateHex(n,e)}},extraApis:{}})},Gw=function(t,o){var r=Iw.parts().spectrum({dom:{tag:"canvas",attributes:{role:"presentation"},classes:[o("sv-palette-spectrum")]}}),i=Iw.parts().thumb({dom:{tag:"div",attributes:{role:"presentation"},classes:[o("sv-palette-thumb")],innerHtml:"'}}),u=function(t,n){var e=t.width,o=t.height,r=t.getContext("2d");if(null!==r){r.fillStyle=n,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)}};return cf({factory:function(t){var n=nt({x:nt(0),y:nt(0)}),e=Gu([mf.config({find:et.some}),Lm.config({})]);return Iw.sketch({dom:{tag:"div",attributes:{role:"presentation"},classes:[o("sv-palette")]},model:{mode:"xy",getInitialValue:n},rounded:!1,components:[r,i],onChange:function(t,n,e){jo(t,Ky(),{value:e})},onInit:function(t,n,e,o){u(e.element().dom(),Ih(Rh()))},sliderBehaviours:e})},name:"SaturationBrightnessPalette",configFields:[],apis:{setRgba:function(t,n,e){var o,r;o=e,r=n.components()[0].element().dom(),u(r,Ih(o))}},extraApis:{}})},Xw=function(c,s){return cf({name:"ColourPicker",configFields:[zn("dom"),te("onValidHex",tt),te("onInvalidHex",tt)],factory:function(t){var a,v,e=Ww(c,s,t.onValidHex,t.onInvalidHex),o=Gw(c,s),b={paletteRgba:nt(se(Rh()))},n=Cg(o.sketch({})),r=Cg(e.sketch({})),i=function(t,e){n.getOpt(t).each(function(t){var n=Mh(e);b.paletteRgba().set(n),o.setRgba(t,n)})},u=function(t,n){r.getOpt(t).each(function(t){e.updateHex(t,n)})},y=function(n,e,t){z(t,function(t){t(n,e)})};return{uid:t.uid,dom:t.dom,components:[n.asSpec(),Rw(c,s),r.asSpec()],behaviours:Gu([Vm("colour-picker-events",[gr(Ky(),(v=[u],function(t,n){var e,o,r,i,u,a,c,s,l,f=n.event().value(),d=b.paletteRgba().get(),m=(i=r=0,u=(e=d).red()/255,a=e.green()/255,c=e.blue()/255,s=Math.min(u,Math.min(a,c)),l=Math.max(u,Math.max(a,c)),s===l?Xy(0,0,100*(i=s)):(r=60*((r=u===s?3:c===s?1:5)-(u===s?a-c:c===s?u-a:c-u)/(l-s)),o=(l-s)/l,i=l,Xy(Math.round(r),Math.round(100*o),Math.round(100*i)))),g=Xy(m.hue(),f.x(),100-f.y()),p=_h(g),h=Ch(p);y(t,h,v)})),gr(qy(),(a=[i,u],function(t,n){var e,o,r,i=n.event().value(),u=(e=i.y(),o=Xy((100-e)/100*360,100,100),r=_h(o),Ch(r));y(t,u,a)}))]),mf.config({find:function(t){return r.getOpt(t)}}),vm.config({mode:"acyclic"})])}}})},Yw=function(){return mf.config({find:et.some})},qw=function(t){return mf.config({find:t.getOpt})},Kw=function(t){return mf.config({find:function(n){return Rr(n.element(),t).bind(function(t){return n.getSystem().getByDom(t).toOption()})}})},$w={"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"},Jw=function(t){return $w[t]},Qw=pn([te("preprocess",d),te("postprocess",d)]),Zw=function(t,n,e){return Rm.config(bt({store:{mode:"manual",getValue:n,setValue:e}},t.map(function(t){return{store:{initialValue:t}}}).getOr({})))},tS=function(t,n,e){return Zw(t,function(t){return n(t.element())},function(t,n){return e(t.element(),n)})},nS=function(r,t){var i=An("RepresentingConfigs.memento processors",Qw,t);return Rm.config({store:{mode:"manual",getValue:function(t){var n=r.get(t),e=Rm.getValue(n);return i.postprocess(e)},setValue:function(t,n){var e=i.preprocess(n),o=r.get(t);Rm.setValue(o,e)}}})},eS=Zw,oS=function(t){return tS(t,Wr,Gr)},rS=function(t){return Rm.config({store:{mode:"memory",initialValue:t}})},iS=function(r,n){var e=function(t,n){n.stop()},o=function(t){return function(n,e){z(t,function(t){t(n,e)})}},i=function(t,n){if(!Zp.isDisabled(t)){var e=n.event().raw();a(t,e.dataTransfer.files)}},u=function(t,n){var e=n.event().raw().target.files;a(t,e)},a=function(t,n){var e,o;Rm.setValue(t,(e=n,o=new RegExp("("+".jpg,.jpeg,.png,.gif".split(/\s*,\s*/).join("|")+")$","i"),L(it(e),function(t){return o.test(t.name)}))),jo(t,Sb,{name:r.name})},c=Cg({dom:{tag:"input",attributes:{type:"file",accept:"image/*"},styles:{display:"none"}},behaviours:Gu([Vm("input-file-events",[yr(Oo())])])}),t=r.label.map(function(t){return vy(t,n)}),s=Fb.parts().field({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-dropzone-container"]},behaviours:Gu([rS([]),Yw(),Zp.config({}),Zm.config({toggleClass:"dragenter",toggleOnExecute:!1}),Vm("dropzone-events",[gr("dragenter",o([e,Zm.toggle])),gr("dragleave",o([e,Zm.toggle])),gr("dragover",e),gr("drop",o([e,i])),gr(mo(),u)])]),components:[{dom:{tag:"div",classes:["tox-dropzone"],styles:{}},components:[{dom:{tag:"p",innerHtml:n.translate("Drop an image here")}},Sg.sketch({dom:{tag:"button",innerHtml:n.translate("Browse for an image"),styles:{position:"relative"},classes:["tox-button","tox-button--secondary"]},components:[c.asSpec()],action:function(t){c.get(t).element().dom().click()},buttonBehaviours:Gu([Ny.config({})])})]}]}}}});return my(t,s,["tox-form__group--stretched"],[])},uS=ri("alloy-fake-before-tabstop"),aS=ri("alloy-fake-after-tabstop"),cS=function(t){return{dom:{tag:"div",styles:{width:"1px",height:"1px",outline:"none"},attributes:{tabindex:"0"},classes:t},behaviours:Gu([Lm.config({ignore:!0}),Ny.config({})])}},sS=function(t,n){jo(t,so(),{raw:{which:9,shiftKey:n}})},lS=function(t){return Uv(t,["."+uS,"."+aS].join(","),nt(!1))},fS=function(t,n){var e=n.element();Pi(e,uS)?sS(t,!0):Pi(e,aS)&&sS(t,!1)},dS=function(t){return{dom:{tag:"div",classes:["tox-navobj"]},components:[cS([uS]),t,cS([aS])],behaviours:Gu([Kw(1)])}},mS=!(ze.detect().browser.isIE()||ze.detect().browser.isEdge()),gS=function(t,n){var o,r,e=mS&&t.sandboxed,i=I({},t.label.map(function(t){return{title:t}}).getOr({}),e?{sandbox:"allow-scripts allow-same-origin"}:{}),u=(o=e,r=se(""),{getValue:function(t){return r.get()},setValue:function(t,n){if(o)Yr(t.element(),"srcdoc",n);else{Yr(t.element(),"src","javascript:''");var e=t.element().dom().contentWindow.document;e.open(),e.write(n),e.close()}r.set(n)}}),a=t.label.map(function(t){return vy(t,n)}),c=Fb.parts().field({factory:{sketch:function(t){return dS({uid:t.uid,dom:{tag:"iframe",attributes:i},behaviours:Gu([Ny.config({}),Lm.config({}),eS(et.none(),u.getValue,u.setValue)])})}}});return my(a,c,["tox-form__group--stretched"],[])};function pS(t,n){return bS(F.document.createElement("canvas"),t,n)}function hS(t){var n=pS(t.width,t.height);return vS(n).drawImage(t,0,0),n}function vS(t){return t.getContext("2d")}function bS(t,n,e){return t.width=n,t.height=e,t}var yS={atob:function(t){return on.getOrDie("atob")(t)},requestAnimationFrame:function(t){on.getOrDie("requestAnimationFrame")(t)}};function xS(t){return t.naturalWidth||t.width}function wS(t){return t.naturalHeight||t.height}var SS=window.Promise?window.Promise:function(){var i=function(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=null,this._value=null,this._deferreds=[],l(t,o(r,this),o(a,this))},t=i.immediateFn||"function"==typeof window.setImmediate&&window.setImmediate||function(t){F.setTimeout(t,1)};function o(t,n){return function(){return t.apply(n,arguments)}}var e=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function u(o){var r=this;null!==this._state?t(function(){var t=r._state?o.onFulfilled:o.onRejected;if(null!==t){var n;try{n=t(r._value)}catch(e){return void o.reject(e)}o.resolve(n)}else(r._state?o.resolve:o.reject)(r._value)}):this._deferreds.push(o)}function r(t){try{if(t===this)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if("function"==typeof n)return void l(o(n,t),o(r,this),o(a,this))}this._state=!0,this._value=t,c.call(this)}catch(e){a.call(this,e)}}function a(t){this._state=!1,this._value=t,c.call(this)}function c(){for(var t=0,n=this._deferreds;t").css({position:"absolute",top:0,left:0,width:o.width,height:o.height,zIndex:2147483647,opacity:1e-4,cursor:e}).appendTo(d.body),FC(d).on("mousemove touchmove",c).on("mouseup touchend",a),r.start(t)},c=function(t){if(HC(t),t.button!==u)return a(t);t.deltaX=t.screenX-l,t.deltaY=t.screenY-f,t.preventDefault(),r.drag(t)},a=function(t){HC(t),FC(d).off("mousemove touchmove",c).off("mouseup touchend",a),i.remove(),r.stop&&r.stop(t)},this.destroy=function(){FC(m).off()},FC(m).on("mousedown touchstart",n)}var zC=0;var LC=function(n){var l=Cg({dom:{tag:"div",classes:["tox-image-tools__image-bg"],attributes:{role:"presentation"}}}),f=se(1),d=se(et.none()),m=se({x:0,y:0,w:1,h:1}),c=se({x:0,y:0,w:1,h:1}),s=function(t,s){g.getOpt(t).each(function(t){var e=f.get(),o=fa(t.element()),r=ca(t.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),n={left:a.toString()+"px",top:c.toString()+"px",width:i.toString()+"px",height:u.toString()+"px",position:"absolute"};Xi(s,n),l.getOpt(t).each(function(t){Xi(t.element(),n)}),d.get().each(function(t){var n=m.get();t.setRect({x:n.x*e+a,y:n.y*e+c,w:n.w*e,h:n.h*e}),t.setClampRect({x:a,y:c,w:i,h:u}),t.setViewPortRect({x:0,y:0,w:o,h:r})})})},e=function(t,n){var e,a=fe.fromTag("img");return Yr(a,"src",n),(e=a.dom(),new Gg(function(t){var n=function(){e.removeEventListener("load",n),t(e)};e.complete?t(e):e.addEventListener("load",n)})).then(function(){return g.getOpt(t).map(function(t){var n=cu({element:a});Sm.replaceAt(t,1,et.some(n));var e=c.get(),o={x:0,y:0,w:a.dom().naturalWidth,h:a.dom().naturalHeight};c.set(o);var r,u,i=IC.inflate(o,-20,-20);return m.set(i),e.w===o.w&&e.h===o.h||(r=t,u=a,g.getOpt(r).each(function(t){var n=fa(t.element()),e=ca(t.element()),o=u.dom().naturalWidth,r=u.dom().naturalHeight,i=Math.min(n/o,e/r);1<=i?f.set(1):f.set(i)})),s(t,a),a})})},t=cb.sketch({dom:{tag:"div",classes:["tox-image-tools__image"]},components:[l.asSpec(),{dom:{tag:"img",attributes:{src:n}}},{dom:{tag:"div"},behaviours:Gu([Vm("image-panel-crop-events",[Sr(function(t){g.getOpt(t).each(function(t){var n=function S(s,e,l,o,r){var f,u,n,i,a="tox-",c="tox-crid-"+zC++;function d(t,n){return{x:n.x-t.x,y:n.y-t.y,w:n.w,h:n.h}}function m(t,n,e,o){var r,i,u,a,c;r=n.x,i=n.y,u=n.w,a=n.h,r+=e*t.deltaX,i+=o*t.deltaY,(u+=e*t.deltaW)<20&&(u=20),(a+=o*t.deltaH)<20&&(a=20),c=s=IC.clamp({x:r,y:i,w:u,h:a},l,"move"===t.name),c=d(l,c),f.fire("updateRect",{rect:c}),h(c)}function g(n){function t(t,n){n.h<0&&(n.h=0),n.w<0&&(n.w=0),FC("#"+c+"-"+t,o).css({left:n.x,top:n.y,width:n.w,height:n.h})}VC.each(u,function(t){FC("#"+c+"-"+t.name,o).css({left:n.w*t.xMul+n.x,top:n.h*t.yMul+n.y})}),t("top",{x:e.x,y:e.y,w:e.w,h:n.y-e.y}),t("right",{x:n.x+n.w,y:n.y,w:e.w-n.x-n.w+e.x,h:n.h}),t("bottom",{x:e.x,y:n.y+n.h,w:e.w,h:e.h-n.y-n.h+e.y}),t("left",{x:e.x,y:n.y,w:n.x-e.x,h:n.h}),t("move",n)}function p(t){g(s=t)}function h(t){p(function e(t,n){return{x:n.x+t.x,y:n.y+t.y,w:n.w,h:n.h}}(l,t))}return u=[{name:"move",xMul:0,yMul:0,deltaX:1,deltaY:1,deltaW:0,deltaH:0,label:"Crop Mask"},{name:"nw",xMul:0,yMul:0,deltaX:1,deltaY:1,deltaW:-1,deltaH:-1,label:"Top Left Crop Handle"},{name:"ne",xMul:1,yMul:0,deltaX:0,deltaY:1,deltaW:1,deltaH:-1,label:"Top Right Crop Handle"},{name:"sw",xMul:0,yMul:1,deltaX:1,deltaY:0,deltaW:-1,deltaH:1,label:"Bottom Left Crop Handle"},{name:"se",xMul:1,yMul:1,deltaX:0,deltaY:0,deltaW:1,deltaH:1,label:"Bottom Right Crop Handle"}],i=["top","right","bottom","left"],function v(){FC('
').appendTo(o),VC.each(i,function(t){FC("#"+c,o).append(''),components:[],behaviours:Gu([IE.config({channel:l_,initialData:t,updateState:function(t,n){var r=P(n.buttons,function(t){var n,e,o=Cg((e=i,vC(n=t,n.type,e)));return{name:t.name,align:t.align,memento:o}});return et.some({lookupByName:function(t,n){return e=t,o=n,W(r,function(t){return t.name===o}).bind(function(t){return t.memento.getOpt(e)});var e,o},footerButtons:r})},renderComponents:h_})])}},b_=function(t,n){return XD.parts().footer(v_(t,n))},y_=function(n,e){if(n.getRoot().getSystem().isConnected()){var o=mf.getCurrent(n.getFormWrapper()).getOr(n.getFormWrapper());return Pw.getField(o,e).fold(function(){var t=n.getFooter();return IE.getState(t).get().bind(function(t){return t.lookupByName(o,e)})},function(t){return et.some(t)})}return et.none()},x_=function(c,o){var t=function(t){var n=c.getRoot();n.getSystem().isConnected()&&t(n)},s={getData:function(){var t=c.getRoot(),n=t.getSystem().isConnected()?c.getFormWrapper():t;return Rm.getValue(n)},setData:function(a){t(function(t){var n,e,o=s.getData(),r=yt(o,a),i=(n=r,e=c.getRoot(),IE.getState(e).get().map(function(t){return Dn(Bn("data",t.dataValidator,n))}).getOr(n)),u=c.getFormWrapper();Rm.setValue(u,i)})},disable:function(t){y_(c,t).each(Zp.disable)},enable:function(t){y_(c,t).each(Zp.enable)},focus:function(t){y_(c,t).each(Lm.focus)},block:function(n){if(!k(n))throw new Error("The dialogInstanceAPI.block function should be passed a blocking message of type string as an argument");t(function(t){jo(t,Tb,{message:n})})},unblock:function(){t(function(t){Lo(t,Bb)})},showTab:function(e){t(function(t){var n=c.getBody();IE.getState(n).get().exists(function(t){return t.isTabPanel()})&&mf.getCurrent(n).each(function(t){n_.showTab(t,e)})})},redial:function(e){t(function(t){var n=o(e);t.getSystem().broadcastOn([a_],n),t.getSystem().broadcastOn([c_],n.internalDialog),t.getSystem().broadcastOn([s_],n.internalDialog),t.getSystem().broadcastOn([l_],n.internalDialog),s.setData(n.initialData)})},close:function(){t(function(t){Lo(t,Cb)})}};return s},w_=function(t){return Sg.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:[{dom:{tag:"div",classes:["tox-icon"],innerHtml:''}}],action:function(t){Lo(t,kb)}})},S_=function(t,n,e){var o=function(t){return[au(e.translate(t.title))]};return{dom:{tag:"div",classes:["tox-dialog__title"],attributes:I({},n.map(function(t){return{id:t}}).getOr({}))},components:o(t),behaviours:Gu([IE.config({channel:c_,renderComponents:o})])}},C_=function(t,n){return e={title:n.shared.providers.translate(t),draggable:!0},o=n.shared.providers,r=XD.parts().title(S_(e,et.none(),o)),i=XD.parts().draghandle({dom:bp('
')}),u=XD.parts().close(w_(o)),a=[r].concat(e.draggable?[i]:[]).concat([u]),cb.sketch({dom:bp('
'),components:a});var e,o,r,i,u,a},k_=function(t,n){return{onClose:function(){return n.closeWindow()},onBlock:function(e){XD.setBusy(t(),function(t,n){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:n,components:[{dom:bp('
')}]}})},onUnblock:function(){XD.setIdle(t())}}},O_=function(t,n,e,o){var r;return lu(XD.sketch({lazySink:o.shared.getSink,onEscape:function(t){return Lo(t,kb),et.some(!0)},useTabstopAt:function(t){return!lS(t)&&("button"!==Zo(t)||"disabled"!==Kr(t,"disabled"))},modalBehaviours:Gu([IE.config({channel:a_,updateState:function(t,n){return et.some(n)},initialData:n}),rS({}),Lm.config({}),Vm("execute-on-form",e.concat([wr(ao(),function(t,n){vm.focusIn(t)})])),Vm("scroll-lock",[Sr(function(){Vi(ir(),"tox-dialog__disable-scroll")}),Cr(function(){Hi(ir(),"tox-dialog__disable-scroll")})])].concat(t.extraBehaviours)),eventOrder:(r={},r[So()]=["execute-on-form"],r[wo()]=["reflecting","receiving"],r[Mo()]=["scroll-lock","reflecting","messages","execute-on-form","alloy.base.behaviour"],r[Fo()]=["alloy.base.behaviour","execute-on-form","messages","reflecting","scroll-lock"],r),dom:{tag:"div",classes:["tox-dialog"].concat(t.extraClasses),styles:I({position:"relative"},t.extraStyles)},components:[t.header,t.body].concat(t.footer.toArray()),dragBlockClass:"tox-dialog-wrap",parts:{blocker:{dom:bp('
'),components:[{dom:{tag:"div",classes:["tox-dialog-wrap__backdrop"]}}]}}}))},E_=function(t,n,e){var o,r,i,u=C_(t.internalDialog.title,e),a=(o={body:t.internalDialog.body},r=e,i=d_(o,et.none(),r,!1),XD.parts().body(i)),c=b_({buttons:t.internalDialog.buttons},e),s=p_(function(){return m},k_(function(){return d},n)),l="normal"!==t.internalDialog.size?"large"===t.internalDialog.size?["tox-dialog--width-lg"]:["tox-dialog--width-md"]:[],f={header:u,body:a,footer:et.some(c),extraClasses:l,extraBehaviours:[],extraStyles:{}},d=O_(f,t,s,e),m=x_({getRoot:function(){return d},getBody:function(){return XD.getBody(d)},getFooter:function(){return XD.getFooter(d)},getFormWrapper:function(){var t=XD.getBody(d);return mf.getCurrent(t).getOr(t)}},n.redial);return{dialog:d,instanceApi:m}},T_=tinymce.util.Tools.resolve("tinymce.util.URI"),B_=["insertContent","setContent","execCommand","close","block","unblock"],D_=function(t){return O(t)&&-1!==B_.indexOf(t.mceAction)},A_=function(o,t,r,n){var e,i,u,a,c=C_(o.title,n),s=(i={dom:{tag:"div",classes:["tox-dialog__content-js"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-iframe"]},components:[dS({dom:{tag:"iframe",attributes:{src:o.url}},behaviours:Gu([Ny.config({}),Lm.config({})])})]}],behaviours:Gu([vm.config({mode:"acyclic",useTabstopAt:x(lS)})])},XD.parts().body(i)),l=o.buttons.bind(function(t){return 0===t.length?et.none():et.some(b_({buttons:t},n))}),f=g_(function(){return y},k_(function(){return b},t)),d=I({},o.height.fold(function(){return{}},function(t){return{height:t+"px","max-height":t+"px"}}),o.width.fold(function(){return{}},function(t){return{width:t+"px","max-width":t+"px"}})),m=o.width.isNone()&&o.height.isNone()?["tox-dialog--width-lg"]:[],g=new T_(o.url,{base_uri:new T_(F.window.location.href)}),p=g.protocol+"://"+g.host+(g.port?":"+g.port:""),h=se(et.none()),v=[Vm("messages",[Sr(function(){var t=Lv(fe.fromDom(F.window),"message",function(t){if(g.isSameOrigin(new T_(t.raw().origin))){var n=t.raw().data;D_(n)?function(t,n,e){switch(e.mceAction){case"insertContent":t.insertContent(e.content);break;case"setContent":t.setContent(e.content);break;case"execCommand":var o=!!T(e.ui)&&e.ui;t.execCommand(e.cmd,o,e.value);break;case"close":n.close();break;case"block":n.block(e.message);break;case"unblock":n.unblock()}}(r,y,n):!D_(e=n)&&O(e)&>(e,"mceAction")&&o.onMessage(y,n)}var e});h.set(et.some(t))}),Cr(function(){h.get().each(function(t){return t.unbind()})})]),Zu.config({channels:(e={},e[f_]={onReceive:function(t,n){mu(t.element(),"iframe").each(function(t){t.dom().contentWindow.postMessage(n,p)})}},e)})],b=O_({header:c,body:s,footer:l,extraClasses:m,extraBehaviours:v,extraStyles:d},o,f,n),y=(u=b,a=function(t){u.getSystem().isConnected()&&t(u)},{block:function(n){if(!k(n))throw new Error("The urlDialogInstanceAPI.block function should be passed a blocking message of type string as an argument");a(function(t){jo(t,Tb,{message:n})})},unblock:function(){a(function(t){Lo(t,Bb)})},close:function(){a(function(t){Lo(t,Cb)})},sendMessage:function(n){a(function(t){t.getSystem().broadcastOn([f_],n)})}});return{dialog:b,instanceApi:y}},__=function(t,n,e,o){var r,i,u,a,c,s,l,f,d,m,g=ri("dialog-label"),p=ri("dialog-content"),h=Cg((u={title:t.internalDialog.title,draggable:!0},a=g,c=e.shared.providers,cb.sketch({dom:bp('
'),components:[S_(u,et.some(a),c),w_(c)],containerBehaviours:Gu([MD.config({mode:"mouse",blockerClass:"blocker",getTarget:function(t){return gu(t,'[role="dialog"]').getOrDie()},snaps:{getSnapPoints:function(){return[]},leftAttr:"data-drag-left",topAttr:"data-drag-top"}})])}))),v=Cg((s={body:t.internalDialog.body},l=p,f=e,d=o,d_(s,et.some(l),f,d))),b=Cg((m={buttons:t.internalDialog.buttons},v_(m,e))),y=p_(function(){return w},{onBlock:function(){},onUnblock:function(){},onClose:function(){return n.closeWindow()}}),x=lu({dom:{tag:"div",classes:["tox-dialog"],attributes:(r={role:"dialog"},r["aria-labelledby"]=g,r["aria-describedby"]=""+p,r)},eventOrder:(i={},i[wo()]=[IE.name(),Zu.name()],i[So()]=["execute-on-form"],i[Mo()]=["reflecting","execute-on-form"],i),behaviours:Gu([vm.config({mode:"cyclic",onEscape:function(t){return Lo(t,Cb),et.some(!0)},useTabstopAt:function(t){return!lS(t)&&("button"!==Zo(t)||"disabled"!==Kr(t,"disabled"))}}),IE.config({channel:a_,updateState:function(t,n){return et.some(n)},initialData:t}),Vm("execute-on-form",y),rS({})]),components:[h.asSpec(),v.asSpec(),b.asSpec()]}),w=x_({getRoot:function(){return x},getFooter:function(){return b.get(x)},getBody:function(){return v.get(x)},getFormWrapper:function(){var t=v.get(x);return mf.getCurrent(t).getOr(t)}},n.redial);return{dialog:x,instanceApi:w}},M_={dom:{tag:"div",styles:{display:"none"},classes:["tox-dialog__header"]}},F_={dom:{tag:"div",classes:["tox-dialog__header"]}},I_=function(t,n){return XD.parts().close(Sg.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":n.translate("Close")}},action:t,buttonBehaviours:Gu([Ny.config({})])}))},R_=function(){return XD.parts().title({dom:{tag:"div",classes:["tox-dialog__title"],innerHtml:"",styles:{display:"none"}}})},V_=function(t,n){return XD.parts().body({dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[{dom:bp("

"+n.translate(t)+"

")}]}]})},N_=function(t){return XD.parts().footer({dom:{tag:"div",classes:["tox-dialog__footer"]},components:t})},H_=function(t,n){return[cb.sketch({dom:{tag:"div",classes:["tox-dialog__footer-start"]},components:t}),cb.sketch({dom:{tag:"div",classes:["tox-dialog__footer-end"]},components:n})]},P_=function(e){return XD.sketch({lazySink:e.lazySink,onEscape:function(){return e.onCancel(),et.some(!0)},dom:{tag:"div",classes:["tox-dialog"].concat(e.extraClasses)},components:[bt(e.headerOverride.getOr(F_),{components:[e.partSpecs.title,e.partSpecs.close]}),e.partSpecs.body,e.partSpecs.footer],parts:{blocker:{dom:bp('
'),components:[{dom:{tag:"div",classes:["tox-dialog-wrap__backdrop"]}}]}},modalBehaviours:Gu([Vm("basic-dialog-events",[gr(kb,function(t,n){e.onCancel()}),gr(Eb,function(t,n){e.onSubmit()})])])})},z_=function(s){var u,a,c,l,e=(a=(u=s).backstage.shared,{open:function(t,n){var e=function(){XD.hide(r),n()},o=Cg(vC({name:"close-alert",text:"OK",primary:!0,align:"end",disabled:!1,icon:et.none()},"cancel",u.backstage)),r=lu(P_({lazySink:function(){return a.getSink()},headerOverride:et.some(M_),partSpecs:{title:R_(),close:I_(function(){e()},a.providers),body:V_(t,a.providers),footer:N_(H_([],[o.asSpec()]))},onCancel:function(){return e()},onSubmit:tt,extraClasses:["tox-alert-dialog"]}));XD.show(r);var i=o.get(r);Lm.focus(i)}}),o=(l=(c=s).backstage.shared,{open:function(t,n){var e=function(t){XD.hide(i),n(t)},o=Cg(vC({name:"yes",text:"Yes",primary:!0,align:"end",disabled:!1,icon:et.none()},"submit",c.backstage)),r=vC({name:"no",text:"No",primary:!0,align:"end",disabled:!1,icon:et.none()},"cancel",c.backstage),i=lu(P_({lazySink:function(){return l.getSink()},headerOverride:et.some(M_),partSpecs:{title:R_(),close:I_(function(){e(!1)},l.providers),body:V_(t,l.providers),footer:N_(H_([],[r,o.asSpec()]))},onCancel:function(){return e(!1)},onSubmit:function(){return e(!0)},extraClasses:["tox-confirm-dialog"]}));XD.show(i);var u=o.get(i);Lm.focus(u)}}),r=function(t,e){return UA.openUrl(function(t){var n=A_(t,{closeWindow:function(){XD.hide(n.dialog),e(n.instanceApi)}},s.editor,s.backstage);return XD.show(n.dialog),n.instanceApi},t)},i=function(t,i){return UA.open(function(t,n,e){var o=n,r=E_({dataValidator:e,initialData:o,internalDialog:t},{redial:UA.redial,closeWindow:function(){XD.hide(r.dialog),i(r.instanceApi)}},s.backstage);return XD.show(r.dialog),r.instanceApi.setData(o),r.instanceApi},t)},f=function(t,u,a,c){return UA.open(function(t,n,e){var o=Dn(Bn("data",e,n)),r=__({dataValidator:e,initialData:o,internalDialog:t},{redial:UA.redial,closeWindow:function(){xg.hide(i),a(r.instanceApi)}},s.backstage,c),i=lu(xg.sketch({lazySink:s.backstage.shared.getSink,dom:{tag:"div",classes:[]},fireDismissalEventInstead:{},inlineBehaviours:Gu([Vm("window-manager-inline-events",[gr(Io(),function(t,n){Lo(r.dialog,kb)})])])}));return xg.showAt(i,u,fu(r.dialog)),r.instanceApi.setData(o),vm.focusIn(r.dialog),r.instanceApi},t)};return{open:function(t,n,e){return n!==undefined&&"toolbar"===n.inline?f(t,s.backstage.shared.anchors.toolbar(),e,n.ariaAttrs):n!==undefined&&"cursor"===n.inline?f(t,s.backstage.shared.anchors.cursor(),e,n.ariaAttrs):i(t,e)},openUrl:function(t,n){return r(t,n)},alert:function(t,n){e.open(t,function(){n()})},close:function(t){t.close()},confirm:function(t,n){o.open(t,function(t){n(t)})}}};!function $_(){e.add("silver",function(t){var n=LD(t),e=n.uiMothership,o=n.backstage,r=n.renderUI,i=n.getUi;Vv(t,o.shared);var u=z_({editor:t,backstage:o});return{renderUI:r,getWindowManagerImpl:nt(u),getNotificationManagerImpl:function(){return Dg(t,{backstage:o},e)},ui:i()}})}()}(window);