tinymce
Version:
Web based JavaScript HTML WYSIWYG editor control.
9 lines • 406 kB
JavaScript
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.1.5 (2019-12-19)
*/
!function(v){"use strict";function Z(){}function i(e,o){return function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return e(o.apply(null,n))}}function l(n){return n}var nn=function(n){return function(){return n}};function d(o){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];return function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var e=r.concat(n);return o.apply(null,e)}}function b(e){return function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return!e.apply(null,n)}}function r(n){return function(){throw new Error(n)}}var u=nn(!1),a=nn(!0),n=tinymce.util.Tools.resolve("tinymce.ThemeManager"),N=function(){return(N=Object.assign||function(n){for(var t,e=1,o=arguments.length;e<o;e++)for(var r in t=arguments[e])Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}).apply(this,arguments)};function c(n,t){var e={};for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&t.indexOf(o)<0&&(e[o]=n[o]);if(null!=n&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(n);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(n,o[r])&&(e[o[r]]=n[o[r]])}return e}function g(){for(var n=0,t=0,e=arguments.length;t<e;t++)n+=arguments[t].length;var o=Array(n),r=0;for(t=0;t<e;t++)for(var i=arguments[t],u=0,a=i.length;u<a;u++,r++)o[r]=i[u];return o}function t(){return s}var e,s=(e={fold:function(n,t){return n()},is:u,isSome:u,isNone:a,getOr:m,getOrThunk:f,getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:nn(null),getOrUndefined:nn(undefined),or:m,orThunk:f,map:t,each:Z,bind:t,exists:u,forall:a,filter:t,equals:o,equals_:o,toArray:function(){return[]},toString:nn("none()")},Object.freeze&&Object.freeze(e),e);function o(n){return n.isNone()}function f(n){return n()}function m(n){return n}function p(t){return function(n){return function(n){if(null===n)return"null";var t=typeof n;return"object"==t&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"==t&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":t}(n)===t}}function h(n,t){if(fn(n)){for(var e=0,o=n.length;e<o;++e)if(!0!==t(n[e]))return!1;return!0}return!1}function y(n,t){return pn.call(n,t)}function x(n,t){for(var e=0,o=n.length;e<o;e++){if(t(n[e],e))return!0}return!1}function w(n,t){for(var e=[],o=0;o<n.length;o+=t){var r=gn.call(n,o,o+t);e.push(r)}return e}function S(n,t){for(var e=n.length,o=new Array(e),r=0;r<e;r++){var i=n[r];o[r]=t(i,r)}return o}function C(n,t){for(var e=[],o=0,r=n.length;o<r;o++){var i=n[o];t(i,o)&&e.push(i)}return e}function k(n,t,e){return function(n,t){for(var e=n.length-1;0<=e;e--){t(n[e],e)}}(n,function(n){e=t(e,n)}),e}function O(n,t,e){return bn(n,function(n){e=t(e,n)}),e}function E(n,t){for(var e=0,o=n.length;e<o;e++){var r=n[e];if(t(r,e))return on.some(r)}return on.none()}function T(n,t){for(var e=0,o=n.length;e<o;e++){if(t(n[e],e))return on.some(e)}return on.none()}function H(n){for(var t=[],e=0,o=n.length;e<o;++e){if(!fn(n[e]))throw new Error("Arr.flatten item "+e+" was not an array, input: "+n);hn.apply(t,n[e])}return t}function B(n,t){var e=S(n,t);return H(e)}function D(n,t){for(var e=0,o=n.length;e<o;++e){if(!0!==t(n[e],e))return!1}return!0}function A(n){var t=gn.call(n,0);return t.reverse(),t}function _(n,t){return C(n,function(n){return!vn(t,n)})}function M(n){return[n]}function F(n){return 0===n.length?on.none():on.some(n[n.length-1])}function P(n,e){return kn(n,function(n,t){return{k:t,v:e(n,t)}})}function I(n,t){for(var e=wn(n),o=0,r=e.length;o<r;o++){var i=e[o],u=n[i];if(t(u,i,n))return on.some(u)}return on.none()}function R(n){return On(n,function(n){return n})}function V(n,t){return En(n,t)?on.from(n[t]):on.none()}function z(u){return function(){for(var n=new Array(arguments.length),t=0;t<n.length;t++)n[t]=arguments[t];if(0===n.length)throw new Error("Can't merge zero objects");for(var e={},o=0;o<n.length;o++){var r=n[o];for(var i in r)Bn.call(r,i)&&(e[i]=u(e[i],r[i]))}return e}}function L(e){var o,r=!1;return function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return r||(r=!0,o=e.apply(null,n)),o}}function j(n){return _n.defaultedThunk(nn(n))}function U(t){return function(n){return En(n,t)?on.from(n[t]):on.none()}}function W(n,t){return U(t)(n)}function G(n,t){var e={};return e[n]=t,e}function X(n,t){return function(n,e){var o={};return Cn(n,function(n,t){vn(e,t)||(o[t]=n)}),o}(n,t)}function Y(n,t){return function(t,e){return function(n){return En(n,t)?n[t]:e}}(n,t)}function q(n,t){return G(n,t)}function K(n){return function(n){var t={};return bn(n,function(n){t[n.key]=n.value}),t}(n)}function J(n,t){var e=function(n){var t=[],e=[];return bn(n,function(n){n.fold(function(n){t.push(n)},function(n){e.push(n)})}),{errors:t,values:e}}(n);return 0<e.errors.length?function(n){return an.error(H(n))}(e.errors):function(n,t){return 0===n.length?an.value(t):an.value(Dn(t,An.apply(undefined,n)))}(e.values,t)}function $(n,t){return function(n,t){return En(n,t)&&n[t]!==undefined&&null!==n[t]}(n,t)}var Q,tn,en=function(e){function n(){return r}function t(n){return n(e)}var o=nn(e),r={fold:function(n,t){return t(e)},is:function(n){return e===n},isSome:a,isNone:u,getOr:o,getOrThunk:o,getOrDie:o,getOrNull:o,getOrUndefined:o,or:n,orThunk:n,map:function(n){return en(n(e))},each:function(n){n(e)},bind:t,exists:t,forall:t,filter:function(n){return n(e)?r:s},toArray:function(){return[e]},toString:function(){return"some("+e+")"},equals:function(n){return n.is(e)},equals_:function(n,t){return n.fold(u,function(n){return t(e,n)})}};return r},on={some:en,none:t,from:function(n){return null===n||n===undefined?s:en(n)}},rn=function(e){return{is:function(n){return e===n},isValue:a,isError:u,getOr:nn(e),getOrThunk:nn(e),getOrDie:nn(e),or:function(n){return rn(e)},orThunk:function(n){return rn(e)},fold:function(n,t){return t(e)},map:function(n){return rn(n(e))},mapError:function(n){return rn(e)},each:function(n){n(e)},bind:function(n){return n(e)},exists:function(n){return n(e)},forall:function(n){return n(e)},toOption:function(){return on.some(e)}}},un=function(e){return{is:u,isValue:u,isError:a,getOr:l,getOrThunk:function(n){return n()},getOrDie:function(){return r(String(e))()},or:function(n){return n},orThunk:function(n){return n()},fold:function(n,t){return n(e)},map:function(n){return un(e)},mapError:function(n){return un(n(e))},each:Z,bind:function(n){return un(e)},exists:u,forall:a,toOption:on.none}},an={value:rn,error:un,fromOption:function(n,t){return n.fold(function(){return un(t)},rn)}},cn=p("string"),sn=p("object"),fn=p("array"),ln=p("boolean"),dn=p("function"),mn=p("number"),gn=Array.prototype.slice,pn=Array.prototype.indexOf,hn=Array.prototype.push,vn=function(n,t){return-1<y(n,t)},bn=function(n,t){for(var e=0,o=n.length;e<o;e++){t(n[e],e)}},yn=function(n){return 0===n.length?on.none():on.some(n[0])},xn=dn(Array.from)?Array.from:function(n){return gn.call(n)},wn=Object.keys,Sn=Object.hasOwnProperty,Cn=function(n,t){for(var e=wn(n),o=0,r=e.length;o<r;o++){var i=e[o];t(n[i],i)}},kn=function(n,o){var r={};return Cn(n,function(n,t){var e=o(n,t);r[e.k]=e.v}),r},On=function(n,e){var o=[];return Cn(n,function(n,t){o.push(e(n,t))}),o},En=function(n,t){return Sn.call(n,t)},Tn=function(u){if(!fn(u))throw new Error("cases must be an array");if(0===u.length)throw new Error("there must be at least one case");var a=[],e={};return bn(u,function(n,o){var t=wn(n);if(1!==t.length)throw new Error("one and only one name per case");var r=t[0],i=n[r];if(e[r]!==undefined)throw new Error("duplicate key detected:"+r);if("cata"===r)throw new Error("cannot have a case named cata (sorry)");if(!fn(i))throw new Error("case arguments must be an array");a.push(r),e[r]=function(){var n=arguments.length;if(n!==i.length)throw new Error("Wrong number of arguments to case "+r+". Expected "+i.length+" ("+i+"), got "+n);for(var e=new Array(n),t=0;t<e.length;t++)e[t]=arguments[t];return{fold:function(){if(arguments.length!==u.length)throw new Error("Wrong number of arguments to fold. Expected "+u.length+", got "+arguments.length);return arguments[o].apply(null,e)},match:function(n){var t=wn(n);if(a.length!==t.length)throw new Error("Wrong number of arguments to match. Expected: "+a.join(",")+"\nActual: "+t.join(","));if(!D(a,function(n){return vn(t,n)}))throw new Error("Not all branches were specified when using match. Specified: "+t.join(", ")+"\nRequired: "+a.join(", "));return n[r].apply(null,e)},log:function(n){v.console.log(n,{constructors:a,constructor:r,params:e})}}}}),e},Bn=Object.prototype.hasOwnProperty,Dn=z(function(n,t){return sn(n)&&sn(t)?Dn(n,t):t}),An=z(function(n,t){return t}),_n=Tn([{strict:[]},{defaultedThunk:["fallbackThunk"]},{asOption:[]},{asDefaultedOptionThunk:["fallbackThunk"]},{mergeWithThunk:["baseThunk"]}]),Mn=_n.strict,Fn=_n.asOption,In=_n.defaultedThunk,Rn=_n.mergeWithThunk,Vn=(Tn([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]),function(n){return U(n)}),Nn=function(n,t){return W(n,t)};(tn=Q=Q||{})[tn.Error=0]="Error",tn[tn.Value=1]="Value";function Hn(n,t,e){return n.stype===Q.Error?t(n.serror):e(n.svalue)}function Pn(n){return{stype:Q.Value,svalue:n}}function zn(n){return{stype:Q.Error,serror:n}}function Ln(n){return i(qt,H)(n)}function jn(n){return sn(n)&&100<wn(n).length?" removed due to size":JSON.stringify(n,null,2)}function Un(n,t){return qt([{path:n,getErrorInfo:t}])}function Wn(n,t,e){return W(t,e).fold(function(){return function(n,t,e){return Un(n,function(){return'Could not find valid *strict* value for "'+t+'" in '+jn(e)})}(n,e,t)},Xt)}function Gn(n,t,e){var o=W(n,t).fold(function(){return e(n)},l);return Xt(o)}function Xn(u,a,n,c){return n.fold(function(o,e,n,r){function i(n){var t=r.extract(u.concat([o]),c,n);return $t(t,function(n){return G(e,c(n))})}function t(n){return n.fold(function(){var n=G(e,c(on.none()));return Xt(n)},function(n){var t=r.extract(u.concat([o]),c,n);return $t(t,function(n){return G(e,c(on.some(n)))})})}return n.fold(function(){return Kt(Wn(u,a,o),i)},function(n){return Kt(Gn(a,o,n),i)},function(){return Kt(function(n,t){return Xt(W(n,t))}(a,o),t)},function(n){return Kt(function(t,n,e){var o=W(t,n).map(function(n){return!0===n?e(t):n});return Xt(o)}(a,o,n),t)},function(n){var t=n(a),e=$t(Gn(a,o,nn({})),function(n){return Dn(t,n)});return Kt(e,i)})},function(n,t){var e=t(a);return Xt(G(n,c(e)))})}function Yn(o){return{extract:function(t,n,e){return Jt(o(e,n),function(n){return function(n,t){return Un(n,function(){return t})}(t,n)})},toString:function(){return"val"},toDsl:function(){return te.itemOf(o)}}}function qn(n){var i=re(n),u=k(n,function(t,n){return n.fold(function(n){return Dn(t,q(n,!0))},nn(t))},{});return{extract:function(n,t,e){var o=ln(e)?[]:function(t){var n=wn(t);return C(n,function(n){return $(t,n)})}(e),r=C(o,function(n){return!$(u,n)});return 0===r.length?i.extract(n,t,e):function(n,t){return Un(n,function(){return"There are unsupported fields: ["+t.join(", ")+"] specified"})}(n,r)},toString:i.toString,toDsl:i.toDsl}}function Kn(r){return{extract:function(e,o,n){var t=S(n,function(n,t){return r.extract(e.concat(["["+t+"]"]),o,n)});return ne(t)},toString:function(){return"array("+r.toString()+")"},toDsl:function(){return te.arrOf(r)}}}function Jn(i,u){return{extract:function(e,o,r){var n=wn(r),t=function(n,t){return Kn(Yn(i)).extract(n,l,t)}(e,n);return Kt(t,function(n){var t=S(n,function(n){return oe.field(n,n,Mn(),u)});return re(t).extract(e,o,r)})},toString:function(){return"setOf("+u.toString()+")"},toDsl:function(){return te.setOf(i,u)}}}function $n(t,e,o,n,r){return Nn(n,r).fold(function(){return function(n,t,e){return Un(n,function(){return'The chosen schema: "'+e+'" did not exist in branches: '+jn(t)})}(t,n,r)},function(n){return n.extract(t.concat(["branch: "+r]),e,o)})}function Qn(n,r){return{extract:function(t,e,o){return Nn(o,n).fold(function(){return function(n,t){return Un(n,function(){return'Choice schema did not contain choice key: "'+t+'"'})}(t,n)},function(n){return $n(t,e,o,r,n)})},toString:function(){return"chooseOn("+n+"). Possible values: "+wn(r)},toDsl:function(){return te.choiceOf(n,r)}}}function Zn(t){return Yn(function(n){return t(n).fold(qt,Xt)})}function nt(t,n){return Jn(function(n){return Wt(t(n))},n)}function tt(n,t,e){return Gt(function(n,t,e,o){var r=t.extract([n],e,o);return Qt(r,function(n){return{input:o,errors:n}})}(n,t,l,e))}function et(n){return n.fold(function(n){throw new Error(le(n))},l)}function ot(n,t,e){return et(tt(n,t,e))}function rt(n,t){return Qn(n,t)}function it(n,t){return Qn(n,P(t,re))}function ut(e,o){return Yn(function(n){var t=typeof n;return e(n)?Xt(n):qt("Expected type: "+o+" but got: "+t)})}function at(t){return Zn(function(n){return vn(t,n)?an.value(n):an.error('Unsupported value: "'+n+'", choose one of "'+t.join(", ")+'".')})}function ct(n){return ce(n,n,Mn(),ie())}function st(n,t){return ce(n,n,Mn(),t)}function ft(n){return st(n,ge)}function lt(n,t){return ce(n,n,Mn(),at(t))}function dt(n){return st(n,he)}function mt(n,t){return ce(n,n,Mn(),re(t))}function gt(n,t){return ce(n,n,Mn(),ue(t))}function pt(n,t){return ce(n,n,Mn(),Kn(t))}function ht(n){return ce(n,n,Fn(),ie())}function vt(n,t){return ce(n,n,Fn(),t)}function bt(n){return vt(n,me)}function yt(n){return vt(n,ge)}function xt(n){return vt(n,he)}function wt(n,t){return vt(n,re(t))}function St(n,t){return ce(n,n,j(t),ie())}function Ct(n,t,e){return ce(n,n,j(t),e)}function kt(n,t){return Ct(n,t,me)}function Ot(n,t){return Ct(n,t,ge)}function Et(n,t,e){return Ct(n,t,at(e))}function Tt(n,t){return Ct(n,t,pe)}function Bt(n,t){return Ct(n,t,he)}function Dt(n,t,e){return Ct(n,t,re(e))}function At(n,t){return ae(n,t)}function _t(n,t,e){return 0!=(n.compareDocumentPosition(t)&e)}function Mt(n,t){var e=function(n,t){for(var e=0;e<n.length;e++){var o=n[e];if(o.test(t))return o}return undefined}(n,t);if(!e)return{major:0,minor:0};function o(n){return Number(t.replace(e,"$"+n))}return ke(o(1),o(2))}function Ft(n,t){return function(){return t===n}}function It(n,t){return function(){return t===n}}function Rt(n,t){var e=String(t).toLowerCase();return E(n,function(n){return n.search(e)})}function Vt(n,t){return-1!==n.indexOf(t)}function Nt(t){return function(n){return Vt(n,t)}}function Ht(){return Le.get()}function Pt(n,t){var e=n.dom();if(e.nodeType!==Ge)return!1;var o=e;if(o.matches!==undefined)return o.matches(t);if(o.msMatchesSelector!==undefined)return o.msMatchesSelector(t);if(o.webkitMatchesSelector!==undefined)return o.webkitMatchesSelector(t);if(o.mozMatchesSelector!==undefined)return o.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")}function zt(n){return n.nodeType!==Ge&&n.nodeType!==Xe||0===n.childElementCount}function Lt(n,t){var e=t===undefined?v.document:t.dom();return zt(e)?[]:S(e.querySelectorAll(n),we.fromDom)}function jt(n,t){return n.dom()===t.dom()}function Ut(n,t){return jt(n.element(),t.event().target())}var Wt=function(n){return n.fold(zn,Pn)},Gt=function(n){return Hn(n,an.error,an.value)},Xt=Pn,Yt=function(n){var t=[],e=[];return bn(n,function(n){Hn(n,function(n){return e.push(n)},function(n){return t.push(n)})}),{values:t,errors:e}},qt=zn,Kt=function(n,t){return n.stype===Q.Value?t(n.svalue):n},Jt=function(n,t){return n.stype===Q.Error?t(n.serror):n},$t=function(n,t){return n.stype===Q.Value?{stype:Q.Value,svalue:t(n.svalue)}:n},Qt=function(n,t){return n.stype===Q.Error?{stype:Q.Error,serror:t(n.serror)}:n},Zt=function(n,t){var e=Yt(n);return 0<e.errors.length?Ln(e.errors):function(n,t){return 0<n.length?Xt(Dn(t,An.apply(undefined,n))):Xt(t)}(e.values,t)},ne=function(n){var t=Yt(n);return 0<t.errors.length?Ln(t.errors):Xt(t.values)},te=Tn([{setOf:["validator","valueType"]},{arrOf:["valueType"]},{objOf:["fields"]},{itemOf:["validator"]},{choiceOf:["key","branches"]},{thunk:["description"]},{func:["args","outputSchema"]}]),ee=Tn([{field:["name","presence","type"]},{state:["name"]}]),oe=Tn([{field:["key","okey","presence","prop"]},{state:["okey","instantiator"]}]),re=function(o){return{extract:function(n,t,e){return function(t,e,n,o){var r=S(n,function(n){return Xn(t,e,n,o)});return Zt(r,{})}(n,e,o,t)},toString:function(){return"obj{\n"+S(o,function(n){return n.fold(function(n,t,e,o){return n+" -> "+o.toString()},function(n,t){return"state("+n+")"})}).join("\n")+"}"},toDsl:function(){return te.objOf(S(o,function(n){return n.fold(function(n,t,e,o){return ee.field(n,e,o)},function(n,t){return ee.state(n)})}))}}},ie=nn(Yn(Xt)),ue=i(Kn,re),ae=oe.state,ce=oe.field,se=Yn(Xt),fe=function(o){return{extract:function(n,t,e){return o().extract(n,t,e)},toString:function(){return o().toString()},toDsl:function(){return o().toDsl()}}},le=function(n){return"Errors: \n"+function(n){var t=10<n.length?n.slice(0,10).concat([{path:[],getErrorInfo:function(){return"... (only showing first ten failures)"}}]):n;return S(t,function(n){return"Failed path: ("+n.path.join(" > ")+")\n"+n.getErrorInfo()})}(n.errors)+"\n\nInput object: "+jn(n.input)},de=nn(se),me=ut(mn,"number"),ge=ut(cn,"string"),pe=ut(ln,"boolean"),he=ut(dn,"function"),ve=function(t){function n(n,t){for(var e=n.next();!e.done;){if(!t(e.value))return!1;e=n.next()}return!0}if(Object(t)!==t)return!0;switch({}.toString.call(t).slice(8,-1)){case"Boolean":case"Number":case"String":case"Date":case"RegExp":case"Blob":case"FileList":case"ImageData":case"ImageBitmap":case"ArrayBuffer":return!0;case"Array":case"Object":return Object.keys(t).every(function(n){return ve(t[n])});case"Map":return n(t.keys(),ve)&&n(t.values(),ve);case"Set":return n(t.keys(),ve);default:return!1}},be=Yn(function(n){return ve(n)?Xt(n):qt("Expected value to be acceptable for sending via postMessage")}),ye=function(n){function t(){return e}var e=n;return{get:t,set:function(n){e=n},clone:function(){return ye(t())}}},xe=function(n){if(null===n||n===undefined)throw new Error("Node cannot be null or undefined");return{dom:nn(n)}},we={fromHtml:function(n,t){var e=(t||v.document).createElement("div");if(e.innerHTML=n,!e.hasChildNodes()||1<e.childNodes.length)throw v.console.error("HTML does not have a single root node",n),new Error("HTML must have a single root node");return xe(e.childNodes[0])},fromTag:function(n,t){var e=(t||v.document).createElement(n);return xe(e)},fromText:function(n,t){var e=(t||v.document).createTextNode(n);return xe(e)},fromDom:xe,fromPoint:function(n,t,e){var o=n.dom();return on.from(o.elementFromPoint(t,e)).map(xe)}},Se=function(n,t){return _t(n,t,v.Node.DOCUMENT_POSITION_CONTAINED_BY)},Ce=function(){return ke(0,0)},ke=function(n,t){return{major:n,minor:t}},Oe={nu:ke,detect:function(n,t){var e=String(t).toLowerCase();return 0===n.length?Ce():Mt(n,e)},unknown:Ce},Ee="Firefox",Te=function(n){var t=n.current;return{current:t,version:n.version,isEdge:Ft("Edge",t),isChrome:Ft("Chrome",t),isIE:Ft("IE",t),isOpera:Ft("Opera",t),isFirefox:Ft(Ee,t),isSafari:Ft("Safari",t)}},Be={unknown:function(){return Te({current:undefined,version:Oe.unknown()})},nu:Te,edge:nn("Edge"),chrome:nn("Chrome"),ie:nn("IE"),opera:nn("Opera"),firefox:nn(Ee),safari:nn("Safari")},De="Windows",Ae="Android",_e="Solaris",Me="FreeBSD",Fe=function(n){var t=n.current;return{current:t,version:n.version,isWindows:It(De,t),isiOS:It("iOS",t),isAndroid:It(Ae,t),isOSX:It("OSX",t),isLinux:It("Linux",t),isSolaris:It(_e,t),isFreeBSD:It(Me,t)}},Ie={unknown:function(){return Fe({current:undefined,version:Oe.unknown()})},nu:Fe,windows:nn(De),ios:nn("iOS"),android:nn(Ae),linux:nn("Linux"),osx:nn("OSX"),solaris:nn(_e),freebsd:nn(Me)},Re=function(n,e){return Rt(n,e).map(function(n){var t=Oe.detect(n.versionRegexes,e);return{current:n.name,version:t}})},Ve=function(n,e){return Rt(n,e).map(function(n){var t=Oe.detect(n.versionRegexes,e);return{current:n.name,version:t}})},Ne=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,He=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(n){return Vt(n,"edge/")&&Vt(n,"chrome")&&Vt(n,"safari")&&Vt(n,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Ne],search:function(n){return Vt(n,"chrome")&&!Vt(n,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(n){return Vt(n,"msie")||Vt(n,"trident")}},{name:"Opera",versionRegexes:[Ne,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Nt("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Nt("firefox")},{name:"Safari",versionRegexes:[Ne,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(n){return(Vt(n,"safari")||Vt(n,"mobile/"))&&Vt(n,"applewebkit")}}],Pe=[{name:"Windows",search:Nt("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(n){return Vt(n,"iphone")||Vt(n,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Nt("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:Nt("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Nt("linux"),versionRegexes:[]},{name:"Solaris",search:Nt("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Nt("freebsd"),versionRegexes:[]}],ze={browsers:nn(He),oses:nn(Pe)},Le=ye(function(n,t){var e=ze.browsers(),o=ze.oses(),r=Re(e,n).fold(Be.unknown,Be.nu),i=Ve(o,n).fold(Ie.unknown,Ie.nu);return{browser:r,os:i,deviceType:function(n,t,e,o){var r=n.isiOS()&&!0===/ipad/i.test(e),i=n.isiOS()&&!r,u=n.isiOS()||n.isAndroid(),a=u||o("(pointer:coarse)"),c=r||!i&&u&&o("(min-device-width:768px)"),s=i||u&&!c,f=t.isSafari()&&n.isiOS()&&!1===/safari/i.test(e),l=!s&&!c&&!f;return{isiPad:nn(r),isiPhone:nn(i),isTablet:nn(c),isPhone:nn(s),isTouch:nn(a),isAndroid:n.isAndroid,isiOS:n.isiOS,isWebView:nn(f),isDesktop:nn(l)}}(i,r,n,t)}}(v.navigator.userAgent,function(n){return v.window.matchMedia(n).matches})),je=(v.Node.ATTRIBUTE_NODE,v.Node.CDATA_SECTION_NODE,v.Node.COMMENT_NODE,v.Node.DOCUMENT_NODE),Ue=(v.Node.DOCUMENT_TYPE_NODE,v.Node.DOCUMENT_FRAGMENT_NODE,v.Node.ELEMENT_NODE),We=v.Node.TEXT_NODE,Ge=(v.Node.PROCESSING_INSTRUCTION_NODE,v.Node.ENTITY_REFERENCE_NODE,v.Node.ENTITY_NODE,v.Node.NOTATION_NODE,Ue),Xe=je,Ye=Ht().browser.isIE()?function(n,t){return Se(n.dom(),t.dom())}:function(n,t){var e=n.dom(),o=t.dom();return e!==o&&e.contains(o)};function qe(n,t,e,o,r){return n(e,o)?on.some(e):dn(r)&&r(e)?on.none():t(e,o,r)}function Ke(n){return n.dom().nodeName.toLowerCase()}function Je(t){return function(n){return function(n){return n.dom().nodeType}(n)===t}}"undefined"!=typeof v.window?v.window:Function("return this;")();function $e(n){var t=Pr(n)?n.dom().parentNode:n.dom();return t!==undefined&&null!==t&&t.ownerDocument.body.contains(t)}function Qe(n,t,e){for(var o=n.dom(),r=dn(e)?e:nn(!1);o.parentNode;){o=o.parentNode;var i=we.fromDom(o);if(t(i))return on.some(i);if(r(i))break}return on.none()}function Ze(n,t,e){return qe(function(n,t){return t(n)},Qe,n,t,e)}function no(n,r){var i=function(n){for(var t=0;t<n.childNodes.length;t++){var e=we.fromDom(n.childNodes[t]);if(r(e))return on.some(e);var o=i(n.childNodes[t]);if(o.isSome())return o}return on.none()};return i(n.dom())}function to(n){if(!$(n,"can")&&!$(n,"abort")&&!$(n,"run"))throw new Error("EventHandler defined by: "+JSON.stringify(n,null,2)+" does not have can, abort, or run!");return ot("Extracting event.handler",qn([St("can",nn(!0)),St("abort",nn(!1)),St("run",Z)]),n)}function eo(e){var n=function(t,o){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return O(t,function(n,t){return n&&o(t).apply(undefined,e)},!0)}}(e,function(n){return n.can}),t=function(t,o){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return O(t,function(n,t){return n||o(t).apply(undefined,e)},!1)}}(e,function(n){return n.abort});return to({can:n,abort:t,run:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];bn(e,function(n){n.run.apply(undefined,t)})}})}function oo(n,t){Fi(n,n.element(),t,{})}function ro(n,t,e){Fi(n,n.element(),t,e)}function io(n){oo(n,di())}function uo(n,t,e){Fi(n,t,e,{})}function ao(n,t,e,o){n.getSystem().triggerEvent(e,t,o.event())}function co(n){return K(n)}function so(n,t){return{key:n,value:to({abort:t})}}function fo(n){return{key:n,value:to({run:function(n,t){t.event().prevent()}})}}function lo(n,t){return{key:n,value:to({run:t})}}function mo(n,e,o){return{key:n,value:to({run:function(n,t){e.apply(undefined,[n,t].concat(o))}})}}function go(n){return function(e){return{key:n,value:to({run:function(n,t){Ut(n,t)&&e(n,t)}})}}}function po(n,t,e){return function(e,o){return lo(e,function(n,t){n.getSystem().getByUid(o).each(function(n){ao(n,n.element(),e,t)})})}(n,t.partUids[e])}function ho(n,r){return lo(n,function(t,n){var e=n.event(),o=t.getSystem().getByDom(e.target()).fold(function(){return jr(e.target(),function(n){return t.getSystem().getByDom(n).toOption()},nn(!1)).getOr(t)},function(n){return n});r(t,o,n)})}function vo(n){return lo(n,function(n,t){t.cut()})}function bo(n,t){return go(n)(t)}function yo(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(t.length!==e.length)throw new Error('Wrong number of arguments to struct. Expected "['+t.length+']", got '+e.length+" arguments");var o={};return bn(t,function(n,t){o[n]=nn(e[t])}),o}}function xo(n){return n.slice(0).sort()}function wo(t,n){if(!fn(n))throw new Error("The "+t+" fields must be an array. Was: "+n+".");bn(n,function(n){if(!cn(n))throw new Error("The value "+n+" in the "+t+" fields was not a string.")})}function So(r,i){var u=r.concat(i);if(0===u.length)throw new Error("You must specify at least one required or optional field.");return wo("required",r),wo("optional",i),function(n){var e=xo(n);E(e,function(n,t){return t<e.length-1&&n===e[t+1]}).each(function(n){throw new Error("The field: "+n+" occurs more than once in the combined fields: ["+e.join(", ")+"].")})}(u),function(t){var e=wn(t);D(r,function(n){return vn(e,n)})||function(n,t){throw new Error("All required keys ("+xo(n).join(", ")+") were not specified. Specified keys were: "+xo(t).join(", ")+".")}(r,e);var n=C(e,function(n){return!vn(u,n)});0<n.length&&function(n){throw new Error("Unsupported keys for object: "+xo(n).join(", "))}(n);var o={};return bn(r,function(n){o[n]=nn(t[n])}),bn(i,function(n){o[n]=nn(Object.prototype.hasOwnProperty.call(t,n)?on.some(t[n]):on.none())}),o}}function Co(n){return we.fromDom(n.dom().ownerDocument)}function ko(n){return we.fromDom(n.dom().ownerDocument.documentElement)}function Oo(n){return we.fromDom(n.dom().ownerDocument.defaultView)}function Eo(n){return on.from(n.dom().parentNode).map(we.fromDom)}function To(n){return on.from(n.dom().offsetParent).map(we.fromDom)}function Bo(n){return S(n.dom().childNodes,we.fromDom)}function Do(n,t){var e=n.dom().childNodes;return on.from(e[t]).map(we.fromDom)}function Ao(t,e){Eo(t).each(function(n){n.dom().insertBefore(e.dom(),t.dom())})}function _o(n,t){(function(n){return on.from(n.dom().nextSibling).map(we.fromDom)})(n).fold(function(){Eo(n).each(function(n){Hi(n,t)})},function(n){Ao(n,t)})}function Mo(t,e){(function(n){return Do(n,0)})(t).fold(function(){Hi(t,e)},function(n){t.dom().insertBefore(e.dom(),n.dom())})}function Fo(t,n){bn(n,function(n){Hi(t,n)})}function Io(n){n.dom().textContent="",bn(Bo(n),function(n){Pi(n)})}function Ro(n){var t=Bo(n);0<t.length&&function(t,n){bn(n,function(n){Ao(t,n)})}(n,t),Pi(n)}function Vo(n){return n.dom().innerHTML}function No(n,t){var e=Co(n).dom(),o=we.fromDom(e.createDocumentFragment()),r=function(n,t){var e=(t||v.document).createElement("div");return e.innerHTML=n,Bo(we.fromDom(e))}(t,e);Fo(o,r),Io(n),Hi(n,o)}function Ho(n,t,e){if(!(cn(e)||ln(e)||mn(e)))throw v.console.error("Invalid call to Attr.set. Key ",t,":: Value ",e,":: Element ",n),new Error("Attribute value was not simple");n.setAttribute(t,e+"")}function Po(n,t,e){Ho(n.dom(),t,e)}function zo(n,t){var e=n.dom().getAttribute(t);return null===e?undefined:e}function Lo(n,t){var e=n.dom();return!(!e||!e.hasAttribute)&&e.hasAttribute(t)}function jo(n,t){n.dom().removeAttribute(t)}function Uo(n){return function(n,t){return we.fromDom(n.dom().cloneNode(t))}(n,!1)}function Wo(n){return function(n){var t=we.fromTag("div"),e=we.fromDom(n.dom().cloneNode(!0));return Hi(t,e),Vo(t)}(Uo(n))}function Go(n){return Wo(n)}function Xo(n){var t=(new Date).getTime();return n+"_"+Math.floor(1e9*Math.random())+ ++ji+String(t)}function Yo(n){return Xo(n)}function qo(t){function n(n){return function(){throw new Error("The component must be in a context to send: "+n+"\n"+Go(t().element())+" is not in context.")}}return{debugInfo:nn("fake"),triggerEvent:n("triggerEvent"),triggerFocus:n("triggerFocus"),triggerEscape:n("triggerEscape"),build:n("build"),addToWorld:n("addToWorld"),removeFromWorld:n("removeFromWorld"),addToGui:n("addToGui"),removeFromGui:n("removeFromGui"),getByUid:n("getByUid"),getByDom:n("getByDom"),broadcast:n("broadcast"),broadcastOn:n("broadcastOn"),broadcastEvent:n("broadcastEvent"),isConnected:nn(!1)}}function Ko(n,t){var e=n.toString(),o=e.indexOf(")")+1,r=e.indexOf("("),i=e.substring(r+1,o-1).split(/,\s*/);return n.toFunctionAnnotation=function(){return{name:t,parameters:$i(i)}},n}function Jo(n){return q(Qi,n)}function $o(o){return function(n,t){var e=t.toString(),o=e.indexOf(")")+1,r=e.indexOf("("),i=e.substring(r+1,o-1).split(/,\s*/);return n.toFunctionAnnotation=function(){return{name:"OVERRIDE",parameters:$i(i.slice(1))}},n}(function(n){for(var t=[],e=1;e<arguments.length;e++)t[e-1]=arguments[e];return o.apply(undefined,[n.getApis()].concat([n].concat(t)))},o)}function Qo(n,r){var i={};return Cn(n,function(n,o){Cn(n,function(n,t){var e=Y(t,[])(i);i[t]=e.concat([r(o,n)])})}),i}function Zo(n){return{classes:n.classes!==undefined?n.classes:[],attributes:n.attributes!==undefined?n.attributes:{},styles:n.styles!==undefined?n.styles:{}}}function nr(n){return n.cHandler}function tr(n,t){return{name:nn(n),handler:nn(t)}}function er(n,t,e){var o=N(N({},e),function(n,t){var e={};return bn(n,function(n){e[n.name()]=n.handlers(t)}),e}(t,n));return Qo(o,tr)}function or(n){var i=function(n){return dn(n)?{can:nn(!0),abort:nn(!1),run:n}:n}(n);return function(n,t){for(var e=[],o=2;o<arguments.length;o++)e[o-2]=arguments[o];var r=[n,t].concat(e);i.abort.apply(undefined,r)?t.stop():i.can.apply(undefined,r)&&i.run.apply(undefined,r)}}function rr(n,t,e){var o=t[e];return o?function(u,a,n,c){var t=n.slice(0);try{var e=t.sort(function(n,t){var e=n[a](),o=t[a](),r=c.indexOf(e),i=c.indexOf(o);if(-1===r)throw new Error("The ordering for "+u+" does not have an entry for "+e+".\nOrder specified: "+JSON.stringify(c,null,2));if(-1===i)throw new Error("The ordering for "+u+" does not have an entry for "+o+".\nOrder specified: "+JSON.stringify(c,null,2));return r<i?-1:i<r?1:0});return an.value(e)}catch(o){return an.error([o])}}("Event: "+e,"name",n,o).map(function(n){var t=S(n,function(n){return n.handler()});return eo(t)}):function(n,t){return an.error(["The event ("+n+') has more than one behaviour that listens to it.\nWhen this occurs, you must specify an event ordering for the behaviours in your spec (e.g. [ "listing", "toggling" ]).\nThe behaviours that can trigger it are: '+JSON.stringify(S(t,function(n){return n.name()}),null,2)])}(e,n)}function ir(n){return tt("custom.definition",re([ce("dom","dom",Mn(),re([ct("tag"),St("styles",{}),St("classes",[]),St("attributes",{}),ht("value"),ht("innerHtml")])),ct("components"),ct("uid"),St("events",{}),St("apis",{}),ce("eventOrder","eventOrder",function(n){return _n.mergeWithThunk(nn(n))}({"alloy.execute":["disabling","alloy.base.behaviour","toggling","typeaheadevents"],"alloy.focus":["alloy.base.behaviour","focusing","keying"],"alloy.system.init":["alloy.base.behaviour","disabling","toggling","representing"],input:["alloy.base.behaviour","representing","streaming","invalidating"],"alloy.system.detached":["alloy.base.behaviour","representing","item-events","tooltipping"],mousedown:["focusing","alloy.base.behaviour","item-type-events"],touchstart:["focusing","alloy.base.behaviour","item-type-events"],mouseover:["item-type-events","tooltipping"]}),de()),ht("domModification")]),n)}function ur(n,t){var e=zo(n,t);return e===undefined||""===e?[]:e.split(" ")}function ar(n){return n.dom().classList!==undefined}function cr(n,t){return function(n,t,e){var o=ur(n,t).concat([e]);return Po(n,t,o.join(" ")),!0}(n,"class",t)}function sr(n,t){return function(n,t,e){var o=C(ur(n,t),function(n){return n!==e});return 0<o.length?Po(n,t,o.join(" ")):jo(n,t),!1}(n,"class",t)}function fr(n,t){ar(n)?n.dom().classList.add(t):cr(n,t)}function lr(n){0===(ar(n)?n.dom().classList:function(n){return ur(n,"class")}(n)).length&&jo(n,"class")}function dr(n,t){ar(n)?n.dom().classList.remove(t):sr(n,t),lr(n)}function mr(n,t){return ar(n)&&n.dom().classList.contains(t)}function gr(t,n){bn(n,function(n){fr(t,n)})}function pr(t,n){bn(n,function(n){dr(t,n)})}function hr(n){return n.style!==undefined&&dn(n.style.getPropertyValue)}function vr(n,t,e){if(!cn(e))throw v.console.error("Invalid call to CSS.set. Property ",t,":: Value ",e,":: Element ",n),new Error("CSS value must be a string: "+e);hr(n)&&n.style.setProperty(t,e)}function br(n,t){hr(n)&&n.style.removeProperty(t)}function yr(n,t,e){var o=n.dom();vr(o,t,e)}function xr(n,t){var e=n.dom();Cn(t,function(n,t){vr(e,t,n)})}function wr(n,t){var e=n.dom(),o=v.window.getComputedStyle(e).getPropertyValue(t),r=""!==o||$e(n)?o:ou(e,t);return null===r?undefined:r}function Sr(n,t){var e=n.dom(),o=ou(e,t);return on.from(o).filter(function(n){return 0<n.length})}function Cr(n,t,e){var o=we.fromTag(n);return yr(o,t,e),Sr(o,t).isSome()}function kr(n,t){var e=n.dom();br(e,t),Lo(n,"style")&&""===function(n){return n.replace(/^\s+|\s+$/g,"")}(zo(n,"style"))&&jo(n,"style")}function Or(n){return n.dom().offsetWidth}function Er(n){return n.dom().value}function Tr(n,t){if(t===undefined)throw new Error("Value.set was undefined");n.dom().value=t}function Br(n){var t=we.fromTag(n.tag);!function(n,t){var e=n.dom();Cn(t,function(n,t){Ho(e,t,n)})}(t,n.attributes),gr(t,n.classes),xr(t,n.styles),n.innerHtml.each(function(n){return No(t,n)});var e=n.domChildren;return Fo(t,e),n.value.each(function(n){Tr(t,n)}),n.uid,Yi(t,n.uid),t}function Dr(n,t){return function(t,n){var e=S(n,function(n){return wt(n.name(),[ct("config"),St("state",Zi)])}),o=tt("component.behaviours",re(e),t.behaviours).fold(function(n){throw new Error(le(n)+"\nComplete spec:\n"+JSON.stringify(t,null,2))},function(n){return n});return{list:n,data:P(o,function(n){var t=n.map(function(n){return{config:n.config,state:n.state.init(n.config)}});return function(){return t}})}}(n,t)}function Ar(n){var t=function(n){var t=Y("behaviours",{})(n),e=C(wn(t),function(n){return t[n]!==undefined});return S(e,function(n){return t[n].me})}(n);return Dr(n,t)}function _r(n,t,e){var o=function(n){return N(N({},n.dom),{uid:n.uid,domChildren:S(n.components,function(n){return n.element()})})}(n),r=function(n){return n.domModification.fold(function(){return Zo({})},Zo)}(n),i={"alloy.base.modification":r};return function(n,t){return N(N({},n),{attributes:N(N({},n.attributes),t.attributes),styles:N(N({},n.styles),t.styles),classes:n.classes.concat(t.classes)})}(o,0<t.length?function(t,n,e,o){var r=N({},n);bn(e,function(n){r[n.name()]=n.exhibit(t,o)});function i(n){return k(n,function(n,t){return N(N({},t.modification),n)},{})}var u=Qo(r,function(n,t){return{name:n,modification:t}}),a=k(u.classes,function(n,t){return t.modification.concat(n)},[]),c=i(u.attributes),s=i(u.styles);return Zo({classes:a,attributes:c,styles:s})}(e,i,t,o):r)}function Mr(n,t,e){var o={"alloy.base.behaviour":function(n){return n.events}(n)};return function(n,t,e,o){var r=er(n,e,o);return eu(r,t)}(e,n.eventOrder,t,o).getOrDie()}function Fr(n){var t=Ki(n),e=t.events,o=c(t,["events"]),r=function(n){var t=Y("components",[])(n);return S(t,uu)}(o),i=N(N({},o),{events:N(N({},Li),e),components:r});return an.value(function(e){function n(){return l}var o=ye(Ji),t=et(ir(e)),r=Ar(e),i=function(n){return n.list}(r),u=function(n){return n.data}(r),a=_r(t,i,u),c=Br(a),s=Mr(t,i,u),f=ye(t.components),l={getSystem:o.get,config:function(n){var t=u;return(dn(t[n.name()])?t[n.name()]:function(){throw new Error("Could not find "+n.name()+" in "+JSON.stringify(e,null,2))})()},hasConfigured:function(n){return dn(u[n.name()])},spec:nn(e),readState:function(n){return u[n]().map(function(n){return n.state.readState()}).getOr("not enabled")},getApis:function(){return t.apis},connect:function(n){o.set(n)},disconnect:function(){o.set(qo(n))},element:nn(c),syncComponents:function(){var n=Bo(c),t=B(n,function(n){return o.get().getByDom(n).fold(function(){return[]},function(n){return[n]})});f.set(t)},components:f.get,events:nn(s)};return l}(i))}function Ir(n){var t=we.fromText(n);return ru({element:t})}var Rr,Vr,Nr,Hr=Je(Ue),Pr=Je(We),zr=L(function(){return Lr(we.fromDom(v.document))}),Lr=function(n){var t=n.dom().body;if(null===t||t===undefined)throw new Error("Body is not available yet");return we.fromDom(t)},jr=function(n,t,e){return Ze(n,function(n){return t(n).isSome()},e).bind(t)},Ur=nn("touchstart"),Wr=nn("touchmove"),Gr=nn("touchend"),Xr=nn("touchcancel"),Yr=nn("mousedown"),qr=nn("mousemove"),Kr=nn("mouseout"),Jr=nn("mouseup"),$r=nn("mouseover"),Qr=nn("focusin"),Zr=nn("focusout"),ni=nn("keydown"),ti=nn("keyup"),ei=nn("input"),oi=nn("change"),ri=nn("click"),ii=nn("transitionend"),ui=nn("selectstart"),ai={tap:nn("alloy.tap")},ci=nn("alloy.focus"),si=nn("alloy.blur.post"),fi=nn("alloy.paste.post"),li=nn("alloy.receive"),di=nn("alloy.execute"),mi=nn("alloy.focus.item"),gi=ai.tap,pi=nn("alloy.longpress"),hi=nn("alloy.sandbox.close"),vi=nn("alloy.typeahead.cancel"),bi=nn("alloy.system.init"),yi=nn("alloy.system.touchmove"),xi=nn("alloy.system.touchend"),wi=nn("alloy.system.scroll"),Si=nn("alloy.system.resize"),Ci=nn("alloy.system.attached"),ki=nn("alloy.system.detached"),Oi=nn("alloy.system.dismissRequested"),Ei=nn("alloy.system.repositionRequested"),Ti=nn("alloy.focusmanager.shifted"),Bi=nn("alloy.slotcontainer.visibility"),Di=nn("alloy.change.tab"),Ai=nn("alloy.dismiss.tab"),_i=nn("alloy.highlight"),Mi=nn("alloy.dehighlight"),Fi=function(n,t,e,o){var r=N({target:t},o);n.getSystem().triggerEvent(e,t,P(r,nn))},Ii=go(Ci()),Ri=go(ki()),Vi=go(bi()),Ni=(Rr=di(),function(n){return lo(Rr,n)}),Hi=(yo("element","offset"),function(n,t){n.dom().appendChild(t.dom())}),Pi=function(n){var t=n.dom();null!==t.parentNode&&t.parentNode.removeChild(t)},zi=co([(Vr=ci(),Nr=function(n,t){var e=t.event().originator(),o=t.event().target();return!function(n,t,e){return jt(t,n.element())&&!jt(t,e)}(n,e,o)||(v.console.warn(ci()+" did not get interpreted by the desired target. \nOriginator: "+Go(e)+"\nTarget: "+Go(o)+"\nCheck the "+ci()+" event handlers"),!1)},{key:Vr,value:to({can:Nr})})]),Li=/* */Object.freeze({events:zi}),ji=0,Ui=nn("alloy-id-"),Wi=nn("data-alloy-id"),Gi=Ui(),Xi=Wi(),Yi=function(n,t){Object.defineProperty(n.dom(),Xi,{value:t,writable:!0})},qi=function(n){var t=Hr(n)?n.dom()[Xi]:null;return on.from(t)},Ki=l,Ji=qo(),$i=function(n){return S(n,function(n){return function(n,t){return function(n,t,e){return""===t||!(n.length<t.length)&&n.substr(e,e+t.length)===t}(n,t,n.length-t.length)}(n,"/*")?n.substring(0,n.length-"/*".length):n})},Qi=Xo("alloy-premade"),Zi={init:function(){return nu({readState:function(){return"No State required"}})}},nu=function(n){return n},tu=function(n,t){return function(n,t){return{cHandler:n,purpose:nn(t)}}(d.apply(undefined,[n.handler].concat(t)),n.purpose())},eu=function(n,i){var t=On(n,function(o,r){return(1===o.length?an.value(o[0].handler()):rr(o,i,r)).map(function(n){var t=or(n),e=1<o.length?C(i[r],function(t){return x(o,function(n){return n.name()===t})}).join(" > "):o[0].name();return q(r,function(n,t){return{handler:n,purpose:nn(t)}}(t,e))})});return J(t,{})},ou=function(n,t){return hr(n)?n.style.getPropertyValue(t):""},ru=function(n){var t=ot("external.component",qn([ct("element"),ht("uid")]),n),e=ye(qo());t.uid.each(function(n){Yi(t.element,n)});var o={getSystem:e.get,config:on.none,hasConfigured:nn(!1),connect:function(n){e.set(n)},disconnect:function(){e.set(qo(function(){return o}))},getApis:function(){return{}},element:nn(t.element),spec:nn(n),readState:nn("No state"),syncComponents:Z,components:nn([]),events:nn({})};return Jo(o)},iu=Yo,uu=function(t){return function(n){return Nn(n,Qi)}(t).fold(function(){var n=t.hasOwnProperty("uid")?t:N({uid:iu("")},t);return Fr(n).getOrDie()},function(n){return n})},au=Jo;function cu(o,r){function n(n){var t=r(n);if(t<=0||null===t){var e=wr(n,o);return parseFloat(e)||0}return t}function i(r,n){return O(n,function(n,t){var e=wr(r,t),o=e===undefined?0:parseInt(e,10);return isNaN(o)?n:n+o},0)}return{set:function(n,t){if(!mn(t)&&!t.match(/^[0-9]+$/))throw new Error(o+".set accepts only positive integer values. Value was "+t);var e=n.dom();hr(e)&&(e.style[o]=t+"px")},get:n,getOuter:n,aggregate:i,max:function(n,t,e){var o=i(n,e);return o<t?t-o:0}}}function su(n){return Mu.get(n)}function fu(n){return Mu.getOuter(n)}function lu(n,t){return n!==undefined?n:t!==undefined?t:0}function du(n){var t=n.dom().ownerDocument,e=t.body,o=t.defaultView,r=t.documentElement;if(e===n.dom())return Iu(e.offsetLeft,e.offsetTop);var i=lu(o.pageYOffset,r.scrollTop),u=lu(o.pageXOffset,r.scrollLeft),a=lu(r.clientTop,e.clientTop),c=lu(r.clientLeft,e.clientLeft);return Ru(n).translate(u-c,i-a)}function mu(n){return Vu.get(n)}function gu(n){return Vu.getOuter(n)}function pu(n){var t=n!==undefined?n.dom():v.document,e=t.body.scrollLeft||t.documentElement.scrollLeft,o=t.body.scrollTop||t.documentElement.scrollTop;return Iu(e,o)}function hu(n,t,e,o){return{x:nn(n),y:nn(t),width:nn(e),height:nn(o),right:nn(n+e),bottom:nn(t+o)}}function vu(n){var t=n===undefined?v.window:n,e=t.document,o=pu(we.fromDom(e)),r=t.visualViewport;if(r!==undefined)return hu(Math.max(r.pageLeft,o.left()),Math.max(r.pageTop,o.top()),r.width,r.height);var i=e.documentElement,u=i.clientWidth,a=i.clientHeight;return hu(o.left(),o.top(),u,a)}function bu(o){var n=we.fromDom(v.document),r=pu(n);return function(n,t){var e=t.owner(n),o=Nu(t,e);return on.some(o)}(o,Hu).fold(d(du,o),function(n){var t=Ru(o),e=k(n,function(n,t){var e=Ru(t);return{left:n.left+e.left(),top:n.top+e.top()}},{left:0,top:0});return Iu(e.left+t.left()+r.left(),e.top+t.top()+r.top())})}function yu(n,t,e,o){return{x:nn(n),y:nn(t),width:nn(e),height:nn(o),right:nn(n+e),bottom:nn(t+o)}}function xu(n){var t=du(n),e=gu(n),o=fu(n);return yu(t.left(),t.top(),e,o)}function wu(n){var t=bu(n),e=gu(n),o=fu(n);return yu(t.left(),t.top(),e,o)}function Su(){return vu(v.window)}function Cu(n,t,e){return Qe(n,function(n){return Pt(n,t)},e)}function ku(n,t){return function(n,t){var e=t===undefined?v.document:t.dom();return zt(e)?on.none():on.from(e.querySelector(n)).map(we.fromDom)}(t,n)}function Ou(n,t,e){return qe(Pt,Cu,n,t,e)}function Eu(){var t=Xo("aria-owns");return{id:nn(t),link:function(n){Po(n,"aria-owns",t)},unlink:function(n){jo(n,"aria-owns")}}}function Tu(t,n){return function(n){return Ze(n,function(n){if(!Hr(n))return!1;var t=zo(n,"id");return t!==undefined&&-1<t.indexOf("aria-owns")}).bind(function(n){var t=zo(n,"id"),e=Co(n);return ku(e,'[aria-owns="'+t+'"]')})}(n).exists(function(n){return Lu(t,n)})}function Bu(n){for(var t=[],e=function(n){t.push(n)},o=0;o<n.length;o++)n[o].each(e);return t}function Du(n,t){for(var e=0;e<n.length;e++){var o=t(n[e],e);if(o.isSome())return o}return on.none()}var Au,_u,Mu=cu("height",function(n){var t=n.dom();return $e(n)?t.getBoundingClientRect().height:t.offsetHeight}),Fu=function(e,o){return{left:nn(e),top:nn(o),translate:function(n,t){return Fu(e+n,o+t)}}},Iu=Fu,Ru=function(n){var t=n.dom(),e=t.ownerDocument.body;return e===t?Iu(e.offsetLeft,e.offsetTop):$e(n)?function(n){var t=n.getBoundingClientRect();return Iu(t.left,t.top)}(t):Iu(0,0)},Vu=cu("width",function(n){return n.dom().offsetWidth}),Nu=(Ht().browser.isSafari(),function(o,n){return o.view(n).fold(nn([]),function(n){var t=o.owner(n),e=Nu(o,t);return[n].concat(e)})}),Hu=/* */Object.freeze({view:function(n){return(n.dom()===v.document?on.none():on.from(n.dom().defaultView.frameElement)).map(we.fromDom)},owner:function(n){return Co(n)}}),Pu=yo("point","width","height"),zu=yo("x","y","width","height"),Lu=function(t,n){return function(n,t,e){return Ze(n,t,e).isSome()}(n,function(n){return jt(n,t.element())},nn(!1))||Tu(t,n)},ju="unknown";(_u=Au=Au||{})[_u.STOP=0]="STOP",_u[_u.NORMAL=1]="NORMAL",_u[_u.LOGGING=2]="LOGGING";function Uu(t,n,e){switch(Nn(Pa.get(),t).orThunk(function(){var n=wn(Pa.get());return Du(n,function(n){return-1<t.indexOf(n)?on.some(Pa.get()[n]):on.none()})}).getOr(Au.NORMAL)){case Au.NORMAL:return e(La());case Au.LOGGING:var o=function(t,e){var o=[],r=(new Date).getTime();return{logEventCut:function(n,t,e){o.push({outcome:"cut",target:t,purpose:e})},logEventStopped:function(n,t,e){o.push({outcome:"stopped",target:t,purpose:e})},logNoParent:function(n,t,e){o.push({outcome:"no-parent",target:t,purpose:e})},logEventNoHandlers:function(n,t){o.push({outcome:"no-handlers-left",target:t})},logEventResponse:function(n,t,e){o.push({outcome:"response",purpose:e,target:t})},write:function(){var n=(new Date).getTime();vn(["mousemove","mouseover","mouseout",bi()],t)||v.console.log(t,{event:t,time:n-r,target:e.dom(),sequence:S(o,function(n){return vn(["cut","stopped","response"],n.outcome)?"{"+n.purpose+"} "+n.outcome+" at ("+Go(n.target)+")":n.outcome})})}}}(t,n),r=e(o);return o.write(),r;case Au.STOP:return!0}}function Wu(n,t,e){return Uu(n,t,e)}function Gu(){return mt("markers",[ct("backgroundMenu")].concat(ja()).concat(Ua()))}function Xu(n){return mt("markers",S(n,ct))}function Yu(n,t,e){return function(){var n=new Error;if(n.stack===undefined)return;var t=n.stack.split("\n");E(t,function(t){return 0<t.indexOf("alloy")&&!x(za,function(n){return-1<t.indexOf(n)})}).getOr(ju)}(),ce(t,t,e,Zn(function(e){return an.value(function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return e.apply(undefined,n)})}))}function qu(n){return Yu(0,n,j(Z))}function Ku(n){return Yu(0,n,j(on.none))}function Ju(n){return Yu(0,n,Mn())}function $u(n){return Yu(0,n,Mn())}function Qu(n,t){return At(n,nn(t))}function Zu(n){return At(n,l)}function na(n){return n.x()}function ta(n,t){return n.x()+n.width()/2-t.width()/2}function ea(n,t){return n.x()+n.width()-t.width()}function oa(n,t){return n.y()-t.height()}function ra(n){return n.y()+n.height()}function ia(n,t){return n.y()+n.height()/2-t.height()/2}function ua(n,t,e){return Ya(na(n),ra(n),e.southeast(),Ka(),"layout-se")}function aa(n,t,e){return Ya(ea(n,t),ra(n),e.southwest(),Ja(),"layout-sw")}function ca(n,t,e){return Ya(na(n),oa(n,t),e.northeast(),$a(),"layout-ne")}function sa(n,t,e){return Ya(ea(n,t),oa(n,t),e.northwest(),Qa(),"layout-nw")}function fa(n,t,e){return Ya(function(n){return n.x()+n.width()}(n),ia(n,t),e.east(),tc(),"layout-e")}function la(n,t,e){return Ya(function(n,t){return n.x()-t.width()}(n,t),ia(n,t),e.west(),ec(),"layout-w")}function da(){return[ua,aa,ca,sa,rc,oc]}function ma(){return[aa,ua,sa,ca,rc,oc]}function ga(e,o,r){return Vi(function(n,t){r(n,e,o)})}function pa(n,t,e,o,r,i){var u=qn(n),a=wt(t,[function(n,t){return vt(n,qn(t))}("config",n)]);return ic(u,a,t,e,o,r,i)}function ha(r,i,u){return function(n,t,e){var o=e.toString(),r=o.indexOf(")")+1,i=o.indexOf("("),u=o.substring(i+1,r-1).split(/,\s*/);return n.toFunctionAnnotation=function(){return{name:t,parameters:$i(u.slice(0,1).concat(u.slice(3)))}},n}(function(e){for(var n=[],t=1;t<arguments.length;t++)n[t-1]=arguments[t];var o=[e].concat(n);return e.config({name:nn(r)}).fold(function(){throw new Error("We could not find any behaviour configuration for: "+r+". Using API: "+u)},function(n){var t=Array.prototype.slice.call(o,1);return i.apply(undefined,[e,n.config,n.state].concat(t))})},u,i)}function va(n){return{key:n,value:undefined}}function ba(n){return K(n)}function ya(n){var t=ot("Creating behaviour: "+n.name,uc,n);return pa(t.fields,t.name,t.active,t.apis,t.extra,t.state)}function xa(n){var t=ot("Creating behaviour: "+n.name,ac,n);return function(n,t,e,o,r,i){var u=n,a=wt(t,[vt("config",n)]);return ic(u,a,t,e,o,r,i)}(it(t.branchKey,t.branches),t.name,t.active,t.apis,t.extra,t.state)}function wa(n){n.dom().focus()}function Sa(n){var t=n!==undefined?n.dom():v.document;return on.from(t.activeElement).map(we.fromDom)}function Ca(t){return Sa(Co(t)).filter(function(n){return t.dom().contains(n.dom())})}function ka(n,e){var o=Co(e),t=Sa(o).bind(function(t){function n(n){return jt(t,n)}return n(e)?on.some(e):no(e,n)}),r=n(e);return t.each(function(t){Sa(o).filter(function(n){return jt(n,t)}).fold(function(){wa(t)},Z)}),r}function Oa(n,t,e){function r(n){return Nn(e,n).getOr([])}function o(n,t,e){var o=_(mc,e);return{offset:function(){return Iu(n,t)},classesOn:function(){return B(e,r)},classesOff:function(){return B(o,r)}}}return{southeast:function(){return o(-n,t,["top","alignLeft"])},southwest:function(){return o(n,t,["top","alignRight"])},south:function(){return o(-n/2,t,["top","alignCentre"])},northeast:function(){return o(-n,-t,["bottom","alignLeft"])},northwest:function(){return o(n,-t,["bottom","alignRight"])},north:function(){return o(-n/2,-t,["bottom","alignCentre"])},east:function(){return o(n,-t/2,["valignCentre","left"])},west:function(){return o(-n,-t/2,["valignCentre","right"