(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-vendors"],{"00b4":function(e,t,n){"use strict";n("ac1f");var r=n("23e7"),i=n("c65b"),o=n("1626"),a=n("825a"),s=n("577e"),u=function(){var e=!1,t=/[ac]/;return t.exec=function(){return e=!0,/./.exec.apply(this,arguments)},!0===t.test("abc")&&e}(),c=/./.test;r({target:"RegExp",proto:!0,forced:!u},{test:function(e){var t=a(this),n=s(e),r=t.exec;if(!o(r))return i(c,t,n);var u=i(r,t,n);return null!==u&&(a(u),!0)}})},"00bb":function(e,t,n){(function(t,r,i){e.exports=r(n("21bf"),n("38ba"))})(0,(function(e){return e.mode.CFB=function(){var t=e.lib.BlockCipherMode.extend();function n(e,t,n,r){var i,o=this._iv;o?(i=o.slice(0),this._iv=void 0):i=this._prevBlock,r.encryptBlock(i,0);for(var a=0;a-1},H=function(e,t){for(var n=0,r=e.length;n=0;n--){var r=e[n];t(r,n)}},Y=function(e,t){for(var n=[],r=[],i=0,o=e.length;i=0&&t=t.length&&e.substr(n,n+t.length)===t},Fe=function(e,t){return He(e,t)?Le(e,t.length):e},je=function(e,t){return We(e,t)?e:Be(e,t)},Ve=function(e,t){return-1!==e.indexOf(t)},He=function(e,t){return $e(e,t,0)},We=function(e,t){return $e(e,t,e.length-t.length)},Ue=function(e){return function(t){return t.replace(e,"")}},qe=Ue(/^\s+|\s+$/g),Ge=function(e){return e.length>0},Ke=function(e){return!Ge(e)},Ye=function(e){return void 0!==e.style&&h(e.style.getPropertyValue)},Xe=function(e,t){var n=t||document,r=n.createElement("div");if(r.innerHTML=e,!r.hasChildNodes()||r.childNodes.length>1)throw console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return Qe(r.childNodes[0])},Je=function(e,t){var n=t||document,r=n.createElement(e);return Qe(r)},Ze=function(e,t){var n=t||document,r=n.createTextNode(e);return Qe(r)},Qe=function(e){if(null===e||void 0===e)throw new Error("Node cannot be null or undefined");return{dom:e}},et=function(e,t,n){return z.from(e.dom.elementFromPoint(t,n)).map(Qe)},tt={fromHtml:Xe,fromTag:Je,fromText:Ze,fromDom:Qe,fromPoint:et};"undefined"!==typeof window?window:Function("return this;")();var nt,rt=9,it=11,ot=1,at=3,st=function(e){var t=e.dom.nodeName;return t.toLowerCase()},ut=function(e){return e.dom.nodeType},ct=function(e){return function(t){return ut(t)===e}},lt=ct(ot),ft=ct(at),dt=ct(rt),ht=ct(it),pt=function(e){var t,n=!1;return function(){for(var r=[],i=0;i0&&t0}))},er=function(e){var t={},n=e.dom;if(Ye(n))for(var r=0;rr?t-r:0;return i};return{set:n,get:r,getOuter:i,aggregate:o,max:a}},or=ir("height",(function(e){var t=e.dom;return zn(e)?t.getBoundingClientRect().height:t.offsetHeight})),ar=function(e){return or.get(e)},sr=function(e){return or.getOuter(e)},ur=function(e,t){var n=["margin-top","border-top-width","padding-top","padding-bottom","border-bottom-width","margin-bottom"],r=or.max(e,t,n);Kn(e,"max-height",r+"px")},cr=function(e,t){var n=function(n,r){return cr(e+n,t+r)};return{left:e,top:t,translate:n}},lr=cr,fr=function(e){var t=e.getBoundingClientRect();return lr(t.left,t.top)},dr=function(e,t){return void 0!==e?e:void 0!==t?t:0},hr=function(e){var t=e.dom.ownerDocument,n=t.body,r=t.defaultView,i=t.documentElement;if(n===e.dom)return lr(n.offsetLeft,n.offsetTop);var o=dr(null===r||void 0===r?void 0:r.pageYOffset,i.scrollTop),a=dr(null===r||void 0===r?void 0:r.pageXOffset,i.scrollLeft),s=dr(i.clientTop,n.clientTop),u=dr(i.clientLeft,n.clientLeft);return pr(e).translate(a-u,o-s)},pr=function(e){var t=e.dom,n=t.ownerDocument,r=n.body;return r===t?lr(r.offsetLeft,r.offsetTop):zn(e)?fr(t):lr(0,0)},mr=ir("width",(function(e){return e.dom.offsetWidth})),vr=function(e,t){return mr.set(e,t)},gr=function(e){return mr.get(e)},br=function(e){return mr.getOuter(e)},yr=function(e,t){var n=["margin-left","border-left-width","padding-left","padding-right","border-right-width","margin-right"],r=mr.max(e,t,n);Kn(e,"max-width",r+"px")},wr=function(e,t,n,r,i,o,a){return{target:e,x:t,y:n,stop:r,prevent:i,kill:o,raw:a}},xr=function(e){var t=tt.fromDom(In(e).getOr(e.target)),n=function(){return e.stopPropagation()},r=function(){return e.preventDefault()},i=b(r,n);return wr(t,e.clientX,e.clientY,n,r,i,e)},_r=function(e,t){return function(n){e(n)&&t(xr(n))}},Cr=function(e,t,n,r,i){var o=_r(n,r);return e.dom.addEventListener(t,o,i),{unbind:C(Or,e,t,o,i)}},kr=function(e,t,n,r){return Cr(e,t,n,r,!1)},Sr=function(e,t,n,r){return Cr(e,t,n,r,!0)},Or=function(e,t,n,r){e.dom.removeEventListener(t,n,r)},Er=function(e,t){var n=gn(e);n.each((function(n){n.dom.insertBefore(t.dom,e.dom)}))},Tr=function(e,t){var n=wn(e);n.fold((function(){var n=gn(e);n.each((function(e){Mr(e,t)}))}),(function(e){Er(e,t)}))},Dr=function(e,t){var n=Cn(e);n.fold((function(){Mr(e,t)}),(function(n){e.dom.insertBefore(t.dom,n.dom)}))},Mr=function(e,t){e.dom.appendChild(t.dom)},Ar=function(e,t,n){_n(e,n).fold((function(){Mr(e,t)}),(function(e){Er(e,t)}))},Nr=function(e,t){G(t,(function(t){Er(e,t)}))},Pr=function(e,t){G(t,(function(t){Mr(e,t)}))},Ir=function(e){e.dom.textContent="",G(xn(e),(function(e){Rr(e)}))},Rr=function(e){var t=e.dom;null!==t.parentNode&&t.parentNode.removeChild(t)},zr=function(e){var t=xn(e);t.length>0&&Nr(e,t),Rr(e)},Br=function(e){var t=void 0!==e?e.dom:document,n=t.body.scrollLeft||t.documentElement.scrollLeft,r=t.body.scrollTop||t.documentElement.scrollTop;return lr(n,r)},Lr=function(e,t,n){var r=void 0!==n?n.dom:document,i=r.defaultView;i&&i.scrollTo(e,t)},$r=function(e){var t=void 0===e?window:e;return tn().browser.isFirefox()?z.none():z.from(t["visualViewport"])},Fr=function(e,t,n,r){return{x:e,y:t,width:n,height:r,right:e+n,bottom:t+r}},jr=function(e){var t=void 0===e?window:e,n=t.document,r=Br(tt.fromDom(n));return $r(t).fold((function(){var e=t.document.documentElement,n=e.clientWidth,i=e.clientHeight;return Fr(r.left,r.top,n,i)}),(function(e){return Fr(Math.max(e.pageLeft,r.left),Math.max(e.pageTop,r.top),e.width,e.height)}))},Vr=function(e,t){var n=e.view(t);return n.fold(w([]),(function(t){var n=e.owner(t),r=Vr(e,n);return[t].concat(r)}))},Hr=function(e,t){var n=t.owner(e),r=Vr(t,n);return z.some(r)},Wr=function(e){var t,n=e.dom===document?z.none():z.from(null===(t=e.dom.defaultView)||void 0===t?void 0:t.frameElement);return n.map(tt.fromDom)},Ur=function(e){return hn(e)},qr=Object.freeze({__proto__:null,view:Wr,owner:Ur}),Gr=function(e){var t=tt.fromDom(document),n=Br(t),r=Hr(e,qr);return r.fold(C(hr,e),(function(t){var r=pr(e),i=J(t,(function(e,t){var n=pr(t);return{left:e.left+n.left,top:e.top+n.top}}),{left:0,top:0});return lr(i.left+r.left+n.left,i.top+r.top+n.top)}))},Kr=function(e,t,n){return{point:e,width:t,height:n}},Yr=function(e,t,n,r){return{x:e,y:t,width:n,height:r}},Xr=function(e,t,n,r){return{x:e,y:t,width:n,height:r,right:e+n,bottom:t+r}},Jr=function(e){var t=hr(e),n=br(e),r=sr(e);return Xr(t.left,t.top,n,r)},Zr=function(e){var t=Gr(e),n=br(e),r=sr(e);return Xr(t.left,t.top,n,r)},Qr=function(){return jr(window)},ei=function(e){var t=function(t){return ei(e)},n=function(t){return ei(e)},r=function(t){return ei(t(e))},i=function(t){return ei(e)},o=function(t){t(e)},a=function(t){return t(e)},s=function(t,n){return n(e)},u=function(t){return t(e)},c=function(t){return t(e)},l=function(){return z.some(e)};return{isValue:E,isError:O,getOr:w(e),getOrThunk:w(e),getOrDie:w(e),or:t,orThunk:n,fold:s,map:r,mapError:i,each:o,bind:a,exists:u,forall:c,toOptional:l}},ti=function(e){var t=function(e){return e()},n=function(){return S(String(e))()},r=x,i=function(e){return e()},o=function(t){return ti(e)},a=function(t){return ti(t(e))},s=function(t){return ti(e)},u=function(t,n){return t(e)};return{isValue:O,isError:E,getOr:x,getOrThunk:t,getOrDie:n,or:r,orThunk:i,fold:u,map:o,mapError:a,each:v,bind:s,exists:O,forall:E,toOptional:z.none}},ni=function(e,t){return e.fold((function(){return ti(t)}),ei)},ri={value:ei,error:ti,fromOption:ni};(function(e){e[e["Error"]=0]="Error",e[e["Value"]=1]="Value"})(nt||(nt={}));var ii=function(e,t,n){return e.stype===nt.Error?t(e.serror):n(e.svalue)},oi=function(e){var t=[],n=[];return G(e,(function(e){ii(e,(function(e){return n.push(e)}),(function(e){return t.push(e)}))})),{values:t,errors:n}},ai=function(e,t){return e.stype===nt.Error?{stype:nt.Error,serror:t(e.serror)}:e},si=function(e,t){return e.stype===nt.Value?{stype:nt.Value,svalue:t(e.svalue)}:e},ui=function(e,t){return e.stype===nt.Value?t(e.svalue):e},ci=function(e,t){return e.stype===nt.Error?t(e.serror):e},li=function(e){return{stype:nt.Value,svalue:e}},fi=function(e){return{stype:nt.Error,serror:e}},di=function(e){return ii(e,ri.error,ri.value)},hi=function(e){return e.fold(fi,li)},pi={fromResult:hi,toResult:di,svalue:li,partition:oi,serror:fi,bind:ui,bindError:ci,map:si,mapError:ai,fold:ii},mi=function(e,t,n,r){return{tag:"field",key:e,newKey:t,presence:n,prop:r}},vi=function(e,t){return{tag:"custom",newKey:e,instantiator:t}},gi=function(e,t,n){switch(e.tag){case"field":return t(e.key,e.newKey,e.presence,e.prop);case"custom":return n(e.newKey,e.instantiator)}},bi=function(e,t){return t},yi=function(e,t){var n=a(e)&&a(t);return n?xi(e,t):t},wi=function(e){return function(){for(var t=[],n=0;n0?pi.svalue(xi(t,_i.apply(void 0,e))):pi.svalue(t)},Mi=function(e){return b(pi.serror,ne)(e)},Ai=function(e,t){var n=pi.partition(e);return n.errors.length>0?Mi(n.errors):Di(n.values,t)},Ni=function(e){var t=pi.partition(e);return t.errors.length>0?Mi(t.errors):pi.svalue(t.values)},Pi={consolidateObj:Ai,consolidateArr:Ni},Ii=function(e){return a(e)&&me(e).length>100?" removed due to size":JSON.stringify(e,null,2)},Ri=function(e){var t=e.length>10?e.slice(0,10).concat([{path:[],getErrorInfo:w("... (only showing first ten failures)")}]):e;return q(t,(function(e){return"Failed path: ("+e.path.join(" > ")+")\n"+e.getErrorInfo()}))},zi=function(e,t){return pi.serror([{path:e,getErrorInfo:t}])},Bi=function(e,t,n){return zi(e,(function(){return'Could not find valid *required* value for "'+t+'" in '+Ii(n)}))},Li=function(e,t){return zi(e,(function(){return'Choice schema did not contain choice key: "'+t+'"'}))},$i=function(e,t,n){return zi(e,(function(){return'The chosen schema: "'+n+'" did not exist in branches: '+Ii(t)}))},Fi=function(e,t){return zi(e,(function(){return"There are unsupported fields: ["+t.join(", ")+"] specified"}))},ji=function(e,t){return zi(e,w(t))},Vi=function(e){var t=function(t,n){return pi.bindError(e(n),(function(e){return ji(t,e)}))},n=w("val");return{extract:t,toString:n}},Hi=Vi(pi.svalue),Wi=function(e,t,n,r){return Oe(t,n).fold((function(){return Bi(e,n,t)}),r)},Ui=function(e,t,n,r){var i=Oe(e,t).getOrThunk((function(){return n(e)}));return r(i)},qi=function(e,t,n){return n(Oe(e,t))},Gi=function(e,t,n,r){var i=Oe(e,t).map((function(t){return!0===t?n(e):t}));return r(i)},Ki=function(e,t,n,r,i){var o=function(e){return i.extract(t.concat([r]),e)},a=function(e){return e.fold((function(){return pi.svalue(z.none())}),(function(e){var n=i.extract(t.concat([r]),e);return pi.map(n,z.some)}))};switch(e.tag){case"required":return Wi(t,n,r,o);case"defaultedThunk":return Ui(n,r,e.process,o);case"option":return qi(n,r,a);case"defaultedOptionThunk":return Gi(n,r,e.process,a);case"mergeWithThunk":return Ui(n,r,w({}),(function(t){var r=xi(e.process(n),t);return o(r)}))}},Yi=function(e,t,n){for(var r={},i=[],o=0,a=n;o0?pi.serror(i):pi.svalue(r)},Xi=function(e){var t=function(t,n){return e().extract(t,n)},n=function(){return e().toString()};return{extract:t,toString:n}},Ji=function(e){return me(_e(e,d))},Zi=function(e){var t=Qi(e),n=J(e,(function(e,t){return gi(t,(function(t){var n;return xi(e,(n={},n[t]=!0,n))}),w(e))}),{}),r=function(e,r){var i=c(r)?[]:Ji(r),o=X(i,(function(e){return!Te(n,e)}));return 0===o.length?t.extract(e,r):Fi(e,o)};return{extract:r,toString:t.toString}},Qi=function(e){var t=function(t,n){return Yi(t,n,e)},n=function(){var t=q(e,(function(e){return gi(e,(function(e,t,n,r){return e+" -> "+r.toString()}),(function(e,t){return"state("+e+")"}))}));return"obj{\n"+t.join("\n")+"}"};return{extract:t,toString:n}},eo=function(e){var t=function(t,n){var r=q(n,(function(n,r){return e.extract(t.concat(["["+r+"]"]),n)}));return Pi.consolidateArr(r)},n=function(){return"array("+e.toString()+")"};return{extract:t,toString:n}},to=function(e){var t=function(t,n){for(var r=[],i=0,o=e;i0?va(n.errors):ma(n.values,t)},ba=function(e){return h(e)?e:O},ya=function(e,t,n){var r=e.dom,i=ba(n);while(r.parentNode){r=r.parentNode;var o=tt.fromDom(r),a=t(o);if(a.isSome())return a;if(i(o))break}return z.none()},wa=function(e,t,n){var r=t(e),i=ba(n);return r.orThunk((function(){return i(e)?z.none():ya(e,t,i)}))},xa=function(e,t){return cn(e.element,t.event.target)},_a={can:E,abort:O,run:v},Ca=function(e){if(!Te(e,"can")&&!Te(e,"abort")&&!Te(e,"run"))throw new Error("EventHandler defined by: "+JSON.stringify(e,null,2)+" does not have can, abort, or run!");return D(D({},_a),e)},ka=function(e,t){return function(){for(var n=[],r=0;r1?X(t[n],(function(t){return H(e,(function(e){return e.name===t}))})).join(" > "):e[0].name;return ha(n,Iu(i,o))}))}));return ga(n,{})},qu="alloy.base.behaviour",Gu=Qi([Oo("dom","dom",Ci(),Qi([Do("tag"),Ko("styles",{}),Ko("classes",[]),Ko("attributes",{}),Fo("value"),Fo("innerHtml")])),Do("components"),Do("uid"),Ko("events",{}),Ko("apis",{}),Oo("eventOrder","eventOrder",Ti((sa={},sa[ts()]=["disabling",qu,"toggling","typeaheadevents"],sa[Ja()]=[qu,"focusing","keying"],sa[ss()]=[qu,"disabling","toggling","representing"],sa[Va()]=[qu,"representing","streaming","invalidating"],sa[hs()]=[qu,"representing","item-events","tooltipping"],sa[Pa()]=["focusing",qu,"item-type-events"],sa[Da()]=["focusing",qu,"item-type-events"],sa[Ba()]=["item-type-events","tooltipping"],sa[es()]=["receiving","reflecting","tooltipping"],sa)),oo()),Fo("domModification")]),Ku=function(e){return wo("custom.definition",Gu,e)},Yu=function(e){return D(D({},e.dom),{uid:e.uid,domChildren:q(e.components,(function(e){return e.element}))})},Xu=function(e){return e.domModification.fold((function(){return Mu({})}),Mu)},Ju=function(e){return e.events},Zu=function(e,t){var n=Vn(e,t);return void 0===n||""===n?[]:n.split(" ")},Qu=function(e,t,n){var r=Zu(e,t),i=r.concat([n]);return Fn(e,t,i.join(" ")),!0},ec=function(e,t,n){var r=X(Zu(e,t),(function(e){return e!==n}));return r.length>0?Fn(e,t,r.join(" ")):Un(e,t),!1},tc=function(e){return void 0!==e.dom.classList},nc=function(e){return Zu(e,"class")},rc=function(e,t){return Qu(e,"class",t)},ic=function(e,t){return ec(e,"class",t)},oc=function(e,t){tc(e)?e.dom.classList.add(t):rc(e,t)},ac=function(e){var t=tc(e)?e.dom.classList:nc(e);0===t.length&&Un(e,"class")},sc=function(e,t){if(tc(e)){var n=e.dom.classList;n.remove(t)}else ic(e,t);ac(e)},uc=function(e,t){return tc(e)&&e.dom.classList.contains(t)},cc=function(e,t){G(t,(function(t){oc(e,t)}))},lc=function(e,t){G(t,(function(t){sc(e,t)}))},fc=function(e,t){return ie(t,(function(t){return uc(e,t)}))},dc=function(e){return e.dom.value},hc=function(e,t){if(void 0===t)throw new Error("Value.set was undefined");e.dom.value=t},pc=function(e){var t=tt.fromTag(e.tag);jn(t,e.attributes),cc(t,e.classes),Yn(t,e.styles),e.innerHtml.each((function(e){return Ks(t,e)}));var n=e.domChildren;return Pr(t,n),e.value.each((function(e){hc(t,e)})),e.uid,lu(t,e.uid),t},mc=function(e){var t=Oe(e,"behaviours").getOr({});return re(me(t),(function(e){var n=t[e];return d(n)?[n.me]:[]}))},vc=function(e,t){return Ou(e,t)},gc=function(e){var t=mc(e);return vc(e,t)},bc=function(e,t,n){var r=Yu(e),i=Xu(e),o={"alloy.base.modification":i},a=t.length>0?Nu(n,o,t,r):i;return Au(r,a)},yc=function(e,t,n){var r={"alloy.base.behaviour":Ju(e)};return ju(n,e.eventOrder,t,r).getOrDie()},wc=function(e){var t=function(){return y},n=ia(mu),r=xo(Ku(e)),i=gc(e),o=Eu(i),a=Tu(i),s=bc(r,o,a),u=pc(s),c=yc(r,o,a),l=ia(r.components),f=function(e){n.set(e)},d=function(){n.set(pu(t))},p=function(){var e=xn(u),t=re(e,(function(e){return n.get().getByDom(e).fold((function(){return[]}),ue)}));l.set(t)},m=function(t){var n=a,r=h(n[t.name()])?n[t.name()]:function(){throw new Error("Could not find "+t.name()+" in "+JSON.stringify(e,null,2))};return r()},v=function(e){return h(a[e.name()])},g=function(){return r.apis},b=function(e){return a[e]().map((function(e){return e.state.readState()})).getOr("not enabled")},y={uid:e.uid,getSystem:n.get,config:m,hasConfigured:v,spec:e,readState:b,getApis:g,connect:f,disconnect:d,element:u,syncComponents:p,components:l.get,events:c};return y},xc=function(e){var t=Oe(e,"components").getOr([]);return q(t,Ec)},_c=function(e){var t=hu(e),n=t.events,r=M(t,["events"]),i=xc(r),o=D(D({},r),{events:D(D({},nu),n),components:i});return ri.value(wc(o))},Cc=function(e){var t=tt.fromText(e);return kc({element:t})},kc=function(e){var t=_o("external.component",Zi([Do("element"),Fo("uid")]),e),n=ia(pu()),r=function(e){n.set(e)},i=function(){n.set(pu((function(){return a})))},o=t.uid.getOrThunk((function(){return du("external")}));lu(t.element,o);var a={uid:o,getSystem:n.get,config:z.none,hasConfigured:O,connect:r,disconnect:i,getApis:function(){return{}},element:t.element,spec:e,readState:w("No state"),syncComponents:v,components:w([]),events:{}};return xu(a)},Sc=du,Oc=function(e){return Ee(e,"uid")},Ec=function(e){return _u(e).getOrThunk((function(){var t=Oc(e)?e:D({uid:Sc("")},e);return _c(t).getOrDie()}))},Tc=xu;function Dc(e,t,n,r,i){return e(n,r)?z.some(n):h(i)&&i(n)?z.none():t(n,r,i)}var Mc,Ac=function(e,t,n){var r=e.dom,i=h(n)?n:O;while(r.parentNode){r=r.parentNode;var o=tt.fromDom(r);if(t(o))return z.some(o);if(i(o))break}return z.none()},Nc=function(e,t,n){var r=function(e,t){return t(e)};return Dc(r,Ac,e,t,n)},Pc=function(e,t){var n=function(e){return t(tt.fromDom(e))},r=ee(e.dom.childNodes,n);return r.map(tt.fromDom)},Ic=function(e,t){var n=function(e){for(var r=0;r-1}));return t.bind((function(e){var t=Vn(e,"id"),n=Dn(e);return Lc(n,'[aria-owns="'+t+'"]')}))},jc=function(){var e=iu("aria-owns"),t=function(t){Fn(t,"aria-owns",e)},n=function(e){Un(e,"aria-owns")};return{id:e,link:t,unlink:n}},Vc=function(e,t){return Fc(t).exists((function(t){return Hc(e,t)}))},Hc=function(e,t){return Rc(t,(function(t){return cn(t,e.element)}),O)||Vc(e,t)},Wc="unknown";(function(e){e[e["STOP"]=0]="STOP",e[e["NORMAL"]=1]="NORMAL",e[e["LOGGING"]=2]="LOGGING"})(Mc||(Mc={}));var Uc=ia({}),qc=function(e,t){var n=[],r=(new Date).getTime();return{logEventCut:function(e,t,r){n.push({outcome:"cut",target:t,purpose:r})},logEventStopped:function(e,t,r){n.push({outcome:"stopped",target:t,purpose:r})},logNoParent:function(e,t,r){n.push({outcome:"no-parent",target:t,purpose:r})},logEventNoHandlers:function(e,t){n.push({outcome:"no-handlers-left",target:t})},logEventResponse:function(e,t,r){n.push({outcome:"response",purpose:r,target:t})},write:function(){var i=(new Date).getTime();V(["mousemove","mouseover","mouseout",ss()],e)||console.log(e,{event:e,time:i-r,target:t.dom,sequence:q(n,(function(e){return V(["cut","stopped","response"],e.outcome)?"{"+e.purpose+"} "+e.outcome+" at ("+Qs(e.target)+")":e.outcome}))})}}},Gc=function(e,t,n){var r=Oe(Uc.get(),e).orThunk((function(){var t=me(Uc.get());return pe(t,(function(t){return e.indexOf(t)>-1?z.some(Uc.get()[t]):z.none()}))})).getOr(Mc.NORMAL);switch(r){case Mc.NORMAL:return n(Zc());case Mc.LOGGING:var i=qc(e,t),o=n(i);return i.write(),o;case Mc.STOP:return!0}},Kc=["alloy/data/Fields","alloy/debugging/Debugging"],Yc=function(){var e=new Error;if(void 0!==e.stack){var t=e.stack.split("\n");return ee(t,(function(e){return e.indexOf("alloy")>0&&!H(Kc,(function(t){return e.indexOf(t)>-1}))})).getOr(Wc)}return Wc},Xc={logEventCut:v,logEventStopped:v,logNoParent:v,logEventNoHandlers:v,logEventResponse:v,write:v},Jc=function(e,t,n){return Gc(e,t,n)},Zc=w(Xc),Qc=w([Do("menu"),Do("selectedMenu")]),el=w([Do("item"),Do("selectedItem")]);w(Qi(el().concat(Qc())));var tl=w(Qi(el())),nl=Bo("initSize",[Do("numColumns"),Do("numRows")]),rl=function(){return Mo("markers",tl())},il=function(){return Bo("markers",[Do("backgroundMenu")].concat(Qc()).concat(el()))},ol=function(e){return Bo("markers",q(e,Do))},al=function(e,t,n){return Yc(),Oo(t,t,n,go((function(e){return ri.value((function(){for(var t=[],n=0;nr?n:i=n&&a<=i,h=s>=r&&s<=o,p=d&&h,m=u<=i&&u>=n,v=c<=o&&c>=r,g=m&&v,b=Math.min(l,a>=n?i-a:u-n),y=Math.min(f,s>=r?o-s:c-r);return{originInBounds:p,sizeInBounds:g,visibleW:b,visibleH:y}},Xf=function(e,t){var n=t.x,r=t.y,i=t.right,o=t.bottom,a=e.x,s=e.y,u=e.width,c=e.height,l=Math.max(n,i-u),f=Math.max(r,o-c),d=Tl(a,n,l),h=Tl(s,r,f),p=Math.min(d+u,i)-d,m=Math.min(h+c,o)-h;return Xr(d,h,p,m)},Jf=function(e,t,n){var r=w(t.bottom-n.y),i=w(n.bottom-t.y),o=gl(e,i,i,r),a=w(t.right-n.x),s=w(n.right-t.x),u=bl(e,s,s,a);return{maxWidth:u,maxHeight:o}},Zf=function(e,t,n,r){var i=e.bubble,o=i.offset,a=Al(r,e.restriction,o),s=e.x+o.left,u=e.y+o.top,c=Xr(s,u,t,n),l=Yf(c,a),f=l.originInBounds,d=l.sizeInBounds,h=l.visibleW,p=l.visibleH,m=f&&d,v=m?c:Xf(c,a),g=v.width>0&&v.height>0,b=Jf(e.direction,v,r),y=b.maxWidth,w=b.maxHeight,x={rect:v,maxHeight:w,maxWidth:y,direction:e.direction,placement:e.placement,classes:{on:i.classesOn,off:i.classesOff},layout:e.label,testY:u};return m||e.alwaysFit?Kf.fit(x):Kf.nofit(x,h,p,g)},Qf=function(e,t,n,r,i,o){var a=r.width,s=r.height,u=function(t,u,c,l,f){var d=t(n,r,i,e,o),h=Zf(d,a,s,o);return h.fold(w(h),(function(e,t,n,r){var i=f===r?n>l||t>c:!f&&r;return i?h:Kf.nofit(u,c,l,f)}))},c=Z(t,(function(e,t){var n=C(u,t);return e.fold(w(e),n)}),Kf.nofit({rect:n,maxHeight:r.height,maxWidth:r.width,direction:yl(),placement:"southeast",classes:{on:[],off:[]},layout:"none",testY:n.y},-1,-1,!1));return c.fold(x,x)},ed=function(e){var t=ia(z.none()),n=function(){return t.get().each(e)},r=function(){n(),t.set(z.none())},i=function(){return t.get().isSome()},o=function(){return t.get()},a=function(e){n(),t.set(z.some(e))};return{clear:r,isSet:i,get:o,set:a}},td=function(){return ed((function(e){return e.destroy()}))},nd=function(){return ed((function(e){return e.unbind()}))},rd=function(){var e=td(),t=function(t){return e.get().each(t)};return D(D({},e),{run:t})},id=function(){var e=ed(v),t=function(t){return e.get().each(t)};return D(D({},e),{on:t})},od=E,ad=function(e,t,n){return kr(e,t,od,n)},sd=function(e,t,n){return Sr(e,t,od,n)},ud=xr,cd=["top","bottom","right","left"],ld="data-alloy-transition-timer",fd=function(e,t){return fc(e,t.classes)},dd=function(e,t,n){return n.exists((function(n){var r=e.mode;return"all"===r||n[r]!==t[r]}))},hd=function(e,t){var n=function(e){return parseFloat(e).toFixed(3)};return ke(t,(function(t,r){var i=e[r].map(n),o=t.map(n);return!Me(i,o)})).isSome()},pd=function(e){var t=function(t){var n=Jn(e,t),r=o(n)?n.split(/\s*,\s*/):[];return X(r,Ge)},n=function(e){if(o(e)&&/^[\d.]+/.test(e)){var t=parseFloat(e);return We(e,"ms")?t:1e3*t}return 0},r=t("transition-delay"),i=t("transition-duration");return Z(i,(function(e,t,i){var o=n(r[i])+n(t);return Math.max(e,o)}),0)},md=function(e,t){var n,r=nd(),i=nd(),o=function(t){var n,r=null!==(n=t.raw.pseudoElement)&&void 0!==n?n:"";return cn(t.target,e)&&Ke(r)&&V(cd,t.raw.propertyName)},a=function(a){if(f(a)||o(a)){r.clear(),i.clear();var s=null===a||void 0===a?void 0:a.raw.type;(f(s)||s===qa())&&(clearTimeout(n),Un(e,ld),lc(e,t.classes))}},s=function(){r.set(ad(e,qa(),a)),i.set(ad(e,Ua(),a))};if("ontransitionstart"in e.dom)var u=ad(e,Ga(),(function(e){o(e)&&(u.unbind(),s())}));else s();var c=pd(e);requestAnimationFrame((function(){n=setTimeout(a,c+17),Fn(e,ld,n)}))},vd=function(e,t){cc(e,t.classes),Hn(e,ld).each((function(t){clearTimeout(parseInt(t,10)),Un(e,ld)})),md(e,t)},gd=function(e,t,n,r,i,o){var a=dd(r,i,o);if(a||fd(e,r)){Kn(e,"position",n.position);var s=Rf(t,e),u=If(t,D(D({},i),{rect:s})),c=se(cd,(function(e){return u[e]}));hd(n,c)&&(Xn(e,c),a&&vd(e,r),rr(e))}else lc(e,r.classes)},bd=function(e){return{width:br(e),height:sr(e)}},yd=function(e,t,n,r){nr(t,"max-height"),nr(t,"max-width");var i=bd(t);return Qf(t,r.preference,e,i,n,r.bounds)},wd=function(e,t){var n=t.classes;lc(e,n.off),cc(e,n.on)},xd=function(e,t,n){var r=n.maxHeightFunction;r(e,t.maxHeight)},_d=function(e,t,n){var r=n.maxWidthFunction;r(e,t.maxWidth)},Cd=function(e,t,n){var r=If(n.origin,t);n.transition.each((function(i){gd(e,n.origin,r,i,t,n.lastPlacement)})),Af(e,r)},kd=function(e,t){Uf(e,t.placement)},Sd=function(e,t){ur(e,Math.floor(t))},Od=w((function(e,t){Sd(e,t),Yn(e,{"overflow-x":"hidden","overflow-y":"auto"})})),Ed=w((function(e,t){Sd(e,t)})),Td=function(e,t,n){return void 0===e[t]?n:e[t]},Dd=function(e,t,n,r,i,o,a,s){var u=Td(a,"maxHeightFunction",Od()),c=Td(a,"maxWidthFunction",v),l=e.anchorBox,f=e.origin,d={bounds:zf(f,o),origin:f,preference:r,maxHeightFunction:u,maxWidthFunction:c,lastPlacement:i,transition:s};return Md(l,t,n,d)},Md=function(e,t,n,r){var i=yd(e,t,n,r);return Cd(t,i,r),kd(t,i),wd(t,i),xd(t,i,r),_d(t,i,r),{layout:i.layout,placement:i.placement}},Ad=["valignCentre","alignLeft","alignRight","alignCentre","top","bottom","left","right","inset"],Nd=function(e,t,n,r){void 0===r&&(r=1);var i=e*r,o=t*r,a=function(e){return Oe(n,e).getOr([])},s=function(e,t,n){var r=ae(Ad,n);return{offset:lr(e,t),classesOn:re(n,a),classesOff:re(r,a)}};return{southeast:function(){return s(-e,t,["top","alignLeft"])},southwest:function(){return s(e,t,["top","alignRight"])},south:function(){return s(-e/2,t,["top","alignCentre"])},northeast:function(){return s(-e,-t,["bottom","alignLeft"])},northwest:function(){return s(e,-t,["bottom","alignRight"])},north:function(){return s(-e/2,-t,["bottom","alignCentre"])},east:function(){return s(e,-t/2,["valignCentre","left"])},west:function(){return s(-e,-t/2,["valignCentre","right"])},insetNortheast:function(){return s(i,o,["top","alignLeft","inset"])},insetNorthwest:function(){return s(-i,o,["top","alignRight","inset"])},insetNorth:function(){return s(-i/2,o,["top","alignCentre","inset"])},insetSoutheast:function(){return s(i,-o,["bottom","alignLeft","inset"])},insetSouthwest:function(){return s(-i,-o,["bottom","alignRight","inset"])},insetSouth:function(){return s(-i/2,-o,["bottom","alignCentre","inset"])},insetEast:function(){return s(-i,-o/2,["valignCentre","right","inset"])},insetWest:function(){return s(i,-o/2,["valignCentre","left","inset"])}}},Pd=function(){return Nd(0,0,{})},Id=x,Rd=function(e,t){return function(n){return"rtl"===zd(n)?t:e}},zd=function(e){return"rtl"===Jn(e,"direction")?"rtl":"ltr"};(function(e){e["TopToBottom"]="toptobottom",e["BottomToTop"]="bottomtotop"})($f||($f={}));var Bd="data-alloy-vertical-dir",Ld=function(e){return Rc(e,(function(e){return lt(e)&&Vn(e,"data-alloy-vertical-dir")===$f.BottomToTop}))},$d=function(){return qo("layouts",[Do("onLtr"),Do("onRtl"),Fo("onBottomLtr"),Fo("onBottomRtl")])},Fd=function(e,t,n,r,i,o,a){var s=a.map(Ld).getOr(!1),u=t.layouts.map((function(t){return t.onLtr(e)})),c=t.layouts.map((function(t){return t.onRtl(e)})),l=s?t.layouts.bind((function(t){return t.onBottomLtr.map((function(t){return t(e)}))})).or(u).getOr(i):u.getOr(n),f=s?t.layouts.bind((function(t){return t.onBottomRtl.map((function(t){return t(e)}))})).or(c).getOr(o):c.getOr(r),d=Rd(l,f);return d(e)},jd=function(e,t,n){var r=t.hotspot,i=Rf(n,r.element),o=Fd(e.element,t,Ql(),ef(),Jl(),Zl(),z.some(t.hotspot.element));return z.some(Id({anchorBox:i,bubble:t.bubble.getOr(Pd()),overrides:t.overrides,layouts:o,placer:z.none()}))},Vd=[Do("hotspot"),Fo("bubble"),Ko("overrides",{}),$d(),fl("placement",jd)],Hd=function(e,t,n){var r=Bf(n,t.x,t.y),i=Xr(r.left,r.top,t.width,t.height),o=Fd(e.element,t,Yl(),Xl(),Yl(),Xl(),z.none());return z.some(Id({anchorBox:i,bubble:t.bubble,overrides:t.overrides,layouts:o,placer:z.none()}))},Wd=[Do("x"),Do("y"),Ko("height",0),Ko("width",0),Ko("bubble",Pd()),Ko("overrides",{}),$d(),fl("placement",Hd)],Ud=aa.generate([{screen:["point"]},{absolute:["point","scrollLeft","scrollTop"]}]),qd=function(e){return e.fold(x,(function(e,t,n){return e.translate(-t,-n)}))},Gd=function(e){return e.fold(x,x)},Kd=function(e){return Z(e,(function(e,t){return e.translate(t.left,t.top)}),lr(0,0))},Yd=function(e){var t=q(e,qd);return Kd(t)},Xd=function(e){var t=q(e,Gd);return Kd(t)},Jd=Ud.screen,Zd=Ud.absolute,Qd=function(e,t,n){var r=vn(n.root).dom,i=function(t){var n=hn(t),r=hn(e.element);return cn(n,r)};return z.from(r.frameElement).map(tt.fromDom).filter(i).map(hr)},eh=function(e,t,n){var r=hn(e.element),i=Br(r),o=Qd(e,t,n).getOr(i);return Zd(o,i.left,i.top)},th=function(e,t,n,r){var i=Jd(lr(e,t));return z.some(Kr(i,n,r))},nh=function(e,t,n,r,i){return e.map((function(e){var o=[t,e.point],a=Lf(r,(function(){return Xd(o)}),(function(){return Xd(o)}),(function(){return Yd(o)})),s=Yr(a.left,a.top,e.width,e.height),u=n.showAbove?Jl():Ql(),c=n.showAbove?Zl():ef(),l=Fd(i,n,u,c,u,c,z.none());return Id({anchorBox:s,bubble:n.bubble.getOr(Pd()),overrides:n.overrides,layouts:l,placer:z.none()})}))},rh=function(e,t,n){var r=eh(e,n,t);return t.node.filter(zn).bind((function(i){var o=i.dom.getBoundingClientRect(),a=th(o.left,o.top,o.width,o.height),s=t.node.getOr(e.element);return nh(a,r,t,n,s)}))},ih=[Do("node"),Do("root"),Fo("bubble"),$d(),Ko("overrides",{}),Ko("showAbove",!1),fl("placement",rh)],oh="\ufeff",ah=" ",sh=function(e,t,n,r){return{start:e,soffset:t,finish:n,foffset:r}},uh={create:sh},ch=aa.generate([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),lh=function(e,t,n,r){return e.fold(t,n,r)},fh=function(e){return e.fold(x,x,x)},dh=ch.before,hh=ch.on,ph=ch.after,mh={before:dh,on:hh,after:ph,cata:lh,getStart:fh},vh=aa.generate([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),gh=function(e){return vh.exact(e.start,e.soffset,e.finish,e.foffset)},bh=function(e){return e.match({domRange:function(e){return tt.fromDom(e.startContainer)},relative:function(e,t){return mh.getStart(e)},exact:function(e,t,n,r){return e}})},yh=vh.domRange,wh=vh.relative,xh=vh.exact,_h=function(e){var t=bh(e);return vn(t)},Ch=uh.create,kh={domRange:yh,relative:wh,exact:xh,exactFromRange:gh,getWin:_h,range:Ch},Sh=function(e,t){t.fold((function(t){e.setStartBefore(t.dom)}),(function(t,n){e.setStart(t.dom,n)}),(function(t){e.setStartAfter(t.dom)}))},Oh=function(e,t){t.fold((function(t){e.setEndBefore(t.dom)}),(function(t,n){e.setEnd(t.dom,n)}),(function(t){e.setEndAfter(t.dom)}))},Eh=function(e,t,n){var r=e.document.createRange();return Sh(r,t),Oh(r,n),r},Th=function(e,t,n,r,i){var o=e.document.createRange();return o.setStart(t.dom,n),o.setEnd(r.dom,i),o},Dh=function(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom,width:e.width,height:e.height}},Mh=function(e){var t=e.getClientRects(),n=t.length>0?t[0]:e.getBoundingClientRect();return n.width>0||n.height>0?z.some(n).map(Dh):z.none()},Ah=function(e){var t=e.getBoundingClientRect();return t.width>0||t.height>0?z.some(t).map(Dh):z.none()},Nh=aa.generate([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),Ph=function(e,t,n){return t(tt.fromDom(n.startContainer),n.startOffset,tt.fromDom(n.endContainer),n.endOffset)},Ih=function(e,t){return t.match({domRange:function(e){return{ltr:w(e),rtl:z.none}},relative:function(t,n){return{ltr:pt((function(){return Eh(e,t,n)})),rtl:pt((function(){return z.some(Eh(e,n,t))}))}},exact:function(t,n,r,i){return{ltr:pt((function(){return Th(e,t,n,r,i)})),rtl:pt((function(){return z.some(Th(e,r,i,t,n))}))}}})},Rh=function(e,t){var n=t.ltr();if(n.collapsed){var r=t.rtl().filter((function(e){return!1===e.collapsed}));return r.map((function(e){return Nh.rtl(tt.fromDom(e.endContainer),e.endOffset,tt.fromDom(e.startContainer),e.startOffset)})).getOrThunk((function(){return Ph(e,Nh.ltr,n)}))}return Ph(e,Nh.ltr,n)},zh=function(e,t){var n=Ih(e,t);return Rh(e,n)},Bh=function(e,t){var n=zh(e,t);return n.match({ltr:function(t,n,r,i){var o=e.document.createRange();return o.setStart(t.dom,n),o.setEnd(r.dom,i),o},rtl:function(t,n,r,i){var o=e.document.createRange();return o.setStart(r.dom,i),o.setEnd(t.dom,n),o}})};Nh.ltr,Nh.rtl;var Lh,$h=function(e,t){var n=function(n){if(!e(n))throw new Error("Can only get "+t+" value of a "+t+" node");return r(n).getOr("")},r=function(t){return e(t)?z.from(t.dom.nodeValue):z.none()},i=function(n,r){if(!e(n))throw new Error("Can only set raw "+t+" value of a "+t+" node");n.dom.nodeValue=r};return{get:n,getOption:r,set:i}},Fh=$h(ft,"text"),jh=function(e){return Fh.get(e)},Vh=function(e){return Fh.getOption(e)},Hh=function(e){return"img"===st(e)?1:Vh(e).fold((function(){return xn(e).length}),(function(e){return e.length}))},Wh=function(e){return Vh(e).filter((function(e){return 0!==e.trim().length||e.indexOf(ah)>-1})).isSome()},Uh=["img","br"],qh=function(e){var t=Wh(e);return t||V(Uh,st(e))},Gh=function(e){return Kh(e,qh)},Kh=function(e,t){var n=function(e){for(var r=xn(e),i=r.length-1;i>=0;i--){var o=r[i];if(t(o))return z.some(o);var a=n(o);if(a.isSome())return a}return z.none()};return n(e)},Yh=function(e,t){return sn(t,e)},Xh=function(e,t,n,r){var i=hn(e),o=i.dom.createRange();return o.setStart(e.dom,t),o.setEnd(n.dom,r),o},Jh=function(e,t,n,r){var i=Xh(e,t,n,r),o=cn(e,n)&&t===r;return i.collapsed&&!o},Zh=function(e){return z.from(e.getSelection())},Qh=function(e){if(e.rangeCount>0){var t=e.getRangeAt(0),n=e.getRangeAt(e.rangeCount-1);return z.some(uh.create(tt.fromDom(t.startContainer),t.startOffset,tt.fromDom(n.endContainer),n.endOffset))}return z.none()},ep=function(e){if(null===e.anchorNode||null===e.focusNode)return Qh(e);var t=tt.fromDom(e.anchorNode),n=tt.fromDom(e.focusNode);return Jh(t,e.anchorOffset,n,e.focusOffset)?z.some(uh.create(t,e.anchorOffset,n,e.focusOffset)):Qh(e)},tp=function(e){return Zh(e).filter((function(e){return e.rangeCount>0})).bind(ep)},np=function(e,t){var n=Bh(e,t);return Mh(n)},rp=function(e,t){var n=Bh(e,t);return Ah(n)},ip=function(e,t){return{element:e,offset:t}},op=function(e,t){var n=xn(e);if(0===n.length)return ip(e,t);if(t"})),oo()),_v=Eo("schema",(function(){return[Fo("preprocess")]})),Cv=Ko("defaults",w({})),kv=Ko("overrides",w({})),Sv=Qi([bv,yv,wv,xv,Cv,kv]),Ov=Qi([bv,yv,wv,Cv,kv]),Ev=Qi([bv,yv,wv,xv,Cv,kv]),Tv=Qi([bv,_v,wv,Do("unit"),xv,Cv,kv]),Dv=function(e){return e.fold(z.some,z.none,z.some,z.some)},Mv=function(e){var t=function(e){return e.name};return e.fold(t,t,t,t)},Av=function(e){return e.fold(x,x,x,x)},Nv=function(e,t){return function(n){var r=_o("Converting part type",t,n);return e(r)}},Pv=Nv(gv.required,Sv),Iv=Nv(gv.external,Ov),Rv=Nv(gv.optional,Ev),zv=Nv(gv.group,Tv),Bv=w("entirety"),Lv=Object.freeze({__proto__:null,required:Pv,external:Iv,optional:Rv,group:zv,asNamedPart:Dv,name:Mv,asCommon:Av,original:Bv}),$v=function(e,t,n,r){return xi(t.defaults(e,n,r),n,{uid:e.partUids[t.name]},t.overrides(e,n,r))},Fv=function(e,t,n){var r={},i={};return G(n,(function(e){e.fold((function(e){r[e.pname]=pv(!0,(function(t,n,r){return e.factory.sketch($v(t,e,n,r))}))}),(function(e){var n=t.parts[e.name];i[e.name]=w(e.factory.sketch($v(t,e,n[Bv()]),n))}),(function(e){r[e.pname]=pv(!1,(function(t,n,r){return e.factory.sketch($v(t,e,n,r))}))}),(function(e){r[e.pname]=mv(!0,(function(t,n,r){var i=t[e.name];return q(i,(function(n){return e.factory.sketch(xi(e.defaults(t,n,r),n,e.overrides(t,n)))}))}))}))})),{internals:w(r),externals:w(i)}},jv=function(e,t){var n={};return G(t,(function(t){Dv(t).each((function(t){var r=Vv(e,t.pname);n[t.name]=function(n){var i=_o("Part: "+t.name+" in "+e,Qi(t.schema),n);return D(D({},r),{config:n,validated:i})}}))})),n},Vv=function(e,t){return{uiType:vv(),owner:e,name:t}},Hv=function(e,t,n){return{uiType:vv(),owner:e,name:t,config:n,validated:{}}},Wv=function(e){return re(e,(function(e){return e.fold(z.none,z.some,z.none,z.none).map((function(e){return Bo(e.name,e.schema.concat([dl(Bv())]))})).toArray()}))},Uv=function(e){return q(e,Mv)},qv=function(e,t,n){return Fv(e,t,n)},Gv=function(e,t,n){return hv(z.some(e),t,t.components,n)},Kv=function(e,t,n){var r=t.partUids[n];return e.getSystem().getByUid(r).toOptional()},Yv=function(e,t,n){return Kv(e,t,n).getOrDie("Could not find part: "+n)},Xv=function(e,t,n){var r={},i=t.partUids,o=e.getSystem();return G(n,(function(e){r[e]=w(o.getByUid(i[e]))})),r},Jv=function(e,t){var n=e.getSystem();return be(t.partUids,(function(e,t){return w(n.getByUid(e))}))},Zv=function(e){return me(e.partUids)},Qv=function(e,t,n){var r={},i=t.partUids,o=e.getSystem();return G(n,(function(e){r[e]=w(o.getByUid(i[e]).getOrDie())})),r},eg=function(e,t){var n=Uv(t);return pa(q(n,(function(t){return{key:t,value:e+"-"+t}})))},tg=function(e){return Oo("partUids","partUids",Ei((function(t){return eg(t.uid,e)})),oo())},ng=Object.freeze({__proto__:null,generate:jv,generateOne:Hv,schemas:Wv,names:Uv,substitutes:qv,components:Gv,defaultUids:eg,defaultUidsSchema:tg,getAllParts:Jv,getAllPartNames:Zv,getPart:Kv,getPartOrDie:Yv,getParts:Xv,getPartsOrDie:Qv}),rg=function(e,t){var n=e.length>0?[Bo("parts",e)]:[];return n.concat([Do("uid"),Ko("dom",{}),Ko("components",[]),dl("originalSpec"),Ko("debug.sketcher",{})]).concat(t)},ig=function(e,t,n,r,i){var o=rg(r,i);return _o(e+" [SpecSchema]",Zi(o.concat(t)),n)},og=function(e,t,n,r){var i=ug(r),o=ig(e,t,i,[],[]);return n(o,i)},ag=function(e,t,n,r,i){var o=ug(i),a=Wv(n),s=tg(n),u=ig(e,t,o,a,[s]),c=qv(e,u,n),l=Gv(e,u,c.internals());return r(u,l,o,c.externals())},sg=function(e){return Ee(e,"uid")},ug=function(e){return sg(e)?e:D(D({},e),{uid:du("uid")})},cg=function(e){return void 0!==e.uid},lg=Zi([Do("name"),Do("factory"),Do("configFields"),Ko("apis",{}),Ko("extraApis",{})]),fg=Zi([Do("name"),Do("factory"),Do("configFields"),Do("partFields"),Ko("apis",{}),Ko("extraApis",{})]),dg=function(e){var t=_o("Sketcher for "+e.name,lg,e),n=function(e){return og(t.name,t.configFields,t.factory,e)},r=be(t.apis,Cu),i=be(t.extraApis,(function(e,t){return bu(e,t)}));return D(D({name:t.name,configFields:t.configFields,sketch:n},r),i)},hg=function(e){var t=_o("Sketcher for "+e.name,fg,e),n=function(e){return ag(t.name,t.configFields,t.partFields,t.factory,e)},r=jv(t.name,t.partFields),i=be(t.apis,Cu),o=be(t.extraApis,(function(e,t){return bu(e,t)}));return D(D({name:t.name,partFields:t.partFields,configFields:t.configFields,sketch:n,parts:r},i),o)},pg=function(e){return"input"===st(e)&&"radio"!==Vn(e,"type")||"textarea"===st(e)},mg=function(e,t,n){return t.find(e)},vg=Object.freeze({__proto__:null,getCurrent:mg}),gg=[Do("find")],bg=mf({fields:gg,name:"composing",apis:vg}),yg=["input","button","textarea","select"],wg=function(e,t,n){var r=t.disabled()?Tg:Dg;r(e,t)},xg=function(e,t){return!0===t.useNative&&V(yg,st(e.element))},_g=function(e){return Wn(e.element,"disabled")},Cg=function(e){Fn(e.element,"disabled","disabled")},kg=function(e){Un(e.element,"disabled")},Sg=function(e){return"true"===Vn(e.element,"aria-disabled")},Og=function(e){Fn(e.element,"aria-disabled","true")},Eg=function(e){Fn(e.element,"aria-disabled","false")},Tg=function(e,t,n){t.disableClass.each((function(t){oc(e.element,t)}));var r=xg(e,t)?Cg:Og;r(e),t.onDisabled(e)},Dg=function(e,t,n){t.disableClass.each((function(t){sc(e.element,t)}));var r=xg(e,t)?kg:Eg;r(e),t.onEnabled(e)},Mg=function(e,t){return xg(e,t)?_g(e):Sg(e)},Ag=function(e,t,n,r){var i=r?Tg:Dg;i(e,t)},Ng=Object.freeze({__proto__:null,enable:Dg,disable:Tg,isDisabled:Mg,onLoad:wg,set:Ag}),Pg=function(e,t){return Mu({classes:t.disabled()?t.disableClass.toArray():[]})},Ig=function(e,t){return Ts([Ds(ts(),(function(t,n){return Mg(t,e)})),sf(e,t,wg)])},Rg=Object.freeze({__proto__:null,exhibit:Pg,events:Ig}),zg=[ea("disabled",O),Ko("useNative",!0),Fo("disableClass"),sl("onDisabled"),sl("onEnabled")],Bg=mf({fields:zg,name:"disabling",active:Rg,apis:Ng}),Lg=function(e,t,n,r){var i=Yh(e.element,"."+t.highlightClass);G(i,(function(n){H(r,(function(e){return e.element===n}))||(sc(n,t.highlightClass),e.getSystem().getByDom(n).each((function(n){t.onDehighlight(e,n),_s(n,xs())})))}))},$g=function(e,t,n){return Lg(e,t,n,[])},Fg=function(e,t,n,r){qg(e,t,n,r)&&(sc(r.element,t.highlightClass),t.onDehighlight(e,r),_s(r,xs()))},jg=function(e,t,n,r){Lg(e,t,n,[r]),qg(e,t,n,r)||(oc(r.element,t.highlightClass),t.onHighlight(e,r),_s(r,ws()))},Vg=function(e,t,n){Yg(e,t).each((function(r){jg(e,t,n,r)}))},Hg=function(e,t,n){Xg(e,t).each((function(r){jg(e,t,n,r)}))},Wg=function(e,t,n,r){Kg(e,t,n,r).fold((function(e){throw e}),(function(r){jg(e,t,n,r)}))},Ug=function(e,t,n,r){var i=eb(e,t),o=ee(i,r);o.each((function(r){jg(e,t,n,r)}))},qg=function(e,t,n,r){return uc(r.element,t.highlightClass)},Gg=function(e,t,n){return Lc(e.element,"."+t.highlightClass).bind((function(t){return e.getSystem().getByDom(t).toOptional()}))},Kg=function(e,t,n,r){var i=Yh(e.element,"."+t.itemClass);return z.from(i[r]).fold((function(){return ri.error(new Error("No element found with index "+r))}),e.getSystem().getByDom)},Yg=function(e,t,n){return Lc(e.element,"."+t.itemClass).bind((function(t){return e.getSystem().getByDom(t).toOptional()}))},Xg=function(e,t,n){var r=Yh(e.element,"."+t.itemClass),i=r.length>0?z.some(r[r.length-1]):z.none();return i.bind((function(t){return e.getSystem().getByDom(t).toOptional()}))},Jg=function(e,t,n,r){var i=Yh(e.element,"."+t.itemClass),o=te(i,(function(e){return uc(e,t.highlightClass)}));return o.bind((function(t){var n=El(t,r,0,i.length-1);return e.getSystem().getByDom(i[n]).toOptional()}))},Zg=function(e,t,n){return Jg(e,t,n,-1)},Qg=function(e,t,n){return Jg(e,t,n,1)},eb=function(e,t,n){var r=Yh(e.element,"."+t.itemClass);return Ae(q(r,(function(t){return e.getSystem().getByDom(t).toOptional()})))},tb=Object.freeze({__proto__:null,dehighlightAll:$g,dehighlight:Fg,highlight:jg,highlightFirst:Vg,highlightLast:Hg,highlightAt:Wg,highlightBy:Ug,isHighlighted:qg,getHighlighted:Gg,getFirst:Yg,getLast:Xg,getPrevious:Zg,getNext:Qg,getCandidates:eb}),nb=[Do("highlightClass"),Do("itemClass"),sl("onHighlight"),sl("onDehighlight")],rb=mf({fields:nb,name:"highlighting",apis:tb}),ib=[8],ob=[9],ab=[13],sb=[27],ub=[32],cb=[37],lb=[38],fb=[39],db=[40],hb=function(e,t,n){var r=oe(e.slice(0,t)),i=oe(e.slice(t+1));return ee(r.concat(i),n)},pb=function(e,t,n){var r=oe(e.slice(0,t));return ee(r,n)},mb=function(e,t,n){var r=e.slice(0,t),i=e.slice(t+1);return ee(i.concat(r),n)},vb=function(e,t,n){var r=e.slice(t+1);return ee(r,n)},gb=function(e){return function(t){var n=t.raw;return V(e,n.which)}},bb=function(e){return function(t){return ie(e,(function(e){return e(t)}))}},yb=function(e){var t=e.raw;return!0===t.shiftKey},wb=function(e){var t=e.raw;return!0===t.ctrlKey},xb=k(yb),_b=function(e,t){return{matches:e,classification:t}},Cb=function(e,t){var n=ee(e,(function(e){return e.matches(t)}));return n.map((function(e){return e.classification}))},kb=function(e,t,n){var r=t.exists((function(e){return n.exists((function(t){return cn(t,e)}))}));r||Cs(e,vs(),{prevFocus:t,newFocus:n})},Sb=function(){var e=function(e){return Ef(e.element)},t=function(t,n){var r=e(t);t.getSystem().triggerFocus(n,t.element);var i=e(t);kb(t,r,i)};return{get:e,set:t}},Ob=function(){var e=function(e){return rb.getHighlighted(e).map((function(e){return e.element}))},t=function(t,n){var r=e(t);t.getSystem().getByDom(n).fold(v,(function(e){rb.highlight(t,e)}));var i=e(t);kb(t,r,i)};return{get:e,set:t}};(function(e){e["OnFocusMode"]="onFocus",e["OnEnterOrSpaceMode"]="onEnterOrSpace",e["OnApiMode"]="onApi"})(Lh||(Lh={}));var Eb=function(e,t,n,r,i){var o=function(){return e.concat([Ko("focusManager",Sb()),Yo("focusInside","onFocus",go((function(e){return V(["onFocus","onEnterOrSpace","onApi"],e)?ri.value(e):ri.error("Invalid value for focusInside")}))),fl("handler",u),fl("state",t),fl("sendFocusIn",i)])},a=function(e,t,n,r,i){var o=n(e,t,r,i);return Cb(o,t.event).bind((function(n){return n(e,t,r,i)}))},s=function(e,t){var o=e.focusInside!==Lh.OnFocusMode?z.none():i(e).map((function(n){return Ns(Ja(),(function(r,i){n(r,e,t),i.stop()}))})),s=function(n,r){var o=gb(ub.concat(ab))(r.event);e.focusInside===Lh.OnEnterOrSpaceMode&&o&&xa(n,r)&&i(e).each((function(i){i(n,e,t),r.stop()}))},u=[Ns(Fa(),(function(r,i){a(r,i,n,e,t).fold((function(){s(r,i)}),(function(e){i.stop()}))})),Ns(ja(),(function(n,i){a(n,i,r,e,t).each((function(e){i.stop()}))}))];return Ts(o.toArray().concat(u))},u={schema:o,processKey:a,toEvents:s};return u},Tb=function(e){var t=[Fo("onEscape"),Fo("onEnter"),Ko("selector",'[data-alloy-tabstop="true"]:not(:disabled)'),Ko("firstTabstop",0),Ko("useTabstopAt",E),Fo("visibilitySelector")].concat([e]),n=function(e,t){var n=e.visibilitySelector.bind((function(e){return $c(t,e)})).getOr(t);return ar(n)>0},r=function(e,t){var r=Yh(e.element,t.selector),i=X(r,(function(e){return n(t,e)}));return z.from(i[t.firstTabstop])},i=function(e,t){return t.focusManager.get(e).bind((function(e){return $c(e,t.selector)}))},o=function(e,t){return n(e,t)&&e.useTabstopAt(t)},a=function(e,t,n){r(e,t).each((function(n){t.focusManager.set(e,n)}))},s=function(e,t,n,r,i){return i(t,n,(function(e){return o(r,e)})).fold((function(){return r.cyclic?z.some(!0):z.none()}),(function(t){return r.focusManager.set(e,t),z.some(!0)}))},u=function(e,t,n,r){var o=Yh(e.element,n.selector);return i(e,n).bind((function(t){var i=te(o,C(cn,t));return i.bind((function(t){return s(e,o,t,n,r)}))}))},c=function(e,t,n){var r=n.cyclic?hb:pb;return u(e,t,n,r)},l=function(e,t,n){var r=n.cyclic?mb:vb;return u(e,t,n,r)},f=function(e,t,n){return n.onEnter.bind((function(n){return n(e,t)}))},d=function(e,t,n){return n.onEscape.bind((function(n){return n(e,t)}))},h=w([_b(bb([yb,gb(ob)]),c),_b(gb(ob),l),_b(gb(sb),d),_b(bb([xb,gb(ab)]),f)]),p=w([]);return Eb(t,ku.init,h,p,(function(){return z.some(a)}))},Db=Tb(Eo("cyclic",O)),Mb=Tb(Eo("cyclic",E)),Ab=function(e,t,n){return Ss(e,n,ts()),z.some(!0)},Nb=function(e,t,n){var r=pg(n)&&gb(ub)(t.event);return r?z.none():Ab(e,t,n)},Pb=function(e,t){return z.some(!0)},Ib=[Ko("execute",Nb),Ko("useSpace",!1),Ko("useEnter",!0),Ko("useControlEnter",!1),Ko("useDown",!1)],Rb=function(e,t,n){return n.execute(e,t,e.element)},zb=function(e,t,n,r){var i=n.useSpace&&!pg(e.element)?ub:[],o=n.useEnter?ab:[],a=n.useDown?db:[],s=i.concat(o).concat(a);return[_b(gb(s),Rb)].concat(n.useControlEnter?[_b(bb([wb,gb(ab)]),Rb)]:[])},Bb=function(e,t,n,r){return n.useSpace&&!pg(e.element)?[_b(gb(ub),Pb)]:[]},Lb=Eb(Ib,ku.init,zb,Bb,(function(){return z.none()})),$b=function(){var e=id(),t=function(t,n){e.set({numRows:t,numColumns:n})},n=function(){return e.get().map((function(e){return e.numRows}))},r=function(){return e.get().map((function(e){return e.numColumns}))};return Su({readState:function(){return e.get().map((function(e){return{numRows:String(e.numRows),numColumns:String(e.numColumns)}})).getOr({numRows:"?",numColumns:"?"})},setGridSize:t,getNumRows:n,getNumColumns:r})},Fb=function(e){return e.state(e)},jb=Object.freeze({__proto__:null,flatgrid:$b,init:Fb}),Vb=function(e){return function(t,n,r,i){var o=e(t.element);return qb(o,t,n,r,i)}},Hb=function(e,t){var n=Rd(e,t);return Vb(n)},Wb=function(e,t){var n=Rd(t,e);return Vb(n)},Ub=function(e){return function(t,n,r,i){return qb(e,t,n,r,i)}},qb=function(e,t,n,r,i){var o=r.focusManager.get(t).bind((function(n){return e(t.element,n,r,i)}));return o.map((function(e){return r.focusManager.set(t,e),!0}))},Gb=Ub,Kb=Ub,Yb=Ub,Xb=function(e){return e.offsetWidth<=0&&e.offsetHeight<=0},Jb=function(e){return!Xb(e.dom)},Zb=function(e,t){return te(e,t).map((function(t){return{index:t,candidates:e}}))},Qb=function(e,t,n){var r=function(e){return cn(e,t)},i=Yh(e,n),o=X(i,Jb);return Zb(o,r)},ey=function(e,t){return te(e,(function(e){return cn(t,e)}))},ty=function(e,t,n,r){var i=Math.floor(t/n),o=t%n;return r(i,o).bind((function(t){var r=t.row*n+t.column;return r>=0&&r1?z.some(e.slice(1)):z.none()}))},p=function(e){return Oe(n.get(),e)},m=function(e){return v(e).bind(Ux)},v=function(e){return Oe(t.get(),e)},g=function(t){return Oe(e.get(),t)},b=function(e){var t=i.get();return ae(me(t),e)},y=function(){return r.get().bind(m)},w=function(){return t.get()};return{setMenuBuilt:s,setContents:u,expand:d,refresh:p,collapse:h,lookupMenu:v,lookupItem:g,otherMenus:b,getPrimary:y,getMenus:w,clear:o,isClear:a,getTriggeringPath:f}},Ux=function(e){return"prepared"===e.type?z.some(e.menu):z.none()},qx={init:Wx,extractPreparedMenu:Ux},Gx=function(e,t){var n,r=id(),i=function(t,n,r){return be(r,(function(r,i){var o=function(){return Fx.sketch(D(D({},r),{value:i,markers:e.markers,fakeFocus:e.fakeFocus,onHighlight:e.onHighlight,focusManager:e.fakeFocus?Ob():Sb()}))};return i===n?{type:"prepared",menu:t.getSystem().build(o())}:{type:"notbuilt",nbMenu:o}}))},o=qx.init(),a=function(t){var n=i(t,e.data.primary,e.data.menus),r=c();return o.setContents(e.data.primary,n,e.data.expansions,r),o.getPrimary()},s=function(e){return ev.getValue(e).value},u=function(e,t,n){return pe(t,(function(e){if(!e.getSystem().isConnected())return z.none();var t=rb.getCandidates(e);return ee(t,(function(e){return s(e)===n}))}))},c=function(t){return be(e.data.menus,(function(e,t){return re(e.items,(function(e){return"separator"===e.type?[]:[e.data.value]}))}))},l=function(e,t){rb.highlight(e,t),rb.getHighlighted(t).orThunk((function(){return rb.getFirst(t)})).each((function(t){Ss(e,t.element,ns())}))},f=function(e,t){return Ae(q(t,(function(t){return e.lookupMenu(t).bind((function(e){return"prepared"===e.type?z.some(e.menu):z.none()}))})))},d=function(t,n,r){var i=f(n,n.otherMenus(r));G(i,(function(n){lc(n.element,[e.markers.backgroundMenu]),e.stayInDom||$w.remove(t,n)}))},h=function(t){return r.get().getOrThunk((function(){var n={},i=Yh(t.element,"."+e.markers.item),o=X(i,(function(e){return"true"===Vn(e,"aria-haspopup")}));return G(o,(function(e){t.getSystem().getByDom(e).each((function(e){var t=s(e);n[t]=e}))})),r.set(n),n}))},p=function(e,t){var n=h(e);ge(n,(function(e,n){var r=V(t,n);Fn(e.element,"aria-expanded",r)}))},m=function(t,n,r){return z.from(r[0]).bind((function(i){return n.lookupMenu(i).bind((function(i){if("notbuilt"===i.type)return z.none();var o=i.menu,a=f(n,r.slice(1));return G(a,(function(t){oc(t.element,e.markers.backgroundMenu)})),zn(o.element)||$w.append(t,Tc(o)),lc(o.element,[e.markers.backgroundMenu]),l(t,o),d(t,n,r),z.some(o)}))}))};(function(e){e[e["HighlightSubmenu"]=0]="HighlightSubmenu",e[e["HighlightParent"]=1]="HighlightParent"})(n||(n={}));var g=function(e,t,n){if("notbuilt"===n.type){var r=e.getSystem().build(n.nbMenu());return o.setMenuBuilt(t,r),r}return n.menu},b=function(t,r,i){if(void 0===i&&(i=n.HighlightSubmenu),r.hasConfigured(Bg)&&Bg.isDisabled(r))return z.some(r);var a=s(r);return o.expand(a).bind((function(a){return p(t,a),z.from(a[0]).bind((function(s){return o.lookupMenu(s).bind((function(u){var c=g(t,s,u);return zn(c.element)||$w.append(t,Tc(c)),e.onOpenSubmenu(t,r,c,oe(a)),i===n.HighlightSubmenu?(rb.highlightFirst(c),m(t,o,a)):(rb.dehighlightAll(c),z.some(r))}))}))}))},y=function(t,n){var r=s(n);return o.collapse(r).bind((function(r){return p(t,r),m(t,o,r).map((function(r){return e.onCollapseMenu(t,n,r),r}))}))},w=function(e,t){var n=s(t);return o.refresh(n).bind((function(t){return p(e,t),m(e,o,t)}))},x=function(e,t){return pg(t.element)?z.none():b(e,t,n.HighlightSubmenu)},_=function(e,t){return pg(t.element)?z.none():y(e,t)},C=function(t,n){return y(t,n).orThunk((function(){return e.onEscape(t,n).map((function(){return t}))}))},k=function(t){return function(n,r){return $c(r.getSource(),"."+e.markers.item).bind((function(e){return n.getSystem().getByDom(e).toOptional().bind((function(e){return t(n,e).map(E)}))}))}},S=Ts([Ns(Lx(),(function(e,t){var n=t.event.item;o.lookupItem(s(n)).each((function(){var n=t.event.menu;rb.highlight(e,n);var r=s(t.event.item);o.refresh(r).each((function(t){return d(e,o,t)}))}))})),Us((function(t,r){var i=r.event.target;t.getSystem().getByDom(i).each((function(r){var i=s(r);0===i.indexOf("collapse-item")&&y(t,r),b(t,r,n.HighlightSubmenu).fold((function(){e.onExecute(t,r)}),v)}))})),Vs((function(t,n){a(t).each((function(n){$w.append(t,Tc(n)),e.onOpenMenu(t,n),e.highlightImmediately&&l(t,n)}))}))].concat(e.navigateOnHover?[Ns(_x(),(function(t,r){var i=r.event.item;w(t,i),b(t,i,n.HighlightParent),e.onHover(t,i)}))]:[])),O=function(e){return rb.getHighlighted(e).bind(rb.getHighlighted)},T=function(e){O(e).each((function(t){y(e,t)}))},M=function(e){o.getPrimary().each((function(t){l(e,t)}))},A=function(e){return z.from(e.components()[0]).filter((function(e){return"menu"===Vn(e.element,"role")}))},N=function(t){var n=o.getPrimary().bind((function(e){return O(t).bind((function(e){var n=s(e),r=Se(o.getMenus()),i=Ae(q(r,qx.extractPreparedMenu));return o.getTriggeringPath(n,(function(e){return u(t,i,e)}))})).map((function(t){return{primary:e,triggeringPath:t}}))}));n.fold((function(){A(t).each((function(n){e.onRepositionMenu(t,n,[])}))}),(function(n){var r=n.primary,i=n.triggeringPath;e.onRepositionMenu(t,r,i)}))},P={collapseMenu:T,highlightPrimary:M,repositionMenus:N};return{uid:e.uid,dom:e.dom,markers:e.markers,behaviours:rv(e.tmenuBehaviours,[Dw.config({mode:"special",onRight:k(x),onLeft:k(_),onEscape:k(C),focusIn:function(e,t){o.getPrimary().each((function(t){Ss(e,t.element,ns())}))}}),rb.config({highlightClass:e.markers.selectedMenu,itemClass:e.markers.menu}),bg.config({find:function(e){return rb.getHighlighted(e)}}),$w.config({})]),eventOrder:e.eventOrder,apis:P,events:S}},Kx=w("collapse-item"),Yx=function(e,t,n){return{primary:e,menus:t,expansions:n}},Xx=function(e,t){return{primary:e,menus:ha(e,t),expansions:{}}},Jx=function(e){return{value:iu(Kx()),meta:{text:e}}},Zx=dg({name:"TieredMenu",configFields:[ll("onExecute"),ll("onEscape"),cl("onOpenMenu"),cl("onOpenSubmenu"),sl("onRepositionMenu"),sl("onCollapseMenu"),Ko("highlightImmediately",!0),Bo("data",[Do("primary"),Do("menus"),Do("expansions")]),Ko("fakeFocus",!1),sl("onHighlight"),sl("onHover"),il(),Do("dom"),Ko("navigateOnHover",!0),Ko("stayInDom",!1),tv("tmenuBehaviours",[Dw,rb,bg,$w]),Ko("eventOrder",{})],apis:{collapseMenu:function(e,t){e.collapseMenu(t)},highlightPrimary:function(e,t){e.highlightPrimary(t)},repositionMenus:function(e,t){e.repositionMenus(t)}},factory:Gx,extraApis:{tieredData:Yx,singleData:Xx,collapseItem:Jx}}),Qx=function(e,t,n,r,i){var o=function(){return e.lazySink(t)},a="horizontal"===r.type?{layouts:{onLtr:function(){return Ql()},onRtl:function(){return ef()}}}:{},s=function(e){return 2===e.length},u=function(e){return s(e)?a:{}};return Zx.sketch({dom:{tag:"div"},data:r.data,markers:r.menu.markers,highlightImmediately:r.menu.highlightImmediately,onEscape:function(){return bm.close(t),e.onEscape.map((function(e){return e(t)})),z.some(!0)},onExecute:function(){return z.some(!0)},onOpenMenu:function(e,t){Lp.positionWithinBounds(o().getOrDie(),t,n,i())},onOpenSubmenu:function(e,t,n,r){var i=o().getOrDie();Lp.position(i,n,{anchor:D({type:"submenu",item:t},u(r))})},onRepositionMenu:function(e,t,r){var a=o().getOrDie();Lp.positionWithinBounds(a,t,n,i()),G(r,(function(e){var t=u(e.triggeringPath);Lp.position(a,e.triggeredMenu,{anchor:D({type:"submenu",item:e.triggeringItem},t)})}))}})},e_=function(e,t){var n=function(t,n){var r=e.getRelated(t);return r.exists((function(e){return Hc(e,n)}))},r=function(e,t){bm.setContent(e,t)},i=function(e,t,n){o(e,t,n,z.none())},o=function(e,t,n,r){a(e,t,n,(function(){return r.map((function(e){return Jr(e)}))}))},a=function(t,n,r,i){var o=e.lazySink(t).getOrDie();bm.openWhileCloaked(t,n,(function(){return Lp.positionWithinBounds(o,t,r,i())})),ev.setValue(t,z.some({mode:"position",config:r,getBounds:i}))},s=function(e,t,n){u(e,t,n,z.none)},u=function(t,n,r,i){var o=Qx(e,t,n,r,i);bm.open(t,o),ev.setValue(t,z.some({mode:"menu",menu:o}))},c=function(e){bm.isOpen(e)&&(ev.setValue(e,z.none()),bm.close(e))},l=function(e){return bm.getState(e)},f=function(t){bm.isOpen(t)&&ev.getValue(t).each((function(n){switch(n.mode){case"menu":bm.getState(t).each(Zx.repositionMenus);break;case"position":var r=e.lazySink(t).getOrDie();Lp.positionWithinBounds(r,t,n.config,n.getBounds());break}}))},d={setContent:r,showAt:i,showWithin:o,showWithinBounds:a,showMenuAt:s,showMenuWithinBounds:u,hide:c,getContent:l,reposition:f,isOpen:bm.isOpen};return{uid:e.uid,dom:e.dom,behaviours:rv(e.inlineBehaviours,[bm.config({isPartOf:function(e,t,r){return Hc(t,r)||n(e,r)},getAttachPoint:function(t){return e.lazySink(t).getOrDie()},onOpen:function(t){e.onShow(t)},onClose:function(t){e.onHide(t)}}),ev.config({store:{mode:"memory",initialValue:z.none()}}),yf.config({channels:D(D({},Cm(D({isExtraPart:t.isExtraPart},e.fireDismissalEventInstead.map((function(e){return{fireEventInstead:{event:e.event}}})).getOr({})))),Sm(D(D({},e.fireRepositionEventInstead.map((function(e){return{fireEventInstead:{event:e.event}}})).getOr({})),{doReposition:f})))})]),eventOrder:e.eventOrder,apis:d}},t_=dg({name:"InlineView",configFields:[Do("lazySink"),sl("onShow"),sl("onHide"),Wo("onEscape"),tv("inlineBehaviours",[bm,ev,yf]),qo("fireDismissalEventInstead",[Ko("event",ps())]),qo("fireRepositionEventInstead",[Ko("event",ms())]),Ko("getRelated",z.none),Ko("isExtraPart",O),Ko("eventOrder",z.none)],factory:e_,apis:{showAt:function(e,t,n,r){e.showAt(t,n,r)},showWithin:function(e,t,n,r,i){e.showWithin(t,n,r,i)},showWithinBounds:function(e,t,n,r,i){e.showWithinBounds(t,n,r,i)},showMenuAt:function(e,t,n,r){e.showMenuAt(t,n,r)},showMenuWithinBounds:function(e,t,n,r,i){e.showMenuWithinBounds(t,n,r,i)},hide:function(e,t){e.hide(t)},isOpen:function(e,t){return e.isOpen(t)},getContent:function(e,t){return e.getContent(t)},setContent:function(e,t,n){e.setContent(t,n)},reposition:function(e,t){e.reposition(t)}}}),n_="layout-inset",r_=function(e){return e.x},i_=function(e,t){return e.x+e.width/2-t.width/2},o_=function(e,t){return e.x+e.width-t.width},a_=function(e){return e.y},s_=function(e,t){return e.y+e.height-t.height},u_=function(e,t){return e.y+e.height/2-t.height/2},c_=function(e,t,n){return pl(o_(e,t),s_(e,t),n.insetSouthwest(),_l(),"southwest",Ml(e,{right:0,bottom:3}),n_)},l_=function(e,t,n){return pl(r_(e),s_(e,t),n.insetSoutheast(),xl(),"southeast",Ml(e,{left:1,bottom:3}),n_)},f_=function(e,t,n){return pl(o_(e,t),a_(e),n.insetNorthwest(),wl(),"northwest",Ml(e,{right:0,top:2}),n_)},d_=function(e,t,n){return pl(r_(e),a_(e),n.insetNortheast(),yl(),"northeast",Ml(e,{left:1,top:2}),n_)},h_=function(e,t,n){return pl(i_(e,t),a_(e),n.insetNorth(),Cl(),"north",Ml(e,{top:2}),n_)},p_=function(e,t,n){return pl(i_(e,t),s_(e,t),n.insetSouth(),kl(),"south",Ml(e,{bottom:3}),n_)},m_=function(e,t,n){return pl(o_(e,t),u_(e,t),n.insetEast(),Ol(),"east",Ml(e,{right:0}),n_)},v_=function(e,t,n){return pl(r_(e),u_(e,t),n.insetWest(),Sl(),"west",Ml(e,{left:1}),n_)},g_=function(e){switch(e){case"north":return h_;case"northeast":return d_;case"northwest":return f_;case"south":return p_;case"southeast":return l_;case"southwest":return c_;case"east":return m_;case"west":return v_}},b_=function(e,t,n,r,i){var o=qf(r).map(g_).getOr(h_);return o(e,t,n,r,i)},y_=function(e){switch(e){case"north":return p_;case"northeast":return l_;case"northwest":return c_;case"south":return h_;case"southeast":return d_;case"southwest":return f_;case"east":return v_;case"west":return m_}},w_=function(e,t,n,r,i){var o=qf(r).map(y_).getOr(h_);return o(e,t,n,r,i)},x_=tinymce.util.Tools.resolve("tinymce.util.Delay"),__=function(e){var t=gx(e.action),n=e.dom.tag,r=function(t){return Oe(e.dom,"attributes").bind((function(e){return Oe(e,t)}))},i=function(){if("button"===n){var e=r("type").getOr("button"),t=r("role").map((function(e){return{role:e}})).getOr({});return D({type:e},t)}var i=r("role").getOr("button");return{role:i}};return{uid:e.uid,dom:e.dom,components:e.components,events:t,behaviours:iv.augment(e.buttonBehaviours,[Xw.config({}),Dw.config({mode:"execution",useSpace:!0,useEnter:!0})]),domModification:{attributes:i()},eventOrder:e.eventOrder}},C_=dg({name:"Button",factory:__,configFields:[Ko("uid",void 0),Do("dom"),Ko("components",[]),iv.field("buttonBehaviours",[Xw,Dw]),Fo("action"),Fo("role"),Ko("eventOrder",{})]}),k_=function(e){var t=void 0!==e.dom.attributes?e.dom.attributes:[];return Z(t,(function(e,t){var n;return"class"===t.name?e:D(D({},e),(n={},n[t.name]=t.value,n))}),{})},S_=function(e){return Array.prototype.slice.call(e.dom.classList,0)},O_=function(e){var t=tt.fromHtml(e),n=xn(t),r=k_(t),i=S_(t),o=0===n.length?{}:{innerHtml:Gs(t)};return D({tag:st(t),classes:i,attributes:r},o)},E_=function(e){var t=cg(e)&&Te(e,"uid")?e.uid:du("memento"),n=function(e){return e.getSystem().getByUid(t).getOrDie()},r=function(e){return e.getSystem().getByUid(t).toOptional()},i=function(){return D(D({},e),{uid:t})};return{get:n,getOpt:r,asSpec:i}};function T_(e){return T_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},T_(e)}function D_(e,t){return D_=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},D_(e,t)}function M_(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function A_(e,t,n){return A_=M_()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=Function.bind.apply(e,r),o=new i;return n&&D_(o,n.prototype),o},A_.apply(null,arguments)}function N_(e){return P_(e)||I_(e)||R_(e)||B_()}function P_(e){if(Array.isArray(e))return z_(e)}function I_(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function R_(e,t){if(e){if("string"===typeof e)return z_(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?z_(e,t):void 0}}function z_(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1?n-1:0),i=1;i/gm),CC=W_(/^data-[\-\w.\u00B7-\uFFFF]/),kC=W_(/^aria-[\-\w]+$/),SC=W_(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),OC=W_(/^(?:\w+script|data):/i),EC=W_(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),TC=W_(/^html$/i),DC=function(){return"undefined"===typeof window?null:window},MC=function(e,t){if("object"!==T_(e)||"function"!==typeof e.createPolicy)return null;var n=null,r="data-tt-policy-suffix";t.currentScript&&t.currentScript.hasAttribute(r)&&(n=t.currentScript.getAttribute(r));var i="dompurify"+(n?"#"+n:"");try{return e.createPolicy(i,{createHTML:function(e){return e}})}catch(o){return console.warn("TrustedTypes policy "+i+" could not be created."),null}};function AC(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:DC(),t=function(e){return AC(e)};if(t.version="2.3.8",t.removed=[],!e||!e.document||9!==e.document.nodeType)return t.isSupported=!1,t;var n=e.document,r=e.document,i=e.DocumentFragment,o=e.HTMLTemplateElement,a=e.Node,s=e.Element,u=e.NodeFilter,c=e.NamedNodeMap,l=void 0===c?e.NamedNodeMap||e.MozNamedAttrMap:c,f=e.HTMLFormElement,d=e.DOMParser,h=e.trustedTypes,p=s.prototype,m=cC(p,"cloneNode"),v=cC(p,"nextSibling"),g=cC(p,"childNodes"),b=cC(p,"parentNode");if("function"===typeof o){var y=r.createElement("template");y.content&&y.content.ownerDocument&&(r=y.content.ownerDocument)}var w=MC(h,n),x=w?w.createHTML(""):"",_=r,C=_.implementation,k=_.createNodeIterator,S=_.createDocumentFragment,O=_.getElementsByTagName,E=n.importNode,T={};try{T=uC(r).documentMode?r.documentMode:{}}catch(je){}var D={};t.isSupported="function"===typeof b&&C&&"undefined"!==typeof C.createHTMLDocument&&9!==T;var M,A,N=xC,P=_C,I=CC,R=kC,z=OC,B=EC,L=SC,$=null,F=sC({},[].concat(N_(lC),N_(fC),N_(dC),N_(pC),N_(vC))),j=null,V=sC({},[].concat(N_(gC),N_(bC),N_(yC),N_(wC))),H=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),W=null,U=null,q=!0,G=!0,K=!1,Y=!1,X=!1,J=!1,Z=!1,Q=!1,ee=!1,te=!1,ne=!0,re=!0,ie=!1,oe={},ae=null,se=sC({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),ue=null,ce=sC({},["audio","video","img","source","image","track"]),le=null,fe=sC({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),de="http://www.w3.org/1998/Math/MathML",he="http://www.w3.org/2000/svg",pe="http://www.w3.org/1999/xhtml",me=pe,ve=!1,ge=["application/xhtml+xml","text/html"],be="text/html",ye=null,we=r.createElement("form"),xe=function(e){return e instanceof RegExp||e instanceof Function},_e=function(e){ye&&ye===e||(e&&"object"===T_(e)||(e={}),e=uC(e),$="ALLOWED_TAGS"in e?sC({},e.ALLOWED_TAGS):F,j="ALLOWED_ATTR"in e?sC({},e.ALLOWED_ATTR):V,le="ADD_URI_SAFE_ATTR"in e?sC(uC(fe),e.ADD_URI_SAFE_ATTR):fe,ue="ADD_DATA_URI_TAGS"in e?sC(uC(ce),e.ADD_DATA_URI_TAGS):ce,ae="FORBID_CONTENTS"in e?sC({},e.FORBID_CONTENTS):se,W="FORBID_TAGS"in e?sC({},e.FORBID_TAGS):{},U="FORBID_ATTR"in e?sC({},e.FORBID_ATTR):{},oe="USE_PROFILES"in e&&e.USE_PROFILES,q=!1!==e.ALLOW_ARIA_ATTR,G=!1!==e.ALLOW_DATA_ATTR,K=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Y=e.SAFE_FOR_TEMPLATES||!1,X=e.WHOLE_DOCUMENT||!1,Q=e.RETURN_DOM||!1,ee=e.RETURN_DOM_FRAGMENT||!1,te=e.RETURN_TRUSTED_TYPE||!1,Z=e.FORCE_BODY||!1,ne=!1!==e.SANITIZE_DOM,re=!1!==e.KEEP_CONTENT,ie=e.IN_PLACE||!1,L=e.ALLOWED_URI_REGEXP||L,me=e.NAMESPACE||pe,e.CUSTOM_ELEMENT_HANDLING&&xe(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(H.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&xe(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(H.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"===typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(H.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),M=M=-1===ge.indexOf(e.PARSER_MEDIA_TYPE)?be:e.PARSER_MEDIA_TYPE,A="application/xhtml+xml"===M?function(e){return e}:Z_,Y&&(G=!1),ee&&(Q=!0),oe&&($=sC({},N_(vC)),j=[],!0===oe.html&&(sC($,lC),sC(j,gC)),!0===oe.svg&&(sC($,fC),sC(j,bC),sC(j,wC)),!0===oe.svgFilters&&(sC($,dC),sC(j,bC),sC(j,wC)),!0===oe.mathMl&&(sC($,pC),sC(j,yC),sC(j,wC))),e.ADD_TAGS&&($===F&&($=uC($)),sC($,e.ADD_TAGS)),e.ADD_ATTR&&(j===V&&(j=uC(j)),sC(j,e.ADD_ATTR)),e.ADD_URI_SAFE_ATTR&&sC(le,e.ADD_URI_SAFE_ATTR),e.FORBID_CONTENTS&&(ae===se&&(ae=uC(ae)),sC(ae,e.FORBID_CONTENTS)),re&&($["#text"]=!0),X&&sC($,["html","head","body"]),$.table&&(sC($,["tbody"]),delete W.tbody),H_&&H_(e),ye=e)},Ce=sC({},["mi","mo","mn","ms","mtext"]),ke=sC({},["foreignobject","desc","title","annotation-xml"]),Se=sC({},["title","style","font","a","script"]),Oe=sC({},fC);sC(Oe,dC),sC(Oe,hC);var Ee=sC({},pC);sC(Ee,mC);var Te=function(e){var t=b(e);t&&t.tagName||(t={namespaceURI:pe,tagName:"template"});var n=Z_(e.tagName),r=Z_(t.tagName);return e.namespaceURI===he?t.namespaceURI===pe?"svg"===n:t.namespaceURI===de?"svg"===n&&("annotation-xml"===r||Ce[r]):Boolean(Oe[n]):e.namespaceURI===de?t.namespaceURI===pe?"math"===n:t.namespaceURI===he?"math"===n&&ke[r]:Boolean(Ee[n]):e.namespaceURI===pe&&(!(t.namespaceURI===he&&!ke[r])&&(!(t.namespaceURI===de&&!Ce[r])&&(!Ee[n]&&(Se[n]||!Oe[n]))))},De=function(e){J_(t.removed,{element:e});try{e.parentNode.removeChild(e)}catch(je){try{e.outerHTML=x}catch(je){e.remove()}}},Me=function(e,n){try{J_(t.removed,{attribute:n.getAttributeNode(e),from:n})}catch(je){J_(t.removed,{attribute:null,from:n})}if(n.removeAttribute(e),"is"===e&&!j[e])if(Q||ee)try{De(n)}catch(je){}else try{n.setAttribute(e,"")}catch(je){}},Ae=function(e){var t,n;if(Z)e=""+e;else{var i=Q_(e,/^[\r\n\t ]+/);n=i&&i[0]}"application/xhtml+xml"===M&&(e=''+e+"");var o=w?w.createHTML(e):e;if(me===pe)try{t=(new d).parseFromString(o,M)}catch(je){}if(!t||!t.documentElement){t=C.createDocument(me,"template",null);try{t.documentElement.innerHTML=ve?"":o}catch(je){}}var a=t.body||t.documentElement;return e&&n&&a.insertBefore(r.createTextNode(n),a.childNodes[0]||null),me===pe?O.call(t,X?"html":"body")[0]:X?t.documentElement:a},Ne=function(e){return k.call(e.ownerDocument||e,e,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT,null,!1)},Pe=function(e){return e instanceof f&&("string"!==typeof e.nodeName||"string"!==typeof e.textContent||"function"!==typeof e.removeChild||!(e.attributes instanceof l)||"function"!==typeof e.removeAttribute||"function"!==typeof e.setAttribute||"string"!==typeof e.namespaceURI||"function"!==typeof e.insertBefore)},Ie=function(e){return"object"===T_(a)?e instanceof a:e&&"object"===T_(e)&&"number"===typeof e.nodeType&&"string"===typeof e.nodeName},Re=function(e,n,r){D[e]&&Y_(D[e],(function(e){e.call(t,n,r,ye)}))},ze=function(e){var n;if(Re("beforeSanitizeElements",e,null),Pe(e))return De(e),!0;if(rC(/[\u0080-\uFFFF]/,e.nodeName))return De(e),!0;var r=A(e.nodeName);if(Re("uponSanitizeElement",e,{tagName:r,allowedTags:$}),e.hasChildNodes()&&!Ie(e.firstElementChild)&&(!Ie(e.content)||!Ie(e.content.firstElementChild))&&rC(/<[/\w]/g,e.innerHTML)&&rC(/<[/\w]/g,e.textContent))return De(e),!0;if("select"===r&&rC(/