From 1175f4174739fa86dfe5be2eba0090a68e14df9a Mon Sep 17 00:00:00 2001 From: Matt Morgan Date: Tue, 30 Jun 2015 11:49:52 -0500 Subject: [PATCH] new build --- dist/platypus.d.ts | 4 ++-- dist/platypus.js | 14 ++++++++++---- dist/platypus.min.js | 10 +++++----- tsd.json | 2 +- 4 files changed, 18 insertions(+), 12 deletions(-) diff --git a/dist/platypus.d.ts b/dist/platypus.d.ts index 2c86f652..bc61544e 100644 --- a/dist/platypus.d.ts +++ b/dist/platypus.d.ts @@ -1,5 +1,5 @@ /** - * PlatypusTS v0.13.10 (https://platypi.io) + * PlatypusTS v0.13.11 (https://platypi.io) * Copyright 2015 Platypi, LLC. All rights reserved. * * PlatypusTS is licensed under the MIT license found at @@ -5728,7 +5728,7 @@ declare module plat { */ protected _androidVersion: number; /** - * Whether or not we're on Android 4.4.x + * Whether or not we're on Android 4.4.x or below. */ protected _android44orBelow: boolean; /** diff --git a/dist/platypus.js b/dist/platypus.js index 586510c4..b62ee31f 100644 --- a/dist/platypus.js +++ b/dist/platypus.js @@ -6,7 +6,7 @@ var __extends = this.__extends || function (d, b) { }; /* tslint:disable */ /** - * PlatypusTS v0.13.10 (https://platypi.io) + * PlatypusTS v0.13.11 (https://platypi.io) * Copyright 2015 Platypi, LLC. All rights reserved. * * PlatypusTS is licensed under the MIT license found at @@ -8782,9 +8782,9 @@ var plat; */ this._androidVersion = isUndefined(this._compat.ANDROID) ? -1 : this._compat.ANDROID; /** - * Whether or not we're on Android 4.4.x + * Whether or not we're on Android 4.4.x or below. */ - this._android44orBelow = Math.floor(this._androidVersion / 10) <= 44; + this._android44orBelow = this._androidVersion > -1 && Math.floor(this._androidVersion / 10) <= 44; /** * Whether or not the user is using mouse when touch events are present. */ @@ -8844,6 +8844,10 @@ var plat; * A regular expressino for determining a pointer end event. */ this.__pointerEndRegex = /up|cancel/i; + /** + * Whether or not there are any swipe subscribers for the current target during touch move events. + */ + this.__haveSwipeSubscribers = false; /** * A hash map for mapping custom events to standard events. */ @@ -9011,7 +9015,9 @@ var plat; xTarget: target, yTarget: target }; - this.__haveSwipeSubscribers = this.__findFirstSubscribers(target, [gestures.$swipe, gestures.$swipedown, gestures.$swipeleft, gestures.$swiperight, gestures.$swipeup]).length > 0; + if (this._android44orBelow) { + this.__haveSwipeSubscribers = this.__findFirstSubscribers(target, [gestures.$swipe, gestures.$swipedown, gestures.$swipeleft, gestures.$swiperight, gestures.$swipeup]).length > 0; + } var gestureCount = this._gestureCount, noHolds = gestureCount.$hold <= 0, noRelease = gestureCount.$release <= 0; // if any moving events registered, register move if (eventType === 'touchstart' || gestureCount.$track > 0 || diff --git a/dist/platypus.min.js b/dist/platypus.min.js index 4c7f58d4..942bee20 100644 --- a/dist/platypus.min.js +++ b/dist/platypus.min.js @@ -1,8 +1,8 @@ var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},plat;!function(a){"use strict;";function b(){}function c(a,b,c,d,e,f){Object.defineProperty(a,b,{value:c,enumerable:d===!0,configurable:e===!0,writable:f===!0})}function d(a,b,c,d,e){Object.defineProperty(a,b,{get:function(){return c},enumerable:d===!0,configurable:e===!0})}function e(a,b,d){for(var f=[],g=3;g=0}function y(a){return"object"==typeof a&&$e.call(a)===ef}function z(a,b,c){var d=[];return u(b)?d:t(b.filter)?b.filter(a,c):(B(function(b,c,e){a(b,c,e)&&d.push(b)},b),d)}function A(a,b){return z(function(b){return!I(function(a,c){return b[c]!==a},a)},b)}function B(a,b,c){if(u(b)||!h(b)&&!x(b))return b;var d,e,f;if(t(b.forEach))return b.forEach(a,c);if(x(b))for(d=0,f=b.length;f>d;++d)a.call(c,b[d],d,b);else{var g=Object.keys(b);for(f=g.length;g.length>0;)e=g.shift(),a.call(c,b[e],e,b)}return b}function C(a,b,c){var d=[];return u(b)?d:t(b.map)?b.map(a,c):(B(function(e,f){d.push(a.call(c,e,f,b))},b),d)}function D(a,b,c){return ya=ya||plat.acquire(Oa),ya.all(C(a,b,c))}function E(a,b,c,d){ya=ya||plat.acquire(Oa);var e=ya.resolve([]);if(!w(b))return e;a=a.bind(c);var f=function(b,c,d,e){return b.then(function(b){return a(c,d,e).then(function(a){return b.concat(a)})})};return d===!0?b.reduceRight(f,e):b.reduce(f,e)}function F(a,b,c){return E(a,b,c)}function G(a,b,c){return E(a,b,c,!0)}function H(a,b){return C(function(b){return b[a]},b)}function I(a,b,c){if(u(b)||t(b))return!1;var d,e,f,g;if(t(b.some))return b.some(a,c);if(x(b)){for(d=0,f=b.length;f>d;++d)if(g=a.call(c,b[d],d,b),g===!0)return!0}else{var h=Object.keys(b);for(f=h.length;h.length>0;)if(e=h.shift(),g=a.call(c,b[e],e,b),g===!0)return!0}return!1}function J(a,b,c){return K(a,0,b,c)}function K(a,b,c,d){function e(){a.apply(d,c)}var f=setTimeout(e,b);return function(){clearTimeout(f)}}function L(a,b,c,d){function e(){a.apply(d,c)}var f=setInterval(e,b);return function(){clearInterval(f)}}function M(a,c){za=za||plat.acquire(Pa);var d=za.requestAnimationFrame;if(v(d))return J(function(){a.call(c,Date.now())});var e=d(a.bind(c)),f=za.cancelAnimationFrame||b;return function(){f(e)}}function N(a){function b(){return a+c.join("")}u(a)&&(a="");var c=Ze[a];u(c)&&(c=Ze[a]=["0","/"]);for(var d,e=c.length;e--;){if(d=c[e].charCodeAt(0),57===d)return c[e]="A",b();if(90===d)return c[e]="a",b();if(122!==d)return c[e]=String.fromCharCode(d+1),b();c[e]="0"}return c.unshift("0"),b()}function O(a){return!n(a)||q(a)?a:(a=a.charAt(0).toLowerCase()+a.slice(1),Aa=Aa||plat.acquire($a).camelCaseRegex,a.replace(Aa,function(a,b,c,d){return d?c.toUpperCase():c}))}function P(a,b){return!n(a)||q(a)?a:(u(b)&&(b=""),Ba=Ba||plat.acquire($a).capitalCaseRegex,a.replace(Ba,function(a,c){return c?b+a.toLowerCase():a.toLowerCase()}))}function Q(a,b){return u(a)||delete a[b],a}function R(a,b){return u(a)?a:a[b]}function S(a){if(!q(a)){for(var b,c=a.split("&"),d={},e=c.length,f=0;e>f;++f)b=c[f].split("="),d[b[0]]=b[1];return d}}function T(a){return!w(a)&&!h(a)||q(a)?"":"?"+C(function(a,b){return b+"="+a},a).join("&")}function U(a){return w(a)?a.reduce(function(a,b){return a&&b!==!1},!0):r(a)?a:!0}function V(a,b,c){var d=l(b),e=!k(b),f=d?b:(Ca||(Ca=plat.acquire(Sa))).createDocumentFragment();e&&(b=f);var g,h=w(a)?a:Array.prototype.slice.call(a),i=h.length;if(c===!0){var j;for(g=0;i>g;++g)j=h[g].cloneNode(!0),f.insertBefore(j,null)}else for(g=0;i>g;++g)f.insertBefore(h[g],null);return d||e||b.appendChild(f),b}function W(a){for(var b=Array.prototype.slice.call(a.childNodes);b.length>0;)a.removeChild(b.pop())}function X(a,b){if(t(a.push)||(a=Array.prototype.slice.call(a)),!u(b))return void Y(a,b);for(var c;a.length>0;)c=a.pop(),b=c.parentNode,u(b)||b.removeChild(c)}function Y(a,b){for(;a.length>0;)b.removeChild(a.pop())}function Z(a){za=za||(za=plat.acquire(Pa)),Ca=Ca||(Ca=plat.acquire(Sa));var b=kf.exec(a),c=Ca.createElement("div");if(u(b))return c=fa(c,a),c.removeChild(c.lastChild);a=a.trim();var d=b[1];if(za.pushState&&v(qf[d]))return fa(c,a);if("body"===d)return c=fa(Ca.createElement("html"),a),c.removeChild(c.lastChild);var e=rf[d]||rf._default,f=e[0],g=e[1],h=e[2];for(c=fa(c,g+a+h);f-->0;)c=c.lastChild;return c}function $(a,b){if(W(a),!q(b)){var c=Z(b);return c.childNodes.length>0?V(c.childNodes,a):a.insertBefore(c,null),a}}function _(a,b,c){if(!u(a)&&h(b)){v(c)&&(c=null);var d;if(k(b))return d=b,b=Array.prototype.slice.call(d.childNodes),a.insertBefore(d,c),b;t(b.push)||(b=Array.prototype.slice.call(b)),Ca=Ca||(Ca=plat.acquire(Sa));var e=b.length;d=Ca.createDocumentFragment();for(var f=0;e>f;++f)d.insertBefore(b[f],null);return a.insertBefore(d,c),b}}function aa(a){var b=a.parentNode,c=_(b,a.childNodes,a);return b.removeChild(a),c}function ba(a,b){if(u(b))return b;if(a.nodeType===Node.ELEMENT_NODE)for(var c,d=a.attributes,e=d.length,f=0;e>f;++f)c=d[f],b.setAttribute(c.name,c.value);var g=a.parentNode;return _(b,a.childNodes),g.replaceChild(b,a),b}function ca(a){Ca=Ca||(Ca=plat.acquire(Sa));var b=Ca.createDocumentFragment();return q(a)||$(b,a),b}function da(a,b){if(!u(a)){var c,d=a.nextSibling,e=a.parentNode;if(u(b)&&(b=null),!u(e)&&(u(b)||b.parentNode===e))for(;d!==b;)c=d.nextSibling,e.removeChild(d),d=c}}function ea(a,b){u(a)||(da(a,b),ga(a),ga(b))}function fa(a,b){return za=za||(za=plat.acquire(Pa)),za.msApp?MSApp.execUnsafeLocalFunction(function(){a.innerHTML=b}):a.innerHTML=b,a}function ga(a){if(k(a)){var b=a.parentNode;u(b)||b.removeChild(a)}}function ha(a,b){var c=(a||{}).className;if(n(c)&&n(b)&&""!==b){var d,e,f=b.split(lf);if(v(a.classList)){if(q(c))return void(a.className=b);for(;f.length>0;)d=f.shift(),""!==d&&(e=new RegExp("^"+d+"\\s+|\\s+"+d+"$|\\s+"+d+"\\s+","g"),e.test(c)||(a.className+=" "+d))}else for(;f.length>0;)d=f.shift(),""!==d&&a.classList.add(d)}}function ia(a,b){var c=(a||{}).className;if(n(c)&&n(b)&&""!==b){var d,e=b.split(lf);if(v(a.classList)){if(c===b)return void(a.className="");for(;e.length>0;)d=e.shift(),""!==d&&(a.className=c=c.replace(new RegExp("^"+d+"\\s+|\\s+"+d+"$|\\s+"+d+"\\s+","g"),""))}else for(;e.length>0;)d=e.shift(),""!==d&&a.classList.remove(d)}}function ja(a,b){var c=(a||{}).className;if(n(c)&&n(b)&&""!==b){var d,e=b.split(lf);if(v(a.classList)){var f;if(""===c)a.className=b;else if(c===b)return void(a.className="");for(;e.length>0;)if(d=e.shift(),""!==d){if(f=new RegExp("^"+d+"\\s+|\\s+"+d+"$|\\s+"+d+"\\s+","g"),f.test(c)){a.className=c=c.replace(f,"");continue}a.className+=" "+d}}else for(;e.length>0;)d=e.shift(),""!==d&&a.classList.toggle(d)}}function ka(a,b,c){var d=(a||{}).className;if(n(d)&&n(c)&&""!==c){if(v(a.classList)){var e=new RegExp("^"+b+"\\s+","g"),f=new RegExp("\\s+"+b+"\\s+","g"),g=new RegExp("\\s+"+b+"$","g");return void(a.className=d.replace(e,c+" ").replace(f," "+c+" ").replace(g," "+c))}a.classList.add(c),a.classList.remove(b)}}function la(a,b){var c=(a||{}).className;if(!n(c)||!n(b)||""===b)return!1;var d=b.split(lf);if(v(a.classList)){if(""===c)return!1;if(c===b)return!0;for(var e;d.length>0;)if(e=d.shift(),""!==e&&!new RegExp("^"+e+"\\s|\\s"+e+"$|\\s"+e+"\\s","g").test(c))return!1;return!0}for(;d.length>0;)if(e=d.shift(),""!==e&&!a.classList.contains(e))return!1;return!0}function ma(a){return Da=Da||(Da=plat.acquire(nb)),Ea=Ea||(Ea=plat.acquire(La)),Da.put(a,Da.read(a).catch(function(b){return u(b)?Ea.ajax({url:a}):void 0}).then(function(b){if(l(b))return Da.put(a,b);if(!h(b)||!n(b.response))return Fa=Fa||(Fa=plat.acquire(Ya)),Fa.warn("No template found at "+a),Da.put(a);var c=b.response;return q(c.trim())?Da.put(a):Da.put(a,c)}).catch(function(b){return J(function(){Fa=Fa||(Fa=plat.acquire(Ya)),Fa.error(new Error("Failure to get template from "+a+"."))}),b}))}function na(a){var b,c=w(a);b=c?Af.Injector.getDependencies(a):Af.Injector.getDependencies([a]);for(var d=b.length,e=[],f=0;d>f;++f)e.push(b[f].inject());return c?e:e[0]}function oa(){return window}function pa(a){return a.document}function qa(a){return!u(Lf[a])}function ra(a){return!u(Kf[a])}function sa(a){return!u(Jf[a])}function ta(a){return!v(Mf[a])}function ua(a,b,c,d,e,f){return Of._parser=a,Of._ContextManager=b,Of._EventManager=c,Of._Promise=d,Of._dom=e,Of._log=f,Of}function va(){return Pf}function wa(a,b,c,d,e,f){return Uf._compat=a,Uf._EventManager=b,Uf._document=c,Uf._compiler=d,Uf._LifecycleEvent=e,Uf._log=f,Uf}function xa(a){return a.app}var ya,za,Aa,Ba,Ca,Da,Ea,Fa,Ga,Ha="$",Ia="context",Ja=Ha+"AppStatic",Ka=Ha+"App",La=Ha+"Http",Ma=Ha+"HttpRequestInstance",Na=Ha+"HttpConfig",Oa=Ha+"Promise",Pa=Ha+"Compat",Qa=Ha+"ControlFactory",Ra=Ha+"AttributeControlFactory",Sa=Ha+"Document",Ta=Ha+"DispatchEventInstance",Ua=Ha+"ErrorEventStatic",Va=Ha+"EventManagerStatic",Wa=Ha+"LifecycleEventStatic",Xa=Ha+"LifecycleEventInstance",Ya=Ha+"Log",Za=Ha+"Parser",$a=Ha+"Regex",_a=Ha+"Tokenizer",ab=Ha+"NavigatorInstance",bb=Ha+"ContextManagerStatic",cb=Ha+"ContextManagerInstance",db=Ha+"Compiler",eb=Ha+"CommentManagerFactory",fb=Ha+"CommentManagerInstance",gb=Ha+"ElementManagerFactory",hb=Ha+"ElementManagerInstance",ib=Ha+"NodeManagerStatic",jb=Ha+"TextManagerFactory",kb=Ha+"TextManagerInstance",lb=Ha+"CacheFactory",mb=Ha+"ManagerCache",nb=Ha+"TemplateCache",ob=Ha+"Animator",pb=Ha+"AttributesFactory",qb=Ha+"AttributesInstance",rb=Ha+"BindableTemplatesFactory",sb=Ha+"Dom",tb=Ha+"DomEvents",ub=Ha+"IDomEventsConfig",vb=Ha+"DomEventInstance",wb=Ha+"ResourcesFactory",xb=Ha+"ResourcesInstance",yb=Ha+"TemplateControlFactory",zb=Ha+"TemplateControlInstance",Ab=Ha+"Utils",Bb=Ha+"Browser",Cb=Ha+"BrowserConfig",Db=Ha+"Router",Eb=Ha+"RouterStatic",Fb=Ha+"UrlUtilsInstance",Gb=Ha+"Window",Hb=Ha+"LocalStorage",Ib=Ha+"SessionStorage",Jb=Ha+"BaseSegmentFactory",Kb=Ha+"BaseSegmentInstance",Lb=Ha+"StaticSegmentInstance",Mb=Ha+"VariableSegmentInstance",Nb=Ha+"DynamicSegmentInstance",Ob=Ha+"SplatSegmentInstance",Pb=Ha+"StateStatic",Qb=Ha+"StateInstance",Rb=Ha+"RouteRecognizerInstance",Sb=Ha+"InjectorStatic",Tb=Ha+"History",Ub=Ha+"Location",Vb="plat-",Wb=Vb+"bind",Xb=Vb+"href",Yb=Vb+"src",Zb=Vb+"keydown",$b=Vb+"keypress",_b=Vb+"keyup",ac=Vb+"charpress",bc=Vb+"name",cc=Vb+"options",dc=Vb+"checked",ec=Vb+"disabled",fc=Vb+"selected",gc=Vb+"readonly",hc=Vb+"visible",ic=Vb+"style",jc=Vb+"tap",kc=Vb+"blur",lc=Vb+"change",mc=Vb+"copy",nc=Vb+"cut",oc=Vb+"paste",pc=Vb+"dbltap",qc=Vb+"focus",rc=Vb+"submit",sc=Vb+"touchstart",tc=Vb+"touchend",uc=Vb+"touchmove",vc=Vb+"touchcancel",wc=Vb+"hold",xc=Vb+"release",yc=Vb+"swipe",zc=Vb+"swipeleft",Ac=Vb+"swiperight",Bc=Vb+"swipeup",Cc=Vb+"swipedown",Dc=Vb+"track",Ec=Vb+"trackleft",Fc=Vb+"trackright",Gc=Vb+"trackup",Hc=Vb+"trackdown",Ic=Vb+"trackend",Jc=Vb+"react",Kc=Vb+"link",Lc=Vb+"foreach",Mc=Vb+"html",Nc=Vb+"if",Oc=Vb+"ignore",Pc=Vb+"select",Qc=Vb+"template",Rc=Vb+"viewport",Sc=Vb+"control",Tc=Vb+"viewcontrol",Uc=Vb+"resources",Vc=Vb+Ia,Wc=Qc+"-"+Ia,Xc=Vb+"callback",Yc="data-",Zc="__templateControlCache",$c="head",_c="meta",ad="title",bd="description",cd="author",dd="creator",ed="link",fd="href",gd="name",hd="property",id="image",jd="video",kd="type",ld="rel",md="url",nd="article:",od="og:",pd="twitter:",qd="content",rd="ready",sd="suspend",td="resume",ud="online",vd="offline",wd="error",xd="shutdown",yd="exiting",zd="beforeLoad",Ad="beforeNavigate",Bd="navigated",Cd="navigating",Dd="urlChanged",Ed="pause",Fd="deviceReady",Gd="backbutton",Hd="backclick",Id="backButtonPressed",Jd=Vb+"hide",Kd=Vb+"animating",Ld=Vb+"animation",Md=Vb+"transition",Nd=Vb+"enter",Od=Vb+"leave",Pd=Vb+"move",Qd=Vb+"fadein",Rd=Vb+"fadeout",Sd="$",Td=Sd+"tap",Ud=Sd+"dbltap",Vd=Sd+"touchstart",Wd=Sd+"touchend",Xd=Sd+"touchmove",Yd=Sd+"touchcancel",Zd=Sd+"hold",$d=Sd+"release",_d=Sd+"swipe",ae=Sd+"swipeleft",be=Sd+"swiperight",ce=Sd+"swipeup",de=Sd+"swipedown",ee=Sd+"track",fe=Sd+"trackleft",ge=Sd+"trackright",he=Sd+"trackup",ie=Sd+"trackdown",je=Sd+"trackend",ke={index:"index",even:"even",odd:"odd",first:"first",last:"last"},le="base",me="variable",ne="static",oe="splat",pe="dynamic",qe=1e3,re="{{",se="}}",te="static",ue="singleton",ve="instance",we="factory",xe="class",ye="css",ze="-compiled",Ae="-@",Be="-init",Ce=": start node",De=": end node",Ee="popstate",Fe="hashchange",Ge="wrapped",He="plat_callback",Ie="js",Je="noop",Ke="__app__",Le="resource",Me=Le+"s",Ne="alias",Oe=Ne+"es",Pe="observable",Qe="injectable",Re="object",Se="function",Te="literal",Ue="root",Ve="rootContext",We="control",Xe=Ia,Ye=!!Array.isArray,Ze={},$e=Object.prototype.toString,_e="[object ",af=_e+"Error]",bf=_e+"File]",cf=_e+"Array]",df=_e+"Boolean]",ef=_e+"Date]",ff=_e+"Number]",gf=_e+"RegExp]",hf=_e+"String]",jf=_e+"Promise]",kf=/<([\w:]+)/,lf=/\s+/g,mf=[1,'"],nf=[1,"","
"],of=[3,"","
"],pf=[1,'',""],qf={thead:nf,tbody:nf,tfoot:nf,colgroup:nf,caption:nf,tr:[2,"","
"],col:[2,"","
"],td:of,th:of},rf=e(!1,!1,{},qf,{option:mf,optgroup:mf,legend:[1,"
","
"],area:[1,"",""],param:[1,"",""],text:pf,circle:pf,ellipse:pf,line:pf,path:pf,polygon:pf,polyline:pf,rect:pf,_default:[0,"",""]}),sf={},tf={},uf={},vf={},wf={},xf={},yf={},zf={};!function(a){function b(b,c,d,e,f,g){var h=b[c]=new Af.Injector(c,d,e,f);return g===!0&&(xf[c]=h),a}function c(b,c,d){var e=na(Sb),f=na(Ja);return f.registerApp(new e(b,c,d)),a}function d(a,c,d,e){if(!n(a))throw new Error("A Control must be registered with a string name");return a=a.toLowerCase(),"head"===a&&(e=!0),b(sf,a,c,d,e?te:void 0)}function e(a,c,d){if(!n(a))throw new Error("A ViewControl must be registered with a string name");return a=a.toLowerCase(),b(tf,a,c,d)}function f(a,c,d,e){if(n(e)){if(e=e.toLowerCase(),e===we||e===te||e===xe)return b(vf,a,c,d,e,!0);if(e!==ue&&e!==ve)throw new Error("Invalid injectable type "+e+" during injectable registration.")}else e=ue;return b(vf,a,c,d,e,!1)}function g(c,d,e,f){if(n(f)&&(f=f.toLowerCase(),f!==ye&&f!==Ie))throw new Error('Invalid animationType "'+f+'" during animation registration.');return b(f===Ie?zf:yf,c,d,e,a.injectable.INSTANCE)}a.app=c,a.control=d,a.viewControl=e,a.injectable=f;var f;!function(a){a.STATIC=te,a.SINGLETON=ue,a.INSTANCE=ve,a.FACTORY=we,a.CLASS=xe}(f=a.injectable||(a.injectable={})),a.animation=g;var g;!function(a){a.CSS=ye,a.JS=Ie}(g=a.animation||(a.animation={}))}(Ga=a.register||(a.register={}));var Af;!function(a){var c=function(){function a(b,c,d,e){void 0===e&&(e=null),this.name=b,this.Constructor=c,this.type=e;var f,g=this.dependencies=a.convertDependencies(d),h=g.indexOf(Je);if(Object.defineProperty(c,"__injectorName",{value:b,enumerable:!1,configurable:!0,writable:!0}),Object.defineProperty(c,"__injectorDependencies",{value:g.slice(0),enumerable:!1,configurable:!0,writable:!0}),h>-1){var i=d[h];if(u(i))throw new TypeError("The dependency for "+b+" at index "+h+" is undefined, did you forget to include a file?");throw new TypeError("Could not resolve dependency "+i.slice(9,i.indexOf("("))+" for "+b+". Are you using a static injectable Type?")}if(f=a.__findCircularReferences(this),n(f))throw new Error("Circular dependency detected from "+this.name+" to "+f+".");if(b===Ja){var j=this.inject();this.dependencies=g,j.start()}}return a.initialize=function(){for(var a=xf,b=Object.keys(a),c=b.length,d=0;c>d;++d)a[b[d]].inject();xf={}},a.getDependencies=function(b){if(u(b)||q(b))return[];for(var c=[],d=b.length,e=0;d>e;++e)c.push(a.getDependency(b[e]));return c},a.getDependency=function(b){return u(b)||b===Je?a.__noop():a.isInjector(b)?b:a.__locateInjector(b)},a.convertDependencies=function(b){if(!w(b))return[];for(var c=a.convertDependency,d=[],e=b.length,f=0;e>f;++f)d.push(c(b[f]));return d},a.convertDependency=function(b){return u(b)?Je:a.__getInjectorName(b)},a.isInjector=function(a){return t(a.inject)&&!v(a.type)&&!v(a.name)&&!v(a.Constructor)},a.__getInjectorName=function(b){if(u(b))return Je;if(n(b))return b;var c=b,d=h(c._inject)?c._inject:{};if(n(c.__injectorName)&&(b=c.__injectorName),!n(b))return new a(b,c,d.dependencies);var e=a.__findInjector.bind(a,b),f=e(vf)||e(wf)||e(xf)||e(tf)||e(sf)||e(yf)||e(zf);return!h(f)&&n(b)&&(f=wf[b]=new a(b,c,c._inject.dependencies)),h(f)?f.name:Je},a.__construct=function(b,c,d){if(u(b)||u(b.prototype))return b;var e,f=Object.create(b.prototype),g=d===ve;g&&(e=uf[b.__injectorName]),h(e)||(e=a.__walk(f,Object.getPrototypeOf(f),{}),g&&(uf[b.__injectorName]=e));for(var i=na(C(function(a){return a},e)),j=Object.keys(e),k=j.length,l=0;k>l;++l)f[j[l]]=i[l];var m=f.constructor.apply(f,c);return v(m)?f:m},a.__walk=function(b,c,d){var g=c.constructor,i={};h(g._inject)&&g!==Object&&(i=a.__walk(b,Object.getPrototypeOf(c),d));var j=f(g._inject,!0);return e(!1,!1,{},d,i,j)},a.__locateInjector=function(b){if(!u(b)){var c=b;n(b.__injectorName)&&(c=b.__injectorName);var d=a.__findInjector.bind(a,c),e=d(vf)||d(wf)||d(xf)||d(sf)||d(tf)||d(yf)||d(zf);return h(e)||(t(b)?(n(c)||(c=N(Vb)),e=new a(c,b,h(b._inject)?b._injectorDependencies:[]),wf[c]=e):e=a.__wrap(b)),e}},a.__findInjector=function(b,c){if(!u(b)){if(b===a||b===Sb){var d=a.__wrap(a);return d.name=Sb,d}return n(b)?c[b]||c[b.toLowerCase()]:void 0}},a.__wrap=function(a){return{inject:function(){return a},name:Ge,dependencies:[],Constructor:a}},a.__noop=function(){return{inject:b,type:Je,name:Je,dependencies:[],Constructor:b}},a.__findCircularReferences=function(b){if(h(b)&&w(b.dependencies))for(var c,d,e,f=b.name,g=b.dependencies,i=[{name:f,dependencies:g.slice(0)}],j=a.__locateInjector;i.length>0;){c=i.pop(),g=c.dependencies,e=g.length;for(var k=0;e>k;++k){if(d=g[k],d===f)return c.name;b=j(d),h(b)&&w(b.dependencies)&&i.push({name:b.name,dependencies:b.dependencies.slice(0)})}}},a.prototype.inject=function(){for(var b,c,d=[],e=this.type,f=this.dependencies,g=f.length,h=0;g>h;++h)b=a.getDependency(f[h]),d.push(b.inject());return c=a.__construct(this.Constructor,d,e),n(e)&&e!==ve&&this._wrapInjector(c),c.__injectable__type=e,c},a.prototype._wrapInjector=function(a){return this.inject=function(){return a},this},a}();a.Injector=c;var d;!function(a){a.control=sf,a.viewControl=tf,a.injectable=vf,a.staticInjectable=xf,a.animation=yf,a.jsAnimation=zf}(d=a.injectors||(a.injectors={}))}(Af=a.dependency||(a.dependency={})),v(window)||(v(window.plat)&&(window.plat=plat),v(window.module)&&(window.module={})),a.acquire=na;var Bf;!function(a){var b=function(){function a(){this.ERROR=5,this.WARN=4,this.INFO=3,this.DEBUG=2,this.TRACE=1,this._level=this.INFO}return a.prototype.error=function(a){throw this._log(a,this.ERROR),a},a.prototype.warn=function(a){this._log(a,this.WARN)},a.prototype.info=function(a){this._log(a,this.INFO)},a.prototype.debug=function(a){this._log(a,this.DEBUG)},a.prototype.trace=function(a){this._log(a,this.TRACE)},a.prototype.setLogLevel=function(a){switch(n(a)&&(a=this[a.toUpperCase()]),a){case this.ERROR:case this.WARN:case this.INFO:case this.DEBUG:case this.TRACE:this._level=a;break;default:this._level=this.INFO}},a.prototype._log=function(b,c){if(this._shouldLog(c)){n(b)&&(b=new Error(b));var d=this._ErrorEvent;u(d)&&(d=this._ErrorEvent=na(Ua)),d.dispatch(wd,a,b,c)}},a.prototype._shouldLog=function(a){return s(a)||(a=this.INFO),this._level1?(a=w(h)&&h.length>1?h[1]:"",d=a[0].toUpperCase()+a.slice(1),b="WebKit|Moz|MS".match(new RegExp("("+a+")","i"))[1],c="-"+a+"-"):v(g.OLink)?a=d=b=c="":(a="o",d=b="O",c="-o-"),this.vendorPrefix={dom:b,lowerCase:a,css:c,upperCase:d},this.requestAnimationFrame=e.requestAnimationFrame||e[a+"RequestAnimationFrame"],this.cancelAnimationFrame=e.cancelAnimationFrame||e[a+"CancelRequestAnimationFrame"]||e[a+"CancelAnimationFrame"];var i=f.style;!(v(this.ANDROID)||Math.floor(this.ANDROID/10)>=44)||v(i.animation)||v(i.transition)?v(i[d+"Animation"])||v(i[d+"Transition"])||(this.animationSupported=!0,this.animationEvents={$animation:a+"Animation",$animationStart:a+"AnimationStart",$animationEnd:a+"AnimationEnd",$animationIteration:a+"AnimationIteration",$transition:a+"Transition",$transitionStart:a+"TransitionStart",$transitionEnd:a+"TransitionEnd"}):(this.animationSupported=!0,this.animationEvents={$animation:"animation",$animationStart:"animationstart",$animationEnd:"animationend",$animationIteration:"animationiteration",$transition:"transition",$transitionStart:"transitionstart",$transitionEnd:"transitionend"})},a.prototype.__determineCss=function(){var a=this._document,b=a.head,c=a.createElement("div");c.setAttribute(Jd,""),b.insertBefore(c,null);var d=this._window.getComputedStyle(c),e=d.display,f=d.visibility;this.platCss="none"===e||"hidden"===f,b.removeChild(c)},a._inject={_window:Gb,_history:Tb,_document:Sa},a}();a.Compat=Cf,Ga.injectable(Pa,Cf);var Df=function(){function a(){}return a.prototype.noop=function(){},a.prototype.extend=function(a){for(var b=[],c=1;c<|~]/,this.fullUrlRegex=/^(?:[a-z0-9\-]+:)(?:\/\/)?|(?:\/\/)/i,this.validateEmail=new RegExp('^(([^<>()[\\]\\.,;:\\s@\\"]+(\\.[^<>()[\\]\\.,;:\\s@\\"]+)*)|(\\".+\\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$'),this.validateTelephone=/^\+?[0-9\.\(\)\s-]*$/,this.dynamicSegmentsRegex=/^:([^\/]+)$/,this.splatSegmentRegex=/^\*([^\/]+)$/}return Object.defineProperty(a.prototype,"newLineRegex",{get:function(){return/\r|\n/g},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"optionalRouteRegex",{get:function(){return/\((.*?)\)/g},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"namedParameterRouteRegex",{get:function(){return/(\(\?)?:\w+/g},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"wildcardRouteRegex",{get:function(){return/\*\w*/g},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"escapeRouteRegex",{get:function(){return/[\-{}\[\]+?.,\\\^$|#\s]/g},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"camelCaseRegex",{get:function(){return/([\-_\.\s])(\w+?)/g},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"capitalCaseRegex",{get:function(){return/[A-Z]/g},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"whiteSpaceRegex",{get:function(){return/("[^"]*?"|'[^']*?')|[\s\r\n\t\v]/g},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"quotationRegex",{get:function(){return/'|"/g},enumerable:!0,configurable:!0}),a}();a.Regex=b,Ga.injectable($a,b);var c=function(){function a(){this.__previousChar="",this.__variableRegex=na($a).invalidVariableRegex,this.__outputQueue=[],this.__operatorStack=[],this.__argCount=[],this.__objArgCount=[],this.__lastColonChar=[],this.__lastCommaChar=[]}return a.prototype.createTokens=function(a){if(u(a))return[];this._input=a;for(var b,c=a.length,d=0,e=!1,f=this._isSpace,g=this._isAlphaNumeric,h=0;c>h;h++)if(b=a[h],!f(b)){if(g(b))h=this.__handleAplhaNumeric(h,b);else if(qa(b))switch(b){case".":h=this.__handlePeriod(h,b);break;case"{":this.__handleLeftBrace(b);break;case"}":this.__handleRightBrace(b);break;case"[":this.__handleLeftBracket(b);break;case"]":this.__handleRightBracket(b);break;case"(":this.__handleLeftParenthesis(b);break;case")":this.__handleRightParenthesis(b);break;case",":this.__handleComma(b);break;case"'":case'"':h=this.__handleStringLiteral(h,b)}else if(sa(b))switch(b){case"?":e=!0,d++,this.__handleQuestion(b);break;case":":d=this.__handleColon(b,d);break;default:h=this.__handleOtherOperator(h,b)}else if(";"===b)return this._throwError("Unexpected semicolon"),[];this.__previousChar=b}if(e&&d>0)return this._throwError("Improper ternary expression"),[];if(this.__objArgCount.length>0)return this._throwError("Improper object literal"),[];this.__popRemainingOperators();var i=this.__outputQueue;return this._resetTokenizer(),i},a.prototype._checkType=function(a,b){return b?this._isNumeric(a):this._isAlphaNumeric(a)},a.prototype._lookAhead=function(a,b,c){for(var d,e=this._input,f=e.length;++b="0"&&"9">=a},a.prototype._isSpace=function(a){return" "===a||"\r"===a||"\n"===a||" "===a||" "===a||" "===a},a.prototype._isAlphaNumeric=function(a){return a>="a"&&"z">=a||a>="A"&&"Z">=a||a>="0"&&"9">=a||"@"===a||"_"===a||"$"===a},a.prototype._isStringValidVariable=function(a){return!this.__variableRegex.test(a)},a.prototype.__handleAplhaNumeric=function(a,b){var c=this._isNumeric(b),d=this._lookAhead(b,a,c);return this.__outputQueue.push(c?{val:Number(d),args:0}:{val:d,args:-1}),a+d.length-1},a.prototype.__handlePeriod=function(a,b){var c,d=this.__outputQueue,e=this.__operatorStack,f=d.length-1,g=this.__previousChar;return 0>f||this._isSpace(g)||!u(Jf[g])||"("===g||","===g?(c=this._lookAhead(b,a,!0),a+=c.length-1,d.push({val:parseFloat(c),args:0})):this._isValEqual(e[0],b)?d.push({ val:b,args:0}):u(d[f])||!s(Number(d[f].val))||this._isValEqual(d[f-1],b)?e.unshift({val:b,args:0}):(c=this._lookAhead(b,a,!0),a+=c.length-1,d[f].val+=parseFloat(c)),a},a.prototype.__handleLeftBrace=function(a){this.__operatorStack.unshift({val:a,args:0}),this.__objArgCount.push(0),this.__lastColonChar.push(a),this.__lastCommaChar.push(a)},a.prototype.__handleRightBrace=function(a){var b=this.__operatorStack,c=b[0],d=this.__objArgCount.pop();return u(c)?this._throwError("Improper object literal"):(this._popStackForVal(c,"{","Improper object literal"),b.shift(),this.__lastColonChar.pop(),this.__lastCommaChar.pop(),void this.__outputQueue.push({val:"{}",args:d}))},a.prototype.__handleLeftBracket=function(a){var b=this.__previousChar,c=this.__operatorStack;this._isValEqual(c[0],".")&&this.__outputQueue.push(c.shift()),c.unshift({val:a,args:0}),this.__argCount.push({num:0,isArray:!("]"===b||")"===b||this._isAlphaNumeric(b))}),this.__lastCommaChar.push(a)},a.prototype.__handleRightBracket=function(a){var b=this.__operatorStack,c=b[0],d=this.__argCount.pop();return u(c)||u(d)?this._throwError("Brackets mismatch"):(d.isArray||d.num--,this._popStackForVal(c,"[","Brackets mismatch"),b.shift(),this.__lastCommaChar.pop(),void this.__outputQueue.push({val:"[]",args:"["===this.__previousChar?-1:d.num+1}))},a.prototype.__handleLeftParenthesis=function(a){var b=this.__previousChar,c=this.__operatorStack;if(this._isAlphaNumeric(b)||"]"===b||")"===b){var d=this.__outputQueue,e=d[d.length-1];this._isValEqual(e,"[]")?(c.unshift(d.pop()),c.unshift(d.pop())):this._isValEqual(e,"()")||this._isNumeric(e.val)||c.unshift(d.pop()),this.__argCount.push({num:0})}c.unshift({val:a,args:0}),this.__lastCommaChar.push(a)},a.prototype.__handleRightParenthesis=function(a){var b=this.__operatorStack,c=b[0],d=this.__argCount.pop();if(u(c))return this._throwError("Parentheses mismatch");if(this._popStackForVal(c,"(","Parentheses mismatch"),b.shift(),this.__lastCommaChar.pop(),!u(d)){var e=d.num;if("("===this.__previousChar)return void(this.__removeFnFromStack(e)&&this.__outputQueue.push({val:"()",args:0}));this.__removeFnFromStack(e+1)&&this.__outputQueue.push({val:"()",args:e+1})}},a.prototype.__handleComma=function(a){var b=this.__lastCommaChar,c=b[b.length-1];if("("===c||"["===c){var d=this.__argCount,e=d.length;if(!(e>0))return this._throwError("Mismatch with "+c);d[e-1].num++}var f=this.__operatorStack[0];return u(f)?this._throwError("Unexpected comma"):void this._popStackForVal(f,c,"Unexpected comma")},a.prototype.__handleStringLiteral=function(a,b){var c=this._lookAheadForDelimiter(b,a),d=this.__operatorStack;return this._isValEqual(d[0],"([")?d.unshift({val:c,args:0}):this.__outputQueue.push({val:c,args:0}),a+c.length+1},a.prototype.__handleQuestion=function(a){this.__lastColonChar.push(a),this.__determinePrecedence(a)},a.prototype.__handleColon=function(a,b){var c=this.__lastColonChar,d=c[c.length-1],e=this.__outputQueue;if("?"===d){var f=this.__operatorStack,g=f[0];if(u(g))return void this._throwError("Ternary mismatch");b--,c.pop(),this._popStackForVal(g,"?","Ternary mismatch"),e.push(f.shift()),f.unshift({val:a,args:-2})}else{if("{"!==d)return void this._throwError("Unexpected colon");var h=this.__objArgCount,i=e.length-1;if(h[h.length-1]++,0>i)return void this._throwError("Unexpected colon");e[i].args=1}return b},a.prototype.__handleOtherOperator=function(a,b){var c=this._lookAheadForOperatorFn(b,a);return this.__determinePrecedence(c),a+c.length-1},a.prototype.__popRemainingOperators=function(){for(var a,b,c=this.__outputQueue,d=this.__operatorStack;d.length>0;){if(a=d.shift(),b=a.val,"("===b||")"===b)return this._throwError("Parentheses mismatch");c.push(a)}},a.prototype.__determineOperator=function(a){switch(a){case"+":case"-":if(0===this.__outputQueue.length||sa(this.__previousChar))return Jf["u"+a];default:return Jf[a]}},a.prototype.__determinePrecedence=function(a){var b,c,d=this.__determineOperator(a),e=d.precedence,f="ltr"===d.associativity,g=this.__operatorStack,h=this.__outputQueue;if(0===g.length)return void g.unshift({val:a,args:d.fn.length-2});do if(c=g[0].val,"."!==c){if(b=Jf[c],u(b)||!(b.precedence0);g.unshift({val:a,args:d.fn.length-2})},a.prototype.__removeFnFromStack=function(a){for(var b,c=this.__outputQueue,d=this.__operatorStack,e=d[0],f=this._isValEqual,g=this._isValUnequal,h=!1;!u(e)&&g(e,"([")&&(this._isStringValidVariable(e.val)||f(e.val,".[]")||ra(e.val));)b=d.shift(),-1!==b.args||f(b,".[]")||(b.args=-2),c.push(b),e=d[0],h=!0;return h||g(c[c.length-a-1],"()")||(h=!0),h},a._inject={_log:Ya},a}();a.Tokenizer=c,Ga.injectable(_a,c);var d=function(){function a(){this._tokens=[],this.__cache={},this.__codeArray=[],this.__identifiers=[],this.__tempIdentifiers=[],this.__aliases={}}return a.prototype.parse=function(a){var b=this.__cache[a];if(!u(b))return{expression:b.expression,identifiers:b.identifiers.slice(0),aliases:b.aliases.slice(0),evaluate:b.evaluate};this._tokens=this._tokenizer.createTokens(a),b=this._evaluate(a);var c=b.identifiers;if(0===c.length){var d=b.evaluate(null);b.evaluate=function(){return d}}return this.__cache[a]=b,b},a.prototype.clearCache=function(a){return n(a)?void Q(this.__cache,a):void(this.__cache={})},a.prototype._evaluate=function(a){for(var b,c,d,e=this._tokens,f=e.length,g=this.__tempIdentifiers,h=this.__codeArray,i=!1,j=0;f>j;j++)if(b=e[j],c=b.val,d=b.args,ra(c))switch(c){case"()":i=this.__handleFunction(j,d,i);break;case"{}":h.push(this.__convertObject(d)),g.push(".");break;default:0>d?(h.push("[]"),g.push(".")):d>0?(h.push(this.__convertArrayLiteral(d)),g.push(".")):i=this.__indexIntoObject(j,c,i)}else if(sa(c))if(0===d)h.push(this.__convertPrimitive(j,c,d));else switch(c){case"?":this.__handleQuestion();break;case":":this.__handleColon();break;case"+":case"-":1===d&&(c="u"+c);default:this.__handleOperator(c,d)}else 0>d?h.push(this.__convertFunction(j,c,i)):h.push(this.__convertPrimitive(j,c,d));this._popRemainingIdentifiers(),this._makeIdentifiersUnique();var k={evaluate:new Function(Ia,Oe,"var initialContext;return "+(0===h.length?'"'+a+'"':h.join(""))+";"),expression:a,identifiers:this.__identifiers.slice(0),aliases:Object.keys(this.__aliases)};return this._resetParser(),k},a.prototype._peek=function(a){return this._tokens[a+1]},a.prototype._lookBack=function(a){return this._tokens[a-1]},a.prototype._popRemainingIdentifiers=function(){for(var a,b=this.__identifiers,c=this.__tempIdentifiers;c.length>0;)a=c.pop(),"."!==a&&b.push(a)},a.prototype._makeIdentifiersUnique=function(){for(var a,b=this.__identifiers,c=[],d={};b.length>0;)a=b.pop(),d[a]||(d[a]=!0,c.push(a));this.__identifiers=c},a.prototype._isValEqual=function(a,b){return u(a)||u(a.val)?u(b):""===a.val?""===b:-1!==b.indexOf(a.val)},a.prototype._isValUnequal=function(a,b){return u(a)||u(a.val)?!u(b):""===a.val?""!==b:-1===b.indexOf(a.val)},a.prototype._resetParser=function(){this._tokens=[],this.__codeArray=[],this.__identifiers=[],this.__tempIdentifiers=[],this.__aliases={}},a.prototype._throwError=function(a){this._log.error(new Error(a))},a.prototype.__convertPrimitive=function(a,b,c){if(c>0)return this.__tempIdentifiers.push("."),b;var d=s(Number(b)),e=this._peek(a),f=!(u(e)||e.args>=1),g=this._isValEqual;return ta(b)||n(b)&&(d||this._isValUnequal(e,"[]()")||g(e,"[]")&&!f)?(this.__tempIdentifiers.push("."),'"'+b+'"'):(!d||g(e,".[]")&&f?this.__tempIdentifiers.push(b):this.__tempIdentifiers.push("."),b)},a.prototype.__convertFunction=function(a,b,c){if("@"===b[0])this.__aliases[b.slice(1)]=!0;else if(ta(b))return this.__tempIdentifiers.push("."),b;var d=this._peek(a),e=this._isValEqual;if(e(this._tokens[a-1],"()")&&e(d,".[]")?this.__tempIdentifiers.push("."):this.__tempIdentifiers.push(b),u(d))return"(initialContext = ("+this.__findInitialContext.toString()+')(context,aliases,"'+b+'"))';switch(d.val){case".":case"()":return b;default:if(!c)return"(initialContext = ("+this.__findInitialContext.toString()+')(context,aliases,"'+b+'"))'}},a.prototype.__convertObject=function(a){for(var b,c,d,e=this.__identifiers,f=this.__tempIdentifiers,g=this.__codeArray,h=0,i="{";h++1&&(c=f.pop(),f.pop(),"."!==c&&e.push(c));return i.replace(",","")+"}"},a.prototype.__convertArrayLiteral=function(a){for(var b,c=this.__identifiers,d=this.__tempIdentifiers,e=this.__codeArray,f=0,g="";f++0&&(b=d.pop(),"."!==b&&c.push(b));return"["+g.slice(0,-1)+"]"},a.prototype.__handleFunction=function(a,b,c){var d,e,f=this.__identifiers,g=this.__tempIdentifiers,h=this.__codeArray,i=0,j=this._lookBack(a),k=!u(j)&&(-2===j.args||this._isValEqual(j,".[]")),l="",m="",n="",o=!1;for(k&&(m=h.pop(),n=g.pop());i++0&&(d=g.pop(),"."!==d&&(f.push(d),o=!0));if(e=b>0?".call(initialContext || context,"+l.slice(0,l.length-1)+")":".call(initialContext || context)",c)if(c=!1,h.length>0){var p=h.pop(),r=g.length-1;0>r||"."===g[r]||""===n?""!==n&&o&&"["!==p[0]&&"]"!==p[p.length-1]&&(f[f.length-1]+="."+n):(g[r]+="."+n,f.push(g.pop())),e=q(m)?p+e:"(("+this.__indexIntoContext.toString()+")("+p+',"'+m+'") || (function () {}))'+e}else this._throwError("Improper expression or context");else k?(e="(initialContext = (("+this.__findInitialContext.toString()+')(context,aliases,"'+m+'") || (function () {}))'+e+")",f.push(m)):e=h.pop()+e;h.push(e);var s=g.length;return this._isValEqual(this._peek(a),"[]")&&s>0&&"."!==g[s-1]&&f.push(g.pop()),c},a.prototype.__indexIntoObject=function(a,b,c){var d=this._isValEqual;if(d(this._peek(a),"()"))return!0;var e,f=this.__codeArray,g=f.pop(),h=this.__identifiers,i=this.__tempIdentifiers,j=this._lookBack(a),k=i.pop(),l=!u(k);return l&&"@"===k[0]?(g="("+this.__indexIntoContext.toString()+")("+f.pop()+","+g+")",h.push(k),i.length>0&&h.push(i.pop())):d(j,"++--()[]*/%?:>=<=&&||!===")?(g="("+this.__indexIntoContext.toString()+")("+f.pop()+","+g+")",i.push(".")):"[]"!==b||u(j)||j.args>=0?(g="("+this.__indexIntoContext.toString()+")("+f.pop()+',"'+g+'")',e=i.length-1,e>=0?"."!==i[e]&&(i[e]+="."+k):l&&"."!==k&&"."!==b&&h.push(k)):(g="("+this.__indexIntoContext.toString()+")("+f.pop()+","+g+")",e=i.length-1,e>=0&&"."!==i[e]&&h.push(i.pop()),h.push(k)),f.push(g),c},a.prototype.__handleQuestion=function(){for(var a,b=this.__identifiers,c=this.__tempIdentifiers,d=this.__codeArray,e=d.pop(),f=0;2>f&&c.length>0;f++)a=c.pop(),"."!==a&&b.push(a);d.push(d.pop()+"?"+e)},a.prototype.__handleColon=function(){for(var a,b=this.__identifiers,c=this.__tempIdentifiers,d=this.__codeArray,e=d.pop(),f=0;2>f&&c.length>0;f++)a=c.pop(),"."!==a&&b.push(a);d.push(d.pop()+":"+e)},a.prototype.__handleOperator=function(a,b){for(var c,d=this.__identifiers,e=this.__tempIdentifiers,f=this.__codeArray,g=0,h="";g++0&&(c=e.pop(),"."!==c&&d.push(c));f.push("("+Jf[a].fn.toString()+")(context, aliases,"+h.slice(0,h.length-1)+")")},a.prototype.__findInitialContext=function(a,b,c){return"@"===c[0]&&null!==b&&"object"==typeof b?b[c.slice(1)]:null!==a&&"object"==typeof a?a[c]:void 0},a.prototype.__indexIntoContext=function(a,b){return null!==a&&"object"==typeof a?a[b]:void 0},a._inject={_tokenizer:_a,_log:Ya},a}();a.Parser=d,Ga.injectable(Za,d)}(Ef=a.expressions||(a.expressions={}));var Ff;!function(a){function b(a){return a.location}function c(){return d.config}a.Location=b,Ga.injectable(Ub,b,[Gb]);var d=function(){function a(){this.uid=N(Vb),this.__lastUrl=this._location.href,this.__initializing=!1,this._EventManager.on(this.uid,zd,this.initialize,this),this._compat.msApp&&(this._stack=[])}return a.prototype.initialize=function(){var a=this._compat;this._EventManager.dispose(this.uid),this.__initializing=!0,na(Fb);var b=this.url(),c=b,d=this._urlChanged.bind(this),e=this._dom,f=this._window;c!==b&&this.url(c,!0),a.pushState&&e.addEventListener(f,Ee,d,!1),e.addEventListener(f,Fe,d,!1),this.__initializing=!1},a.prototype.url=function(a,b){var c=this._location;return n(a)&&this.__lastUrl!==a&&(!b&&w(this._stack)&&this._stack.push(c.href),this._setUrl(a,b)),this.__currentUrl||c.href},a.prototype.back=function(a){s(a)||(a=1);var b=this._stack;return w(b)&&b.length>1?(this._stack=b=b.slice(0,b.length-(a-1)),this.url(b.pop()),void b.pop()):void this._history.go(-a)},a.prototype.forward=function(a){s(a)||(a=1),this._history.go(a)},a.prototype.urlUtils=function(b){b=b||this.url();var c=na(Fb),d=a.config;return d.routingType===d.HASH&&(b=b.replace(new RegExp("#"+(d.hashPrefix||"")+"/?"),"")),c.initialize(b),c},a.prototype.isCrossDomain=function(a){if(!n(a))return!1;var b=this.urlUtils(a),c=this.urlUtils();return b.protocol!==c.protocol||b.hostname!==c.hostname||b.port!==c.port},a.prototype._urlChanged=function(){if(!this.__initializing){this.__currentUrl=null;var b=this.url(),c=a.config;if(!(this.__lastUrl===b||c.routingType===c.STATE&&b.indexOf(this.__lastUrl+"#")>-1)){this.__lastUrl=b;var d=this._EventManager;d.dispatch(Dd,this,d.DIRECT,[this.urlUtils()])}}},a.prototype._setUrl=function(b,c){b=this.formatUrl(b);var d=this.urlUtils(b),e=a.config.baseUrl,f=this._history,g=this._location;return-1===d.href.indexOf(e)?void(g.href=b):(this._regex.fullUrlRegex.test(b)||"/"===b[0]||(b=e+b),void(this._compat.pushState?(c?f.replaceState(null,"",b):f.pushState(null,"",b),this.__initializing||this._urlChanged()):(this.__currentUrl=b,c?g.replace(b):g.href=b)))},a.prototype.formatUrl=function(b){var c=a.config,d=c.baseUrl,e=!this._regex.fullUrlRegex.test(b)||b.indexOf(d)>-1;if(!n(b))return"";if(b===d)return b;if("/"===b[0]&&(b=b.slice(1)),e&&c.routingType===c.HASH){var f=-1!==b.indexOf(this.urlUtils().protocol),g=c.hashPrefix||"",h="#"+g,i=new RegExp(h+"|#/");"/"!==b[b.length-1]&&-1===b.indexOf("?")&&(b+="/"),f&&!i.test(b)?b=b+h+"/":i.test(b)||(b=h+("/"!==b[0]?"/":"")+b)}return e&&-1===b.indexOf(d)&&(b=d+b),b},a._inject={_EventManager:Va,_compat:Pa,_regex:$a,_window:Gb,_location:Ub,_history:Tb,_dom:sb},a.config={HASH:"hash",STATE:"state",routingType:"hash",hashPrefix:"!",baseUrl:""},a}();a.Browser=d,Ga.injectable(Bb,d),a.IBrowserConfig=c,Ga.injectable(Cb,c);var e=function(){function a(){var b=this._browserConfig,c=b.baseUrl;if(q(c)||!this._regex.fullUrlRegex.test(c)){var d=this._window.location.href,e=d.replace(this._regex.initialUrlRegex,"/"),c=c;for(n(c)?0===c.indexOf("/")&&(c=c.slice(1)):c="",c=a.__getBaseUrl(e)+c;"/"===c[c.length-1];)c=c.slice(0,-1);b.baseUrl=c+"/"}}return a.__getQuery=function(a){return S(a)},a.__getBaseUrl=function(a){var b=na($a),c=na(Ub),d=c.origin,e=c.protocol;c.host;return"file:"===e||e.indexOf("wmapp")>-1||e.indexOf("ms-appx")>-1?d=c.href:v(d)&&(d=c.protocol+"//"+c.host),d=d.replace(b.initialUrlRegex,""),d.split("?")[0].split("#")[0]+"/"},a.prototype.initialize=function(b){b=b||"";var c=a.__urlUtilsElement||(a.__urlUtilsElement=this._document.createElement("a")),d=this._browserConfig;"/"===b[0]&&0!==b.indexOf("//")&&(b=b.slice(1)),this._regex.fullUrlRegex.test(b)||(b=d.baseUrl+b),c.setAttribute("href",b),b=c.href,c.setAttribute("href",b),b=c.href,this.href=b,this.protocol=c.protocol?c.protocol.replace(/:$/,""):"",this.host=c.host,this.search=c.search?c.search.replace(/^\?/,""):"",this.hash=c.hash?c.hash.replace(/^#/,""):"",this.hostname=c.hostname,this.port=c.port;var e;e=q(d.baseUrl)?"/"===c.pathname.charAt(0)?c.pathname:"/"+c.pathname:b.replace(d.baseUrl,"/"),e=e.replace(this._regex.initialUrlRegex,"/"),this.pathname=e.split("?")[0].split("#")[0],this.query=a.__getQuery(this.search)},a.prototype.toString=function(){return this.href},a._inject={_EventManager:Va,_document:Sa,_window:Gb,_compat:Pa,_regex:$a,_browserConfig:Cb},a}();a.UrlUtils=e,Ga.injectable(Fb,e,null,ve)}(Ff=a.web||(a.web={}));var Gf;!function(a){function c(){return function(){x.nextTick(g)}}function d(){var a=new r(g),b=na(Sa),c=na(Gb),d=b.createElement("div");return a.observe(d,{attributes:!0}),c.addEventListener("unload",function(){a.disconnect(),a=null},!1),function(){d.setAttribute("drainQueue","drainQueue")}}function f(){var a=a,b="undefined"!=typeof a?a:this;return function(){b.setTimeout(g,1)}}function g(){for(var a,b,c,d=0;d-1?"&":"?")+k+"="+j;var l=g[j];g[j]=function(b){t(a.clearTimeout)&&a.clearTimeout(),h.head.removeChild(i),v(l)?Q(g,j):g[j]=l,e({response:b,status:200})},h.head.appendChild(i);var m=c.timeout;s(m)&&m>0&&(a.clearTimeout=J(function(){a.clearTimeout=K(function(){f(new B({response:"Request timed out in "+m+"ms for "+d,status:408})),g[j]=b},m-1)}))});return e.initialize(this),e},a.prototype._xhrOnReadyStateChange=function(){var a=this.xhr;if(4===a.readyState){var b=a.status;if(0===b){var c=a.response;if(u(c))try{c=a.responseText}catch(a){}return q(c)?!1:!0}return b>=200&&300>b||304===b?!0:!1}},a.prototype._sendXhrRequest=function(){var a=this,b=this.xhr,c=this.__options,d=c.method,e=c.url,f=new C(function(f,g){b.onreadystatechange=function(){var b=a._xhrOnReadyStateChange();if(!u(b)){var d=a._formatResponse(c.responseType,b);b?f(d):g(new B(d)),a.xhr=c=null}},n(d)||(a._log.info('AjaxOptions method was not of type string. Defaulting to "GET".'),d="GET"),b.open(d.toUpperCase(),e,!0,c.user,c.password);var i=c.responseType;if(a.__fileSupported||""===i||"text"===i||(i=""),"json"===i)try{b.responseType=i}catch(a){b.responseType=""}b.withCredentials=c.withCredentials;var j=c.overrideMimeType,k=c.data;if(n(j)&&!q(j)&&b.overrideMimeType(j),u(k)||""===k)a.__setHeaders(),b.send();else{var l=c.transforms||[],m=l.length,o=c.contentType,p=n(o)&&!q(o);if(m>0){for(var r=0;m>r;++r)k=l[r](k,b);p&&b.setRequestHeader("Content-Type",o),a.__setHeaders(),b.send(k)}else if(h(k))if(p){var t=o.toLowerCase();-1!==t.indexOf("x-www-form-urlencoded")?(k=a.__serializeFormData(),b.setRequestHeader("Content-Type",o),a.__setHeaders(),b.send(k)):-1!==t.indexOf("multipart/form-data")?a.__fileSupported?(k=a.__appendFormData(),a.__setHeaders(),b.send(k)):a.__submitFramedFormData().then(function(a){f(a)},function(){a.xhr=null}):(k=JSON.stringify(k),b.setRequestHeader("Content-Type",o),a.__setHeaders(),b.send(k))}else a.__setHeaders(),b.send(k);else p&&b.setRequestHeader("Content-Type",o),a.__setHeaders(),b.send(k)}var v=c.timeout;s(v)&&v>0&&(a.clearTimeout=J(function(){a.clearTimeout=K(function(){g(new B({response:"Request timed out in "+v+"ms for "+c.url,status:b.status,getAllResponseHeaders:function(){return b.getAllResponseHeaders()},xhr:b})),b.onreadystatechange=null,b.abort(),a.xhr=null},v-1)}))});return f.initialize(this),f},a.prototype._invalidOptions=function(){var a=this;return new C(function(b,c){a._log.warn("Attempting a request without specifying a url"),c(new B({response:"Attempting a request without specifying a url",status:null,getAllResponseHeaders:null,xhr:null}))})},a.prototype._formatResponse=function(a,b){var c=this.xhr,d=c.status,e=c.response;if(u(e))try{e=c.responseText}catch(a){}if(0===d&&(d=b?200:404),c.onreadystatechange=null,t(this.clearTimeout)&&this.clearTimeout(),"json"===a&&n(e))try{e=JSON.parse(e)}catch(a){}return{response:e,status:d,getAllResponseHeaders:function(){return c.getAllResponseHeaders()},xhr:c}},a.prototype.__setHeaders=function(){var a,b,c=this.__options.headers,d=Object.keys(c||{}),e=this.xhr,f=d.length;for(b=0;f>b;++b)a=d[b],e.setRequestHeader(a,c[a])},a.prototype.__serializeFormData=function(){for(var a,b,c=this.__options.data,d=Object.keys(c),e=[];d.length>0;)a=d.pop(),b=c[a],u(b)?b="":h(b)&&(this._log.warn('Invalid form entry with key "'+a+'" and value "'+b),b=JSON.stringify(b)),e.push(encodeURIComponent(a)+"="+encodeURIComponent(b));return e.join("&").replace(/%20/g,"+")},a.prototype.__appendFormData=function(){for(var a,b,c=this.__options.data,d=new FormData,e=Object.keys(c);e.length>0;)a=e.pop(),b=c[a],u(b)?d.append(a,""):h(b)?m(b)?d.append(a,b,b.name||b.fileName||"blob"):(this._log.warn('Invalid form entry with key "'+a+'" and value "'+b),d.append(a,JSON.stringify(b))):d.append(a,b);return d},a.prototype.__submitFramedFormData=function(){var a,b=this,c=this.__options,d=c.data,e=c.url,f=this._document,g=f.body,h=na(Oa),i=f.createElement("form"),j=f.createElement("iframe"),k=N("iframe_target"),l=Object.keys(d);for(j.name=i.target=k,j.src="javascript:false;",i.enctype=i.encoding="multipart/form-data",i.action=e,i.method="POST",i.style.display="none";l.length>0;)a=l.pop(),i.insertBefore(this.__createInput(a,d[a]),null);return new h(function(a,c){b.xhr.abort=function(){j.onload=null,g.removeChild(i),g.removeChild(j),c()},j.onload=function(){var c=j.contentDocument.body.innerHTML;g.removeChild(i),g.removeChild(j),a({response:c,status:200,getAllResponseHeaders:function(){return""}}),b.xhr=j.onload=null},g.insertBefore(i,null),g.insertBefore(j,null),i.submit()})},a.prototype.__createInput=function(a,b){var c=this._document,d=c.createElement("input");if(d.type="hidden",d.name=a,u(b))d.value="";else if(h(b))if(!t(b.slice)||v(b.name)||v(b.path))this._log.info('Invalid form entry with key "'+a+'" and value "'+b),d.value=JSON.stringify(b);else{var e=c.querySelectorAll('input[type="file"][name="'+a+'"]'),f=e.length;if(0===f)this._log.info('Could not find input[type="file"] with [name="'+a+'"]. Stringifying data instead.'),d.value=JSON.stringify(b);else if(1===f){d=e[0];var g=d.cloneNode(!0);d.parentNode.insertBefore(g,d)}else{for(var i,j=b.path;f-->0;)if(i=e[f],i.value===j){d=i;var k=d.cloneNode(!0);d.parentNode.insertBefore(k,d);break}-1===f&&(this._log.info('Could not find input[type="file"] with [name="'+a+'"] and [value="'+b.path+'"]. Stringifying data instead.'),d.value=JSON.stringify(b))}}else d.value=b;return d},a._inject={_browser:Bb,_window:Gb,_document:Sa,_config:Na,_compat:Pa,_log:Ya},a}();a.HttpRequest=A;var B=function(){function a(a){this.name="AjaxError",Error.apply(this),this.response=this.message=a.response,this.status=a.status,this.getAllResponseHeaders=a.getAllResponseHeaders,this.xhr=a.xhr}return a.prototype.toString=function(){var a=this.response,b=a;return h(a)&&!a.hasOwnProperty("toString")&&(b=JSON.stringify(a)),"Request failed with status: "+this.status+" and response: "+b},a}();a.AjaxError=B,B.prototype=Error.prototype;var C=function(a){function c(b,c){a.call(this,b),this._window=na(Gb),u(c)||(this.__http=c.__http)}return __extends(c,a),c.prototype.initialize=function(a){h(a)&&u(this.__http)&&(this.__http=a)},c.prototype.cancel=function(){var a=this.__http,c=a.xhr,d=a.jsonpCallback;t(a.clearTimeout)&&a.clearTimeout(),u(c)?u(d)||(this._window[d]=b):(c.onreadystatechange=null,c.abort(),a.xhr=null),this.__subscribers=[]},c.prototype.then=function(b,c){return a.prototype.then.call(this,b,c)},c.prototype.catch=function(b){return a.prototype.catch.call(this,b)},c}(y);a.AjaxPromise=C;var D=function(){function a(){this.responseType={DEFAULT:"",ARRAYBUFFER:"arraybuffer",BLOB:"blob",DOCUMENT:"document",JSON:"json",TEXT:"text"},this.contentType={ENCODED_FORM:"application/x-www-form-urlencoded;charset=utf-8",JSON:"application/json;charset=utf-8",MULTIPART_FORM:"multipart/form-data",OCTET_STREAM:"application/octet-stream;charset=utf-8",XML:"application/xml;charset=utf-8",PLAIN_TEXT:"text/plain",HTML:"text/html"}}return a.prototype.ajax=function(a){var b=na(Ma);return b.initialize(a),b.execute()},a.prototype.jsonp=function(a){var b=na(Ma);return b.initialize(a),b.executeJsonp()},a.prototype.json=function(a){var b=na(Ma);return b.initialize(e(!1,!1,{},a,{responseType:"json"})),b.execute()},a.config={url:null,method:"GET",responseType:"",transforms:[],headers:{},withCredentials:!1,timeout:null,jsonpIdentifier:"callback",contentType:"application/json;charset=utf-8"},a}();a.Http=D,Ga.injectable(La,D),Ga.injectable(Ma,A,null,ve),a.IHttpConfig=j,Ga.injectable(Na,j)}(Gf=a.async||(a.async={}));var Hf;!function(a){function b(){return f}function c(){return a.managerCache}var d={},e={},f=function(){function a(a,b){this.__uid=a,this.__options=b,this.__size=0,u(b)&&(this.__options={timeout:0}),e[a]={}}return a.create=function(b,c){var e=d[b];return u(e)&&(e=d[b]=new a(b,c)),e},a.fetch=function(a){return d[a]},a.clear=function(){for(var a=Object.keys(d),b=a.length,c=0;b>c;++c)d[a[c]].clear();d={}},a.prototype.info=function(){return{uid:this.__uid,size:this.__size,options:this.__options}},a.prototype.put=function(a,b){var c=e[this.__uid][a];e[this.__uid][a]=b,v(c)&&this.__size++;var d=this.__options.timeout;return s(d)&&d>0&&K(this.remove,d,[a],this),b},a.prototype.read=function(a){return e[this.__uid][a]},a.prototype.remove=function(a){Q(e[this.__uid],a),this.__size--},a.prototype.clear=function(){e[this.__uid]={},this.__size=0},a.prototype.dispose=function(){this.clear(),Q(d,this.__uid)},a}();a.Cache=f,a.ICacheFactory=b,Ga.injectable(lb,b,null,we),a.managerCache=f.create("__managerCache"),a.IManagerCache=c,Ga.injectable(mb,c);var g=function(a){function b(){a.call(this,"__templateCache")}return __extends(b,a),b.prototype.put=function(b,c){var d=this._Promise;if(a.prototype.put.call(this,b,d.resolve(c)),l(c))c=c.cloneNode(!0);else if(k(c)){var e=document.createDocumentFragment();e.appendChild(c.cloneNode(!0)),c=e}else(n(c)||u(c))&&(c=ca(c));return d.resolve(c)},b.prototype.read=function(b){var c=this,d=a.prototype.read.call(this,b);return u(d)?this._Promise.reject(null):d.then(function(a){return c.put(b,a)},function(a){return c._log.warn("Error retrieving template, "+b+", from promise."),null})},b._inject={_Promise:Oa,_log:Ya},b}(f);a.TemplateCache=g,Ga.injectable(nb,g);var h=function(){function a(a){var b=this;this._storage=a,B(function(a,c){b[c]=a},a)}return Object.defineProperty(a.prototype,"length",{get:function(){return this._storage.length},enumerable:!0,configurable:!0}),a.prototype.clear=function(){this._storage.clear()},a.prototype.getItem=function(a){return this._storage.getItem(a)},a.prototype.key=function(a){return this._storage.key(a)},a.prototype.removeItem=function(a){this._storage.removeItem(a)},a.prototype.setItem=function(a,b){this._storage.setItem(a,b),this[a]=this.getItem(a)},a}();a.BaseStorage=h;var i=function(a){function b(){a.call(this,plat.acquire(Gb).localStorage)}return __extends(b,a),b}(h);a.LocalStorage=i,Ga.injectable(Hb,i);var j=function(a){function b(){a.call(this,plat.acquire(Gb).sessionStorage)}return __extends(b,a),b}(h);a.SessionStorage=j,Ga.injectable(Ib,j)}(Hf=a.storage||(a.storage={}));var If,Jf={"u+":{precedence:4,associativity:"rtl",fn:function(a,b,c){return+c(a,b)}},"+":{precedence:6,associativity:"ltr",fn:function(a,b,c,d){return c(a,b)+d(a,b)}},"u-":{precedence:4,associativity:"rtl",fn:function(a,b,c){return-c(a,b)}},"-":{precedence:6,associativity:"ltr",fn:function(a,b,c,d){return c(a,b)-d(a,b)}},"*":{precedence:5,associativity:"ltr",fn:function(a,b,c,d){return c(a,b)*d(a,b)}},"/":{precedence:5,associativity:"ltr",fn:function(a,b,c,d){return c(a,b)/d(a,b)}},"%":{precedence:5,associativity:"ltr",fn:function(a,b,c,d){return c(a,b)%d(a,b)}},"?":{precedence:15,associativity:"rtl",fn:function(){return void 0}},":":{precedence:15,associativity:"rtl",fn:function(){return void 0}},">":{precedence:8,associativity:"ltr",fn:function(a,b,c,d){return c(a,b)>d(a,b)}},"<":{precedence:8,associativity:"ltr",fn:function(a,b,c,d){return c(a,b)>":{precedence:7,associativity:"ltr",fn:function(a,b,c,d){return c(a,b)>>d(a,b)}},"<<":{precedence:7,associativity:"ltr",fn:function(a,b,c,d){return c(a,b)<>>":{precedence:7, associativity:"ltr",fn:function(a,b,c,d){return c(a,b)>>>d(a,b)}},"&&":{precedence:13,associativity:"ltr",fn:function(a,b,c,d){return c(a,b)&&d(a,b)}},"||":{precedence:14,associativity:"ltr",fn:function(a,b,c,d){return c(a,b)||d(a,b)}},"==":{precedence:9,associativity:"ltr",fn:function(a,b,c,d){return c(a,b)==d(a,b)}},"===":{precedence:9,associativity:"ltr",fn:function(a,b,c,d){return c(a,b)===d(a,b)}},"!=":{precedence:9,associativity:"ltr",fn:function(a,b,c,d){return c(a,b)!=d(a,b)}},"!==":{precedence:9,associativity:"ltr",fn:function(a,b,c,d){return c(a,b)!==d(a,b)}},">=":{precedence:8,associativity:"ltr",fn:function(a,b,c,d){return c(a,b)>=d(a,b)}},"<=":{precedence:8,associativity:"ltr",fn:function(a,b,c,d){return c(a,b)<=d(a,b)}},"=":{precedence:17,associativity:"rtl",fn:function(a,b,c,d){var e=plat.acquire(Ya);e.error(new Error("Assignment operators are not supported"))}},"++":{precedence:3,associativity:"",fn:function(a,b,c){var d=plat.acquire(Ya);d.error(new Error("Assignment operators are not supported"))}},"--":{precedence:3,associativity:"",fn:function(a,b,c){var d=plat.acquire(Ya);d.error(new Error("Assignment operators are not supported"))}},"+=":{precedence:17,associativity:"rtl",fn:function(a,b,c,d){var e=plat.acquire(Ya);e.error(new Error("Assignment operators are not supported"))}},"-=":{precedence:17,associativity:"rtl",fn:function(a,b,c,d){var e=plat.acquire(Ya);e.error(new Error("Assignment operators are not supported"))}},"*=":{precedence:17,associativity:"rtl",fn:function(a,b,c,d){var e=plat.acquire(Ya);e.error(new Error("Assignment operators are not supported"))}},"/=":{precedence:17,associativity:"rtl",fn:function(a,b,c,d){var e=plat.acquire(Ya);e.error(new Error("Assignment operators are not supported"))}},"%=":{precedence:17,associativity:"rtl",fn:function(a,b,c,d){var e=plat.acquire(Ya);e.error(new Error("Assignment operators are not supported"))}}},Kf={"()":{precedence:2,associativity:null,fn:null},"[]":{precedence:2,associativity:null,fn:null},".":{precedence:2,associativity:null,fn:null},"{}":{precedence:1,associativity:null,fn:null}},Lf={"{":{precedence:1,associativity:null,fn:null},"}":{precedence:1,associativity:null,fn:null},"[":{precedence:2,associativity:null,fn:null},"]":{precedence:2,associativity:null,fn:null},"(":{precedence:2,associativity:null,fn:null},")":{precedence:2,associativity:null,fn:null},".":{precedence:2,associativity:null,fn:null},",":{precedence:18,associativity:null,fn:null},"'":{precedence:0,associativity:null,fn:null},'"':{precedence:0,associativity:null,fn:null}},Mf={false:!1,true:!0,null:null,undefined:"undefined"};!function(a){function f(a){return i._log=a,i}var g=["push","pop","reverse","shift","sort","splice","unshift"],i=function(){function a(){this._compat=na(Pa),this.__identifiers={},this.__identifierHash={},this.__lengthListeners={},this.__contextObjects={},this.__isArrayFunction=!1}return a.getManager=function(b){var c,d=a.__managers,e=b.uid,f=d[e];return u(f)?(c=d[e]=new a,c.context=b,c):c=f},a.dispose=function(b){if(!u(b)){var c=b.uid,d=a.__controls,e=d[c]||{},f=a.__managers,g=f[c];u(g)||(g.dispose(),Q(f,c));for(var h,i=Object.keys(e);i.length>0;)for(h=e[i.shift()];h.length>0;)h.shift()();Q(d,c),u(b.context)||(a.unObserve(b.context),a.defineProperty(b,Ia,b.context,!0,!0,!0))}},a.removeArrayListeners=function(b,c){var d=a.arrayChangeListeners[b];u(d)||Q(d,c)},a.getContext=function(a,b){if(u(a))return a;for(b=b.slice(0);b.length>0;)if(a=a[b.shift()],u(a))return a;return a},a.defineProperty=function(a,b,d,e,f,g){c(a,b,d,e,f,g)},a.defineGetter=function(a,b,c,e,f){d(a,b,c,e,f)},a.pushRemoveListener=function(b,c,d){var e,f=a.__controls,g=f[c];u(g)&&(g=f[c]={}),e=g[b],u(e)&&(e=g[b]=[]),e.push(d)},a.spliceRemoveListener=function(b,c,d){var e,f=a.__controls,g=f[c];if(!u(g)&&(e=g[b],!u(e))){var h=e.indexOf(d);-1!==h&&(e.splice(h,1),0===e.length&&Q(g,b))}},a.removeIdentifier=function(b,c){for(var d,e=b.length,f=a.__controls,g=0;e>g;++g)d=f[b[g]],u(d)||Q(d,c)},a.createContext=function(b,c){var d=b.context;if(!h(d)){if(!u(d))return void a._log.warn("A child control is trying to create a child context that has a parent control with a primitive type context");d=b.context={}}for(var e,f,g=c.split(".");g.length>0;)e=g.shift(),f=d[e],u(f)&&(f=s(Number(g[0]))?d[e]=[]:d[e]={}),d=f;return d},a.unObserve=function(a){e(!0,!0,a)},a.prototype.getContext=function(a,b){return this._getContext(a.join("."),a,b)},a.prototype.observe=function(c,d){var e=this;if(q(c))return b;var f,g,i=c.split("."),j=i.pop(),k="length"===j,l=this._hasIdentifier(c),m=!u(d);if(i.length>0?(f=i.join("."),g=this._getContext(f,i,!0)):(f=j,g=this.context),!h(g))return m?(k&&(this.__lengthListeners[c]=d,a.pushRemoveListener(c,d.uid,function(){Q(e.__lengthListeners,c)})),this._addObservableListener(c,d,k)):b;this.__observedIdentifier=null,this.__contextObjects[c]=g[j];var o=this.__observedIdentifier,p=!u(o),r=b;if(p&&(l=!0),m){var s=b,t=this._addObservableListener(c,d,k);p&&c!==o&&(s=this._addObservableListener(o,d,k)),r=function(){t(),s()}}var v=w(g),x=r,y=b,z=b,A=Number(j);if(v&&A>=g.length)y=this.observe(f+".length",{uid:d.uid,listener:function(a,b){A>=a||(y(),e._define(c,g,j))}}),r=function(){x(),y()};else if(!l)if(v&&k){var B=i.pop(),C=this.getContext(i,!1);if(this.__observedIdentifier=null,R(C,B),n(this.__observedIdentifier)&&(f=this.__observedIdentifier),m){var D=d.uid;y=this.observeArrayMutation(D,b,f,g,null),z=this.observe(f,{uid:D,listener:function(a,c){y(),y=e.observeArrayMutation(D,b,f,a,c)}})}r=function(){x(),z(),y()}}else this._define(c,g,j);return r},a.prototype.observeArrayMutation=function(a,c,d,e,f){if(w(f)&&this._restoreArray(f),u(e))return b;var g=d.split("."),h=g.pop(),i=this.getContext(g,!1);this.__observedIdentifier=null,R(i,h),n(this.__observedIdentifier)&&(d=this.__observedIdentifier);var j=[];return t(c)&&j.push(this._pushArrayListener(a,d,c)),this._overwriteArray(d,e),function(){for(;j.length>0;)j.pop()()}},a.prototype.dispose=function(){this.context=null,this.__identifiers={},this.__identifierHash={},this.__contextObjects={}},a.prototype._pushArrayListener=function(b,c,d){var e=a.arrayChangeListeners,f=e[c];u(f)&&(f=e[c]={});var g=f[b];u(g)&&(g=f[b]=[]);var h=!1,i=function(){if(!h){h=!0,a.spliceRemoveListener(c,b,i);var j=g.indexOf(d);-1!==j&&(g.splice(j,1),0===g.length&&(Q(f,b),q(f)&&Q(e,c)))}};return g.push(d),a.pushRemoveListener(c,b,i),i},a.prototype._restoreArray=function(a){var b=this._compat;if(b.setProto)Object.setPrototypeOf(a,Object.create(Array.prototype));else if(b.proto)a.__proto__=Object.create(Array.prototype);else for(var c,d=g.length,e=0;d>e;++e)c=g[e],a[c]=Array.prototype[c]},a.prototype._overwriteArray=function(b,c){var d,e,f=this._compat,h=g.length;if(f.proto){var i=Object.create(Array.prototype);for(e=0;h>e;++e)d=g[e],i[d]=this._overwriteArrayFunction(b,d);return void(f.setProto?Object.setPrototypeOf(c,i):c.__proto__=i)}for(e=0;h>e;++e)d=g[e],a.defineProperty(c,d,this._overwriteArrayFunction(b,d),!1,!0,!0)},a.prototype._getContext=function(a,b,c){var d=this.__contextObjects[a];return u(d)&&(d=c===!0?this.__contextObjects[a]=this._observeImmediateContext(b,a):this._getImmediateContext(b)),d},a.prototype._getImmediateContext=function(a){for(var b=this.context;a.length>0&&(b=b[a.shift()],!u(b)););return b},a.prototype._observeImmediateContext=function(a,b){return u(this.__identifiers[b])&&this.observe(b,null),this._getImmediateContext(a)},a.prototype._getValues=function(a,b,c){for(var d,e=!0,f=!0;a.length>1;)if(d=a.shift(),e&&(b=b[d],u(b)&&(e=!1)),f&&(c=c[d],u(c)&&(f=!1)),!e&&!f)return null;d=a[0];var g,h;return u(b)||(g=b[d]),u(c)||(h=c[d]),{newValue:g,oldValue:h}},a.prototype._notifyChildProperties=function(a,c,d,e){var f=this;e=e||Object.keys(this.__identifierHash[a]||{});for(var g,i,j,k,l,m,o,p,r,s,t,v=e.length,x={},y=".",z="length",A=a.length+1,B=0;v>B;++B){if(g=e[B],i=g.slice(A),k=i.split(y),m=k.pop(),o=m===z,j=k.join(y),q(j)){if(p=c,r=d,s=u(p)?void 0:p[m],t=u(r)?void 0:r[m],o&&!w(r)&&w(p)){var C=this.__lengthListeners[g];if(!u(C)){var D=C.uid,E=a.split(y),F=E.pop(),G=E.join(y),H=this._getContext(G,E,!1);this.__observedIdentifier=null,R(H,F),n(this.__observedIdentifier)&&(G=this.__observedIdentifier);var I=this.observeArrayMutation(D,b,G,p,null);this.observe(G,{uid:D,listener:function(a,c){I(),I=f.observeArrayMutation(D,b,G,a,c)}}),Q(this.__lengthListeners,g)}}}else{if(l=x[j],u(l)&&(l=x[j]=this._getValues(k,c,d),u(l))){this._execute(g,null,null);continue}p=l.newValue,r=l.oldValue,s=u(p)?void 0:p[m],t=u(r)?void 0:r[m]}x[i]={newValue:s,oldValue:t},h(p)&&(!w(p)||p.length>m)&&this._define(g,p,m),this._execute(g,s,t)}x=null},a.prototype._addObservableListener=function(b,c,d){var e=this;if(d===!0){var f=b.split(".");f.pop();var g=f.pop(),i=this.getContext(f,!1);h(i)&&(this.__observedIdentifier=null,R(i,g),n(this.__observedIdentifier)&&(b=this.__observedIdentifier+(d===!0?".length":"")))}this.__add(b,c);var j=c.uid,k=function(){a.spliceRemoveListener(b,j,k),e._removeCallback(b,c)};return a.pushRemoveListener(b,j,k),k},a.prototype._define=function(a,b,c){h(b[c])?this.__defineObject(a,b,c):this.__definePrimitive(a,b,c)},a.prototype._overwriteArrayFunction=function(b,c){var d=a.arrayChangeListeners[b]||{},e=this;return function(){for(var f=[],g=0;g0?[h]:[]):p?(j=f.length,m=[]):(j=f.length-2,k=f[0],m=h)):(h=Array.prototype[c].apply(this,f),l=this.length,t?i=o:"push"===c?(j=f.length,k=n,m=[]):"pop"===c&&(j=0,k=l,m=n>0?[h]:[])),(q||r||"pop"===c)&&a.unObserve(h);var u,v,w,x,y=Object.keys(d),z=y.length;for(w=0;z>w;++w)for(u=d[y[w]],v=u.length,x=0;v>x;++x)u[x]([{object:this,type:c,index:k,removed:m,addedCount:j,oldArray:i}]);return s&&e._notifyChildProperties(b,this,o),e._execute(b+".length",l,n),h}},a.prototype._removeCallback=function(a,b){var c=this.__identifiers[a];if(!u(c)){var d=c.indexOf(b);-1!==d&&(c.splice(d,1),0===c.length&&Q(this.__contextObjects,a))}},a.prototype._hasIdentifier=function(a){return!q(this.__identifiers[a])},a.prototype._execute=function(a,b,c){var d=this.__identifiers[a];if(v(b)?Q(this.__contextObjects,a):this.__contextObjects[a]=b,b!==c&&!u(d))for(var e=d.slice(0),f=e.length,g=0;f>g;++g)e[g].listener(b,c)},a.prototype.__defineObject=function(b,c,d){var e=this,f=c[d];Object.defineProperty(c,d,{configurable:!0,enumerable:!0,get:function(){return e.__observedIdentifier=b,f},set:function(g){if(f!==g){var i=f;if(f=g,!e.__isArrayFunction){a.unObserve(i);var j,k=e.__identifierHash[b],l=!1;h(k)&&(j=Object.keys(k),l=j.length>0),e._execute(b,f,i),l?(e._notifyChildProperties(b,f,i,j),h(f)||e.__definePrimitive(b,c,d)):q(e.__identifiers[b])?a.defineProperty(c,d,f,!0,!0,!0):h(f)||e.__definePrimitive(b,c,d)}}}})},a.prototype.__definePrimitive=function(b,c,d){var e=this,f=c[d],g=!u(f);w(c)&&"length"===d||Object.defineProperty(c,d,{configurable:!0,enumerable:!0,get:function(){return e.__observedIdentifier=b,f},set:function(i){if(f!==i){var j=f;if(f=i,!e.__isArrayFunction||!w(c)){var k,l=e.__identifierHash[b],m=!1;h(l)&&(k=Object.keys(l),m=k.length>0),e._execute(b,i,j),!m&&q(e.__identifiers[b])?a.defineProperty(c,d,f,!0,!0,!0):h(f)?(e.__defineObject(b,c,d),m&&e._notifyChildProperties(b,i,j,k)):g||(e.__definePrimitive(b,c,d),g=!0)}}}})},a.prototype.__add=function(a,b){var c=this.__identifiers[a],d=b.priority,e=!1;if(u(c)&&(c=this.__identifiers[a]=[]),s(d)){for(var f=c.length,g=0;f>g;++g)if(d>c[g].priority){c.splice(g,0,b),e=!0;break}}else b.priority=-1;e||c.push(b),this.__addHashValues(a)},a.prototype.__addHashValues=function(a){var b=this.__identifierHash;if(!h(b[a])){b[a]={};for(var c,d,e=".",f=a;-1!==(c=f.lastIndexOf(e));)f=f.slice(0,c),d=b[f],u(d)?(d=b[f]={},f!==a&&(d[a]=!0)):f===a||d[a]||(d[a]=!0)}},a.arrayChangeListeners={},a.__managers={},a.__controls={},a}();a.ContextManager=i,a.IContextManagerStatic=f,Ga.injectable(bb,f,[Ya],te),Ga.injectable(cb,i,null,ve)}(If=a.observable||(a.observable={}));var Nf;!function(a){function b(){return f}function c(a,b,c,d,e){return g._log=a,g._compat=b,g._document=c,g._window=d,g._dom=e,g}function d(a){return h._EventManager=a,h}var e=function(){function a(){this.defaultPrevented=!1,this.stopped=!1}return a.prototype.initialize=function(a,b,c){this.name=a,this.direction=c||this._EventManager.UP,this.sender=b},a.prototype.preventDefault=function(){this.defaultPrevented||this._ContextManager.defineGetter(this,"defaultPrevented",!0)},a.prototype.stopPropagation=function(){this.direction===this._EventManager.UP&&(this.stopped=!0,this._EventManager.propagatingEvents[this.name]=!1)},a._inject={_EventManager:Va,_ContextManager:bb},a}();a.DispatchEvent=e,Ga.injectable(Ta,e,null,ve);var f=function(a){function b(){a.apply(this,arguments)}return __extends(b,a),b.dispatch=function(a,b){var c=na(Xa);return c.initialize(a,b),g.sendEvent(c),c},b.prototype.initialize=function(b,c){a.prototype.initialize.call(this,b,c,this._EventManager.DIRECT)},b}(e);a.LifecycleEvent=f,a.ILifecycleEventStatic=b,Ga.injectable(Wa,b,null,te),Ga.injectable(Xa,f,null,ve);var g=function(){function a(){}return a.initialize=function(){if(!a.__initialized){a.__initialized=!0;for(var b,c=a.__lifecycleEventListeners,d=a._compat,e=a._document,g=a._window,h=a._dom,i=f.dispatch;c.length>0;)b=c.pop(),e.removeEventListener(b.name,b.value,!1);if(d.cordova){for(var j,k,l=[td,ud,vd],m=d.winJs,n=l.length,o=function(b){return function(){i(b,a)}},p=0;n>p;++p)j=l[p],k=o(j),c.push({name:j,value:k}),h.addEventListener(e,j,k,!1);k=o(sd),c.push({name:Ed,value:k}),h.addEventListener(e,Ed,k,!1),k=o(rd),c.push({name:Fd,value:k}),h.addEventListener(e,Fd,k,!1),k=function(){return m||i(Gd,a),!0},c.push({name:Gd,value:k}),h.addEventListener(e,Gd,k,!1),m&&(k=function(){return i(Gd,a),!0},c.push({name:Hd,value:k}),g.WinJS.Application.addEventListener(Hd,k,!1))}else{if(d.amd)return;h.addEventListener(g,"load",function(){i(rd,a)})}}},a.dispose=function(b){Q(a.__eventsListeners,b)},a.on=function(b,c,d,e){var f=a.__eventsListeners[b];u(f)&&(f=a.__eventsListeners[b]={listeners:{},context:e});var g=f.listeners[c];return w(g)||(g=f.listeners[c]=[]),g.push(d),function(){var a=g.indexOf(d);-1!==a&&g.splice(a,1)}},a.dispatch=function(b,c,d,e){var f=na(Ta);return f.initialize(b,c,d),a.sendEvent(f,e),f},a.hasDirection=function(b){return b===a.UP||b===a.DOWN||b===a.DIRECT},a.sendEvent=function(b,c){var d=b.name,e=b.direction;switch(c=c||[],a.propagatingEvents[d]=!0,c=c||[],e){case a.UP:a._dispatchUp(b,c);break;case a.DOWN:a._dispatchDown(b,c);break;case a.DIRECT:a._dispatchDirect(b,c)}Q(a.propagatingEvents,d)},a._dispatchUp=function(b,c){for(var d=b.name,e=b.sender;!u(e)&&a.propagatingEvents[d];)u(e.uid)?e=e.parent:(a.__executeEvent(e.uid,b,c),e=e.parent)},a._dispatchDown=function(b,c){var d,e=[],f=b.name;for(e.push(b.sender);e.length&&a.propagatingEvents[f];)d=e.pop(),u(d.uid)||(a.__executeEvent(d.uid,b,c),u(d.controls)||(e=e.concat(d.controls)))},a._dispatchDirect=function(b,c){for(var d,e=Object.keys(a.__eventsListeners),f=e.length,g=b.name,h=0;f>h&&a.propagatingEvents[g];++h)d=a.__eventsListeners[e[h]],u(d)||u(d.listeners[g])||a.__callListeners(d.context,b,d.listeners[g],c)},a.__executeEvent=function(b,c,d){var e=a.__eventsListeners[b];if(!u(e)){var f=e.context,g=e.listeners[c.name];u(g)||a.__callListeners(f,c,g,d)}},a.__callListeners=function(b,c,d,e){var f=c.name,g=d.length,h=-1;for(e=[c].concat(e);++h0;)e[f]();Q(c,d)}}},a.getInstance=function(){return new a},a.__addRemoveListener=function(b,c){var d=a.__eventListeners;return w(d[b])?void d[b].push(c):void(d[b]=[c])},a.__spliceRemoveListener=function(b,c){var d=a.__eventListeners,e=d[b];if(w(e)){var f=e.indexOf(c);if(-1===f)return;e.splice(f,1)}},a.__getControls=function(b,c,d){var e,f=[],g=a.getRootControl(b);u(g)||g[c]!==d||f.push(g);var h=g.controls;if(u(h))return f;for(var i=[].concat(h);i.length>0;)e=i.shift(),e[c]===d&&f.push(e),u(e.controls)||(i=i.concat(e.controls));return f},a.prototype.initialize=function(){},a.prototype.loaded=function(){},a.prototype.getControlsByName=function(b){return a.__getControls(this,"name",b)},a.prototype.getControlsByType=function(b){return n(b)?a.__getControls(this,"type",b):a.__getControls(this,"constructor",b)},a.prototype.addEventListener=function(c,d,e,f){if(!t(e))return this._log.warn('"Control.addEventListener" must take a function as the third argument.'),b;e=e.bind(this);var g=this.dom.addEventListener(c,d,e,f),h=this.uid;return a.__addRemoveListener(h,g),function(){g(),a.__spliceRemoveListener(h,g)}},a.prototype.observe=function(c,d){var e=this,f=h(this.context)?this:this.parent,g=a.getRootControl(f);if(u(f))return b;var i;if(q(d))i=f.absoluteContextPath;else if(n(d)){var j=(a._parser||na(Za)).parse(d),k=j.identifiers[0],l=k.split("."),m=l.shift().slice(1),o=l.length>0?"."+l.join("."):"";i=m===Ve?Ia+o:m===Xe?f.absoluteContextPath+o:f.absoluteContextPath+"."+k}else i=f.absoluteContextPath+"."+d;var p=a._ContextManager||na(bb),r=p.getManager(g);return r.observe(i,{listener:function(a,b){c.call(e,a,b,d)},uid:this.uid})},a.prototype.observeArray=function(c,d){var e=h(this.context)?this:this.parent,f=e.context;if(u(e)||!h(f))return b;var g,i;if(q(d))g=f,i=e.absoluteContextPath;else if(n(d)){var j=(a._parser||na(Za)).parse(d);g=j.evaluate(f),i=e.absoluteContextPath+"."+j.identifiers[0]}else g=f[d],i=e.absoluteContextPath+"."+d;if(!w(g))return b;var k=t(c);if(!k)return b;c=c.bind(this);var l=a._ContextManager||na(bb),m=l.getManager(a.getRootControl(e)),o=this.uid,p=function(a){c(a,d)},r=m.observeArrayMutation(o,p,i,g,null),s=m.observe(i,{listener:function(a,b){r(),r=m.observeArrayMutation(o,p,i,a,b)},uid:o});return function(){r(),s()}},a.prototype.observeExpression=function(c,d){var e=this;if(q(d))return b;if(n(d))d=(a._parser||na(Za)).parse(d);else if(!t(d.evaluate))return b;var f=u(this.resources)?this.parent:this;if(u(f)||!n(f.absoluteContextPath))return b;var g,h,i,j,k=d.aliases,l=k.length,m={},o=a._ContextManager||na(bb),p=o.getManager,r=Qf.TemplateControl,s=r.findResource,v=r.evaluateExpression;for(j=0;l>j;++j)g=k[j],h=s(f,g),u(h)||(i=h.resource.type,(i===Pe||i===Te)&&(m[g]=p(h.control)));var w,x,y=d.identifiers,z=p(a.getRootControl(f)),A=[],B=f.absoluteContextPath,C=B+".",D={};for(l=y.length,j=0;l>j;++j)w=y[j],A=w.split("."),x=A[0],"@"!==w[0]?D[C+w]=z:(g=x.slice(1),g===Xe?D[B+w.replace(x,"")]=z:g===Ve?D[w.replace(x,"context")]=z:(w=w.replace(x,"resources."+g+".value"),u(m[g])||(D[w]=m[g])));y=Object.keys(D),l=y.length;var E=v(d,f),F=[],G=this.uid,H=function(){var a=v(d,f);c.call(e,a,E,d.expression),E=a};for(j=0;l>j;++j)w=y[j],F.push(D[w].observe(w,{uid:G,listener:H}));return function(){for(var a=F.length,b=0;a>b;++b)F[b]()}},a.prototype.evaluateExpression=function(a,b){return Qf.TemplateControl.evaluateExpression(a,this.parent,b)},a.prototype.findProperty=function(b){for(var c,d=this,e=(a._parser||na(Za)).parse(b);!u(d);){if(c=e.evaluate(d),!u(c))return{expresssion:e,control:d,value:c};d=d.parent}},a.prototype.dispatchEvent=function(b,c){for(var d=[],e=2;e0&&(d=b.getResources(c,a.aliases,d),q(d))))return a.evaluate(c.context,d)},b.getResources=function(a,c,d){if(u(a))return{};var e,f,g,h=c.length,i=b.__resourceCache[a.uid];u(i)&&(i=b.__resourceCache[a.uid]={}),d=d||{};for(var j=0;h>j;++j)if(e=c[j],"@"===e[0]&&(e=e.slice(1)),e!==Xe)if(e!==Ve){if(u(d[e])){if(u(i[e]))g=b.findResource(a,e);else{var k=i[e].control,l=k.resources;g=u(l)?b.findResource(a,e):{control:k,resource:l[e]}}u(g)?b._log.warn("Resource alias: "+e+" is not defined."):(i[e]=g,f=g.resource,d[e]=u(f)?f:f.value)}}else d[e]=Of.getRootControl(a).context;else d[e]=a.context;return d},b.findResource=function(a,b){var c;if(!u(a)&&!u(a.resources)&&n(b)&&!q(b)){"@"===b[0]&&(b=b.slice(1));var d=b===Ve;if(d||b===Xe||b===We){if(d&&(a=Of.getRootControl(a)),c=(a.resources||{})[b],u(c))return;return{resource:c,control:a}}for(;!u(a);){if(c=(a.resources||{})[b],!u(c))return{resource:c,control:a};a=a.parent}}},b.dispose=function(a){if(!u(a)){var c=a.uid,d=a.controls,e=d&&d.slice(0),f=Of._ContextManager,g=f.defineProperty;if(!u(e))for(var h=e.length-1,i=h;i>=0;--i)Of.dispose(e[i]);if(t(a.dispose)&&a.dispose(),Of.removeEventListeners(a),b.removeElement(a),b._ResourcesFactory.dispose(a),b._BindableTemplatesFactory.dispose(a),Q(b.__resourceCache,a.uid),f.dispose(a),Nf.EventManager.dispose(a.uid),b._managerCache.remove(c),Of.removeParent(a),g(a,Me,null,!0,!0,!0),a.attributes=null,a.bindableTemplates=null,a.controls=[],a.root=null,a.innerTemplate=null,a.__injectable__type===te){var j=sf[a.type];Ga.control(a.type,a.constructor,j.dependencies,!0)}}},b.loadControl=function(a){for(var c,d=a.controls,e=d.length,f=0;e>f;++f)c=d[f],u(c.controls)?c.loaded():b.loadControl(c);a.loaded()},b.contextChanged=function(a,c,d){a.context=c,b.setContextResources(a),t(a.contextChanged)&&a.contextChanged(c,d)},b.setContextResources=function(a){var c=a.context;return u(a.resources)&&(a.resources=b._ResourcesFactory.getInstance(),a.resources.initialize(a)),a.hasOwnContext&&(u(a.resources.rootContext)?a.resources.add({root:{type:Pe,value:c}}):a.resources.rootContext.value=c),u(a.resources.context)?void a.resources.add({context:{type:Pe,value:c}}):void(a.resources.context.value=c)},b.removeElement=function(a){if(!u(a)){var b,c=a.element;return null===a.replaceWith||""===a.replaceWith||l(c)?(ea(a.startNode,a.endNode),void(a.elementNodes=a.startNode=a.endNode=null)):void(u(c)||(b=c.parentNode,u(b)||b.removeChild(c),a.element=null))}},b.setAbsoluteContextPath=function(a,b){Of._ContextManager.defineGetter(a,"absoluteContextPath",b,!1,!0)},b.determineTemplate=function(a,c){var d=b._templateCache,e=a.dom,f=b._Promise;if(u(c)){if(u(a.templateUrl)){if(u(a.templateString))return f.reject(null);var g=a.type;return d.read(g).catch(function(b){return u(b)&&(b=a.templateString),d.put(g,b)})}c=a.templateUrl}else;return e.getTemplate(c)},b.detach=function(a){if(!u(a)&&!u(a.controls)){for(var c=a.controls.slice(0),d=c.length,e=0;d>e;++e)Of.dispose(c[e]);Of.removeEventListeners(a),b.removeElement(a),b._ResourcesFactory.dispose(a,!0),Q(b.__resourceCache,a.uid),Of._ContextManager.dispose(a),Nf.EventManager.dispose(a.uid),b._managerCache.remove(a.uid),Of.removeParent(a),a.controls=[],a.attributes=null}},b.getInstance=function(){return new b},b.prototype.contextChanged=function(a,b){},b.prototype.setTemplate=function(){},b.prototype.getResources=function(a,c){return b.getResources(this,a,c)},b.prototype.findResource=function(a){return b.findResource(this,a)},b.prototype.evaluateExpression=function(a,c){return b.evaluateExpression(a,this,c)},b.__resourceCache={},b}(Of);a.TemplateControl=o,a.ITemplateControlFactory=c,Ga.injectable(yb,c,[wb,rb,mb,nb,Za,La,Oa,Ya],we),Ga.injectable(zb,o,null,ve);var r=function(a){function b(){a.apply(this,arguments),this.priority=120,this._listeners=[]}return __extends(b,a),b.prototype.onInput=function(a){var b=this._listeners;return b.push(a),function(){var c=b.indexOf(a);-1!==c&&b.splice(c,1)}},b.prototype.observeProperties=function(a){},b.prototype.inputChanged=function(a,b){if(a!==b)for(var c=this._listeners,d=c.length,e=0;d>e;++e)c[e](a,b)},b.prototype.dispose=function(){this._listeners=[]},b}(o);a.BindControl=r;var y=function(a){function b(){a.apply(this,arguments),this.hasOwnContext=!0}return __extends(b,a),b.dispose=function(a){o.dispose(a)},b.getInstance=function(){return new b},b.prototype.canNavigateFrom=function(){},b.prototype.canNavigateTo=function(a,b){},b.prototype.navigatingFrom=function(){},b.prototype.navigatedTo=function(a,b){},b}(o);a.ViewControl=y;var z=function(){function a(){this._domEvents=na(tb)}return a.prototype.addEventListener=function(a,b,c,d){return this._domEvents.addEventListener(a,b,c,d)},a.prototype.appendChildren=function(a,b){return V(a,b)},a.prototype.cloneChildren=function(a,b){return V(a,b,!0)},a.prototype.clearNode=function(a){return W(a)},a.prototype.clearNodeBlock=function(a,b){return X(a,b)},a.prototype.setInnerHtml=function(a,b){return $(a,b)},a.prototype.insertBefore=function(a,b,c){return _(a,b,c)},a.prototype.replace=function(a){return aa(a)},a.prototype.replaceWith=function(a,b){return ba(a,b)},a.prototype.serializeHtml=function(a){return ca(a)},a.prototype.removeBetween=function(a,b){return da(a,b)},a.prototype.removeAll=function(a,b){return ea(a,b)},a.prototype.addClass=function(a,b){return ha(a,b)},a.prototype.removeClass=function(a,b){return ia(a,b)},a.prototype.toggleClass=function(a,b){return ja(a,b)},a.prototype.replaceClass=function(a,b,c){return ka(a,b,c)},a.prototype.hasClass=function(a,b){return la(a,b)},a.prototype.getTemplate=function(a){return ma(a)},a._inject={_domEvents:tb},a}();a.Dom=z,Ga.injectable(sb,z);var A=function(){function a(){this._ResourcesFactory=na(wb),this._ControlFactory=na(Qa),this._TemplateControlFactory=na(yb),this._ContextManager=na(bb),this._Promise=na(Oa),this._managerCache=na(mb),this._document=na(Sa),this._ElementManagerFactory=na(gb),this._BindableTemplatesFactory=na(rb),this._log=na(Ya),this.templates={},this.cache={},this.__compiledControls=[]}return a.create=function(b,c){var d=new a;return d.control=b,u(c)||(d.templates=c.templates,d.cache=c.cache),d},a.dispose=function(a){if(!u(a)){var b=a.bindableTemplates;!u(b)&&t(b.dispose)&&b.dispose()}},a.isBoundControl=function(a){if(u(a))return!1;var b=a.parent;return u(b)?!1:0===a.type.indexOf(b.type+Ae)},a.prototype.bind=function(a,b,c){return this._bind(a,b,c)},a.prototype.add=function(a,b){if(!u(b)){if(n(b))return void this._compile(a,ca(b));if(l(b))return void this._compile(a,b);var c=this._document.createDocumentFragment();if(k(b))c.appendChild(b);else{if(!x(b))return;V(b,c)}this._compile(a,c)}},a.prototype.replace=function(b,c,d,e){var f=this.control.controls[b];if(!a.isBoundControl(f))return this._log.warn("The child control at the specified index: "+b+" is not a bound control and thus cannot be replaced by BindableTemplates."),this._Promise.resolve([]);var g=f.endNode;return k(g)&&k(g.parentNode)?this._bind(c,d,e,b):(this._log.warn("The child control at the specified index: "+b+" had either no placeholding comment nodes or its comment nodes had no parent and thus cannot be replaced by BindableTemplates."),this._Promise.resolve([]))},a.prototype.dispose=function(){for(var a=this._TemplateControlFactory.dispose,b=this.__compiledControls,c=b.length,d=0;c>d;++d)a(b[d]);this.__compiledControls=[],this.control=null,this.cache={},this.templates={}},a.prototype._bind=function(a,b,c,d){var e=this,f=this.templates[a],g=u(d);return u(f)?void this._log.error(new Error("Cannot bind template, no template stored with key: "+a)):u(b)||s(b)||n(b)?(f=f.then(function(d){var f=d.cloneNode(!0),h=e._createBoundControl(a,f,b,c),i=e._createNodeMap(h,f,b);return g&&e.control.controls.push(h),e._bindTemplate(a,i)}),g?f.then(null,function(a){return J(function(){n(a)&&(a=new Error(a)),e._log.error(a)}),e._document.createDocumentFragment()}):f.then(function(a){var b=Array.prototype.slice.call(a.childNodes),c=e.control.controls[d],f=c.endNode,g=f.parentNode,h=f.nextSibling;return e._TemplateControlFactory.dispose(c),g.insertBefore(a,h),b}).then(null,function(a){return J(function(){n(a)&&(a=new Error(a)),e._log.error(a)}),e._document.createDocumentFragment()})):void this._log.warn("Cannot bind template with relativeIdentifier: "+b+". Identifier must be either a string or number")},a.prototype._bindTemplate=function(a,c){var d=this,e=c.uiControlNode.control,f=!1,g=t(e.dispose)?e.dispose.bind(e):b;return e.dispose=function(){f=!0,g(),e.dispose=g},this._bindNodeMap(a,c).then(function(){var a=d._document,b=c.element;return f?a.createDocumentFragment():(e.startNode=b.insertBefore(a.createComment(e.type+Ce),b.firstChild),e.endNode=b.insertBefore(a.createComment(e.type+De),null),b)},function(a){return J(function(){n(a)&&(a=new Error(a)),d._log.error(a)}),null})},a.prototype._bindNodeMap=function(a,b){var c=this.cache[a],d=b.uiControlNode.control,e=b.element,f=this._managerCache; -return c.clone(e,f.read(this.control.uid),b),f.read(d.uid).bindAndLoad()},a.prototype._compile=function(a,b){var c=this._createBoundControl(a+ze,b),d=this._createNodeMap(c,b);this.__compiledControls.push(c),this._compileNodeMap(c,d,a)},a.prototype._compileNodeMap=function(a,b,c){var d=this,e=this._ElementManagerFactory.getInstance(),f=[];e.isClone=!0,e.initialize(b,null),e.setUiControlTemplate(),this.cache[c]=e,f.push(e.fulfillTemplate()),this.templates[c]=this._Promise.all(f).then(function(){var c,e,f=b.element,g=f.cloneNode(!0),h=d._document;return c=a.startNode=h.createComment(a.type+Ce),e=a.endNode=h.createComment(a.type+De),f.insertBefore(c,f.firstChild),f.insertBefore(e,null),g})},a.prototype._createNodeMap=function(a,b,c){return{element:b,attributes:{},nodes:[],childContext:c,uiControlNode:{control:a,nodeName:a.type,expressions:[],injector:null}}},a.prototype._createBoundControl=function(a,b,c,d){var e=this._TemplateControlFactory,f=e.getInstance(),g=this._ResourcesFactory,i=this.control,j=this.cache[a],k=h(j),l=g.getInstance();if(k){var m=j.getUiControl();l.initialize(f,m.resources),l.add(d)}else l.initialize(f,d);if(f.resources=l,g.addControlResources(f),f.bindableTemplates=this._BindableTemplatesFactory.create(f,i.bindableTemplates),f.parent=i,f.controls=[],f.element=b,f.type=i.type+Ae+a,f.root=this._ControlFactory.getRootControl(f),k){var n=this._ContextManager.getManager(f.root);f.absoluteContextPath=i.absoluteContextPath||Ia,u(c)||(f.absoluteContextPath+="."+c),f.context=n.getContext(f.absoluteContextPath.split("."),!1)}return f},a}();a.BindableTemplates=A,a.IBindableTemplatesFactory=d,Ga.injectable(rb,d,null,we);var C=function(){function a(){this.__listeners={}}return a.getInstance=function(){return new a},a.prototype.initialize=function(a,b){this.__control=a;for(var c,d=Object.keys(b),e=this.__listeners,f=d.length,g=0;f>g;++g)c=d[g],this[c]=b[c],e[c]=[]},a.prototype.observe=function(a,c){var d=this.__listeners[O(c)];return u(d)?b:(a=a.bind(this.__control),d.push(a),function(){var b=d.indexOf(a);-1!==b&&d.splice(b,1)})},a.prototype._attributeChanged=function(a,b,c){for(var d=this.__listeners[O(a)],e=d.length,f=0;e>f;++f)d[f](b,c)},a}();a.Attributes=C,a.IAttributesFactory=g,Ga.injectable(qb,C,null,ve),Ga.injectable(pb,g,null,we);var D=function(){function a(){this.__resources={},this.__bound=!1}return a.create=function(c,d){if(u(d))return d;var e;switch(d.type.toLowerCase()){case Qe:var f=vf[d.value];u(f)||(d.value=f.inject());break;case Pe:a._observeResource(c,d);break;case Re:e=d.value,n(e)&&(d.value=c.evaluateExpression(e));break;case Te:break;case Se:e=d.value,n(e)&&(e=c[e],t(e)?d.value=e.bind(c):(a._log.warn('Attempted to create a "function" type Resource, but the function '+e+"cannot be found on your control."),d.value=b))}return d},a.addControlResources=function(b){b.resources.add({context:{value:b.context,type:Pe},control:{value:b,type:Re}}),b.hasOwnContext&&a.__addRoot(b)},a.bindResources=function(b){var c=b.__resources;if(!u(c)){for(var d,e=b.__controlInstance,f=Object.keys(c),g=a.__controlResources,h=f.length,i=0;h>i;++i)d=f[i],g[d]!==!0&&(b[d]=c[d]=a.create(e,b[d]));b.__bound=!0}},a.dispose=function(b,c){var d=b.resources;if(!u(d)){for(var e,g,h=Object.keys(d.__resources),i=h.length,j=a._ContextManager.defineProperty,k=0;i>k;++k)e=h[k],g=d[e],u(g)||g.type!==Pe&&g.type!==Te||j(d,e,c?f(g,!0):null,!0,!0,!0);a._removeListeners(d.__controlInstance)}},a.parseElement=function(b){for(var c,d,e,f,g,h,i=Array.prototype.slice.call(b.children),j=a._regex,k=j.whiteSpaceRegex,l=j.quotationRegex,m={},n=a.__resourceTypes;i.length>0;)c=i.pop(),g=c.nodeName.toLowerCase(),n[g]&&(e=c.attributes,d={},f=e.getNamedItem(Ne),u(f)||(d.alias=f.value,h=c.textContent.replace(k,"$1"),q(h)||(d.value=g===Qe||g===Te?h.replace(l,""):h,d.type=g,m[d.alias]=d)));return m},a.getInstance=function(){return new a},a._observeResource=function(b,c){var d=c.value,e=b.uid,f=a.__observableResourceRemoveListeners[e];if(u(f)&&(f=a.__observableResourceRemoveListeners[e]=[]),n(d)){u(c.initialValue)?c.initialValue=d:d=c.initialValue;var g=b.observeExpression(function(a){c.value=a},d);c.value=b.evaluateExpression(d),f.push(g)}},a._removeListeners=function(b){if(!u(b)){var c=b.uid,d=a.__observableResourceRemoveListeners[c];if(w(d))for(var e=d.length,f=0;e>f;++f)d[f]();Q(a.__observableResourceRemoveListeners,c)}},a.__addRoot=function(a){a.resources.add({root:{value:a,type:Re,alias:Ue},rootContext:{value:a.context,type:Pe,alias:Ve}})},a.prototype.initialize=function(b,c){if(this.__controlInstance=b,!u(c)){k(c)?c=a.parseElement(c):h(c.resources)&&(c=c.resources),this.__resources=c;for(var d,e=Object.keys(c),f=e.length,g=0;f>g;++g)d=e[g],this[d]=c[d]}},a.prototype.add=function(b){if(!u(b)){k(b)&&(b=a.parseElement(b));for(var c,d,e=Object.keys(b),f=e.length,g=this.__controlInstance,h=this.__bound,i=a.create,j=0;f>j;++j)d=e[j],c=b[d],c.alias=d,this[d]=this.__resources[d]=h?i(g,c):c}},a.INJECTABLE=Qe,a.OBJECT=Re,a.OBSERVABLE=Pe,a.LITERAL=Te,a.FUNCTION=Se,a.__observableResourceRemoveListeners={},a}();a.Resources=D,a.IResourcesFactory=i,Ga.injectable(wb,i,[bb,$a,Ya],we),Ga.injectable(xb,D,null,ve);var E=function(){function a(){this._gestures=a.gestures,this._androidVersion=v(this._compat.ANDROID)?-1:this._compat.ANDROID,this._android44orBelow=Math.floor(this._androidVersion/10)<=44,this._inMouse=!1,this._subscribers={},this._gestureCount={$tap:0,$dbltap:0,$hold:0,$release:0,$swipe:0,$track:0,$trackend:0},this.__hasMoved=!1,this.__hasRelease=!1,this.__detectingMove=!1,this.__tapCount=0,this.__touchCount=0,this.__cancelDeferredTap=b,this.__cancelDeferredHold=b,this.__cancelRegex=/cancel/i,this.__pointerEndRegex=/up|cancel/i,this.__reverseMap={},this.__mappedEventListener=this.__handleMappedEvent.bind(this),this.__mappedCount={$touchstart:0,$touchmove:0,$touchend:0,$touchcancel:0},this.__pointerHash={},this.__pointerEvents=[],this.__listeners={},this.__getTypes()}return a.prototype.addEventListener=function(a,c,d,e){var f=this,g=this._compat,h=g.mappedEvents,i=h[c],j=!u(i),k=this.__mappedCount,l=b,m=b,n=this._gestures,o=!1;if(j){var p=k[c];this.__reverseMap[i]=c,this.__registerElement(a,c),k[c]++,l=this.__addMappedEvent(p,i,e),g.hasTouchEvents&&!this.__cancelRegex.test(i)&&(i=i.replace("touch","mouse").replace("start","down").replace("end","up"),this.__reverseMap[i]=c,m=this.__addMappedEvent(p,i,e))}if(a.addEventListener(c,d,e),!v(a["on"+c])||v(n[c])||j)return function(){if(!o){if(j){var b=k[c];s(b)&&(b>0&&(b=--k[c]),0===b&&(l(),m())),f.__unregisterElement(a,c)}o=!0,a.removeEventListener(c,d,e)}};var q=n.$swipe,r=n.$track,t=c;if(-1!==c.indexOf(r)){var w=n.$trackend;t=c===w?w:r}else-1!==c.indexOf(q)&&(t=q);return this._gestureCount[t]++,this.__registerElement(a,c),function(){o||(o=!0,f.__removeEventListener(a,c,d,e))}},a.prototype.dispose=function(){this.__unregisterTypes(),this._gestureCount={$tap:0,$dbltap:0,$hold:0,$release:0,$swipe:0,$track:0,$trackend:0},this.__mappedCount={$touchstart:0,$touchmove:0,$touchend:0,$touchcancel:0},this._isActive=!1,this._subscribers={},this.__pointerEvents=[],this.__pointerHash={},this.__reverseMap={},this.__tapCount=this.__touchCount=0,this.__detectingMove=this.__hasMoved=this.__hasRelease=this.__haveSwipeSubscribers=!1,this.__lastMoveEvent=this.__lastTouchDown=this.__lastTouchUp=null,this.__swipeOrigin=this.__capturedTarget=this.__focusedElement=null,this.__cancelDeferredHold=this.__cancelDeferredTap=b},a.prototype._onTouchStart=function(c){var d=this;if(this.__touchCount++>0)return!0;var e=c.type;if("mousedown"!==e)this._inTouch=!0;else{if(this._inTouch===!0)return c.preventDefault(),!1;this._compat.hasTouchEvents&&(this._inMouse=!0)}if(c=this.__standardizeEventObject(c),u(c))return!0;this.__capturedTarget=this.__lastMoveEvent=null,this.__hasMoved=!1;var f=c.clientX,g=c.clientY,h=c.timeStamp,i=c.target,j=this._gestures;this.__lastTouchDown={_buttons:c._buttons,clientX:f,clientY:g,timeStamp:h,target:i,identifier:c.identifier},this.__swipeOrigin={clientX:f,clientY:g,xTimestamp:h,yTimestamp:h,xTarget:i,yTarget:i},this.__haveSwipeSubscribers=this.__findFirstSubscribers(i,[j.$swipe,j.$swipedown,j.$swipeleft,j.$swiperight,j.$swipeup]).length>0;var k=this._gestureCount,l=k.$hold<=0,m=k.$release<=0;if(("touchstart"===e||k.$track>0||k.$trackend>0||k.$swipe>0)&&(this.__registerType(this._moveEvents),this.__detectingMove=!0),l&&m)return!0;var n,o,p=a.config.intervals.holdInterval,q=!1;return l?(this.__hasRelease=!1,this.__cancelDeferredHold=K(function(){d.__hasRelease=!0},p),!0):(m?(n=this.__findFirstSubscriber(c.target,this._gestures.$hold),(q=!u(n))&&(o=function(){n.trigger(c),d.__cancelDeferredHold=b})):(this.__hasRelease=!1,n=this.__findFirstSubscriber(c.target,this._gestures.$hold),(q=!u(n))&&(o=function(){n.trigger(c),d.__hasRelease=!0,d.__cancelDeferredHold=b})),void(q&&(this.__cancelDeferredHold=K(o,p))))},a.prototype._onTouchMove=function(c){if(this.__cancelDeferredHold(),this.__cancelDeferredHold=b,this._inTouch===!0&&"mousemove"===c.type)return!0;var d=this.__standardizeEventObject(c);if(u(d))return!0;var e=this._gestureCount,f=e.$track<=0,g=e.$swipe<=0,h=a.config,i=this.__swipeOrigin,j=d.clientX,k=d.clientY,l=this.__hasMoved||this.__getDistance(i.clientX,j,i.clientY,k)>=h.distances.minScrollDistance;if(!l)return!0;if(this.__hasMoved=!0,f&&g)return!0;var m=this.__lastMoveEvent||i,n=d.direction=this.__getDirection(j-m.clientX,k-m.clientY);this.__handleOriginChange(n);var o=Math.abs(j-i.clientX),p=Math.abs(k-i.clientY);d.velocity=this.__getVelocity(o,p,d.timeStamp-i.xTimestamp,d.timeStamp-i.yTimestamp),!g&&this._android44orBelow&&this.__haveSwipeSubscribers&&c.preventDefault(),f||this.__handleTrack(d,c),this.__lastMoveEvent=d},a.prototype._onTouchEnd=function(b){var c=b.type,d=this.__hasMoved,e="mouseup"!==c;if(this.__touchCount<=0?this.__touchCount=0:this.__touchCount--,e){if("touchend"===c){if(d)b.cancelable===!0&&b.preventDefault();else{if(this._inTouch!==!0)return this.__preventClickFromTouch(),b.cancelable===!0&&b.preventDefault(),!0;this.__handleInput(b.target),b.cancelable===!0&&b.preventDefault()}this.__preventClickFromTouch()}}else if(!v(this._inTouch)){if(!this._inMouse)return b.cancelable===!0&&b.preventDefault(),!1;this._inMouse=!1}if(this.__cancelRegex.test(c))return this.__handleCanceled(b),!0;if(b=this.__standardizeEventObject(b),u(b))return!0;e&&(this._inTouch=!1),this.__touchCount>0&&(this.__touchCount=b.touches.length),this.__clearTempStates(),this.__hasRelease&&this.__handleRelease(b),this.__handleSwipe();var f=a.config,g=f.intervals,h=b.timeStamp,i=this.__lastTouchDown;if(d)return this.__handleTrackEnd(b),this.__tapCount=0,!0;if(u(i)||h-i.timeStamp>g.tapInterval)return this.__tapCount=0,!0;var j=this.__lastTouchUp,k=b.clientX,l=b.clientY;this.__tapCount>0&&this.__getDistance(k,j.clientX,l,j.clientY)<=f.distances.maxDblTapDistance&&h-j.timeStamp<=g.dblTapInterval?this.__handleDbltap(b):this.__tapCount=0,this.__handleTap(b),this.__lastTouchUp=b},a.prototype.__clearTempStates=function(){this.__cancelDeferredHold(),this.__cancelDeferredHold=b,this.__detectingMove&&(this.__unregisterType(this._moveEvents),this.__detectingMove=!1)},a.prototype.__resetTouchEnd=function(){this.__tapCount=this.__touchCount=0,this._inTouch=this.__hasRelease=!1,this.__pointerHash={},this.__pointerEvents=[],this.__capturedTarget=null},a.prototype.__handleCanceled=function(a){var b=a.touches||this.__pointerEvents,c=this.__getTouchIndex(b);a=c>=0?b[c]:this.__standardizeEventObject(a),this._inTouch=!1,this.__clearTempStates(),this.__hasMoved&&(this._android44orBelow&&this.__handleSwipe(),this.__handleTrackEnd(a)),this.__resetTouchEnd()},a.prototype.__handleTap=function(c){var d=this;if(this.__tapCount++,!(this._gestureCount.$tap<=0)){var e=this._gestures,f=this.__findFirstSubscriber(c.target,e.$tap);if(!u(f))return a.config.intervals.dblTapZoomDelay<=0||"mouse"===c.pointerType||"mouseup"===c.type?(c._buttons=this.__lastTouchDown._buttons,void f.trigger(c)):void(this.__cancelDeferredTap=K(function(){c._buttons=d.__lastTouchDown._buttons,f.trigger(c),d.__tapCount=0,d.__cancelDeferredTap=b},a.config.intervals.dblTapZoomDelay))}},a.prototype.__handleDbltap=function(a){if(this.__tapCount=0,this.__cancelDeferredTap(),this.__cancelDeferredTap=b,!(this._gestureCount.$dbltap<=0)){var c=this.__findFirstSubscriber(a.target,this._gestures.$dbltap);u(c)||(a._buttons=this.__lastTouchDown._buttons,c.trigger(a),this.__tapCount=-1)}},a.prototype.__handleRelease=function(a){var b=this.__findFirstSubscriber(a.target,this._gestures.$release);u(b)||b.trigger(a),this.__hasRelease=!1},a.prototype.__handleSwipe=function(){if(!(this._gestureCount.$swipe<=0)){var a=this.__lastMoveEvent;if(!u(a)){for(var b=this.__swipeOrigin,c=Math.abs(a.clientX-b.clientX),d=Math.abs(a.clientY-b.clientY),e=this.__getRegisteredSwipes(a.direction,a.velocity,c,d);e.length>0;)e.pop().trigger(a);this.__lastMoveEvent=null}}},a.prototype.__handleTrack=function(a,b){var c=this._gestures,d=c.$track,e=a.direction,f=this.__capturedTarget||a.target,g=this.__findFirstSubscribers(f,[d,d+e.x,d+e.y]);if(this._android44orBelow){var h=this.__findFirstSubscribers(f,[d,c.$trackdown,c.$trackup,c.$trackleft,c.$trackright,c.$trackend]);h.length>0&&b.preventDefault()}if(g.length>0)for(this._androidVersion>-1&&b.preventDefault();g.length>0;)g.pop().trigger(a)},a.prototype.__handleTrackEnd=function(a){if(!(this._gestureCount.$trackend<=0)){var b=this.__capturedTarget||a.target,c=this.__findFirstSubscriber(b,this._gestures.$trackend);u(c)||c.trigger(a)}},a.prototype.__handleMappedEvent=function(a){var b=a.type,c=this.__reverseMap[b],d=this.__findFirstSubscriber(a.target,c);u(d)||(a=this.__standardizeEventObject(a),u(a)||d.trigger(a))},a.prototype.__getTypes=function(){var a,b,c,d=this._compat,e=d.mappedEvents,f=this.__listeners;if(d.hasPointerEvents)a=this._startEvents=e.$touchstart,b=this._moveEvents=e.$touchmove,c=this._endEvents=e.$touchend+" "+e.$touchcancel;else if(d.hasTouchEvents)a=this._startEvents=e.$touchstart+" mousedown",b=this._moveEvents=e.$touchmove+" mousemove",c=this._endEvents=e.$touchend+" mouseup "+e.$touchcancel;else{var g=e.$touchcancel;a=this._startEvents=e.$touchstart,b=this._moveEvents=e.$touchmove,c=this._endEvents=e.$touchend+(g?" "+g:"")}f[a]=this._onTouchStart.bind(this),f[b]=this._onTouchMove.bind(this),f[c]=this._onTouchEnd.bind(this)},a.prototype.__registerTypes=function(){this.__registerType(this._startEvents),this.__registerType(this._endEvents)},a.prototype.__unregisterTypes=function(){this.__unregisterType(this._startEvents),this.__unregisterType(this._endEvents),this.__detectingMove&&(this.__unregisterType(this._moveEvents),this.__detectingMove=!1)},a.prototype.__registerType=function(a){for(var b=this.__listeners[a],c=this._document,d=a.split(" "),e=d.length;e-->0;)c.addEventListener(d[e],b,!1)},a.prototype.__unregisterType=function(a){for(var b=this.__listeners[a],c=this._document,d=a.split(" "),e=d.length;e-->0;)c.removeEventListener(d[e],b,!1)},a.prototype.__registerElement=function(b,c){var d,e=b.__plat;u(e)?(d=N("domEvent_"),b.__plat=e={domEvent:d}):u(e.domEvent)&&(d=N("domEvent_"),e.domEvent=d),this._isActive||(this.__registerTypes(),u(this._isActive)&&this.__appendGestureStyle(),this._isActive=!0);var f;if(u(d)){var g=this._subscribers[e.domEvent];return v(g[c])?(f=new H(b,c),g[c]=f):g[c].count++,void g.gestureCount++}var h={gestureCount:1};f=new H(b,c),h[c]=f,this._subscribers[d]=h,v(b.className)||ha(b,a.config.styleConfig[0].className),this.__removeSelections(b)},a.prototype.__unregisterElement=function(a,b){var c=a.__plat;if(!u(c)&&!u(c.domEvent)){var d=c.domEvent,e=this._subscribers[d],f=e[b];u(f)||(f.count--,0===f.count&&Q(e,b),e.gestureCount--,0===e.gestureCount&&(Q(this._subscribers,d),this.__removeElement(a)))}},a.prototype.__setTouchPoint=function(a){var b=a.type,c=this._compat;return c.hasPointerEvents||c.hasMsPointerEvents?void this.__updatePointers(a,this.__pointerEndRegex.test(b)):void(a.pointerType=-1===b.indexOf("mouse")?"touch":"mouse")},a.prototype.__setCapture=function(a){u(this.__capturedTarget)&&!j(a)&&(this.__capturedTarget=a)},a.prototype.__updatePointers=function(a,b){var c,d=a.pointerId,e=this.__pointerHash,f=e[d];if(b)v(f)||(c=this.__pointerEvents.indexOf(f),c>-1&&this.__pointerEvents.splice(c,1),Q(this.__pointerHash,d));else{if(1===d&&!q(e))return;a.identifier=a.pointerId,v(f)||(c=this.__pointerEvents.indexOf(f))<0?this.__pointerEvents.push(a):this.__pointerEvents.splice(c,1,a),e[d]=a}},a.prototype.__findFirstSubscriber=function(a,b){if(!u(a)){var c,d,e;do if(c=a.__plat,!v(c)&&!v(c.domEvent)&&(d=this._subscribers[c.domEvent],e=d[b],!v(e)))return e;while(!u(a=a.parentNode))}},a.prototype.__findFirstSubscribers=function(a,b){if(u(a))return[];var c,d,e,f,g,h=[];do if(c=a.__plat,!v(c)&&!v(c.domEvent))for(d=this._subscribers[c.domEvent],e=Object.keys(d);e.length>0;)f=e.pop(),g=b.indexOf(f),-1!==g&&(h.push(d[f]),b.splice(g,1));while(b.length>0&&!u(a=a.parentNode));return h},a.prototype.__addMappedEvent=function(a,b,c){var d=this,e=this._document;return 0===a&&e.addEventListener(b,this.__mappedEventListener,c),function(){e.removeEventListener(b,d.__mappedEventListener,c)}},a.prototype.__removeEventListener=function(a,b,c,d){var e=this._gestures;a.removeEventListener(b,c,d);var f=e.$swipe,g=e.$track,h=b;if(-1!==b.indexOf(g)){var i=e.$trackend;h=b===i?i:g}else-1!==b.indexOf(f)&&(h=f);this._gestureCount[h]--,this.__unregisterElement(a,b)},a.prototype.__removeElement=function(b){this.__returnSelections(b),v(b.className)||ia(b,a.config.styleConfig[0].className);var c=b.__plat;Q(c,"domEvent"),q(c)&&Q(b,"__plat"),q(this._subscribers)&&this.dispose()},a.prototype.__standardizeEventObject=function(a){this.__setTouchPoint(a);var b,c=-1!==this._startEvents.indexOf(a.type),d=a.touches||this.__pointerEvents,e=a.changedTouches,f=!v(e),g=a.timeStamp;if(f)if(c)b=a.preventDefault.bind(a),a=e[0],a.preventDefault=b;else{var h=this.__getTouchIndex(e);if(h>=0)b=a.preventDefault.bind(a),a=e[h],a.preventDefault=b;else if(this.__getTouchIndex(d)>=0)return null}return c&&this.__setCapture(a.target),this.__normalizeButtons(a),a.touches=d,a.offset=this.__getOffset(a),(v(a.timeStamp)||g>a.timeStamp)&&(a.timeStamp=g),a},a.prototype.__normalizeButtons=function(a){var b;if(s(a.buttons)&&0!==a.buttons)b=a.buttons;else if(s(a.which)&&a.which>0)b=a.which;else switch(a.button){case-1:b=0;break;case 0:b=1;break;case 1:b=4;break;case 2:b=2;break;case 3:b=8;break;case 4:b=16;break;default:b=1}a._buttons=b},a.prototype.__getTouchIndex=function(a){for(var b=(this.__lastTouchDown||{}).identifier,c=a.length,d=0;c>d;++d)if(a[d].identifier===b)return d;return-1},a.prototype.__getOffset=function(a){var b=this.__capturedTarget||a.target;if(j(b))return{x:a.clientX,y:a.clientY};if(!v(a.offsetX)&&b===a.target)return{x:a.offsetX,y:a.offsetY};for(var c=b.offsetLeft,d=b.offsetTop;!u(b=b.offsetParent);)c+=b.offsetLeft,d+=b.offsetTop;return{x:a.clientX-c,y:a.clientY-d}},a.prototype.__getDistance=function(a,b,c,d){var e=b-a,f=d-c;return Math.sqrt(e*e+f*f)},a.prototype.__getVelocity=function(a,b,c,d){var e=0,f=0;return c>0&&(e=a/c||0),d>0&&(f=b/d||0),{x:e,y:f}},a.prototype.__getDirection=function(a,b){var c=Math.abs(a),d=Math.abs(b),e=(this.__lastMoveEvent||{}).direction||{},f=0===a?e.x||"none":0>a?"left":"right",g=0===b?e.y||"none":0>b?"up":"down";return{x:f,y:g,primary:c===d?e.primary||"none":c>d?f:g}},a.prototype.__handleOriginChange=function(a){var b=this.__lastMoveEvent;if(!u(b)){var c=b.direction,d=c.x===a.x,e=c.y===a.y;if(!d||!e){var f=this.__swipeOrigin,g=this._gestures,h=[g.$swipe,g.$swipedown,g.$swipeleft,g.$swiperight,g.$swipeup];d||(f.clientX=b.clientX,f.xTimestamp=b.timeStamp,f.xTarget=b.target,this._android44orBelow&&(this.__haveSwipeSubscribers=this.__findFirstSubscribers(f.xTarget,h).length>0)),e||(f.clientY=b.clientY,f.yTimestamp=b.timeStamp,f.yTarget=b.target,this._android44orBelow&&(this.__haveSwipeSubscribers=this.__findFirstSubscribers(f.yTarget,h).length>0))}}},a.prototype.__getRegisteredSwipes=function(b,c,d,e){var f,g=this._gestures.$swipe,h=a.config.velocities.minSwipeVelocity,i=[g],j=this.__swipeOrigin||{};return d>e?(f=j.xTarget,c.x>=h&&i.push(g+b.x)):e>d&&(f=j.yTarget,c.y>=h&&i.push(g+b.y)),this.__findFirstSubscribers(f,i)},a.prototype.__isHorizontal=function(a){return"left"===a||"right"===a},a.prototype.__appendGestureStyle=function(){var b,c,d=this._document;if(!this._compat.platCss)if(!u(d.styleSheets)&&d.styleSheets.length>0){var e=d.styleSheets[0];for(b=a.config.styleConfig,c=b.length;c-->0;)e.insertRule(this.__createStyle(b[c]),0)}else{var f=d.head,g=d.createElement("style"),h="";for(g.type="text/css",b=a.config.styleConfig,c=b.length;c-->0;)h=this.__createStyle(b[c])+h;g.textContent=h,f.appendChild(g)}},a.prototype.__createStyle=function(a){var b=a.styles||[],c=b.length,d="."+a.className+" { ",e="";c=b.length;for(var f=0;c>f;++f)e+=b[f]+";";return d+=e+" } "},a.prototype.__isFocused=function(a){return a===this.__focusedElement},a.prototype.__handleInput=function(a){var b=this,c=a.nodeName,d=this.__focusedElement||{};if(!n(c))return this.__focusedElement=null,void(t(d.blur)&&d.blur());var e;switch(c.toLowerCase()){case"input":switch(a.type){case"range":t(d.blur)&&d.blur();break;case"button":case"submit":case"checkbox":case"radio":case"file":t(d.blur)&&d.blur(),J(function(){b._document.body.contains(a)&&t(a.click)&&a.click()});break;default:return this.__focusedElement=a,a.focus(),void(e=this.addEventListener(a,"blur",function(){b.__isFocused(a)&&(b.__focusedElement=null),e()},!1))}break;case"a":case"button":case"label":t(d.blur)&&d.blur(),J(function(){b._document.body.contains(a)&&t(a.click)&&a.click()});break;case"textarea":return this.__focusedElement=a,a.focus(),void(e=this.addEventListener(a,"blur",function(){b.__isFocused(a)&&(b.__focusedElement=null),e()},!1));case"select":t(d.blur)&&d.blur(),J(function(){var c=b._document;if(c.body.contains(a)){var d=c.createEvent("MouseEvents");d.initMouseEvent("mousedown",!1,!1,null,null,null,null,null,null,null,null,null,null,null,null),a.dispatchEvent(d)}});break;default:t(d.blur)&&d.blur(),J(function(){b._document.body.contains(a)&&t(a.click)&&a.click()})}this.__focusedElement=null},a.prototype.__preventClickFromTouch=function(){var a,c=this,d=this._document,e=K(function(){d.removeEventListener("click",a,!0),d.removeEventListener("mousedown",a,!0),d.removeEventListener("mouseup",a,!0)},400);a=function(f){if(f.preventDefault(),f.stopPropagation(),d.removeEventListener(f.type,a,!0),e===b)return!1;e(),e=b;var g=c.__lastTouchDown;return u(g)||c.__isFocused(g.target)?!1:(c.__handleInput(g.target),!1)},J(function(){d.addEventListener("click",a,!0),d.addEventListener("mousedown",a,!0),d.addEventListener("mouseup",a,!0)})},a.prototype.__removeSelections=function(a){k(a)&&(v(a.onselectstart)||a.addEventListener("selectstart",this.__preventDefault,!1),v(a.ondragstart)||a.addEventListener("dragstart",this.__preventDefault,!1))},a.prototype.__returnSelections=function(a){k(a)&&(v(a.onselectstart)||a.removeEventListener("selectstart",this.__preventDefault,!1),v(a.ondragstart)||a.removeEventListener("dragstart",this.__preventDefault,!1))},a.prototype.__preventDefault=function(a){var b=a.target.nodeName;return n(b)&&(b=b.toLowerCase()),"input"===b||"textarea"===b?!0:(a.preventDefault(),!1)},a._inject={_document:Sa,_compat:Pa},a.config={intervals:{tapInterval:250,dblTapInterval:300,holdInterval:400,dblTapZoomDelay:0},distances:{minScrollDistance:3,maxDblTapDistance:10},velocities:{minSwipeVelocity:.645},styleConfig:[{className:"plat-gesture",styles:["-moz-user-select: none","-khtml-user-select: none","-webkit-touch-callout: none","-webkit-user-select: none","-webkit-user-drag: none","-webkit-tap-highlight-color: transparent","-webkit-overflow-scrolling: touch","-ms-user-select: none","-ms-touch-action: manipulation","touch-action: manipulation"]},{className:"plat-no-touch-action",styles:["-ms-touch-action: none","touch-action: none"]}]},a.gestures={$tap:Td,$dbltap:Ud,$hold:Zd,$release:$d,$swipe:_d,$swipeleft:ae,$swiperight:be,$swipeup:ce,$swipedown:de,$track:ee,$trackleft:fe,$trackright:ge,$trackup:he,$trackdown:ie,$trackend:je},a}();a.DomEvents=E,Ga.injectable(tb,E),a.IDomEventsConfig=m,Ga.injectable(ub,m);var F=function(){function a(){this._document=na(Sa)}return a.prototype.initialize=function(a,b,c){this.element=a,this.event=b,this.eventType=n(c)?c:"CustomEvent"},a.prototype.trigger=function(a,b,c){var d=this._document.createEvent(this.eventType);return h(a)&&e(!1,!1,d,a),d.initCustomEvent(this.event,!0,!0,u(b)?0:b),(c||this.element).dispatchEvent(d)},a}();a.DomEvent=F,Ga.injectable(vb,F,null,ve);var G,H=function(a){function b(b,c){a.call(this),this.count=0,this.element=b,this.event=c,this.count++}return __extends(b,a),b.prototype.trigger=function(a){var b=this._document.createEvent("CustomEvent"),c=this.element,d=a.target;this.__extendEventObject(b,a),b.initCustomEvent(this.event,!0,!0,0);var e=c.contains(d)?d.dispatchEvent(b):c.dispatchEvent(b);return e||a.preventDefault(),e},b.prototype.__extendEventObject=function(a,b){var c=b.pointerType;a.clientX=b.clientX,a.clientY=b.clientY,a.offsetX=b.offset.x,a.offsetY=b.offset.y,a.direction=b.direction||{x:"none",y:"none",primary:"none"},a.touches=b.touches,a.velocity=b.velocity||{x:0,y:0},a.identifier=b.identifier||0,a.pointerType=s(c)?this.__convertPointerType(c,b.type):c,a.screenX=b.screenX,a.screenY=b.screenY,a.pageX=b.pageX,a.pageY=b.pageY,a.buttons=b._buttons},b.prototype.__convertPointerType=function(a,b){switch(a){case MSPointerEvent.MSPOINTER_TYPE_MOUSE:return"mouse";case MSPointerEvent.MSPOINTER_TYPE_PEN:return"pen";case MSPointerEvent.MSPOINTER_TYPE_TOUCH:return"touch"}return-1===b.indexOf("mouse")?"touch":"mouse"},b}(F);!function(a){var c=function(){function a(){this._animatedElements={}}return a.prototype.create=function(a,b,c){return this._create(a,b,c,{key:null})},a.prototype.animate=function(a,b,c){return this._animate(a,b,c,{key:null})},a.prototype.enter=function(a,b,c,d,e){return this._animate(a,b,e,{key:"enter",parent:c,refChild:d})},a.prototype.leave=function(a,b,c){return this._animate(a,b,c,{key:"leave"})},a.prototype.move=function(a,b,c,d,e){return this._animate(a,b,e,{key:"move",parent:c,refChild:d})},a.prototype.show=function(a,b,c){return this._animate(a,b,c,{key:"show"})},a.prototype.hide=function(a,b,c){return this._animate(a,b,c,{key:"hide"})},a.prototype.all=function(a){for(var c=this,e=a.length,f=[],g=new d(function(b){c._Promise.all(a).then(function(){b()})}),h=0;e>h;++h)f=f.concat(a[h].getInstances());return g.initialize(f),g.then(b)},a.prototype.resolve=function(){var a=new d(function(b){b(function(){return a})});return a},a.prototype._animate=function(a,b,c,d){var e=this._create(a,b,c,d),f=e.current;return e.previous.then(function(){M(function(){f.start()})}),f},a.prototype._create=function(a,c,e,f){var g,h=this,i=yf[c],j=[],k=[];if((!this._compat.animationSupported||v(i))&&(i=zf[c],v(i)))return a=this.__constructAnimatableElements(a,{inject:b},k,j),this._handlePreInitFunctionality(a,k,f),this._handlePostInitFunctionality(a,k,f),this._handleEndFunctionality(a,k,f),g=this.resolve(),{previous:g,current:g};a=this.__constructAnimatableElements(a,i,k,j);var l=k.length;if(0===l)return this._handlePreInitFunctionality(a,k,f),this._handlePostInitFunctionality(a,k,f),this._handleEndFunctionality(a,k,f),g=this.resolve(),{previous:g,current:g};this._handlePreInitFunctionality(a,k,f);var m,n=N("animation_"),o=this.__setAnimationId(n,k),q=new d(function(b){var c=h._Promise;m=c.all(o).then(function(){for(var d=[],g=0;l>g;++g)d.push(j[g].instantiate(k[g],e));h._handlePostInitFunctionality(a,k,f);var i=c.all(d),m=h.__isParentAnimating(k),o=h.__generateAnimatedElement(n,k,q);if(!u(m)){h._handleEndFunctionality(a,k,f),o.animationEnd(!0);var r=h._animatedElements[m],s=p(r.promise)?function(){return r.promise}:function(){return q};i.then(function(){b(s)})}h.__stopChildAnimations(k),o.promise=q,i.then(function(){h._handleEndFunctionality(a,k,f),o.animationEnd(),b(function(){return q})})})});return q.initialize(j),{previous:m,current:q}},a.prototype._handlePreInitFunctionality=function(a,b,c){switch(c.key){case"move":for(var d=0;de;++e)f.insertBefore(a[e],g);break;case"show":for(d=b.length,e=0;d>e;++e)b[e].removeAttribute(Jd)}},a.prototype._handleEndFunctionality=function(a,b,c){var d,e;switch(c.key){case"leave":for(d=a.length,e=0;d>e;++e)ga(a[e]);break;case"hide":for(d=b.length,e=0;d>e;++e)b[e].setAttribute(Jd,"")}},a.prototype.__setAnimationId=function(a,b){for(var c,d,e,f=this._animatedElements,g=[],h=b.length,i=0;h>i;++i)e=b[i],d=e.__plat,v(d)?(e.__plat={animation:a},ha(e,Kd)):v(d.animation)?(d.animation=a,ha(e,Kd)):(c=f[d.animation],v(c)||(g.push(c.promise),c.animationEnd(!0)),d.animation=a);return g},a.prototype.__generateAnimatedElement=function(a,b,c){var d=this._animatedElements,e=function(e){var f,g,h,i=b.length;if(e===!0)return c.cancel(),void Q(d,a);for(var j=0;i>j;++j)g=b[j],f=g.__plat||{},h=f.animation,v(h)||h!==a||(ia(g,Kd),Q(f,"animation"),q(f)&&Q(g,"__plat"));Q(d,a)};return d[a]={animationEnd:e}},a.prototype.__isParentAnimating=function(a){for(var b,c=a[0];!j(c=c.parentNode)&&!u(c)&&c.nodeType===Node.ELEMENT_NODE;)if(la(c,Kd)&&(b=(c.__plat||{}).animation,n(b))){if(!u(this._animatedElements[b]))return b;Q(c.__plat,"animation"),q(plat)&&Q(c,"__plat"),ia(c,Kd)}},a.prototype.__stopChildAnimations=function(a){for(var b,c,d,e,f=this._animatedElements,g=Array.prototype.slice,h=0;h0;)d=b.pop().__plat||{},e=d.animation,u(e)||(c=f[e]||{},t(c.animationEnd)&&c.animationEnd(!0))},a.prototype.__constructAnimatableElements=function(a,b,c,d){if(!w(a))if(l(a))a=Array.prototype.slice.call(a.childNodes);else if(x(a))a=Array.prototype.slice.call(a);else{if(!k(a)||a.nodeType!==Node.ELEMENT_NODE)return[];a=[a]}for(var e,f=a.length,g=0;f>g;++g)e=a[g],k(e)&&e.nodeType===Node.ELEMENT_NODE&&(c.push(e),d.push(b.inject()));return a},a._inject={_compat:Pa,_Promise:Oa,_document:Sa},a}();a.Animator=c,Ga.injectable(ob,c);var d=function(a){function c(b,c){a.call(this,b),this._Promise=na(Oa),this.__animationState=0,this.__animationInstances=[],u(c)||(this.__animationInstances=c.__animationInstances,this.__animationState=c.__animationState)}return __extends(c,a),c.prototype.initialize=function(a){q(this.__animationInstances)&&(w(a)?this.__animationInstances=a:h(a)&&(this.__animationInstances=[a]))},c.prototype.getInstances=function(){return this.__animationInstances},c.prototype.start=function(){if(!(this.__animationState>0)){for(var a,b=this.__animationInstances,c=b.length,d=0;c>d;++d)a=b[d],t(a.start)&&a.start();this.__animationState=1}},c.prototype.pause=function(){if(1!==this.__animationState)return this._Promise.resolve();for(var a,c=this.__animationInstances,d=[],e=c.length,f=0;e>f;++f)a=c[f],t(a.pause)&&d.push(a.pause());return this._Promise.all(d).then(b)},c.prototype.resume=function(){if(1!==this.__animationState)return this._Promise.resolve();for(var a,c=this.__animationInstances,d=[],e=c.length,f=0;e>f;++f)a=c[f],t(a.resume)&&d.push(a.resume());return this._Promise.all(d).then(b)},c.prototype.cancel=function(){if(2===this.__animationState)return this;for(var a,b=this.__animationInstances,c=b.length,d=0;c>d;++d)a=b[d],t(a.cancel)&&a.cancel(),t(a.end)&&a.end();return this.__animationState=2,this},c.prototype.isCanceled=function(){return 2===this.__animationState},c.prototype.then=function(b){return a.prototype.then.call(this,b)},c.prototype.catch=function(b){return a.prototype.catch.call(this,b)},c}(Gf.Promise);a.AnimationPromise=d;var e=function(){function a(){this.__eventListeners=[]}return a.prototype.initialize=function(){},a.prototype.start=function(){},a.prototype.end=function(){ -for(var a=this.__eventListeners;a.length>0;)a.pop()();t(this._resolve)&&(this._resolve(),this._resolve=null)},a.prototype.pause=function(){return this._Promise.resolve()},a.prototype.resume=function(){return this._Promise.resolve()},a.prototype.cancel=function(){this.end()},a.prototype.addEventListener=function(a,c,d){if(!t(c))return this._log.warn('An animation\'s "addEventListener" must take a function as the second argument.'),b;c=c.bind(this);var e=this.dom.addEventListener(this.element,a,function(a){a.stopPropagation(),c(a)},d),f=this.__eventListeners;return f.push(e),function(){e();var a=f.indexOf(e);-1!==a&&f.splice(a,1)}},a.prototype.instantiate=function(a,b){var c=this;this.element=a,this.options=b;var e=new d(function(a){c._resolve=a,c.initialize()});return e.initialize(this),e},a._inject={_window:Gb,_compat:Pa,_log:Ya,_Promise:Oa,dom:sb,utils:Ab},a}();a.BaseAnimation=e;var f=function(a){function b(){a.apply(this,arguments),this._animationEvents=this._compat.animationEvents}return __extends(b,a),b.prototype.animationStart=function(a){return this.addEventListener(this._animationEvents.$animationStart,a,!1)},b.prototype.animationEnd=function(a){return this.addEventListener(this._animationEvents.$animationEnd,a,!1)},b.prototype.animationIteration=function(a){return this.addEventListener(this._animationEvents.$animationIteration,a,!1)},b.prototype.transitionStart=function(a){return this.addEventListener(this._animationEvents.$transitionStart,a,!1)},b.prototype.transitionEnd=function(a){return this.addEventListener(this._animationEvents.$transitionEnd,a,!1)},b}(e);a.CssAnimation=f;var g=function(a){function c(){a.apply(this,arguments),this.className=Ld,this._animationCanceled=b}return __extends(c,a),c.prototype.initialize=function(){ha(this.element,this.className+Be)},c.prototype.start=function(){var a=this;this._animationCanceled=M(function(){var b=a.element,c=a.className;if(null===b.offsetParent)return a._dispose(),void a.end();ha(b,c);var d=a._animationEvents.$animation,e=a.options||{},f=a._window.getComputedStyle(b,e.pseudo),g=f[d+"Name"];return""===g||"none"===g||"paused"===f[d+"PlayState"]?(a._dispose(),void a.end()):(e.preserveInit||ia(b,c+Be),void(a._animationCanceled=a.animationEnd(function(){a._animationCanceled=M(function(){a._dispose(),a.end()})})))})},c.prototype.pause=function(){var a=this;if(this._animationCanceled===b)return this._Promise.resolve();var c=this._compat.animationEvents;return new this._Promise(function(d){M(function(){a._animationCanceled!==b&&(a.element.style[c.$animation+"PlayState"]="paused"),d()})})},c.prototype.resume=function(){var a=this;if(this._animationCanceled===b)return this._Promise.resolve();var c=this._compat.animationEvents;return new this._Promise(function(d){M(function(){a._animationCanceled!==b&&(a.element.style[c.$animation+"PlayState"]="running"),d()})})},c.prototype.cancel=function(){this._animationCanceled(),this._dispose(),this.end()},c.prototype._dispose=function(){var a=this.className;ia(this.element,a+" "+a+Be),this._animationCanceled=b},c}(f);a.SimpleCssAnimation=g,Ga.animation(Ld,g);var i=function(a){function b(){a.apply(this,arguments),this.className=Qd}return __extends(b,a),b}(g);a.FadeIn=i,Ga.animation(Qd,i);var m=function(a){function b(){a.apply(this,arguments),this.className=Rd}return __extends(b,a),b}(g);a.FadeOut=m,Ga.animation(Rd,m);var o=function(a){function b(){a.apply(this,arguments),this.className=Nd}return __extends(b,a),b}(g);a.Enter=o,Ga.animation(Nd,o);var r=function(a){function b(){a.apply(this,arguments),this.className=Od}return __extends(b,a),b}(g);a.Leave=r,Ga.animation(Od,r);var s=function(a){function b(){a.apply(this,arguments),this.className=Pd}return __extends(b,a),b}(g);a.Move=s,Ga.animation(Pd,s);var y=function(a){function c(){a.apply(this,arguments),this.className=Md,this._animationCanceled=b,this._modifiedProperties={},this._normalizeRegex=/-/g,this._nonNumRegex=/[^\-0-9\.]/g,this._normalizedKeys={},this._transitionCount=0,this._count=0,this._started=!1,this._usingCss=!1}return __extends(c,a),c.prototype.initialize=function(){ha(this.element,this.className+Be)},c.prototype.start=function(){var a=this;this._animationCanceled=M(function(){var b=a.element,c=a.className;null===b.offsetParent&&(a._animate(),a._dispose(),a.end()),ha(b,c),a._started=!0;var d=a.utils,e=a._animationEvents.$transition,f=a.options||{},g=f.count,h=a._window.getComputedStyle(b,f.pseudo),i=h[e+"Property"],j=h[e+"Duration"];if(d.isNumber(g)&&g>0&&(a._count=g),""===i||"none"===i||""===j||"0s"===j)return a._animate(),a._dispose(),void a.end();if(f.preserveInit===!1&&ia(b,c+Be),a._animationCanceled=a.transitionEnd(a._done),!a._animate()){if(d.isEmpty(f.properties))return void a._cssTransition(h);a._dispose(),a.end()}})},c.prototype.cancel=function(){this._animationCanceled(),this._started||this._animate(),this._dispose(),this.end()},c.prototype._dispose=function(){var a=this.className;ia(this.element,a+" "+a+Be),this._animationCanceled=b},c.prototype._done=function(a){var b=a.propertyName;if(n(b)){var c=++this._transitionCount;if(b=b.replace(this._normalizeRegex,"").toLowerCase(),c0;)a=f.shift(),b=d[a],c=e[a],n(c)?(d[a]=c,b===d[a]?k++:(h[a]=b,i[a.replace(j,"").toLowerCase()]=!0)):k++;return g>k},c.prototype._cssTransition=function(a){var c,d,e,f,g=this,h=this._animationEvents.$transition,i=a[h+"Duration"].split(","),j=a[h+"Delay"].split(","),k=a[h+"Property"].split(","),l=k.length,m=[],n=this._normalizedKeys,o=this._normalizeRegex,p=this._modifiedProperties,q=0,r=0,s=!1,t=this.utils.defer.bind(this,function(c,d){g._animationCanceled!==b&&("all"===c?s=!0:a[c]!==d&&(s=!0,p[c]=d),++rq;++q)c=k[q]=k[q].trim(),d=i.length>q?i[q].trim():i[i.length-1].trim(),e=j.length>q?j[q].trim():j[j.length-1].trim(),n[c.replace(o,"").toLowerCase()]=!0,f=a[c],m.push(f),t(this._toMs(d)+this._toMs(e),[c,f])},c.prototype._toMs=function(a){var b=this._nonNumRegex,c=a.match(b)[0],d=Number(a.replace(b,""));return this.utils.isNumber(d)?"s"===c?1e3*d:"ms"===c?d:0:0},c}(f);a.SimpleCssTransition=y,Ga.animation(Md,y)}(G=a.animations||(a.animations={}));var I;!function(a){var c=function(a){function c(){a.apply(this,arguments)}return __extends(c,a),c.prototype.initialize=function(){var a,b=this._router=this._Router.currentRouter(),c=this._getParentViewport();u(c)||u(c._router)||(a=this._parentRouter=c._router,a.addChild(b)),this._navigator.initialize(b)},c.prototype.loaded=function(){var a=this;this._Promise.resolve(this._router.finishNavigating).then(function(){a._router.register(a)})},c.prototype.canNavigateTo=function(a){var b=this,c=this._Router.currentRouter,d=c(),e=!0,f=this._Injector.getDependency(a.delegate.view),g=f.inject(),i=a.parameters,j=c();if(!h(g))return this._Promise.resolve(null);if(d!==j){j.initialize(this._router);var k=na(ab);g.navigator=k,k.initialize(j)}else g.navigator=this._navigator;return t(g.canNavigateTo)&&(e=g.canNavigateTo(i,a.query)),this._Promise.resolve(e).then(function(a){return b._nextInjector=f,b._nextView=g,a})},c.prototype.canNavigateFrom=function(){var a=this.controls[0],b=!0;return h(a)&&t(a.canNavigateFrom)&&(b=a.canNavigateFrom()),this._Promise.resolve(b)},c.prototype.navigateTo=function(a){var b=this._nextInjector||this._Injector.getDependency(a.delegate.view),c=this._createNodeMap(b),d=(this.element,c.element),e=(a.parameters,a.query),f=c.uiControlNode.control;this._animator.enter(d,Nd,this.element);var g=this._managerCache.read(this.uid),h=this._ElementManagerFactory.getInstance();return g.children=[],h.initialize(c,g),t(f.navigatedTo)&&f.navigatedTo(a.parameters,e),h.setUiControlTemplate(),f.hasOwnContext?h.observeRootContext(f,h.fulfillAndLoad):h.fulfillAndLoad()},c.prototype.navigateFrom=function(){var a,c=this.controls[0];return a=h(c)&&t(c.navigatingFrom)?this._Promise.resolve(c.navigatingFrom()):this._Promise.resolve(),a.catch(b).then(function(){Of.dispose(c)})},c.prototype.dispose=function(){this._router.unregister(this),this._navigator.dispose()},c.prototype._createNodeMap=function(a){var b=this._nextView||a.inject(),c=this._document,d=a.name,e=b.replaceWith,f=q(e)||"any"===e?c.createElement("div"):c.createElement(e);return f.setAttribute(Sc,d),f.className=Tc,{element:f,attributes:{},nodes:[],uiControlNode:{control:b,nodeName:d,expressions:[],injector:a,childManagerLength:0}}},c.prototype._getParentViewport=function(){for(var a=this.parent,b=this.type;!u(a)&&a.type!==b;)a=a.parent;return a},c._inject={_Router:Eb,_Promise:Oa,_Injector:Sb,_ElementManagerFactory:gb,_document:Sa,_managerCache:mb,_animator:ob,_navigator:ab},c}(o);a.Viewport=c,Ga.control(Rc,c);var d=function(a){function b(){a.call(this),this.replaceWith=null,this.__isFirst=!1;var b=na(lb);this.__templateControlCache=b.create(Zc)}return __extends(b,a),b.prototype.initialize=function(){var a=this.options||{},b=a.value||{},c=this._id=b.id;if(u(c))return void this._log.warn(this.type+" instantiated without an id option");this._url=b.templateUrl;var d=this.__templateControlCache.read(c);return u(d)?(this.__isFirst=!0,void this._initializeTemplate()):void(this.__templatePromise=d)},b.prototype.loaded=function(){this.__isFirst||this._waitForTemplateControl(this.__templatePromise)},b.prototype.dispose=function(){if(this.__isFirst){var a=this.__templateControlCache;a.remove(this._id),0===a.info().size&&a.dispose()}},b.prototype._initializeTemplate=function(){var a=this,b=this._id;if(!u(b)){var c,d=this.endNode.parentNode,e=this._url;u(e)?(c=this._document.createDocumentFragment(),V(this.elementNodes,c)):(c=this._templateCache.read(e),X(this.elementNodes,d));var f;p(c)?f=c.catch(function(b){return u(b)?o.determineTemplate(a,e):void 0}).then(function(c){return a.bindableTemplates.add(b,c.cloneNode(!0)),a}):(this.bindableTemplates.add(b,c.cloneNode(!0)),f=this._Promise.resolve(this)),this.__templateControlCache.put(b,f)}},b.prototype._waitForTemplateControl=function(a){var b=this;p(a)&&a.then(function(a){return u(b._url)||b._url===a._url||b._log.warn("The specified url: "+b._url+" does not match the original "+b.type+' with id: "'+b._id+'". The original url will be loaded.'),b.__mapBindableTemplates(a),b.bindableTemplates.bind(b._id)}).then(function(a){var c=b.endNode;_(c.parentNode,a,c)}).catch(function(a){J(function(){b._log.warn("Problem resolving "+b.type+" url: "+a.response)})})},b.prototype.__mapBindableTemplates=function(a){var b=this.bindableTemplates;b.cache=a.bindableTemplates.cache,b.templates=a.bindableTemplates.templates},b._inject={_Promise:Oa,_templateCache:nb,_document:Sa},b}(o);a.Template=d,Ga.control(Qc,d);var e=function(a){function b(){a.apply(this,arguments)}return __extends(b,a),b.prototype.setTemplate=function(){this.innerTemplate=V(this.element.childNodes)},b.prototype.loaded=function(){this.element.appendChild(this.innerTemplate.cloneNode(!0))},b}(o);a.Ignore=e,Ga.control(Oc,e);var f=function(a){function b(){var b=this;a.call(this),this.priority=120,this._aliases={index:ke.index,even:ke.even,odd:ke.odd,first:ke.first,last:ke.last},this._blockLength=0,this._addQueue=[],this._itemLength=0,this.__listenerSet=!1,this.itemsLoaded=new this._Promise(function(a){b.__resolveFn=a})}return __extends(b,a),b.prototype.setTemplate=function(){this.bindableTemplates.add("item",this.element.childNodes)},b.prototype.contextChanged=function(a,b){w(a)?this._setListener():(this._log.debug(this.type+" context set to something other than an Array."),a=[]),this._executeEvent([{object:a,type:"splice"}])},b.prototype.loaded=function(){var a=this.options,b=this._animate=!v(a)&&a.value.animate===!0,c=this.context;if(this._container=this.element,b&&(this._animationQueue=[]),!w(c))return void(u(c)||this._log.debug(this.type+" context set to something other than an Array."));this._setAliases();var d=this._addQueue,e=c.length,f=this._addItems(0,e,0).then(function(){var a=d.indexOf(f);-1!==a&&d.splice(a,1)});d.push(f),this._setListener()},b.prototype.dispose=function(){this.__resolveFn=this._animationQueue=this._addQueue=null},b.prototype._setAliases=function(){var a=this.options;if(!v(a)){var b=a.value.aliases;if(h(b))for(var c,d=this._aliases,e=Object.keys(d),f=e.length,g=0;f>g;++g)c=b[e[g]],n(c)&&(d[e[g]]=c)}},b.prototype._addItems=function(a,b,c){var d=this,e=+(a+b),f=[],g=a;for(this._itemLength+=b;e>a;)f.push(this._bindItem(a++));return f.length>0&&(this.itemsLoaded=this._Promise.all(f).then(function(a){if(d._setBlockLength(a),c>0)for(var b=a.length,e=d._container,f=0;b>f;++f)c>f?d._appendAnimatedItem(a[f]):e.insertBefore(a[f],null);else d._appendItems(a);d._updateResource(g-1),t(d.__resolveFn)&&(d.__resolveFn(),d.__resolveFn=null)}).catch(function(a){J(function(){n(a)&&(a=new Error(a)),d._log.error(a)})})),this.itemsLoaded},b.prototype._appendItems=function(a){V(a,this._container)},b.prototype._appendAnimatedItem=function(a){if(k(a)){var b=this._animationQueue,c={animation:this._animator.enter(a,Nd,this._container).then(function(){var a=b.indexOf(c);-1!==a&&b.splice(a,1)}),op:null};b.push(c)}},b.prototype._removeItems=function(a,b){for(var c=o.dispose,d=this.controls,e=a+b;e-->a;)c(d[e]);this._updateResource(d.length-1)},b.prototype._bindItem=function(a){return this.bindableTemplates.bind("item",a,this._getAliases(a))},b.prototype._setBlockLength=function(a){this._blockLength>0||0===a.length||(this._blockLength=a[0].childNodes.length)},b.prototype._updateResource=function(a){var b=this.controls;0>a||a>=b.length||b[a].resources.add(this._getAliases(a))},b.prototype._setListener=function(){this.__listenerSet||(this.observeArray(this._executeEvent),this.__listenerSet=!0)},b.prototype._executeEvent=function(a){var b="_"+a[0].type;t(this[b])&&this[b](a)},b.prototype._getAliases=function(a){var b=0===(1&a),c={},d=this._aliases,e=Te;return c[d.index]={value:a,type:e},c[d.even]={value:b,type:e},c[d.odd]={value:!b,type:e},c[d.first]={value:0===a,type:e},c[d.last]={value:a===this.context.length-1,type:e},c},b.prototype._push=function(a){var b=a[0],c=this._addQueue,d=b.addedCount,e=this._addItems(b.index,d,this._animate?d:0).then(function(){var a=c.indexOf(e);-1!==a&&c.splice(a,1)});c.push(e)},b.prototype._pop=function(a){var b=this,c=a[0],d=c.object.length;if(0!==c.removed.length){var e=c.object.length;this._itemLength>0&&this._itemLength--,this._Promise.all(this._addQueue).then(function(){return b._animate?void b._animateItems(d,1,Od,"leave",!1).then(function(){b._removeItems(e,1)}):void b._removeItems(e,1)})}},b.prototype._unshift=function(a){var b=a[0],c=b.addedCount,d=this._addQueue;if(this._animate){var e=this._animationQueue,f=e.length;this._animateItems(0,c,Nd,null,f>0&&"clone"===e[f-1].op)}var g=this._addItems(b.object.length-c,c,0).then(function(){var a=d.indexOf(g);-1!==a&&d.splice(a,1)});d.push(g)},b.prototype._shift=function(a){var b=this,c=this._addQueue,d=a[0];if(0!==d.removed.length){this._animate&&0===c.length&&(c=c.concat([this._animateItems(0,1,Od,"clone",!0)]));var e=d.object.length;this._itemLength>0&&this._itemLength--,this._Promise.all(c).then(function(){b._removeItems(e,1)})}},b.prototype._splice=function(a){var b,c=this,d=a[0],e=d.addedCount,f=this._addQueue,g=this._itemLength,h=this._animate;if(u(e)){h&&this._cancelCurrentAnimations();var i=d.object.length,j=g-i;return void(i>g?(b=this._addItems(g,-j,0).then(function(){var a=f.indexOf(b);-1!==a&&f.splice(a,1)}),f.push(b)):g>i&&(g>=j?this._itemLength-=j:this._itemLength=0,this._Promise.all(f).then(function(){c._removeItems(g-j,j)})))}var k=d.removed.length,l=this._animationQueue;if(e>k){var m,n=e-k;if(h){m=e;var o=l.length,p=d.index;e-p>g&&(m=g-p),this._animateItems(p,m,Nd,null,o>0&&"clone"===l[o-1].op),m=e-m}else m=0;b=this._addItems(d.object.length-n,n,m).then(function(){var a=f.indexOf(b);-1!==a&&f.splice(a,1)}),f.push(b)}else if(k>e){var q=e>0;h&&!q&&0===f.length&&(f=f.concat([this._animateItems(d.index,k,Od,"clone",!0)]));var r=k-e;g>=r?this._itemLength-=r:this._itemLength=0,this._Promise.all(f).then(function(){if(h&&q){var a=l.length;c._animateItems(d.index,e,Nd,null,a>0&&"clone"===l[a-1].op)}c._removeItems(g-r,r)})}},b.prototype._calculateBlockLength=function(a,b){return this._blockLength},b.prototype._animateItems=function(a,b,c,d,e){var f=this._calculateBlockLength();if(0===f)return this._Promise.resolve();var g=a*f;switch(d){case"clone":return this._handleClonedContainerAnimation(g,b*f+g,c,e===!0);case"leave":return this._handleLeave(g,b*f+g,c);default:return this._handleSimpleAnimation(g,b*f+g,c,e===!0)}},b.prototype._handleSimpleAnimation=function(a,b,c,d){var e=this._container,f=Array.prototype.slice.call(e.childNodes,a,b);if(0===f.length)return this._Promise.resolve();var g=this._animationQueue,h=this._animator.create(f,c),i=h.current.then(function(){var a=g.indexOf(j);-1!==a&&g.splice(a,1)}),j={animation:i,op:null},k=function(){return h.previous.then(function(){i.start()}),i};if(d&&g.length>0){var l=this._cancelCurrentAnimations().then(k);return g.push(j),l}return g.push(j),k()},b.prototype._handleLeave=function(a,b,c){var d=this._container,e=Array.prototype.slice.call(d.childNodes,a,b);if(0===e.length)return this._Promise.resolve();var f=this._animationQueue,g=this._animator.leave(e,c).then(function(){var a=f.indexOf(h);-1!==a&&f.splice(a,1)}),h={animation:g,op:"leave"};return f.push(h),g},b.prototype._handleClonedContainerAnimation=function(a,b,c,d){var e=this._container,f=e.cloneNode(!0),g=Array.prototype.slice.call(f.childNodes,a,b);if(0===g.length)return this._Promise.resolve();var h,i=this._animationQueue,j=this._animator.create(g,c),k=j.current.then(function(){var a=i.indexOf(l);a>-1&&i.splice(a,1),u(h)||h.replaceChild(e,f)}),l={animation:k,op:"clone"},m=function(){return h=e.parentNode,u(h)||k.isCanceled()?k:(h.replaceChild(f,e),j.previous.then(function(){k.start()}),k)};if(d&&i.length>0){var n=this._cancelCurrentAnimations().then(m);return i.push(l),n}return i.push(l),m()},b.prototype._cancelCurrentAnimations=function(){for(var a=this._animationQueue,b=[],c=a.length,d=0;c>d;++d)b.push(a[d].animation.cancel());return this._Promise.all(b)},b._inject={_animator:ob,_Promise:Oa},b}(o);a.ForEach=f,Ga.control(Lc,f);var g=function(a){function b(){a.apply(this,arguments),this.replaceWith=$c}return __extends(b,a),b.prototype.initialize=function(){var a=this;this.on(Cd,function(){a._removeAllElements()})},b.prototype.setTemplate=function(){var a=_c,b=ad,c=ed,d=cd,e=kd,f=dd,g=bd,h=md,i=od,j=nd,k=pd;this._titleElement=this._createElement(b),this._ogTitleElement=this._createElement(a,i+b),this._twitterTitleElement=this._createElement(a,k+b),this._descriptionElement=this._createElement(a,g),this._ogDescriptionElement=this._createElement(a,i+g),this._twitterDescriptionElement=this._createElement(a,k+g),this._ogUrlElement=this._createElement(a,i+h),this._twitterUrlElement=this._createElement(a,k+h),this._authorElement=this._createElement(a,d),this._googleAuthorElement=this._createElement(c,d),this._fbAuthorElement=this._createElement(a,j+d),this._twitterCreatorElement=this._createElement(a,k+f),this._ogTypeElement=this._createElement(a,i+e)},b.prototype.title=function(a){return n(a)?(this._titleElement.innerText=a,this._setContent([this._ogTitleElement,this._twitterTitleElement],a),a):this._getContent(this._titleElement)},b.prototype.description=function(a){return n(a)?(this._setContent([this._descriptionElement,this._ogDescriptionElement,this._twitterDescriptionElement],a),a):this._getContent(this._descriptionElement)},b.prototype.url=function(a){return n(a)?(this._setContent([this._ogUrlElement,this._twitterUrlElement],a),a):this._getContent(this._ogUrlElement)},b.prototype.author=function(a){return n(a)?(this._setContent([this._authorElement],a),a):this._getContent(this._authorElement)},b.prototype.googleAuthor=function(a){return n(a)?(this._setContent([this._googleAuthorElement],a),a):this._getContent(this._googleAuthorElement)},b.prototype.fbAuthor=function(a){return n(a)?(this._setContent([this._fbAuthorElement],a),a):this._getContent(this._fbAuthorElement)},b.prototype.twitterCreator=function(a){return n(a)?(this._setContent([this._twitterCreatorElement],a),a):this._getContent(this._twitterCreatorElement)},b.prototype.fbType=function(a){return n(a)?(this._setContent([this._ogTypeElement],a),a):this._getContent(this._ogTypeElement)},b.prototype.images=function(a){var b=this;if(w(a)){var c,d,e=_c,f=od,g=pd;B(function(a){c=b._createElement(e,f+id),d=b._createElement(e,g+id),a=b._browser.urlUtils(a).href,b._setContent([c,d],a)},a)}},b.prototype.videos=function(a){var b=this;if(w(a)){var c,d=_c,e=od,f=jd,g=this._browser;B(function(a){c=b._createElement(d,e+f),a=g.urlUtils(a).href,b._setContent([c],a)},a)}},b.prototype.loaded=function(){this.url(this._browser.url())},b.prototype.navigated=function(a){this.url(a)},b.prototype._getContent=function(a){var b=a.nodeName.toLowerCase();return b===ad?a.innerText:b===_c?a.getAttribute(qd):b===ed?a.getAttribute(fd):void 0},b.prototype._setContent=function(a,b){for(var c,d,e=this.element,f=Array.prototype.slice.call(e.children),g=a.length,h=qd,i=fd,j=this._titleElement.nextSibling,k=this.dom,l=0;g>l;++l)d=a[l],c=d.nodeName.toLowerCase(),c===_c?d.setAttribute(h,b):d.setAttribute(i,b),-1===f.indexOf(d)&&k.insertBefore(e,d,j)},b.prototype._createElement=function(a,b){var c,d=n(b),e=!d||0!==b.indexOf(od)&&0!==b.indexOf(nd)?gd:hd,f=this.element;return a===ed&&(e=ld),c=d?f.querySelector(a+"["+e+'="'+b+'"]'):f.querySelector(a),k(c)||(c=this._document.createElement(a)),d&&c.setAttribute(e,b),c},b.prototype._removeAllElements=function(){var a=Array.prototype.slice,b=this._document.head.querySelectorAll("meta["+hd+'^="'+od+'"]'),c=this._document.head.querySelectorAll("meta["+gd+'^="'+pd+'"]');this._removeElements.apply(this,[this._descriptionElement,this._authorElement,this._googleAuthorElement].concat(a.call(b),a.call(c)))},b.prototype._removeElements=function(){for(var a=[],b=0;bg;++g)c=a[g],-1!==e.indexOf(c)&&d.removeChild(c)},b._inject={_document:Sa,_browser:Bb},b}(plat.ui.TemplateControl);a.Head=g;var i=function(a){function b(){a.apply(this,arguments)}return __extends(b,a),b.prototype.setTemplate=function(){this.dom.clearNode(this.element)},b.prototype.loaded=function(){var a=this.options;h(a)&&(this._onOptionsChanged(a.value),a.observe(this._onOptionsChanged))},b.prototype._onOptionsChanged=function(a,b){if(a!==b){if(!h(a))return void this._log.debug("plat-options for "+this.type+" must be an object.");var c=a.html,d=this._html;if(this._html=c,c!==d)return u(c)?void(this.controls.length>0?this._TemplateControlFactory.dispose(this.controls[0]):this.dom.clearNode(this.element)):n(c)?a.compile===!0?(this.controls.length>0?this._TemplateControlFactory.dispose(this.controls[0]):this.dom.clearNode(this.element),void this._generateTemplate(c)):void $(this.element,c):void this._log.debug("Trying to bind a non-string value to "+this.type+".")}},b.prototype._generateTemplate=function(a){var b=this,c=this.bindableTemplates,d="html";c.add(d,a),c.bind(d).then(function(a){b.element.insertBefore(a,null)})},b._inject={_TemplateControlFactory:yb},b}(o);a.InnerHtml=i,Ga.control(Mc,i);var j=function(a){function b(){var b=this;a.call(this),this.replaceWith="select",this.priority=120,this.groups={},this.itemsLoaded=new this._Promise(function(a){b.__resolveFn=a})}return __extends(b,a),b.prototype.setTemplate=function(){this.bindableTemplates.add("option",this.element.childNodes);var a=this.options||{},b=a.value||{},c=b.default;if(h(c)){var d=this._document.createElement("option"),e=c.value,f=c.textContent;d.value=v(e)?f:e,d.textContent=v(f)?e:f,this.element.insertBefore(d,null)}if(u(b.group))this._isGrouped=!1;else{var g=this._group=b.group,i=this._document.createElement("optgroup");i.label=re+g+se,this.bindableTemplates.add("group",i),this._isGrouped=!0}},b.prototype.contextChanged=function(a,b){var c=this;if(q(a))return void(q(b)||this.itemsLoaded.then(function(){c._removeItems(c.controls.length)}));if(!w(a))return void this._log.debug(this.type+" context set to something other than an Array.");var d=w(a)?a.length:0,e=w(b)?b.length:0;this._setListener(),d>e?this._addItems(d-e,e):e>d&&this._removeItems(e-d)},b.prototype.loaded=function(){if(v(this._isGrouped)){var a=this.options||{},b=a.value||{};this._isGrouped=!u(this._group=b.group)}this._defaultOption=this.element.firstElementChild;var c=this.context;return w(c)?(this._addItems(c.length,0),void this._setListener()):void this._log.debug(this.type+" context set to something other than an Array.")},b.prototype.dispose=function(){a.prototype.dispose.call(this),this.__resolveFn=null,this._defaultOption=null},b.prototype.observeProperties=function(a){var b,c=this.element;this._binder=a,c.multiple?(b=this._setSelectedIndices.bind(this),u(a.evaluate())&&this.inputChanged([]),a.observeProperty(function(){b(a.evaluate(),null,null)},null,!0)):b=this._setSelectedIndex.bind(this),a.observeProperty(b),this.addEventListener(c,"change",this._observeChange,!1)},b.prototype._setSelectedIndex=function(a,b,c,d){var e=this,f=this.element,g=f.value;if(u(a))return d!==!0&&this._document.body.contains(f)?void(f.selectedIndex=-1):void this.itemsLoaded.then(function(){u(e._binder.evaluate())&&e.inputChanged(f.value)});if(n(a)){if(g===a)return;if(!this._document.body.contains(f))return f.value=a,void(f.value!==a&&(f.value=g,this.inputChanged(f.value)))}else{var h;s(a)?(a=a.toString(),h="Trying to bind a value of type number to a "+this.type+"'s element. The value will implicitly be converted to type string."):h="Trying to bind a value that is not a string to a "+this.type+"'s element. The element's selected index will be set to -1.",this._log.debug(h)}this.itemsLoaded.then(function(){f.value=a,(f.value!==a||-1===f.selectedIndex)&&(f.selectedIndex=-1)})},b.prototype._setSelectedIndices=function(a,b,c,d){var e,f=this,g=this.element,h=g.options,i=u(h)?0:h.length,j=u(a);this.itemsLoaded.then(function(){if(!j&&w(a))for(var b,c;i-->0;)e=h[i],b=e.value,c=Number(b),-1!==a.indexOf(b)||s(c)&&-1!==a.indexOf(c)?e.selected=!0:e.selected=!1;else for(d===!0&&u(f._binder.evaluate())&&f.inputChanged(f._getSelectedValues());i-->0;){if(e=h[i],!j&&e.value===""+a)return void(e.selected=!0);e.selected=!1}})},b.prototype._observeChange=function(){var a=this.element;this.inputChanged(a.multiple?this._getSelectedValues():a.value)},b.prototype._getSelectedValues=function(){for(var a,b=this.element.options,c=b.length,d=[],e=0;c>e;++e)a=b[e],a.selected&&d.push(a.value);return d},b.prototype._setListener=function(){this.__listenerSet||(this.observeArray(this._executeEvent),this.__listenerSet=!0)},b.prototype._executeEvent=function(a){var b="_"+a[0].type;t(this[b])&&this[b](a)},b.prototype._addItems=function(a,b){for(var c=this,d=this.bindableTemplates,e=[],f=this._insertOption;a-->0;)e.push(d.bind("option",b).then(f.bind(this,b++)));return e.length>0?this.itemsLoaded=this._Promise.all(e).then(function(){t(c.__resolveFn)&&(c.__resolveFn(),c.__resolveFn=null)}):(t(this.__resolveFn)&&(this.__resolveFn(),this.__resolveFn=null),this.itemsLoaded=new this._Promise(function(a){c.__resolveFn=a})),this.itemsLoaded},b.prototype._insertOption=function(a,b){var c=this.element;if(this._isGrouped){var d=this.groups,e=(this.context[a]||{})[this._group],f=d[e];return u(f)?d[e]=this.bindableTemplates.bind("group",a).then(function(a){return f=d[e]=a.childNodes[1],f.insertBefore(b,null),c.insertBefore(a,null),f}):p(f)?f.then(function(a){a.insertBefore(b,null)}):(f.insertBefore(b,null),this._Promise.resolve())}return c.insertBefore(b,null),this._Promise.resolve()},b.prototype._removeItems=function(a){for(var b=o.dispose,c=this.controls;a-->0;)b(c.pop())},b.prototype._removeItem=function(){return this._isGrouped?void this._resetSelect():void this._removeItems(1)},b.prototype._resetSelect=function(){this._removeItems(this.controls.length),this.groups={},u(this._defaultOption)||this.element.insertBefore(this._defaultOption.cloneNode(!0),null),this._addItems(this.context.length,0)},b.prototype._push=function(a){var b=a[0];this._addItems(b.addedCount,b.index)},b.prototype._pop=function(a){var b=this;0!==a[0].removed.length&&this.itemsLoaded.then(function(){b._removeItem()})},b.prototype._unshift=function(a){if(this._isGrouped)return void this._resetSelect();var b=a[0],c=b.addedCount;this._addItems(c,b.object.length-c-1)},b.prototype._shift=function(a){var b=this;0!==a[0].removed.length&&this.itemsLoaded.then(function(){b._removeItem()})},b.prototype._splice=function(a){var b=this;if(this._isGrouped)return void this._resetSelect();var c=a[0],d=c.addedCount,e=c.removed.length;d>e?this._addItems(d-e,c.object.length-d-1):e>d&&this.itemsLoaded.then(function(){b._removeItems(e-d)})},b.prototype._sort=function(a){this._isGrouped&&this._resetSelect()},b.prototype._reverse=function(a){this._isGrouped&&this._resetSelect()},b._inject={_Promise:Oa,_document:Sa},b}(r);a.Select=j,Ga.control(Pc,j);var l=function(a){function c(){a.call(this),this.__condition=!0,this.__firstTime=!0;var b=this._document;this.commentNode=b.createComment(Nc+Ae+"placeholder"),this.fragmentStore=b.createDocumentFragment()}return __extends(c,a),c.prototype.contextChanged=function(){var a=this.options.value;if(!q(a))return this._setter(a)},c.prototype.setTemplate=function(){this.bindableTemplates.add("template",Array.prototype.slice.call(this.element.childNodes))},c.prototype.loaded=function(){u(this.options)&&(this._log.warn("No condition specified in "+cc+" for "+this.type+"."),this.options={value:{condition:!0},observe:b});var a=this.contextChanged();return this.__removeListener=this.options.observe(this._setter),a},c.prototype.dispose=function(){t(this.__removeListener)&&(this.__removeListener(),this.__removeListener=null),this.commentNode=null,this.fragmentStore=null},c.prototype._setter=function(a){var b,c=this,d=!!a.condition;return d!==this.__condition||this.__firstTime?(d?b=u(this.__leaveAnimation)?this._addItem():this.__leaveAnimation.cancel().then(function(){return c.__leaveAnimation=null,c._addItem()}):u(this.__enterAnimation)?(this._removeItem(),b=this._Promise.resolve(null)):b=this.__enterAnimation.cancel().then(function(){return c.__enterAnimation=null,c._removeItem()}),this.__condition=d,b):this._Promise.resolve(null)},c.prototype._addItem=function(){var a=this;return k(this.commentNode.parentNode)||this.__firstTime?this.__firstTime?(this.__firstTime=!1,this.__initialBind=this.bindableTemplates.bind("template").then(function(b){var c=a.element;return a.__initialBind=null,c.parentNode===a.fragmentStore?(c.insertBefore(b,null),a._animateEntrance()):(a.__enterAnimation=a._animator.animate(c,Nd),c.insertBefore(b,null),a.__enterAnimation)}).then(function(){a.__enterAnimation=null}),this.__initialBind):p(this.__initialBind)?this.__initialBind.then(function(){return a._animateEntrance()}):this._animateEntrance():this._Promise.resolve(null)},c.prototype._animateEntrance=function(){var a=this,c=this.commentNode,d=c.parentNode;return k(d)?this.__enterAnimation=this._animator.enter(this.element,Nd,d,c).then(function(){a.__enterAnimation=null}):this._animator.resolve().then(b)},c.prototype._removeItem=function(){var a=this;return p(this.__initialBind)?this.__initialBind.then(function(){return a._animateLeave()}):this._animateLeave()},c.prototype._animateLeave=function(){var a=this,c=this.element,d=c.parentElement,e=c.nextSibling;return k(d)?this.__leaveAnimation=this._animator.leave(c,Od).then(function(){a.__leaveAnimation=null,d.insertBefore(a.commentNode,e),a.fragmentStore.insertBefore(c,null); -}):this._animator.resolve().then(b)},c._inject={_animator:ob,_Promise:Oa,_document:Sa},c}(o);a.If=l,Ga.control(Nc,l);var m=function(a){function b(){a.apply(this,arguments),this.replaceWith="a",this._router=this._Router.currentRouter()}return __extends(b,a),b.prototype.initialize=function(){this._removeClickListener=this.dom.addEventListener(this.element,"click",this._handleClick,!1)},b.prototype.loaded=function(){var a=this.options,b=this.setHref.bind(this);return h(a)?(h(a.value)||(a.value={view:""}),this.addEventListener(this.element,Td,this._handleTap,!1),b(),void a.observe(b)):(this._log.warn("No options specified for "+this.type+". Please send in options of type plat.ui.controls.ILinkOptions."),a=this.options={},a.value={view:""},void this.setHref())},b.prototype.setHref=function(){var a=this.getHref();if(!q(a)){var b=this.element;b.href=a}},b.prototype.getHref=function(){if(!u(this._router)){var a=this.options.value,b=a.view;if(a.isUrl!==!0){var c=a.parameters,d=a.query;if(q(b))return b;b=this._router.generate(b,c,d)}return this._browser.formatUrl(b)}},b.prototype._handleClick=function(a){var b;if(s(a.buttons)&&0!==a.buttons)b=a.buttons;else if(s(a.which)&&a.which>0)b=a.which;else switch(a.button){case-1:b=0;break;case 0:b=1;break;case 1:b=4;break;case 2:b=2;break;case 3:b=8;break;case 4:b=16;break;default:b=1}1===b&&a.preventDefault()},b.prototype._handleTap=function(a){var b=this;if(1===a.buttons){var c=this.getHref();v(c)||(a.preventDefault(),M(function(){b._browser.url(c)}))}},b.prototype.dispose=function(){K(this._removeClickListener,3e3)},b._inject={_Router:Eb,_Injector:Sb,_browser:Bb},b}(o);a.Link=m,Ga.control(Kc,m)}(I=a.controls||(a.controls={}))}(Qf=a.ui||(a.ui={}));var Rf;!function(a){function c(a,b,c,d,e){return i._markupRegex=a.markupRegex,i._newLineRegex=a.newLineRegex,i._ContextManager=b,i._parser=c,i._TemplateControlFactory=d,i._log=e,i}function d(a,b,c,d,e,f){return j._document=a,j._managerCache=b,j._ResourcesFactory=c,j._AttributesFactory=d,j._BindableTemplatesFactory=e,j._log=f,j}function e(){return l}function f(){return m}var g=function(){function a(){}return a.prototype.compile=function(a,b){var c,d,e,f=a.childNodes,g=!u(b),h=g?this._managerCache.read(b.uid):null,i=this._ElementManagerFactory.create;if(f=v(f)?t(a.push)?a:Array.prototype.slice.call(a):Array.prototype.slice.call(f),u(h)){c=f.length;for(var j=0;c>j;++j)e=f[j],e.nodeType===Node.ELEMENT_NODE&&(u(i(e))||this.compile(e)),d=f.length,j+=d-c,c=d}else this._compileNodes(f,h)},a.prototype._compileNodes=function(a,b){for(var c,d,e,f=a.length,g=this._ElementManagerFactory.create,h=this._CommentManagerFactory.create,i=this._TextManagerFactory.create,j=0;f>j;++j){switch(c=a[j],c.nodeType){case Node.ELEMENT_NODE:d=g(c,b),u(d)||this._compileNodes(Array.prototype.slice.call(c.childNodes),d);break;case Node.TEXT_NODE:i(c,b);break;case Node.COMMENT_NODE:h(c,b)}e=a.length,j+=e-f,f=e}},a._inject={_ElementManagerFactory:gb,_TextManagerFactory:jb,_CommentManagerFactory:eb,_managerCache:mb},a}();a.Compiler=g,Ga.injectable(db,g);var i=function(){function a(){this.isClone=!1}return a.hasMarkup=function(b){return a._markupRegex.test(b)},a.findMarkup=function(b){var c,d,e,f,g=[],h=a._wrapExpression,i=a._parser;for(b=b.replace(a._newLineRegex,"");-1!==(c=b.indexOf(re))&&-1!==(d=b.indexOf(se));){for(0!==c&&g.push(h(b.slice(0,c)));"}"===b[++d];);e=b.slice(c+2,d-2),"="===e[0]?(f=i.parse(e.slice(1).trim()),f.oneTime=!0,g.push(f)):g.push(i.parse(e.trim())),b=b.slice(d)}return c>-1&&d>=0?g.push(h(b.slice(d))):""!==b&&g.push(h(b)),g},a.build=function(b,c){for(var d,e,f="",g=b.length,i={},j=a._TemplateControlFactory.evaluateExpression,k=0;g>k;++k)if(d=b[k],e=j(d,c,i),h(e))try{f+=JSON.stringify(e,null,4)}catch(b){u(b.description)||(b.description="Cannot stringify object: "+b.description),b.message="Cannot stringify object: "+b.message,a._log.warn(b)}else u(e)||(f+=e);return f},a.observeExpressions=function(b,c,d){for(var e,f,g,h,i=a.__findUniqueIdentifiers(b),j=i.identifiers,k=i.oneTimeIdentifiers,l={listener:d,uid:c.uid};j.length>0;)f=a.__getObservationDetails(j.pop(),c),g=f.manager,u(g)||g.observe(f.absoluteIdentifier,l);for(;k.length>0;)if(e=k.pop(),f=a.__getObservationDetails(e,c),g=f.manager,!u(g)&&!f.isDefined){h=f.absoluteIdentifier;var m=g.observe(h,l),n=g.observe(h,{uid:c.uid,listener:function(){m(),n()}})}},a._wrapExpression=function(a){return{evaluate:function(){return a},identifiers:[],aliases:[],expression:a}},a.__findUniqueIdentifiers=function(a){var b,c=a.length;if(1===c)return b=a[0],b.oneTime===!0?{identifiers:[],oneTimeIdentifiers:b.identifiers.slice(0)}:{identifiers:b.identifiers.slice(0),oneTimeIdentifiers:[]};for(var d,e,f,g,h,i={},j={},k=[],l=[],m=0;c>m;++m)for(b=a[m],h=b.oneTime,d=b.identifiers,g=d.length,f=0;g>f;++f)if(e=d[f],h){if(i[e]===!0)continue;j[e]||(j[e]=!0,l.push(e))}else i[e]||(i[e]=!0,k.push(e)),j[e]===!0&&(j[e]=!1,l.splice(l.indexOf(e),1));return{identifiers:k,oneTimeIdentifiers:l}},a.__getObservationDetails=function(b,c){var d,e=a._ContextManager,f=b.split("."),g="",h=!1;if("@"===b[0]){var i,j={},k=f.shift(),l=k.slice(1);if(f.length>0&&(g="."+f.join(".")),i=j[l],u(i)&&(i=j[l]=c.findResource(l)),!u(i)&&!u(i.resource)){var m=i.resource.type;l===Xe?(d=e.getManager(Of.getRootControl(c)),g=c.absoluteContextPath+g):l===Ve?(d=e.getManager(j[l].control),g="context"+g):(m===Pe||m===Te)&&(d=e.getManager(j[l].control),g="resources."+l+".value"+g)}}else h=!v(e.getContext(c.context,f)),h||v(e.getContext(c,f))?(d=e.getManager(Of.getRootControl(c)),g=c.absoluteContextPath+"."+b):d=null;return{absoluteIdentifier:g,manager:d,isDefined:h}},a.prototype.initialize=function(a,b){this.nodeMap=a,this.parent=b,u(b)||(this.isClone=b.isClone,b.children.push(this))},a.prototype.getParentControl=function(){for(var a,b=this.parent;u(a)&&!u(b);)a=b.getUiControl(),b=b.parent;return a},a.prototype.clone=function(a,b){return 1},a.prototype.bind=function(){},a}();a.NodeManager=i,a.INodeManagerStatic=c,Ga.injectable(ib,c,[$a,bb,Za,yb,Ya],te);var j=function(a){function b(){a.apply(this,arguments),this.children=[],this.type="element",this.replace=!1,this.hasOwnContext=!1}return __extends(b,a),b.create=function(a,c){var d,e=a.nodeName.toLowerCase(),f=e,g=sf[e]||tf[e],h=!0,i=!1;if(u(g)&&(a.hasAttribute(Sc)?(e=a.getAttribute(Sc).toLowerCase(),g=sf[e]||tf[e],h=!1):a.hasAttribute(Yc+Sc)&&(e=a.getAttribute(Yc+Sc).toLowerCase(),g=sf[e]||tf[e],h=!1)),!u(g)){var j=g.inject(),k=b.locateResources(a);d={control:j,resourceElement:k,nodeName:e,expressions:[],injector:g},i=!0,h&&a.setAttribute(Sc,e);var l=j.replaceWith,m="any"===l&&h;if(!q(l)&&("any"!==l||m)&&l.toLowerCase()!==f){m&&(l="div");var o=b._document.createElement(l);o.nodeType===Node.ELEMENT_NODE&&(a=ba(a,o))}}var p=b._collectAttributes(a.attributes),r=b.getInstance();return p.element=a,!i&&n(p.childContext)?(g=vf[zb],i=!0,p.uiControlNode={control:g.inject(),resourceElement:null,nodeName:Wc,expressions:[],injector:g}):p.uiControlNode=d,r.initialize(p,c),p.hasControl||i?(r.setUiControlTemplate(),i?null:r):(r.bind=function(){return[]},r)},b.locateResources=function(a){for(var b,c,d=Array.prototype.slice.call(a.childNodes);d.length>0;)if(b=d.shift(),c=b.nodeName.toLowerCase(),c===Uc||c==="x-"+Uc)return a.removeChild(b);return null},b.clone=function(a,c,d,e,f){u(f)&&(f=b._cloneNodeMap(a.nodeMap,d,c.getUiControl()||c.getParentControl(),e));var g=b.getInstance(),h=!u(e);return g.nodeMap=f,g.parent=c,u(c)||c.children.push(g),g.replace=a.replace,g.replaceNodeLength=a.replaceNodeLength,g.hasOwnContext=a.hasOwnContext,g.isClone=!0,f.hasControl||h||(g.bind=function(){return[]}),h&&b._managerCache.put(e.uid,g),g},b.cloneUiControl=function(a,c){var d=a.uiControlNode;if(!u(d)&&!u(d.injector)){var e=d.control,f=d.injector.inject(),g=b._ResourcesFactory.getInstance(),h=b._AttributesFactory.getInstance();return f.parent=c,c.controls.push(f),f.controls=[],h.initialize(f,a.attributes),f.attributes=h,g.initialize(f,e.resources),f.resources=g,b._ResourcesFactory.addControlResources(f),u(e.innerTemplate)||(f.innerTemplate=e.innerTemplate.cloneNode(!0)),f.type=e.type,f.bindableTemplates=b._BindableTemplatesFactory.create(f,e.bindableTemplates),f.replaceWith=e.replaceWith,f}},b.createAttributeControls=function(a,c,d,e,f){var g,h=a.nodes,i=f===!0?e:a.element;if(k(i)){if(i.nodeType===Node.DOCUMENT_FRAGMENT_NODE)return f===!0?b._copyAttributeNodes(h):[];g=i.attributes}var j,l,m,o,p,q,r=a.attributes,v=[],w=h.length;for(q=0;w>q;++q)l=h[q],p=l.nodeName,m=l.injector,o=null,u(m)||(o=m.inject(),l.control=o,o.parent=c,o.element=i,j=b._AttributesFactory.getInstance(),j.initialize(o,r),o.attributes=j,o.type=p,n(o.uid)||(o.uid=N(Vb)),o.templateControl=d),f===!0&&(v.push({control:o,expressions:l.expressions,node:g?g.getNamedItem(p)||g.getNamedItem(Yc+p):null,nodeName:p,injector:m}),u(o)||(u(c)||c.controls.push(o),t(o.initialize)&&o.initialize()));if(!f)for(h.sort(function(a,b){var c=a.control,d=b.control;if(u(c))return 1;if(u(d))return-1;var e=s(c.priority)?c.priority:0,f=s(d.priority)?d.priority:0;return f-e}),q=0;w>q;++q)l=h[q],o=l.control,u(o)||(u(c)||c.controls.push(o),t(o.initialize)&&o.initialize());return v},b.getInstance=function(){var a=new b;return a._Promise=na(Oa),a._ContextManager=i._ContextManager,a._compiler=na(db),a._CommentManagerFactory=na(eb),a._ControlFactory=na(Qa),a._TemplateControlFactory=i._TemplateControlFactory,a._BindableTemplatesFactory=b._BindableTemplatesFactory,a._log=b._log,a},b._collectAttributes=function(a){for(var c,d,e,f,g,h,j,k,l=[],m=i.hasMarkup,n=i.findMarkup,o=i._parser,p=!1,q=a.length,r={},s=0;q>s;++s)c=a[s],e=c.value,d=c.name.replace(/^data-/i,"").toLowerCase(),k=sf[d]||tf[d],d===Vc?""!==e&&(f=o.parse(e),1!==f.identifiers.length&&b._log.warn("Incorrect "+Vc+": "+e+", must contain a single identifier."),g=f.identifiers[0]):d!==Sc&&(h=m(e),j=h?n(e):[],p||!h&&u(k)||(p=!0),l.push({control:null,node:c,nodeName:d,expressions:j,injector:k})),r[O(d)]=e;return{element:null,attributes:r,nodes:l,childContext:g,hasControl:p}},b._copyAttributeNodes=function(a){for(var b,c=[],d=a.length,e=0;d>e;++e)b=a[e],c.push({expressions:b.expressions,nodeName:b.nodeName});return c},b._cloneNode=function(a,b,c){return{control:c,injector:a.injector,expressions:a.expressions,node:b,nodeName:a.nodeName}},b._cloneNodeMap=function(a,c,d,e){var f=a.hasControl,g={attributes:a.attributes,childContext:a.childContext,nodes:[],element:c,uiControlNode:u(a.uiControlNode)?null:b._cloneNode(a.uiControlNode,c,e),hasControl:f};return f&&(g.nodes=b.createAttributeControls(a,d,e,c,!0)),g},b.prototype.clone=function(a,c,d){var e,f,g,h,i=this.replace,j=this.children,k=u(d)?null:d.uiControlNode.control,l=!u(k);if(l||(k=b.cloneUiControl(this.nodeMap,c.getUiControl()||c.getParentControl()),l=!u(k)),i){var m=a.parentNode.childNodes,n=Array.prototype,o=n.indexOf.call(m,a);e=n.slice.call(m,o+1,o+this.replaceNodeLength),f=b.clone(this,c,null,k,d),k.elementNodes=e,k.startNode=a,k.endNode=e.pop(),g=j.shift(),h=j.shift(),g.clone(k.startNode,f),h.clone(k.endNode,f),t(k.initialize)&&k.initialize()}else e=Array.prototype.slice.call(a.childNodes),f=b.clone(this,c,a,k,d),d=f.nodeMap,l&&(k.element=a,t(k.initialize)&&k.initialize());for(var p=j.length,q=0,r=0;p>r;++r)q+=j[r].clone(e[q],f);return i?(j.unshift(h),j.unshift(g),q+2):1},b.prototype.initialize=function(c,d,e){a.prototype.initialize.call(this,c,d);var f,g=c.uiControlNode,h=!u(g);h&&(this._populateUiControl(),f=g.control,this.hasOwnContext=f.hasOwnContext),c.hasControl&&b.createAttributeControls(c,this.getParentControl(),f),!e&&h&&t(f.initialize)&&f.initialize()},b.prototype.bind=function(){var a=this,b=this.nodeMap,c=this.getParentControl(),d=b.uiControlNode,e=[];if(!u(d)){var f,g=d.control,i=b.childContext,j=this._ContextManager.getManager,k=u(c)?Ia:c.absoluteContextPath,l=this._TemplateControlFactory,m=!g.hasOwnContext;if(e.push(g),m&&!u(i))if("@"===i[0]){var n=i.split("."),o=n.shift(),p=o.slice(1),q=l.findResource(g,p);if(h(q)){var r=q.resource;i=n.length>0?"."+n.join("."):"",p===Xe?k+=i:p===Ve?k=Ia+i:r.type===Pe||r.type===Te?(k="resources."+p+".value"+i,g.root=q.control):this._log.warn('Only resources of type "observable" can be set as context.')}else this._log.warn("Could not set the context of "+g.type+' with the resource specified as "'+i+'".')}else k+="."+i;h(g.root)||(g.root=this._ControlFactory.getRootControl(g)||g),f=j(g.root);var s=!1;m?(g.context=f.getContext(k.split("."),!1),s=v(g.context)&&!this._BindableTemplatesFactory.isBoundControl(g)):k=Ia,s?this.contextPromise=new this._Promise(function(b,c){var d=f.observe(k,{uid:g.uid,listener:function(c,e){v(c)||(d(),g.context=c,a._beforeLoad(g,k),b())}})}):this._beforeLoad(g,k)}return this._observeControlIdentifiers(b.nodes,c,e,b.element),e},b.prototype.setUiControlTemplate=function(a){var b=this,c=this.nodeMap.uiControlNode;if(!u(c)){var d=c.control;return void(this.templatePromise=this._TemplateControlFactory.determineTemplate(d,a).then(function(a){b.templatePromise=null,b._initializeControl(d,a.cloneNode(!0))},function(a){if(b.templatePromise=null,u(a)){var c=a;b._BindableTemplatesFactory.isBoundControl(d)&&(c=V(d.element.childNodes)),b._initializeControl(d,c)}else J(function(){n(a)&&(a=new Error(a)),b._log.error(a)})}))}u(this.parent)&&this.bindAndLoad()},b.prototype.getUiControl=function(){var a=this.nodeMap.uiControlNode;if(!u(a))return a.control},b.prototype.fulfillTemplate=function(){var a=this;return u(this.templatePromise)?this._fulfillChildTemplates():this.templatePromise.then(function(){return a._fulfillChildTemplates()})},b.prototype.fulfillAndLoad=function(){var a=this;return this.fulfillTemplate().then(function(){return a.bindAndLoad()}).catch(function(b){J(function(){n(b)&&(b=new Error(b)),a._log.error(b)})})},b.prototype.bindAndLoad=function(){var a,b=this,c=this.bind();return a=p(this.contextPromise)?this.contextPromise.then(function(){return b._bindChildren()}):this._bindChildren(),a.then(function(){return b._loadControls(c,b.getUiControl())}).catch(function(a){J(function(){n(a)&&(a=new Error(a)),b._log.error(a)})})},b.prototype.observeRootContext=function(a,b){var c=this;return b=b.bind(this),u(a.context)?new this._Promise(function(d){var e=c._ContextManager.getManager(a).observe(Ia,{listener:function(){e(),b().then(d)},uid:a.uid})}).catch(function(a){J(function(){n(a)&&(a=new Error(a)),c._log.error(a)})}):b()},b.prototype._beforeLoad=function(a,c){var d=this._ContextManager.getManager(a.root),e=this._TemplateControlFactory;a.zCC__plat=d.observe(c,{uid:a.uid,priority:qe,listener:function(b,c){a.context=b}}),e.setAbsoluteContextPath(a,c),e.setContextResources(a),b._ResourcesFactory.bindResources(a.resources)},b.prototype._bindChildren=function(){for(var a,b=this.children,c=b.length,d=[],e=0;c>e;++e)a=b[e],a.hasOwnContext?this.isClone?d.push(a.observeRootContext(a.getUiControl(),a.bindAndLoad)):d.push(a.observeRootContext(a.getUiControl(),a.fulfillAndLoad)):v(a.children)?a.bind():d.push(a.bindAndLoad());return this._Promise.all(d)},b.prototype._loadControls=function(a,b){var c,d,e,f,g=a.length,h=this._ControlFactory.load,i=u(b);if(i)f=0;else{var j=b.priority;e=s(j)?j:100,f=1}for(;g>f;++f)c=a[f],c.templateControl=b,!i&&e>c.priority&&(i=!0,d=h(b)),h(c);return i||(d=h(b)),d},b.prototype._populateUiControl=function(){var a=this.nodeMap,c=this.getParentControl(),d=a.uiControlNode,e=d.control,f=e.uid,g=e.resources,i=a.element,j=Array.prototype.slice.call(i.childNodes),k=b._AttributesFactory.getInstance(),l=this.replace=null===e.replaceWith||""===e.replaceWith;n(f)||(f=e.uid=N(Vb)),b._managerCache.put(f,this),u(c)||e.parent===c||(c.controls.push(e),e.parent=c),t(i.setAttribute)&&i.setAttribute(Jd,""),e.element=i,e.controls=[],k.initialize(e,a.attributes),e.attributes=k,h(g)&&t(g.add)?g.add(d.resourceElement):(g=b._ResourcesFactory.getInstance(),g.initialize(e,d.resourceElement),e.resources=g),b._ResourcesFactory.addControlResources(e),e.type=d.nodeName,e.bindableTemplates=e.bindableTemplates||this._BindableTemplatesFactory.create(e),!(j.length>0)||q(e.templateString)&&q(e.templateUrl)||(e.innerTemplate=V(j)),l&&this._replaceElement(e,a)},b.prototype._replaceElement=function(a,c){var d=c.element,e=d.parentNode,f=b._document,g=a.type,h=a.uid,i=a.startNode=f.createComment(g+" "+h+Ce),j=a.endNode=f.createComment(g+" "+h+De),k=this._CommentManagerFactory.create;k(i,this),k(j,this),e.insertBefore(i,d),e.insertBefore(j,d.nextSibling),a.elementNodes=aa(d),a.element=c.element=null},b.prototype._initializeControl=function(a,c){var d,e=this.nodeMap.element,f=this.replace;if(!u(c)){var g=b.locateResources(c);u(g)||a.resources.add(b._ResourcesFactory.parseElement(g)),f?(d=a.endNode,a.elementNodes=Array.prototype.slice.call(c.childNodes),_(d.parentNode,c,d)):_(e,c,e.lastChild)}if(t(a.setTemplate)&&a.setTemplate(),f){this._compiler.compile(a.elementNodes,a);var h=a.startNode,i=h.parentNode,j=Array.prototype.slice.call(i.childNodes);d=a.endNode,a.elementNodes=j.slice(j.indexOf(h)+1,j.indexOf(d)),this.replaceNodeLength=a.elementNodes.length+2}else this._compiler.compile(e,a);u(a.parent)&&this.fulfillAndLoad()},b.prototype._observeControlIdentifiers=function(a,b,c,d){for(var e,f,g,h=a.length,j=!u(b),k=0,l=this.replace,m=[];h>k;++k)e=a[k],f=e.control,j&&e.expressions.length>0&&(g=o.getInstance(),m.push(g),g.initialize(d,e,b,c,l),i.observeExpressions(e.expressions,b,g.attributeChanged.bind(g))),u(f)||c.push(f);for(h=m.length,k=0;h>k;++k)m[k].attributeChanged()},b.prototype._fulfillChildTemplates=function(){for(var a,b=this,c=this.children,d=c.length,e=[],f=0;d>f;++f)a=c[f],v(a.children)||e.push(a.fulfillTemplate());return this._Promise.all(e).catch(function(a){J(function(){n(a)&&(a=new Error(a)),b._log.error(a)})})},b._inject={_Promise:Oa,_ContextManager:bb,_compiler:db,_CommentManagerFactory:eb,_ControlFactory:Qa,_TemplateControlFactory:yb,_BindableTemplatesFactory:rb,_log:Ya},b}(i);a.ElementManager=j,a.IElementManagerFactory=d,Ga.injectable(gb,d,[Sa,mb,wb,pb,rb,Ya],we),Ga.injectable(hb,j,null,ve);var l=function(a){function c(){a.apply(this,arguments),this.type="text"}return __extends(c,a),c.create=function(a,d){var e=a.nodeValue,f=new c;if(i.hasMarkup(e)){var g=i.findMarkup(e),h={nodes:[{node:a,expressions:g}]};return f.initialize(h,d),f}return f.initialize(null,d),f.bind=b,f},c._cloneNodeMap=function(a,b){var c=a.nodes[0],d={nodes:[{expressions:c.expressions,nodeName:c.nodeName,node:b}]};return d},c._clone=function(a,d,e){var f=a.nodeMap,g=new c;return u(f)?(g.initialize(null,e),g.bind=b):g.initialize(c._cloneNodeMap(f,d),e),g},c.prototype.clone=function(a,b){return c._clone(this,a,b),1},c.prototype.bind=function(){var a=this.getParentControl(),b=this.nodeMap.nodes[0],c=b.node,d=b.expressions;i.observeExpressions(b.expressions,a,this._setText.bind(this,c,a,d)),this._setText(c,a,d)},c.prototype._setText=function(a,b,c){a.nodeValue=i.build(c,b||{})},c}(i);a.TextManager=l,a.ITextManagerFactory=e,Ga.injectable(jb,e,null,we),Ga.injectable(kb,l,null,ve);var m=function(a){function b(){a.apply(this,arguments),this.type="comment"}return __extends(b,a),b.create=function(a,c){var d=new b;return d.initialize({nodes:[{node:a}]},c),d},b.prototype.clone=function(a,c){return b.create(a,c),1},b}(i);a.CommentManager=m,a.ICommentManagerFactory=f,Ga.injectable(eb,f,null,we),Ga.injectable(fb,m,null,ve);var o=function(){function a(){this._lastValues={}}return a.getInstance=function(){var b=new a;return b._NodeManager=na(ib),b._markupRegex=na($a).markupRegex,b},a.prototype.initialize=function(a,b,c,d,e){this.element=a,this.node=b,this.parent=c,this._controls=d,this.replace=e,"class"!==b.nodeName?this.attributeChanged=this._staticAttributeChanged:(this.attributeChanged=this._dynamicAttributeChanged,this._bindingExpressions=this._getBindingExpressions(b.expressions))},a.prototype._getBindingExpressions=function(a){return z(function(a){return a.identifiers.length>0||a.aliases.length>0||""===a.expression.trim()},a)},a.prototype._dynamicAttributeChanged=function(){var a,b,c,d=this.node,e=d.node,f=this._NodeManager.build(this._bindingExpressions,this.parent),g=f.split(/\s/),h=this._lastValues,i=this.element;for(this._NodeManager.hasMarkup(e.value)&&(e.value=e.value.replace(this._markupRegex,"")),b=g.length,c=0;b>c;++c)h[g[c]]=!0;for(g=Object.keys(h),b=g.length,c=0;b>c;++c)a=g[c],h[a]?(ha(i,a),h[a]=!1):(Q(h,a),ia(i,a));f=e.value,this._notifyAttributes(d.nodeName,f)},a.prototype._staticAttributeChanged=function(){var a=(this._controls,this.node),b=O(a.nodeName),c=this._NodeManager.build(a.expressions,this.parent);this._notifyAttributes(b,c),this.replace||(a.node.value=c)},a.prototype._notifyAttributes=function(a,b){for(var c,d,e=this._controls,f=e.length,g=0;f>g;++g)c=e[g].attributes,d=c[a],c[a]=b,c._attributeChanged(a,b,d)},a}();a.AttributeManager=o}(Rf=a.processing||(a.processing={}));var Sf;!function(a){function c(a){return a.history}function d(a){return r._regex=a,r}function e(){return C}function g(){return I}var i=function(){function a(){this.uid=N(Vb),this.isRoot=!1,this._removeUrlListener=b,this._ignoreOnce=!1,this._backNavigate=!1}return a.prototype.initialize=function(b){this._router=b,h(b)&&b.isRoot&&!h(a._root)&&(this.isRoot=!0,a._root=this,this._observeUrl())},a.prototype.navigate=function(a,b){var c=this;b=h(b)?b:{};var d;return this.finishNavigating().then(function(){if(d=b.isUrl?a:c._generate(a,b.parameters,b.query),!n(d)){var e=new Error("Cannot serialize url from input parameters, check your view reference.");c._log.error(e)}return c._navigate(d,b.replace)})},a.prototype.finishNavigating=function(){var c=a._root._router;return c.navigating?c.finishNavigating.catch(b):this._Promise.resolve()},a.prototype.goBack=function(b){var c=this;b=h(b)?b:{};var d=Number(b.length);return s(d)||(d=1),this.isRoot?(this._backNavigate=!0,this.finishNavigating().then(function(){return c._goBack(d)})):a._root.goBack(b)},a.prototype.dispose=function(){this._removeUrlListener(),Q(this,"router")},a.prototype._navigate=function(b,c){var d=this;return this.isRoot?new this._Promise(function(a,e){d._resolveNavigate=a,d._rejectNavigate=e,d._browser.url(b,c)}):a._root._navigate(b,c)},a.prototype._goBack=function(a){var b=this;return new this._Promise(function(c,d){b._resolveNavigate=c,b._rejectNavigate=d,b._browser.back(a)})},a.prototype._observeUrl=function(){var a=this;if(h(this._router)){var b,c,d=this._EventManager,e=na($c),f=h(e)&&t(e.navigated),g=function(d){a._ignoreOnce=!0,a._previousUrl=b,a._browser.url(b,!c),a._history.go(-1),t(a._rejectNavigate)&&a._rejectNavigate(d),q(d)||a._log.warn(d)};this._previousUrl=this._browser.url(),d.dispose(this.uid),d.on(this.uid,Gd,function(){var b=d.dispatch(Id,a,d.DIRECT);b.defaultPrevented||a.goBack()}),d.on(this.uid,Dd,function(h,i){return a._ignoreOnce?(a._ignoreOnce=!1,void(t(a._resolveNavigate)&&a._resolveNavigate())):(c=a._backNavigate,a._backNavigate=!1,b=a._previousUrl,h=d.dispatch(Ad,a,d.DIRECT,[i]),h.defaultPrevented?void g(new Error("Navigation prevented during "+Ad+" event")):void a.finishNavigating().then(function(){return d.dispatch(Cd,a,d.DIRECT,[i]),a._router.navigate(i.pathname,i.query)}).then(function(){a._previousUrl=i.pathname,t(a._resolveNavigate)&&a._resolveNavigate(),f&&e.navigated(i.href),d.dispatch(Bd,a,d.DIRECT,[i])},g))})}},a.prototype._generate=function(a,b,c){return u(this._router)?void 0:q(a)?a:this._router.generate(a,b,c)},a._inject={_Promise:Oa,_Injector:Sb,_browserConfig:Cb,_browser:Bb,_EventManager:Va,_window:Gb,_log:Ya,_history:Tb},a}();a.Navigator=i,Ga.injectable(ab,i,null,ve),a.History=c,Ga.injectable(Tb,c,[Gb]);var j,k=["/",".","*","+","?","|","(",")","[","]","{","}","\\"],l=new RegExp("(\\"+k.join("|\\")+")","g"),m={},o={},p={},r=function(){function a(){this.type=le,this.name="",this.regex=""}return a.parse=function(b,c,d){if(!(n(b)&&w(c)&&h(d)))return[];"/"===b[0]&&(b=b.slice(1));for(var e,f,g,i=b.split("/"),k=i.length,l=a.__findSegment,q=[],r=a._regex,s=0;k>s;++s)e=i[s],""===e?(h(j)||(j=na(Kb)),q.push(j)):(g=e.match(r.dynamicSegmentsRegex))?(f=g[1],q.push(l(f,Nb,m)),c.push(f),d.dynamics++):(g=e.match(r.splatSegmentRegex))?(f=g[1],q.push(l(f,Ob,o)),c.push(f),d.splats++):(q.push(l(e,Lb,p)),d.statics++);return q},a.__findSegment=function(a,b,c){var d=c[a];return h(d)||(d=c[a]=na(b),d.initialize(a)),d},a.prototype.initialize=function(a){this.name=a},a.prototype.reduceCharacters=function(a,b){return h(this._specification)&&(b=a(b,this._specification)),b},a.prototype.generate=function(a){return this.name},a}();a.BaseSegment=r,a.IBaseSegmentFactory=d,plat.register.injectable(Jb,d,[$a],we),plat.register.injectable(Kb,r,null,ve);var x=function(a){function b(){a.apply(this,arguments),this.type=ne}return __extends(b,a),b.prototype.initialize=function(b){a.prototype.initialize.call(this,b),this.regex=this.name.replace(l,"\\$1")},b.prototype.reduceCharacters=function(a,b){for(var c=this.name,d=c.length,e=b,f=0;d>f;++f)e=a(e,{validCharacters:c[f]});return e},b}(r);a.StaticSegment=x,plat.register.injectable(Lb,x,null,ve);var y=function(a){function b(){a.apply(this,arguments),this.type=me}return __extends(b,a),b.prototype.generate=function(a){return h(a)?a[this.name]:void 0},b}(r);a.VariableSegment=y,plat.register.injectable(Mb,y,null,ve);var z=function(a){function b(){a.apply(this,arguments),this.type=oe,this.regex="(.+)",this._specification={invalidCharacters:"",repeat:!0}}return __extends(b,a),b}(y);a.SplatSegment=z,plat.register.injectable(Ob,z,null,ve);var A=function(a){function b(){a.apply(this,arguments),this.type=pe,this.regex="([^/]+)",this._specification={invalidCharacters:"/",repeat:!0}}return __extends(b,a),b}(y);a.DynamicSegment=A,plat.register.injectable(Nb,A,null,ve);var C=function(){function a(){this.initialize()}return a.compile=function(a,b){return a.reduceCharacters(function(a,b){return a.add(b)},b)},a.link=function(a,b){for(var c,d,e,f,g,h=a.delegates,i=a.regex,j=h.length,k=b.match(i),l=1,m=[],n=0;j>n;++n){for(g=h[n],c=g.names,d={},e=0,f=c.length;f>e;++e)d[c[e]]=k[l++];m.push({delegate:g.delegate,parameters:d,isDynamic:f>0})}return m},a.recognize=function(a,b){for(var c,d=[],e=b.length,f=0;e>f;++f)c=b[f],d=d.concat(c.match(a));return d},a.sort=function(a){if(!w(a))return a;var b,c,d,e,f,g,h,i;return a.sort(function(a,j){if(b=a.types,f=j.types,c=b.splats,g=f.splats,c!==g)return c-g;if(d=b.statics,e=b.dynamics,h=f.statics,i=f.dynamics,c>0){if(d!==h)return h-d;if(e!==i)return i-e}return e!==i?e-i:d!==h?h=d:0})},a.prototype.initialize=function(a){this.specification=a,this.nextStates=[]},a.prototype.add=function(b){var c=this._find(b);return h(c)?c:(c=na(a),c.initialize(b),this.nextStates.push(c),b.repeat&&c.nextStates.push(c),c)},a.prototype.match=function(a){var b,c,d=[];return this._someChildren(function(e){return b=e.specification,c=b.validCharacters,n(c)&&c.indexOf(a)>-1?void d.push(e):(c=b.invalidCharacters,void(n(c)&&-1===c.indexOf(a)&&d.push(e)))}),d},a.prototype._find=function(a){var b,c,d=a.validCharacters,e=a.invalidCharacters;return this._someChildren(function(a){return b=a.specification,b.validCharacters===d&&b.invalidCharacters===e?(c=a,!0):void 0}),c},a.prototype._someChildren=function(a){for(var b=this.nextStates,c=b.length,d=0;c>d;++d)if(a(b[d])===!0)return!0;return!1},a}();a.State=C,a.IStateStatic=e,plat.register.injectable(Pb,e,null,te),plat.register.injectable(Qb,C,null,ve);var E=function(){function a(){this._namedRoutes={}}return a.prototype.register=function(a,b){if(w(a)){for(var c,d=this._rootState,e=a.length,f=["^"],g={statics:0,dynamics:0,splats:0},i=[],j=[],k=0;e>k;++k)c=this._parse(a[k],i,g),j=j.concat(c),d=this._compile(c,d,f);d=this._finalize(d,f),d.delegates=i,d.regex=new RegExp(f.join("")+"$"),d.types=g,h(b)&&n(b.name)&&(this._namedRoutes[this._toLowerCase(b.name)]={segments:j,delegates:i})}},a.prototype.recognize=function(a){var b=!1,c=[];return a=this._addLeadingSlash(a),b=this._hasTrailingSlash(a),b&&(a=a.substr(0,a.length-1)),c=this._filter(this._findStates(a)),this._link(c[0],a,b)},a.prototype.generate=function(a,b){a=this._toLowerCase(a);var c,d,e=this._namedRoutes[a],f="";if(h(e)){c=e.segments,d=c.length;for(var g=0;d>g;g++){var i=c[g];i.type!==le&&(f+="/",f+=i.generate(b))}return f=this._addLeadingSlash(f)}},a.prototype.delegatesFor=function(a){a=this._toLowerCase(a);var b,c=this._namedRoutes[a];return h(c)?(b=c.delegates,w(b)?b.slice(0):[]):[]},a.prototype.exists=function(a){return h(this._namedRoutes[this._toLowerCase(a)])},a.prototype._toLowerCase=function(a){return n(a)?a.toLowerCase():a},a.prototype._finalize=function(a,b){return a===this._rootState&&(a=a.add({validCharacters:"/"}),b.push("/")),a},a.prototype._parse=function(a,b,c){var d=[];return b.push({delegate:a.delegate,names:d}),this._BaseSegmentFactory.parse(a.pattern,d,c)},a.prototype._compile=function(a,b,c){for(var d,e=a.length,f=this._State.compile,g=0;e>g;++g)d=a[g],d.type!==le&&(b=b.add({validCharacters:"/"}),b=f(d,b),c.push("/"+d.regex));return b},a.prototype._addLeadingSlash=function(a){return a=decodeURI(a),"/"!==a[0]&&(a="/"+a),a},a.prototype._hasTrailingSlash=function(a){var b=a.length;return b>1&&"/"===a[b-1]},a.prototype._findStates=function(a){for(var b=[this._rootState],c=this._State.recognize,d=a.length,e=0;d>e&&(b=c(a[e],b),0!==b.length);++e);return b},a.prototype._filter=function(a){for(var b,c=a.length,d=[],e=0;c>e;++e)b=a[e],w(b.delegates)&&d.push(b);return this._State.sort(d)},a.prototype._link=function(a,b,c){return h(a)&&w(a.delegates)?(c&&this._isDynamic(a)&&(b+="/"),this._State.link(a,b)):void 0},a.prototype._isDynamic=function(a){return"(.+)$"===a.regex.source.slice(-5)},a._inject={_BaseSegmentFactory:Jb,_State:Pb,_rootState:Qb},a}();a.RouteRecognizer=E,plat.register.injectable(Rb,E,null,ve);var G="/*childRoute",H=G.length,I=function(){function a(){this.navigating=!1,this.children=[],this.isRoot=!1,this._paramTransforms={},this._queryTransforms={},this._interceptors={},this._ports=[],this._resolve=this._Promise.resolve.bind(this._Promise),this._reject=this._Promise.reject.bind(this._Promise),this.uid=N(Vb),this.isRoot=u(a.currentRouter()),a.currentRouter(this),this.initialize()}return a.currentRouter=function(b){return u(b)||(a.__currentRouter=b),a.__currentRouter},a.prototype.initialize=function(a){this.parent=a},a.prototype.addChild=function(a){return u(a)||this.children.indexOf(a)>-1?a:(a.initialize(this),this.children.push(a),a)},a.prototype.removeChild=function(a){var b=this.children,c=this.children.indexOf(a);0>c||b.splice(c,1)},a.prototype.register=function(a){var c=this,d=this._ports;return u(a)||d.indexOf(a)>-1?this._resolve():(d.push(a),h(this.currentRouteInfo)?(this.navigating=!0,this._resolve(this.finishNavigating).catch(b).then(function(){var a=f(c.currentRouteInfo,!0);return c.finishNavigating=c._canNavigateTo(a).then(function(b){return b?(c.currentRouteInfo=void 0,c._performNavigation(a)):void 0}).then(function(){c.navigating=!1,c.currentRouteInfo=a},function(){c.navigating=!1})})):this._resolve())},a.prototype.unregister=function(a){var b=this._ports,c=b.indexOf(a);0>c||(b.splice(c,1),0!==b.length||u(this.parent)||this.parent.removeChild(this))},a.prototype.configure=function(a){var b=this;return w(a)?B(function(a){b._configureRoute(a)},a):this._configureRoute(a),this._forceNavigate()},a.prototype.unknown=function(a){return this._unknownHandler=a,this},a.prototype.param=function(a,b,c){return this._addHandler(a,b,c,this._paramTransforms)},a.prototype.queryParam=function(a,b,c){return this._addHandler(a,b,c,this._queryTransforms)},a.prototype.intercept=function(a,b){v(b)&&(b="*");var c=b;"*"!==b&&(b=this._Injector.convertDependency(b)),b===Je&&(b=c);var d=this._interceptors[b];return w(d)||(d=this._interceptors[b]=[]),d.push(a),this},a.prototype.navigate=function(a,b,c){var d=this;h(b)||(b={});var e=this._resolve,g=T(b);if("/"===a&&(a=""),c=c===!0,!n(a)||this.navigating||!c&&a===this._previousUrl&&g===this._previousQuery)return this.navigating?this.finishNavigating.then(function(){return d.navigate(a,b,c)}):e();var i,j,k,l=this._recognizer.recognize(a); -if(q(l)){if(l=this._childRecognizer.recognize(a),q(l)){if(this._previousUrl=a,this._previousQuery=g,t(this._unknownHandler)){var m={segment:a,view:void 0};return e(this._unknownHandler(m)).then(function(){var b=m.view;if(!v(b))return d.configure({pattern:a,view:b})})}return e()}if(i=l[0],i.query=b,j=i.delegate.pattern,j=j.substr(0,j.length-H),this._previousPattern===j)return this.navigating=!0,this.finishNavigating=this._navigateChildren(i).then(function(){d._previousUrl=a,d._previousQuery=g,d.navigating=!1},function(a){throw d.navigating=!1,a})}else i=l[0],i.query=b,j=i.delegate.pattern;k=this._recognizer.generate(i.delegate.view,i.parameters);var o=this._previousSegment;this._previousSegment=k,this.navigating=!0;var p=this._nextRouteInfo=f(i,!0);return this.finishNavigating=this._canNavigate(i).then(function(b){if(!b)throw d.navigating=!1,new Error("Not cleared to navigate");return d._previousUrl=a,d._previousQuery=g,d._performNavigation(i)}).then(function(){d._previousPattern=j,d._previousSegment=k,d.currentRouteInfo=p,d.navigating=!1},function(a){throw d._previousSegment=o,d.navigating=!1,a})},a.prototype.generate=function(a,b,c){var d=a;a=this._Injector.convertDependency(a),a===Je&&(a=d);for(var e=this,f="";!u(e)&&!e._recognizer.exists(a);)e=e.parent;if(u(e))throw new Error("Route for "+a+" does not exist.");for(var g,h=e._recognizer.generate(a,b);!u(e=e.parent);)g=e._previousSegment,g=u(g)||"/"===g?"":g,f=g+f;return f+h+T(c)},a.prototype._configureRoute=function(a){var b=this._Injector.convertDependency(a.view),c=a.alias||b;if(b!==Je){a.view=b,a.alias=c||b;var d={pattern:a.pattern,delegate:a},e=a.pattern+G,f={pattern:e,delegate:{pattern:e,view:b,alias:c}};this._recognizer.register([d],{name:c}),this._childRecognizer.register([f])}},a.prototype._addHandler=function(a,b,c,d){v(c)&&(c="*");var e=c;if("*"!==c&&(c=this._Injector.convertDependency(c)),c===Je&&(c=e),q(c)||q(b))return this;var f=d[c];h(f)||(f=d[c]={});var g=f[b];return w(g)||(g=f[b]=[]),g.push(a),this},a.prototype._forceNavigate=function(){var a,b=this,c=this._resolve;if(this.navigating)return this.finishNavigating.then(function(){return b._forceNavigate()});if(this.isRoot&&q(this._previousUrl)){var d=this._browser.urlUtils();this._previousUrl=d.pathname,a=d.query}return q(this._previousQuery)||(a=S(this._previousQuery)),q(this._previousUrl)?c():this.navigate(this._previousUrl,a,!0)},a.prototype._navigateChildren=function(a){var c=this._getChildRoute(a);return u(c)?this._resolve():D(function(b){return b.navigate(c,a.query)},this.children).then(b)},a.prototype._getChildRoute=function(a){if(!u(a)){var b=a.parameters.childRoute;return n(b)||(b=""),"/"+b}},a.prototype._performNavigation=function(a){var b=this,c=this._isSameRoute(this._nextRouteInfo);return this._performNavigateFrom(c).then(function(){return c?void 0:D(function(b){return b.navigateTo(a)},b._ports)}).then(function(){return b._navigateChildren(a)})},a.prototype._performNavigateFrom=function(a){var c=this;return D(function(a){return a._performNavigateFrom()},this.children).then(function(){return a?void 0:D(function(a){return a.navigateFrom()},c._ports)}).then(b)},a.prototype._canNavigate=function(a){var b=this,c=this._isSameRoute(this._nextRouteInfo);return this._canNavigateFrom(c).then(function(d){return d&&b._canNavigateTo(a,c)})},a.prototype._canNavigateFrom=function(a){var b=this;return this._Promise.all(this.children.reduce(function(a,b){return a.concat(b._canNavigateFrom())},[])).then(U).then(function(c){return!c||a?[c]:D(function(a){return a.canNavigateFrom()},b._ports)}).then(U)},a.prototype._canNavigateTo=function(a,b){var c=this;return q(this._ports)?this._resolve(!0):this._callAllHandlers(a.delegate.alias,a.parameters,a.query).then(function(){return c._callInterceptors(a)}).then(function(d){return d===!1||b?[d]:D(function(b){return b.canNavigateTo(a)},c._ports)}).then(U)},a.prototype._callAllHandlers=function(a,c,d){var e=this;return this._callHandlers(this._queryTransforms["*"],d).then(function(){return e._callHandlers(e._queryTransforms[a],d)}).then(function(){return e._callHandlers(e._paramTransforms["*"],c,d)}).then(function(){return e._callHandlers(e._paramTransforms[a],c,d)}).then(b)},a.prototype._callHandlers=function(a,c,d){var e=this._resolve;return h(c)||(c={}),D(function(a,b){return F(function(a){return e(a(c[b],c,d))},a)},a).then(b)},a.prototype._callInterceptors=function(a){var b=this,c=this._resolve;return F(function(b){return c(b(a))},this._interceptors["*"]).then(U).then(function(d){return d?D(function(b){return c(b(a))},b._interceptors[a.delegate.alias]):[d]}).then(U)},a.prototype._isSameRoute=function(a){var b=this.currentRouteInfo;if(!h(b)||!h(a))return!1;var c=b.delegate,d=a.delegate,e=T(b.parameters),f=T(a.parameters),g=T(b.query),i=T(a.query);return c.view===d.view&&c.alias===d.alias&&c.pattern===d.pattern&&e===f&&g===i},a.prototype._clearInfo=function(){this._previousSegment=void 0,this._previousPattern=void 0,this._previousUrl=void 0,this._previousQuery=void 0,this.currentRouteInfo=void 0,this.navigating=!1,B(function(a){a._clearInfo()},this.children)},a._inject={_Promise:Oa,_Injector:Sb,_EventManager:Va,_browser:Bb,_browserConfig:Cb,_recognizer:Rb,_childRecognizer:Rb},a}();a.Router=I,plat.register.injectable(Db,I,null,ve),a.IRouterStatic=g,plat.register.injectable(Eb,g)}(Sf=a.routing||(a.routing={}));var Tf;!function(a){var c=function(a){function b(){a.apply(this,arguments)}return __extends(b,a),b.prototype.initialize=function(){var a=O(this.type),b=this.attributes[a];q(b)||this._isPrecompiled()||(this._label=b,this._define(b))},b.prototype.dispose=function(){for(var a=this._label,b=this.parent;!v(a)&&h(b);)h(b[a])&&k(b[a].element)&&b[a].element===this.element&&Q(b,a),b=b.parent},b.prototype._define=function(a){var b=this.templateControl;u(b)||(b.name=a);for(var c=this.parent,d={element:this.element,control:b};h(c);){var e=c[a];h(e)||(c[a]=d),c=c.parent}},b.prototype._isPrecompiled=function(){for(var a=this.parent;!u(a);){if(-1!==a.type.indexOf(ze))return!0;a=a.parent}return!1},b}(Pf);a.Name=c,Ga.control(bc,c);var d=function(a){function c(){a.apply(this,arguments),this._expression=[],this._aliases=[]}return __extends(c,a),c.prototype.loaded=function(){u(this.element)||(this.attribute=O(this.type),this._setListener())},c.prototype._setListener=function(){var a=this.attributes[this.attribute];q(this.event)||q(a)||(this._parseArgs(a),this._addEventListeners())},c.prototype._addEventListeners=function(){this.addEventListener(this.element,this.event,this._onEvent,!1)},c.prototype._buildExpression=function(){var a,c,d,e,f,g=this._expression.slice(0),h=this._parser,i=this.parent,j=g.shift();if(u(i)||(e=i.getResources(this._aliases),f=i.context),"@"!==j[0]){if(a=this.findProperty(j),u(a))return this._log.warn("Could not find property "+j+" on any parent control."),{fn:b,context:{},args:[]};var k=a.expresssion,l=k.identifiers;if(l.length>1)return this._log.warn("Cannot have more than one identifier in a "+this.type+"'s expression."),{fn:b,context:{},args:[]};var m=l[0],n=m.split(".");n.pop(),c=0===n.length?a.control:h.parse(n.join(".")).evaluate(a.control),d=a.value}else d=u(e)?b:e[j]||b,c=void 0;for(var o=g.length,p=[],q=0;o>q;++q)p.push(h.parse(g[q]).evaluate(f,e));return{fn:d,context:c,args:p}},c.prototype._onEvent=function(a){var b=this._buildExpression(),c=b.fn;return t(c)?void c.apply(b.context,b.args.concat(a)):void this._log.warn("Cannot find registered event method "+this._expression[0]+" for control: "+this.type)},c.prototype._findAliases=function(a){for(var b,c=a.length,d={},e=[],f=[],g=this._parser;c-->0;)b=a[c].trim(),f=f.concat(g.parse(b).aliases);for(;f.length>0;)b=f.pop(),d[b]||(e.push(b),d[b]=!0);return e},c.prototype._parseArgs=function(a){if(!q(a)){var b=this._regex.argumentRegex.exec(a);u(b)?this._expression.push(a):this._expression=[a.slice(0,b.index)].concat(""!==b[1]?b[1].split(","):[]),this._aliases=this._findAliases(this._expression)}},c._inject={_parser:Za,_regex:$a},c}(Pf);a.SimpleEventControl=d;var e=function(a){function b(){a.apply(this,arguments),this.event=Td}return __extends(b,a),b}(d);a.Tap=e;var f=function(a){function b(){a.apply(this,arguments),this.event="blur"}return __extends(b,a),b}(d);a.Blur=f;var g=function(a){function b(){a.apply(this,arguments),this.event="change"}return __extends(b,a),b}(d);a.Change=g;var i=function(a){function b(){a.apply(this,arguments),this.event="copy"}return __extends(b,a),b}(d);a.Copy=i;var j=function(a){function b(){a.apply(this,arguments),this.event="cut"}return __extends(b,a),b}(d);a.Cut=j;var l=function(a){function b(){a.apply(this,arguments),this.event="paste"}return __extends(b,a),b}(d);a.Paste=l;var m=function(a){function b(){a.apply(this,arguments),this.event=Ud}return __extends(b,a),b}(d);a.DblTap=m;var o=function(a){function b(){a.apply(this,arguments),this.event="focus"}return __extends(b,a),b}(d);a.Focus=o;var p=function(a){function b(){a.apply(this,arguments),this.event=Vd}return __extends(b,a),b}(d);a.TouchStart=p;var x=function(a){function b(){a.apply(this,arguments),this.event=Wd}return __extends(b,a),b}(d);a.TouchEnd=x;var y=function(a){function b(){a.apply(this,arguments),this.event=Xd}return __extends(b,a),b}(d);a.TouchMove=y;var z=function(a){function b(){a.apply(this,arguments),this.event=Yd}return __extends(b,a),b}(d);a.TouchCancel=z;var A=function(a){function b(){a.apply(this,arguments),this.event=Zd}return __extends(b,a),b}(d);a.Hold=A;var B=function(a){function b(){a.apply(this,arguments),this.event=$d}return __extends(b,a),b}(d);a.Release=B;var C=function(a){function b(){a.apply(this,arguments),this.event=_d}return __extends(b,a),b}(d);a.Swipe=C;var D=function(a){function b(){a.apply(this,arguments),this.event=ae}return __extends(b,a),b}(d);a.SwipeLeft=D;var E=function(a){function b(){a.apply(this,arguments),this.event=be}return __extends(b,a),b}(d);a.SwipeRight=E;var F=function(a){function b(){a.apply(this,arguments),this.event=ce}return __extends(b,a),b}(d);a.SwipeUp=F;var G=function(a){function b(){a.apply(this,arguments),this.event=de}return __extends(b,a),b}(d);a.SwipeDown=G;var H=function(a){function b(){a.apply(this,arguments),this.event=ee}return __extends(b,a),b}(d);a.Track=H;var I=function(a){function b(){a.apply(this,arguments),this.event=fe}return __extends(b,a),b}(d);a.TrackLeft=I;var K=function(a){function b(){a.apply(this,arguments),this.event=ge}return __extends(b,a),b}(d);a.TrackRight=K;var L=function(a){function b(){a.apply(this,arguments),this.event=he}return __extends(b,a),b}(d);a.TrackUp=L;var N=function(a){function b(){a.apply(this,arguments),this.event=ie}return __extends(b,a),b}(d);a.TrackDown=N;var P=function(a){function b(){a.apply(this,arguments),this.event=je}return __extends(b,a),b}(d);a.TrackEnd=P;var R=function(a){function b(){a.apply(this,arguments),this.event="submit"}return __extends(b,a),b.prototype._onEvent=function(b){this.element.hasAttribute("action")||b.preventDefault(),a.prototype._onEvent.call(this,b)},b}(d);a.Submit=R;var S=function(b){function c(){b.apply(this,arguments),this.event="input"}return __extends(c,b),c.prototype._addEventListeners=function(){var b,c=this,d=this.element,e=this._compat,f=!1,g="input",h=function(a){f||c._onEvent(a)},i=function(a){t(b)||(b=J(function(){h(a),b=null}))};v(e.ANDROID)&&(this.addEventListener(d,"compositionstart",function(){f=!0},!1),this.addEventListener(d,"compositionend",function(a){f=!1,h(a)},!1)),this.addEventListener(d,g,h,!1),this.addEventListener(d,"change",h,!1),e.hasEvent(g)||(this.addEventListener(d,"keydown",function(b){var c=b.keyCode,d=a.KeyCodes;c===d.lwk||c===d.rwk||c>=d.shift&&c<=d.escape||c>d.space&&c<=d.down||i(b)},!1),this.addEventListener(d,"cut",i,!1),this.addEventListener(d,"paste",i,!1))},c._inject={_compat:Pa},c}(d);a.React=S,Ga.control(jc,e),Ga.control(kc,f),Ga.control(lc,g),Ga.control(mc,i),Ga.control(nc,j),Ga.control(oc,l),Ga.control(pc,m),Ga.control(qc,o),Ga.control(rc,R),Ga.control(sc,p),Ga.control(tc,x),Ga.control(uc,y),Ga.control(vc,z),Ga.control(wc,A),Ga.control(xc,B),Ga.control(yc,C),Ga.control(zc,D),Ga.control(Ac,E),Ga.control(Bc,F),Ga.control(Cc,G),Ga.control(Dc,H),Ga.control(Ec,I),Ga.control(Fc,K),Ga.control(Gc,L),Ga.control(Hc,N),Ga.control(Ic,P),Ga.control(Jc,S),a.KeyCodes={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,pause:19,break:19,"caps lock":20,escape:27,space:32,"page up":33,"page down":34,end:35,home:36,left:37,"left arrow":37,up:38,"up arrow":38,right:39,"right arrow":39,down:40,"down arrow":40,insert:45,delete:46,0:48,zero:48,")":48,"right parenthesis":48,1:49,one:49,"!":49,exclamation:49,"exclamation point":49,2:50,two:50,"@":50,at:50,3:51,three:51,"#":51,"number sign":51,hash:51,pound:51,4:52,four:52,$:52,dollar:52,"dollar sign":52,5:53,five:53,"%":53,percent:53,"percent sign":53,6:54,six:54,"^":54,caret:54,7:55,seven:55,"&":55,ampersand:55,8:56,eight:56,"*":56,asterisk:56,9:57,nine:57,"(":57,"left parenthesis":57,a:65,b:66,c:67,d:68,e:69,f:70,g:71,h:72,i:73,j:74,k:75,l:76,m:77,n:78,o:79,p:80,q:81,r:82,s:83,t:84,u:85,v:86,w:87,x:88,y:89,z:90,lwk:91,"left window key":91,rwk:92,"right window key":92,select:93,"select key":93,"numpad 0":96,"numpad 1":97,"numpad 2":98,"numpad 3":99,"numpad 4":100,"numpad 5":101,"numpad 6":102,"numpad 7":103,"numpad 8":104,"numpad 9":105,multiply:106,add:107,subtract:109,"decimal point":110,divide:111,f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123,"num lock":144,"scroll lock":145,";":186,"semi-colon":186,":":186,colon:186,"=":187,equal:187,"equal sign":187,"+":187,plus:187,",":188,comma:188,"<":188,lt:188,"less than":188,"left angle bracket":188,"-":189,dash:189,_:189,underscore:189,".":190,period:190,">":190,gt:190,"greater than":190,"right angle bracket":190,"/":191,"forward slash":191,"?":191,"question mark":191,"`":192,"grave accent":192,"~":192,tilde:192,"[":219,"open bracket":219,"{":219,"open brace":219,"\\":220,"back slash":220,"|":220,pipe:220,"]":221,"close bracket":221,"}":221,"close brace":221,"'":222,"single quote":222,'"':222,"double quote":222};var T=function(b){function c(){b.apply(this,arguments),this.keyCodes={}}return __extends(c,b),c.prototype._setListener=function(){var a=this.attribute;if(!q(this.event)&&!q(a)){var c=this.attributes[a].trim();if("{"===c[0]){var d=this.evaluateExpression(c)||{method:""},e=this._filterArgs(d);return this._setKeyCodes(e),void this.addEventListener(this.element,this.event,this._onEvent,!1)}b.prototype._setListener.call(this)}},c.prototype._filterArgs=function(a){var b=a.key,c=a.keys;return this._parseArgs(a.method),w(c)?c:n(c)?[c]:w(b)?b:n(b)?[b]:void(u(a.char)&&u(a.chars)||this._log.warn(this.type+" should be using the property key or keys to denote key codes or keys and not char codes or characters."))},c.prototype._onEvent=function(a){this._compareKeys(a)&&b.prototype._onEvent.call(this,a)},c.prototype._compareKeys=function(a){var b=this.keyCodes,c=a.keyCode||a.which;return q(b)||b[c]===!0},c.prototype._setKeyCodes=function(b){w(b)||(b=[]);for(var c,d,e=b.length,f=this.keyCodes,g=0;e>g;++g)c=b[g],d=s(c)?c:a.KeyCodes[c.toLowerCase()],f[d]=!0},c}(d);a.KeyCodeEventControl=T;var U=function(a){function b(){a.apply(this,arguments),this.event="keydown"}return __extends(b,a),b}(T);a.KeyDown=U;var V=function(a){function b(){a.apply(this,arguments),this.event="keydown"}return __extends(b,a),b.prototype._onEvent=function(b){var c=this,d=b.keyCode||b.which;if(a.prototype._compareKeys.call(this,b)&&(d>=48&&90>=d||d>=186||d>=96&&111>=d))var e=this.addEventListener(this.element,"keypress",function(b){e(),a.prototype._onEvent.call(c,b)},!1)},b.prototype._compareKeys=function(a){return!0},b}(T);a.KeyPress=V;var W=function(a){function b(){a.apply(this,arguments),this.event="keyup"}return __extends(b,a),b}(T);a.KeyUp=W;var X=function(a){function b(){a.apply(this,arguments),this.event="keypress"}return __extends(b,a),b.prototype._filterArgs=function(a){var b=a.char,c=a.chars;return this._parseArgs(a.method),w(c)?c:n(c)?[c]:w(b)?b:n(b)?[b]:void(u(a.key)&&u(a.keys)||this._log.warn(this.type+" should be using the property key or keys to denote key codes or keys and not char codes or characters."))},b.prototype._onEvent=function(b){var c,d=this.keyCodes,e=b.charCode||b.which;if(e)c=String.fromCharCode(e);else if(c=b.key,!c)return;(q(d)||d[c]===!0)&&a.prototype._onEvent.call(this,b)},b.prototype._compareKeys=function(a){return!0},b.prototype._setKeyCodes=function(a){w(a)||(a=[]);for(var b,c,d=a.length,e=this.keyCodes,f=0;d>f;++f)b=a[f],c=s(b)?String.fromCharCode(b):b,e[c]=!0},b}(T);a.CharPress=X,Ga.control(Zb,U),Ga.control($b,V),Ga.control(_b,W),Ga.control(ac,X);var Y=function(a){function b(){a.apply(this,arguments),this.property=""}return __extends(b,a),b.prototype.loaded=function(){u(this.element)||(this.attribute=O(this.type),this.setter(),this.__removeListener=this.attributes.observe(this.setter,this.attribute))},b.prototype.contextChanged=function(){u(this.element)||this.setter()},b.prototype.dispose=function(){t(this.__removeListener)&&(this.__removeListener(),this.__removeListener=null)},b.prototype.setter=function(){var a=this;M(function(){var b=a.element,c=a.property;if(k(b))switch(a.attributes[a.attribute]){case"false":case"0":case"null":case"":b.setAttribute(c,""),b[c]=!1,b.removeAttribute(c);break;default:b.setAttribute(c,c),b[c]=!0}})},b}(Pf);a.SetAttributeControl=Y;var Z=function(a){function b(){a.apply(this,arguments),this.property="checked"}return __extends(b,a),b}(Y);a.Checked=Z;var $=function(a){function b(){a.apply(this,arguments),this.property="disabled"}return __extends(b,a),b}(Y);a.Disabled=$;var _=function(a){function b(){a.apply(this,arguments),this.property="selected"}return __extends(b,a),b}(Y);a.Selected=_;var aa=function(a){function b(){a.apply(this,arguments),this.property="readonly"}return __extends(b,a),b}(Y);a.ReadOnly=aa;var ba=function(a){function c(){a.apply(this,arguments),this.property="display",this.value="none",this.importance="important",this._initialValue=""}return __extends(c,a),c.prototype.initialize=function(){var a=this.element.style||{getPropertyValue:b},c=a.getPropertyValue(this.property);this._setValue(this.value,this.importance),q(c)||"none"===c||(this._initialValue=c)},c.prototype.setter=function(){var a=this;M(function(){if(k(a.element))switch(a.attributes[a.attribute]){case"false":case"0":case"null":case"":a._setValue(a.value,a.importance);break;default:a._setValue(a._initialValue)}})},c.prototype._setValue=function(a,c){var d=this.property,e=this.element.style||{setProperty:b,removeProperty:b,getPropertyValue:b,getPropertyPriority:b},f=e.getPropertyValue(d),g=e.getPropertyPriority(d);if(a!==f||c!==g)return q(a)?void e.removeProperty(d):void e.setProperty(d,a,c)},c}(Y);a.Visible=ba;var ca=function(a){function b(){a.apply(this,arguments),this.property="style"}return __extends(b,a),b.prototype.setter=function(){var a=this,b=this.element,c=this.attributes[this.attribute];q(c)||u(b)||M(function(){b.setAttribute(a.property,c)})},b}(Y);a.Style=ca,Ga.control(dc,Z),Ga.control(ec,$),Ga.control(fc,_),Ga.control(gc,aa),Ga.control(hc,ba),Ga.control(ic,ca);var da=function(a){function b(){a.apply(this,arguments)}return __extends(b,a),b.prototype.setter=function(){var a=this.element,b=this.property,c=this.attributes[this.attribute];q(c)||u(a)||v(a[b])||(a[b]=c)},b}(Y);a.ElementPropertyControl=da;var ea=function(a){function b(){a.apply(this,arguments),this.property="href"}return __extends(b,a),b}(da);a.Href=ea;var fa=function(a){function b(){a.apply(this,arguments),this.property="src"}return __extends(b,a),b.prototype.setter=function(){var a=this.element,b=this.property,c=this.attributes[this.attribute];q(c)||u(a)||v(a[b])||(a[b]=this._browser.urlUtils(c))},b._inject={_browser:Bb},b}(da);a.Src=fa,Ga.control(Xb,ea),Ga.control(Yb,fa);var ga=function(c){function d(){c.apply(this,arguments),this.priority=100,this._supportsTwoWayBinding=!1,this.__fileSupported=na(Pa).fileSupported,this.__fileNameRegex=na($a).fileNameRegex,this.__isSelf=!1}return __extends(d,c),d.prototype.initialize=function(){this._determineType()},d.prototype.loaded=function(){var a=this.parent;if(!u(a)&&!u(this.element)){var b=O(this.type),c=this._parser,d=this._expression=c.parse(this.attributes[b]),e=d.identifiers;if(1!==e.length)return this._log.warn("Only 1 identifier allowed in a "+this.type+" expression"),void(this._contextExpression=null);var f=e[0].split(".");if(this._property=f.pop(),d.aliases.length>0){var g,i=d.aliases[0],j=a.findResource(i);if(h(j)){if(g=j.resource.type,g!==Pe&&g!==Te)return}else j={resource:{}};i===Xe||i===Ve?this._contextExpression=c.parse(f.join(".")):(this._property="value",this._contextExpression={evaluate:function(){return j.resource},aliases:[],identifiers:[],expression:""})}else f.length>0?this._contextExpression=c.parse(f.join(".")):this._contextExpression={evaluate:function(){return a.context},aliases:[],identifiers:[],expression:""};this._supportsTwoWayBinding&&this.templateControl.observeProperties(this),this._watchExpression(),u(this._addEventType)||this._addEventType()}},d.prototype.contextChanged=function(){this._watchExpression()},d.prototype.dispose=function(){this._addEventType=null},d.prototype.evaluate=function(){var a=this._expression;if(!v(a))return this.evaluateExpression(a)},d.prototype.observeProperty=function(a,b,c){var d,e=this;if(q(b))d=this._expression.expression;else if(s(b))d=this._expression.expression+"."+b;else{var f=this._parser,g=f.parse(b),i=g.identifiers;if(1!==i.length)return void this._log.warn("Only 1 identifier path allowed when observing changes to a bound property's child with a control implementing ISupportTwoWayBinding and working with "+this.type);var j=f.parse(this._expression.expression+"."+i[0]);d=j.identifiers[0];var k=d.split(".");k.pop();var l=k.join("."),m=this.evaluateExpression(l);if(!h(m)){if(!u(m))return void this._log.warn("A control implementing ISupportTwoWayBinding is trying to index into a primitive type when trying to evaluate "+this.type+'="'+this._expression.expression+'"');m=this._ContextManager.createContext(this.parent,l)}}a=a.bind(this.templateControl);var n;return n=c===!0?this.observeArray(function(c){a(c,b)},d):this.observe(function(c,d){e.__isSelf||c===d||a(c,d,b)},d),a(this.evaluateExpression(d),void 0,b,!0),n},d.prototype._addTextEventListener=function(){var b,c=this,d=this.element,e=this._compat,f=!1,g="input",h=function(){f||c._propertyChanged()},i=function(){t(b)||(b=J(function(){h(),b=null}))};v(e.ANDROID)&&(this.addEventListener(d,"compositionstart",function(){f=!0},!1),this.addEventListener(d,"compositionend",function(){f=!1,h()},!1)),e.hasEvent(g)?this.addEventListener(d,g,h,!1):(this.addEventListener(d,"keydown",function(b){var c=b.keyCode||b.which,d=a.KeyCodes;c===d.lwk||c===d.rwk||c>=d.shift&&c<=d.escape||c>d.space&&c<=d.down||i()},!1),this.addEventListener(d,"cut",i,!1),this.addEventListener(d,"paste",i,!1)),this.addEventListener(d,"change",h,!1)},d.prototype._addChangeEventListener=function(){this.addEventListener(this.element,"change",this._propertyChanged,!1)},d.prototype._addButtonEventListener=function(){this.addEventListener(this.element,Td,this._propertyChanged,!1)},d.prototype._getChecked=function(){return this.element.checked},d.prototype._getValue=function(){return this.element.value},d.prototype._getTextContent=function(){return this.element.textContent},d.prototype._getFile=function(){var a=this.element,c=a.value;return this.__fileSupported&&a.files.length>0?a.files[0]:{name:c.replace(this.__fileNameRegex,""),path:c,lastModifiedDate:void 0,type:void 0,size:void 0,msDetachStream:b,msClose:b,slice:function(){return{}}}},d.prototype._getFiles=function(){var a=this.element;if(this.__fileSupported)return Array.prototype.slice.call(a.files);for(var c,d=a.value.split(/,|;/g),e=d.length,f=[],g=function(){return{}},h=0;e>h;++h)c=d[h],f.push({name:c.replace(this.__fileNameRegex,""),path:c,lastModifiedDate:void 0,type:void 0,size:void 0,msDetachStream:b,msClose:b,slice:g});return f},d.prototype._getSelectedValues=function(){for(var a,b=this.element.options,c=b.length,d=[],e=0;c>e;++e)a=b[e],a.selected&&d.push(a.value);return d},d.prototype._setText=function(a,b,c){return this.__isSelf?void 0:u(a)&&(a="",c===!0)?(u(this.element.value)&&this._setValue(a),void this._propertyChanged()):void this._setValue(a)},d.prototype._setRange=function(a,b,c){return this.__isSelf?void 0:q(a)&&(a=0,c===!0)?(q(this.element.value)&&this._setValue(a),void this._propertyChanged()):void this._setValue(a)},d.prototype._setHidden=function(a,b,c){return this.__isSelf?void 0:q(a)&&(a="",c===!0)?(q(this.element.value)&&this._setValue(a),void this._propertyChanged()):void this._setValue(a)},d.prototype._setValue=function(a){var b=this.element;b.value!==a&&(b.value=a)},d.prototype._setChecked=function(a,b,c){if(!this.__isSelf){if(!r(a)){if(c===!0)return void this._propertyChanged();a=!!a}this.element.checked=a}},d.prototype._setRadio=function(a){var b=this.element;if(!this.__isSelf)return u(a)&&b.checked?void this._propertyChanged():void(b.checked=b.value===a)},d.prototype._setSelectedIndex=function(a,b,c){if(!this.__isSelf){var d=this.element,e=d.value;if(u(a))return c!==!0&&this._document.body.contains(d)?void(d.selectedIndex=-1):void this._propertyChanged();if(n(a)){if(e===a)return;if(!this._document.body.contains(d))return d.value=a,void(d.value!==a&&(d.value=e,this._propertyChanged()))}else{var f;s(a)?(a=a.toString(),f="Trying to bind a value of type number to a element. The element's selected index will be set to -1.",this._log.info(f)}d.value=a,(d.value!==a||-1===d.selectedIndex)&&(d.selectedIndex=-1)}},d.prototype._setSelectedIndices=function(a,b,c){if(!this.__isSelf){var d,e=this.element.options,f=u(e)?0:e.length,g=u(a);if(!g&&w(a))for(var h,i;f-->0;)d=e[f],h=d.value,i=Number(h),-1!==a.indexOf(h)||s(i)&&-1!==a.indexOf(i)?d.selected=!0:d.selected=!1;else for(c===!0&&this._propertyChanged();f-->0;){if(d=e[f],!g&&d.value===""+a)return void(d.selected=!0);d.selected=!1}}},d.prototype._determineType=function(){if(!this._observingBindableProperty()){var a=this.element;if(!u(a))switch(a.nodeName.toLowerCase()){case"input":switch(a.type){case"button":case"submit":case"reset":case"image":this._addEventType=this._addButtonEventListener,this._getter=this._getValue;break;case"checkbox":this._addEventType=this._addChangeEventListener,this._getter=this._getChecked,this._setter=this._setChecked;break;case"radio":this._initializeRadio();break;case"range":this._addEventType=this._addChangeEventListener,this._getter=this._getValue,this._setter=this._setRange;break;case"file":var b=a.multiple;this._addEventType=this._addChangeEventListener,this._getter=b?this._getFiles:this._getFile;break;case"hidden":this._getter=this._getValue,this._setter=this._setHidden;break;default:this._addEventType=this._addTextEventListener,this._getter=this._getValue,this._setter=this._setText}break;case"textarea":this._addEventType=this._addTextEventListener,this._getter=this._getValue,this._setter=this._setText;break;case"select":this._initializeSelect();break;case"button":this._addEventType=this._addButtonEventListener,this._getter=this._getTextContent}}},d.prototype._watchExpression=function(){var a=this,b=this._contextExpression,c=this.evaluateExpression(b);if(!h(c)){if(!(u(c)&&b.identifiers.length>0))return void this._log.warn(this.type+" is trying to index into a primitive type. "+this._contextExpression.expression+" is already defined and not an object when trying to evaluate "+this.type+'="'+this._expression.expression+'"');c=this._createContext(b.identifiers[0])}var d;if(t(this._setter)){this._setter===this._setSelectedIndices&&(d=this._property,u(c[d])&&(c[d]=[]),this.observeArray(function(b){a._setter(b[0].object,null,!0)},b+"."+d));var e=this._expression;this.observeExpression(function(b,c){a._setter(b,c)},e),this._setter(this.evaluateExpression(e),void 0,!0)}},d.prototype._createContext=function(a){var b=a.split("."),c=b.shift().slice(1),d=this.parent;return c===Ve?(a=b.join("."),d=this.parent.root):c===Ia&&(a=b.join(".")),this._ContextManager.createContext(d,a)},d.prototype._propertyChanged=function(){if(!u(this._contextExpression)){var a=this.evaluateExpression(this._contextExpression),b=this._property,c=this._getter();u(a)||a[b]===c||(this.__isSelf=!0,a[b]=c,this.__isSelf=!1)}},d.prototype._initializeRadio=function(){var a=this.element;if(this._addEventType=this._addChangeEventListener,this._getter=this._getValue,this._setter=this._setRadio,!a.hasAttribute("name")){var b=O(this.type),c=this.attributes[b];a.setAttribute("name",c)}a.hasAttribute("value")||a.setAttribute("value","")},d.prototype._initializeSelect=function(){var a,b=this.element,c=b.multiple,d=b.options,e=d.length;this._addEventType=this._addChangeEventListener,c?(this._getter=this._getSelectedValues,this._setter=this._setSelectedIndices):(this._getter=this._getValue,this._setter=this._setSelectedIndex);for(var f=0;e>f;++f)a=d[f],a.hasAttribute("value")||a.setAttribute("value",a.textContent)},d.prototype._observingBindableProperty=function(){var a=this,b=this.templateControl;return!u(b)&&t(b.onInput)&&t(b.observeProperties)?(b.onInput(function(b){a._getter=function(){return b},a._propertyChanged()}),this._supportsTwoWayBinding=!0):!1},d._inject={_parser:Za,_ContextManager:bb,_compat:Pa,_document:Sa},d}(Pf);a.Bind=ga,Ga.control(Wb,ga);var ha=function(a){function b(){a.apply(this,arguments),this.property="",this.priority=200,this._listeners=[],this._boundAddListener=this._addListener.bind(this)}return __extends(b,a),b.prototype.initialize=function(){this.attribute=O(this.type),this._setProperty(this._getValue())},b.prototype.loaded=function(){this._observeProperty(),this._setProperty(this._getValue())},b.prototype.dispose=function(){t(this._removeListener)&&this._removeListener(),this._listeners=[]},b.prototype._setProperty=function(a,b){var c=this.templateControl;u(c)||(this._ContextManager.defineGetter(c,this.property,{value:a,observe:this._boundAddListener},!0,!0),this._callListeners(a,b))},b.prototype._callListeners=function(a,b){for(var c=this._listeners,d=c.length,e=0;d>e;++e)c[e](a,b)},b.prototype._addListener=function(a){var b=this._listeners;return a=a.bind(this.templateControl),b.push(a),function(){var c=b.indexOf(a);-1!==c&&b.splice(c,1)}},b.prototype._getValue=function(){return u(this.templateControl)?void 0:this.evaluateExpression(this.attributes[this.attribute])},b.prototype._observeProperty=function(){u(this.templateControl)||(this._removeListener=this.observeExpression(this._setProperty,this.attributes[this.attribute]))},b._inject={_ContextManager:bb},b}(Pf);a.ObservableAttributeControl=ha;var ia=function(a){function b(){a.apply(this,arguments),this.property="options"}return __extends(b,a),b}(ha);a.Options=ia,Ga.control(cc,ia)}(Tf=a.controls||(a.controls={}));var Uf=function(){function a(){this.uid=N(Vb),this._log=a._log;var b=this.navigator=na(ab);b.initialize(na(Eb).currentRouter())}return a.start=function(){if(!a._compat.isCompatible)return a._log.error(new Error("PlatypusTS only supports modern browsers where Object.defineProperty is defined"));a.__addPlatCss();var b=a._EventManager;b.dispose(Ke),b.on(Ke,rd,a.__ready),b.on(Ke,xd,a.__shutdown),b.initialize()},a.registerApp=function(b){if(!u(a.app)&&n(a.app.uid)&&a._EventManager.dispose(a.app.uid),a.__injector=b,a._compat.amd){var c=a._LifecycleEvent,d=c.dispatch;J(function(){d(rd,c)})}},a.load=function(b){var c=a._LifecycleEvent,d=a._compiler,e=a._document.body,f=a._document.head;return c.dispatch(zd,a),u(b)?(e.setAttribute(Jd,""),void J(function(){d.compile([f]),d.compile([e]),e.removeAttribute(Jd)})):t(b.setAttribute)?(b.setAttribute(Jd,""),void J(function(){d.compile([b]),b.removeAttribute(Jd)})):void J(function(){d.compile([b])})},a.__ready=function(b){Af.Injector.initialize(), -a.__registerAppEvents(b),b.defaultPrevented||a.load()},a.__shutdown=function(){var b,c=navigator.app,d=a._LifecycleEvent;if(!u(c)&&t(c.exitApp)){if(b=d.dispatch(yd,a),b.defaultPrevented)return;c.exitApp()}},a.__registerAppEvents=function(b){var c=a.__injector;if(!u(c)&&t(c.inject)){var d=a.app=c.inject();d.on(sd,d.suspend),d.on(td,d.resume),d.on(ud,d.online),d.on(vd,d.offline),d.on(wd,d.error),d.on(yd,d.exiting),t(d.ready)&&d.ready(b)}},a.__addPlatCss=function(){var b=a._document;if(!a._compat.platCss){if(!u(b.styleSheets)&&b.styleSheets.length>0)return void b.styleSheets[0].insertRule("[plat-hide] { display: none !important; }",0);var c=document.createElement("style");c.textContent="[plat-hide] { display: none !important; }",document.head.appendChild(c)}},a.prototype.suspend=function(a){},a.prototype.resume=function(a){},a.prototype.error=function(a){},a.prototype.ready=function(a){},a.prototype.exiting=function(a){},a.prototype.online=function(a){},a.prototype.offline=function(a){},a.prototype.dispatchEvent=function(b){for(var c=[],d=1;dg;++g)c=d[g],this[c]=b[c],e[c]=[]},a.prototype.observe=function(a,c){var d=this.__listeners[O(c)];return u(d)?b:(a=a.bind(this.__control),d.push(a),function(){var b=d.indexOf(a);-1!==b&&d.splice(b,1)})},a.prototype._attributeChanged=function(a,b,c){for(var d=this.__listeners[O(a)],e=d.length,f=0;e>f;++f)d[f](b,c)},a}();a.Attributes=C,a.IAttributesFactory=g,Ga.injectable(qb,C,null,ve),Ga.injectable(pb,g,null,we);var D=function(){function a(){this.__resources={},this.__bound=!1}return a.create=function(c,d){if(u(d))return d;var e;switch(d.type.toLowerCase()){case Qe:var f=vf[d.value];u(f)||(d.value=f.inject());break;case Pe:a._observeResource(c,d);break;case Re:e=d.value,n(e)&&(d.value=c.evaluateExpression(e));break;case Te:break;case Se:e=d.value,n(e)&&(e=c[e],t(e)?d.value=e.bind(c):(a._log.warn('Attempted to create a "function" type Resource, but the function '+e+"cannot be found on your control."),d.value=b))}return d},a.addControlResources=function(b){b.resources.add({context:{value:b.context,type:Pe},control:{value:b,type:Re}}),b.hasOwnContext&&a.__addRoot(b)},a.bindResources=function(b){var c=b.__resources;if(!u(c)){for(var d,e=b.__controlInstance,f=Object.keys(c),g=a.__controlResources,h=f.length,i=0;h>i;++i)d=f[i],g[d]!==!0&&(b[d]=c[d]=a.create(e,b[d]));b.__bound=!0}},a.dispose=function(b,c){var d=b.resources;if(!u(d)){for(var e,g,h=Object.keys(d.__resources),i=h.length,j=a._ContextManager.defineProperty,k=0;i>k;++k)e=h[k],g=d[e],u(g)||g.type!==Pe&&g.type!==Te||j(d,e,c?f(g,!0):null,!0,!0,!0);a._removeListeners(d.__controlInstance)}},a.parseElement=function(b){for(var c,d,e,f,g,h,i=Array.prototype.slice.call(b.children),j=a._regex,k=j.whiteSpaceRegex,l=j.quotationRegex,m={},n=a.__resourceTypes;i.length>0;)c=i.pop(),g=c.nodeName.toLowerCase(),n[g]&&(e=c.attributes,d={},f=e.getNamedItem(Ne),u(f)||(d.alias=f.value,h=c.textContent.replace(k,"$1"),q(h)||(d.value=g===Qe||g===Te?h.replace(l,""):h,d.type=g,m[d.alias]=d)));return m},a.getInstance=function(){return new a},a._observeResource=function(b,c){var d=c.value,e=b.uid,f=a.__observableResourceRemoveListeners[e];if(u(f)&&(f=a.__observableResourceRemoveListeners[e]=[]),n(d)){u(c.initialValue)?c.initialValue=d:d=c.initialValue;var g=b.observeExpression(function(a){c.value=a},d);c.value=b.evaluateExpression(d),f.push(g)}},a._removeListeners=function(b){if(!u(b)){var c=b.uid,d=a.__observableResourceRemoveListeners[c];if(w(d))for(var e=d.length,f=0;e>f;++f)d[f]();Q(a.__observableResourceRemoveListeners,c)}},a.__addRoot=function(a){a.resources.add({root:{value:a,type:Re,alias:Ue},rootContext:{value:a.context,type:Pe,alias:Ve}})},a.prototype.initialize=function(b,c){if(this.__controlInstance=b,!u(c)){k(c)?c=a.parseElement(c):h(c.resources)&&(c=c.resources),this.__resources=c;for(var d,e=Object.keys(c),f=e.length,g=0;f>g;++g)d=e[g],this[d]=c[d]}},a.prototype.add=function(b){if(!u(b)){k(b)&&(b=a.parseElement(b));for(var c,d,e=Object.keys(b),f=e.length,g=this.__controlInstance,h=this.__bound,i=a.create,j=0;f>j;++j)d=e[j],c=b[d],c.alias=d,this[d]=this.__resources[d]=h?i(g,c):c}},a.INJECTABLE=Qe,a.OBJECT=Re,a.OBSERVABLE=Pe,a.LITERAL=Te,a.FUNCTION=Se,a.__observableResourceRemoveListeners={},a}();a.Resources=D,a.IResourcesFactory=i,Ga.injectable(wb,i,[bb,$a,Ya],we),Ga.injectable(xb,D,null,ve);var E=function(){function a(){this._gestures=a.gestures,this._androidVersion=v(this._compat.ANDROID)?-1:this._compat.ANDROID,this._android44orBelow=this._androidVersion>-1&&Math.floor(this._androidVersion/10)<=44,this._inMouse=!1,this._subscribers={},this._gestureCount={$tap:0,$dbltap:0,$hold:0,$release:0,$swipe:0,$track:0,$trackend:0},this.__hasMoved=!1,this.__hasRelease=!1,this.__detectingMove=!1,this.__tapCount=0,this.__touchCount=0,this.__cancelDeferredTap=b,this.__cancelDeferredHold=b,this.__cancelRegex=/cancel/i,this.__pointerEndRegex=/up|cancel/i,this.__haveSwipeSubscribers=!1,this.__reverseMap={},this.__mappedEventListener=this.__handleMappedEvent.bind(this),this.__mappedCount={$touchstart:0,$touchmove:0,$touchend:0,$touchcancel:0},this.__pointerHash={},this.__pointerEvents=[],this.__listeners={},this.__getTypes()}return a.prototype.addEventListener=function(a,c,d,e){var f=this,g=this._compat,h=g.mappedEvents,i=h[c],j=!u(i),k=this.__mappedCount,l=b,m=b,n=this._gestures,o=!1;if(j){var p=k[c];this.__reverseMap[i]=c,this.__registerElement(a,c),k[c]++,l=this.__addMappedEvent(p,i,e),g.hasTouchEvents&&!this.__cancelRegex.test(i)&&(i=i.replace("touch","mouse").replace("start","down").replace("end","up"),this.__reverseMap[i]=c,m=this.__addMappedEvent(p,i,e))}if(a.addEventListener(c,d,e),!v(a["on"+c])||v(n[c])||j)return function(){if(!o){if(j){var b=k[c];s(b)&&(b>0&&(b=--k[c]),0===b&&(l(),m())),f.__unregisterElement(a,c)}o=!0,a.removeEventListener(c,d,e)}};var q=n.$swipe,r=n.$track,t=c;if(-1!==c.indexOf(r)){var w=n.$trackend;t=c===w?w:r}else-1!==c.indexOf(q)&&(t=q);return this._gestureCount[t]++,this.__registerElement(a,c),function(){o||(o=!0,f.__removeEventListener(a,c,d,e))}},a.prototype.dispose=function(){this.__unregisterTypes(),this._gestureCount={$tap:0,$dbltap:0,$hold:0,$release:0,$swipe:0,$track:0,$trackend:0},this.__mappedCount={$touchstart:0,$touchmove:0,$touchend:0,$touchcancel:0},this._isActive=!1,this._subscribers={},this.__pointerEvents=[],this.__pointerHash={},this.__reverseMap={},this.__tapCount=this.__touchCount=0,this.__detectingMove=this.__hasMoved=this.__hasRelease=this.__haveSwipeSubscribers=!1,this.__lastMoveEvent=this.__lastTouchDown=this.__lastTouchUp=null,this.__swipeOrigin=this.__capturedTarget=this.__focusedElement=null,this.__cancelDeferredHold=this.__cancelDeferredTap=b},a.prototype._onTouchStart=function(c){var d=this;if(this.__touchCount++>0)return!0;var e=c.type;if("mousedown"!==e)this._inTouch=!0;else{if(this._inTouch===!0)return c.preventDefault(),!1;this._compat.hasTouchEvents&&(this._inMouse=!0)}if(c=this.__standardizeEventObject(c),u(c))return!0;this.__capturedTarget=this.__lastMoveEvent=null,this.__hasMoved=!1;var f=c.clientX,g=c.clientY,h=c.timeStamp,i=c.target,j=this._gestures;this.__lastTouchDown={_buttons:c._buttons,clientX:f,clientY:g,timeStamp:h,target:i,identifier:c.identifier},this.__swipeOrigin={clientX:f,clientY:g,xTimestamp:h,yTimestamp:h,xTarget:i,yTarget:i},this._android44orBelow&&(this.__haveSwipeSubscribers=this.__findFirstSubscribers(i,[j.$swipe,j.$swipedown,j.$swipeleft,j.$swiperight,j.$swipeup]).length>0);var k=this._gestureCount,l=k.$hold<=0,m=k.$release<=0;if(("touchstart"===e||k.$track>0||k.$trackend>0||k.$swipe>0)&&(this.__registerType(this._moveEvents),this.__detectingMove=!0),l&&m)return!0;var n,o,p=a.config.intervals.holdInterval,q=!1;return l?(this.__hasRelease=!1,this.__cancelDeferredHold=K(function(){d.__hasRelease=!0},p),!0):(m?(n=this.__findFirstSubscriber(c.target,this._gestures.$hold),(q=!u(n))&&(o=function(){n.trigger(c),d.__cancelDeferredHold=b})):(this.__hasRelease=!1,n=this.__findFirstSubscriber(c.target,this._gestures.$hold),(q=!u(n))&&(o=function(){n.trigger(c),d.__hasRelease=!0,d.__cancelDeferredHold=b})),void(q&&(this.__cancelDeferredHold=K(o,p))))},a.prototype._onTouchMove=function(c){if(this.__cancelDeferredHold(),this.__cancelDeferredHold=b,this._inTouch===!0&&"mousemove"===c.type)return!0;var d=this.__standardizeEventObject(c);if(u(d))return!0;var e=this._gestureCount,f=e.$track<=0,g=e.$swipe<=0,h=a.config,i=this.__swipeOrigin,j=d.clientX,k=d.clientY,l=this.__hasMoved||this.__getDistance(i.clientX,j,i.clientY,k)>=h.distances.minScrollDistance;if(!l)return!0;if(this.__hasMoved=!0,f&&g)return!0;var m=this.__lastMoveEvent||i,n=d.direction=this.__getDirection(j-m.clientX,k-m.clientY);this.__handleOriginChange(n);var o=Math.abs(j-i.clientX),p=Math.abs(k-i.clientY);d.velocity=this.__getVelocity(o,p,d.timeStamp-i.xTimestamp,d.timeStamp-i.yTimestamp),!g&&this._android44orBelow&&this.__haveSwipeSubscribers&&c.preventDefault(),f||this.__handleTrack(d,c),this.__lastMoveEvent=d},a.prototype._onTouchEnd=function(b){var c=b.type,d=this.__hasMoved,e="mouseup"!==c;if(this.__touchCount<=0?this.__touchCount=0:this.__touchCount--,e){if("touchend"===c){if(d)b.cancelable===!0&&b.preventDefault();else{if(this._inTouch!==!0)return this.__preventClickFromTouch(),b.cancelable===!0&&b.preventDefault(),!0;this.__handleInput(b.target),b.cancelable===!0&&b.preventDefault()}this.__preventClickFromTouch()}}else if(!v(this._inTouch)){if(!this._inMouse)return b.cancelable===!0&&b.preventDefault(),!1;this._inMouse=!1}if(this.__cancelRegex.test(c))return this.__handleCanceled(b),!0;if(b=this.__standardizeEventObject(b),u(b))return!0;e&&(this._inTouch=!1),this.__touchCount>0&&(this.__touchCount=b.touches.length),this.__clearTempStates(),this.__hasRelease&&this.__handleRelease(b),this.__handleSwipe();var f=a.config,g=f.intervals,h=b.timeStamp,i=this.__lastTouchDown;if(d)return this.__handleTrackEnd(b),this.__tapCount=0,!0;if(u(i)||h-i.timeStamp>g.tapInterval)return this.__tapCount=0,!0;var j=this.__lastTouchUp,k=b.clientX,l=b.clientY;this.__tapCount>0&&this.__getDistance(k,j.clientX,l,j.clientY)<=f.distances.maxDblTapDistance&&h-j.timeStamp<=g.dblTapInterval?this.__handleDbltap(b):this.__tapCount=0,this.__handleTap(b),this.__lastTouchUp=b},a.prototype.__clearTempStates=function(){this.__cancelDeferredHold(),this.__cancelDeferredHold=b,this.__detectingMove&&(this.__unregisterType(this._moveEvents),this.__detectingMove=!1)},a.prototype.__resetTouchEnd=function(){this.__tapCount=this.__touchCount=0,this._inTouch=this.__hasRelease=!1,this.__pointerHash={},this.__pointerEvents=[],this.__capturedTarget=null},a.prototype.__handleCanceled=function(a){var b=a.touches||this.__pointerEvents,c=this.__getTouchIndex(b);a=c>=0?b[c]:this.__standardizeEventObject(a),this._inTouch=!1,this.__clearTempStates(),this.__hasMoved&&(this._android44orBelow&&this.__handleSwipe(),this.__handleTrackEnd(a)),this.__resetTouchEnd()},a.prototype.__handleTap=function(c){var d=this;if(this.__tapCount++,!(this._gestureCount.$tap<=0)){var e=this._gestures,f=this.__findFirstSubscriber(c.target,e.$tap);if(!u(f))return a.config.intervals.dblTapZoomDelay<=0||"mouse"===c.pointerType||"mouseup"===c.type?(c._buttons=this.__lastTouchDown._buttons,void f.trigger(c)):void(this.__cancelDeferredTap=K(function(){c._buttons=d.__lastTouchDown._buttons,f.trigger(c),d.__tapCount=0,d.__cancelDeferredTap=b},a.config.intervals.dblTapZoomDelay))}},a.prototype.__handleDbltap=function(a){if(this.__tapCount=0,this.__cancelDeferredTap(),this.__cancelDeferredTap=b,!(this._gestureCount.$dbltap<=0)){var c=this.__findFirstSubscriber(a.target,this._gestures.$dbltap);u(c)||(a._buttons=this.__lastTouchDown._buttons,c.trigger(a),this.__tapCount=-1)}},a.prototype.__handleRelease=function(a){var b=this.__findFirstSubscriber(a.target,this._gestures.$release);u(b)||b.trigger(a),this.__hasRelease=!1},a.prototype.__handleSwipe=function(){if(!(this._gestureCount.$swipe<=0)){var a=this.__lastMoveEvent;if(!u(a)){for(var b=this.__swipeOrigin,c=Math.abs(a.clientX-b.clientX),d=Math.abs(a.clientY-b.clientY),e=this.__getRegisteredSwipes(a.direction,a.velocity,c,d);e.length>0;)e.pop().trigger(a);this.__lastMoveEvent=null}}},a.prototype.__handleTrack=function(a,b){var c=this._gestures,d=c.$track,e=a.direction,f=this.__capturedTarget||a.target,g=this.__findFirstSubscribers(f,[d,d+e.x,d+e.y]);if(this._android44orBelow){var h=this.__findFirstSubscribers(f,[d,c.$trackdown,c.$trackup,c.$trackleft,c.$trackright,c.$trackend]);h.length>0&&b.preventDefault()}if(g.length>0)for(this._androidVersion>-1&&b.preventDefault();g.length>0;)g.pop().trigger(a)},a.prototype.__handleTrackEnd=function(a){if(!(this._gestureCount.$trackend<=0)){var b=this.__capturedTarget||a.target,c=this.__findFirstSubscriber(b,this._gestures.$trackend);u(c)||c.trigger(a)}},a.prototype.__handleMappedEvent=function(a){var b=a.type,c=this.__reverseMap[b],d=this.__findFirstSubscriber(a.target,c);u(d)||(a=this.__standardizeEventObject(a),u(a)||d.trigger(a))},a.prototype.__getTypes=function(){var a,b,c,d=this._compat,e=d.mappedEvents,f=this.__listeners;if(d.hasPointerEvents)a=this._startEvents=e.$touchstart,b=this._moveEvents=e.$touchmove,c=this._endEvents=e.$touchend+" "+e.$touchcancel;else if(d.hasTouchEvents)a=this._startEvents=e.$touchstart+" mousedown",b=this._moveEvents=e.$touchmove+" mousemove",c=this._endEvents=e.$touchend+" mouseup "+e.$touchcancel;else{var g=e.$touchcancel;a=this._startEvents=e.$touchstart,b=this._moveEvents=e.$touchmove,c=this._endEvents=e.$touchend+(g?" "+g:"")}f[a]=this._onTouchStart.bind(this),f[b]=this._onTouchMove.bind(this),f[c]=this._onTouchEnd.bind(this)},a.prototype.__registerTypes=function(){this.__registerType(this._startEvents),this.__registerType(this._endEvents)},a.prototype.__unregisterTypes=function(){this.__unregisterType(this._startEvents),this.__unregisterType(this._endEvents),this.__detectingMove&&(this.__unregisterType(this._moveEvents),this.__detectingMove=!1)},a.prototype.__registerType=function(a){for(var b=this.__listeners[a],c=this._document,d=a.split(" "),e=d.length;e-->0;)c.addEventListener(d[e],b,!1)},a.prototype.__unregisterType=function(a){for(var b=this.__listeners[a],c=this._document,d=a.split(" "),e=d.length;e-->0;)c.removeEventListener(d[e],b,!1)},a.prototype.__registerElement=function(b,c){var d,e=b.__plat;u(e)?(d=N("domEvent_"),b.__plat=e={domEvent:d}):u(e.domEvent)&&(d=N("domEvent_"),e.domEvent=d),this._isActive||(this.__registerTypes(),u(this._isActive)&&this.__appendGestureStyle(),this._isActive=!0);var f;if(u(d)){var g=this._subscribers[e.domEvent];return v(g[c])?(f=new H(b,c),g[c]=f):g[c].count++,void g.gestureCount++}var h={gestureCount:1};f=new H(b,c),h[c]=f,this._subscribers[d]=h,v(b.className)||ha(b,a.config.styleConfig[0].className),this.__removeSelections(b)},a.prototype.__unregisterElement=function(a,b){var c=a.__plat;if(!u(c)&&!u(c.domEvent)){var d=c.domEvent,e=this._subscribers[d],f=e[b];u(f)||(f.count--,0===f.count&&Q(e,b),e.gestureCount--,0===e.gestureCount&&(Q(this._subscribers,d),this.__removeElement(a)))}},a.prototype.__setTouchPoint=function(a){var b=a.type,c=this._compat;return c.hasPointerEvents||c.hasMsPointerEvents?void this.__updatePointers(a,this.__pointerEndRegex.test(b)):void(a.pointerType=-1===b.indexOf("mouse")?"touch":"mouse")},a.prototype.__setCapture=function(a){u(this.__capturedTarget)&&!j(a)&&(this.__capturedTarget=a)},a.prototype.__updatePointers=function(a,b){var c,d=a.pointerId,e=this.__pointerHash,f=e[d];if(b)v(f)||(c=this.__pointerEvents.indexOf(f),c>-1&&this.__pointerEvents.splice(c,1),Q(this.__pointerHash,d));else{if(1===d&&!q(e))return;a.identifier=a.pointerId,v(f)||(c=this.__pointerEvents.indexOf(f))<0?this.__pointerEvents.push(a):this.__pointerEvents.splice(c,1,a),e[d]=a}},a.prototype.__findFirstSubscriber=function(a,b){if(!u(a)){var c,d,e;do if(c=a.__plat,!v(c)&&!v(c.domEvent)&&(d=this._subscribers[c.domEvent],e=d[b],!v(e)))return e;while(!u(a=a.parentNode))}},a.prototype.__findFirstSubscribers=function(a,b){if(u(a))return[];var c,d,e,f,g,h=[];do if(c=a.__plat,!v(c)&&!v(c.domEvent))for(d=this._subscribers[c.domEvent],e=Object.keys(d);e.length>0;)f=e.pop(),g=b.indexOf(f),-1!==g&&(h.push(d[f]),b.splice(g,1));while(b.length>0&&!u(a=a.parentNode));return h},a.prototype.__addMappedEvent=function(a,b,c){var d=this,e=this._document;return 0===a&&e.addEventListener(b,this.__mappedEventListener,c),function(){e.removeEventListener(b,d.__mappedEventListener,c)}},a.prototype.__removeEventListener=function(a,b,c,d){var e=this._gestures;a.removeEventListener(b,c,d);var f=e.$swipe,g=e.$track,h=b;if(-1!==b.indexOf(g)){var i=e.$trackend;h=b===i?i:g}else-1!==b.indexOf(f)&&(h=f);this._gestureCount[h]--,this.__unregisterElement(a,b)},a.prototype.__removeElement=function(b){this.__returnSelections(b),v(b.className)||ia(b,a.config.styleConfig[0].className);var c=b.__plat;Q(c,"domEvent"),q(c)&&Q(b,"__plat"),q(this._subscribers)&&this.dispose()},a.prototype.__standardizeEventObject=function(a){this.__setTouchPoint(a);var b,c=-1!==this._startEvents.indexOf(a.type),d=a.touches||this.__pointerEvents,e=a.changedTouches,f=!v(e),g=a.timeStamp;if(f)if(c)b=a.preventDefault.bind(a),a=e[0],a.preventDefault=b;else{var h=this.__getTouchIndex(e);if(h>=0)b=a.preventDefault.bind(a),a=e[h],a.preventDefault=b;else if(this.__getTouchIndex(d)>=0)return null}return c&&this.__setCapture(a.target),this.__normalizeButtons(a),a.touches=d,a.offset=this.__getOffset(a),(v(a.timeStamp)||g>a.timeStamp)&&(a.timeStamp=g),a},a.prototype.__normalizeButtons=function(a){var b;if(s(a.buttons)&&0!==a.buttons)b=a.buttons;else if(s(a.which)&&a.which>0)b=a.which;else switch(a.button){case-1:b=0;break;case 0:b=1;break;case 1:b=4;break;case 2:b=2;break;case 3:b=8;break;case 4:b=16;break;default:b=1}a._buttons=b},a.prototype.__getTouchIndex=function(a){for(var b=(this.__lastTouchDown||{}).identifier,c=a.length,d=0;c>d;++d)if(a[d].identifier===b)return d;return-1},a.prototype.__getOffset=function(a){var b=this.__capturedTarget||a.target;if(j(b))return{x:a.clientX,y:a.clientY};if(!v(a.offsetX)&&b===a.target)return{x:a.offsetX,y:a.offsetY};for(var c=b.offsetLeft,d=b.offsetTop;!u(b=b.offsetParent);)c+=b.offsetLeft,d+=b.offsetTop;return{x:a.clientX-c,y:a.clientY-d}},a.prototype.__getDistance=function(a,b,c,d){var e=b-a,f=d-c;return Math.sqrt(e*e+f*f)},a.prototype.__getVelocity=function(a,b,c,d){var e=0,f=0;return c>0&&(e=a/c||0),d>0&&(f=b/d||0),{x:e,y:f}},a.prototype.__getDirection=function(a,b){var c=Math.abs(a),d=Math.abs(b),e=(this.__lastMoveEvent||{}).direction||{},f=0===a?e.x||"none":0>a?"left":"right",g=0===b?e.y||"none":0>b?"up":"down";return{x:f,y:g,primary:c===d?e.primary||"none":c>d?f:g}},a.prototype.__handleOriginChange=function(a){var b=this.__lastMoveEvent;if(!u(b)){var c=b.direction,d=c.x===a.x,e=c.y===a.y;if(!d||!e){var f=this.__swipeOrigin,g=this._gestures,h=[g.$swipe,g.$swipedown,g.$swipeleft,g.$swiperight,g.$swipeup];d||(f.clientX=b.clientX,f.xTimestamp=b.timeStamp,f.xTarget=b.target,this._android44orBelow&&(this.__haveSwipeSubscribers=this.__findFirstSubscribers(f.xTarget,h).length>0)),e||(f.clientY=b.clientY,f.yTimestamp=b.timeStamp,f.yTarget=b.target,this._android44orBelow&&(this.__haveSwipeSubscribers=this.__findFirstSubscribers(f.yTarget,h).length>0))}}},a.prototype.__getRegisteredSwipes=function(b,c,d,e){var f,g=this._gestures.$swipe,h=a.config.velocities.minSwipeVelocity,i=[g],j=this.__swipeOrigin||{};return d>e?(f=j.xTarget,c.x>=h&&i.push(g+b.x)):e>d&&(f=j.yTarget,c.y>=h&&i.push(g+b.y)),this.__findFirstSubscribers(f,i)},a.prototype.__isHorizontal=function(a){return"left"===a||"right"===a},a.prototype.__appendGestureStyle=function(){var b,c,d=this._document;if(!this._compat.platCss)if(!u(d.styleSheets)&&d.styleSheets.length>0){var e=d.styleSheets[0];for(b=a.config.styleConfig,c=b.length;c-->0;)e.insertRule(this.__createStyle(b[c]),0)}else{var f=d.head,g=d.createElement("style"),h="";for(g.type="text/css",b=a.config.styleConfig,c=b.length;c-->0;)h=this.__createStyle(b[c])+h;g.textContent=h,f.appendChild(g)}},a.prototype.__createStyle=function(a){var b=a.styles||[],c=b.length,d="."+a.className+" { ",e="";c=b.length;for(var f=0;c>f;++f)e+=b[f]+";";return d+=e+" } "},a.prototype.__isFocused=function(a){return a===this.__focusedElement},a.prototype.__handleInput=function(a){var b=this,c=a.nodeName,d=this.__focusedElement||{};if(!n(c))return this.__focusedElement=null,void(t(d.blur)&&d.blur());var e;switch(c.toLowerCase()){case"input":switch(a.type){case"range":t(d.blur)&&d.blur();break;case"button":case"submit":case"checkbox":case"radio":case"file":t(d.blur)&&d.blur(),J(function(){b._document.body.contains(a)&&t(a.click)&&a.click()});break;default:return this.__focusedElement=a,a.focus(),void(e=this.addEventListener(a,"blur",function(){b.__isFocused(a)&&(b.__focusedElement=null),e()},!1))}break;case"a":case"button":case"label":t(d.blur)&&d.blur(),J(function(){b._document.body.contains(a)&&t(a.click)&&a.click()});break;case"textarea":return this.__focusedElement=a,a.focus(),void(e=this.addEventListener(a,"blur",function(){b.__isFocused(a)&&(b.__focusedElement=null),e()},!1));case"select":t(d.blur)&&d.blur(),J(function(){var c=b._document;if(c.body.contains(a)){var d=c.createEvent("MouseEvents");d.initMouseEvent("mousedown",!1,!1,null,null,null,null,null,null,null,null,null,null,null,null),a.dispatchEvent(d)}});break;default:t(d.blur)&&d.blur(),J(function(){b._document.body.contains(a)&&t(a.click)&&a.click()})}this.__focusedElement=null},a.prototype.__preventClickFromTouch=function(){var a,c=this,d=this._document,e=K(function(){d.removeEventListener("click",a,!0),d.removeEventListener("mousedown",a,!0),d.removeEventListener("mouseup",a,!0)},400);a=function(f){if(f.preventDefault(),f.stopPropagation(),d.removeEventListener(f.type,a,!0),e===b)return!1;e(),e=b;var g=c.__lastTouchDown;return u(g)||c.__isFocused(g.target)?!1:(c.__handleInput(g.target),!1)},J(function(){d.addEventListener("click",a,!0),d.addEventListener("mousedown",a,!0),d.addEventListener("mouseup",a,!0)})},a.prototype.__removeSelections=function(a){k(a)&&(v(a.onselectstart)||a.addEventListener("selectstart",this.__preventDefault,!1),v(a.ondragstart)||a.addEventListener("dragstart",this.__preventDefault,!1))},a.prototype.__returnSelections=function(a){k(a)&&(v(a.onselectstart)||a.removeEventListener("selectstart",this.__preventDefault,!1),v(a.ondragstart)||a.removeEventListener("dragstart",this.__preventDefault,!1))},a.prototype.__preventDefault=function(a){var b=a.target.nodeName;return n(b)&&(b=b.toLowerCase()),"input"===b||"textarea"===b?!0:(a.preventDefault(),!1)},a._inject={_document:Sa,_compat:Pa},a.config={intervals:{tapInterval:250,dblTapInterval:300,holdInterval:400,dblTapZoomDelay:0},distances:{minScrollDistance:3,maxDblTapDistance:10},velocities:{minSwipeVelocity:.645},styleConfig:[{className:"plat-gesture",styles:["-moz-user-select: none","-khtml-user-select: none","-webkit-touch-callout: none","-webkit-user-select: none","-webkit-user-drag: none","-webkit-tap-highlight-color: transparent","-webkit-overflow-scrolling: touch","-ms-user-select: none","-ms-touch-action: manipulation","touch-action: manipulation"]},{className:"plat-no-touch-action",styles:["-ms-touch-action: none","touch-action: none"]}]},a.gestures={$tap:Td,$dbltap:Ud,$hold:Zd,$release:$d,$swipe:_d,$swipeleft:ae,$swiperight:be,$swipeup:ce,$swipedown:de,$track:ee,$trackleft:fe,$trackright:ge,$trackup:he,$trackdown:ie,$trackend:je},a}();a.DomEvents=E,Ga.injectable(tb,E),a.IDomEventsConfig=m,Ga.injectable(ub,m);var F=function(){function a(){this._document=na(Sa)}return a.prototype.initialize=function(a,b,c){this.element=a,this.event=b,this.eventType=n(c)?c:"CustomEvent"},a.prototype.trigger=function(a,b,c){var d=this._document.createEvent(this.eventType);return h(a)&&e(!1,!1,d,a),d.initCustomEvent(this.event,!0,!0,u(b)?0:b),(c||this.element).dispatchEvent(d)},a}();a.DomEvent=F,Ga.injectable(vb,F,null,ve);var G,H=function(a){function b(b,c){a.call(this),this.count=0,this.element=b,this.event=c,this.count++}return __extends(b,a),b.prototype.trigger=function(a){var b=this._document.createEvent("CustomEvent"),c=this.element,d=a.target;this.__extendEventObject(b,a),b.initCustomEvent(this.event,!0,!0,0);var e=c.contains(d)?d.dispatchEvent(b):c.dispatchEvent(b);return e||a.preventDefault(),e},b.prototype.__extendEventObject=function(a,b){var c=b.pointerType;a.clientX=b.clientX,a.clientY=b.clientY,a.offsetX=b.offset.x,a.offsetY=b.offset.y,a.direction=b.direction||{x:"none",y:"none",primary:"none"},a.touches=b.touches,a.velocity=b.velocity||{x:0,y:0},a.identifier=b.identifier||0,a.pointerType=s(c)?this.__convertPointerType(c,b.type):c,a.screenX=b.screenX,a.screenY=b.screenY,a.pageX=b.pageX,a.pageY=b.pageY,a.buttons=b._buttons},b.prototype.__convertPointerType=function(a,b){switch(a){case MSPointerEvent.MSPOINTER_TYPE_MOUSE:return"mouse";case MSPointerEvent.MSPOINTER_TYPE_PEN:return"pen";case MSPointerEvent.MSPOINTER_TYPE_TOUCH:return"touch"}return-1===b.indexOf("mouse")?"touch":"mouse"},b}(F);!function(a){var c=function(){function a(){this._animatedElements={}}return a.prototype.create=function(a,b,c){return this._create(a,b,c,{key:null})},a.prototype.animate=function(a,b,c){return this._animate(a,b,c,{key:null})},a.prototype.enter=function(a,b,c,d,e){return this._animate(a,b,e,{key:"enter",parent:c,refChild:d})},a.prototype.leave=function(a,b,c){return this._animate(a,b,c,{key:"leave"})},a.prototype.move=function(a,b,c,d,e){return this._animate(a,b,e,{key:"move",parent:c,refChild:d})},a.prototype.show=function(a,b,c){return this._animate(a,b,c,{key:"show"})},a.prototype.hide=function(a,b,c){return this._animate(a,b,c,{key:"hide"})},a.prototype.all=function(a){for(var c=this,e=a.length,f=[],g=new d(function(b){c._Promise.all(a).then(function(){b()})}),h=0;e>h;++h)f=f.concat(a[h].getInstances());return g.initialize(f),g.then(b)},a.prototype.resolve=function(){var a=new d(function(b){b(function(){return a})});return a},a.prototype._animate=function(a,b,c,d){var e=this._create(a,b,c,d),f=e.current;return e.previous.then(function(){M(function(){f.start()})}),f},a.prototype._create=function(a,c,e,f){var g,h=this,i=yf[c],j=[],k=[];if((!this._compat.animationSupported||v(i))&&(i=zf[c],v(i)))return a=this.__constructAnimatableElements(a,{inject:b},k,j),this._handlePreInitFunctionality(a,k,f),this._handlePostInitFunctionality(a,k,f),this._handleEndFunctionality(a,k,f),g=this.resolve(),{previous:g,current:g};a=this.__constructAnimatableElements(a,i,k,j);var l=k.length;if(0===l)return this._handlePreInitFunctionality(a,k,f),this._handlePostInitFunctionality(a,k,f),this._handleEndFunctionality(a,k,f),g=this.resolve(),{previous:g,current:g};this._handlePreInitFunctionality(a,k,f);var m,n=N("animation_"),o=this.__setAnimationId(n,k),q=new d(function(b){var c=h._Promise;m=c.all(o).then(function(){for(var d=[],g=0;l>g;++g)d.push(j[g].instantiate(k[g],e));h._handlePostInitFunctionality(a,k,f);var i=c.all(d),m=h.__isParentAnimating(k),o=h.__generateAnimatedElement(n,k,q);if(!u(m)){h._handleEndFunctionality(a,k,f),o.animationEnd(!0);var r=h._animatedElements[m],s=p(r.promise)?function(){return r.promise}:function(){return q};i.then(function(){b(s)})}h.__stopChildAnimations(k),o.promise=q,i.then(function(){h._handleEndFunctionality(a,k,f),o.animationEnd(),b(function(){return q})})})});return q.initialize(j),{previous:m,current:q}},a.prototype._handlePreInitFunctionality=function(a,b,c){switch(c.key){case"move":for(var d=0;de;++e)f.insertBefore(a[e],g);break;case"show":for(d=b.length,e=0;d>e;++e)b[e].removeAttribute(Jd)}},a.prototype._handleEndFunctionality=function(a,b,c){var d,e;switch(c.key){case"leave":for(d=a.length,e=0;d>e;++e)ga(a[e]);break;case"hide":for(d=b.length,e=0;d>e;++e)b[e].setAttribute(Jd,"")}},a.prototype.__setAnimationId=function(a,b){for(var c,d,e,f=this._animatedElements,g=[],h=b.length,i=0;h>i;++i)e=b[i],d=e.__plat,v(d)?(e.__plat={animation:a},ha(e,Kd)):v(d.animation)?(d.animation=a,ha(e,Kd)):(c=f[d.animation],v(c)||(g.push(c.promise),c.animationEnd(!0)),d.animation=a);return g},a.prototype.__generateAnimatedElement=function(a,b,c){var d=this._animatedElements,e=function(e){var f,g,h,i=b.length;if(e===!0)return c.cancel(),void Q(d,a);for(var j=0;i>j;++j)g=b[j],f=g.__plat||{},h=f.animation,v(h)||h!==a||(ia(g,Kd),Q(f,"animation"),q(f)&&Q(g,"__plat"));Q(d,a)};return d[a]={animationEnd:e}},a.prototype.__isParentAnimating=function(a){for(var b,c=a[0];!j(c=c.parentNode)&&!u(c)&&c.nodeType===Node.ELEMENT_NODE;)if(la(c,Kd)&&(b=(c.__plat||{}).animation,n(b))){if(!u(this._animatedElements[b]))return b;Q(c.__plat,"animation"),q(plat)&&Q(c,"__plat"),ia(c,Kd)}},a.prototype.__stopChildAnimations=function(a){for(var b,c,d,e,f=this._animatedElements,g=Array.prototype.slice,h=0;h0;)d=b.pop().__plat||{},e=d.animation,u(e)||(c=f[e]||{},t(c.animationEnd)&&c.animationEnd(!0))},a.prototype.__constructAnimatableElements=function(a,b,c,d){if(!w(a))if(l(a))a=Array.prototype.slice.call(a.childNodes);else if(x(a))a=Array.prototype.slice.call(a);else{if(!k(a)||a.nodeType!==Node.ELEMENT_NODE)return[];a=[a]}for(var e,f=a.length,g=0;f>g;++g)e=a[g],k(e)&&e.nodeType===Node.ELEMENT_NODE&&(c.push(e),d.push(b.inject()));return a},a._inject={_compat:Pa,_Promise:Oa,_document:Sa},a}();a.Animator=c,Ga.injectable(ob,c);var d=function(a){function c(b,c){a.call(this,b),this._Promise=na(Oa),this.__animationState=0,this.__animationInstances=[],u(c)||(this.__animationInstances=c.__animationInstances,this.__animationState=c.__animationState)}return __extends(c,a),c.prototype.initialize=function(a){q(this.__animationInstances)&&(w(a)?this.__animationInstances=a:h(a)&&(this.__animationInstances=[a]))},c.prototype.getInstances=function(){return this.__animationInstances},c.prototype.start=function(){if(!(this.__animationState>0)){for(var a,b=this.__animationInstances,c=b.length,d=0;c>d;++d)a=b[d],t(a.start)&&a.start();this.__animationState=1}},c.prototype.pause=function(){if(1!==this.__animationState)return this._Promise.resolve();for(var a,c=this.__animationInstances,d=[],e=c.length,f=0;e>f;++f)a=c[f],t(a.pause)&&d.push(a.pause());return this._Promise.all(d).then(b)},c.prototype.resume=function(){if(1!==this.__animationState)return this._Promise.resolve();for(var a,c=this.__animationInstances,d=[],e=c.length,f=0;e>f;++f)a=c[f],t(a.resume)&&d.push(a.resume());return this._Promise.all(d).then(b)},c.prototype.cancel=function(){if(2===this.__animationState)return this;for(var a,b=this.__animationInstances,c=b.length,d=0;c>d;++d)a=b[d],t(a.cancel)&&a.cancel(),t(a.end)&&a.end();return this.__animationState=2,this},c.prototype.isCanceled=function(){return 2===this.__animationState},c.prototype.then=function(b){return a.prototype.then.call(this,b)},c.prototype.catch=function(b){return a.prototype.catch.call(this,b)},c}(Gf.Promise);a.AnimationPromise=d;var e=function(){function a(){this.__eventListeners=[]; +}return a.prototype.initialize=function(){},a.prototype.start=function(){},a.prototype.end=function(){for(var a=this.__eventListeners;a.length>0;)a.pop()();t(this._resolve)&&(this._resolve(),this._resolve=null)},a.prototype.pause=function(){return this._Promise.resolve()},a.prototype.resume=function(){return this._Promise.resolve()},a.prototype.cancel=function(){this.end()},a.prototype.addEventListener=function(a,c,d){if(!t(c))return this._log.warn('An animation\'s "addEventListener" must take a function as the second argument.'),b;c=c.bind(this);var e=this.dom.addEventListener(this.element,a,function(a){a.stopPropagation(),c(a)},d),f=this.__eventListeners;return f.push(e),function(){e();var a=f.indexOf(e);-1!==a&&f.splice(a,1)}},a.prototype.instantiate=function(a,b){var c=this;this.element=a,this.options=b;var e=new d(function(a){c._resolve=a,c.initialize()});return e.initialize(this),e},a._inject={_window:Gb,_compat:Pa,_log:Ya,_Promise:Oa,dom:sb,utils:Ab},a}();a.BaseAnimation=e;var f=function(a){function b(){a.apply(this,arguments),this._animationEvents=this._compat.animationEvents}return __extends(b,a),b.prototype.animationStart=function(a){return this.addEventListener(this._animationEvents.$animationStart,a,!1)},b.prototype.animationEnd=function(a){return this.addEventListener(this._animationEvents.$animationEnd,a,!1)},b.prototype.animationIteration=function(a){return this.addEventListener(this._animationEvents.$animationIteration,a,!1)},b.prototype.transitionStart=function(a){return this.addEventListener(this._animationEvents.$transitionStart,a,!1)},b.prototype.transitionEnd=function(a){return this.addEventListener(this._animationEvents.$transitionEnd,a,!1)},b}(e);a.CssAnimation=f;var g=function(a){function c(){a.apply(this,arguments),this.className=Ld,this._animationCanceled=b}return __extends(c,a),c.prototype.initialize=function(){ha(this.element,this.className+Be)},c.prototype.start=function(){var a=this;this._animationCanceled=M(function(){var b=a.element,c=a.className;if(null===b.offsetParent)return a._dispose(),void a.end();ha(b,c);var d=a._animationEvents.$animation,e=a.options||{},f=a._window.getComputedStyle(b,e.pseudo),g=f[d+"Name"];return""===g||"none"===g||"paused"===f[d+"PlayState"]?(a._dispose(),void a.end()):(e.preserveInit||ia(b,c+Be),void(a._animationCanceled=a.animationEnd(function(){a._animationCanceled=M(function(){a._dispose(),a.end()})})))})},c.prototype.pause=function(){var a=this;if(this._animationCanceled===b)return this._Promise.resolve();var c=this._compat.animationEvents;return new this._Promise(function(d){M(function(){a._animationCanceled!==b&&(a.element.style[c.$animation+"PlayState"]="paused"),d()})})},c.prototype.resume=function(){var a=this;if(this._animationCanceled===b)return this._Promise.resolve();var c=this._compat.animationEvents;return new this._Promise(function(d){M(function(){a._animationCanceled!==b&&(a.element.style[c.$animation+"PlayState"]="running"),d()})})},c.prototype.cancel=function(){this._animationCanceled(),this._dispose(),this.end()},c.prototype._dispose=function(){var a=this.className;ia(this.element,a+" "+a+Be),this._animationCanceled=b},c}(f);a.SimpleCssAnimation=g,Ga.animation(Ld,g);var i=function(a){function b(){a.apply(this,arguments),this.className=Qd}return __extends(b,a),b}(g);a.FadeIn=i,Ga.animation(Qd,i);var m=function(a){function b(){a.apply(this,arguments),this.className=Rd}return __extends(b,a),b}(g);a.FadeOut=m,Ga.animation(Rd,m);var o=function(a){function b(){a.apply(this,arguments),this.className=Nd}return __extends(b,a),b}(g);a.Enter=o,Ga.animation(Nd,o);var r=function(a){function b(){a.apply(this,arguments),this.className=Od}return __extends(b,a),b}(g);a.Leave=r,Ga.animation(Od,r);var s=function(a){function b(){a.apply(this,arguments),this.className=Pd}return __extends(b,a),b}(g);a.Move=s,Ga.animation(Pd,s);var y=function(a){function c(){a.apply(this,arguments),this.className=Md,this._animationCanceled=b,this._modifiedProperties={},this._normalizeRegex=/-/g,this._nonNumRegex=/[^\-0-9\.]/g,this._normalizedKeys={},this._transitionCount=0,this._count=0,this._started=!1,this._usingCss=!1}return __extends(c,a),c.prototype.initialize=function(){ha(this.element,this.className+Be)},c.prototype.start=function(){var a=this;this._animationCanceled=M(function(){var b=a.element,c=a.className;null===b.offsetParent&&(a._animate(),a._dispose(),a.end()),ha(b,c),a._started=!0;var d=a.utils,e=a._animationEvents.$transition,f=a.options||{},g=f.count,h=a._window.getComputedStyle(b,f.pseudo),i=h[e+"Property"],j=h[e+"Duration"];if(d.isNumber(g)&&g>0&&(a._count=g),""===i||"none"===i||""===j||"0s"===j)return a._animate(),a._dispose(),void a.end();if(f.preserveInit===!1&&ia(b,c+Be),a._animationCanceled=a.transitionEnd(a._done),!a._animate()){if(d.isEmpty(f.properties))return void a._cssTransition(h);a._dispose(),a.end()}})},c.prototype.cancel=function(){this._animationCanceled(),this._started||this._animate(),this._dispose(),this.end()},c.prototype._dispose=function(){var a=this.className;ia(this.element,a+" "+a+Be),this._animationCanceled=b},c.prototype._done=function(a){var b=a.propertyName;if(n(b)){var c=++this._transitionCount;if(b=b.replace(this._normalizeRegex,"").toLowerCase(),c0;)a=f.shift(),b=d[a],c=e[a],n(c)?(d[a]=c,b===d[a]?k++:(h[a]=b,i[a.replace(j,"").toLowerCase()]=!0)):k++;return g>k},c.prototype._cssTransition=function(a){var c,d,e,f,g=this,h=this._animationEvents.$transition,i=a[h+"Duration"].split(","),j=a[h+"Delay"].split(","),k=a[h+"Property"].split(","),l=k.length,m=[],n=this._normalizedKeys,o=this._normalizeRegex,p=this._modifiedProperties,q=0,r=0,s=!1,t=this.utils.defer.bind(this,function(c,d){g._animationCanceled!==b&&("all"===c?s=!0:a[c]!==d&&(s=!0,p[c]=d),++rq;++q)c=k[q]=k[q].trim(),d=i.length>q?i[q].trim():i[i.length-1].trim(),e=j.length>q?j[q].trim():j[j.length-1].trim(),n[c.replace(o,"").toLowerCase()]=!0,f=a[c],m.push(f),t(this._toMs(d)+this._toMs(e),[c,f])},c.prototype._toMs=function(a){var b=this._nonNumRegex,c=a.match(b)[0],d=Number(a.replace(b,""));return this.utils.isNumber(d)?"s"===c?1e3*d:"ms"===c?d:0:0},c}(f);a.SimpleCssTransition=y,Ga.animation(Md,y)}(G=a.animations||(a.animations={}));var I;!function(a){var c=function(a){function c(){a.apply(this,arguments)}return __extends(c,a),c.prototype.initialize=function(){var a,b=this._router=this._Router.currentRouter(),c=this._getParentViewport();u(c)||u(c._router)||(a=this._parentRouter=c._router,a.addChild(b)),this._navigator.initialize(b)},c.prototype.loaded=function(){var a=this;this._Promise.resolve(this._router.finishNavigating).then(function(){a._router.register(a)})},c.prototype.canNavigateTo=function(a){var b=this,c=this._Router.currentRouter,d=c(),e=!0,f=this._Injector.getDependency(a.delegate.view),g=f.inject(),i=a.parameters,j=c();if(!h(g))return this._Promise.resolve(null);if(d!==j){j.initialize(this._router);var k=na(ab);g.navigator=k,k.initialize(j)}else g.navigator=this._navigator;return t(g.canNavigateTo)&&(e=g.canNavigateTo(i,a.query)),this._Promise.resolve(e).then(function(a){return b._nextInjector=f,b._nextView=g,a})},c.prototype.canNavigateFrom=function(){var a=this.controls[0],b=!0;return h(a)&&t(a.canNavigateFrom)&&(b=a.canNavigateFrom()),this._Promise.resolve(b)},c.prototype.navigateTo=function(a){var b=this._nextInjector||this._Injector.getDependency(a.delegate.view),c=this._createNodeMap(b),d=(this.element,c.element),e=(a.parameters,a.query),f=c.uiControlNode.control;this._animator.enter(d,Nd,this.element);var g=this._managerCache.read(this.uid),h=this._ElementManagerFactory.getInstance();return g.children=[],h.initialize(c,g),t(f.navigatedTo)&&f.navigatedTo(a.parameters,e),h.setUiControlTemplate(),f.hasOwnContext?h.observeRootContext(f,h.fulfillAndLoad):h.fulfillAndLoad()},c.prototype.navigateFrom=function(){var a,c=this.controls[0];return a=h(c)&&t(c.navigatingFrom)?this._Promise.resolve(c.navigatingFrom()):this._Promise.resolve(),a.catch(b).then(function(){Of.dispose(c)})},c.prototype.dispose=function(){this._router.unregister(this),this._navigator.dispose()},c.prototype._createNodeMap=function(a){var b=this._nextView||a.inject(),c=this._document,d=a.name,e=b.replaceWith,f=q(e)||"any"===e?c.createElement("div"):c.createElement(e);return f.setAttribute(Sc,d),f.className=Tc,{element:f,attributes:{},nodes:[],uiControlNode:{control:b,nodeName:d,expressions:[],injector:a,childManagerLength:0}}},c.prototype._getParentViewport=function(){for(var a=this.parent,b=this.type;!u(a)&&a.type!==b;)a=a.parent;return a},c._inject={_Router:Eb,_Promise:Oa,_Injector:Sb,_ElementManagerFactory:gb,_document:Sa,_managerCache:mb,_animator:ob,_navigator:ab},c}(o);a.Viewport=c,Ga.control(Rc,c);var d=function(a){function b(){a.call(this),this.replaceWith=null,this.__isFirst=!1;var b=na(lb);this.__templateControlCache=b.create(Zc)}return __extends(b,a),b.prototype.initialize=function(){var a=this.options||{},b=a.value||{},c=this._id=b.id;if(u(c))return void this._log.warn(this.type+" instantiated without an id option");this._url=b.templateUrl;var d=this.__templateControlCache.read(c);return u(d)?(this.__isFirst=!0,void this._initializeTemplate()):void(this.__templatePromise=d)},b.prototype.loaded=function(){this.__isFirst||this._waitForTemplateControl(this.__templatePromise)},b.prototype.dispose=function(){if(this.__isFirst){var a=this.__templateControlCache;a.remove(this._id),0===a.info().size&&a.dispose()}},b.prototype._initializeTemplate=function(){var a=this,b=this._id;if(!u(b)){var c,d=this.endNode.parentNode,e=this._url;u(e)?(c=this._document.createDocumentFragment(),V(this.elementNodes,c)):(c=this._templateCache.read(e),X(this.elementNodes,d));var f;p(c)?f=c.catch(function(b){return u(b)?o.determineTemplate(a,e):void 0}).then(function(c){return a.bindableTemplates.add(b,c.cloneNode(!0)),a}):(this.bindableTemplates.add(b,c.cloneNode(!0)),f=this._Promise.resolve(this)),this.__templateControlCache.put(b,f)}},b.prototype._waitForTemplateControl=function(a){var b=this;p(a)&&a.then(function(a){return u(b._url)||b._url===a._url||b._log.warn("The specified url: "+b._url+" does not match the original "+b.type+' with id: "'+b._id+'". The original url will be loaded.'),b.__mapBindableTemplates(a),b.bindableTemplates.bind(b._id)}).then(function(a){var c=b.endNode;_(c.parentNode,a,c)}).catch(function(a){J(function(){b._log.warn("Problem resolving "+b.type+" url: "+a.response)})})},b.prototype.__mapBindableTemplates=function(a){var b=this.bindableTemplates;b.cache=a.bindableTemplates.cache,b.templates=a.bindableTemplates.templates},b._inject={_Promise:Oa,_templateCache:nb,_document:Sa},b}(o);a.Template=d,Ga.control(Qc,d);var e=function(a){function b(){a.apply(this,arguments)}return __extends(b,a),b.prototype.setTemplate=function(){this.innerTemplate=V(this.element.childNodes)},b.prototype.loaded=function(){this.element.appendChild(this.innerTemplate.cloneNode(!0))},b}(o);a.Ignore=e,Ga.control(Oc,e);var f=function(a){function b(){var b=this;a.call(this),this.priority=120,this._aliases={index:ke.index,even:ke.even,odd:ke.odd,first:ke.first,last:ke.last},this._blockLength=0,this._addQueue=[],this._itemLength=0,this.__listenerSet=!1,this.itemsLoaded=new this._Promise(function(a){b.__resolveFn=a})}return __extends(b,a),b.prototype.setTemplate=function(){this.bindableTemplates.add("item",this.element.childNodes)},b.prototype.contextChanged=function(a,b){w(a)?this._setListener():(this._log.debug(this.type+" context set to something other than an Array."),a=[]),this._executeEvent([{object:a,type:"splice"}])},b.prototype.loaded=function(){var a=this.options,b=this._animate=!v(a)&&a.value.animate===!0,c=this.context;if(this._container=this.element,b&&(this._animationQueue=[]),!w(c))return void(u(c)||this._log.debug(this.type+" context set to something other than an Array."));this._setAliases();var d=this._addQueue,e=c.length,f=this._addItems(0,e,0).then(function(){var a=d.indexOf(f);-1!==a&&d.splice(a,1)});d.push(f),this._setListener()},b.prototype.dispose=function(){this.__resolveFn=this._animationQueue=this._addQueue=null},b.prototype._setAliases=function(){var a=this.options;if(!v(a)){var b=a.value.aliases;if(h(b))for(var c,d=this._aliases,e=Object.keys(d),f=e.length,g=0;f>g;++g)c=b[e[g]],n(c)&&(d[e[g]]=c)}},b.prototype._addItems=function(a,b,c){var d=this,e=+(a+b),f=[],g=a;for(this._itemLength+=b;e>a;)f.push(this._bindItem(a++));return f.length>0&&(this.itemsLoaded=this._Promise.all(f).then(function(a){if(d._setBlockLength(a),c>0)for(var b=a.length,e=d._container,f=0;b>f;++f)c>f?d._appendAnimatedItem(a[f]):e.insertBefore(a[f],null);else d._appendItems(a);d._updateResource(g-1),t(d.__resolveFn)&&(d.__resolveFn(),d.__resolveFn=null)}).catch(function(a){J(function(){n(a)&&(a=new Error(a)),d._log.error(a)})})),this.itemsLoaded},b.prototype._appendItems=function(a){V(a,this._container)},b.prototype._appendAnimatedItem=function(a){if(k(a)){var b=this._animationQueue,c={animation:this._animator.enter(a,Nd,this._container).then(function(){var a=b.indexOf(c);-1!==a&&b.splice(a,1)}),op:null};b.push(c)}},b.prototype._removeItems=function(a,b){for(var c=o.dispose,d=this.controls,e=a+b;e-->a;)c(d[e]);this._updateResource(d.length-1)},b.prototype._bindItem=function(a){return this.bindableTemplates.bind("item",a,this._getAliases(a))},b.prototype._setBlockLength=function(a){this._blockLength>0||0===a.length||(this._blockLength=a[0].childNodes.length)},b.prototype._updateResource=function(a){var b=this.controls;0>a||a>=b.length||b[a].resources.add(this._getAliases(a))},b.prototype._setListener=function(){this.__listenerSet||(this.observeArray(this._executeEvent),this.__listenerSet=!0)},b.prototype._executeEvent=function(a){var b="_"+a[0].type;t(this[b])&&this[b](a)},b.prototype._getAliases=function(a){var b=0===(1&a),c={},d=this._aliases,e=Te;return c[d.index]={value:a,type:e},c[d.even]={value:b,type:e},c[d.odd]={value:!b,type:e},c[d.first]={value:0===a,type:e},c[d.last]={value:a===this.context.length-1,type:e},c},b.prototype._push=function(a){var b=a[0],c=this._addQueue,d=b.addedCount,e=this._addItems(b.index,d,this._animate?d:0).then(function(){var a=c.indexOf(e);-1!==a&&c.splice(a,1)});c.push(e)},b.prototype._pop=function(a){var b=this,c=a[0],d=c.object.length;if(0!==c.removed.length){var e=c.object.length;this._itemLength>0&&this._itemLength--,this._Promise.all(this._addQueue).then(function(){return b._animate?void b._animateItems(d,1,Od,"leave",!1).then(function(){b._removeItems(e,1)}):void b._removeItems(e,1)})}},b.prototype._unshift=function(a){var b=a[0],c=b.addedCount,d=this._addQueue;if(this._animate){var e=this._animationQueue,f=e.length;this._animateItems(0,c,Nd,null,f>0&&"clone"===e[f-1].op)}var g=this._addItems(b.object.length-c,c,0).then(function(){var a=d.indexOf(g);-1!==a&&d.splice(a,1)});d.push(g)},b.prototype._shift=function(a){var b=this,c=this._addQueue,d=a[0];if(0!==d.removed.length){this._animate&&0===c.length&&(c=c.concat([this._animateItems(0,1,Od,"clone",!0)]));var e=d.object.length;this._itemLength>0&&this._itemLength--,this._Promise.all(c).then(function(){b._removeItems(e,1)})}},b.prototype._splice=function(a){var b,c=this,d=a[0],e=d.addedCount,f=this._addQueue,g=this._itemLength,h=this._animate;if(u(e)){h&&this._cancelCurrentAnimations();var i=d.object.length,j=g-i;return void(i>g?(b=this._addItems(g,-j,0).then(function(){var a=f.indexOf(b);-1!==a&&f.splice(a,1)}),f.push(b)):g>i&&(g>=j?this._itemLength-=j:this._itemLength=0,this._Promise.all(f).then(function(){c._removeItems(g-j,j)})))}var k=d.removed.length,l=this._animationQueue;if(e>k){var m,n=e-k;if(h){m=e;var o=l.length,p=d.index;e-p>g&&(m=g-p),this._animateItems(p,m,Nd,null,o>0&&"clone"===l[o-1].op),m=e-m}else m=0;b=this._addItems(d.object.length-n,n,m).then(function(){var a=f.indexOf(b);-1!==a&&f.splice(a,1)}),f.push(b)}else if(k>e){var q=e>0;h&&!q&&0===f.length&&(f=f.concat([this._animateItems(d.index,k,Od,"clone",!0)]));var r=k-e;g>=r?this._itemLength-=r:this._itemLength=0,this._Promise.all(f).then(function(){if(h&&q){var a=l.length;c._animateItems(d.index,e,Nd,null,a>0&&"clone"===l[a-1].op)}c._removeItems(g-r,r)})}},b.prototype._calculateBlockLength=function(a,b){return this._blockLength},b.prototype._animateItems=function(a,b,c,d,e){var f=this._calculateBlockLength();if(0===f)return this._Promise.resolve();var g=a*f;switch(d){case"clone":return this._handleClonedContainerAnimation(g,b*f+g,c,e===!0);case"leave":return this._handleLeave(g,b*f+g,c);default:return this._handleSimpleAnimation(g,b*f+g,c,e===!0)}},b.prototype._handleSimpleAnimation=function(a,b,c,d){var e=this._container,f=Array.prototype.slice.call(e.childNodes,a,b);if(0===f.length)return this._Promise.resolve();var g=this._animationQueue,h=this._animator.create(f,c),i=h.current.then(function(){var a=g.indexOf(j);-1!==a&&g.splice(a,1)}),j={animation:i,op:null},k=function(){return h.previous.then(function(){i.start()}),i};if(d&&g.length>0){var l=this._cancelCurrentAnimations().then(k);return g.push(j),l}return g.push(j),k()},b.prototype._handleLeave=function(a,b,c){var d=this._container,e=Array.prototype.slice.call(d.childNodes,a,b);if(0===e.length)return this._Promise.resolve();var f=this._animationQueue,g=this._animator.leave(e,c).then(function(){var a=f.indexOf(h);-1!==a&&f.splice(a,1)}),h={animation:g,op:"leave"};return f.push(h),g},b.prototype._handleClonedContainerAnimation=function(a,b,c,d){var e=this._container,f=e.cloneNode(!0),g=Array.prototype.slice.call(f.childNodes,a,b);if(0===g.length)return this._Promise.resolve();var h,i=this._animationQueue,j=this._animator.create(g,c),k=j.current.then(function(){var a=i.indexOf(l);a>-1&&i.splice(a,1),u(h)||h.replaceChild(e,f)}),l={animation:k,op:"clone"},m=function(){return h=e.parentNode,u(h)||k.isCanceled()?k:(h.replaceChild(f,e),j.previous.then(function(){k.start()}),k)};if(d&&i.length>0){var n=this._cancelCurrentAnimations().then(m);return i.push(l),n}return i.push(l),m()},b.prototype._cancelCurrentAnimations=function(){for(var a=this._animationQueue,b=[],c=a.length,d=0;c>d;++d)b.push(a[d].animation.cancel());return this._Promise.all(b)},b._inject={_animator:ob,_Promise:Oa},b}(o);a.ForEach=f,Ga.control(Lc,f);var g=function(a){function b(){a.apply(this,arguments),this.replaceWith=$c}return __extends(b,a),b.prototype.initialize=function(){var a=this;this.on(Cd,function(){a._removeAllElements()})},b.prototype.setTemplate=function(){var a=_c,b=ad,c=ed,d=cd,e=kd,f=dd,g=bd,h=md,i=od,j=nd,k=pd;this._titleElement=this._createElement(b),this._ogTitleElement=this._createElement(a,i+b),this._twitterTitleElement=this._createElement(a,k+b),this._descriptionElement=this._createElement(a,g),this._ogDescriptionElement=this._createElement(a,i+g),this._twitterDescriptionElement=this._createElement(a,k+g),this._ogUrlElement=this._createElement(a,i+h),this._twitterUrlElement=this._createElement(a,k+h),this._authorElement=this._createElement(a,d),this._googleAuthorElement=this._createElement(c,d),this._fbAuthorElement=this._createElement(a,j+d),this._twitterCreatorElement=this._createElement(a,k+f),this._ogTypeElement=this._createElement(a,i+e)},b.prototype.title=function(a){return n(a)?(this._titleElement.innerText=a,this._setContent([this._ogTitleElement,this._twitterTitleElement],a),a):this._getContent(this._titleElement)},b.prototype.description=function(a){return n(a)?(this._setContent([this._descriptionElement,this._ogDescriptionElement,this._twitterDescriptionElement],a),a):this._getContent(this._descriptionElement)},b.prototype.url=function(a){return n(a)?(this._setContent([this._ogUrlElement,this._twitterUrlElement],a),a):this._getContent(this._ogUrlElement)},b.prototype.author=function(a){return n(a)?(this._setContent([this._authorElement],a),a):this._getContent(this._authorElement)},b.prototype.googleAuthor=function(a){return n(a)?(this._setContent([this._googleAuthorElement],a),a):this._getContent(this._googleAuthorElement)},b.prototype.fbAuthor=function(a){return n(a)?(this._setContent([this._fbAuthorElement],a),a):this._getContent(this._fbAuthorElement)},b.prototype.twitterCreator=function(a){return n(a)?(this._setContent([this._twitterCreatorElement],a),a):this._getContent(this._twitterCreatorElement)},b.prototype.fbType=function(a){return n(a)?(this._setContent([this._ogTypeElement],a),a):this._getContent(this._ogTypeElement)},b.prototype.images=function(a){var b=this;if(w(a)){var c,d,e=_c,f=od,g=pd;B(function(a){c=b._createElement(e,f+id),d=b._createElement(e,g+id),a=b._browser.urlUtils(a).href,b._setContent([c,d],a)},a)}},b.prototype.videos=function(a){var b=this;if(w(a)){var c,d=_c,e=od,f=jd,g=this._browser;B(function(a){c=b._createElement(d,e+f),a=g.urlUtils(a).href,b._setContent([c],a)},a)}},b.prototype.loaded=function(){this.url(this._browser.url())},b.prototype.navigated=function(a){this.url(a)},b.prototype._getContent=function(a){var b=a.nodeName.toLowerCase();return b===ad?a.innerText:b===_c?a.getAttribute(qd):b===ed?a.getAttribute(fd):void 0},b.prototype._setContent=function(a,b){for(var c,d,e=this.element,f=Array.prototype.slice.call(e.children),g=a.length,h=qd,i=fd,j=this._titleElement.nextSibling,k=this.dom,l=0;g>l;++l)d=a[l],c=d.nodeName.toLowerCase(),c===_c?d.setAttribute(h,b):d.setAttribute(i,b),-1===f.indexOf(d)&&k.insertBefore(e,d,j)},b.prototype._createElement=function(a,b){var c,d=n(b),e=!d||0!==b.indexOf(od)&&0!==b.indexOf(nd)?gd:hd,f=this.element;return a===ed&&(e=ld),c=d?f.querySelector(a+"["+e+'="'+b+'"]'):f.querySelector(a),k(c)||(c=this._document.createElement(a)),d&&c.setAttribute(e,b),c},b.prototype._removeAllElements=function(){var a=Array.prototype.slice,b=this._document.head.querySelectorAll("meta["+hd+'^="'+od+'"]'),c=this._document.head.querySelectorAll("meta["+gd+'^="'+pd+'"]');this._removeElements.apply(this,[this._descriptionElement,this._authorElement,this._googleAuthorElement].concat(a.call(b),a.call(c)))},b.prototype._removeElements=function(){for(var a=[],b=0;bg;++g)c=a[g],-1!==e.indexOf(c)&&d.removeChild(c)},b._inject={_document:Sa,_browser:Bb},b}(plat.ui.TemplateControl);a.Head=g;var i=function(a){function b(){a.apply(this,arguments)}return __extends(b,a),b.prototype.setTemplate=function(){this.dom.clearNode(this.element)},b.prototype.loaded=function(){var a=this.options;h(a)&&(this._onOptionsChanged(a.value),a.observe(this._onOptionsChanged))},b.prototype._onOptionsChanged=function(a,b){if(a!==b){if(!h(a))return void this._log.debug("plat-options for "+this.type+" must be an object.");var c=a.html,d=this._html;if(this._html=c,c!==d)return u(c)?void(this.controls.length>0?this._TemplateControlFactory.dispose(this.controls[0]):this.dom.clearNode(this.element)):n(c)?a.compile===!0?(this.controls.length>0?this._TemplateControlFactory.dispose(this.controls[0]):this.dom.clearNode(this.element),void this._generateTemplate(c)):void $(this.element,c):void this._log.debug("Trying to bind a non-string value to "+this.type+".")}},b.prototype._generateTemplate=function(a){var b=this,c=this.bindableTemplates,d="html";c.add(d,a),c.bind(d).then(function(a){b.element.insertBefore(a,null)})},b._inject={_TemplateControlFactory:yb},b}(o);a.InnerHtml=i,Ga.control(Mc,i);var j=function(a){function b(){var b=this;a.call(this),this.replaceWith="select",this.priority=120,this.groups={},this.itemsLoaded=new this._Promise(function(a){b.__resolveFn=a})}return __extends(b,a),b.prototype.setTemplate=function(){this.bindableTemplates.add("option",this.element.childNodes);var a=this.options||{},b=a.value||{},c=b.default;if(h(c)){var d=this._document.createElement("option"),e=c.value,f=c.textContent;d.value=v(e)?f:e,d.textContent=v(f)?e:f,this.element.insertBefore(d,null)}if(u(b.group))this._isGrouped=!1;else{var g=this._group=b.group,i=this._document.createElement("optgroup");i.label=re+g+se,this.bindableTemplates.add("group",i),this._isGrouped=!0}},b.prototype.contextChanged=function(a,b){var c=this;if(q(a))return void(q(b)||this.itemsLoaded.then(function(){c._removeItems(c.controls.length)}));if(!w(a))return void this._log.debug(this.type+" context set to something other than an Array.");var d=w(a)?a.length:0,e=w(b)?b.length:0;this._setListener(),d>e?this._addItems(d-e,e):e>d&&this._removeItems(e-d)},b.prototype.loaded=function(){if(v(this._isGrouped)){var a=this.options||{},b=a.value||{};this._isGrouped=!u(this._group=b.group)}this._defaultOption=this.element.firstElementChild;var c=this.context;return w(c)?(this._addItems(c.length,0),void this._setListener()):void this._log.debug(this.type+" context set to something other than an Array.")},b.prototype.dispose=function(){a.prototype.dispose.call(this),this.__resolveFn=null,this._defaultOption=null},b.prototype.observeProperties=function(a){var b,c=this.element;this._binder=a,c.multiple?(b=this._setSelectedIndices.bind(this),u(a.evaluate())&&this.inputChanged([]),a.observeProperty(function(){b(a.evaluate(),null,null)},null,!0)):b=this._setSelectedIndex.bind(this),a.observeProperty(b),this.addEventListener(c,"change",this._observeChange,!1)},b.prototype._setSelectedIndex=function(a,b,c,d){var e=this,f=this.element,g=f.value;if(u(a))return d!==!0&&this._document.body.contains(f)?void(f.selectedIndex=-1):void this.itemsLoaded.then(function(){u(e._binder.evaluate())&&e.inputChanged(f.value)});if(n(a)){if(g===a)return;if(!this._document.body.contains(f))return f.value=a,void(f.value!==a&&(f.value=g,this.inputChanged(f.value)))}else{var h;s(a)?(a=a.toString(),h="Trying to bind a value of type number to a "+this.type+"'s element. The value will implicitly be converted to type string."):h="Trying to bind a value that is not a string to a "+this.type+"'s element. The element's selected index will be set to -1.",this._log.debug(h)}this.itemsLoaded.then(function(){f.value=a,(f.value!==a||-1===f.selectedIndex)&&(f.selectedIndex=-1)})},b.prototype._setSelectedIndices=function(a,b,c,d){var e,f=this,g=this.element,h=g.options,i=u(h)?0:h.length,j=u(a);this.itemsLoaded.then(function(){if(!j&&w(a))for(var b,c;i-->0;)e=h[i],b=e.value,c=Number(b),-1!==a.indexOf(b)||s(c)&&-1!==a.indexOf(c)?e.selected=!0:e.selected=!1;else for(d===!0&&u(f._binder.evaluate())&&f.inputChanged(f._getSelectedValues());i-->0;){if(e=h[i],!j&&e.value===""+a)return void(e.selected=!0);e.selected=!1}})},b.prototype._observeChange=function(){var a=this.element;this.inputChanged(a.multiple?this._getSelectedValues():a.value)},b.prototype._getSelectedValues=function(){for(var a,b=this.element.options,c=b.length,d=[],e=0;c>e;++e)a=b[e],a.selected&&d.push(a.value);return d},b.prototype._setListener=function(){this.__listenerSet||(this.observeArray(this._executeEvent),this.__listenerSet=!0)},b.prototype._executeEvent=function(a){var b="_"+a[0].type;t(this[b])&&this[b](a)},b.prototype._addItems=function(a,b){for(var c=this,d=this.bindableTemplates,e=[],f=this._insertOption;a-->0;)e.push(d.bind("option",b).then(f.bind(this,b++)));return e.length>0?this.itemsLoaded=this._Promise.all(e).then(function(){t(c.__resolveFn)&&(c.__resolveFn(),c.__resolveFn=null)}):(t(this.__resolveFn)&&(this.__resolveFn(),this.__resolveFn=null),this.itemsLoaded=new this._Promise(function(a){c.__resolveFn=a})),this.itemsLoaded},b.prototype._insertOption=function(a,b){var c=this.element;if(this._isGrouped){var d=this.groups,e=(this.context[a]||{})[this._group],f=d[e];return u(f)?d[e]=this.bindableTemplates.bind("group",a).then(function(a){return f=d[e]=a.childNodes[1],f.insertBefore(b,null),c.insertBefore(a,null),f}):p(f)?f.then(function(a){a.insertBefore(b,null)}):(f.insertBefore(b,null),this._Promise.resolve())}return c.insertBefore(b,null),this._Promise.resolve()},b.prototype._removeItems=function(a){for(var b=o.dispose,c=this.controls;a-->0;)b(c.pop())},b.prototype._removeItem=function(){return this._isGrouped?void this._resetSelect():void this._removeItems(1)},b.prototype._resetSelect=function(){this._removeItems(this.controls.length),this.groups={},u(this._defaultOption)||this.element.insertBefore(this._defaultOption.cloneNode(!0),null),this._addItems(this.context.length,0)},b.prototype._push=function(a){var b=a[0];this._addItems(b.addedCount,b.index)},b.prototype._pop=function(a){var b=this;0!==a[0].removed.length&&this.itemsLoaded.then(function(){b._removeItem()})},b.prototype._unshift=function(a){if(this._isGrouped)return void this._resetSelect();var b=a[0],c=b.addedCount;this._addItems(c,b.object.length-c-1)},b.prototype._shift=function(a){var b=this;0!==a[0].removed.length&&this.itemsLoaded.then(function(){b._removeItem()})},b.prototype._splice=function(a){var b=this;if(this._isGrouped)return void this._resetSelect();var c=a[0],d=c.addedCount,e=c.removed.length;d>e?this._addItems(d-e,c.object.length-d-1):e>d&&this.itemsLoaded.then(function(){b._removeItems(e-d)})},b.prototype._sort=function(a){this._isGrouped&&this._resetSelect()},b.prototype._reverse=function(a){this._isGrouped&&this._resetSelect()},b._inject={_Promise:Oa,_document:Sa},b}(r);a.Select=j,Ga.control(Pc,j);var l=function(a){function c(){a.call(this),this.__condition=!0,this.__firstTime=!0;var b=this._document;this.commentNode=b.createComment(Nc+Ae+"placeholder"),this.fragmentStore=b.createDocumentFragment()}return __extends(c,a),c.prototype.contextChanged=function(){var a=this.options.value;if(!q(a))return this._setter(a)},c.prototype.setTemplate=function(){this.bindableTemplates.add("template",Array.prototype.slice.call(this.element.childNodes))},c.prototype.loaded=function(){u(this.options)&&(this._log.warn("No condition specified in "+cc+" for "+this.type+"."),this.options={value:{condition:!0},observe:b});var a=this.contextChanged();return this.__removeListener=this.options.observe(this._setter),a},c.prototype.dispose=function(){t(this.__removeListener)&&(this.__removeListener(),this.__removeListener=null),this.commentNode=null,this.fragmentStore=null},c.prototype._setter=function(a){var b,c=this,d=!!a.condition;return d!==this.__condition||this.__firstTime?(d?b=u(this.__leaveAnimation)?this._addItem():this.__leaveAnimation.cancel().then(function(){return c.__leaveAnimation=null,c._addItem()}):u(this.__enterAnimation)?(this._removeItem(),b=this._Promise.resolve(null)):b=this.__enterAnimation.cancel().then(function(){return c.__enterAnimation=null,c._removeItem()}),this.__condition=d,b):this._Promise.resolve(null)},c.prototype._addItem=function(){var a=this;return k(this.commentNode.parentNode)||this.__firstTime?this.__firstTime?(this.__firstTime=!1,this.__initialBind=this.bindableTemplates.bind("template").then(function(b){var c=a.element;return a.__initialBind=null,c.parentNode===a.fragmentStore?(c.insertBefore(b,null),a._animateEntrance()):(a.__enterAnimation=a._animator.animate(c,Nd),c.insertBefore(b,null),a.__enterAnimation)}).then(function(){a.__enterAnimation=null}),this.__initialBind):p(this.__initialBind)?this.__initialBind.then(function(){return a._animateEntrance()}):this._animateEntrance():this._Promise.resolve(null)},c.prototype._animateEntrance=function(){var a=this,c=this.commentNode,d=c.parentNode;return k(d)?this.__enterAnimation=this._animator.enter(this.element,Nd,d,c).then(function(){a.__enterAnimation=null}):this._animator.resolve().then(b)},c.prototype._removeItem=function(){var a=this;return p(this.__initialBind)?this.__initialBind.then(function(){return a._animateLeave()}):this._animateLeave()},c.prototype._animateLeave=function(){var a=this,c=this.element,d=c.parentElement,e=c.nextSibling;return k(d)?this.__leaveAnimation=this._animator.leave(c,Od).then(function(){ +a.__leaveAnimation=null,d.insertBefore(a.commentNode,e),a.fragmentStore.insertBefore(c,null)}):this._animator.resolve().then(b)},c._inject={_animator:ob,_Promise:Oa,_document:Sa},c}(o);a.If=l,Ga.control(Nc,l);var m=function(a){function b(){a.apply(this,arguments),this.replaceWith="a",this._router=this._Router.currentRouter()}return __extends(b,a),b.prototype.initialize=function(){this._removeClickListener=this.dom.addEventListener(this.element,"click",this._handleClick,!1)},b.prototype.loaded=function(){var a=this.options,b=this.setHref.bind(this);return h(a)?(h(a.value)||(a.value={view:""}),this.addEventListener(this.element,Td,this._handleTap,!1),b(),void a.observe(b)):(this._log.warn("No options specified for "+this.type+". Please send in options of type plat.ui.controls.ILinkOptions."),a=this.options={},a.value={view:""},void this.setHref())},b.prototype.setHref=function(){var a=this.getHref();if(!q(a)){var b=this.element;b.href=a}},b.prototype.getHref=function(){if(!u(this._router)){var a=this.options.value,b=a.view;if(a.isUrl!==!0){var c=a.parameters,d=a.query;if(q(b))return b;b=this._router.generate(b,c,d)}return this._browser.formatUrl(b)}},b.prototype._handleClick=function(a){var b;if(s(a.buttons)&&0!==a.buttons)b=a.buttons;else if(s(a.which)&&a.which>0)b=a.which;else switch(a.button){case-1:b=0;break;case 0:b=1;break;case 1:b=4;break;case 2:b=2;break;case 3:b=8;break;case 4:b=16;break;default:b=1}1===b&&a.preventDefault()},b.prototype._handleTap=function(a){var b=this;if(1===a.buttons){var c=this.getHref();v(c)||(a.preventDefault(),M(function(){b._browser.url(c)}))}},b.prototype.dispose=function(){K(this._removeClickListener,3e3)},b._inject={_Router:Eb,_Injector:Sb,_browser:Bb},b}(o);a.Link=m,Ga.control(Kc,m)}(I=a.controls||(a.controls={}))}(Qf=a.ui||(a.ui={}));var Rf;!function(a){function c(a,b,c,d,e){return i._markupRegex=a.markupRegex,i._newLineRegex=a.newLineRegex,i._ContextManager=b,i._parser=c,i._TemplateControlFactory=d,i._log=e,i}function d(a,b,c,d,e,f){return j._document=a,j._managerCache=b,j._ResourcesFactory=c,j._AttributesFactory=d,j._BindableTemplatesFactory=e,j._log=f,j}function e(){return l}function f(){return m}var g=function(){function a(){}return a.prototype.compile=function(a,b){var c,d,e,f=a.childNodes,g=!u(b),h=g?this._managerCache.read(b.uid):null,i=this._ElementManagerFactory.create;if(f=v(f)?t(a.push)?a:Array.prototype.slice.call(a):Array.prototype.slice.call(f),u(h)){c=f.length;for(var j=0;c>j;++j)e=f[j],e.nodeType===Node.ELEMENT_NODE&&(u(i(e))||this.compile(e)),d=f.length,j+=d-c,c=d}else this._compileNodes(f,h)},a.prototype._compileNodes=function(a,b){for(var c,d,e,f=a.length,g=this._ElementManagerFactory.create,h=this._CommentManagerFactory.create,i=this._TextManagerFactory.create,j=0;f>j;++j){switch(c=a[j],c.nodeType){case Node.ELEMENT_NODE:d=g(c,b),u(d)||this._compileNodes(Array.prototype.slice.call(c.childNodes),d);break;case Node.TEXT_NODE:i(c,b);break;case Node.COMMENT_NODE:h(c,b)}e=a.length,j+=e-f,f=e}},a._inject={_ElementManagerFactory:gb,_TextManagerFactory:jb,_CommentManagerFactory:eb,_managerCache:mb},a}();a.Compiler=g,Ga.injectable(db,g);var i=function(){function a(){this.isClone=!1}return a.hasMarkup=function(b){return a._markupRegex.test(b)},a.findMarkup=function(b){var c,d,e,f,g=[],h=a._wrapExpression,i=a._parser;for(b=b.replace(a._newLineRegex,"");-1!==(c=b.indexOf(re))&&-1!==(d=b.indexOf(se));){for(0!==c&&g.push(h(b.slice(0,c)));"}"===b[++d];);e=b.slice(c+2,d-2),"="===e[0]?(f=i.parse(e.slice(1).trim()),f.oneTime=!0,g.push(f)):g.push(i.parse(e.trim())),b=b.slice(d)}return c>-1&&d>=0?g.push(h(b.slice(d))):""!==b&&g.push(h(b)),g},a.build=function(b,c){for(var d,e,f="",g=b.length,i={},j=a._TemplateControlFactory.evaluateExpression,k=0;g>k;++k)if(d=b[k],e=j(d,c,i),h(e))try{f+=JSON.stringify(e,null,4)}catch(b){u(b.description)||(b.description="Cannot stringify object: "+b.description),b.message="Cannot stringify object: "+b.message,a._log.warn(b)}else u(e)||(f+=e);return f},a.observeExpressions=function(b,c,d){for(var e,f,g,h,i=a.__findUniqueIdentifiers(b),j=i.identifiers,k=i.oneTimeIdentifiers,l={listener:d,uid:c.uid};j.length>0;)f=a.__getObservationDetails(j.pop(),c),g=f.manager,u(g)||g.observe(f.absoluteIdentifier,l);for(;k.length>0;)if(e=k.pop(),f=a.__getObservationDetails(e,c),g=f.manager,!u(g)&&!f.isDefined){h=f.absoluteIdentifier;var m=g.observe(h,l),n=g.observe(h,{uid:c.uid,listener:function(){m(),n()}})}},a._wrapExpression=function(a){return{evaluate:function(){return a},identifiers:[],aliases:[],expression:a}},a.__findUniqueIdentifiers=function(a){var b,c=a.length;if(1===c)return b=a[0],b.oneTime===!0?{identifiers:[],oneTimeIdentifiers:b.identifiers.slice(0)}:{identifiers:b.identifiers.slice(0),oneTimeIdentifiers:[]};for(var d,e,f,g,h,i={},j={},k=[],l=[],m=0;c>m;++m)for(b=a[m],h=b.oneTime,d=b.identifiers,g=d.length,f=0;g>f;++f)if(e=d[f],h){if(i[e]===!0)continue;j[e]||(j[e]=!0,l.push(e))}else i[e]||(i[e]=!0,k.push(e)),j[e]===!0&&(j[e]=!1,l.splice(l.indexOf(e),1));return{identifiers:k,oneTimeIdentifiers:l}},a.__getObservationDetails=function(b,c){var d,e=a._ContextManager,f=b.split("."),g="",h=!1;if("@"===b[0]){var i,j={},k=f.shift(),l=k.slice(1);if(f.length>0&&(g="."+f.join(".")),i=j[l],u(i)&&(i=j[l]=c.findResource(l)),!u(i)&&!u(i.resource)){var m=i.resource.type;l===Xe?(d=e.getManager(Of.getRootControl(c)),g=c.absoluteContextPath+g):l===Ve?(d=e.getManager(j[l].control),g="context"+g):(m===Pe||m===Te)&&(d=e.getManager(j[l].control),g="resources."+l+".value"+g)}}else h=!v(e.getContext(c.context,f)),h||v(e.getContext(c,f))?(d=e.getManager(Of.getRootControl(c)),g=c.absoluteContextPath+"."+b):d=null;return{absoluteIdentifier:g,manager:d,isDefined:h}},a.prototype.initialize=function(a,b){this.nodeMap=a,this.parent=b,u(b)||(this.isClone=b.isClone,b.children.push(this))},a.prototype.getParentControl=function(){for(var a,b=this.parent;u(a)&&!u(b);)a=b.getUiControl(),b=b.parent;return a},a.prototype.clone=function(a,b){return 1},a.prototype.bind=function(){},a}();a.NodeManager=i,a.INodeManagerStatic=c,Ga.injectable(ib,c,[$a,bb,Za,yb,Ya],te);var j=function(a){function b(){a.apply(this,arguments),this.children=[],this.type="element",this.replace=!1,this.hasOwnContext=!1}return __extends(b,a),b.create=function(a,c){var d,e=a.nodeName.toLowerCase(),f=e,g=sf[e]||tf[e],h=!0,i=!1;if(u(g)&&(a.hasAttribute(Sc)?(e=a.getAttribute(Sc).toLowerCase(),g=sf[e]||tf[e],h=!1):a.hasAttribute(Yc+Sc)&&(e=a.getAttribute(Yc+Sc).toLowerCase(),g=sf[e]||tf[e],h=!1)),!u(g)){var j=g.inject(),k=b.locateResources(a);d={control:j,resourceElement:k,nodeName:e,expressions:[],injector:g},i=!0,h&&a.setAttribute(Sc,e);var l=j.replaceWith,m="any"===l&&h;if(!q(l)&&("any"!==l||m)&&l.toLowerCase()!==f){m&&(l="div");var o=b._document.createElement(l);o.nodeType===Node.ELEMENT_NODE&&(a=ba(a,o))}}var p=b._collectAttributes(a.attributes),r=b.getInstance();return p.element=a,!i&&n(p.childContext)?(g=vf[zb],i=!0,p.uiControlNode={control:g.inject(),resourceElement:null,nodeName:Wc,expressions:[],injector:g}):p.uiControlNode=d,r.initialize(p,c),p.hasControl||i?(r.setUiControlTemplate(),i?null:r):(r.bind=function(){return[]},r)},b.locateResources=function(a){for(var b,c,d=Array.prototype.slice.call(a.childNodes);d.length>0;)if(b=d.shift(),c=b.nodeName.toLowerCase(),c===Uc||c==="x-"+Uc)return a.removeChild(b);return null},b.clone=function(a,c,d,e,f){u(f)&&(f=b._cloneNodeMap(a.nodeMap,d,c.getUiControl()||c.getParentControl(),e));var g=b.getInstance(),h=!u(e);return g.nodeMap=f,g.parent=c,u(c)||c.children.push(g),g.replace=a.replace,g.replaceNodeLength=a.replaceNodeLength,g.hasOwnContext=a.hasOwnContext,g.isClone=!0,f.hasControl||h||(g.bind=function(){return[]}),h&&b._managerCache.put(e.uid,g),g},b.cloneUiControl=function(a,c){var d=a.uiControlNode;if(!u(d)&&!u(d.injector)){var e=d.control,f=d.injector.inject(),g=b._ResourcesFactory.getInstance(),h=b._AttributesFactory.getInstance();return f.parent=c,c.controls.push(f),f.controls=[],h.initialize(f,a.attributes),f.attributes=h,g.initialize(f,e.resources),f.resources=g,b._ResourcesFactory.addControlResources(f),u(e.innerTemplate)||(f.innerTemplate=e.innerTemplate.cloneNode(!0)),f.type=e.type,f.bindableTemplates=b._BindableTemplatesFactory.create(f,e.bindableTemplates),f.replaceWith=e.replaceWith,f}},b.createAttributeControls=function(a,c,d,e,f){var g,h=a.nodes,i=f===!0?e:a.element;if(k(i)){if(i.nodeType===Node.DOCUMENT_FRAGMENT_NODE)return f===!0?b._copyAttributeNodes(h):[];g=i.attributes}var j,l,m,o,p,q,r=a.attributes,v=[],w=h.length;for(q=0;w>q;++q)l=h[q],p=l.nodeName,m=l.injector,o=null,u(m)||(o=m.inject(),l.control=o,o.parent=c,o.element=i,j=b._AttributesFactory.getInstance(),j.initialize(o,r),o.attributes=j,o.type=p,n(o.uid)||(o.uid=N(Vb)),o.templateControl=d),f===!0&&(v.push({control:o,expressions:l.expressions,node:g?g.getNamedItem(p)||g.getNamedItem(Yc+p):null,nodeName:p,injector:m}),u(o)||(u(c)||c.controls.push(o),t(o.initialize)&&o.initialize()));if(!f)for(h.sort(function(a,b){var c=a.control,d=b.control;if(u(c))return 1;if(u(d))return-1;var e=s(c.priority)?c.priority:0,f=s(d.priority)?d.priority:0;return f-e}),q=0;w>q;++q)l=h[q],o=l.control,u(o)||(u(c)||c.controls.push(o),t(o.initialize)&&o.initialize());return v},b.getInstance=function(){var a=new b;return a._Promise=na(Oa),a._ContextManager=i._ContextManager,a._compiler=na(db),a._CommentManagerFactory=na(eb),a._ControlFactory=na(Qa),a._TemplateControlFactory=i._TemplateControlFactory,a._BindableTemplatesFactory=b._BindableTemplatesFactory,a._log=b._log,a},b._collectAttributes=function(a){for(var c,d,e,f,g,h,j,k,l=[],m=i.hasMarkup,n=i.findMarkup,o=i._parser,p=!1,q=a.length,r={},s=0;q>s;++s)c=a[s],e=c.value,d=c.name.replace(/^data-/i,"").toLowerCase(),k=sf[d]||tf[d],d===Vc?""!==e&&(f=o.parse(e),1!==f.identifiers.length&&b._log.warn("Incorrect "+Vc+": "+e+", must contain a single identifier."),g=f.identifiers[0]):d!==Sc&&(h=m(e),j=h?n(e):[],p||!h&&u(k)||(p=!0),l.push({control:null,node:c,nodeName:d,expressions:j,injector:k})),r[O(d)]=e;return{element:null,attributes:r,nodes:l,childContext:g,hasControl:p}},b._copyAttributeNodes=function(a){for(var b,c=[],d=a.length,e=0;d>e;++e)b=a[e],c.push({expressions:b.expressions,nodeName:b.nodeName});return c},b._cloneNode=function(a,b,c){return{control:c,injector:a.injector,expressions:a.expressions,node:b,nodeName:a.nodeName}},b._cloneNodeMap=function(a,c,d,e){var f=a.hasControl,g={attributes:a.attributes,childContext:a.childContext,nodes:[],element:c,uiControlNode:u(a.uiControlNode)?null:b._cloneNode(a.uiControlNode,c,e),hasControl:f};return f&&(g.nodes=b.createAttributeControls(a,d,e,c,!0)),g},b.prototype.clone=function(a,c,d){var e,f,g,h,i=this.replace,j=this.children,k=u(d)?null:d.uiControlNode.control,l=!u(k);if(l||(k=b.cloneUiControl(this.nodeMap,c.getUiControl()||c.getParentControl()),l=!u(k)),i){var m=a.parentNode.childNodes,n=Array.prototype,o=n.indexOf.call(m,a);e=n.slice.call(m,o+1,o+this.replaceNodeLength),f=b.clone(this,c,null,k,d),k.elementNodes=e,k.startNode=a,k.endNode=e.pop(),g=j.shift(),h=j.shift(),g.clone(k.startNode,f),h.clone(k.endNode,f),t(k.initialize)&&k.initialize()}else e=Array.prototype.slice.call(a.childNodes),f=b.clone(this,c,a,k,d),d=f.nodeMap,l&&(k.element=a,t(k.initialize)&&k.initialize());for(var p=j.length,q=0,r=0;p>r;++r)q+=j[r].clone(e[q],f);return i?(j.unshift(h),j.unshift(g),q+2):1},b.prototype.initialize=function(c,d,e){a.prototype.initialize.call(this,c,d);var f,g=c.uiControlNode,h=!u(g);h&&(this._populateUiControl(),f=g.control,this.hasOwnContext=f.hasOwnContext),c.hasControl&&b.createAttributeControls(c,this.getParentControl(),f),!e&&h&&t(f.initialize)&&f.initialize()},b.prototype.bind=function(){var a=this,b=this.nodeMap,c=this.getParentControl(),d=b.uiControlNode,e=[];if(!u(d)){var f,g=d.control,i=b.childContext,j=this._ContextManager.getManager,k=u(c)?Ia:c.absoluteContextPath,l=this._TemplateControlFactory,m=!g.hasOwnContext;if(e.push(g),m&&!u(i))if("@"===i[0]){var n=i.split("."),o=n.shift(),p=o.slice(1),q=l.findResource(g,p);if(h(q)){var r=q.resource;i=n.length>0?"."+n.join("."):"",p===Xe?k+=i:p===Ve?k=Ia+i:r.type===Pe||r.type===Te?(k="resources."+p+".value"+i,g.root=q.control):this._log.warn('Only resources of type "observable" can be set as context.')}else this._log.warn("Could not set the context of "+g.type+' with the resource specified as "'+i+'".')}else k+="."+i;h(g.root)||(g.root=this._ControlFactory.getRootControl(g)||g),f=j(g.root);var s=!1;m?(g.context=f.getContext(k.split("."),!1),s=v(g.context)&&!this._BindableTemplatesFactory.isBoundControl(g)):k=Ia,s?this.contextPromise=new this._Promise(function(b,c){var d=f.observe(k,{uid:g.uid,listener:function(c,e){v(c)||(d(),g.context=c,a._beforeLoad(g,k),b())}})}):this._beforeLoad(g,k)}return this._observeControlIdentifiers(b.nodes,c,e,b.element),e},b.prototype.setUiControlTemplate=function(a){var b=this,c=this.nodeMap.uiControlNode;if(!u(c)){var d=c.control;return void(this.templatePromise=this._TemplateControlFactory.determineTemplate(d,a).then(function(a){b.templatePromise=null,b._initializeControl(d,a.cloneNode(!0))},function(a){if(b.templatePromise=null,u(a)){var c=a;b._BindableTemplatesFactory.isBoundControl(d)&&(c=V(d.element.childNodes)),b._initializeControl(d,c)}else J(function(){n(a)&&(a=new Error(a)),b._log.error(a)})}))}u(this.parent)&&this.bindAndLoad()},b.prototype.getUiControl=function(){var a=this.nodeMap.uiControlNode;if(!u(a))return a.control},b.prototype.fulfillTemplate=function(){var a=this;return u(this.templatePromise)?this._fulfillChildTemplates():this.templatePromise.then(function(){return a._fulfillChildTemplates()})},b.prototype.fulfillAndLoad=function(){var a=this;return this.fulfillTemplate().then(function(){return a.bindAndLoad()}).catch(function(b){J(function(){n(b)&&(b=new Error(b)),a._log.error(b)})})},b.prototype.bindAndLoad=function(){var a,b=this,c=this.bind();return a=p(this.contextPromise)?this.contextPromise.then(function(){return b._bindChildren()}):this._bindChildren(),a.then(function(){return b._loadControls(c,b.getUiControl())}).catch(function(a){J(function(){n(a)&&(a=new Error(a)),b._log.error(a)})})},b.prototype.observeRootContext=function(a,b){var c=this;return b=b.bind(this),u(a.context)?new this._Promise(function(d){var e=c._ContextManager.getManager(a).observe(Ia,{listener:function(){e(),b().then(d)},uid:a.uid})}).catch(function(a){J(function(){n(a)&&(a=new Error(a)),c._log.error(a)})}):b()},b.prototype._beforeLoad=function(a,c){var d=this._ContextManager.getManager(a.root),e=this._TemplateControlFactory;a.zCC__plat=d.observe(c,{uid:a.uid,priority:qe,listener:function(b,c){a.context=b}}),e.setAbsoluteContextPath(a,c),e.setContextResources(a),b._ResourcesFactory.bindResources(a.resources)},b.prototype._bindChildren=function(){for(var a,b=this.children,c=b.length,d=[],e=0;c>e;++e)a=b[e],a.hasOwnContext?this.isClone?d.push(a.observeRootContext(a.getUiControl(),a.bindAndLoad)):d.push(a.observeRootContext(a.getUiControl(),a.fulfillAndLoad)):v(a.children)?a.bind():d.push(a.bindAndLoad());return this._Promise.all(d)},b.prototype._loadControls=function(a,b){var c,d,e,f,g=a.length,h=this._ControlFactory.load,i=u(b);if(i)f=0;else{var j=b.priority;e=s(j)?j:100,f=1}for(;g>f;++f)c=a[f],c.templateControl=b,!i&&e>c.priority&&(i=!0,d=h(b)),h(c);return i||(d=h(b)),d},b.prototype._populateUiControl=function(){var a=this.nodeMap,c=this.getParentControl(),d=a.uiControlNode,e=d.control,f=e.uid,g=e.resources,i=a.element,j=Array.prototype.slice.call(i.childNodes),k=b._AttributesFactory.getInstance(),l=this.replace=null===e.replaceWith||""===e.replaceWith;n(f)||(f=e.uid=N(Vb)),b._managerCache.put(f,this),u(c)||e.parent===c||(c.controls.push(e),e.parent=c),t(i.setAttribute)&&i.setAttribute(Jd,""),e.element=i,e.controls=[],k.initialize(e,a.attributes),e.attributes=k,h(g)&&t(g.add)?g.add(d.resourceElement):(g=b._ResourcesFactory.getInstance(),g.initialize(e,d.resourceElement),e.resources=g),b._ResourcesFactory.addControlResources(e),e.type=d.nodeName,e.bindableTemplates=e.bindableTemplates||this._BindableTemplatesFactory.create(e),!(j.length>0)||q(e.templateString)&&q(e.templateUrl)||(e.innerTemplate=V(j)),l&&this._replaceElement(e,a)},b.prototype._replaceElement=function(a,c){var d=c.element,e=d.parentNode,f=b._document,g=a.type,h=a.uid,i=a.startNode=f.createComment(g+" "+h+Ce),j=a.endNode=f.createComment(g+" "+h+De),k=this._CommentManagerFactory.create;k(i,this),k(j,this),e.insertBefore(i,d),e.insertBefore(j,d.nextSibling),a.elementNodes=aa(d),a.element=c.element=null},b.prototype._initializeControl=function(a,c){var d,e=this.nodeMap.element,f=this.replace;if(!u(c)){var g=b.locateResources(c);u(g)||a.resources.add(b._ResourcesFactory.parseElement(g)),f?(d=a.endNode,a.elementNodes=Array.prototype.slice.call(c.childNodes),_(d.parentNode,c,d)):_(e,c,e.lastChild)}if(t(a.setTemplate)&&a.setTemplate(),f){this._compiler.compile(a.elementNodes,a);var h=a.startNode,i=h.parentNode,j=Array.prototype.slice.call(i.childNodes);d=a.endNode,a.elementNodes=j.slice(j.indexOf(h)+1,j.indexOf(d)),this.replaceNodeLength=a.elementNodes.length+2}else this._compiler.compile(e,a);u(a.parent)&&this.fulfillAndLoad()},b.prototype._observeControlIdentifiers=function(a,b,c,d){for(var e,f,g,h=a.length,j=!u(b),k=0,l=this.replace,m=[];h>k;++k)e=a[k],f=e.control,j&&e.expressions.length>0&&(g=o.getInstance(),m.push(g),g.initialize(d,e,b,c,l),i.observeExpressions(e.expressions,b,g.attributeChanged.bind(g))),u(f)||c.push(f);for(h=m.length,k=0;h>k;++k)m[k].attributeChanged()},b.prototype._fulfillChildTemplates=function(){for(var a,b=this,c=this.children,d=c.length,e=[],f=0;d>f;++f)a=c[f],v(a.children)||e.push(a.fulfillTemplate());return this._Promise.all(e).catch(function(a){J(function(){n(a)&&(a=new Error(a)),b._log.error(a)})})},b._inject={_Promise:Oa,_ContextManager:bb,_compiler:db,_CommentManagerFactory:eb,_ControlFactory:Qa,_TemplateControlFactory:yb,_BindableTemplatesFactory:rb,_log:Ya},b}(i);a.ElementManager=j,a.IElementManagerFactory=d,Ga.injectable(gb,d,[Sa,mb,wb,pb,rb,Ya],we),Ga.injectable(hb,j,null,ve);var l=function(a){function c(){a.apply(this,arguments),this.type="text"}return __extends(c,a),c.create=function(a,d){var e=a.nodeValue,f=new c;if(i.hasMarkup(e)){var g=i.findMarkup(e),h={nodes:[{node:a,expressions:g}]};return f.initialize(h,d),f}return f.initialize(null,d),f.bind=b,f},c._cloneNodeMap=function(a,b){var c=a.nodes[0],d={nodes:[{expressions:c.expressions,nodeName:c.nodeName,node:b}]};return d},c._clone=function(a,d,e){var f=a.nodeMap,g=new c;return u(f)?(g.initialize(null,e),g.bind=b):g.initialize(c._cloneNodeMap(f,d),e),g},c.prototype.clone=function(a,b){return c._clone(this,a,b),1},c.prototype.bind=function(){var a=this.getParentControl(),b=this.nodeMap.nodes[0],c=b.node,d=b.expressions;i.observeExpressions(b.expressions,a,this._setText.bind(this,c,a,d)),this._setText(c,a,d)},c.prototype._setText=function(a,b,c){a.nodeValue=i.build(c,b||{})},c}(i);a.TextManager=l,a.ITextManagerFactory=e,Ga.injectable(jb,e,null,we),Ga.injectable(kb,l,null,ve);var m=function(a){function b(){a.apply(this,arguments),this.type="comment"}return __extends(b,a),b.create=function(a,c){var d=new b;return d.initialize({nodes:[{node:a}]},c),d},b.prototype.clone=function(a,c){return b.create(a,c),1},b}(i);a.CommentManager=m,a.ICommentManagerFactory=f,Ga.injectable(eb,f,null,we),Ga.injectable(fb,m,null,ve);var o=function(){function a(){this._lastValues={}}return a.getInstance=function(){var b=new a;return b._NodeManager=na(ib),b._markupRegex=na($a).markupRegex,b},a.prototype.initialize=function(a,b,c,d,e){this.element=a,this.node=b,this.parent=c,this._controls=d,this.replace=e,"class"!==b.nodeName?this.attributeChanged=this._staticAttributeChanged:(this.attributeChanged=this._dynamicAttributeChanged,this._bindingExpressions=this._getBindingExpressions(b.expressions))},a.prototype._getBindingExpressions=function(a){return z(function(a){return a.identifiers.length>0||a.aliases.length>0||""===a.expression.trim()},a)},a.prototype._dynamicAttributeChanged=function(){var a,b,c,d=this.node,e=d.node,f=this._NodeManager.build(this._bindingExpressions,this.parent),g=f.split(/\s/),h=this._lastValues,i=this.element;for(this._NodeManager.hasMarkup(e.value)&&(e.value=e.value.replace(this._markupRegex,"")),b=g.length,c=0;b>c;++c)h[g[c]]=!0;for(g=Object.keys(h),b=g.length,c=0;b>c;++c)a=g[c],h[a]?(ha(i,a),h[a]=!1):(Q(h,a),ia(i,a));f=e.value,this._notifyAttributes(d.nodeName,f)},a.prototype._staticAttributeChanged=function(){var a=(this._controls,this.node),b=O(a.nodeName),c=this._NodeManager.build(a.expressions,this.parent);this._notifyAttributes(b,c),this.replace||(a.node.value=c)},a.prototype._notifyAttributes=function(a,b){for(var c,d,e=this._controls,f=e.length,g=0;f>g;++g)c=e[g].attributes,d=c[a],c[a]=b,c._attributeChanged(a,b,d)},a}();a.AttributeManager=o}(Rf=a.processing||(a.processing={}));var Sf;!function(a){function c(a){return a.history}function d(a){return r._regex=a,r}function e(){return C}function g(){return I}var i=function(){function a(){this.uid=N(Vb),this.isRoot=!1,this._removeUrlListener=b,this._ignoreOnce=!1,this._backNavigate=!1}return a.prototype.initialize=function(b){this._router=b,h(b)&&b.isRoot&&!h(a._root)&&(this.isRoot=!0,a._root=this,this._observeUrl())},a.prototype.navigate=function(a,b){var c=this;b=h(b)?b:{};var d;return this.finishNavigating().then(function(){if(d=b.isUrl?a:c._generate(a,b.parameters,b.query),!n(d)){var e=new Error("Cannot serialize url from input parameters, check your view reference.");c._log.error(e)}return c._navigate(d,b.replace)})},a.prototype.finishNavigating=function(){var c=a._root._router;return c.navigating?c.finishNavigating.catch(b):this._Promise.resolve()},a.prototype.goBack=function(b){var c=this;b=h(b)?b:{};var d=Number(b.length);return s(d)||(d=1),this.isRoot?(this._backNavigate=!0,this.finishNavigating().then(function(){return c._goBack(d)})):a._root.goBack(b)},a.prototype.dispose=function(){this._removeUrlListener(),Q(this,"router")},a.prototype._navigate=function(b,c){var d=this;return this.isRoot?new this._Promise(function(a,e){d._resolveNavigate=a,d._rejectNavigate=e,d._browser.url(b,c)}):a._root._navigate(b,c)},a.prototype._goBack=function(a){var b=this;return new this._Promise(function(c,d){b._resolveNavigate=c,b._rejectNavigate=d,b._browser.back(a)})},a.prototype._observeUrl=function(){var a=this;if(h(this._router)){var b,c,d=this._EventManager,e=na($c),f=h(e)&&t(e.navigated),g=function(d){a._ignoreOnce=!0,a._previousUrl=b,a._browser.url(b,!c),a._history.go(-1),t(a._rejectNavigate)&&a._rejectNavigate(d),q(d)||a._log.warn(d)};this._previousUrl=this._browser.url(),d.dispose(this.uid),d.on(this.uid,Gd,function(){var b=d.dispatch(Id,a,d.DIRECT);b.defaultPrevented||a.goBack()}),d.on(this.uid,Dd,function(h,i){return a._ignoreOnce?(a._ignoreOnce=!1,void(t(a._resolveNavigate)&&a._resolveNavigate())):(c=a._backNavigate,a._backNavigate=!1,b=a._previousUrl,h=d.dispatch(Ad,a,d.DIRECT,[i]),h.defaultPrevented?void g(new Error("Navigation prevented during "+Ad+" event")):void a.finishNavigating().then(function(){return d.dispatch(Cd,a,d.DIRECT,[i]),a._router.navigate(i.pathname,i.query)}).then(function(){a._previousUrl=i.pathname,t(a._resolveNavigate)&&a._resolveNavigate(),f&&e.navigated(i.href),d.dispatch(Bd,a,d.DIRECT,[i])},g))})}},a.prototype._generate=function(a,b,c){return u(this._router)?void 0:q(a)?a:this._router.generate(a,b,c)},a._inject={_Promise:Oa,_Injector:Sb,_browserConfig:Cb,_browser:Bb,_EventManager:Va,_window:Gb,_log:Ya,_history:Tb},a}();a.Navigator=i,Ga.injectable(ab,i,null,ve),a.History=c,Ga.injectable(Tb,c,[Gb]);var j,k=["/",".","*","+","?","|","(",")","[","]","{","}","\\"],l=new RegExp("(\\"+k.join("|\\")+")","g"),m={},o={},p={},r=function(){function a(){this.type=le,this.name="",this.regex=""}return a.parse=function(b,c,d){if(!(n(b)&&w(c)&&h(d)))return[];"/"===b[0]&&(b=b.slice(1));for(var e,f,g,i=b.split("/"),k=i.length,l=a.__findSegment,q=[],r=a._regex,s=0;k>s;++s)e=i[s],""===e?(h(j)||(j=na(Kb)),q.push(j)):(g=e.match(r.dynamicSegmentsRegex))?(f=g[1],q.push(l(f,Nb,m)),c.push(f),d.dynamics++):(g=e.match(r.splatSegmentRegex))?(f=g[1],q.push(l(f,Ob,o)),c.push(f),d.splats++):(q.push(l(e,Lb,p)),d.statics++);return q},a.__findSegment=function(a,b,c){var d=c[a];return h(d)||(d=c[a]=na(b),d.initialize(a)),d},a.prototype.initialize=function(a){this.name=a},a.prototype.reduceCharacters=function(a,b){return h(this._specification)&&(b=a(b,this._specification)),b},a.prototype.generate=function(a){return this.name},a}();a.BaseSegment=r,a.IBaseSegmentFactory=d,plat.register.injectable(Jb,d,[$a],we),plat.register.injectable(Kb,r,null,ve);var x=function(a){function b(){a.apply(this,arguments),this.type=ne}return __extends(b,a),b.prototype.initialize=function(b){a.prototype.initialize.call(this,b),this.regex=this.name.replace(l,"\\$1")},b.prototype.reduceCharacters=function(a,b){for(var c=this.name,d=c.length,e=b,f=0;d>f;++f)e=a(e,{validCharacters:c[f]});return e},b}(r);a.StaticSegment=x,plat.register.injectable(Lb,x,null,ve);var y=function(a){function b(){a.apply(this,arguments),this.type=me}return __extends(b,a),b.prototype.generate=function(a){return h(a)?a[this.name]:void 0},b}(r);a.VariableSegment=y,plat.register.injectable(Mb,y,null,ve);var z=function(a){function b(){a.apply(this,arguments),this.type=oe,this.regex="(.+)",this._specification={invalidCharacters:"",repeat:!0}}return __extends(b,a),b}(y);a.SplatSegment=z,plat.register.injectable(Ob,z,null,ve);var A=function(a){function b(){a.apply(this,arguments),this.type=pe,this.regex="([^/]+)",this._specification={invalidCharacters:"/",repeat:!0}}return __extends(b,a),b}(y);a.DynamicSegment=A,plat.register.injectable(Nb,A,null,ve);var C=function(){function a(){this.initialize()}return a.compile=function(a,b){return a.reduceCharacters(function(a,b){return a.add(b)},b)},a.link=function(a,b){for(var c,d,e,f,g,h=a.delegates,i=a.regex,j=h.length,k=b.match(i),l=1,m=[],n=0;j>n;++n){for(g=h[n],c=g.names,d={},e=0,f=c.length;f>e;++e)d[c[e]]=k[l++];m.push({delegate:g.delegate,parameters:d,isDynamic:f>0})}return m},a.recognize=function(a,b){for(var c,d=[],e=b.length,f=0;e>f;++f)c=b[f],d=d.concat(c.match(a));return d},a.sort=function(a){if(!w(a))return a;var b,c,d,e,f,g,h,i;return a.sort(function(a,j){if(b=a.types,f=j.types,c=b.splats,g=f.splats,c!==g)return c-g;if(d=b.statics,e=b.dynamics,h=f.statics,i=f.dynamics,c>0){if(d!==h)return h-d;if(e!==i)return i-e}return e!==i?e-i:d!==h?h=d:0})},a.prototype.initialize=function(a){this.specification=a,this.nextStates=[]},a.prototype.add=function(b){var c=this._find(b);return h(c)?c:(c=na(a),c.initialize(b),this.nextStates.push(c),b.repeat&&c.nextStates.push(c),c)},a.prototype.match=function(a){var b,c,d=[];return this._someChildren(function(e){return b=e.specification,c=b.validCharacters,n(c)&&c.indexOf(a)>-1?void d.push(e):(c=b.invalidCharacters,void(n(c)&&-1===c.indexOf(a)&&d.push(e)))}),d},a.prototype._find=function(a){var b,c,d=a.validCharacters,e=a.invalidCharacters;return this._someChildren(function(a){return b=a.specification,b.validCharacters===d&&b.invalidCharacters===e?(c=a,!0):void 0}),c},a.prototype._someChildren=function(a){for(var b=this.nextStates,c=b.length,d=0;c>d;++d)if(a(b[d])===!0)return!0;return!1},a}();a.State=C,a.IStateStatic=e,plat.register.injectable(Pb,e,null,te),plat.register.injectable(Qb,C,null,ve);var E=function(){function a(){this._namedRoutes={}}return a.prototype.register=function(a,b){if(w(a)){for(var c,d=this._rootState,e=a.length,f=["^"],g={statics:0,dynamics:0,splats:0},i=[],j=[],k=0;e>k;++k)c=this._parse(a[k],i,g),j=j.concat(c),d=this._compile(c,d,f);d=this._finalize(d,f),d.delegates=i,d.regex=new RegExp(f.join("")+"$"),d.types=g,h(b)&&n(b.name)&&(this._namedRoutes[this._toLowerCase(b.name)]={segments:j,delegates:i})}},a.prototype.recognize=function(a){var b=!1,c=[];return a=this._addLeadingSlash(a),b=this._hasTrailingSlash(a),b&&(a=a.substr(0,a.length-1)),c=this._filter(this._findStates(a)),this._link(c[0],a,b)},a.prototype.generate=function(a,b){a=this._toLowerCase(a);var c,d,e=this._namedRoutes[a],f="";if(h(e)){c=e.segments,d=c.length;for(var g=0;d>g;g++){var i=c[g];i.type!==le&&(f+="/",f+=i.generate(b))}return f=this._addLeadingSlash(f)}},a.prototype.delegatesFor=function(a){a=this._toLowerCase(a);var b,c=this._namedRoutes[a];return h(c)?(b=c.delegates,w(b)?b.slice(0):[]):[]},a.prototype.exists=function(a){return h(this._namedRoutes[this._toLowerCase(a)])},a.prototype._toLowerCase=function(a){return n(a)?a.toLowerCase():a},a.prototype._finalize=function(a,b){return a===this._rootState&&(a=a.add({validCharacters:"/"}),b.push("/")),a},a.prototype._parse=function(a,b,c){var d=[];return b.push({delegate:a.delegate,names:d}),this._BaseSegmentFactory.parse(a.pattern,d,c)},a.prototype._compile=function(a,b,c){for(var d,e=a.length,f=this._State.compile,g=0;e>g;++g)d=a[g],d.type!==le&&(b=b.add({validCharacters:"/"}),b=f(d,b),c.push("/"+d.regex));return b},a.prototype._addLeadingSlash=function(a){return a=decodeURI(a),"/"!==a[0]&&(a="/"+a),a},a.prototype._hasTrailingSlash=function(a){var b=a.length;return b>1&&"/"===a[b-1]},a.prototype._findStates=function(a){for(var b=[this._rootState],c=this._State.recognize,d=a.length,e=0;d>e&&(b=c(a[e],b),0!==b.length);++e);return b},a.prototype._filter=function(a){for(var b,c=a.length,d=[],e=0;c>e;++e)b=a[e],w(b.delegates)&&d.push(b);return this._State.sort(d)},a.prototype._link=function(a,b,c){return h(a)&&w(a.delegates)?(c&&this._isDynamic(a)&&(b+="/"),this._State.link(a,b)):void 0},a.prototype._isDynamic=function(a){return"(.+)$"===a.regex.source.slice(-5)},a._inject={_BaseSegmentFactory:Jb,_State:Pb,_rootState:Qb},a}();a.RouteRecognizer=E,plat.register.injectable(Rb,E,null,ve);var G="/*childRoute",H=G.length,I=function(){function a(){this.navigating=!1,this.children=[],this.isRoot=!1,this._paramTransforms={},this._queryTransforms={},this._interceptors={},this._ports=[],this._resolve=this._Promise.resolve.bind(this._Promise),this._reject=this._Promise.reject.bind(this._Promise),this.uid=N(Vb),this.isRoot=u(a.currentRouter()),a.currentRouter(this),this.initialize()}return a.currentRouter=function(b){return u(b)||(a.__currentRouter=b),a.__currentRouter},a.prototype.initialize=function(a){this.parent=a},a.prototype.addChild=function(a){return u(a)||this.children.indexOf(a)>-1?a:(a.initialize(this),this.children.push(a),a)},a.prototype.removeChild=function(a){var b=this.children,c=this.children.indexOf(a);0>c||b.splice(c,1)},a.prototype.register=function(a){var c=this,d=this._ports;return u(a)||d.indexOf(a)>-1?this._resolve():(d.push(a),h(this.currentRouteInfo)?(this.navigating=!0,this._resolve(this.finishNavigating).catch(b).then(function(){var a=f(c.currentRouteInfo,!0);return c.finishNavigating=c._canNavigateTo(a).then(function(b){return b?(c.currentRouteInfo=void 0,c._performNavigation(a)):void 0}).then(function(){c.navigating=!1,c.currentRouteInfo=a},function(){c.navigating=!1})})):this._resolve())},a.prototype.unregister=function(a){var b=this._ports,c=b.indexOf(a);0>c||(b.splice(c,1),0!==b.length||u(this.parent)||this.parent.removeChild(this))},a.prototype.configure=function(a){var b=this;return w(a)?B(function(a){b._configureRoute(a)},a):this._configureRoute(a),this._forceNavigate()},a.prototype.unknown=function(a){return this._unknownHandler=a,this},a.prototype.param=function(a,b,c){return this._addHandler(a,b,c,this._paramTransforms)},a.prototype.queryParam=function(a,b,c){return this._addHandler(a,b,c,this._queryTransforms)},a.prototype.intercept=function(a,b){v(b)&&(b="*");var c=b;"*"!==b&&(b=this._Injector.convertDependency(b)),b===Je&&(b=c);var d=this._interceptors[b];return w(d)||(d=this._interceptors[b]=[]),d.push(a),this},a.prototype.navigate=function(a,b,c){var d=this;h(b)||(b={});var e=this._resolve,g=T(b);if("/"===a&&(a=""),c=c===!0,!n(a)||this.navigating||!c&&a===this._previousUrl&&g===this._previousQuery)return this.navigating?this.finishNavigating.then(function(){ +return d.navigate(a,b,c)}):e();var i,j,k,l=this._recognizer.recognize(a);if(q(l)){if(l=this._childRecognizer.recognize(a),q(l)){if(this._previousUrl=a,this._previousQuery=g,t(this._unknownHandler)){var m={segment:a,view:void 0};return e(this._unknownHandler(m)).then(function(){var b=m.view;if(!v(b))return d.configure({pattern:a,view:b})})}return e()}if(i=l[0],i.query=b,j=i.delegate.pattern,j=j.substr(0,j.length-H),this._previousPattern===j)return this.navigating=!0,this.finishNavigating=this._navigateChildren(i).then(function(){d._previousUrl=a,d._previousQuery=g,d.navigating=!1},function(a){throw d.navigating=!1,a})}else i=l[0],i.query=b,j=i.delegate.pattern;k=this._recognizer.generate(i.delegate.view,i.parameters);var o=this._previousSegment;this._previousSegment=k,this.navigating=!0;var p=this._nextRouteInfo=f(i,!0);return this.finishNavigating=this._canNavigate(i).then(function(b){if(!b)throw d.navigating=!1,new Error("Not cleared to navigate");return d._previousUrl=a,d._previousQuery=g,d._performNavigation(i)}).then(function(){d._previousPattern=j,d._previousSegment=k,d.currentRouteInfo=p,d.navigating=!1},function(a){throw d._previousSegment=o,d.navigating=!1,a})},a.prototype.generate=function(a,b,c){var d=a;a=this._Injector.convertDependency(a),a===Je&&(a=d);for(var e=this,f="";!u(e)&&!e._recognizer.exists(a);)e=e.parent;if(u(e))throw new Error("Route for "+a+" does not exist.");for(var g,h=e._recognizer.generate(a,b);!u(e=e.parent);)g=e._previousSegment,g=u(g)||"/"===g?"":g,f=g+f;return f+h+T(c)},a.prototype._configureRoute=function(a){var b=this._Injector.convertDependency(a.view),c=a.alias||b;if(b!==Je){a.view=b,a.alias=c||b;var d={pattern:a.pattern,delegate:a},e=a.pattern+G,f={pattern:e,delegate:{pattern:e,view:b,alias:c}};this._recognizer.register([d],{name:c}),this._childRecognizer.register([f])}},a.prototype._addHandler=function(a,b,c,d){v(c)&&(c="*");var e=c;if("*"!==c&&(c=this._Injector.convertDependency(c)),c===Je&&(c=e),q(c)||q(b))return this;var f=d[c];h(f)||(f=d[c]={});var g=f[b];return w(g)||(g=f[b]=[]),g.push(a),this},a.prototype._forceNavigate=function(){var a,b=this,c=this._resolve;if(this.navigating)return this.finishNavigating.then(function(){return b._forceNavigate()});if(this.isRoot&&q(this._previousUrl)){var d=this._browser.urlUtils();this._previousUrl=d.pathname,a=d.query}return q(this._previousQuery)||(a=S(this._previousQuery)),q(this._previousUrl)?c():this.navigate(this._previousUrl,a,!0)},a.prototype._navigateChildren=function(a){var c=this._getChildRoute(a);return u(c)?this._resolve():D(function(b){return b.navigate(c,a.query)},this.children).then(b)},a.prototype._getChildRoute=function(a){if(!u(a)){var b=a.parameters.childRoute;return n(b)||(b=""),"/"+b}},a.prototype._performNavigation=function(a){var b=this,c=this._isSameRoute(this._nextRouteInfo);return this._performNavigateFrom(c).then(function(){return c?void 0:D(function(b){return b.navigateTo(a)},b._ports)}).then(function(){return b._navigateChildren(a)})},a.prototype._performNavigateFrom=function(a){var c=this;return D(function(a){return a._performNavigateFrom()},this.children).then(function(){return a?void 0:D(function(a){return a.navigateFrom()},c._ports)}).then(b)},a.prototype._canNavigate=function(a){var b=this,c=this._isSameRoute(this._nextRouteInfo);return this._canNavigateFrom(c).then(function(d){return d&&b._canNavigateTo(a,c)})},a.prototype._canNavigateFrom=function(a){var b=this;return this._Promise.all(this.children.reduce(function(a,b){return a.concat(b._canNavigateFrom())},[])).then(U).then(function(c){return!c||a?[c]:D(function(a){return a.canNavigateFrom()},b._ports)}).then(U)},a.prototype._canNavigateTo=function(a,b){var c=this;return q(this._ports)?this._resolve(!0):this._callAllHandlers(a.delegate.alias,a.parameters,a.query).then(function(){return c._callInterceptors(a)}).then(function(d){return d===!1||b?[d]:D(function(b){return b.canNavigateTo(a)},c._ports)}).then(U)},a.prototype._callAllHandlers=function(a,c,d){var e=this;return this._callHandlers(this._queryTransforms["*"],d).then(function(){return e._callHandlers(e._queryTransforms[a],d)}).then(function(){return e._callHandlers(e._paramTransforms["*"],c,d)}).then(function(){return e._callHandlers(e._paramTransforms[a],c,d)}).then(b)},a.prototype._callHandlers=function(a,c,d){var e=this._resolve;return h(c)||(c={}),D(function(a,b){return F(function(a){return e(a(c[b],c,d))},a)},a).then(b)},a.prototype._callInterceptors=function(a){var b=this,c=this._resolve;return F(function(b){return c(b(a))},this._interceptors["*"]).then(U).then(function(d){return d?D(function(b){return c(b(a))},b._interceptors[a.delegate.alias]):[d]}).then(U)},a.prototype._isSameRoute=function(a){var b=this.currentRouteInfo;if(!h(b)||!h(a))return!1;var c=b.delegate,d=a.delegate,e=T(b.parameters),f=T(a.parameters),g=T(b.query),i=T(a.query);return c.view===d.view&&c.alias===d.alias&&c.pattern===d.pattern&&e===f&&g===i},a.prototype._clearInfo=function(){this._previousSegment=void 0,this._previousPattern=void 0,this._previousUrl=void 0,this._previousQuery=void 0,this.currentRouteInfo=void 0,this.navigating=!1,B(function(a){a._clearInfo()},this.children)},a._inject={_Promise:Oa,_Injector:Sb,_EventManager:Va,_browser:Bb,_browserConfig:Cb,_recognizer:Rb,_childRecognizer:Rb},a}();a.Router=I,plat.register.injectable(Db,I,null,ve),a.IRouterStatic=g,plat.register.injectable(Eb,g)}(Sf=a.routing||(a.routing={}));var Tf;!function(a){var c=function(a){function b(){a.apply(this,arguments)}return __extends(b,a),b.prototype.initialize=function(){var a=O(this.type),b=this.attributes[a];q(b)||this._isPrecompiled()||(this._label=b,this._define(b))},b.prototype.dispose=function(){for(var a=this._label,b=this.parent;!v(a)&&h(b);)h(b[a])&&k(b[a].element)&&b[a].element===this.element&&Q(b,a),b=b.parent},b.prototype._define=function(a){var b=this.templateControl;u(b)||(b.name=a);for(var c=this.parent,d={element:this.element,control:b};h(c);){var e=c[a];h(e)||(c[a]=d),c=c.parent}},b.prototype._isPrecompiled=function(){for(var a=this.parent;!u(a);){if(-1!==a.type.indexOf(ze))return!0;a=a.parent}return!1},b}(Pf);a.Name=c,Ga.control(bc,c);var d=function(a){function c(){a.apply(this,arguments),this._expression=[],this._aliases=[]}return __extends(c,a),c.prototype.loaded=function(){u(this.element)||(this.attribute=O(this.type),this._setListener())},c.prototype._setListener=function(){var a=this.attributes[this.attribute];q(this.event)||q(a)||(this._parseArgs(a),this._addEventListeners())},c.prototype._addEventListeners=function(){this.addEventListener(this.element,this.event,this._onEvent,!1)},c.prototype._buildExpression=function(){var a,c,d,e,f,g=this._expression.slice(0),h=this._parser,i=this.parent,j=g.shift();if(u(i)||(e=i.getResources(this._aliases),f=i.context),"@"!==j[0]){if(a=this.findProperty(j),u(a))return this._log.warn("Could not find property "+j+" on any parent control."),{fn:b,context:{},args:[]};var k=a.expresssion,l=k.identifiers;if(l.length>1)return this._log.warn("Cannot have more than one identifier in a "+this.type+"'s expression."),{fn:b,context:{},args:[]};var m=l[0],n=m.split(".");n.pop(),c=0===n.length?a.control:h.parse(n.join(".")).evaluate(a.control),d=a.value}else d=u(e)?b:e[j]||b,c=void 0;for(var o=g.length,p=[],q=0;o>q;++q)p.push(h.parse(g[q]).evaluate(f,e));return{fn:d,context:c,args:p}},c.prototype._onEvent=function(a){var b=this._buildExpression(),c=b.fn;return t(c)?void c.apply(b.context,b.args.concat(a)):void this._log.warn("Cannot find registered event method "+this._expression[0]+" for control: "+this.type)},c.prototype._findAliases=function(a){for(var b,c=a.length,d={},e=[],f=[],g=this._parser;c-->0;)b=a[c].trim(),f=f.concat(g.parse(b).aliases);for(;f.length>0;)b=f.pop(),d[b]||(e.push(b),d[b]=!0);return e},c.prototype._parseArgs=function(a){if(!q(a)){var b=this._regex.argumentRegex.exec(a);u(b)?this._expression.push(a):this._expression=[a.slice(0,b.index)].concat(""!==b[1]?b[1].split(","):[]),this._aliases=this._findAliases(this._expression)}},c._inject={_parser:Za,_regex:$a},c}(Pf);a.SimpleEventControl=d;var e=function(a){function b(){a.apply(this,arguments),this.event=Td}return __extends(b,a),b}(d);a.Tap=e;var f=function(a){function b(){a.apply(this,arguments),this.event="blur"}return __extends(b,a),b}(d);a.Blur=f;var g=function(a){function b(){a.apply(this,arguments),this.event="change"}return __extends(b,a),b}(d);a.Change=g;var i=function(a){function b(){a.apply(this,arguments),this.event="copy"}return __extends(b,a),b}(d);a.Copy=i;var j=function(a){function b(){a.apply(this,arguments),this.event="cut"}return __extends(b,a),b}(d);a.Cut=j;var l=function(a){function b(){a.apply(this,arguments),this.event="paste"}return __extends(b,a),b}(d);a.Paste=l;var m=function(a){function b(){a.apply(this,arguments),this.event=Ud}return __extends(b,a),b}(d);a.DblTap=m;var o=function(a){function b(){a.apply(this,arguments),this.event="focus"}return __extends(b,a),b}(d);a.Focus=o;var p=function(a){function b(){a.apply(this,arguments),this.event=Vd}return __extends(b,a),b}(d);a.TouchStart=p;var x=function(a){function b(){a.apply(this,arguments),this.event=Wd}return __extends(b,a),b}(d);a.TouchEnd=x;var y=function(a){function b(){a.apply(this,arguments),this.event=Xd}return __extends(b,a),b}(d);a.TouchMove=y;var z=function(a){function b(){a.apply(this,arguments),this.event=Yd}return __extends(b,a),b}(d);a.TouchCancel=z;var A=function(a){function b(){a.apply(this,arguments),this.event=Zd}return __extends(b,a),b}(d);a.Hold=A;var B=function(a){function b(){a.apply(this,arguments),this.event=$d}return __extends(b,a),b}(d);a.Release=B;var C=function(a){function b(){a.apply(this,arguments),this.event=_d}return __extends(b,a),b}(d);a.Swipe=C;var D=function(a){function b(){a.apply(this,arguments),this.event=ae}return __extends(b,a),b}(d);a.SwipeLeft=D;var E=function(a){function b(){a.apply(this,arguments),this.event=be}return __extends(b,a),b}(d);a.SwipeRight=E;var F=function(a){function b(){a.apply(this,arguments),this.event=ce}return __extends(b,a),b}(d);a.SwipeUp=F;var G=function(a){function b(){a.apply(this,arguments),this.event=de}return __extends(b,a),b}(d);a.SwipeDown=G;var H=function(a){function b(){a.apply(this,arguments),this.event=ee}return __extends(b,a),b}(d);a.Track=H;var I=function(a){function b(){a.apply(this,arguments),this.event=fe}return __extends(b,a),b}(d);a.TrackLeft=I;var K=function(a){function b(){a.apply(this,arguments),this.event=ge}return __extends(b,a),b}(d);a.TrackRight=K;var L=function(a){function b(){a.apply(this,arguments),this.event=he}return __extends(b,a),b}(d);a.TrackUp=L;var N=function(a){function b(){a.apply(this,arguments),this.event=ie}return __extends(b,a),b}(d);a.TrackDown=N;var P=function(a){function b(){a.apply(this,arguments),this.event=je}return __extends(b,a),b}(d);a.TrackEnd=P;var R=function(a){function b(){a.apply(this,arguments),this.event="submit"}return __extends(b,a),b.prototype._onEvent=function(b){this.element.hasAttribute("action")||b.preventDefault(),a.prototype._onEvent.call(this,b)},b}(d);a.Submit=R;var S=function(b){function c(){b.apply(this,arguments),this.event="input"}return __extends(c,b),c.prototype._addEventListeners=function(){var b,c=this,d=this.element,e=this._compat,f=!1,g="input",h=function(a){f||c._onEvent(a)},i=function(a){t(b)||(b=J(function(){h(a),b=null}))};v(e.ANDROID)&&(this.addEventListener(d,"compositionstart",function(){f=!0},!1),this.addEventListener(d,"compositionend",function(a){f=!1,h(a)},!1)),this.addEventListener(d,g,h,!1),this.addEventListener(d,"change",h,!1),e.hasEvent(g)||(this.addEventListener(d,"keydown",function(b){var c=b.keyCode,d=a.KeyCodes;c===d.lwk||c===d.rwk||c>=d.shift&&c<=d.escape||c>d.space&&c<=d.down||i(b)},!1),this.addEventListener(d,"cut",i,!1),this.addEventListener(d,"paste",i,!1))},c._inject={_compat:Pa},c}(d);a.React=S,Ga.control(jc,e),Ga.control(kc,f),Ga.control(lc,g),Ga.control(mc,i),Ga.control(nc,j),Ga.control(oc,l),Ga.control(pc,m),Ga.control(qc,o),Ga.control(rc,R),Ga.control(sc,p),Ga.control(tc,x),Ga.control(uc,y),Ga.control(vc,z),Ga.control(wc,A),Ga.control(xc,B),Ga.control(yc,C),Ga.control(zc,D),Ga.control(Ac,E),Ga.control(Bc,F),Ga.control(Cc,G),Ga.control(Dc,H),Ga.control(Ec,I),Ga.control(Fc,K),Ga.control(Gc,L),Ga.control(Hc,N),Ga.control(Ic,P),Ga.control(Jc,S),a.KeyCodes={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,pause:19,break:19,"caps lock":20,escape:27,space:32,"page up":33,"page down":34,end:35,home:36,left:37,"left arrow":37,up:38,"up arrow":38,right:39,"right arrow":39,down:40,"down arrow":40,insert:45,delete:46,0:48,zero:48,")":48,"right parenthesis":48,1:49,one:49,"!":49,exclamation:49,"exclamation point":49,2:50,two:50,"@":50,at:50,3:51,three:51,"#":51,"number sign":51,hash:51,pound:51,4:52,four:52,$:52,dollar:52,"dollar sign":52,5:53,five:53,"%":53,percent:53,"percent sign":53,6:54,six:54,"^":54,caret:54,7:55,seven:55,"&":55,ampersand:55,8:56,eight:56,"*":56,asterisk:56,9:57,nine:57,"(":57,"left parenthesis":57,a:65,b:66,c:67,d:68,e:69,f:70,g:71,h:72,i:73,j:74,k:75,l:76,m:77,n:78,o:79,p:80,q:81,r:82,s:83,t:84,u:85,v:86,w:87,x:88,y:89,z:90,lwk:91,"left window key":91,rwk:92,"right window key":92,select:93,"select key":93,"numpad 0":96,"numpad 1":97,"numpad 2":98,"numpad 3":99,"numpad 4":100,"numpad 5":101,"numpad 6":102,"numpad 7":103,"numpad 8":104,"numpad 9":105,multiply:106,add:107,subtract:109,"decimal point":110,divide:111,f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123,"num lock":144,"scroll lock":145,";":186,"semi-colon":186,":":186,colon:186,"=":187,equal:187,"equal sign":187,"+":187,plus:187,",":188,comma:188,"<":188,lt:188,"less than":188,"left angle bracket":188,"-":189,dash:189,_:189,underscore:189,".":190,period:190,">":190,gt:190,"greater than":190,"right angle bracket":190,"/":191,"forward slash":191,"?":191,"question mark":191,"`":192,"grave accent":192,"~":192,tilde:192,"[":219,"open bracket":219,"{":219,"open brace":219,"\\":220,"back slash":220,"|":220,pipe:220,"]":221,"close bracket":221,"}":221,"close brace":221,"'":222,"single quote":222,'"':222,"double quote":222};var T=function(b){function c(){b.apply(this,arguments),this.keyCodes={}}return __extends(c,b),c.prototype._setListener=function(){var a=this.attribute;if(!q(this.event)&&!q(a)){var c=this.attributes[a].trim();if("{"===c[0]){var d=this.evaluateExpression(c)||{method:""},e=this._filterArgs(d);return this._setKeyCodes(e),void this.addEventListener(this.element,this.event,this._onEvent,!1)}b.prototype._setListener.call(this)}},c.prototype._filterArgs=function(a){var b=a.key,c=a.keys;return this._parseArgs(a.method),w(c)?c:n(c)?[c]:w(b)?b:n(b)?[b]:void(u(a.char)&&u(a.chars)||this._log.warn(this.type+" should be using the property key or keys to denote key codes or keys and not char codes or characters."))},c.prototype._onEvent=function(a){this._compareKeys(a)&&b.prototype._onEvent.call(this,a)},c.prototype._compareKeys=function(a){var b=this.keyCodes,c=a.keyCode||a.which;return q(b)||b[c]===!0},c.prototype._setKeyCodes=function(b){w(b)||(b=[]);for(var c,d,e=b.length,f=this.keyCodes,g=0;e>g;++g)c=b[g],d=s(c)?c:a.KeyCodes[c.toLowerCase()],f[d]=!0},c}(d);a.KeyCodeEventControl=T;var U=function(a){function b(){a.apply(this,arguments),this.event="keydown"}return __extends(b,a),b}(T);a.KeyDown=U;var V=function(a){function b(){a.apply(this,arguments),this.event="keydown"}return __extends(b,a),b.prototype._onEvent=function(b){var c=this,d=b.keyCode||b.which;if(a.prototype._compareKeys.call(this,b)&&(d>=48&&90>=d||d>=186||d>=96&&111>=d))var e=this.addEventListener(this.element,"keypress",function(b){e(),a.prototype._onEvent.call(c,b)},!1)},b.prototype._compareKeys=function(a){return!0},b}(T);a.KeyPress=V;var W=function(a){function b(){a.apply(this,arguments),this.event="keyup"}return __extends(b,a),b}(T);a.KeyUp=W;var X=function(a){function b(){a.apply(this,arguments),this.event="keypress"}return __extends(b,a),b.prototype._filterArgs=function(a){var b=a.char,c=a.chars;return this._parseArgs(a.method),w(c)?c:n(c)?[c]:w(b)?b:n(b)?[b]:void(u(a.key)&&u(a.keys)||this._log.warn(this.type+" should be using the property key or keys to denote key codes or keys and not char codes or characters."))},b.prototype._onEvent=function(b){var c,d=this.keyCodes,e=b.charCode||b.which;if(e)c=String.fromCharCode(e);else if(c=b.key,!c)return;(q(d)||d[c]===!0)&&a.prototype._onEvent.call(this,b)},b.prototype._compareKeys=function(a){return!0},b.prototype._setKeyCodes=function(a){w(a)||(a=[]);for(var b,c,d=a.length,e=this.keyCodes,f=0;d>f;++f)b=a[f],c=s(b)?String.fromCharCode(b):b,e[c]=!0},b}(T);a.CharPress=X,Ga.control(Zb,U),Ga.control($b,V),Ga.control(_b,W),Ga.control(ac,X);var Y=function(a){function b(){a.apply(this,arguments),this.property=""}return __extends(b,a),b.prototype.loaded=function(){u(this.element)||(this.attribute=O(this.type),this.setter(),this.__removeListener=this.attributes.observe(this.setter,this.attribute))},b.prototype.contextChanged=function(){u(this.element)||this.setter()},b.prototype.dispose=function(){t(this.__removeListener)&&(this.__removeListener(),this.__removeListener=null)},b.prototype.setter=function(){var a=this;M(function(){var b=a.element,c=a.property;if(k(b))switch(a.attributes[a.attribute]){case"false":case"0":case"null":case"":b.setAttribute(c,""),b[c]=!1,b.removeAttribute(c);break;default:b.setAttribute(c,c),b[c]=!0}})},b}(Pf);a.SetAttributeControl=Y;var Z=function(a){function b(){a.apply(this,arguments),this.property="checked"}return __extends(b,a),b}(Y);a.Checked=Z;var $=function(a){function b(){a.apply(this,arguments),this.property="disabled"}return __extends(b,a),b}(Y);a.Disabled=$;var _=function(a){function b(){a.apply(this,arguments),this.property="selected"}return __extends(b,a),b}(Y);a.Selected=_;var aa=function(a){function b(){a.apply(this,arguments),this.property="readonly"}return __extends(b,a),b}(Y);a.ReadOnly=aa;var ba=function(a){function c(){a.apply(this,arguments),this.property="display",this.value="none",this.importance="important",this._initialValue=""}return __extends(c,a),c.prototype.initialize=function(){var a=this.element.style||{getPropertyValue:b},c=a.getPropertyValue(this.property);this._setValue(this.value,this.importance),q(c)||"none"===c||(this._initialValue=c)},c.prototype.setter=function(){var a=this;M(function(){if(k(a.element))switch(a.attributes[a.attribute]){case"false":case"0":case"null":case"":a._setValue(a.value,a.importance);break;default:a._setValue(a._initialValue)}})},c.prototype._setValue=function(a,c){var d=this.property,e=this.element.style||{setProperty:b,removeProperty:b,getPropertyValue:b,getPropertyPriority:b},f=e.getPropertyValue(d),g=e.getPropertyPriority(d);if(a!==f||c!==g)return q(a)?void e.removeProperty(d):void e.setProperty(d,a,c)},c}(Y);a.Visible=ba;var ca=function(a){function b(){a.apply(this,arguments),this.property="style"}return __extends(b,a),b.prototype.setter=function(){var a=this,b=this.element,c=this.attributes[this.attribute];q(c)||u(b)||M(function(){b.setAttribute(a.property,c)})},b}(Y);a.Style=ca,Ga.control(dc,Z),Ga.control(ec,$),Ga.control(fc,_),Ga.control(gc,aa),Ga.control(hc,ba),Ga.control(ic,ca);var da=function(a){function b(){a.apply(this,arguments)}return __extends(b,a),b.prototype.setter=function(){var a=this.element,b=this.property,c=this.attributes[this.attribute];q(c)||u(a)||v(a[b])||(a[b]=c)},b}(Y);a.ElementPropertyControl=da;var ea=function(a){function b(){a.apply(this,arguments),this.property="href"}return __extends(b,a),b}(da);a.Href=ea;var fa=function(a){function b(){a.apply(this,arguments),this.property="src"}return __extends(b,a),b.prototype.setter=function(){var a=this.element,b=this.property,c=this.attributes[this.attribute];q(c)||u(a)||v(a[b])||(a[b]=this._browser.urlUtils(c))},b._inject={_browser:Bb},b}(da);a.Src=fa,Ga.control(Xb,ea),Ga.control(Yb,fa);var ga=function(c){function d(){c.apply(this,arguments),this.priority=100,this._supportsTwoWayBinding=!1,this.__fileSupported=na(Pa).fileSupported,this.__fileNameRegex=na($a).fileNameRegex,this.__isSelf=!1}return __extends(d,c),d.prototype.initialize=function(){this._determineType()},d.prototype.loaded=function(){var a=this.parent;if(!u(a)&&!u(this.element)){var b=O(this.type),c=this._parser,d=this._expression=c.parse(this.attributes[b]),e=d.identifiers;if(1!==e.length)return this._log.warn("Only 1 identifier allowed in a "+this.type+" expression"),void(this._contextExpression=null);var f=e[0].split(".");if(this._property=f.pop(),d.aliases.length>0){var g,i=d.aliases[0],j=a.findResource(i);if(h(j)){if(g=j.resource.type,g!==Pe&&g!==Te)return}else j={resource:{}};i===Xe||i===Ve?this._contextExpression=c.parse(f.join(".")):(this._property="value",this._contextExpression={evaluate:function(){return j.resource},aliases:[],identifiers:[],expression:""})}else f.length>0?this._contextExpression=c.parse(f.join(".")):this._contextExpression={evaluate:function(){return a.context},aliases:[],identifiers:[],expression:""};this._supportsTwoWayBinding&&this.templateControl.observeProperties(this),this._watchExpression(),u(this._addEventType)||this._addEventType()}},d.prototype.contextChanged=function(){this._watchExpression()},d.prototype.dispose=function(){this._addEventType=null},d.prototype.evaluate=function(){var a=this._expression;if(!v(a))return this.evaluateExpression(a)},d.prototype.observeProperty=function(a,b,c){var d,e=this;if(q(b))d=this._expression.expression;else if(s(b))d=this._expression.expression+"."+b;else{var f=this._parser,g=f.parse(b),i=g.identifiers;if(1!==i.length)return void this._log.warn("Only 1 identifier path allowed when observing changes to a bound property's child with a control implementing ISupportTwoWayBinding and working with "+this.type);var j=f.parse(this._expression.expression+"."+i[0]);d=j.identifiers[0];var k=d.split(".");k.pop();var l=k.join("."),m=this.evaluateExpression(l);if(!h(m)){if(!u(m))return void this._log.warn("A control implementing ISupportTwoWayBinding is trying to index into a primitive type when trying to evaluate "+this.type+'="'+this._expression.expression+'"');m=this._ContextManager.createContext(this.parent,l)}}a=a.bind(this.templateControl);var n;return n=c===!0?this.observeArray(function(c){a(c,b)},d):this.observe(function(c,d){e.__isSelf||c===d||a(c,d,b)},d),a(this.evaluateExpression(d),void 0,b,!0),n},d.prototype._addTextEventListener=function(){var b,c=this,d=this.element,e=this._compat,f=!1,g="input",h=function(){f||c._propertyChanged()},i=function(){t(b)||(b=J(function(){h(),b=null}))};v(e.ANDROID)&&(this.addEventListener(d,"compositionstart",function(){f=!0},!1),this.addEventListener(d,"compositionend",function(){f=!1,h()},!1)),e.hasEvent(g)?this.addEventListener(d,g,h,!1):(this.addEventListener(d,"keydown",function(b){var c=b.keyCode||b.which,d=a.KeyCodes;c===d.lwk||c===d.rwk||c>=d.shift&&c<=d.escape||c>d.space&&c<=d.down||i()},!1),this.addEventListener(d,"cut",i,!1),this.addEventListener(d,"paste",i,!1)),this.addEventListener(d,"change",h,!1)},d.prototype._addChangeEventListener=function(){this.addEventListener(this.element,"change",this._propertyChanged,!1)},d.prototype._addButtonEventListener=function(){this.addEventListener(this.element,Td,this._propertyChanged,!1)},d.prototype._getChecked=function(){return this.element.checked},d.prototype._getValue=function(){return this.element.value},d.prototype._getTextContent=function(){return this.element.textContent},d.prototype._getFile=function(){var a=this.element,c=a.value;return this.__fileSupported&&a.files.length>0?a.files[0]:{name:c.replace(this.__fileNameRegex,""),path:c,lastModifiedDate:void 0,type:void 0,size:void 0,msDetachStream:b,msClose:b,slice:function(){return{}}}},d.prototype._getFiles=function(){var a=this.element;if(this.__fileSupported)return Array.prototype.slice.call(a.files);for(var c,d=a.value.split(/,|;/g),e=d.length,f=[],g=function(){return{}},h=0;e>h;++h)c=d[h],f.push({name:c.replace(this.__fileNameRegex,""),path:c,lastModifiedDate:void 0,type:void 0,size:void 0,msDetachStream:b,msClose:b,slice:g});return f},d.prototype._getSelectedValues=function(){for(var a,b=this.element.options,c=b.length,d=[],e=0;c>e;++e)a=b[e],a.selected&&d.push(a.value);return d},d.prototype._setText=function(a,b,c){return this.__isSelf?void 0:u(a)&&(a="",c===!0)?(u(this.element.value)&&this._setValue(a),void this._propertyChanged()):void this._setValue(a)},d.prototype._setRange=function(a,b,c){return this.__isSelf?void 0:q(a)&&(a=0,c===!0)?(q(this.element.value)&&this._setValue(a),void this._propertyChanged()):void this._setValue(a)},d.prototype._setHidden=function(a,b,c){return this.__isSelf?void 0:q(a)&&(a="",c===!0)?(q(this.element.value)&&this._setValue(a),void this._propertyChanged()):void this._setValue(a)},d.prototype._setValue=function(a){var b=this.element;b.value!==a&&(b.value=a)},d.prototype._setChecked=function(a,b,c){if(!this.__isSelf){if(!r(a)){if(c===!0)return void this._propertyChanged();a=!!a}this.element.checked=a}},d.prototype._setRadio=function(a){var b=this.element;if(!this.__isSelf)return u(a)&&b.checked?void this._propertyChanged():void(b.checked=b.value===a)},d.prototype._setSelectedIndex=function(a,b,c){if(!this.__isSelf){var d=this.element,e=d.value;if(u(a))return c!==!0&&this._document.body.contains(d)?void(d.selectedIndex=-1):void this._propertyChanged();if(n(a)){if(e===a)return;if(!this._document.body.contains(d))return d.value=a,void(d.value!==a&&(d.value=e,this._propertyChanged()))}else{var f;s(a)?(a=a.toString(),f="Trying to bind a value of type number to a element. The element's selected index will be set to -1.",this._log.info(f)}d.value=a,(d.value!==a||-1===d.selectedIndex)&&(d.selectedIndex=-1)}},d.prototype._setSelectedIndices=function(a,b,c){if(!this.__isSelf){var d,e=this.element.options,f=u(e)?0:e.length,g=u(a);if(!g&&w(a))for(var h,i;f-->0;)d=e[f],h=d.value,i=Number(h),-1!==a.indexOf(h)||s(i)&&-1!==a.indexOf(i)?d.selected=!0:d.selected=!1;else for(c===!0&&this._propertyChanged();f-->0;){if(d=e[f],!g&&d.value===""+a)return void(d.selected=!0);d.selected=!1}}},d.prototype._determineType=function(){if(!this._observingBindableProperty()){var a=this.element;if(!u(a))switch(a.nodeName.toLowerCase()){case"input":switch(a.type){case"button":case"submit":case"reset":case"image":this._addEventType=this._addButtonEventListener,this._getter=this._getValue;break;case"checkbox":this._addEventType=this._addChangeEventListener,this._getter=this._getChecked,this._setter=this._setChecked;break;case"radio":this._initializeRadio();break;case"range":this._addEventType=this._addChangeEventListener,this._getter=this._getValue,this._setter=this._setRange;break;case"file":var b=a.multiple;this._addEventType=this._addChangeEventListener,this._getter=b?this._getFiles:this._getFile;break;case"hidden":this._getter=this._getValue,this._setter=this._setHidden;break;default:this._addEventType=this._addTextEventListener,this._getter=this._getValue,this._setter=this._setText}break;case"textarea":this._addEventType=this._addTextEventListener,this._getter=this._getValue,this._setter=this._setText;break;case"select":this._initializeSelect();break;case"button":this._addEventType=this._addButtonEventListener,this._getter=this._getTextContent}}},d.prototype._watchExpression=function(){var a=this,b=this._contextExpression,c=this.evaluateExpression(b);if(!h(c)){if(!(u(c)&&b.identifiers.length>0))return void this._log.warn(this.type+" is trying to index into a primitive type. "+this._contextExpression.expression+" is already defined and not an object when trying to evaluate "+this.type+'="'+this._expression.expression+'"');c=this._createContext(b.identifiers[0])}var d;if(t(this._setter)){this._setter===this._setSelectedIndices&&(d=this._property,u(c[d])&&(c[d]=[]),this.observeArray(function(b){a._setter(b[0].object,null,!0)},b+"."+d));var e=this._expression;this.observeExpression(function(b,c){a._setter(b,c)},e),this._setter(this.evaluateExpression(e),void 0,!0)}},d.prototype._createContext=function(a){var b=a.split("."),c=b.shift().slice(1),d=this.parent;return c===Ve?(a=b.join("."),d=this.parent.root):c===Ia&&(a=b.join(".")),this._ContextManager.createContext(d,a)},d.prototype._propertyChanged=function(){if(!u(this._contextExpression)){var a=this.evaluateExpression(this._contextExpression),b=this._property,c=this._getter();u(a)||a[b]===c||(this.__isSelf=!0,a[b]=c,this.__isSelf=!1)}},d.prototype._initializeRadio=function(){var a=this.element;if(this._addEventType=this._addChangeEventListener,this._getter=this._getValue,this._setter=this._setRadio,!a.hasAttribute("name")){var b=O(this.type),c=this.attributes[b];a.setAttribute("name",c)}a.hasAttribute("value")||a.setAttribute("value","")},d.prototype._initializeSelect=function(){var a,b=this.element,c=b.multiple,d=b.options,e=d.length;this._addEventType=this._addChangeEventListener,c?(this._getter=this._getSelectedValues,this._setter=this._setSelectedIndices):(this._getter=this._getValue,this._setter=this._setSelectedIndex);for(var f=0;e>f;++f)a=d[f],a.hasAttribute("value")||a.setAttribute("value",a.textContent)},d.prototype._observingBindableProperty=function(){var a=this,b=this.templateControl;return!u(b)&&t(b.onInput)&&t(b.observeProperties)?(b.onInput(function(b){a._getter=function(){return b},a._propertyChanged()}),this._supportsTwoWayBinding=!0):!1},d._inject={_parser:Za,_ContextManager:bb,_compat:Pa,_document:Sa},d}(Pf);a.Bind=ga,Ga.control(Wb,ga);var ha=function(a){function b(){a.apply(this,arguments),this.property="",this.priority=200,this._listeners=[],this._boundAddListener=this._addListener.bind(this)}return __extends(b,a),b.prototype.initialize=function(){this.attribute=O(this.type),this._setProperty(this._getValue())},b.prototype.loaded=function(){this._observeProperty(),this._setProperty(this._getValue())},b.prototype.dispose=function(){t(this._removeListener)&&this._removeListener(),this._listeners=[]},b.prototype._setProperty=function(a,b){var c=this.templateControl;u(c)||(this._ContextManager.defineGetter(c,this.property,{value:a,observe:this._boundAddListener},!0,!0),this._callListeners(a,b))},b.prototype._callListeners=function(a,b){for(var c=this._listeners,d=c.length,e=0;d>e;++e)c[e](a,b)},b.prototype._addListener=function(a){var b=this._listeners;return a=a.bind(this.templateControl),b.push(a),function(){var c=b.indexOf(a);-1!==c&&b.splice(c,1)}},b.prototype._getValue=function(){return u(this.templateControl)?void 0:this.evaluateExpression(this.attributes[this.attribute])},b.prototype._observeProperty=function(){u(this.templateControl)||(this._removeListener=this.observeExpression(this._setProperty,this.attributes[this.attribute]))},b._inject={_ContextManager:bb},b}(Pf);a.ObservableAttributeControl=ha;var ia=function(a){function b(){a.apply(this,arguments),this.property="options"}return __extends(b,a),b}(ha);a.Options=ia,Ga.control(cc,ia)}(Tf=a.controls||(a.controls={}));var Uf=function(){function a(){this.uid=N(Vb),this._log=a._log;var b=this.navigator=na(ab);b.initialize(na(Eb).currentRouter())}return a.start=function(){if(!a._compat.isCompatible)return a._log.error(new Error("PlatypusTS only supports modern browsers where Object.defineProperty is defined"));a.__addPlatCss();var b=a._EventManager;b.dispose(Ke),b.on(Ke,rd,a.__ready),b.on(Ke,xd,a.__shutdown),b.initialize()},a.registerApp=function(b){if(!u(a.app)&&n(a.app.uid)&&a._EventManager.dispose(a.app.uid),a.__injector=b,a._compat.amd){var c=a._LifecycleEvent,d=c.dispatch;J(function(){d(rd,c)})}},a.load=function(b){var c=a._LifecycleEvent,d=a._compiler,e=a._document.body,f=a._document.head;return c.dispatch(zd,a),u(b)?(e.setAttribute(Jd,""),void J(function(){d.compile([f]),d.compile([e]),e.removeAttribute(Jd)})):t(b.setAttribute)?(b.setAttribute(Jd,""),void J(function(){d.compile([b]),b.removeAttribute(Jd)})):void J(function(){ +d.compile([b])})},a.__ready=function(b){Af.Injector.initialize(),a.__registerAppEvents(b),b.defaultPrevented||a.load()},a.__shutdown=function(){var b,c=navigator.app,d=a._LifecycleEvent;if(!u(c)&&t(c.exitApp)){if(b=d.dispatch(yd,a),b.defaultPrevented)return;c.exitApp()}},a.__registerAppEvents=function(b){var c=a.__injector;if(!u(c)&&t(c.inject)){var d=a.app=c.inject();d.on(sd,d.suspend),d.on(td,d.resume),d.on(ud,d.online),d.on(vd,d.offline),d.on(wd,d.error),d.on(yd,d.exiting),t(d.ready)&&d.ready(b)}},a.__addPlatCss=function(){var b=a._document;if(!a._compat.platCss){if(!u(b.styleSheets)&&b.styleSheets.length>0)return void b.styleSheets[0].insertRule("[plat-hide] { display: none !important; }",0);var c=document.createElement("style");c.textContent="[plat-hide] { display: none !important; }",document.head.appendChild(c)}},a.prototype.suspend=function(a){},a.prototype.resume=function(a){},a.prototype.error=function(a){},a.prototype.ready=function(a){},a.prototype.exiting=function(a){},a.prototype.online=function(a){},a.prototype.offline=function(a){},a.prototype.dispatchEvent=function(b){for(var c=[],d=1;d