(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-264fdf0b"],{"030f":function(t,e,n){(function(t){(function(){"use strict";var e=function(){},n=function(t){return function(){return t()}},r=function(t,e){return function(){for(var n=[],r=0;r-1},j=function(t,e){for(var n=0,r=t.length;n=0;n--){var r=t[n];e(r,n)}},K=function(t,e){for(var n=[],r=[],o=0,i=t.length;o=0&&e0?de(n.errors):fe(n.values,e)},ge=function(t,e){return t.length>0?_t.svalue(Kt(e,Xt.apply(void 0,t))):_t.svalue(e)},he=function(t){return r(_t.serror,et)(t)},pe=function(t,e){var n=_t.partition(t);return n.errors.length>0?he(n.errors):ge(n.values,e)},ve=function(t){var e=_t.partition(t);return e.errors.length>0?he(e.errors):_t.svalue(e.values)},be={consolidateObj:pe,consolidateArr:ve},ye=function(t){return _(t)&&Et(t).length>100?" removed due to size":JSON.stringify(t,null,2)},we=function(t){var e=t.length>10?t.slice(0,10).concat([{path:[],getErrorInfo:function(){return"... (only showing first ten failures)"}}]):t;return q(e,(function(t){return"Failed path: ("+t.path.join(" > ")+")\n"+t.getErrorInfo()}))},xe=function(t,e){return _t.serror([{path:t,getErrorInfo:e}])},Ce=function(t,e,n){return xe(t,(function(){return'Could not find valid *strict* value for "'+e+'" in '+ye(n)}))},ke=function(t,e){return xe(t,(function(){return'Choice schema did not contain choice key: "'+e+'"'}))},Se=function(t,e,n){return xe(t,(function(){return'The chosen schema: "'+n+'" did not exist in branches: '+ye(e)}))},Oe=function(t,e){return xe(t,(function(){return"There are unsupported fields: ["+e.join(", ")+"] specified"}))},Te=function(t,e){return xe(t,(function(){return e}))},_e=Ut.generate([{field:["key","okey","presence","prop"]},{state:["okey","instantiator"]}]),Ee=function(t,e,n){return Ft(e,n).fold((function(){return Ce(t,n,e)}),_t.svalue)},Ae=function(t,e,n){var r=Ft(t,e).fold((function(){return n(t)}),u);return _t.svalue(r)},De=function(t,e){return _t.svalue(Ft(t,e))},Me=function(t,e,n){var r=Ft(t,e).map((function(e){return!0===e?n(t):e}));return _t.svalue(r)},Ne=function(t,e,n,r){return n.fold((function(n,o,u,a){var c=function(e){var i=a.extract(t.concat([n]),r,e);return _t.map(i,(function(t){return ue(o,r(t))}))},s=function(e){return e.fold((function(){var t=ue(o,r(x.none()));return _t.svalue(t)}),(function(e){var i=a.extract(t.concat([n]),r,e);return _t.map(i,(function(t){return ue(o,r(x.some(t)))}))}))};return function(){return u.fold((function(){return _t.bind(Ee(t,e,n),c)}),(function(t){return _t.bind(Ae(e,n,t),c)}),(function(){return _t.bind(De(e,n),s)}),(function(t){return _t.bind(Me(e,n,t),s)}),(function(t){var r=t(e),o=_t.map(Ae(e,n,i({})),(function(t){return Kt(r,t)}));return _t.bind(o,c)}))}()}),(function(t,n){var o=n(e);return _t.svalue(ue(t,r(o)))}))},Re=function(t,e,n,r){var o=q(n,(function(n){return Ne(t,e,n,r)}));return be.consolidateObj(o,{})},Be=function(t){var e=function(e,n,r){return t().extract(e,n,r)},n=function(){return t().toString()};return{extract:e,toString:n}},Pe=function(t){var e=function(e,n,r){return _t.bindError(t(r,n),(function(t){return Te(e,t)}))},n=function(){return"val"};return{extract:e,toString:n}},ze=function(t){return Et(Pt(t,(function(t){return void 0!==t&&null!==t})))},Ie=function(t){var e=Le(t),n=Y(t,(function(t,e){return e.fold((function(e){return Kt(t,se(e,!0))}),i(t))}),{}),r=function(t,r,o){var i=A(o)?[]:ze(o),u=X(i,(function(t){return!Vt(n,t)}));return 0===u.length?e.extract(t,r,o):Oe(t,u)};return{extract:r,toString:e.toString}},Le=function(t){var e=function(e,n,r){return Re(e,r,t,n)},n=function(){var e=q(t,(function(t){return t.fold((function(t,e,n,r){return t+" -> "+r.toString()}),(function(t,e){return"state("+t+")"}))}));return"obj{\n"+e.join("\n")+"}"};return{extract:e,toString:n}},Fe=function(t){var e=function(e,n,r){var o=q(r,(function(r,o){return t.extract(e.concat(["["+o+"]"]),n,r)}));return be.consolidateArr(o)},n=function(){return"array("+t.toString()+")"};return{extract:e,toString:n}},He=function(t){var e=function(e,n,r){for(var o=[],i=0,u=t;i1)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return Qn(r.childNodes[0])},Jn=function(t,e){var n=e||document,r=n.createElement(t);return Qn(r)},Zn=function(t,e){var n=e||document,r=n.createTextNode(t);return Qn(r)},Qn=function(t){if(null===t||void 0===t)throw new Error("Node cannot be null or undefined");return{dom:t}},tr=function(t,e,n){return x.from(t.dom.elementFromPoint(e,n)).map(Qn)},er={fromHtml:Yn,fromTag:Jn,fromText:Zn,fromDom:Qn,fromPoint:tr},nr=function(t,e,n,r){var o=t.isiOS()&&!0===/ipad/i.test(n),u=t.isiOS()&&!o,a=t.isiOS()||t.isAndroid(),c=a||r("(pointer:coarse)"),s=o||!u&&a&&r("(min-device-width:768px)"),l=u||a&&!s,f=e.isSafari()&&t.isiOS()&&!1===/safari/i.test(n),d=!l&&!s&&!f;return{isiPad:i(o),isiPhone:i(u),isTablet:i(s),isPhone:i(l),isTouch:i(c),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:i(f),isDesktop:i(d)}},rr=function(t,e){for(var n=0;n=e.length&&t.substr(n,n+e.length)===e},gr=function(t,e){return-1!==t.indexOf(e)},hr=function(t,e){return mr(t,e,t.length-e.length)},pr=function(t){return function(e){return e.replace(t,"")}},vr=pr(/^\s+|\s+$/g),br=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,yr=function(t){return function(e){return gr(e,t)}},wr=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return gr(t,"edge/")&&gr(t,"chrome")&&gr(t,"safari")&&gr(t,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,br],search:function(t){return gr(t,"chrome")&&!gr(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return gr(t,"msie")||gr(t,"trident")}},{name:"Opera",versionRegexes:[br,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:yr("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:yr("firefox")},{name:"Safari",versionRegexes:[br,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(gr(t,"safari")||gr(t,"mobile/"))&&gr(t,"applewebkit")}}],xr=[{name:"Windows",search:yr("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return gr(t,"iphone")||gr(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:yr("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:yr("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:yr("linux"),versionRegexes:[]},{name:"Solaris",search:yr("sunos"),versionRegexes:[]},{name:"FreeBSD",search:yr("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:yr("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],Cr={browsers:i(wr),oses:i(xr)},kr="Edge",Sr="Chrome",Or="IE",Tr="Opera",_r="Firefox",Er="Safari",Ar=function(){return Dr({current:void 0,version:cr.unknown()})},Dr=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isEdge:r(kr),isChrome:r(Sr),isIE:r(Or),isOpera:r(Tr),isFirefox:r(_r),isSafari:r(Er)}},Mr={unknown:Ar,nu:Dr,edge:i(kr),chrome:i(Sr),ie:i(Or),opera:i(Tr),firefox:i(_r),safari:i(Er)},Nr="Windows",Rr="iOS",Br="Android",Pr="Linux",zr="OSX",Ir="Solaris",Lr="FreeBSD",Fr="ChromeOS",Hr=function(){return Vr({current:void 0,version:cr.unknown()})},Vr=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isWindows:r(Nr),isiOS:r(Rr),isAndroid:r(Br),isOSX:r(zr),isLinux:r(Pr),isSolaris:r(Ir),isFreeBSD:r(Lr),isChromeOS:r(Fr)}},jr={unknown:Hr,nu:Vr,windows:i(Nr),ios:i(Rr),android:i(Br),linux:i(Pr),osx:i(zr),solaris:i(Ir),freebsd:i(Lr),chromeos:i(Fr)},Ur=function(t,e){var n=Cr.browsers(),r=Cr.oses(),o=dr.detectBrowser(n,t).fold(Mr.unknown,Mr.nu),i=dr.detectOs(r,t).fold(jr.unknown,jr.nu),u=nr(i,o,t,e);return{browser:o,os:i,deviceType:u}},Wr={detect:Ur},qr=function(t){return window.matchMedia(t).matches},$r=Yt((function(){return Wr.detect(navigator.userAgent,qr)})),Gr=function(){return $r()},Kr=function(t,e,n){return 0!==(t.compareDocumentPosition(e)&n)},Xr=function(t,e){return Kr(t,e,Node.DOCUMENT_POSITION_CONTAINED_BY)},Yr=9,Jr=11,Zr=1,Qr=3,to=function(t,e){var n=t.dom;if(n.nodeType!==Zr)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},eo=function(t){return t.nodeType!==Zr&&t.nodeType!==Yr&&t.nodeType!==Jr||0===t.childElementCount},no=function(t,e){var n=void 0===e?document:e.dom;return eo(n)?[]:q(n.querySelectorAll(t),er.fromDom)},ro=function(t,e){var n=void 0===e?document:e.dom;return eo(n)?x.none():x.from(n.querySelector(t)).map(er.fromDom)},oo=function(t,e){return t.dom===e.dom},io=function(t,e){var n=t.dom,r=e.dom;return n!==r&&n.contains(r)},uo=function(t,e){return Xr(t.dom,e.dom)},ao=function(t,e){return Gr().browser.isIE()?uo(t,e):io(t,e)},co=function(t){return R(t)?t:l},so=function(t,e,n){var r=t.dom,o=co(n);while(r.parentNode){r=r.parentNode;var i=er.fromDom(r),u=e(i);if(u.isSome())return u;if(o(i))break}return x.none()},lo=function(t,e,n){var r=e(t),o=co(n);return r.orThunk((function(){return o(t)?x.none():so(t,e,o)}))},fo=function(t,e){return oo(t.element,e.event.target)},mo=function(t){if(!Vt(t,"can")&&!Vt(t,"abort")&&!Vt(t,"run"))throw new Error("EventHandler defined by: "+JSON.stringify(t,null,2)+" does not have can, abort, or run!");return on("Extracting event.handler",Ie([Ln("can",f),Ln("abort",l),Ln("run",e)]),t)},go=function(t,e){return function(){for(var n=[],r=0;r0&&mu(t,e),pu(t)},bu=function(t,e){var n=e||document,r=n.createElement("div");return r.innerHTML=t,Xi(er.fromDom(r))},yu=function(t){return t.dom.innerHTML},wu=function(t,e){var n=Vi(t),r=n.dom,o=er.fromDom(r.createDocumentFragment()),i=bu(e,r);gu(o,i),hu(t),fu(t,o)},xu=function(t){var e=er.fromTag("div"),n=er.fromDom(t.dom.cloneNode(!0));return fu(e,n),yu(e)},Cu=function(t,e,n){if(!(T(n)||A(n)||B(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")},ku=function(t,e,n){Cu(t.dom,e,n)},Su=function(t,e){var n=t.dom;Dt(e,(function(t,e){Cu(n,e,t)}))},Ou=function(t,e){var n=t.dom.getAttribute(e);return null===n?void 0:n},Tu=function(t,e){return x.from(Ou(t,e))},_u=function(t,e){var n=t.dom;return!(!n||!n.hasAttribute)&&n.hasAttribute(e)},Eu=function(t,e){t.dom.removeAttribute(e)},Au=function(t,e){return er.fromDom(t.dom.cloneNode(e))},Du=function(t){return Au(t,!1)},Mu=function(t){if(Zi(t))return"#shadow-root";var e=Du(t);return xu(e)},Nu=function(t){return Mu(t)},Ru=function(t,e,n){return oo(e,t.element)&&!oo(e,n)},Bu=pi([bi(Fo(),(function(t,e){var n=e.event,r=n.originator,o=n.target;return!Ru(t,r,o)||(console.warn(Fo()+" did not get interpreted by the desired target. \nOriginator: "+Nu(r)+"\nTarget: "+Nu(o)+"\nCheck the "+Fo()+" event handlers"),!1)}))]),Pu=Object.freeze({__proto__:null,events:Bu}),zu=0,Iu=function(t){var e=new Date,n=e.getTime(),r=Math.floor(1e9*Math.random());return zu++,t+"_"+r+zu+String(n)},Lu=i("alloy-id-"),Fu=i("data-alloy-id"),Hu=Lu(),Vu=Fu(),ju=function(t,e){var n=Iu(Hu+t);return Uu(e,n),n},Uu=function(t,e){Object.defineProperty(t.dom,Vu,{value:e,writable:!0})},Wu=function(t){var e=Ii(t)?t.dom[Vu]:null;return x.from(e)},qu=function(t){return Iu(t)},$u=u,Gu=function(t){var e=function(e){return function(){throw new Error("The component must be in a context to send: "+e+(t?"\n"+Nu(t().element)+" is not in context.":""))}};return{debugInfo:i("fake"),triggerEvent:e("triggerEvent"),triggerFocus:e("triggerFocus"),triggerEscape:e("triggerEscape"),build:e("build"),addToWorld:e("addToWorld"),removeFromWorld:e("removeFromWorld"),addToGui:e("addToGui"),removeFromGui:e("removeFromGui"),getByUid:e("getByUid"),getByDom:e("getByDom"),broadcast:e("broadcast"),broadcastOn:e("broadcastOn"),broadcastEvent:e("broadcastEvent"),isConnected:l}},Ku=Gu(),Xu=function(t,e,n){var r=n.toString(),o=r.indexOf(")")+1,i=r.indexOf("("),u=r.substring(i+1,o-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:e,parameters:Yu(u.slice(0,1).concat(u.slice(3)))}},t},Yu=function(t){return q(t,(function(t){return hr(t,"/*")?t.substring(0,t.length-"/*".length):t}))},Ju=function(t,e){var n=t.toString(),r=n.indexOf(")")+1,o=n.indexOf("("),i=n.substring(o+1,r-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:e,parameters:Yu(i)}},t},Zu=function(t,e){var n=e.toString(),r=n.indexOf(")")+1,o=n.indexOf("("),i=n.substring(o+1,r-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:"OVERRIDE",parameters:Yu(i.slice(1))}},t},Qu=Iu("alloy-premade"),ta=function(t){return se(Qu,t)},ea=function(t){return Ft(t,Qu)},na=function(t){return Zu((function(e){for(var n=[],r=1;r1?X(e[n],(function(e){return j(t,(function(t){return t.name===e}))})).join(" > "):t[0].name;return se(n,ma(o,i))}))}));return me(n,{})},Oa="alloy.base.behaviour",Ta=function(t){var e;return nn("custom.definition",Le([$e("dom","dom",te(),Le([yn("tag"),Ln("styles",{}),Ln("classes",[]),Ln("attributes",{}),Dn("value"),Dn("innerHtml")])),yn("components"),yn("uid"),Ln("events",{}),Ln("apis",{}),$e("eventOrder","eventOrder",Qt((e={},e[Uo()]=["disabling",Oa,"toggling","typeaheadevents"],e[Fo()]=[Oa,"focusing","keying"],e[Xo()]=[Oa,"disabling","toggling","representing"],e[No()]=[Oa,"representing","streaming","invalidating"],e[ei()]=[Oa,"representing","item-events","tooltipping"],e[ko()]=["focusing",Oa,"item-type-events"],e[yo()]=["focusing",Oa,"item-type-events"],e[_o()]=["item-type-events","tooltipping"],e[jo()]=["receiving","reflecting","tooltipping"],e)),ln()),Dn("domModification")]),t)},_a=function(t){return m(m({},t.dom),{uid:t.uid,domChildren:q(t.components,(function(t){return t.element}))})},Ea=function(t){return t.domModification.fold((function(){return sa({})}),sa)},Aa=function(t){return t.events},Da=function(t,e){var n=Ou(t,e);return void 0===n||""===n?[]:n.split(" ")},Ma=function(t,e,n){var r=Da(t,e),o=r.concat([n]);return ku(t,e,o.join(" ")),!0},Na=function(t,e,n){var r=X(Da(t,e),(function(t){return t!==n}));return r.length>0?ku(t,e,r.join(" ")):Eu(t,e),!1},Ra=function(t){return void 0!==t.dom.classList},Ba=function(t){return Da(t,"class")},Pa=function(t,e){return Ma(t,"class",e)},za=function(t,e){return Na(t,"class",e)},Ia=function(t,e){Ra(t)?t.dom.classList.add(e):Pa(t,e)},La=function(t){var e=Ra(t)?t.dom.classList:Ba(t);0===e.length&&Eu(t,"class")},Fa=function(t,e){if(Ra(t)){var n=t.dom.classList;n.remove(e)}else za(t,e);La(t)},Ha=function(t,e){return Ra(t)&&t.dom.classList.contains(e)},Va=function(t,e){$(e,(function(e){Ia(t,e)}))},ja=function(t,e){$(e,(function(e){Fa(t,e)}))},Ua=function(t){return void 0!==t.style&&R(t.style.getPropertyValue)},Wa=function(t){var e=Li(t)?t.dom.parentNode:t.dom;if(void 0===e||null===e||null===e.ownerDocument)return!1;var n=e.ownerDocument;return ou(er.fromDom(e)).fold((function(){return n.body.contains(e)}),o(Wa,iu))},qa=function(){return $a(er.fromDom(document))},$a=function(t){var e=t.dom.body;if(null===e||void 0===e)throw new Error("Body is not available yet");return er.fromDom(e)},Ga=function(t,e,n){if(!T(n))throw console.error("Invalid call to CSS.set. Property ",e,":: Value ",n,":: Element ",t),new Error("CSS value must be a string: "+n);Ua(t)&&t.style.setProperty(e,n)},Ka=function(t,e){Ua(t)&&t.style.removeProperty(e)},Xa=function(t,e,n){var r=t.dom;Ga(r,e,n)},Ya=function(t,e){var n=t.dom;Dt(e,(function(t,e){Ga(n,e,t)}))},Ja=function(t,e){var n=t.dom;Dt(e,(function(t,e){t.fold((function(){Ka(n,e)}),(function(t){Ga(n,e,t)}))}))},Za=function(t,e){var n=t.dom,r=window.getComputedStyle(n),o=r.getPropertyValue(e);return""!==o||Wa(t)?o:Qa(n,e)},Qa=function(t,e){return Ua(t)?t.style.getPropertyValue(e):""},tc=function(t,e){var n=t.dom,r=Qa(n,e);return x.from(r).filter((function(t){return t.length>0}))},ec=function(t){var e={},n=t.dom;if(Ua(n))for(var r=0;r0?fa(n,i,e,r):o;return la(r,u)},dc=function(t,e,n){var r={"alloy.base.behaviour":Aa(t)};return wa(n,t.eventOrder,e,r).getOrDie()},mc=function(t){var e=function(){return b},n=Xn(Ku),r=rn(Ta(t)),o=lc(t),i=ua(o),u=aa(o),a=fc(r,i,u),c=ac(a),s=dc(r,i,u),l=Xn(r.components),f=function(t){n.set(t)},d=function(){n.set(Gu(e))},m=function(){var t=Xi(c),e=nt(t,(function(t){return n.get().getByDom(t).fold((function(){return[]}),(function(t){return[t]}))}));l.set(e)},g=function(e){var n=u,r=R(n[e.name()])?n[e.name()]:function(){throw new Error("Could not find "+e.name()+" in "+JSON.stringify(t,null,2))};return r()},h=function(t){return R(u[t.name()])},p=function(){return r.apis},v=function(t){return u[t]().map((function(t){return t.state.readState()})).getOr("not enabled")},b={getSystem:n.get,config:g,hasConfigured:h,spec:t,readState:v,getApis:p,connect:f,disconnect:d,element:c,syncComponents:m,components:l.get,events:s};return b},gc=function(t){var e=Ft(t,"components").getOr([]);return q(e,yc)},hc=function(t){var e=$u(t),n=e.events,r=g(e,["events"]),o=gc(r),i=m(m({},r),{events:m(m({},Pu),n),components:o});return pt.value(mc(i))},pc=function(t){var e=er.fromText(t);return vc({element:e})},vc=function(t){var n=on("external.component",Ie([yn("element"),Dn("uid")]),t),r=Xn(Gu()),o=function(t){r.set(t)},u=function(){r.set(Gu((function(){return a})))};n.uid.each((function(t){Uu(n.element,t)}));var a={getSystem:r.get,config:x.none,hasConfigured:l,connect:o,disconnect:u,getApis:function(){return{}},element:n.element,spec:t,readState:i("No state"),syncComponents:e,components:i([]),events:{}};return ta(a)},bc=qu,yc=function(t){return ea(t).fold((function(){var e=t.hasOwnProperty("uid")?t:m({uid:bc("")},t);return hc(e).getOrDie()}),(function(t){return t}))},wc=ta,xc=function(t,e){var n=function(e,n){if(!B(n)&&!n.match(/^[0-9]+$/))throw new Error(t+".set accepts only positive integer values. Value was "+n);var r=e.dom;Ua(r)&&(r.style[t]=n+"px")},r=function(n){var r=e(n);if(r<=0||null===r){var o=Za(n,t);return parseFloat(o)||0}return r},o=r,i=function(t,e){return J(e,(function(e,n){var r=Za(t,n),o=void 0===r?0:parseInt(r,10);return isNaN(o)?e:e+o}),0)},u=function(t,e,n){var r=i(t,n),o=e>r?e-r:0;return o};return{set:n,get:r,getOuter:o,aggregate:i,max:u}},Cc=xc("height",(function(t){var e=t.dom;return Wa(t)?e.getBoundingClientRect().height:e.offsetHeight})),kc=function(t){return Cc.get(t)},Sc=function(t){return Cc.getOuter(t)},Oc=function(t,e){var n=["margin-top","border-top-width","padding-top","padding-bottom","border-bottom-width","margin-bottom"],r=Cc.max(t,e,n);Xa(t,"max-height",r+"px")},Tc=function(t,e){var n=function(n,r){return Tc(t+n,e+r)};return{left:t,top:e,translate:n}},_c=Tc,Ec=function(t){var e=t.getBoundingClientRect();return _c(e.left,e.top)},Ac=function(t,e){return void 0!==t?t:void 0!==e?e:0},Dc=function(t){var e=t.dom.ownerDocument,n=e.body,r=e.defaultView,o=e.documentElement;if(n===t.dom)return _c(n.offsetLeft,n.offsetTop);var i=Ac(null===r||void 0===r?void 0:r.pageYOffset,o.scrollTop),u=Ac(null===r||void 0===r?void 0:r.pageXOffset,o.scrollLeft),a=Ac(o.clientTop,n.clientTop),c=Ac(o.clientLeft,n.clientLeft);return Mc(t).translate(u-c,i-a)},Mc=function(t){var e=t.dom,n=e.ownerDocument,r=n.body;return r===e?_c(r.offsetLeft,r.offsetTop):Wa(t)?Ec(e):_c(0,0)},Nc=xc("width",(function(t){return t.dom.offsetWidth})),Rc=function(t,e){return Nc.set(t,e)},Bc=function(t){return Nc.get(t)},Pc=function(t){return Nc.getOuter(t)},zc=function(t,e){var n=["margin-left","border-left-width","padding-left","padding-right","border-right-width","margin-right"],r=Nc.max(t,e,n);Xa(t,"max-width",r+"px")},Ic=function(t,e,n,r,o,i,u){return{target:t,x:e,y:n,stop:r,prevent:o,kill:i,raw:u}},Lc=function(t){var e=er.fromDom(uu(t).getOr(t.target)),n=function(){return t.stopPropagation()},o=function(){return t.preventDefault()},i=r(o,n);return Ic(e,t.clientX,t.clientY,n,o,i,t)},Fc=function(t,e){return function(n){t(n)&&e(Lc(n))}},Hc=function(t,e,n,r,o){var i=Fc(n,r);return t.dom.addEventListener(e,i,o),{unbind:a(Uc,t,e,i,o)}},Vc=function(t,e,n,r){return Hc(t,e,n,r,!1)},jc=function(t,e,n,r){return Hc(t,e,n,r,!0)},Uc=function(t,e,n,r){t.dom.removeEventListener(e,n,r)},Wc=function(t){var e=void 0!==t?t.dom:document,n=e.body.scrollLeft||e.documentElement.scrollLeft,r=e.body.scrollTop||e.documentElement.scrollTop;return _c(n,r)},qc=function(t,e,n){var r=void 0!==n?n.dom:document,o=r.defaultView;o&&o.scrollTo(t,e)},$c=function(t){var e=void 0===t?window:t;return x.from(e["visualViewport"])},Gc=function(t,e,n,r){return{x:t,y:e,width:n,height:r,right:t+n,bottom:e+r}},Kc=function(t){var e=void 0===t?window:t,n=e.document,r=Wc(er.fromDom(n));return $c(e).fold((function(){var t=e.document.documentElement,n=t.clientWidth,o=t.clientHeight;return Gc(r.left,r.top,n,o)}),(function(t){return Gc(Math.max(t.pageLeft,r.left),Math.max(t.pageTop,r.top),t.width,t.height)}))},Xc=function(t,e){var n=t.view(e);return n.fold(i([]),(function(e){var n=t.owner(e),r=Xc(t,n);return[e].concat(r)}))},Yc=function(t,e){var n=e.owner(t),r=Xc(e,n);return x.some(r)},Jc=function(t){var e,n=t.dom===document?x.none():x.from(null===(e=t.dom.defaultView)||void 0===e?void 0:e.frameElement);return n.map(er.fromDom)},Zc=function(t){return Vi(t)},Qc=Object.freeze({__proto__:null,view:Jc,owner:Zc}),ts=function(t){var e=er.fromDom(document),n=Wc(e),r=Yc(t,Qc);return r.fold(a(Dc,t),(function(e){var r=Mc(t),o=Y(e,(function(t,e){var n=Mc(e);return{left:t.left+n.left,top:t.top+n.top}}),{left:0,top:0});return _c(o.left+r.left+n.left,o.top+r.top+n.top)}))},es=function(t,e,n){return{point:t,width:e,height:n}},ns=function(t,e,n,r){return{x:t,y:e,width:n,height:r}},rs=function(t,e,n,r){return{x:t,y:e,width:n,height:r,right:t+n,bottom:e+r}},os=function(t){var e=Dc(t),n=Pc(t),r=Sc(t);return rs(e.left,e.top,n,r)},is=function(t){var e=ts(t),n=Pc(t),r=Sc(t);return rs(e.left,e.top,n,r)},us=function(){return Kc(window)};function as(t,e,n,r,o){return t(n,r)?x.some(n):R(o)&&o(n)?x.none():e(n,r,o)}var cs,ss=function(t,e,n){var r=t.dom,o=R(n)?n:l;while(r.parentNode){r=r.parentNode;var i=er.fromDom(r);if(e(i))return x.some(i);if(o(i))break}return x.none()},ls=function(t,e,n){var r=function(t,e){return e(t)};return as(r,ss,t,e,n)},fs=function(t,e){var n=function(t){for(var r=0;r-1}));return e.bind((function(t){var e=Ou(t,"id"),n=eu(t);return gs(n,'[aria-owns="'+e+'"]')}))},vs=function(){var t=Iu("aria-owns"),e=function(e){ku(e,"aria-owns",t)},n=function(t){Eu(t,"aria-owns")};return{id:t,link:e,unlink:n}},bs=function(t,e){return ps(e).exists((function(e){return ys(t,e)}))},ys=function(t,e){return ds(e,(function(e){return oo(e,t.element)}),l)||bs(t,e)},ws="unknown";(function(t){t[t["STOP"]=0]="STOP",t[t["NORMAL"]=1]="NORMAL",t[t["LOGGING"]=2]="LOGGING"})(cs||(cs={}));var xs,Cs=Xn({}),ks=function(t,e){var n=[],r=(new Date).getTime();return{logEventCut:function(t,e,r){n.push({outcome:"cut",target:e,purpose:r})},logEventStopped:function(t,e,r){n.push({outcome:"stopped",target:e,purpose:r})},logNoParent:function(t,e,r){n.push({outcome:"no-parent",target:e,purpose:r})},logEventNoHandlers:function(t,e){n.push({outcome:"no-handlers-left",target:e})},logEventResponse:function(t,e,r){n.push({outcome:"response",purpose:r,target:e})},write:function(){var o=(new Date).getTime();V(["mousemove","mouseover","mouseout",Xo()],t)||console.log(t,{event:t,time:o-r,target:e.dom,sequence:q(n,(function(t){return V(["cut","stopped","response"],t.outcome)?"{"+t.purpose+"} "+t.outcome+" at ("+Nu(t.target)+")":t.outcome}))})}}},Ss=function(t,e,n){var r=Ft(Cs.get(),t).orThunk((function(){var e=Et(Cs.get());return dt(e,(function(e){return t.indexOf(e)>-1?x.some(Cs.get()[e]):x.none()}))})).getOr(cs.NORMAL);switch(r){case cs.NORMAL:return n(As());case cs.LOGGING:var o=ks(t,e),i=n(o);return o.write(),i;case cs.STOP:return!0}},Os=["alloy/data/Fields","alloy/debugging/Debugging"],Ts=function(){var t=new Error;if(void 0!==t.stack){var e=t.stack.split("\n");return Q(e,(function(t){return t.indexOf("alloy")>0&&!j(Os,(function(e){return t.indexOf(e)>-1}))})).getOr(ws)}return ws},_s={logEventCut:e,logEventStopped:e,logNoParent:e,logEventNoHandlers:e,logEventResponse:e,write:e},Es=function(t,e,n){return Ss(t,e,n)},As=i(_s),Ds=i([yn("menu"),yn("selectedMenu")]),Ms=i([yn("item"),yn("selectedItem")]),Ns=(i(Le(Ms().concat(Ds()))),i(Le(Ms()))),Rs=_n("initSize",[yn("numColumns"),yn("numRows")]),Bs=function(){return wn("markers",Ns())},Ps=function(){return _n("markers",[yn("backgroundMenu")].concat(Ds()).concat(Ms()))},zs=function(t){return _n("markers",q(t,yn))},Is=function(t,e,n){Ts();return $e(e,e,n,Qe((function(t){return pt.value((function(){for(var e=[],n=0;n=r?x.some(e):x.none():e<=r?x.some(e):x.none()})).map((function(t){return t+o})).getOr(r)},o=r("left",t.x),i=r("top",t.y),a=r("right",t.right),c=r("bottom",t.bottom);return rs(o,i,a-o,c-i)},al=function(t){return t.x},cl=function(t,e){return t.x+t.width/2-e.width/2},sl=function(t,e){return t.x+t.width-e.width},ll=function(t,e){return t.y-e.height},fl=function(t){return t.y+t.height},dl=function(t,e){return t.y+t.height/2-e.height/2},ml=function(t){return t.x+t.width},gl=function(t,e){return t.x-e.width},hl=function(t,e,n){return qs(al(t),fl(t),n.southeast(),Ys(),il(t,{left:1,top:3}),"layout-se")},pl=function(t,e,n){return qs(sl(t,e),fl(t),n.southwest(),Js(),il(t,{right:0,top:3}),"layout-sw")},vl=function(t,e,n){return qs(al(t),ll(t,e),n.northeast(),Zs(),il(t,{left:1,bottom:2}),"layout-ne")},bl=function(t,e,n){return qs(sl(t,e),ll(t,e),n.northwest(),Qs(),il(t,{right:0,bottom:2}),"layout-nw")},yl=function(t,e,n){return qs(cl(t,e),ll(t,e),n.north(),el(),il(t,{bottom:2}),"layout-n")},wl=function(t,e,n){return qs(cl(t,e),fl(t),n.south(),tl(),il(t,{top:3}),"layout-s")},xl=function(t,e,n){return qs(ml(t),dl(t,e),n.east(),nl(),il(t,{left:0}),"layout-e")},Cl=function(t,e,n){return qs(gl(t,e),dl(t,e),n.west(),rl(),il(t,{right:1}),"layout-w")},kl=function(){return[hl,pl,vl,bl,wl,yl,xl,Cl]},Sl=function(){return[pl,hl,bl,vl,wl,yl,xl,Cl]},Ol=function(){return[vl,bl,hl,pl,yl,wl]},Tl=function(){return[bl,vl,pl,hl,yl,wl]},_l=function(){return[hl,pl,vl,bl,wl,yl]},El=function(){return[pl,hl,bl,vl,wl,yl]},Al=function(t,e){return e.universal?t:X(t,(function(t){return V(e.channels,t)}))},Dl=function(t){return pi([wi(jo(),(function(e,n){var r=t.channels,o=Et(r),i=n,u=Al(o,i);$(u,(function(t){var n=r[t],o=n.schema,u=on("channel["+t+"] data\nReceiver: "+Nu(e.element),o,i.data);n.onReceive(e,u)}))}))])},Ml=Object.freeze({__proto__:null,events:Dl}),Nl=[wn("channels",tn(pt.value,Ie([Hs("onReceive"),Ln("schema",ln())])))],Rl=function(t,e,n){return Ri((function(r){n(r,t,e)}))},Bl=function(t,e,n){return Ni((function(r,o){n(r,t,e)}))},Pl=function(t,e,n,r,o,i){var u=Ie(t),a=zn(e,[In("config",t)]);return Fl(u,a,e,n,r,o,i)},zl=function(t,e,n,r,o,i){var u=t,a=zn(e,[Mn("config",t)]);return Fl(u,a,e,n,r,o,i)},Il=function(t,e,n){var r=function(r){for(var o=[],u=1;ur?n:o=i,l=e>=u,f=s&&l,d=t+n<=i+a,m=e+r<=u+c,g=d&&m,h=Math.abs(Math.min(n,s?i+a-t:i-(t+n))),p=Math.abs(Math.min(r,l?u+c-e:u-(e+r))),v=Math.max(o.x,o.right-n),b=Math.max(o.y,o.bottom-r),y=vf(t,o.x,v),w=vf(e,o.y,b);return{originInBounds:f,sizeInBounds:g,limitX:y,limitY:w,deltaW:h,deltaH:p}},wf=function(t,e,n,r){var o=t.x,u=t.y,a=t.bubble.offset,c=a.left,s=a.top,l=ul(r,t.boundsRestriction,a),f=l.y,d=l.bottom,m=l.x,g=l.right,h=o+c,p=u+s,v=yf(h,p,e,n,l),b=v.originInBounds,y=v.sizeInBounds,w=v.limitX,x=v.limitY,C=v.deltaW,k=v.deltaH,S=i(x+k-f),O=i(d-x),T=Ks(t.direction,O,O,S),_=i(w+C-m),E=i(g-w),A=Xs(t.direction,E,E,_),D={x:w,y:x,width:C,height:k,maxHeight:T,maxWidth:A,direction:t.direction,classes:{on:t.bubble.classesOn,off:t.bubble.classesOff},label:t.label,candidateYforTest:p};return b&&y?bf.fit(D):bf.nofit(D,C,k)},xf=function(t,e,n,r,o){var i=n.width,c=n.height,s=function(t,u,a,s){var l=t(e,n,r),f=wf(l,i,c,o);return f.fold(bf.fit,(function(t,e,n){var r=n>s||e>a;return r?bf.nofit(t,e,n):bf.nofit(u,a,s)}))},l=J(t,(function(t,e){var n=a(s,e);return t.fold(bf.fit,n)}),bf.nofit({x:e.x,y:e.y,width:n.width,height:n.height,maxHeight:n.height,maxWidth:n.width,direction:Ys(),classes:{on:[],off:[]},label:"none",candidateYforTest:e.y},-1,-1));return l.fold(u,u)},Cf=function(t){return{width:Pc(t),height:Sc(t)}},kf=function(t,e,n,r){rc(e,"max-height"),rc(e,"max-width");var o=Cf(e);return xf(r.preference,t,o,n,r.bounds)},Sf=function(t,e){var n=e.classes;ja(t,n.off),Va(t,n.on)},Of=function(t,e,n){var r=n.maxHeightFunction;r(t,e.maxHeight)},Tf=function(t,e,n){var r=n.maxWidthFunction;r(t,e.maxWidth)},_f=function(t,e,n){rf(t,af(n.origin,e))},Ef=function(t,e){Oc(t,Math.floor(e))},Af=i((function(t,e){Ef(t,e),Ya(t,{"overflow-x":"hidden","overflow-y":"auto"})})),Df=i((function(t,e){Ef(t,e)})),Mf=function(t,e,n){return void 0===t[e]?n:t[e]},Nf=function(t,n,r,o,i,u){var a=Mf(u,"maxHeightFunction",Af()),c=Mf(u,"maxWidthFunction",e),s=t.anchorBox,l=t.origin,f={bounds:sf(l,i),origin:l,preference:o,maxHeightFunction:a,maxWidthFunction:c};Rf(s,n,r,f)},Rf=function(t,e,n,r){var o=kf(t,e,n,r);_f(e,o,r),Sf(e,o),Of(e,o,r),Tf(e,o,r)},Bf=["valignCentre","alignLeft","alignRight","alignCentre","top","bottom","left","right"],Pf=function(t,e,n){var r=function(t){return Ft(n,t).getOr([])},o=function(t,e,n){var o=it(Bf,n);return{offset:_c(t,e),classesOn:nt(n,r),classesOff:nt(o,r)}};return{southeast:function(){return o(-t,e,["top","alignLeft"])},southwest:function(){return o(t,e,["top","alignRight"])},south:function(){return o(-t/2,e,["top","alignCentre"])},northeast:function(){return o(-t,-e,["bottom","alignLeft"])},northwest:function(){return o(t,-e,["bottom","alignRight"])},north:function(){return o(-t/2,-e,["bottom","alignCentre"])},east:function(){return o(t,-e/2,["valignCentre","left"])},west:function(){return o(-t,-e/2,["valignCentre","right"])},innerNorthwest:function(){return o(-t,e,["top","alignRight"])},innerNortheast:function(){return o(t,e,["top","alignLeft"])},innerNorth:function(){return o(-t/2,e,["top","alignCentre"])},innerSouthwest:function(){return o(-t,-e,["bottom","alignRight"])},innerSoutheast:function(){return o(t,-e,["bottom","alignLeft"])},innerSouth:function(){return o(-t/2,-e,["bottom","alignCentre"])},innerWest:function(){return o(t,-e/2,["valignCentre","right"])},innerEast:function(){return o(-t,-e/2,["valignCentre","left"])}}},zf=function(){return Pf(0,0,{})},If=function(t){return t},Lf=function(t,e){return function(n){return"rtl"===Ff(n)?e:t}},Ff=function(t){return"rtl"===Za(t,"direction")?"rtl":"ltr"};(function(t){t["TopToBottom"]="toptobottom",t["BottomToTop"]="bottomtotop"})(xs||(xs={}));var Hf,Vf="data-alloy-vertical-dir",jf=function(t){return ds(t,(function(t){return Ii(t)&&Ou(t,"data-alloy-vertical-dir")===xs.BottomToTop}))},Uf=function(){return zn("layouts",[yn("onLtr"),yn("onRtl"),Dn("onBottomLtr"),Dn("onBottomRtl")])},Wf=function(t,e,n,r,o,i,u){var a=u.map(jf).getOr(!1),c=e.layouts.map((function(e){return e.onLtr(t)})),s=e.layouts.map((function(e){return e.onRtl(t)})),l=a?e.layouts.bind((function(e){return e.onBottomLtr.map((function(e){return e(t)}))})).or(c).getOr(o):c.getOr(n),f=a?e.layouts.bind((function(e){return e.onBottomRtl.map((function(e){return e(t)}))})).or(s).getOr(i):s.getOr(r),d=Lf(l,f);return d(t)},qf=function(t,e,n){var r=e.hotspot,o=cf(n,r.element),i=Wf(t.element,e,_l(),El(),Ol(),Tl(),x.some(e.hotspot.element));return x.some(If({anchorBox:o,bubble:e.bubble.getOr(zf()),overrides:e.overrides,layouts:i,placer:x.none()}))},$f=[yn("hotspot"),Dn("bubble"),Ln("overrides",{}),Uf(),js("placement",qf)],Gf=function(t,e,n){var r=lf(n,e.x,e.y),o=rs(r.left,r.top,e.width,e.height),i=Wf(t.element,e,kl(),Sl(),kl(),Sl(),x.none());return x.some(If({anchorBox:o,bubble:e.bubble,overrides:e.overrides,layouts:i,placer:x.none()}))},Kf=[yn("x"),yn("y"),Ln("height",0),Ln("width",0),Ln("bubble",zf()),Ln("overrides",{}),Uf(),js("placement",Gf)],Xf=Ut.generate([{screen:["point"]},{absolute:["point","scrollLeft","scrollTop"]}]),Yf=function(t){return t.fold(u,(function(t,e,n){return t.translate(-e,-n)}))},Jf=function(t){return t.fold(u,u)},Zf=function(t){return J(t,(function(t,e){return t.translate(e.left,e.top)}),_c(0,0))},Qf=function(t){var e=q(t,Yf);return Zf(e)},td=function(t){var e=q(t,Jf);return Zf(e)},ed=Xf.screen,nd=Xf.absolute,rd=function(t,e,n){var r=Wi(n.root).dom,o=function(e){var n=Vi(e),r=Vi(t.element);return oo(n,r)};return x.from(r.frameElement).map(er.fromDom).filter(o).map(Dc)},od=function(t,e,n){var r=Vi(t.element),o=Wc(r),i=rd(t,e,n).getOr(o);return nd(i,o.left,o.top)},id=function(t,e,n,r){var o=t,i=e,u=n,a=r;t<0&&(o=0,u=n+t),e<0&&(i=0,a=r+e);var c=ed(_c(o,i));return x.some(es(c,u,a))},ud=function(t,e,n,r,o){return t.map((function(t){var i=[e,t.point],u=ff(r,(function(){return td(i)}),(function(){return td(i)}),(function(){return Qf(i)})),a=ns(u.left,u.top,t.width,t.height),c=n.showAbove?Ol():_l(),s=n.showAbove?Tl():El(),l=Wf(o,n,c,s,c,s,x.none());return If({anchorBox:a,bubble:n.bubble.getOr(zf()),overrides:n.overrides,layouts:l,placer:x.none()})}))},ad=function(t,e,n){var r=od(t,n,e);return e.node.filter(Wa).bind((function(o){var i=o.dom.getBoundingClientRect(),u=id(i.left,i.top,i.width,i.height),a=e.node.getOr(t.element);return ud(u,r,e,n,a)}))},cd=[yn("node"),yn("root"),Dn("bubble"),Uf(),Ln("overrides",{}),Ln("showAbove",!1),js("placement",ad)],sd="\ufeff",ld=" ",fd=function(t,e,n,r){return{start:t,soffset:e,finish:n,foffset:r}},dd={create:fd},md=Ut.generate([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),gd=function(t,e,n,r){return t.fold(e,n,r)},hd=function(t){return t.fold(u,u,u)},pd=md.before,vd=md.on,bd=md.after,yd={before:pd,on:vd,after:bd,cata:gd,getStart:hd},wd=Ut.generate([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),xd=function(t){return wd.exact(t.start,t.soffset,t.finish,t.foffset)},Cd=function(t){return t.match({domRange:function(t){return er.fromDom(t.startContainer)},relative:function(t,e){return yd.getStart(t)},exact:function(t,e,n,r){return t}})},kd=wd.domRange,Sd=wd.relative,Od=wd.exact,Td=function(t){var e=Cd(t);return Wi(e)},_d=dd.create,Ed={domRange:kd,relative:Sd,exact:Od,exactFromRange:xd,getWin:Td,range:_d},Ad=function(t,e){e.fold((function(e){t.setStartBefore(e.dom)}),(function(e,n){t.setStart(e.dom,n)}),(function(e){t.setStartAfter(e.dom)}))},Dd=function(t,e){e.fold((function(e){t.setEndBefore(e.dom)}),(function(e,n){t.setEnd(e.dom,n)}),(function(e){t.setEndAfter(e.dom)}))},Md=function(t,e,n){var r=t.document.createRange();return Ad(r,e),Dd(r,n),r},Nd=function(t,e,n,r,o){var i=t.document.createRange();return i.setStart(e.dom,n),i.setEnd(r.dom,o),i},Rd=function(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom,width:t.width,height:t.height}},Bd=function(t){var e=t.getClientRects(),n=e.length>0?e[0]:t.getBoundingClientRect();return n.width>0||n.height>0?x.some(n).map(Rd):x.none()},Pd=Ut.generate([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),zd=function(t,e,n){return e(er.fromDom(n.startContainer),n.startOffset,er.fromDom(n.endContainer),n.endOffset)},Id=function(t,e){return e.match({domRange:function(t){return{ltr:i(t),rtl:x.none}},relative:function(e,n){return{ltr:Yt((function(){return Md(t,e,n)})),rtl:Yt((function(){return x.some(Md(t,n,e))}))}},exact:function(e,n,r,o){return{ltr:Yt((function(){return Nd(t,e,n,r,o)})),rtl:Yt((function(){return x.some(Nd(t,r,o,e,n))}))}}})},Ld=function(t,e){var n=e.ltr();if(n.collapsed){var r=e.rtl().filter((function(t){return!1===t.collapsed}));return r.map((function(t){return Pd.rtl(er.fromDom(t.endContainer),t.endOffset,er.fromDom(t.startContainer),t.startOffset)})).getOrThunk((function(){return zd(t,Pd.ltr,n)}))}return zd(t,Pd.ltr,n)},Fd=function(t,e){var n=Id(t,e);return Ld(t,n)},Hd=function(t,e){var n=Fd(t,e);return n.match({ltr:function(e,n,r,o){var i=t.document.createRange();return i.setStart(e.dom,n),i.setEnd(r.dom,o),i},rtl:function(e,n,r,o){var i=t.document.createRange();return i.setStart(r.dom,o),i.setEnd(e.dom,n),i}})},Vd=(Pd.ltr,Pd.rtl,function(t,e){var n=function(n){if(!t(n))throw new Error("Can only get "+e+" value of a "+e+" node");return r(n).getOr("")},r=function(e){return t(e)?x.from(e.dom.nodeValue):x.none()},o=function(n,r){if(!t(n))throw new Error("Can only set raw "+e+" value of a "+e+" node");n.dom.nodeValue=r};return{get:n,getOption:r,set:o}}),jd=Vd(Li,"text"),Ud=function(t){return jd.get(t)},Wd=function(t){return jd.getOption(t)},qd=function(t){return"img"===Bi(t)?1:Wd(t).fold((function(){return Xi(t).length}),(function(t){return t.length}))},$d=function(t){return Wd(t).filter((function(t){return 0!==t.trim().length||t.indexOf(ld)>-1})).isSome()},Gd=["img","br"],Kd=function(t){var e=$d(t);return e||V(Gd,Bi(t))},Xd=function(t){return Yd(t,Kd)},Yd=function(t,e){var n=function(t){for(var r=Xi(t),o=r.length-1;o>=0;o--){var i=r[o];if(e(i))return x.some(i);var u=n(i);if(u.isSome())return u}return x.none()};return n(t)},Jd=function(t,e){return no(e,t)},Zd=function(t,e,n,r){var o=Vi(t),i=o.dom.createRange();return i.setStart(t.dom,e),i.setEnd(n.dom,r),i},Qd=function(t,e,n,r){var o=Zd(t,e,n,r),i=oo(t,n)&&e===r;return o.collapsed&&!i},tm=function(t){return x.from(t.getSelection())},em=function(t){if(t.rangeCount>0){var e=t.getRangeAt(0),n=t.getRangeAt(t.rangeCount-1);return x.some(dd.create(er.fromDom(e.startContainer),e.startOffset,er.fromDom(n.endContainer),n.endOffset))}return x.none()},nm=function(t){if(null===t.anchorNode||null===t.focusNode)return em(t);var e=er.fromDom(t.anchorNode),n=er.fromDom(t.focusNode);return Qd(e,t.anchorOffset,n,t.focusOffset)?x.some(dd.create(e,t.anchorOffset,n,t.focusOffset)):em(t)},rm=function(t){return tm(t).filter((function(t){return t.rangeCount>0})).bind(nm)},om=function(t,e){var n=Hd(t,e);return Bd(n)},im=function(t,e){return{element:t,offset:e}},um=function(t,e){var n=Xi(t);if(0===n.length)return im(t,e);if(e"})),ln()),vh=Kn("schema",(function(){return[Dn("preprocess")]})),bh=Ln("defaults",i({})),yh=Ln("overrides",i({})),wh=Le([mh,gh,hh,ph,bh,yh]),xh=Le([mh,gh,hh,bh,yh]),Ch=Le([mh,gh,hh,ph,bh,yh]),kh=Le([mh,vh,hh,yn("unit"),ph,bh,yh]),Sh=function(t){return t.fold(x.some,x.none,x.some,x.some)},Oh=function(t){var e=function(t){return t.name};return t.fold(e,e,e,e)},Th=function(t){return t.fold(u,u,u,u)},_h=function(t,e){return function(n){var r=on("Converting part type",e,n);return t(r)}},Eh=_h(dh.required,wh),Ah=_h(dh.external,xh),Dh=_h(dh.optional,Ch),Mh=_h(dh.group,kh),Nh=i("entirety"),Rh=Object.freeze({__proto__:null,required:Eh,external:Ah,optional:Dh,group:Mh,asNamedPart:Sh,name:Oh,asCommon:Th,original:Nh}),Bh=function(t,e,n,r){return Kt(e.defaults(t,n,r),n,{uid:t.partUids[e.name]},e.overrides(t,n,r))},Ph=function(t,e,n){var r={},o={};return $(n,(function(t){t.fold((function(t){r[t.pname]=sh(!0,(function(e,n,r){return t.factory.sketch(Bh(e,t,n,r))}))}),(function(t){var n=e.parts[t.name];o[t.name]=i(t.factory.sketch(Bh(e,t,n[Nh()]),n))}),(function(t){r[t.pname]=sh(!1,(function(e,n,r){return t.factory.sketch(Bh(e,t,n,r))}))}),(function(t){r[t.pname]=lh(!0,(function(e,n,r){var o=e[t.name];return q(o,(function(n){return t.factory.sketch(Kt(t.defaults(e,n,r),n,t.overrides(e,n)))}))}))}))})),{internals:i(r),externals:i(o)}},zh=function(t,e){var n={};return $(e,(function(e){Sh(e).each((function(e){var r=Ih(t,e.pname);n[e.name]=function(n){var o=on("Part: "+e.name+" in "+t,Le(e.schema),n);return m(m({},r),{config:n,validated:o})}}))})),n},Ih=function(t,e){return{uiType:fh(),owner:t,name:e}},Lh=function(t,e,n){return{uiType:fh(),owner:t,name:e,config:n,validated:{}}},Fh=function(t){return nt(t,(function(t){return t.fold(x.none,x.some,x.none,x.none).map((function(t){return _n(t.name,t.schema.concat([Us(Nh())]))})).toArray()}))},Hh=function(t){return q(t,Oh)},Vh=function(t,e,n){return Ph(t,e,n)},jh=function(t,e,n){return ch(x.some(t),e,e.components,n)},Uh=function(t,e,n){var r=e.partUids[n];return t.getSystem().getByUid(r).toOptional()},Wh=function(t,e,n){return Uh(t,e,n).getOrDie("Could not find part: "+n)},qh=function(t,e,n){var r={},o=e.partUids,u=t.getSystem();return $(n,(function(t){r[t]=i(u.getByUid(o[t]))})),r},$h=function(t,e){var n=t.getSystem();return Mt(e.partUids,(function(t,e){return i(n.getByUid(t))}))},Gh=function(t){return Et(t.partUids)},Kh=function(t,e,n){var r={},o=e.partUids,u=t.getSystem();return $(n,(function(t){r[t]=i(u.getByUid(o[t]).getOrDie())})),r},Xh=function(t,e){var n=Hh(e);return le(q(n,(function(e){return{key:e,value:t+"-"+e}})))},Yh=function(t){return $e("partUids","partUids",re((function(e){return Xh(e.uid,t)})),ln())},Jh=Object.freeze({__proto__:null,generate:zh,generateOne:Lh,schemas:Fh,names:Hh,substitutes:Vh,components:jh,defaultUids:Xh,defaultUidsSchema:Yh,getAllParts:$h,getAllPartNames:Gh,getPart:Uh,getPartOrDie:Wh,getParts:qh,getPartsOrDie:Kh}),Zh=function(t,e){var n=t.length>0?[_n("parts",t)]:[];return n.concat([yn("uid"),Ln("dom",{}),Ln("components",[]),Us("originalSpec"),Ln("debug.sketcher",{})]).concat(e)},Qh=function(t,e,n,r,o){var i=Zh(r,o);return on(t+" [SpecSchema]",Ie(i.concat(e)),n)},tp=function(t,e,n,r){var o=rp(r),i=Qh(t,e,o,[],[]);return n(i,o)},ep=function(t,e,n,r,o){var i=rp(o),u=Fh(n),a=Yh(n),c=Qh(t,e,i,u,[a]),s=Vh(t,c,n),l=jh(t,c,s.internals());return r(c,l,i,s.externals())},np=function(t){return Ht(t,"uid")},rp=function(t){return np(t)?t:m(m({},t),{uid:qu("uid")})},op=function(t){return void 0!==t.uid},ip=Ie([yn("name"),yn("factory"),yn("configFields"),Ln("apis",{}),Ln("extraApis",{})]),up=Ie([yn("name"),yn("factory"),yn("configFields"),yn("partFields"),Ln("apis",{}),Ln("extraApis",{})]),ap=function(t){var e=on("Sketcher for "+t.name,ip,t),n=function(t){return tp(e.name,e.configFields,e.factory,t)},r=Mt(e.apis,na),o=Mt(e.extraApis,(function(t,e){return Ju(t,e)}));return m(m({name:e.name,configFields:e.configFields,sketch:n},r),o)},cp=function(t){var e=on("Sketcher for "+t.name,up,t),n=function(t){return ep(e.name,e.configFields,e.partFields,e.factory,t)},r=zh(e.name,e.partFields),o=Mt(e.apis,na),i=Mt(e.extraApis,(function(t,e){return Ju(t,e)}));return m(m({name:e.name,partFields:e.partFields,configFields:e.configFields,sketch:n,parts:r},o),i)},sp=function(t){for(var e=[],n=function(t){e.push(t)},r=0;r0?x.some(r[r.length-1]):x.none();return o.bind((function(e){return t.getSystem().getByDom(e).toOptional()}))},Rp=function(t,e,n,r){var o=Jd(t.element,"."+e.itemClass),i=tt(o,(function(t){return Ha(t,e.highlightClass)}));return i.bind((function(e){var n=pf(e,r,0,o.length-1);return t.getSystem().getByDom(o[n]).toOptional()}))},Bp=function(t,e,n){return Rp(t,e,n,-1)},Pp=function(t,e,n){return Rp(t,e,n,1)},zp=function(t,e,n){var r=Jd(t.element,"."+e.itemClass);return sp(q(r,(function(e){return t.getSystem().getByDom(e).toOptional()})))},Ip=Object.freeze({__proto__:null,dehighlightAll:xp,dehighlight:Cp,highlight:kp,highlightFirst:Sp,highlightLast:Op,highlightAt:Tp,highlightBy:_p,isHighlighted:Ep,getHighlighted:Ap,getFirst:Mp,getLast:Np,getPrevious:Bp,getNext:Pp,getCandidates:zp}),Lp=[yn("highlightClass"),yn("itemClass"),Ls("onHighlight"),Ls("onDehighlight")],Fp=jl({fields:Lp,name:"highlighting",apis:Ip}),Hp=[8],Vp=[9],jp=[13],Up=[27],Wp=[32],qp=[37],$p=[38],Gp=[39],Kp=[40],Xp=function(t,e,n){var r=ot(t.slice(0,e)),o=ot(t.slice(e+1));return Q(r.concat(o),n)},Yp=function(t,e,n){var r=ot(t.slice(0,e));return Q(r,n)},Jp=function(t,e,n){var r=t.slice(0,e),o=t.slice(e+1);return Q(o.concat(r),n)},Zp=function(t,e,n){var r=t.slice(e+1);return Q(r,n)},Qp=function(t){return function(e){var n=e.raw;return V(t,n.which)}},tv=function(t){return function(e){return rt(t,(function(t){return t(e)}))}},ev=function(t){var e=t.raw;return!0===e.shiftKey},nv=function(t){var e=t.raw;return!0===e.ctrlKey},rv=c(ev),ov=function(t,e){return{matches:t,classification:e}},iv=function(t,e){var n=Q(t,(function(t){return t.matches(e)}));return n.map((function(t){return t.classification}))},uv=function(t,e,n){var r=e.exists((function(t){return n.exists((function(e){return oo(e,t)}))}));r||fi(t,oi(),{prevFocus:e,newFocus:n})},av=function(){var t=function(t){return tf(t.element)},e=function(e,n){var r=t(e);e.getSystem().triggerFocus(n,e.element);var o=t(e);uv(e,r,o)};return{get:t,set:e}},cv=function(){var t=function(t){return Fp.getHighlighted(t).map((function(t){return t.element}))},n=function(n,r){var o=t(n);n.getSystem().getByDom(r).fold(e,(function(t){Fp.highlight(n,t)}));var i=t(n);uv(n,o,i)};return{get:t,set:n}};(function(t){t["OnFocusMode"]="onFocus",t["OnEnterOrSpaceMode"]="onEnterOrSpace",t["OnApiMode"]="onApi"})(Hf||(Hf={}));var sv=function(t,e,n,r,o){var i=function(){return t.concat([Ln("focusManager",av()),Fn("focusInside","onFocus",Qe((function(t){return V(["onFocus","onEnterOrSpace","onApi"],t)?pt.value(t):pt.error("Invalid value for focusInside")}))),js("handler",c),js("state",e),js("sendFocusIn",o)])},u=function(t,e,n,r,o){var i=n(t,e,r,o);return iv(i,e.event).bind((function(n){return n(t,e,r,o)}))},a=function(t,e){var i=t.focusInside!==Hf.OnFocusMode?x.none():o(t).map((function(n){return wi(Fo(),(function(r,o){n(r,t,e),o.stop()}))})),a=function(n,r){var i=Qp(Wp.concat(jp))(r.event);t.focusInside===Hf.OnEnterOrSpaceMode&&i&&fo(n,r)&&o(t).each((function(o){o(n,t,e),r.stop()}))},c=[wi(Do(),(function(r,o){u(r,o,n,t,e).fold((function(){a(r,o)}),(function(t){o.stop()}))})),wi(Mo(),(function(n,o){u(n,o,r,t,e).each((function(t){o.stop()}))}))];return pi(i.toArray().concat(c))},c={schema:i,processKey:u,toEvents:a};return c},lv=function(t){var e=[Dn("onEscape"),Dn("onEnter"),Ln("selector",'[data-alloy-tabstop="true"]:not(:disabled)'),Ln("firstTabstop",0),Ln("useTabstopAt",f),Dn("visibilitySelector")].concat([t]),n=function(t,e){var n=t.visibilitySelector.bind((function(t){return hs(e,t)})).getOr(e);return kc(n)>0},r=function(t,e){var r=Jd(t.element,e.selector),o=X(r,(function(t){return n(e,t)}));return x.from(o[e.firstTabstop])},o=function(t,e){return e.focusManager.get(t).bind((function(t){return hs(t,e.selector)}))},u=function(t,e){return n(t,e)&&t.useTabstopAt(e)},c=function(t,e,n){r(t,e).each((function(n){e.focusManager.set(t,n)}))},s=function(t,e,n,r,o){return o(e,n,(function(t){return u(r,t)})).fold((function(){return r.cyclic?x.some(!0):x.none()}),(function(e){return r.focusManager.set(t,e),x.some(!0)}))},l=function(t,e,n,r){var i=Jd(t.element,n.selector);return o(t,n).bind((function(e){var o=tt(i,a(oo,e));return o.bind((function(e){return s(t,i,e,n,r)}))}))},d=function(t,e,n){var r=n.cyclic?Xp:Yp;return l(t,e,n,r)},m=function(t,e,n){var r=n.cyclic?Jp:Zp;return l(t,e,n,r)},g=function(t,e,n){return n.onEnter.bind((function(n){return n(t,e)}))},h=function(t,e,n){return n.onEscape.bind((function(n){return n(t,e)}))},p=i([ov(tv([ev,Qp(Vp)]),d),ov(Qp(Vp),m),ov(Qp(Up),h),ov(tv([rv,Qp(jp)]),g)]),v=i([]);return sv(e,ra.init,p,v,(function(){return x.some(c)}))},fv=lv(Kn("cyclic",l)),dv=lv(Kn("cyclic",f)),mv=function(t,e,n){return mi(t,n,Uo()),x.some(!0)},gv=function(t,e,n){var r=hp(n)&&Qp(Wp)(e.event);return r?x.none():mv(t,e,n)},hv=function(t,e){return x.some(!0)},pv=[Ln("execute",gv),Ln("useSpace",!1),Ln("useEnter",!0),Ln("useControlEnter",!1),Ln("useDown",!1)],vv=function(t,e,n){return n.execute(t,e,t.element)},bv=function(t,e,n,r){var o=n.useSpace&&!hp(t.element)?Wp:[],i=n.useEnter?jp:[],u=n.useDown?Kp:[],a=o.concat(i).concat(u);return[ov(Qp(a),vv)].concat(n.useControlEnter?[ov(tv([nv,Qp(jp)]),vv)]:[])},yv=function(t,e,n,r){return n.useSpace&&!hp(t.element)?[ov(Qp(Wp),hv)]:[]},wv=sv(pv,ra.init,bv,yv,(function(){return x.none()})),xv=function(){var t=Xn(x.none()),e=function(e,n){t.set(x.some({numRows:e,numColumns:n}))},n=function(){return t.get().map((function(t){return t.numRows}))},r=function(){return t.get().map((function(t){return t.numColumns}))};return oa({readState:function(){return t.get().map((function(t){return{numRows:String(t.numRows),numColumns:String(t.numColumns)}})).getOr({numRows:"?",numColumns:"?"})},setGridSize:e,getNumRows:n,getNumColumns:r})},Cv=function(t){return t.state(t)},kv=Object.freeze({__proto__:null,flatgrid:xv,init:Cv}),Sv=function(t){return function(e,n,r,o){var i=t(e.element);return Ev(i,e,n,r,o)}},Ov=function(t,e){var n=Lf(t,e);return Sv(n)},Tv=function(t,e){var n=Lf(e,t);return Sv(n)},_v=function(t){return function(e,n,r,o){return Ev(t,e,n,r,o)}},Ev=function(t,e,n,r,o){var i=r.focusManager.get(e).bind((function(n){return t(e.element,n,r,o)}));return i.map((function(t){return r.focusManager.set(e,t),!0}))},Av=_v,Dv=_v,Mv=_v,Nv=function(t){return t.offsetWidth<=0&&t.offsetHeight<=0},Rv=function(t){return!Nv(t.dom)},Bv=function(t,e){return tt(t,e).map((function(e){return{index:e,candidates:t}}))},Pv=function(t,e,n){var r=function(t){return oo(t,e)},o=Jd(t,n),i=X(o,Rv);return Bv(i,r)},zv=function(t,e){return tt(t,(function(t){return oo(e,t)}))},Iv=function(t,e,n,r){var o=Math.floor(e/n),i=e%n;return r(o,i).bind((function(e){var r=e.row*n+e.column;return r>=0&&r1?x.some(t.slice(1)):x.none()}))},h=function(t){return Ft(n.get(),t)},p=function(t){return v(t).bind(_w)},v=function(t){return Ft(e.get(),t)},b=function(e){return Ft(t.get(),e)},y=function(t){var e=o.get();return it(Et(e),t)},w=function(){return r.get().bind(p)},C=function(){return e.get()};return{setMenuBuilt:a,setContents:c,expand:d,refresh:h,collapse:g,lookupMenu:v,lookupItem:b,otherMenus:y,getPrimary:w,getMenus:C,clear:i,isClear:u,getTriggeringPath:f}},_w=function(t){return"prepared"===t.type?x.some(t.menu):x.none()},Ew={init:Tw,extractPreparedMenu:_w},Aw=function(t,n){var r,o=Xn(x.none()),i=function(e,n,r){return Mt(r,(function(r,o){var i=function(){return Cw.sketch(m(m({},r),{value:o,markers:t.markers,fakeFocus:t.fakeFocus,onHighlight:t.onHighlight,focusManager:t.fakeFocus?cv():av()}))};return o===n?{type:"prepared",menu:e.getSystem().build(i())}:{type:"notbuilt",nbMenu:i}}))},u=Ew.init(),a=function(e){var n=i(e,t.data.primary,t.data.menus),r=l();return u.setContents(t.data.primary,n,t.data.expansions,r),u.getPrimary()},c=function(t){return Xg.getValue(t).value},s=function(t,e,n){return dt(e,(function(t){if(!t.getSystem().isConnected())return x.none();var e=Fp.getCandidates(t);return Q(e,(function(t){return c(t)===n}))}))},l=function(e){return Mt(t.data.menus,(function(t,e){return nt(t.items,(function(t){return"separator"===t.type?[]:[t.data.value]}))}))},d=function(t,e){Fp.highlight(t,e),Fp.getHighlighted(e).orThunk((function(){return Fp.getFirst(e)})).each((function(e){mi(t,e.element,Wo())}))},g=function(t,e){return sp(q(e,(function(e){return t.lookupMenu(e).bind((function(t){return"prepared"===t.type?x.some(t.menu):x.none()}))})))},h=function(e,n,r){var o=g(n,n.otherMenus(r));$(o,(function(n){ja(n.element,[t.markers.backgroundMenu]),t.stayInDom||xy.remove(e,n)}))},p=function(e){return o.get().getOrThunk((function(){var n={},r=Jd(e.element,"."+t.markers.item),i=X(r,(function(t){return"true"===Ou(t,"aria-haspopup")}));return $(i,(function(t){e.getSystem().getByDom(t).each((function(t){var e=c(t);n[e]=t}))})),o.set(x.some(n)),n}))},v=function(t,e){var n=p(t);Dt(n,(function(t,n){var r=V(e,n);ku(t.element,"aria-expanded",r)}))},b=function(e,n,r){return x.from(r[0]).bind((function(o){return n.lookupMenu(o).bind((function(o){if("notbuilt"===o.type)return x.none();var i=o.menu,u=g(n,r.slice(1));return $(u,(function(e){Ia(e.element,t.markers.backgroundMenu)})),Wa(i.element)||xy.append(e,wc(i)),ja(i.element,[t.markers.backgroundMenu]),d(e,i),h(e,n,r),x.some(i)}))}))};(function(t){t[t["HighlightSubmenu"]=0]="HighlightSubmenu",t[t["HighlightParent"]=1]="HighlightParent"})(r||(r={}));var y=function(t,e,n){if("notbuilt"===n.type){var r=t.getSystem().build(n.nbMenu());return u.setMenuBuilt(e,r),r}return n.menu},w=function(e,n,o){void 0===o&&(o=r.HighlightSubmenu);var i=c(n);return u.expand(i).bind((function(i){return v(e,i),x.from(i[0]).bind((function(a){return u.lookupMenu(a).bind((function(c){var s=y(e,a,c);return Wa(s.element)||xy.append(e,wc(s)),t.onOpenSubmenu(e,n,s,ot(i)),o===r.HighlightSubmenu?(Fp.highlightFirst(s),b(e,u,i)):(Fp.dehighlightAll(s),x.some(n))}))}))}))},C=function(e,n){var r=c(n);return u.collapse(r).bind((function(r){return v(e,r),b(e,u,r).map((function(r){return t.onCollapseMenu(e,n,r),r}))}))},k=function(t,e){var n=c(e);return u.refresh(n).bind((function(e){return v(t,e),b(t,u,e)}))},S=function(t,e){return hp(e.element)?x.none():w(t,e,r.HighlightSubmenu)},O=function(t,e){return hp(e.element)?x.none():C(t,e)},T=function(e,n){return C(e,n).orThunk((function(){return t.onEscape(e,n).map((function(){return e}))}))},_=function(e){return function(n,r){return hs(r.getSource(),"."+t.markers.item).bind((function(t){return n.getSystem().getByDom(t).toOptional().bind((function(t){return e(n,t).map(f)}))}))}},E=pi([wi(ww(),(function(t,e){var n=e.event.item;u.lookupItem(c(n)).each((function(){var n=e.event.menu;Fp.highlight(t,n);var r=c(e.event.item);u.refresh(r).each((function(e){return h(t,u,e)}))}))})),Ri((function(n,o){var i=o.event.target;n.getSystem().getByDom(i).each((function(o){var i=c(o);0===i.indexOf("collapse-item")&&C(n,o),w(n,o,r.HighlightSubmenu).fold((function(){t.onExecute(n,o)}),e)}))})),Di((function(e,n){a(e).each((function(n){xy.append(e,wc(n)),t.onOpenMenu(e,n),t.highlightImmediately&&d(e,n)}))}))].concat(t.navigateOnHover?[wi(ow(),(function(e,n){var o=n.event.item;k(e,o),w(e,o,r.HighlightParent),t.onHover(e,o)}))]:[])),A=function(t){return Fp.getHighlighted(t).bind(Fp.getHighlighted)},D=function(t){A(t).each((function(e){C(t,e)}))},M=function(t){u.getPrimary().each((function(e){d(t,e)}))},N=function(t){return x.from(t.components()[0]).filter((function(t){return"menu"===Ou(t.element,"role")}))},R=function(e){var n=u.getPrimary().bind((function(t){return A(e).bind((function(t){var n=c(t),r=Lt(u.getMenus()),o=sp(q(r,Ew.extractPreparedMenu));return u.getTriggeringPath(n,(function(t){return s(e,o,t)}))})).map((function(e){return{primary:t,triggeringPath:e}}))}));n.fold((function(){N(e).each((function(n){t.onRepositionMenu(e,n,[])}))}),(function(n){var r=n.primary,o=n.triggeringPath;t.onRepositionMenu(e,r,o)}))},B={collapseMenu:D,highlightPrimary:M,repositionMenus:R};return{uid:t.uid,dom:t.dom,markers:t.markers,behaviours:Zg(t.tmenuBehaviours,[fy.config({mode:"special",onRight:_(S),onLeft:_(O),onEscape:_(T),focusIn:function(t,e){u.getPrimary().each((function(e){mi(t,e.element,Wo())}))}}),Fp.config({highlightClass:t.markers.selectedMenu,itemClass:t.markers.menu}),yp.config({find:function(t){return Fp.getHighlighted(t)}}),xy.config({})]),eventOrder:t.eventOrder,apis:B,events:E}},Dw=i("collapse-item"),Mw=function(t,e,n){return{primary:t,menus:e,expansions:n}},Nw=function(t,e){return{primary:t,menus:se(t,e),expansions:{}}},Rw=function(t){return{value:Iu(Dw()),meta:{text:t}}},Bw=ap({name:"TieredMenu",configFields:[Vs("onExecute"),Vs("onEscape"),Hs("onOpenMenu"),Hs("onOpenSubmenu"),Ls("onRepositionMenu"),Ls("onCollapseMenu"),Ln("highlightImmediately",!0),_n("data",[yn("primary"),yn("menus"),yn("expansions")]),Ln("fakeFocus",!1),Ls("onHighlight"),Ls("onHover"),Ps(),yn("dom"),Ln("navigateOnHover",!0),Ln("stayInDom",!1),Yg("tmenuBehaviours",[fy,Fp,yp,xy]),Ln("eventOrder",{})],apis:{collapseMenu:function(t,e){t.collapseMenu(e)},highlightPrimary:function(t,e){t.highlightPrimary(e)},repositionMenus:function(t,e){t.repositionMenus(e)}},factory:Aw,extraApis:{tieredData:Mw,singleData:Nw,collapseItem:Rw}}),Pw=function(t,e,n,r,o){var i=function(){return t.lazySink(e)},u="horizontal"===r.type?{layouts:{onLtr:function(){return _l()},onRtl:function(){return El()}}}:{},a=function(t){return 2===t.length},c=function(t){return a(t)?u:{}};return Bw.sketch({dom:{tag:"div"},data:r.data,markers:r.menu.markers,highlightImmediately:r.menu.highlightImmediately,onEscape:function(){return mg.close(e),t.onEscape.map((function(t){return t(e)})),x.some(!0)},onExecute:function(){return x.some(!0)},onOpenMenu:function(t,e){Rm.positionWithinBounds(i().getOrDie(),n,e,o())},onOpenSubmenu:function(t,e,n,r){var o=i().getOrDie();Rm.position(o,m({anchor:"submenu",item:e},c(r)),n)},onRepositionMenu:function(t,e,r){var u=i().getOrDie();Rm.positionWithinBounds(u,n,e,o()),$(r,(function(t){var e=c(t.triggeringPath);Rm.position(u,m({anchor:"submenu",item:t.triggeringItem},e),t.triggeredMenu)}))}})},zw=function(t,e){var n=function(e,n){var r=t.getRelated(e);return r.exists((function(t){return ys(t,n)}))},r=function(t,e){mg.setContent(t,e)},o=function(t,e,n){i(t,e,n,x.none())},i=function(t,e,n,r){u(t,e,n,(function(){return r.map((function(t){return os(t)}))}))},u=function(e,n,r,o){var i=t.lazySink(e).getOrDie();mg.openWhileCloaked(e,r,(function(){return Rm.positionWithinBounds(i,n,e,o())})),Xg.setValue(e,x.some({mode:"position",anchor:n,getBounds:o}))},a=function(t,e,n){c(t,e,n,(function(){return x.none()}))},c=function(e,n,r,o){var i=Pw(t,e,n,r,o);mg.open(e,i),Xg.setValue(e,x.some({mode:"menu",menu:i}))},s=function(t){mg.isOpen(t)&&(Xg.setValue(t,x.none()),mg.close(t))},l=function(t){return mg.getState(t)},f=function(e){mg.isOpen(e)&&Xg.getValue(e).each((function(n){switch(n.mode){case"menu":mg.getState(e).each((function(t){Bw.repositionMenus(t)}));break;case"position":var r=t.lazySink(e).getOrDie();Rm.positionWithinBounds(r,n.anchor,e,n.getBounds());break}}))},d={setContent:r,showAt:o,showWithin:i,showWithinBounds:u,showMenuAt:a,showMenuWithinBounds:c,hide:s,getContent:l,reposition:f,isOpen:mg.isOpen};return{uid:t.uid,dom:t.dom,behaviours:Zg(t.inlineBehaviours,[mg.config({isPartOf:function(t,e,r){return ys(e,r)||n(t,r)},getAttachPoint:function(e){return t.lazySink(e).getOrDie()},onOpen:function(e){t.onShow(e)},onClose:function(e){t.onHide(e)}}),Xg.config({store:{mode:"memory",initialValue:x.none()}}),$l.config({channels:m(m({},bg(m({isExtraPart:e.isExtraPart},t.fireDismissalEventInstead.map((function(t){return{fireEventInstead:{event:t.event}}})).getOr({})))),wg(m(m({},t.fireRepositionEventInstead.map((function(t){return{fireEventInstead:{event:t.event}}})).getOr({})),{doReposition:f})))})]),eventOrder:t.eventOrder,apis:d}},Iw=ap({name:"InlineView",configFields:[yn("lazySink"),Ls("onShow"),Ls("onHide"),Bn("onEscape"),Yg("inlineBehaviours",[mg,Xg,$l]),zn("fireDismissalEventInstead",[Ln("event",ni())]),zn("fireRepositionEventInstead",[Ln("event",ri())]),Ln("getRelated",x.none),Ln("isExtraPart",l),Ln("eventOrder",x.none)],factory:zw,apis:{showAt:function(t,e,n,r){t.showAt(e,n,r)},showWithin:function(t,e,n,r,o){t.showWithin(e,n,r,o)},showWithinBounds:function(t,e,n,r,o){t.showWithinBounds(e,n,r,o)},showMenuAt:function(t,e,n,r){t.showMenuAt(e,n,r)},showMenuWithinBounds:function(t,e,n,r,o){t.showMenuWithinBounds(e,n,r,o)},hide:function(t,e){t.hide(e)},isOpen:function(t,e){return t.isOpen(e)},getContent:function(t,e){return t.getContent(e)},setContent:function(t,e,n){t.setContent(e,n)},reposition:function(t,e){t.reposition(e)}}}),Lw=function(t){return t.x},Fw=function(t,e){return t.x+t.width/2-e.width/2},Hw=function(t,e){return t.x+t.width-e.width},Vw=function(t){return t.y},jw=function(t,e){return t.y+t.height-e.height},Uw=function(t,e,n){return qs(Hw(t,e),jw(t,e),n.innerSoutheast(),Qs(),il(t,{right:0,bottom:3}),"layout-inner-se")},Ww=function(t,e,n){return qs(Lw(t),jw(t,e),n.innerSouthwest(),Zs(),il(t,{left:1,bottom:3}),"layout-inner-sw")},qw=function(t,e,n){return qs(Hw(t,e),Vw(t),n.innerNortheast(),Js(),il(t,{right:0,top:2}),"layout-inner-ne")},$w=function(t,e,n){return qs(Lw(t),Vw(t),n.innerNorthwest(),Ys(),il(t,{left:1,top:2}),"layout-inner-nw")},Gw=function(t,e,n){return qs(Fw(t,e),Vw(t),n.innerNorth(),tl(),il(t,{top:2}),"layout-inner-n")},Kw=function(t,e,n){return qs(Fw(t,e),jw(t,e),n.innerSouth(),el(),il(t,{bottom:3}),"layout-inner-s")},Xw=tinymce.util.Tools.resolve("tinymce.util.Delay"),Yw=function(t){var e=Qy(t.action),n=t.dom.tag,r=function(e){return Ft(t.dom,"attributes").bind((function(t){return Ft(t,e)}))},o=function(){if("button"===n){var t=r("type").getOr("button"),e=r("role").map((function(t){return{role:t}})).getOr({});return m({type:t},e)}var o=r("role").getOr("button");return{role:o}};return{uid:t.uid,dom:t.dom,components:t.components,events:e,behaviours:Qg.augment(t.buttonBehaviours,[Ny.config({}),fy.config({mode:"execution",useSpace:!0,useEnter:!0})]),domModification:{attributes:o()},eventOrder:t.eventOrder}},Jw=ap({name:"Button",factory:Yw,configFields:[Ln("uid",void 0),yn("dom"),Ln("components",[]),Qg.field("buttonBehaviours",[Ny,fy]),Dn("action"),Dn("role"),Ln("eventOrder",{})]}),Zw=function(t){var e=op(t)&&Vt(t,"uid")?t.uid:qu("memento"),n=function(t){return t.getSystem().getByUid(e).getOrDie()},r=function(t){return t.getSystem().getByUid(e).toOptional()},o=function(){return m(m({},t),{uid:e})};return{get:n,getOpt:r,asSpec:o}},Qw=function(t){return x.from(t()["temporary-placeholder"]).getOr("!not found!")},tx=function(t,e){return x.from(e()[t.toLowerCase()]).getOrThunk((function(){return Qw(e)}))},ex=function(t,e,n){return x.from(e()[t.toLowerCase()]).or(n).getOrThunk((function(){return Qw(e)}))},nx=function(t,e){return dt(t,(function(t){return x.from(e()[t.toLowerCase()])})).getOrThunk((function(){return Qw(e)}))},rx={success:"checkmark",error:"warning",err:"error",warning:"warning",warn:"warning",info:"info"},ox=function(t){var e=Zw({dom:{tag:"p",innerHtml:t.translationProvider(t.text)},behaviours:Hl([xy.config({})])}),n=function(t){return{dom:{tag:"div",classes:["tox-bar"],attributes:{style:"width: "+t+"%"}}}},r=function(t){return{dom:{tag:"div",classes:["tox-text"],innerHtml:t+"%"}}},o=Zw({dom:{tag:"div",classes:t.progress?["tox-progress-bar","tox-progress-indicator"]:["tox-progress-bar"]},components:[{dom:{tag:"div",classes:["tox-bar-container"]},components:[n(0)]},r(0)],behaviours:Hl([xy.config({})])}),i=function(t,e){t.getSystem().isConnected()&&o.getOpt(t).each((function(t){xy.set(t,[{dom:{tag:"div",classes:["tox-bar-container"]},components:[n(e)]},r(e)])}))},u=function(t,n){if(t.getSystem().isConnected()){var r=e.get(t);xy.set(r,[pc(n)])}},a={updateProgress:i,updateText:u},c=et([t.icon.toArray(),t.level.toArray(),t.level.bind((function(t){return x.from(rx[t])})).toArray()]),s=Zw(Jw.sketch({dom:{tag:"button",classes:["tox-notification__dismiss","tox-button","tox-button--naked","tox-button--icon"]},components:[{dom:{tag:"div",classes:["tox-icon"],innerHtml:tx("close",t.iconProvider),attributes:{"aria-label":t.translationProvider("Close")}}}],action:function(e){t.onAction(e)}})),l=[{dom:{tag:"div",classes:["tox-notification__icon"],innerHtml:nx(c,t.iconProvider)}},{dom:{tag:"div",classes:["tox-notification__body"]},components:[e.asSpec()],behaviours:Hl([xy.config({})])}];return{uid:t.uid,dom:{tag:"div",attributes:{role:"alert"},classes:t.level.map((function(t){return["tox-notification","tox-notification--in","tox-notification--"+t]})).getOr(["tox-notification","tox-notification--in"])},behaviours:Hl([Ny.config({}),ky("notification-events",[wi(Eo(),(function(t){s.getOpt(t).each(Ny.focus)}))])]),components:l.concat(t.progress?[o.asSpec()]:[]).concat(t.closeButton?[s.asSpec()]:[]),apis:a}},ix=ap({name:"Notification",factory:ox,configFields:[Dn("level"),yn("progress"),yn("icon"),yn("onAction"),yn("text"),yn("iconProvider"),yn("translationProvider"),Un("closeButton",!0)],apis:{updateProgress:function(t,e,n){t.updateProgress(e,n)},updateText:function(t,e,n){t.updateText(e,n)}}});function ux(t,e,n){var r=e.backstage,o=function(t){switch(t){case"bc-bc":return Kw;case"tc-tc":return Gw;case"tc-bc":return yl;case"bc-tc":default:return wl}},i=function(t){$(t,(function(t){return t.moveTo(0,0)}))},u=function(t){t.length>0&&(st(t).each((function(t){return t.moveRel(null,"banner")})),$(t,(function(e,n){n>0&&e.moveRel(t[n-1].getEl(),"bc-tc")})))},a=function(t){i(t),u(t)},c=function(t,i){var u=!t.closeButton&&t.timeout&&(t.timeout>0||t.timeout<0),a=function(){i(),Iw.hide(s)},c=yc(ix.sketch({text:t.text,level:V(["success","error","warning","warn","info"],t.type)?t.type:void 0,progress:!0===t.progressBar,icon:x.from(t.icon),closeButton:!u,onAction:a,iconProvider:r.shared.providers.icons,translationProvider:r.shared.providers.translate})),s=yc(Iw.sketch(m({dom:{tag:"div",classes:["tox-notifications-container"]},lazySink:e.backstage.shared.getSink,fireDismissalEventInstead:{}},r.shared.header.isPositionedAtTop()?{}:{fireRepositionEventInstead:{}})));return n.add(s),t.timeout>0&&Xw.setTimeout((function(){a()}),t.timeout),{close:a,moveTo:function(t,e){Iw.showAt(s,{anchor:"makeshift",x:t,y:e},wc(c))},moveRel:function(t,n){if("banner"!==n){var r=o(n),i={anchor:"node",root:qa(),node:x.some(er.fromDom(t)),layouts:{onRtl:function(){return[r]},onLtr:function(){return[r]}}};Iw.showAt(s,i,wc(c))}else Iw.showAt(s,e.backstage.shared.anchors.banner(),wc(c))},text:function(t){ix.updateText(c,t)},settings:t,getEl:function(){return c.element.dom},progressBar:{value:function(t){ix.updateProgress(c,t)}}}},s=function(t){t.close()},l=function(t){return t.settings};return{open:c,close:s,reposition:a,getArgs:l}}var ax,cx=function(t,e){var n=null,r=function(){null!==n&&(clearTimeout(n),n=null)},o=function(){for(var r=[],o=0;o',t.getDoc());return fu(n,er.fromDom(e.extractContents())),e.insertNode(n.dom),qi(n).each((function(t){return t.dom.normalize()})),Xd(n).map((function(e){t.selection.setCursorLocation(e.dom,qd(e))})),n}))},hx=function(t){return hs(t,mx)},px=function(t){return t.collapsed&&3===t.startContainer.nodeType},vx=function(t){return t.toString().replace(/\u00A0/g," ").replace(/\uFEFF/g,"")},bx=function(t){return""!==t&&-1!=="  \f\n\r\t\v".indexOf(t)},yx=function(t,e){return t.substring(e.length)},wx=function(t,e,n){var r;for(r=e-1;r>=0;r--){var o=t.charAt(r);if(bx(o))return x.none();if(o===n)break}return x.some(r)},xx=function(t,e,n,r){if(void 0===r&&(r=0),!px(e))return x.none();var o=function(t,e,r){return wx(r,e,n).getOr(e)},i=t.getParent(e.startContainer,t.isBlock)||t.getRoot();return dx(t,e.startContainer,e.startOffset,o,i).bind((function(t){var o=e.cloneRange();if(o.setStart(t.container,t.offset),o.setEnd(e.endContainer,e.endOffset),o.collapsed)return x.none();var i=vx(o),u=i.lastIndexOf(n);return 0!==u||yx(i,n).length0?Ax(e[e.length-1]):Tx(t,e.length)},Dx=function(t,e){var n=t.childNodes;return n.length>0&&e0&&Ex(t)&&n.length===e?Ax(n[n.length-1]):Tx(t,e)},Mx=function(t,e){return dx(t,e.container,e.offset,(function(t,e){return 0===e?-1:e}),t.getRoot()).filter((function(t){var e=t.container.data.charAt(t.offset-1);return!bx(e)})).isSome()},Nx=function(t){return function(e){var n=Dx(e.startContainer,e.startOffset);return!Mx(t,n)}},Rx=function(t,e,n){return dt(n.triggerChars,(function(n){return Cx(t,e,n)}))},Bx=function(t,e){var n=e(),r=t.selection.getRng();return Rx(t.dom,r,n).bind((function(n){return Px(t,e,n)}))},Px=function(t,e,n,r){void 0===r&&(r={});var o=e(),i=t.selection.getRng(),u=i.startContainer.nodeValue,a=X(o.lookupByChar(n.triggerChar),(function(e){return n.text.length>=e.minChars&&e.matches.getOrThunk((function(){return Nx(t.dom)}))(n.range,u,n.text)}));if(0===a.length)return x.none();var c=Ox.all(q(a,(function(t){var e=t.fetch(n.text,t.maxResults,r);return e.then((function(e){return{matchText:n.text,items:e,columns:t.columns,onAction:t.onAction,highlightOn:t.highlightOn}}))})));return x.some({lookupData:c,context:n})},zx=Le([Cn("type"),Rn("text")]),Ix=function(t){return nn("separatormenuitem",zx,t)},Lx=Le([Ln("type","autocompleteitem"),Ln("active",!1),Ln("disabled",!1),Ln("meta",{}),Cn("value"),Rn("text"),Rn("icon")]),Fx=Le([Cn("type"),Cn("ch"),Hn("minChars",1),Ln("columns",1),Hn("maxResults",10),Bn("matches"),On("fetch"),On("onAction"),$n("highlightOn",[],mn)]),Hx=function(t){return nn("Autocompleter.Separator",zx,t)},Vx=function(t){return nn("Autocompleter.Item",Lx,t)},jx=function(t){return nn("Autocompleter",Fx,t)},Ux=[Un("disabled",!1),Rn("tooltip"),Rn("icon"),Rn("text"),Wn("onSetup",(function(){return e}))],Wx=Le([Cn("type"),On("onAction")].concat(Ux)),qx=function(t){return nn("toolbarbutton",Wx,t)},$x=[Un("active",!1)].concat(Ux),Gx=Le($x.concat([Cn("type"),On("onAction")])),Kx=function(t){return nn("ToggleButton",Gx,t)},Xx=[Wn("predicate",l),jn("scope","node",["node","editor"]),jn("position","selection",["node","selection","line"])],Yx=Ux.concat([Ln("type","contextformbutton"),Ln("primary",!1),On("onAction"),Kn("original",u)]),Jx=$x.concat([Ln("type","contextformbutton"),Ln("primary",!1),On("onAction"),Kn("original",u)]),Zx=Ux.concat([Ln("type","contextformbutton")]),Qx=$x.concat([Ln("type","contextformtogglebutton")]),tC=cn("type",{contextformbutton:Yx,contextformtogglebutton:Jx}),eC=Le([Ln("type","contextform"),Wn("initValue",(function(){return""})),Rn("label"),An("commands",tC),Mn("launch",cn("type",{contextformbutton:Zx,contextformtogglebutton:Qx}))].concat(Xx)),nC=function(t){return nn("ContextForm",eC,t)},rC=Le([Ln("type","contexttoolbar"),Cn("items")].concat(Xx)),oC=function(t){return nn("ContextToolbar",rC,t)},iC=function(t){var e={};return $(t,(function(t){e[t]={}})),Et(e)},uC=function(t){var e=t.ui.registry.getAll().popups,n=Mt(e,(function(t){return jx(t).fold((function(t){throw new Error(un(t))}),(function(t){return t}))})),r=iC(zt(n,(function(t){return t.ch}))),o=Lt(n),i=function(t){return X(o,(function(e){return e.ch===t}))};return{dataset:n,triggerChars:r,lookupByChar:i}};(function(t){t[t["CLOSE_ON_EXECUTE"]=0]="CLOSE_ON_EXECUTE",t[t["BUBBLE_TO_SANDBOX"]=1]="BUBBLE_TO_SANDBOX"})(ax||(ax={}));var aC,cC=ax,sC="tox-menu-nav__js",lC="tox-collection__item",fC="tox-swatch",dC={normal:sC,color:fC},mC="tox-collection__item--enabled",gC="tox-collection__group-heading",hC="tox-collection__item-icon",pC="tox-collection__item-label",vC="tox-collection__item-accessory",bC="tox-collection__item-caret",yC="tox-collection__item-checkmark",wC="tox-collection__item--active",xC="tox-collection__item-icon-rtl",CC="tox-collection__item-container",kC="tox-collection__item-container--column",SC="tox-collection__item-container--row",OC="tox-collection__item-container--align-right",TC="tox-collection__item-container--align-left",_C="tox-collection__item-container--valign-top",EC="tox-collection__item-container--valign-middle",AC="tox-collection__item-container--valign-bottom",DC=function(t){return Ft(dC,t).getOr(sC)},MC=function(t){return"color"===t?"tox-swatches":"tox-menu"},NC=function(t){return{backgroundMenu:"tox-background-menu",selectedMenu:"tox-selected-menu",selectedItem:"tox-collection__item--active",hasIcons:"tox-menu--has-icons",menu:MC(t),tieredMenu:"tox-tiered-menu"}},RC=function(t){var e=NC(t);return{backgroundMenu:e.backgroundMenu,selectedMenu:e.selectedMenu,menu:e.menu,selectedItem:e.selectedItem,item:DC(t)}},BC=function(t,e,n){var r=NC(n);return{tag:"div",classes:et([[r.menu,"tox-menu-"+e+"-column"],t?[r.hasIcons]:[]])}},PC=[Cw.parts.items({})],zC=function(t,e,n){var r=NC(n),o={tag:"div",classes:et([[r.tieredMenu]])};return{dom:o,markers:RC(n)}},IC=function(t,e){return function(n){var r=W(n,e);return q(r,(function(e){return{dom:t,components:e}}))}},LC=function(t){return{dom:{tag:"div",classes:["tox-menu","tox-swatches-menu"]},components:[{dom:{tag:"div",classes:["tox-swatches"]},components:[Cw.parts.items({preprocess:"auto"!==t?IC({tag:"div",classes:["tox-swatches__row"]},t):u})]}]}},FC=function(t){return{dom:{tag:"div",classes:["tox-menu","tox-collection","tox-collection--toolbar","tox-collection--toolbar-lg"]},components:[Cw.parts.items({preprocess:IC({tag:"div",classes:["tox-collection__group"]},t)})]}},HC=function(t,e){var n=[],r=[];return $(t,(function(t,o){e(t,o)?(r.length>0&&n.push(r),r=[],Ht(t.dom,"innerHtml")&&r.push(t)):r.push(t)})),r.length>0&&n.push(r),q(n,(function(t){return{dom:{tag:"div",classes:["tox-collection__group"]},components:t}}))},VC=function(t,e,n){return{dom:{tag:"div",classes:["tox-menu","tox-collection"].concat(1===t?["tox-collection--list"]:["tox-collection--grid"])},components:[Cw.parts.items({preprocess:function(n){return"auto"!==t&&t>1?IC({tag:"div",classes:["tox-collection__group"]},t)(n):HC(n,(function(t,n){return"separator"===e[n].type}))}})]}},jC=function(t,e){return{dom:{tag:"div",classes:["tox-collection","tox-collection--horizontal"]},components:[Cw.parts.items({preprocess:function(e){return HC(e,(function(e,n){return"separator"===t[n].type}))}})]}},UC=function(t){return j(t,(function(t){return"icon"in t&&void 0!==t.icon}))},WC=function(t){return console.error(un(t)),console.log(t),x.none()},qC=function(t,e,n,r,o){var i=jC(n);return{value:t,dom:i.dom,components:i.components,items:n}},$C=function(t,e,n,r,o){if("color"===o){var i=LC(r);return{value:t,dom:i.dom,components:i.components,items:n}}if("normal"===o&&"auto"===r){i=VC(r,n);return{value:t,dom:i.dom,components:i.components,items:n}}if("normal"===o&&1===r){i=VC(1,n);return{value:t,dom:i.dom,components:i.components,items:n}}if("normal"===o){i=VC(r,n);return{value:t,dom:i.dom,components:i.components,items:n}}if("listpreview"===o&&"auto"!==r){i=FC(r);return{value:t,dom:i.dom,components:i.components,items:n}}return{value:t,dom:BC(e,r,o),components:PC,items:n}},GC=[Cn("type"),Cn("src"),Rn("alt"),$n("classes",[],mn)],KC=Le(GC),XC=[Cn("type"),Cn("text"),Rn("name"),$n("classes",["tox-collection__item-label"],mn)],YC=Le(XC),JC=Ze((function(){return an("type",{cardimage:KC,cardtext:YC,cardcontainer:ZC})})),ZC=Le([Cn("type"),Vn("direction","horizontal"),Vn("align","left"),Vn("valign","middle"),An("items",JC)]),QC=[Un("disabled",!1),Rn("text"),Rn("shortcut"),$e("value","value",ne((function(){return Iu("menuitem-value")})),ln()),Ln("meta",{})],tk=Le([Cn("type"),Rn("label"),An("items",JC),Wn("onSetup",(function(){return e})),Wn("onAction",e)].concat(QC)),ek=function(t){return nn("cardmenuitem",tk,t)},nk=Le([Cn("type"),Un("active",!1),Rn("icon")].concat(QC)),rk=function(t){return nn("choicemenuitem",nk,t)},ok=["inserttable","colorswatch"],ik=Le([Cn("type"),kn("fancytype",ok),Wn("onAction",e)]),uk=function(t){return nn("fancymenuitem",ik,t)},ak=Le([Cn("type"),Wn("onSetup",(function(){return e})),Wn("onAction",e),Rn("icon")].concat(QC)),ck=function(t){return nn("menuitem",ak,t)},sk=Le([Cn("type"),On("getSubmenuItems"),Wn("onSetup",(function(){return e})),Rn("icon")].concat(QC)),lk=function(t){return nn("nestedmenuitem",sk,t)},fk=Le([Cn("type"),Rn("icon"),Un("active",!1),Wn("onSetup",(function(){return e})),On("onAction")].concat(QC)),dk=function(t){return nn("togglemenuitem",fk,t)},mk=function(t,e,n){var r=Jd(t.element,"."+n);if(r.length>0){var o=tt(r,(function(t){var n=t.dom.getBoundingClientRect().top,o=r[0].dom.getBoundingClientRect().top;return Math.abs(n-o)>e})).getOr(r.length);return x.some({numColumns:o,numRows:Math.ceil(r.length/o)})}return x.none()},gk=function(t,e){return Hl([ky(t,e)])},hk=function(t){return gk(Iu("unnamed-events"),t)},pk={namedEvents:gk,unnamedEvents:hk},vk=Iu("tooltip.exclusive"),bk=Iu("tooltip.show"),yk=Iu("tooltip.hide"),wk=function(t,e,n){t.getSystem().broadcastOn([vk],{})},xk=function(t,e,n,r){n.getTooltip().each((function(t){t.getSystem().isConnected()&&xy.set(t,r)}))},Ck=Object.freeze({__proto__:null,hideAllExclusive:wk,setComponents:xk}),kk=function(t,e){var n=function(n){e.getTooltip().each((function(r){jm(r),t.onHide(n,r),e.clearTooltip()})),e.clearTimer()},r=function(n){if(!e.isShowing()){wk(n);var r=t.lazySink(n).getOrDie(),o=n.getSystem().build({dom:t.tooltipDom,components:t.tooltipComponents,events:pi("normal"===t.mode?[wi(_o(),(function(t){li(n,bk)})),wi(Oo(),(function(t){li(n,yk)}))]:[]),behaviours:Hl([xy.config({})])});e.setTooltip(o),Fm(r,o),t.onShow(n,o),Rm.position(r,t.anchor(n),o)}};return pi(et([[wi(bk,(function(n){e.resetTimer((function(){r(n)}),t.delay)})),wi(yk,(function(r){e.resetTimer((function(){n(r)}),t.delay)})),wi(jo(),(function(t,e){var r=e;r.universal||V(r.channels,vk)&&n(t)})),Mi((function(t){n(t)}))],"normal"===t.mode?[wi(Eo(),(function(t){li(t,bk)})),wi(Ho(),(function(t){li(t,yk)})),wi(_o(),(function(t){li(t,bk)})),wi(Oo(),(function(t){li(t,yk)}))]:[wi(ci(),(function(t,e){li(t,bk)})),wi(si(),(function(t){li(t,yk)}))]]))},Sk=Object.freeze({__proto__:null,events:kk}),Ok=[yn("lazySink"),yn("tooltipDom"),Ln("exclusive",!0),Ln("tooltipComponents",[]),Ln("delay",300),jn("mode","normal",["normal","follow-highlight"]),Ln("anchor",(function(t){return{anchor:"hotspot",hotspot:t,layouts:{onLtr:i([wl,yl,hl,vl,pl,bl]),onRtl:i([wl,yl,hl,vl,pl,bl])}}})),Ls("onHide"),Ls("onShow")],Tk=function(){var t=Xn(x.none()),e=Xn(x.none()),n=function(){return e.get()},r=function(t){e.set(x.some(t))},o=function(){e.set(x.none())},u=function(){t.get().each((function(t){clearTimeout(t)}))},a=function(e,n){u(),t.set(x.some(setTimeout((function(){e()}),n)))},c=function(){return e.get().isSome()},s=i("not-implemented");return oa({getTooltip:n,isShowing:c,setTooltip:r,clearTooltip:o,clearTimer:u,resetTimer:a,readState:s})},_k=Object.freeze({__proto__:null,init:Tk}),Ek=jl({fields:Ok,name:"tooltipping",active:Sk,state:_k,apis:Ck}),Ak=function(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")},Dk=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),Mk=tinymce.util.Tools.resolve("tinymce.util.I18n"),Nk=["input","button","textarea","select"],Rk=function(t,e,n){var r=e.disabled()?Vk:jk;r(t,e)},Bk=function(t,e){return!0===e.useNative&&V(Nk,Bi(t.element))},Pk=function(t){return _u(t.element,"disabled")},zk=function(t){ku(t.element,"disabled","disabled")},Ik=function(t){Eu(t.element,"disabled")},Lk=function(t){return"true"===Ou(t.element,"aria-disabled")},Fk=function(t){ku(t.element,"aria-disabled","true")},Hk=function(t){ku(t.element,"aria-disabled","false")},Vk=function(t,e,n){e.disableClass.each((function(e){Ia(t.element,e)}));var r=Bk(t,e)?zk:Fk;r(t),e.onDisabled(t)},jk=function(t,e,n){e.disableClass.each((function(e){Fa(t.element,e)}));var r=Bk(t,e)?Ik:Hk;r(t),e.onEnabled(t)},Uk=function(t,e){return Bk(t,e)?Pk(t):Lk(t)},Wk=function(t,e,n,r){var o=r?Vk:jk;o(t,e)},qk=Object.freeze({__proto__:null,enable:jk,disable:Vk,isDisabled:Uk,onLoad:Rk,set:Wk}),$k=function(t,e){return sa({classes:e.disabled()?e.disableClass.toArray():[]})},Gk=function(t,e){return pi([vi(Uo(),(function(e,n){return Uk(e,t)})),Bl(t,e,Rk)])},Kk=Object.freeze({__proto__:null,exhibit:$k,events:Gk}),Xk=[Wn("disabled",l),Ln("useNative",!0),Dn("disableClass"),Ls("onDisabled"),Ls("onEnabled")],Yk=jl({fields:Xk,name:"disabling",active:Kk,apis:qk}),Jk=tinymce.util.Tools.resolve("tinymce.EditorManager"),Zk=function(t){var e=t.getParam("skin"),n=t.getParam("skin_url");if(!1!==e){var r=e||"oxide";n=n?t.documentBaseURI.toAbsolute(n):Jk.baseURL+"/skins/ui/"+r}return n},Qk=function(t){return t.getParam("readonly",!1,"boolean")},tS=function(t){return!1===t.getParam("skin")},eS=function(t){return t.getParam("height",Math.max(t.getElement().offsetHeight,200))},nS=function(t){return t.getParam("width",Dk.DOM.getStyle(t.getElement(),"width"))},rS=function(t){return x.from(t.getParam("min_width")).filter(B)},oS=function(t){return x.from(t.getParam("min_height")).filter(B)},iS=function(t){return x.from(t.getParam("max_width")).filter(B)},uS=function(t){return x.from(t.getParam("max_height")).filter(B)},aS=function(t){return x.from(t.getParam("style_formats")).filter(E)},cS=function(t){return t.getParam("style_formats_merge",!1,"boolean")},sS=function(t){return t.getParam("lineheight_formats","1 1.1 1.2 1.3 1.4 1.5 2","string").split(" ")},lS=function(t){return t.getParam("removed_menuitems","")},fS=function(t){return!1!==t.getParam("menubar",!0,"boolean")},dS=function(t){var e=t.getParam("toolbar",!0),n=!0===e,r=T(e),o=E(e)&&e.length>0;return!gS(t)&&(o||r||n)},mS=function(t){var e=U(9,(function(e){return t.getParam("toolbar"+(e+1),!1,"string")})),n=X(e,(function(t){return"string"===typeof t}));return n.length>0?x.some(n):x.none()},gS=function(t){return mS(t).fold((function(){var e=t.getParam("toolbar",[],"string[]");return e.length>0}),f)};(function(t){t["default"]="wrap",t["floating"]="floating",t["sliding"]="sliding",t["scrolling"]="scrolling"})(aC||(aC={}));var hS,pS=function(t){return t.getParam("toolbar_mode","","string")};(function(t){t["auto"]="auto",t["top"]="top",t["bottom"]="bottom"})(hS||(hS={}));var vS,bS=function(t){return t.getParam("toolbar_groups",{},"object")},yS=function(t){return t.getParam("toolbar_location",hS.auto,"string")},wS=function(t){return yS(t)===hS.bottom},xS=function(t){return t.getParam("fixed_toolbar_container","","string")},CS=function(t){return t.getParam("toolbar_persist",!1,"boolean")},kS=function(t){var e=xS(t);return e.length>0&&t.inline?gs(qa(),e):x.none()},SS=function(t){return t.inline&&kS(t).isSome()},OS=function(t){var e=kS(t);return e.getOrThunk((function(){return nu(eu(er.fromDom(t.getElement())))}))},TS=function(t){return t.inline&&!fS(t)&&!dS(t)&&!gS(t)},_S=function(t){var e=t.getParam("toolbar_sticky",!1,"boolean");return(e||t.inline)&&!SS(t)&&!TS(t)},ES=function(t){return t.getParam("draggable_modal",!1,"boolean")},AS=function(t){var e=t.getParam("menu");return e?Mt(e,(function(t){return m(m({},t),{items:t.items})})):{}},DS=function(t){return t.getParam("menubar")},MS=function(t){return t.getParam("toolbar",!0)},NS=function(t){return t.getParam("file_picker_callback")},RS=function(t){return t.getParam("file_picker_types")},BS=function(t){return t.getParam("file_browser_callback_types")},PS=function(t){return!1===t.getParam("typeahead_urls")},zS=function(t){return t.getParam("anchor_top","#top")},IS=function(t){return t.getParam("anchor_bottom","#bottom")},LS=function(t){var e=t.getParam("file_picker_validator_handler",void 0,"function");return void 0===e?t.getParam("filepicker_validator_handler",void 0,"function"):e},FS="silver.readonly",HS=Le([Sn("readonly")]),VS=function(t,e){var n=t.outerContainer,r=n.element;e&&(t.mothership.broadcastOn([gg()],{target:r}),t.uiMothership.broadcastOn([gg()],{target:r})),t.mothership.broadcastOn([FS],{readonly:e}),t.uiMothership.broadcastOn([FS],{readonly:e})},jS=function(t,e){t.on("init",(function(){t.mode.isReadOnly()&&VS(e,!0)})),t.on("SwitchMode",(function(){return VS(e,t.mode.isReadOnly())})),Qk(t)&&t.setMode("readonly")},US=function(){var t;return $l.config({channels:(t={},t[FS]={schema:HS,onReceive:function(t,e){Yk.set(t,e.readonly)}},t)})},WS=function(t){return Yk.config({disabled:t,disableClass:"tox-collection__item--state-disabled"})},qS=function(t){return Yk.config({disabled:t})},$S=function(t){return Yk.config({disabled:t,disableClass:"tox-tbtn--disabled"})},GS=function(t){return Yk.config({disabled:t,disableClass:"tox-tbtn--disabled",useNative:!1})},KS={item:WS,button:qS,splitButton:$S,toolbarButton:GS},XS=function(t,e){var n=t.getApi(e);return function(t){t(n)}},YS=function(t,e){return Di((function(n){var r=XS(t,n);r((function(n){var r=t.onSetup(n);R(r)&&e.set(r)}))}))},JS=function(t,e){return Mi((function(n){return XS(t,n)(e.get())}))},ZS=function(t,e){return Ri((function(n,r){XS(t,n)(t.onAction),t.triggersSubmenu||e!==cC.CLOSE_ON_EXECUTE||(n.getSystem().isConnected()&&li(n,Go()),r.stop())}))},QS=(vS={},vS[Uo()]=["disabling","alloy.base.behaviour","toggling","item-events"],vS),tO=function(t){return nt(t,(function(t){return t.toArray()}))},eO=function(t,n,r,o){var i=Xn(e);return{type:"item",dom:n.dom,components:tO(n.optComponents),data:t.data,eventOrder:QS,hasSubmenu:t.triggersSubmenu,itemBehaviours:Hl([ky("item-events",[ZS(t,r),YS(t,i),JS(t,i)]),KS.item((function(){return t.disabled||o.isDisabled()})),US(),xy.config({})].concat(t.itemBehaviours))}},nO=function(t){return{value:t.value,meta:m({text:t.text.getOr("")},t.meta)}},rO=tinymce.util.Tools.resolve("tinymce.Env"),oO=function(t){var e={alt:"⌥",ctrl:"⌃",shift:"⇧",meta:"⌘",access:"⌃⌥"},n={meta:"Ctrl",access:"Shift+Alt"},r=rO.mac?e:n,o=t.split("+"),i=q(o,(function(t){var e=t.toLowerCase().trim();return Ht(r,e)?r[e]:t}));return rO.mac?i.join(""):i.join("+")},iO=function(t){return{dom:{tag:"div",classes:[hC],innerHtml:t}}},uO=function(t){return{dom:{tag:"div",classes:[pC]},components:[pc(Mk.translate(t))]}},aO=function(t,e){return{dom:{tag:"div",classes:e,innerHtml:t}}},cO=function(t,e){return{dom:{tag:"div",classes:[pC]},components:[{dom:{tag:t.tag,styles:t.styles},components:[pc(Mk.translate(e))]}]}},sO=function(t){return{dom:{tag:"div",classes:[vC],innerHtml:oO(t)}}},lO=function(t){return{dom:{tag:"div",classes:[yC],innerHtml:tx("checkmark",t)}}},fO=function(t){return{dom:{tag:"div",classes:[bC],innerHtml:tx("chevron-right",t)}}},dO=function(t){return{dom:{tag:"div",classes:[bC],innerHtml:tx("chevron-down",t)}}},mO=function(t,e){var n="vertical"===t.direction?kC:SC,r="left"===t.align?TC:OC,o=function(){switch(t.valign){case"top":return _C;case"middle":return EC;case"bottom":return AC}};return{dom:{tag:"div",classes:[CC,n,r,o()]},components:e}},gO=function(t,e,n){return{dom:{tag:"img",classes:e,attributes:{src:t,alt:n.getOr("")}}}},hO=function(t,e,n,r){var o="custom",i="remove",u=function(){var u=fC,a=n.getOr(""),c=t.map((function(t){return{title:r.translate(t)}})).getOr({}),s={tag:"div",attributes:c,classes:[u]};return m(m({},s),e===o?{tag:"button",classes:h(s.classes,["tox-swatches__picker-btn"]),innerHtml:a}:e===i?{classes:h(s.classes,["tox-swatch--remove"]),innerHtml:a}:{attributes:m(m({},s.attributes),{"data-mce-color":e}),styles:{"background-color":e}})};return{dom:u(),optComponents:[]}},pO=function(t,e){var n=e.map((function(t){return{attributes:{title:Mk.translate(t)}}})).getOr({});return m({tag:"div",classes:[sC,lC].concat(t?[xC]:[])},n)},vO=function(t,e,n,r,o){var i=n?e.or(x.some("")).map(iO):x.none(),u=t.checkMark,a=t.htmlContent.fold((function(){return t.textContent.map(r)}),(function(t){return x.some(aO(t,[pC]))})),c={dom:pO(o,t.ariaLabel),optComponents:[i,a,t.shortcutContent.map(sO),u,t.caret]};return c},bO=["list-num-default","list-num-lower-alpha","list-num-lower-greek","list-num-lower-roman","list-num-upper-alpha","list-num-upper-roman"],yO=["list-bull-circle","list-bull-default","list-bull-square"],wO=function(t,e,n,r){void 0===r&&(r=x.none());var o=function(t){return t.map((function(t){return Mk.isRtl()&&V(bO,t)?t+"-rtl":t}))},i=Mk.isRtl()&&t.iconContent.exists((function(t){return V(yO,t)})),u=o(t.iconContent).map((function(t){return ex(t,e.icons,r)})),c=x.from(t.meta).fold((function(){return uO}),(function(t){return Ht(t,"style")?a(cO,t.style):uO}));return"color"===t.presets?hO(t.ariaLabel,t.value,u,e):vO(t,u,n,c,i)},xO=function(t,e){return Ft(t,"tooltipWorker").map((function(t){return[Ek.config({lazySink:e.getSink,tooltipDom:{tag:"div",classes:["tox-tooltip-worker-container"]},tooltipComponents:[],anchor:function(t){return{anchor:"submenu",item:t,overrides:{maxHeightFunction:Df}}},mode:"follow-highlight",onShow:function(e,n){t((function(t){Ek.setComponents(e,[vc({element:er.fromDom(t)})])}))}})]})).getOr([])},CO=function(t){return Dk.DOM.encode(t)},kO=function(t,e){var n=Mk.translate(t),r=CO(n);if(e.length>0){var o=new RegExp(Ak(e),"gi");return r.replace(o,(function(t){return''+t+""}))}return r},SO=function(t,n,r,o,u,a,c,s){void 0===s&&(s=!0);var l=wO({presets:o,textContent:x.none(),htmlContent:r?t.text.map((function(t){return kO(t,n)})):x.none(),ariaLabel:t.text,iconContent:t.icon,shortcutContent:x.none(),checkMark:x.none(),caret:x.none(),value:t.value},c.providers,s,t.icon);return eO({data:nO(t),disabled:t.disabled,getApi:i({}),onAction:function(e){return u(t.value,t.meta)},onSetup:i(e),triggersSubmenu:!1,itemBehaviours:xO(t.meta,c)},l,a,c.providers)},OO=function(t,e){return q(t,(function(t){switch(t.type){case"cardcontainer":return mO(t,OO(t.items,e));case"cardimage":return gO(t.src,t.classes,t.alt);case"cardtext":var n=t.name.exists((function(t){return V(e.cardText.highlightOn,t)})),r=n?x.from(e.cardText.matchText).getOr(""):"";return aO(kO(t.text,r),t.classes)}}))},TO=function(t,e,n,r){var o=function(t){return{isDisabled:function(){return Yk.isDisabled(t)},setDisabled:function(e){Yk.set(t,e),$(Jd(t.element,"*"),(function(n){t.getSystem().getByDom(n).each((function(t){t.hasConfigured(Yk)&&Yk.set(t,e)}))}))}}},i={dom:pO(!1,t.label),optComponents:[x.some({dom:{tag:"div",classes:[CC,SC]},components:OO(t.items,r)})]};return eO({data:nO(m({text:x.none()},t)),disabled:t.disabled,getApi:o,onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:x.from(r.itemBehaviours).getOr([])},i,e,n.providers)},_O=function(t,n,r,o,i,u,a,c){void 0===c&&(c=!0);var s=function(t){return{setActive:function(e){Jy.set(t,e)},isActive:function(){return Jy.isOn(t)},isDisabled:function(){return Yk.isDisabled(t)},setDisabled:function(e){return Yk.set(t,e)}}},l=wO({presets:r,textContent:n?t.text:x.none(),htmlContent:x.none(),ariaLabel:t.text,iconContent:t.icon,shortcutContent:n?t.shortcut:x.none(),checkMark:n?x.some(lO(a.icons)):x.none(),caret:x.none(),value:t.value},a,c);return Kt(eO({data:nO(t),disabled:t.disabled,getApi:s,onAction:function(e){return o(t.value)},onSetup:function(t){return t.setActive(i),e},triggersSubmenu:!1,itemBehaviours:[]},l,u,a),{toggling:{toggleClass:mC,toggleOnExecute:!1,selected:t.active}})},EO=zh(lw(),fw()),AO=function(t){return{value:t}},DO=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,MO=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,NO=function(t){return DO.test(t)||MO.test(t)},RO=function(t){var e=t.value.replace(DO,(function(t,e,n,r){return e+e+n+n+r+r}));return{value:e}},BO=function(t){var e=RO(t),n=MO.exec(e.value);return null===n?["FFFFFF","FF","FF","FF"]:n},PO=function(t){var e=t.toString(16);return 1===e.length?"0"+e:e},zO=function(t){var e=PO(t.red)+PO(t.green)+PO(t.blue);return AO(e)},IO=Math.min,LO=Math.max,FO=Math.round,HO=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)/,VO=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d?(?:\.\d+)?)\)/,jO=function(t,e,n,r){return{red:t,green:e,blue:n,alpha:r}},UO=function(t){var e=parseInt(t,10);return e.toString()===t&&e>=0&&e<=255},WO=function(t){var e,n,r,o=(t.hue||0)%360,i=t.saturation/100,u=t.value/100;if(i=LO(0,IO(i,1)),u=LO(0,IO(u,1)),0===i)return e=n=r=FO(255*u),jO(e,n,r,1);var a=o/60,c=u*i,s=c*(1-Math.abs(a%2-1)),l=u-c;switch(Math.floor(a)){case 0:e=c,n=s,r=0;break;case 1:e=s,n=c,r=0;break;case 2:e=0,n=c,r=s;break;case 3:e=0,n=s,r=c;break;case 4:e=s,n=0,r=c;break;case 5:e=c,n=0,r=s;break;default:e=n=r=0}return e=FO(255*(e+l)),n=FO(255*(n+l)),r=FO(255*(r+l)),jO(e,n,r,1)},qO=function(t){var e=BO(t),n=parseInt(e[1],16),r=parseInt(e[2],16),o=parseInt(e[3],16);return jO(n,r,o,1)},$O=function(t,e,n,r){var o=parseInt(t,10),i=parseInt(e,10),u=parseInt(n,10),a=parseFloat(r);return jO(o,i,u,a)},GO=function(t){if("transparent"===t)return x.some(jO(0,0,0,0));var e=HO.exec(t);if(null!==e)return x.some($O(e[1],e[2],e[3],"1"));var n=VO.exec(t);return null!==n?x.some($O(n[1],n[2],n[3],n[4])):x.none()},KO=function(t){return"rgba("+t.red+","+t.green+","+t.blue+","+t.alpha+")"},XO=jO(255,0,0,1),YO=function(t){return t.fire("SkinLoaded")},JO=function(t,e){return t.fire("SkinLoadError",e)},ZO=function(t){return t.fire("ResizeEditor")},QO=function(t,e){return t.fire("ResizeContent",e)},tT=function(t,e){return t.fire("ScrollContent",e)},eT=function(t,e){return t.fire("TextColorChange",e)},nT=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),rT="tinymce-custom-colors";function oT(t){void 0===t&&(t=10);var e=nT.getItem(rT),n=T(e)?JSON.parse(e):[],r=function(e){var n=t-e.length;return n<0?e.slice(0,t):e},o=r(n),i=function(e){H(o,e).each(u),o.unshift(e),o.length>t&&o.pop(),nT.setItem(rT,JSON.stringify(o))},u=function(t){o.splice(t,1)},a=function(){return o.slice(0)};return{add:i,state:a}}var iT,uT="choiceitem",aT=[{type:uT,text:"Light Green",value:"#BFEDD2"},{type:uT,text:"Light Yellow",value:"#FBEEB8"},{type:uT,text:"Light Red",value:"#F8CAC6"},{type:uT,text:"Light Purple",value:"#ECCAFA"},{type:uT,text:"Light Blue",value:"#C2E0F4"},{type:uT,text:"Green",value:"#2DC26B"},{type:uT,text:"Yellow",value:"#F1C40F"},{type:uT,text:"Red",value:"#E03E2D"},{type:uT,text:"Purple",value:"#B96AD9"},{type:uT,text:"Blue",value:"#3598DB"},{type:uT,text:"Dark Turquoise",value:"#169179"},{type:uT,text:"Orange",value:"#E67E23"},{type:uT,text:"Dark Red",value:"#BA372A"},{type:uT,text:"Dark Purple",value:"#843FA1"},{type:uT,text:"Dark Blue",value:"#236FA1"},{type:uT,text:"Light Gray",value:"#ECF0F1"},{type:uT,text:"Medium Gray",value:"#CED4D9"},{type:uT,text:"Gray",value:"#95A5A6"},{type:uT,text:"Dark Gray",value:"#7E8C8D"},{type:uT,text:"Navy Blue",value:"#34495E"},{type:uT,text:"Black",value:"#000000"},{type:uT,text:"White",value:"#ffffff"}],cT=oT(10),sT=function(t){var e=[],n=document.createElement("canvas");n.height=1,n.width=1;for(var r=n.getContext("2d"),o=function(t,e){var n=255,r=e/255,o=Math.round(t*r+n*(1-r));return("0"+o.toString(16)).slice(-2).toUpperCase()},i=function(t){if(/^[0-9A-Fa-f]{6}$/.test(t))return"#"+t.toUpperCase();r.clearRect(0,0,n.width,n.height),r.fillStyle="#FFFFFF",r.fillStyle=t,r.fillRect(0,0,1,1);var e=r.getImageData(0,0,1,1).data,i=e[0],u=e[1],a=e[2],c=e[3];return"#"+o(i,c)+o(u,c)+o(a,c)},u=0;u0?d(n,r,e,o):r.text.length-n.matchLength>=10?c():a()}}))}))}))},h=sx((function(t){27!==t.which&&g()}),50),p={onKeypress:h,cancelIfNecessary:c,isMenuOpen:i,isActive:u,isProcessingAction:r.get,getView:function(){return Iw.getContent(o)}};!1===t.hasPlugin("rtc")&&Sx.setup(p,t)},l_={register:s_},f_=f,d_=function(t,e,n){return Vc(t,e,f_,n)},m_=function(t,e,n){return jc(t,e,f_,n)},g_=Lc,h_=function(t,e,n){return hs(t,e,n).isSome()},p_=function(t,e){var n=null,r=function(){for(var r=[],o=0;ov_||r>v_},x_=function(t){var e=Xn(x.none()),n=Xn(!1),r=p_((function(e){t.triggerEvent($o(),e),n.set(!0)}),b_),o=function(t){return y_(t).each((function(o){r.cancel();var i={x:o.clientX,y:o.clientY,target:t.target};r.schedule(t),n.set(!1),e.set(x.some(i))})),x.none()},i=function(t){return r.cancel(),y_(t).each((function(t){e.get().each((function(n){w_(t,n)&&e.set(x.none())}))})),x.none()},u=function(o){r.cancel();var i=function(t){return oo(t.target,o.target)};return e.get().filter(i).map((function(e){return n.get()?(o.prevent(),!1):t.triggerEvent(qo(),o)}))},a=le([{key:yo(),value:o},{key:wo(),value:i},{key:xo(),value:u}]),c=function(t,e){return Ft(a,e).bind((function(e){return e(t)}))};return{fireIfReady:c}},C_=function(t){var e=t.raw;return e.which===Hp[0]&&!V(["input","textarea"],Bi(t.target))&&!h_(t.target,'[contenteditable="true"]')},k_=function(){return Gr().browser.isFirefox()},S_=Ie([On("triggerEvent"),Ln("stopBackspace",!0)]),O_=function(t,e){return k_()?m_(t,"focus",e):d_(t,"focusin",e)},T_=function(t,e){return k_()?m_(t,"blur",e):d_(t,"focusout",e)},__=function(t,e){var n=on("Getting GUI events settings",S_,e),r=["touchstart","touchmove","touchend","touchcancel","gesturestart","mousedown","mouseup","mouseover","mousemove","mouseout","click"],o=x_(n),i=q(r.concat(["selectstart","input","contextmenu","change","transitionend","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","keyup"]),(function(e){return d_(t,e,(function(t){o.fireIfReady(t,e).each((function(e){e&&t.kill()}));var r=n.triggerEvent(e,t);r&&t.kill()}))})),u=Xn(x.none()),a=d_(t,"paste",(function(t){o.fireIfReady(t,"paste").each((function(e){e&&t.kill()}));var e=n.triggerEvent("paste",t);e&&t.kill(),u.set(x.some(setTimeout((function(){n.triggerEvent(Vo(),t)}),0)))})),c=d_(t,"keydown",(function(t){var e=n.triggerEvent("keydown",t);e?t.kill():!0===n.stopBackspace&&C_(t)&&t.prevent()})),s=O_(t,(function(t){var e=n.triggerEvent("focusin",t);e&&t.kill()})),l=Xn(x.none()),f=T_(t,(function(t){var e=n.triggerEvent("focusout",t);e&&t.kill(),l.set(x.some(setTimeout((function(){n.triggerEvent(Ho(),t)}),0)))})),d=function(){$(i,(function(t){t.unbind()})),c.unbind(),s.unbind(),f.unbind(),a.unbind(),u.get().each(clearTimeout),l.get().each(clearTimeout)};return{unbind:d}},E_=function(t,e){var n=Ft(t,"target").getOr(e);return Xn(n)},A_=function(t,e){var n=Xn(!1),r=Xn(!1),o=function(){n.set(!0)},i=function(){r.set(!0)};return{stop:o,cut:i,isStopped:n.get,isCut:r.get,event:t,setSource:e.set,getSource:e.get}},D_=function(t){var n=Xn(!1),r=function(){n.set(!0)};return{stop:r,cut:e,isStopped:n.get,isCut:l,event:t,setSource:s("Cannot set source of a broadcasted event"),getSource:s("Cannot get source of a broadcasted event")}},M_=Ut.generate([{stopped:[]},{resume:["element"]},{complete:[]}]),N_=function(t,e,n,r,o,i){var u=t(e,r),a=A_(n,o);return u.fold((function(){return i.logEventNoHandlers(e,r),M_.complete()}),(function(t){var n=t.descHandler,r=pa(n);return r(a),a.isStopped()?(i.logEventStopped(e,t.element,n.purpose),M_.stopped()):a.isCut()?(i.logEventCut(e,t.element,n.purpose),M_.complete()):qi(t.element).fold((function(){return i.logNoParent(e,t.element,n.purpose),M_.complete()}),(function(r){return i.logEventResponse(e,t.element,n.purpose),M_.resume(r)}))}))},R_=function(t,e,n,r,o,i){return N_(t,e,n,r,o,i).fold(f,(function(r){return R_(t,e,n,r,o,i)}),l)},B_=function(t,e,n,r,o){var i=E_(n,r);return N_(t,e,n,r,i,o)},P_=function(t,e,n){var r=D_(e);return $(t,(function(t){var e=t.descHandler,n=pa(e);n(r)})),r.isStopped()},z_=function(t,e,n,r){return I_(t,e,n,n.target,r)},I_=function(t,e,n,r,o){var i=E_(n,r);return R_(t,e,n,r,i,o)},L_=function(t,e){return{element:t,descHandler:e}},F_=function(t,e){return{id:t,descHandler:e}},H_=function(){var t={},e=function(e,n,r){Dt(r,(function(r,o){var i=void 0!==t[o]?t[o]:{};i[n]=ha(r,e),t[o]=i}))},n=function(t,e){return Wu(e).fold((function(){return x.none()}),(function(n){return t.bind((function(t){return Ft(t,n)})).map((function(t){return L_(e,t)}))}))},r=function(e){return Ft(t,e).map((function(t){return zt(t,(function(t,e){return F_(e,t)}))})).getOr([])},o=function(e,r,o){var i=Ft(t,r);return lo(o,(function(t){return n(i,t)}),e)},i=function(e){Dt(t,(function(t,n){t.hasOwnProperty(e)&&delete t[e]}))};return{registerId:e,unregisterId:i,filterByType:r,find:o}},V_=function(){var t=H_(),e={},n=function(t){var e=t.element;return Wu(e).fold((function(){return ju("uid-",t.element)}),(function(t){return t}))},r=function(t,n){var r=e[n];if(r!==t)throw new Error('The tagId "'+n+'" is already used by: '+Nu(r.element)+"\nCannot use it for: "+Nu(t.element)+"\nThe conflicting element is"+(Wa(r.element)?" ":" not ")+"already in the DOM");i(t)},o=function(o){var i=n(o);Vt(e,i)&&r(o,i);var u=[o];t.registerId(u,i,o.events),e[i]=o},i=function(n){Wu(n.element).each((function(n){delete e[n],t.unregisterId(n)}))},u=function(e){return t.filterByType(e)},a=function(e,n,r){return t.find(e,n,r)},c=function(t){return Ft(e,t)};return{find:a,filter:u,register:o,unregister:i,getById:c}},j_=function(t){var e=t.dom,n=e.attributes,r=g(e,["attributes"]);return{uid:t.uid,dom:m({tag:"div",attributes:m({role:"presentation"},n)},r),components:t.components,behaviours:Jg(t.containerBehaviours),events:t.events,domModification:t.domModification,eventOrder:t.eventOrder}},U_=ap({name:"Container",factory:j_,configFields:[Ln("components",[]),Yg("containerBehaviours",[]),Ln("events",{}),Ln("domModification",{}),Ln("eventOrder",{})]}),W_=function(t){var n=function(e){return qi(t.element).fold(f,(function(t){return oo(e,t)}))},r=V_(),o=function(t,e){return r.find(n,t,e)},u=__(t.element,{triggerEvent:function(t,e){return Es(t,e.target,(function(n){return z_(o,t,e,n)}))}}),a={debugInfo:i("real"),triggerEvent:function(t,e,n){Es(t,e,(function(r){return I_(o,t,n,e,r)}))},triggerFocus:function(t,n){Wu(t).fold((function(){Yl(t)}),(function(r){Es(Fo(),t,(function(r){return B_(o,Fo(),{originator:n,kill:e,prevent:e,target:t},t,r),!1}))}))},triggerEscape:function(t,e){a.triggerEvent("keydown",t.element,e.event)},getByUid:function(t){return b(t)},getByDom:function(t){return y(t)},build:yc,addToGui:function(t){l(t)},removeFromGui:function(t){d(t)},addToWorld:function(t){c(t)},removeFromWorld:function(t){s(t)},broadcast:function(t){h(t)},broadcastOn:function(t,e){p(t,e)},broadcastEvent:function(t,e){v(t,e)},isConnected:f},c=function(t){t.connect(a),Li(t.element)||(r.register(t),$(t.components(),c),a.triggerEvent(Xo(),t.element,{target:t.element}))},s=function(t){Li(t.element)||($(t.components(),s),r.unregister(t)),t.disconnect()},l=function(e){Fm(t,e)},d=function(t){jm(t)},m=function(){u.unbind(),pu(t.element)},g=function(t){var e=r.filter(jo());$(e,(function(e){var n=e.descHandler,r=pa(n);r(t)}))},h=function(t){g({universal:!0,data:t})},p=function(t,e){g({universal:!1,channels:t,data:e})},v=function(t,e){var n=r.filter(t);return P_(n,e)},b=function(t){return r.getById(t).fold((function(){return pt.error(new Error('Could not find component with uid: "'+t+'" in system.'))}),pt.value)},y=function(t){var e=Wu(t).getOr("not found");return b(e)};return c(t),{root:t,element:t.element,destroy:m,add:l,remove:d,getByUid:b,getByDom:y,addToWorld:c,removeFromWorld:s,broadcast:h,broadcastOn:p,broadcastEvent:v}},q_=function(t,e){return{dom:{tag:"div",classes:["tox-bar","tox-form__controls-h-stack"]},components:q(t.items,e.interpreter)}},$_=i([Ln("prefix","form-field"),Yg("fieldBehaviours",[yp,Xg])]),G_=i([Dh({schema:[yn("dom")],name:"label"}),Dh({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:t.text}}}},schema:[yn("text")],name:"aria-descriptor"}),Eh({factory:{sketch:function(t){var e=ce(t,["factory"]);return t.factory.sketch(e)}},schema:[yn("factory")],name:"field"})]),K_=function(t,e,n,r){var o=Zg(t.fieldBehaviours,[yp.config({find:function(e){return Uh(e,t,"field")}}),Xg.config({store:{mode:"manual",getValue:function(t){return yp.getCurrent(t).bind(Xg.getValue)},setValue:function(t,e){yp.getCurrent(t).each((function(t){Xg.setValue(t,e)}))}}})]),i=pi([Di((function(e,n){var r=qh(e,t,["label","field","aria-descriptor"]);r.field().each((function(e){var n=Iu(t.prefix);r.label().each((function(t){ku(t.element,"for",n),ku(e.element,"id",n)})),r["aria-descriptor"]().each((function(n){var r=Iu(t.prefix);ku(n.element,"id",r),ku(e.element,"aria-describedby",r)}))}))}))]),u={getField:function(e){return Uh(e,t,"field")},getLabel:function(e){return Uh(e,t,"label")}};return{uid:t.uid,dom:t.dom,components:e,behaviours:o,events:i,apis:u}},X_=cp({name:"FormField",configFields:$_(),partFields:G_(),factory:K_,apis:{getField:function(t,e){return t.getField(e)},getLabel:function(t,e){return t.getLabel(e)}}}),Y_=function(t,e){return sa({attributes:le([{key:e.tabAttr,value:"true"}])})},J_=Object.freeze({__proto__:null,exhibit:Y_}),Z_=[Ln("tabAttr","data-alloy-tabstop")],Q_=jl({fields:Z_,name:"tabstopping",active:J_}),tE=tinymce.util.Tools.resolve("tinymce.html.Entities"),eE=function(t,e,n,r){var o=rE(t,e,n,r);return X_.sketch(o)},nE=function(t,e){return eE(t,e,[],[])},rE=function(t,e,n,r){return{dom:iE(n),components:t.toArray().concat([e]),fieldBehaviours:Hl(r)}},oE=function(){return iE([])},iE=function(t){return{tag:"div",classes:["tox-form__group"].concat(t)}},uE=function(t,e){return X_.parts.label({dom:{tag:"label",classes:["tox-label"],innerHtml:e.translate(t)}})},aE=Iu("form-component-change"),cE=Iu("form-close"),sE=Iu("form-cancel"),lE=Iu("form-action"),fE=Iu("form-submit"),dE=Iu("form-block"),mE=Iu("form-unblock"),gE=Iu("form-tabchange"),hE=Iu("form-resize"),pE=function(t,e){var n,r=t.label.map((function(t){return uE(t,e)})),o=function(t){return function(e,n){hs(n.event.target,"[data-collection-item-value]").each((function(r){t(e,n,r,Ou(r,"data-collection-item-value"))}))}},i=function(n,r){var o=q(r,(function(n){var r=Mk.translate(n.text),o=1===t.columns?'
'+r+"
":"",i='
'+n.icon+"
",u={_:" "," - ":" ","-":" "},a=r.replace(/\_| \- |\-/g,(function(t){return u[t]})),c=e.isDisabled()?" tox-collection__item--state-disabled":"";return'
'+i+o+"
"})),i="auto"!==t.columns&&t.columns>1?W(o,t.columns):[o],u=q(i,(function(t){return'
'+t.join("")+"
"}));wu(n.element,u.join(""))},a=o((function(n,r,o,i){r.stop(),e.isDisabled()||fi(n,lE,{name:t.name,value:i})})),c=[wi(_o(),o((function(t,e,n){Yl(n)}))),wi(Bo(),a),wi(qo(),a),wi(Eo(),o((function(t,e,n){gs(t.element,"."+wC).each((function(t){Fa(t,wC)})),Ia(n,wC)}))),wi(Ao(),o((function(t){gs(t.element,"."+wC).each((function(t){Fa(t,wC)}))}))),Ri(o((function(e,n,r,o){fi(e,lE,{name:t.name,value:o})})))],s=function(t,e){return q(Jd(t.element,".tox-collection__item"),e)},l=X_.parts.field({dom:{tag:"div",classes:["tox-collection"].concat(1!==t.columns?["tox-collection--grid"]:["tox-collection--list"])},components:[],factory:{sketch:u},behaviours:Hl([Yk.config({disabled:e.isDisabled,onDisabled:function(t){s(t,(function(t){Ia(t,"tox-collection__item--state-disabled"),ku(t,"aria-disabled",!0)}))},onEnabled:function(t){s(t,(function(t){Fa(t,"tox-collection__item--state-disabled"),Eu(t,"aria-disabled")}))}}),US(),xy.config({}),Xg.config({store:{mode:"memory",initialValue:[]},onSetValue:function(e,n){i(e,n),"auto"===t.columns&&mk(e,5,"tox-collection__item").each((function(t){var n=t.numRows,r=t.numColumns;fy.setGridSize(e,n,r)})),li(e,hE)}}),Q_.config({}),fy.config(BT(t.columns,"normal")),ky("collection-events",c)]),eventOrder:(n={},n[Uo()]=["disabling","alloy.base.behaviour","collection-events"],n)}),f=["tox-form__group--collection"];return eE(r,l,f,[])},vE=i([Dn("data"),Ln("inputAttributes",{}),Ln("inputStyles",{}),Ln("tag","input"),Ln("inputClasses",[]),Ls("onSetValue"),Ln("styles",{}),Ln("eventOrder",{}),Yg("inputBehaviours",[Xg,Ny]),Ln("selectOnFocus",!0)]),bE=function(t){return Hl([Ny.config({onFocus:t.selectOnFocus?function(t){var e=t.element,n=ic(e);e.dom.setSelectionRange(0,n.length)}:e})])},yE=function(t){return m(m({},bE(t)),Zg(t.inputBehaviours,[Xg.config({store:m(m({mode:"manual"},t.data.map((function(t){return{initialValue:t}})).getOr({})),{getValue:function(t){return ic(t.element)},setValue:function(t,e){var n=ic(t.element);n!==e&&uc(t.element,e)}}),onSetValue:t.onSetValue})]))},wE=function(t){return{tag:t.tag,attributes:m({type:"text"},t.inputAttributes),styles:t.inputStyles,classes:t.inputClasses}},xE=function(t,e){return{uid:t.uid,dom:wE(t),components:[],behaviours:yE(t),eventOrder:t.eventOrder}},CE=ap({name:"Input",configFields:vE(),factory:xE}),kE={},SE={exports:kE};(function(e,n,r,o){(function(o){if("object"===typeof n&&"undefined"!==typeof r)r.exports=o();else if("function"===typeof e&&e.amd)e([],o);else{var i;i="undefined"!==typeof window?window:"undefined"!==typeof t?t:"undefined"!==typeof self?self:this,i.EphoxContactWrapper=o()}})((function(){return function(){function t(e,n,r){function i(a,c){if(!n[a]){if(!e[a]){var s="function"==typeof o&&o;if(!c&&s)return s(a,!0);if(u)return u(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var f=n[a]={exports:{}};e[a][0].call(f.exports,(function(t){var n=e[a][1][t];return i(n||t)}),f,f.exports,t,e,n,r)}return n[a].exports}for(var u="function"==typeof o&&o,a=0;a1)for(var n=1;n=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},n.setImmediate="function"===typeof e?e:function(t){var e=c++,r=!(arguments.length<2)&&u.call(arguments,1);return a[e]=!0,o((function(){a[e]&&(r?t.apply(null,r):t.call(null),n.clearImmediate(e))})),e},n.clearImmediate="function"===typeof r?r:function(t){delete a[t]}}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":1,timers:3}],4:[function(t,e,n){var r=t("promise-polyfill"),o=function(){return"undefined"!==typeof window?window:Function("return this;")()}();e.exports={boltExport:o.Promise||r}},{"promise-polyfill":2}]},{},[4])(4)}))})(void 0,kE,SE,void 0);var OE,TE=SE.exports.boltExport,_E=function(t){var e=x.none(),n=[],r=function(t){return _E((function(e){o((function(n){e(t(n))}))}))},o=function(t){u()?c(t):n.push(t)},i=function(t){u()||(e=x.some(t),a(n),n=[])},u=function(){return e.isSome()},a=function(t){$(t,c)},c=function(t){e.each((function(e){setTimeout((function(){t(e)}),0)}))};return t(i),{get:o,map:r,isReady:u}},EE=function(t){return _E((function(e){e(t)}))},AE={nu:_E,pure:EE},DE=function(t){setTimeout((function(){throw t}),0)},ME=function(t){var e=function(e){t().then(e,DE)},n=function(e){return ME((function(){return t().then(e)}))},r=function(e){return ME((function(){return t().then((function(t){return e(t).toPromise()}))}))},o=function(e){return ME((function(){return t().then((function(){return e.toPromise()}))}))},i=function(){return AE.nu(e)},u=function(){var e=null;return ME((function(){return null===e&&(e=t()),e}))},a=t;return{map:n,bind:r,anonBind:o,toLazy:i,toCached:u,toPromise:a,get:e}},NE=function(t){return ME((function(){return new TE(t)}))},RE=function(t){return ME((function(){return TE.resolve(t)}))},BE={nu:NE,pure:RE},PE=["input","textarea"],zE=function(t){var e=Bi(t);return V(PE,e)},IE=function(t,e){var n=e.getRoot(t).getOr(t.element);Fa(n,e.invalidClass),e.notify.each((function(e){zE(t.element)&&ku(t.element,"aria-invalid",!1),e.getContainer(t).each((function(t){wu(t,e.validHtml)})),e.onValid(t)}))},LE=function(t,e,n,r){var o=e.getRoot(t).getOr(t.element);Ia(o,e.invalidClass),e.notify.each((function(e){zE(t.element)&&ku(t.element,"aria-invalid",!0),e.getContainer(t).each((function(t){wu(t,r)})),e.onInvalid(t,r)}))},FE=function(t,e,n){return e.validator.fold((function(){return BE.pure(pt.value(!0))}),(function(e){return e.validate(t)}))},HE=function(t,e,n){return e.notify.each((function(e){e.onValidate(t)})),FE(t,e).map((function(r){return t.getSystem().isConnected()?r.fold((function(r){return LE(t,e,n,r),pt.error(r)}),(function(n){return IE(t,e),pt.value(n)})):pt.error("No longer in system")}))},VE=function(t,e){var n=e.getRoot(t).getOr(t.element);return Ha(n,e.invalidClass)},jE=Object.freeze({__proto__:null,markValid:IE,markInvalid:LE,query:FE,run:HE,isInvalid:VE}),UE=function(t,n){return t.validator.map((function(r){return pi([wi(r.onEvent,(function(e){HE(e,t,n).get(u)}))].concat(r.validateOnLoad?[Di((function(r){HE(r,t,n).get(e)}))]:[]))})).getOr({})},WE=Object.freeze({__proto__:null,events:UE}),qE=[yn("invalidClass"),Ln("getRoot",x.none),zn("notify",[Ln("aria","alert"),Ln("getContainer",x.none),Ln("validHtml",""),Ls("onValid"),Ls("onInvalid"),Ls("onValidate")]),zn("validator",[yn("validate"),Ln("onEvent","input"),Ln("validateOnLoad",!0)])],$E=jl({fields:qE,name:"invalidating",active:WE,apis:jE,extra:{validation:function(t){return function(e){var n=Xg.getValue(e);return BE.pure(t(n))}}}}),GE=function(t,e,n,r){return n.getOrCreate(t,e,r)},KE=Object.freeze({__proto__:null,getCoupled:GE}),XE=[wn("others",tn(pt.value,ln()))],YE=function(){var t={},e=function(e,n,r){var o=Et(n.others);if(o)return Ft(t,r).getOrThunk((function(){var o=Ft(n.others,r).getOrDie("No information found for coupled component: "+r),i=o(e),u=e.getSystem().build(i);return t[r]=u,u}));throw new Error("Cannot find coupled component: "+r+". Known coupled components: "+JSON.stringify(o,null,2))},n=i({});return oa({readState:n,getOrCreate:e})},JE=Object.freeze({__proto__:null,init:YE}),ZE=jl({fields:XE,name:"coupling",apis:KE,state:JE}),QE=i("sink"),tA=i(Dh({name:QE(),overrides:i({dom:{tag:"div"},behaviours:Hl([Rm.config({useFixed:f})]),events:pi([_i(Do()),_i(ko()),_i(Bo())])})}));(function(t){t[t["HighlightFirst"]=0]="HighlightFirst",t[t["HighlightNone"]=1]="HighlightNone"})(OE||(OE={}));var eA,nA=function(t,e){var n=t.getHotspot(e).getOr(e),r="hotspot",o=t.getAnchorOverrides();return t.layouts.fold((function(){return{anchor:r,hotspot:n,overrides:o}}),(function(t){return{anchor:r,hotspot:n,overrides:o,layouts:t}}))},rA=function(t,e,n){var r=t.fetch;return r(n).map(e)},oA=function(t,e,n,r,o,i,u){var a=rA(t,e,r),c=sA(r,t);return a.map((function(t){return t.bind((function(t){return x.from(Bw.sketch(m(m({},i.menu()),{uid:qu(""),data:t,highlightImmediately:u===OE.HighlightFirst,onOpenMenu:function(t,e){var r=c().getOrDie();Rm.position(r,n,e),mg.decloak(o)},onOpenSubmenu:function(t,e,n){var r=c().getOrDie();Rm.position(r,{anchor:"submenu",item:e},n),mg.decloak(o)},onRepositionMenu:function(t,e,r){var o=c().getOrDie();Rm.position(o,n,e),$(r,(function(t){Rm.position(o,{anchor:"submenu",item:t.triggeringItem},t.triggeredMenu)}))},onEscape:function(){return Ny.focus(r),mg.close(o),x.some(!0)}})))}))}))},iA=function(t,e,n,r,o,i,u){var a=nA(t,n),c=oA(t,e,a,n,r,o,u);return c.map((function(t){return t.fold((function(){mg.isOpen(r)&&mg.close(r)}),(function(t){mg.cloak(r),mg.open(r,t),i(r)})),r}))},uA=function(t,e,n,r,o,i,u){return mg.close(r),BE.pure(r)},aA=function(t,e,n,r,o,i){var u=ZE.getCoupled(n,"sandbox"),a=mg.isOpen(u),c=a?uA:iA;return c(t,e,n,u,r,o,i)},cA=function(t,e,n){var r=yp.getCurrent(e).getOr(e),o=Bc(t.element);n?Xa(r.element,"min-width",o+"px"):Rc(r.element,o)},sA=function(t,e){return t.getSystem().getByUid(e.uid+"-"+QE()).map((function(t){return function(){return pt.value(t)}})).getOrThunk((function(){return e.lazySink.fold((function(){return function(){return pt.error(new Error("No internal sink is specified, nor could an external sink be found"))}}),(function(e){return function(){return e(t)}}))}))},lA=function(t){mg.getState(t).each((function(t){Bw.repositionMenus(t)}))},fA=function(t,e,n){var r=vs(),o=function(o,i){var u=nA(t,e);r.link(e.element),t.matchWidth&&cA(u.hotspot,i,t.useMinWidth),t.onOpen(u,o,i),void 0!==n&&void 0!==n.onOpen&&n.onOpen(o,i)},i=function(t,o){r.unlink(e.element),void 0!==n&&void 0!==n.onClose&&n.onClose(t,o)},u=sA(e,t);return{dom:{tag:"div",classes:t.sandboxClasses,attributes:{id:r.id,role:"listbox"}},behaviours:Qg.augment(t.sandboxBehaviours,[Xg.config({store:{mode:"memory",initialValue:e}}),mg.config({onOpen:o,onClose:i,isPartOf:function(t,n,r){return ys(n,r)||ys(e,r)},getAttachPoint:function(){return u().getOrDie()}}),yp.config({find:function(t){return mg.getState(t).bind((function(t){return yp.getCurrent(t)}))}}),$l.config({channels:m(m({},bg({isExtraPart:l})),wg({doReposition:lA}))})])}},dA=function(t){var e=ZE.getCoupled(t,"sandbox");lA(e)},mA=function(){return[Ln("sandboxClasses",[]),Qg.field("sandboxBehaviours",[yp,$l,mg,Xg])]},gA=i([yn("dom"),yn("fetch"),Ls("onOpen"),Fs("onExecute"),Ln("getHotspot",x.some),Ln("getAnchorOverrides",i({})),Uf(),Yg("dropdownBehaviours",[Jy,ZE,fy,Ny]),yn("toggleClass"),Ln("eventOrder",{}),Dn("lazySink"),Ln("matchWidth",!1),Ln("useMinWidth",!1),Dn("role")].concat(mA())),hA=i([Ah({schema:[Ps()],name:"menu",defaults:function(t){return{onExecute:t.onExecute}}}),tA()]),pA=function(t,n,r,o){var i,u=function(e){return Ft(t.dom,"attributes").bind((function(t){return Ft(t,e)}))},a=function(t){mg.getState(t).each((function(t){Bw.highlightPrimary(t)}))},c=function(n){var r=a;aA(t,(function(t){return t}),n,o,r,OE.HighlightFirst).get(e)},s={expand:function(n){Jy.isOn(n)||aA(t,(function(t){return t}),n,o,e,OE.HighlightNone).get(e)},open:function(n){Jy.isOn(n)||aA(t,(function(t){return t}),n,o,e,OE.HighlightFirst).get(e)},isOpen:Jy.isOn,close:function(n){Jy.isOn(n)&&aA(t,(function(t){return t}),n,o,e,OE.HighlightFirst).get(e)},repositionMenus:function(t){Jy.isOn(t)&&dA(t)}},l=function(t,e){return di(t),x.some(!0)};return{uid:t.uid,dom:t.dom,components:n,behaviours:Zg(t.dropdownBehaviours,[Jy.config({toggleClass:t.toggleClass,aria:{mode:"expanded"}}),ZE.config({others:{sandbox:function(e){return fA(t,e,{onOpen:function(){return Jy.on(e)},onClose:function(){return Jy.off(e)}})}}}),fy.config({mode:"special",onSpace:l,onEnter:l,onDown:function(t,e){if(vA.isOpen(t)){var n=ZE.getCoupled(t,"sandbox");a(n)}else vA.open(t);return x.some(!0)},onEscape:function(t,e){return vA.isOpen(t)?(vA.close(t),x.some(!0)):x.none()}}),Ny.config({})]),events:Qy(x.some(c)),eventOrder:m(m({},t.eventOrder),(i={},i[Uo()]=["disabling","toggling","alloy.base.behaviour"],i)),apis:s,domModification:{attributes:m(m({"aria-haspopup":"true"},t.role.fold((function(){return{}}),(function(t){return{role:t}}))),"button"===t.dom.tag?{type:u("type").getOr("button")}:{})}}},vA=cp({name:"Dropdown",configFields:gA(),partFields:hA(),factory:pA,apis:{open:function(t,e){return t.open(e)},expand:function(t,e){return t.expand(e)},close:function(t,e){return t.close(e)},isOpen:function(t,e){return t.isOpen(e)},repositionMenus:function(t,e){return t.repositionMenus(e)}}}),bA=function(){return sa({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})},yA=function(){return pi([vi(zo(),f)])},wA=Object.freeze({__proto__:null,events:yA,exhibit:bA}),xA=jl({fields:[],name:"unselecting",active:wA}),CA=function(t,e){return vA.sketch({dom:t.dom,components:t.components,toggleClass:"mce-active",dropdownBehaviours:Hl([KS.button(e.providers.isDisabled),US(),xA.config({}),Q_.config({})]),layouts:t.layouts,sandboxClasses:["tox-dialog__popups"],lazySink:e.getSink,fetch:function(n){return BE.nu((function(e){return t.fetch(e)})).map((function(r){return x.from(a_(Kt(MT(Iu("menu-value"),r,(function(e){t.onItemAction(n,e)}),t.columns,t.presets,cC.CLOSE_ON_EXECUTE,l,e.providers),{movement:RT(t.columns,t.presets)})))}))},parts:{menu:zC(!1,1,t.presets)}})},kA=Iu("color-input-change"),SA=Iu("color-swatch-change"),OA=Iu("color-picker-cancel"),TA=function(t,n,r){var o=X_.parts.field({factory:CE,inputClasses:["tox-textfield"],onSetValue:function(t){return $E.run(t).get(e)},inputBehaviours:Hl([Yk.config({disabled:n.providers.isDisabled}),US(),Q_.config({}),$E.config({invalidClass:"tox-textbox-field-invalid",getRoot:function(t){return qi(t.element)},notify:{onValid:function(t){var e=Xg.getValue(t);fi(t,kA,{color:e})}},validator:{validateOnLoad:!1,validate:function(t){var e=Xg.getValue(t);if(0===e.length)return BE.pure(pt.value(!0));var n=er.fromTag("span");Xa(n,"background-color",e);var r=tc(n,"background-color").fold((function(){return pt.error("blah")}),(function(t){return pt.value(e)}));return BE.pure(r)}}})]),selectOnFocus:!1}),i=t.label.map((function(t){return uE(t,n.providers)})),u=function(t,e){fi(t,SA,{value:e})},a=function(t,e){c.getOpt(t).each((function(t){"custom"===e?r.colorPicker((function(e){e.fold((function(){return li(t,OA)}),(function(e){u(t,e),hT(e)}))}),"#ffffff"):u(t,"remove"===e?"":e)}))},c=Zw(CA({dom:{tag:"span",attributes:{"aria-label":n.providers.translate("Color swatch")}},layouts:{onRtl:function(){return[pl,hl,wl]},onLtr:function(){return[hl,pl,wl]}},components:[],fetch:OT(r.getColors(),r.hasCustomColors()),columns:r.getColorCols(),presets:"color",onItemAction:a},n));return X_.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:i.toArray().concat([{dom:{tag:"div",classes:["tox-color-input"]},components:[o,c.asSpec()]}]),fieldBehaviours:Hl([ky("form-field-events",[wi(kA,(function(e,n){c.getOpt(e).each((function(t){Xa(t.element,"background-color",n.event.color)})),fi(e,aE,{name:t.name})})),wi(SA,(function(t,e){X_.getField(t).each((function(n){Xg.setValue(n,e.event.value),yp.getCurrent(t).each(Ny.focus)}))})),wi(OA,(function(t,e){X_.getField(t).each((function(e){yp.getCurrent(t).each(Ny.focus)}))}))])])})},_A=function(t,e,n){return{hue:t,saturation:e,value:n}},EA=function(t){var e=0,n=0,r=0,o=t.red/255,i=t.green/255,u=t.blue/255,a=Math.min(o,Math.min(i,u)),c=Math.max(o,Math.max(i,u));if(a===c)return r=a,_A(0,0,100*r);var s=o===a?i-u:u===a?o-i:u-o;return e=o===a?3:u===a?1:5,e=60*(e-s/(c-a)),n=(c-a)/c,r=c,_A(Math.round(e),Math.round(100*n),Math.round(100*r))},AA=function(t){var e=(100-t)/100*360,n=_A(e,100,100),r=WO(n);return zO(r)},DA=Iu("rgb-hex-update"),MA=Iu("slider-update"),NA=Iu("palette-update"),RA=Dh({schema:[yn("dom")],name:"label"}),BA=function(t){return Dh({name:t+"-edge",overrides:function(e){var n=e.model.manager.edgeActions[t];return n.fold((function(){return{}}),(function(t){return{events:pi([xi(yo(),(function(e,n,r){return t(e,r)}),[e]),xi(ko(),(function(e,n,r){return t(e,r)}),[e]),xi(So(),(function(e,n,r){r.mouseIsDown.get()&&t(e,r)}),[e])])}}))}})},PA=BA("top-left"),zA=BA("top"),IA=BA("top-right"),LA=BA("right"),FA=BA("bottom-right"),HA=BA("bottom"),VA=BA("bottom-left"),jA=BA("left"),UA=Eh({name:"thumb",defaults:i({dom:{styles:{position:"absolute"}}}),overrides:function(t){return{events:pi([Oi(yo(),t,"spectrum"),Oi(wo(),t,"spectrum"),Oi(xo(),t,"spectrum"),Oi(ko(),t,"spectrum"),Oi(So(),t,"spectrum"),Oi(To(),t,"spectrum")])}}}),WA=Eh({schema:[Kn("mouseIsDown",(function(){return Xn(!1)}))],name:"spectrum",overrides:function(t){var e=t.model,n=e.manager,r=function(e,r){return n.getValueFromEvent(r).map((function(r){return n.setValueFrom(e,t,r)}))};return{behaviours:Hl([fy.config({mode:"special",onLeft:function(e){return n.onLeft(e,t)},onRight:function(e){return n.onRight(e,t)},onUp:function(e){return n.onUp(e,t)},onDown:function(e){return n.onDown(e,t)}}),Ny.config({})]),events:pi([wi(yo(),r),wi(wo(),r),wi(ko(),r),wi(So(),(function(e,n){t.mouseIsDown.get()&&r(e,n)}))])}}}),qA=[RA,jA,LA,zA,HA,PA,IA,VA,FA,UA,WA],$A="slider.change.value",GA=i($A),KA=function(t){return-1!==t.type.indexOf("touch")},XA=function(t){var e=t.event.raw;if(KA(e)){var n=e;return void 0!==n.touches&&1===n.touches.length?x.some(n.touches[0]).map((function(t){return _c(t.clientX,t.clientY)})):x.none()}var r=e;return void 0!==r.clientX?x.some(r).map((function(t){return _c(t.clientX,t.clientY)})):x.none()},YA="top",JA="right",ZA="bottom",QA="left",tD=function(t){return t.model.minX},eD=function(t){return t.model.minY},nD=function(t){return t.model.minX-1},rD=function(t){return t.model.minY-1},oD=function(t){return t.model.maxX},iD=function(t){return t.model.maxY},uD=function(t){return t.model.maxX+1},aD=function(t){return t.model.maxY+1},cD=function(t,e,n){return e(t)-n(t)},sD=function(t){return cD(t,oD,tD)},lD=function(t){return cD(t,iD,eD)},fD=function(t){return sD(t)/2},dD=function(t){return lD(t)/2},mD=function(t){return t.stepSize},gD=function(t){return t.snapToGrid},hD=function(t){return t.snapStart},pD=function(t){return t.rounded},vD=function(t,e){return void 0!==t[e+"-edge"]},bD=function(t){return vD(t,QA)},yD=function(t){return vD(t,JA)},wD=function(t){return vD(t,YA)},xD=function(t){return vD(t,ZA)},CD=function(t){return t.model.value.get()},kD=function(t){return{x:t}},SD=function(t){return{y:t}},OD=function(t,e){return{x:t,y:e}},TD=function(t,e){fi(t,GA(),{value:e})},_D=function(t,e){TD(t,OD(nD(e),rD(e)))},ED=function(t,e){TD(t,SD(rD(e)))},AD=function(t,e){TD(t,OD(fD(e),rD(e)))},DD=function(t,e){TD(t,OD(uD(e),rD(e)))},MD=function(t,e){TD(t,kD(uD(e)))},ND=function(t,e){TD(t,OD(uD(e),dD(e)))},RD=function(t,e){TD(t,OD(uD(e),aD(e)))},BD=function(t,e){TD(t,SD(aD(e)))},PD=function(t,e){TD(t,OD(fD(e),aD(e)))},zD=function(t,e){TD(t,OD(nD(e),aD(e)))},ID=function(t,e){TD(t,kD(nD(e)))},LD=function(t,e){TD(t,OD(nD(e),dD(e)))},FD=function(t,e,n,r){return tn?n:t===e?e-1:Math.max(e,t-r)},HD=function(t,e,n,r){return t>n?t:td)return h;var p=UD(o,f,d),v=VD(p/m*r+e,g,h);return u&&v>=e&&v<=n?jD(v,e,n,i,a):c?Math.round(v):v},qD=function(t){var e=t.min,n=t.max,r=t.range,o=t.value,i=t.hasMinEdge,u=t.hasMaxEdge,a=t.maxBound,c=t.maxOffset,s=t.centerMinEdge,l=t.centerMaxEdge;return on?u?a:l:(o-e)/r*c},$D="top",GD="right",KD="bottom",XD="left",YD="width",JD="height",ZD=function(t){return t.element.dom.getBoundingClientRect()},QD=function(t,e){return t[e]},tM=function(t){var e=ZD(t);return QD(e,XD)},eM=function(t){var e=ZD(t);return QD(e,GD)},nM=function(t){var e=ZD(t);return QD(e,$D)},rM=function(t){var e=ZD(t);return QD(e,KD)},oM=function(t){var e=ZD(t);return QD(e,YD)},iM=function(t){var e=ZD(t);return QD(e,JD)},uM=function(t,e,n){return(t+e)/2-n},aM=function(t,e){var n=ZD(t),r=ZD(e),o=QD(n,XD),i=QD(n,GD),u=QD(r,XD);return uM(o,i,u)},cM=function(t,e){var n=ZD(t),r=ZD(e),o=QD(n,$D),i=QD(n,KD),u=QD(r,$D);return uM(o,i,u)},sM=function(t,e){fi(t,GA(),{value:e})},lM=function(t){return{x:t}},fM=function(t,e,n){var r={min:tD(e),max:oD(e),range:sD(e),value:n,step:mD(e),snap:gD(e),snapStart:hD(e),rounded:pD(e),hasMinEdge:bD(e),hasMaxEdge:yD(e),minBound:tM(t),maxBound:eM(t),screenRange:oM(t)};return WD(r)},dM=function(t,e,n){var r=fM(t,e,n),o=lM(r);return sM(t,o),r},mM=function(t,e){var n=tD(e);sM(t,lM(n))},gM=function(t,e){var n=oD(e);sM(t,lM(n))},hM=function(t,e,n){var r=t>0?HD:FD,o=r(CD(n).x,tD(n),oD(n),mD(n));return sM(e,lM(o)),x.some(o)},pM=function(t){return function(e,n){return hM(t,e,n).map(f)}},vM=function(t){var e=XA(t);return e.map((function(t){return t.left}))},bM=function(t,e,n,r,o){var i=0,u=oM(t),a=r.bind((function(e){return x.some(aM(e,t))})).getOr(i),c=o.bind((function(e){return x.some(aM(e,t))})).getOr(u),s={min:tD(e),max:oD(e),range:sD(e),value:n,hasMinEdge:bD(e),hasMaxEdge:yD(e),minBound:tM(t),minOffset:i,maxBound:eM(t),maxOffset:u,centerMinEdge:a,centerMaxEdge:c};return qD(s)},yM=function(t,e,n,r,o,i){var u=bM(e,i,n,r,o);return tM(e)-tM(t)+u},wM=function(t,e,n,r){var o=CD(n),i=yM(t,r.getSpectrum(t),o.x,r.getLeftEdge(t),r.getRightEdge(t),n),u=Bc(e.element)/2;Xa(e.element,"left",i-u+"px")},xM=pM(-1),CM=pM(1),kM=x.none,SM=x.none,OM={"top-left":x.none(),top:x.none(),"top-right":x.none(),right:x.some(MD),"bottom-right":x.none(),bottom:x.none(),"bottom-left":x.none(),left:x.some(ID)},TM=Object.freeze({__proto__:null,setValueFrom:dM,setToMin:mM,setToMax:gM,findValueOfOffset:fM,getValueFromEvent:vM,findPositionOfValue:yM,setPositionFromValue:wM,onLeft:xM,onRight:CM,onUp:kM,onDown:SM,edgeActions:OM}),_M=function(t,e){fi(t,GA(),{value:e})},EM=function(t){return{y:t}},AM=function(t,e,n){var r={min:eD(e),max:iD(e),range:lD(e),value:n,step:mD(e),snap:gD(e),snapStart:hD(e),rounded:pD(e),hasMinEdge:wD(e),hasMaxEdge:xD(e),minBound:nM(t),maxBound:rM(t),screenRange:iM(t)};return WD(r)},DM=function(t,e,n){var r=AM(t,e,n),o=EM(r);return _M(t,o),r},MM=function(t,e){var n=eD(e);_M(t,EM(n))},NM=function(t,e){var n=iD(e);_M(t,EM(n))},RM=function(t,e,n){var r=t>0?HD:FD,o=r(CD(n).y,eD(n),iD(n),mD(n));return _M(e,EM(o)),x.some(o)},BM=function(t){return function(e,n){return RM(t,e,n).map(f)}},PM=function(t){var e=XA(t);return e.map((function(t){return t.top}))},zM=function(t,e,n,r,o){var i=0,u=iM(t),a=r.bind((function(e){return x.some(cM(e,t))})).getOr(i),c=o.bind((function(e){return x.some(cM(e,t))})).getOr(u),s={min:eD(e),max:iD(e),range:lD(e),value:n,hasMinEdge:wD(e),hasMaxEdge:xD(e),minBound:nM(t),minOffset:i,maxBound:rM(t),maxOffset:u,centerMinEdge:a,centerMaxEdge:c};return qD(s)},IM=function(t,e,n,r,o,i){var u=zM(e,i,n,r,o);return nM(e)-nM(t)+u},LM=function(t,e,n,r){var o=CD(n),i=IM(t,r.getSpectrum(t),o.y,r.getTopEdge(t),r.getBottomEdge(t),n),u=kc(e.element)/2;Xa(e.element,"top",i-u+"px")},FM=x.none,HM=x.none,VM=BM(-1),jM=BM(1),UM={"top-left":x.none(),top:x.some(ED),"top-right":x.none(),right:x.none(),"bottom-right":x.none(),bottom:x.some(BD),"bottom-left":x.none(),left:x.none()},WM=Object.freeze({__proto__:null,setValueFrom:DM,setToMin:MM,setToMax:NM,findValueOfOffset:AM,getValueFromEvent:PM,findPositionOfValue:IM,setPositionFromValue:LM,onLeft:FM,onRight:HM,onUp:VM,onDown:jM,edgeActions:UM}),qM=function(t,e){fi(t,GA(),{value:e})},$M=function(t,e){return{x:t,y:e}},GM=function(t,e,n){var r=fM(t,e,n.left),o=AM(t,e,n.top),i=$M(r,o);return qM(t,i),i},KM=function(t,e,n,r){var o=t>0?HD:FD,i=e?CD(r).x:o(CD(r).x,tD(r),oD(r),mD(r)),u=e?o(CD(r).y,eD(r),iD(r),mD(r)):CD(r).y;return qM(n,$M(i,u)),x.some(i)},XM=function(t,e){return function(n,r){return KM(t,e,n,r).map(f)}},YM=function(t,e){var n=tD(e),r=eD(e);qM(t,$M(n,r))},JM=function(t,e){var n=oD(e),r=iD(e);qM(t,$M(n,r))},ZM=function(t){return XA(t)},QM=function(t,e,n,r){var o=CD(n),i=yM(t,r.getSpectrum(t),o.x,r.getLeftEdge(t),r.getRightEdge(t),n),u=IM(t,r.getSpectrum(t),o.y,r.getTopEdge(t),r.getBottomEdge(t),n),a=Bc(e.element)/2,c=kc(e.element)/2;Xa(e.element,"left",i-a+"px"),Xa(e.element,"top",u-c+"px")},tN=XM(-1,!1),eN=XM(1,!1),nN=XM(-1,!0),rN=XM(1,!0),oN={"top-left":x.some(_D),top:x.some(AD),"top-right":x.some(DD),right:x.some(ND),"bottom-right":x.some(RD),bottom:x.some(PD),"bottom-left":x.some(zD),left:x.some(LD)},iN=Object.freeze({__proto__:null,setValueFrom:GM,setToMin:YM,setToMax:JM,getValueFromEvent:ZM,setPositionFromValue:QM,onLeft:tN,onRight:eN,onUp:nN,onDown:rN,edgeActions:oN}),uN=[Ln("stepSize",1),Ln("onChange",e),Ln("onChoose",e),Ln("onInit",e),Ln("onDragStart",e),Ln("onDragEnd",e),Ln("snapToGrid",!1),Ln("rounded",!0),Dn("snapStart"),wn("model",cn("mode",{x:[Ln("minX",0),Ln("maxX",100),Kn("value",(function(t){return Xn(t.mode.minX)})),yn("getInitialValue"),js("manager",TM)],y:[Ln("minY",0),Ln("maxY",100),Kn("value",(function(t){return Xn(t.mode.minY)})),yn("getInitialValue"),js("manager",WM)],xy:[Ln("minX",0),Ln("maxX",100),Ln("minY",0),Ln("maxY",100),Kn("value",(function(t){return Xn({x:t.mode.minX,y:t.mode.minY})})),yn("getInitialValue"),js("manager",iN)]})),Yg("sliderBehaviours",[fy,Xg]),Kn("mouseIsDown",(function(){return Xn(!1)}))],aN=function(t,e,n,r){var o,i=function(e){return Wh(e,t,"thumb")},u=function(e){return Wh(e,t,"spectrum")},a=function(e){return Uh(e,t,"left-edge")},c=function(e){return Uh(e,t,"right-edge")},s=function(e){return Uh(e,t,"top-edge")},l=function(e){return Uh(e,t,"bottom-edge")},d=t.model,m=d.manager,g=function(e,n){m.setPositionFromValue(e,n,t,{getLeftEdge:a,getRightEdge:c,getTopEdge:s,getBottomEdge:l,getSpectrum:u})},h=function(e,n){d.value.set(n);var r=i(e);return g(e,r),t.onChange(e,r,n),x.some(!0)},p=function(e){m.setToMin(e,t)},v=function(e){m.setToMax(e,t)},b=function(e){var n=function(){Uh(e,t,"thumb").each((function(n){var r=d.value.get();t.onChoose(e,n,r)}))},r=t.mouseIsDown.get();t.mouseIsDown.set(!1),r&&n()},y=function(e,n){n.stop(),t.mouseIsDown.set(!0),t.onDragStart(e,i(e))},w=function(e,n){n.stop(),t.onDragEnd(e,i(e)),b(e)};return{uid:t.uid,dom:t.dom,components:e,behaviours:Zg(t.sliderBehaviours,[fy.config({mode:"special",focusIn:function(e){return Uh(e,t,"spectrum").map(fy.focusIn).map(f)}}),Xg.config({store:{mode:"manual",getValue:function(t){return d.value.get()}}}),$l.config({channels:(o={},o[pg()]={onReceive:b},o)})]),events:pi([wi(GA(),(function(t,e){h(t,e.event.value)})),Di((function(e,n){var r=d.getInitialValue();d.value.set(r);var o=i(e);g(e,o);var a=u(e);t.onInit(e,o,a,d.value.get())})),wi(yo(),y),wi(xo(),w),wi(ko(),y),wi(To(),w)]),apis:{resetToMin:p,resetToMax:v,changeValue:h,refresh:g},domModification:{styles:{position:"relative"}}}},cN=cp({name:"Slider",configFields:uN,partFields:qA,factory:aN,apis:{resetToMin:function(t,e){t.resetToMin(e)},resetToMax:function(t,e){t.resetToMax(e)},refresh:function(t,e){t.refresh(e)}}}),sN=function(t,e){var n=cN.parts.spectrum({dom:{tag:"div",classes:[e("hue-slider-spectrum")],attributes:{role:"presentation"}}}),r=cN.parts.thumb({dom:{tag:"div",classes:[e("hue-slider-thumb")],attributes:{role:"presentation"}}});return cN.sketch({dom:{tag:"div",classes:[e("hue-slider")],attributes:{role:"presentation"}},rounded:!1,model:{mode:"y",getInitialValue:i({y:0})},components:[n,r],sliderBehaviours:Hl([Ny.config({})]),onChange:function(t,e,n){fi(t,MA,{value:n})}})},lN="form",fN=[Yg("formBehaviours",[Xg])],dN=function(t){return""},mN=function(t){var e=function(){var t=[],e=function(e,n){return t.push(e),Lh(lN,dN(e),n)};return{field:e,record:function(){return t}}}(),n=t(e),r=e.record(),o=q(r,(function(t){return Eh({name:t,pname:dN(t)})}));return ep(lN,fN,o,hN,n)},gN=function(t,e){return t.fold((function(){return pt.error(e)}),pt.value)},hN=function(t,e){return{uid:t.uid,dom:t.dom,components:e,behaviours:Zg(t.formBehaviours,[Xg.config({store:{mode:"manual",getValue:function(e){var n=$h(e,t);return Mt(n,(function(t,e){return t().bind((function(t){var n=yp.getCurrent(t);return gN(n,new Error("Cannot find a current component to extract the value from for form part '"+e+"': "+Nu(t.element)))})).map(Xg.getValue)}))},setValue:function(e,n){Dt(n,(function(n,r){Uh(e,t,r).each((function(t){yp.getCurrent(t).each((function(t){Xg.setValue(t,n)}))}))}))}}})]),apis:{getField:function(e,n){return Uh(e,t,n).bind(yp.getCurrent)}}}},pN={getField:na((function(t,e,n){return t.getField(e,n)})),sketch:mN},vN=Iu("valid-input"),bN=Iu("invalid-input"),yN=Iu("validating-input"),wN="colorcustom.rgb.",xN=function(t,n,r,o){var i=function(e,r){return $E.config({invalidClass:n("invalid"),notify:{onValidate:function(t){fi(t,yN,{type:e})},onValid:function(t){fi(t,vN,{type:e,value:Xg.getValue(t)})},onInvalid:function(t){fi(t,bN,{type:e,value:Xg.getValue(t)})}},validator:{validate:function(e){var n=Xg.getValue(e),o=r(n)?pt.value(!0):pt.error(t("aria.input.invalid"));return BE.pure(o)},validateOnLoad:!1}})},u=function(r,o,u,a,c){var s=t(wN+"range"),l=X_.parts.label({dom:{tag:"label",innerHtml:u,attributes:{"aria-label":a}}}),f=X_.parts.field({data:c,factory:CE,inputAttributes:m({type:"text"},"hex"===o?{"aria-live":"polite"}:{}),inputClasses:[n("textfield")],inputBehaviours:Hl([i(o,r),Q_.config({})]),onSetValue:function(t){if($E.isInvalid(t)){var n=$E.run(t);n.get(e)}}}),d=[l,f],g="hex"!==o?[X_.parts["aria-descriptor"]({text:s})]:[],h=d.concat(g);return{dom:{tag:"div",attributes:{role:"presentation"}},components:h}},a=function(t,e){var n=zO(e);return pN.getField(t,"hex").each((function(e){Ny.isFocused(e)||Xg.setValue(t,{hex:n.value})})),n},c=function(t,e){var n=e.red,r=e.green,o=e.blue;Xg.setValue(t,{red:n,green:r,blue:o})},s=Zw({dom:{tag:"div",classes:[n("rgba-preview")],styles:{"background-color":"white"},attributes:{role:"presentation"}}}),l=function(t,e){s.getOpt(t).each((function(t){Xa(t.element,"background-color","#"+e.value)}))},f=function(){var e={red:Xn(x.some(255)),green:Xn(x.some(255)),blue:Xn(x.some(255)),hex:Xn(x.some("ffffff"))},i=function(t,e){var n=qO(e);c(t,n),g(n)},f=function(t){return e[t].get()},d=function(t,n){e[t].set(n)},m=function(){return f("red").bind((function(t){return f("green").bind((function(e){return f("blue").map((function(n){return jO(t,e,n,1)}))}))}))},g=function(t){var e=t.red,n=t.green,r=t.blue;d("red",x.some(e)),d("green",x.some(n)),d("blue",x.some(r))},h=function(t,e){var n=e.event;"hex"!==n.type?d(n.type,x.none()):o(t)},p=function(t,e){r(t);var n=AO(e);d("hex",x.some(e));var o=qO(n);c(t,o),g(o),fi(t,DA,{hex:n}),l(t,n)},v=function(t,e,n){var r=parseInt(n,10);d(e,x.some(r)),m().each((function(e){var n=a(t,e);l(t,n)}))},b=function(t){return"hex"===t.type},y=function(t,e){var n=e.event;b(n)?p(t,n.value):v(t,n.type,n.value)},w=function(e){return{label:t(wN+e+".label"),description:t(wN+e+".description")}},C=w("red"),k=w("green"),S=w("blue"),O=w("hex");return Kt(pN.sketch((function(e){return{dom:{tag:"form",classes:[n("rgb-form")],attributes:{"aria-label":t("aria.color.picker")}},components:[e.field("red",X_.sketch(u(UO,"red",C.label,C.description,255))),e.field("green",X_.sketch(u(UO,"green",k.label,k.description,255))),e.field("blue",X_.sketch(u(UO,"blue",S.label,S.description,255))),e.field("hex",X_.sketch(u(NO,"hex",O.label,O.description,"ffffff"))),s.asSpec()],formBehaviours:Hl([$E.config({invalidClass:n("form-invalid")}),ky("rgb-form-events",[wi(vN,y),wi(bN,h),wi(yN,h)])])}})),{apis:{updateHex:function(t,e){Xg.setValue(t,{hex:e.value}),i(t,e),l(t,e)}}})},d=ap({factory:f,name:"RgbForm",configFields:[],apis:{updateHex:function(t,e,n){t.updateHex(e,n)}},extraApis:{}});return d},CN=function(t,e){var n=cN.parts.spectrum({dom:{tag:"canvas",attributes:{role:"presentation"},classes:[e("sv-palette-spectrum")]}}),r=cN.parts.thumb({dom:{tag:"div",attributes:{role:"presentation"},classes:[e("sv-palette-thumb")],innerHtml:"'}}),o=function(t,e){var n=t.width,r=t.height,o=t.getContext("2d");if(null!==o){o.fillStyle=e,o.fillRect(0,0,n,r);var i=o.createLinearGradient(0,0,n,0);i.addColorStop(0,"rgba(255,255,255,1)"),i.addColorStop(1,"rgba(255,255,255,0)"),o.fillStyle=i,o.fillRect(0,0,n,r);var u=o.createLinearGradient(0,0,0,r);u.addColorStop(0,"rgba(0,0,0,0)"),u.addColorStop(1,"rgba(0,0,0,1)"),o.fillStyle=u,o.fillRect(0,0,n,r)}},u=function(t,e){var n=t.components()[0].element.dom;o(n,KO(e))},a=function(t){var u=i({x:0,y:0}),a=function(t,e,n){fi(t,NA,{value:n})},c=function(t,e,n,r){o(n.element.dom,KO(XO))},s=Hl([yp.config({find:x.some}),Ny.config({})]);return cN.sketch({dom:{tag:"div",attributes:{role:"presentation"},classes:[e("sv-palette")]},model:{mode:"xy",getInitialValue:u},rounded:!1,components:[n,r],onChange:a,onInit:c,sliderBehaviours:s})},c=ap({factory:a,name:"SaturationBrightnessPalette",configFields:[],apis:{setRgba:function(t,e,n){u(e,n)}},extraApis:{}});return c},kN=function(t,n){var r=function(e){var r=xN(t,n,e.onValidHex,e.onInvalidHex),o=CN(t,n),i={paletteRgba:Xn(XO)},u=Zw(o.sketch({})),a=Zw(r.sketch({})),c=function(t,e){u.getOpt(t).each((function(t){var n=qO(e);i.paletteRgba.set(n),o.setRgba(t,n)}))},s=function(t,e){a.getOpt(t).each((function(t){r.updateHex(t,e)}))},l=function(t,e,n){$(n,(function(n){n(t,e)}))},f=function(){var t=[s];return function(e,n){var r=n.event.value,o=i.paletteRgba.get(),u=EA(o),a=_A(u.hue,r.x,100-r.y),c=WO(a),s=zO(c);l(e,s,t)}},d=function(){var t=[c,s];return function(e,n){var r=n.event.value,o=AA(r.y);l(e,o,t)}};return{uid:e.uid,dom:e.dom,components:[u.asSpec(),sN(t,n),a.asSpec()],behaviours:Hl([ky("colour-picker-events",[wi(NA,f()),wi(MA,d())]),yp.config({find:function(t){return a.getOpt(t)}}),fy.config({mode:"acyclic"})])}},o=ap({name:"ColourPicker",configFields:[yn("dom"),Ln("onValidHex",e),Ln("onInvalidHex",e)],factory:r});return o},SN=function(){return yp.config({find:x.some})},ON=function(t){return yp.config({find:t.getOpt})},TN=function(t){return yp.config({find:function(e){return Yi(e.element,t).bind((function(t){return e.getSystem().getByDom(t).toOptional()}))}})},_N={self:SN,memento:ON,childAt:TN},EN={"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"},AN=function(t){return EN[t]},DN=function(t){return AN(t)},MN=function(t){var e=function(t){return"tox-"+t},n=kN(DN,e),r=function(t){fi(t,lE,{name:"hex-valid",value:!0})},o=function(t){fi(t,lE,{name:"hex-valid",value:!1})},i=Zw(n.sketch({dom:{tag:"div",classes:[e("color-picker-container")],attributes:{role:"presentation"}},onValidHex:r,onInvalidHex:o}));return{dom:{tag:"div"},components:[i.asSpec()],behaviours:Hl([Xg.config({store:{mode:"manual",getValue:function(t){var e=i.get(t),n=yp.getCurrent(e),r=n.bind((function(t){var e=Xg.getValue(t);return e.hex}));return r.map((function(t){return"#"+t})).getOr("")},setValue:function(t,e){var n=/^#([a-fA-F0-9]{3}(?:[a-fA-F0-9]{3})?)/,r=n.exec(e),o=i.get(t),u=yp.getCurrent(o);u.fold((function(){console.log("Can not find form")}),(function(t){Xg.setValue(t,{hex:x.from(r[1]).getOr("")}),pN.getField(t,"hex").each((function(t){li(t,No())}))}))}}}),_N.self()])}},NN=tinymce.util.Tools.resolve("tinymce.Resource"),RN=function(t){return Object.prototype.hasOwnProperty.call(t,"init")},BN=function(t){var e=Xn(x.none()),n=Zw({dom:{tag:t.tag}}),r=Xn(x.none());return{dom:{tag:"div",classes:["tox-custom-editor"]},behaviours:Hl([ky("custom-editor-events",[Di((function(o){n.getOpt(o).each((function(n){(RN(t)?t.init(n.element.dom):NN.load(t.scriptId,t.scriptUrl).then((function(e){return e(n.element.dom,t.settings)}))).then((function(t){r.get().each((function(e){t.setValue(e)})),r.set(x.none()),e.set(x.some(t))}))}))}))]),Xg.config({store:{mode:"manual",getValue:function(){return e.get().fold((function(){return r.get().getOr("")}),(function(t){return t.getValue()}))},setValue:function(t,n){e.get().fold((function(){r.set(x.some(n))}),(function(t){return t.setValue(n)}))}}}),_N.self()]),components:[n.asSpec()]}},PN=tinymce.util.Tools.resolve("tinymce.util.Tools"),zN=Le([Ln("preprocess",u),Ln("postprocess",u)]),IN=function(t,e){var n=on("RepresentingConfigs.memento processors",zN,e);return Xg.config({store:{mode:"manual",getValue:function(e){var r=t.get(e),o=Xg.getValue(r);return n.postprocess(o)},setValue:function(e,r){var o=n.preprocess(r),i=t.get(e);Xg.setValue(i,o)}}})},LN=function(t,e,n){return Xg.config(Kt({store:{mode:"manual",getValue:e,setValue:n}},t.map((function(t){return{store:{initialValue:t}}})).getOr({})))},FN=function(t,e,n){return LN(t,(function(t){return e(t.element)}),(function(t,e){return n(t.element,e)}))},HN=function(t){return FN(t,ic,uc)},VN=function(t){return FN(t,yu,wu)},jN=function(t){return Xg.config({store:{mode:"memory",initialValue:t}})},UN={memento:IN,withElement:FN,withComp:LN,domValue:HN,domHtml:VN,memory:jN},WN="jpeg,jpg,jpe,jfi,jif,jfif,png,gif,bmp,webp",qN=function(t,e){var n=PN.explode(e.getSetting("images_file_types",WN,"string")),r=function(t){return j(n,(function(e){return hr(t.name.toLowerCase(),"."+e.toLowerCase())}))};return X(ft(t),r)},$N=function(t,e){var n=function(t,e){e.stop()},r=function(t){return function(e,n){$(t,(function(t){t(e,n)}))}},o=function(t,e){if(!Yk.isDisabled(t)){var n=e.event.raw;u(t,n.dataTransfer.files)}},i=function(t,e){var n=e.event.raw.target;u(t,n.files)},u=function(n,r){Xg.setValue(n,qN(r,e)),fi(n,aE,{name:t.name})},a=Zw({dom:{tag:"input",attributes:{type:"file",accept:"image/*"},styles:{display:"none"}},behaviours:Hl([ky("input-file-events",[_i(Bo()),_i(qo())])])}),c=function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-dropzone-container"]},behaviours:Hl([UN.memory([]),_N.self(),Yk.config({}),Jy.config({toggleClass:"dragenter",toggleOnExecute:!1}),ky("dropzone-events",[wi("dragenter",r([n,Jy.toggle])),wi("dragleave",r([n,Jy.toggle])),wi("dragover",n),wi("drop",r([n,o])),wi(Ro(),i)])]),components:[{dom:{tag:"div",classes:["tox-dropzone"],styles:{}},components:[{dom:{tag:"p",innerHtml:e.translate("Drop an image here")}},Jw.sketch({dom:{tag:"button",innerHtml:e.translate("Browse for an image"),styles:{position:"relative"},classes:["tox-button","tox-button--secondary"]},components:[a.asSpec()],action:function(t){var e=a.get(t);e.element.dom.click()},buttonBehaviours:Hl([Q_.config({}),KS.button(e.isDisabled),US()])})]}]}},s=t.label.map((function(t){return uE(t,e)})),l=X_.parts.field({factory:{sketch:c}});return eE(s,l,["tox-form__group--stretched"],[])},GN=function(t,e){return{dom:{tag:"div",classes:["tox-form__grid","tox-form__grid--"+t.columns+"col"]},components:q(t.items,e.interpreter)}},KN=Iu("alloy-fake-before-tabstop"),XN=Iu("alloy-fake-after-tabstop"),YN=function(t){return{dom:{tag:"div",styles:{width:"1px",height:"1px",outline:"none"},attributes:{tabindex:"0"},classes:t},behaviours:Hl([Ny.config({ignore:!0}),Q_.config({})])}},JN=function(t){return{dom:{tag:"div",classes:["tox-navobj"]},components:[YN([KN]),t,YN([XN])],behaviours:Hl([_N.childAt(1)])}},ZN=function(t,e){fi(t,Do(),{raw:{which:9,shiftKey:e}})},QN=function(t,e){var n=e.element;Ha(n,KN)?ZN(t,!0):Ha(n,XN)&&ZN(t,!1)},tR=function(t){return h_(t,["."+KN,"."+XN].join(","),l)},eR=!(Gr().browser.isIE()||Gr().browser.isEdge()),nR=function(t){var e=Xn("");return{getValue:function(t){return e.get()},setValue:function(n,r){if(t)ku(n.element,"srcdoc",r);else{ku(n.element,"src","javascript:''");var o=n.element.dom.contentWindow.document;o.open(),o.write(r),o.close()}e.set(r)}}},rR=function(t,e){var n=eR&&t.sandboxed,r=m(m({},t.label.map((function(t){return{title:t}})).getOr({})),n?{sandbox:"allow-scripts allow-same-origin"}:{}),o=nR(n),i=t.label.map((function(t){return uE(t,e)})),u=function(t){return JN({uid:t.uid,dom:{tag:"iframe",attributes:r},behaviours:Hl([Q_.config({}),Ny.config({}),UN.withComp(x.none(),o.getValue,o.setValue)])})},a=X_.parts.field({factory:{sketch:u}});return eE(i,a,["tox-form__group--stretched"],[])},oR=function(t,e){return aR(document.createElement("canvas"),t,e)},iR=function(t){var e=oR(t.width,t.height),n=uR(e);return n.drawImage(t,0,0),e},uR=function(t){return t.getContext("2d")},aR=function(t,e,n){return t.width=e,t.height=n,t},cR=function(t){return t.naturalWidth||t.width},sR=function(t){return t.naturalHeight||t.height},lR=function(){var t=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,r(u,this),r(a,this))},e=window,n=t.immediateFn||"function"===typeof e.setImmediate&&e.setImmediate||function(t){return setTimeout(t,1)},r=function(t,e){return function(){for(var n=[],r=0;rn?r=n:rn?t=n:t2)&&(i=i<.5?.5:2,a=!0),(u<.5||u>2)&&(u=u<.5?.5:2,a=!0);var c=$R(t,i,u);return a?c.then((function(t){return qR(t,e,n)})):c},$R=function(t,e,n){return new fR((function(r){var o=cR(t),i=sR(t),u=Math.floor(o*e),a=Math.floor(i*n),c=oR(u,a),s=uR(c);s.drawImage(t,0,0,o,i,0,0,u,a),r(c)}))},GR=function(t,e){return t.toCanvas().then((function(n){return KR(n,t.getType(),e)}))},KR=function(t,e,n){var r=oR(t.width,t.height),o=uR(r),i=0,u=0;return n=n<0?360+n:n,90!==n&&270!==n||aR(r,r.height,r.width),90!==n&&180!==n||(i=r.width),270!==n&&180!==n||(u=r.height),o.translate(i,u),o.rotate(n*Math.PI/180),o.drawImage(t,0,0),CR(r,e)},XR=function(t,e){return t.toCanvas().then((function(n){return YR(n,t.getType(),e)}))},YR=function(t,e,n){var r=oR(t.width,t.height),o=uR(r);return"v"===n?(o.scale(1,-1),o.drawImage(t,0,-r.height)):(o.scale(-1,1),o.drawImage(t,-r.width,0)),CR(r,e)},JR=function(t,e,n,r,o){return t.toCanvas().then((function(i){return ZR(i,t.getType(),e,n,r,o)}))},ZR=function(t,e,n,r,o,i){var u=oR(o,i),a=uR(u);return a.drawImage(t,-n,-r),CR(u,e)},QR=function(t,e,n){return t.toCanvas().then((function(r){return qR(r,e,n).then((function(e){return CR(e,t.getType())}))}))},tB=function(t){return FR(t)},eB=function(t){return UR(t)},nB=function(t,e){return WR(t,e)},rB=function(t,e,n,r){return jR(t,e,n,r)},oB=function(t,e){return HR(t,e)},iB=function(t,e){return VR(t,e)},uB=function(t,e){return XR(t,e)},aB=function(t,e,n,r,o){return JR(t,e,n,r,o)},cB=function(t,e,n){return QR(t,e,n)},sB=function(t,e){return GR(t,e)},lB=function(t,e){return m({dom:{tag:"span",innerHtml:t,classes:["tox-icon","tox-tbtn__icon-wrap"]}},e)},fB=function(t,e){return lB(tx(t,e),{})},dB=function(t,e){return lB(tx(t,e),{behaviours:Hl([xy.config({})])})},mB=function(t,e,n){return{dom:{tag:"span",innerHtml:n.translate(t),classes:[e+"__select-label"]},behaviours:Hl([xy.config({})])}},gB=Iu("toolbar.button.execute"),hB=function(t){return Ri((function(e,n){XS(t,e)((function(n){fi(e,gB,{buttonApi:n}),t.onAction(n)}))}))},pB=(eA={},eA[Uo()]=["disabling","alloy.base.behaviour","toggling","toolbar-button-events"],eA),vB=Iu("update-menu-text"),bB=Iu("update-menu-icon"),yB=function(t,n,r){var o=Xn(e),i=t.text.map((function(t){return Zw(mB(t,n,r.providers))})),u=t.icon.map((function(t){return Zw(dB(t,r.providers.icons))})),c=function(t,e){var n=Xg.getValue(t);return Ny.focus(n),fi(n,"keydown",{raw:e.event.raw}),vA.close(n),x.some(!0)},s=t.role.fold((function(){return{}}),(function(t){return{role:t}})),l=t.tooltip.fold((function(){return{}}),(function(t){var e=r.providers.translate(t);return{title:e,"aria-label":e}})),f=Zw(vA.sketch(m(m(m({},t.uid?{uid:t.uid}:{}),s),{dom:{tag:"button",classes:[n,n+"--select"].concat(q(t.classes,(function(t){return n+"--"+t}))),attributes:m({},l)},components:tO([u.map((function(t){return t.asSpec()})),i.map((function(t){return t.asSpec()})),x.some({dom:{tag:"div",classes:[n+"__select-chevron"],innerHtml:tx("chevron-down",r.providers.icons)}})]),matchWidth:!0,useMinWidth:!0,dropdownBehaviours:Hl(h(t.dropdownBehaviours,[KS.button((function(){return t.disabled||r.providers.isDisabled()})),US(),xA.config({}),xy.config({}),ky("dropdown-events",[YS(t,o),JS(t,o)]),ky("menubutton-update-display-text",[wi(vB,(function(t,e){i.bind((function(e){return e.getOpt(t)})).each((function(t){xy.set(t,[pc(r.providers.translate(e.event.text))])}))})),wi(bB,(function(t,e){u.bind((function(e){return e.getOpt(t)})).each((function(t){xy.set(t,[dB(e.event.icon,r.providers.icons)])}))}))])])),eventOrder:Kt(pB,{mousedown:["focusing","alloy.base.behaviour","item-type-events","normal-dropdown-events"]}),sandboxBehaviours:Hl([fy.config({mode:"special",onLeft:c,onRight:c})]),lazySink:r.getSink,toggleClass:n+"--active",parts:{menu:zC(!1,t.columns,t.presets)},fetch:function(e){return BE.nu(a(t.fetch,e))}})));return f.asSpec()},wB=function(t){return T(t)},xB=function(t){return"separator"===t.type},CB=function(t){return Ht(t,"getSubmenuItems")},kB={type:"separator"},SB=function(t,e){var n=J(t,(function(t,n){return wB(n)?""===n?t:"|"===n?t.length>0&&!xB(t[t.length-1])?t.concat([kB]):t:Ht(e,n.toLowerCase())?t.concat([e[n.toLowerCase()]]):t:t.concat([n])}),[]);return n.length>0&&xB(n[n.length-1])&&n.pop(),n},OB=function(t,e){var n=t.getSubmenuItems(),r=EB(n,e),o=Kt(r.menus,se(t.value,r.items)),i=Kt(r.expansions,se(t.value,t.value));return{item:t,menus:o,expansions:i}},TB=function(t,e){return CB(t)?OB(t,e):{item:t,menus:{},expansions:{}}},_B=function(t){if(xB(t))return t;var e=Ft(t,"value").getOrThunk((function(){return Iu("generated-menu-item")}));return Kt({value:e},t)},EB=function(t,e){var n=SB(T(t)?t.split(" "):t,e);return Y(n,(function(t,n){var r=_B(n),o=TB(r,e);return{menus:Kt(t.menus,o.menus),items:[o.item].concat(t.items),expansions:Kt(t.expansions,o.expansions)}}),{menus:{},expansions:{},items:[]})},AB=function(t,e,n,r){var o=Iu("primary-menu"),i=EB(t,n.shared.providers.menuItems());if(0===i.items.length)return x.none();var u=u_(o,i.items,e,n,r),a=Mt(i.menus,(function(t,r){return u_(r,t,e,n,!1)})),c=Kt(a,se(o,u));return x.from(Bw.tieredData(o,c,i.expansions))},DB=function(t){return{isDisabled:function(){return Yk.isDisabled(t)},setDisabled:function(e){return Yk.set(t,e)},setActive:function(e){var n=t.element;e?(Ia(n,"tox-tbtn--enabled"),ku(n,"aria-pressed",!0)):(Fa(n,"tox-tbtn--enabled"),Eu(n,"aria-pressed"))},isActive:function(){return Ha(t.element,"tox-tbtn--enabled")}}},MB=function(t,e,n,r){return yB({text:t.text,icon:t.icon,tooltip:t.tooltip,role:r,fetch:function(e,r){t.fetch((function(t){r(AB(t,cC.CLOSE_ON_EXECUTE,n,!1))}))},onSetup:t.onSetup,getApi:DB,columns:1,presets:"normal",classes:[],dropdownBehaviours:[Q_.config({})]},e,n.shared)},NB=function(t,e,n){var r=function(t){return function(r){var o=!r.isActive();r.setActive(o),t.storage.set(o),n.shared.getSink().each((function(n){e().getOpt(n).each((function(e){Yl(e.element),fi(e,lE,{name:t.name,value:t.storage.get()})}))}))}},o=function(t){return function(e){e.setActive(t.storage.get())}};return function(e){e(q(t,(function(t){var e=t.text.fold((function(){return{}}),(function(t){return{text:t}}));return m(m({type:t.type,active:!1},e),{onAction:r(t),onSetup:o(t)})})))}},RB=function(t,e,n,r,o,i){void 0===n&&(n=[]);var u=e.fold((function(){return{}}),(function(t){return{action:t}})),a=m({buttonBehaviours:Hl([KS.button((function(){return t.disabled||i.isDisabled()})),US(),Q_.config({}),ky("button press",[yi("click"),yi("mousedown")])].concat(n)),eventOrder:{click:["button press","alloy.base.behaviour"],mousedown:["button press","alloy.base.behaviour"]}},u),c=Kt(a,{dom:r});return Kt(c,{components:o})},BB=function(t,e,n,r){void 0===r&&(r=[]);var o=t.tooltip.map((function(t){return{"aria-label":n.translate(t),title:n.translate(t)}})).getOr({}),i={tag:"button",classes:["tox-tbtn"],attributes:o},u=t.icon.map((function(t){return fB(t,n.icons)})),a=tO([u]);return RB(t,e,r,i,a,n)},PB=function(t,e,n,r){void 0===r&&(r=[]);var o=BB(t,x.some(e),n,r);return Jw.sketch(o)},zB=function(t,e,n,r,o){void 0===r&&(r=[]),void 0===o&&(o=[]);var i=n.translate(t.text),u=t.icon?t.icon.map((function(t){return fB(t,n.icons)})):x.none(),a=u.isSome()?tO([u]):[],c=u.isSome()?{}:{innerHtml:i},s=h(t.primary||t.borderless?["tox-button"]:["tox-button","tox-button--secondary"],u.isSome()?["tox-button--icon"]:[],t.borderless?["tox-button--naked"]:[],o),l=m(m({tag:"button",classes:s},c),{attributes:{title:i}});return RB(t,e,r,l,a,n)},IB=function(t,e,n,r,o){void 0===r&&(r=[]),void 0===o&&(o=[]);var i=zB(t,x.some(e),n,r,o);return Jw.sketch(i)},LB=function(t,e){return function(n){"custom"===e?fi(n,lE,{name:t,value:{}}):"submit"===e?li(n,fE):"cancel"===e?li(n,sE):console.error("Unknown button type: ",e)}},FB=function(t,e){return"menu"===e},HB=function(t,e){return"custom"===e||"cancel"===e||"submit"===e},VB=function(t,n,r){if(FB(t,n)){var o=function(){return a},i=t,u=m(m({},t),{onSetup:function(n){return n.setDisabled(t.disabled),e},fetch:NB(i.items,o,r)}),a=Zw(MB(u,"tox-tbtn",r,x.none()));return a.asSpec()}if(HB(t,n)){var c=LB(t.name,n),s=m(m({},t),{borderless:!1});return IB(s,c,r.shared.providers,[])}console.error("Unknown footer button type: ",n)},jB=function(t,e){var n=LB(t.name,"custom");return nE(x.none(),X_.parts.field(m({factory:Jw},zB(t,x.some(n),e,[UN.memory(""),_N.self()]))))},UB=i([Ln("field1Name","field1"),Ln("field2Name","field2"),Hs("onLockedChange"),zs(["lockClass"]),Ln("locked",!1),Qg.field("coupledFieldBehaviours",[yp,Xg])]),WB=function(t,e,n){return Uh(t,e,n).bind(yp.getCurrent)},qB=function(t,e){return Eh({factory:X_,name:t,overrides:function(t){return{fieldBehaviours:Hl([ky("coupled-input-behaviour",[wi(No(),(function(n){WB(n,t,e).each((function(e){Uh(n,t,"lock").each((function(r){Jy.isOn(r)&&t.onLockedChange(n,e,r)}))}))}))])])}}})},$B=i([qB("field1","field2"),qB("field2","field1"),Eh({factory:Jw,schema:[yn("dom")],name:"lock",overrides:function(t){return{buttonBehaviours:Hl([Jy.config({selected:t.locked,toggleClass:t.markers.lockClass,aria:{mode:"pressed"}})])}}})]),GB=function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,behaviours:Qg.augment(t.coupledFieldBehaviours,[yp.config({find:x.some}),Xg.config({store:{mode:"manual",getValue:function(e){var n,r=Kh(e,t,["field1","field2"]);return n={},n[t.field1Name]=Xg.getValue(r.field1()),n[t.field2Name]=Xg.getValue(r.field2()),n},setValue:function(e,n){var r=Kh(e,t,["field1","field2"]);Vt(n,t.field1Name)&&Xg.setValue(r.field1(),n[t.field1Name]),Vt(n,t.field2Name)&&Xg.setValue(r.field2(),n[t.field2Name])}}})]),apis:{getField1:function(e){return Uh(e,t,"field1")},getField2:function(e){return Uh(e,t,"field2")},getLock:function(e){return Uh(e,t,"lock")}}}},KB=cp({name:"FormCoupledInputs",configFields:UB(),partFields:$B(),factory:GB,apis:{getField1:function(t,e){return t.getField1(e)},getField2:function(t,e){return t.getField2(e)},getLock:function(t,e){return t.getLock(e)}}}),XB=function(t){var e={"":0,px:0,pt:1,mm:1,pc:2,ex:2,em:2,ch:2,rem:2,cm:3,in:4,"%":4},n=function(t){return t in e?e[t]:1},r=t.value.toFixed(n(t.unit));return-1!==r.indexOf(".")&&(r=r.replace(/\.?0*$/,"")),r+t.unit},YB=function(t){var e=/^\s*(\d+(?:\.\d+)?)\s*(|cm|mm|in|px|pt|pc|em|ex|ch|rem|vw|vh|vmin|vmax|%)\s*$/,n=e.exec(t);if(null!==n){var r=parseFloat(n[1]),o=n[2];return pt.value({value:r,unit:o})}return pt.error(t)},JB=function(t,e){var n={"":96,px:96,pt:72,cm:2.54,pc:12,mm:25.4,in:1},r=function(t){return Object.prototype.hasOwnProperty.call(n,t)};return t.unit===e?x.some(t.value):r(t.unit)&&r(e)?n[t.unit]===n[e]?x.some(t.value):x.some(t.value/n[t.unit]*n[e]):x.none()},ZB=function(t){return x.none()},QB=function(t,e){return function(n){return JB(n,e).map((function(n){return{value:n*t,unit:e}}))}},tP=function(t,e){var n=YB(t).toOptional(),r=YB(e).toOptional();return fp(n,r,(function(t,e){return JB(t,e.unit).map((function(t){return e.value/t})).map((function(t){return QB(t,e.unit)})).getOr(ZB)})).getOr(ZB)},eP=function(t,e){var n=ZB,r=Iu("ratio-event"),o=KB.parts.lock({dom:{tag:"button",classes:["tox-lock","tox-button","tox-button--naked","tox-button--icon"],attributes:{title:e.translate(t.label.getOr("Constrain proportions"))}},components:[{dom:{tag:"span",classes:["tox-icon","tox-lock-icon__lock"],innerHtml:tx("lock",e.icons)}},{dom:{tag:"span",classes:["tox-icon","tox-lock-icon__unlock"],innerHtml:tx("unlock",e.icons)}}],buttonBehaviours:Hl([Yk.config({disabled:function(){return t.disabled||e.isDisabled()}}),US(),Q_.config({})])}),i=function(t){return{dom:{tag:"div",classes:["tox-form__group"]},components:t}},u=function(n){return X_.parts.field({factory:CE,inputClasses:["tox-textfield"],inputBehaviours:Hl([Yk.config({disabled:function(){return t.disabled||e.isDisabled()}}),US(),Q_.config({}),ky("size-input-events",[wi(Eo(),(function(t,e){fi(t,r,{isField1:n})})),wi(Ro(),(function(e,n){fi(e,aE,{name:t.name})}))])]),selectOnFocus:!1})},a=function(t){return{dom:{tag:"label",classes:["tox-label"],innerHtml:e.translate(t)}}},c=KB.parts.field1(i([X_.parts.label(a("Width")),u(!0)])),s=KB.parts.field2(i([X_.parts.label(a("Height")),u(!1)]));return KB.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:[{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:[c,s,i([a(" "),o])]}],field1Name:"width",field2Name:"height",locked:!0,markers:{lockClass:"tox-locked"},onLockedChange:function(t,e,r){YB(Xg.getValue(t)).each((function(t){n(t).each((function(t){Xg.setValue(e,XB(t))}))}))},coupledFieldBehaviours:Hl([Yk.config({disabled:function(){return t.disabled||e.isDisabled()},onDisabled:function(t){KB.getField1(t).bind(X_.getField).each(Yk.disable),KB.getField2(t).bind(X_.getField).each(Yk.disable),KB.getLock(t).each(Yk.disable)},onEnabled:function(t){KB.getField1(t).bind(X_.getField).each(Yk.enable),KB.getField2(t).bind(X_.getField).each(Yk.enable),KB.getLock(t).each(Yk.enable)}}),US(),ky("size-input-events2",[wi(r,(function(t,e){var r=e.event.isField1,o=r?KB.getField1(t):KB.getField2(t),i=r?KB.getField2(t):KB.getField1(t),u=o.map(Xg.getValue).getOr(""),a=i.map(Xg.getValue).getOr("");n=tP(u,a)}))])])})},nP=i(Iu("undo")),rP=i(Iu("redo")),oP=i(Iu("zoom")),iP=i(Iu("back")),uP=i(Iu("apply")),aP=i(Iu("swap")),cP=i(Iu("transform")),sP=i(Iu("temp-transform")),lP=i(Iu("transform-apply")),fP={undo:nP,redo:rP,zoom:oP,back:iP,apply:uP,swap:aP,transform:cP,tempTransform:sP,transformApply:lP},dP=i("save-state"),mP=i("disable"),gP=i("enable"),hP={formActionEvent:lE,saveState:dP,disable:mP,enable:gP},pP=function(t,n){var r=function(t,e,r,o){return Zw(IB({name:t,text:t,disabled:r,primary:o,icon:x.none(),borderless:!1},e,n))},o=function(t,e,r,o){return Zw(PB({name:t,icon:x.some(t),tooltip:x.some(e),disabled:o,primary:!1,borderless:!1},r,n))},u=function(t,e){t.map((function(t){var n=t.get(e);n.hasConfigured(Yk)&&Yk.disable(n)}))},a=function(t,e){t.map((function(t){var n=t.get(e);n.hasConfigured(Yk)&&Yk.enable(n)}))},c={tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools-edit-panel"]},s=e,l=function(t,e,n){fi(t,e,n)},f=function(t){return li(t,hP.disable())},d=function(t){return li(t,hP.enable())},m=function(t,e){f(t),l(t,fP.transform(),{transform:e}),d(t)},g=function(t,e){f(t),l(t,fP.tempTransform(),{transform:e}),d(t)},h=function(t){return function(){ut.getOpt(t).each((function(t){xy.set(t,[ot])}))}},p=function(t,e){f(t),l(t,fP.transformApply(),{transform:e,swap:h(t)}),d(t)},v=function(){return r("Back",(function(t){return l(t,fP.back(),{swap:h(t)})}),!1,!1)},b=function(){return Zw({dom:{tag:"div",classes:["tox-spacer"]},behaviours:Hl([Yk.config({})])})},y=function(){return r("Apply",(function(t){return l(t,fP.apply(),{swap:h(t)})}),!0,!0)},w=function(){return function(e){var n=t.getRect();return aB(e,n.x,n.y,n.w,n.h)}},C=[v(),b(),r("Apply",(function(e){var n=w();p(e,n),t.hideCrop()}),!1,!0)],k=U_.sketch({dom:c,components:C.map((function(t){return t.asSpec()})),containerBehaviours:Hl([ky("image-tools-crop-buttons-events",[wi(hP.disable(),(function(t,e){u(C,t)})),wi(hP.enable(),(function(t,e){a(C,t)}))])])}),S=Zw(eP({name:"size",label:x.none(),constrain:!0,disabled:!1},n)),O=function(t,e){return function(n){return cB(n,t,e)}},T=[v(),b(),S,b(),r("Apply",(function(t){S.getOpt(t).each((function(e){var n=Xg.getValue(e),r=parseInt(n.width,10),o=parseInt(n.height,10),i=O(r,o);p(t,i)}))}),!1,!0)],_=U_.sketch({dom:c,components:T.map((function(t){return t.asSpec()})),containerBehaviours:Hl([ky("image-tools-resize-buttons-events",[wi(hP.disable(),(function(t,e){u(T,t)})),wi(hP.enable(),(function(t,e){a(T,t)}))])])}),E=function(t,e){return function(n){return t(n,e)}},A=E(uB,"h"),D=E(uB,"v"),M=E(sB,-90),N=E(sB,90),R=function(t,e){g(t,e)},B=[v(),b(),o("flip-horizontally","Flip horizontally",(function(t){R(t,A)}),!1),o("flip-vertically","Flip vertically",(function(t){R(t,D)}),!1),o("rotate-left","Rotate counterclockwise",(function(t){R(t,M)}),!1),o("rotate-right","Rotate clockwise",(function(t){R(t,N)}),!1),b(),y()],P=U_.sketch({dom:c,components:B.map((function(t){return t.asSpec()})),containerBehaviours:Hl([ky("image-tools-fliprotate-buttons-events",[wi(hP.disable(),(function(t,e){u(B,t)})),wi(hP.enable(),(function(t,e){a(B,t)}))])])}),z=function(t,e,r,o,u){var a=cN.parts.label({dom:{tag:"label",classes:["tox-label"],innerHtml:n.translate(t)}}),c=cN.parts.spectrum({dom:{tag:"div",classes:["tox-slider__rail"],attributes:{role:"presentation"}}}),s=cN.parts.thumb({dom:{tag:"div",classes:["tox-slider__handle"],attributes:{role:"presentation"}}});return Zw(cN.sketch({dom:{tag:"div",classes:["tox-slider"],attributes:{role:"presentation"}},model:{mode:"x",minX:r,maxX:u,getInitialValue:i({x:o})},components:[a,c,s],sliderBehaviours:Hl([Ny.config({})]),onChoose:e}))},I=function(t,e,n,r,o){var i=function(t,n,r){var o=E(e,r.x/100);m(t,o)};return z(t,i,n,r,o)},L=function(t,e,n,r,o){return[v(),I(t,e,n,r,o),y()]},F=function(t,e,n,r,o){var i=L(t,e,n,r,o);return U_.sketch({dom:c,components:i.map((function(t){return t.asSpec()})),containerBehaviours:Hl([ky("image-tools-filter-panel-buttons-events",[wi(hP.disable(),(function(t,e){u(i,t)})),wi(hP.enable(),(function(t,e){a(i,t)}))])])})},H=[v(),b(),y()],V=U_.sketch({dom:c,components:H.map((function(t){return t.asSpec()}))}),j=F("Brightness",oB,-100,0,100),U=F("Contrast",iB,-100,0,100),W=F("Gamma",nB,-100,0,100),q=function(t,e,n){return function(r){return rB(r,t,e,n)}},$=function(t){var e=function(t,e,n){var r=G.getOpt(t),o=X.getOpt(t),i=K.getOpt(t);r.each((function(e){o.each((function(n){i.each((function(r){var o=Xg.getValue(e).x/100,i=Xg.getValue(r).x/100,u=Xg.getValue(n).x/100,a=q(o,i,u);m(t,a)}))}))}))};return z(t,e,0,100,200)},G=$("R"),K=$("G"),X=$("B"),Y=[v(),G,K,X,y()],J=U_.sketch({dom:c,components:Y.map((function(t){return t.asSpec()}))}),Z=function(t,e,n){return function(r){var o=function(){ut.getOpt(r).each((function(e){xy.set(e,[t]),n(e)}))};l(r,fP.swap(),{transform:e,swap:o})}},Q=function(e){t.showCrop()},tt=function(e){S.getOpt(e).each((function(e){var n=t.getMeasurements(),r=n.width,o=n.height;Xg.setValue(e,{width:r,height:o})}))},et=x.some(eB),nt=x.some(tB),rt=[o("crop","Crop",Z(k,x.none(),Q),!1),o("resize","Resize",Z(_,x.none(),tt),!1),o("orientation","Orientation",Z(P,x.none(),s),!1),o("brightness","Brightness",Z(j,x.none(),s),!1),o("sharpen","Sharpen",Z(V,et,s),!1),o("contrast","Contrast",Z(U,x.none(),s),!1),o("color-levels","Color levels",Z(J,x.none(),s),!1),o("gamma","Gamma",Z(W,x.none(),s),!1),o("invert","Invert",Z(V,nt,s),!1)],ot=U_.sketch({dom:c,components:rt.map((function(t){return t.asSpec()}))}),it=U_.sketch({dom:{tag:"div"},components:[ot],containerBehaviours:Hl([xy.config({})])}),ut=Zw(it),at=function(t){return ut.getOpt(t).map((function(t){var e=t.components()[0];return e.components()[e.components().length-1]}))};return{memContainer:ut,getApplyButton:at}},vP=tinymce.util.Tools.resolve("tinymce.geom.Rect"),bP=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),yP=tinymce.util.Tools.resolve("tinymce.util.Observable"),wP=tinymce.util.Tools.resolve("tinymce.util.VK"),xP=function(t){var e=Math.max,n=t.documentElement,r=t.body,o=e(n.scrollWidth,r.scrollWidth),i=e(n.clientWidth,r.clientWidth),u=e(n.offsetWidth,r.offsetWidth),a=e(n.scrollHeight,r.scrollHeight),c=e(n.clientHeight,r.clientHeight),s=e(n.offsetHeight,r.offsetHeight);return{width:o").css({position:"absolute",top:0,left:0,width:f.width,height:f.height,zIndex:2147483647,opacity:1e-4,cursor:c}).appendTo(u.body),bP(u).on("mousemove touchmove",s).on("mouseup touchend",l),e.start(t)},s=function(t){if(CP(t),t.button!==r)return l(t);t.deltaX=t.screenX-o,t.deltaY=t.screenY-i,t.preventDefault(),e.drag(t)},l=function(t){CP(t),bP(u).off("mousemove touchmove",s).off("mouseup touchend",l),n.remove(),e.stop&&e.stop(t)},f=function(){bP(a).off()};return bP(a).on("mousedown touchstart",c),{destroy:f}}var SP=0,OP=function(t,e,n,r,o){var i,u="tox-",a=u+"crid-"+SP++,c=[{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"}],s=["top","right","bottom","left"],l=function(t,e){return{x:e.x+t.x,y:e.y+t.y,w:e.w,h:e.h}},f=function(t,e){return{x:e.x-t.x,y:e.y-t.y,w:e.w,h:e.h}},d=function(){return f(n,t)},m=function(e,r,o,i){var u,a,c,s,l;u=r.x,a=r.y,c=r.w,s=r.h,u+=o*e.deltaX,a+=i*e.deltaY,c+=o*e.deltaW,s+=i*e.deltaH,c<20&&(c=20),s<20&&(s=20),l=t=vP.clamp({x:u,y:a,w:c,h:s},n,"move"===e.name),l=f(n,l),C.fire("updateRect",{rect:l}),y(l)},g=function(){var e=function(e){var n;return kP(a,{document:r.ownerDocument,handle:a+"-"+e.name,start:function(){n=t},drag:function(t){m(e,n,t.deltaX,t.deltaY)}})};bP('
').appendTo(r),PN.each(s,(function(t){bP("#"+a,r).append('