/** * Copyright (c) Tiny Technologies, Inc. All rights reserved. * Licensed under the LGPL or a commercial license. * For LGPL see License.txt in the project root for license information. * For commercial licenses see https://www.tiny.cloud/ * * Version: 5.9.2 (2021-09-08) */ !function(){"use strict";var b=function(){return(b=Object.assign||function(n){for(var e,t=1,o=arguments.length;t "+o.toString()},function(n,e){return"state("+n+")"})}).join("\n")+"}"}}},mo=w(fo),go=(Qt=m,_t(function(n){var e=typeof n;return Qt(n)?no(n):eo("Expected type: function but got: "+e)})),po=function(n){return"Errors: \n"+Z(10<(e=n.errors).length?e.slice(0,10).concat([{path:[],getErrorInfo:w("... (only showing first ten failures)")}]):e,function(n){return"Failed path: ("+n.path.join(" > ")+")\n"+n.getErrorInfo()}).join("\n")+"\n\nInput object: "+Dt(n.input);var e},ho=xt,vo=function(n,e){return{tag:"custom",newKey:n,instantiator:e}},yo=[Lt("alpha"),Lt("omega")];function bo(n,e){return(t={})[n]=e,t;var t}function xo(n){return e={},M(n,function(n){e[n.key]=n.value}),e;var e}function wo(n,e,t){return void 0===t&&(t=o),n.exists(function(n){return t(n,e)})}function So(n){for(var e=[],t=function(n){e.push(n)},o=0;o="/*".length&&"/*"===n.substr(e,e+"/*".length)?n.substring(0,n.length-"/*".length):n;var e})},nr=function(t,n,l,i,e,o,r){function u(n){return Ie(n,l)?n[l]():mn.none()}var c=De(e,function(n,e){return r=l,t=function(t){for(var n=[],e=1;e"}),mo()),ta=vo("schema",function(){return[Ut("preprocess")]}),oa=Yt("defaults",w({})),ra=Yt("overrides",w({})),ia=lo([Qc,Zc,na,ea,oa,ra]),ua=lo([Qc,Zc,na,oa,ra]),ca=lo([Qc,Zc,na,ea,oa,ra]),aa=lo([Qc,ta,na,Lt("unit"),ea,oa,ra]),sa=Wu(Jc.required,ia);function fa(n,e,t,o){return co(e.defaults(n,t,o),t,{uid:n.partUids[e.name]},e.overrides(n,t,o))}function la(n,e,t){return o=e,r={},i={},M(t,function(n){n.fold(function(o){r[o.pname]=Xc(!0,function(n,e,t){return o.factory.sketch(fa(n,o,e,t))})},function(n){var e=o.parts[n.name];i[n.name]=w(n.factory.sketch(fa(o,n,e[Us()]),e))},function(o){r[o.pname]=Xc(!1,function(n,e,t){return o.factory.sketch(fa(n,o,e,t))})},function(o){r[o.pname]=qc(!0,function(e,n,t){return Z(e[o.name],function(n){return o.factory.sketch(co(o.defaults(e,n,t),n,o.overrides(e,n)))})})})}),{internals:w(r),externals:w(i)};var o,r,i}function da(n,e,t){return o=mn.some(n),i=(r=e).components,s=De(t,function(n,e){return o=n,r=!1,{name:w(t=e),required:function(){return o.fold(function(n,e){return n},function(n,e){return n})},used:function(){return r},replace:function(){if(r)throw new Error("Trying to use the same placeholder more than once: "+t);return r=!0,o}};var t,o,r}),u=o,c=r,a=s,f=B(i,function(n){return Wc(u,c,n,a)}),Ce(s,function(n){if(!1===n.used()&&n.required())throw new Error("Placeholder: "+n.name()+" was not found in components list\nNamespace: "+o.getOr("none")+"\nComponents: "+JSON.stringify(r.components,null,2))}),f;var o,r,i,u,c,a,s,f}function ma(n,e,t){var o=e.partUids[t];return n.getSystem().getByUid(o).toOptional()}function ga(n,e,t){return ma(n,e,t).getOrDie("Could not find part: "+t)}function pa(o){return ho("partUids","partUids",Ct(function(n){return e=n.uid,t=Z(o,Uu),xo(Z(t,function(n){return{key:n,value:e+"-"+n}}));var e,t}),mo())}function ha(n){return bo(Xs,n)}function va(o){return n=function(n){for(var e=[],t=1;t')},function(n){return Oa(''+n+"")})}function Da(e){return Gs({name:e+"-edge",overrides:function(n){return n.model.manager.edgeActions[e].fold(function(){return{}},function(o){return{events:qo([Do(Vn(),function(n,e,t){return o(n,t)},[n]),Do(jn(),function(n,e,t){return o(n,t)},[n]),Do(Nn(),function(n,e,t){t.mouseIsDown.get()&&o(n,t)},[n])])}})}})}function Ma(n,e,t){e.store.manager.onLoad(n,e,t)}function _a(n,e,t){e.store.manager.onUnload(n,e,t)}function Ia(){var n=jo(null);return tr({set:n.set,get:n.get,isNotSet:function(){return null===n.get()},clear:function(){n.set(null)},readState:function(){return{mode:"memory",value:n.get()}}})}function Fa(){var i=jo({}),u=jo({});return tr({readState:function(){return{mode:"dataset",dataByValue:i.get(),dataByText:u.get()}},lookup:function(n){return _e(i.get(),n).orThunk(function(){return _e(u.get(),n)})},update:function(n){var e=i.get(),t=u.get(),o={},r={};M(n,function(e){_e(o[e.value]=e,"meta").each(function(n){_e(n,"text").each(function(n){r[n]=e})})}),i.set(b(b({},e),o)),u.set(b(b({},t),r))},clear:function(){i.set({}),u.set({})}})}function Ra(n,e,t,o){var r=e.store;t.update([o]),r.setValue(n,o),e.onSetValue(n,o)}function Va(n,e){return Sf.set(n,e)}function Ba(n){return Sf.get(n)}function Aa(n){var e=n.event.raw;return-1===e.type.indexOf("touch")?void 0!==e.clientX?mn.some(e).map(function(n){return Tf(n.clientX,n.clientY)}):mn.none():void 0!==e.touches&&1===e.touches.length?mn.some(e.touches[0]).map(function(n){return Tf(n.clientX,n.clientY)}):mn.none()}function ja(n){return n.model.minX}function Na(n){return n.model.minY}function Ha(n){return n.model.minX-1}function Pa(n){return n.model.minY-1}function za(n){return n.model.maxX}function La(n){return n.model.maxY}function Ga(n){return n.model.maxX+1}function $a(n){return n.model.maxY+1}function Ua(n,e,t){return e(n)-t(n)}function Wa(n){return Ua(n,za,ja)}function Xa(n){return Ua(n,La,Na)}function qa(n){return Wa(n)/2}function Ya(n){return Xa(n)/2}function Ka(n){return n.stepSize}function Ja(n){return n.snapToGrid}function Qa(n){return n.snapStart}function Za(n){return n.rounded}function ns(n,e){return void 0!==n[e+"-edge"]}function es(n){return ns(n,"left")}function ts(n){return ns(n,"right")}function os(n){return ns(n,"top")}function rs(n){return ns(n,"bottom")}function is(n){return n.model.value.get()}function us(n,e){return{x:n,y:e}}function cs(n,e){X(n,kf(),{value:e})}function as(n,e,t,o){return n'),components:[qf.parts["left-edge"](Ta('
')),qf.parts.spectrum({dom:Oa('
'),components:[Ta('
')],behaviours:or([ii.config({toggleClass:ci("thumb-active")})])}),qf.parts["right-edge"](Ta('
')),qf.parts.thumb({dom:Oa('
'),behaviours:or([ii.config({toggleClass:ci("thumb-active")})])})],onChange:function(n,e,t){var o=i(t.x());Gr(e.element,"background-color",o),r.onChange(n,e,o)},onDragStart:function(n,e){ii.on(e)},onDragEnd:function(n,e){ii.off(e)},onInit:function(n,e,t,o){var r=i(o.x());Gr(e.element,"background-color",r)},stepSize:10,model:{mode:"x",minX:0,maxX:360,getInitialValue:function(){return{x:r.getInitialValue()}}},sliderBehaviours:or([jr(qf.refresh)])}))];function i(n){return n<0?"black":360'),(e={onChange:n.onChange,sizes:Qf,category:"font",getInitialValue:n.getInitialValue},r=Pt("SizeSlider",Jf,e),qf.sketch({dom:{tag:"div",classes:[ci("slider-"+r.category+"-size-container"),ci("slider"),ci("slider-size-container")]},onChange:function(n,e,t){var o=t.x();0<=o&&o'),components:[Ta('
')]}),qf.parts.thumb({dom:Oa('
'),behaviours:or([ii.config({toggleClass:ci("thumb-active")})])})]})),Ta('')];var e,r}function js(n){var e=void 0!==n.uid&&Ie(n,"uid")?n.uid:Zs("memento");return{get:function(n){return n.getSystem().getByUid(e).getOrDie()},getOpt:function(n){return n.getSystem().getByUid(e).toOptional()},asSpec:function(){return b(b({},n),{uid:e})}}}Wu(Jc.external,ua);var Ns,Hs,Ps,zs,Ls,Gs=Wu(Jc.optional,ca),$s=Wu(Jc.group,aa),Us=w("entirety"),Ws=function(n,e){return{uiType:Yc(),owner:n,name:e}},Xs=$u("alloy-premade"),qs=w("alloy-id-"),Ys=w("data-alloy-id"),Ks=qs(),Js=Ys(),Qs=function(n,e){Object.defineProperty(n.dom,Js,{value:e,writable:!0})},Zs=$u,nf=function(n){return dt(n,"uid")?n:b(b({},n),{uid:Zs("uid")})},ef=Rt([Lt("name"),Lt("factory"),Lt("configFields"),Yt("apis",{}),Yt("extraApis",{})]),tf=Rt([Lt("name"),Lt("factory"),Lt("configFields"),Lt("partFields"),Yt("apis",{}),Yt("extraApis",{})]),of=wa({name:"Button",factory:function(n){function t(e){return _e(n.dom,"attributes").bind(function(n){return _e(n,e)})}var e,o=(e=n.action,qo(V([e.map(function(t){return Qo(function(n,e){t(n),e.stop()})}).toArray(),Hr()]))),r=n.dom.tag;return{uid:n.uid,dom:n.dom,components:n.components,events:o,behaviours:Gc(n.buttonBehaviours,[fi.config({}),zc.config({mode:"execution",useSpace:!0,useEnter:!0})]),domModification:{attributes:function(){if("button"!==r)return{role:t("role").getOr("button")};var n=t("type").getOr("button"),e=t("role").map(function(n){return{role:n}}).getOr({});return b({type:n},e)}()},eventOrder:n.eventOrder}},configFields:[Yt("uid",void 0),Lt("dom"),Yt("components",[]),Lc("buttonBehaviours",[fi,zc]),Ut("action"),Ut("role"),Yt("eventOrder",{})]}),rf=Ao({fields:[],name:"unselecting",active:Object.freeze({__proto__:null,events:function(){return qo([Eo(Xn(),x)])},exhibit:function(){return Ro({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})}})}),uf=function(n,e,t,o){return of.sketch({dom:Ca(n,o),action:e,buttonBehaviours:co(or([rf.config({})]),t)})},cf=Gs({schema:[Lt("dom")],name:"label"}),af=Da("top-left"),sf=Da("top"),ff=Da("top-right"),lf=Da("right"),df=Da("bottom-right"),mf=Da("bottom"),gf=Da("bottom-left"),pf=[cf,Da("left"),lf,sf,mf,af,ff,gf,df,sa({name:"thumb",defaults:w({dom:{styles:{position:"absolute"}}}),overrides:function(n){return{events:qo([_o(Vn(),n,"spectrum"),_o(Bn(),n,"spectrum"),_o(An(),n,"spectrum"),_o(jn(),n,"spectrum"),_o(Nn(),n,"spectrum"),_o(Hn(),n,"spectrum")])}}}),sa({schema:[vo("mouseIsDown",function(){return jo(!1)})],name:"spectrum",overrides:function(t){function o(e,n){return r.getValueFromEvent(n).map(function(n){return r.setValueFrom(e,t,n)})}var r=t.model.manager;return{behaviours:or([zc.config({mode:"special",onLeft:function(n){return r.onLeft(n,t)},onRight:function(n){return r.onRight(n,t)},onUp:function(n){return r.onUp(n,t)},onDown:function(n){return r.onDown(n,t)}}),fi.config({})]),events:qo([Co(Vn(),o),Co(Bn(),o),Co(jn(),o),Co(Nn(),function(n,e){t.mouseIsDown.get()&&o(n,e)})])}}})],hf=Object.freeze({__proto__:null,onLoad:Ma,onUnload:_a,setValue:function(n,e,t,o){e.store.manager.setValue(n,e,t,o)},getValue:function(n,e,t){return e.store.manager.getValue(n,e,t)},getState:function(n,e,t){return t}}),vf=Object.freeze({__proto__:null,events:function(t,o){var n=t.resetOnDom?[Yo(function(n,e){Ma(n,t,o)}),Ko(function(n,e){_a(n,t,o)})]:[Vo(t,o,Ma)];return qo(n)}}),yf=Object.freeze({__proto__:null,memory:Ia,dataset:Fa,manual:function(){return tr({readState:Y})},init:function(n){return n.store.manager.state(n)}}),bf=[Ut("initialValue"),Lt("getFallbackEntry"),Lt("getDataKey"),Lt("setValue"),Dr("manager",{setValue:Ra,getValue:function(n,e,t){var o=e.store,r=o.getDataKey(n);return t.lookup(r).getOrThunk(function(){return o.getFallbackEntry(r)})},onLoad:function(e,t,o){t.store.initialValue.each(function(n){Ra(e,t,o,n)})},onUnload:function(n,e,t){t.clear()},state:Fa})],xf=[Lt("getValue"),Yt("setValue",Y),Ut("initialValue"),Dr("manager",{setValue:function(n,e,t,o){e.store.setValue(n,o),e.onSetValue(n,o)},getValue:function(n,e,t){return e.store.getValue(n)},onLoad:function(e,t,n){t.store.initialValue.each(function(n){t.store.setValue(e,n)})},onUnload:Y,state:er.init})],wf=Ao({fields:[Kt("store",{mode:"memory"},zt("mode",{memory:[Ut("initialValue"),Dr("manager",{setValue:function(n,e,t,o){t.set(o),e.onSetValue(n,o)},getValue:function(n,e,t){return t.get()},onLoad:function(n,e,t){e.store.initialValue.each(function(n){t.isNotSet()&&t.set(n)})},onUnload:function(n,e,t){t.clear()},state:Ia})],manual:xf,dataset:bf})),Tr("onSetValue"),Yt("resetOnDom",!1)],name:"representing",active:vf,apis:hf,extra:{setValueFrom:function(n,e){var t=wf.getValue(e);wf.setValue(n,t)}},state:yf}),Sf=Yr("width",function(n){return n.dom.offsetWidth}),Of=function(t,o){return{left:t,top:o,translate:function(n,e){return Of(t+n,o+e)}}},Tf=Of,kf=w("slider.change.value"),Ef="left",Cf=Ts(-1),Df=Ts(1),Mf=mn.none,_f=mn.none,If={"top-left":mn.none(),top:mn.none(),"top-right":mn.none(),right:mn.some(function(n,e){cs(n,{x:Ga(e)})}),"bottom-right":mn.none(),bottom:mn.none(),"bottom-left":mn.none(),left:mn.some(function(n,e){cs(n,{x:Ha(e)})})},Ff=Object.freeze({__proto__:null,setValueFrom:function(n,e,t){var o=Os(n,e,t);return Ss(n,{x:o}),o},setToMin:function(n,e){Ss(n,{x:ja(e)})},setToMax:function(n,e){Ss(n,{x:za(e)})},findValueOfOffset:Os,getValueFromEvent:function(n){return Aa(n).map(function(n){return n.left})},findPositionOfValue:ks,setPositionFromValue:function(n,e,t,o){var r=is(t),i=ks(n,o.getSpectrum(n),r.x,o.getLeftEdge(n),o.getRightEdge(n),t),u=Ba(e.element)/2;Gr(e.element,"left",i-u+"px")},onLeft:Cf,onRight:Df,onUp:Mf,onDown:_f,edgeActions:If}),Rf=mn.none,Vf=mn.none,Bf=Ds(-1),Af=Ds(1),jf={"top-left":mn.none(),top:mn.some(function(n,e){cs(n,{y:Pa(e)})}),"top-right":mn.none(),right:mn.none(),"bottom-right":mn.none(),bottom:mn.some(function(n,e){cs(n,{y:$a(e)})}),"bottom-left":mn.none(),left:mn.none()},Nf=Object.freeze({__proto__:null,setValueFrom:function(n,e,t){var o=Cs(n,e,t);return Es(n,{y:o}),o},setToMin:function(n,e){Es(n,{y:Na(e)})},setToMax:function(n,e){Es(n,{y:La(e)})},findValueOfOffset:Cs,getValueFromEvent:function(n){return Aa(n).map(function(n){return n.top})},findPositionOfValue:Ms,setPositionFromValue:function(n,e,t,o){var r=is(t),i=Ms(n,o.getSpectrum(n),r.y,o.getTopEdge(n),o.getBottomEdge(n),t),u=Kr(e.element)/2;Gr(e.element,"top",i-u+"px")},onLeft:Rf,onRight:Vf,onUp:Bf,onDown:Af,edgeActions:jf}),Hf=Aa,Pf=Fs(-1,!1),zf=Fs(1,!1),Lf=Fs(-1,!0),Gf=Fs(1,!0),$f={"top-left":mn.some(function(n,e){cs(n,us(Ha(e),Pa(e)))}),top:mn.some(function(n,e){cs(n,us(qa(e),Pa(e)))}),"top-right":mn.some(function(n,e){cs(n,us(Ga(e),Pa(e)))}),right:mn.some(function(n,e){cs(n,us(Ga(e),Ya(e)))}),"bottom-right":mn.some(function(n,e){cs(n,us(Ga(e),$a(e)))}),bottom:mn.some(function(n,e){cs(n,us(qa(e),$a(e)))}),"bottom-left":mn.some(function(n,e){cs(n,us(Ha(e),$a(e)))}),left:mn.some(function(n,e){cs(n,us(Ha(e),Ya(e)))})},Uf=Object.freeze({__proto__:null,setValueFrom:function(n,e,t){var o=Is(Os(n,e,t.left),Cs(n,e,t.top));return _s(n,o),o},setToMin:function(n,e){_s(n,Is(ja(e),Na(e)))},setToMax:function(n,e){_s(n,Is(za(e),La(e)))},getValueFromEvent:Hf,setPositionFromValue:function(n,e,t,o){var r=is(t),i=ks(n,o.getSpectrum(n),r.x,o.getLeftEdge(n),o.getRightEdge(n),t),u=Ms(n,o.getSpectrum(n),r.y,o.getTopEdge(n),o.getBottomEdge(n),t),c=Ba(e.element)/2,a=Kr(e.element)/2;Gr(e.element,"left",i-c+"px"),Gr(e.element,"top",u-a+"px")},onLeft:Pf,onRight:zf,onUp:Lf,onDown:Gf,edgeActions:$f}),Wf=[Yt("stepSize",1),Yt("onChange",Y),Yt("onChoose",Y),Yt("onInit",Y),Yt("onDragStart",Y),Yt("onDragEnd",Y),Yt("snapToGrid",!1),Yt("rounded",!0),Ut("snapStart"),Gt("model",zt("mode",{x:[Yt("minX",0),Yt("maxX",100),vo("value",function(n){return jo(n.mode.minX)}),Lt("getInitialValue"),Dr("manager",Ff)],y:[Yt("minY",0),Yt("maxY",100),vo("value",function(n){return jo(n.mode.minY)}),Lt("getInitialValue"),Dr("manager",Nf)],xy:[Yt("minX",0),Yt("maxX",100),Yt("minY",0),Yt("maxY",100),vo("value",function(n){return jo({x:n.mode.minX,y:n.mode.minY})}),Lt("getInitialValue"),Dr("manager",Uf)]})),zu("sliderBehaviours",[zc,wf]),vo("mouseIsDown",function(){return jo(!1)})],Xf=w("mouse.released"),qf=Sa({name:"Slider",configFields:Wf,partFields:pf,factory:function(i,n,e,t){function u(n){return ga(n,i,"thumb")}function c(n){return ga(n,i,"spectrum")}function o(n){return ma(n,i,"left-edge")}function r(n){return ma(n,i,"right-edge")}function a(n){return ma(n,i,"top-edge")}function s(n){return ma(n,i,"bottom-edge")}function f(n,e){v.setPositionFromValue(n,e,i,{getLeftEdge:o,getRightEdge:r,getTopEdge:a,getBottomEdge:s,getSpectrum:c})}function l(n,e){h.value.set(e),f(n,u(n))}function d(t){var n=i.mouseIsDown.get();i.mouseIsDown.set(!1),n&&ma(t,i,"thumb").each(function(n){var e=h.value.get();i.onChoose(t,n,e)})}function m(n,e){e.stop(),i.mouseIsDown.set(!0),i.onDragStart(n,u(n))}function g(n,e){e.stop(),i.onDragEnd(n,u(n)),d(n)}var p,h=i.model,v=h.manager;return{uid:i.uid,dom:i.dom,components:n,behaviours:Lu(i.sliderBehaviours,[zc.config({mode:"special",focusIn:function(n){return ma(n,i,"spectrum").map(zc.focusIn).map(x)}}),wf.config({store:{mode:"manual",getValue:function(n){return h.value.get()}}}),ti.config({channels:((p={})[Xf()]={onReceive:d},p)})]),events:qo([Co(kf(),function(n,e){!function(n,e){l(n,e);var t=u(n);i.onChange(n,t,e),mn.some(!0)}(n,e.event.value)}),Yo(function(n,e){var t=h.getInitialValue();h.value.set(t);var o=u(n);f(n,o);var r=c(n);i.onInit(n,o,r,h.value.get())}),Co(Vn(),m),Co(An(),g),Co(jn(),m),Co(Hn(),g)]),apis:{resetToMin:function(n){v.setToMin(n,i)},resetToMax:function(n){v.setToMax(n,i)},setValue:l,refresh:f},domModification:{styles:{position:"relative"}}}},apis:{setValue:function(n,e,t){n.setValue(e,t)},resetToMin:function(n,e){n.resetToMin(e)},resetToMax:function(n,e){n.resetToMax(e)},refresh:function(n,e){n.refresh(e)}}}),Yf=["9px","10px","11px","12px","14px","16px","18px","20px","24px","32px","36px"],Kf=w(Yf),Jf=Rt([Lt("getInitialValue"),Lt("onChange"),Lt("category"),Lt("sizes")]),Qf=Kf(),Zf=window.Promise||(Ns=window,Hs=nl.immediateFn||"function"==typeof Ns.setImmediate&&Ns.setImmediate||function(n){return setTimeout(n,1)},Ps=function(t,o){return function(){for(var n=[],e=0;e'),action:function(n){var e=t.get(n);wf.setValue(e,"")}}));return{name:n,spec:ld.sketch({dom:Oa('
'),components:[t.asSpec(),o.asSpec()],containerBehaviours:or([ii.config({toggleClass:ci("input-container-empty")}),fd.config({find:function(n){return mn.some(t.get(n))}}),ll("input-clearing",[Co(Gn(),function(n){var e=t.get(n);(0"}function bl(o,r){return Ea(r,"link","link",function(){var n,e,t=kd(o,r);o.setContextToolbar(t),n=r,e=function(){o.focusToolbar()},(ad.os.isAndroid()?function(n,e){var t=e.selection.getRng();n(),e.selection.setRng(t)}:p)(e,n),cd(r).each(function(n){r.selection.select(n.dom)})})}function xl(e){function t(n){return"The component must be in a context to execute: "+n+(e?"\n"+Go(e().element)+" is not in context.":"")}function n(n){return function(){throw new Error(t(n))}}function o(n){return function(){console.warn(t(n))}}return{debugInfo:w("fake"),triggerEvent:o("triggerEvent"),triggerFocus:o("triggerFocus"),triggerEscape:o("triggerEscape"),broadcast:o("broadcast"),broadcastOn:o("broadcastOn"),broadcastEvent:o("broadcastEvent"),build:n("build"),addToWorld:n("addToWorld"),removeFromWorld:n("removeFromWorld"),addToGui:n("addToGui"),removeFromGui:n("removeFromGui"),getByUid:n("getByUid"),getByDom:n("getByDom"),isConnected:S}}function wl(n,r){var i={};return Ce(n,function(n,o){Ce(n,function(n,e){var t=_e(i,e).getOr([]);i[e]=t.concat([r(o,n)])})}),i}function Sl(n){return n.cHandler}function Ol(n,e){return{name:n,handler:e}}function Tl(n,e,t){var o=e[t];return o?function(u,c,n,a){try{var e=(t=function(n,e){var t=n[c],o=e[c],r=a.indexOf(t),i=a.indexOf(o);if(-1===r)throw new Error("The ordering for "+u+" does not have an entry for "+t+".\nOrder specified: "+JSON.stringify(a,null,2));if(-1===i)throw new Error("The ordering for "+u+" does not have an entry for "+o+".\nOrder specified: "+JSON.stringify(a,null,2));return r'),components:[ld.sketch({dom:Oa('
'),components:Z(s.fields,function(n,e){return e<=s.maxFieldIndex?ld.sketch({dom:Oa('
'),components:[i(-1,"previous",0'),behaviours:or([Qi.config({highlightClass:ci("dot-active"),itemClass:ci("dot-item")})]),components:B(s.fields,function(n,e){return e<=s.maxFieldIndex?[Ta('
')]:[]})}),{dom:Oa('
'),components:[f.asSpec(),l.asSpec()],behaviours:or([zc.config({mode:"special",focusIn:function(n){var e=f.get(n);zc.focusIn(e)}}),ll("serializer-wrapper-events",[Co(Vn(),function(n,e){var t=e.event;s.state.dialogSwipeState.set({xValue:t.raw.touches[0].clientX,points:[]})}),Co(Bn(),function(n,e){var t=e.event;s.state.dialogSwipeState.on(function(n){e.event.prevent(),s.state.dialogSwipeState.set(function(n,e){if(e===n.xValue)return n;var t=0'),action:function(n){X(n,a,{direction:e})},buttonBehaviours:or([Sd.config({disableClass:ci("toolbar-navigation-disabled"),disabled:function(){return!t}})])})}function u(n,r){var i=Jr(n.element,"."+ci("serialised-dialog-screen"));hi(n.element,"."+ci("serialised-dialog-chain")).each(function(o){0<=s.state.currentScreen.get()+r&&s.state.currentScreen.get()+r "):r[0].name;return bo(u,{handler:t,purpose:o})})});return e={},t=[],o=[],M(a,function(n){n.fold(function(n){t.push(n)},function(n){o.push(n)})}),0<(u={errors:t,values:o}).errors.length?ht.error(V(u.errors)):(i=e,0===(r=u.values).length?ht.value(i):ht.value(co(i,ao.apply(void 0,r))))},Id="alloy.base.behaviour",Fd=lo([ho("dom","dom",Ot(),lo([Lt("tag"),Yt("styles",{}),Yt("classes",[]),Yt("attributes",{}),Ut("value"),Ut("innerHtml")])),Lt("components"),Lt("uid"),Yt("events",{}),Yt("apis",{}),ho("eventOrder","eventOrder",((ud={})[Zn()]=["disabling",Id,"toggling","typeaheadevents"],ud[Yn()]=[Id,"focusing","keying"],ud[oe()]=[Id,"disabling","toggling","representing"],ud[Gn()]=[Id,"representing","streaming","invalidating"],ud[ie()]=[Id,"representing","item-events","tooltipping"],ud[jn()]=["focusing",Id,"item-type-events"],ud[Vn()]=["focusing",Id,"item-type-events"],ud[Pn()]=["item-type-events","tooltipping"],ud[Qn()]=["receiving","reflecting","tooltipping"],Ct(w(ud))),mo()),Ut("domModification")]),Rd=Zs,Vd=function(u){return _e(u,Xs).getOrThunk(function(){var n,e,t,o,r,i=dt(u,"uid")?u:b({uid:Rd("")},u);return n=Dd(i),e=n.events,t=c(n,["events"]),o=Z(_e(t,"components").getOr([]),Vd),r=b(b({},t),{events:b(b({},Cd),e),components:o}),ht.value(_l(r)).getOrDie()})},Bd=ha,Ad="alloy.item-hover",jd="alloy.item-focus",Nd=w(Ad),Hd=w(jd),Pd=[Lt("data"),Lt("components"),Lt("dom"),Yt("hasSubmenu",!1),Ut("toggling"),Lc("itemBehaviours",[ii,fi,zc,wf]),Yt("ignoreFocus",!1),Yt("domModification",{}),Dr("builder",function(n){return{dom:n.dom,domModification:b(b({},n.domModification),{attributes:b(b(b({role:n.toggling.isSome()?"menuitemcheckbox":"menuitem"},n.domModification.attributes),{"aria-haspopup":n.hasSubmenu}),n.hasSubmenu?{"aria-expanded":!1}:{})}),behaviours:Gc(n.itemBehaviours,[n.toggling.fold(ii.revoke,function(n){return ii.config(b({aria:{mode:"checked"}},n))}),fi.config({ignore:n.ignoreFocus,stopMousedown:n.ignoreFocus,onFocus:function(n){Rl(n)}}),zc.config({mode:"execution"}),wf.config({store:{mode:"memory",initialValue:n.data}}),ll("item-type-events",u(u([],Hr()),[Co(Pn(),Fl),Co(ne(),fi.focus)]))]),components:n.components,eventOrder:n.eventOrder}}),Yt("eventOrder",{})],zd=[Lt("dom"),Lt("components"),Dr("builder",function(n){return{dom:n.dom,components:n.components,events:qo([Co(ne(),function(n,e){e.stop()})])}})],Ld=w("item-widget"),Gd=w([sa({name:"widget",overrides:function(e){return{behaviours:or([wf.config({store:{mode:"manual",getValue:function(n){return e.data},setValue:Y}})])}}})]),$d=zt("type",{widget:[Lt("uid"),Lt("data"),Lt("components"),Lt("dom"),Yt("autofocus",!1),Yt("ignoreFocus",!1),Lc("widgetBehaviours",[wf,fi,zc]),Yt("domModification",{}),pa(Gd()),Dr("builder",function(t){function o(n){return ma(n,t,"widget").map(function(n){return zc.focusIn(n),n})}function n(n,e){return eu(e.event.target)||t.autofocus&&e.setSource(n.element),mn.none()}var e=la(Ld(),t,Gd()),r=da(Ld(),t,e.internals());return{dom:t.dom,components:r,domModification:t.domModification,events:qo([Qo(function(n,e){o(n).each(function(n){e.stop()})}),Co(Pn(),Fl),Co(ne(),function(n,e){t.autofocus?o(n):fi.focus(n)})]),behaviours:Gc(t.widgetBehaviours,[wf.config({store:{mode:"memory",initialValue:t.data}}),fi.config({ignore:t.ignoreFocus,onFocus:function(n){Rl(n)}}),zc.config({mode:"special",focusIn:t.autofocus?function(n){o(n)}:ur(),onLeft:n,onRight:n,onEscape:function(n,e){return fi.isFocused(n)||t.autofocus?(t.autofocus&&e.setSource(n.element),mn.none()):(fi.focus(n),mn.some(!0))}})])}})],item:Pd,separator:zd}),Ud=w([$s({factory:{sketch:function(n){var e=Pt("menu.spec item",$d,n);return e.builder(e)}},name:"items",unit:"item",defaults:function(n,e){return dt(e,"uid")?e:b(b({},e),{uid:Zs("item")})},overrides:function(n,e){return{type:e.type,ignoreFocus:n.fakeFocus,domModification:{classes:[n.markers.item]}}}})]),Wd=w([Lt("value"),Lt("items"),Lt("dom"),Lt("components"),Yt("eventOrder",{}),zu("menuBehaviours",[Qi,wf,fd,zc]),Kt("movement",{mode:"menu",moveOnTab:!0},zt("mode",{grid:[ei(),Dr("config",function(n,e){return{mode:"flatgrid",selector:"."+n.markers.item,initSize:{numColumns:e.initSize.numColumns,numRows:e.initSize.numRows},focusManager:n.focusManager}})],matrix:[Dr("config",function(n,e){return{mode:"matrix",selectors:{row:e.rowSelector,cell:"."+n.markers.item},focusManager:n.focusManager}}),Lt("rowSelector")],menu:[Yt("moveOnTab",!0),Dr("config",function(n,e){return{mode:"menu",selector:"."+n.markers.item,moveOnTab:e.moveOnTab,focusManager:n.focusManager}})]})),Gt("markers",ni()),Yt("fakeFocus",!1),Yt("focusManager",Ri()),Tr("onHighlight")]),Xd=w("alloy.menu-focus"),qd=Sa({name:"Menu",configFields:Wd(),partFields:Ud(),factory:function(n,e,t,o){return{uid:n.uid,dom:n.dom,markers:n.markers,behaviours:Lu(n.menuBehaviours,[Qi.config({highlightClass:n.markers.selectedItem,itemClass:n.markers.item,onHighlight:n.onHighlight}),wf.config({store:{mode:"memory",initialValue:n.value}}),fd.config({find:mn.some}),zc.config(n.movement.config(n,n.movement))]),events:qo([Co(Hd(),function(e,t){var n=t.event;e.getSystem().getByDom(n.target).each(function(n){Qi.highlight(e,n),t.stop(),X(e,Xd(),{menu:e,item:n})})}),Co(Nd(),function(n,e){var t=e.event.item;Qi.highlight(n,t)})]),components:e,eventOrder:n.eventOrder,domModification:{attributes:{role:"menu"}}}}}),Yd=function(n,e){return n.components()},Kd=Ao({fields:[],name:"replacing",apis:Object.freeze({__proto__:null,append:function(n,e,t,o){Vl(n,0,Qe,o)},prepend:function(n,e,t,o){Vl(n,0,be,o)},remove:Bl,replaceAt:Al,replaceBy:function(e,n,t,o,r){return R(Yd(e),o).bind(function(n){return Al(e,0,0,n,r)})},set:function(i,n,e,u){var t,o,r,c;t=function(){var e,n,t,o,r=Z(u,i.getSystem().build);n=r,o=(e=i).components(),M((t=e).components(),function(n){return Ze(n.element)}),we(t.element),t.syncComponents(),M(N(o,n),function(n){ut(n),e.getSystem().removeFromWorld(n)}),M(n,function(n){n.getSystem().isConnected()?ke(e,n):(e.getSystem().addToWorld(n),ke(e,n),rt(e.element)&&ct(n)),e.syncComponents()})},o=i.element,r=tt(o),c=Po(r).bind(function(e){function n(n){return un(e,n)}var r,i;return n(o)?mn.some(o):(r=n,(i=function(n){for(var e=0;e");o[t[0]]=bo(t[1],n),o[t[1]]=bo(t[0],n)}),o},createBistate:function(n,e,t){return xo([{key:n,value:bo(e,t)},{key:e,value:bo(n,t)}])},createTristate:function(n,e,t,o){return xo([{key:n,value:xo([{key:e,value:o},{key:t,value:o}])},{key:e,value:xo([{key:n,value:o},{key:t,value:o}])},{key:t,value:xo([{key:n,value:o},{key:e,value:o}])}])}}}),cm=ci("scrollable"),am=cm,sm=function(n,e,t,o,r){return{data:{value:n,text:e},type:"item",dom:{tag:"div",classes:r?[ci("styles-item-is-menu")]:[]},toggling:{toggleOnExecute:!1,toggleClass:ci("format-matches"),selected:t},itemBehaviours:or(r?[]:[Ar(n,function(n,e){(e?ii.on:ii.off)(n)})]),components:[{dom:{tag:"div",attributes:{style:o},innerHtml:e}}]}},fm=function(n,e,t,o){return{value:n,dom:{tag:"div"},components:[of.sketch({dom:{tag:"div",classes:[ci("styles-collapser")]},components:o?[{dom:{tag:"span",classes:[ci("styles-collapse-icon")]}},Il(n)]:[Il(n)],action:function(n){var e;o&&(e=t().get(n),em.collapseMenu(e))}}),{dom:{tag:"div",classes:[ci("styles-menu-items-container")]},components:[qd.parts.items({})],behaviours:or([ll("adhoc-scrollable-menu",[Yo(function(n,e){Gr(n.element,"overflow-y","auto"),Gr(n.element,"-webkit-overflow-scrolling","touch"),Pl(n.element)}),Ko(function(n){Xr(n.element,"overflow-y"),Xr(n.element,"-webkit-overflow-scrolling"),zl(n.element)})])])}],items:e,menuBehaviours:or([um.config({initialState:"after",routes:um.createTristate("before","current","after",{transition:{property:"transform",transitionClass:"transitioning"}})})])}},lm=function(n){return _(n,function(n,e){var t=Gl(e);return{menus:co(n.menus,t.menus),items:[t.item].concat(n.items),expansions:co(n.expansions,t.expansions)}},{menus:{},expansions:{},items:[]})},dm=function(n){return B(n,function(n){return(D(n)?dm:Ul)(n)})},mm=function(n,e,t,o){n.dom.removeEventListener(e,t,o)},gm=x,pm=tinymce.util.Tools.resolve("tinymce.util.Delay"),hm=Jt([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]);function vm(n,e){var t=le(n);return"input"===t?Sg.after(n):k(["br","img"],t)?0===e?Sg.before(n):Sg.after(n):Sg.on(n,e)}function ym(n){return mn.from(n.getSelection())}function bm(n,e,t,o,r){var i=nd(n,e,t,o,r);ym(n).each(function(n){n.removeAllRanges(),n.addRange(i)})}function xm(n,e,t,o,r){var i,u,c,a,s,f=(i=o,u=r,c=vm(e,t),a=vm(i,u),Tg.relative(c,a));od(s=n,f).match({ltr:function(n,e,t,o){bm(s,n,e,t,o)},rtl:function(r,i,u,c){ym(s).each(function(n){if(n.setBaseAndExtent)n.setBaseAndExtent(r.dom,i,u.dom,c);else if(n.extend)try{t=u,o=c,(e=n).collapse(r.dom,i),e.extend(t.dom,o)}catch(n){bm(s,u,c,r,i)}else bm(s,u,c,r,i);var e,t,o})}})}function wm(n){if(0r.innerHeight||n.bottom>r.innerHeight?Math.min(t,n.bottom-r.innerHeight+50):0;0!==e&&r.scrollTo(r.pageXOffset,r.pageYOffset+e)})}),Pm(i,o.innerHeight)});return Pm(i,o.innerHeight),{toEditing:function(){!function(n){n.focus();var e=fe.fromDom(n.document.body);(Po().exists(function(n){return k(["input","textarea"],le(n))})?function(n){pm.setTimeout(function(){n()},0)}:p)(function(){Po().each(Ho),No(e)})}(r)},destroy:function(){n.unbind()}}}function Gm(t,o){function r(){s(i)||(clearTimeout(i),i=null)}var i=null;return{cancel:r,throttle:function(){for(var n=[],e=0;e