!function(O,W,v){"use strict";function H(a){return function(){var d,b=arguments[0];for(d="["+(a?a+":":"")+b+"] http://errors.angularjs.org/1.5.0/"+(a?a+"/":"")+b,b=1;b").append(a).html();try{return a[0].nodeType===Pa?G(d):d.match(/^(<[^>]+>)/)[1].replace(/^<([\w\-]+)/,function(a,b){return"<"+G(b)})}catch(c){return G(d)}}function yc(a){try{return decodeURIComponent(a)}catch(b){}}function zc(a){var b={};return n((a||"").split("&"),function(a){var c,e,f;a&&(e=a=a.replace(/\+/g,"%20"),c=a.indexOf("="),-1!==c&&(e=a.substring(0,c),f=a.substring(c+1)),e=yc(e),y(e)&&(f=!y(f)||yc(f),sa.call(b,e)?L(b[e])?b[e].push(f):b[e]=[b[e],f]:b[e]=f))}),b}function Ub(a){var b=[];return n(a,function(a,c){L(a)?n(a,function(a){b.push(ha(c,!0)+(!0===a?"":"="+ha(a,!0)))}):b.push(ha(c,!0)+(!0===a?"":"="+ha(a,!0)))}),b.length?b.join("&"):""}function qb(a){return ha(a,!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+")}function ha(a,b){return encodeURIComponent(a).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%20/g,b?"%20":"+")}function ee(a,b){var d,c,e=Qa.length;for(c=0;c/,">"))}return b=b||[],b.unshift(["$provide",function(b){b.value("$rootElement",a)}]),d.debugInfoEnabled&&b.push(["$compileProvider",function(a){a.debugInfoEnabled(!0)}]),b.unshift("ng"),c=fb(b,d.strictDi),c.invoke(["$rootScope","$rootElement","$compile","$injector",function(a,b,c,d){a.$apply(function(){b.data("$injector",d),c(b)(a)})}]),c},e=/^NG_ENABLE_DEBUG_INFO!/,f=/^NG_DEFER_BOOTSTRAP!/;if(O&&e.test(O.name)&&(d.debugInfoEnabled=!0,O.name=O.name.replace(e,"")),O&&!f.test(O.name))return c();O.name=O.name.replace(f,""),ia.resumeBootstrap=function(a){return n(a,function(a){b.push(a)}),c()},D(ia.resumeDeferredBootstrap)&&ia.resumeDeferredBootstrap()}function ge(){O.name="NG_ENABLE_DEBUG_INFO!"+O.name,O.location.reload()}function he(a){if(!(a=ia.element(a).injector()))throw Da("test");return a.get("$$testability")}function Bc(a,b){return b=b||"_",a.replace(ie,function(a,c){return(c?b:"")+a.toLowerCase()})}function sb(a,b,d){if(!a)throw Da("areq",b||"?",d||"required");return a}function Sa(a,b,d){return d&&L(a)&&(a=a[a.length-1]),sb(D(a),b,"not a function, got "+(a&&"object"==typeof a?a.constructor.name||"Object":typeof a)),a}function Ta(a,b){if("hasOwnProperty"===a)throw Da("badname",b)}function Dc(a,b,d){if(!b)return a;b=b.split(".");for(var c,e=a,f=b.length,g=0;g")+c[2],c=c[0];c--;)d=d.lastChild;f=db(f,d.childNodes),d=e.firstChild,d.textContent=""}else f.push(b.createTextNode(a));return e.textContent="",e.innerHTML="",n(f,function(a){e.appendChild(a)}),e}function Oc(a,b){var d=a.parentNode;d&&d.replaceChild(b,a),b.appendChild(a)}function U(a){if(a instanceof U)return a;var b;if(F(a)&&(a=X(a),b=!0),!(this instanceof U)){if(b&&"<"!=a.charAt(0))throw Xb("nosel");return new U(a)}if(b){b=W;var d;a=(d=Nf.exec(a))?[b.createElement(d[1])]:(d=Nc(a,b))?d.childNodes:[]}Pc(this,a)}function Yb(a){return a.cloneNode(!0)}function wb(a,b){if(b||hb(a),a.querySelectorAll)for(var d=a.querySelectorAll("*"),c=0,e=d.length;c=xa)&&("function"==typeof a&&/^(?:class\s|constructor\()/.test(Function.prototype.toString.call(a))),d?(c.unshift(null),new(Function.prototype.bind.apply(a,c))):a.apply(b,c)},instantiate:function(a,b,c){var d=L(a)?a[a.length-1]:a;return a=e(a,b,c),a.unshift(null),new(Function.prototype.bind.apply(d,a))},get:d,annotate:fb.$$annotate,has:function(b){return r.hasOwnProperty(b+"Provider")||a.hasOwnProperty(b)}}}b=!0===b;var k={},l=[],m=new Ua([],!0),r={$provide:{provider:d(c),factory:d(f),service:d(function(a,b){return f(a,["$injector",function(a){return a.instantiate(b)}])}),value:d(function(a,b){return f(a,ba(b),!1)}),constant:d(function(a,b){Ta(a,"constant"),r[a]=b,I[a]=b}),decorator:function(a,b){var c=s.get(a+"Provider"),d=c.$get;c.$get=function(){var a=t.invoke(d,c);return t.invoke(b,null,{$delegate:a})}}}},s=r.$injector=h(r,function(a,b){throw ia.isString(b)&&l.push(b),Ga("unpr",l.join(" <- "))}),I={},K=h(I,function(a,b){var c=s.get(a+"Provider",b);return t.invoke(c.$get,c,v,a)}),t=K;r.$injectorProvider={$get:ba(K)};var p=g(a),t=K.get("$injector");return t.strictDi=b,n(p,function(a){a&&t.invoke(a)}),t}function Xe(){var a=!0;this.disableAutoScrolling=function(){a=!1},this.$get=["$window","$location","$rootScope",function(b,d,c){function e(a){var b=null;return Array.prototype.some.call(a,function(a){if("a"===ra(a))return b=a,!0}),b}function f(a){if(a){a.scrollIntoView();var c;c=g.yOffset,D(c)?c=c():Rb(c)?(c=c[0],c="fixed"!==b.getComputedStyle(c).position?0:c.getBoundingClientRect().bottom):N(c)||(c=0),c&&(a=a.getBoundingClientRect().top,b.scrollBy(0,a-c))}else b.scrollTo(0,0)}function g(a){a=F(a)?a:d.hash();var b;a?(b=h.getElementById(a))?f(b):(b=e(h.getElementsByName(a)))?f(b):"top"===a&&f(null):f(null)}var h=b.document;return a&&c.$watch(function(){return d.hash()},function(a,b){a===b&&""===a||Pf(function(){c.$evalAsync(g)})}),g}]}function jb(a,b){return a||b?a?b?(L(a)&&(a=a.join(" ")),L(b)&&(b=b.join(" ")),a+" "+b):a:b:""}function Yf(a){F(a)&&(a=a.split(" "));var b=Z();return n(a,function(a){a.length&&(b[a]=!0)}),b}function Ha(a){return E(a)?a:{}}function Zf(a,b,d,c){function e(a){try{a.apply(null,wa.call(arguments,1))}finally{if(0===--K)for(;t.length;)try{t.pop()()}catch(b){d.error(b)}}}function f(){z=null,g(),h()}function g(){a:{try{p=m.state;break a}catch(a){}p=void 0}p=x(p)?null:p,oa(p,$)&&(p=$),$=p}function h(){u===k.url()&&w===p||(u=k.url(),w=p,n(A,function(a){a(k.url(),p)}))}var k=this,l=a.location,m=a.history,r=a.setTimeout,s=a.clearTimeout,I={};k.isMock=!1;var K=0,t=[];k.$$completeOutstandingRequest=e,k.$$incOutstandingRequestCount=function(){K++},k.notifyWhenNoOutstandingRequests=function(a){0===K?a():t.push(a)};var p,w,u=l.href,la=b.find("base"),z=null;g(),w=p,k.url=function(b,d,e){if(x(e)&&(e=null),l!==a.location&&(l=a.location),m!==a.history&&(m=a.history),b){var f=w===e;if(u===b&&(!c.history||f))return k;var h=u&&Ia(u)===Ia(b);return u=b,w=e,!c.history||h&&f?(h&&!z||(z=b),d?l.replace(b):h?(d=l,e=b.indexOf("#"),e=-1===e?"":b.substr(e),d.hash=e):l.href=b,l.href!==b&&(z=b)):(m[d?"replaceState":"pushState"](e,"",b),g(),w=p),k}return z||l.href.replace(/%27/g,"'")},k.state=function(){return p};var A=[],Q=!1,$=null;k.onUrlChange=function(b){return Q||(c.history&&C(a).on("popstate",f),C(a).on("hashchange",f),Q=!0),A.push(b),b},k.$$applicationDestroyed=function(){C(a).off("hashchange popstate",f)},k.$$checkUrlChange=h,k.baseHref=function(){var a=la.attr("href");return a?a.replace(/^(https?\:)?\/\/[^\/]*/,""):""},k.defer=function(a,b){var c;return K++,c=r(function(){delete I[c],e(a)},b||0),I[c]=!0,c},k.defer.cancel=function(a){return!!I[a]&&(delete I[a],s(a),e(B),!0)}}function df(){this.$get=["$window","$log","$sniffer","$document",function(a,b,d,c){return new Zf(a,c,b,d)}]}function ef(){this.$get=function(){function a(a,c){function e(a){a!=r&&(s?s==a&&(s=a.n):s=a,f(a.n,a.p),f(a,r),r=a,r.n=null)}function f(a,b){a!=b&&(a&&(a.p=b),b&&(b.n=a))}if(a in b)throw H("$cacheFactory")("iid",a);var g=0,h=T({},c,{id:a}),k=Z(),l=c&&c.capacity||Number.MAX_VALUE,m=Z(),r=null,s=null;return b[a]={put:function(a,b){if(!x(b)){if(ll&&this.remove(s.key),b}},get:function(a){if(l",b=ba.firstChild.attributes;var d=b[0];b.removeNamedItem(d.name),d.value=c,a.attributes.setNamedItem(d)}function $(a,b){try{a.addClass(b)}catch(c){}}function M(a,b,c,d,e){a instanceof C||(a=C(a));for(var f=/\S+/,g=0,h=a.length;g").append(a).html())):c?Ra.clone.call(a):a,g)for(var h in g)d.data("$"+h+"Controller",g[h].instance);return M.$$addScopeInfo(d,b),c&&c(d,b),l&&l(b,d,d,f),d}}function P(a,b,c,d,e,f){function g(a,c,d,e){var f,k,l,m,p,s,u;if(A)for(u=Array(c.length),m=0;mJ.priority)break;if((fa=J.scope)&&(J.templateUrl||(E(fa)?(Wa("new/isolated scope",P||Q,J,ea),P=J):Wa("new/isolated scope",P,J,ea)),Q=Q||J),H=J.name,!N&&(J.replace&&(J.templateUrl||J.template)||J.transclude&&!J.$$tlb)){for(fa=R+1;N=a[fa++];)if(N.transclude&&!N.$$tlb||N.replace&&(N.templateUrl||N.template)){Fb=!0;break}N=!0}if(!J.templateUrl&&J.controller&&(fa=J.controller,I=I||Z(),Wa("'"+H+"' controller",I[H],J,ea),I[H]=J),fa=J.transclude)if(z=!0,J.$$tlb||(Wa("transclusion",S,J,ea),S=J),"element"==fa)B=!0,t=J.priority,G=ea,ea=d.$$element=C(W.createComment(" "+H+": "+d[H]+" ")),b=ea[0],aa(f,wa.call(G,0),b),ya=ac(Fb,G,e,t,g&&g.name,{nonTlbTranscludeDirective:S});else{var V=Z();if(G=C(Yb(b)).contents(),E(fa)){G=[];var ha=Z(),da=Z();n(fa,function(a,b){var c="?"===a.charAt(0);a=c?a.substring(1):a,ha[a]=b,V[b]=null,da[b]=c}),n(ea.contents(),function(a){var b=ha[va(ra(a))];b?(da[b]=!0,V[b]=V[b]||[],V[b].push(a)):G.push(a)}),n(da,function(a,b){if(!a)throw ja("reqslot",b)});for(var ga in V)V[ga]&&(V[ga]=ac(Fb,V[ga],e))}ea.empty(),ya=ac(Fb,G,e,v,v,{needsNewScope:J.$$isolateScope||J.$$newScope}),ya.$$slots=V}if(J.template)if(la=!0,Wa("template",$,J,ea),$=J,fa=D(J.template)?J.template(ea,d):J.template,fa=qa(fa),J.replace){if(g=J,G=Wb.test(fa)?Zc(U(J.templateNamespace,X(fa))):[],b=G[0],1!=G.length||1!==b.nodeType)throw ja("tplrt",H,"");aa(f,ea,b),Va={$attr:{}},fa=ma(b,[],Va);var oa=a.splice(R+1,a.length-(R+1));(P||Q)&&$c(fa,P,Q),a=a.concat(fa).concat(oa),ad(d,Va),Va=a.length}else ea.html(fa);if(J.templateUrl)la=!0,Wa("template",$,J,ea),$=J,J.replace&&(g=J),u=$f(a.splice(R,a.length-R),ea,d,f,z&&ya,h,l,{controllerDirectives:I,newScopeDirective:Q!==J&&Q,newIsolateScopeDirective:P,templateDirective:$,nonTlbTranscludeDirective:S}),Va=a.length;else if(J.compile)try{O=J.compile(ea,d,ya),D(O)?p(null,O,Y,ba):O&&p(O.pre,O.post,Y,ba)}catch(pa){c(pa,ta(ea))}J.terminal&&(u.terminal=!0,t=Math.max(t,J.priority))}return u.scope=Q&&!0===Q.scope,u.transcludeOnThisElement=z,u.templateOnThisElement=la,u.transclude=ya,m.hasElementTranscludeDirective=B,u}function $c(a,b,c){for(var d=0,e=a.length;dm.priority)&&-1!=m.restrict.indexOf(f)&&(k&&(m=Sb(m,{$$start:k,$$end:l})),b.push(m),h=m)}catch(t){c(t)}}return h}function O(b){if(e.hasOwnProperty(b))for(var c=a.get(b+"Directive"),d=0,f=c.length;d"+b+"",c.childNodes[0].childNodes;default:return b}}function R(a,b){if("srcdoc"==b)return la.HTML;var c=ra(a);return"xlinkHref"==b||"form"==c&&"action"==b||"img"!=c&&("src"==b||"ngSrc"==b)?la.RESOURCE_URL:void 0}function Y(a,c,d,e,f){var g=R(a,e);f=h[e]||f;var k=b(d,!0,g,f);if(k){if("multiple"===e&&"select"===ra(a))throw ja("selmulti",ta(a));c.push({priority:100,compile:function(){return{pre:function(a,c,h){if(c=h.$$observers||(h.$$observers=Z()),l.test(e))throw ja("nodomevents");var m=h[e];m!==d&&(k=m&&b(m,!0,g,f),d=m),k&&(h[e]=k(a),(c[e]||(c[e]=[])).$$inter=!0,(h.$$observers&&h.$$observers[e].$$scope||a).$watch(k,function(a,b){"class"===e&&a!=b?h.$updateClass(a,b):h.$set(e,a)}))}}}})}}function aa(a,b,c){var g,h,d=b[0],e=b.length,f=d.parentNode;if(a)for(g=0,h=a.length;g=b)return a;for(;b--;)8===a[b].nodeType&&ag.call(a,b,1);return a}function Wc(a,b){if(b&&F(b))return b;if(F(a)){var d=dd.exec(a);if(d)return d[3]}}function ff(){var a={},b=!1;this.register=function(b,c){Ta(b,"controller"),E(b)?T(a,b):a[b]=c},this.allowGlobals=function(){b=!0},this.$get=["$injector","$window",function(d,c){function e(a,b,c,d){if(!a||!E(a.$scope))throw H("$controller")("noscp",d,b);a.$scope[b]=c}return function(f,g,h,k){var l,m,r;if(h=!0===h,k&&F(k)&&(r=k),F(f)){if(!(k=f.match(dd)))throw bg("ctrlfmt",f);m=k[1],r=r||k[3],f=a.hasOwnProperty(m)?a[m]:Dc(g.$scope,m,!0)||(b?Dc(c,m,!0):v),Sa(f,m,!0)}return h?(h=(L(f)?f[f.length-1]:f).prototype,l=Object.create(h||null),r&&e(g,r,l,m||f.name),T(function(){var a=d.invoke(f,l,g,m);return a!==l&&(E(a)||D(a))&&(l=a,r&&e(g,r,l,m||f.name)),l},{instance:l,identifier:r})):(l=d.instantiate(f,g,m),r&&e(g,r,l,m||f.name),l)}}]}function gf(){this.$get=["$window",function(a){return C(a.document)}]}function hf(){this.$get=["$log",function(a){return function(b,d){a.error.apply(a,arguments)}}]}function bc(a){return E(a)?V(a)?a.toISOString():eb(a):a}function nf(){this.$get=function(){return function(a){if(!a)return"";var b=[];return rc(a,function(a,c){null===a||x(a)||(L(a)?n(a,function(a,d){b.push(ha(c)+"="+ha(bc(a)))}):b.push(ha(c)+"="+ha(bc(a))))}),b.join("&")}}}function of(){this.$get=function(){return function(a){function b(a,e,f){null===a||x(a)||(L(a)?n(a,function(a,c){b(a,e+"["+(E(a)?c:"")+"]")}):E(a)&&!V(a)?rc(a,function(a,c){b(a,e+(f?"":"[")+c+(f?"":"]"))}):d.push(ha(e)+"="+ha(bc(a))))}if(!a)return"";var d=[];return b(a,"",!0),d.join("&")}}}function cc(a,b){if(F(a)){var d=a.replace(cg,"").trim();if(d){var c=b("Content-Type");(c=c&&0===c.indexOf(ed))||(c=(c=d.match(dg))&&eg[c[0]].test(d)),c&&(a=wc(d))}}return a}function fd(a){var d,b=Z();return F(a)?n(a.split("\n"),function(a){d=a.indexOf(":");var e=G(X(a.substr(0,d)));a=X(a.substr(d+1)),e&&(b[e]=b[e]?b[e]+", "+a:a)}):E(a)&&n(a,function(a,d){var f=G(d),g=X(a);f&&(b[f]=b[f]?b[f]+", "+g:g)}),b}function gd(a){var b;return function(d){return b||(b=fd(a)),d?(d=b[G(d)],void 0===d&&(d=null),d):b}}function hd(a,b,d,c){return D(c)?c(a,b,d):(n(c,function(c){a=c(a,b,d)}),a)}function mf(){var a=this.defaults={transformResponse:[cc],transformRequest:[function(a){return E(a)&&"[object File]"!==ga.call(a)&&"[object Blob]"!==ga.call(a)&&"[object FormData]"!==ga.call(a)?eb(a):a}],headers:{common:{Accept:"application/json, text/plain, */*"},post:na(dc),put:na(dc),patch:na(dc)},xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",paramSerializer:"$httpParamSerializer"},b=!1;this.useApplyAsync=function(a){return y(a)?(b=!!a,this):b};var d=!0;this.useLegacyPromiseExtensions=function(a){return y(a)?(d=!!a,this):d};var c=this.interceptors=[];this.$get=["$httpBackend","$$cookieReader","$cacheFactory","$rootScope","$q","$injector",function(e,f,g,h,k,l){function m(b){function c(a){var b=T({},a);return b.data=hd(a.data,a.headers,a.status,f.transformResponse),a=a.status,200<=a&&300>a?b:k.reject(b)}function e(a,b){var c,d={};return n(a,function(a,e){D(a)?null!=(c=a(b))&&(d[e]=c):d[e]=a}),d}if(!E(b))throw H("$http")("badreq",b);if(!F(b.url))throw H("$http")("badreq",b.url);var f=T({method:"get",transformRequest:a.transformRequest,transformResponse:a.transformResponse,paramSerializer:a.paramSerializer},b);f.headers=function(b){var f,g,h,c=a.headers,d=T({},b.headers),c=T({},c.common,c[G(b.method)]);a:for(f in c){g=G(f);for(h in d)if(G(h)===g)continue a;d[f]=c[f]}return e(d,na(b))}(b),f.method=ub(f.method),f.paramSerializer=F(f.paramSerializer)?l.get(f.paramSerializer):f.paramSerializer;var g=[function(b){var d=b.headers,e=hd(b.data,gd(d),v,b.transformRequest);return x(e)&&n(d,function(a,b){"content-type"===G(b)&&delete d[b]}),x(b.withCredentials)&&!x(a.withCredentials)&&(b.withCredentials=a.withCredentials),r(b,e).then(c,c)},v],h=k.when(f);for(n(K,function(a){(a.request||a.requestError)&&g.unshift(a.request,a.requestError),(a.response||a.responseError)&&g.push(a.response,a.responseError)});g.length;){b=g.shift();var m=g.shift(),h=h.then(b,m)}return d?(h.success=function(a){return Sa(a,"fn"),h.then(function(b){a(b.data,b.status,b.headers,f)}),h},h.error=function(a){return Sa(a,"fn"),h.then(null,function(b){a(b.data,b.status,b.headers,f)}),h}):(h.success=id("success"),h.error=id("error")),h}function r(c,d){function g(a,c,d,e){function f(){l(c,a,d,e)}K&&(200<=a&&300>a?K.put(S,[a,c,fd(d),e]):K.remove(S)),b?h.$applyAsync(f):(f(),h.$$phase||h.$apply())}function l(a,b,d,e){b=-1<=b?b:0,(200<=b&&300>b?A.resolve:A.reject)({data:a,status:b,headers:gd(d),config:c,statusText:e})}function r(a){l(a.data,a.status,na(a.headers()),a.statusText)}function z(){var a=m.pendingRequests.indexOf(c);-1!==a&&m.pendingRequests.splice(a,1)}var K,M,A=k.defer(),Q=A.promise,P=c.headers,S=s(c.url,c.paramSerializer(c.params));return m.pendingRequests.push(c),Q.then(z,z),!c.cache&&!a.cache||!1===c.cache||"GET"!==c.method&&"JSONP"!==c.method||(K=E(c.cache)?c.cache:E(a.cache)?a.cache:I),K&&(M=K.get(S),y(M)?M&&D(M.then)?M.then(r,r):L(M)?l(M[1],M[0],na(M[2]),M[3]):l(M,200,{},"OK"):K.put(S,Q)),x(M)&&((M=jd(c.url)?f()[c.xsrfCookieName||a.xsrfCookieName]:v)&&(P[c.xsrfHeaderName||a.xsrfHeaderName]=M),e(c.method,S,d,g,P,c.timeout,c.withCredentials,c.responseType)),Q}function s(a,b){return 0=l&&(u.resolve(p),t(n.$$intervalId),delete g[n.$$intervalId]),w||a.$apply()},k),g[n.$$intervalId]=u,n}var g={};return f.cancel=function(a){return!!(a&&a.$$intervalId in g)&&(g[a.$$intervalId].reject("canceled"),b.clearInterval(a.$$intervalId),delete g[a.$$intervalId],!0)},f}]}function ec(a){a=a.split("/");for(var b=a.length;b--;)a[b]=qb(a[b]);return a.join("/")}function kd(a,b){var d=za(a);b.$$protocol=d.protocol,b.$$host=d.hostname,b.$$port=ca(d.port)||gg[d.protocol]||null}function ld(a,b){var d="/"!==a.charAt(0);d&&(a="/"+a);var c=za(a);b.$$path=decodeURIComponent(d&&"/"===c.pathname.charAt(0)?c.pathname.substring(1):c.pathname),b.$$search=zc(c.search),b.$$hash=decodeURIComponent(c.hash),b.$$path&&"/"!=b.$$path.charAt(0)&&(b.$$path="/"+b.$$path)}function pa(a,b){if(0===b.indexOf(a))return b.substr(a.length)}function Ia(a){var b=a.indexOf("#");return-1==b?a:a.substr(0,b)}function kb(a){return a.replace(/(#.+)|#$/,"$1")}function fc(a,b,d){this.$$html5=!0,d=d||"",kd(a,this),this.$$parse=function(a){var d=pa(b,a);if(!F(d))throw Gb("ipthprfx",a,b);ld(d,this),this.$$path||(this.$$path="/"),this.$$compose()},this.$$compose=function(){var a=Ub(this.$$search),d=this.$$hash?"#"+qb(this.$$hash):"";this.$$url=ec(this.$$path)+(a?"?"+a:"")+d,this.$$absUrl=b+this.$$url.substr(1)},this.$$parseLinkUrl=function(c,e){if(e&&"#"===e[0])return this.hash(e.slice(1)),!0;var f,g;return y(f=pa(a,c))?(g=f,g=y(f=pa(d,f))?b+(pa("/",f)||f):a+g):y(f=pa(b,c))?g=b+f:b==c+"/"&&(g=b),g&&this.$$parse(g),!!g}}function gc(a,b,d){kd(a,this),this.$$parse=function(c){var f,e=pa(a,c)||pa(b,c);x(e)||"#"!==e.charAt(0)?this.$$html5?f=e:(f="",x(e)&&(a=c,this.replace())):(f=pa(d,e),x(f)&&(f=e)),ld(f,this),c=this.$$path;var e=a,g=/^\/[A-Z]:(\/.*)/;0===f.indexOf(e)&&(f=f.replace(e,"")),g.exec(f)||(c=(f=g.exec(c))?f[1]:c),this.$$path=c,this.$$compose()},this.$$compose=function(){var b=Ub(this.$$search),e=this.$$hash?"#"+qb(this.$$hash):"";this.$$url=ec(this.$$path)+(b?"?"+b:"")+e,this.$$absUrl=a+(this.$$url?d+this.$$url:"")},this.$$parseLinkUrl=function(b,d){return Ia(a)==Ia(b)&&(this.$$parse(b),!0)}}function md(a,b,d){this.$$html5=!0,gc.apply(this,arguments),this.$$parseLinkUrl=function(c,e){if(e&&"#"===e[0])return this.hash(e.slice(1)),!0;var f,g;return a==Ia(c)?f=c:(g=pa(b,c))?f=a+d+g:b===c+"/"&&(f=b),f&&this.$$parse(f),!!f},this.$$compose=function(){var b=Ub(this.$$search),e=this.$$hash?"#"+qb(this.$$hash):"";this.$$url=ec(this.$$path)+(b?"?"+b:"")+e,this.$$absUrl=a+d+this.$$url}}function Hb(a){return function(){return this[a]}}function nd(a,b){return function(d){return x(d)?this[a]:(this[a]=b(d),this.$$compose(),this)}}function rf(){var a="",b={enabled:!1,requireBase:!0,rewriteLinks:!0};this.hashPrefix=function(b){return y(b)?(a=b,this):a},this.html5Mode=function(a){return Na(a)?(b.enabled=a,this):E(a)?(Na(a.enabled)&&(b.enabled=a.enabled),Na(a.requireBase)&&(b.requireBase=a.requireBase),Na(a.rewriteLinks)&&(b.rewriteLinks=a.rewriteLinks),this):b},this.$get=["$rootScope","$browser","$sniffer","$rootElement","$window",function(d,c,e,f,g){function h(a,b,d){var e=l.url(),f=l.$$state;try{c.url(a,b,d),l.$$state=c.state()}catch(g){throw l.url(e),l.$$state=f,g}}function k(a,b){d.$broadcast("$locationChangeSuccess",l.absUrl(),a,l.$$state,b)}var l,m;m=c.baseHref();var s,r=c.url();if(b.enabled){if(!m&&b.requireBase)throw Gb("nobase");s=r.substring(0,r.indexOf("/",r.indexOf("//")+2))+(m||"/"),m=e.history?fc:md}else s=Ia(r),m=gc;var I=s.substr(0,Ia(s).lastIndexOf("/")+1);l=new m(s,I,"#"+a),l.$$parseLinkUrl(r,r),l.$$state=c.state();var n=/^\s*(javascript|mailto):/i;f.on("click",function(a){if(b.rewriteLinks&&!a.ctrlKey&&!a.metaKey&&!a.shiftKey&&2!=a.which&&2!=a.button){for(var e=C(a.target);"a"!==ra(e[0]);)if(e[0]===f[0]||!(e=e.parent())[0])return;var h=e.prop("href"),k=e.attr("href")||e.attr("xlink:href");E(h)&&"[object SVGAnimatedString]"===h.toString()&&(h=za(h.animVal).href),n.test(h)||!h||e.attr("target")||a.isDefaultPrevented()||!l.$$parseLinkUrl(h,k)||(a.preventDefault(),l.absUrl()!=c.url()&&(d.$apply(),g.angular["ff-684208-preventDefault"]=!0))}}),kb(l.absUrl())!=kb(r)&&c.url(l.absUrl(),!0);var t=!0;return c.onUrlChange(function(a,b){x(pa(I,a))?g.location.href=a:(d.$evalAsync(function(){var f,c=l.absUrl(),e=l.$$state;a=kb(a),l.$$parse(a),l.$$state=b,f=d.$broadcast("$locationChangeStart",a,c,b,e).defaultPrevented,l.absUrl()===a&&(f?(l.$$parse(c),l.$$state=e,h(c,!1,e)):(t=!1,k(c,e)))}),d.$$phase||d.$digest())}),d.$watch(function(){var a=kb(c.url()),b=kb(l.absUrl()),f=c.state(),g=l.$$replace,m=a!==b||l.$$html5&&e.history&&f!==l.$$state;(t||m)&&(t=!1,d.$evalAsync(function(){var b=l.absUrl(),c=d.$broadcast("$locationChangeStart",b,a,l.$$state,f).defaultPrevented;l.absUrl()===b&&(c?(l.$$parse(a),l.$$state=f):(m&&h(b,g,f===l.$$state?null:l.$$state),k(a,f)))})),l.$$replace=!1}),l}]}function sf(){var a=!0,b=this;this.debugEnabled=function(b){return y(b)?(a=b,this):a},this.$get=["$window",function(d){function c(a){return a instanceof Error&&(a.stack?a=a.message&&-1===a.stack.indexOf(a.message)?"Error: "+a.message+"\n"+a.stack:a.stack:a.sourceURL&&(a=a.message+"\n"+a.sourceURL+":"+a.line)),a}function e(a){var b=d.console||{},e=b[a]||b.log||B;a=!1;try{a=!!e.apply}catch(k){}return a?function(){var a=[];return n(arguments,function(b){a.push(c(b))}),e.apply(b,a)}:function(a,b){e(a,null==b?"":b)}}return{log:e("log"),info:e("info"),warn:e("warn"),error:e("error"),debug:function(){var c=e("debug");return function(){a&&c.apply(b,arguments)}}()}}]}function Xa(a,b){if("__defineGetter__"===a||"__defineSetter__"===a||"__lookupGetter__"===a||"__lookupSetter__"===a||"__proto__"===a)throw ka("isecfld",b);return a}function hg(a){return a+""}function Aa(a,b){if(a){if(a.constructor===a)throw ka("isecfn",b);if(a.window===a)throw ka("isecwindow",b);if(a.children&&(a.nodeName||a.prop&&a.attr&&a.find))throw ka("isecdom",b);if(a===Object)throw ka("isecobj",b)}return a}function od(a,b){if(a){if(a.constructor===a)throw ka("isecfn",b);if(a===ig||a===jg||a===kg)throw ka("isecff",b)}}function Ib(a,b){if(a&&(a===(0).constructor||a===(!1).constructor||a==="".constructor||a==={}.constructor||a===[].constructor||a===Function.constructor))throw ka("isecaf",b)}function lg(a,b){return void 0!==a?a:b}function pd(a,b){return void 0===a?b:void 0===b?a:a+b}function R(a,b){var d,c;switch(a.type){case q.Program:d=!0,n(a.body,function(a){R(a.expression,b),d=d&&a.expression.constant}),a.constant=d;break;case q.Literal:a.constant=!0,a.toWatch=[];break;case q.UnaryExpression:R(a.argument,b),a.constant=a.argument.constant,a.toWatch=a.argument.toWatch;break;case q.BinaryExpression:R(a.left,b),R(a.right,b),a.constant=a.left.constant&&a.right.constant,a.toWatch=a.left.toWatch.concat(a.right.toWatch);break;case q.LogicalExpression:R(a.left,b),R(a.right,b),a.constant=a.left.constant&&a.right.constant,a.toWatch=a.constant?[]:[a];break;case q.ConditionalExpression:R(a.test,b),R(a.alternate,b),R(a.consequent,b),a.constant=a.test.constant&&a.alternate.constant&&a.consequent.constant,a.toWatch=a.constant?[]:[a];break;case q.Identifier:a.constant=!1,a.toWatch=[a];break;case q.MemberExpression:R(a.object,b),a.computed&&R(a.property,b),a.constant=a.object.constant&&(!a.computed||a.property.constant),a.toWatch=[a];break;case q.CallExpression:d=!!a.filter&&!b(a.callee.name).$stateful,c=[],n(a.arguments,function(a){R(a,b),d=d&&a.constant,a.constant||c.push.apply(c,a.toWatch)}),a.constant=d,a.toWatch=a.filter&&!b(a.callee.name).$stateful?c:[a];break;case q.AssignmentExpression:R(a.left,b),R(a.right,b),a.constant=a.left.constant&&a.right.constant,a.toWatch=[a];break;case q.ArrayExpression:d=!0,c=[],n(a.elements,function(a){R(a,b),d=d&&a.constant,a.constant||c.push.apply(c,a.toWatch)}),a.constant=d,a.toWatch=c;break;case q.ObjectExpression:d=!0,c=[],n(a.properties,function(a){R(a.value,b),d=d&&a.value.constant,a.value.constant||c.push.apply(c,a.value.toWatch)}),a.constant=d,a.toWatch=c;break;case q.ThisExpression:a.constant=!1,a.toWatch=[];break;case q.LocalsExpression:a.constant=!1,a.toWatch=[]}}function qd(a){if(1==a.length){a=a[0].expression;var b=a.toWatch;return 1!==b.length?b:b[0]!==a?b:v}}function rd(a){return a.type===q.Identifier||a.type===q.MemberExpression}function sd(a){if(1===a.body.length&&rd(a.body[0].expression))return{type:q.AssignmentExpression,left:a.body[0].expression,right:{type:q.NGValueParameter},operator:"="}}function td(a){return 0===a.body.length||1===a.body.length&&(a.body[0].expression.type===q.Literal||a.body[0].expression.type===q.ArrayExpression||a.body[0].expression.type===q.ObjectExpression)}function ud(a,b){this.astBuilder=a,this.$filter=b}function vd(a,b){this.astBuilder=a,this.$filter=b}function Jb(a){return"constructor"==a}function hc(a){return D(a.valueOf)?a.valueOf():mg.call(a)}function tf(){var a=Z(),b=Z();this.$get=["$filter",function(d){function c(c,f,r){var u,n,z;switch(r=r||K,typeof c){case"string":z=c=c.trim();var A=r?b:a;if(!(u=A[z])){":"===c.charAt(0)&&":"===c.charAt(1)&&(n=!0,c=c.substring(2)),u=r?I:s;var Q=new ic(u);u=new jc(Q,d,u).parse(c),u.constant?u.$$watchDelegate=l:n?u.$$watchDelegate=u.literal?k:h:u.inputs&&(u.$$watchDelegate=g),r&&(u=e(u)),A[z]=u}return m(u,f);case"function":return m(c,f);default:return m(B,f)}}function e(a){function b(c,d,e,f){var g=K;K=!0;try{return a(c,d,e,f)}finally{K=g}}if(!a)return a;b.$$watchDelegate=a.$$watchDelegate,b.assign=e(a.assign),b.constant=a.constant,b.literal=a.literal;for(var c=0;a.inputs&&c=this.promise.$$state.status&&d&&d.length&&a(function(){for(var a,e,f=0,g=d.length;fa)for(b in l++,f)sa.call(e,b)||(u--,delete f[b])}else f!==e&&(f=e,l++);return l}}c.$stateful=!0;var e,f,h,d=this,k=1I&&(x=4-I,y[x]||(y[x]=[]),y[x].push({msg:D(a.exp)?"fn: "+(a.exp.name||a.exp.toString()):a.exp,newVal:g,oldVal:k}))}catch(E){f(E)}if(!(s=z.$$watchersCount&&z.$$childHead||z!==this&&z.$$nextSibling))for(;z!==this&&!(s=z.$$nextSibling);)z=z.$parent}while(z=s);if((n||u.length)&&!I--)throw w.$$phase=null,d("infdig",b,y)}while(n||u.length);for(w.$$phase=null;v.length;)try{v.shift()()}catch(H){f(H)}},$destroy:function(){if(!this.$$destroyed){var a=this.$parent;this.$broadcast("$destroy"),this.$$destroyed=!0,this===w&&h.$$applicationDestroyed(),s(this,-this.$$watchersCount);for(var b in this.$$listenerCount)I(this,this.$$listenerCount[b],b);a&&a.$$childHead==this&&(a.$$childHead=this.$$nextSibling),a&&a.$$childTail==this&&(a.$$childTail=this.$$prevSibling),this.$$prevSibling&&(this.$$prevSibling.$$nextSibling=this.$$nextSibling),this.$$nextSibling&&(this.$$nextSibling.$$prevSibling=this.$$prevSibling),this.$destroy=this.$digest=this.$apply=this.$evalAsync=this.$applyAsync=B,this.$on=this.$watch=this.$watchGroup=function(){return B},this.$$listeners={},this.$$nextSibling=null,l(this)}},$eval:function(a,b){return g(a)(this,b)},$evalAsync:function(a,b){w.$$phase||u.length||h.defer(function(){u.length&&w.$digest()}),u.push({scope:this,expression:g(a),locals:b})},$$postDigest:function(a){v.push(a)},$apply:function(a){try{r("$apply");try{return this.$eval(a)}finally{w.$$phase=null}}catch(b){f(b)}finally{try{w.$digest()}catch(c){throw f(c),c}}},$applyAsync:function(a){function b(){c.$eval(a)}var c=this;a&&z.push(b),a=g(a),p()},$on:function(a,b){var c=this.$$listeners[a];c||(this.$$listeners[a]=c=[]),c.push(b);var d=this;do{d.$$listenerCount[a]||(d.$$listenerCount[a]=0),d.$$listenerCount[a]++}while(d=d.$parent);var e=this;return function(){var d=c.indexOf(b);-1!==d&&(c[d]=null,I(e,1,a))}},$emit:function(a,b){var d,l,m,c=[],e=this,g=!1,h={name:a,targetScope:e,stopPropagation:function(){g=!0},preventDefault:function(){h.defaultPrevented=!0},defaultPrevented:!1},k=db([h],arguments,1);do{for(d=e.$$listeners[a]||c,h.currentScope=e,l=0,m=d.length;lxa)throw Ba("iequirks");var c=na(qa);c.isEnabled=function(){return a},c.trustAs=d.trustAs,c.getTrusted=d.getTrusted,c.valueOf=d.valueOf,a||(c.trustAs=c.getTrusted=function(a,b){return b},c.valueOf=ab),c.parseAs=function(a,d){var e=b(d);return e.literal&&e.constant?e:b(d,function(b){return c.getTrusted(a,b)})};var e=c.parseAs,f=c.getTrusted,g=c.trustAs;return n(qa,function(a,b){var d=G(b);c[gb("parse_as_"+d)]=function(b){return e(a,b)},c[gb("get_trusted_"+d)]=function(b){return f(a,b)},c[gb("trust_as_"+d)]=function(b){return g(a,b)}}),c}]}function zf(){this.$get=["$window","$document",function(a,b){var g,d={},c=ca((/android (\d+)/.exec(G((a.navigator||{}).userAgent))||[])[1]),e=/Boxee/i.test((a.navigator||{}).userAgent),f=b[0]||{},h=/^(Moz|webkit|ms)(?=[A-Z])/,k=f.body&&f.body.style,l=!1,m=!1;if(k){for(var r in k)if(l=h.exec(r)){g=l[0],g=g.substr(0,1).toUpperCase()+g.substr(1);break}g||(g="WebkitOpacity"in k&&"webkit"),l=!!("transition"in k||g+"Transition"in k),m=!!("animation"in k||g+"Animation"in k),!c||l&&m||(l=F(k.webkitTransition),m=F(k.webkitAnimation))}return{history:!(!a.history||!a.history.pushState||4>c||e),hasEvent:function(a){if("input"===a&&11>=xa)return!1;if(x(d[a])){var b=f.createElement("div");d[a]="on"+a in b}return d[a]},csp:Ea(),vendorPrefix:g,transitions:l,animations:m,android:c}}]}function Bf(){var a;this.httpOptions=function(b){return b?(a=b,this):a},this.$get=["$templateCache","$http","$q","$sce",function(b,d,c,e){function f(g,h){f.totalPendingRequests++,F(g)&&b.get(g)||(g=e.getTrustedResourceUrl(g));var k=d.defaults&&d.defaults.transformResponse;return L(k)?k=k.filter(function(a){return a!==cc}):k===cc&&(k=null),d.get(g,T({cache:b,transformResponse:k},a)).finally(function(){f.totalPendingRequests--}).then(function(a){return b.put(g,a.data),a.data},function(a){if(!h)throw ja("tpload",g,a.status,a.statusText);return c.reject(a)})}return f.totalPendingRequests=0,f}]}function Cf(){this.$get=["$rootScope","$browser","$location",function(a,b,d){return{findBindings:function(a,b,d){a=a.getElementsByClassName("ng-binding");var g=[];return n(a,function(a){var c=ia.element(a).data("$binding");c&&n(c,function(c){d?new RegExp("(^|\\s)"+xd(b)+"(\\s|\\||$)").test(c)&&g.push(a):-1!=c.indexOf(b)&&g.push(a)})}),g},findModels:function(a,b,d){for(var g=["ng-","data-ng-","ng\\:"],h=0;hc&&(c=e),c+=+a.slice(e+1),a=a.substring(0,e)):0>c&&(c=a.length),e=0;a.charAt(e)==lc;e++);if(e==(g=a.length))d=[0],c=1;else{for(g--;a.charAt(g)==lc;)g--;for(c-=e,d=[],f=0;e<=g;e++,f++)d[f]=+a.charAt(e)}return c>Hd&&(d=d.splice(0,Hd-1),b=c-1,c=1),{d:d,e:b,i:c}}function vg(a,b,d,c){var e=a.d,f=e.length-a.i;if(b=x(b)?Math.min(Math.max(d,f),c):+b,d=b+a.i,c=e[d],0h;)k.unshift(0),h++;for(0b.lgSize&&h.unshift(k.splice(-b.lgSize).join(""));k.length>b.gSize;)h.unshift(k.splice(-b.gSize).join(""));k.length&&h.unshift(k.join("")),k=h.join(d),f.length&&(k+=c+f.join("")),e&&(k+="e+"+e)}return 0>a&&!g?b.negPre+k+b.negSuf:b.posPre+k+b.posSuf}function Kb(a,b,d){var c="";for(0>a&&(c="-",a=-a),a=""+a;a.length-d)&&(e+=d),0===e&&-12==d&&(e=12),Kb(e,b,c)}}function Lb(a,b){return function(d,c){var e=d["get"+a]();return c[ub(b?"SHORT"+a:a)][e]}}function Id(a){var b=new Date(a,0,1).getDay();return new Date(a,0,(4>=b?5:12)-b)}function Jd(a){return function(b){var d=Id(b.getFullYear());return b=+new Date(b.getFullYear(),b.getMonth(),b.getDate()+(4-b.getDay()))-+d,b=1+Math.round(b/6048e5),Kb(b,a)}}function mc(a,b){return 0>=a.getFullYear()?b.ERAS[0]:b.ERAS[1]}function Cd(a){function b(a){var b;if(b=a.match(d)){a=new Date(0);var f=0,g=0,h=b[8]?a.setUTCFullYear:a.setFullYear,k=b[8]?a.setUTCHours:a.setHours;b[9]&&(f=ca(b[9]+b[10]),g=ca(b[9]+b[11])),h.call(a,ca(b[1]),ca(b[2])-1,ca(b[3])),f=ca(b[4]||0)-f,g=ca(b[5]||0)-g,h=ca(b[6]||0),b=Math.round(1e3*parseFloat("0."+(b[7]||0))),k.call(a,f,g,h,b)}return a}var d=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;return function(c,d,f){var k,l,g="",h=[];if(d=d||"mediumDate",d=a.DATETIME_FORMATS[d]||d,F(c)&&(c=wg.test(c)?ca(c):b(c)),N(c)&&(c=new Date(c)),!V(c)||!isFinite(c.getTime()))return c;for(;d;)(l=xg.exec(d))?(h=db(h,l,1),d=h.pop()):(h.push(d),d=null);var m=c.getTimezoneOffset();return f&&(m=xc(f,m),c=Tb(c,f,!0)),n(h,function(b){k=yg[b],g+=k?k(c,a.DATETIME_FORMATS,m):"''"===b?"'":b.replace(/(^'|'$)/g,"").replace(/''/g,"'")}),g}}function pg(){return function(a,b){return x(b)&&(b=2),eb(a,b)}}function qg(){return function(a,b,d){return b=1/0===Math.abs(Number(b))?Number(b):ca(b),isNaN(b)?a:(N(a)&&(a=a.toString()),L(a)||F(a)?(d=!d||isNaN(d)?0:ca(d),d=0>d?Math.max(0,a.length+d):d,0<=b?a.slice(d,d+b):0===d?a.slice(b,a.length):a.slice(Math.max(0,d+b),d)):a)}}function Ed(a){function b(b,d){return d=d?-1:1,b.map(function(b){var c=1,h=ab;if(D(b))h=b;else if(F(b)&&("+"!=b.charAt(0)&&"-"!=b.charAt(0)||(c="-"==b.charAt(0)?-1:1,b=b.substring(1)),""!==b&&(h=a(b),h.constant)))var k=h(),h=function(a){return a[k]};return{get:h,descending:c*d}})}function d(a){switch(typeof a){case"number":case"boolean":case"string":return!0;default:return!1}}return function(a,e,f){if(null==a)return a;if(!Ca(a))throw H("orderBy")("notarray",a);L(e)||(e=[e]),0===e.length&&(e=["+"]);var g=b(e,f);return g.push({get:function(){return{}},descending:f?-1:1}),a=Array.prototype.map.call(a,function(a,b){return{value:a,predicateValues:g.map(function(c){var e=c.get(a);return c=typeof e,null===e?(c="string",e="null"):"string"===c?e=e.toLowerCase():"object"===c&&("function"==typeof e.valueOf&&(e=e.valueOf(),d(e))||tc(e)&&(e=e.toString(),d(e))||(e=b)),{value:e,type:c}})}}),a.sort(function(a,b){for(var c=0,d=0,e=g.length;db||37<=b&&40>=b||m(a,this,this.value)}),e.hasEvent("paste")&&b.on("paste cut",m)}b.on("change",k),c.$render=function(){var a=c.$isEmpty(c.$viewValue)?"":c.$viewValue;b.val()!==a&&b.val(a)}}function Ob(a,b){return function(d,c){var e,f;if(V(d))return d;if(F(d)){if('"'==d.charAt(0)&&'"'==d.charAt(d.length-1)&&(d=d.substring(1,d.length-1)),zg.test(d))return new Date(d);if(a.lastIndex=0,e=a.exec(d))return e.shift(),f=c?{yyyy:c.getFullYear(),MM:c.getMonth()+1,dd:c.getDate(),HH:c.getHours(),mm:c.getMinutes(),ss:c.getSeconds(),sss:c.getMilliseconds()/1e3}:{yyyy:1970,MM:1,dd:1,HH:0,mm:0,ss:0,sss:0},n(e,function(a,c){c=t},g.$observe("min",function(a){t=s(a),h.$validate()})}if(y(g.max)||g.ngMax){var p;h.$validators.max=function(a){return!r(a)||x(p)||d(a)<=p},g.$observe("max",function(a){p=s(a),h.$validate()})}}}function Md(a,b,d,c){(c.$$hasNativeValidators=E(b[0].validity))&&c.$parsers.push(function(a){var c=b.prop("validity")||{};return c.badInput||c.typeMismatch?v:a})}function Nd(a,b,d,c,e){if(y(c)){if(a=a(c),!a.constant)throw nb("constexpr",d,c);return a(b)}return e}function oc(a,b){return a="ngClass"+a,["$animate",function(d){function c(a,b){var c=[],d=0;a:for(;d(?:<\/\1>|)$/,Wb=/<|&#?\w+;/,Lf=/<([\w:-]+)/,Mf=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,da={option:[1,'"],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};da.optgroup=da.option,da.tbody=da.tfoot=da.colgroup=da.caption=da.thead,da.th=da.td;var Tf=Node.prototype.contains||function(a){return!!(16&this.compareDocumentPosition(a))},Ra=U.prototype={ready:function(a){function b(){d||(d=!0,a())}var d=!1;"complete"===W.readyState?setTimeout(b):(this.on("DOMContentLoaded",b),U(O).on("load",b))},toString:function(){var a=[];return n(this,function(b){a.push(""+b)}),"["+a.join(", ")+"]"},eq:function(a){return C(0<=a?this[a]:this[this.length+a])},length:0,push:Bg,sort:[].sort,splice:[].splice},Db={};n("multiple selected checked disabled readOnly required open".split(" "),function(a){Db[G(a)]=a});var Uc={};n("input select option textarea button form details".split(" "),function(a){Uc[a]=!0});var cd={ngMinlength:"minlength",ngMaxlength:"maxlength",ngMin:"min",ngMax:"max",ngPattern:"pattern"};n({data:Zb,removeData:hb,hasData:function(a){for(var b in ib[a.ng339])return!0;return!1},cleanData:function(a){for(var b=0,d=a.length;b/,Wf=/^[^\(]*\(\s*([^\)]*)\)/m,Cg=/,/,Dg=/^\s*(_?)(\S+?)\1\s*$/,Uf=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm,Ga=H("$injector");fb.$$annotate=function(a,b,d){var c;if("function"==typeof a){if(!(c=a.$inject)){if(c=[],a.length){if(b)throw F(d)&&d||(d=a.name||Xf(a)),Ga("strictdi",d);b=Vc(a),n(b[1].split(Cg),function(a){a.replace(Dg,function(a,b,d){c.push(d)})})}a.$inject=c}}else L(a)?(b=a.length-1,Sa(a[b],"fn"),c=a.slice(0,b)):Sa(a,"fn",!0);return c};var Rd=H("$animate"),$e=function(){this.$get=function(){}},af=function(){var a=new Ua,b=[];this.$get=["$$AnimateRunner","$rootScope",function(d,c){function e(a,b,c){var d=!1;return b&&(b=F(b)?b.split(" "):L(b)?b:[],n(b,function(b){b&&(d=!0,a[b]=c)})),d}function f(){n(b,function(b){var c=a.get(b);if(c){var d=Yf(b.attr("class")),e="",f="";n(c,function(a,b){a!==!!d[b]&&(a?e+=(e.length?" ":"")+b:f+=(f.length?" ":"")+b)}),n(b,function(a){e&&Bb(a,e),f&&Ab(a,f)}),a.remove(b)}}),b.length=0}return{enabled:B,on:B,off:B,pin:B,push:function(g,h,k,l){return l&&l(),k=k||{},k.from&&g.css(k.from),k.to&&g.css(k.to),(k.addClass||k.removeClass)&&(h=k.addClass,l=k.removeClass,k=a.get(g)||{},h=e(k,h,!0),l=e(k,l,!1),(h||l)&&(a.put(g,k),b.push(g),1===b.length&&c.$$postDigest(f))),g=new d,g.complete(),g}}}]},Ye=["$provide",function(a){var b=this;this.$$registeredAnimations=Object.create(null),this.register=function(d,c){if(d&&"."!==d.charAt(0))throw Rd("notcsel",d);var e=d+"-animation";b.$$registeredAnimations[d.substr(1)]=e,a.factory(e,c)},this.classNameFilter=function(a){if(1===arguments.length&&(this.$$classNameFilter=a instanceof RegExp?a:null)&&/(\s+|\/)ng-animate(\s+|\/)/.test(this.$$classNameFilter.toString()))throw Rd("nongcls","ng-animate");return this.$$classNameFilter},this.$get=["$$animateQueue",function(a){function b(a,c,d){if(d){var h;a:{for(h=0;h <= >= && || ! = |".split(" "),function(a){Pb[a]=!0});var Hg={n:"\n",f:"\f",r:"\r",t:"\t",v:"\v","'":"'",'"':'"'},ic=function(a){this.options=a};ic.prototype={constructor:ic,lex:function(a){for(this.text=a,this.index=0,this.tokens=[];this.index=a&&"string"==typeof a},isWhitespace:function(a){return" "===a||"\r"===a||"\t"===a||"\n"===a||"\v"===a||" "===a},isIdent:function(a){return"a"<=a&&"z">=a||"A"<=a&&"Z">=a||"_"===a||"$"===a},isExpOperator:function(a){return"-"===a||"+"===a||this.isNumber(a)},throwError:function(a,b,d){throw d=d||this.index,b=y(b)?"s "+b+"-"+this.index+" ["+this.text.substring(b,d)+"]":" "+d,ka("lexerr",a,b,this.text)},readNumber:function(){for(var a="",b=this.index;this.index","<=",">=");)a={type:q.BinaryExpression,operator:b.text,left:a,right:this.additive()};return a},additive:function(){for(var b,a=this.multiplicative();b=this.expect("+","-");)a={type:q.BinaryExpression,operator:b.text,left:a,right:this.multiplicative()};return a},multiplicative:function(){for(var b,a=this.unary();b=this.expect("*","/","%");)a={type:q.BinaryExpression,operator:b.text,left:a,right:this.unary()};return a},unary:function(){var a;return(a=this.expect("+","-","!"))?{type:q.UnaryExpression,operator:a.text,prefix:!0,argument:this.unary()}:this.primary()},primary:function(){var a;this.expect("(")?(a=this.filterChain(),this.consume(")")):this.expect("[")?a=this.arrayDeclaration():this.expect("{")?a=this.object():this.constants.hasOwnProperty(this.peek().text)?a=Oa(this.constants[this.consume().text]):this.peek().identifier?a=this.identifier():this.peek().constant?a=this.constant():this.throwError("not a primary expression",this.peek());for(var b;b=this.expect("(","[",".");)"("===b.text?(a={type:q.CallExpression,callee:a,arguments:this.parseArguments()},this.consume(")")):"["===b.text?(a={type:q.MemberExpression,object:a,property:this.expression(),computed:!0},this.consume("]")):"."===b.text?a={type:q.MemberExpression,object:a,property:this.identifier(),computed:!1}:this.throwError("IMPOSSIBLE");return a},filter:function(a){a=[a];for(var b={type:q.CallExpression,callee:this.identifier(),arguments:a,filter:!0};this.expect(":");)a.push(this.expression());return b},parseArguments:function(){var a=[];if(")"!==this.peekToken().text)do{a.push(this.expression())}while(this.expect(","));return a},identifier:function(){var a=this.consume();return a.identifier||this.throwError("is not a valid identifier",a),{type:q.Identifier,name:a.text}},constant:function(){return{type:q.Literal,value:this.consume().value}},arrayDeclaration:function(){var a=[];if("]"!==this.peekToken().text)do{if(this.peek("]"))break;a.push(this.expression())}while(this.expect(","));return this.consume("]"),{type:q.ArrayExpression,elements:a}},object:function(){var b,a=[];if("}"!==this.peekToken().text)do{if(this.peek("}"))break;b={type:q.Property,kind:"init"},this.peek().constant?b.key=this.constant():this.peek().identifier?b.key=this.identifier():this.throwError("invalid key",this.peek()),this.consume(":"),b.value=this.expression(),a.push(b)}while(this.expect(","));return this.consume("}"),{type:q.ObjectExpression,properties:a}},throwError:function(a,b){throw ka("syntax",b.text,a,b.index+1,this.text,this.text.substring(b.index))},consume:function(a){if(0===this.tokens.length)throw ka("ueoe",this.text);var b=this.expect(a);return b||this.throwError("is unexpected, expecting ["+a+"]",this.peek()),b},peekToken:function(){if(0===this.tokens.length)throw ka("ueoe",this.text);return this.tokens[0]},peek:function(a,b,d,c){return this.peekAhead(0,a,b,d,c)},peekAhead:function(a,b,d,c,e){if(this.tokens.length>a){a=this.tokens[a];var f=a.text;if(f===b||f===d||f===c||f===e||!(b||d||c||e))return a}return!1},expect:function(a,b,d,c){return!!(a=this.peek(a,b,d,c))&&(this.tokens.shift(),a)},constants:{true:{type:q.Literal,value:!0},false:{type:q.Literal,value:!1},null:{type:q.Literal,value:null},undefined:{type:q.Literal,value:v},this:{type:q.ThisExpression},$locals:{type:q.LocalsExpression}}},ud.prototype={compile:function(a,b){var d=this,c=this.astBuilder.ast(a);this.state={nextId:0,filters:{},expensiveChecks:b,fn:{vars:[],body:[],own:{}},assign:{vars:[],body:[],own:{}},inputs:[]},R(c,d.$filter);var f,e="";return this.stage="assign",(f=sd(c))&&(this.state.computing="assign",e=this.nextId(),this.recurse(f,e),this.return_(e),e="fn.assign="+this.generateFunction("assign","s,v,l")),f=qd(c.body),d.stage="inputs",n(f,function(a,b){var c="fn"+b;d.state[c]={vars:[],body:[],own:{}},d.state.computing=c;var e=d.nextId();d.recurse(a,e),d.return_(e),d.state.inputs.push(c),a.watchId=b}),this.state.computing="fn",this.stage="main",this.recurse(c),e='"'+this.USE+" "+this.STRICT+'";\n'+this.filterPrefix()+"var fn="+this.generateFunction("fn","s,l,a,i")+e+this.watchFns()+"return fn;",e=new Function("$filter","ensureSafeMemberName","ensureSafeObject","ensureSafeFunction","getStringValue","ensureSafeAssignContext","ifDefined","plus","text",e)(this.$filter,Xa,Aa,od,hg,Ib,lg,pd,a),this.state=this.stage=v,e.literal=td(c),e.constant=c.constant,e},USE:"use",STRICT:"strict",watchFns:function(){var a=[],b=this.state.inputs,d=this;return n(b,function(b){a.push("var "+b+"="+d.generateFunction(b,"s"))}),b.length&&a.push("fn.inputs=["+b.join(",")+"];"),a.join("")},generateFunction:function(a,b){return"function("+b+"){"+this.varsPrefix(a)+this.body(a)+"};"},filterPrefix:function(){var a=[],b=this;return n(this.state.filters,function(d,c){a.push(d+"=$filter("+b.escape(c)+")")}),a.length?"var "+a.join(",")+";":""},varsPrefix:function(a){return this.state[a].vars.length?"var "+this.state[a].vars.join(",")+";":""},body:function(a){return this.state[a].body.join("")},recurse:function(a,b,d,c,e,f){var g,h,l,m,k=this;if(c=c||B,!f&&y(a.watchId))b=b||this.nextId(),this.if_("i",this.lazyAssign(b,this.computedMember("i",a.watchId)),this.lazyRecurse(a,b,d,c,e,!0));else switch(a.type){case q.Program:n(a.body,function(b,c){k.recurse(b.expression,v,v,function(a){h=a}),c!==a.body.length-1?k.current().body.push(h,";"):k.return_(h)});break;case q.Literal:m=this.escape(a.value),this.assign(b,m),c(m);break;case q.UnaryExpression:this.recurse(a.argument,v,v,function(a){h=a}),m=a.operator+"("+this.ifDefined(h,0)+")",this.assign(b,m),c(m);break;case q.BinaryExpression:this.recurse(a.left,v,v,function(a){g=a}),this.recurse(a.right,v,v,function(a){h=a}),m="+"===a.operator?this.plus(g,h):"-"===a.operator?this.ifDefined(g,0)+a.operator+this.ifDefined(h,0):"("+g+")"+a.operator+"("+h+")",this.assign(b,m),c(m);break;case q.LogicalExpression:b=b||this.nextId(),k.recurse(a.left,b),k.if_("&&"===a.operator?b:k.not(b),k.lazyRecurse(a.right,b)),c(b);break;case q.ConditionalExpression:b=b||this.nextId(),k.recurse(a.test,b),k.if_(b,k.lazyRecurse(a.alternate,b),k.lazyRecurse(a.consequent,b)),c(b);break;case q.Identifier:b=b||this.nextId(),d&&(d.context="inputs"===k.stage?"s":this.assign(this.nextId(),this.getHasOwnProperty("l",a.name)+"?l:s"),d.computed=!1,d.name=a.name),Xa(a.name),k.if_("inputs"===k.stage||k.not(k.getHasOwnProperty("l",a.name)),function(){k.if_("inputs"===k.stage||"s",function(){e&&1!==e&&k.if_(k.not(k.nonComputedMember("s",a.name)),k.lazyAssign(k.nonComputedMember("s",a.name),"{}")),k.assign(b,k.nonComputedMember("s",a.name))})},b&&k.lazyAssign(b,k.nonComputedMember("l",a.name))),(k.state.expensiveChecks||Jb(a.name))&&k.addEnsureSafeObject(b),c(b);break;case q.MemberExpression:g=d&&(d.context=this.nextId())||this.nextId(),b=b||this.nextId(),k.recurse(a.object,g,v,function(){k.if_(k.notNull(g),function(){e&&1!==e&&k.addEnsureSafeAssignContext(g),a.computed?(h=k.nextId(),k.recurse(a.property,h),k.getStringValue(h),k.addEnsureSafeMemberName(h),e&&1!==e&&k.if_(k.not(k.computedMember(g,h)),k.lazyAssign(k.computedMember(g,h),"{}")),m=k.ensureSafeObject(k.computedMember(g,h)),k.assign(b,m),d&&(d.computed=!0,d.name=h)):(Xa(a.property.name),e&&1!==e&&k.if_(k.not(k.nonComputedMember(g,a.property.name)),k.lazyAssign(k.nonComputedMember(g,a.property.name),"{}")),m=k.nonComputedMember(g,a.property.name),(k.state.expensiveChecks||Jb(a.property.name))&&(m=k.ensureSafeObject(m)),k.assign(b,m),d&&(d.computed=!1,d.name=a.property.name))},function(){k.assign(b,"undefined")}),c(b)},!!e);break;case q.CallExpression:b=b||this.nextId(),a.filter?(h=k.filter(a.callee.name),l=[],n(a.arguments,function(a){var b=k.nextId();k.recurse(a,b),l.push(b)}),m=h+"("+l.join(",")+")",k.assign(b,m),c(b)):(h=k.nextId(),g={},l=[],k.recurse(a.callee,h,g,function(){k.if_(k.notNull(h),function(){k.addEnsureSafeFunction(h),n(a.arguments,function(a){k.recurse(a,k.nextId(),v,function(a){l.push(k.ensureSafeObject(a))})}),g.name?(k.state.expensiveChecks||k.addEnsureSafeObject(g.context),m=k.member(g.context,g.name,g.computed)+"("+l.join(",")+")"):m=h+"("+l.join(",")+")",m=k.ensureSafeObject(m),k.assign(b,m)},function(){k.assign(b,"undefined")}),c(b)}));break;case q.AssignmentExpression:if(h=this.nextId(),g={},!rd(a.left))throw ka("lval");this.recurse(a.left,v,g,function(){k.if_(k.notNull(g.context),function(){k.recurse(a.right,h),k.addEnsureSafeObject(k.member(g.context,g.name,g.computed)),k.addEnsureSafeAssignContext(g.context),m=k.member(g.context,g.name,g.computed)+a.operator+h,k.assign(b,m),c(b||m)})},1);break;case q.ArrayExpression:l=[],n(a.elements,function(a){k.recurse(a,k.nextId(),v,function(a){l.push(a)})}),m="["+l.join(",")+"]",this.assign(b,m),c(m);break;case q.ObjectExpression:l=[],n(a.properties,function(a){k.recurse(a.value,k.nextId(),v,function(b){l.push(k.escape(a.key.type===q.Identifier?a.key.name:""+a.key.value)+":"+b)})}),m="{"+l.join(",")+"}",this.assign(b,m),c(m);break;case q.ThisExpression:this.assign(b,"s"),c("s");break;case q.LocalsExpression:this.assign(b,"l"),c("l");break;case q.NGValueParameter:this.assign(b,"v"),c("v")}},getHasOwnProperty:function(a,b){var d=a+"."+b,c=this.current().own;return c.hasOwnProperty(d)||(c[d]=this.nextId(!1,a+"&&("+this.escape(b)+" in "+a+")")),c[d]},assign:function(a,b){if(a)return this.current().body.push(a,"=",b,";"),a},filter:function(a){return this.state.filters.hasOwnProperty(a)||(this.state.filters[a]=this.nextId(!0)),this.state.filters[a]},ifDefined:function(a,b){return"ifDefined("+a+","+this.escape(b)+")"},plus:function(a,b){return"plus("+a+","+b+")"},return_:function(a){this.current().body.push("return ",a,";")},if_:function(a,b,d){if(!0===a)b();else{var c=this.current().body;c.push("if(",a,"){"),b(),c.push("}"),d&&(c.push("else{"),d(),c.push("}"))}},not:function(a){return"!("+a+")"},notNull:function(a){return a+"!=null"},nonComputedMember:function(a,b){return a+"."+b},computedMember:function(a,b){return a+"["+b+"]"},member:function(a,b,d){return d?this.computedMember(a,b):this.nonComputedMember(a,b)},addEnsureSafeObject:function(a){this.current().body.push(this.ensureSafeObject(a),";")},addEnsureSafeMemberName:function(a){this.current().body.push(this.ensureSafeMemberName(a),";")},addEnsureSafeFunction:function(a){this.current().body.push(this.ensureSafeFunction(a),";")},addEnsureSafeAssignContext:function(a){this.current().body.push(this.ensureSafeAssignContext(a),";")},ensureSafeObject:function(a){return"ensureSafeObject("+a+",text)"},ensureSafeMemberName:function(a){return"ensureSafeMemberName("+a+",text)"},ensureSafeFunction:function(a){return"ensureSafeFunction("+a+",text)"},getStringValue:function(a){this.assign(a,"getStringValue("+a+")")},ensureSafeAssignContext:function(a){return"ensureSafeAssignContext("+a+",text)"},lazyRecurse:function(a,b,d,c,e,f){var g=this;return function(){g.recurse(a,b,d,c,e,f)}},lazyAssign:function(a,b){var d=this;return function(){d.assign(a,b)}},stringEscapeRegex:/[^ a-zA-Z0-9]/g,stringEscapeFn:function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)},escape:function(a){if(F(a))return"'"+a.replace(this.stringEscapeRegex,this.stringEscapeFn)+"'";if(N(a))return a.toString();if(!0===a)return"true";if(!1===a)return"false";if(null===a)return"null";if(void 0===a)return"undefined";throw ka("esc")},nextId:function(a,b){var d="v"+this.state.nextId++;return a||this.current().vars.push(d+(b?"="+b:"")),d},current:function(){return this.state[this.state.computing]}},vd.prototype={compile:function(a,b){var d=this,c=this.astBuilder.ast(a);this.expression=a,this.expensiveChecks=b,R(c,d.$filter);var e,f;(e=sd(c))&&(f=this.recurse(e)),e=qd(c.body);var g;e&&(g=[],n(e,function(a,b){var c=d.recurse(a);a.input=c,g.push(c),a.watchId=b}));var h=[];return n(c.body,function(a){h.push(d.recurse(a.expression))}),e=0===c.body.length?function(){}:1===c.body.length?h[0]:function(a,b){var c;return n(h,function(d){c=d(a,b)}),c},f&&(e.assign=function(a,b,c){return f(a,c,b)}),g&&(e.inputs=g),e.literal=td(c),e.constant=c.constant,e},recurse:function(a,b,d){var c,e,g,f=this;if(a.input)return this.inputs(a.input,a.watchId);switch(a.type){case q.Literal:return this.value(a.value,b);case q.UnaryExpression:return e=this.recurse(a.argument),this["unary"+a.operator](e,b);case q.BinaryExpression:case q.LogicalExpression:return c=this.recurse(a.left),e=this.recurse(a.right),this["binary"+a.operator](c,e,b);case q.ConditionalExpression:return this["ternary?:"](this.recurse(a.test),this.recurse(a.alternate),this.recurse(a.consequent),b);case q.Identifier:return Xa(a.name,f.expression),f.identifier(a.name,f.expensiveChecks||Jb(a.name),b,d,f.expression);case q.MemberExpression:return c=this.recurse(a.object,!1,!!d),a.computed||(Xa(a.property.name,f.expression),e=a.property.name),a.computed&&(e=this.recurse(a.property)),a.computed?this.computedMember(c,e,b,d,f.expression):this.nonComputedMember(c,e,f.expensiveChecks,b,d,f.expression);case q.CallExpression:return g=[],n(a.arguments,function(a){g.push(f.recurse(a))}),a.filter&&(e=this.$filter(a.callee.name)),a.filter||(e=this.recurse(a.callee,!0)),a.filter?function(a,c,d,f){for(var r=[],n=0;n":function(a,b,d){return function(c,e,f,g){return c=a(c,e,f,g)>b(c,e,f,g),d?{value:c}:c}},"binary<=":function(a,b,d){return function(c,e,f,g){return c=a(c,e,f,g)<=b(c,e,f,g),d?{value:c}:c}},"binary>=":function(a,b,d){return function(c,e,f,g){return c=a(c,e,f,g)>=b(c,e,f,g),d?{value:c}:c}},"binary&&":function(a,b,d){return function(c,e,f,g){return c=a(c,e,f,g)&&b(c,e,f,g),d?{value:c}:c}},"binary||":function(a,b,d){return function(c,e,f,g){return c=a(c,e,f,g)||b(c,e,f,g),d?{value:c}:c}},"ternary?:":function(a,b,d,c){return function(e,f,g,h){return e=a(e,f,g,h)?b(e,f,g,h):d(e,f,g,h),c?{value:e}:e}},value:function(a,b){return function(){return b?{context:v,name:v,value:a}:a}},identifier:function(a,b,d,c,e){return function(f,g,h,k){return f=g&&a in g?g:f,c&&1!==c&&f&&!f[a]&&(f[a]={}),g=f?f[a]:v,b&&Aa(g,e),d?{context:f,name:a,value:g}:g}},computedMember:function(a,b,d,c,e){return function(f,g,h,k){var m,n,l=a(f,g,h,k);return null!=l&&(m=b(f,g,h,k),m+="",Xa(m,e),c&&1!==c&&(Ib(l),l&&!l[m]&&(l[m]={})),n=l[m],Aa(n,e)),d?{context:l,name:m,value:n}:n}},nonComputedMember:function(a,b,d,c,e,f){return function(g,h,k,l){return g=a(g,h,k,l),e&&1!==e&&(Ib(g),g&&!g[b]&&(g[b]={})),h=null!=g?g[b]:v,(d||Jb(b))&&Aa(h,f),c?{context:g,name:b,value:h}:h}},inputs:function(a,b){return function(d,c,e,f){return f?f[b]:a(d,c,e)}}};var jc=function(a,b,d){this.lexer=a,this.$filter=b,this.options=d,this.ast=new q(this.lexer),this.astCompiler=d.csp?new vd(this.ast,b):new ud(this.ast,b)};jc.prototype={constructor:jc,parse:function(a){return this.astCompiler.compile(a,this.options.expensiveChecks)}};var mg=Object.prototype.valueOf,Ba=H("$sce"),qa={HTML:"html",CSS:"css",URL:"url",RESOURCE_URL:"resourceUrl",JS:"js"},ja=H("$compile"),Y=W.createElement("a"),zd=za(O.location.href);Ad.$inject=["$document"],Lc.$inject=["$provide"];var Hd=22,Gd=".",lc="0";Bd.$inject=["$locale"],Dd.$inject=["$locale"];var yg={yyyy:aa("FullYear",4),yy:aa("FullYear",2,0,!0),y:aa("FullYear",1),MMMM:Lb("Month"),MMM:Lb("Month",!0),MM:aa("Month",2,1),M:aa("Month",1,1),dd:aa("Date",2),d:aa("Date",1),HH:aa("Hours",2),H:aa("Hours",1),hh:aa("Hours",2,-12),h:aa("Hours",1,-12),mm:aa("Minutes",2),m:aa("Minutes",1),ss:aa("Seconds",2),s:aa("Seconds",1),sss:aa("Milliseconds",3),EEEE:Lb("Day"),EEE:Lb("Day",!0),a:function(a,b){return 12>a.getHours()?b.AMPMS[0]:b.AMPMS[1]},Z:function(a,b,d){return a=-1*d,a=(0<=a?"+":"")+(Kb(Math[0=a.getFullYear()?b.ERANAMES[0]:b.ERANAMES[1]}},xg=/((?:[^yMdHhmsaZEwG']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z|G+|w+))(.*)/,wg=/^\-?\d+$/;Cd.$inject=["$locale"];var rg=ba(G),sg=ba(ub);Ed.$inject=["$parse"];var oe=ba({restrict:"E",compile:function(a,b){if(!b.href&&!b.xlinkHref)return function(a,b){if("a"===b[0].nodeName.toLowerCase()){var e="[object SVGAnimatedString]"===ga.call(b.prop("href"))?"xlink:href":"href";b.on("click",function(a){b.attr(e)||a.preventDefault()})}}}}),vb={};n(Db,function(a,b){function d(a,d,e){a.$watch(e[c],function(a){e.$set(b,!!a)})}if("multiple"!=a){var c=va("ng-"+b),e=d;"checked"===a&&(e=function(a,b,e){e.ngModel!==e[c]&&d(a,b,e)}),vb[c]=function(){return{restrict:"A",priority:100,link:e}}}}),n(cd,function(a,b){vb[b]=function(){return{priority:100,link:function(a,c,e){if("ngPattern"===b&&"/"==e.ngPattern.charAt(0)&&(c=e.ngPattern.match(Ag)))return void e.$set("ngPattern",new RegExp(c[1],c[2]));a.$watch(e[b],function(a){e.$set(b,a)})}}}}),n(["src","srcset","href"],function(a){var b=va("ng-"+a);vb[b]=function(){return{priority:99,link:function(d,c,e){var f=a,g=a;"href"===a&&"[object SVGAnimatedString]"===ga.call(c.prop("href"))&&(g="xlinkHref",e.$attr[g]="xlink:href",f=null),e.$observe(b,function(b){b?(e.$set(g,b),xa&&f&&c.prop(f,e[g])):"href"===a&&e.$set(g,null)})}}}});var Mb={$addControl:B,$$renameControl:function(a,b){a.$name=b},$removeControl:B,$setValidity:B,$setDirty:B,$setPristine:B,$setSubmitted:B};Kd.$inject=["$element","$attrs","$scope","$animate","$interpolate"];var Sd=function(a){return["$timeout","$parse",function(b,d){function c(a){return""===a?d('this[""]').assign:d(a).assign||B}return{name:"form",restrict:a?"EAC":"E",require:["form","^^?form"],controller:Kd,compile:function(d,f){d.addClass(Ya).addClass(ob);var g=f.name?"name":!(!a||!f.ngForm)&&"ngForm";return{pre:function(a,d,e,f){var n=f[0];if(!("action"in e)){var s=function(b){a.$apply(function(){n.$commitViewValue(),n.$setSubmitted()}),b.preventDefault()};d[0].addEventListener("submit",s,!1),d.on("$destroy",function(){b(function(){d[0].removeEventListener("submit",s,!1)},0,!1)})}(f[1]||n.$$parentForm).$addControl(n);var q=g?c(n.$name):B;g&&(q(a,n),e.$observe(g,function(b){n.$name!==b&&(q(a,v),n.$$parentForm.$$renameControl(n,b),(q=c(n.$name))(a,n))})),d.on("$destroy",function(){n.$$parentForm.$removeControl(n),q(a,v),T(n,Mb)})}}}}}]},pe=Sd(),Ce=Sd(!0),zg=/\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z)/,Ig=/^[a-z][a-z\d.+-]*:\/*(?:[^:@]+(?::[^@]+)?@)?(?:[^\s:/?#]+|\[[a-f\d:]+\])(?::\d+)?(?:\/[^?#]*)?(?:\?[^#]*)?(?:#.*)?$/i,Jg=/^[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i,Kg=/^\s*(\-|\+)?(\d+|(\d*(\.\d*)))([eE][+-]?\d+)?\s*$/,Td=/^(\d{4})-(\d{2})-(\d{2})$/,Ud=/^(\d{4})-(\d\d)-(\d\d)T(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,pc=/^(\d{4})-W(\d\d)$/,Vd=/^(\d{4})-(\d\d)$/,Wd=/^(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,Xd={text:function(a,b,d,c,e,f){lb(a,b,d,c,e,f),nc(c)},date:mb("date",Td,Ob(Td,["yyyy","MM","dd"]),"yyyy-MM-dd"),"datetime-local":mb("datetimelocal",Ud,Ob(Ud,"yyyy MM dd HH mm ss sss".split(" ")),"yyyy-MM-ddTHH:mm:ss.sss"),time:mb("time",Wd,Ob(Wd,["HH","mm","ss","sss"]),"HH:mm:ss.sss"),week:mb("week",pc,function(a,b){if(V(a))return a;if(F(a)){pc.lastIndex=0;var d=pc.exec(a);if(d){var c=+d[1],e=+d[2],f=d=0,g=0,h=0,k=Id(c),e=7*(e-1);return b&&(d=b.getHours(),f=b.getMinutes(),g=b.getSeconds(),h=b.getMilliseconds()),new Date(c,0,k.getDate()+e,d,f,g,h)}}return NaN},"yyyy-Www"),month:mb("month",Vd,Ob(Vd,["yyyy","MM"]),"yyyy-MM"),number:function(a,b,d,c,e,f){if(Md(a,b,d,c),lb(a,b,d,c,e,f),c.$$parserName="number",c.$parsers.push(function(a){return c.$isEmpty(a)?null:Kg.test(a)?parseFloat(a):v}),c.$formatters.push(function(a){if(!c.$isEmpty(a)){if(!N(a))throw nb("numfmt",a);a=a.toString()}return a}),y(d.min)||d.ngMin){var g;c.$validators.min=function(a){return c.$isEmpty(a)||x(g)||a>=g},d.$observe("min",function(a){y(a)&&!N(a)&&(a=parseFloat(a,10)),g=N(a)&&!isNaN(a)?a:v,c.$validate()})}if(y(d.max)||d.ngMax){var h;c.$validators.max=function(a){return c.$isEmpty(a)||x(h)||a<=h},d.$observe("max",function(a){y(a)&&!N(a)&&(a=parseFloat(a,10)),h=N(a)&&!isNaN(a)?a:v,c.$validate()})}},url:function(a,b,d,c,e,f){lb(a,b,d,c,e,f),nc(c),c.$$parserName="url",c.$validators.url=function(a,b){var d=a||b;return c.$isEmpty(d)||Ig.test(d)}},email:function(a,b,d,c,e,f){lb(a,b,d,c,e,f),nc(c),c.$$parserName="email",c.$validators.email=function(a,b){var d=a||b;return c.$isEmpty(d)||Jg.test(d)}},radio:function(a,b,d,c){x(d.name)&&b.attr("name",++pb),b.on("click",function(a){b[0].checked&&c.$setViewValue(d.value,a&&a.type)}),c.$render=function(){b[0].checked=d.value==c.$viewValue},d.$observe("value",c.$render)},checkbox:function(a,b,d,c,e,f,g,h){var k=Nd(h,a,"ngTrueValue",d.ngTrueValue,!0),l=Nd(h,a,"ngFalseValue",d.ngFalseValue,!1);b.on("click",function(a){c.$setViewValue(b[0].checked,a&&a.type)}),c.$render=function(){b[0].checked=c.$viewValue},c.$isEmpty=function(a){return!1===a},c.$formatters.push(function(a){return oa(a,k)}),c.$parsers.push(function(a){return a?k:l})},hidden:B,button:B,submit:B,reset:B,file:B},Fc=["$browser","$sniffer","$filter","$parse",function(a,b,d,c){return{restrict:"E",require:["?ngModel"],link:{pre:function(e,f,g,h){ h[0]&&(Xd[G(g.type)]||Xd.text)(e,f,g,h[0],b,a,d,c)}}}}],Lg=/^(true|false|\d+)$/,Ue=function(){return{restrict:"A",priority:100,compile:function(a,b){return Lg.test(b.ngValue)?function(a,b,e){e.$set("value",a.$eval(e.ngValue))}:function(a,b,e){a.$watch(e.ngValue,function(a){e.$set("value",a)})}}}},ue=["$compile",function(a){return{restrict:"AC",compile:function(b){return a.$$addBindingClass(b),function(b,c,e){a.$$addBindingInfo(c,e.ngBind),c=c[0],b.$watch(e.ngBind,function(a){c.textContent=x(a)?"":a})}}}}],we=["$interpolate","$compile",function(a,b){return{compile:function(d){return b.$$addBindingClass(d),function(c,d,f){c=a(d.attr(f.$attr.ngBindTemplate)),b.$$addBindingInfo(d,c.expressions),d=d[0],f.$observe("ngBindTemplate",function(a){d.textContent=x(a)?"":a})}}}}],ve=["$sce","$parse","$compile",function(a,b,d){return{restrict:"A",compile:function(c,e){var f=b(e.ngBindHtml),g=b(e.ngBindHtml,function(a){return(a||"").toString()});return d.$$addBindingClass(c),function(b,c,e){d.$$addBindingInfo(c,e.ngBindHtml),b.$watch(g,function(){c.html(a.getTrustedHtml(f(b))||"")})}}}}],Te=ba({restrict:"A",require:"ngModel",link:function(a,b,d,c){c.$viewChangeListeners.push(function(){a.$eval(d.ngChange)})}}),xe=oc("",!0),ze=oc("Odd",0),ye=oc("Even",1),Ae=Ma({compile:function(a,b){b.$set("ngCloak",v),a.removeClass("ng-cloak")}}),Be=[function(){return{restrict:"A",scope:!0,controller:"@",priority:500}}],Kc={},Mg={blur:!0,focus:!0};n("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste".split(" "),function(a){var b=va("ng-"+a);Kc[b]=["$parse","$rootScope",function(d,c){return{restrict:"A",compile:function(e,f){var g=d(f[b],null,!0);return function(b,d){d.on(a,function(d){var e=function(){g(b,{$event:d})};Mg[a]&&c.$$phase?b.$evalAsync(e):b.$apply(e)})}}}}]});var Ee=["$animate",function(a){return{multiElement:!0,transclude:"element",priority:600,terminal:!0,restrict:"A",$$tlb:!0,link:function(b,d,c,e,f){var g,h,k;b.$watch(c.ngIf,function(b){b?h||f(function(b,e){h=e,b[b.length++]=W.createComment(" end ngIf: "+c.ngIf+" "),g={clone:b},a.enter(b,d.parent(),d)}):(k&&(k.remove(),k=null),h&&(h.$destroy(),h=null),g&&(k=tb(g.clone),a.leave(k).then(function(){k=null}),g=null))})}}}],Fe=["$templateRequest","$anchorScroll","$animate",function(a,b,d){return{restrict:"ECA",priority:400,terminal:!0,transclude:"element",controller:ia.noop,compile:function(c,e){var f=e.ngInclude||e.src,g=e.onload||"",h=e.autoscroll;return function(c,e,m,n,s){var v,t,p,q=0,w=function(){t&&(t.remove(),t=null),v&&(v.$destroy(),v=null),p&&(d.leave(p).then(function(){t=null}),t=p,p=null)};c.$watch(f,function(f){var m=function(){!y(h)||h&&!c.$eval(h)||b()},z=++q;f?(a(f,!0).then(function(a){if(!c.$$destroyed&&z===q){var b=c.$new();n.template=a,a=s(b,function(a){w(),d.enter(a,null,e).then(m)}),v=b,p=a,v.$emit("$includeContentLoaded",f),c.$eval(g)}},function(){c.$$destroyed||z!==q||(w(),c.$emit("$includeContentError",f))}),c.$emit("$includeContentRequested",f)):(w(),n.template=null)})}}}}],We=["$compile",function(a){return{restrict:"ECA",priority:-400,require:"ngInclude",link:function(b,d,c,e){ga.call(d[0]).match(/SVG/)?(d.empty(),a(Nc(e.template,W).childNodes)(b,function(a){d.append(a)},{futureParentElement:d})):(d.html(e.template),a(d.contents())(b))}}}],Ge=Ma({priority:450,compile:function(){return{pre:function(a,b,d){a.$eval(d.ngInit)}}}}),Se=function(){return{restrict:"A",priority:100,require:"ngModel",link:function(a,b,d,c){var e=b.attr(d.$attr.ngList)||", ",f="false"!==d.ngTrim,g=f?X(e):e;c.$parsers.push(function(a){if(!x(a)){var b=[];return a&&n(a.split(g),function(a){a&&b.push(f?X(a):a)}),b}}),c.$formatters.push(function(a){return L(a)?a.join(e):v}),c.$isEmpty=function(a){return!a||!a.length}}}},ob="ng-valid",Od="ng-invalid",Ya="ng-pristine",Nb="ng-dirty",Qd="ng-pending",nb=H("ngModel"),Ng=["$scope","$exceptionHandler","$attrs","$element","$parse","$animate","$timeout","$rootScope","$q","$interpolate",function(a,b,d,c,e,f,g,h,k,l){this.$modelValue=this.$viewValue=Number.NaN,this.$$rawModelValue=v,this.$validators={},this.$asyncValidators={},this.$parsers=[],this.$formatters=[],this.$viewChangeListeners=[],this.$untouched=!0,this.$touched=!1,this.$pristine=!0,this.$dirty=!1,this.$valid=!0,this.$invalid=!1,this.$error={},this.$$success={},this.$pending=v,this.$name=l(d.name||"",!1)(a),this.$$parentForm=Mb;var t,m=e(d.ngModel),r=m.assign,q=m,I=r,K=null,p=this;this.$$setOptions=function(a){if((p.$options=a)&&a.getterSetter){var b=e(d.ngModel+"()"),f=e(d.ngModel+"($$$p)");q=function(a){var c=m(a);return D(c)&&(c=b(a)),c},I=function(a,b){D(m(a))?f(a,{$$$p:p.$modelValue}):r(a,p.$modelValue)}}else if(!m.assign)throw nb("nonassign",d.ngModel,ta(c))},this.$render=B,this.$isEmpty=function(a){return x(a)||""===a||null===a||a!==a},this.$$updateEmptyClasses=function(a){p.$isEmpty(a)?(f.removeClass(c,"ng-not-empty"),f.addClass(c,"ng-empty")):(f.removeClass(c,"ng-empty"),f.addClass(c,"ng-not-empty"))};var w=0;Ld({ctrl:this,$element:c,set:function(a,b){a[b]=!0},unset:function(a,b){delete a[b]},$animate:f}),this.$setPristine=function(){p.$dirty=!1,p.$pristine=!0,f.removeClass(c,Nb),f.addClass(c,Ya)},this.$setDirty=function(){p.$dirty=!0,p.$pristine=!1,f.removeClass(c,Ya),f.addClass(c,Nb),p.$$parentForm.$setDirty()},this.$setUntouched=function(){p.$touched=!1,p.$untouched=!0,f.setClass(c,"ng-untouched","ng-touched")},this.$setTouched=function(){p.$touched=!0,p.$untouched=!1,f.setClass(c,"ng-touched","ng-untouched")},this.$rollbackViewValue=function(){g.cancel(K),p.$viewValue=p.$$lastCommittedViewValue,p.$render()},this.$validate=function(){if(!N(p.$modelValue)||!isNaN(p.$modelValue)){var a=p.$$rawModelValue,b=p.$valid,c=p.$modelValue,d=p.$options&&p.$options.allowInvalid;p.$$runValidators(a,p.$$lastCommittedViewValue,function(e){d||b===e||(p.$modelValue=e?a:v,p.$modelValue!==c&&p.$$writeModelToScope())})}},this.$$runValidators=function(a,b,c){function f(a,b){h===w&&p.$setValidity(a,b)}function g(a){h===w&&c(a)}w++;var h=w;!function(){var a=p.$$parserName||"parse";return x(t)?(f(a,null),!0):(t||(n(p.$validators,function(a,b){f(b,null)}),n(p.$asyncValidators,function(a,b){f(b,null)})),f(a,t),t)}()?g(!1):function(){var c=!0;return n(p.$validators,function(d,e){var g=d(a,b);c=c&&g,f(e,g)}),!!c||(n(p.$asyncValidators,function(a,b){f(b,null)}),!1)}()?function(){var c=[],d=!0;n(p.$asyncValidators,function(e,g){var h=e(a,b);if(!h||!D(h.then))throw nb("nopromise",h);f(g,v),c.push(h.then(function(){f(g,!0)},function(a){d=!1,f(g,!1)}))}),c.length?k.all(c).then(function(){g(d)},B):g(!0)}():g(!1)},this.$commitViewValue=function(){var a=p.$viewValue;g.cancel(K),(p.$$lastCommittedViewValue!==a||""===a&&p.$$hasNativeValidators)&&(p.$$updateEmptyClasses(a),p.$$lastCommittedViewValue=a,p.$pristine&&this.$setDirty(),this.$$parseAndValidate())},this.$$parseAndValidate=function(){var b=p.$$lastCommittedViewValue;if(t=!x(b)||v)for(var c=0;ce||c.$isEmpty(b)||b.length<=e}}}}},Ic=function(){return{restrict:"A",require:"?ngModel",link:function(a,b,d,c){if(c){var e=0;d.$observe("minlength",function(a){e=ca(a)||0,c.$validate()}),c.$validators.minlength=function(a,b){return c.$isEmpty(b)||b.length>=e}}}}};O.angular.bootstrap?console.log("WARNING: Tried to load angular more than once."):(function(){var a;if(!Cc){var b=rb();(ua=x(b)?O.jQuery:b?O[b]:v)&&ua.fn.on?(C=ua,T(ua.fn,{scope:Ra.scope,isolateScope:Ra.isolateScope,controller:Ra.controller,injector:Ra.injector,inheritedData:Ra.inheritedData}),a=ua.cleanData,ua.cleanData=function(b){for(var c,f,e=0;null!=(f=b[e]);e++)(c=ua._data(f,"events"))&&c.$destroy&&ua(f).triggerHandler("$destroy");a(b)}):C=U,ia.element=C,Cc=!0}}(),function(a){T(a,{bootstrap:Ac,copy:Oa,extend:T,merge:Zd,equals:oa,element:C,forEach:n,injector:fb,noop:B,bind:vc,toJson:eb,fromJson:wc,identity:ab,isUndefined:x,isDefined:y,isString:F,isFunction:D,isObject:E,isNumber:N,isElement:Rb,isArray:L,version:me,isDate:V,lowercase:G,uppercase:ub,callbacks:{counter:0},getTestability:he,$$minErr:H,$$csp:Ea,reloadWithDebugInfo:ge}),(Vb=ke(O))("ng",["ngLocale"],["$provide",function(a){a.provider({$$sanitizeUri:ne}),a.provider("$compile",Ec).directive({a:oe,input:Fc,textarea:Fc,form:pe,script:qe,select:re,style:se,option:te,ngBind:ue,ngBindHtml:ve,ngBindTemplate:we,ngClass:xe,ngClassEven:ye,ngClassOdd:ze,ngCloak:Ae,ngController:Be,ngForm:Ce,ngHide:De,ngIf:Ee,ngInclude:Fe,ngInit:Ge,ngNonBindable:He,ngPluralize:Ie,ngRepeat:Je,ngShow:Ke,ngStyle:Le,ngSwitch:Me,ngSwitchWhen:Ne,ngSwitchDefault:Oe,ngOptions:Pe,ngTransclude:Qe,ngModel:Re,ngList:Se,ngChange:Te,pattern:Gc,ngPattern:Gc,required:Hc,ngRequired:Hc,minlength:Ic,ngMinlength:Ic,maxlength:Jc,ngMaxlength:Jc,ngValue:Ue,ngModelOptions:Ve}).directive({ngInclude:We}).directive(vb).directive(Kc),a.provider({$anchorScroll:Xe,$animate:Ye,$animateCss:Ze,$$animateJs:$e,$$animateQueue:af,$$AnimateRunner:bf,$$animateAsyncRun:cf,$browser:df,$cacheFactory:ef,$controller:ff,$document:gf,$exceptionHandler:hf,$filter:Lc,$$forceReflow:jf,$interpolate:kf,$interval:lf,$http:mf,$httpParamSerializer:nf,$httpParamSerializerJQLike:of,$httpBackend:pf,$xhrFactory:qf,$location:rf,$log:sf,$parse:tf,$rootScope:uf,$q:vf,$$q:wf,$sce:xf,$sceDelegate:yf,$sniffer:zf,$templateCache:Af,$templateRequest:Bf,$$testability:Cf,$timeout:Df,$window:Ef,$$rAF:Ff,$$jqLite:Gf,$$HashMap:Hf,$$cookieReader:If})}])}(ia),ia.module("ngLocale",[],["$provide",function(a){function b(a){a+="";var b=a.indexOf(".");return-1==b?0:a.length-b-1}a.value("$locale",{DATETIME_FORMATS:{AMPMS:["AM","PM"],DAY:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),ERANAMES:["Before Christ","Anno Domini"],ERAS:["BC","AD"],FIRSTDAYOFWEEK:6,MONTH:"January February March April May June July August September October November December".split(" "),SHORTDAY:"Sun Mon Tue Wed Thu Fri Sat".split(" "),SHORTMONTH:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),STANDALONEMONTH:"January February March April May June July August September October November December".split(" "),WEEKENDRANGE:[5,6],fullDate:"EEEE, MMMM d, y",longDate:"MMMM d, y",medium:"MMM d, y h:mm:ss a",mediumDate:"MMM d, y",mediumTime:"h:mm:ss a",short:"M/d/yy h:mm a",shortDate:"M/d/yy",shortTime:"h:mm a"},NUMBER_FORMATS:{CURRENCY_SYM:"$",DECIMAL_SEP:".",GROUP_SEP:",",PATTERNS:[{gSize:3,lgSize:3,maxFrac:3,minFrac:0,minInt:1,negPre:"-",negSuf:"",posPre:"",posSuf:""},{gSize:3,lgSize:3,maxFrac:2,minFrac:2,minInt:1,negPre:"-¤",negSuf:"",posPre:"¤",posSuf:""}]},id:"en-us",localeID:"en_US",pluralCat:function(a,c){var e=0|a,f=c;return v===f&&(f=Math.min(b(a),3)),Math.pow(10,f),1==e&&0==f?"one":"other"}})}]),C(W).ready(function(){fe(W,Ac)}))}(window,document),!window.angular.$$csp().noInlineStyle&&window.angular.element(document.head).prepend(''),function(D,r,Va){"use strict";function ya(a,b,c){if(!a)throw Ka("areq",b||"?",c||"required");return a}function za(a,b){return a||b?a?b?(ba(a)&&(a=a.join(" ")),ba(b)&&(b=b.join(" ")),a+" "+b):a:b:""}function La(a){var b={};return a&&(a.to||a.from)&&(b.to=a.to,b.from=a.from),b}function X(a,b,c){var d="";return a=ba(a)?a:a&&R(a)&&a.length?a.split(/\s+/):[],s(a,function(a,g){a&&0=a&&(a=e,e=0,b.push(t),t=[]),t.push(g.fn),g.children.forEach(function(a){e++,c.push(a)}),a--}return t.length&&b.push(t),b}(c)}var M=[],r=U(a);return function(u,A,v){function z(a){a=a.hasAttribute("ng-animate-ref")?[a]:a.querySelectorAll("[ng-animate-ref]");var b=[];return s(a,function(a){var c=a.getAttribute("ng-animate-ref");c&&c.length&&b.push(a)}),b}function K(a){var b=[],c={};s(a,function(a,f){var d=G(a.element),h=0<=["enter","move"].indexOf(a.event),d=a.structural?z(d):[];if(d.length){var e=h?"to":"from";s(d,function(a){var b=a.getAttribute("ng-animate-ref");c[b]=c[b]||{},c[b][e]={animationID:f,element:I(a)}})}else b.push(a)});var d={},h={};return s(c,function(c,e){var l=c.from,t=c.to;if(l&&t){var g=a[l.animationID],E=a[t.animationID],k=l.animationID.toString();if(!h[k]){var z=h[k]={structural:!0,beforeStart:function(){g.beforeStart(),E.beforeStart()},close:function(){g.close(),E.close()},classes:J(g.classes,E.classes),from:g,to:E,anchors:[]};z.classes.length?b.push(z):(b.push(g),b.push(E))}h[k].anchors.push({out:l.element,in:t.element})}else l=l?l.animationID:t.animationID,t=l.toString(),d[t]||(d[t]=!0,b.push(a[l]))}),b}function J(a,b){a=a.split(" "),b=b.split(" ");for(var c=[],d=0;d=P&&b>=O&&(wa=!0,q())}function L(){function b(){if(!A){if(t(!1),s(m,function(a){l.style[a[0]]=a[1]}),z(a,f),e.addClass(a,ca),p.recalculateTimingStyles){if(ja=l.className+" "+da,ga=r(l,ja),F=v(l,ja,ga),$=F.maxDelay,n=Math.max($,0),0===(O=F.maxDuration))return void q();p.hasTransitions=0B.expectedEndTime)?H.cancel(B.timer):g.push(q)}L&&(k=H(c,k,!1),g[0]={timer:k,expectedEndTime:d},g.push(q),a.data("$$animateCss",g)),ea.length&&a.on(ea.join(" "),E),f.to&&(f.cleanupStyles&&Ga(x,l,Object.keys(f.to)),Ba(a,f))}}function c(){var b=a.data("$$animateCss");if(b){for(var d=1;d=31&&e.keyCode<=90},isNumPadKey:function(e){return 3===e.location&&e.keyCode>=97&&e.keyCode<=105},isNavigationKey:function(e){var t=m.KEY_CODE;return-1!=[t.SPACE,t.ENTER,t.UP_ARROW,t.DOWN_ARROW].indexOf(e.keyCode)},KEY_CODE:{COMMA:188,SEMICOLON:186,ENTER:13,ESCAPE:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT_ARROW:37,UP_ARROW:38,RIGHT_ARROW:39,DOWN_ARROW:40,TAB:9,BACKSPACE:8,DELETE:46},CSS:{TRANSITIONEND:"transitionend"+(s?" webkitTransitionEnd":""),ANIMATIONEND:"animationend"+(s?" webkitAnimationEnd":""),TRANSFORM:i("transform"),TRANSFORM_ORIGIN:i("transformOrigin"),TRANSITION:i("transition"),TRANSITION_DURATION:i("transitionDuration"),ANIMATION_PLAY_STATE:i("animationPlayState"),ANIMATION_DURATION:i("animationDuration"),ANIMATION_NAME:i("animationName"),ANIMATION_TIMING:i("animationTimingFunction"),ANIMATION_DIRECTION:i("animationDirection")},MEDIA:{xs:"(max-width: 599px)","gt-xs":"(min-width: 600px)",sm:"(min-width: 600px) and (max-width: 959px)","gt-sm":"(min-width: 960px)",md:"(min-width: 960px) and (max-width: 1279px)","gt-md":"(min-width: 1280px)",lg:"(min-width: 1280px) and (max-width: 1919px)","gt-lg":"(min-width: 1920px)",xl:"(min-width: 1920px)",landscape:"(orientation: landscape)",portrait:"(orientation: portrait)",print:"print"},MEDIA_PRIORITY:["xl","gt-lg","lg","gt-md","md","gt-sm","sm","gt-xs","xs","landscape","portrait","print"]};return m}e.$inject=["$sniffer","$window","$document"],t.module("material.core").factory("$mdConstant",e)}(),function(){function e(e,n){function o(){return[].concat(v)}function i(){return v.length}function r(e){return v.length&&e>-1&&e-1}function h(){return v.length?v[0]:null}function f(){return v.length?v[v.length-1]:null}function g(e,o,i,a){i=i||b;for(var d=u(o);;){if(!r(d))return null;var s=d+(e?-1:1),l=null;if(r(s)?l=v[s]:n&&(l=e?f():h(),s=u(l)),null===l||s===a)return null;if(i(l))return l;t.isUndefined(a)&&(a=s),d=s}}var b=function(){return!0};e&&!t.isArray(e)&&(e=Array.prototype.slice.call(e)),n=!!n;var v=e||[];return{items:o,count:i,inRange:r,contains:p,indexOf:u,itemAt:s,findBy:l,add:c,remove:m,first:h,last:f,next:t.bind(null,g,!1),previous:t.bind(null,g,!0),hasPrevious:d,hasNext:a}}t.module("material.core").config(["$provide",function(t){t.decorator("$mdUtil",["$delegate",function(t){return t.iterator=e,t}])}])}(),function(){function e(e,n,o){function i(e){var n=u[e];t.isUndefined(n)&&(n=u[e]=r(e));var o=h[n];return t.isUndefined(o)&&(o=a(n)),o}function r(t){return e.MEDIA[t]||("("!==t.charAt(0)?"("+t+")":t)}function a(e){var t=p[e];return t||(t=p[e]=o.matchMedia(e)),t.addListener(d),h[t.media]=!!t.matches}function d(e){n.$evalAsync(function(){h[e.media]=!!e.matches})}function s(e){return p[e]}function l(t,n){for(var o=0;o-1}function g(e){return String(e).indexOf("%")>-1}function b(e){return e[0]||e}var v=l.startSymbol(),E=l.endSymbol(),$="{{"===v&&"}}"===E,C=function(e,n,o){var i=!1;if(e&&e.length){var r=u.getComputedStyle(e[0]);i=t.isDefined(r[n])&&(!o||r[n]==o)}return i},M={dom:{},now:e.performance?t.bind(e.performance,e.performance.now):Date.now||function(){return(new Date).getTime()},bidi:function(e,n,i,r){var a=!("rtl"==o[0].dir||"rtl"==o[0].body.dir);if(0==arguments.length)return a?"ltr":"rtl";var d=t.element(e);a&&t.isDefined(i)?d.css(n,h(i)):!a&&t.isDefined(r)&&d.css(n,h(r))},bidiProperty:function(e,n,i,r){var a=!("rtl"==o[0].dir||"rtl"==o[0].body.dir),d=t.element(e);a&&t.isDefined(n)?(d.css(n,h(r)),d.css(i,"")):!a&&t.isDefined(i)&&(d.css(i,h(r)),d.css(n,""))},clientRect:function(e,t,n){var o=b(e);t=b(t||o.offsetParent||document.body);var i=o.getBoundingClientRect(),r=n?t.getBoundingClientRect():{left:0,top:0,width:0,height:0};return{left:i.left-r.left,top:i.top-r.top,width:i.width,height:i.height}},offsetRect:function(e,t){return M.clientRect(e,t,!0)},nodesToArray:function(e){e=e||[];for(var t=[],n=0;ns.clientHeight+1&&(d(s,{position:"fixed",width:"100%",top:-o+"px"}),e.style.overflowY="scroll"),s.clientWidth
'),e.appendChild(o[0])),o.on("wheel",n),o.on("touchmove",n),function(){o.off("wheel"),o.off("touchmove"),o[0].parentNode.removeChild(o[0]),delete M.disableScrollAround._enableScrolling}}(n);return M.disableScrollAround._enableScrolling=function(){--M.disableScrollAround._count||(l(),c(),delete M.disableScrollAround._enableScrolling)}},enableScrolling:function(){var e=this.disableScrollAround._enableScrolling;e&&e()},floatingScrollbars:function(){if(this.floatingScrollbars.cached===n){var e=t.element("
").css({width:"100%","z-index":-1,position:"absolute",height:"35px","overflow-y":"scroll"});e.children().css("height","60px"),o[0].body.appendChild(e[0]),this.floatingScrollbars.cached=e[0].offsetWidth==e[0].childNodes[0].offsetWidth,e.remove()}return this.floatingScrollbars.cached},forceFocus:function(t){var n=t[0]||t;document.addEventListener("click",function i(e){e.target===n&&e.$focus&&(n.focus(),e.stopImmediatePropagation(),e.preventDefault(),n.removeEventListener("click",i))},!0);var o=document.createEvent("MouseEvents");o.initMouseEvent("click",!1,!0,e,{},0,0,0,0,!1,!1,!1,!1,0,null),o.$material=!0,o.$focus=!0,n.dispatchEvent(o)},createBackdrop:function(e,t){return a(M.supplant('',[t]))(e)},supplant:function(e,t,n){return n=n||/\{([^\{\}]*)\}/g,e.replace(n,function(e,n){var o=n.split("."),i=t;try{for(var r in o)o.hasOwnProperty(r)&&(i=i[o[r]])}catch(a){i=e}return"string"==typeof i||"number"==typeof i?i:e})},fakeNgModel:function(){return{$fake:!0,$setTouched:t.noop,$setViewValue:function(e){this.$viewValue=e,this.$render(e),this.$viewChangeListeners.forEach(function(e){e()})},$isEmpty:function(e){return 0===(""+e).length},$parsers:[],$formatters:[],$viewChangeListeners:[],$render:t.noop}},debounce:function(e,t,o,i){var a;return function(){var d=o,s=Array.prototype.slice.call(arguments);r.cancel(a),a=r(function(){a=n,e.apply(d,s)},t||10,i)}},throttle:function(e,t){var n;return function(){var o=this,i=arguments,r=M.now();(!n||r-n>t)&&(e.apply(o,i),n=r)}},time:function(e){var t=M.now();return e(),M.now()-t},valueOnUse:function(e,t,n){var o=null,i=Array.prototype.slice.call(arguments),r=i.length>3?i.slice(3):[];Object.defineProperty(e,t,{get:function(){return null===o&&(o=n.apply(e,r)),o}})},nextUid:function(){return""+i++},disconnectScope:function(e){if(e&&e.$root!==e&&!e.$$destroyed){var t=e.$parent;e.$$disconnected=!0,t.$$childHead===e&&(t.$$childHead=e.$$nextSibling),t.$$childTail===e&&(t.$$childTail=e.$$prevSibling),e.$$prevSibling&&(e.$$prevSibling.$$nextSibling=e.$$nextSibling),e.$$nextSibling&&(e.$$nextSibling.$$prevSibling=e.$$prevSibling),e.$$nextSibling=e.$$prevSibling=null}},reconnectScope:function(e){if(e&&e.$root!==e&&e.$$disconnected){var t=e,n=t.$parent;t.$$disconnected=!1,t.$$prevSibling=n.$$childTail,n.$$childHead?(n.$$childTail.$$nextSibling=t,n.$$childTail=t):n.$$childHead=n.$$childTail=t}},getClosest:function(e,n,o){if(t.isString(n)){var i=n.toUpperCase();n=function(e){return e.nodeName===i}}if(e instanceof t.element&&(e=e[0]),o&&(e=e.parentNode),!e)return null;do{if(n(e))return e}while(e=e.parentNode);return null},elementContains:function(n,o){return(e.Node&&e.Node.prototype&&Node.prototype.contains?t.bind(n,n.contains):t.bind(n,function(e){return n===o||!!(16&this.compareDocumentPosition(e))}))(o)},extractElementByName:function(e,n,o,i){function r(e){return a(e)||(o?d(e):null)}function a(e){if(e)for(var t=0,o=e.length;t");o[0].body.appendChild(n[0]);for(var i=["sticky","-webkit-sticky"],r=0;rt)&&p(n)}function o(){return i(M.now()-s,r,a,1e3)}function i(e,t,n,o){if(e>o)return t+n;var i=(e/=o)*e;return t+n*(i*e*-2+3*i)}var r=e.scrollTop,a=t-r,d=r-1?a(e,t,function(){return l(e)}):r(e,t,n)}function s(e,t){var n=l(e);n.indexOf(i.startSymbol())>-1||n||r(e,t,n)}function l(e){e=e[0]||e;for(var n,o=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null,!1),i="";n=o.nextNode();)(function(t){for(;t.parentNode&&(t=t.parentNode)!==e;)if(t.getAttribute&&"true"===t.getAttribute("aria-hidden"))return!0})(n)||(i+=n.textContent);return i.trim()||""}function c(e,t){var i=e.hasChildNodes(),r=!1;if(i)for(var a=e.childNodes,d=0;d").html(o.trim()).contents(),s=i(d);return n={locals:e,element:d,link:function(o){if(e.$scope=o,l){var i=r(l,e,!0,c);h&&t.extend(i.instance,e);var a=i();d.data("$ngControllerController",a),d.children().data("$ngControllerController",a),n.controller=a}return s(o)}}})}}e.$inject=["$q","$templateRequest","$injector","$compile","$controller"],t.module("material.core").service("$mdCompiler",e)}(),function(){function n(){}function o(n,o,i){function r(e){return function(t,n){n.distancethis.options.maxDistance&&this.cancel()},onEnd:function(){this.onCancel()}}).handler("drag",{options:{minDistance:6,horizontal:!0,cancelMultiplier:1.5},onSetup:function(e,t){g&&(this.oldTouchAction=e[0].style[g],e[0].style[g]=!1===t.horizontal?"pan-y":"pan-x")},onCleanup:function(e){this.oldTouchAction&&(e[0].style[g]=this.oldTouchAction)},onStart:function(e){this.state.registeredParent||this.cancel()},onMove:function(e,t){var n,o;g||"touchmove"!==e.type||e.preventDefault(),this.state.dragPointer?this.dispatchDragMove(e):(this.state.options.horizontal?(n=Math.abs(t.distanceX)>this.state.options.minDistance,o=Math.abs(t.distanceY)>this.state.options.minDistance*this.state.options.cancelMultiplier):(n=Math.abs(t.distanceY)>this.state.options.minDistance,o=Math.abs(t.distanceX)>this.state.options.minDistance*this.state.options.cancelMultiplier),n?(this.state.dragPointer=d(e),c(e,this.state.dragPointer),this.dispatchEvent(e,"$md.dragstart",this.state.dragPointer)):o&&this.cancel())},dispatchDragMove:o.throttle(function(e){this.state.isRunning&&(c(e,this.state.dragPointer),this.dispatchEvent(e,"$md.drag",this.state.dragPointer))}),onEnd:function(e,t){this.state.dragPointer&&(c(e,this.state.dragPointer),this.dispatchEvent(e,"$md.dragend",this.state.dragPointer))}}).handler("swipe",{options:{minVelocity:.65,minDistance:10},onEnd:function(e,t){var n;Math.abs(t.velocityX)>this.state.options.minVelocity&&Math.abs(t.distanceX)>this.state.options.minDistance?(n="left"==t.directionX?"$md.swipeleft":"$md.swiperight",this.dispatchEvent(e,n)):Math.abs(t.velocityY)>this.state.options.minVelocity&&Math.abs(t.distanceY)>this.state.options.minDistance&&(n="up"==t.directionY?"$md.swipeup":"$md.swipedown",this.dispatchEvent(e,n))}})}function i(e){this.name=e,this.state={}}function r(){function n(e,n,o){o=o||u;var i=new t.element.Event(n);i.$material=!0,i.pointer=o,i.srcEvent=e,t.extend(i,{clientX:o.x,clientY:o.y,screenX:o.x,screenY:o.y,pageX:o.x,pageY:o.y,ctrlKey:e.ctrlKey,altKey:e.altKey,shiftKey:e.shiftKey,metaKey:e.metaKey}),t.element(o.target).trigger(i)}function o(t,n,o){o=o||u;var i;"click"===n||"mouseup"==n||"mousedown"==n?(i=document.createEvent("MouseEvents"),i.initMouseEvent(n,!0,!0,e,t.detail,o.x,o.y,o.x,o.y,t.ctrlKey,t.altKey,t.shiftKey,t.metaKey,t.button,t.relatedTarget||null)):(i=document.createEvent("CustomEvent"),i.initCustomEvent(n,!0,!0,{})),i.$material=!0,i.pointer=o,i.srcEvent=t,o.target.dispatchEvent(i)}var r=void 0!==e.jQuery&&t.element===e.jQuery;return i.prototype={options:{},dispatchEvent:r?n:o,onSetup:t.noop,onCleanup:t.noop,onStart:t.noop,onMove:t.noop,onEnd:t.noop,onCancel:t.noop,start:function(e,n){if(!this.state.isRunning){var o=this.getNearestParent(e.target),i=o&&o.$mdGesture[this.name]||{};this.state={isRunning:!0,options:t.extend({},this.options,i),registeredParent:o},this.onStart(e,n)}},move:function(e,t){this.state.isRunning&&this.onMove(e,t)},end:function(e,t){this.state.isRunning&&(this.onEnd(e,t),this.state.isRunning=!1)},cancel:function(e,t){this.onCancel(e,t),this.state={}},getNearestParent:function(e){for(var t=e;t;){if((t.$mdGesture||{})[this.name])return t;t=t.parentNode}return null},registerElement:function(e,t){function n(){delete e[0].$mdGesture[o.name],e.off("$destroy",n),o.onCleanup(e,t||{})}var o=this;return e[0].$mdGesture=e[0].$mdGesture||{},e[0].$mdGesture[this.name]=t||{},e.on("$destroy",n),o.onSetup(e,t||{}),n}},i}function a(e,n){function o(e){!e.clientX&&!e.clientY||e.$material||e.isIonicTap||l(e)||(e.preventDefault(),e.stopPropagation())}function i(e){0===e.clientX&&0===e.clientY||e.$material||e.isIonicTap||l(e)?(g=null,"label"==e.target.tagName.toLowerCase()&&(g={x:e.x,y:e.y})):(e.preventDefault(),e.stopPropagation(),g=null)}function r(e,t){var o;for(var i in h)(o=h[i])instanceof n&&("start"===e&&o.cancel(),o[e](t,u))}function a(e){if(!u){var t=+Date.now();p&&!s(e,p)&&t-p.endTime<1500||(u=d(e),r("start",e))}}function m(e){u&&s(e,u)&&(c(e,u),r("move",e))}function f(e){u&&s(e,u)&&(c(e,u),u.endTime=+Date.now(),r("end",e),p=u,u=null)}document.contains||(document.contains=function(e){return document.body.contains(e)}),!b&&e.isHijackingClicks&&(document.addEventListener("click",i,!0),document.addEventListener("mouseup",o,!0),document.addEventListener("mousedown",o,!0),document.addEventListener("focus",o,!0),b=!0);t.element(document).on("mousedown touchstart pointerdown",a).on("mousemove touchmove pointermove",m).on("mouseup mouseleave touchend touchcancel pointerup pointercancel",f).on("$$mdGestureReset",function(){p=u=null})}function d(e){var t=m(e),n={startTime:+Date.now(),target:e.target,type:e.type.charAt(0)};return n.startX=n.x=t.pageX,n.startY=n.y=t.pageY,n}function s(e,t){return e&&t&&e.type.charAt(0)===t.type}function l(e){return g&&g.x==e.x&&g.y==e.y}function c(e,t){var n=m(e),o=t.x=n.pageX,i=t.y=n.pageY;t.distanceX=o-t.startX,t.distanceY=i-t.startY,t.distance=Math.sqrt(t.distanceX*t.distanceX+t.distanceY*t.distanceY),t.directionX=t.distanceX>0?"right":t.distanceX<0?"left":"",t.directionY=t.distanceY>0?"down":t.distanceY<0?"up":"",t.duration=+Date.now()-t.startTime,t.velocityX=t.distanceX/t.duration,t.velocityY=t.distanceY/t.duration}function m(e){return e=e.originalEvent||e,e.touches&&e.touches[0]||e.changedTouches&&e.changedTouches[0]||e}o.$inject=["$$MdGestureHandler","$$rAF","$timeout"],a.$inject=["$mdGesture","$$MdGestureHandler"];var u,p,h={},f=!1,g=null,b=!1;t.module("material.core.gestures",[]).provider("$mdGesture",n).factory("$$MdGestureHandler",r).run(a),n.prototype={skipClickHijack:function(){return f=!0},$get:["$$MdGestureHandler","$$rAF","$timeout",function(e,t,n){return new o(e,t,n)}]}}(),function(){function e(){function e(e){function n(e){return s.optionsFactory=e.options,s.methods=(e.methods||[]).concat(a),l}function o(e,t){return d[e]=t,l}function i(t,n){if(n=n||{},n.methods=n.methods||[],n.options=n.options||function(){return{}},/^cancel|hide|show$/.test(t))throw new Error("Preset '"+t+"' in "+e+" is reserved!");if(n.methods.indexOf("_options")>-1)throw new Error("Method '_options' in "+e+" is reserved!");return s.presets[t]={methods:n.methods.concat(a),optionsFactory:n.options,argOption:n.argOption},l}function r(n,o){function i(e){return e=e||{},e._options&&(e=e._options),m.show(t.extend({},c,e))}function r(e){return m.destroy(e)}function a(t,n){var i={};return i[e]=u,o.invoke(t||function(){return n},{},i)}var l,c,m=n(),u={hide:m.hide,cancel:m.cancel,show:i,destroy:r};return l=s.methods||[],c=a(s.optionsFactory,{}),t.forEach(d,function(e,t){u[t]=e}),t.forEach(s.presets,function(e,n){function o(e){this._options=t.extend({},i,e)}var i=a(e.optionsFactory,{}),r=(e.methods||[]).concat(l);if(t.extend(i,{$type:n}),t.forEach(r,function(e){o.prototype[e]=function(t){return this._options[e]=t,this}}),e.argOption){var d="show"+n.charAt(0).toUpperCase()+n.slice(1);u[d]=function(e){var t=u[n](e);return u.show(t)}}u[n]=function(n){return arguments.length&&e.argOption&&!t.isObject(n)&&!t.isArray(n)?(new o)[e.argOption](n):new o(n)}}),u}r.$inject=["$$interimElement","$injector"];var a=["onHide","onShow","onRemove"],d={},s={presets:{}},l={setDefaults:n,addPreset:i,addMethod:o,$get:r};return l.addPreset("build",{methods:["controller","controllerAs","resolve","template","templateUrl","themable","transformTemplate","parent"]}),l}function o(e,o,i,r,a,d,s,l,c,m,u){return function(){function p(e){e=e||{};var t=new b(e||{});return(!e.skipHide&&$.length?v.cancel():o.when(!0)).finally(function(){$.push(t),t.show().catch(function(e){return e})}),t.deferred.promise}function h(e,t){function i(n){return n.remove(e,!1,t||{}).catch(function(e){return e}),n.deferred.promise}if(!$.length)return o.when(e);if(t=t||{},t.closeAll){var r=o.all($.reverse().map(i));return $=[],r}return t.closeTo!==n?o.all($.splice(t.closeTo).map(i)):i($.pop())}function f(e,n){var i=$.pop();return i?(i.remove(e,!0,n||{}).catch(function(e){return e}),i.deferred.promise.catch(t.noop)):o.when(e)}function g(e){var n=e?null:$.shift(),i=t.element(e).length?t.element(e)[0].parentNode:null;if(i){var r=$.filter(function(e){return e.options.element[0]===i});r.length>0&&(n=r[0],$.splice($.indexOf(n),1))}return n?n.remove(E,!1,{$destroy:!0}):o.when(E)}function b(u){function p(){return o(function(e,t){function n(e){y.deferred.reject(e),t(e)}u.onCompiling&&u.onCompiling(u),g(u).then(function(t){T=b(t,u),A=C(T,u,t.controller).then(e,n)},n)})}function h(e,n,i){function r(e){y.deferred.resolve(e)}function a(e){y.deferred.reject(e)}return T?(u=t.extend(u||{},i||{}),u.cancelAutoHide&&u.cancelAutoHide(),u.element.triggerHandler("$mdInterimElementRemove"),!0===u.$destroy?M(u.element,u).then(function(){n&&a(e)||r(e)}):(o.when(A).finally(function(){M(u.element,u).then(function(){n&&a(e)||r(e)},a)}),y.deferred.promise)):o.when(!1)}function g(e){return(e.skipCompile?null:c.compile(e))||o(function(t){t({locals:{},link:function(){return e.element}})})}function b(e,n){t.extend(e.locals,n);var o=e.link(n.scope);return n.element=o,n.parent=E(o,n),n.themable&&m(o),o}function E(n,o){var i=o.parent;if(i=t.isFunction(i)?i(o.scope,n,o):t.isString(i)?t.element(e[0].querySelector(i)):t.element(i),!(i||{}).length){var r;return d[0]&&d[0].querySelector&&(r=d[0].querySelector(":not(svg) > body")),r||(r=d[0]),"#comment"==r.nodeName&&(r=e[0].body),t.element(r)}return i}function $(){var e,o=t.noop;u.hideDelay&&(e=a(v.hide,u.hideDelay),o=function(){a.cancel(e)}),u.cancelAutoHide=function(){o(),u.cancelAutoHide=n}}function C(e,n,i){var r=n.onShowing||t.noop,a=n.onComplete||t.noop;return r(n.scope,e,n,i),o(function(t,r){try{o.when(n.onShow(n.scope,e,n,i)).then(function(){a(n.scope,e,n),$(),t(e)},r)}catch(d){r(d.message)}})}function M(e,n){var o=n.onRemoving||t.noop;return i(function(t,r){try{var a=i.when(n.onRemove(n.scope,e,n)||!0);o(e,a),1==n.$destroy?t(e):a.then(function(){!n.preserveScope&&n.scope&&n.scope.$destroy(),t(e)},r)}catch(d){r(d)}})}var y,T,A=o.when(!0);return u=function(e){return e=e||{},e.template&&(e.template=l.processTemplate(e.template)),t.extend({preserveScope:!1,cancelAutoHide:t.noop,scope:e.scope||r.$new(e.isolateScope),onShow:function(e,t,n){return s.enter(t,n.parent)},onRemove:function(e,t){return t&&s.leave(t)||o.when()}},e)}(u),y={options:u,deferred:o.defer(),show:p,remove:h}}var v,E=!1,$=[];return v={show:p,hide:h,cancel:f,destroy:g,$injector_:u}}}return o.$inject=["$document","$q","$$q","$rootScope","$timeout","$rootElement","$animate","$mdUtil","$mdCompiler","$mdTheming","$injector"],e.$get=o,e}t.module("material.core").provider("$$interimElement",e)}(),function(){!function(){function n(){var e=!!document.querySelector("[md-layouts-disabled]");A.enabled=!e}function o(){return A.enabled=!1,{restrict:"A",priority:"900"}}function i(e){return["$timeout",function(n){return{restrict:"A",priority:-10,compile:function(o){return A.enabled?(o.addClass(e),function(t,o){n(function(){o.removeClass(e)},10,!1)}):t.noop}}}]}function r(e){function n(t,n,o){var i=d(n,e),r=o.$observe(o.$normalize(e),i);i(p(e,o,"")),t.$on("$destroy",function(){r()})}return["$mdUtil","$interpolate","$log",function(o,i,r){return g=o,b=i,v=r,{restrict:"A",compile:function(o,i){var r;return A.enabled&&(l(e,i,o,v),c(e,p(e,i,""),m(o,e,i)),r=n),r||t.noop}}}]}function a(e){function n(t,n){n.addClass(e)}return["$mdUtil","$interpolate","$log",function(o,i,r){return g=o,b=i,v=r,{restrict:"A",compile:function(o,i){var r;return A.enabled&&(c(e,p(e,i,""),m(o,e,i)),n(null,o),r=n),r||t.noop}}}]}function d(e,n){var o;return function(i){var r=c(n,i||"");t.isDefined(r)&&(o&&e.removeClass(o),o=r?n+"-"+r.replace($,"-"):n,e.addClass(o))}}function s(e){var n=e.split("-");return["$log",function(o){return o.warn(e+"has been deprecated. Please use a `"+n[0]+"-gt-` variant."),t.noop}]}function l(e,t,n,o){var i,r,a,d=n[0].nodeName.toLowerCase();switch(e.replace(E,"")){case"flex":"md-button"!=d&&"fieldset"!=d||(r="<"+d+" "+e+">",a="https://github.com/philipwalton/flexbugs#9-some-html-elements-cant-be-flex-containers",i="Markup '{0}' may not work as expected in IE Browsers. Consult '{1}' for details.",o.warn(g.supplant(i,[r,a])))}}function c(e,n,o){var i=n;if(!u(n)){switch(e.replace(E,"")){case"layout":h(n,M)||(n=M[0]);break;case"flex":h(n,C)||isNaN(n)&&(n="");break;case"flex-offset":case"flex-order":n&&!isNaN(+n)||(n="0");break;case"layout-align":var r=f(n);n=g.supplant("{main}-{cross}",r);break;case"layout-padding":case"layout-margin":case"layout-fill":case"layout-wrap":case"layout-nowrap":case"layout-nowrap":n=""}n!=i&&(o||t.noop)(n)}return n}function m(e,t,n){return function(e){u(e)||(n[n.$normalize(t)]=e)}}function u(e){return(e||"").indexOf(b.startSymbol())>-1}function p(e,t,n){var o=t.$normalize(e);return t[o]?t[o].replace($,"-"):n||null}function h(e,t,n){e=n&&e?e.replace($,n):e;var o=!1;return e&&t.forEach(function(t){t=n?t.replace($,n):t,o=o||t===e}),o}function f(e){var t,n={main:"start",cross:"stretch"};return e=e||"",0!==e.indexOf("-")&&0!==e.indexOf(" ")||(e="none"+e),t=e.toLowerCase().trim().replace($,"-").split("-"),t.length&&"space"===t[0]&&(t=[t[0]+"-"+t[1],t[2]]),t.length>0&&(n.main=t[0]||n.main),t.length>1&&(n.cross=t[1]||n.cross),y.indexOf(n.main)<0&&(n.main="start"),T.indexOf(n.cross)<0&&(n.cross="stretch"),n}var g,b,v,E=/(-gt)?-(sm|md|lg|print)/g,$=/\s+/g,C=["grow","initial","auto","none","noshrink","nogrow"],M=["row","column"],y=["","start","center","end","stretch","space-around","space-between"],T=["","start","center","end","stretch"],A={enabled:!0,breakpoints:[]};!function(e){function d(e){return e.replace(m,"").replace(u,function(e,t,n,o){return o?n.toUpperCase():n})}var m=/^((?:x|data)[\:\-_])/i,u=/([\:\-\_]+(.))/g,p=["","xs","gt-xs","sm","gt-sm","md","gt-md","lg","gt-lg","xl","print"],h=["layout","flex","flex-order","flex-offset","layout-align"],f=["show","hide","layout-padding","layout-margin"];t.forEach(p,function(n){t.forEach(h,function(t){var o=n?t+"-"+n:t;e.directive(d(o),r(o))}),t.forEach(f,function(t){var o=n?t+"-"+n:t;e.directive(d(o),a(o))})}),e.provider("$$mdLayout",function(){return{$get:t.noop,validateAttributeValue:c,validateAttributeUsage:l,disableLayouts:function(e){A.enabled=!0!==e}}}).directive("mdLayoutCss",o).directive("ngCloak",i("ng-cloak")).directive("layoutWrap",a("layout-wrap")).directive("layoutNowrap",a("layout-nowrap")).directive("layoutNoWrap",a("layout-no-wrap")).directive("layoutFill",a("layout-fill")).directive("layoutLtMd",s("layout-lt-md")).directive("layoutLtLg",s("layout-lt-lg")).directive("flexLtMd",s("flex-lt-md")).directive("flexLtLg",s("flex-lt-lg")).directive("layoutAlignLtMd",s("layout-align-lt-md")).directive("layoutAlignLtLg",s("layout-align-lt-lg")).directive("flexOrderLtMd",s("flex-order-lt-md")).directive("flexOrderLtLg",s("flex-order-lt-lg")).directive("offsetLtMd",s("flex-offset-lt-md")).directive("offsetLtLg",s("flex-offset-lt-lg")).directive("hideLtMd",s("hide-lt-md")).directive("hideLtLg",s("hide-lt-lg")).directive("showLtMd",s("show-lt-md")).directive("showLtLg",s("show-lt-lg")).config(n)}(t.module("material.core.layout",["ng"]))}()}(),function(){t.module("material.core.meta",[]).provider("$$mdMeta",function(){function e(e){if(r[e])return!0;var n=document.getElementsByName(e)[0];return!!n&&(r[e]=t.element(n),!0)}function n(n,o){if(e(n),r[n])r[n].attr("content",o);else{var a=t.element('');i.append(a),r[n]=a}return function(){r[n].attr("content",""),r[n].remove(),delete r[n]}}function o(t){if(!e(t))throw Error("$$mdMeta: could not find a meta tag with the name '"+t+"'");return r[t].attr("content")}var i=t.element(document.head),r={},a={setMeta:n,getMeta:o};return t.extend({},a,{$get:function(){return a}})})}(),function(){function e(e,o){function i(e){return e&&""!==e}var r,a=[],d={};return r={notFoundError:function(t,n){e.error((n||"")+"No instance found for handle",t)},getInstances:function(){return a},get:function(e){if(!i(e))return null;var t,n,o;for(t=0,n=a.length;t');return this.$element.append(e),e},o.prototype.clearTimeout=function(){this.timeout&&(this.$timeout.cancel(this.timeout),this.timeout=null)},o.prototype.isRippleAllowed=function(){var e=this.$element[0];do{if(!e.tagName||"BODY"===e.tagName)break;if(e&&t.isFunction(e.hasAttribute)){if(e.hasAttribute("disabled"))return!1;if("false"===this.inkRipple()||"0"===this.inkRipple())return!1}}while(e=e.parentNode);return!0},o.prototype.inkRipple=function(){return this.$element.attr("md-ink-ripple")},o.prototype.createRipple=function(e,n){ if(this.isRippleAllowed()){var i=this,r=i.$mdColorUtil,d=t.element('
'),s=this.$element.prop("clientWidth"),l=this.$element.prop("clientHeight"),c=2*Math.max(Math.abs(s-e),e),m=2*Math.max(Math.abs(l-n),n),u=function(e,t,n){return e?Math.max(t,n):Math.sqrt(Math.pow(t,2)+Math.pow(n,2))}(this.options.fitRipple,c,m),p=this.calculateColor();d.css({left:e+"px",top:n+"px",background:"black",width:u+"px",height:u+"px",backgroundColor:r.rgbaToRgb(p),borderColor:r.rgbaToRgb(p)}),this.lastRipple=d,this.clearTimeout(),this.timeout=this.$timeout(function(){i.clearTimeout(),i.mousedown||i.fadeInComplete(d)},157.5,!1),this.options.dimBackground&&this.container.css({backgroundColor:p}),this.container.append(d),this.ripples.push(d),d.addClass("md-ripple-placed"),this.$mdUtil.nextTick(function(){d.addClass("md-ripple-scaled md-ripple-active"),i.$timeout(function(){i.clearRipples()},450,!1)},!1)}},o.prototype.fadeInComplete=function(e){this.lastRipple===e?this.timeout||this.mousedown||this.removeRipple(e):this.removeRipple(e)},o.prototype.removeRipple=function(e){var t=this;this.ripples.indexOf(e)<0||(this.ripples.splice(this.ripples.indexOf(e),1),e.removeClass("md-ripple-active"),e.addClass("md-ripple-remove"),0===this.ripples.length&&this.container.css({backgroundColor:""}),this.$timeout(function(){t.fadeOutComplete(e)},450,!1))},o.prototype.fadeOutComplete=function(e){e.remove(),this.lastRipple=null}}(),function(){!function(){function e(e){function n(n,o,i){return e.attach(n,o,t.extend({center:!1,dimBackground:!0,outline:!1,rippleSize:"full"},i))}return{attach:n}}e.$inject=["$mdInkRipple"],t.module("material.core").factory("$mdTabInkRipple",e)}()}(),function(){t.module("material.core.theming.palette",[]).constant("$mdColorPalette",{red:{50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000",contrastDefaultColor:"light",contrastDarkColors:"50 100 200 300 A100",contrastStrongLightColors:"400 500 600 700 A200 A400 A700"},pink:{50:"#fce4ec",100:"#f8bbd0",200:"#f48fb1",300:"#f06292",400:"#ec407a",500:"#e91e63",600:"#d81b60",700:"#c2185b",800:"#ad1457",900:"#880e4f",A100:"#ff80ab",A200:"#ff4081",A400:"#f50057",A700:"#c51162",contrastDefaultColor:"light",contrastDarkColors:"50 100 200 A100",contrastStrongLightColors:"500 600 A200 A400 A700"},purple:{50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff",contrastDefaultColor:"light",contrastDarkColors:"50 100 200 A100",contrastStrongLightColors:"300 400 A200 A400 A700"},"deep-purple":{50:"#ede7f6",100:"#d1c4e9",200:"#b39ddb",300:"#9575cd",400:"#7e57c2",500:"#673ab7",600:"#5e35b1",700:"#512da8",800:"#4527a0",900:"#311b92",A100:"#b388ff",A200:"#7c4dff",A400:"#651fff",A700:"#6200ea",contrastDefaultColor:"light",contrastDarkColors:"50 100 200 A100",contrastStrongLightColors:"300 400 A200"},indigo:{50:"#e8eaf6",100:"#c5cae9",200:"#9fa8da",300:"#7986cb",400:"#5c6bc0",500:"#3f51b5",600:"#3949ab",700:"#303f9f",800:"#283593",900:"#1a237e",A100:"#8c9eff",A200:"#536dfe",A400:"#3d5afe",A700:"#304ffe",contrastDefaultColor:"light",contrastDarkColors:"50 100 200 A100",contrastStrongLightColors:"300 400 A200 A400"},blue:{50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff",contrastDefaultColor:"light",contrastDarkColors:"50 100 200 300 400 A100",contrastStrongLightColors:"500 600 700 A200 A400 A700"},"light-blue":{50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea",contrastDefaultColor:"dark",contrastLightColors:"600 700 800 900 A700",contrastStrongLightColors:"600 700 800 A700"},cyan:{50:"#e0f7fa",100:"#b2ebf2",200:"#80deea",300:"#4dd0e1",400:"#26c6da",500:"#00bcd4",600:"#00acc1",700:"#0097a7",800:"#00838f",900:"#006064",A100:"#84ffff",A200:"#18ffff",A400:"#00e5ff",A700:"#00b8d4",contrastDefaultColor:"dark",contrastLightColors:"700 800 900",contrastStrongLightColors:"700 800 900"},teal:{50:"#e0f2f1",100:"#b2dfdb",200:"#80cbc4",300:"#4db6ac",400:"#26a69a",500:"#009688",600:"#00897b",700:"#00796b",800:"#00695c",900:"#004d40",A100:"#a7ffeb",A200:"#64ffda",A400:"#1de9b6",A700:"#00bfa5",contrastDefaultColor:"dark",contrastLightColors:"500 600 700 800 900",contrastStrongLightColors:"500 600 700"},green:{50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853",contrastDefaultColor:"dark",contrastLightColors:"500 600 700 800 900",contrastStrongLightColors:"500 600 700"},"light-green":{50:"#f1f8e9",100:"#dcedc8",200:"#c5e1a5",300:"#aed581",400:"#9ccc65",500:"#8bc34a",600:"#7cb342",700:"#689f38",800:"#558b2f",900:"#33691e",A100:"#ccff90",A200:"#b2ff59",A400:"#76ff03",A700:"#64dd17",contrastDefaultColor:"dark",contrastLightColors:"700 800 900",contrastStrongLightColors:"700 800 900"},lime:{50:"#f9fbe7",100:"#f0f4c3",200:"#e6ee9c",300:"#dce775",400:"#d4e157",500:"#cddc39",600:"#c0ca33",700:"#afb42b",800:"#9e9d24",900:"#827717",A100:"#f4ff81",A200:"#eeff41",A400:"#c6ff00",A700:"#aeea00",contrastDefaultColor:"dark",contrastLightColors:"900",contrastStrongLightColors:"900"},yellow:{50:"#fffde7",100:"#fff9c4",200:"#fff59d",300:"#fff176",400:"#ffee58",500:"#ffeb3b",600:"#fdd835",700:"#fbc02d",800:"#f9a825",900:"#f57f17",A100:"#ffff8d",A200:"#ffff00",A400:"#ffea00",A700:"#ffd600",contrastDefaultColor:"dark"},amber:{50:"#fff8e1",100:"#ffecb3",200:"#ffe082",300:"#ffd54f",400:"#ffca28",500:"#ffc107",600:"#ffb300",700:"#ffa000",800:"#ff8f00",900:"#ff6f00",A100:"#ffe57f",A200:"#ffd740",A400:"#ffc400",A700:"#ffab00",contrastDefaultColor:"dark"},orange:{50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00",contrastDefaultColor:"dark",contrastLightColors:"800 900",contrastStrongLightColors:"800 900"},"deep-orange":{50:"#fbe9e7",100:"#ffccbc",200:"#ffab91",300:"#ff8a65",400:"#ff7043",500:"#ff5722",600:"#f4511e",700:"#e64a19",800:"#d84315",900:"#bf360c",A100:"#ff9e80",A200:"#ff6e40",A400:"#ff3d00",A700:"#dd2c00",contrastDefaultColor:"light",contrastDarkColors:"50 100 200 300 400 A100 A200",contrastStrongLightColors:"500 600 700 800 900 A400 A700"},brown:{50:"#efebe9",100:"#d7ccc8",200:"#bcaaa4",300:"#a1887f",400:"#8d6e63",500:"#795548",600:"#6d4c41",700:"#5d4037",800:"#4e342e",900:"#3e2723",A100:"#d7ccc8",A200:"#bcaaa4",A400:"#8d6e63",A700:"#5d4037",contrastDefaultColor:"light",contrastDarkColors:"50 100 200 A100 A200",contrastStrongLightColors:"300 400"},grey:{50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#ffffff",A200:"#000000",A400:"#303030",A700:"#616161",contrastDefaultColor:"dark",contrastLightColors:"600 700 800 900 A200 A400 A700"},"blue-grey":{50:"#eceff1",100:"#cfd8dc",200:"#b0bec5",300:"#90a4ae",400:"#78909c",500:"#607d8b",600:"#546e7a",700:"#455a64",800:"#37474f",900:"#263238",A100:"#cfd8dc",A200:"#b0bec5",A400:"#78909c",A700:"#455a64",contrastDefaultColor:"light",contrastDarkColors:"50 100 200 300 A100 A200",contrastStrongLightColors:"400 500 700"}})}(),function(){!function(e){function t(e){var t=!!document.querySelector("[md-themes-disabled]");e.disableTheming(t)}function o(t,o){function i(e,t){return t=t||{},p[e]=a(e,t),h}function r(t,n){return a(t,e.extend({},p[t]||{},n))}function a(e,t){var n=w.filter(function(e){return!t[e]});if(n.length)throw new Error("Missing colors %1 in palette %2!".replace("%1",n.join(", ")).replace("%2",e));return t}function s(t,n){if(E[t])return E[t];n=n||"default";var o="string"==typeof n?E[n]:n,i=new c(t);return o&&e.forEach(o.colors,function(t,n){i.colors[n]={name:t.name,hues:e.extend({},t.hues)}}),E[t]=i,i}function c(t){function n(t){if((t=0===arguments.length||!!t)!==o.isDark){o.isDark=t,o.foregroundPalette=o.isDark?g:f,o.foregroundShadow=o.isDark?b:v;var n=o.isDark?A:T,i=o.isDark?T:A;return e.forEach(n,function(e,t){var n=o.colors[t],r=i[t];if(n)for(var a in n.hues)n.hues[a]===r[a]&&(n.hues[a]=e[a])}),o}}var o=this;o.name=t,o.colors={},o.dark=n,n(!1),M.forEach(function(t){var n=(o.isDark?A:T)[t];o[t+"Palette"]=function(i,r){var a=o.colors[t]={name:i,hues:e.extend({},n,r)};return Object.keys(a.hues).forEach(function(e){if(!n[e])throw new Error("Invalid hue name '%1' in theme %2's %3 color %4. Available hue names: %4".replace("%1",e).replace("%2",o.name).replace("%3",i).replace("%4",Object.keys(n).join(", ")))}),Object.keys(a.hues).map(function(e){return a.hues[e]}).forEach(function(e){if(-1==w.indexOf(e))throw new Error("Invalid hue value '%1' in theme %2's %3 color %4. Available hue values: %5".replace("%1",e).replace("%2",o.name).replace("%3",t).replace("%4",i).replace("%5",w.join(", ")))}),o},o[t+"Color"]=function(){var e=Array.prototype.slice.call(arguments);return console.warn("$mdThemingProviderTheme."+t+"Color() has been deprecated. Use $mdThemingProviderTheme."+t+"Palette() instead."),o[t+"Palette"].apply(o,e)}})}function m(t,o){function i(e){return e===n||""===e||a.THEMES[e]!==n}function r(n,r){function a(){return(l=r.controller("mdTheme")||n.data("$mdThemeController"))&&l.$mdTheme||("default"==C?"":C)}function d(e){if(e){i(e)||o.warn("Attempted to use unregistered theme '"+e+"'. Register it with $mdThemingProvider.theme().");var t=n.data("$mdThemeName");t&&n.removeClass("md-"+t+"-theme"),n.addClass("md-"+e+"-theme"),n.data("$mdThemeName",e),l&&n.data("$mdThemeController",l)}}var l=r.controller("mdTheme"),c=n.attr("md-theme-watch"),m=($||e.isDefined(c))&&"false"!=c;d(a()),($&&!function(){var e=r.controller("mdTheme");return!!e&&(n.on("$destroy",e.registerChanges(function(){d(a())})),!0)}()||!$&&m)&&n.on("$destroy",t.$watch(a,d))}var a=function(e,o){o===n&&(o=e,e=n),e===n&&(e=t),a.inherit(o,o)};return a.THEMES=e.extend({},E),a.PALETTES=e.extend({},p),a.inherit=r,a.registered=i,a.defaultTheme=function(){return C},a.generateTheme=function(e){l(E[e],e,k.nonce)},a.setBrowserColor=x,a}m.$inject=["$rootScope","$log"],p={};var h,E={},$=!1,C="default";e.extend(p,t);var y=function(e){var t=o.setMeta("theme-color",e),n=o.setMeta("msapplication-navbutton-color",e);return function(){t(),n()}},x=function(t){t=e.isObject(t)?t:{};var n=t.theme||"default",o=t.hue||"800",i=p[t.palette]||p[E[n].colors[t.palette||"primary"].name],r=e.isObject(i[o])?i[o].hex:i[o];return y(r)};return h={definePalette:i,extendPalette:r,theme:s,configuration:function(){return e.extend({},k,{defaultTheme:C,alwaysWatchTheme:$,registeredStyles:[].concat(k.registeredStyles)})},disableTheming:function(t){k.disableTheming=e.isUndefined(t)||!!t},registerStyles:function(e){k.registeredStyles.push(e)},setNonce:function(e){k.nonce=e},generateThemesOnDemand:function(e){k.generateOnDemand=e},setDefaultTheme:function(e){C=e},alwaysWatchTheme:function(e){$=e},enableBrowserColor:x,$get:m,_LIGHT_DEFAULT_HUES:T,_DARK_DEFAULT_HUES:A,_PALETTES:p,_THEMES:E,_parseRules:d,_rgba:u}}function i(t,n,o){return{priority:100,link:{pre:function(i,r,a){var d=[],s={registerChanges:function(t,n){return n&&(t=e.bind(n,t)),d.push(t),function(){var e=d.indexOf(t);e>-1&&d.splice(e,1)}},$setTheme:function(e){t.registered(e)||o.warn("attempted to use unregistered theme '"+e+"'"),s.$mdTheme=e,d.forEach(function(e){e()})}};r.data("$mdThemeController",s),s.$setTheme(n(a.mdTheme)(i)),a.$observe("mdTheme",s.$setTheme)}}}}function r(){return k.disableTheming=!0,{restrict:"A",priority:"900"}}function a(e){return e}function d(t,n,o){c(t,n),o=o.replace(/THEME_NAME/g,t.name);var i=[],r=t.colors[n],a=new RegExp("\\.md-"+t.name+"-theme","g"),d=new RegExp("('|\")?{{\\s*("+n+")-(color|contrast)-?(\\d\\.?\\d*)?\\s*}}(\"|')?","g"),s=/'?"?\{\{\s*([a-zA-Z]+)-(A?\d+|hue\-[0-3]|shadow|default)-?(\d\.?\d*)?(contrast)?\s*\}\}'?"?/g,l=p[r.name];return o=o.replace(s,function(e,n,o,i,r){return"foreground"===n?"shadow"==o?t.foregroundShadow:t.foregroundPalette[o]||t.foregroundPalette[1]:(0!==o.indexOf("hue")&&"default"!==o||(o=t.colors[n].hues[o]),u((p[t.colors[n].name][o]||"")[r?"contrast":"value"],i))}),e.forEach(r.hues,function(e,n){var r=o.replace(d,function(t,n,o,i,r){return u(l[e]["color"===i?"value":"contrast"],r)});if("default"!==n&&(r=r.replace(a,".md-"+t.name+"-theme.md-"+n)),"default"==t.name){var s=/((?:(?:(?: |>|\.|\w|-|:|\(|\)|\[|\]|"|'|=)+) )?)((?:(?:\w|\.|-)+)?)\.md-default-theme((?: |>|\.|\w|-|:|\(|\)|\[|\]|"|'|=)*)/g;r=r.replace(s,function(e,t,n,o){return e+", "+t+n+o})}i.push(r)}),i}function s(t,n){function o(t,n){var o=t.contrastDefaultColor,i=t.contrastLightColors||[],r=t.contrastStrongLightColors||[],a=t.contrastDarkColors||[];"string"==typeof i&&(i=i.split(" ")),"string"==typeof r&&(r=r.split(" ")),"string"==typeof a&&(a=a.split(" ")),delete t.contrastDefaultColor,delete t.contrastLightColors,delete t.contrastStrongLightColors,delete t.contrastDarkColors,e.forEach(t,function(n,d){if(!e.isObject(n)){var l=m(n);if(!l)throw new Error("Color %1, in palette %2's hue %3, is invalid. Hex or rgb(a) color expected.".replace("%1",n).replace("%2",t.name).replace("%3",d));t[d]={hex:t[d],value:l,contrast:function(){return"light"===o?a.indexOf(d)>-1?E:r.indexOf(d)>-1?C:$:i.indexOf(d)>-1?r.indexOf(d)>-1?C:$:E}()}}})}var i=document.head,r=i?i.firstElementChild:null,a=!k.disableTheming&&t.has("$MD_THEME_CSS")?t.get("$MD_THEME_CSS"):"";if(a+=k.registeredStyles.join(""),r&&0!==a.length){e.forEach(p,o);var d=a.split(/\}(?!(\}|'|"|;))/).filter(function(e){return e&&e.trim().length}).map(function(e){return e.trim()+"}"}),s=new RegExp("md-("+M.join("|")+")","g");M.forEach(function(e){x[e]=""}),d.forEach(function(e){for(var t,n=(e.match(s),0);t=M[n];n++)if(e.indexOf(".md-"+t)>-1)return x[t]+=e;for(n=0;t=M[n];n++)if(e.indexOf(t)>-1)return x[t]+=e;return x[y]+=e}),k.generateOnDemand||e.forEach(n.THEMES,function(e){h[e.name]||"default"!==n.defaultTheme()&&"default"===e.name||l(e,e.name,k.nonce)})}}function l(e,t,n){var o=document.head,i=o?o.firstElementChild:null;h[t]||(M.forEach(function(t){for(var r=d(e,t,x[t]);r.length;){var a=r.shift();if(a){var s=document.createElement("style");s.setAttribute("md-theme-style",""),n&&s.setAttribute("nonce",n),s.appendChild(document.createTextNode(a)),o.insertBefore(s,i)}}}),h[e.name]=!0)}function c(e,t){if(!p[(e.colors[t]||{}).name])throw new Error("You supplied an invalid color palette for theme %1's %2 palette. Available palettes: %3".replace("%1",e.name).replace("%2",t).replace("%3",Object.keys(p).join(", ")))}function m(t){if(e.isArray(t)&&3==t.length)return t;if(/^rgb/.test(t))return t.replace(/(^\s*rgba?\(|\)\s*$)/g,"").split(",").map(function(e,t){return 3==t?parseFloat(e,10):parseInt(e,10)});if("#"==t.charAt(0)&&(t=t.substring(1)),/^([a-fA-F0-9]{3}){1,2}$/g.test(t)){var n=t.length/3,o=t.substr(0,n),i=t.substr(n,n),r=t.substr(2*n);return 1===n&&(o+=o,i+=i,r+=r),[parseInt(o,16),parseInt(i,16),parseInt(r,16)]}}function u(t,n){return t?(4==t.length&&(t=e.copy(t),n?t.pop():n=t.pop()),n&&("number"==typeof n||"string"==typeof n&&n.length)?"rgba("+t.join(",")+","+n+")":"rgb("+t.join(",")+")"):"rgb('0,0,0')"}t.$inject=["$mdThemingProvider"],i.$inject=["$mdTheming","$interpolate","$log"],a.$inject=["$mdTheming"],o.$inject=["$mdColorPalette","$$mdMetaProvider"],s.$inject=["$injector","$mdTheming"],e.module("material.core.theming",["material.core.theming.palette","material.core.meta"]).directive("mdTheme",i).directive("mdThemable",a).directive("mdThemesDisabled",r).provider("$mdTheming",o).config(t).run(s);var p,h={},f={name:"dark",1:"rgba(0,0,0,0.87)",2:"rgba(0,0,0,0.54)",3:"rgba(0,0,0,0.38)",4:"rgba(0,0,0,0.12)"},g={name:"light",1:"rgba(255,255,255,1.0)",2:"rgba(255,255,255,0.7)",3:"rgba(255,255,255,0.5)",4:"rgba(255,255,255,0.12)"},b="1px 1px 0px rgba(0,0,0,0.4), -1px -1px 0px rgba(0,0,0,0.4)",v="",E=m("rgba(0,0,0,0.87)"),$=m("rgba(255,255,255,0.87)"),C=m("rgb(255,255,255)"),M=["primary","accent","warn","background"],y="primary",T={accent:{default:"A200","hue-1":"A100","hue-2":"A400","hue-3":"A700"},background:{default:"50","hue-1":"A100","hue-2":"100","hue-3":"300"}},A={background:{default:"A400","hue-1":"800","hue-2":"900","hue-3":"A200"}};M.forEach(function(e){var t={default:"500","hue-1":"300","hue-2":"800","hue-3":"A100"};T[e]||(T[e]=t),A[e]||(A[e]=t)});var w=["50","100","200","300","400","500","600","700","800","900","A100","A200","A400","A700"],k={disableTheming:!1,generateOnDemand:!1,registeredStyles:[],nonce:null},x={}}(e.angular)}(),function(){function n(n,o,i,r,a){var d;return d={translate3d:function(e,t,n,o){function i(n){return a(e,{to:n||t,addClass:o.transitionOutClass,removeClass:o.transitionInClass}).start()}return a(e,{from:t,to:n,addClass:o.transitionInClass,removeClass:o.transitionOutClass}).start().then(function(){return i})},waitTransitionEnd:function(t,n){var a=3e3;return o(function(o,d){function s(e){e&&e.target!==t[0]||(e&&i.cancel(c),t.off(r.CSS.TRANSITIONEND,s),o())}n=n||{},function(n){return n=n||e.getComputedStyle(t[0]),"0s"==n.transitionDuration||!n.transition&&!n.transitionProperty}(n.cachedTransitionStyles)&&(a=0);var c=i(s,n.timeout||a);t.on(r.CSS.TRANSITIONEND,s)})},calculateTransformValues:function(e,t){var o=t.element,i=t.bounds;if(o||i){var r=o?d.clientRect(o)||function(){var t=e?e.parent():null,n=t?t.parent():null;return n?d.clientRect(n):null}():d.copyRect(i),a=d.copyRect(e[0].getBoundingClientRect()),s=d.centerPointFor(a),l=d.centerPointFor(r);return{centerX:l.x-s.x,centerY:l.y-s.y,scaleX:Math.round(100*Math.min(.5,r.width/a.width))/100,scaleY:Math.round(100*Math.min(.5,r.height/a.height))/100}}return{centerX:0,centerY:0,scaleX:.5,scaleY:.5}},calculateZoomToOrigin:function(e,o){return t.bind(null,n.supplant,"translate3d( {centerX}px, {centerY}px, 0 ) scale( {scaleX}, {scaleY} )")(d.calculateTransformValues(e,o))},calculateSlideToOrigin:function(e,o){return t.bind(null,n.supplant,"translate3d( {centerX}px, {centerY}px, 0 )")(d.calculateTransformValues(e,o))},toCss:function(e){function n(e,n,i){t.forEach(n.split(" "),function(e){o[e]=i})}var o={};return t.forEach(e,function(e,a){if(!t.isUndefined(e))if("left top right bottom width height x y min-width min-height max-width max-height".indexOf(a)>=0)o[a]=e+"px";else switch(a){case"transition":n(a,r.CSS.TRANSITION,e);break;case"transform":n(a,r.CSS.TRANSFORM,e);break;case"transformOrigin":n(a,r.CSS.TRANSFORM_ORIGIN,e);break;case"font-size":o["font-size"]=e}}),o},toTransformCss:function(e,n,o){var i={};return t.forEach(r.CSS.TRANSFORM.split(" "),function(t){i[t]=e}),n&&(o=o||"all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) !important",i.transition=o),i},copyRect:function(e,n){return e?(n=n||{},t.forEach("left top right bottom width height".split(" "),function(t){n[t]=Math.round(e[t])}),n.width=n.width||n.right-n.left,n.height=n.height||n.bottom-n.top,n):null},clientRect:function(e){var n=t.element(e)[0].getBoundingClientRect();return function(e){return e&&e.width>0&&e.height>0}(n)?d.copyRect(n):null},centerPointFor:function(e){return e?{x:Math.round(e.left+e.width/2),y:Math.round(e.top+e.height/2)}:{x:0,y:0}}}}t.module("material.core").factory("$$mdAnimate",["$q","$timeout","$mdConstant","$animateCss",function(e,t,o,i){return function(r){return n(r,e,t,o,i)}}])}(),function(){t.version.minor>=4?t.module("material.core.animate",[]):function(){function e(e){return e.replace(/-[a-z]/g,function(e){return e.charAt(1).toUpperCase()})}var n=t.forEach,o=t.isDefined(document.documentElement.style.WebkitAppearance),i=o?"-webkit-":"",r=(o?"webkitTransitionEnd ":"")+"transitionend",a=(o?"webkitAnimationEnd ":"")+"animationend",d=["$document",function(e){return function(){return e[0].body.clientWidth+1}}],s=["$$rAF",function(e){return function(){var t=!1;return e(function(){t=!0}),function(n){t?n():e(n)}}}],l=["$q","$$rAFMutex",function(e,o){function i(e){this.setHost(e),this._doneCallbacks=[],this._runInAnimationFrame=o(),this._state=0}return i.prototype={setHost:function(e){this.host=e||{}},done:function(e){2===this._state?e():this._doneCallbacks.push(e)},progress:t.noop,getPromise:function(){if(!this.promise){var t=this;this.promise=e(function(e,n){t.done(function(t){!1===t?n():e()})})}return this.promise},then:function(e,t){return this.getPromise().then(e,t)},catch:function(e){return this.getPromise().catch(e)},finally:function(e){return this.getPromise().finally(e)},pause:function(){this.host.pause&&this.host.pause()},resume:function(){this.host.resume&&this.host.resume()},end:function(){this.host.end&&this.host.end(),this._resolve(!0)},cancel:function(){this.host.cancel&&this.host.cancel(),this._resolve(!1)},complete:function(e){var t=this;0===t._state&&(t._state=1,t._runInAnimationFrame(function(){t._resolve(e)}))},_resolve:function(e){2!==this._state&&(n(this._doneCallbacks,function(t){t(e)}),this._doneCallbacks.length=0,this._state=2)}},i.all=function(e,t){function o(n){r=r&&n,++i===e.length&&t(r)}var i=0,r=!0;n(e,function(e){e.done(o)})},i}];t.module("material.core.animate",[]).factory("$$forceReflow",d).factory("$$AnimateRunner",l).factory("$$rAFMutex",s).factory("$animateCss",["$window","$$rAF","$$AnimateRunner","$$forceReflow","$$jqLite","$timeout","$animate",function(t,d,s,l,c,m,u){function p(o,d){var l=[],c=C(o),p=c&&u.enabled(),g=!1,y=!1;p&&(d.transitionStyle&&l.push([i+"transition",d.transitionStyle]),d.keyframeStyle&&l.push([i+"animation",d.keyframeStyle]),d.delay&&l.push([i+"transition-delay",d.delay+"s"]),d.duration&&l.push([i+"transition-duration",d.duration+"s"]),g=d.keyframeStyle||d.to&&(d.duration>0||d.transitionStyle),y=!!d.addClass||!!d.removeClass,M(o,!0));var T=p&&(g||y);E(o,d);var A,w,k=!1;return{close:t.close,start:function(){function t(){if(!k)return k=!0,A&&w&&o.off(A,w),h(o,d),v(o,d),n(l,function(t){c.style[e(t[0])]=""}),u.complete(!0),u}var u=new s;return b(function(){if(M(o,!1),!T)return t();n(l,function(t){var n=t[0],o=t[1];c.style[e(n)]=o}),h(o,d);var s=f(o);if(0===s.duration)return t();var u=[];d.easing&&(s.transitionDuration&&u.push([i+"transition-timing-function",d.easing]),s.animationDuration&&u.push([i+"animation-timing-function",d.easing])),d.delay&&s.animationDelay&&u.push([i+"animation-delay",d.delay+"s"]),d.duration&&s.animationDuration&&u.push([i+"animation-duration",d.duration+"s"]),n(u,function(t){var n=t[0],o=t[1];c.style[e(n)]=o,l.push(t)});var p=s.delay,g=1e3*p,b=s.duration,v=1e3*b,E=Date.now();A=[],s.transitionDuration&&A.push(r),s.animationDuration&&A.push(a),A=A.join(" "),w=function(e){e.stopPropagation();var n=e.originalEvent||e,o=n.timeStamp||Date.now(),i=parseFloat(n.elapsedTime.toFixed(3));Math.max(o-E,0)>=g&&i>=b&&t()},o.on(A,w),$(o,d),m(t,g+1.5*v,!1)}),u}}}function h(e,t){t.addClass&&(c.addClass(e,t.addClass),t.addClass=null),t.removeClass&&(c.removeClass(e,t.removeClass),t.removeClass=null)}function f(e){function n(e){return o?"Webkit"+e.charAt(0).toUpperCase()+e.substr(1):e}var i=C(e),r=t.getComputedStyle(i),a=g(r[n("transitionDuration")]),d=g(r[n("animationDuration")]),s=g(r[n("transitionDelay")]),l=g(r[n("animationDelay")]);return d*=parseInt(r[n("animationIterationCount")],10)||1,{duration:Math.max(d,a),delay:Math.max(l,s),animationDuration:d,transitionDuration:a,animationDelay:l,transitionDelay:s}}function g(e){var t=0,o=(e||"").split(/\s*,\s*/);return n(o,function(e){"s"==e.charAt(e.length-1)&&(e=e.substring(0,e.length-1)),e=parseFloat(e)||0,t=t?Math.max(e,t):e}),t}function b(e){y&&y(),T.push(e),y=d(function(){y=null;for(var e=l(),t=0;t` will affect the bottom-sheet opening animations.",i[0])}l.disableBackdrop||(h=r.createBackdrop(o,"md-bottom-sheet-backdrop md-opaque"),h[0].tabIndex=-1,l.clickOutsideToClose&&h.on("click",function(){r.nextTick(d.cancel,!0)}),a.inherit(h,l.parent),e.enter(h,l.parent,null));var f=new p(i,l.parent);return l.bottomSheet=f,a.inherit(f.element,l.parent),l.disableParentScroll&&(l.restoreScroll=r.disableScrollAround(f.element,l.parent)),e.enter(f.element,l.parent,h).then(function(){var e=r.findFocusTarget(i)||t.element(i[0].querySelector("button")||i[0].querySelector("a")||i[0].querySelector(r.prefixer("ng-click",!0)))||h;l.escapeToClose&&(l.rootElementKeyupCallback=function(e){e.keyCode===n.KEY_CODE.ESCAPE&&r.nextTick(d.cancel,!0)},s.on("keyup",l.rootElementKeyupCallback),e&&e.focus())})}function u(t,n,o){var i=o.bottomSheet;return o.disableBackdrop||e.leave(h),e.leave(i.element).then(function(){o.disableParentScroll&&(o.restoreScroll(),delete o.restoreScroll),i.cleanup()})}function p(e,t){function a(t){e.css(n.CSS.TRANSITION_DURATION,"0ms")}function s(t){var o=t.pointer.distanceY;o<5&&(o=Math.max(-i,o/2)),e.css(n.CSS.TRANSFORM,"translate3d(0,"+(i+o)+"px,0)")}function c(t){if(t.pointer.distanceY>0&&(t.pointer.distanceY>20||Math.abs(t.pointer.velocityY)>o)){var i=e.prop("offsetHeight")-t.pointer.distanceY,a=Math.min(i/t.pointer.velocityY*.75,500);e.css(n.CSS.TRANSITION_DURATION,a+"ms"),r.nextTick(d.cancel,!0)}else e.css(n.CSS.TRANSITION_DURATION,""),e.css(n.CSS.TRANSFORM,"")}var m=l.register(t,"drag",{horizontal:!1});return t.on("$md.dragstart",a).on("$md.drag",s).on("$md.dragend",c),{element:e,cleanup:function(){m(),t.off("$md.dragstart",a),t.off("$md.drag",s),t.off("$md.dragend",c)}}}var h;return{themable:!0,onShow:m,onRemove:u,disableBackdrop:!1,escapeToClose:!0,clickOutsideToClose:!0,disableParentScroll:!0}}n.$inject=["$animate","$mdConstant","$mdUtil","$mdTheming","$mdBottomSheet","$rootElement","$mdGesture","$log"];var o=.5,i=80;return e("$mdBottomSheet").setDefaults({methods:["disableParentScroll","escapeToClose","clickOutsideToClose"],options:n})}e.$inject=["$mdBottomSheet"],n.$inject=["$$interimElementProvider"],t.module("material.components.bottomSheet",["material.core","material.components.backdrop"]).directive("mdBottomSheet",e).provider("$mdBottomSheet",n)}(),function(){function e(e){return{restrict:"E",link:function(t,n){e(n)}}}function n(e,n,o,i){function r(e){return t.isDefined(e.href)||t.isDefined(e.ngHref)||t.isDefined(e.ngLink)||t.isDefined(e.uiSref)}function a(e,t){return r(t)?'':''}function d(a,d,s){n(d),e.attach(a,d),o.expectWithoutText(d,"aria-label"),r(s)&&t.isDefined(s.ngDisabled)&&a.$watch(s.ngDisabled,function(e){d.attr("tabindex",e?-1:0)}),d.on("click",function(e){!0===s.disabled&&(e.preventDefault(),e.stopImmediatePropagation())}),d.hasClass("md-no-focus")||(a.mouseActive=!1,d.on("mousedown",function(){a.mouseActive=!0,i(function(){a.mouseActive=!1},100)}).on("focus",function(){!1===a.mouseActive&&d.addClass("md-focused")}).on("blur",function(e){d.removeClass("md-focused")}))}return{restrict:"EA",replace:!0,transclude:!0,template:a,link:d}}n.$inject=["$mdButtonInkRipple","$mdTheming","$mdAria","$timeout"],e.$inject=["$mdTheming"],t.module("material.components.button",["material.core"]).directive("mdButton",n).directive("a",e)}(),function(){function e(e){return{restrict:"E",link:function(t,n,o){n.addClass("_md"),e(n)}}}e.$inject=["$mdTheming"],t.module("material.components.card",["material.core"]).directive("mdCard",e)}(),function(){t.module("material.components.chips",["material.core","material.components.autocomplete"])}(),function(){function e(e,n,o,i,r,a){function d(d,s){function l(d,s,l,c){function u(e){var t=e.which||e.keyCode;t!==o.KEY_CODE.SPACE&&t!==o.KEY_CODE.ENTER||(e.preventDefault(),s.addClass("md-focused"),p(e))}function p(e){s[0].hasAttribute("disabled")||d.skipToggle||d.$apply(function(){var t=l.ngChecked?l.checked:!c.$viewValue;c.$setViewValue(t,e&&e.type),c.$render()})}function h(){s.toggleClass("md-checked",!!c.$viewValue&&!g)}function f(e){g=!1!==e,g&&s.attr("aria-checked","mixed"),s.toggleClass("md-indeterminate",g)}var g;c=c||r.fakeNgModel(),i(s),s.children().on("focus",function(){s.focus()}),r.parseAttributeBoolean(l.mdIndeterminate)&&(f(),d.$watch(l.mdIndeterminate,f)),l.ngChecked&&d.$watch(d.$eval.bind(d,l.ngChecked),function(e){c.$setViewValue(e),c.$render()}),function(e,t,n){l[e]&&d.$watch(l[e],function(e){n[e]&&s.attr(t,n[e])})}("ngDisabled","tabindex",{true:"-1",false:l.tabindex}),n.expectWithText(s,"aria-label"),e.link.pre(d,{on:t.noop,0:{}},l,[c]),d.mouseActive=!1,s.on("click",p).on("keypress",u).on("mousedown",function(){d.mouseActive=!0,a(function(){d.mouseActive=!1},100)}).on("focus",function(){!1===d.mouseActive&&s.addClass("md-focused")}).on("blur",function(){s.removeClass("md-focused")}),c.$render=h}return s.$set("tabindex",s.tabindex||"0"),s.$set("type","checkbox"),s.$set("role",s.type),{pre:function(e,t){t.on("click",function(e){this.hasAttribute("disabled")&&e.stopImmediatePropagation()})},post:l}}return e=e[0],{restrict:"E",transclude:!0,require:"?ngModel",priority:210,template:'
',compile:d}}e.$inject=["inputDirective","$mdAria","$mdConstant","$mdTheming","$mdUtil","$timeout"],t.module("material.components.checkbox",["material.core"]).directive("mdCheckbox",e)}(),function(){!function(){function e(e,n,o){function r(e,t){try{t&&e.css(s(t))}catch(n){o.error(n.message)}}function a(e){return d(c(e))}function d(t,o){o=o||!1;var i=e.PALETTES[t.palette][t.hue];return i=o?i.contrast:i.value,n.supplant("rgba({0}, {1}, {2}, {3})",[i[0],i[1],i[2],i[3]||t.opacity])}function s(e){var n={},o=e.hasOwnProperty("color");return t.forEach(e,function(e,t){var i=c(e),r=t.indexOf("background")>-1;n[t]=d(i),r&&!o&&(n.color=d(i,!0))}),n}function l(n){return t.isDefined(e.THEMES[n.split("-")[0]])}function c(n){var o=n.split("-"),i=t.isDefined(e.THEMES[o[0]]),r=i?o.splice(0,1)[0]:e.defaultTheme();return{theme:r,palette:m(o,r),hue:u(o,r),opacity:o[2]||1}}function m(t,o){var r=t.length>1&&-1!==i.indexOf(t[1]),a=t[0].replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();if(r&&(a=t[0]+"-"+t.splice(1,1)),-1===i.indexOf(a)){ var d=e.THEMES[o].colors[a];if(!d)throw new Error(n.supplant("mdColors: couldn't find '{palette}' in the palettes.",{palette:a}));a=d.name}return a}function u(t,o){var i=e.THEMES[o].colors;if("hue"===t[1]){var r=parseInt(t.splice(2,1)[0],10);if(r<1||r>3)throw new Error(n.supplant("mdColors: 'hue-{hueNumber}' is not a valid hue, can be only 'hue-1', 'hue-2' and 'hue-3'",{hueNumber:r}));if(t[1]="hue-"+r,!(t[0]in i))throw new Error(n.supplant("mdColors: 'hue-x' can only be used with [{availableThemes}], but was used with '{usedTheme}'",{availableThemes:Object.keys(i).join(", "),usedTheme:t[0]}));return i[t[0]].hues[t[1]]}return t[1]||i[t[0]in i?t[0]:"primary"].hues.default}return i=i||Object.keys(e.PALETTES),{applyThemeColors:r,getThemeColor:a,hasTheme:l}}function n(e,n,i,r){return{restrict:"A",require:["^?mdTheme"],compile:function(a,d){var l=function(){var e=d.mdColors,i=e.indexOf("::")>-1,r=!!i||o.test(d.mdColors);d.mdColors=e.replace("::","");var a=t.isDefined(d.mdColorsWatch);return!i&&!r&&(!a||n.parseAttributeBoolean(d.mdColorsWatch))}();return function(n,o,a,d){var s=d[0],c={},m=function(t){"string"!=typeof t&&(t=""),a.mdColors||(a.mdColors="{}");var o=r(a.mdColors)(n);return s&&Object.keys(o).forEach(function(n){var i=o[n];e.hasTheme(i)||(o[n]=(t||s.$mdTheme)+"-"+i)}),u(o),o},u=function(e){if(!t.equals(e,c)){var n=Object.keys(c);c.background&&!n.color&&n.push("color"),n.forEach(function(e){o.css(e,"")})}c=e},p=t.noop;s&&(p=s.registerChanges(function(t){e.applyThemeColors(o,m(t))})),n.$on("$destroy",function(){p()});try{l?n.$watch(m,t.bind(this,e.applyThemeColors,o),!0):e.applyThemeColors(o,m())}catch(h){i.error(h.message)}}}}}n.$inject=["$mdColors","$mdUtil","$log","$parse"],e.$inject=["$mdTheming","$mdUtil","$log"];var o=/^{((\s|,)*?["'a-zA-Z-]+?\s*?:\s*?('|")[a-zA-Z0-9-.]*('|"))+\s*}$/,i=null;t.module("material.components.colors",["material.core"]).directive("mdColors",n).service("$mdColors",e)}()}(),function(){function e(e){function t(e,t){this.$scope=e,this.$element=t}return{restrict:"E",controller:["$scope","$element",t],link:function(t,o){o.addClass("_md"),e(o),t.$broadcast("$mdContentLoaded",o),n(o[0])}}}function n(e){t.element(e).on("$md.pressdown",function(t){"t"===t.pointer.type&&(t.$materialScrollFixed||(t.$materialScrollFixed=!0,0===e.scrollTop?e.scrollTop=1:e.scrollHeight===e.scrollTop+e.offsetHeight&&(e.scrollTop-=1)))})}e.$inject=["$mdTheming"],t.module("material.components.content",["material.core"]).directive("mdContent",e)}(),function(){t.module("material.components.datepicker",["material.core","material.components.icon","material.components.virtualRepeat"])}(),function(){function e(e,n,o){return{restrict:"E",link:function(i,r){r.addClass("_md"),n(r),e(function(){function e(){r.toggleClass("md-content-overflow",a.scrollHeight>a.clientHeight)}var n,a=r[0].querySelector("md-dialog-content");a&&(n=a.getElementsByTagName("img"),e(),t.element(n).on("load",e)),i.$on("$destroy",function(){o.destroy(r)})})}}}function o(e){function o(e,t){return{template:['',' ','

{{ dialog.title }}

','
','
',"

{{::dialog.mdTextContent}}

","
",' ',' '," ","
"," ",' '," {{ dialog.cancel }}"," ",' '," {{ dialog.ok }}"," "," ","
"].join("").replace(/\s\s+/g,""),controller:function(){var n="prompt"==this.$type;n&&this.initialValue&&(this.result=this.initialValue),this.hide=function(){e.hide(!n||this.result)},this.abort=function(){e.cancel()},this.keypress=function(n){n.keyCode===t.KEY_CODE.ENTER&&e.hide(this.result)}},controllerAs:"dialog",bindToController:!0}}function i(e,o,i,d,s,l,c,m,u,p,h){function f(e){E(e),e.contentElement&&(e.restoreContentElement=$(e))}function g(e,t,n,o){if(o){if(o.mdHtmlContent=o.htmlContent||n.htmlContent||"",o.mdTextContent=o.textContent||n.textContent||o.content||n.content||"",o.mdHtmlContent&&!p.has("$sanitize"))throw Error("The ngSanitize module must be loaded in order to use htmlContent.");if(o.mdHtmlContent&&o.mdTextContent)throw Error("md-dialog cannot have both `htmlContent` and `textContent`")}}function b(e,n,o,r){function a(){n[0].querySelector(".md-actions")&&u.warn("Using a class of md-actions is deprecated, please use .")}function d(){if(o.focusOnOpen){(i.findFocusTarget(n)||function(){var e=n[0].querySelector(".dialog-close");if(!e){var t=n[0].querySelectorAll(".md-actions button, md-dialog-actions button");e=t[t.length-1]}return e}()||s).focus()}}t.element(l[0].body).addClass("md-dialog-is-showing");var s=n.find("md-dialog");if(s.hasClass("ng-cloak")){u.warn("$mdDialog: using `` will affect the dialog opening animations.",n[0])}return C(o),T(s,o),y(e,n,o),M(n,o),k(n,o).then(function(){A(n,o),a(),d()})}function v(e,n,o){function d(){t.element(l[0].body).removeClass("md-dialog-is-showing"),o.contentElement?(o.reverseContainerStretch(),o.restoreContentElement()):n.remove(),o.$destroy||o.origin.focus()}return o.deactivateListeners(),o.unlockScreenReader(),o.hideBackdrop(o.$destroy),r&&r.parentNode&&r.parentNode.removeChild(r),a&&a.parentNode&&a.parentNode.removeChild(a),o.$destroy?d():function(){return x(n,o)}().then(d)}function E(e){if(!e.theme&&(e.theme=h.defaultTheme(),e.targetEvent&&e.targetEvent.target)){var n=t.element(e.targetEvent.target);e.theme=(n.controller("mdTheme")||{}).$mdTheme||e.theme}}function $(e){function n(e){var t=e.parentNode,n=e.nextElementSibling;return function(){n?t.insertBefore(e,n):t.appendChild(e)}}var o=e.contentElement,i=null;return t.isString(o)?(o=document.querySelector(o),i=n(o)):(o=o[0]||o,i=document.contains(o)?n(o):function(){o.parentNode.removeChild(o)}),e.element=t.element(o),e.skipCompile=!0,i}function C(e){function o(e,o){var i=t.element(e||{});if(i&&i.length){var r={top:0,left:0,height:0,width:0},a=t.isFunction(i[0].getBoundingClientRect);return t.extend(o||{},{element:a?i:n,bounds:a?i[0].getBoundingClientRect():t.extend({},r,i[0]),focus:t.bind(i,i.focus)})}}function i(e,n){return t.isString(e)&&(e=l[0].querySelector(e)),t.element(e||n)}e.origin=t.extend({element:null,bounds:null,focus:t.noop},e.origin||{}),e.parent=i(e.parent,m),e.closeTo=o(i(e.closeTo)),e.openFrom=o(i(e.openFrom)),e.targetEvent&&(e.origin=o(e.targetEvent.target,e.origin))}function M(n,o){var r=t.element(c),a=i.debounce(function(){w(n,o)},60),s=[],l=function(){var t="alert"==o.$type?e.hide:e.cancel;i.nextTick(t,!0)};if(o.escapeToClose){var m=o.parent,u=function(e){e.keyCode===d.KEY_CODE.ESCAPE&&(e.stopPropagation(),e.preventDefault(),l())};n.on("keydown",u),m.on("keydown",u),s.push(function(){n.off("keydown",u),m.off("keydown",u)})}if(r.on("resize",a),s.push(function(){r.off("resize",a)}),o.clickOutsideToClose){var p,h=n,f=function(e){p=e.target},g=function(e){p===h[0]&&e.target===h[0]&&(e.stopPropagation(),e.preventDefault(),l())};h.on("mousedown",f),h.on("mouseup",g),s.push(function(){h.off("mousedown",f),h.off("mouseup",g)})}o.deactivateListeners=function(){s.forEach(function(e){e()}),o.deactivateListeners=null}}function y(e,t,n){n.disableParentScroll&&(n.restoreScroll=i.disableScrollAround(t,n.parent)),n.hasBackdrop&&(n.backdrop=i.createBackdrop(e,"md-dialog-backdrop md-opaque"),s.enter(n.backdrop,n.parent)),n.hideBackdrop=function(e){n.backdrop&&(e?n.backdrop.remove():s.leave(n.backdrop)),n.disableParentScroll&&(n.restoreScroll(),delete n.restoreScroll),n.hideBackdrop=null}}function T(e,t){var n="alert"===t.$type?"alertdialog":"dialog",d=e.find("md-dialog-content"),s=e.attr("id"),l="dialogContent_"+(s||i.nextUid());e.attr({role:n,tabIndex:"-1"}),0===d.length&&(d=e,s&&(l=s)),d.attr("id",l),e.attr("aria-describedby",l),t.ariaLabel?o.expect(e,"aria-label",t.ariaLabel):o.expectAsync(e,"aria-label",function(){var e=d.text().split(/\s+/);return e.length>3&&(e=e.slice(0,3).concat("...")),e.join(" ")}),r=document.createElement("div"),r.classList.add("md-dialog-focus-trap"),r.tabIndex=0,a=r.cloneNode(!1);var c=function(){e.focus()};r.addEventListener("focus",c),a.addEventListener("focus",c),e[0].parentNode.insertBefore(r,e[0]),e.after(a)}function A(e,t){function n(e){for(;e.parentNode;){if(e===document.body)return;for(var t=e.parentNode.children,i=0;i'+function(e){return t.autoWrap&&!/<\/md-dialog>/g.test(e)?""+(e||"")+"":e||""}(e)+""}}}o.$inject=["$mdDialog","$mdConstant"],i.$inject=["$mdDialog","$mdAria","$mdUtil","$mdConstant","$animate","$document","$window","$rootElement","$log","$injector","$mdTheming"];var r,a;return e("$mdDialog").setDefaults({methods:["disableParentScroll","hasBackdrop","clickOutsideToClose","escapeToClose","targetEvent","closeTo","openFrom","parent","fullscreen","contentElement"],options:i}).addPreset("alert",{methods:["title","htmlContent","textContent","content","ariaLabel","ok","theme","css"],options:o}).addPreset("confirm",{methods:["title","htmlContent","textContent","content","ariaLabel","ok","cancel","theme","css"],options:o}).addPreset("prompt",{methods:["title","htmlContent","textContent","initialValue","content","placeholder","ariaLabel","ok","cancel","theme","css"],options:o})}e.$inject=["$$rAF","$mdTheming","$mdDialog"],o.$inject=["$$interimElementProvider"],t.module("material.components.dialog",["material.core","material.components.backdrop"]).directive("mdDialog",e).provider("$mdDialog",o)}(),function(){function e(e){return{restrict:"E",link:e}}e.$inject=["$mdTheming"],t.module("material.components.divider",["material.core"]).directive("mdDivider",e)}(),function(){!function(){function e(e){return{restrict:"E",require:["^?mdFabSpeedDial","^?mdFabToolbar"],compile:function(t,n){var o=t.children();e.prefixer().hasAttribute(o,"ng-repeat")?o.addClass("md-fab-action-item"):o.wrap('
')}}}e.$inject=["$mdUtil"],t.module("material.components.fabActions",["material.core"]).directive("mdFabActions",e)}()}(),function(){!function(){function e(e,n,o,i,r,a){function l(e){"click"==e.type&&k(e),"focusout"!=e.type||D||(D=a(function(){S.close()},100,!1)),"focusin"==e.type&&D&&(a.cancel(D),D=null)}function c(){S.currentActionIndex=-1}function u(){n[0].scrollHeight>0?o.addClass(n,"_md-animations-ready").then(function(){n.removeClass("md-animations-waiting")}):N<10&&(a(u,100),N+=1)}function p(){n.on("keydown",g),i.nextTick(function(){t.element(document).on("click touchend",f)})}function h(){n.off("keydown",g),t.element(document).off("click touchend",f)}function f(e){if(e.target){var t=i.getClosest(e.target,"md-fab-trigger"),n=i.getClosest(e.target,"md-fab-actions");t||n||S.close()}}function g(e){switch(e.which){case r.KEY_CODE.ESCAPE:return S.close(),e.preventDefault(),!1;case r.KEY_CODE.LEFT_ARROW:return C(e),!1;case r.KEY_CODE.UP_ARROW:return M(e),!1;case r.KEY_CODE.RIGHT_ARROW:return y(e),!1;case r.KEY_CODE.DOWN_ARROW:return T(e),!1}}function b(e){E(e,-1)}function v(e){E(e,1)}function E(e,n){var o=$();S.currentActionIndex=S.currentActionIndex+n,S.currentActionIndex=Math.min(o.length-1,S.currentActionIndex),S.currentActionIndex=Math.max(0,S.currentActionIndex);var i=t.element(o[S.currentActionIndex]).children()[0];t.element(i).attr("tabindex",0),i.focus(),e.preventDefault(),e.stopImmediatePropagation()}function $(){var e=_()[0].querySelectorAll(".md-fab-action-item");return t.forEach(e,function(e){t.element(t.element(e).children()[0]).attr("tabindex",-1)}),e}function C(e){"left"===S.direction?v(e):b(e)}function M(e){"down"===S.direction?b(e):v(e)}function y(e){"left"===S.direction?b(e):v(e)}function T(e){"up"===S.direction?b(e):v(e)}function A(e){return i.getClosest(e,"md-fab-trigger")}function w(e){return i.getClosest(e,"md-fab-actions")}function k(e){A(e.target)&&S.toggle(),w(e.target)&&S.close()}function x(){return n.find("md-fab-trigger")}function _(){return n.find("md-fab-actions")}var S=this;S.open=function(){e.$evalAsync("vm.isOpen = true")},S.close=function(){e.$evalAsync("vm.isOpen = false"),n.find("md-fab-trigger")[0].focus()},S.toggle=function(){e.$evalAsync("vm.isOpen = !vm.isOpen")},function(){S.direction=S.direction||"down",S.isOpen=S.isOpen||!1,c(),n.addClass("md-animations-waiting")}(),function(){var o=["click","focusin","focusout"];t.forEach(o,function(e){n.on(e,l)}),e.$on("$destroy",function(){t.forEach(o,function(e){n.off(e,l)}),h()})}(),function(){e.$watch("vm.direction",function(e,t){o.removeClass(n,"md-"+t),o.addClass(n,"md-"+e),c()});var t,i;e.$watch("vm.isOpen",function(e){c(),t&&i||(t=x(),i=_()),e?p():h();var r=e?"md-is-open":"",a=e?"":"md-is-open";t.attr("aria-haspopup",!0),t.attr("aria-expanded",e),i.attr("aria-hidden",!e),o.setClass(n,r,a)})}();var N=0;u();var D}e.$inject=["$scope","$element","$animate","$mdUtil","$mdConstant","$timeout"],t.module("material.components.fabShared",["material.core"]).controller("MdFabController",e)}()}(),function(){!function(){function n(){function e(e,t){t.prepend('
')}return{restrict:"E",scope:{direction:"@?mdDirection",isOpen:"=?mdOpen"},bindToController:!0,controller:"MdFabController",controllerAs:"vm",link:e}}function o(n){function o(e){n(e,r,!1)}function i(n){if(!n.hasClass("md-animations-waiting")||n.hasClass("_md-animations-ready")){var o=n[0],i=n.controller("mdFabSpeedDial"),r=o.querySelectorAll(".md-fab-action-item"),a=o.querySelector("md-fab-trigger"),d=o.querySelector("._md-css-variables"),s=parseInt(e.getComputedStyle(d).zIndex);t.forEach(r,function(e,t){var n=e.style;n.transform=n.webkitTransform="",n.transitionDelay="",n.opacity=1,n.zIndex=r.length-t+s}),a.style.zIndex=s+r.length+1,i.isOpen||t.forEach(r,function(e,t){var n,o,r=e.style,d=(a.clientHeight-e.clientHeight)/2,s=(a.clientWidth-e.clientWidth)/2;switch(i.direction){case"up":n=e.scrollHeight*(t+1)+d,o="Y";break;case"down":n=-(e.scrollHeight*(t+1)+d),o="Y";break;case"left":n=e.scrollWidth*(t+1)+s,o="X";break;case"right":n=-(e.scrollWidth*(t+1)+s),o="X"}var l="translate"+o+"("+n+"px)";r.transform=r.webkitTransform=l})}}return{addClass:function(e,t,n){e.hasClass("md-fling")?(i(e),o(n)):n()},removeClass:function(e,t,n){i(e),o(n)}}}function i(n){function o(e){n(e,r,!1)}function i(n){var o=n[0],i=n.controller("mdFabSpeedDial"),r=o.querySelectorAll(".md-fab-action-item"),d=o.querySelector("._md-css-variables"),s=parseInt(e.getComputedStyle(d).zIndex);t.forEach(r,function(e,t){var n=e.style,o=t*a;n.opacity=i.isOpen?1:0,n.transform=n.webkitTransform=i.isOpen?"scale(1)":"scale(0)",n.transitionDelay=(i.isOpen?o:r.length-o)+"ms",n.zIndex=r.length-t+s})}var a=65;return{addClass:function(e,t,n){i(e),o(n)},removeClass:function(e,t,n){i(e),o(n)}}}o.$inject=["$timeout"],i.$inject=["$timeout"];var r=300;t.module("material.components.fabSpeedDial",["material.core","material.components.fabShared","material.components.fabActions"]).directive("mdFabSpeedDial",n).animation(".md-fling",o).animation(".md-scale",i).service("mdFabSpeedDialFlingAnimation",o).service("mdFabSpeedDialScaleAnimation",i)}()}(),function(){!function(){function n(){function e(e,t,n){t.addClass("md-fab-toolbar"),t.find("md-fab-trigger").find("button").prepend('
')}return{restrict:"E",transclude:!0,template:'
',scope:{direction:"@?mdDirection",isOpen:"=?mdOpen"},bindToController:!0,controller:"MdFabController",controllerAs:"vm",link:e}}function o(){function n(n,o,i){if(o){var r=n[0],a=n.controller("mdFabToolbar"),d=r.querySelector(".md-fab-toolbar-background"),s=r.querySelector("md-fab-trigger button"),l=r.querySelector("md-toolbar"),c=r.querySelector("md-fab-trigger button md-icon"),m=n.find("md-fab-actions").children();if(s&&d){var u=e.getComputedStyle(s).getPropertyValue("background-color"),p=r.offsetWidth,h=(r.offsetHeight,p/s.offsetWidth*2);d.style.backgroundColor=u,d.style.borderRadius=p+"px",a.isOpen?(l.style.pointerEvents="inherit",d.style.width=s.offsetWidth+"px",d.style.height=s.offsetHeight+"px",d.style.transform="scale("+h+")",d.style.transitionDelay="0ms",c&&(c.style.transitionDelay=".3s"),t.forEach(m,function(e,t){e.style.transitionDelay=25*(m.length-t)+"ms"})):(l.style.pointerEvents="none",d.style.transform="scale(1)",d.style.top="0",n.hasClass("md-right")&&(d.style.left="0",d.style.right=null),n.hasClass("md-left")&&(d.style.right="0",d.style.left=null),d.style.transitionDelay="200ms",c&&(c.style.transitionDelay="0ms"),t.forEach(m,function(e,t){e.style.transitionDelay=200+25*t+"ms"}))}}}return{addClass:function(e,t,o){n(e,t,o),o()},removeClass:function(e,t,o){n(e,t,o),o()}}}t.module("material.components.fabToolbar",["material.core","material.components.fabShared","material.components.fabActions"]).directive("mdFabToolbar",n).animation(".md-fab-toolbar",o).service("mdFabToolbarAnimation",o)}()}(),function(){function e(e,o,i,r){function a(n,a,d,s){function c(){s.layoutDelegate=t.noop,T();for(var e in o.MEDIA)r.getQuery(o.MEDIA[e]).removeListener(y)}function m(e){null==e?s.invalidateLayout():r(e)&&s.invalidateLayout()}function u(e){var o=g(),r={tileSpans:b(o),colCount:v(),rowMode:C(),rowHeight:$(),gutter:E()};if(e||!t.equals(r,A)){var d=i(r.colCount,r.tileSpans,o).map(function(e,n){return{grid:{element:a,style:f(r.colCount,n,r.gutter,r.rowMode,r.rowHeight)},tiles:e.map(function(e,i){return{element:t.element(o[i]),style:h(e.position,e.spans,r.colCount,n,r.gutter,r.rowMode,r.rowHeight)}})}}).reflow().performance();n.mdOnLayout({$event:{performance:d}}),A=r}}function p(e){return w+e+k}function h(e,t,n,o,i,r,a){var d=1/n*100,s=(n-1)/n,l=x({share:d,gutterShare:s,gutter:i}),c={left:_({unit:l,offset:e.col,gutter:i}),width:S({unit:l,span:t.col,gutter:i}),paddingTop:"",marginTop:"",top:"",height:""};switch(r){case"fixed":c.top=_({unit:a,offset:e.row,gutter:i}),c.height=S({unit:a,span:t.row,gutter:i});break;case"ratio":var m=d/a,u=x({share:m,gutterShare:s,gutter:i});c.paddingTop=S({unit:u,span:t.row,gutter:i}),c.marginTop=_({unit:u,offset:e.row,gutter:i});break;case"fit":var p=(o-1)/o,m=1/o*100,u=x({share:m,gutterShare:p,gutter:i});c.top=_({unit:u,offset:e.row,gutter:i}),c.height=S({unit:u,span:t.row,gutter:i})}return c}function f(e,t,n,o,i){var r={};switch(o){case"fixed":r.height=S({unit:i,span:t,gutter:n}),r.paddingBottom="";break;case"ratio":var a=1===e?0:(e-1)/e,d=1/e*100,s=d*(1/i),l=x({share:s,gutterShare:a,gutter:n});r.height="",r.paddingBottom=S({unit:l,span:t,gutter:n})}return r}function g(){return[].filter.call(a.children(),function(e){return"MD-GRID-TILE"==e.tagName&&!e.$$mdDestroyed})}function b(e){return[].map.call(e,function(e){var n=t.element(e).controller("mdGridTile");return{row:parseInt(r.getResponsiveAttribute(n.$attrs,"md-rowspan"),10)||1,col:parseInt(r.getResponsiveAttribute(n.$attrs,"md-colspan"),10)||1}})}function v(){var e=parseInt(r.getResponsiveAttribute(d,"md-cols"),10);if(isNaN(e))throw"md-grid-list: md-cols attribute was not found, or contained a non-numeric value";return e}function E(){return M(r.getResponsiveAttribute(d,"md-gutter")||1)}function $(){var e=r.getResponsiveAttribute(d,"md-row-height");if(!e)throw"md-grid-list: md-row-height attribute was not found";switch(C()){case"fixed":return M(e);case"ratio":var t=e.split(":");return parseFloat(t[0])/parseFloat(t[1]);case"fit":return 0}}function C(){var e=r.getResponsiveAttribute(d,"md-row-height");if(!e)throw"md-grid-list: md-row-height attribute was not found";return"fit"==e?"fit":-1!==e.indexOf(":")?"ratio":"fixed"}function M(e){return/\D$/.test(e)?e:e+"px"}a.addClass("_md"),a.attr("role","list"),s.layoutDelegate=u;var y=t.bind(s,s.invalidateLayout),T=function(){for(var e in o.MEDIA)r(e),r.getQuery(o.MEDIA[e]).addListener(y);return r.watchResponsiveAttributes(["md-cols","md-row-height","md-gutter"],d,m)}();n.$on("$destroy",c);var A,w=e.startSymbol(),k=e.endSymbol(),x=e(p("share")+"% - ("+p("gutter")+" * "+p("gutterShare")+")"),_=e("calc(("+p("unit")+" + "+p("gutter")+") * "+p("offset")+")"),S=e("calc(("+p("unit")+") * "+p("span")+" + ("+p("span")+" - 1) * "+p("gutter")+")")}return{restrict:"E",controller:n,scope:{mdOnLayout:"&"},link:a}}function n(e){this.layoutInvalidated=!1,this.tilesInvalidated=!1,this.$timeout_=e.nextTick,this.layoutDelegate=t.noop}function o(e){function n(t,n){var o,a,d,s,l,c;return s=e.time(function(){a=i(t,n)}),o={layoutInfo:function(){return a},map:function(t){return l=e.time(function(){var e=o.layoutInfo();d=t(e.positioning,e.rowCount)}),o},reflow:function(t){return c=e.time(function(){(t||r)(d.grid,d.tiles)}),o},performance:function(){return{tileCount:n.length,layoutTime:s,mapTime:l,reflowTime:c,totalTime:s+l+c}}}}function o(e,t){e.element.css(e.style),t.forEach(function(e){e.element.css(e.style)})}function i(e,t){function n(t,n){if(t.col>e)throw"md-grid-list: Tile at position "+n+" has a colspan ("+t.col+") that exceeds the column count ("+e+")";for(var a=0,c=0;c-a=e?o():(a=l.indexOf(0,d),-1!==a&&-1!==(c=r(a+1))?d=c+1:(a=c=0,o()));return i(a,t.col,t.row),d=a+t.col,{col:a,row:s}}function o(){d=0,s++,i(0,e,-1)}function i(e,t,n){for(var o=e;o",transclude:!0,scope:{},controller:["$attrs",function(e){this.$attrs=e}],link:n}}function r(){return{template:"
",transclude:!0}}n.$inject=["$mdUtil"],o.$inject=["$mdUtil"],e.$inject=["$interpolate","$mdConstant","$mdGridLayout","$mdMedia"],i.$inject=["$mdMedia"],t.module("material.components.gridList",["material.core"]).directive("mdGridList",e).directive("mdGridTile",i).directive("mdGridTileFooter",r).directive("mdGridTileHeader",r).factory("$mdGridLayout",o),n.prototype={invalidateTiles:function(){this.tilesInvalidated=!0,this.invalidateLayout()},invalidateLayout:function(){this.layoutInvalidated||(this.layoutInvalidated=!0,this.$timeout_(t.bind(this,this.layout)))},layout:function(){try{this.layoutDelegate(this.tilesInvalidated)}finally{this.layoutInvalidated=!1,this.tilesInvalidated=!1}}}}(),function(){t.module("material.components.icon",["material.core"])}(),function(){function n(e,t){function n(t){var n=t[0].querySelector(r),o=t[0].querySelector(a);return n&&t.addClass("md-icon-left"),o&&t.addClass("md-icon-right"),function(t,n){e(n)}}function o(e,n,o,i){var r=this;r.isErrorGetter=o.mdIsError&&t(o.mdIsError),r.delegateClick=function(){r.input.focus()},r.element=n,r.setFocused=function(e){n.toggleClass("md-input-focused",!!e)},r.setHasValue=function(e){n.toggleClass("md-input-has-value",!!e)},r.setHasPlaceholder=function(e){n.toggleClass("md-input-has-placeholder",!!e)},r.setInvalid=function(e){e?i.addClass(n,"md-input-invalid"):i.removeClass(n,"md-input-invalid")},e.$watch(function(){return r.label&&r.input},function(e){e&&!r.label.attr("for")&&r.label.attr("for",r.input.attr("id"))})}o.$inject=["$scope","$element","$attrs","$animate"];var i=["INPUT","TEXTAREA","SELECT","MD-SELECT"],r=i.reduce(function(e,t){return e.concat(["md-icon ~ "+t,".md-icon ~ "+t])},[]).join(","),a=i.reduce(function(e,t){return e.concat([t+" ~ md-icon",t+" ~ .md-icon"])},[]).join(",");return{restrict:"E",compile:n,controller:o}}function o(){return{restrict:"E",require:"^?mdInputContainer",link:function(e,t,n,o){!o||n.mdNoFloat||t.hasClass("md-container-ignore")||(o.label=t,e.$on("$destroy",function(){o.label=null}))}}}function i(e,n,o,i,r){function a(a,d,s,l){function c(e){return h.setHasValue(!g.$isEmpty(e)),e}function u(){h.setHasValue(d.val().length>0||(d[0].validity||{}).badInput)}var h=l[0],f=!!l[1],g=l[1]||e.fakeNgModel(),b=l[2],v=t.isDefined(s.readonly),E=e.parseAttributeBoolean(s.mdNoAsterisk),$=d[0].tagName.toLowerCase();if(h){if("hidden"===s.type)return void d.attr("aria-hidden","true");if(h.input){if(h.input[0].contains(d[0]))return;throw new Error(" can only have *one* ,
This field is required
'),t.put("app/directives/header-item/header-item.html",''),t.put("app/directives/header-item/header-view.html","
")}]),function(a,b){"object"==typeof exports&&"undefined"!=typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):a.moment=b()}(this,function(){"use strict";function a(){return Uc.apply(null,arguments)}function c(a){return"[object Array]"===Object.prototype.toString.call(a)}function d(a){return a instanceof Date||"[object Date]"===Object.prototype.toString.call(a)}function e(a,b){var c,d=[];for(c=0;c0)for(c in Wc)d=Wc[c],e=b[d],m(e)||(a[d]=e);return a}function o(b){n(this,b),this._d=new Date(null!=b._d?b._d.getTime():NaN),!1===Xc&&(Xc=!0,a.updateOffset(this),Xc=!1)}function p(a){return a instanceof o||null!=a&&null!=a._isAMomentObject}function q(a){return 0>a?Math.ceil(a):Math.floor(a)}function r(a){var b=+a,c=0;return 0!==b&&isFinite(b)&&(c=q(b)),c}function s(a,b,c){var d,e=Math.min(a.length,b.length),f=Math.abs(a.length-b.length),g=0;for(d=0;e>d;d++)(c&&a[d]!==b[d]||!c&&r(a[d])!==r(b[d]))&&g++;return g+f}function t(){}function u(a){return a?a.toLowerCase().replace("_","-"):a}function v(a){for(var b,c,d,e,f=0;f0;){if(d=w(e.slice(0,b).join("-")))return d;if(c&&c.length>=b&&s(e,c,!0)>=b-1)break;b--}f++}return null}function w(a){var b=null;if(!Yc[a]&&"undefined"!=typeof module&&module&&module.exports)try{b=Vc._abbr,require("./locale/"+a),x(b)}catch(c){}return Yc[a]}function x(a,b){var c;return a&&(c=m(b)?z(a):y(a,b))&&(Vc=c),Vc._abbr}function y(a,b){return null!==b?(b.abbr=a,Yc[a]=Yc[a]||new t,Yc[a].set(b),x(a),Yc[a]):(delete Yc[a],null)}function z(a){var b;if(a&&a._locale&&a._locale._abbr&&(a=a._locale._abbr),!a)return Vc;if(!c(a)){if(b=w(a))return b;a=[a]}return v(a)}function A(a,b){var c=a.toLowerCase();Zc[c]=Zc[c+"s"]=Zc[b]=a}function B(a){return"string"==typeof a?Zc[a]||Zc[a.toLowerCase()]:void 0}function C(a){var b,c,d={};for(c in a)f(a,c)&&(b=B(c))&&(d[b]=a[c]);return d}function D(a){return a instanceof Function||"[object Function]"===Object.prototype.toString.call(a)}function E(b,c){return function(d){return null!=d?(G(this,b,d),a.updateOffset(this,c),this):F(this,b)}}function F(a,b){return a.isValid()?a._d["get"+(a._isUTC?"UTC":"")+b]():NaN}function G(a,b,c){a.isValid()&&a._d["set"+(a._isUTC?"UTC":"")+b](c)}function H(a,b){var c;if("object"==typeof a)for(c in a)this.set(c,a[c]);else if(a=B(a),D(this[a]))return this[a](b);return this}function I(a,b,c){var d=""+Math.abs(a),e=b-d.length;return(a>=0?c?"+":"":"-")+Math.pow(10,Math.max(0,e)).toString().substr(1)+d}function J(a,b,c,d){var e=d;"string"==typeof d&&(e=function(){return this[d]()}),a&&(bd[a]=e),b&&(bd[b[0]]=function(){return I(e.apply(this,arguments),b[1],b[2])}),c&&(bd[c]=function(){return this.localeData().ordinal(e.apply(this,arguments),a)})}function K(a){return a.match(/\[[\s\S]/)?a.replace(/^\[|\]$/g,""):a.replace(/\\/g,"")}function L(a){var b,c,d=a.match($c);for(b=0,c=d.length;c>b;b++)bd[d[b]]?d[b]=bd[d[b]]:d[b]=K(d[b]);return function(e){var f="";for(b=0;c>b;b++)f+=d[b]instanceof Function?d[b].call(e,a):d[b];return f}}function M(a,b){return a.isValid()?(b=N(b,a.localeData()),ad[b]=ad[b]||L(b),ad[b](a)):a.localeData().invalidDate()}function N(a,b){function c(a){return b.longDateFormat(a)||a}var d=5;for(_c.lastIndex=0;d>=0&&_c.test(a);)a=a.replace(_c,c),_c.lastIndex=0,d-=1;return a}function O(a,b,c){td[a]=D(b)?b:function(a,d){return a&&c?c:b}}function P(a,b){return f(td,a)?td[a](b._strict,b._locale):new RegExp(Q(a))}function Q(a){return R(a.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(a,b,c,d,e){return b||c||d||e}))}function R(a){return a.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function S(a,b){var c,d=b;for("string"==typeof a&&(a=[a]),"number"==typeof b&&(d=function(a,c){c[b]=r(a)}),c=0;cd;d++){if(e=h([2e3,d]),c&&!this._longMonthsParse[d]&&(this._longMonthsParse[d]=new RegExp("^"+this.months(e,"").replace(".","")+"$","i"),this._shortMonthsParse[d]=new RegExp("^"+this.monthsShort(e,"").replace(".","")+"$","i")),c||this._monthsParse[d]||(f="^"+this.months(e,"")+"|^"+this.monthsShort(e,""),this._monthsParse[d]=new RegExp(f.replace(".",""),"i")),c&&"MMMM"===b&&this._longMonthsParse[d].test(a))return d;if(c&&"MMM"===b&&this._shortMonthsParse[d].test(a))return d;if(!c&&this._monthsParse[d].test(a))return d}}function Z(a,b){var c;return a.isValid()?"string"==typeof b&&"number"!=typeof(b=a.localeData().monthsParse(b))?a:(c=Math.min(a.date(),V(a.year(),b)),a._d["set"+(a._isUTC?"UTC":"")+"Month"](b,c),a):a}function $(b){return null!=b?(Z(this,b),a.updateOffset(this,!0),this):F(this,"Month")}function _(){return V(this.year(),this.month())}function aa(a){return this._monthsParseExact?(f(this,"_monthsRegex")||ca.call(this),a?this._monthsShortStrictRegex:this._monthsShortRegex):this._monthsShortStrictRegex&&a?this._monthsShortStrictRegex:this._monthsShortRegex}function ba(a){return this._monthsParseExact?(f(this,"_monthsRegex")||ca.call(this),a?this._monthsStrictRegex:this._monthsRegex):this._monthsStrictRegex&&a?this._monthsStrictRegex:this._monthsRegex}function ca(){function a(a,b){return b.length-a.length}var b,c,d=[],e=[],f=[];for(b=0;12>b;b++)c=h([2e3,b]),d.push(this.monthsShort(c,"")),e.push(this.months(c,"")),f.push(this.months(c,"")),f.push(this.monthsShort(c,""));for(d.sort(a),e.sort(a),f.sort(a),b=0;12>b;b++)d[b]=R(d[b]),e[b]=R(e[b]),f[b]=R(f[b]);this._monthsRegex=new RegExp("^("+f.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+e.join("|")+")$","i"),this._monthsShortStrictRegex=new RegExp("^("+d.join("|")+")$","i")}function da(a){var b,c=a._a;return c&&-2===j(a).overflow&&(b=c[wd]<0||c[wd]>11?wd:c[xd]<1||c[xd]>V(c[vd],c[wd])?xd:c[yd]<0||c[yd]>24||24===c[yd]&&(0!==c[zd]||0!==c[Ad]||0!==c[Bd])?yd:c[zd]<0||c[zd]>59?zd:c[Ad]<0||c[Ad]>59?Ad:c[Bd]<0||c[Bd]>999?Bd:-1,j(a)._overflowDayOfYear&&(vd>b||b>xd)&&(b=xd),j(a)._overflowWeeks&&-1===b&&(b=Cd),j(a)._overflowWeekday&&-1===b&&(b=Dd),j(a).overflow=b),a}function ea(b){!1===a.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+b)}function fa(a,b){var c=!0;return g(function(){return c&&(ea(a+"\nArguments: "+Array.prototype.slice.call(arguments).join(", ")+"\n"+(new Error).stack),c=!1),b.apply(this,arguments)},b)}function ga(a,b){Jd[a]||(ea(b),Jd[a]=!0)}function ha(a){var b,c,d,e,f,g,h=a._i,i=Kd.exec(h)||Ld.exec(h);if(i){for(j(a).iso=!0,b=0,c=Nd.length;c>b;b++)if(Nd[b][1].exec(i[1])){e=Nd[b][0],d=!1!==Nd[b][2];break}if(null==e)return void(a._isValid=!1);if(i[3]){for(b=0,c=Od.length;c>b;b++)if(Od[b][1].exec(i[3])){f=(i[2]||" ")+Od[b][0];break}if(null==f)return void(a._isValid=!1)}if(!d&&null!=f)return void(a._isValid=!1);if(i[4]){if(!Md.exec(i[4]))return void(a._isValid=!1);g="Z"}a._f=e+(f||"")+(g||""),wa(a)}else a._isValid=!1}function ia(b){var c=Pd.exec(b._i);return null!==c?void(b._d=new Date(+c[1])):(ha(b),void(!1===b._isValid&&(delete b._isValid,a.createFromInputFallback(b))))}function ja(a,b,c,d,e,f,g){var h=new Date(a,b,c,d,e,f,g);return 100>a&&a>=0&&isFinite(h.getFullYear())&&h.setFullYear(a),h}function ka(a){var b=new Date(Date.UTC.apply(null,arguments));return 100>a&&a>=0&&isFinite(b.getUTCFullYear())&&b.setUTCFullYear(a),b}function la(a){return ma(a)?366:365}function ma(a){return a%4==0&&a%100!=0||a%400==0}function na(){return ma(this.year())}function oa(a,b,c){var d=7+b-c;return-(7+ka(a,0,d).getUTCDay()-b)%7+d-1}function pa(a,b,c,d,e){var f,g,h=(7+c-d)%7,i=oa(a,d,e),j=1+7*(b-1)+h+i;return 0>=j?(f=a-1,g=la(f)+j):j>la(a)?(f=a+1,g=j-la(a)):(f=a,g=j),{year:f,dayOfYear:g}}function qa(a,b,c){var d,e,f=oa(a.year(),b,c),g=Math.floor((a.dayOfYear()-f-1)/7)+1;return 1>g?(e=a.year()-1,d=g+ra(e,b,c)):g>ra(a.year(),b,c)?(d=g-ra(a.year(),b,c),e=a.year()+1):(e=a.year(),d=g),{week:d,year:e}}function ra(a,b,c){var d=oa(a,b,c),e=oa(a+1,b,c);return(la(a)-d+e)/7}function sa(a,b,c){return null!=a?a:null!=b?b:c}function ta(b){var c=new Date(a.now());return b._useUTC?[c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()]:[c.getFullYear(),c.getMonth(),c.getDate()]}function ua(a){var b,c,d,e,f=[];if(!a._d){for(d=ta(a),a._w&&null==a._a[xd]&&null==a._a[wd]&&va(a),a._dayOfYear&&(e=sa(a._a[vd],d[vd]),a._dayOfYear>la(e)&&(j(a)._overflowDayOfYear=!0),c=ka(e,0,a._dayOfYear),a._a[wd]=c.getUTCMonth(),a._a[xd]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];for(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];24===a._a[yd]&&0===a._a[zd]&&0===a._a[Ad]&&0===a._a[Bd]&&(a._nextDay=!0,a._a[yd]=0),a._d=(a._useUTC?ka:ja).apply(null,f),null!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[yd]=24)}}function va(a){var b,c,d,e,f,g,h,i;b=a._w,null!=b.GG||null!=b.W||null!=b.E?(f=1,g=4,c=sa(b.GG,a._a[vd],qa(Ea(),1,4).year),d=sa(b.W,1),(1>(e=sa(b.E,1))||e>7)&&(i=!0)):(f=a._locale._week.dow,g=a._locale._week.doy,c=sa(b.gg,a._a[vd],qa(Ea(),f,g).year),d=sa(b.w,1),null!=b.d?(0>(e=b.d)||e>6)&&(i=!0):null!=b.e?(e=b.e+f,(b.e<0||b.e>6)&&(i=!0)):e=f),1>d||d>ra(c,f,g)?j(a)._overflowWeeks=!0:null!=i?j(a)._overflowWeekday=!0:(h=pa(c,d,e,f,g),a._a[vd]=h.year,a._dayOfYear=h.dayOfYear)}function wa(b){if(b._f===a.ISO_8601)return void ha(b);b._a=[],j(b).empty=!0;var c,d,e,f,g,h=""+b._i,i=h.length,k=0;for(e=N(b._f,b._locale).match($c)||[],c=0;c0&&j(b).unusedInput.push(g),h=h.slice(h.indexOf(d)+d.length),k+=d.length),bd[f]?(d?j(b).empty=!1:j(b).unusedTokens.push(f),U(f,d,b)):b._strict&&!d&&j(b).unusedTokens.push(f);j(b).charsLeftOver=i-k,h.length>0&&j(b).unusedInput.push(h),!0===j(b).bigHour&&b._a[yd]<=12&&b._a[yd]>0&&(j(b).bigHour=void 0),b._a[yd]=xa(b._locale,b._a[yd],b._meridiem),ua(b),da(b)}function xa(a,b,c){var d;return null==c?b:null!=a.meridiemHour?a.meridiemHour(b,c):null!=a.isPM?(d=a.isPM(c),d&&12>b&&(b+=12),d||12!==b||(b=0),b):b}function ya(a){var b,c,d,e,f;if(0===a._f.length)return j(a).invalidFormat=!0,void(a._d=new Date(NaN));for(e=0;ef)&&(d=f,c=b));g(a,c||b)}function za(a){if(!a._d){var b=C(a._i);a._a=e([b.year,b.month,b.day||b.date,b.hour,b.minute,b.second,b.millisecond],function(a){return a&&parseInt(a,10)}),ua(a)}}function Aa(a){var b=new o(da(Ba(a)));return b._nextDay&&(b.add(1,"d"),b._nextDay=void 0),b}function Ba(a){var b=a._i,e=a._f;return a._locale=a._locale||z(a._l),null===b||void 0===e&&""===b?l({nullInput:!0}):("string"==typeof b&&(a._i=b=a._locale.preparse(b)),p(b)?new o(da(b)):(c(e)?ya(a):e?wa(a):d(b)?a._d=b:Ca(a),k(a)||(a._d=null),a))}function Ca(b){var f=b._i;void 0===f?b._d=new Date(a.now()):d(f)?b._d=new Date(+f):"string"==typeof f?ia(b):c(f)?(b._a=e(f.slice(0),function(a){return parseInt(a,10)}),ua(b)):"object"==typeof f?za(b):"number"==typeof f?b._d=new Date(f):a.createFromInputFallback(b)}function Da(a,b,c,d,e){var f={};return"boolean"==typeof c&&(d=c,c=void 0),f._isAMomentObject=!0,f._useUTC=f._isUTC=e,f._l=c,f._i=a,f._f=b,f._strict=d,Aa(f)}function Ea(a,b,c,d){return Da(a,b,c,d,!1)}function Fa(a,b){var d,e;if(1===b.length&&c(b[0])&&(b=b[0]),!b.length)return Ea();for(d=b[0],e=1;ea&&(a=-a,c="-"),c+I(~~(a/60),2)+b+I(~~a%60,2)})}function La(a,b){var c=(b||"").match(a)||[],d=c[c.length-1]||[],e=(d+"").match(Ud)||["-",0,0],f=60*e[1]+r(e[2]);return"+"===e[0]?f:-f}function Ma(b,c){var e,f;return c._isUTC?(e=c.clone(),f=(p(b)||d(b)?+b:+Ea(b))-+e,e._d.setTime(+e._d+f),a.updateOffset(e,!1),e):Ea(b).local()}function Na(a){return 15*-Math.round(a._d.getTimezoneOffset()/15)}function Oa(b,c){var d,e=this._offset||0;return this.isValid()?null!=b?("string"==typeof b?b=La(qd,b):Math.abs(b)<16&&(b*=60),!this._isUTC&&c&&(d=Na(this)),this._offset=b,this._isUTC=!0,null!=d&&this.add(d,"m"),e!==b&&(!c||this._changeInProgress?cb(this,Za(b-e,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,a.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?e:Na(this):null!=b?this:NaN}function Pa(a,b){return null!=a?("string"!=typeof a&&(a=-a),this.utcOffset(a,b),this):-this.utcOffset()}function Qa(a){return this.utcOffset(0,a)}function Ra(a){return this._isUTC&&(this.utcOffset(0,a),this._isUTC=!1,a&&this.subtract(Na(this),"m")),this}function Sa(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&this.utcOffset(La(pd,this._i)),this}function Ta(a){return!!this.isValid()&&(a=a?Ea(a).utcOffset():0,(this.utcOffset()-a)%60==0)}function Ua(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Va(){if(!m(this._isDSTShifted))return this._isDSTShifted;var a={};if(n(a,this),a=Ba(a),a._a){var b=a._isUTC?h(a._a):Ea(a._a);this._isDSTShifted=this.isValid()&&s(a._a,b.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function Wa(){return!!this.isValid()&&!this._isUTC}function Xa(){return!!this.isValid()&&this._isUTC}function Ya(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}function Za(a,b){var c,d,e,g=a,h=null;return Ja(a)?g={ms:a._milliseconds,d:a._days,M:a._months}:"number"==typeof a?(g={},b?g[b]=a:g.milliseconds=a):(h=Vd.exec(a))?(c="-"===h[1]?-1:1,g={y:0,d:r(h[xd])*c,h:r(h[yd])*c,m:r(h[zd])*c,s:r(h[Ad])*c,ms:r(h[Bd])*c}):(h=Wd.exec(a))?(c="-"===h[1]?-1:1,g={y:$a(h[2],c),M:$a(h[3],c),d:$a(h[4],c),h:$a(h[5],c),m:$a(h[6],c),s:$a(h[7],c),w:$a(h[8],c)}):null==g?g={}:"object"==typeof g&&("from"in g||"to"in g)&&(e=ab(Ea(g.from),Ea(g.to)),g={},g.ms=e.milliseconds,g.M=e.months),d=new Ia(g),Ja(a)&&f(a,"_locale")&&(d._locale=a._locale),d}function $a(a,b){var c=a&&parseFloat(a.replace(",","."));return(isNaN(c)?0:c)*b}function _a(a,b){var c={milliseconds:0,months:0};return c.months=b.month()-a.month()+12*(b.year()-a.year()),a.clone().add(c.months,"M").isAfter(b)&&--c.months,c.milliseconds=+b-+a.clone().add(c.months,"M"),c}function ab(a,b){var c;return a.isValid()&&b.isValid()?(b=Ma(b,a),a.isBefore(b)?c=_a(a,b):(c=_a(b,a),c.milliseconds=-c.milliseconds,c.months=-c.months),c):{milliseconds:0,months:0}}function bb(a,b){return function(c,d){var e,f;return null===d||isNaN(+d)||(ga(b,"moment()."+b+"(period, number) is deprecated. Please use moment()."+b+"(number, period)."),f=c,c=d,d=f),c="string"==typeof c?+c:c,e=Za(c,d),cb(this,e,a),this}}function cb(b,c,d,e){var f=c._milliseconds,g=c._days,h=c._months;b.isValid()&&(e=null==e||e,f&&b._d.setTime(+b._d+f*d),g&&G(b,"Date",F(b,"Date")+g*d),h&&Z(b,F(b,"Month")+h*d),e&&a.updateOffset(b,g||h))}function db(a,b){var c=a||Ea(),d=Ma(c,this).startOf("day"),e=this.diff(d,"days",!0),f=-6>e?"sameElse":-1>e?"lastWeek":0>e?"lastDay":1>e?"sameDay":2>e?"nextDay":7>e?"nextWeek":"sameElse",g=b&&(D(b[f])?b[f]():b[f]);return this.format(g||this.localeData().calendar(f,this,Ea(c)))}function eb(){return new o(this)}function fb(a,b){var c=p(a)?a:Ea(a);return!(!this.isValid()||!c.isValid())&&(b=B(m(b)?"millisecond":b),"millisecond"===b?+this>+c:+c<+this.clone().startOf(b))}function gb(a,b){var c=p(a)?a:Ea(a);return!(!this.isValid()||!c.isValid())&&(b=B(m(b)?"millisecond":b),"millisecond"===b?+c>+this:+this.clone().endOf(b)<+c)}function hb(a,b,c){return this.isAfter(a,c)&&this.isBefore(b,c)}function ib(a,b){var c,d=p(a)?a:Ea(a);return!(!this.isValid()||!d.isValid())&&(b=B(b||"millisecond"),"millisecond"===b?+this==+d:(c=+d,+this.clone().startOf(b)<=c&&c<=+this.clone().endOf(b)))}function jb(a,b){return this.isSame(a,b)||this.isAfter(a,b)}function kb(a,b){return this.isSame(a,b)||this.isBefore(a,b)}function lb(a,b,c){var d,e,f,g;return this.isValid()?(d=Ma(a,this),d.isValid()?(e=6e4*(d.utcOffset()-this.utcOffset()),b=B(b), "year"===b||"month"===b||"quarter"===b?(g=mb(this,d),"quarter"===b?g/=3:"year"===b&&(g/=12)):(f=this-d,g="second"===b?f/1e3:"minute"===b?f/6e4:"hour"===b?f/36e5:"day"===b?(f-e)/864e5:"week"===b?(f-e)/6048e5:f),c?g:q(g)):NaN):NaN}function mb(a,b){var c,d,e=12*(b.year()-a.year())+(b.month()-a.month()),f=a.clone().add(e,"months");return 0>b-f?(c=a.clone().add(e-1,"months"),d=(b-f)/(f-c)):(c=a.clone().add(e+1,"months"),d=(b-f)/(c-f)),-(e+d)}function nb(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function ob(){var a=this.clone().utc();return 0f&&(b=f),Ob.call(this,a,b,c,d,e))}function Ob(a,b,c,d,e){var f=pa(a,b,c,d,e),g=ka(f.year,0,f.dayOfYear);return this.year(g.getUTCFullYear()),this.month(g.getUTCMonth()),this.date(g.getUTCDate()),this}function Pb(a){return null==a?Math.ceil((this.month()+1)/3):this.month(3*(a-1)+this.month()%3)}function Qb(a){return qa(a,this._week.dow,this._week.doy).week}function Rb(){return this._week.dow}function Sb(){return this._week.doy}function Tb(a){var b=this.localeData().week(this);return null==a?b:this.add(7*(a-b),"d")}function Ub(a){var b=qa(this,1,4).week;return null==a?b:this.add(7*(a-b),"d")}function Vb(a,b){return"string"!=typeof a?a:isNaN(a)?(a=b.weekdaysParse(a),"number"==typeof a?a:null):parseInt(a,10)}function Wb(a,b){return c(this._weekdays)?this._weekdays[a.day()]:this._weekdays[this._weekdays.isFormat.test(b)?"format":"standalone"][a.day()]}function Xb(a){return this._weekdaysShort[a.day()]}function Yb(a){return this._weekdaysMin[a.day()]}function Zb(a,b,c){var d,e,f;for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),d=0;7>d;d++){if(e=Ea([2e3,1]).day(d),c&&!this._fullWeekdaysParse[d]&&(this._fullWeekdaysParse[d]=new RegExp("^"+this.weekdays(e,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[d]=new RegExp("^"+this.weekdaysShort(e,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[d]=new RegExp("^"+this.weekdaysMin(e,"").replace(".",".?")+"$","i")),this._weekdaysParse[d]||(f="^"+this.weekdays(e,"")+"|^"+this.weekdaysShort(e,"")+"|^"+this.weekdaysMin(e,""),this._weekdaysParse[d]=new RegExp(f.replace(".",""),"i")),c&&"dddd"===b&&this._fullWeekdaysParse[d].test(a))return d;if(c&&"ddd"===b&&this._shortWeekdaysParse[d].test(a))return d;if(c&&"dd"===b&&this._minWeekdaysParse[d].test(a))return d;if(!c&&this._weekdaysParse[d].test(a))return d}}function $b(a){if(!this.isValid())return null!=a?this:NaN;var b=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=a?(a=Vb(a,this.localeData()),this.add(a-b,"d")):b}function _b(a){if(!this.isValid())return null!=a?this:NaN;var b=(this.day()+7-this.localeData()._week.dow)%7;return null==a?b:this.add(a-b,"d")}function ac(a){return this.isValid()?null==a?this.day()||7:this.day(this.day()%7?a:a-7):null!=a?this:NaN}function bc(a){var b=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==a?b:this.add(a-b,"d")}function cc(){return this.hours()%12||12}function dc(a,b){J(a,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),b)})}function ec(a,b){return b._meridiemParse}function fc(a){return"p"===(a+"").toLowerCase().charAt(0)}function gc(a,b,c){return a>11?c?"pm":"PM":c?"am":"AM"}function hc(a,b){b[Bd]=r(1e3*("0."+a))}function ic(){return this._isUTC?"UTC":""}function jc(){return this._isUTC?"Coordinated Universal Time":""}function kc(a){return Ea(1e3*a)}function lc(){return Ea.apply(null,arguments).parseZone()}function mc(a,b,c){var d=this._calendar[a];return D(d)?d.call(b,c):d}function nc(a){var b=this._longDateFormat[a],c=this._longDateFormat[a.toUpperCase()];return b||!c?b:(this._longDateFormat[a]=c.replace(/MMMM|MM|DD|dddd/g,function(a){return a.slice(1)}),this._longDateFormat[a])}function oc(){return this._invalidDate}function pc(a){return this._ordinal.replace("%d",a)}function qc(a){return a}function rc(a,b,c,d){var e=this._relativeTime[c];return D(e)?e(a,b,c,d):e.replace(/%d/i,a)}function sc(a,b){var c=this._relativeTime[a>0?"future":"past"];return D(c)?c(b):c.replace(/%s/i,b)}function tc(a){var b,c;for(c in a)b=a[c],D(b)?this[c]=b:this["_"+c]=b;this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)}function uc(a,b,c,d){var e=z(),f=h().set(d,b);return e[c](f,a)}function vc(a,b,c,d,e){if("number"==typeof a&&(b=a,a=void 0),a=a||"",null!=b)return uc(a,b,c,e);var f,g=[];for(f=0;d>f;f++)g[f]=uc(a,f,c,e);return g}function wc(a,b){return vc(a,b,"months",12,"month")}function xc(a,b){return vc(a,b,"monthsShort",12,"month")}function yc(a,b){return vc(a,b,"weekdays",7,"day")}function zc(a,b){return vc(a,b,"weekdaysShort",7,"day")}function Ac(a,b){return vc(a,b,"weekdaysMin",7,"day")}function Bc(){var a=this._data;return this._milliseconds=se(this._milliseconds),this._days=se(this._days),this._months=se(this._months),a.milliseconds=se(a.milliseconds),a.seconds=se(a.seconds),a.minutes=se(a.minutes),a.hours=se(a.hours),a.months=se(a.months),a.years=se(a.years),this}function Cc(a,b,c,d){var e=Za(b,c);return a._milliseconds+=d*e._milliseconds,a._days+=d*e._days,a._months+=d*e._months,a._bubble()}function Dc(a,b){return Cc(this,a,b,1)}function Ec(a,b){return Cc(this,a,b,-1)}function Fc(a){return 0>a?Math.floor(a):Math.ceil(a)}function Gc(){var a,b,c,d,e,f=this._milliseconds,g=this._days,h=this._months,i=this._data;return f>=0&&g>=0&&h>=0||0>=f&&0>=g&&0>=h||(f+=864e5*Fc(Ic(h)+g),g=0,h=0),i.milliseconds=f%1e3,a=q(f/1e3),i.seconds=a%60,b=q(a/60),i.minutes=b%60,c=q(b/60),i.hours=c%24,g+=q(c/24),e=q(Hc(g)),h+=e,g-=Fc(Ic(e)),d=q(h/12),h%=12,i.days=g,i.months=h,i.years=d,this}function Hc(a){return 4800*a/146097}function Ic(a){return 146097*a/4800}function Jc(a){var b,c,d=this._milliseconds;if("month"===(a=B(a))||"year"===a)return b=this._days+d/864e5,c=this._months+Hc(b),"month"===a?c:c/12;switch(b=this._days+Math.round(Ic(this._months)),a){case"week":return b/7+d/6048e5;case"day":return b+d/864e5;case"hour":return 24*b+d/36e5;case"minute":return 1440*b+d/6e4;case"second":return 86400*b+d/1e3;case"millisecond":return Math.floor(864e5*b)+d;default:throw new Error("Unknown unit "+a)}}function Kc(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*r(this._months/12)}function Lc(a){return function(){return this.as(a)}}function Mc(a){return a=B(a),this[a+"s"]()}function Nc(a){return function(){return this._data[a]}}function Oc(){return q(this.days()/7)}function Pc(a,b,c,d,e){return e.relativeTime(b||1,!!c,a,d)}function Qc(a,b,c){var d=Za(a).abs(),e=Ie(d.as("s")),f=Ie(d.as("m")),g=Ie(d.as("h")),h=Ie(d.as("d")),i=Ie(d.as("M")),j=Ie(d.as("y")),k=e=f&&["m"]||f=g&&["h"]||g=h&&["d"]||h=i&&["M"]||i=j&&["y"]||["yy",j];return k[2]=b,k[3]=+a>0,k[4]=c,Pc.apply(null,k)}function Rc(a,b){return void 0!==Je[a]&&(void 0===b?Je[a]:(Je[a]=b,!0))}function Sc(a){var b=this.localeData(),c=Qc(this,!a,b);return a&&(c=b.pastFuture(+this,c)),b.postformat(c)}function Tc(){var a,b,c,d=Ke(this._milliseconds)/1e3,e=Ke(this._days),f=Ke(this._months);a=q(d/60),b=q(a/60),d%=60,a%=60,c=q(f/12),f%=12;var g=c,h=f,i=e,j=b,k=a,l=d,m=this.asSeconds();return m?(0>m?"-":"")+"P"+(g?g+"Y":"")+(h?h+"M":"")+(i?i+"D":"")+(j||k||l?"T":"")+(j?j+"H":"")+(k?k+"M":"")+(l?l+"S":""):"P0D"}var Uc,Vc,Wc=a.momentProperties=[],Xc=!1,Yc={},Zc={},$c=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,_c=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,ad={},bd={},cd=/\d/,dd=/\d\d/,ed=/\d{3}/,fd=/\d{4}/,gd=/[+-]?\d{6}/,hd=/\d\d?/,id=/\d\d\d\d?/,jd=/\d\d\d\d\d\d?/,kd=/\d{1,3}/,ld=/\d{1,4}/,md=/[+-]?\d{1,6}/,nd=/\d+/,od=/[+-]?\d+/,pd=/Z|[+-]\d\d:?\d\d/gi,qd=/Z|[+-]\d\d(?::?\d\d)?/gi,rd=/[+-]?\d+(\.\d{1,3})?/,sd=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,td={},ud={},vd=0,wd=1,xd=2,yd=3,zd=4,Ad=5,Bd=6,Cd=7,Dd=8;J("M",["MM",2],"Mo",function(){return this.month()+1}),J("MMM",0,0,function(a){return this.localeData().monthsShort(this,a)}),J("MMMM",0,0,function(a){return this.localeData().months(this,a)}),A("month","M"),O("M",hd),O("MM",hd,dd),O("MMM",function(a,b){return b.monthsShortRegex(a)}),O("MMMM",function(a,b){return b.monthsRegex(a)}),S(["M","MM"],function(a,b){b[wd]=r(a)-1}),S(["MMM","MMMM"],function(a,b,c,d){var e=c._locale.monthsParse(a,d,c._strict);null!=e?b[wd]=e:j(c).invalidMonth=a});var Ed=/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/,Fd="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Gd="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Hd=sd,Id=sd,Jd={};a.suppressDeprecationWarnings=!1;var Kd=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,Ld=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,Md=/Z|[+-]\d\d(?::?\d\d)?/,Nd=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],Od=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Pd=/^\/?Date\((\-?\d+)/i;a.createFromInputFallback=fa("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(a){a._d=new Date(a._i+(a._useUTC?" UTC":""))}),J("Y",0,0,function(){var a=this.year();return 9999>=a?""+a:"+"+a}),J(0,["YY",2],0,function(){return this.year()%100}),J(0,["YYYY",4],0,"year"),J(0,["YYYYY",5],0,"year"),J(0,["YYYYYY",6,!0],0,"year"),A("year","y"),O("Y",od),O("YY",hd,dd),O("YYYY",ld,fd),O("YYYYY",md,gd),O("YYYYYY",md,gd),S(["YYYYY","YYYYYY"],vd),S("YYYY",function(b,c){c[vd]=2===b.length?a.parseTwoDigitYear(b):r(b)}),S("YY",function(b,c){c[vd]=a.parseTwoDigitYear(b)}),S("Y",function(a,b){b[vd]=parseInt(a,10)}),a.parseTwoDigitYear=function(a){return r(a)+(r(a)>68?1900:2e3)};var Qd=E("FullYear",!1);a.ISO_8601=function(){};var Rd=fa("moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(){var a=Ea.apply(null,arguments);return this.isValid()&&a.isValid()?this>a?this:a:l()}),Sd=fa("moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(){var a=Ea.apply(null,arguments);return this.isValid()&&a.isValid()?a>this?this:a:l()}),Td=function(){return Date.now?Date.now():+new Date};Ka("Z",":"),Ka("ZZ",""),O("Z",qd),O("ZZ",qd),S(["Z","ZZ"],function(a,b,c){c._useUTC=!0,c._tzm=La(qd,a)});var Ud=/([\+\-]|\d\d)/gi;a.updateOffset=function(){};var Vd=/^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?\d*)?$/,Wd=/^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/;Za.fn=Ia.prototype;var Xd=bb(1,"add"),Yd=bb(-1,"subtract");a.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";var Zd=fa("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(a){return void 0===a?this.localeData():this.locale(a)});J(0,["gg",2],0,function(){return this.weekYear()%100}),J(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Ib("gggg","weekYear"),Ib("ggggg","weekYear"),Ib("GGGG","isoWeekYear"),Ib("GGGGG","isoWeekYear"),A("weekYear","gg"),A("isoWeekYear","GG"),O("G",od),O("g",od),O("GG",hd,dd),O("gg",hd,dd),O("GGGG",ld,fd),O("gggg",ld,fd),O("GGGGG",md,gd),O("ggggg",md,gd),T(["gggg","ggggg","GGGG","GGGGG"],function(a,b,c,d){b[d.substr(0,2)]=r(a)}),T(["gg","GG"],function(b,c,d,e){c[e]=a.parseTwoDigitYear(b)}),J("Q",0,"Qo","quarter"),A("quarter","Q"),O("Q",cd),S("Q",function(a,b){b[wd]=3*(r(a)-1)}),J("w",["ww",2],"wo","week"),J("W",["WW",2],"Wo","isoWeek"),A("week","w"),A("isoWeek","W"),O("w",hd),O("ww",hd,dd),O("W",hd),O("WW",hd,dd),T(["w","ww","W","WW"],function(a,b,c,d){b[d.substr(0,1)]=r(a)});var $d={dow:0,doy:6};J("D",["DD",2],"Do","date"),A("date","D"),O("D",hd),O("DD",hd,dd),O("Do",function(a,b){return a?b._ordinalParse:b._ordinalParseLenient}),S(["D","DD"],xd),S("Do",function(a,b){b[xd]=r(a.match(hd)[0],10)});var _d=E("Date",!0);J("d",0,"do","day"),J("dd",0,0,function(a){return this.localeData().weekdaysMin(this,a)}),J("ddd",0,0,function(a){return this.localeData().weekdaysShort(this,a)}),J("dddd",0,0,function(a){return this.localeData().weekdays(this,a)}),J("e",0,0,"weekday"),J("E",0,0,"isoWeekday"),A("day","d"),A("weekday","e"),A("isoWeekday","E"),O("d",hd),O("e",hd),O("E",hd),O("dd",sd),O("ddd",sd),O("dddd",sd),T(["dd","ddd","dddd"],function(a,b,c,d){var e=c._locale.weekdaysParse(a,d,c._strict);null!=e?b.d=e:j(c).invalidWeekday=a}),T(["d","e","E"],function(a,b,c,d){b[d]=r(a)});var ae="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),be="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),ce="Su_Mo_Tu_We_Th_Fr_Sa".split("_");J("DDD",["DDDD",3],"DDDo","dayOfYear"),A("dayOfYear","DDD"),O("DDD",kd),O("DDDD",ed),S(["DDD","DDDD"],function(a,b,c){c._dayOfYear=r(a)}),J("H",["HH",2],0,"hour"),J("h",["hh",2],0,cc),J("hmm",0,0,function(){return""+cc.apply(this)+I(this.minutes(),2)}),J("hmmss",0,0,function(){return""+cc.apply(this)+I(this.minutes(),2)+I(this.seconds(),2)}),J("Hmm",0,0,function(){return""+this.hours()+I(this.minutes(),2)}),J("Hmmss",0,0,function(){return""+this.hours()+I(this.minutes(),2)+I(this.seconds(),2)}),dc("a",!0),dc("A",!1),A("hour","h"),O("a",ec),O("A",ec),O("H",hd),O("h",hd),O("HH",hd,dd),O("hh",hd,dd),O("hmm",id),O("hmmss",jd),O("Hmm",id),O("Hmmss",jd),S(["H","HH"],yd),S(["a","A"],function(a,b,c){c._isPm=c._locale.isPM(a),c._meridiem=a}),S(["h","hh"],function(a,b,c){b[yd]=r(a),j(c).bigHour=!0}),S("hmm",function(a,b,c){var d=a.length-2;b[yd]=r(a.substr(0,d)),b[zd]=r(a.substr(d)),j(c).bigHour=!0}),S("hmmss",function(a,b,c){var d=a.length-4,e=a.length-2;b[yd]=r(a.substr(0,d)),b[zd]=r(a.substr(d,2)),b[Ad]=r(a.substr(e)),j(c).bigHour=!0}),S("Hmm",function(a,b,c){var d=a.length-2;b[yd]=r(a.substr(0,d)),b[zd]=r(a.substr(d))}),S("Hmmss",function(a,b,c){var d=a.length-4,e=a.length-2;b[yd]=r(a.substr(0,d)),b[zd]=r(a.substr(d,2)),b[Ad]=r(a.substr(e))});var de=/[ap]\.?m?\.?/i,ee=E("Hours",!0);J("m",["mm",2],0,"minute"),A("minute","m"),O("m",hd),O("mm",hd,dd),S(["m","mm"],zd);var fe=E("Minutes",!1);J("s",["ss",2],0,"second"),A("second","s"),O("s",hd),O("ss",hd,dd),S(["s","ss"],Ad);var ge=E("Seconds",!1);J("S",0,0,function(){return~~(this.millisecond()/100)}),J(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),J(0,["SSS",3],0,"millisecond"),J(0,["SSSS",4],0,function(){return 10*this.millisecond()}),J(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),J(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),J(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),J(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),J(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),A("millisecond","ms"),O("S",kd,cd),O("SS",kd,dd),O("SSS",kd,ed);var he;for(he="SSSS";he.length<=9;he+="S")O(he,nd);for(he="S";he.length<=9;he+="S")S(he,hc);var ie=E("Milliseconds",!1);J("z",0,0,"zoneAbbr"),J("zz",0,0,"zoneName");var je=o.prototype;je.add=Xd,je.calendar=db,je.clone=eb,je.diff=lb,je.endOf=xb,je.format=pb,je.from=qb,je.fromNow=rb,je.to=sb,je.toNow=tb,je.get=H,je.invalidAt=Gb,je.isAfter=fb,je.isBefore=gb,je.isBetween=hb,je.isSame=ib,je.isSameOrAfter=jb,je.isSameOrBefore=kb,je.isValid=Eb,je.lang=Zd,je.locale=ub,je.localeData=vb,je.max=Sd,je.min=Rd,je.parsingFlags=Fb,je.set=H,je.startOf=wb,je.subtract=Yd,je.toArray=Bb,je.toObject=Cb,je.toDate=Ab,je.toISOString=ob,je.toJSON=Db,je.toString=nb,je.unix=zb,je.valueOf=yb,je.creationData=Hb,je.year=Qd,je.isLeapYear=na,je.weekYear=Jb,je.isoWeekYear=Kb,je.quarter=je.quarters=Pb,je.month=$,je.daysInMonth=_,je.week=je.weeks=Tb,je.isoWeek=je.isoWeeks=Ub,je.weeksInYear=Mb,je.isoWeeksInYear=Lb,je.date=_d,je.day=je.days=$b,je.weekday=_b,je.isoWeekday=ac,je.dayOfYear=bc,je.hour=je.hours=ee,je.minute=je.minutes=fe,je.second=je.seconds=ge,je.millisecond=je.milliseconds=ie,je.utcOffset=Oa,je.utc=Qa,je.local=Ra,je.parseZone=Sa,je.hasAlignedHourOffset=Ta,je.isDST=Ua,je.isDSTShifted=Va,je.isLocal=Wa,je.isUtcOffset=Xa,je.isUtc=Ya,je.isUTC=Ya,je.zoneAbbr=ic,je.zoneName=jc,je.dates=fa("dates accessor is deprecated. Use date instead.",_d),je.months=fa("months accessor is deprecated. Use month instead",$),je.years=fa("years accessor is deprecated. Use year instead",Qd),je.zone=fa("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",Pa);var ke=je,le={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},me={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},pe=/\d{1,2}/,qe={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},re=t.prototype;re._calendar=le,re.calendar=mc,re._longDateFormat=me,re.longDateFormat=nc,re._invalidDate="Invalid date",re.invalidDate=oc,re._ordinal="%d",re.ordinal=pc,re._ordinalParse=pe,re.preparse=qc,re.postformat=qc,re._relativeTime=qe,re.relativeTime=rc,re.pastFuture=sc,re.set=tc,re.months=W,re._months=Fd,re.monthsShort=X,re._monthsShort=Gd,re.monthsParse=Y,re._monthsRegex=Id,re.monthsRegex=ba,re._monthsShortRegex=Hd,re.monthsShortRegex=aa,re.week=Qb,re._week=$d,re.firstDayOfYear=Sb,re.firstDayOfWeek=Rb,re.weekdays=Wb,re._weekdays=ae,re.weekdaysMin=Yb,re._weekdaysMin=ce,re.weekdaysShort=Xb,re._weekdaysShort=be,re.weekdaysParse=Zb,re.isPM=fc,re._meridiemParse=de,re.meridiem=gc,x("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(a){var b=a%10;return a+(1===r(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th")}}),a.lang=fa("moment.lang is deprecated. Use moment.locale instead.",x),a.langData=fa("moment.langData is deprecated. Use moment.localeData instead.",z);var se=Math.abs,te=Lc("ms"),ue=Lc("s"),ve=Lc("m"),we=Lc("h"),xe=Lc("d"),ye=Lc("w"),ze=Lc("M"),Ae=Lc("y"),Be=Nc("milliseconds"),Ce=Nc("seconds"),De=Nc("minutes"),Ee=Nc("hours"),Fe=Nc("days"),Ge=Nc("months"),He=Nc("years"),Ie=Math.round,Je={s:45,m:45,h:22,d:26,M:11},Ke=Math.abs,Le=Ia.prototype;return Le.abs=Bc,Le.add=Dc,Le.subtract=Ec,Le.as=Jc,Le.asMilliseconds=te,Le.asSeconds=ue,Le.asMinutes=ve,Le.asHours=we,Le.asDays=xe,Le.asWeeks=ye,Le.asMonths=ze,Le.asYears=Ae,Le.valueOf=Kc,Le._bubble=Gc,Le.get=Mc,Le.milliseconds=Be,Le.seconds=Ce,Le.minutes=De,Le.hours=Ee,Le.days=Fe,Le.weeks=Oc,Le.months=Ge,Le.years=He,Le.humanize=Sc,Le.toISOString=Tc,Le.toString=Tc,Le.toJSON=Tc,Le.locale=ub,Le.localeData=vb,Le.toIsoString=fa("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Tc),Le.lang=Zd,J("X",0,0,"unix"),J("x",0,0,"valueOf"),O("x",od),O("X",rd),S("X",function(a,b,c){c._d=new Date(1e3*parseFloat(a,10))}),S("x",function(a,b,c){c._d=new Date(r(a))}),a.version="2.11.2",function(a){Uc=a}(Ea),a.fn=ke,a.min=Ga,a.max=Ha,a.now=Td,a.utc=h,a.unix=kc,a.months=wc,a.isDate=d,a.locale=x,a.invalid=l,a.duration=Za,a.isMoment=p,a.weekdays=yc,a.parseZone=lc,a.localeData=z,a.isDuration=Ja,a.monthsShort=xc,a.weekdaysMin=Ac,a.defineLocale=y,a.weekdaysShort=zc,a.normalizeUnits=B,a.relativeTimeThreshold=Rc,a.prototype=ke,a}),function(){"use strict";function DatePickerCtrl($scope,$mdDialog,$mdMedia,$timeout,currentDate,options){var self=this;this.date=moment(currentDate),this.minDate=options.minDate&&moment(options.minDate).isValid()?moment(options.minDate):null,this.maxDate=options.maxDate&&moment(options.maxDate).isValid()?moment(options.maxDate):null,this.displayFormat=options.displayFormat||"ddd, MMM DD",this.dateFilter=angular.isFunction(options.dateFilter)?options.dateFilter:null,this.selectingYear=!1,this.minDate&&this.maxDate&&this.maxDate.isBefore(this.minDate)&&(this.maxDate=moment(this.minDate).add(1,"days")),this.date&&(this.minDate&&this.date.isBefore(this.minDate)&&(this.date=moment(this.minDate)),this.maxDate&&this.date.isAfter(this.maxDate)&&(this.date=moment(this.maxDate))),this.yearItems={currentIndex_:0,PAGE_SIZE:5,START:self.minDate?self.minDate.year():1900,END:self.maxDate?self.maxDate.year():0,getItemAtIndex:function(index){return this.currentIndex_firstDay&&(day={value:i-firstDay,enabled:self.isDayEnabled(moment(self.date).date(i-firstDay).toDate())}),arr.push(day)}return arr},this.isDayEnabled=function(day){return!(this.minDate&&!(this.minDate<=day)||this.maxDate&&!(this.maxDate>=day)||self.dateFilter&&self.dateFilter(day))},this.selectDate=function(dom){self.date.date(dom)},this.nextMonth=function(){self.date.add(1,"months")},this.prevMonth=function(){self.date.subtract(1,"months")},this.updateDaysInMonth=function(){self.daysInMonth=self.getDaysInMonth()},$scope.$watch(function(){return self.date.unix()},function(newValue,oldValue){newValue&&newValue!==oldValue&&self.updateDaysInMonth()}),self.updateDaysInMonth()}function formatValidator(value,format){return!value||angular.isDate(value)||moment(value,format,!0).isValid()}function minDateValidator(value,format,minDate){var minDate=moment(minDate,"YYYY-MM-DD",!0),date=angular.isDate(value)?moment(value):moment(value,format,!0);return!value||angular.isDate(value)||!minDate.isValid()||date.isSameOrAfter(minDate)}function maxDateValidator(value,format,maxDate){var maxDate=moment(maxDate,"YYYY-MM-DD",!0),date=angular.isDate(value)?moment(value):moment(value,format,!0);return!value||angular.isDate(value)||!maxDate.isValid()||date.isSameOrBefore(maxDate)}function filterValidator(value,format,filter){var date=angular.isDate(value)?moment(value):moment(value,format,!0);return!value||angular.isDate(value)||!angular.isFunction(filter)||!filter(date)}function TimePickerCtrl($scope,$mdDialog,time,autoSwitch,$mdMedia){var self=this;this.VIEW_HOURS=1,this.VIEW_MINUTES=2,this.currentView=this.VIEW_HOURS,this.time=moment(time),this.autoSwitch=!!autoSwitch,this.clockHours=parseInt(this.time.format("h")),this.clockMinutes=parseInt(this.time.minutes()),$scope.$mdMedia=$mdMedia,this.switchView=function(){self.currentView=self.currentView==self.VIEW_HOURS?self.VIEW_MINUTES:self.VIEW_HOURS},this.setAM=function(){self.time.hours()>=12&&self.time.hour(self.time.hour()-12)},this.setPM=function(){self.time.hours()<12&&self.time.hour(self.time.hour()+12)},this.cancel=function(){$mdDialog.cancel()},this.confirm=function(){$mdDialog.hide(this.time.toDate())}}function ClockCtrl($scope){var self=this;this.STEP_DEG=30,this.steps=[],this.CLOCK_TYPES={hours:{range:12},minutes:{range:60}},this.getPointerStyle=function(){var divider=1;switch(self.type){case"hours":divider=12;break;case"minutes":divider=60}var degrees=Math.round(self.selected*(360/divider))-180;return{"-webkit-transform":"rotate("+degrees+"deg)","-ms-transform":"rotate("+degrees+"deg)",transform:"rotate("+degrees+"deg)"}},this.setTimeByDeg=function(deg){deg=deg>=360?0:deg;var divider=0;switch(self.type){case"hours":divider=12;break;case"minutes":divider=60}self.setTime(Math.round(divider/360*deg))},this.setTime=function(time,type){switch(this.selected=time,self.type){case"hours":"PM"==self.time.format("A")&&(time+=12),this.time.hours(time);break;case"minutes":time>59&&(time-=60),this.time.minutes(time)}},this.init=function(){switch(self.type=self.type||"hours",self.type){case"hours":for(var i=1;i<=12;i++)self.steps.push(i);self.selected=self.time.hours()||0,self.selected>12&&(self.selected-=12);break;case"minutes":for(var i=5;i<=55;i+=5)self.steps.push(i);self.steps.push(0),self.selected=self.time.minutes()||0}},this.init()}var module=angular.module("mdPickers",["ngMaterial","ngAnimate","ngAria"]);module.config(["$mdIconProvider","mdpIconsRegistry",function($mdIconProvider,mdpIconsRegistry){angular.forEach(mdpIconsRegistry,function(icon,index){$mdIconProvider.icon(icon.id,icon.url)})}]),module.run(["$templateCache","mdpIconsRegistry",function($templateCache,mdpIconsRegistry){angular.forEach(mdpIconsRegistry,function(icon,index){$templateCache.put(icon.url,icon.svg)})}]),module.constant("mdpIconsRegistry",[{id:"mdp-chevron-left",url:"mdp-chevron-left.svg",svg:''},{id:"mdp-chevron-right",url:"mdp-chevron-right.svg",svg:''},{id:"mdp-access-time",url:"mdp-access-time.svg",svg:''},{id:"mdp-event",url:"mdp-event.svg",svg:''}]),module.directive("ngMessage",["$mdUtil",function($mdUtil){return{restrict:"EA",priority:101,compile:function(element){if($mdUtil.getClosest(element,"mdp-time-picker",!0)||$mdUtil.getClosest(element,"mdp-date-picker",!0))return element.toggleClass("md-input-message-animation",!0),{}}}}]),module.provider("$mdpDatePicker",function(){var LABEL_OK="OK",LABEL_CANCEL="Cancel",DISPLAY_FORMAT="ddd, MMM DD";this.setDisplayFormat=function(format){DISPLAY_FORMAT=format},this.setOKButtonLabel=function(label){LABEL_OK=label},this.setCancelButtonLabel=function(label){LABEL_CANCEL=label},this.$get=["$mdDialog",function($mdDialog){return function(currentDate,options){return angular.isDate(currentDate)||(currentDate=Date.now()),angular.isObject(options)||(options={}),options.displayFormat=DISPLAY_FORMAT,$mdDialog.show({controller:["$scope","$mdDialog","$mdMedia","$timeout","currentDate","options",DatePickerCtrl],controllerAs:"datepicker",clickOutsideToClose:!0, template:'
'+(options.dateLabel?''+options.dateLabel+"":"")+'{{ datepicker.date.format(datepicker.displayFormat) }}
{{ item }}
'+LABEL_CANCEL+''+LABEL_OK+"
",targetEvent:options.targetEvent,locals:{currentDate:currentDate,options:options},skipHide:!0})}}]}),module.directive("mdpCalendar",["$animate",function($animate){return{restrict:"E",bindToController:{date:"=",minDate:"=",maxDate:"=",dateFilter:"="},template:'
{{ calendar.date.format("MMMM YYYY") }}
{{ d }}
{{ day.value }}
',controller:["$scope",CalendarCtrl],controllerAs:"calendar",link:function(scope,element,attrs,ctrl){var animElements=[element[0].querySelector(".mdp-calendar-week-days"),element[0].querySelector(".mdp-calendar-days"),element[0].querySelector(".mdp-calendar-monthyear")].map(function(a){return angular.element(a)});scope.$watch(function(){return ctrl.date.format("YYYYMM")},function(newValue,oldValue){var direction=null;if(newValue>oldValue?direction="mdp-animate-next":newValue
"},scope:{minDate:"=mdpMinDate",maxDate:"=mdpMaxDate",dateFilter:"=mdpDateFilter",dateFormat:"@mdpFormat",placeholder:"@mdpPlaceholder",noFloat:"=mdpNoFloat",openOnClick:"=mdpOpenOnClick",disabled:"=?mdpDisabled"},link:{pre:function(scope,element,attrs,ngModel,$transclude){},post:function(scope,element,attrs,ngModel,$transclude){function updateInputElement(value){inputElement[0].value=value,inputContainerCtrl.setHasValue(!ngModel.$isEmpty(value))}function updateDate(date){var value=moment(date,angular.isDate(date)?null:scope.dateFormat,!0),strValue=value.format(scope.dateFormat);value.isValid()?(updateInputElement(strValue),ngModel.$setViewValue(strValue)):(updateInputElement(date),ngModel.$setViewValue(date)),!ngModel.$pristine&&messages.hasClass("md-auto-hide")&&inputContainer.hasClass("md-input-invalid")&&messages.removeClass("md-auto-hide"),ngModel.$render()}function onInputElementEvents(event){event.target.value!==ngModel.$viewVaue&&updateDate(event.target.value)}var inputElement=angular.element(element[0].querySelector("input")),inputContainer=angular.element(element[0].querySelector("md-input-container")),inputContainerCtrl=inputContainer.controller("mdInputContainer");$transclude(function(clone){inputContainer.append(clone)});var messages=angular.element(inputContainer[0].querySelector("[ng-messages]"));scope.type=scope.dateFormat?"text":"date",scope.dateFormat=scope.dateFormat||"YYYY-MM-DD",scope.model=ngModel,scope.isError=function(){return!ngModel.$pristine&&!!ngModel.$invalid},ngModel.$formatters.unshift(function(value){var date=angular.isDate(value)&&moment(value);updateInputElement(date&&date.isValid()?date.format(scope.dateFormat):null)}),ngModel.$validators.format=function(modelValue,viewValue){return formatValidator(viewValue,scope.dateFormat)},ngModel.$validators.minDate=function(modelValue,viewValue){return minDateValidator(viewValue,scope.dateFormat,scope.minDate)},ngModel.$validators.maxDate=function(modelValue,viewValue){return maxDateValidator(viewValue,scope.dateFormat,scope.maxDate)},ngModel.$validators.filter=function(modelValue,viewValue){return filterValidator(viewValue,scope.dateFormat,scope.dateFilter)},ngModel.$validators.required=function(modelValue,viewValue){return angular.isUndefined(attrs.required)||!ngModel.$isEmpty(modelValue)||!ngModel.$isEmpty(viewValue)},ngModel.$parsers.unshift(function(value){var parsed=moment(value,scope.dateFormat,!0);if(parsed.isValid()){if(angular.isDate(ngModel.$modelValue)){var originalModel=moment(ngModel.$modelValue);originalModel.year(parsed.year()),originalModel.month(parsed.month()),originalModel.date(parsed.date()),parsed=originalModel}return parsed.toDate()}return null}),scope.showPicker=function(ev){$mdpDatePicker(ngModel.$modelValue,{minDate:scope.minDate,maxDate:scope.maxDate,dateFilter:scope.dateFilter,targetEvent:ev}).then(updateDate)},inputElement.on("reset input blur",onInputElementEvents),scope.$on("$destroy",function(){inputElement.off("reset input blur",onInputElementEvents)})}}}}]),module.directive("mdpDatePicker",["$mdpDatePicker","$timeout",function($mdpDatePicker,$timeout){return{restrict:"A",require:"ngModel",scope:{minDate:"@min",maxDate:"@max",dateFilter:"=mdpDateFilter",dateFormat:"@mdpFormat"},link:function(scope,element,attrs,ngModel,$transclude){function showPicker(ev){$mdpDatePicker(ngModel.$modelValue,{minDate:scope.minDate,maxDate:scope.maxDate,dateFilter:scope.dateFilter,targetEvent:ev}).then(function(time){ngModel.$setViewValue(moment(time).format(scope.format)),ngModel.$render()})}scope.dateFormat=scope.dateFormat||"YYYY-MM-DD",ngModel.$validators.format=function(modelValue,viewValue){return formatValidator(viewValue,scope.format)},ngModel.$validators.minDate=function(modelValue,viewValue){return minDateValidator(viewValue,scope.format,scope.minDate)},ngModel.$validators.maxDate=function(modelValue,viewValue){return maxDateValidator(viewValue,scope.format,scope.maxDate)},ngModel.$validators.filter=function(modelValue,viewValue){return filterValidator(viewValue,scope.format,scope.dateFilter)},element.on("click",showPicker),scope.$on("$destroy",function(){element.off("click",showPicker)})}}}]),module.directive("mdpClock",["$animate","$timeout",function($animate,$timeout){return{restrict:"E",bindToController:{type:"@?",time:"=",autoSwitch:"=?"},replace:!0,template:'
{{ step }}
',controller:["$scope",ClockCtrl],controllerAs:"clock",link:function(scope,element,attrs,ctrl){var timepickerCtrl=(angular.element(element[0].querySelector(".mdp-pointer")),scope.$parent.timepicker),onEvent=function(event){var containerCoords=event.currentTarget.getClientRects()[0],x=event.currentTarget.offsetWidth/2-(event.pageX-containerCoords.left),y=event.pageY-containerCoords.top-event.currentTarget.offsetHeight/2,deg=Math.round(Math.atan2(x,y)*(180/Math.PI));$timeout(function(){ctrl.setTimeByDeg(deg+180),ctrl.autoSwitch&&-1!==["mouseup","click"].indexOf(event.type)&&timepickerCtrl&&timepickerCtrl.switchView()})};element.on("mousedown",function(){element.on("mousemove",onEvent)}),element.on("mouseup",function(e){element.off("mousemove")}),element.on("click",onEvent),scope.$on("$destroy",function(){element.off("click",onEvent),element.off("mousemove",onEvent)})}}}]),module.provider("$mdpTimePicker",function(){var LABEL_OK="OK",LABEL_CANCEL="Cancel";this.setOKButtonLabel=function(label){LABEL_OK=label},this.setCancelButtonLabel=function(label){LABEL_CANCEL=label},this.$get=["$mdDialog",function($mdDialog){return function(time,options){return angular.isDate(time)||(time=Date.now()),angular.isObject(options)||(options={}),$mdDialog.show({controller:["$scope","$mdDialog","time","autoSwitch","$mdMedia",TimePickerCtrl],controllerAs:"timepicker",clickOutsideToClose:!0,template:'
{{ timepicker.time.format("h") }}:{{ timepicker.time.format("mm") }}
AMPM
'+LABEL_CANCEL+''+LABEL_OK+"
",targetEvent:options.targetEvent,locals:{time:time,autoSwitch:options.autoSwitch},skipHide:!0})}}]}),module.directive("mdpTimePicker",["$mdpTimePicker","$timeout",function($mdpTimePicker,$timeout){return{restrict:"E",require:"ngModel",transclude:!0,template:function(element,attrs){var noFloat=angular.isDefined(attrs.mdpNoFloat),placeholder=angular.isDefined(attrs.mdpPlaceholder)?attrs.mdpPlaceholder:"",openOnClick=!!angular.isDefined(attrs.mdpOpenOnClick);return'
"},scope:{timeFormat:"@mdpFormat",placeholder:"@mdpPlaceholder",autoSwitch:"=?mdpAutoSwitch",disabled:"=?mdpDisabled"},link:function(scope,element,attrs,ngModel,$transclude){function updateInputElement(value){inputElement[0].value=value,inputContainerCtrl.setHasValue(!ngModel.$isEmpty(value))}function updateTime(time){var value=moment(time,angular.isDate(time)?null:scope.timeFormat,!0),strValue=value.format(scope.timeFormat);value.isValid()?(updateInputElement(strValue),ngModel.$setViewValue(strValue)):(updateInputElement(time),ngModel.$setViewValue(time)),!ngModel.$pristine&&messages.hasClass("md-auto-hide")&&inputContainer.hasClass("md-input-invalid")&&messages.removeClass("md-auto-hide"),ngModel.$render()}function onInputElementEvents(event){event.target.value!==ngModel.$viewVaue&&updateTime(event.target.value)}var inputElement=angular.element(element[0].querySelector("input")),inputContainer=angular.element(element[0].querySelector("md-input-container")),inputContainerCtrl=inputContainer.controller("mdInputContainer");$transclude(function(clone){inputContainer.append(clone)});var messages=angular.element(inputContainer[0].querySelector("[ng-messages]"));scope.type=scope.timeFormat?"text":"time",scope.timeFormat=scope.timeFormat||"HH:mm",scope.autoSwitch=scope.autoSwitch||!1,scope.$watch(function(){return ngModel.$error},function(newValue,oldValue){inputContainerCtrl.setInvalid(!ngModel.$pristine&&!!Object.keys(ngModel.$error).length)},!0),ngModel.$formatters.unshift(function(value){var time=angular.isDate(value)&&moment(value);updateInputElement(time&&time.isValid()?time.format(scope.timeFormat):null)}),ngModel.$validators.format=function(modelValue,viewValue){return!viewValue||angular.isDate(viewValue)||moment(viewValue,scope.timeFormat,!0).isValid()},ngModel.$validators.required=function(modelValue,viewValue){return angular.isUndefined(attrs.required)||!ngModel.$isEmpty(modelValue)||!ngModel.$isEmpty(viewValue)},ngModel.$parsers.unshift(function(value){var parsed=moment(value,scope.timeFormat,!0);if(parsed.isValid()){if(angular.isDate(ngModel.$modelValue)){var originalModel=moment(ngModel.$modelValue);originalModel.minutes(parsed.minutes()),originalModel.hours(parsed.hours()),originalModel.seconds(parsed.seconds()),parsed=originalModel}return parsed.toDate()}return null}),scope.showPicker=function(ev){$mdpTimePicker(ngModel.$modelValue,{targetEvent:ev,autoSwitch:scope.autoSwitch}).then(function(time){updateTime(time,!0)})},inputElement.on("reset input blur",onInputElementEvents),scope.$on("$destroy",function(){inputElement.off("reset input blur",onInputElementEvents)})}}}]),module.directive("mdpTimePicker",["$mdpTimePicker","$timeout",function($mdpTimePicker,$timeout){return{restrict:"A",require:"ngModel",scope:{timeFormat:"@mdpFormat",autoSwitch:"=?mdpAutoSwitch"},link:function(scope,element,attrs,ngModel,$transclude){function showPicker(ev){$mdpTimePicker(ngModel.$modelValue,{targetEvent:ev,autoSwitch:scope.autoSwitch}).then(function(time){ngModel.$setViewValue(moment(time).format(scope.format)),ngModel.$render()})}scope.format=scope.format||"HH:mm",element.on("click",showPicker),scope.$on("$destroy",function(){element.off("click",showPicker)})}}}])}(),function(window,angular){function mdDateRangePickerDirective($mdDateRangePicker){return{scope:{selectedTemplate:"=",selectedTemplateName:"=",dateStart:"=?",dateEnd:"=?",firstDayOfWeek:"=?",showTemplate:"=?",mdOnSelect:"&",localizationMap:"=?",customTemplates:"=?",disableTemplates:"@",maxRange:"=?",minRange:"=?",onePanel:"=?",isDisabledDate:"&?",format:"=?",clickOutsideToClose:"=?"},template:'
{{::day.name}}
{{::day.name}}
',controller:"mdDateRangePickerCtrl",link:function(scope,element,attributes,ctrl){function handleClickOutside(event){element[0].contains(event.target)||scope.$apply(function(){scope.clickOutsideToClose=!1})}document.body.addEventListener("click",handleClickOutside,!0),scope.actionByKey=function(eventKey,eventParam,e){switch(eventKey){case"prev":scope.handleClickPrevMonth(e),scope.runIfNotInDigest();break;case"next":scope.handleClickNextMonth(e),scope.runIfNotInDigest();break;case"date1":scope.handleClickDate(e,scope.dates[eventParam])?scope.runIfNotInDigest(scope.triggerChange):scope.runIfNotInDigest();break;case"date2":scope.handleClickDate(e,scope.dates2[eventParam])?scope.runIfNotInDigest(scope.triggerChange):scope.runIfNotInDigest();break;case"TD":scope.handleClickSelectToday(),scope.runIfNotInDigest(scope.triggerChange);break;case"YD":scope.handleClickSelectYesterday(),scope.runIfNotInDigest(scope.triggerChange);break;case"TW":scope.handleClickSelectThisWeek(),scope.runIfNotInDigest(scope.triggerChange);break;case"LW":scope.handleClickSelectLastWeek(),scope.runIfNotInDigest(scope.triggerChange);break;case"TM":scope.handleClickSelectThisMonth(),scope.runIfNotInDigest(scope.triggerChange);break;case"LM":scope.handleClickSelectLastMonth(),scope.runIfNotInDigest(scope.triggerChange);break;case"TY":scope.handleClickSelectThisYear(),scope.runIfNotInDigest(scope.triggerChange);break;case"LY":scope.handleClickSelectLastYear(),scope.runIfNotInDigest(scope.triggerChange)}},scope.runIfNotInDigest=function(operation){null==scope.$root||scope.$root.$$phase||(scope.$apply(),operation&&"function"==typeof operation&&operation())},element.on("click",function(e){var eventKey=e.target.getAttribute("event-key"),eventParam=e.target.getAttribute("event-param");scope.actionByKey(eventKey,eventParam,e)}),scope.triggerChange=function(e){var $dates=$mdDateRangePicker.getSelectedDate(scope.dateStart,scope.dateEnd,scope.isDisabledDate,scope.maxRange,scope.minRange);scope.mdOnSelect&&scope.mdOnSelect({$dates:$dates})}}}}function mdDateRangePickerCtrl($scope,$filter){function selectCustomRange(tmpltKey,tmpltObj){$scope.dateStart=tmpltObj.dateStart,$scope.dateEnd=tmpltObj.dateEnd,$scope.selectedTemplate=tmpltKey,$scope.selectedTemplateName=$scope.selectedDateText()}function getLocalizationVal(val){return null!=$scope.localizationMap&&null!=$scope.localizationMap[val]?$scope.localizationMap[val]:val}function getFirstDayOfWeek(){return-1!==[void 0,null,"",NaN].indexOf($scope.firstDayOfWeek)?START_OF_WEEK:$scope.firstDayOfWeek}function fillDateGrid(currentDate){var ctr,day,dates=[],monthEndDate=(new Date(currentDate.getFullYear(),currentDate.getMonth(),1),new Date(currentDate.getFullYear(),currentDate.getMonth()+1,0)),firstDay=getFirstDayOfWeek();for(ctr=1;ctr<=monthEndDate.getDate();ctr++)dates.push(new Date(currentDate.getFullYear(),currentDate.getMonth(),ctr));for(day=dates[0].getDay(),ctr=0;day!==firstDay;)dates.unshift(new Date(currentDate.getFullYear(),currentDate.getMonth(),ctr)),day=day<=0?6:day-1,ctr--;for(day=(dates[dates.length-1].getDay()+1)%7,ctr=1;day!==firstDay;)dates.push(new Date(currentDate.getFullYear(),currentDate.getMonth()+1,ctr)),day=(day+1)%7,ctr++;return dates}function getDateDiff(date1,date2){if(date1&&date2){var _d1=new Date(date1.getFullYear(),date1.getMonth(),date1.getDate());return new Date(date2.getFullYear(),date2.getMonth(),date2.getDate())-_d1}}function inCurrentMonth(date,isSecondMonth){return isSecondMonth?date.getMonth()===$scope.activeMonth2&&date.getFullYear()===$scope.activeYear2:date.getMonth()===$scope.activeMonth&&date.getFullYear()===$scope.activeYear}function isInMaxRange(date){if(!$scope.dateStart)return!0;if(0!==getDateDiff($scope.dateStart,$scope.dateEnd))return!0;var diff=getDateDiff($scope.dateStart,date);return $scope.maxRange&&Math.abs(Math.ceil(diff/864e5))+1<=$scope.maxRange||!$scope.maxRange}function isInMinRange(date){if(!$scope.dateStart)return!0;if(0!==getDateDiff($scope.dateStart,$scope.dateEnd))return!0;var diff=getDateDiff($scope.dateStart,date);return $scope.minRange&&Math.abs(Math.ceil(diff/864e5))+1!=$scope.minRange||!$scope.minRange}function handleClickDate($event,date){var changed=!1,shouldConfirm=!1;if(0===getDateDiff($scope.dateStart,$scope.dateEnd)){if(0===getDateDiff($scope.dateStart,date))shouldConfirm=!0,changed=!0;else if(!$scope.isDisabledDate||!$scope.isDisabledDate({$date:date})){var diff=getDateDiff($scope.dateStart,date);diff>0?($scope.maxRange&&Math.abs(Math.ceil(diff/864e5))+1<=$scope.maxRange||!$scope.maxRange)&&($scope.minRange&&Math.ceil(diff/864e5)+1!=$scope.minRange||!$scope.minRange)&&($scope.dateEnd=date,shouldConfirm=!0,changed=!0):($scope.maxRange&&Math.abs(Math.ceil(diff/864e5))+1<=$scope.maxRange||!$scope.maxRange)&&($scope.minRange&&Math.abs(Math.ceil(diff/864e5))+1!=$scope.minRange||!$scope.minRange)&&($scope.dateStart=date,shouldConfirm=!0,changed=!0)}}else $scope.isDisabledDate&&$scope.isDisabledDate({$date:date})||($scope.dateStart=date,$scope.dateEnd=date,changed=!0);return changed&&($scope.selectedTemplate=!1,$scope.selectedTemplateName=$scope.selectedDateText()),shouldConfirm}function inSelectedDateRange(date){return!(!$scope.dateStart||!$scope.dateEnd)&&(getDateDiff($scope.dateStart,date)>=0&&0<=getDateDiff(date,$scope.dateEnd))}function updateActiveDate(isSecondMonth){var d=new Date($scope.activeYear,$scope.activeMonth,1),d2=new Date($scope.activeYear2,$scope.activeMonth2,1);isSecondMonth?(d=new Date($scope.activeYear2,$scope.activeMonth2-1,1),$scope.activeYear=d.getFullYear(),$scope.activeMonth=d.getMonth()):(d2=new Date($scope.activeYear,$scope.activeMonth+1,1),$scope.activeYear2=d2.getFullYear(),$scope.activeMonth2=d2.getMonth()),$scope.focusToDate(d)}function handleClickNextMonth($event){var d=new Date($scope.activeDate.getFullYear(),$scope.activeDate.getMonth()+1,1);$scope.focusToDate(d)}function handleClickPrevMonth($event){var d=new Date($scope.activeDate.getFullYear(),$scope.activeDate.getMonth()-1,1);$scope.focusToDate(d)}function handleClickSelectToday(){var d=new Date,d1=new Date(d.getFullYear(),d.getMonth(),d.getDate());$scope.dateStart=d1,$scope.dateEnd=d1,$scope.selectedTemplate="TD",$scope.selectedTemplateName=$scope.selectedDateText()}function handleClickSelectYesterday(){var d=new Date,d1=new Date(d.getFullYear(),d.getMonth(),d.getDate()-1);$scope.dateStart=d1,$scope.dateEnd=d1,$scope.selectedTemplate="YD",$scope.selectedTemplateName=$scope.selectedDateText()}function handleClickSelectThisWeek(){var p=new Date,d=new Date(p.getFullYear(),p.getMonth(),p.getDate()),d1=new Date(d.getFullYear(),d.getMonth(),d.getDate()-(d.getDay()-getFirstDayOfWeek())),d2=new Date(d.getFullYear(),d.getMonth(),d.getDate()+(6-d.getDay()+getFirstDayOfWeek()));$scope.dateStart=d1,$scope.dateEnd=d2,$scope.selectedTemplate="TW",$scope.selectedTemplateName=$scope.selectedDateText()} function handleClickSelectLastWeek(){var p=new Date,d=new Date(p.getFullYear(),p.getMonth(),p.getDate()-7),d1=new Date(d.getFullYear(),d.getMonth(),d.getDate()-(d.getDay()-getFirstDayOfWeek())),d2=new Date(d.getFullYear(),d.getMonth(),d.getDate()+(6-d.getDay()+getFirstDayOfWeek()));$scope.dateStart=d1,$scope.dateEnd=d2,$scope.selectedTemplate="LW",$scope.selectedTemplateName=$scope.selectedDateText()}function handleClickSelectThisMonth(){var d=new Date,d1=new Date(d.getFullYear(),d.getMonth(),1),d2=new Date(d.getFullYear(),d.getMonth()+1,0);$scope.dateStart=d1,$scope.dateEnd=d2,$scope.selectedTemplate="TM",$scope.selectedTemplateName=$scope.selectedDateText()}function handleClickSelectLastMonth(){var p=new Date,d=new Date(p.getFullYear(),p.getMonth(),0),d1=new Date(d.getFullYear(),d.getMonth(),1),d2=new Date(d.getFullYear(),d.getMonth()+1,0);$scope.dateStart=d1,$scope.dateEnd=d2,$scope.selectedTemplate="LM",$scope.selectedTemplateName=$scope.selectedDateText()}function handleClickSelectThisYear(){var d=new Date,d1=new Date(d.getFullYear(),0,1),d2=new Date(d.getFullYear(),11,31);$scope.dateStart=d1,$scope.dateEnd=d2,$scope.selectedTemplate="TY",$scope.selectedTemplateName=$scope.selectedDateText()}function handleClickSelectLastYear(){var d=new Date,d1=new Date(d.getFullYear()-1,0,1),d2=new Date(d.getFullYear()-1,11,31);$scope.dateStart=d1,$scope.dateEnd=d2,$scope.selectedTemplate="LY",$scope.selectedTemplateName=$scope.selectedDateText()}function isSelectedStartDate(date){return 0===getDateDiff($scope.dateStart,date)}function isSelectedEndDate(date){return 0===getDateDiff($scope.dateEnd,date)}function isToday(date){return 0===getDateDiff(date,new Date)}function selectedDateText(){return $scope.format&&"function"==typeof $scope.format?$scope.format($scope.dateStart,$scope.dateEnd,$scope.selectedTemplate,$scope.selectedTemplateName):$scope.dateStart&&$scope.dateEnd?$scope.selectedTemplate?null!=SELECTION_TEMPLATES_CUSTOM&&null!=SELECTION_TEMPLATES_CUSTOM[$scope.selectedTemplate]?SELECTION_TEMPLATES_CUSTOM[$scope.selectedTemplate].name:SELECTION_TEMPLATES[$scope.selectedTemplate]:0===getDateDiff($scope.dateStart,$scope.dateEnd)?$filter("date")($scope.dateStart,"dd MMM yyyy"):$filter("date")($scope.dateStart,"dd"+($scope.dateStart.getMonth()!==$scope.dateEnd.getMonth()||$scope.dateStart.getFullYear()!==$scope.dateEnd.getFullYear()?" MMM":"")+($scope.dateStart.getFullYear()!==$scope.dateEnd.getFullYear()?" yyyy":""))+" - "+$filter("date")($scope.dateEnd,"dd MMM yyyy"):""}function focusToDate(d){var d2=new Date(d.getFullYear(),d.getMonth()+1,1);$scope.activeDate=d,$scope.activeMonth=d.getMonth(),$scope.activeYear=d.getFullYear(),$scope.activeDate2=d2,$scope.activeMonth2=d2.getMonth(),$scope.activeYear2=d2.getFullYear(),$scope.dates=fillDateGrid(d),$scope.dates2=fillDateGrid(d2)}var SELECTION_TEMPLATES={TD:getLocalizationVal("Today"),YD:getLocalizationVal("Yesterday"),TW:getLocalizationVal("This Week"),LW:getLocalizationVal("Last Week"),TM:getLocalizationVal("This Month"),LM:getLocalizationVal("Last Month"),TY:getLocalizationVal("This Year"),LY:getLocalizationVal("Last Year")},START_OF_WEEK=1;SELECTION_TEMPLATES_CUSTOM={},$scope.isMenuContainer=!1,$scope.days=[],$scope.label="Date range picker",$scope.dates=[],$scope.dates2=[],$scope.numberOfMonthToDisplay=2,$scope.today=new Date,$scope.dateStart&&$scope.dateStart.setHours(0,0,0,0),$scope.dateEnd&&$scope.dateStart.setHours(23,59,59,999),$scope.firstDayOfMonth=$scope.dateStart?new Date($scope.dateStart.getFullYear(),$scope.dateStart.getMonth(),1):Date($scope.today.getFullYear(),$scope.today.getMonth(),1),$scope.lastDayOfMonth=$scope.dateStart?new Date($scope.dateStart.getFullYear(),$scope.dateStart.getMonth()+1,0):Date($scope.today.getFullYear(),$scope.today.getMonth()+1,0),$scope.activeDate=$scope.dateStart||$scope.today,$scope.activeDate2=new Date($scope.activeDate.getFullYear(),$scope.activeDate.getMonth()+1,1),$scope.activeMonth=$scope.activeDate.getMonth(),$scope.activeYear=$scope.activeDate.getFullYear(),$scope.activeMonth2=$scope.activeDate2.getMonth(),$scope.activeYear2=$scope.activeDate2.getFullYear(),$scope.months=[],$scope.years=[],$scope.inCurrentMonth=inCurrentMonth,$scope.isToday=isToday,$scope.handleClickDate=handleClickDate,$scope.inSelectedDateRange=inSelectedDateRange,$scope.isSelectedStartDate=isSelectedStartDate,$scope.isSelectedEndDate=isSelectedEndDate,$scope.updateActiveDate=updateActiveDate,$scope.selectedDateText=selectedDateText,$scope.focusToDate=focusToDate,$scope.handleClickNextMonth=handleClickNextMonth,$scope.handleClickPrevMonth=handleClickPrevMonth,$scope.handleClickSelectToday=handleClickSelectToday,$scope.handleClickSelectYesterday=handleClickSelectYesterday,$scope.handleClickSelectThisWeek=handleClickSelectThisWeek,$scope.handleClickSelectLastWeek=handleClickSelectLastWeek,$scope.handleClickSelectThisMonth=handleClickSelectThisMonth,$scope.handleClickSelectLastMonth=handleClickSelectLastMonth,$scope.handleClickSelectThisYear=handleClickSelectThisYear,$scope.handleClickSelectLastYear=handleClickSelectLastYear,$scope.getLocalizationVal=getLocalizationVal,$scope.selectCustomRange=selectCustomRange,$scope.isInMaxRange=isInMaxRange,$scope.isInMinRange=isInMinRange,$scope.selectionTemplate={},function(){var currTmpl,mctr=0;if(null!=$scope.customTemplates)for(var i=0;i<$scope.customTemplates.length;i++)currTmpl=$scope.customTemplates[i],SELECTION_TEMPLATES_CUSTOM[currTmpl.name]=currTmpl;if($scope.selectedTemplate){switch($scope.selectedTemplate){case"TD":$scope.handleClickSelectToday();break;case"YD":$scope.handleClickSelectYesterday();break;case"TW":$scope.handleClickSelectThisWeek();break;case"LW":$scope.handleClickSelectLastWeek();break;case"TM":$scope.handleClickSelectThisMonth();break;case"LM":$scope.handleClickSelectLastMonth();break;case"TY":$scope.handleClickSelectThisYear();break;case"LY":$scope.handleClickSelectLastYear();break;default:SELECTION_TEMPLATES_CUSTOM&&SELECTION_TEMPLATES_CUSTOM[$scope.selectedTemplate]&&SELECTION_TEMPLATES_CUSTOM[$scope.selectedTemplate].dateStart&&SELECTION_TEMPLATES_CUSTOM[$scope.selectedTemplate].dateEnd&&($scope.dateStart=SELECTION_TEMPLATES_CUSTOM[$scope.selectedTemplate].dateStart,$scope.dateEnd=SELECTION_TEMPLATES_CUSTOM[$scope.selectedTemplate].dateEnd),$scope.selectedTemplateName=$scope.selectedDateText()}$scope.updateActiveDate()}else $scope.selectedTemplate="",$scope.selectedTemplateName=$scope.selectedDateText(),$scope.updateActiveDate();$scope.$watch("selectedTemplate",function(next,prev){next===prev||!$scope.dateStart||$scope.inCurrentMonth($scope.dateStart)||$scope.inCurrentMonth($scope.dateStart,!0)||$scope.focusToDate($scope.dateStart)}),$scope.$watch("dateStart",function(next,prev){next===prev||!$scope.dateStart||$scope.inCurrentMonth($scope.dateStart)||$scope.inCurrentMonth($scope.dateStart,!0)||$scope.focusToDate($scope.dateStart)});var w=new Date(2017,0,1);for($scope.days=[],mctr=0;mctr<7;mctr++)w.setDate(mctr+1+getFirstDayOfWeek()),$scope.days.push({id:mctr,name:getLocalizationVal($filter("date")(w,"EEE"))});var m=null;for($scope.months=[],mctr=0;mctr<12;mctr++)m=new Date(2017,mctr,1),$scope.months.push({id:mctr,name:getLocalizationVal($filter("date")(m,"MMMM"))});var y=$scope.activeYear,yctr=0;for($scope.years=[],yctr=y;yctr',''," {{ngModel.selectedTemplateName || placeholder}}",' ',"",'',' {{ngModel.selectedTemplateName || placeholder}}',' ','

','{{getLocalizationVal("Clear")}}','{{getLocalizationVal("Ok")}}',"

","
",""].join(""),controller:["$scope","$mdMenu",function($scope,$mdMenu){$scope.ok=function($dates){$scope.mdOnSelect({$dates:$dates}),$mdMenu.hide()},$scope.clear=function(){$scope.ngModel.selectedTemplateName="",$scope.ngModel.selectedTemplate=null,$scope.ngModel.dateStart=null,$scope.ngModel.dateEnd=null},$scope.getLocalizationVal=function(val){return $scope.ngModel&&null!=$scope.ngModel.localizationMap&&null!=$scope.ngModel.localizationMap[val]?$scope.ngModel.localizationMap[val]:val}}]}}function mdDateRangePickerService($mdDialog){function getSelectedDate(dateStart,dateEnd,isDisabledDateCallback,maxRange,minRange){for(var dates=[],limit=dateEnd.getTime(),date=dateStart,ctr=0,y=dateStart.getFullYear(),m=dateStart.getMonth(),d=dateStart.getDate();date.getTime()<=limit&&(isDisabledDateCallback&&!isDisabledDateCallback({$date:date})&&dates.push(date),ctr++,date=new Date(y,m,d+ctr),!(ctr>(maxRange||1e4))););return dates}function show(config){return $mdDialog.show({locals:{mdDateRangePickerServiceModel:angular.copy(config.model),mdDateRangePickerServiceConfig:angular.copy(config)},controller:["$scope","mdDateRangePickerServiceModel","mdDateRangePickerServiceConfig",function($scope,mdDateRangePickerServiceModel,mdDateRangePickerServiceConfig){$scope.model=mdDateRangePickerServiceModel||{},$scope.config=mdDateRangePickerServiceConfig||{},$scope.model.selectedTemplateName=$scope.model.selectedTemplateName||"",$scope.ok=function(){$scope.model.dateStart&&$scope.model.dateStart.setHours(0,0,0,0),$scope.model.dateEnd&&$scope.model.dateEnd.setHours(23,59,59,999),$mdDialog.hide($scope.model)},$scope.cancel=function(){$mdDialog.cancel()},$scope.clear=function(){$scope.model.selectedTemplateName="",$scope.model.selectedTemplate=null,$scope.model.dateStart=null,$scope.model.dateEnd=null},$scope.handleOnSelect=function($dates){"function"==typeof $scope.config.mdOnSelect&&$scope.config.mdOnSelect($dates),$scope.config.autoConfirm&&$scope.ok()},$scope.getLocalizationVal=function(val){return $scope.model&&null!=$scope.model.localizationMap&&null!=$scope.model.localizationMap[val]?$scope.model.localizationMap[val]:val},$scope.model.customTemplates&&console.warn("model.customTemplates will be removed from model on next rlease, please use root config e.g. $mdDateRangePicker.show({customTemplates}) instead"),$scope.model.localizationMap&&console.warn("model.localizationMap will be removed from model on next rlease, please use root config e.g. $mdDateRangePicker.show({localizationMap}) instead"),$scope.model.firstDayOfWeek&&console.warn("model.firstDayOfWeek will be removed from model on next rlease, please use root config e.g. $mdDateRangePicker.show({firstDayOfWeek}) instead"),$scope.model.showTemplate&&console.warn("model.showTemplate will be removed from model on next rlease, please use root config e.g. $mdDateRangePicker.show({showTemplate}) instead"),$scope.model.maxRange&&console.warn("model.maxRange will be removed from model on next rlease, please use root config e.g. $mdDateRangePicker.show({maxRange}) instead"),$scope.model.onePanel&&console.warn("model.onePanel will be removed from model on next rlease, please use root config e.g. $mdDateRangePicker.show({onePanel}) instead"),$scope.model.isDisabledDate&&console.warn("model.isDisabledDate({ $date: $date }) will be removed from model on next rlease, please use root config e.g. $mdDateRangePicker.show({isDisabledDate:($date)=>{}}) instead")}],template:['','','",'{{model.selectedTemplateName}}',"","","","","",'','{{getLocalizationVal("Cancel")}}','{{getLocalizationVal("Clear")}}','{{getLocalizationVal("Ok")}}',"",""].join(""),parent:angular.element(document.body),multiple:config.multiple,targetEvent:config.targetEvent||document.body,clickOutsideToClose:!0,fullscreen:config.model.fullscreen})}var service=this;service.show=show,service.getSelectedDate=getSelectedDate}angular.module("ngMaterialDateRangePicker",["ngMaterial"]).directive("mdDateRangePicker",mdDateRangePickerDirective).directive("mdDateRange",mdDateRangeDirective).controller("mdDateRangePickerCtrl",mdDateRangePickerCtrl).service("$mdDateRangePicker",mdDateRangePickerService),mdDateRangePickerDirective.$inject=["$mdDateRangePicker"],mdDateRangePickerCtrl.$inject=["$scope","$filter"],mdDateRangePickerService.$inject=["$mdDialog"]}(window,angular),function(angular){angular.module("ui.carousel.config",[]).value("ui.carousel.config",{debug:!1}),angular.module("ui.carousel.providers",[]),angular.module("ui.carousel.controllers",[]),angular.module("ui.carousel.directives",[]),angular.module("ui.carousel",["ui.carousel.config","ui.carousel.directives","ui.carousel.controllers","ui.carousel.providers"])}(angular),angular.module("ui.carousel.controllers").controller("UICarouselController",["$scope","$element","$timeout","$q","Carousel","$window",function($scope,$element,$timeout,$q,Carousel,$window){var _this=this;this.$onInit=function(){_this.initOptions(),_this.initRanges(),_this.setProps(),_this.setupInfinite()},this.initOptions=function(){_this.options=angular.extend({},Carousel.getOptions()),void 0!==_this.initialSlide&&(_this.options.initialSlide=_this.initialSlide),void 0!==_this.fade&&(_this.options.fade=_this.fade),void 0!==_this.autoplayOn&&(_this.options.autoplayOn=_this.autoplayOn),void 0!==_this.autoplaySpeed&&(_this.options.autoplaySpeed=_this.autoplaySpeed),void 0!==_this.cssEase&&(_this.options.cssEase=_this.cssEase),void 0!==_this.speed&&(_this.options.speed=_this.speed),void 0!==_this.infinite&&(_this.options.infinite=_this.infinite),void 0!==_this.arrows&&(_this.options.arrows=_this.arrows),void 0!==_this.dots&&(_this.options.dots=_this.dots),void 0!==_this.visiblePrev&&(_this.options.visiblePrev=_this.visiblePrev),void 0!==_this.visibleNext&&(_this.options.visibleNext=_this.visibleNext),void 0!==_this.currentGallery&&(_this.options.currentGallery=_this.currentGallery),_this.options.fade?(_this.options.slidesToShow=1,_this.options.slidesToScroll=1):(_this.show&&(_this.options.slidesToShow=_this.show),_this.scroll&&(_this.options.slidesToScroll=_this.scroll))},this.initRanges=function(){_this.slides||(_this.slides=[]),_this.isCarouselReady=!1,_this.isTrackMoving=!1,_this.track=$element.find(".track"),_this.width=1,_this.height=1,_this.currentSlide=_this.options.initialSlide,_this.trackStyle={},_this.slideStyle={},_this.isVisibleDots=!1,_this.isVisiblePrev=_this.options.visiblePrev,_this.isVisibleNext=_this.options.visibleNext,_this.isClickablePrev=!1,_this.isClickableNext=!1,_this.animType=null,_this.transformType=null,_this.transitionType=null},this.initUI=function(){_this.width=$element[0].clientWidth,_this.height=$element[0].clientHeight,$timeout(function(){_this.initTrack(),_this.updateItemStyle()},200)},this.updateItemStyle=function(){_this.itemWidth=_this.width/_this.options.slidesToShow,_this.slideStyle={width:_this.itemWidth+"px"}},this.initTrack=function(){var itemWidth=_this.width/_this.options.slidesToShow,trackWidth=itemWidth*_this.slidesInTrack.length;_this.trackStyle.width=trackWidth+"px",_this.slideHandler(_this.currentSlide).finally(function(){_this.isCarouselReady=!0,$timeout(function(){_this.height=$element[0].clientHeight}),_this.options.fade||_this.refreshTrackStyle(),_this.onInit&&_this.onInit()}).catch(function(){})},this.next=function(){if(!_this.isClickableNext)return!1;var indexOffset=_this.getIndexOffset(),slideOffset=0===indexOffset?_this.options.slidesToScroll:indexOffset;_this.slideHandler(_this.currentSlide+slideOffset).catch(function(){})},this.prev=function(){if(!_this.isClickablePrev)return!1;var indexOffset=_this.getIndexOffset(),slideOffset=0===indexOffset?_this.options.slidesToScroll:_this.options.slidesToShow-indexOffset;_this.slideHandler(_this.currentSlide-slideOffset).catch(function(){})},this.getIndexOffset=function(){return _this.slides.length%_this.options.slidesToScroll!=0?0:(_this.slides.length-_this.currentSlide)%_this.options.slidesToScroll},this.movePage=function(page){var target=_this.options.slidesToScroll*page;_this.slideHandler(target).catch(function(){})},this.slideHandler=function(index){if(!_this.slides)return $q.reject("Carousel not fully setup");if(_this.isTrackMoving)return $q.reject("Track is moving");var len=_this.slides.length,show=_this.options.slidesToShow;if(len<=show)return _this.correctTrack(),$q.reject("Length of slides smaller than slides to show");var anim=index,target=null;if(target=anim<0?len%_this.options.slidesToScroll!=0?len-len%_this.options.slidesToScroll:len+anim:anim>=len?len%_this.options.slidesToScroll!=0?0:anim-len:anim,_this.onBeforeChange&&_this.onBeforeChange({currentSlide:_this.currentSlide,target:target}),_this.options.fade)return _this.currentSlide=target,$timeout(function(){_this.autoplayTrack(),_this.onAfterChange&&_this.onAfterChange({currentSlide:_this.currentSlide})},_this.options.speed),$q.when("Handler fade");var itemWidth=_this.width/_this.options.slidesToShow,left=-1*target*itemWidth;return _this.options.infinite&&(left=-1*(anim+show)*itemWidth),_this.isTrackMoving=!0,_this.moveTrack(left).then(function(){_this.isTrackMoving=!1,_this.currentSlide=target,_this.autoplayTrack(),target!==anim&&_this.correctTrack(),_this.options.infinite||(0===_this.currentSlide?(_this.isClickablePrev=!1,_this.isClickableNext=!0):_this.currentSlide===_this.slidesInTrack.length-_this.options.slidesToShow?(_this.isClickableNext=!1,_this.isClickablePrev=!0):(_this.isClickablePrev=!0,_this.isClickableNext=!0)),$timeout(function(){_this.onAfterChange&&_this.onAfterChange({currentSlide:_this.currentSlide})},200)})},this.moveTrack=function(left){var deferred=$q.defer();return!1===_this.options.vertical?_this.trackStyle[_this.animType]="translate3d("+left+"px, 0px, 0px)":_this.trackStyle[_this.animType]="translate3d(0px, "+left+"px, 0px)",$timeout(function(){deferred.resolve("Track moved")},_this.options.speed),deferred.promise},this.correctTrack=function(){_this.options.infinite&&function(){var left=0;_this.slides.length>_this.options.slidesToShow&&(left=-1*(_this.currentSlide+_this.options.slidesToShow)*_this.itemWidth),_this.trackStyle[_this.transitionType]=_this.transformType+" 0ms "+_this.options.cssEase,_this.isTrackMoving=!0,$timeout(function(){_this.trackStyle[_this.animType]="translate3d("+left+"px, 0, 0px)",$timeout(function(){_this.refreshTrackStyle(),_this.isTrackMoving=!1},200)})}()},this.refreshTrackStyle=function(){_this.trackStyle[_this.transitionType]=_this.transformType+" "+_this.options.speed+"ms "+_this.options.cssEase},this.autoplayTrack=function(){_this.options.autoplayOn&&(_this.timeout&&$timeout.cancel(_this.timeout),_this.timeout=$timeout(function(){_this.next(),$timeout.cancel(_this.timeout),_this.timeout=null},_this.slides[_this.currentSlide].autoSlideTime||_this.options.autoplaySpeed))},this.getSlideStyle=function(index){var style=_this.slideStyle;if(_this.options.fade){var left=-1*index*_this.itemWidth,uniqueStyle={position:"relative",top:"0px",left:left+"px","z-index":index===_this.currentSlide?10:9,opacity:index===_this.currentSlide?1:0};index>=_this.currentSlide-1&&index<=_this.currentSlide+1&&(uniqueStyle.transition="opacity 250ms linear"),style=angular.extend(style,uniqueStyle)}return style},this.getSlideClass=function(index){return index===_this.currentSlide?"active":""},this.getSlideWidth=function(index){return Math.ceil(_this.itemWidth)},this.getSlideHeight=function(index){return Math.ceil(_this.height)},this.setupInfinite=function(){var len=_this.slides.length,show=_this.options.slidesToShow,tmpTrack=angular.copy(_this.slides);if(_this.options.infinite&&!1===_this.options.fade&&len>show){for(var number=show,i=0;i=len-show;_i--)tmpTrack.unshift(angular.copy(_this.slides[_i]))}_this.slidesInTrack=tmpTrack},this.getDots=function(){if(!_this.slides)return[];for(var dots=Math.ceil(_this.slides.length/_this.options.slidesToScroll),res=[],i=0;i_this.options.slidesToShow?(_this.isVisibleDots=!0,_this.isVisiblePrev=!0,_this.isVisibleNext=!0,_this.isClickablePrev=!0,_this.isClickableNext=!0):(_this.isVisibleDots=!1,_this.isVisiblePrev=_this.options.visiblePrev||!1,_this.isVisibleNext=_this.options.visibleNext||!1,_this.isClickablePrev=!1,_this.isClickableNext=!1),_this.initUI()},$scope.$watchCollection("ctrl.slides",function(slides){slides&&(_this.currentSlide>slides.length-1&&(_this.currentSlide=slides.length-1),_this.setupInfinite(),_this.refreshCarousel())}),angular.element($window).on("resize",this.refreshCarousel),$scope.$on("$destroy",function(){}),1===angular.version.major&&angular.version.minor<5&&this.$onInit()}]),angular.module("ui.carousel.directives").directive("uiCarousel",["$compile","$templateCache","$sce",function($compile,$templateCache,$sce){return{restrict:"AE",bindToController:!0,scope:{name:"=?",slides:"=",show:"=?slidesToShow",scroll:"=?slidesToScroll",classes:"@",fade:"=?",onChange:"=?",disableArrow:"=?",autoplayOn:"=?",autoplaySpeed:"=?",cssEase:"=?",speed:"=?",infinite:"=?",arrows:"=?",dots:"=?",initialSlide:"=?",visibleNext:"=?",visiblePrev:"=?",currentGallery:"=?",onBeforeChange:"&",onAfterChange:"&",onInit:"&"},link:function($scope,el,attrs){var template=angular.element($templateCache.get("ui-carousel/carousel.template.html")),injectComponentMap={"carousel-item":".carousel-item","carousel-prev":".carousel-prev","carousel-next":".carousel-next"},templateInstance=template.clone();angular.forEach(injectComponentMap,function(innerSelector,outerSelector){var outerElement=el[0].querySelector(outerSelector);outerElement&&angular.element(templateInstance[0].querySelector(innerSelector)).html(outerElement.innerHTML)});var compiledElement=$compile(templateInstance)($scope);el.addClass("ui-carousel").html("").append(compiledElement);try{$scope.photoPop=$scope.$parent.$parent.$parent.photoPop}catch(e){}try{$scope.popPhotos=$scope.$parent.vm.popPhotos}catch(e){}},controller:"UICarouselController",controllerAs:"ctrl"}}]),angular.module("ui.carousel.providers").provider("Carousel",function(){var _this=this;this.options={arrows:!0,autoplayOn:!1,autoplaySpeed:3e3,cssEase:"ease",dots:!1,easing:"linear",fade:!1,infinite:!0,initialSlide:0,slidesToShow:1,slidesToScroll:1,speed:500,visiblePrev:!1,visibleNext:!1,draggable:!0,lazyLoad:"ondemand",swipe:!0,swipeToSlide:!1,touchMove:!0,vertical:!1,verticalSwiping:!1,currentGallery:{}},this.$get=[function(){return{setOptions:function(options){_this.options=angular.extend(_this.options,options)},getOptions:function(){return _this.options}}}]}),function(module){try{module=angular.module("ui.carousel")}catch(e){module=angular.module("ui.carousel",[])}module.run(["$templateCache",function($templateCache){$templateCache.put("ui-carousel/carousel.template.html",'')}])}(),function(){"use strict";function inViewDirective($parse){return{restrict:"A",require:"?^^inViewContainer",link:function(scope,element,attrs,container){var options={};attrs.inViewOptions&&(options=scope.$eval(attrs.inViewOptions)),options.offset&&(options.offset=normalizeOffset(options.offset)),options.viewportOffset&&(options.viewportOffset=normalizeOffset(options.viewportOffset));var viewportEventSignal=signalSingle({type:"initial"}).merge(signalFromEvent(window,"checkInView click ready wheel mousewheel DomMouseScroll MozMousePixelScroll resize scroll touchmove mouseup keydown"));container&&(viewportEventSignal=viewportEventSignal.merge(container.eventsSignal)),options.throttle&&(viewportEventSignal=viewportEventSignal.throttle(options.throttle));var inviewInfoSignal=viewportEventSignal.map(function(event){var viewportRect;viewportRect=container?container.getViewportRect():getViewportRect(),viewportRect=offsetRect(viewportRect,options.viewportOffset);var elementRect=offsetRect(element[0].getBoundingClientRect(),options.offset),isVisible=!!(element[0].offsetWidth||element[0].offsetHeight||element[0].getClientRects().length),info={inView:isVisible&&intersectRect(elementRect,viewportRect),event:event,element:element,elementRect:elementRect,viewportRect:viewportRect};return options.generateParts&&info.inView&&(info.parts={},info.parts.top=elementRect.top>=viewportRect.top,info.parts.left=elementRect.left>=viewportRect.left,info.parts.bottom=elementRect.bottom<=viewportRect.bottom,info.parts.right=elementRect.right<=viewportRect.right),info}).scan({},function(lastInfo,newInfo){return options.generateDirection&&newInfo.inView&&lastInfo.elementRect&&(newInfo.direction={horizontal:newInfo.elementRect.left-lastInfo.elementRect.left,vertical:newInfo.elementRect.top-lastInfo.elementRect.top}),newInfo.changed=newInfo.inView!==lastInfo.inView||!angular.equals(newInfo.parts,lastInfo.parts)||!angular.equals(newInfo.direction,lastInfo.direction),newInfo}).filter(function(info){return!!info.changed&&!("initial"===info.event.type&&!info.inView)}),inViewExpression=$parse(attrs.inView),dispose=inviewInfoSignal.subscribe(function(info){scope.$applyAsync(function(){inViewExpression(scope,{$inview:info.inView,$inviewInfo:info})})});scope.$on("$destroy",dispose)}}}function inViewContainerDirective(){return{restrict:"A",controller:["$element",function($element){this.element=$element,this.eventsSignal=signalFromEvent($element,"scroll"),this.getViewportRect=function(){return $element[0].getBoundingClientRect()}}]}}function getViewportRect(){var result={top:0,left:0,width:window.innerWidth,right:window.innerWidth,height:window.innerHeight,bottom:window.innerHeight};return result.height?result:("CSS1Compat"===document.compatMode?(result.width=result.right=document.documentElement.clientWidth,result.height=result.bottom=document.documentElement.clientHeight):(result.width=result.right=document.body.clientWidth,result.height=result.bottom=document.body.clientHeight),result)}function intersectRect(r1,r2){return!(r2.left>r1.right||r2.rightr1.bottom||r2.bottom0}function QuickSignal(didSubscribeFunc){this.didSubscribeFunc=didSubscribeFunc}function signalMerge(){var signals=arguments;return new QuickSignal(function(subscriber){for(var disposables=[],i=signals.length-1;i>=0;i--)disposables.push(signals[i].subscribe(function(){subscriber.apply(null,arguments)}));subscriber.$dispose=function(){for(var i=disposables.length-1;i>=0;i--)disposables[i]&&disposables[i]()}})}function signalFromEvent(target,event){return new QuickSignal(function(subscriber){var handler=function(e){subscriber(e)},el=angular.element(target);event.split(" ").map(function(e){el[0].addEventListener(e,handler,!0)}),subscriber.$dispose=function(){event.split(" ").map(function(e){el[0].removeEventListener(e,handler,!0)})}})}function signalSingle(value){return new QuickSignal(function(subscriber){setTimeout(function(){subscriber(value)})})}angular.module("angular-inview",[]).directive("inView",["$parse",inViewDirective]).directive("inViewContainer",inViewContainerDirective),QuickSignal.prototype.subscribe=function(subscriber){return this.didSubscribeFunc(subscriber),function(){subscriber.$dispose&&(subscriber.$dispose(),subscriber.$dispose=null)}},QuickSignal.prototype.map=function(f){var s=this;return new QuickSignal(function(subscriber){subscriber.$dispose=s.subscribe(function(nextValue){subscriber(f(nextValue))})})},QuickSignal.prototype.filter=function(f){var s=this;return new QuickSignal(function(subscriber){subscriber.$dispose=s.subscribe(function(nextValue){f(nextValue)&&subscriber(nextValue)})})},QuickSignal.prototype.scan=function(initial,scanFunc){var s=this;return new QuickSignal(function(subscriber){var last=initial;subscriber.$dispose=s.subscribe(function(nextValue){last=scanFunc(last,nextValue),subscriber(last)})})},QuickSignal.prototype.merge=function(signal){return signalMerge(this,signal)},QuickSignal.prototype.throttle=function(threshhold){var last,deferTimer,s=this;return new QuickSignal(function(subscriber){var chainDisposable=s.subscribe(function(){var now=+new Date,args=arguments;last&&nowo;o++){for(var r=e[o],s=0;i>s&&void 0!==(r=this._queue[s](r,o,e))&&null!==r;s++);void 0!==r&&null!==r&&t.push(r)}return t},t.Pipeline.prototype.reset=function(){this._queue=[]},t.Pipeline.prototype.get=function(){return this._queue},t.Pipeline.prototype.toJSON=function(){return this._queue.map(function(e){return t.Pipeline.warnIfFunctionNotRegistered(e),e.label})},t.Index=function(){this._fields=[],this._ref="id",this.pipeline=new t.Pipeline,this.documentStore=new t.DocumentStore,this.index={},this.eventEmitter=new t.EventEmitter,this._idfCache={},this.on("add","remove","update",function(){this._idfCache={}}.bind(this))},t.Index.prototype.on=function(){var e=Array.prototype.slice.call(arguments);return this.eventEmitter.addListener.apply(this.eventEmitter,e)},t.Index.prototype.off=function(e,t){return this.eventEmitter.removeListener(e,t)},t.Index.load=function(e){e.version!==t.version&&t.utils.warn("version mismatch: current "+t.version+" importing "+e.version);var n=new this;n._fields=e.fields,n._ref=e.ref,n.documentStore=t.DocumentStore.load(e.documentStore),n.pipeline=t.Pipeline.load(e.pipeline),n.index={};for(var i in e.index)n.index[i]=t.InvertedIndex.load(e.index[i]);return n},t.Index.prototype.addField=function(e){return this._fields.push(e),this.index[e]=new t.InvertedIndex,this},t.Index.prototype.setRef=function(e){return this._ref=e,this},t.Index.prototype.saveDocument=function(e){return this.documentStore=new t.DocumentStore(e),this},t.Index.prototype.addDoc=function(e,n){if(e){var n=void 0===n||n,i=e[this._ref];this.documentStore.addDoc(i,e),this._fields.forEach(function(n){var o=this.pipeline.run(t.tokenizer(e[n]));this.documentStore.addFieldLength(i,n,o.length);var r={};o.forEach(function(e){e in r?r[e]+=1:r[e]=1},this);for(var s in r){var u=r[s];u=Math.sqrt(u),this.index[n].addToken(s,{ref:i,tf:u})}},this),n&&this.eventEmitter.emit("add",e,this)}},t.Index.prototype.removeDocByRef=function(e){if(e&&!1!==this.documentStore.isDocStored()&&this.documentStore.hasDoc(e)){var t=this.documentStore.getDoc(e);this.removeDoc(t,!1)}},t.Index.prototype.removeDoc=function(e,n){if(e){var n=void 0===n||n,i=e[this._ref];this.documentStore.hasDoc(i)&&(this.documentStore.removeDoc(i),this._fields.forEach(function(n){this.pipeline.run(t.tokenizer(e[n])).forEach(function(e){this.index[n].removeToken(e,i)},this)},this),n&&this.eventEmitter.emit("remove",e,this))}},t.Index.prototype.updateDoc=function(e,t){var t=void 0===t||t;this.removeDocByRef(e[this._ref],!1),this.addDoc(e,!1),t&&this.eventEmitter.emit("update",e,this)},t.Index.prototype.idf=function(e,t){var n="@"+t+"/"+e;if(Object.prototype.hasOwnProperty.call(this._idfCache,n))return this._idfCache[n];var i=this.index[t].getDocFreq(e),o=1+Math.log(this.documentStore.length/(i+1));return this._idfCache[n]=o,o},t.Index.prototype.getFields=function(){return this._fields.slice()},t.Index.prototype.search=function(e,n){if(!e)return[];e="string"==typeof e?{any:e}:JSON.parse(JSON.stringify(e));var i=null;null!=n&&(i=JSON.stringify(n));for(var o=new t.Configuration(i,this.getFields()).get(),r={},s=Object.keys(e),u=0;u0&&t.push(e);for(var i in n)"docs"!==i&&"df"!==i&&this.expandToken(e+i,t,n[i]);return t},t.InvertedIndex.prototype.toJSON=function(){return{root:this.root}},t.Configuration=function(e,n){var e=e||"";if(void 0==n||null==n)throw new Error("fields should not be null");this.config={};var i;try{i=JSON.parse(e),this.buildUserConfig(i,n)}catch(o){t.utils.warn("user configuration parse failed, will use default configuration"),this.buildDefaultConfig(n)}},t.Configuration.prototype.buildDefaultConfig=function(e){this.reset(),e.forEach(function(e){this.config[e]={boost:1,bool:"OR",expand:!1}},this)},t.Configuration.prototype.buildUserConfig=function(e,n){var i="OR",o=!1;if(this.reset(),"bool"in e&&(i=e.bool||i),"expand"in e&&(o=e.expand||o),"fields"in e)for(var r in e.fields)if(n.indexOf(r)>-1){var s=e.fields[r],u=o;void 0!=s.expand&&(u=s.expand),this.config[r]={boost:s.boost||0===s.boost?s.boost:1,bool:s.bool||i,expand:u}}else t.utils.warn("field name in user configuration not found in index instance fields");else this.addAllFields2UserConfig(i,o,n)},t.Configuration.prototype.addAllFields2UserConfig=function(e,t,n){n.forEach(function(n){this.config[n]={boost:1,bool:e,expand:t}},this)},t.Configuration.prototype.get=function(){return this.config},t.Configuration.prototype.reset=function(){this.config={}},lunr.SortedSet=function(){this.length=0,this.elements=[]},lunr.SortedSet.load=function(e){var t=new this;return t.elements=e,t.length=e.length,t},lunr.SortedSet.prototype.add=function(){var e,t;for(e=0;e1;){if(r===e)return o;e>r&&(t=o),r>e&&(n=o),i=n-t,o=t+Math.floor(i/2),r=this.elements[o]}return r===e?o:-1},lunr.SortedSet.prototype.locationFor=function(e){for(var t=0,n=this.elements.length,i=n-t,o=t+Math.floor(i/2),r=this.elements[o];i>1;)e>r&&(t=o),r>e&&(n=o),i=n-t,o=t+Math.floor(i/2),r=this.elements[o];return r>e?o:e>r?o+1:void 0},lunr.SortedSet.prototype.intersect=function(e){for(var t=new lunr.SortedSet,n=0,i=0,o=this.length,r=e.length,s=this.elements,u=e.elements;!(n>o-1||i>r-1);)s[n]!==u[i]?s[n]u[i]&&i++:(t.add(s[n]),n++,i++);return t},lunr.SortedSet.prototype.clone=function(){var e=new lunr.SortedSet;return e.elements=this.toArray(),e.length=e.elements.length,e},lunr.SortedSet.prototype.union=function(e){var t,n,i;this.length>=e.length?(t=this,n=e):(t=e,n=this),i=t.clone();for(var o=0,r=n.toArray();o=0}function a(t){return n(t),"click"}function i(t){return n(t)?t.innerText||t.value:t.id||t.name||t.tagName}function r(t){return"analytics"===t.substr(0,9)&&-1===["On","Event","If","Properties","EventType"].indexOf(t.substr(9))}function o(t){var e=t.slice(9);return void 0!==e&&null!==e&&e.length>0?e.substring(0,1).toLowerCase()+e.substring(1):e}return{restrict:"A",link:function(n,s,c){var u=c.analyticsOn||a(s[0]),l={};t.forEach(c.$attr,function(t,e){r(e)&&(l[o(e)]=c[e],c.$observe(e,function(t){l[o(e)]=t}))}),t.element(s[0]).bind(u,function(a){var r=c.analyticsEvent||i(s[0]);l.eventType=a.type,(!c.analyticsIf||n.$eval(c.analyticsIf))&&(c.analyticsProperties&&t.extend(l,n.$eval(c.analyticsProperties)),e.eventTrack(r,l))})}}}])}(angular),function(t,e,n){"use strict";e.module("angulartics.google.analytics",["angulartics"]).config(["$analyticsProvider",function(a){function i(e){if(t.ga)for(var n=1;200>=n;n++)e["dimension"+n.toString()]&&ga("set","dimension"+n.toString(),e["dimension"+n.toString()]),e["metric"+n.toString()]&&ga("set","metric"+n.toString(),e["metric"+n.toString()])}a.settings.pageTracking.trackRelativePath=!0,a.settings.ga={additionalAccountNames:void 0,userId:null},a.registerPageTrack(function(n){t._gaq&&(_gaq.push(["_trackPageview",n]),e.forEach(a.settings.ga.additionalAccountNames,function(t){_gaq.push([t+"._trackPageview",n])})),t.ga&&(a.settings.ga.userId&&ga("set","&uid",a.settings.ga.userId),ga("send","pageview",n),e.forEach(a.settings.ga.additionalAccountNames,function(t){ga(t+".send","pageview",n)}))}),a.registerEventTrack(function(n,r){if(r&&r.category||(r=r||{},r.category="Event"),r.value){var o=parseInt(r.value,10);r.value=isNaN(o)?0:o}if(t.ga){var s={eventCategory:r.category,eventAction:n,eventLabel:r.label,eventValue:r.value,nonInteraction:r.noninteraction,page:r.page||t.location.hash.substring(1)||t.location.pathname,userId:a.settings.ga.userId};i(r),a.settings.ga.transport?ga("send","event",s,{transport:a.settings.ga.transport}):ga("send","event",s),e.forEach(a.settings.ga.additionalAccountNames,function(t){ga(t+".send","event",s)})}else t._gaq&&_gaq.push(["_trackEvent",r.category,n,r.label,r.value,r.noninteraction])}),a.registerSetUsername(function(t){a.settings.ga.userId=t}),a.registerSetUserProperties(function(t){i(t)})}])}(window,window.angular),function(){"use strict";function t(t){return"[object Array]"===Object.prototype.toString.call(t)}function e(t){return void 0!==t}function n(t){return"function"==typeof t}function a(t){return null===t}function i(t){return"string"==typeof t}function r(t){return void 0===t}function o(t,e){return t.hasOwnProperty(e)}function s(t){return a(t)||r(t)||i(t)&&0==t.length}function c(t){return i(t)&&t.length>0}function u(t,e){return angular.equals(t,e)}function l(t,e){return angular.copy(t,e)}function g(t,e){return angular.module(t,e)}angular.module("sly",["slyEvaluate","slyRepeat"]),g("slyEvaluate",["gatedScope"]).directive("slyEvaluateOnlyWhen",["$parse",function(t){return{scope:!0,restrict:"A",compile:function(e,n){return{pre:function(e,n,i){var r=null,u=!1,l=t(i.slyEvaluateOnlyWhen),g=null;if(o(i,"slyAlwaysEvaluate")&&(g=i.slyAlwaysEvaluate,s(g)))throw new Exception("Empty string is illegal for value of slyAlwaysEvaluate");e.$addWatcherGate(function(){var t=l(e);if(!u)return u=!0,r=t,!0;var n=r!==t;return r=t,n},function(t){return a(g)||!(c(t)&&t.indexOf(g)>=0)},!0)}}}}}]).directive("slyAlwaysEvaluate",function(){return{restrict:"A",link:function(t,e,n){}}}).directive("slyShow",["$animate",function(t){function e(t){if(t&&0!==t.length){var e=""+t;e=i(e)?e.toLowerCase():e,t=!("f"==e||"0"==e||"false"==e||"no"==e||"n"==e||"[]"==e)}else t=!1;return t}return{restrict:"A",link:function(n,a,i){n.$watch(i.slyShow,function(n){t[e(n)?"removeClass":"addClass"](a,"ng-hide")},!1,"slyShow")}}}]).directive("slyPreventEvaluationWhenHidden",function(){return{restrict:"A",scope:!0,compile:function(t,n){return{pre:function(t,n,a){t.$addWatcherGate(function(){return!n.hasClass("ng-hide")},function(t,n,a,i){return!e(i)||"slyShow"!=i})}}}}}),g("slyRepeat",["gatedScope"]).directive("slyRepeat",["$animate","$parse",function(e,n){function a(t){t.scope.$addWatcherGate(function(){return t.isActiveForRepeat})}return{restrict:"A",scope:!0,transclude:"element",priority:1e3,terminal:!0,compile:function(n,i,r){return function(n,i,o){var s=o.slyRepeat,c=s.match(/^\s*(.+)\s+in\s+(.*?)$/);if(!c)throw Error("Expected slyRepeat in form of '_item_ in _collection_' but got '"+s+"'.");var u=c[1],l=c[2];if(!(c=u.match(/^(?:([\$\w]+))$/)))throw Error("'item' in 'item in collection' should be identifier but got '"+lhs+"'.");var g=[],f=[],h=n.$watchCollection(l,function(o){if(o){if(!t(o))throw Error("'collection' did not evaluate to an array. expression was "+l);var s=g.length;if(g.length0){var c=g.length+f.length;c>o.length&&(c=o.length),g=g.concat(f.splice(0,c-g.length))}var h=null,$=[],p=[];if(o.length>g.length){for(var d=g.length;d0){var y=h.length-1,w=h.length-1;s0&&(y-=1);for(var d=y;w>=d;++d)h[d].scope.$last=d==h.length-1,h[d].scope.$middle=0!=d&&d!=h.length-1,h[d].isActiveForRepeat||(h[d].isActiveForRepeat=!0,h[d].element.css("display",""))}for(var d=0;d<$.length&&!$[d].isActiveForRepeat;++d)$[d].element.css("display","none");for(var d=0;d0&&(m=g[g.length-1].element);for(var d=0;d=that.maxWidth&&(that.element.css("width",that.maxWidth+"px"),that.element.css("height",that.maxHeight+"px"))},that.resizeSlides=function(){for(var slides=$window.document.getElementsByClassName("slide"),index=0;index1&&(that.autoSlideInterval=$interval(function(){that.navigateRight()},that.cloneData[that.currentIndex+1].autoSlideTime||that.autoSlideTime))},that.stopAutoSlide=function(){angular.isDefined(that.autoSlideInterval)&&($interval.cancel(that.autoSlideInterval),that.autoSlideInterval=void 0)},that.onNavigateLeft=function(){that.navigateLeft(),that.restartAutoSlide()},that.navigateLeft=function(){that.isDataInvalidOrTooSmall()||(that.currentIndex--,that.radioButtonIndex=that.currentIndex,that.currentMarginLeftValue+=that.currentWidth,that.applyMarginLeft(),that.restartAutoSlide(),-1===that.currentIndex&&that.restartFromLastItem())},that.restartFromLastItem=function(){$timeout(function(){that.disableTransitions(),that.currentMarginLeftValue=that.currentWidth*that.data.length*-1,that.applyMarginLeft(),that.currentIndex=that.data.length-1,that.radioButtonIndex=that.currentIndex,that.enableTransitions()},that.transitionsTime)},that.onNavigateRight=function(){that.navigateRight(),that.restartAutoSlide()},that.navigateRight=function(){that.isDataInvalidOrTooSmall()||(that.currentIndex++,that.radioButtonIndex=that.currentIndex,that.currentMarginLeftValue-=that.currentWidth,that.applyMarginLeft(),that.restartAutoSlide(),that.currentIndex===that.data.length&&$timeout(function(){that.restartFromFirstItem()},that.transitionsTime))},that.applyMarginLeft=function(){that.slidesContainer.css("margin-left",that.currentMarginLeftValue+"px")},that.disableTransitions=function(){that.slidesContainer.css("transition","none"),that.transitionsEnabled=!1},that.enableTransitions=function(){$timeout(function(){that.slidesContainer.css("transition","margin 0.5s ease-in-out"),that.transitionsEnabled=!0},200)},that.onRadioButtonClick=function(){var multiplier;that.radioButtonIndex>that.currentIndex?(multiplier=that.radioButtonIndex-that.currentIndex,that.currentMarginLeftValue-=that.currentWidth*multiplier):(multiplier=that.currentIndex-that.radioButtonIndex,that.currentMarginLeftValue+=that.currentWidth*multiplier),that.currentIndex=that.radioButtonIndex,that.applyMarginLeft(),that.restartAutoSlide()},that.isDataInvalidOrTooSmall=function(){return!that.data||0===that.data.length}}angular.module("bdmMaterialCarousel").controller("bdmCarouselController",["$timeout","$attrs","$interval","$window",CarouselController])}(),function(){"use strict";function CarouselDirective(){function link(scope,element,attrs,ctrl){ctrl.itemTemplateUrl="app/cards/item-carousel.html",(void 0===attrs.autoSlide||ctrl.data.length<2)&&(ctrl.autoSlide=!1),void 0===attrs.autoSlideTime&&(ctrl.data.length<2?ctrl.autoSlideTime=!1:ctrl.autoSlideTime=5e3),ctrl.registerElement(element),scope.$on("$destroy",function(){ctrl.stopAutoSlide()}),scope.$watch("ctrl.autoSlide",function(){ctrl.validateAutoSlide()}),scope.$watch("ctrl.autoSlideTime",function(){ctrl.restartAutoSlide()})}return{restrict:"E",replace:!0,templateUrl:"carousel-directive.html",scope:{},controller:"bdmCarouselController",controllerAs:"ctrl",bindToController:{data:"=",maxWidth:"@?",maxHeight:"@?",autoSlide:"@?",autoSlideTime:"@?"},link:link}}angular.module("bdmMaterialCarousel").directive("bdmCarousel",[CarouselDirective])}(),function(){angular.module("bdmMaterialCarousel.templates",[]).run(["$templateCache",function($templateCache){$templateCache.put("carousel-directive.html",'\n\n \n \n \n\n \n \n \n\n \n \n \n \n\n\n')}])}();var decamelize=require("decamelize");angular.module("humanizeText",[]).filter("escape",function(){return window.encodeURIComponent}).filter("getFirstImage",function(){return function(image){return image?image&&"["==image[0]?(image=JSON.parse(image),image[0]):(angular.isArray(image)&&(image=image[0]),image?image.indexOf(",")>-1?image=image.split(",")[0]:image?image.replace("(","%28").replace(")","%29"):"":""):""}}).filter("capitalize",function(){return function(input,all){return input?input.replace(/\w\S*/g,function(txt){return txt.charAt(0).toUpperCase()+txt.substr(1).toLowerCase()}):""}}).filter("camelCaseToHuman",function(){return function(input,uppercaseFirst){if("string"!=typeof input)return input;var result=decamelize(input," ");return uppercaseFirst&&(result=result.charAt(0).toUpperCase()+result.slice(1)),result.replace(/_/g," ").replace(/([A-Z])/g," $1").trim()}})},{decamelize:2}],2:[function(require,module,exports){"use strict";module.exports=function(str,sep){if("string"!=typeof str)throw new TypeError("Expected a string");return str.replace(/([a-z\d])([A-Z])/g,"$1"+(sep||"")+"$2").toLowerCase()}},{}]},{},[1]),function(){"use strict";angular.module("explorer.app",["explorer.directives","explorer.filters","explorer.config","explorer.constants","explorer.routes","explorer.services.alert","explorer.services.settings","explorer.services.data"])}(),function(){var isMobile=function(){var check=!1;return function(a){(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4)))&&(check=!0)}(navigator.userAgent||navigator.vendor||window.opera),check||"ontouchstart"in window||window.innerWidth<=768}();angular.module("explorer.constants",[]).constant("appConfig",{api:window.location.protocol+"//"+(window.APP_DOMAIN.indexOf(".au")>-1||window.APP_DOMAIN.indexOf("brewer")>-1?window.APP_DOMAIN:"www."+window.APP_DOMAIN)+"/api/",searchDelay:350,messageDelay:36e3,headers:{"Content-Type":"application/json",Authorization:"XJKKAHJJS783$KKAS",X_BDM_TOKEN:"827asduuia277bbjsuw884"},requireLoggedIn:["trips","profile","messages","message","favorites","settings"],googlePlaceIdURL:"https://maps.googleapis.com/maps/api/place/details/json?placeid=",googleStaticImage:"https://maps.googleapis.com/maps/api/staticmap?center=",tileLayer:"https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png",mapMarkerIcon:{iconUrl:"https://lh3.googleusercontent.com/8mKbeINxiev0D5TlBY0Hct2TzbfDV9EvXiNmsrquy8_kSpoC27b9YmzJKGtFJwIZnR9D0RTWD-pr97f2JQoljSVXnt-wXJFvOFxN0v0_I6s8QucWrsc=s0",iconSize:[34,45],iconAnchor:[16,45],popupAnchor:[0,-45]},selectedMapMarkerIcon:{iconUrl:"https://lh3.googleusercontent.com/WgDv3MGvAiGN7nzSeNRDHCZYv3oDwPXpfYcVy-pvJy2qpHTuhuEzPZLdS-7-S-S_XbYkft206FaWjLp7TarNsvaDhUPzVdNYiDdOqEKPKqivkaG1HJg=s0",iconSize:[34,45],iconAnchor:[16,45],popupAnchor:[0,-45]},hideMarkerPopup:!0,mapCenter:{lat:parseFloat(window.CENTER_LAT||"-10.373411"),lng:parseFloat(window.CENTER_LNG||"131.284889"),focus:!0,draggable:!0,zoom:isMobile?2:4},zoomcontrolposition:"topright",maxClusterRadius:10,isMobileDevice:isMobile})}(),function(){"use strict";angular.module("explorer.directives",[]).directive("propertyNotice",function($window,$timeout,Places,Settings){return{restrict:"E",scope:{},replace:!0,templateUrl:CDN_URL+"cards/view/property-notice.tpl.html",link:function(scope,element,attrs,filter){function filterNoticesByPropertyId(notices,propertyId){return notices.filter(function(notice){return notice.priority===priorityNotice&¬ice.propertyIds&¬ice.propertyIds.length&¬ice.propertyIds.includes(propertyId)})}var priorityNotice=4;Settings.get("currentHotel")&&function(propertyId){Settings.get("hasPortalNoticesData")?scope.propertyNotices=filterNoticesByPropertyId(Settings.get("portalNoticesData"),propertyId):Places.get("PortalNoticesData").then(function(response){"ok"==response.data.status&&(Settings.set("hasPortalNoticesData",!0),Settings.set("portalNoticesData",response.data.content),scope.propertyNotices=filterNoticesByPropertyId(response.data.content,propertyId))})}(Settings.get("currentHotel").id)}}}).directive("sitewideNotice",function($rootScope,$state,$location,$timeout,Places,Settings){return{restrict:"E",scope:{},replace:!0,templateUrl:CDN_URL+"cards/view/sitewide-notice.tpl.html",link:function(scope,element,attrs,filter){function loadNotices(){if(Settings.get("hasPortalNoticesData")){var siteNotices=Settings.get("portalNoticesData"),urlMappedNotices=[];if(scope.siteNotices=[],scope.refreshHeaderToolbarHeight=$rootScope.refreshHeaderToolbarHeight,angular.forEach(siteNotices,function(notice){switch(notice.urlDisplay){case"all":("sitewide"!==attrs.position||"sitewide"===attrs.position&&3===notice.priority)&&scope.siteNotices.push(notice);break;case"home":notice.displayUrls=["/"],urlMappedNotices.push(notice);break;case"show":urlMappedNotices.push(notice)}}),urlMappedNotices.length){var currentRoute,displayUrlMappedNotices=[],usedUrls=[];angular.forEach(urlMappedNotices,function(notice){notice.displayUrls&¬ice.displayUrls.indexOf($location.path())>-1&&(usedUrls.push(currentRoute),displayUrlMappedNotices.push(notice))}),angular.forEach(urlMappedNotices,function(notice){angular.forEach(notice.displayUrls,function(url){-1==usedUrls.indexOf($location.path())&&url.indexOf("*")>-1&&$location.path().startsWith(url.replace("*",""))&&displayUrlMappedNotices.push(notice)})}),displayUrlMappedNotices.length&&(scope.siteNotices=displayUrlMappedNotices),$rootScope.$on("$stateChangeSuccess",function(ev,to,toParams,from,fromParams){scope.siteNotices=[],displayUrlMappedNotices=[],usedUrls=[],currentRoute=to.url.replace("/:template",""),angular.forEach(urlMappedNotices,function(notice){notice.displayUrls.indexOf(currentRoute)>-1&&(usedUrls.push(currentRoute),displayUrlMappedNotices.push(notice))}),angular.forEach(urlMappedNotices,function(notice){angular.forEach(notice.displayUrls,function(url){-1==usedUrls.indexOf(currentRoute)&&url.indexOf("*")>-1&¤tRoute.startsWith(url.replace("*",""))&&displayUrlMappedNotices.push(notice)})}),displayUrlMappedNotices.length?scope.siteNotices=displayUrlMappedNotices:angular.forEach(siteNotices,function(notice){"all"==notice.urlDisplay&&3===notice.priority&&scope.siteNotices.push(notice)})})}}else Places.get("PortalNoticesData").then(function(response){"ok"==response.data.status&&(Settings.set("hasPortalNoticesData",!0),Settings.set("portalNoticesData",response.data.content))}),$timeout(function(){loadNotices()},500)}loadNotices()}}}).directive("socialShare",function($window,$timeout,Settings){return{restrict:"E",scope:{},replace:!0,templateUrl:"app/cards/social-share.html",link:function(scope,element,attrs,filter){var currentLandingPage=Settings.get("currentLandingPage");scope.currentPageUrl=$window.location.href,angular.forEach($window.LANDING_PAGES,function(page){if(page.id==currentLandingPage.id)for(var i in page)i.indexOf("social")>-1&&(currentLandingPage[i]=page[i])}),scope.page=currentLandingPage}}}).directive("propertyGoogleMap",function($timeout,$window,$compile){return{restrict:"E",scope:{center:"=",markers:"=",options:"=?",onMarkerClick:"&?",selectedResult:"=?",allHotels:"=?",hideMapResortCard:"=?"},template:'
Map',link:function(scope,element){function getGoogleMapsApiKey(){for(var scripts=document.querySelectorAll('script[src*="maps.googleapis.com/maps/api/js"]'),i=0;i1){var clustererInitialized=!1,tealColors={light:"#244c42",medium:"#1d3c34",dark:"#1d3c34",darker:"#00818d"};if(window.markerClusterer&&window.markerClusterer.MarkerClusterer)try{var tealRenderer={render:function(cluster){var count=cluster.count,color=count<11?tealColors.light:count<30?tealColors.medium:count<100?tealColors.dark:tealColors.darker,size=count<11?36:count<30?42:count<100?50:60,svg=''+count+"";return new google.maps.Marker({position:cluster.position,icon:{url:"data:image/svg+xml;charset=UTF-8,"+encodeURIComponent(svg),scaledSize:new google.maps.Size(size,size),anchor:new google.maps.Point(size/2,size/2)},label:"",zIndex:Number(google.maps.Marker.MAX_ZINDEX)+count})}};scope.clusterer=new window.markerClusterer.MarkerClusterer({map:map,markers:googleMarkers,algorithm:new window.markerClusterer.SuperClusterAlgorithm({radius:65}),renderer:tealRenderer,onClusterClick:function(event,cluster,map){map.fitBounds(cluster.bounds)}}),clustererInitialized=!0}catch(e){console.warn("Modern MarkerClusterer API failed:",e)}if(!clustererInitialized&&window.MarkerClusterer)try{var tealClusterStyles=[{url:"data:image/svg+xml;charset=UTF-8,"+encodeURIComponent(''),height:40,width:40,textColor:"#ffffff",textSize:14,fontWeight:"bold"},{url:"data:image/svg+xml;charset=UTF-8,"+encodeURIComponent(''),height:48,width:48,textColor:"#ffffff",textSize:15,fontWeight:"bold"},{url:"data:image/svg+xml;charset=UTF-8,"+encodeURIComponent(''),height:56,width:56,textColor:"#ffffff",textSize:16,fontWeight:"bold"},{url:"data:image/svg+xml;charset=UTF-8,"+encodeURIComponent(''),height:64,width:64,textColor:"#ffffff",textSize:17,fontWeight:"bold"}];scope.clusterer=new window.MarkerClusterer(map,googleMarkers,{gridSize:50,maxZoom:12,minimumClusterSize:2,styles:tealClusterStyles}),clustererInitialized=!0}catch(e){console.warn("Classic MarkerClusterer API failed:",e)}clustererInitialized||googleMarkers.forEach(function(marker){marker.setMap(map)})}else googleMarkers.forEach(function(marker){marker.setMap(map)});$timeout(function(){googleMarkers.length>0&&(googleMarkers.length>1?(map.fitBounds(bounds),isInitialLoad=!1,google.maps.event.addListenerOnce(map,"bounds_changed",function(){map.getZoom()>19&&map.setZoom(19)})):1===googleMarkers.length&&(map.setCenter(googleMarkers[0].getPosition()),isInitialLoad&&(map.setZoom(13),isInitialLoad=!1)))},100)}}function initMap(){var initialCenter={lat:39.8283,lng:-98.5795},initialZoom=5;scope.center&&scope.center.lat&&scope.center.lng?(initialCenter={lat:scope.center.lat,lng:scope.center.lng},initialZoom=scope.center.zoom||6):Array.isArray(scope.markers)&&scope.markers.length>0&&(initialCenter={lat:scope.markers[0].lat,lng:scope.markers[0].lng},initialZoom=scope.markers.length>1?5:13);var mapContainer=element[0].querySelector(".property-google-map-container");mapContainer||(mapContainer=element[0].firstChild),mapContainer.style.width="100%",mapContainer.style.height=scope.mapHeight,map=new google.maps.Map(mapContainer,{zoom:initialZoom,center:initialCenter,mapTypeId:"roadmap",disableDefaultUI:scope.options&&scope.options.disableDefaultUI||!1,zoomControl:!0,zoomControlOptions:{position:google.maps.ControlPosition.RIGHT_TOP},scrollwheel:scope.options&&scope.options.scrollWheelZoom||!1,draggable:!scope.options||!1!==scope.options.draggable,maxZoom:19,styles:scope.osmStyle}),addMarkers()}function tryInitMap(){if(!map)return window.google&&google.maps?void((scope.center&&scope.center.lat&&scope.center.lng||Array.isArray(scope.markers)&&scope.markers.length>0)&&initMap()):void console.warn("Google Maps API not loaded.")}scope.mapHeight=scope.options&&scope.options.height||"100%",scope.isStatic=scope.options&&scope.options.static,element.css({display:"block",width:"100%",height:scope.mapHeight});var map=null,googleMarkers=[],infoWindow=null,isInitialLoad=!0,defaultMarkerIcon=null,selectedMarkerIcon=null,osmStyle=[{elementType:"geometry",stylers:[{color:"#fafaf8"}]},{elementType:"labels.icon",stylers:[{visibility:"off"}]},{elementType:"labels.text.fill",stylers:[{color:"#616161"}]},{elementType:"labels.text.stroke",stylers:[{color:"#f5f5f5"}]},{featureType:"administrative.country",elementType:"geometry.stroke",stylers:[{color:"#eee0e0"}]},{featureType:"administrative.land_parcel",elementType:"labels.text.fill",stylers:[{color:"#bdbdbd"}]},{featureType:"administrative.province",elementType:"geometry.stroke",stylers:[{color:"#eee0e0"},{weight:1}]},{featureType:"poi",elementType:"geometry",stylers:[{color:"#eeeeee"}]},{featureType:"poi",elementType:"labels.text.fill",stylers:[{color:"#757575"}]},{featureType:"poi.park",elementType:"geometry",stylers:[{color:"#e5e5e5"}]},{featureType:"poi.park",elementType:"labels.text.fill",stylers:[{color:"#9e9e9e"}]},{featureType:"road",elementType:"geometry",stylers:[{color:"#ffffff"}]},{featureType:"road.arterial",elementType:"labels.text.fill",stylers:[{color:"#757575"}]},{featureType:"road.highway",elementType:"geometry",stylers:[{color:"#dadada"}]},{featureType:"road.highway",elementType:"labels.text.fill",stylers:[{color:"#616161"}]},{featureType:"road.local",elementType:"labels.text.fill",stylers:[{color:"#9e9e9e"}]},{featureType:"transit.line",elementType:"geometry",stylers:[{color:"#e5e5e5"}]},{featureType:"transit.station",elementType:"geometry",stylers:[{color:"#eeeeee"}]},{featureType:"water",elementType:"geometry",stylers:[{color:"#d4dadc"}]},{featureType:"water",elementType:"labels.text.fill",stylers:[{color:"#9e9e9e"}]}];if(scope.osmStyle=osmStyle,scope.isStatic)return void(scope.staticMapUrl=function(){if(!scope.center||!scope.center.lat||!scope.center.lng)return"";var apiKey=getGoogleMapsApiKey(),zoom=scope.center.zoom||16,url="https://maps.googleapis.com/maps/api/staticmap?center="+scope.center.lat+","+scope.center.lng+"&zoom="+zoom+"&size=600x300&scale=2&maptype=roadmap";return url+=convertStylesToStaticParams(osmStyle),Array.isArray(scope.markers)&&scope.markers.length&&scope.markers.forEach(function(m){var markerParam="&markers=";m.icon&&m.icon.iconUrl&&(markerParam+="icon:"+encodeURIComponent(m.icon.iconUrl)+"|"),markerParam+=m.lat+","+m.lng,url+=markerParam}),apiKey&&(url+="&key="+apiKey),url}());scope.$watch("markers",function(newMarkers,oldMarkers){void 0!==newMarkers&&null!==newMarkers&&(map?newMarkers!==oldMarkers&&addMarkers():newMarkers.length>0&&tryInitMap())},!0),scope.$watch("center",function(newCenter,oldCenter){newCenter&&newCenter.lat&&newCenter.lng&&(map?newCenter!==oldCenter&&(map.setCenter({lat:newCenter.lat,lng:newCenter.lng}),newCenter.zoom&&map.setZoom(newCenter.zoom)):tryInitMap())},!0),$timeout(function(){tryInitMap()},100),scope.$on("$destroy",function(){clearMarkers(),infoWindow&&infoWindow.close()})}}}).directive("dynamicHtml",function($compile){return{restrict:"A",replace:!0,link:function(scope,ele,attrs){scope.$watch(attrs.dynamicHtml,function(html){ele.html(html),$compile(ele.contents())(scope)})}}}).directive("defaultRfp",function($window,$timeout,$filter,$mdpDatePicker,Settings,Person,Alert){return{restrict:"E",scope:{},replace:!0,templateUrl:"app/regional/shell/cards/view/default-rfp.tpl.html",link:function(scope,element,attrs,filter){function submitMeetingRFP(){scope.meetingForm.firstname&&scope.meetingForm.lastname&&scope.meetingForm.email&&scope.meetingForm.phone?Person.submitForm("MeetingRFP",scope.meetingForm).then(function(response){ response&&response.data&&"ok"==response.data.status?(scope.meetingForm={},Alert.fire({message:"Thank you. We will reach out to you shortly!"})):Alert.fire({message:"There was an error, please try again later!"})}):Alert.fire({message:"Please fill in all the required fields."})}scope.attrs=attrs,scope.checkinDate=new Date(moment()),scope.checkoutDate=new Date(moment().add(2,"days")),scope.phoneReservations=$window.APP_CLIENT_PHONE_RESERVATIONS||"",scope.currentHotel=Settings.get("currentHotel"),scope.promoCode=$window.PROMOID||null,scope.hotels=[],scope.submitMeetingRFP=submitMeetingRFP,scope.checkinMinDate=new Date(moment()),scope.checkoutMinDate=new Date(moment().add(2,"days")),Settings.get("has_nearby_resorts")&&(scope.regions=Settings.get("nearby_resorts"),function(){if(angular.forEach(scope.regions,function(destination,destinationName){angular.forEach(destination.hotels,function(hotel){scope.hotels.push(hotel)})}),Settings.get("groupTravelProperty")){var _resort=Settings.get("groupTravelProperty");scope.meetingForm.resort=[],scope.meetingForm.resort.push(_resort),Settings.set("groupTravelProperty",null)}}())}}}).directive("ehSweepsRfp",function($window,$timeout,$filter,$mdpDatePicker,Settings,Person,Alert){return{restrict:"E",scope:{thankYouPage:"@",formSubmitEvent:"@",campaignName:"@"},replace:!0,templateUrl:"app/cards/eh-sweeps-rfp.html",link:function(scope,element,attrs,filter){function submitSweepsForm(ev){scope.campaignName&&(scope.form.campaignName=scope.campaignName),scope.thankYouPage&&(scope.form.thankYouPage=scope.thankYouPage),scope.form.firstname&&scope.form.lastname&&scope.form.email&&scope.form.state&&scope.form.country&&scope.form.city&&scope.form.address1?Person.submitForm("SweepsForm",scope.form).then(function(response){response&&response.data&&"ok"==response.data.status?scope.thankYouPage?$window.location.href=scope.thankYouPage:(Alert.fire({ev:ev,message:"Thank you for entering our sweepstakes. Watch your email for a special thank you offer."}),scope.sweepsForm.$setUntouched()):Alert.fire({ev:ev,message:"There was an error, please try again later!"})}):Alert.fire({ev:ev,message:"Please fill in all the required fields."})}scope.attrs=attrs,scope.checkinDate=new Date(moment()),scope.checkoutDate=new Date(moment().add(2,"days")),scope.phoneReservations=$window.APP_CLIENT_PHONE_RESERVATIONS||"",scope.currentHotel=Settings.get("currentHotel"),scope.promoCode=$window.PROMOID||null,scope.hotels=[],scope.submitSweepsForm=submitSweepsForm,scope.checkinMinDate=new Date(moment()),scope.checkoutMinDate=new Date(moment().add(2,"days"))}}}).directive("pricelevel",function(){return{restrict:"E",scope:{},replace:!0,template:"{{priceLevel}}",link:function(scope,element,attrs){scope.priceLevel="";for(var i=0;i-1&&!scope.checkTriggerResortSelect&&$state.go("parentDestination",{parent:item.slug}),scope.checkTriggerResortSelect=!1}function dateRangeHasWeekend(dateRange){for(var startDate=dateRange.start,endDate=dateRange.end,start=new Date(startDate),end=new Date(endDate),currentDate=start;currentDate<=end;currentDate.setDate(currentDate.getDate()+1)){var dayOfWeek=currentDate.getDay();if(5===dayOfWeek||6===dayOfWeek)return!0}return!1}function updateRates(){if(scope.selectedResortDestination)var ratesApi="https://travelclick-rates-api.uc.r.appspot.com/?task=avail&hotelCode="+scope.selectedResortDestination.hotelCode+"&dateIn="+moment(scope.checkinDate).format("YYYY-MM-DD")+"&dateOut="+moment(scope.checkoutDate).format("YYYY-MM-DD")+(scope.promoCode?"&corpCode="+scope.promoCode:""),ratesData=Settings.get(btoa(ratesApi));var handleResponse=function(data,noCache){if("loading"!=data){var dateLabel=moment(scope.checkinDate).format("MM/DD/YYYY")+"-"+moment(scope.checkoutDate).format("MM/DD/YYYY");if(data.roomStays&&data.roomStays.length){var minPrice,leadRate=(dateRangeHasWeekend(data.roomStays[0].timeSpan),null),currentRate=0,specialRateFound=!1,lowestRate=!1,currentRate=0;angular.forEach(data.roomStays[0].allRoomTypes,function(room){angular.forEach(room.averageRates,function(rate){"Discount"==rate.ratePlanCategory&&rate.available&&(currentRate=rate.rate-(rate.discount||0),(!lowestRate||lowestRate.rate-lowestRate.discount>currentRate)&&(lowestRate=rate,specialRateFound=!0))}),angular.forEach(room.averageRates,function(rate){"Promotional"==rate.ratePlanCategory&&rate.available&&(currentRate=rate.rate-(rate.discount||0),(!lowestRate||lowestRate.rate-lowestRate.discount>currentRate)&&(lowestRate=rate,specialRateFound=!0))}),lowestRate||angular.forEach(room.averageRates,function(rate){specialRateFound||"Rack"!=rate.ratePlanCategory||(lowestRate=rate,specialRateFound=!0)}),minPrice=!!lowestRate&&lowestRate.rate-lowestRate.discount,leadRate=minPrice}),leadRate&&scope.selectedResortDestination&&"object"==typeof scope.selectedResortDestination&&(scope.selectedResortDestination.leadRate=leadRate,scope.selectedResortDestination.priceCurrency=data.currencyCode,$analytics.eventTrack(scope.selectedResortDestination.hotelCode+": "+scope.selectedResortDestination.name,{category:"Lead Rate - Available",label:dateLabel}))}else scope.selectedResortDestination&&"object"==typeof scope.selectedResortDestination&&(scope.selectedResortDestination.leadRate=!1,$analytics.eventTrack(scope.selectedResortDestination.hotelCode+": "+scope.selectedResortDestination.name,{category:"Lead Rate - Unavailable",label:dateLabel}));noCache||Settings.set(btoa(ratesApi),data),$rootScope.$broadcast("triggerUpdateBookingDates",data)}};scope.selectedResortDestination&&scope.selectedResortDestination.hotelCode?ratesData?handleResponse(ratesData,!0):(Settings.set(btoa(ratesApi),"loading"),$http({url:ratesApi,method:"GET",dataType:"json"}).success(function(data,status){200==status&&handleResponse(data)}).error(function(data,status,headers,config){scope.isSearching=!1})):scope.selectedResortDestination&&"object"==typeof scope.selectedResortDestination&&(scope.selectedResortDestination.leadRate=!1)}function updateDestinations(trackEvent){trackEvent=trackEvent||!1,scope.selectedResortDestination&&angular.forEach(scope.properties,function(property){if(property.hotelCode==scope.selectedResortDestination)return scope.selectedDestination=property.destinationSlug,scope.selectedDestination=property.destinationName,trackEvent&&$analytics.eventTrack(property.name,{category:"booking bar",label:"resort select"}),void(($state.current.name.indexOf("hotel")<0||"hotels"==$state.current.name||$stateParams.slug!=property.slug&&$stateParams.hotel!=property.slug)&&$state.go("hotel",{country:"us",state:property.state,city:property.cityState.replace("-"+property.state,""),slug:property.slug}))})}function updateResorts(){scope.selectedDestination?angular.forEach(scope.properties.slice().reverse(),function(property){if(property.destinationSlug==scope.selectedDestination)return void(scope.selectedResortDestination=property.hotelCode)}):scope.selectedDestination=null}function isDisabledDate(d){return d=-86400001&&(prevDiff=moment(scope.checkinDate).diff(moment(scope.checkoutDate))),Settings.set("checkinDate",scope.checkinDate),$localStorage.checkinDate=scope.checkinDate,$rootScope.checkinDate=scope.checkinDate}),scope.$watch("checkoutDate",function(oldDate,newDate){Settings.set("checkoutDate",scope.checkoutDate),$localStorage.checkoutDate=scope.checkoutDate,$rootScope.checkoutDate=scope.checkoutDate,moment(scope.checkinDate).diff(moment(scope.checkoutDate))!=prevDiff&&(scope.showDatePicker=!1,$timeout(function(){scope.checkinDate!=scope.checkoutDate&&updateRates()},50))}),$rootScope.$on("updatePromoCode",function(e,promoCode){scope.PROMOID=promoCode,scope.promoCode=promoCode}),$rootScope.$on("updateDiscountCode",function(e,discountCode){scope.discount=discountCode,scope.applyCode(discountCode)}),$rootScope.$on("updateProductId",function(e,productId){scope.PRODUCTID=productId}),$rootScope.$on("updateGaEvent",function(e,gaEvent){scope.GAEVENT=gaEvent}),$rootScope.$on("defaultSearchText",function(e,searchText){scope.search.searchText=searchText||""}),scope.$emit("triggerBookingBarLoaded"),$rootScope.$on("triggerHideBookingBar",function(ev,showHide){scope.hideBookingBar=showHide});var elasticSearch=elasticlunr(function(){this.addField("name"),this.addField("cityName"),this.addField("stateName"),this.setRef("id")});updateDropdownSelect()}}}).directive("shellFooter",function($window,Alert,Person){return{restrict:"E",scope:{},replace:!0,templateUrl:"app/regional/shell/cards/view/shell-footer.tpl.html",link:function(scope,element,attrs){function emailSubscribe(ev){scope.subscriberEmail?Person.submitForm("EmailSubscribe",{email:scope.subscriberEmail}).then(function(response){scope.subscriberEmail="",Alert.fire({ev:ev,title:"Thanks for signing up!",message:"We’ll send our best offers and latest news straight to your inbox.",duration:8500})}):Alert.fire({ev:ev,message:"Please enter a valid email address."})}scope.attrs=attrs,scope.clientPhone=$window.APP_CLIENT_PHONE,scope.clientEmail=$window.APP_CLIENT_EMAIL,scope.currentYear=(new Date).getFullYear(),scope.menu=$window.APP_CONFIG.menu,scope.clientName=$window.APP_CLIENT,scope.clientURL=$window.location.origin,scope.clientLogo=$window.APP_CONFIG.core.header.logo||null,$window.APP_CONFIG.core&&$window.APP_CONFIG.core.footer&&(scope.clientBrand=$window.APP_CONFIG.core.footer.brand||null,scope.footerText=$window.APP_CONFIG.core.footer.text||null,scope.clientAddress=$window.APP_CONFIG.core.footer.address||null,scope.termsLink=$window.APP_CONFIG.core.footer.termsLink||null,scope.privacyLink=$window.APP_CONFIG.core.footer.privacyLink||null,scope.newsletterLink=$window.APP_CONFIG.core.footer.newsletterLink||null,scope.subscribeHeading=$window.APP_CONFIG.core.footer.subscribeHeading||null,scope.subscribeText=$window.APP_CONFIG.core.footer.subscribeText||null),scope.emailSubscribe=emailSubscribe}}}).directive("ehCampaignFooter",function($window){return{restrict:"E",scope:{category:"="},replace:!0,templateUrl:"app/regional/shell/cards/view/campaign-footer.tpl.html",link:function(scope,element,attrs){scope.attrs=attrs,scope.clientPhone=$window.APP_CLIENT_PHONE,scope.clientEmail=$window.APP_CLIENT_EMAIL,scope.currentYear=(new Date).getFullYear(),scope.menu=$window.APP_CONFIG.menu,scope.clientName=$window.APP_CLIENT,scope.clientURL=$window.location.origin,$window.APP_CONFIG.core&&$window.APP_CONFIG.core.footer&&(scope.clientBrand=$window.APP_CONFIG.core.footer.brand||null,scope.footerText=$window.APP_CONFIG.core.footer.text||null,scope.clientAddress=$window.APP_CONFIG.core.footer.address||null,scope.termsLink=$window.APP_CONFIG.core.footer.termsLink||null,scope.privacyLink=$window.APP_CONFIG.core.footer.privacyLink||null,scope.newsletterLink=$window.APP_CONFIG.core.footer.newsletterLink||null)}}}).directive("regionalPropertyHeader",function(){return{restrict:"E",scope:{property:"="},replace:!0,templateUrl:"app/cards/regional-property-header.html",link:function(scope,element,attrs){scope.attrs=attrs}}}).directive("hotelHeroPhoto",function(){return{restrict:"AE",scope:{property:"=",headerImage:"@"},templateUrl:"app/regional/shell/cards/view/hotel-hero-photos.tpl.html",link:function(scope,element,attrs){scope.attrs=attrs}}}).directive("shellBreadcrumb",function($state,$stateParams,$window){return{restrict:"E",scope:{property:"=",destination:"=",slug:"="},templateUrl:"app/regional/shell/cards/view/shell-breadcrumb.tpl.html",link:function(scope,element,attrs){if(scope.attrs=attrs,scope.cityStateSlug=$stateParams.cityState||$stateParams.slug,$window.PORTAL_DESTINATIONS&&scope.cityStateSlug){var tmp=scope.cityStateSlug;angular.forEach($window.PORTAL_DESTINATIONS.states,function(state){tmp.indexOf(state)>-1&&(scope.stateSlug=state)})}switch($state.current.name){case"hotelRooms":case"hotelRoom":scope.isRoomsPage=!0;break;case"destinationPhotos":case"cityDestinationPhotos":scope.isDestinationPhotosPage=!0;break;case"hotelPhotos":scope.isPhotosPage=!0;break;case"hotelEvents":case"hotelEvent":scope.isEventsPage=!0;break;case"destinationNearby":case"cityDestinationNearby":scope.isDestinationNearbyPage=!0;break;case"hotelNearby":scope.isNearbyPage=!0;break;case"hotelSpecial":case"hotelSpecials":scope.isOffersPage=!0}}}}).directive("hotelBannerNotice",function($filter){return{restrict:"E",scope:{crumbs:"=",lang:"="},templateUrl:"app/regional/shell/cards/view/hotel-banner-notice.tpl.html",link:function(scope,element,attrs){scope.attrs=attrs}}}).directive("breadcrumb",function($filter,$window){return{restrict:"E",scope:{crumbs:"=",lang:"="},templateUrl:"app/regional/shell/cards/view/breadcrumb.tpl.html",link:function(scope,element,attrs){scope.attrs=attrs,scope.defaultLanguage=$window.DEFAULT_LANGUAGE||"en"}}}).directive("resortCard",function($window,$filter,Settings){return{restrict:"E",scope:{property:"="},templateUrl:"app/regional/shell/cards/view/resort-card.tpl.html",link:function(scope,element,attrs){function bookNow(hotel,offset){if(offset=offset||2,$window.BOOKING_URL){var options={checkin:$filter("date")(new Date(moment().add(offset,"days")),"MM/dd/yyyy"),checkout:$filter("date")(new Date(moment().add(offset+2,"days")),"MM/dd/yyyy"),numAdults:1,numChildren:0,rooms:1,promoCode:$window.PROMOID||null,gaEvent:$window.GAEVENT||null,lid:$window.LID||null};hotel&&(hotel.hotelCode&&(options.hotelId=hotel.hotelCode),hotel.brand&&(options.brand=hotel.brand),hotel.slug&&(options.slug=hotel.slug),hotel.sameAs&&(options.sameAs=hotel.sameAs),hotel.geo&&(options.lat=hotel.geo.latitude,options.lng=hotel.geo.longitude)),$window._booking_bar_link&&$window.open($window._booking_bar_link(options),"_blank")}}scope.amenityIconSet=Settings.get("amenityIconSet"),scope.attrs=attrs,scope.bookNow=bookNow,scope.defaultLanguage=$window.DEFAULT_LANGUAGE||"en"}}}).directive("mapResortCard",function($window,$filter,Settings){return{restrict:"E",scope:{property:"="},templateUrl:"app/regional/shell/cards/view/map-resort-card.tpl.html",link:function(scope,element,attrs){function bookNow(hotel,offset){if(offset=offset||2,$window.BOOKING_URL){var options={checkin:$filter("date")(new Date(moment().add(offset,"days")),"MM/dd/yyyy"),checkout:$filter("date")(new Date(moment().add(offset+2,"days")),"MM/dd/yyyy"),numAdults:1,numChildren:0,rooms:1,promoCode:$window.PROMOID||null,gaEvent:$window.GAEVENT||null,lid:$window.LID||null};hotel&&(hotel.hotelCode&&(options.hotelId=hotel.hotelCode),hotel.brand&&(options.brand=hotel.brand),hotel.slug&&(options.slug=hotel.slug),hotel.sameAs&&(options.sameAs=hotel.sameAs),hotel.geo&&(options.lat=hotel.geo.latitude,options.lng=hotel.geo.longitude)),$window._booking_bar_link&&$window.open($window._booking_bar_link(options),"_blank")}}scope.amenityIconSet=Settings.get("amenityIconSet"),scope.attrs=attrs,scope.bookNow=bookNow,scope.defaultLanguage=$window.DEFAULT_LANGUAGE||"en"}}}).directive("trustyouPropertyReview",function(Places){var _languageNames={en:"English",de:"German",fr:"French",es:"Spanish",it:"Italian",pt:"Portuguese",nl:"Dutsch",ru:"Russian",pl:"Polish",zh:"Chinese",ja:"Japanese",th:"Thai",id:"Indonesian",ko:"Korean",ar:"Arabic",sv:"Swedish",no:"Norwegian",fi:"Finnish",he:"Hebrew"};return{restrict:"E",scope:{id:"="},templateUrl:"app/cards/trustyou-property-review.html",link:function(scope,element,attrs){scope.attrs=attrs,scope.languageNames=_languageNames,scope.id&&Places.get("PropertyReviewData",scope.id).then(function(response){"ok"==response.data.status&&response.data.reviewData&&(scope.reviewData=response.data.reviewData.meta,scope.guestReviews=response.data.reviewData.reviews)})}}}).directive("offerResortCard",function($mdDialog,$filter,$window,Settings){return{restrict:"E",scope:{propertyId:"=",offer:"="},templateUrl:"app/regional/shell/cards/view/offer-resort-card.tpl.html",link:function(scope,element,attrs){scope.attrs=attrs,scope.defaultLanguage=$window.DEFAULT_LANGUAGE||"en";var tmp,regions=Settings.get("nearby_resorts"),found=!1;regions&&angular.forEach(regions,function(region,regionName){found||angular.forEach(region,function(hotels){found||angular.forEach(hotels,function(hotel){if(!found&&hotel.id==scope.propertyId){if(found=!0,scope.property=hotel,tmp=scope.offer,"object"==typeof tmp.cta)scope.ctaType="multi";else if(scope.offer.cta)try{tmp.cta=JSON.parse(scope.offer.cta),scope.ctaType="multi"}catch(e){scope.ctaType="single"}scope.currentOffer=tmp}})})})}}}).directive("categoryOfferCard",function($state,$mdDialog,$filter,Settings){function _popPhotos(ev,imageSet,imgIndex){$mdDialog.show({parent:angular.element(document.body),clickOutsideToClose:!0,escapeToClose:!0,targetEvent:ev,templateUrl:"app/cards/photo-gallery.html",controller:function($scope,$filter,$mdDialog){var tmpIndex=imgIndex||0;$scope.image={url:imageSet[tmpIndex],index:tmpIndex},$scope.closeDialog=function(){$mdDialog.hide()},$scope.nextImage=function(){tmpIndex=$scope.image.index,$scope.image.index+1=0?($scope.image={url:imageSet[$scope.image.index-1]},$scope.image.index=tmpIndex-1):($scope.image={url:imageSet[$scope.image.index-1]},$scope.image.index=imageSet.length-1)}}})}return{restrict:"E",scope:{property:"=",offer:"=",offerViewMode:"=",currentCategoryId:"=",trackingVar:"=",exclusiveCode:"="},templateUrl:"app/regional/shell/cards/view/category-offer-card.tpl.html",link:function(scope,element,attrs){if(scope.attrs=attrs,scope.popPhotos=_popPhotos,scope.isMultiProperty=!1,scope.offer.propertyIds&&scope.offer.propertyIds.length>1){var regions=Settings.get("nearby_resorts"),properties=[];regions&&(angular.forEach(regions,function(region,regionName){angular.forEach(region,function(hotels){angular.forEach(hotels,function(hotel){scope.offer.propertyIds.indexOf(hotel.id)>-1&&properties.push(hotel)})})}),scope.offer.properties=properties),"offerCategory"==$state.current.name?scope.isMultiProperty=!0:scope.isMultiProperty=!1}else scope.isMultiProperty=!1;var imgObj;try{imgObj="string"!=typeof imgObj?JSON.parse(scope.offer.image):scope.offer.image}catch(e){imgObj=scope.offer.image}scope.isMultiImage=!!(scope.offer&&scope.offer.image&&"object"==typeof imgObj&&imgObj.length>1),scope.isMultiImage?scope.offer.image=imgObj:"object"==imgObj&&1==imgObj.length?scope.offer.image=scope.offer.image:scope.offer.image=angular.isArray(scope.offer.image)?scope.offer.image:[scope.offer.image||scope.property.image],scope.getImageUrl=function(url){return"object"==typeof url&&(url=url[0]),{"background-image":"url('"+$filter("scaleTo")(url,300)+"')"}}}}}).directive("hotelNav",function($window){return{restrict:"E",scope:{view:"@",property:"="},replace:!0,templateUrl:"app/regional/shell/cards/view/hotel-nav.tpl.html",link:function(scope,element,attrs){scope.attrs=attrs,scope.defaultLanguage=$window.DEFAULT_LANGUAGE||"en"}}}).directive("iconSquare",function(){return{restrict:"E",scope:{},replace:!0,templateUrl:"app/cards/icon-square.html",link:function(scope,element,attrs){scope.attrs=attrs}}}).directive("searchBar",function(){return{restrict:"E",scope:{},replace:!0,templateUrl:"app/cards/search-bar.html",link:function(scope,element,attrs){scope.attrs=attrs}}}).directive("focus",function(){return{restrict:"A",link:function(scope,elem,attrs){elem.bind("keydown",function(e){elem.next().focus()})}}}).directive("eventFocus",function(focus){return function(scope,elem,attrs){elem.on(attrs.eventFocus,function(){focus(attrs.eventFocusId)}),scope.$on("$destroy",function(){elem.off(attrs.eventFocus)})}}).directive("mdSearchAutocompleteOnEnter",function($state,Settings){return function(scope,element,attrs){element.bind("keydown keypress",function(event){13===event.which&&(scope.$apply(function(){scope.$$childHead.$mdAutocompleteCtrl.hidden=!0,Settings.hideKeyboard(),$state.go("destinations",{q:scope.search.searchText})}),event.preventDefault())})}}).directive("datePicker",function($rootScope,$state,$stateParams,$window,$timeout,$filter,$analytics,$mdpDatePicker,Settings,Alert){return{restrict:"E",scope:{},replace:!0,templateUrl:"app/regional/shell/cards/view/shell-date-picker.tpl.html",controller:function($rootScope,$scope,$state,$stateParams,$window,$timeout,$filter,$analytics,$mdpDatePicker,Settings,Alert){function isDisabledDate(d){return d0?$scope.attrs.endOffset-$scope.attrs.startOffset:2)+" night stay."}):$window.open($scope.attrs.cta+"&dateIn="+$filter("date")($scope.checkinDate,"MM/dd/yyyy")+"&dateOut="+$filter("date")($scope.checkoutDate,"MM/dd/yyyy")+"&adults="+($scope.attrs.adults||2)+"&children="+($scope.attrs.children||2)+"&rooms="+($scope.attrs.rooms||1),"_blank")}var prevDiff,today=new Date;$scope.isDisabledDate=isDisabledDate,$scope.checkAvailability=checkAvailability,$scope.promoCode=$window.PROMOID,$scope.$watch("checkinDate",function(oldDate,newDate){moment($scope.checkinDate).diff(moment($scope.checkoutDate))>=-86400001&&(prevDiff=moment($scope.checkinDate).diff(moment($scope.checkoutDate)))}),$scope.$watch("checkoutDate",function(oldDate,newDate){moment($scope.checkoutDate).diff(moment($scope.checkinDate))!=prevDiff&&($scope.showDatePicker=!1)})},link:function(scope,element,attrs,filter){scope.attrs=attrs,scope.checkinDate=new Date(moment().add(attrs.startOffset||1,"days")),scope.checkoutDate=new Date(moment().add(attrs.endOffset||2,"days"))}}}).directive("featuredDestinationsCarousel",function(Destinations,Settings,Alert){return{restrict:"E",scope:{destinationIds:"="},replace:!0,transclude:!0,templateUrl:"app/regional/shell/cards/view/featured-destinations-carousel.tpl.html",link:function(scope,element,attrs,filter){scope.attrs=attrs,scope.destinationIds=scope.destinationIds||[], Destinations.getDestinationsByDestinationIds(scope.destinationIds).then(function(response){"ok"==response.data.status&&(scope.destinations=response.data.destinations)})}}})}(),function(){angular.module("explorer.filters",[]).filter("containTo",function(){var vfmSizeKeys=["B","Q","C","D","E","F","H","I","M","J","Z","P","R","S","O"],vfmSizeValues=[100,120,150,200,250,300,350,384,400,480,600,800,1024,2048,5e3];return function(image,size){function parseQueryString(queryString){return queryString.split("&").reduce(function(acc,pair){var parts=pair.split("="),key=parts[0],value=parseFloat(parts[1]);return acc[key]=value,acc},{})}function buildQueryString(params){return Object.keys(params).map(function(key){return key+"="+params[key]}).join("&")}function replaceQueryString(url,newQueryString){var queryStartIndex=url.indexOf("?");if(-1===queryStartIndex)throw new Error("No query string found in the URL");return url.substring(0,queryStartIndex)+"?"+newQueryString}if(angular.isArray(image)&&(image=image.length?image[0]:""),!image||"string"!=typeof image)return"";var lucidUrl=image.split("?")[0];if(image.indexOf("static.travelclick.com")>-1)return function(url,elementClassOrWidth){var queryStartIndex=url.indexOf("?");if(-1===queryStartIndex)throw new Error("No query string found in the URL");var outW,outH,queryString=url.substring(queryStartIndex+1),params=parseQueryString(queryString),cropX=params.cropX,cropY=params.cropY,cropW=params.cropW,cropH=params.cropH,parsedWidth=parseInt(elementClassOrWidth,10);if(isNaN(parsedWidth)){var element=document.querySelector("."+elementClassOrWidth);if(!element)throw new Error("Element with class '"+elementClassOrWidth+"' not found");maxW=element.offsetWidth,maxH=element.offsetHeight}else outW=parsedWidth,outH=OH*(outW/OW);var OW=2*cropX+cropW,OH=2*cropY+cropH,OAR=OH/OW,TAR=maxH/maxW;return TAR===OAR?(outW=maxW,outH=maxH):TAR>OAR?(outW=maxW,outH=outW*OAR):(outH=maxH,outW=outH*(1/OAR)),replaceQueryString(url,buildQueryString({impolicy:"tcimpolicy_v1",cropX:0,cropY:0,cropW:Math.round(OW),cropH:Math.round(OH),outW:Math.round(outW),outH:Math.round(outH)}))}(image,size);if(image&&(image.indexOf("www.cfmedia.vfmleonardo.com")>-1||image.indexOf("wyndham-extra-holidays.leonardocontentcloud.com")>-1)){if(parseInt(size))var width=parseInt(size);else var result=document.getElementsByClassName(size),el=angular.element(result),width=el&&el[0]?parseInt(el[0].clientWidth):300;width<67&&(width=300);var maxSize=image.split("_");maxSize=maxSize[maxSize.length-1],maxSize=maxSize.split("."),maxSize=vfmSizeKeys.indexOf(maxSize[0]);var finalSizeIndex=0;if(vfmSizeValues.indexOf(width)>=0)finalSizeIndex=vfmSizeValues.indexOf(width);else if(width>=vfmSizeValues[vfmSizeValues.length-1])finalSizeIndex=vfmSizeValues[vfmSizeValues.length-1];else for(var i in vfmSizeValues){if(i=parseInt(i),!(vfmSizeValues[i]maxSize?maxSize:finalSizeIndex,image=image.slice(0,-5)+(vfmSizeKeys[finalSizeIndex]?vfmSizeKeys[finalSizeIndex]:"H")+image.substr(image.length-4)}if(!parseInt(size)){var result=document.getElementsByClassName(size),el=angular.element(result),devicePixelRatioMultiplier=window.mobileTabletDevice?window.devicePixelRatio||1:1;return image.indexOf("=s0")>-1&&el[0].clientWidth&&el[0].clientHeight?image.replace("=s0","=w"+Math.round(el[0].clientWidth*devicePixelRatioMultiplier).toString()+"-h"+Math.round(el[0].clientHeight*devicePixelRatioMultiplier).toString())+(window.webPsupport?"-rw-e31536000":""):lucidUrl+"?w="+Math.round(el[0].clientWidth*devicePixelRatioMultiplier).toString()+"&h="+Math.round(el[0].clientHeight*devicePixelRatioMultiplier).toString()}return image.indexOf("=s0")>-1?image.replace("=s0","=w"+size.toString())+(window.webPsupport?"-rw-e31536000":""):lucidUrl+"?w="+Math.round(size.toString()).toString()}}).filter("scaleTo",function(){var vfmSizeKeys=["B","Q","C","D","E","F","H","I","M","J","Z","P","R","S","O"],vfmSizeValues=[100,120,150,200,250,300,350,384,400,480,600,800,1024,2048,5e3];return function(image,size){function parseQueryString(queryString){return queryString.split("&").reduce(function(acc,pair){var parts=pair.split("="),key=parts[0],value=parseFloat(parts[1]);return acc[key]=value,acc},{})}function buildQueryString(params){return Object.keys(params).map(function(key){return key+"="+params[key]}).join("&")}function replaceQueryString(url,newQueryString){var queryStartIndex=url.indexOf("?");if(-1===queryStartIndex)throw new Error("No query string found in the URL");return url.substring(0,queryStartIndex)+"?"+newQueryString}if(angular.isArray(image)&&(image=image.length?image[0]:""),!image||"string"!=typeof image)return"";if(parseInt(size))var width=parseInt(size);else var result=document.getElementsByClassName(size),el=angular.element(result),width=el&&el[0]?parseInt(el[0].clientWidth):300;if(width<67&&(width=300),image.indexOf("static.travelclick.com")>-1)return function(url,elementClassOrWidth){var queryStartIndex=url.indexOf("?");if(-1===queryStartIndex)throw new Error("No query string found in the URL");var outW,outH,queryString=url.substring(queryStartIndex+1),params=parseQueryString(queryString),cropX=params.cropX,cropY=params.cropY,cropW=params.cropW,cropH=params.cropH,parsedWidth=parseInt(elementClassOrWidth,10),OW=2*cropX+cropW,OH=2*cropY+cropH;if(isNaN(parsedWidth)){var element=document.querySelector("."+elementClassOrWidth);if(!element)throw new Error("Element with class '"+elementClassOrWidth+"' not found");outW=element.offsetWidth,outH=OH*(outW/OW)}else outW=parsedWidth,outH=OH*(outW/OW);return replaceQueryString(url,buildQueryString({impolicy:"tcimpolicy_v1",cropX:0,cropY:0,cropW:Math.round(OW),cropH:Math.round(OH),outW:Math.round(outW),outH:Math.round(outH)}))}(image,width);var lucidUrl=image.split("?")[0];if(image.indexOf("www.cfmedia.vfmleonardo.com")>-1||image.indexOf("wyndham-extra-holidays.leonardocontentcloud.com")>-1){var finalSizeIndex=0,originalSizeIndex=0;if(vfmSizeValues.indexOf(width)>=0)finalSizeIndex=vfmSizeValues.indexOf(width);else if(width>=vfmSizeValues[vfmSizeValues.length-1])finalSizeIndex=vfmSizeValues[vfmSizeValues.length-1];else for(var i in vfmSizeValues){if(i=parseInt(i),!(vfmSizeValues[i]-1&&(originalSizeIndex=i);return finalSizeIndex>originalSizeIndex&&(finalSizeIndex=originalSizeIndex),image=image.slice(0,-5)+(vfmSizeKeys[finalSizeIndex]?vfmSizeKeys[finalSizeIndex]:"H")+image.substr(image.length-4)}if(!parseInt(size)){var result=document.getElementsByClassName(size),el=angular.element(result),size=el&&el[0]?parseInt(el[0].clientWidth):300,devicePixelRatioMultiplier=window.mobileTabletDevice?window.devicePixelRatio||1:1;return image.indexOf("=s0")>-1&&size?image.replace("=s0","=w"+Math.round(size*devicePixelRatioMultiplier).toString())+(window.webPsupport?"-rw-e31536000":""):lucidUrl+"?w="+Math.round(size*devicePixelRatioMultiplier).toString()}return image.indexOf("=s0")>-1?image.replace("=s0","=w"+size.toString())+(window.webPsupport?"-rw-e31536000":""):lucidUrl+"?w="+Math.round(size*devicePixelRatioMultiplier).toString()}}).filter("cropTo",function(){var vfmSizeKeys=["B","Q","C","D","E","F","H","I","M","J","Z","P","R","S","O"],vfmSizeValues=[100,120,150,200,250,300,350,384,400,480,600,800,1024,2048,5e3],devicePixelRatioMultiplier=window.mobileTabletDevice?window.devicePixelRatio||1:1;return function(image,size,height){function parseQueryString(queryString){return queryString.split("&").reduce(function(acc,pair){var parts=pair.split("="),key=parts[0],value=parseFloat(parts[1]);return acc[key]=value,acc},{})}function buildQueryString(params){return Object.keys(params).map(function(key){return key+"="+params[key]}).join("&")}function replaceQueryString(url,newQueryString){var queryStartIndex=url.indexOf("?");if(-1===queryStartIndex)throw new Error("No query string found in the URL");return url.substring(0,queryStartIndex)+"?"+newQueryString}if(angular.isArray(image)&&(image=image.length?image[0]:""),!image||"string"!=typeof image)return"";var lucidUrl=image.split("?")[0];if(image.indexOf("static.travelclick.com")>-1)return function(url,elementClassOrWidth,elementHeight){var queryStartIndex=url.indexOf("?");if(-1===queryStartIndex)return url;var outW,outH,queryString=url.substring(queryStartIndex+1),params=parseQueryString(queryString),cropX=params.cropX,cropY=params.cropY,cropW=params.cropW,cropH=params.cropH,parsedWidth=parseInt(elementClassOrWidth,10),parsedHeight=parseInt(elementHeight,10);if(isNaN(parsedWidth)){var element=document.querySelector("."+elementClassOrWidth);if(!element)return url;outW=element.offsetWidth,outH=element.offsetHeight}else outW=parsedWidth,outH=isNaN(parsedHeight)?OH*(outW/OW):parsedHeight;var NewCropH,NewCropW,NewCropX,NewCropY,OW=2*cropX+cropW,OH=2*cropY+cropH,OAR=OH/OW,TAR=outH/outW;return TAR===OAR?(NewCropH=OH,NewCropW=OW,NewCropX=0,NewCropY=0):TAR>OAR?(NewCropH=OH,NewCropW=OH*(1/TAR),NewCropX=(OW-NewCropW)/2,NewCropY=0):(NewCropW=OW,NewCropH=OW*TAR,NewCropY=(OH-NewCropH)/2,NewCropX=0),replaceQueryString(url,buildQueryString({impolicy:"tcimpolicy_v1",cropX:Math.round(NewCropX),cropY:Math.round(NewCropY),cropW:Math.round(NewCropW),cropH:Math.round(NewCropH),outW:Math.round(outW),outH:Math.round(outH)}))}(image,size,height);if(image&&(image.indexOf("www.cfmedia.vfmleonardo.com")>-1||image.indexOf("wyndham-extra-holidays.leonardocontentcloud.com")>-1)){if(parseInt(size))var width=parseInt(size);else var result=document.getElementsByClassName(size),el=angular.element(result),width=el&&el[0]?parseInt(el[0].clientWidth):300,elHeight=el&&el[0]?parseInt(el[0].clientHeight):165;1.75*elHeight>width&&(width=1.75*elHeight),width<100&&(width=300);var finalSizeIndex=0,originalSizeIndex=0;if(vfmSizeValues.indexOf(width)>=0)finalSizeIndex=vfmSizeValues.indexOf(width);else if(width>=vfmSizeValues[vfmSizeValues.length-1])finalSizeIndex=vfmSizeValues[vfmSizeValues.length-1];else for(var i in vfmSizeValues){if(i=parseInt(i),!(vfmSizeValues[i]-1&&(originalSizeIndex=i);return finalSizeIndex>originalSizeIndex&&(finalSizeIndex=originalSizeIndex),image=image.slice(0,-5)+(vfmSizeKeys[finalSizeIndex]?vfmSizeKeys[finalSizeIndex]:"H")+image.substr(image.length-4)}if(height)return image.indexOf("=s0")>-1?image.replace("=s0","=w"+Math.round(parseInt(size)*devicePixelRatioMultiplier).toString()+"-h"+Math.round(parseInt(height)*devicePixelRatioMultiplier).toString()+"-n")+(window.webPsupport?"-rw-e31536000":""):lucidUrl+"?fit=crop&w="+Math.round(parseInt(size)*devicePixelRatioMultiplier).toString()+"&h="+Math.round(parseInt(height)*devicePixelRatioMultiplier).toString();if(!parseInt(size)){var result=document.getElementsByClassName(size),el=angular.element(result);return image.indexOf("=s0")>-1&&el&&el[0]&&el[0].clientWidth&&el[0].clientHeight?image.replace("=s0","=w"+Math.round(el[0].clientWidth*devicePixelRatioMultiplier).toString()+"-h"+Math.round(el[0].clientHeight*devicePixelRatioMultiplier).toString()+"-n")+(window.webPsupport?"-rw-e31536000":""):lucidUrl+"?fit=crop&w="+Math.round(el[0].clientWidth*devicePixelRatioMultiplier).toString()+"&h="+Math.round(el[0].clientHeight*devicePixelRatioMultiplier).toString()}return image.indexOf("=s0")>-1?image.replace("=s0","=w"+size.toString())+(window.webPsupport?"-rw-e31536000":""):lucidUrl+"?fit=crop&w="+Math.round(size).toString()+"&h="+Math.round(size).toString()}}).filter("squareCropTo",function(){var vfmSizeKeys=["B","Q","C","D","E","F","H","I","M","J","Z","P","R","S","O"],vfmSizeValues=[100,120,150,200,250,300,350,384,400,480,600,800,1024,2048,5e3];return squareCropTo=function(image,size){function parseQueryString(queryString){return queryString.split("&").reduce(function(acc,pair){var parts=pair.split("="),key=parts[0],value=parseFloat(parts[1]);return acc[key]=value,acc},{})}function buildQueryString(params){return Object.keys(params).map(function(key){return key+"="+params[key]}).join("&")}function replaceQueryString(url,newQueryString){var queryStartIndex=url.indexOf("?");if(-1===queryStartIndex)throw new Error("No query string found in the URL");return url.substring(0,queryStartIndex)+"?"+newQueryString}if(!image)return"";if(angular.isArray(image)&&(image=image.length?image[0]:""),!image||"string"!=typeof image)return"";if(parseInt(size))var width=parseInt(size);else var result=document.getElementsByClassName(size),el=angular.element(result),width=el&&el[0]?parseInt(el[0].clientWidth):300;if(width<67&&(width=300),width*=1.75,image.indexOf("static.travelclick.com")>-1)return function(url,elementClassOrWidth){var queryStartIndex=url.indexOf("?");if(-1===queryStartIndex)throw new Error("No query string found in the URL");var outW,outH,queryString=url.substring(queryStartIndex+1),params=parseQueryString(queryString),cropX=params.cropX,cropY=params.cropY,cropW=params.cropW,cropH=params.cropH,parsedWidth=parseInt(elementClassOrWidth,10),OW=2*cropX+cropW,OH=2*cropY+cropH;if(isNaN(parsedWidth)){var element=document.querySelector("."+elementClassOrWidth);if(!element)throw new Error("Element with class '"+elementClassOrWidth+"' not found");outW=element.offsetWidth,outH=OH*(outW/OW)}else outW=parsedWidth,outH=OH*(outW/OW);return replaceQueryString(url,buildQueryString({impolicy:"tcimpolicy_v1",cropX:0,cropY:0,cropW:Math.round(OW),cropH:Math.round(OH),outW:Math.round(outW),outH:Math.round(outH)}))}(image,width);var lucidUrl=image.split("?")[0];if(image.indexOf("www.cfmedia.vfmleonardo.com")>-1||image.indexOf("wyndham-extra-holidays.leonardocontentcloud.com")>-1){var finalSizeIndex=0,originalSizeIndex=0;if(vfmSizeValues.indexOf(width)>=0)finalSizeIndex=vfmSizeValues.indexOf(width);else if(width>=vfmSizeValues[vfmSizeValues.length-1])finalSizeIndex=vfmSizeValues[vfmSizeValues.length-1];else for(var i in vfmSizeValues){if(i=parseInt(i),!(vfmSizeValues[i]-1&&(originalSizeIndex=i);return finalSizeIndex>originalSizeIndex&&(finalSizeIndex=originalSizeIndex),image=image.slice(0,-5)+(vfmSizeKeys[finalSizeIndex]?vfmSizeKeys[finalSizeIndex]:"H")+image.substr(image.length-4)}if(!parseInt(size)){var result=document.getElementsByClassName(size),el=angular.element(result),size=el&&el[0]?parseInt(el[0].clientWidth):300,devicePixelRatioMultiplier=window.mobileTabletDevice?window.devicePixelRatio||1:1;return image.indexOf("=s0")>-1&&size?image.replace("=s0","=w"+Math.round(size*devicePixelRatioMultiplier).toString())+(window.webPsupport?"-rw-e31536000":""):lucidUrl+"?w="+Math.round(size*devicePixelRatioMultiplier).toString()}return image.indexOf("=s0")>-1?image.replace("=s0","=w"+Math.round(size).toString())+"-c"+(window.webPsupport?"-rw-e31536000":""):lucidUrl+"?w="+Math.round(size.toString()).toString()},squareCropTo}).filter("toTime",function($filter){return function(dateString){return dateString?moment(dateString,moment.ISO_8601,!0).isValid()?$filter("date")(new Date(moment(dateString)),"h:mm a"):dateString:""}}).filter("firstDateIsZero",function(){return function(date){return"0"==date[0]?"0"+(parseInt(date[1])-1).toString():(parseInt(date)-1).toString()}}).filter("dateOffset",function(){return function(){return function(date,offset){var result,type="+"==offset.charAt(0)?"add":"subtract",days=offset.substring(1);switch(type){case"add":result=new Date(moment(date).add(days,"days"));break;case"subtract":result=new Date(moment(date).subtract(days,"days"))}return result}}()}).filter("plaintext",function(){return function(text){return text?String(text).replace(/<[^>]+>/gm,""):""}}).filter("interpolate",function($interpolate){return function(){return function(template,myObject){return $interpolate(template)(myObject)}}()}).filter("unique",function(){return function(items,filterOn){if(!1===filterOn)return items;if((filterOn||angular.isUndefined(filterOn))&&angular.isArray(items)){var newItems=[],extractValueToCompare=function(item){return angular.isObject(item)&&angular.isString(filterOn)?item[filterOn]:item};angular.forEach(items,function(item){for(var isDuplicate=!1,i=0;i-1||image.indexOf("wyndham-extra-holidays.leonardocontentcloud.com")>-1)?image.replace("_S.jpg","_H.jpg").replace("_R.jpg","_H.jpg"):image:""}}).filter("toArray",function(){return function(obj,addKey){return angular.isObject(obj)?!1===addKey?Object.keys(obj).map(function(key){return obj[key]}):Object.keys(obj).map(function(key){var value=obj[key];return angular.isObject(value)?Object.defineProperty(value,"$key",{enumerable:!1,value:key}):{$key:key,$value:value}}):obj}}).filter("properCaps",function(){var _skip=["to","or","and","of"];return function(str){if(void 0===str||"boolean"==typeof str)return"";var frags=str.split("_");return frags.length<2&&(frags=frags[0].split("-")),frags=frags.map(function(frag){return _skip.indexOf(frag)>0?frag:frag.charAt(0).toUpperCase()+frag.slice(1)}),frags.join(" ").replace("Shell").replace("Us","US").replace("St ","St. ")}}).filter("orderBySearch",function(){return function(input,text){return text?input.sort(function(a,b){return a.length-b.length}):input}}).filter("trustAsHTML",["$sce",function($sce){return function(text){return text?$sce.trustAsHtml(text.replace(/\\"/g,'"').replace("®","®").replace("u00ae","®").replace("u2019","'").replace("u2013","-").replace("’","'").replace("á","á").replace("ú","ú").replace("é","é").replace(/\\/g,"")):""}}]).filter("safeHTML",function($filter){return function(data){return data?data.replace(/\n\r?/g,"
").replace(/\\"/g,'"').replace("®","®").replace("u00ae","®").replace("u2019","'").replace("u2013","-").replace("’","'"):data}}).filter("encodeURIComponent",function(){return window.encodeURIComponent}).filter("tagURL",function(){return window._tag_url||function(){}}).filter("toSlug",function(){return function(input,skipInvalid){if(input){var slug=input.toLowerCase().trim();return slug=slug.replace(/&/g,"and"),slug=slug.replace(/'/g,""),skipInvalid||(slug=slug.replace(/[^a-z0-9\s-]/g," ")),slug=slug.replace(/[\s-]+/g,"-"),"-"==slug.charAt(slug.length-1)&&(slug=slug.substr(0,slug.length-1)),slug}}}).filter("tel",function(){return function(tel){if(!tel)return"";var internationalCodes=["+61","+64","+62","+66","+679","+52"];for(var i in internationalCodes)if(tel.startsWith(internationalCodes[i]))return tel.replace(/-/g," ");var value=tel.toString().trim().replace("(","").replace(") ","-").replace(")","-").replace(/^\+/,"").replace(/-/g,"");if(value.match(/[^0-9]/))return value;var country,city,number;switch(value.length){case 10:country=1,city=value.slice(0,3),number=value.slice(3);break;case 11:1==value[0]?(country=value[0],city=value.slice(1,4),number=value.slice(4)):(country=value.slice(0,2),city=value.slice(2,4),number=value.slice(4));break;default:value=value.replace(/[^0-9]/g,"");var finalValue=[];return value=0==value.indexOf("011")?value.slice(3,value.length):value,value=value.reversePhone(),finalValue.push(value.slice(0,4)),finalValue.push(value.slice(4,7)),finalValue.push(value.slice(7,10)),finalValue.push(value.slice(10,value.length)),("+"+finalValue.join(" ").reversePhone()).replace("+ ","+")}return 1!=country&&country||(country="",number=number.slice(0,3)+"-"+number.slice(3)),(""==country?"("+city+") "+number:"+"+country+" "+city+" "+number).trim()}})}(),function(){"use strict";function AlertService($mdDialog,$timeout){var _alert={};return{fire:function(alert){_alert=$mdDialog.alert().title(alert.title||"Attention").textContent(alert.message).clickOutsideToClose(!0).ok("Close").targetEvent(alert.ev),$timeout(function(){alert.noHide||$mdDialog.hide()},alert.duration||3500),$mdDialog.show(_alert).finally(function(){_alert=void 0})},toast:function(alert){_alert=$mdToast.show($mdToast.simple().position("bottom").textContent(alert.message).action("Dismiss").hideDelay(alert.noHide?0:3e3).toastClass(alert.className||"")),alert.callback&&_alert.then(alert.callback)}}}angular.module("explorer.services.alert",[]).service("Alert",["$mdDialog","$timeout",AlertService])}(),function(){"use strict";function StoriesFactory($http,$window,appConfig,Alert,Settings){return{get:function(listName,objectId){return listName=listName||null,objectId=objectId||$window.SITE_ID,$http({url:appConfig.api+"site/"+objectId+"/"+listName,method:"POST",dataType:"json",data:{task:"get"+listName,objectId:objectId},headers:appConfig.headers})}}}function PersonFactory($http,$window,$localStorage,appConfig,Alert,Settings){var _user={};return{submitForm:function(formName,formData){return $http({url:appConfig.api,method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:{task:"submit"+formName,siteId:$window.SITE_ID,data:formData},headers:appConfig.headers})},login:function(user,callback){$http({url:appConfig.api,method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:{task:"login",email:user.email,pass:user.password},headers:appConfig.headers}).success(function(data,status,headers,config){"ok"==data.status?callback(data):(Alert.fire({message:"There was a problem with your username/password."}),callback(data))}).error(function(data,status,headers,config){Alert.fire({message:"There was a problem. Please try again later."})})},register:function(user,callback){$http({url:appConfig.api,method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:{task:"register",reservationId:Settings.get("reservationId"),email:user.email,password:user.password},headers:appConfig.headers}).success(function(data,status,headers,config){"ok"==data.status?callback(data):Alert.fire({message:"There was a problem with your username/password."})}).error(function(data,status,headers,config){Alert.fire({message:"There was a problem registering. Please try again later."})})},getTripMessages:function(tripId,callback){$http({url:appConfig.api,method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:{task:"getTripMessages",tripId:tripId,token:Settings.get("token")},headers:appConfig.headers}).success(function(data,status,headers,config){"ok"==data.status?callback(data):Alert.fire({message:"Error getting messages."})}).error(function(data,status,headers,config){Alert.fire({message:"There was a problem getting your messages. Please try again later."})})},getMessages:function(callback){$http({url:appConfig.api,method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:{task:"getMessages",token:Settings.get("token")},headers:appConfig.headers}).success(function(data,status,headers,config){"ok"==data.status?callback(data):Alert.fire({message:"Error getting messages."})}).error(function(data,status,headers,config){Alert.fire({message:"There was a problem getting your messages. Please try again later."})})},getMessageById:function(objectId,callback){$http({url:appConfig.api,method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:{task:"getMessageById",objectId:objectId,token:Settings.get("token")},headers:appConfig.headers}).success(function(data,status,headers,config){"ok"==data.status?callback(data):(Alert.fire({message:"Error getting message."}),callback(null))}).error(function(data,status,headers,config){Alert.fire({message:"There was a problem getting your messages. Please try again later."})})},getArchiveMessages:function(callback){$http({url:appConfig.api,method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:{task:"getArchiveMessages",token:Settings.get("token"),model:"messages"},headers:appConfig.headers}).success(function(data,status,headers,config){"ok"==data.status?callback(data):Alert.fire({message:"Error getting messages."})}).error(function(data,status,headers,config){Alert.fire({message:"There was a problem getting your messages. Please try again later."})})},getArchiveMessageById:function(objectId,callback){$http({url:appConfig.api,method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:{task:"getArchiveMessageById",objectId:objectId,token:Settings.get("token"),model:"messages"},headers:appConfig.headers}).success(function(data,status,headers,config){"ok"==data.status?callback(data):(Alert.fire({message:"Error getting message."}),callback(null))}).error(function(data,status,headers,config){Alert.fire({message:"There was a problem getting your messages. Please try again later."})})},removeMessageById:function(objectId,callback){$http({url:appConfig.api,method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:{task:"removeMessageById",objectId:objectId,token:Settings.get("token")},headers:appConfig.headers}).success(function(data,status,headers,config){"ok"==data.status?callback(data):Alert.fire({message:"Error getting messages."})}).error(function(data,status,headers,config){Alert.fire({message:"There was a problem getting your messages. Please try again later."})})},removeArchiveMessageById:function(objectId,callback){$http({url:appConfig.api,method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:{task:"removeArchiveMessageById",objectId:objectId,token:Settings.get("token")},headers:appConfig.headers}).success(function(data,status,headers,config){"ok"==data.status?callback(data):Alert.fire({message:"Error updating."})}).error(function(data,status,headers,config){Alert.fire({message:"There was a problem getting your messages. Please try again later."})})},clickMessageCTA:function(objectId,callback){$http({url:appConfig.api,method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:{task:"clickMessageCTA",objectId:objectId,token:Settings.get("token")},headers:appConfig.headers}).success(function(data,status,headers,config){"ok"==data.status&&callback(data)}).error(function(data,status,headers,config){Alert.fire({message:"There was a problem getting your messages. Please try again later."})})},findReservation:function(user,callback){Settings.set("has_user_reservations",!1),$http({url:appConfig.api,method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:{task:"findReservation",uniqueId:user.uniqueId,lastName:user.lastName,token:Settings.get("token")},headers:appConfig.headers}).success(function(data,status,headers,config){"ok"==data.status&&callback(data)}).error(function(data,status,headers,config){Alert.fire({message:"There was a problem logging you in. Please try again later."})})},findGuestReservation:function(user,callback){return Settings.set("has_user_reservations",!1),$http({url:appConfig.api,method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:{task:"findGuestReservation",uniqueId:user.uniqueId,lastName:user.lastName},headers:appConfig.headers}).success(function(data,status,headers,config){}).error(function(data,status,headers,config){Alert.fire({message:"There was a problem looking up your reservation. Please try again later."})})},getReservationById:function(resId,callback){if(Settings.get("has_user_reservation_"+resId))return callback(Settings.get("user_reservation_"+resId));$http({url:appConfig.api,method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:{task:"getReservationById",token:Settings.get("token"),resId:resId},headers:appConfig.headers}).success(function(data,status,headers,config){"ok"==data.status?(Settings.set("has_user_reservation_"+resId,!0),Settings.set("user_reservation_"+resId,data),callback(data)):callback(null)}).error(function(data,status,headers,config){callback(null),Alert.fire({message:"There was a problem logging you in. Please try again later."})})},listAllReservations:function(options,callback){options=options||{},options.limit=options.limit||2,$http({url:appConfig.api,method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:{task:"allReservations",limit:options.limit,token:Settings.get("token")},headers:appConfig.headers}).success(function(data,status,headers,config){"ok"==data.status&&callback(data)}).error(function(data,status,headers,config){callback(null),Alert.fire({message:"There was a problem logging you in. Please try again later."})})},setPerson:function(user){_user=user},getProfiles:function(callback){$http({url:appConfig.api,method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:{task:"getProfiles",token:Settings.get("token")},headers:appConfig.headers}).success(function(data,status,headers,config){"ok"==data.status?callback(data):Alert.fire({message:"Could not find profile."})}).error(function(data,status,headers,config){Alert.fire({message:"There was a problem logging you in. Please try again later."}),callback(null)})},getUserLocalFavorites:function(options,callback){$http({url:appConfig.api,method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:{task:"getUserFavorites",limit:options.limit||3,hotelcode:options.hotelcode,token:Settings.get("token")},headers:appConfig.headers}).success(function(data,status,headers,config){"ok"==data.status?callback(data):Alert.fire({message:"Error getting favorites. Please try again later."})}).error(function(data,status,headers,config){callback(null),Alert.fire({message:"Error getting favorites. Please try again later."})})},getUserFavorites:function(options,callback){$http({url:appConfig.api,method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:{task:"getUserFavorites",token:Settings.get("token"),tripId:options.tripId},headers:appConfig.headers}).success(function(data,status,headers,config){"ok"==data.status?callback(data):Alert.fire({message:"Error getting favorites. Please try again later."})}).error(function(data,status,headers,config){callback(null),Alert.fire({message:"Error getting favorites. Please try again later."})})},updateUserFavorite:function(placeId,category,callback){$http({url:appConfig.api,method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:{task:"updateUserFavorite",placeId:placeId,category:category,token:Settings.get("token")},headers:appConfig.headers}).success(function(data,status,headers,config){"ok"==data.status?(Settings.set("user_favorites_no_update",!1),callback(data)):Alert.fire({message:"Error updating favorite. Please try again later."})}).error(function(data,status,headers,config){callback(null),Alert.fire({message:"Error updating favorite. Please try again later."})})}}}function DestinationsFactory($rootScope,$http,$q,$window,$localStorage,appConfig,Alert,Settings){var regionId=$window.RID;return{get:function(listName,objectId,childId,language){return language=language||"",language==objectId&&(language=""),objectId=objectId||"",childId=childId||"",$http({url:appConfig.api+"destinations/"+$window.RID+"/"+listName+(objectId?"/"+("string"==typeof objectId?objectId:objectId.id||objectId.destinationId):"")+(childId?"/"+childId:""),method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:{task:"get"+listName,objectId:objectId,childId:childId,regionId:regionId,language:language},headers:appConfig.headers})},getDestinationsByDestinationIds:function(destinationIds){return $http({url:appConfig.api+"destinations/getDestinationsByDestinationIds",method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:{task:"getDestinationsByDestinationIds",destinationIds:destinationIds},headers:appConfig.headers})}}}function PlacesFactory($rootScope,$http,$q,$window,$localStorage,appConfig,Alert,Settings){ var places=[],destinations=[],cityId=null;return{autocomplete:function(query,callback){$http({url:appConfig.api,method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:{task:"autocomplete",q:query},headers:appConfig.headers}).success(function(data,status,headers,config){"ok"==data.status?callback(data):Alert.fire({message:"No Results"})}).error(function(data,status,headers,config){callback(null)})},get:function(listName,objectId,propertyId,isPreview){if(isPreview=isPreview||"",propertyId=propertyId||"",objectId=objectId||$window.RID,Settings.get("has_"+listName+objectId+propertyId)){var deferred=$q.defer();return deferred.resolve({data:Settings.get(listName+objectId+propertyId)}),deferred.promise}return $http({url:appConfig.api+"region/"+objectId+"/"+listName,method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:{task:"get"+listName,objectId:objectId,propertyId:propertyId,isPreview:isPreview},headers:appConfig.headers}).success(function(data,status,headers,config){"ok"==data.status&&(Settings.set("has_"+listName+objectId+propertyId,!0),Settings.set(listName+objectId+propertyId,data))})},markView:function(listName,id){return $http({url:appConfig.api,method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:{task:"markView"+listName,id:id,token:Settings.get("token")},headers:appConfig.headers})},addErrorPage:function(url,referrer){return $http({url:appConfig.api,method:"POST",dataType:"json",data:{task:"addErrorPage",siteId:window.SITE_ID,url:url,referrer:referrer},headers:appConfig.headers})},setCityId:function(_cityId){cityId=_cityId},getCityId:function(slug){return slug?destinations[slug]:cityId},getPlaces:function(){return places},getNearbyResorts:function(){return $http({url:appConfig.api+"regions/nearbyResorts/"+$window.RID,method:"GET",dataType:"json",contentType:"application/json; charset=utf-8",data:{task:"nearbyResorts",objectId:$window.RID},headers:appConfig.headers}).success(function(data,status,headers,config){"ok"==data.status&&(Settings.set("has_nearby_resorts",!0),Settings.set("nearby_resorts",data.regions),$rootScope.$broadcast("triggerRegionsLoaded",data.regions))}).error(function(data,status,headers,config){})},getPropertyDetails:function(objectId,callback){var order="object"==typeof objectId?objectId.order:null;objectId="object"==typeof objectId?objectId.hotelcode:objectId,$http({url:appConfig.api+"/property/details/"+objectId,method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:{task:"getPropertyDetails",objectId:objectId},headers:appConfig.headers}).success(function(data,status,headers,config){"ok"==data.status?(order&&(data.order=order),callback(data)):Alert.fire({message:"No Results"})}).error(function(data,status,headers,config){callback(null)})},getMetaPropertyDetails:function(objectId){if(Settings.get("hasCurrentListing"))return!0;"object"==typeof objectId&&objectId.order;return objectId="object"==typeof objectId?objectId.hotelcode:objectId,$http({url:appConfig.api+"property/details/"+objectId,method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:{task:"getPropertyDetails",objectId:objectId},headers:appConfig.headers}).success(function(data,status,headers,config){"ok"==data.status?(Settings.set("hasCurrentListing",!0),Settings.set("currentListing",data.property)):Alert.fire({message:"No Results"})}).error(function(data,status,headers,config){callback(null)})},getListingById:function(id){angular.forEach(places,function(place){if(place.id==id)return place})},all:function(query,callback){return $http({url:appConfig.api,method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:{task:"placeSearch",q:query},headers:appConfig.headers}).success(function(data,status,headers,config){"ok"==data.status?(places=data.places.map(function(entry){return entry._name=angular.lowercase(entry.name),entry._city=angular.lowercase(entry.city),entry._address=angular.lowercase(entry.formatted_address.AddressLine+" "+entry.formatted_address.CityName),entry._state=angular.lowercase(entry.state),entry}),angular.forEach(data.destinations,function(value,key){destinations[value.slug]=parseInt(value.id)})):Alert.fire({message:"No Results"})}).error(function(data,status,headers,config){})},getNearbyListing:function(slug){return $http({url:appConfig.api,method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:{task:"getNearbyListing",token:Settings.get("token"),slug:slug},headers:appConfig.headers}).success(function(data,status,headers,config){"ok"==data.status?(Settings.set("has_place_id_listing_"+slug,!0),Settings.set("place_id_listing_"+slug,data)):Alert.fire({message:"No Results"})}).error(function(data,status,headers,config){})},getPlaceIdListing:function(placeId,callback){if(Settings.get("has_place_id_listing_"+placeId))return callback(Settings.get("place_id_listing_"+placeId));$http({url:appConfig.api,method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:{task:"getPlaceIdListing",token:Settings.get("token"),placeId:placeId},headers:appConfig.headers}).success(function(data,status,headers,config){"ok"==data.status?(Settings.set("has_place_id_listing_"+placeId,!0),Settings.set("place_id_listing_"+placeId,data),callback(data)):Alert.fire({message:"No Results"})}).error(function(data,status,headers,config){callback(null)})},getPropertyDirections:function(hotelcode,callback){$http({url:appConfig.api,method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:{task:"getPropertyDirections",hotelcode:hotelcode},headers:appConfig.headers}).success(function(data,status,headers,config){"ok"==data.status?callback(data):Alert.fire({message:"No Results"})}).error(function(data,status,headers,config){callback(null)})},getPlaceDirections:function(placeId,callback){$http({url:appConfig.api,method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:{task:"getPlaceDirections",placeId:placeId},headers:appConfig.headers}).success(function(data,status,headers,config){"ok"==data.status?callback(data):Alert.fire({message:"No Results"})}).error(function(data,status,headers,config){callback(null)})},getPropertyByMessageId:function(objectId,callback){$http({url:appConfig.api,method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:{task:"getPropertyByMessageId",objectId:objectId,token:Settings.get("token")},headers:appConfig.headers}).success(function(data,status,headers,config){"ok"==data.status?callback(data):Alert.fire({message:"Error getting messages."})}).error(function(data,status,headers,config){Alert.fire({message:"There was a problem getting your messages. Please try again later."})})},getSpecials:function(objectId){return objectId=objectId||"",$http({url:appConfig.api,method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:{task:"getSpecials",objectId:objectId,token:Settings.get("token")},headers:appConfig.headers}).success(function(data){Settings.set("specials",data.specials)}).error(function(data,status,headers,config){Alert.fire({message:"There was a problem getting your messages. Please try again later."})})},getDestinationsList:function(){return $http({url:appConfig.api,method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:{task:"getDestinationsList",token:Settings.get("token")},headers:appConfig.headers}).success(function(data){Settings.set("hasDestinationsList",!0),Settings.set("destinationsList",data.destinations),Settings.set("featuredResortsList",data.resorts)}).error(function(data,status,headers,config){})},getDestinationDetails:function(objectId){return $http({url:appConfig.api,method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:{task:"getDestinationDetails",objectId:objectId,token:Settings.get("token")},headers:appConfig.headers}).success(function(data){Settings.set("hasDestinationDetails_".objectId,!0),Settings.set("destinationDetails_".objectId,data.destinations)}).error(function(data,status,headers,config){})},nearby:function(options,callback){if(options=options||{},options.task="nearby",options.id=options.listingId||window.PROPERTY_ID,Settings.get("has_nearby_listings_"+options.category+"_"+options.id))return callback(Settings.get("nearby_listings_"+options.category+"_"+options.id));$http({url:appConfig.api+"nearby/property/"+options.id+"/"+options.category,method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:options,headers:{"Content-Type":"application/json"}}).success(function(data,status,headers,config){"ok"==data.status&&(Settings.set("has_nearby_listings_"+options.category+"_"+options.id,!0),Settings.set("nearby_listings_"+options.category+"_"+options.id,data),callback(data))}).error(function(data,status,headers,config){callback(null)})},nearbyDestination:function(options,callback){if(options=options||{},options.task="nearbyDestination",options.token=Settings.get("token"),Settings.get("has_destination_nearby_listings_"+options.category+"_"+options.destinationId))return Settings.get("destination_nearby_listings_"+options.category+"_"+options.destinationId);$http({url:appConfig.api,method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:options,headers:{"Content-Type":"application/json"}}).success(function(data,status,headers,config){"ok"==data.status&&(Settings.set("has_destination_nearby_listings_"+options.category+"_"+options.destinationId,!0),Settings.set("destination_nearby_listings_"+options.category+"_"+options.destinationId,data),callback(data))}).error(function(data,status,headers,config){})}}}angular.module("explorer.services.data",[]).factory("Person",["$http","$window","$localStorage","appConfig","Alert","Settings",PersonFactory]).factory("Places",["$rootScope","$http","$q","$window","$localStorage","appConfig","Alert","Settings",PlacesFactory]).factory("Destinations",["$rootScope","$http","$q","$window","$localStorage","appConfig","Alert","Settings",DestinationsFactory]).factory("Stories",["$http","$window","appConfig","Alert","Settings",StoriesFactory])}(),function(){"use strict";function Focus($timeout,$window){return function(id){$timeout(function(){var element=$window.document.getElementById(id);element&&element.focus()})}}function Settings($rootScope,$state,$document,$focus){var _storage={};new Date(moment()),new Date(moment().add(2,"days"));return{hideKeyboard:function(){document.activeElement.blur();for(var inputs=document.querySelectorAll("input"),i=0;i-1&&(_promoId=_promoId.split("?")[0]),"object"==typeof _promoId&&(_promoId=_promoId[0]),$window.PROMOID=_promoId,$window.PROMOID.toLowerCase()){case"bf2020":case"bf2020dt":case"bd2020pp":case"bf2020soc":case"bf22":case"hol2020":case"psearch":break;case"psearch15":case"eh_20off":$window.PROMOID="PSearch15",15e3;break;case"psearch20":case"eh_20off":$window.PROMOID="PSearch20",15e3}$rootScope.$emit("updatePromoCode",$window.PROMOID)}}function handlePopupData(popupData){if(popupData&&!Settings.get("displayed_"+popupData.id)&&!$cookies.get("optout_"+popupData.id)){var currentTime=new Date,expireTime=new Date,lastVisit=$cookies.get("popup_"+popupData.id),showPopup=!1;expireTime.setHours(expireTime.getHours()+19080);var popup=$mdDialog.confirm({controller:function($scope,$cookies,$mdDialog,popupData){$scope.popup=popupData,$scope.closeDialog=function(ev){$mdDialog.hide()},$scope.optOut=function(ev){$cookies.put("optout_"+popupData.id,moment(currentTime).format("YYYY-MM-DD"),{expires:expireTime,secure:!0}),$mdDialog.hide()}},templateUrl:"app/cards/pop-up.html",locals:{popupData:popupData},parent:angular.element(document.body),clickOutsideToClose:"1"==popupData.clickAwayToClose});if($cookies.put("popup_"+popupData.id,moment(currentTime).format("YYYY-MM-DD"),{expires:expireTime,secure:!0}),lastVisit&&(lastVisit=new Date(lastVisit)),"all"==popupData.urlDisplay||"home"==popupData.urlDisplay&&"/"==$window.location.pathname||"show"==popupData.urlDisplay&&popupData.displayUrls&&popupData.displayUrls.indexOf($window.location.pathname)>-1){switch(popupData.frequency){case"always":showPopup=!0;break;case"once":lastVisit||(showPopup=!0);break;case"daily":(!lastVisit||moment().diff(moment(lastVisit),"days")>1)&&(showPopup=!0);break;case"weekly":(!lastVisit||moment().diff(moment(lastVisit),"weeks")>=1)&&(showPopup=!0);break;case"monthly":(!lastVisit||moment().diff(moment(lastVisit),"months")>=1)&&(showPopup=!0)}showPopup&&("always"!=popupData.frequency&&Settings.set("displayed_"+popupData.id,!0),popupData.delay=popupData.delay||3e3,$timeout(function(){$analytics.eventTrack("Pop-Up Open",{category:"Pop-Up Interaction",label:popupData.title}),$mdDialog.show(popup).then(function(){})},parseInt(popupData.delay)),parseInt(popupData.duration)&&$timeout(function(){$mdDialog.hide(),$analytics.eventTrack("Auto Close",{category:"Pop-Up Interaction",label:popupData.title,value:3e3+parseInt(popupData.duration)})},parseInt(popupData.delay)+parseInt(popupData.duration)))}}}function openSidenav(){$mdSidenav("right").open()}function closeSidenav(){$mdSidenav("right").close()}function isSidenavOpen(){return $mdSidenav("right").isOpen()}function createFilterFor(query){var lowercaseQuery=angular.lowercase(query);return lowercaseQuery=lowercaseQuery.replace(/[^a-zA-Z0-9 ]/g,""),function(item){return item.value.indexOf(lowercaseQuery)>-1}}function loadAll(){if(searchContext.length>0)return searchContext;regions=Settings.get("nearby_resorts");var tmpSlug="";return angular.forEach(regions,function(region,regionName){angular.forEach(region,function(hotels){angular.forEach(hotels,function(hotel){hotel.cityName&&(tmpCities.indexOf(hotel.cityName+", "+hotel.stateName)>-1?citiesContext[tmpCities.indexOf(hotel.cityName+", "+hotel.stateName)].resortCount++:(tmpSlug=$filter("toSlug")(hotel.cityName),window.PORTAL_DESTINATIONS_SLUGS&&window.PORTAL_DESTINATIONS_SLUGS.includes(tmpSlug)&&(tmpCities.push(hotel.cityName+", "+hotel.stateName),citiesContext.push({name:hotel.cityName+", "+hotel.stateName,resortCount:1,url:"/"+tmpSlug}))),hotel.name&&hotel.address&&(tmpHotel={id:hotel.id,name:hotel.name,city:hotel.cityName,state:hotel.stateName,region:regionName,country:hotel.address.addressCountry,postalCode:hotel.address.postalCode,telephone:hotel.telephone,image:hotel.image,url:"/resorts/"+$filter("toSlug")(hotel.stateName)+"/"+$filter("toSlug")(hotel.cityName)+"/"+hotel.slug,brand:hotel.brand||$window.APP_CLIENT},hotel.additionalProperty&&angular.forEach(hotel.additionalProperty,function(property){switch(property.name){case"Additional Locations":tmpHotel.additionalLocations=property.value}}),hotel.alternateName&&(tmpHotel.alternateName=hotel.alternateName.join(" ")),resortsContext.push(tmpHotel)))})})}),angular.forEach(resortsContext,function(context){searchContext.push(context)}),angular.forEach(citiesContext,function(context){searchContext.push(context)}),searchContext=searchContext?searchContext.map(function(item){return item.value=item.value||"",item.value+=" "+item.name.toLowerCase()+" "+(item.city?item.city.toLowerCase():"")+" "+(item.state?item.state.toLowerCase():"")+" "+(item.region?item.region.toLowerCase():"")+" "+(item.country?item.country.toLowerCase():"")+" "+(item.additionalLocations?item.additionalLocations.toLowerCase():"")+" "+(item.alternateName?item.alternateName.toLowerCase():"")+" "+(item.brand?item.brand.toLowerCase():"")+" "+item.telephone+" "+item.postalCode,item.value=item.value.replace(/[^a-zA-Z0-9 ]/g,""),item}):[]}function resetLanguage(ev){$analytics.eventTrack("Reset Language",{category:"Language Selection",label:$window.DEFAULT_LANG||"en"}),$window.location.href=$window.location.href.split("?")[0].split("#")[0]+"?#googtrans(en|en)",$cookies.remove("currentLanguage"),$cookies.remove("googtrans"),$cookies.remove("googtrans",{path:"/",domain:".brewerdigitalmarketing.com"})}function refreshHeaderToolbarHeight(delay){try{$timeout(function(){document.getElementById("header-toolbar")?$rootScope.headerToolbarHeight=document.getElementById("header-toolbar").clientHeight+"px":$rootScope.headerToolbarHeight="0px",document.getElementById("sitewide-notice")?$rootScope.sitewideNoticeHeight=document.getElementById("sitewide-notice").clientHeight+"px":$rootScope.sitewideNoticeHeight="0px"},window.delayRoutingTrigger?delay||100:300)}catch(e){console.log(e),$rootScope.headerToolbarHeight="162px",$rootScope.sitewideNoticeHeight="34px"}}function exit(uri){$timeout(function(){window.location.href=uri},800)}function go(state,params){params=params||{},$state.go(state,params)}function goBack(){$state.go($rootScope.header.backState.pop()||"welcome",$rootScope.header.backParams.pop()||{}),$rootScope.header.deferStackTrace=!0}function close(){Settings.focus(),$state.go($rootScope.header.backState.pop()||"welcome",$rootScope.header.backParams.pop()||{}),$rootScope.header.deferStackTrace=!0}if(Places.getNearbyResorts(),$rootScope.mediaMode={},$rootScope.defaultLanguage=$window.DEFAULT_LANGUAGE||"en",$rootScope.appDomain=$window.APP_DOMAIN,$window.innerWidth>0&&($window.innerWidth>1440&&($rootScope.mediaMode.default=!0),$window.innerWidth>599&&($rootScope.mediaMode.nonMobile=!0),$window.innerWidth<600?($rootScope.mediaMode.xs=!0,$window.mobileTabletDevice=!0):$window.innerWidth<960?($rootScope.mediaMode.sm=!0,$window.mobileTabletDevice=!0):$window.innerWidth<1280?$rootScope.mediaMode.md=!0:$window.innerWidth<1920?$rootScope.mediaMode.lg=!0:$rootScope.mediaMode.xl=!0),$rootScope.windowWidth=$window.innerWidth,$rootScope.windowHeight=$window.innerHeight,angular.element($window).on("resize",function(){$window.innerWidth>0&&($rootScope.mediaMode={},$window.innerWidth>1440&&($rootScope.mediaMode.default=!0),$window.innerWidth>599&&($rootScope.mediaMode.nonMobile=!0),$window.innerWidth<600?$rootScope.mediaMode.xs=!0:$window.innerWidth<960?$rootScope.mediaMode.sm=!0:$window.innerWidth<1280?$rootScope.mediaMode.md=!0:$window.innerWidth<1920?$rootScope.mediaMode.lg=!0:$rootScope.mediaMode.xl=!0)}),$rootScope.$on("triggerRegionsLoaded",function(data){$timeout(function(){$rootScope.highlightTabs&&$rootScope.highlightTabs[$location.path()]>-1&&($rootScope.selectedIndex=$rootScope.highlightTabs[$location.path()])},50)}),$location.hash()&&$window.hashReplacements&&$window.hashReplacements.indexOf($location.hash())&&$timeout(function(){$anchorScroll($window.hashReplacements[$location.hash()])},3e3),1==$window.LANG_SUPPORT){if($location.hash().indexOf("googtrans")>-1){var _currentLanguage=$location.hash().replace("googtrans(en|","").replace(")","");if(console.log("here",$window.DEFAULT_LANG,_currentLanguage,document.querySelectorAll(".notranslate")),$window.DEFAULT_LANG&&$window.DEFAULT_LANG==_currentLanguage?document.querySelectorAll(".notranslate2").forEach(function(item){item.className="notranslate"}):document.querySelectorAll(".notranslate").forEach(function(item){item.className="notranslate2"}),"en"!=_currentLanguage||$window.DEFAULT_LANG&&"en"!=$window.DEFAULT_LANG){var expireDate=new Date;expireDate.setMinutes(expireDate.getMinutes()+30),$cookies.put("currentLanguage",_currentLanguage,{secure:!0,expires:expireDate})}else $cookies.remove("currentLanguage"),$cookies.remove("googtrans"),$cookies.remove("googtrans",{path:"/",domain:".brewerdigitalmarketing.com"}),$cookies.remove("googtrans",{path:"/",domain:$window.location.hostname.replace("www.",".")});$timeout(function(){$location.hash("")},4500)}$window.currentLanguage=$cookies.get("currentLanguage"),$rootScope.currentLanguage=$cookies.get("currentLanguage"),!$rootScope.currentLanguage||$window.DEFAULT_LANG&&$rootScope.currentLanguage==$window.DEFAULT_LANG||"null"==$rootScope.currentLanguage?"en"!=_currentLanguage||$window.DEFAULT_LANG&&"en"!=$window.DEFAULT_LANG?$rootScope.currentLanguage&&($rootScope.googleTranslateActive=!0):($cookies.remove("googtrans"),$cookies.remove("googtrans",{path:"/",domain:".brewerdigitalmarketing.com"}),$cookies.remove("googtrans",{path:"/",domain:$window.location.hostname.replace("www.",".")})):$rootScope.googleTranslateActive=!0}($location.search().lid||$location.search().LID||$location.search().Lid)&&($window.LID=$location.search().lid||$location.search().LID||$location.search().Lid,$analytics.eventTrack($location.search().lid||$location.search().LID||$location.search().Lid,{category:"phone"}),Places.get("SiteDynamicPhone",$window.LID).then(function(response){"ok"==response.data.status&&response.data.phone&&($rootScope.headerPhone=response.data.phone)}));var foundIdentifier=!1;if(($location.search().identifier||$location.search().Identifier)&&$location.url().indexOf("memberbenefit")>-1&&($window.PROMOID=$location.search().identifier||$location.search().Identifier,$analytics.eventTrack($window.PROMOID,{category:"memberbenefit"}),foundIdentifier=!0,Places.get("SiteMemberBenefit",$window.PROMOID).then(function(response){"ok"==response.data.status&&response.data.name&&$rootScope.$broadcast("triggerUpdateH1",response.data.name)})),($location.search().discount||$location.search().Discount)&&($window.DISCOUNTCODE=$location.search().discount||$location.search().Discount,$window.RATEPLANID=$location.search().ratePlanId||$location.search().RatePlanId,Alert.fire({message:'Discount: "'+$window.DISCOUNTCODE.toUpperCase()+'" applied!'})),($location.search().gaevent||$location.search().GAEVENT||$location.search().Gaevent)&&($window.GAEVENT=$location.search().gaevent||$location.search().GAEVENT||$location.search().Gaevent),($location.search().promoid||$location.search().PROMOID||$location.search().Promoid)&&$analytics.eventTrack($location.search().promoid||$location.search().PROMOID||$location.search().Promoid,{category:"promotion"}),($location.search().prodid||$location.search().ProdId||$location.search().prodId)&&($window.PRODUCTID=$location.search().prodid||$location.search().ProdId||$location.search().prodId),!foundIdentifier&&($location.search().Identifier||$location.search().identifier))if($window.PROMOID=$location.search().Identifier||$location.search().identifier,"loc"==$window.PROMOID)$window.PROMOID=null;else switch($window.PROMOID.toLowerCase()){case"spg19":Alert.fire({message:"Your Spring Savings have been activated!"});break;case"flip19":Alert.fire({message:"FLIP19 has been applied! Save up to 30% when you book by Feb. 28, 2019."});break;case"ski19":Alert.fire({message:"Ski resort savings have been applied!"});break;case"beski19":Alert.fire({message:"Ski Resort Savings Applied!"});break;case"besum19":Alert.fire({message:"Your Summer Savings are activated!"});break;case"sum19":Alert.fire({message:"Summer Resort Savings Applied!"});break;case"befall19":Alert.fire({message:"Early Fall Savings Applied!"});break;case"fall19":Alert.fire({message:"Fall Savings Applied!"});break;case"7daysale":Alert.fire({message:"7-Day Flash Sale is LIVE!"});break;case"bf2019":Alert.fire({message:"Cyber Monday Savings Applied!"});break;case"hol2019":Alert.fire({message:"Holiday Savings Applied!"});break;case"flip2020":Alert.fire({message:"Flip Your Routine! Savings applied!"});break;case"spg2020":Alert.fire({message:"Early Summer Savings Have Been Applied!"});break;case"plan2020":Alert.fire({message:"Plan Now, Travel Later Savings Have Been Applied!"});break;case"fall20":Alert.fire({message:"Fall Savings are Here!"});break;case"bf2020":case"bf2020dt":case"bd2020pp":case"bf2020soc":Alert.fire({message:"Cyber Monday Deals have arrived!"});break;case"hol2020":Alert.fire({message:"Unwrap Your Holiday Savings!"});break;case"psearch":Alert.fire({message:"15% off Promo Added!"});break;case"plan21":Alert.fire({message:"Vacation Savings applied!"});break;case"discover21":Alert.fire({message:"Your Destination Savings have been activated!"});break;default:$location.search().message||Alert.fire({message:'Promo: "'+$window.PROMOID.toUpperCase()+'" activated!'})}$location.search().message&&Alert.fire({message:$location.search().message.replace("+"," "),noHide:!0}),($location.search().HotelId||$location.search().hotelId)&&($window.HOTELCODE=$location.search().HotelId||$location.search().hotelId),$rootScope.decoration=$rootScope.decoration||{},$rootScope.isDesktop=!appConfig.isMobileDevice,$rootScope.isMobile=appConfig.isMobileDevice,$rootScope.parentMenuCheck=function(item){return(!item.parent||"0"==item.parent)&&"1"==item.isActive&&"0"!=item.isMenuItem},$rootScope.getSubMenuTarget=function(slug){return slug&&0==slug.indexOf("http")?slug.indexOf($window.location.hostname)>-1&&-1==slug.indexOf(".html")?"":"_blank":""};var _menuItems=$window.APP_CONFIG.menu;$window.LANDING_PAGES&&angular.forEach($window.LANDING_PAGES,function(page){angular.forEach(_menuItems,function(menuItem){page.parent==menuItem.state&&"1"==page.isMenuItem&&"1"==page.isActive&&(menuItem.children||(menuItem.children=[]),menuItem.children.push({title:page.title,pageTitle:page.pageTitle||page.title,slug:page.slug}))})}),$rootScope.menuItems=_menuItems,$rootScope.MetaTags=MetaTags,$rootScope.header={},$rootScope.header.hasBackButton=!1,$rootScope.contentLoaded=!0,$rootScope.noHeaderImageClass="",$rootScope.openSidenav=openSidenav,$rootScope.closeSidenav=closeSidenav,$rootScope.isSidenavOpen=isSidenavOpen;var amenityIconSet={Accessible:"","Air-conditioned":"","Air Conditioned":"","Airport shuttle":"",Bar:"","Business center":"","Fitness Center":"","2 Fitness Centers":"","Exercise Gym":"","Free breakfast":"","Free Breakfast":"","Continental breakfast":"","Gift Shop":"","Nearby Shopping":"",Golf:"","Golf Nearby":"","18-hole Golf Course":"","Championship Golf Course":"","Access to Championship Golf Course":"","14-Station Driving Range":"","Free parking":"","Wi-Fi":"","Complimentary Wi-Fi":"","Free Wi-Fi":"","Free Wi-fi":"","Hot tub":"","Hot Tub":"","2 Hot Tubs":"","3 Hot Tubs":"","4 Hot Tubs":"","5 Hot Tubs":"","6 Hot Tubs":"","Indoor Hot Tub & Sauna":"","Kid-friendly":"","Full Kitchens":"","Kitchen in all rooms":"","Kitchen/Kitchenette":"","In Room Kitchens/Kitchenettes":"","Laundry service":"","Laundry Service":"","Laundry Facilities":"",Pool:"","2 Pools":"","2 Outdoor Pools":"","6 Sparkling Pools":"","Outdoor Pool":"","Heated Pool":"","Outdoor Pool with Whirlpool":"","Indoor & Outdoor Swimming Pools":"","Childrens Pool":"",Restaurant:"","Restaurant & Lobby Bar":"","Restaurant - The Toll Booth Tavern":"","Pet-friendly":"",Smoking:"","Smoke free":"","Indoor Parking":"","Free Parking":"","Valet Parking - Fee":"","Shuttle Bus":"","Shuttle to Napa":"","Disney Shuttle - Fee":""};Settings.set("amenityIconSet",amenityIconSet),$rootScope.amenityIconSet=amenityIconSet,$rootScope.search={};var regions,tmpHotel,searchContext=[],searchContext=[],tmpCities=[],citiesContext=[],resortsContext=[];$rootScope.navSearch=function(query){return searchContext.length?query.length&&$analytics.eventTrack(query,{category:"search",label:"top nav search"}):searchContext=loadAll(),query?searchContext.filter(createFilterFor(query)):null},$rootScope.navItemChange=function(item){$rootScope.search.searchText&&item&&(Settings.hideKeyboard(),$location.path(item.url),$rootScope.search.searchText="",angular.element("search-bar-autocomplete").blur())};var gdpr=$cookies.get("gdpr_agree"),hideGdpr=!1;if(!gdpr&&1!=$window.CUSTOM_GDPR){$timeout(function(){hideGdpr=!0},3e3);var linksHTML="";$window.APP_CONFIG.core&&$window.APP_CONFIG.core.footer&&($window.APP_CONFIG.core.footer.privacyLink&&(linksHTML+=' Privacy Notice'),$window.APP_CONFIG.core.footer.termsLink&&(linksHTML+=' Terms')),$mdToast.show({hideDelay:0,position:"bottom left",template:'
To personalize content and provide a safer experience, we use cookies. By using this site you agree to our use of cookies.'+linksHTML+'
Dismiss
',controller:function($mdToast){this.hideToast=function(){$mdToast.hide();var currentTime=new Date,expireTime=new Date;expireTime.setHours(expireTime.getHours()+8760),$cookies.put("gdpr_agree",moment(currentTime).format("YYYY-MM-DD"),{expires:expireTime,secure:!0})}},controllerAs:"ctrl"}).then(function(result){})}$rootScope.updateLanguage=function(language){ $analytics.eventTrack("Select Language",{category:"Language Selection",label:language}),$window.location.href=$window.location.href.split("?")[0].split("#")[0]+"?#googtrans(en|"+language+")"},$rootScope.translatePopup=function(ev){var popup=$mdDialog.confirm({controller:function($scope,$cookies,$window,$analytics,$mdDialog){$scope.updateLanguage=function(language){$analytics.eventTrack("Select Language Modal",{category:"Language Selection",label:language});var expireDate=new Date;expireDate.setMinutes(expireDate.getMinutes()+30),$cookies.put("currentLanguage",language,{secure:!0,expires:expireDate}),$window.location.href=$window.location.href.split("?")[0].split("#")[0]+"?#googtrans(en|"+language+")"},$scope.closeDialog=function(ev){$mdDialog.hide()}},templateUrl:"app/cards/translate-popup.html",parent:angular.element(document.body),targetEvent:ev,clickOutsideToClose:!0});$mdDialog.show(popup).then(function(){})},$rootScope.bookNow=function(hotel,offset,room){if(console.log("book now",hotel,offset,room),offset=offset||2,room=room||null,$window.BOOKING_URL){var checkinDate=new Date(moment(Settings.get("checkinDate"))),checkoutDate=new Date(moment(Settings.get("checkoutDate"))),options={checkin:$filter("date")(checkinDate,"MM/dd/yyyy"),checkout:$filter("date")(checkoutDate,"MM/dd/yyyy"),numAdults:1,numChildren:0,rooms:1,promoCode:$window.PROMOID||null,gaEvent:$window.GAEVENT||null,lid:$window.LID||null};hotel&&(hotel.hotelCode&&(options.hotelId=hotel.hotelCode),hotel.brand&&(options.brand=hotel.brand),hotel.slug&&(options.slug=hotel.slug),hotel.sameAs&&(options.sameAs=hotel.sameAs),hotel.geo&&(options.lat=hotel.geo.latitude,options.lng=hotel.geo.longitude)),room&&room.identifier&&(options.roomType=room.identifier),$window._booking_bar_link&&$window.open($window._booking_bar_link(options),"_blank")}},$rootScope.propertyGroupTravel=function(hotel){Settings.set("groupTravelProperty",hotel.name),$state.go("meetings")},$rootScope.getPhotoUrl=function(target,url,size,crop){if(url&&"string"==typeof url){if(target&&""!=target)var result=document.getElementsByClassName(target);if("auto"===(size=size||"200")&&target){var el=angular.element(result);return el&&el[0]?url.replace("=s0","=s"+el[0].clientWidth+(crop?"-c":"")):""}return url.replace("=s0","=s"+size+(crop?"-c":""))}};var clientId=$window.getClientId();clientId&&Settings.set("token",clientId),1==$window.LANG_SUPPORT&&$window.DEFAULT_LANG&&(!$window.currentLanguage||"en"==$window.currentLanguage&&-1==$window.location.href.indexOf("googtrans"))&&$rootScope.updateLanguage($window.DEFAULT_LANG);var contentGroup1,dimension2,firstRun=!0;$rootScope.search={},$rootScope.go=go,$rootScope.close=close,$rootScope.goBack=goBack,$rootScope.exit=exit,$rootScope.refreshHeaderToolbarHeight=refreshHeaderToolbarHeight,$rootScope.resetLanguage=resetLanguage,$rootScope.header.backState=[],$rootScope.header.backParams=[],$rootScope.data={},$rootScope.$on("triggerUpdateDecoration",function(ev,decoration){$timeout(function(){$rootScope.decoration=decoration},250)}),$rootScope.$on("triggerUpdatePromoCode",function(ev,promoCode){checkIdentifier(promoCode)}),$rootScope.$on("$stateChangeSuccess",function(ev,to,toParams,from,fromParams){$rootScope.noHeaderImageClass="";try{1!=$window.SCROLL_TOP||from.url==to.url&&from.name!==to.name||($window.scrollTo(0,0),$window.onScrollHandler&&onScrollHandler())}catch(e){console.log(e)}$timeout(function(){$rootScope.bodyClass="string"==typeof to.url&&"/"!=to.url?to.url.replace(/\//g,"").toLowerCase():"home",$rootScope.data.selectedIndex=to.data.index,checkIdentifier();try{1!=$window.SCROLL_TOP||from.url==to.url&&from.name!==to.name||($window.scrollTo(0,0),$window.onScrollHandler&&onScrollHandler()),$window.POPUP_NOTIFICATIONS?angular.forEach($window.POPUP_NOTIFICATIONS,function(popupData){handlePopupData(popupData)}):$window.POPUP_NOTIFICATION&&handlePopupData($window.POPUP_NOTIFICATION)}catch(e){console.log(e)}$location.hash()&&$timeout(function(){$anchorScroll()},1800),$window.customTracking&&"function"==typeof $window.customTracking&&$window.customTracking(to.url),to.data.pageTitle=document.title,to.data.pageTitle&&Settings.setPageTitle(to.data.pageTitle),$rootScope.header.deferStackTrace?$rootScope.header.deferStackTrace=!1:($rootScope.header.backState.push(from.name),$rootScope.header.backParams.push(fromParams)),$window.ga&&$window.ga("send","pageview",{location:$location.absUrl(),page:$location.path(),title:to.data.pageTitle||$filter("camelCaseToHuman")($location.path())}),$window.dataLayer&&(dataLayer.push({event:"content-view"}),dataLayer.push({event:"internalPageview"})),!firstRun&&$window.ga?($rootScope.decoration={},contentGroup1="hotel"==to.name?toParams.slug.ucwords():to.data.pageTitle||$filter("camelCaseToHuman")($location.path()),dimension2=contentGroup1,$window.ga("rT.send","pageview",{location:$location.absUrl(),dimension2:dimension2,dimension4:$location.path(),page:$location.path(),title:to.data.pageTitle||$filter("camelCaseToHuman")($location.path())}),$window.ga("pT.send","pageview",{location:$location.absUrl(),page:$location.path(),title:to.data.pageTitle||$filter("camelCaseToHuman")($location.path())})):firstRun=!1,$rootScope.highlightTabs&&(to.data.id?$rootScope.selectedIndex=$rootScope.highlightTabs[to.data.id]>-1?$rootScope.highlightTabs[to.data.id]:-1:to.data.state?$rootScope.selectedIndex=$rootScope.highlightTabs[to.data.state]>-1?$rootScope.highlightTabs[to.data.state]:-1:$rootScope.highlightTabs[$location.path()]>-1?$rootScope.selectedIndex=$rootScope.highlightTabs[$location.path()]:$rootScope.highlightTabs[$location.path().substring(1)]>-1?$rootScope.selectedIndex=$rootScope.highlightTabs[$location.path().substring(1)]:$rootScope.selectedIndex=-1),hideGdpr&&(hideGdpr=!1,$mdToast.hide()),refreshHeaderToolbarHeight()},400)})}String.prototype.ucwords=function(){return this.replaceAll("-"," ").replace(/^([a-z\u00E0-\u00FC])|\s+([a-z\u00E0-\u00FC])/g,function($1){return $1.toUpperCase()})},String.prototype.replaceAll=function(search,replacement){return this.replace(new RegExp(search,"g"),replacement)},String.prototype.reversePhone=function(){return this.split("").reverse().join("")},String.prototype.startsWith||(String.prototype.startsWith=function(searchString,position){return position=position||0,this.indexOf(searchString,position)===position});var uiroutermetatags;!function(t){function e(t,e,r,s){function i(t,e,r,i,o){s.prerenderReady=!1}function o(e,s){s.metaTags||t.debug('MetaTags - route: "'+s.name+'" does not contain any metatags'),r.update(s.metaTags)}function a(t,e,i,o,a,n){r.prerender.statusCode=500,s.prerenderReady=!0}function n(t,e,i){r.prerender.statusCode=404,s.prerenderReady=!0}e.MetaTags=r,e.$on("$stateChangeStart",i),e.$on("$stateChangeSuccess",o),e.$on("$stateChangeError",a),e.$on("$stateNotFound",n)}e.$inject=["$log","$rootScope","MetaTags","$window"];var r=angular.module("ui.router.metatags",["ui.router"]),s=function(){function t(){this.prefix="",this.suffix="",this.defaultTitle="",this.defaultDescription="",this.defaultKeywords="",this.defaultRobots="",this.staticProperties={},this.enableOGURL=!1}return t.prototype.setTitlePrefix=function(t){return this.prefix=t,this},t.prototype.setTitleSuffix=function(t){return this.suffix=t,this},t.prototype.setDefaultTitle=function(t){return this.defaultTitle=t,this},t.prototype.setDefaultDescription=function(t){return this.defaultDescription=t,this},t.prototype.setDefaultKeywords=function(t){return this.defaultKeywords=t,this},t.prototype.setDefaultRobots=function(t){return this.defaultRobots=t,this},t.prototype.setStaticProperties=function(t){return this.staticProperties=t,this},t.prototype.setOGURL=function(t){return this.enableOGURL=t,this},t.prototype.$get=function(){return{prefix:this.prefix,suffix:this.suffix,defaultTitle:this.defaultTitle,defaultDescription:this.defaultDescription,defaultKeywords:this.defaultKeywords,defaultRobots:this.defaultRobots,staticProperties:this.staticProperties,enableOGURL:this.enableOGURL}},t}();r.provider("UIRouterMetatags",s);var i=function(){function t(t,e,r,s,i,o,a){this.$log=t,this.UIRouterMetatags=e,this.$interpolate=r,this.$injector=s,this.$state=i,this.$location=o,this.$window=a,this.prerender={}}return t.$inject=["$log","UIRouterMetatags","$interpolate","$injector","$state","$location","$window"],t.prototype.update=function(t){var e=this;try{this.properties=angular.extend({},this.UIRouterMetatags.staticProperties),this.UIRouterMetatags.enableOGURL&&(this.properties["og:url"]=this.$location.absUrl()),t?(this.title=t.title?this.UIRouterMetatags.prefix+(this.getValue("title",t.title)||"")+this.UIRouterMetatags.suffix:this.UIRouterMetatags.defaultTitle,this.description=t.description?this.getValue("description",t.description):this.UIRouterMetatags.defaultDescription,this.keywords=t.keywords?this.getValue("keywords",t.keywords):this.UIRouterMetatags.defaultKeywords,this.robots=t.robots?this.getValue("robots",t.robots):this.UIRouterMetatags.defaultRobots,angular.forEach(t.properties,function(t,r){var s=e.getValue(r,t);s&&(e.properties[r]=s)})):(this.title=this.UIRouterMetatags.defaultTitle,this.description=this.UIRouterMetatags.defaultDescription,this.keywords=this.UIRouterMetatags.defaultKeywords,this.robots=this.UIRouterMetatags.defaultRobots),t&&t.prerender?(this.prerender.statusCode=t.prerender.statusCode?this.getValue("prerender.statusCode",t.prerender.statusCode):200,this.prerender.header=t.prerender.header?this.getValue("rerender.header",t.prerender.header):null):(this.prerender.statusCode=200,this.prerender.header=null),this.$window.prerenderReady=!0}catch(r){this.$log.error("error occured when extracting metatags:",r)}},t.prototype.getValue=function(t,e){try{return e?"number"==typeof e?e:"string"==typeof e&&0===e.trim().length?null:angular.isFunction(e)||Array.isArray(e)?this.$injector.invoke(e,this,this.$state.$current.locals.globals):this.$interpolate(e)(this.$state.$current.locals.globals):null}catch(r){return this.$log.error("error occured when trying to get the value of tag:",t,r),null}},t}();r.service("MetaTags",i),r.run(e)}(uiroutermetatags||(uiroutermetatags={})),angular.module("brewervacations-app",["ngMaterial","ngStorage","ngCookies","humanizeText","ngSanitize","mdPickers","ngMaterialDateRangePicker","ui.router","ui.router.util","ui.router.metatags","ui.carousel","sly","angular-inview","bdmMaterialCarousel","angulartics","angulartics.google.analytics","explorer.app"]).run(["$rootScope","$state","$stateParams","$window","$filter","$localStorage","$timeout","$location","$q","$anchorScroll","$mdDialog","$mdToast","$analytics","$cookies","$http","MetaTags","Person","Places","Destinations","Settings","Alert","appConfig","$mdSidenav",GuestAppInit])}(),function(){"use strict";angular.module("explorer.app").controller("ContactUsCtrl",function($state,$stateParams,Settings){var vm=this;vm.CallTel=function(tel){window.location.href="tel:"+tel},vm.MailTo=function(mail){window.location.href="mailto:"+mail},Settings.enableBackButton()}).controller("AboutCtrl",function($state,$stateParams,Settings){var vm=this;Settings.enableBackButton(),vm.property=Settings.get("currentListing")}).controller("PrivacyCtrl",function($state,$stateParams,Settings){Settings.enableBackButton()}).controller("TermsCtrl",function($state,$stateParams,Settings){Settings.enableBackButton()}).controller("OktaLoginCtrl",function($state,$stateParams,$timeout,$window,$cookies,$http,Settings,Alert,appConfig){var vm=this;if(vm.showLoginButton=!1,$cookies.get("_gaWyn_gid")&&Settings.get("oktaUserEnabled")&&Settings.get("oktaEnabledURL"))return $state.go("offerCategory",{slug:Settings.get("oktaEnabledURL")});$timeout(function(){$http({url:appConfig.api+"oktaLogin/"+$window.SESSION_ID||$cookies.get("_gaWyn_gid"),method:"GET",dataType:"json",contentType:"application/json; charset=utf-8",headers:appConfig.headers}).success(function(data,status,headers,config){"ok"==data.status?(Settings.set("oktaUserEnabled",$cookies.get("_gaWyn_gid")),Settings.set("oktaEnabledURL",data.successURL),Alert.fire({title:"Login Success",message:data.message}),$timeout(function(){if(Settings.get("oktaEnabledURL"))return $state.go("offerCategory",{slug:Settings.get("oktaEnabledURL")})},350)):(Alert.fire({title:"Login Error",message:data.message}),vm.showLoginButton=!0)}).error(function(data,status,headers,config){console.log(data,status)})},1e3)})}(),function(){"use strict";function Configure(UIRouterMetatagsProvider,$sceDelegateProvider,$mdAriaProvider){$mdAriaProvider.disableWarnings(),UIRouterMetatagsProvider.setDefaultTitle(window.APP_CLIENT).setDefaultDescription(window.PROPERTY_DESCRIPTION)}function ConfigureRoutes($stateProvider,$urlMatcherFactory){var CDN_URL=window.CDN_URL||"/app/regional",APP_URL=window.APP_URL||"/",APP_THEME=window.APP_THEME||"",LANDING_PAGES=window.LANDING_PAGES||[],statesMatcher=(window.UNPUBLISHED_PAGES,window.PORTAL_DESTINATIONS.states||[]),cityStatesMatcher=window.PORTAL_DESTINATIONS.cityStates||[],citiesMatcher=[],isPreviewMode=window.location.search.indexOf("ispreview")>-1;$urlMatcherFactory.caseInsensitive(!0),$urlMatcherFactory.strictMode(!1),statesMatcher=statesMatcher.join("|"),statesMatcher=$urlMatcherFactory.compile("/{slug:(?:"+statesMatcher+")}"),cityStatesMatcher=cityStatesMatcher.join("|"),cityStatesMatcher=$urlMatcherFactory.compile("/{slug:(?:"+cityStatesMatcher+")}"),citiesMatcher=window.PORTAL_DESTINATIONS_SLUGS||[],citiesMatcher=citiesMatcher.join("|"),citiesMatcher=$urlMatcherFactory.compile("/{parent:(?:"+citiesMatcher+")}");var counter=0;if(LANDING_PAGES.length){var pageCount=1;angular.forEach(LANDING_PAGES,function(page){$stateProvider.state("landingPage"+pageCount++,{url:"/"+page.slug,templateUrl:CDN_URL+APP_THEME+"landingpage/view/"+(page.template||"landingpage")+".tpl.html",controller:"LandingPageCtrl as vm",resolve:{landingPage:function($state,$stateParams,Settings){return Settings.set("currentLandingPage",page),{content:page}}},metaTags:{title:page.pageTitle,description:page.metaDescription,properties:{"og:title":page.pageTitle,"og:description":page.metaDescription}},data:{id:page.id,index:-1,template:page.template,headerLogo:page.headerLogo,title:page.title,pageTitle:page.pageTitle||page.title,headerImage:page.headerImage,headerImageURL:page.headerImageURL,mobileHeaderImage:page.mobileHeaderImage,hasFixedWidthHero:"1"==page.hasFixedWidthHero,featuredImage:page.featuredImage,featuredImageURL:page.featuredImageURL,featuredImagePosition:page.featuredImagePosition,h1:page.h1,h2:page.h2,hasRFP:"1"==page.hasRFP,RFPID:page.RFPID,RFPPosition:page.RFPPosition,hideBookingBarNumber:page.hideBookingBarNumber,promoCode:page.promoCode,gaEvent:page.gaEvent,productId:page.productId,altState:page.altState,altLogo:page.altLogo,headerImagePositionY:page.headerImagePositionY,thankYouPage:page.thankYouPage,formSubmitEvent:page.formSubmitEvent,campaignName:page.campaignName}})})}angular.forEach(window.APP_CONFIG.menu,function(options,menuItem){if(parseInt(options.isActive)||isPreviewMode){var state=options.controller?options.controller.toLowerCase():menuItem.toLowerCase(),templateUrl=options.templateUrl&&options.templateUrl.length>1?options.templateUrl:state+"/view/"+state+".tpl.html",stateOptions={url:APP_URL+(options.controller?"{slug:(?:"+options.url+")}":options.url)+(["hotels","destinations"].indexOf(state)>-1?"?q":""),params:{lid:null,gaevent:null,Identifier:null},templateUrl:CDN_URL+templateUrl,controller:(options.controller||menuItem)+"Ctrl as vm",resolve:{resorts:function($stateParams,Places,Settings){return!(!Settings.get("has_nearby_resorts")&&"home"!=state)||Places.getNearbyResorts($stateParams.slug)},meta:function($stateParams){var _title=window.APP_CLIENT,_description=window.PROPERTY_DESCRIPTION;return _title=options.pageTitle||_title,_description=options.metaDescription||_description,{title:_title,description:_description}}},metaTags:{title:"{{meta.title}}",description:"{{meta.description}}",properties:{"og:title":"{{meta.title}}","og:description":"{{meta.description}}"}},data:{index:counter,menuName:options.menuName||menuItem,pageTitle:options.pageTitle||menuItem,headerImage:options.headerImage||"",mobileHeaderImage:options.mobileHeaderImage||"",featuredImage:options.featuredImage||"",featuredImageURL:options.featuredImageURL||null,template:options.template||null,bodyContent:options.bodyContent||"",secondaryBodyContent:options.secondaryBodyContent||"",promoBanner:options.promoBanner||null,h1:options.h1||"",h2:options.h2||"",headerImagePositionY:options.headerImagePositionY,promoId:options.promoId||null,notices:options.notices||null,RFPID:options.RFPID,sidebarPromo:options.sidebarPromo,primaryOfferCategoryId:options.primaryOfferCategoryId||null,secondaryOfferCategoryId:options.secondaryOfferCategoryId||null,featuredDestinationsIds:options.featuredDestinationsIds||null,featuredDestinationsHeading:options.featuredDestinationsHeading||null,featuredDestinationsSubheading:options.featuredDestinationsSubheading||null,state:options.state}};switch(state){case"home":options.homeSpecials&&(stateOptions.data.homeSpecials=options.homeSpecials),options.homeLocation&&(stateOptions.data.homeLocation=options.homeLocation),options.uspBanner&&(stateOptions.data.uspBanner=options.uspBanner),options.promoBanner&&(stateOptions.data.promoBanner=options.promoBanner),options.promoBanner2&&(stateOptions.data.promoBanner2=options.promoBanner2);break;case"categories":$stateProvider.state("category",{url:APP_URL+"{type:(?:destinations|"+options.url+")}/:slug",templateUrl:CDN_URL+"categories/view/categories.tpl.html",controller:"CategoriesCtrl as vm",resolve:{resorts:function($stateParams,Places,Settings){return!!Settings.get("has_nearby_resorts")||Places.getNearbyResorts($stateParams.slug)},meta:function($stateParams,$filter){return{title:"Best "+$filter("properCaps")($stateParams.slug)+" Resorts from "+window.APP_CLIENT,description:"Find amazing "+$filter("properCaps")($stateParams.slug)+" Resorts from "+window.APP_CLIENT}}},metaTags:{title:"{{meta.title}}",description:"{{meta.description}}"},data:{index:2,pageTitle:"{{meta.title}}",headerImage:options.headerImage||"",featuredImage:options.featuredImage||"",featuredImageURL:options.featuredImageURL||null,template:options.template||null}});break;case"offercategory":$stateProvider.state("featuredOfferCategory",{url:APP_URL+"{slug:(?:"+options.url+")}/:child?Identifier",params:{lid:null,gaevent:null,Identifier:null},templateUrl:CDN_URL+"offers/view/offer-category.tpl.html",controller:"OfferCategoryCtrl as vm",resolve:{resorts:function($stateParams,Places,Settings){return!!Settings.get("has_nearby_resorts")||Places.getNearbyResorts($stateParams.slug)},meta:function($stateParams,$filter){return{title:"Best "+$filter("properCaps")($stateParams.slug)+" Resorts from "+window.APP_CLIENT,description:"Find amazing "+$filter("properCaps")($stateParams.slug)+" Resorts from "+window.APP_CLIENT}}},metaTags:{title:"{{meta.title}}",description:"{{meta.description}}"},data:{index:counter,pageTitle:"{{meta.title}}",headerImage:options.headerImage||"",featuredImage:options.featuredImage||"",featuredImageURL:options.featuredImageURL||null,template:options.template||null,promoId:options.promoId||null}});break;case"offers":$stateProvider.state("offerCategory",{url:APP_URL+"offers/:slug?Identifier",params:{lid:null,gaevent:null,Identifier:null},templateUrl:CDN_URL+"offers/view/offer-category.tpl.html",controller:"OfferCategoryCtrl as vm",resolve:{resorts:function($stateParams,Places,Settings){return!!Settings.get("has_nearby_resorts")||Places.getNearbyResorts($stateParams.slug)},meta:function($stateParams,$filter){return{title:"Best "+$filter("properCaps")($stateParams.slug)+" Resorts from "+window.APP_CLIENT,description:"Find amazing "+$filter("properCaps")($stateParams.slug)+" Resorts from "+window.APP_CLIENT}}},metaTags:{title:"{{meta.title}}",description:"{{meta.description}}"},data:{index:counter,pageTitle:"{{meta.title}}",headerImage:options.headerImage||"",featuredImage:options.featuredImage||"",featuredImageURL:options.featuredImageURL||null,template:options.template||null}});break;case"stories":$stateProvider.state("storiesCategory",{url:APP_URL+"stories/category/:slug",templateUrl:CDN_URL+"stories/view/stories.tpl.html",controller:"StoriesCtrl as vm",resolve:{resorts:function($stateParams,Places,Settings){return!!Settings.get("has_nearby_resorts")||Places.getNearbyResorts($stateParams.slug)},meta:function($stateParams,$filter){var storyName=$filter("properCaps")($stateParams.slug);return{title:storyName+" | "+window.APP_CLIENT,description:"Discover "+storyName+" from "+window.APP_CLIENT+", and enjoy spacious, generously appointed accommodations, with incredible views of "+window.APP_CLIENT}}},metaTags:{title:"{{meta.title}}",description:"{{meta.description}}"},data:{index:counter,pageTitle:"{{meta.title}}",headerImage:options.headerImage||"",featuredImage:options.featuredImage||"",featuredImageURL:options.featuredImageURL||null,template:options.template||null}}).state("story",{url:APP_URL+"stories/{slug:.*}",templateUrl:CDN_URL+"stories/view/story.tpl.html",controller:"StoryCtrl as vm",resolve:{resorts:function($stateParams,Places,Settings){return!!Settings.get("has_nearby_resorts")||Places.getNearbyResorts($stateParams.slug)},meta:function($stateParams,$filter){var storyName=$filter("properCaps")($stateParams.slug);return{title:storyName+" | "+window.APP_CLIENT,description:"Discover "+storyName+" from "+window.APP_CLIENT+", and enjoy spacious, generously appointed accommodations, with incredible views of "+window.APP_CLIENT}}},metaTags:{title:"{{meta.title}}",description:"{{meta.description}}"},data:{index:counter,pageTitle:"{{meta.title}}",headerImage:options.headerImage||"",featuredImage:options.featuredImage||"",featuredImageURL:options.featuredImageURL||null,template:options.template||null}})}options.pageTitle&&(stateOptions.data.pageTitle=options.pageTitle),$stateProvider.state(state,stateOptions),counter++}}),$stateProvider.state("parentDestination",{url:citiesMatcher,cache:!1,templateUrl:CDN_URL+"destinations/view/destination.tpl.html",controller:"DestinationsCtrl as vm",resolve:{resorts:function($stateParams,Places,Settings){return!!Settings.get("has_nearby_resorts")||Places.getNearbyResorts($stateParams.slug)},meta:function($stateParams,Destinations){return Destinations.get("DestinationsList",$stateParams.parent,"",$stateParams.lang)}},metaTags:{title:function(meta){return meta.data.destination?meta.data.destination.pageTitle:""},description:function(meta){return meta.data.destination?meta.data.destination.metaDescription:""}},data:{index:1,pageTitle:function(meta){return meta.data.destination?meta.data.destination.pageTitle:""}}}),$stateProvider.state("sitemap",{url:APP_URL+"sitemap",templateUrl:CDN_URL+"sitemap/view/sitemap.tpl.html",controller:"SiteMapCtrl as vm",resolve:{resorts:function($stateParams,Places,Settings){return Settings.get("has_nearby_resorts")?Settings.get("nearby_resorts"):Places.getNearbyResorts($stateParams.slug)},meta:function($stateParams,$filter){return{title:"View our Sitemap for "+window.APP_CLIENT+" | "+window.APP_CLIENT,description:"Discover world-class accommodations at "+window.APP_CLIENT+", the perfect hotels for business and leisure travelers alike."}}},metaTags:{title:"{{meta.title}}",description:"{{meta.description}}"},data:{index:-1,pageTitle:"Sitemap"}}).state("special",{url:APP_URL+"specials/:slug",templateUrl:CDN_URL+APP_THEME+"offers/view/offer.tpl.html",controller:"OfferCtrl as vm",resolve:{resorts:function($stateParams,Places,Settings){return!!Settings.get("has_nearby_resorts")||Places.getNearbyResorts($stateParams.slug)},meta:function($stateParams,$filter){var specialName=$filter("properCaps")($stateParams.slug);return{title:specialName+" from "+window.APP_CLIENT,description:"Find "+specialName+" from "+window.APP_CLIENT+" | "+window.APP_CLIENT}}},metaTags:{title:"{{meta.title}}",description:"{{meta.description}}"},data:{index:2,pageTitle:"{{meta.title}}"}}).state("hotel",{url:APP_URL+"resorts/:state/:city/:slug",templateUrl:CDN_URL+"hotels/view/hotel.tpl.html",controller:"HotelCtrl as vm",resolve:{resorts:function($stateParams,Places,Settings){return!!Settings.get("has_nearby_resorts")||Places.getNearbyResorts($stateParams.slug)},meta:function($stateParams,$filter){return{title:$filter("properCaps")($stateParams.slug)+" | "+window.APP_CLIENT,description:"Discover world-class accommodations at "+$filter("properCaps")($stateParams.slug)+", the perfect hotel for business and leisure travelers alike. Enjoy spacious, generously appointed rooms at "+$filter("properCaps")($stateParams.slug)+" to book your next unforgettable vacation."}}},metaTags:{title:"{{meta.title}}",description:"{{meta.description}}"},data:{index:1,pageTitle:"{{meta.title}}"}}).state("hotelEvents",{url:APP_URL+"resorts/:state/:city/:slug/events",templateUrl:CDN_URL+"events/view/events.tpl.html",controller:"EventsCtrl as vm",resolve:{resorts:function($stateParams,Places,Settings){return!!Settings.get("has_nearby_resorts")||Places.getNearbyResorts($stateParams.slug)},meta:function($stateParams,$filter){return{title:"Events near "+$filter("properCaps")($stateParams.slug)+" in "+$filter("properCaps")($stateParams.city)+", "+$filter("properCaps")($stateParams.state),description:"Find amazing events near "+$filter("properCaps")($stateParams.slug)+" in "+$filter("properCaps")($stateParams.city)+", "+$filter("properCaps")($stateParams.state)}}},metaTags:{title:"{{meta.title}}",description:"{{meta.description}}"},data:{index:1,pageTitle:"{{meta.title}}"}}).state("hotelEvent",{url:APP_URL+"resorts/:state/:city/:hotel/events/:slug",templateUrl:CDN_URL+"events/view/event.tpl.html",controller:"EventCtrl as vm",resolve:{resorts:function($stateParams,Places,Settings){return!!Settings.get("has_nearby_resorts")||Places.getNearbyResorts($stateParams.slug)},meta:function($stateParams,$filter){var eventName=$filter("properCaps")($stateParams.slug),resortName=$filter("properCaps")($stateParams.hotel);return{title:eventName+" near "+resortName+" | "+window.APP_CLIENT,description:"Discover "+eventName+" near "+resortName+" in "+$filter("properCaps")($stateParams.city)+", "+$filter("properCaps")($stateParams.state)}}},metaTags:{title:"{{meta.title}}",description:"{{meta.description}}"},data:{index:1,pageTitle:"{{meta.title}}"}}).state("hotelDining",{url:APP_URL+"resorts/:state/:city/:slug/dining",templateUrl:CDN_URL+"dining/view/dining.tpl.html",controller:"DiningCtrl as vm",resolve:{resorts:function($stateParams,Places,Settings){return Settings.get("has_nearby_resorts")?Settings.get("nearby_resorts"):Places.getNearbyResorts($stateParams.slug)},meta:function($stateParams,$filter){return{title:"Dining near "+$filter("properCaps")($stateParams.slug)+" | "+window.APP_CLIENT,description:"Find amazing dining near "+$filter("properCaps")($stateParams.slug)+" | "+window.APP_CLIENT}}},metaTags:{title:"{{meta.title}}",description:"{{meta.description}}"},data:{index:1,pageTitle:"{{meta.title}}"}}).state("hotelSpecials",{url:APP_URL+"resorts/:state/:city/:slug/offers",templateUrl:CDN_URL+"offers/view/offers.tpl.html",controller:"OffersCtrl as vm",resolve:{resorts:function($stateParams,Places,Settings){return!!Settings.get("has_nearby_resorts")||Places.getNearbyResorts($stateParams.slug)},meta:function($stateParams,$filter){return{title:"Specials at "+$filter("properCaps")($stateParams.slug)+" in "+$filter("properCaps")($stateParams.city)+", "+$filter("properCaps")($stateParams.state),description:"Find amazing specials at "+$filter("properCaps")($stateParams.slug)+" in "+$filter("properCaps")($stateParams.city)+", "+$filter("properCaps")($stateParams.state)}}},metaTags:{title:"{{meta.title}}",description:"{{meta.description}}"},data:{index:2,pageTitle:"{{meta.title}}"}}).state("hotelSpecial",{url:APP_URL+"resorts/:state/:city/:hotel/offers/:slug?lid&gaevent&Identifier&HotelId",templateUrl:CDN_URL+APP_THEME+"offers/view/offer.tpl.html",controller:"OfferCtrl as vm",resolve:{resorts:function($stateParams,Places,Settings){return!!Settings.get("has_nearby_resorts")||Places.getNearbyResorts($stateParams.slug)},meta:function($stateParams,$filter){var specialName,specialSlug=$stateParams.slug.match(/\d+$/),resortName=$filter("properCaps")($stateParams.hotel);return specialName=specialSlug&&specialSlug[0]?$filter("properCaps")($stateParams.slug.replace("-"+specialSlug[0],"")):$filter("properCaps")($stateParams.slug),{title:specialName+" at "+resortName,description:"Find "+specialName+" at "+resortName+" in "+$filter("properCaps")($stateParams.city)+", "+$filter("properCaps")($stateParams.state)}}},metaTags:{title:"{{meta.title}}",description:"{{meta.description}}"},data:{index:2,pageTitle:"{{meta.title}}"}}).state("hotelRooms",{url:APP_URL+"resorts/:state/:city/:slug/rooms",templateUrl:CDN_URL+"rooms/view/rooms.tpl.html",controller:"RoomsCtrl as vm",params:{lang:{value:null,squash:!0}},resolve:{resorts:function($stateParams,Places,Settings){return!!Settings.get("has_nearby_resorts")||Places.getNearbyResorts($stateParams.slug)},meta:function($stateParams,$filter){return{title:"Rooms at "+$filter("properCaps")($stateParams.slug)+" in "+$filter("properCaps")($stateParams.city)+", "+$filter("properCaps")($stateParams.state),description:"Discover amazing rooms at "+$filter("properCaps")($stateParams.slug)+" in "+$filter("properCaps")($stateParams.city)+", "+$filter("properCaps")($stateParams.state)}}},metaTags:{title:"{{meta.title}}",description:"{{meta.description}}"},data:{index:1,pageTitle:"{{meta.title}}"}}).state("hotelRoom",{url:APP_URL+"resorts/:state/:city/:hotel/rooms/:slug",templateUrl:CDN_URL+APP_THEME+"rooms/view/room.tpl.html",controller:"RoomCtrl as vm",params:{lang:{value:null,squash:!0}},resolve:{resorts:function($stateParams,Places,Settings){return!!Settings.get("has_nearby_resorts")||Places.getNearbyResorts($stateParams.slug)},meta:function($stateParams,$filter){var roomName=$filter("properCaps")($stateParams.slug),resortName=$filter("properCaps")($stateParams.hotel);return{title:roomName+" at "+resortName+" in "+$filter("properCaps")($stateParams.city)+", "+$filter("properCaps")($stateParams.state),description:"Discover "+roomName+" at "+resortName+", and enjoy spacious, generously appointed accommodations in "+$filter("properCaps")($stateParams.city)+", "+$filter("properCaps")($stateParams.state)}}},metaTags:{title:"{{meta.title}}",description:"{{meta.description}}"},data:{index:1,pageTitle:"{{meta.title}}"}}).state("hotelPhotos",{url:APP_URL+"resorts/:state/:city/:slug/photos",templateUrl:CDN_URL+"photos/view/photos.tpl.html",controller:"PhotosCtrl as vm",resolve:{resorts:function($stateParams,Places,Settings){return!!Settings.get("has_nearby_resorts")||Places.getNearbyResorts($stateParams.slug)},meta:function($stateParams,$filter){return{title:"Photos of "+$filter("properCaps")($stateParams.slug)+" in "+$filter("properCaps")($stateParams.city)+", "+$filter("properCaps")($stateParams.state),description:"View incredible photos of "+$filter("properCaps")($stateParams.slug)+" in "+$filter("properCaps")($stateParams.city)+", "+$filter("properCaps")($stateParams.state)}}},metaTags:{title:"{{meta.title}}",description:"{{meta.description}}"},data:{index:1,pageTitle:"{{meta.title}}"}}).state("testingHomepage",{url:"",templateUrl:CDN_URL+"home/view/home.tpl.html",controller:"HomeCtrl as vm",resolve:{meta:function($stateParams,$filter){return{title:window.APP_CLIENT,description:window.PROPERTY_DESCRIPTION}}},metaTags:{title:"{{meta.title}}",description:"{{meta.description}}"},data:{index:0,pageTitle:"Home Page"}}).state("404",{url:"*path",templateUrl:CDN_URL+"404/view/404.tpl.html",controller:"ErrorCtrl as vm",resolve:{resorts:function($stateParams,Places,Settings){return!!Settings.get("has_nearby_resorts")||Places.getNearbyResorts($stateParams.slug)},meta:function($stateParams,$filter){return{ title:"404 Not Found | "+window.APP_CLIENT,description:"Page Not Found | "+window.APP_CLIENT}}},metaTags:{title:"{{meta.title}}",description:"{{meta.description}}",keywords:"terms conditions "},data:{index:-1,pageTitle:"404: Page Not Found"}})}angular.module("explorer.routes",["ui.router","ui.router.util","ui.router.metatags","ngSanitize"]).config(["UIRouterMetatagsProvider","$sceDelegateProvider","$mdAriaProvider",Configure]).config(["$stateProvider","$urlMatcherFactoryProvider",ConfigureRoutes]).config(["$provide",function($provide){$provide.decorator("formDirective",["$delegate",function($delegate){var formDirective=$delegate[0],oldCompile=formDirective.compile;return formDirective.compile=function(tElement,tAttrs,transclude){var compile=oldCompile?oldCompile.apply(this,arguments):{};return tElement.attr("spellcheck","false"),compile},$delegate}])}])}(),function(){"use strict";function ErrorCtrl($rootScope,$state,$window,$filter,Places,Settings){function setupRegions(regions){vm.allHotels=[],angular.forEach(regions,function(region,regionName){region.slug=$filter("toSlug")(regionName),angular.forEach(region.hotels,function(hotel){vm.allHotels.push(hotel)})}),vm.regions=regions}var _menuItems,vm=this;vm.clientName=$window.APP_CLIENT,$window.APP_CONFIG.core&&$window.APP_CONFIG.core.sitemap&&(vm.headerImage=$window.APP_CONFIG.core.sitemap.headerImage,vm.bodyContent=$window.APP_CONFIG.core.sitemap.bodyContent),_menuItems=angular.copy($rootScope.menuItems),$window.LANDING_PAGES&&$window.LANDING_PAGES.length&&angular.forEach($window.LANDING_PAGES,function(page){"0"==page.isMenuItem&&"1"==page.isActive&&(_menuItems[page.title]={url:page.slug,icon:"next",isActive:1,menuName:page.title})}),vm.menuItems=_menuItems,Settings.get("has_nearby_resorts")?setupRegions(Settings.get("nearby_resorts")):Places.getNearbyResorts().then(function(response){response.data&&"ok"==response.data.status&&setupRegions(response.data.regions)},function(){$state.go("home")});try{var errorPage=new URL(document.querySelector("link[rel='canonical']").getAttribute("href"));Places.addErrorPage(errorPage.pathname,document.referrer).then(function(response){"ok"==response.data.status&&console.log(response)})}catch(e){console.log(e)}}angular.module("explorer.app").controller("ErrorCtrl",["$rootScope","$state","$window","$filter","Places","Settings",ErrorCtrl])}(),function(){"use strict";function AccessibilityCtrl($rootScope,$state,$window,$filter,Places,Settings){var vm=this;vm.pageTitle=$state.current.data.pageTitle,vm.bodyContent=$state.current.data.bodyContent,vm.headerImage=$state.current.data.headerImage,vm.headerImagePositionY=$state.current.data.headerImagePositionY||null,vm.featuredImage=$state.current.data.featuredImage,vm.featuredImageURL=$state.current.data.featuredImageURL,vm.h1=$state.current.data.h1,vm.hideH1=$state.current.data.hideH1,vm.h2=$state.current.data.h2,vm.hideH2=$state.current.data.hideH2}angular.module("explorer.app").controller("AccessibilityCtrl",["$rootScope","$state","$window","$filter","Places","Settings",AccessibilityCtrl])}(),function(){"use strict";function AmenitiesCtrl($scope,$state,$stateParams,$window,$filter,Settings){var vm=this,regions=Settings.get("nearby_resorts")||[],_amenityFeatureSet=[];vm.property={},vm.amenityFeatureSet=[],$stateParams.slug?(vm.isProperty=!0,angular.forEach(regions,function(region,regionName){angular.forEach(region.hotels,function(hotel){hotel.slug==$stateParams.slug&&(vm.property=hotel,vm.pageTitle=hotel.name+" Amenities at "+vm.property.name,hotel.headerImage?vm.headerImage=hotel.headerImage:vm.headerImage=hotel.image,$scope.$broadcast("triggerResortSelect",hotel.hotelCode),$scope.$emit("triggerResortSelect",hotel.hotelCode),hotel.hasOfferCatalog&&hotel.hasOfferCatalog.itemListElement&&angular.forEach(hotel.hasOfferCatalog.itemListElement,function(offer){angular.forEach(offer.itemOffered.amenityFeature,function(feature){-1==_amenityFeatureSet.indexOf(feature.name)&&(_amenityFeatureSet.push(feature.name),vm.amenityFeatureSet.push(feature))})}))})})):$state.go($window.APP_CONFIG.menu.Destinations?"destinations":"hotels")}angular.module("explorer.app").controller("AmenitiesCtrl",["$scope","$state","$stateParams","$window","$filter","Settings",AmenitiesCtrl])}(),function(){"use strict";function BrandCtrl($scope,$state,$stateParams,$location,$window,$filter,$timeout,$http,$q,Places,Destinations,Settings,appConfig){function loadBrandData(){vm.isLoading=!0;$http.post("/api/brands",{task:"getBrandBySlug",slug:vm.brandSlug,portalId:14}).then(function(response){response.data&&"ok"===response.data.status&&response.data.brand?(vm.brand=response.data.brand,loadRelatedData(),processPageData()):(vm.notFound=!0,vm.isLoading=!1)}).catch(function(error){console.error("Error loading brand:",error),vm.notFound=!0,vm.isLoading=!1})}function processPageData(){vm.brand.pageTitle&&Settings.setMetaTitle(vm.brand.pageTitle),vm.brand.metaDescription&&Settings.setMetaDescription(vm.brand.metaDescription),vm.brand.uspSection&&vm.brand.uspSection.items&&(vm.brand.uspSection.items=vm.brand.uspSection.items.filter(function(item){return item.name&&""!==item.name.trim()})),vm.brand.faq&&vm.brand.faq.items&&(vm.brand.faq.items=vm.brand.faq.items.filter(function(item){return item.question&&""!==item.question.trim()})),vm.brand.selectedDestinations&&(vm.destinations=vm.brand.selectedDestinations,vm.destinations.length&&loadDestinationDetails()),vm.brand.selectedProperties&&(vm.featuredProperties=vm.brand.selectedProperties.map(function(prop){return _allHotels.find(function(hotel){return hotel.id===prop.id})||null}).filter(function(hotel){return null!==hotel})),vm.brand.selectedOffers&&(vm.featuredOfferCategories=vm.brand.selectedOffers)}function loadRelatedData(){Settings.get("has_nearby_resorts")&&loadBrandProperties(),loadOtherBrands(),vm.destinations.length&&loadDestinationDetails(),"dynamic"===vm.brand.featuredDealsMode&&loadDynamicDeals(),vm.isLoading=!1}function loadBrandProperties(){var regions=Settings.get("nearby_resorts"),brandCode=vm.brand.code;_allHotels=[],angular.forEach(regions,function(region){angular.forEach(region.hotels,function(hotel){brandCode&&hotel.brand&&(hotel.brand.toLowerCase().indexOf(brandCode.toLowerCase())>-1||hotel.brand.toLowerCase().indexOf(vm.brand.name.toLowerCase())>-1)&&_allHotels.push(hotel)})}),vm.allBrandProperties=_allHotels,console.log(_allHotels,vm.featuredProperties),setupMapMarkers()}function loadDestinationDetails(){var destinationsTree=Settings.get("destinationsTree");destinationsTree&&(vm.destinations=vm.destinations.map(function(dest){var matchedDest=destinationsTree.find(function(d){return d.destinationId===dest.destinationId});return matchedDest&&(dest.details=matchedDest),dest}))}function loadOtherBrands(){$http.post("/api/brands",{task:"getAllBrands",portalId:14}).then(function(response){response.data&&"ok"===response.data.status&&(vm.otherBrands=(response.data.brands||[]).filter(function(brand){return brand.slug!==vm.brandSlug}))}).catch(function(error){console.error("Error loading other brands:",error)})}function loadDynamicDeals(){if(vm.brand.primaryOfferCategoryId){Places.get("RegionOffersDetails",14).then(function(response){if(console.log(response.data),response.data&&response.data.categories){var category=response.data.categories.find(function(cat){return cat.id===vm.brand.primaryOfferCategoryId});console.log(category),category&&response.data.offers&&(vm.featuredOfferCategories=response.data.offers.filter(function(offer){return offer.categoryId===vm.brand.primaryOfferCategoryId}))}}).catch(function(error){console.error("Error loading dynamic deals:",error)})}}function setupMapMarkers(){if(vm.allBrandProperties.length){vm.mapMarkers={};var bounds=[];if(angular.forEach(vm.allBrandProperties,function(hotel,index){hotel.geo&&hotel.geo.latitude&&hotel.geo.longitude&&(vm.mapMarkers["marker"+index]={lat:parseFloat(hotel.geo.latitude),lng:parseFloat(hotel.geo.longitude),message:'
'+hotel.name+"
View Resort
",draggable:!1,focus:!1},bounds.push([hotel.geo.latitude,hotel.geo.longitude]))}),bounds.length){var latSum=0,lngSum=0;bounds.forEach(function(point){latSum+=parseFloat(point[0]),lngSum+=parseFloat(point[1])}),vm.mapConfig.center={lat:latSum/bounds.length,lng:lngSum/bounds.length}}}}var vm=this,_allHotels=[];vm.brandSlug=$stateParams.slug,vm.brand=null,vm.isLoading=!0,vm.notFound=!1,vm.destinations=[],vm.featuredDestinations=[],vm.destinationsCarouselConfig={slidesToShow:3,slidesToScroll:1,autoplay:!1},vm.featuredProperties=[],vm.allBrandProperties=[],vm.featuredOfferCategories=[],vm.otherBrands=[],vm.mapConfig={searchMode:"list",center:{lat:39.707186,lng:-101.351624},zoom:6},vm.mapMarkers=null,function(){if(!vm.brandSlug)return vm.notFound=!0,void(vm.isLoading=!1);loadBrandData()}(),vm.getDistanceFromHotel=function(item,hotel){var dist=0;if(item&&hotel&&hotel.geo){var radlat1=Math.PI*parseFloat(hotel.geo.latitude)/180,radlat2=Math.PI*parseFloat(item.Latitude)/180,theta=parseFloat(hotel.geo.longitude)-parseFloat(item.Longitude),radtheta=Math.PI*theta/180;dist=Math.sin(radlat1)*Math.sin(radlat2)+Math.cos(radlat1)*Math.cos(radlat2)*Math.cos(radtheta),dist>1&&(dist=1),dist=Math.acos(dist),dist=180*dist/Math.PI,dist=60*dist*1.1515}return dist},vm.toggleFaqItem=function(item){item.isOpen=!item.isOpen},vm.getPropertyCountByState=function(){var counts={};return angular.forEach(vm.allBrandProperties,function(hotel){var state=hotel.address?hotel.address.addressRegion:"Unknown";counts[state]=(counts[state]||0)+1}),counts}}angular.module("explorer.app").controller("BrandCtrl",["$scope","$state","$stateParams","$location","$window","$filter","$timeout","$http","$q","Places","Destinations","Settings","appConfig",BrandCtrl])}(),function(){"use strict";function BrandsCtrl($scope,$state,$stateParams,$location,$window,$filter,$timeout,$http,Places,Settings,appConfig){function loadBrands(){vm.isLoading=!0;$http.post("/api/brands",{task:"getAllBrands",portalId:14}).then(function(response){response.data&&"ok"===response.data.status&&(vm.brands=response.data.brands||[]),vm.isLoading=!1}).catch(function(error){console.error("Error loading brands:",error),vm.isLoading=!1})}var vm=this;vm.headerImage=$state.current.data.headerImage,vm.headerImagePositionY=$state.current.data.headerImagePositionY||"center",vm.pageTitle=$state.current.data.pageTitle,vm.h1=$state.current.data.h1,vm.h2=$state.current.data.h2,vm.bodyContent=$state.current.data.bodyContent,vm.brands=[],vm.isLoading=!0,function(){loadBrands()}()}angular.module("explorer.app").controller("BrandsCtrl",["$scope","$state","$stateParams","$location","$window","$filter","$timeout","$http","Places","Settings","appConfig",BrandsCtrl])}(),function(){"use strict";function CategoriesCtrl($scope,$state,$stateParams,$window,$timeout,$filter,Settings,Places,appConfig){function setupCategories(data){var _categories,_regions;vm.hotels=[],vm.destinations=[],vm.currentCategory=null,"ok"==data.status&&(_regions=Settings.get("nearby_resorts")||[],_categories=data.categories,angular.forEach(_categories,function(category,index){category.hotels=[],angular.forEach(_regions,function(region){angular.forEach(region.hotels,function(hotel){-1!=hotel.cid.indexOf(category.id.toString())&&category.hotels.push(hotel)})}),category.offers&&angular.forEach(_regions,function(region){angular.forEach(region.hotels,function(hotel){angular.forEach(category.offers,function(offer){offer.pid==hotel.id&&(offer.hotel=hotel,vm.hotels.push(hotel),vm.destinations.push({name:hotel.cityName+", "+hotel.stateName,slug:hotel.state}))})})}),$stateParams.slug&&category.slug==$stateParams.slug?vm.currentCategory=category:(category.hotels=[],angular.forEach(_regions,function(region){angular.forEach(region.hotels,function(hotel){-1!=hotel.cid.indexOf(category.id.toString())&&category.hotels.push(hotel)})}))}),vm.allCategories=_categories,vm.currentCategory?vm.categories=[vm.currentCategory]:vm.categories=_categories),_setupMarkers(vm.currentCategory?vm.currentCategory.hotels:vm.hotels)}function _setupMarkers(hotels){var _hotels=[],_markers={},counter=1;vm.mapCenter=appConfig.mapCenter||(vm.centerLat?{lat:parseFloat(vm.centerLat),lng:parseFloat(vm.centerLng),focus:!0,draggable:!0,zoom:appConfig.isMobileDevice?6:8}:{}),angular.forEach(hotels,function(hotel){_hotels.push(hotel),_markers["marker_"+counter]={lat:parseFloat(hotel.geo.latitude),lng:parseFloat(hotel.geo.longitude),layer:"locations",message:""+hotel.name+""+hotel.name+'
'+hotel.address.addressLocality+", "+hotel.address.addressRegion+"
",focus:!1,alt:"Map marker for "+hotel.name+", located in "+hotel.address.addressLocality+", "+hotel.address.addressRegion,icon:$window.LOGO_MAP_MARKER?{iconUrl:hotel.logo,iconSize:[72,60],iconAnchor:[36,60],popupAnchor:[0,-72],className:"map-tip-popup"}:appConfig.mapMarkerIcon||{iconUrl:vm.mapMarkerIcon||"https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/map-marker-emerald.png",iconSize:[72,60],iconAnchor:[36,60],popupAnchor:[0,-72],className:"map-tip-popup"}},counter++}),vm.mapMarkers=_markers}function loadMore(){currentPage++;var newItems=Places.getPlaces();vm.pagedItems.length>=newItems.length&&(vm.hideLoadMore=!0),offset=currentPage*itemsPerPage,newItems=newItems.slice(offset,offset+itemsPerPage),vm.pagedItems=vm.pagedItems.concat(newItems)}function nextPageDisabledClass(){return currentPage===vm.pageCount()-1?"disabled":""}function pageCount(){return Math.ceil(vm.total/itemsPerPage)}function viewHotel(hotel){Settings.hideKeyboard(),$state.go("viewListing",{slug:hotel.slug,listingId:hotel.id})}var vm=this,offset=0,itemsPerPage=15,currentPage=0;Settings.getCityId();vm.headerImage=$state.current.data.headerImage,vm.headerImagePositionY=$state.current.data.headerImagePositionY||null,vm.featuredImage=$state.current.data.featuredImage,vm.mapMarkerIcon=$window.APP_CONFIG.core.themes?$window.APP_CONFIG.core.themes.mapMarkerIcon:null,vm.bodyContent=$state.current.data.bodyContent,vm.h1=$state.current.data.h1,vm.hideH1=$state.current.data.hideH1,vm.h2=$state.current.data.h2,vm.hideH2=$state.current.data.hideH2,vm.currentSlug=$stateParams.slug||null,vm.isCategoryPage=!!$stateParams.slug,vm.searchQuery=Settings.get("searchQuery")||"",vm.showMore=!0,vm.destinationIcon={url:"./content/img/icons/map-marker-a.png",scaledSize:[32,32],origin:[0,0],anchor:[16,32]},vm.resortIcon={url:"./content/img/icons/map-marker-b.png",scaledSize:[32,32],origin:[0,0],anchor:[16,32]},vm.loadMore=loadMore,vm.nextPageDisabledClass=nextPageDisabledClass,vm.pageCount=pageCount,vm.viewHotel=viewHotel,vm.search="",vm.types=[{type:"eat",name:"Eat"},{type:"play",name:"Play"},{type:"shop",name:"Shop"}],vm.mapOptions={attributionControl:!1,scrollWheelZoom:!1,dragging:!appConfig.isMobileDevice,tap:!appConfig.isMobileDevice,zoomControlPosition:"topright",tileLayer:"https://b.tile.openstreetmap.org/{z}/{x}/{y}.png",minZoom:1,maxZoom:15},vm.mapLayers={baselayers:{osm:{name:"Our Locations",type:"xyz",url:"https://b.tile.openstreetmap.org/{z}/{x}/{y}.png"}},overlays:{locations:{name:"Locations",type:"markercluster",visible:!0}}},vm.mapEvents={map:{enable:["moveend","popupopen"],logic:"emit"},marker:{enable:[],logic:"emit"}},vm.center={},Settings.get("has_RegionCategories")?setupCategories(Settings.get("RegionCategories")):Places.get("RegionCategories").then(function(response){setupCategories(response.data)})}angular.module("explorer.app").controller("CategoriesCtrl",["$scope","$state","$stateParams","$window","$timeout","$filter","Settings","Places","appConfig",CategoriesCtrl])}(),function(){"use strict";function ContactCtrl($state,$stateParams,$window,$timeout,$http,Places,Settings,appConfig){function scrollBy(last,inview){last&&inview&&(vm.regionsLimit+=4)}function setupRegions(_regions){var _hotels=[],_cities=[],_markers=[],counter=1;vm.mapCenter=appConfig.mapCenter||(vm.centerLat?{lat:parseFloat(vm.centerLat),lng:parseFloat(vm.centerLng),focus:!0,draggable:!0,zoom:appConfig.isMobileDevice?2:4}:{}),angular.forEach(_regions,function(region,regionName){region.name=regionName,angular.forEach(region.hotels,function(hotel){_hotels.push(hotel),_cities.includes(hotel.address.addressLocality)||_cities.push(hotel.address.addressLocality),_markers.push({lat:parseFloat(hotel.geo.latitude),lng:parseFloat(hotel.geo.longitude),layer:"locations",message:""+hotel.name+""+hotel.name+'
'+hotel.address.addressLocality+", "+hotel.address.addressRegion+"
",focus:!1,alt:"Map marker for "+hotel.name+", located in "+hotel.address.addressLocality+", "+hotel.address.addressRegion,icon:appConfig.mapMarkerIcon||{iconUrl:vm.mapMarkerIcon||"https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/map-marker-emerald.png",iconSize:[72,60],iconAnchor:[36,60],popupAnchor:[0,-72]}}),counter++})}),vm.regions=_regions,vm.cities=_cities,vm.allHotels=_hotels,vm.mapMarkers=_markers;var propertiesById={};angular.forEach(_hotels,function(hotel){propertiesById[hotel.id]=hotel}),$http.get(appConfig.api+"destinations/"+$window.RID+"/getDestinationsTree").then(function(response){if("ok"==response.data.status){var destinationHotelsMap={};angular.forEach(response.data.destinationProperties,function(prop){prop&&prop.pid&&propertiesById[prop.pid]&&(destinationHotelsMap[prop.destinationId]||(destinationHotelsMap[prop.destinationId]=[]),destinationHotelsMap[prop.destinationId].push(propertiesById[prop.pid]))}),vm.destinations=response.data.destinationsTree,angular.forEach(vm.destinations,function(destination){destination.hotels=destinationHotelsMap[destination.destinationId]||[]}),console.log(propertiesById,vm.destinations)}})}var vm=this;vm.mapMarkerIcon=$window.APP_CONFIG.core.themes?$window.APP_CONFIG.core.themes.mapMarkerIcon:null,vm.headerImage=$state.current.data.headerImage,vm.headerImagePositionY=$state.current.data.headerImagePositionY||null,vm.featuredImage=$state.current.data.featuredImage,vm.bodyContent=$state.current.data.bodyContent,vm.pageTitle=$state.current.data.pageTitle,vm.h1=$state.current.data.h1,vm.hideH1=$state.current.data.hideH1,vm.h2=$state.current.data.h2,vm.hideH2=$state.current.data.hideH2,vm.mapOptions={attributionControl:!1,scrollWheelZoom:!1,dragging:!appConfig.isMobileDevice,tap:!appConfig.isMobileDevice,zoomControlPosition:"topright",tileLayer:"https://b.tile.openstreetmap.org/{z}/{x}/{y}.png",minZoom:1,maxZoom:15},vm.mapLayers={baselayers:{osm:{name:"Our Locations",type:"xyz",url:"https://b.tile.openstreetmap.org/{z}/{x}/{y}.png"}},overlays:{locations:{name:"Hotels",type:"markercluster",visible:!0,layerOptions:{maxClusterRadius:appConfig.maxClusterRadius||80,disableClusteringAtZoom:appConfig.disableClusteringAtZoom||!1,spiderfyDistanceMultiplier:appConfig.spiderfyDistanceMultiplier||1}}}},vm.mapEvents={map:{enable:["moveend","popupopen"],logic:"emit"},marker:{enable:[],logic:"emit"}},vm.bodyContent=$state.current.data.bodyContent,vm.property=Settings.get("currentListing"),vm.callTel=$window.APP_CLIENT_PHONE,vm.contactEmail=$window.APP_CLIENT_EMAIL,vm.scrollBy=scrollBy,vm.MailTo=function(mail){window.location.href="mailto:"+mail},vm.headerImage?Settings.setHeaderImage(vm.headerImage):Settings.setHeaderImage(null),vm.regionName=$window.PROPERTY_CITY+", "+$window.PROPERTY_STATE,Settings.get("has_nearby_resorts")?setupRegions(Settings.get("nearby_resorts")):Places.getNearbyResorts().then(function(response){response.data&&"ok"==response.data.status&&setupRegions(response.data.regions)},function(){$state.go("home")})}angular.module("explorer.app").controller("ContactCtrl",["$state","$stateParams","$window","$timeout","$http","Places","Settings","appConfig",ContactCtrl])}(),function(){"use strict";function DestinationCtrl($scope,$state,$stateParams,$timeout,$window,$filter,Settings,Places,appConfig){function _setupMarkers(hotels){var _hotels=[],_markers=[],counter=1;vm.mapCenter=appConfig.mapCenter||(vm.centerLat?{lat:parseFloat(vm.centerLat),lng:parseFloat(vm.centerLng),focus:!0,draggable:!0,zoom:appConfig.isMobileDevice?7:9}:{}),hotels=hotels.filter(function(hotel){return!(!hotel.geo.latitude||!hotel.geo.longitude)||(console.log("missing lat/long",hotel.name),!1)}),angular.forEach(hotels,function(hotel){var hotelHref;hotelHref=hotel.brand&&$window.LOGO_MAP_MARKER?$state.href("hotel",{brand:hotel.brand.slug,city:hotel.cityState.substring(0,hotel.cityState.lastIndexOf("-")),state:hotel.state,slug:hotel.slug}):$state.href("hotel",{cityState:hotel.cityState,slug:hotel.slug}),_hotels.push(hotel),_markers.push({lat:parseFloat(hotel.geo.latitude),lng:parseFloat(hotel.geo.longitude),layer:"locations",message:"
"+hotel.name+""+hotel.name+'
'+hotel.address.addressLocality+", "+hotel.address.addressRegion+"
",focus:!1,alt:"Map marker for "+hotel.name+", located in "+hotel.address.addressLocality+", "+hotel.address.addressRegion,icon:defaultMapMarkerIconConfig}),counter++}),vm.mapMarkers=_markers.slice(),vm.googleMapMarkers=_markers.slice(),vm.googleMapOptions={height:"580px",scrollWheelZoom:!1,draggable:!appConfig.isMobileDevice,disableDefaultUI:!1},_markers.length>0&&(vm.mapCenter={lat:_markers[0].lat,lng:_markers[0].lng,zoom:_markers.length>1?5:13})}function scrollByProperties(last,inview){last&&inview&&(vm.destinationPropertiesLimit+=6)}function loadMore(){currentPage++;var newItems=Places.getPlaces();vm.pagedItems.length>=newItems.length&&(vm.hideLoadMore=!0),offset=currentPage*itemsPerPage,newItems=newItems.slice(offset,offset+itemsPerPage),vm.pagedItems=vm.pagedItems.concat(newItems)}function nextPageDisabledClass(){return currentPage===vm.pageCount()-1?"disabled":""}function pageCount(){return Math.ceil(vm.total/itemsPerPage)}function viewHotel(hotel){Settings.hideKeyboard(),$state.go("viewListing",{slug:hotel.slug,listingId:hotel.id})}function showMarkerWindow(evt,id){if(vm.map){var _currentHotel=null;vm.currentMarker=this,angular.forEach(_allHotels,function(hotel){hotel.id==id&&(_currentHotel=hotel,$scope.$broadcast("triggerResortSelect",hotel.hotelCode),$scope.$emit("triggerResortSelect",hotel.hotelCode))}),_currentHotel&&(vm.map.setZoom(12),this.setAnimation(google.maps.Animation.DROP),vm.currentHotel=_currentHotel,vm.mapConfig.center.lat=vm.currentHotel.geo.latitude,vm.mapConfig.center.lng=vm.currentHotel.geo.longitude,vm.map.showInfoWindow("marker-window",this))}}var defaultMapMarkerIconConfig,defaultMapMarkerIcon,selectedMapMarkerIcon,vm=this,offset=0,itemsPerPage=15,currentPage=0;Settings.getCityId();vm.searchQuery=Settings.get("searchQuery")||"",vm.showMore=!0,vm.destinationIcon={url:"./content/img/icons/map-marker-a.png",scaledSize:[32,32],origin:[0,0],anchor:[16,32]},vm.resortIcon={url:"./content/img/icons/map-marker-b.png",scaledSize:[32,32],origin:[0,0],anchor:[16,32]},vm.mapMarkerIcon=$window.APP_CONFIG.core.themes?$window.APP_CONFIG.core.themes.mapMarkerIcon:null,vm.center={},vm.loadMore=loadMore,vm.nextPageDisabledClass=nextPageDisabledClass,vm.pageCount=pageCount,vm.viewHotel=viewHotel,vm.showMarkerWindow=showMarkerWindow,vm.scrollByProperties=scrollByProperties,vm.destinationSlug=$stateParams.slug,vm.isState=!1,vm.isCityState=!1,vm.hotels=[],vm.destinations=[],vm.states=[],vm.countries=[],vm.selectedDestination="",vm.selectedState="",vm.selectedCountry="",vm.selectedResort="",vm.search="",vm.types=[{type:"eat",name:"Eat"},{type:"play",name:"Play"},{type:"shop",name:"Shop"}],vm.mapOptions={attributionControl:!1,scrollWheelZoom:!1,dragging:!appConfig.isMobileDevice,tap:!appConfig.isMobileDevice,zoomControlPosition:"topright",tileLayer:appConfig.tileLayer||"https://b.tile.openstreetmap.org/{z}/{x}/{y}.png",minZoom:1,maxZoom:15},vm.mapLayers={baselayers:{osm:{name:"Our Locations",type:"xyz",url:appConfig.tileLayer||"https://b.tile.openstreetmap.org/{z}/{x}/{y}.png"}},overlays:{locations:{name:"Locations",type:"markercluster",visible:!0,layerOptions:{maxClusterRadius:appConfig.maxClusterRadius||80,disableClusteringAtZoom:appConfig.disableClusteringAtZoom||!1,spiderfyDistanceMultiplier:appConfig.spiderfyDistanceMultiplier||1}}}},vm.mapEvents={map:{enable:["moveend","popupopen"],logic:"emit"},marker:{enable:[],logic:"emit"}},Settings.get("has_nearby_resorts")?vm.regions=Settings.get("nearby_resorts"):Places.getNearbyResorts().then(function(response){response.data&&"ok"==response.data.status&&(vm.regions=response.data.regions)});var stateSlug,tmp=$stateParams.slug.split("-");angular.forEach($window.PORTAL_DESTINATIONS.states,function(state){(tmp.indexOf(state)>-1||$stateParams.slug.indexOf(state)>-1)&&(stateSlug=state)});var regions=Settings.get("nearby_resorts")||[],tmpCity=[],breakLoop=!1,foundDestinationName=!1;if(breakLoop||$window.PORTAL_DESTINATIONS.states.indexOf($stateParams.slug)>-1&&(vm.isState=!0,vm.destinationName=$filter("properCaps")($stateParams.slug),angular.forEach(regions,function(destination,destinationName){vm.destinationName.toLowerCase()==destinationName.toLowerCase()&&angular.forEach(destination.hotels,function(hotel){hotel.state==$stateParams.slug&&tmpCity.push(hotel)})}),breakLoop=!0),breakLoop||$window.PORTAL_DESTINATIONS.cityStates.indexOf($stateParams.slug)>-1&&(vm.isCityState=!0,$filter("properCaps")($stateParams.slug),angular.forEach(regions,function(destination,destinationName){angular.forEach(destination.hotels,function(hotel){hotel.cityState==$stateParams.slug?(foundDestinationName||(foundDestinationName=!0,vm.destinationName=hotel.cityName+", "+hotel.stateName),tmpCity.push(hotel)):hotel.additionalProperty&&hotel.additionalProperty[0]&&hotel.additionalProperty[0].value&&hotel.additionalProperty[0].value.replace(/\s+/g,"-").toLowerCase().indexOf($stateParams.slug)>-1&&tmpCity.push(hotel)})}),breakLoop=!0),!breakLoop){var tmpName;vm.destinationName=$filter("properCaps")($stateParams.slug),angular.forEach(regions,function(destination,destinationName){tmpName=$filter("properCaps")($filter("toSlug")(destinationName)),tmpName.toLowerCase()==vm.destinationName.toLowerCase()&&angular.forEach(destination.hotels,function(hotel){tmpCity.push(hotel)})})}Places.get("PortalDestinationDetails",$window.RID,$stateParams.slug.replace("-"+stateSlug,"")).then(function(response){var description="",h1="",h2="";"ok"==response.data.status&&(description=response.data.description,h1=response.data.h1,h2=response.data.h2,h1&&(vm.h1=h1),h2&&(vm.h2=h2)),vm.destination={hotels:tmpCity,description:description,h1:h1,h2:h2},vm.headerImage=response.data.headerImage||null,vm.headerImagePositionY=response.data.headerImagePositionY||null,vm.headerImage?Settings.setHeaderImage(vm.headerImage):Settings.setHeaderImage(null),defaultMapMarkerIconConfig=$window.LOGO_MAP_MARKER?{iconUrl:hotel.brand&&hotel.brand.slug?"https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/clientmedia/brands/portal/"+hotel.brand.slug+"-map-marker.png":hotel.logo,iconSize:[72,60],iconAnchor:[36,60],popupAnchor:[0,-72]}:appConfig.mapMarkerIcon||{iconUrl:vm.mapMarkerIcon||"https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/map-marker-emerald.png",iconSize:[72,60],iconAnchor:[36,60],popupAnchor:[0,-72]},defaultMapMarkerIcon=defaultMapMarkerIconConfig,selectedMapMarkerIcon=!!appConfig.selectedMapMarkerIcon&&appConfig.selectedMapMarkerIcon,_setupMarkers(tmpCity)})}angular.module("explorer.app").controller("DestinationCtrl",["$scope","$state","$stateParams","$timeout","$window","$filter","Settings","Places","appConfig",DestinationCtrl])}(),function(){"use strict";function DestinationsCtrl($scope,$state,$stateParams,$timeout,$window,$location,$filter,$mdDialog,$q,Settings,Destinations,appConfig){function scrollByProperties(last,inview){last&&inview&&(vm.destinationPropertiesLimit+=4)}function resetFilters(type,skip){switch(type){case"themes":angular.forEach(themeGroups,function(themes,name){name!=skip&&(vm.searchFilters.type[name]=0)});break;default:vm.searchWords="",vm.searchFilters.type={},vm.searchFilters.destination=[],vm.searchFilters.brand={},vm.updateSearchResults()}}function loadNearby(){Destinations.get("DestinationNearby",vm.destination.destinationId,$stateParams.child,vm.lang,$stateParams.category).then(function(response){vm.items=response.data.items})}function loadProperties(noDestinationPropertiesList){var regions=Settings.get("nearby_resorts");noDestinationPropertiesList=noDestinationPropertiesList||!1,regions?(angular.forEach(regions,function(destination,destinationName){angular.forEach(destination.hotels,function(hotel){properties[hotel.id]=hotel})}),noDestinationPropertiesList?(setupMap($filter("toArray",!1)(properties)),vm.destination&&"1"==vm.destination.showFilters&&setupFilters()):getDestinationPropertiesList()):$scope.$on("triggerRegionsLoaded",function(){loadProperties(noDestinationPropertiesList)}),Settings.get("topSearchQuery")?(vm.searchWords=Settings.get("topSearchQuery"),updateSearchResults(),Settings.set("topSearchQuery",null)):$stateParams.q&&(vm.searchWords=$stateParams.q,updateSearchResults(),Settings.set("topSearchQuery",null))}function getDestObjId(destObj){return String(destObj.id||destObj.destinationId||"")}function fetchDestinationProperties(destObj){var destId=getDestObjId(destObj);if(!destId)return $q.resolve(null);if(_destinationLoadPromises[destId])return _destinationLoadPromises[destId];var cachedIds=Settings.get("dp_"+destId);if(cachedIds&&cachedIds.length){angular.forEach(cachedIds,function(propId){properties[propId]&&(properties[propId].destinationId=destId)});var resolved=$q.resolve(!0);return _destinationLoadPromises[destId]=resolved,resolved}var promise=Destinations.get("PropertiesList",destObj).then(function(response){if(response.data&&"ok"===response.data.status&&response.data.properties){var ids=[];angular.forEach(response.data.properties,function(prop){prop&&(ids.push(prop.id),properties[prop.id]&&(properties[prop.id].destinationId=destId))}),ids.length&&Settings.set("dp_"+destId,ids)}},angular.noop);return _destinationLoadPromises[destId]=promise,promise}function findChildByDestId(destId,children){var found=null;return angular.forEach(children||[],function(child){found||(getDestObjId(child)===String(destId)?found=child:child.children&&child.children.length&&(found=findChildByDestId(destId,child.children)))}),found}function getDestinationPropertiesList(destination){var destObj=destination||vm.destination,destId=String(getDestObjId(destObj));if(_destinationLoadPromises[destId])return _destinationLoadPromises[destId];var promise=Destinations.get("PropertiesList",destObj).then(function(response){if("ok"==response.data.status&&response.data.properties){var tmp=[];angular.forEach(response.data.properties,function(prop){prop&&tmp.push(prop.id)}), tmp.length&&Settings.set("dp_"+destId,tmp),tmp.length?(angular.forEach(response.data.properties,function(prop){if(prop&&properties[prop.id])if(properties[prop.id].destinationId=destId,properties[prop.id].rooms=prop.rooms,properties[prop.id].destinationContent={destinationId:properties[prop.id].destinationId},properties[prop.id].destinationName=vm.destination.name,destination||(prop.bodyContent&&(properties[prop.id].destinationContent.bodyContent=prop.bodyContent),prop.image&&(properties[prop.id].destinationContent.image=prop.image),prop.imageCredit&&(properties[prop.id].destinationContent.imageCredit=prop.imageCredit)),angular.forEach(prop.rooms,function(room){-1==vm.availableRooms.indexOf(room)&&vm.availableRooms.push(room)}),destination){destination.properties||(destination.properties=[]);var _found=!1;angular.forEach(vm.destination.properties,function(p){p&&p.id==prop.id&&(_found=!0)}),_found&&(childPropertyIds.push(prop.id),destination.properties.push(properties[prop.id]))}else destinationProperties.push(properties[prop.id]),vm.allProperties.push(properties[prop.id]);else;}),vm.destination.properties=destinationProperties.filter(function(property){return property&&-1==childPropertyIds.indexOf(property.id)})):destination&&destination.children&&angular.forEach(destination.children,function(child){getDestinationPropertiesList(child)}),!destination&&vm.destination&&vm.destination.children&&angular.forEach(vm.destination.children,function(child){getDestinationPropertiesList(child)});var uniqueObject={},deduplicatedArray=[];angular.forEach(vm.destination.properties,function(item){var name=item.name;uniqueObject[name]||(uniqueObject[name]=!0,deduplicatedArray.push(item))}),!destination&&"1"==vm.destination.showMap&&vm.destination.properties&&setupMap(),vm.destination&&"1"==vm.destination.showFilters&&setupFilters(),vm.isLoading=!1}},function(error){vm.isLoading=!1});return _destinationLoadPromises[destId]=promise,promise}function setupFilters(){angular.forEach(vm.destination.properties,function(property){-1==_countries.indexOf(property.address.addressCountry)&&(_countries.push(property.address.addressCountry),vm.countries.push({name:property.address.addressCountry,slug:property.address.addressCountry.toLowerCase()})),-1==_states.indexOf(property.stateName)&&(_states.push(property.stateName),vm.states.push({name:property.stateName,country:property.address.addressCountry||"",slug:property.state})),-1==_destinations.indexOf(property.cityState)&&(_destinations.push(property.cityState),vm.destinations.push({destinationId:property.destinationId,name:property.cityName+", "+property.stateName,slug:property.cityState,country:property.address.addressCountry}))}),$location.search().country?($location.search().state&&($location.search().city&&angular.forEach(vm.destinations,function(destination){destination.name.toLowerCase()===$location.search().city.toLowerCase()+", "+$location.search().state.toLowerCase()&&(vm.selectedDestination=destination.slug)}),angular.forEach(vm.states,function(state){state.name.toLowerCase()===$location.search().state.toLowerCase()&&(vm.selectedState=state.name)})),angular.forEach(vm.countries,function(country){country.name.toLowerCase()===$location.search().country.toLowerCase()&&(vm.selectedCountry=country.name)})):$location.search().state?($location.search().city&&angular.forEach(vm.destinations,function(destination){destination.name.toLowerCase()===$location.search().city.toLowerCase()+", "+$location.search().state.toLowerCase()&&(vm.selectedDestination=destination.slug)}),angular.forEach(vm.states,function(state){state.name.toLowerCase()===$location.search().state.toLowerCase()&&(vm.selectedState=state.name)})):$location.search().city&&angular.forEach(vm.destinations,function(destination){destination.name.toLowerCase().indexOf($location.search().city.toLowerCase())>-1&&(vm.selectedDestination=destination.slug)})}function setupMap(markers){markers=markers||null,vm.mapMarkerIcon=$window.APP_CONFIG.core.themes?$window.APP_CONFIG.core.themes.mapMarkerIcon:null,vm.mapOptions={attributionControl:!1,scrollWheelZoom:!1,dragging:!appConfig.isMobileDevice,tap:!appConfig.isMobileDevice,zoomControlPosition:"topleft",boxZoom:!0,zoomControl:!0,tileLayer:appConfig.tileLayer||"https://b.tile.openstreetmap.org/{z}/{x}/{y}.png",minZoom:1,maxZoom:15},vm.mapLayers={baselayers:{osm:{name:(vm.destination&&!vm.globalSearch?vm.destination.name:"Our")+" Resorts",type:"xyz",url:appConfig.tileLayer||"https://b.tile.openstreetmap.org/{z}/{x}/{y}.png"}},overlays:{locations:{name:(vm.destination&&!vm.globalSearch?vm.destination.name:"Our")+" Resorts",type:"markercluster",visible:!0,layerOptions:{maxClusterRadius:appConfig.maxClusterRadius||60}}}},defaultMapMarkerIconConfig=appConfig.mapMarkerIcon||{iconUrl:vm.mapMarkerIcon||"https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/map-marker-emerald.png",iconSize:[72,60],iconAnchor:[36,60],popupAnchor:[0,-72]},defaultMapMarkerIcon=defaultMapMarkerIconConfig,selectedMapMarkerIcon=!!appConfig.selectedMapMarkerIcon&&appConfig.selectedMapMarkerIcon,setupMapMarkers(markers)}function getSearchValue(hotel){return hotel.value=hotel.name.toLowerCase(),hotel.address&&(hotel.amenityFeature||console.log("missing amenities",hotel.name),hotel.value+=" "+(hotel.address.streetAddress?hotel.address.streetAddress.toLowerCase():"")+" "+(hotel.address.addressLocality?hotel.address.addressLocality.toLowerCase():"")+" "+(hotel.address.addressRegion?hotel.address.addressRegion.toLowerCase():"")+" "+(hotel.stateName?hotel.stateName.toLowerCase():"")+" "+(hotel.cityName?hotel.cityName.toLowerCase():"")+" "+(hotel.address.addressCountry?hotel.address.addressCountry.toLowerCase():"")+" "+hotel.telephone+" "+hotel.address.postalCode+" "+(hotel.amenityFeature?hotel.amenityFeature.map(function(amenity){return amenity.name.toLowerCase().trim()}).join(" "):"")+" "+hotel.description),hotel}function setupMapMarkers(locations){locations=locations||(vm.destination?vm.destination.properties:[]),locations?locations=locations.map(getSearchValue):vm.destination.properties.map(getSearchValue),origResults||(origResults=locations),locations=locations.filter(function(hotel){return!!(hotel.geo&&hotel.geo.latitude&&hotel.geo.longitude)||(console.log("missing lat/long",hotel.name),!1)}),_mapMarkers=locations.map(function(hotel){hotel.geo||(hotel.geo={}),hotel.cityState||(hotel.cityState="");var hotelHref;return hotelHref=hotel.brand&&$window.LOGO_MAP_MARKER?$state.href("hotel",{brand:hotel.brand.slug,city:hotel.cityState.substring(0,hotel.cityState.lastIndexOf("-")),state:hotel.state,slug:hotel.slug}):vm.useDesinationUrlStructure?$state.href("hotel",{country:"us",state:hotel.state,city:hotel.cityState.replace("-"+hotel.state,""),slug:hotel.slug}):$state.href("hotel",{cityState:hotel.cityState,slug:hotel.slug}),{lat:parseFloat(hotel.geo.latitude),lng:parseFloat(hotel.geo.longitude),layer:"locations",message:"
'+hotel.name+''+hotel.name+'
'+hotel.address.addressLocality+", "+hotel.address.addressRegion+"
",focus:!1,alt:"Map marker for "+hotel.name+", located in "+hotel.address.addressLocality+", "+hotel.address.addressRegion,icon:defaultMapMarkerIconConfig}}),vm.mapMarkers=_mapMarkers.slice(),vm.googleMapMarkers=_mapMarkers.slice(),vm.googleMapOptions={height:"580px",scrollWheelZoom:!1,draggable:!appConfig.isMobileDevice,disableDefaultUI:!1},_mapMarkers.length>0&&(vm.mapCenter={lat:_mapMarkers[0].lat,lng:_mapMarkers[0].lng,zoom:_mapMarkers.length>1?5:13})}function applyFilter(){pagedResults=filteredResults(),origResults.length>pagedResults.length?vm.pagedResults=pagedResults:vm.pagedResults=[],setupMapMarkers(pagedResults),vm.currentMarker&&(vm.currentMarker=null)}function updateSearchResults(){timer&&$timeout.cancel(timer);var selectedDestIds=(vm.searchFilters.destination||[]).filter(function(d){return"all"!==d&&1!==d&&2!==d}).map(String),pendingFetches=[];selectedDestIds.length&&angular.forEach(selectedDestIds,function(destId){var destObj=null;!destObj&&vm.destination&&vm.destination.children&&(destObj=findChildByDestId(destId,vm.destination.children)),!destObj&&vm.destinations&&angular.forEach(vm.destinations,function(d){destObj||getDestObjId(d)!==destId||(destObj=d)}),destObj&&pendingFetches.push(fetchDestinationProperties(destObj))}),pendingFetches.length?(vm.isLoading=!0,$q.all(pendingFetches).then(function(){vm.isLoading=!1,applyFilter()},function(){vm.isLoading=!1,applyFilter()})):timer=$timeout(function(){applyFilter()},10)}function filteredResults(){vm.themeExtensions=[],vm.themeExtensionTypes=[],vm.themeLimit=10;var passBrandCheck=!0,passDestinationCheck=!0,passTypeCheck=!0,passRoomCheck=!0,queryFilter=function(query,hotel){var lowercaseQuery=angular.lowercase(query);return hotel.value.indexOf(lowercaseQuery)>-1||(lowercaseQuery=lowercaseQuery.replace(/[^a-zA-Z0-9 ]/g,""),hotel.value.indexOf(lowercaseQuery)>-1)},brandFilter=function(brands,hotel){var activeFilter=!1;return angular.forEach(brands,function(filter,brand){1==filter&&(activeFilter=!0)}),hotel.brand=hotel.brand||$window.APP_CLIENT,!activeFilter||!brands||1==brands[hotel.brand]},roomFilter=function(rooms,hotel){var activeFilters=0,passCheck=0,used=[];return angular.forEach(rooms,function(filter,room){1==filter&&activeFilters++}),!(activeFilters>0)||(angular.forEach(rooms,function(filter,room){1==filter&&angular.forEach(hotel.rooms,function(searchRoom){-1==used.indexOf(searchRoom)&&searchRoom.toLowerCase().indexOf(room.toLowerCase())>-1&&(passCheck++,used.push(searchRoom))})}),passCheck==activeFilters)},destinationFilter=function(destinations,hotel){if(!destinations||!destinations.length)return!0;if(destinations.indexOf(1)>-1&&destinations.indexOf(2)>-1)return!0;if(destinations.indexOf(1)>-1&&(0==hotel.address.addressCountry.toLowerCase().indexOf("us")||hotel.address.addressCountry.toLowerCase().indexOf("united states")>-1))return!0;if(destinations.indexOf(2)>-1&&0!=hotel.address.addressCountry.toLowerCase().indexOf("us")&&-1==hotel.address.addressCountry.toLowerCase().indexOf("united states"))return!0;if(!hotel.destinationId){if(destinations.indexOf("all")>-1)return!0;var destPass=!1,destIdsStr=destinations.map(String);return angular.forEach(vm.destinations,function(dest){destIdsStr.indexOf(String(dest.destinationId))>-1&&(hotel.cityState&&hotel.cityState===dest.slug?destPass=!0:hotel.state!==dest.slug&&$filter("toSlug")(hotel.cityName)!==dest.slug||(destPass=!0))}),destPass}return destinations.indexOf("all")>-1&&1==destinations.length||!!hotel.destinationId&&destinations.map(String).indexOf(String(hotel.destinationId))>-1},typeFilter=function(types,hotel){var activeFilters=0,passCheck=0,used=[];return angular.forEach(types,function(filter,type){1==filter&&activeFilters++}),!(activeFilters>0)||(angular.forEach(types,function(filter,searchType){1==filter&&angular.forEach(themeGroups[searchType],function(theme){angular.forEach(hotel.amenityFeature,function(amenity){-1==used.indexOf(searchType)&&("ski"!=theme&&amenity.name.toLowerCase().indexOf(theme)>-1||"ski"==theme&&amenity.name.toLowerCase().indexOf(theme)>-1&&-1==amenity.name.toLowerCase().indexOf("waterskiing")&&-1==amenity.name.toLowerCase().indexOf("cross-country skiing"))&&(passCheck++,used.push(searchType))})})}),passCheck==activeFilters)},_properties=null;if(vm.destination&&vm.destination.properties&&!vm.globalSearch?(_properties=vm.destination.properties,vm.destination.children&&vm.destination.children.length&&angular.forEach(vm.destination.children,function(child){child.properties&&(_properties=_properties.concat(child.properties))})):_properties=$filter("toArray",!1)(properties),!prevAllSearch&&vm.searchFilters.destination&&vm.searchFilters.destination.indexOf("all")>-1?(prevAllSearch=!0,vm.searchFilters.destination=vm.searchFilters.destination.filter(function(destination){return"all"==destination})):vm.searchFilters.destination&&vm.searchFilters.destination.length>1&&(vm.searchFilters.destination=vm.searchFilters.destination.filter(function(destination){return"all"!=destination}),prevAllSearch=!1),$window.dataLayer){if(vm.searchWords&&$window.dataLayer.push({event:"destinationSearch.searchQueryUpdate",eventCategory:"Destination Search",eventLabel:vm.searchWords.trim()}),vm.searchFilters.destination&&vm.searchFilters.destination!=["all"]){var trackingDestinationNames=[];vm.searchFilters.destination.map(function(destinationId){vm.destinations?angular.forEach(vm.destinations,function(destination){destination.destinationId==destinationId&&trackingDestinationNames.push(destination.name)}):vm.destination&&angular.forEach(vm.destination.children,function(destination){destination.destinationId==destinationId&&trackingDestinationNames.push(destination.name)})}),trackingDestinationNames.length&&$window.dataLayer.push({event:"destinationSearch.destinationFilterUpdate",eventCategory:"Destination Search",eventLabel:trackingDestinationNames.toString()})}vm.searchFilters.type&&$window.dataLayer.push({event:"destinationSearch.tripTypeFilterUpdate",eventCategory:"Destination Search",eventLabel:Object.keys(vm.searchFilters.type).toString()})}return _properties.filter(function(hotel){var pass=!0;return vm.searchWords&&(pass=queryFilter(vm.searchWords,hotel)),!!pass&&(angular.forEach(vm.searchFilters,function(filters,filterType){switch(filterType){case"brand":passBrandCheck=brandFilter(filters,hotel);break;case"room":passRoomCheck=roomFilter(filters,hotel);break;case"destination":passDestinationCheck=vm.searchFilters.destination==["all"]||destinationFilter(filters,hotel);break;case"type":passTypeCheck=typeFilter(filters,hotel)}}),passDestinationCheck&&passRoomCheck&&passTypeCheck&&passBrandCheck)})}var dynamicFlex,dynamicFlexTwo,timer,pagedResults,defaultMapMarkerIconConfig,defaultMapMarkerIcon,selectedMapMarkerIcon,vm=this,properties={},destinationProperties=[],childPropertyIds=[],origResults=null,_destinationLoadPromises={},themeGroups={Beaches:["beach"],Golfing:["golf","putt"],Family:["child","playground","picnic","pool","bbq","game","restaurant","bowling","wedding","kid","activities","river","mall"],Fun:["fish","lake","hot","night","tennis","basketball","volleyball","horse","hiking","bar","heli","plane","dance","cook","tub","massage","mall"],Ski:["ski"]},prevAllSearch=!1,_countries=[],_states=[],_destinations=[],_mapMarkers=[];switch(vm.pageTitle=$state.current.data.pageTitle,vm.bodyContent=$state.current.data.bodyContent,vm.headerImage=$state.current.data.headerImage,vm.headerImagePositionY=$state.current.data.headerImagePositionY||null,vm.featuredImage=$state.current.data.featuredImage,vm.featuredImageURL=$state.current.data.featuredImageURL,vm.h1=$state.current.data.h1,vm.hideH1=$state.current.data.hideH1,vm.h2=$state.current.data.h2,vm.hideH2=$state.current.data.hideH2,vm.lang=$stateParams.lang||null,vm.updateSearchResults=updateSearchResults,vm.resetFilters=resetFilters,vm.searchFilters={destination:["all"]},vm.pagedResults=[],vm.availableRooms=[],vm.allProperties=[],vm.searchLimit=25,vm.tripTypes=themeGroups,vm.scrollByProperties=scrollByProperties,vm.isLoading=!0,vm.hotels=[],vm.destinations=[],vm.states=[],vm.countries=[],vm.selectedDestination="",vm.selectedState="",vm.selectedCountry="",vm.selectedResort="",vm.headerImage?Settings.setHeaderImage(vm.headerImage):Settings.setHeaderImage(null),$state.current.name){case"parentDestination":"destination-map",vm.isParentDestination=!0,Destinations.get("DestinationsList",$stateParams.parent,"",vm.lang).then(function(response){"ok"==response.data.status&&response.data.destination?(vm.destination=response.data.destination,dynamicFlex=vm.destination.children.length%4,dynamicFlexTwo=vm.destination.children.length%2,vm.dynamicFlex=dynamicFlex?Math.floor(100/dynamicFlex):25,vm.dynamicFlexTwo=dynamicFlexTwo?Math.floor(100/dynamicFlexTwo):50,vm.searchMode=vm.destination.defaultResortView||"map","1"==vm.destination.showProperties||"1"==vm.destination.showMap?(vm.destination.isLoaded?(setupMap(),vm.isLoading=!1):(loadProperties(),vm.destination.isLoaded=!0),vm.destination&&"1"==vm.destination.showFilters&&setupFilters()):vm.isLoading=!1,$scope.$emit("updateSearchText",vm.destination.name),$scope.$broadcast("updateSearchText",vm.destination.name)):$state.go("home")},function(error){console.log(error),vm.isLoading=!1});break;case"childDestination":"destination-map",vm.isParentDestination=!1,Destinations.get("DestinationsList",$stateParams.parent,$stateParams.child,vm.lang).then(function(response){if("ok"==response.data.status&&response.data.destination){if(vm.destination=response.data.destination,dynamicFlex=vm.destination.children.length%4,dynamicFlexTwo=vm.destination.children.length%2,vm.dynamicFlex=dynamicFlex?Math.floor(100/dynamicFlex):25,vm.dynamicFlexTwo=dynamicFlexTwo?Math.floor(100/dynamicFlexTwo):50,vm.searchMode=vm.destination.defaultResortView||"map",vm.destination.parentId&&"0"!=vm.destination.parentId){var parentDestinationSlug=vm.destination.breadcrumbs[vm.destination.breadcrumbs.length-2].slug.replace(/^\/+/,"").replace($stateParams.parent+"/","");Destinations.get("DestinationsList",$stateParams.parent,parentDestinationSlug!=$stateParams.parent?parentDestinationSlug:"",vm.lang).then(function(response){"ok"==response.data.status&&(vm.parentDestination=response.data.destination)})}"1"==vm.destination.showProperties||"1"==vm.destination.showMap?(vm.destination.isLoaded?(setupMap(),vm.isLoading=!1):(loadProperties(),vm.destination.isLoaded=!0),vm.destination&&"1"==vm.destination.showFilters&&setupFilters()):vm.isLoading=!1,$scope.$emit("updateSearchText",vm.destination.name),$scope.$broadcast("updateSearchText",vm.destination.name)}else $state.go("home")});break;case"destinationNearby":Destinations.get("DestinationsList",$stateParams.parent,$stateParams.child,vm.lang).then(function(response){if("ok"==response.data.status&&response.data.destination){if(vm.destination=response.data.destination,dynamicFlex=vm.destination.children.length%4,dynamicFlexTwo=vm.destination.children.length%2,vm.dynamicFlex=dynamicFlex?Math.floor(100/dynamicFlex):25,vm.dynamicFlexTwo=dynamicFlexTwo?Math.floor(100/dynamicFlexTwo):50,vm.category=$stateParams.category,vm.destination.parentId&&"0"!=vm.destination.parentId){var parentDestinationSlug=vm.destination.breadcrumbs[vm.destination.breadcrumbs.length-2].slug.replace(/^\/+/,"").replace($stateParams.parent+"/","");Destinations.get("DestinationsList",$stateParams.parent,parentDestinationSlug!=$stateParams.parent?parentDestinationSlug:"",vm.lang).then(function(response){"ok"==response.data.status&&(vm.parentDestination=response.data.destination)})}vm.isLoading=!1,$scope.$emit("updateSearchText",vm.destination.name),$scope.$broadcast("updateSearchText",vm.destination.name),loadNearby()}else $state.go("home")});break;case"destinations":default:"destinations-map",Destinations.get("DestinationsList","","",vm.lang).then(function(response){"ok"==response.data.status&&(response.data.destinations?(vm.destinations=response.data.destinations,vm.stateNames=["Arizona","California","Hawaii","Nevada"],vm.stateDestinations=$filter("orderBy")(vm.destinations.filter(function(d){return vm.stateNames.indexOf(d.name)>-1}),"name"),vm.cityDestinations=$filter("orderBy")(vm.destinations.filter(function(d){return-1===vm.stateNames.indexOf(d.name)}),"name"),dynamicFlex=vm.destinations.length%4,dynamicFlexTwo=vm.destinations.length%2,vm.dynamicFlex=dynamicFlex?Math.floor(100/dynamicFlex):25,vm.dynamicFlexTwo=dynamicFlexTwo?Math.floor(100/dynamicFlexTwo):50):response.data.destination&&(vm.destination=response.data.destination,dynamicFlex=vm.destination.children.length%4,dynamicFlexTwo=vm.destination.children.length%2,vm.dynamicFlex=dynamicFlex?Math.floor(100/dynamicFlex):25,vm.dynamicFlexTwo=dynamicFlexTwo?Math.floor(100/dynamicFlexTwo):50,vm.searchMode=vm.destination.defaultResortView||"map"),loadProperties(!0))})}vm.getStates=function(){if(vm.destination&&vm.destination.properties)return $filter("orderBy")($filter("filter")(vm.states,vm.selectedCountry),"name")}}angular.module("explorer.app").controller("DestinationsCtrl",["$scope","$state","$stateParams","$timeout","$window","$location","$filter","$mdDialog","$q","Settings","Destinations","appConfig",DestinationsCtrl])}(),function(){"use strict";function DiningCtrl($scope,$state,$stateParams,$window,$filter,$mdDialog,Places,Settings,appConfig){function photoPop(index,image){image.title&&(image.title=$filter("capitalize")($filter("camelCaseToHuman")(image.title)),image.title=image.title.replace("Photo Urls","")),image.index=index,$mdDialog.show({parent:angular.element(document.body),clickOutsideToClose:!0,escapeToClose:!0,templateUrl:"app/cards/photo-gallery.html",controller:function($scope,$filter,$mdDialog){function getPhotoUrl(target,url,size,crop){if(url&&"string"==typeof url){if(target&&""!=target)var result=document.getElementsByClassName(target);if("auto"===(size=size||"200")&&target){return size=angular.element(result)[0].clientWidth,url.replace("=s0","=s"+size+(crop?"-c":""))}return url.replace("=s0","=s"+size+(crop?"-c":""))}}var tmpIndex;$scope.image=image,$scope.totalImages=vm.property.diningOptions&&vm.property.diningOptions[0]&&vm.property.diningOptions[0].photos?vm.property.diningOptions[0].photos.length:0,$scope.image.url=getPhotoUrl("listing-page",$scope.image.googleUrl,1600,!1),$scope.closeDialog=function(){$mdDialog.hide()},$scope.nextImage=function(){tmpIndex=$scope.image.index,$scope.image.index+1=0?($scope.image=vm.property.diningOptions[0].photos[$scope.image.index-1],$scope.image.index=tmpIndex-1):($scope.image=vm.property.diningOptions[0].photos[vm.property.diningOptions[0].photos.length-1],$scope.image.index=vm.property.diningOptions[0].photos.length-1),$scope.image.title=$filter("capitalize")($filter("camelCaseToHuman")($scope.image.title)),$scope.image.title=$scope.image.title.replace("Photo Urls",""),$scope.image.url=getPhotoUrl("listing-page",$scope.image.googleUrl,1600,!1)}}})}var vm=this,_destinations=Settings.get("nearby_resorts")||[];if(vm.user=Settings.get("user")||{},vm.headerImage=$state.current.data.headerImage,vm.headerImagePositionY=$state.current.data.headerImagePositionY||null,vm.mapMarkerIcon=$window.APP_CONFIG.core.themes?$window.APP_CONFIG.core.themes.mapMarkerIcon:null,vm.mapOptions={attributionControl:!1,dragging:!0,boxZoom:!0,doubleClickZoom:!0,tap:!1,keyboard:!1,scrollWheelZoom:!1,zoomControl:!0,tileLayer:"https://b.tile.openstreetmap.org/{z}/{x}/{y}.png",minZoom:1,maxZoom:15},vm.googleMapOptions={height:"250px",scrollWheelZoom:!1,draggable:!0,disableDefaultUI:!1},vm.mapEvents={map:{enable:["moveend","popupopen"],logic:"emit"},marker:{enable:[],logic:"emit"}},vm.photoPop=photoPop,$stateParams.slug){var regions=_destinations,found=!1;vm.isProperty=!0,angular.forEach(regions,function(destination,destinationName){angular.forEach(destination.hotels,function(hotel){if(hotel.slug==$stateParams.slug.toLowerCase())if(found=!0,Settings.set("currentHotel",hotel),$scope.$broadcast("triggerResortSelect",hotel.hotelCode),$scope.$emit("triggerResortSelect",hotel.hotelCode),hotel.headerImage?vm.headerImage=hotel.headerImage:vm.headerImage=hotel.image,vm.destination=destination,vm.destinationName=destinationName,vm.headerProperty=hotel,vm.pageTitle="Dining near "+hotel.name,Places.get("PortalPropertyNoticesData",hotel.id).then(function(response){"ok"==response.data.status&&(vm.priorityNotices=response.data.content.priorityNotices,vm.notices=response.data.content.notices,vm.hints=response.data.content.hints)}),Settings.get("has_portal_property_details_"+hotel.id)){var _property=Settings.get("portal_property_details_"+hotel.id);_property.diningOptions&&_property.diningOptions.length&&(_property.diningOptions=_property.diningOptions.map(function(option){return option.mapMarker={center:{lat:parseFloat(option.lat),lng:parseFloat(option.lng),focus:!0,draggable:!0,zoom:15},markers:{marker:{lat:parseFloat(option.lat),lng:parseFloat(option.lng),message:(option.image?"":"")+option.name+'
'+option.addressLocality+", "+option.addressRegion+"
",focus:!1,alt:"Map marker for "+hotel.name+", located in "+option.addressLocality+", "+option.addressRegion,icon:appConfig.mapMarkerIcon||{iconUrl:vm.mapMarkerIcon||"https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/map-marker-emerald.png",iconSize:[72,60],iconAnchor:[36,60],popupAnchor:[0,-72]}}},googleMarkers:[{lat:parseFloat(option.lat),lng:parseFloat(option.lng),message:(option.image?"":"")+option.name+'
'+option.addressLocality+", "+option.addressRegion+"
",alt:"Map marker for "+hotel.name+", located in "+option.addressLocality+", "+option.addressRegion,icon:appConfig.mapMarkerIcon||{iconUrl:vm.mapMarkerIcon||"https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/map-marker-emerald.png",iconSize:[72,60],iconAnchor:[36,60]}}]},option})),vm.property=_property}else Places.get("PortalPropertyDetails",hotel.id).then(function(response){if("ok"==response.data.status){var _property=response.data.details;_property.diningOptions&&_property.diningOptions.length&&(_property.diningOptions=_property.diningOptions.map(function(option){return option.mapMarker={center:{lat:parseFloat(option.lat),lng:parseFloat(option.lng),focus:!0,draggable:!0,zoom:15},markers:{marker:{lat:parseFloat(option.lat),lng:parseFloat(option.lng),message:(option.image?"":"")+option.name+'
'+option.addressLocality+", "+option.addressRegion+"
",focus:!1,alt:"Map marker for "+hotel.name+", located in "+option.addressLocality+", "+option.addressRegion,icon:appConfig.mapMarkerIcon||{iconUrl:vm.mapMarkerIcon||"https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/map-marker-emerald.png",iconSize:[72,60],iconAnchor:[36,60],popupAnchor:[0,-72]}}},googleMarkers:[{lat:parseFloat(option.lat),lng:parseFloat(option.lng),message:(option.image?"":"")+option.name+'
'+option.addressLocality+", "+option.addressRegion+"
",alt:"Map marker for "+hotel.name+", located in "+option.addressLocality+", "+option.addressRegion,icon:appConfig.mapMarkerIcon||{iconUrl:vm.mapMarkerIcon||"https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/map-marker-emerald.png",iconSize:[72,60],iconAnchor:[36,60]}}]},option})),vm.property=_property,Settings.set("portal_property_details_"+hotel.id,response.data.details),Settings.set("has_portal_property_details_"+hotel.id,!0)}})})}),found||$state.go("404")}vm.currentIndex=0,vm.setCurrentSlideIndex=function(index){$analytics.eventTrack("webapp",{category:"page interaction",label:"View Dining Image "+(index+1)}),vm.currentIndex=index},vm.isCurrentSlideIndex=function(index){return vm.currentIndex===index},vm.prevSlide=function(){$analytics.eventTrack("webapp",{category:"page interaction",label:"Prev Dining Image "+(vm.currentIndex+1)}),vm.currentIndex=vm.currentIndex>0?--vm.currentIndex:vm.property.diningOptions[0].photos.length-1},vm.nextSlide=function(){$analytics.eventTrack("webapp",{category:"page interaction",label:"Next Dining Image "+(vm.currentIndex+1)}),vm.currentIndex=vm.currentIndex=12&&(ampm="pm",tmpHour-=12),formattedHour=tmpHour+":"+tmpMin+ampm,"0:00pm"==formattedHour?"Noon":formattedHour}}angular.module("explorer.app").controller("DiningCtrl",["$scope","$state","$stateParams","$window","$filter","$mdDialog","Places","Settings","appConfig",DiningCtrl])}(),function(){"use strict";function EventCtrl($scope,$state,$stateParams,$location,$filter,Places,Settings){function getPropertyEventDetails(){Places.get("PropertyNearbyEvents",vm.property.id).then(function(response){response&&response.data&&(events=response.data.events,angular.forEach(events,function(event){$stateParams.slug==$filter("toSlug")(event.name)&&(moment().diff(moment(event.end_time),"days")>=0&&$state.go("events"),event.start_time&&(start_time=moment(event.start_time),event.start_time=new Date(start_time.format())),event.end_time&&(end_time=moment(event.end_time),event.end_time=new Date(end_time.format())),vm.event=event,vm.h2=event.name,eventFound=!0)})),eventFound||$state.go(events.length>0?"hotelEvents":"hotel",{cityState:vm.property.cityState,slug:vm.property.slug})})}var events,start_time,end_time,vm=this,eventFound=!1;if(vm.headerImage=$state.current.data.headerImage,vm.bodyContent=$state.current.data.bodyContent,vm.h1=$state.current.data.h1,vm.hideH1=$state.current.data.hideH1,vm.h2=$state.current.data.h2,vm.hideH2=$state.current.data.hideH2,$stateParams.hotel){var regions=Settings.get("nearby_resorts")||[],hotelFound=!1;vm.isProperty=!0,angular.forEach(regions,function(destination,destinationName){angular.forEach(destination.hotels,function(hotel){hotel.slug==$stateParams.hotel.toLowerCase()&&(hotelFound=!0,$stateParams.cityState&&$stateParams.hotel&&$stateParams.cityState!=hotel.cityState&&(Object.keys($location.search()).length>0&&Settings.set("locationSearchUrlParams",$location.search()),$state.go("hotelEvent",{cityState:hotel.cityState,hotel:hotel.slug,slug:$stateParams.slug},{reload:"hotel"})),Settings.set("currentHotel",hotel),vm.destination=destination,vm.destinationName=destinationName,vm.headerProperty=hotel,vm.pageTitle="Offers at "+hotel.name,hotel.headerImage?vm.headerImage=hotel.headerImage:vm.headerImage=hotel.image,Settings.get("has_portal_property_details_"+hotel.id)?(vm.property=Settings.get("portal_property_details_"+hotel.id),getPropertyEventDetails(),$scope.$broadcast("triggerResortSelect",hotel.hotelCode),$scope.$emit("triggerResortSelect",hotel.hotelCode)):Places.get("PortalPropertyDetails",hotel.id).then(function(response){"ok"==response.data.status&&(vm.property=response.data.details,Settings.set("portal_property_details_"+hotel.id,response.data.details),Settings.set("has_portal_property_details_"+hotel.id,!0),getPropertyEventDetails(),$scope.$broadcast("triggerResortSelect",hotel.hotelCode),$scope.$emit("triggerResortSelect",hotel.hotelCode))}),Settings.set("currentHotel",hotel))})}),hotelFound||$state.go("404")}}angular.module("explorer.app").controller("EventCtrl",["$scope","$state","$stateParams","$location","$filter","Places","Settings",EventCtrl])}(),function(){"use strict";function EventsCtrl($scope,$state,$stateParams,$location,$filter,$timeout,Places,Settings){function getHotelEvents(selectedResort){vm.isLoading=!0,angular.forEach(_destinations,function(destination){angular.forEach(destination.hotels,function(hotel){ hotel.hotelCode==selectedResort&&(_currentHotel=hotel,vm.pageTitle=hotel.name,hotel.photos&&hotel.photos[2]?vm.headerImage=hotel.photos[2].url:vm.headerImage=$state.current.data.headerImage,Places.get("PropertyNearbyEvents",hotel.address.addressLocality+","+hotel.address.addressRegion+","+hotel.geo.latitude+","+hotel.geo.longitude).then(function(response){_eventCategories=[],"ok"==response.data.status&&(vm.property=_currentHotel,_currentEvents=response.data.events.filter(function(event){return moment().diff(moment(event.end_time),"days")<0}),vm.property.events=_currentEvents,angular.forEach(_currentEvents,function(event){event.category&&_eventCategories.indexOf(event.category)<0&&_eventCategories.push(event.category)}),vm.isLoading=!1,vm.eventCategories=_eventCategories)}))})})}var _eventCategories,_currentEvents,_currentHotel,start_time,end_time,vm=this,_destinations=Settings.get("nearby_resorts")||[];if(vm.user=Settings.get("user")||{},vm.headerImage=$state.current.data.headerImage,vm.headerImagePositionY=$state.current.data.headerImagePositionY||null,vm.getHotelEvents=getHotelEvents,$stateParams.slug){var regions=_destinations,found=!1;vm.isProperty=!0,angular.forEach(regions,function(destination,destinationName){angular.forEach(destination.hotels,function(hotel){hotel.slug==$stateParams.slug.toLowerCase()&&(found=!0,$stateParams.cityState&&$stateParams.slug&&$stateParams.cityState!=hotel.cityState&&(Object.keys($location.search()).length>0&&Settings.set("locationSearchUrlParams",$location.search()),$state.go("hotelEvents",{cityState:hotel.cityState,slug:hotel.slug},{reload:"hotelEvent"})),Settings.set("currentHotel",hotel),hotel.headerImage?vm.headerImage=hotel.headerImage:vm.headerImage=hotel.image,vm.destination=destination,vm.destinationName=destinationName,vm.headerProperty=hotel,vm.pageTitle="Events near "+hotel.name,Places.get("PortalPropertyNoticesData",hotel.id).then(function(response){"ok"==response.data.status&&(vm.priorityNotices=response.data.content.priorityNotices,vm.notices=response.data.content.notices,vm.hints=response.data.content.hints)}),Settings.get("has_portal_property_details_"+hotel.id)?(vm.property=Settings.get("portal_property_details_"+hotel.id),Places.get("PropertyNearbyEvents",hotel.address.addressLocality+","+hotel.address.addressRegion+","+hotel.geo.latitude+","+hotel.geo.longitude,hotel.id).then(function(response){_eventCategories=[],"ok"==response.data.status&&($scope.$broadcast("triggerResortSelect",hotel.hotelCode),$scope.$emit("triggerResortSelect",hotel.hotelCode),_currentEvents=response.data.events.filter(function(event){return moment().diff(moment(event.end_time),"days")<0}),vm.property.events=_currentEvents,angular.forEach(_currentEvents,function(event){event.category&&_eventCategories.indexOf(event.category)<0&&_eventCategories.push(event.category),event.slug=$filter("toSlug")(event.name),event.start_time&&(start_time=moment(event.start_time),event.start_time=new Date(start_time.format())),event.end_time&&(end_time=moment(event.end_time),event.end_time=new Date(end_time.format()))}),vm.eventCategories=_eventCategories)})):Places.get("PortalPropertyDetails",hotel.id).then(function(response){"ok"==response.data.status&&(vm.property=response.data.details,Settings.set("portal_property_details_"+hotel.id,response.data.details),Settings.set("has_portal_property_details_"+hotel.id,!0),Places.get("PropertyNearbyEvents",hotel.address.addressLocality+","+hotel.address.addressRegion+","+hotel.geo.latitude+","+hotel.geo.longitude,hotel.id).then(function(response){_eventCategories=[],"ok"==response.data.status&&($scope.$broadcast("triggerResortSelect",hotel.hotelCode),$scope.$emit("triggerResortSelect",hotel.hotelCode),_currentEvents=response.data.events.filter(function(event){return moment().diff(moment(event.end_time),"days")<0}),vm.property.events=_currentEvents,angular.forEach(_currentEvents,function(event){event.category&&_eventCategories.indexOf(event.category)<0&&_eventCategories.push(event.category),event.slug=$filter("toSlug")(event.name),event.start_time&&(start_time=moment(event.start_time),event.start_time=new Date(start_time.format())),event.end_time&&(end_time=moment(event.end_time),event.end_time=new Date(end_time.format()))}),vm.eventCategories=_eventCategories)}))}))})}),found||$state.go("404")}else vm.isProperty=!1,vm.hotels=[],angular.forEach(_destinations,function(destination){angular.forEach(destination.hotels,function(hotel){vm.hotels.push(hotel)})}),vm.selectedResort=Settings.get("selectedResort")||vm.hotels[0].hotelCode,getHotelEvents(vm.selectedResort)}angular.module("explorer.app").controller("EventsCtrl",["$scope","$state","$stateParams","$location","$filter","$timeout","Places","Settings",EventsCtrl])}(),function(){"use strict";function HomeCtrl($scope,$state,$timeout,$window,$filter,$mdMedia,$analytics,Places,Stories,Settings,appConfig){function setupStoryCarousel(stories){Array.isArray(stories)?vm.stories=stories.slice(0,10):vm.stories=[]}function _setupRegions(_regions){vm.centerLat?vm.mapCenter={lat:parseFloat(vm.centerLat),lng:parseFloat(vm.centerLng),focus:!0,draggable:!0,zoom:5}:appConfig.mapCenter&&(vm.mapCenter=appConfig.mapCenter),vm.mapOptions={attributionControl:!1,scrollWheelZoom:!1,dragging:!appConfig.isMobileDevice,tap:!appConfig.isMobileDevice,zoomControlPosition:"topright",tileLayer:appConfig.tileLayer||"https://b.tile.openstreetmap.org/{z}/{x}/{y}.png",minZoom:1,maxZoom:15},vm.mapLayers={baselayers:{osm:{name:"Our Properties",type:"xyz",url:appConfig.tileLayer||"https://b.tile.openstreetmap.org/{z}/{x}/{y}.png"}},overlays:{locations:{name:"All Locations",type:"markercluster",visible:!0,layerOptions:{maxClusterRadius:appConfig.maxClusterRadius||80,disableClusteringAtZoom:appConfig.disableClusteringAtZoom||!1,spiderfyDistanceMultiplier:appConfig.spiderfyDistanceMultiplier||1}}}},vm.mapEvents={map:{enable:["click","zoomstart","moveend","popupopen"],logic:"emit"},marker:{enable:["click"],logic:"emit"}};var defaultMapMarkerIconConfig=appConfig.mapMarkerIcon||{iconUrl:vm.mapMarkerIcon||"https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/map-marker-emerald.png",iconSize:[72,60],iconAnchor:[36,60],popupAnchor:[0,-72]},defaultMapMarkerIcon=defaultMapMarkerIconConfig,selectedMapMarkerIcon=!!appConfig.selectedMapMarkerIcon&&appConfig.selectedMapMarkerIcon;vm.selectedResult=null,vm.hideMapResortCard=!0,angular.forEach(_regions,function(region){angular.forEach(region.hotels,function(hotel){_hotels.push(hotel);try{var hotelHref;if(hotelHref=hotel.brand&&$window.LOGO_MAP_MARKER?$state.href("hotel",{brand:hotel.brand.slug,city:hotel.cityState.substring(0,hotel.cityState.lastIndexOf("-")),state:hotel.state,slug:hotel.slug}):$state.href("hotel",{cityState:hotel.cityState,slug:hotel.slug}),vm.skipHotels&&vm.skipHotels.indexOf(hotel.hotelCode)>-1);else{vm.selectedResult||(vm.selectedResult=hotel);var mapMarker={name:hotel.name,id:hotel.id,lat:parseFloat(hotel.geo.latitude),lng:parseFloat(hotel.geo.longitude),layer:"locations",focus:!1,alt:"Map marker for "+hotel.name+", located in "+hotel.address.addressLocality+(hotel.address.addressRegion?", "+hotel.address.addressRegion:""),icon:$window.LOGO_MAP_MARKER?{iconUrl:hotel.brand&&hotel.brand.slug?"https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/clientmedia/brands/portal/"+hotel.brand.slug+"-map-marker.png":hotel.logo,iconSize:[72,60],iconAnchor:[36,60],popupAnchor:[0,-60],className:"map-tip-popup"}:appConfig.mapMarkerIcon||{iconUrl:vm.mapMarkerIcon||"https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/map-marker-emerald.png",iconSize:[72,60],iconAnchor:[36,60],popupAnchor:[0,-60],className:"map-tip-popup"}};appConfig.hideMarkerPopup||(mapMarker.message="
\t\t '+hotel.name+''+hotel.name+'
'+hotel.address.addressLocality+(hotel.address.addressRegion?", "+hotel.address.addressRegion:"")+"
"),_markers.push(mapMarker)}}catch(e){console.log(hotel,e)}counter++})}),vm.regions=_regions,vm.allHotels=_hotels,vm.mapMarkers=_markers,vm.googleMapMarkers=_markers.slice(),vm.googleMapOptions={height:"580px",scrollWheelZoom:!1,draggable:!appConfig.isMobileDevice,disableDefaultUI:!1,defaultMarkerIcon:defaultMapMarkerIcon?{url:defaultMapMarkerIcon.iconUrl,scaledSize:defaultMapMarkerIcon.iconSize?new google.maps.Size(defaultMapMarkerIcon.iconSize[0],defaultMapMarkerIcon.iconSize[1]):null,anchor:defaultMapMarkerIcon.iconAnchor?new google.maps.Point(defaultMapMarkerIcon.iconAnchor[0],defaultMapMarkerIcon.iconAnchor[1]):null}:null,selectedMarkerIcon:selectedMapMarkerIcon?{url:selectedMapMarkerIcon.iconUrl,scaledSize:selectedMapMarkerIcon.iconSize?new google.maps.Size(selectedMapMarkerIcon.iconSize[0],selectedMapMarkerIcon.iconSize[1]):null,anchor:selectedMapMarkerIcon.iconAnchor?new google.maps.Point(selectedMapMarkerIcon.iconAnchor[0],selectedMapMarkerIcon.iconAnchor[1]):null}:null},_markers.length>0&&(vm.mapCenter={lat:_markers[0].lat,lng:_markers[0].lng,zoom:_markers.length>1?5:13}),$window.HIDE_HOTEL_CATEGORIES||getCategories(),getNotices(),$timeout(function(){$scope.$on("leafletDirectiveMap.popupopen",function(event){$analytics.eventTrack("Click Map Marker",{category:"Home Map Interaction",label:document.querySelector(".map-tip-firstline").innerText})}),$scope.$on("leafletDirectiveMap.zoomstart",function(event){$analytics.eventTrack("Zoom In/Out",{category:"Home Map Interaction"})}),$scope.$on("leafletDirectiveMap.click",function(event){$analytics.eventTrack("Click Map",{category:"Home Map Interaction"})}),$scope.$on("leafletDirectiveMap.moveend",function(event){$analytics.eventTrack("Move Map",{category:"Home Map Interaction"})})},1500)}function calculatePercentDifference(oldPrice,newPrice){var oldPriceNumeric=parseInt(oldPrice.replace(/\D/g,""),10),newPriceNumeric=parseInt(newPrice.replace(/\D/g,""),10);if(isNaN(oldPriceNumeric)||isNaN(newPriceNumeric))return!1;var difference=oldPriceNumeric-newPriceNumeric;return Math.abs(difference/newPriceNumeric*100).toFixed(0)+"%"}function showMarkerWindow(evt,id,markerId){vm.currentHotel=vm.allHotels[id],markerId?vm.map.showInfoWindow("marker-window",markerId):vm.map.showInfoWindow("marker-window",this)}function getCategories(){Places.get($window.USE_REGION_OFFER_CATEGORIES?"RegionOffersDetails":"RegionCategories").then(function(response){var _categories;"ok"==response.data.status&&(_categories=response.data.categories,angular.forEach(_categories,function(category,index){category.hotels=[],angular.forEach(vm.allHotels,function(hotel){hotel.cid.indexOf(category.id.toString())>-1&&category.hotels.push(hotel)}),category.offers||(category.offers=[],angular.forEach(response.data.offers,function(offer){offer.categoryId==category.id&&category.offers.push(offer)})),angular.forEach(category.offers,function(offer){$window.CJEVENT&&-1==offer.cta.indexOf("cjevent")&&(offer.cta.indexOf("?")>0?offer.cta=offer.cta+"&cjevent="+$window.CJEVENT:offer.cta=offer.cta+"?cjevent="+$window.CJEVENT),offer.price&&offer.oldPrice&&(offer.percentDifference=calculatePercentDifference(offer.oldPrice,offer.price)),$window.ROKTID&&-1==offer.cta.indexOf("rtid")&&(offer.cta.indexOf("?")>0?offer.cta=offer.cta+"&rtid="+$window.ROKTID:offer.cta=offer.cta+"?rtid="+$window.ROKTID),offer.hotels=[],offer.pid?angular.forEach(vm.allHotels,function(hotel){hotel.id==offer.pid&&(offer.hotelCityState=hotel.cityState,offer.hotels.push(hotel))}):offer.propertyIds&&angular.forEach(vm.allHotels,function(hotel){angular.forEach(offer.propertyIds,function(propertyId){hotel.id==propertyId&&offer.hotels.push(hotel)})})})})),vm.categories=_categories})}function getNotices(){Settings.get("hasPortalNoticesData")?vm.portalNotices=Settings.get("portalNoticesData").filter(function(notice){return 3!==notice.priority&&4!==notice.priority}):Places.get("PortalNoticesData").then(function(response){"ok"==response.data.status&&(Settings.set("hasPortalNoticesData",!0),Settings.set("portalNoticesData",response.data.content),vm.portalNotices=response.data.content.filter(function(notice){return 3!==notice.priority&&4!==notice.priority}))})}$window.MarkerClusterer&&(MarkerClusterer.prototype.MARKER_CLUSTER_IMAGE_PATH_="https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/clientmedia/0001-b8bde0ae-56af9275-cd0f-7fe91758/wyndham-extra-holidays/map-marker-dot");var vm=this,regionsLoaded=!1;vm.regionName=$window.PROPERTY_CITY+", "+$window.PROPERTY_STATE,vm.data=$state.current.data,vm.mapMarkerIcon=$window.APP_CONFIG.core.themes?$window.APP_CONFIG.core.themes.mapMarkerIcon:null,vm.pageTitle=$state.current.data.pageTitle,vm.bodyContent=$state.current.data.bodyContent,vm.headerImage=$state.current.data.headerImage,vm.headerImagePositionY=$state.current.data.headerImagePositionY||null,vm.heroVideo=$state.current.data.heroVideo,vm.heroVideoUrl=$state.current.data.heroVideoUrl,vm.featuredImage=$state.current.data.featuredImage,vm.featuredImageURL=$state.current.data.featuredImageURL,vm.primaryOfferCategoryId=$state.current.data.primaryOfferCategoryId,vm.secondaryOfferCategoryId=$state.current.data.secondaryOfferCategoryId,vm.featuredDestinationsIds=$state.current.data.featuredDestinationsIds,vm.featuredDestinationsHeading=$state.current.data.featuredDestinationsHeading,vm.featuredDestinationsSubheading=$state.current.data.featuredDestinationsSubheading,vm.h1=$state.current.data.h1,vm.hideH1=$state.current.data.hideH1,vm.h2=$state.current.data.h2,vm.hideH2=$state.current.data.hideH2,vm.notices=$state.current.data.notices,$state.current.data.homeLocation?vm.homeLocation=$state.current.data.homeLocation:vm.homeLocation={},$state.current.data.homeSpecials?vm.homeSpecials=$state.current.data.homeSpecials:vm.homeSpecials={},$state.current.data.uspBanner&&(vm.uspBanner=$state.current.data.uspBanner),$state.current.data.promoBanner&&(vm.promoBanner=$state.current.data.promoBanner),$state.current.data.promoBanner2&&(vm.promoBanner2=$state.current.data.promoBanner2),vm.user=Settings.get("user")||{},vm.query=Settings.get("query")||"",vm.contentFrame={},vm.type={items:[]},vm.showMarkerWindow=showMarkerWindow,vm.calculatePercentDifference=calculatePercentDifference,vm.windowResized=!1;var _hotels=[],_markers=[],counter=1;$window.isLightHouse||-1!=navigator.userAgent.toLowerCase().indexOf("chrome-lighthouse")||(vm.photoSliderImages=$window.REGION_SLIDER_IMAGES.filter(function(image){var pass=!0;return"1"==image.seasonal&&(image.starts||image.ends)&&(image.starts&&!moment().isAfter(moment(image.starts))&&(pass=!1),image.ends&&!moment().isBefore(moment(image.ends))&&(pass=!1)),pass&&"0"!=image.isActive})||[],vm.hideHomePageMap?$window.HIDE_HOTEL_CATEGORIES||(getCategories(),getNotices()):(Settings.get("nearby_resorts")&&(regionsLoaded||(regionsLoaded=!0,_setupRegions(Settings.get("nearby_resorts")))),$scope.$on("triggerRegionsLoaded",function(){regionsLoaded||(regionsLoaded=!0,_setupRegions(Settings.get("nearby_resorts")))}),$timeout(function(){regionsLoaded||Places.getNearbyResorts().then(function(response){response&&response.data&&"ok"==response.data.status&&_setupRegions(response.data.regions)})},2500)),$timeout(function(){if(vm.showStories){var stories=Settings.get("portalSiteStories");stories?setupStoryCarousel(stories):Stories.get("PropertySiteStories").then(function(response){"ok"===response.data.status&&(stories=response.data.stories,Settings.set("portalSiteStories",response.data.stories),Settings.set("portalSiteStoryCategories",response.data.categories),Settings.set("hasPortalSiteStories",!0),setupStoryCarousel(stories))})}}))}angular.module("explorer.app").controller("HomeCtrl",["$scope","$state","$timeout","$window","$filter","$mdMedia","$analytics","Places","Stories","Settings","appConfig",HomeCtrl])}(),function(){"use strict";function HotelCtrl($rootScope,$scope,$state,$stateParams,$window,$filter,$timeout,$location,$http,$analytics,$localStorage,$mdDialog,Places,Alert,Settings,appConfig){function showShopAbandonmentDialog(ev){$mdDialog.show({controller:ShopAbandonmentDialogController,templateUrl:window.CDN_URL+"cards/view/shop-abandonment.tpl.html",parent:angular.element(document.body),targetEvent:ev,clickOutsideToClose:!0,panelClass:"shop-abandonment",fullscreen:!1,locals:{property:vm.property}}).then(function(answer){console.log("Dialog answered with:",answer)},function(){console.log("Dialog was cancelled")})}function ShopAbandonmentDialogController($scope,$mdDialog,$filter,Alert,Settings,property){function formatDate(dateInput){const parsedDate=new Date(dateInput);return $filter("date")(parsedDate,"yyyy-MM-dd")}$scope.user={},$scope.popupImage=property.image,$scope.popupResort=property.name;var excludedPaths=["/las-vegas-nevada/desert-rose-resort","/shawnee-on-delaware-pennsylvania/wyndham-vacation-resorts-shawnee-village","/phoenix-arizona/legacy-golf-resort","/atlanta-georgia/margaritaville-vacation-club-atlanta","/daytona-beach-florida/ocean-walk-resort","/las-vegas-nevada/wyndham-desert-blue","/sevierville-tennessee/wyndham-smoky-mountains","/orlando-florida/wyndham-cypress-palms","/rio-grande-puerto-rico/rio-mar-beach-resort-spa","/charlotte-amalie-us-virgin-islands/limetree-beach-resort"];$scope.closeModal=function(){Settings.store("ShopAbandonSignedUp",!0,36e5),$mdDialog.cancel()},$scope.signUp=function(){if($scope.user.email&&/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test($scope.user.email)){$scope.shopAbandonForm.Country=window.DEVICE_INFO.country||"",$scope.shopAbandonForm.Region=window.DEVICE_INFO.state||"",$scope.shopAbandonForm.City=window.DEVICE_INFO.city||"",$scope.shopAbandonForm.DeviceCategory=window.DEVICE_INFO.deviceCategory||"",$scope.shopAbandonForm.CurrentUrl=window.location.href,$scope.shopAbandonForm.ResortName=property.name,$scope.shopAbandonForm.ResortCity=property.cityName,$scope.shopAbandonForm.ResortState=property.stateName,$scope.shopAbandonForm.PropertyID=property.hotelCode,$scope.shopAbandonForm.CheckinDate=formatDate(Settings.get("checkinDate")),$scope.shopAbandonForm.CheckoutDate=formatDate(Settings.get("checkoutDate")),$scope.shopAbandonForm.Email=$scope.user.email;const formValuesOnly={};angular.forEach($scope.shopAbandonForm,function(value,key){"$"!==key.charAt(0)&&(formValuesOnly[key]=value)});const formDataEncoded=new URLSearchParams(formValuesOnly).toString();$http({method:"POST",url:"https://www.formrouter.net/processform.aspx",data:formDataEncoded,headers:{"Content-Type":"application/x-www-form-urlencoded"}}).then(function(response){$scope.submissionComplete=!0,Settings.store("ShopAbandonSignedUp",!0,864e5)},function(error){Settings.store("ShopAbandonSignedUp",!0,864e5)}),$http.post("/api/salesforce/data-extension",{items:[{Email:$scope.shopAbandonForm.Email,ResortName:$scope.shopAbandonForm.ResortName,PropertyID:$scope.shopAbandonForm.PropertyID,Country:$scope.shopAbandonForm.Country,Region:$scope.shopAbandonForm.Region,City:$scope.shopAbandonForm.City,DeviceCategory:$scope.shopAbandonForm.DeviceCategory,CurrentUrl:$scope.shopAbandonForm.CurrentUrl,CheckinDate:$scope.shopAbandonForm.CheckinDate,CheckoutDate:$scope.shopAbandonForm.CheckoutDate,LoggedInUser:!1}]}).then(function(response){console.log("Success:",response.data)},function(error){console.error("Error:",error)}),$mdDialog.hide();var currentPath=window.location.pathname;excludedPaths.includes(currentPath)||$rootScope.$broadcast("triggerUpdatePromoCode","SHOP20"),$mdDialog.show({controller:function($scope,$mdDialog){$scope.popupImage=property.image,$scope.close=function(){$mdDialog.hide()},$scope.applyIdentifier=function(){$rootScope.$broadcast("triggerUpdatePromoCode","SHOP20")}},templateUrl:window.CDN_URL+"cards/view/shop-abandonment-thank-you.tpl.html",parent:angular.element(document.body),clickOutsideToClose:!0,panelClass:"shop-abandonment",fullscreen:!1})}else alert("Please enter a valid email address.")}}function broadcastDates(){$rootScope.$broadcast("updateDatesOfStay")}function dateRangeHasWeekend(dateRange){for(var startDate=dateRange.start,endDate=dateRange.end,start=new Date(startDate),end=new Date(endDate),currentDate=start;currentDate<=end;currentDate.setDate(currentDate.getDate()+1)){var dayOfWeek=currentDate.getDay();if(5===dayOfWeek||6===dayOfWeek)return!0}return!1}function updateRates(data){if(data&&data.roomStays&&data.roomStays[0]&&vm.property.hasOfferCatalog&&vm.property.hasOfferCatalog.itemListElement.length){var tmpRooms=angular.copy(vm.property.hasOfferCatalog.itemListElement);vm.property.hasOfferCatalog.itemListElement=null,vm.alternateResorts=null;dateRangeHasWeekend(data.roomStays[0].timeSpan);angular.forEach(tmpRooms,function(offer){var minPrice,specialRateFound=!1,lowestRate=!1,currentRate=0;angular.forEach(data.roomStays[0].allRoomTypes,function(room){offer.itemOffered.name==room.roomTypeName&&(angular.forEach(room.averageRates,function(rate){"Discount"==rate.ratePlanCategory&&rate.available&&(currentRate=rate.rate-(rate.discount||0),(!lowestRate||lowestRate.rate-lowestRate.discount>currentRate)&&(lowestRate=rate,specialRateFound=!0))}),angular.forEach(room.averageRates,function(rate){"Promotional"==rate.ratePlanCategory&&rate.available&&(currentRate=rate.rate-(rate.discount||0),(!lowestRate||lowestRate.rate-lowestRate.discount>currentRate)&&(lowestRate=rate,specialRateFound=!0))}),lowestRate?room.averageRates[0]=lowestRate:angular.forEach(room.averageRates,function(rate){specialRateFound||"Rack"!=rate.ratePlanCategory||(room.averageRates[0]=rate,specialRateFound=!0)}),offer.roomTypeId=room.roomTypeCode,offer.priceCurrency=data.currencyCode,offer.available=room.available,minPrice=room.averageRates[0].rate-room.averageRates[0].discount,offer.price=minPrice)})}),vm.property.hasOfferCatalog.itemListElement=tmpRooms}else{var tmpRooms=angular.copy(vm.property.hasOfferCatalog.itemListElement);vm.property.hasOfferCatalog.itemListElement=null,angular.forEach(tmpRooms,function(offer){offer.available=!1,offer.price=!1}),data.alternateHotels&&data.alternateHotels.length&&(angular.forEach(data.alternateHotels,function(resort){angular.forEach(regions,function(destination,destinationName){angular.forEach(destination.hotels,function(hotel){hotel.hotelCode==resort.hotelCode&&(resort.hotelImage=hotel.photos.length?hotel.photos[0].url:hotel.image,resort.hotelSlug=hotel.slug,resort.hotelCityState=hotel.cityState)})})}),vm.alternateResorts=data.alternateHotels),vm.property.hasOfferCatalog.itemListElement=tmpRooms}vm.ratesLoaded=!0}function getYextIframeSrc(storeCode){return"/api/yext-reviews?storeCode="+storeCode}function photoPop(index,image){image.title&&(image.title=$filter("capitalize")($filter("camelCaseToHuman")(image.title)),image.title=image.title.replace("Photo Urls","")),image.index=index,$mdDialog.show({parent:angular.element(document.body),clickOutsideToClose:!0,escapeToClose:!0,templateUrl:"app/cards/photo-gallery.html",controller:function($scope,$filter,$mdDialog){var tmpIndex;$scope.image=image,$scope.totalImages=vm.property.photos.length,$scope.closeDialog=function(){$mdDialog.hide()},$scope.nextImage=function(){tmpIndex=$scope.image.index,$scope.image.index+1=0?($scope.image=vm.property.photos[$scope.image.index-1],$scope.image.index=tmpIndex-1):($scope.image=vm.property.photos[vm.property.photos.length-1],$scope.image.index=vm.property.photos.length-1),$scope.image.title=$filter("capitalize")($filter("camelCaseToHuman")($scope.image.title)),$scope.image.title=$scope.image.title.replace("Photo Urls","")}}})}var vm=this,found=!1;vm.hotelSlug=$stateParams.slug.toLowerCase(),vm.featuredImage=$state.current.data.featuredImage,vm.featuredImageURL=$state.current.data.featuredImageURL,vm.mapMarkerIcon=$window.APP_CONFIG.core.themes?$window.APP_CONFIG.core.themes.mapMarkerIcon:null,vm.currentUrl=$location.path(),vm.photoPop=photoPop,vm.hotelAmenitiesList=[],vm.getYextIframeSrc=getYextIframeSrc,vm.isLightHouse=$window.isLightHouse,vm.broadcastDates=broadcastDates,vm.showShopAbandonmentPopup=!1;var regions=Settings.get("nearby_resorts")||[];$location.search().utm_campaign&&$location.search().utm_campaign.indexOf("7daysale")>-1&&$scope.$emit("triggerUpdatePromoCode","7DAYSALE"),$scope.$on("triggerExpandElementId",function(ev,elementId){angular.forEach(vm.hints,function(hints,hintType){$filter("toSlug")(hintType)===elementId&&(hints.expandNotice=!0)})}),vm.hotelSlug&&(vm.isProperty=!0,angular.forEach(regions,function(destination,destinationName){angular.forEach(destination.hotels,function(hotel){if(hotel.slug==vm.hotelSlug){window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"productView",ecommerce:{currencyCode:"USD",detail:{products:[{name:hotel.name,id:hotel.hotelCode,price:"",brand:hotel.brand,variant:"Rental",quantity:"1"}]}}}),$stateParams.cityState&&vm.hotelSlug&&$stateParams.cityState!=hotel.cityState&&(Object.keys($location.search()).length>0&&Settings.set("locationSearchUrlParams",$location.search()),$state.go("hotel",{cityState:hotel.cityState,slug:hotel.slug},{reload:"hotel"}));var markerIcon={};vm.amenityFeatures=hotel.amenityFeature,markerIcon=hotel.brand&&hotel.brand.slug?{iconUrl:hotel.brand&&hotel.brand.slug?"https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/clientmedia/brands/portal/"+hotel.brand.slug+"-map-marker.png":hotel.logo,iconSize:[72,60],iconAnchor:[36,60],popupAnchor:[0,-72]}:appConfig.mapMarkerIcon||{iconUrl:vm.mapMarkerIcon||"https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/map-marker-emerald.png",iconSize:[72,60],iconAnchor:[36,60],popupAnchor:[0,-60]},Settings.set("currentHotel",hotel),$scope.$emit("triggerUpdateHeaderLogo",hotel.logo),vm.headerImage=hotel.headerImage||hotel.image,vm.destination=destination,vm.destinationName=destinationName,vm.headerProperty=hotel,hotel.hints&&(vm.hints=hotel.hints),$rootScope.header&&$rootScope.header.backState&&$rootScope.header.backState.length>1&&$analytics.eventTrack(hotel.hotelCode,{category:"resort",label:hotel.name}),vm.isLightHouse||-1!=navigator.userAgent.toLowerCase().indexOf("chrome-lighthouse")?(vm.property=hotel,vm.property.bodyContent=vm.property.description):hotel.geo&&hotel.address&&(vm.mapCenter={lat:parseFloat(hotel.geo.latitude),lng:parseFloat(hotel.geo.longitude),focus:!0,draggable:!0,zoom:16},vm.mapMarkers={marker:{lat:vm.mapCenter.lat,lng:vm.mapCenter.lng,message:'
'+hotel.name+'
'+hotel.name+'
'+hotel.address.addressLocality+(hotel.address.addressRegion?", "+hotel.address.addressRegion:"")+"
",focus:!1,alt:"Map marker for "+hotel.name+", located in "+hotel.address.addressLocality+(hotel.address.addressRegion?", "+hotel.address.addressRegion:""),icon:markerIcon}},vm.mapOptions={attributionControl:!1,scrollWheelZoom:!1,zoomControlPosition:"topright",dragging:!appConfig.isMobileDevice,tap:!appConfig.isMobileDevice,tileLayer:appConfig.tileLayer||"https://b.tile.openstreetmap.org/{z}/{x}/{y}.png",minZoom:1,maxZoom:15},vm.googleMapMarkers=[vm.mapMarkers.marker],vm.googleMapOptions={height:"600px",scrollWheelZoom:!1,draggable:!appConfig.isMobileDevice,disableDefaultUI:!0},Places.get("PortalPropertyDetails",hotel.id).then(function(response){if("ok"==response.data.status){$timeout(function(){$scope.$broadcast("triggerResortSelect",hotel.hotelCode),$scope.$emit("triggerResortSelect",hotel.hotelCode)},500),vm.showShopAbandonmentPopupProperties&&(vm.showShopAbandonmentPopupProperties.includes(vm.headerProperty.hotelCode)&&!Settings.retrieve("ShopAbandonSignedUp")&&(vm.showShopAbandonmentPopup=!0),vm.showShopAbandonmentPopup&&$timeout(function(){showShopAbandonmentDialog()},3500));var details=response.data.details;if(details.hasOfferCatalog&&details.hasOfferCatalog.itemListElement&&angular.forEach(details.hasOfferCatalog.itemListElement,function(offer){offer.hotelSlug=hotel.slug,offer.state=hotel.state,offer.cityState=hotel.cityState,offer.hotelCode=hotel.hotelCode,offer.hotelName=hotel.name,offer.hotelSameAs=hotel.sameAs,offer.details?offer.isActive=offer.details.isActive:offer.isActive=1,"ja"==$window.DEFAULT_LANG?offer.itemOffered.slug=$filter("toSlug")(offer.itemOffered.name,!0):offer.itemOffered.slug=$filter("toSlug")(offer.itemOffered.name)}),details.bodyContent||details.dynamicContent||details.headerImage){if(vm.property=details,vm.headerImage=details.headerImage||hotel.image,"function"==typeof Settings.setMetaTitle&&"function"==typeof Settings.setMetaDescription){var pageTitle=details.pageTitle?details.pageTitle:hotel.name;$rootScope.MetaTags.title=pageTitle,Settings.setMetaDescription(details.metaDescription?details.metaDescription:hotel.description)}}else vm.property=hotel||Settings.get("currentHotel");1==$window.SHOW_LEAD_RATES&&(vm.checkinDate=new Date(Settings.get("checkinDate")?moment(Settings.get("checkinDate")):moment().add(2,"days")),vm.checkoutDate=new Date(Settings.get("checkoutDate")?moment(Settings.get("checkoutDate")):moment().add(4,"days")),$scope.$on("triggerUpdateBookingDates",function(ev,data){data.leadRate?(vm.leadRate=data.leadRate,vm.priceCurrency=data.currencyCode):(vm.leadRate=null,vm.priceCurrency=null),vm.ratesLoaded=!1;var _checkinDate=new Date(Settings.get("checkinDate")?moment(Settings.get("checkinDate")):moment().add(2,"days")),_checkoutDate=new Date(Settings.get("checkoutDate")?moment(Settings.get("checkoutDate")):moment().add(4,"days"));vm.checkinDate!=_checkinDate&&vm.checkoutDate!=_checkoutDate&&(updateRates(data),vm.checkinDate=_checkinDate,vm.checkoutDate=_checkoutDate)}),$scope.$watch("vm.checkinDate",function(date){$localStorage.checkinDate=moment(date),Settings.set("checkinDate",moment(date))}),$scope.$watch("vm.checkoutDate",function(date){$localStorage.checkoutDate=moment(date),Settings.set("checkoutDate",moment(date))}))}},function(error){vm.property=hotel||Settings.get("currentHotel")}),Places.get("PortalPropertyNoticesData",hotel.id).then(function(response){if("ok"==response.data.status){if(($rootScope.locationHash||$location.hash())&&response.data.content.hints){angular.forEach(response.data.content.hints,function(hints,hintType){$filter("toSlug")(hintType)===($rootScope.locationHash||$location.hash())&&(hints.expandNotice=!0)})}vm.priorityNotices=response.data.content.priorityNotices,vm.notices=response.data.content.notices,vm.hints=response.data.content.hints}})),found=!0}})}),found||$state.go($window.APP_CONFIG.menu.Destinations?"destinations":"hotels"))}angular.module("explorer.app").controller("HotelCtrl",["$rootScope","$scope","$state","$stateParams","$window","$filter","$timeout","$location","$http","$analytics","$localStorage","$mdDialog","Places","Alert","Settings","appConfig",HotelCtrl])}(),function(){"use strict";function HotelsCtrl($scope,$state,$stateParams,$mdDialog,$window,$filter,$timeout,$analytics,Places,Alert,Settings,appConfig){function _setupMapMarkers(){(vm.pagedResults||vm.allHotels)&&(_mapMarkers=[],vm.selectedResult=null,vm.hideMapResortCard=!0,angular.forEach(vm.pagedResults||vm.allHotels,function(hotel){if(hotel.geo&&hotel.address){vm.selectedResult||(vm.selectedResult=hotel), hotel.cityState||(hotel.cityState="");var hotelHref;hotelHref=hotel.brand&&$window.LOGO_MAP_MARKER?$state.href("hotel",{brand:hotel.brand.slug,city:hotel.cityState.substring(0,hotel.cityState.lastIndexOf("-")),state:hotel.state,slug:hotel.slug}):$state.href("hotel",{cityState:hotel.cityState,slug:hotel.slug});var mapMarker={name:hotel.name,id:hotel.id,lat:parseFloat(hotel.geo.latitude),lng:parseFloat(hotel.geo.longitude),layer:"locations",focus:!1,alt:"Map marker for "+hotel.name+", located in "+(hotel.address?hotel.address.addressLocality:"")+", "+(hotel.address?hotel.address.addressRegion:""),icon:defaultMapMarkerIconConfig};appConfig.hideMarkerPopup||(mapMarker.message="
\t\t '+hotel.name+''+hotel.name+'
'+hotel.address.addressLocality+(hotel.address.addressRegion?", "+hotel.address.addressRegion:"")+"
"),_mapMarkers.push(mapMarker)}else console.log(hotel),hotel.geo={},hotel.address={}}),vm.mapMarkers=_mapMarkers,vm.googleMapMarkers=_mapMarkers,vm.googleMapOptions={height:"580px",scrollWheelZoom:!1,draggable:!appConfig.isMobileDevice,disableDefaultUI:!1,defaultMarkerIcon:defaultMapMarkerIcon?{url:defaultMapMarkerIcon.iconUrl,scaledSize:defaultMapMarkerIcon.iconSize?new google.maps.Size(defaultMapMarkerIcon.iconSize[0],defaultMapMarkerIcon.iconSize[1]):null,anchor:defaultMapMarkerIcon.iconAnchor?new google.maps.Point(defaultMapMarkerIcon.iconAnchor[0],defaultMapMarkerIcon.iconAnchor[1]):null}:null,selectedMarkerIcon:selectedMapMarkerIcon?{url:selectedMapMarkerIcon.iconUrl,scaledSize:selectedMapMarkerIcon.iconSize?new google.maps.Size(selectedMapMarkerIcon.iconSize[0],selectedMapMarkerIcon.iconSize[1]):null,anchor:selectedMapMarkerIcon.iconAnchor?new google.maps.Point(selectedMapMarkerIcon.iconAnchor[0],selectedMapMarkerIcon.iconAnchor[1]):null}:null},$timeout(function(){$scope.$on("leafletDirectiveMap.popupopen",function(event,args){console.log(event,args),$analytics.eventTrack("Click Map Marker Popup Open",{category:"Destinations Map Interaction",label:document.querySelector(".map-tip-firstline").innerText})}),$scope.$on("leafletDirectiveMap.zoomstart",function(event){$analytics.eventTrack("Zoom In/Out",{category:"Destinations Map Interaction"})}),$scope.$on("leafletDirectiveMap.click",function(event){$analytics.eventTrack("Click Map",{category:"Destinations Map Interaction"})}),$scope.$on("leafletDirectiveMarker.click",function(event,args){console.log(event,args),$analytics.eventTrack("Click Map Marker",{category:"Destinations Map Interaction"}),console.log(event)}),$scope.$on("leafletDirectiveMap.moveend",function(event){$analytics.eventTrack("Move Map",{category:"Destinations Map Interaction"})})},1e3))}function filterByBrands(hotel){return!vm.searchFilters.brand||""==vm.searchFilters.brand||0==hotel.name.indexOf(vm.searchFilters.brand)}function orderByFeatureCount(amenity){return vm.amenityFeatureSetCounts[amenity.name]}function showExpandedFeaturesList(ev){$mdDialog.show({controller:ExpandedFeaturesController,templateUrl:"app/cards/eh-expanded-features-list.html",parent:angular.element(document.body),targetEvent:ev,clickOutsideToClose:!0}).then(function(answer){$scope.status='You said the information was "'+answer+'".'},function(){$scope.status="You cancelled the dialog."})}function updateSearchResults(){timer&&$timeout.cancel(timer),timer=$timeout(function(){vm.pagedResults=filteredResults(),vm.currentMarker&&(vm.currentMarker=null)},10)}function filteredResults(){var passExperienceCheck=!0,passDestinationCheck=!0,queryFilter=function(query,hotel){var lowercaseQuery=angular.lowercase(query);return lowercaseQuery=lowercaseQuery.replace(/[^a-zA-Z0-9 ]/g,""),hotel.value.indexOf(lowercaseQuery)>-1},experienceFilter=function(experiences,hotel){var passCounter=0,verifyTotal=0;return angular.forEach(experiences,function(verify,experience){verify&&(verifyTotal++,angular.forEach(_categories,function(category){category.title==experience&&angular.forEach(category.offers,function(offer){offer.pid==hotel.id&&passCounter++})}))}),passCounter>0||!verifyTotal},destinationFilter=function(destination,hotel){return"All"==destination||_allRegions[destination].hotels.indexOf(hotel.id)>-1},destinationListFilter=function(destinationList,hotel){var found=!1,hasSelection=!1;return angular.forEach(destinationList,function(verify,destination){1==verify&&(hasSelection=!0,_allRegions[destination].hotels.indexOf(hotel.id)>-1&&(found=!0))}),!hasSelection||found};return _allHotels.filter(function(hotel){var pass=!0;return vm.searchWords&&(pass=queryFilter(vm.searchWords,hotel),$analytics.eventTrack(vm.searchWords,{category:"search",label:"hotel search"})),!!pass&&(angular.forEach(vm.searchFilters,function(filters,filterType){switch(filterType){case"experiences":passExperienceCheck=experienceFilter(filters,hotel);break;case"destination":passDestinationCheck=destinationFilter(filters,hotel);break;case"destinationList":passDestinationCheck=destinationListFilter(filters,hotel)}}),passDestinationCheck&&passExperienceCheck)})}function _getUrlParam(name){var match=$window.location.search.match(new RegExp("[?&]"+name+"=([^&]*)"));return match?decodeURIComponent(match[1].replace(/\+/g," ")):null}function _updateUrlStateParam(regionName){var search=$window.location.search;search=regionName?search.match(/[?&]state=/)?search.replace(/([?&]state=)[^&]*/,"$1"+encodeURIComponent(regionName)):search+(search?"&":"?")+"state="+encodeURIComponent(regionName):search.replace(/&state=[^&]*/,"").replace(/\?state=[^&]*&?/,"?").replace(/\?$/,""),$window.history.replaceState({},"",$window.location.pathname+search+$window.location.hash)}function selectRegion(regionName){resetFilters(null,!0),vm.searchFilters.destinationList={},vm.searchFilters.destinationList[regionName]=1,updateSearchResults(),_updateUrlStateParam(regionName)}function resetFilters(type,skip){vm.searchWords="",vm.searchFilters={},vm.updateSearchResults(),skip||_updateUrlStateParam(null)}function showMarkerWindow(evt,id,markerId){}function ExpandedFeaturesController($scope,$mdDialog){$scope.featuresList=vm.amenityFeatureSet,$scope.featureSetCounts=vm.amenityFeatureSetCounts,$scope.hide=function(){$mdDialog.hide()},$scope.cancel=function(){$mdDialog.cancel()},$scope.answer=function(answer){$mdDialog.hide(answer)}}var timer,_categories,_mapMarkers,vm=this,_allHotels=[],_amenityFeatureSet=[],_amenityTotalCounts=[],_allRegions=[];vm.centerLat?vm.mapCenter={lat:parseFloat(vm.centerLat),lng:parseFloat(vm.centerLng),focus:!0,draggable:!0,zoom:5}:appConfig.mapCenter&&(vm.mapCenter=appConfig.mapCenter),vm.headerImage=$state.current.data.headerImage,vm.mapMarkerIcon=$window.APP_CONFIG.core.themes?$window.APP_CONFIG.core.themes.mapMarkerIcon:null,vm.bodyContent=$state.current.data.bodyContent,vm.pageTitle=$state.current.data.pageTitle,vm.h1=$state.current.data.h1,vm.hideH1=$state.current.data.hideH1,vm.h2=$state.current.data.h2,vm.hideH2=$state.current.data.hideH2,vm.mapConfig={searchMode:"map",center:{lat:39.707186,lng:-101.351624},zoom:6},vm.searchFilters={},vm.categories=[],vm.regions={},vm.showMarkerWindow=showMarkerWindow,vm.updateSearchResults=updateSearchResults,vm.showExpandedFeaturesList=showExpandedFeaturesList,vm.orderByFeatureCount=orderByFeatureCount,vm.filterByBrands=filterByBrands,vm.resetFilters=resetFilters,vm.selectRegion=selectRegion,vm.mapOptions={attributionControl:!1,scrollWheelZoom:!1,dragging:!appConfig.isMobileDevice,tap:!appConfig.isMobileDevice,zoomControlPosition:"topright",boxZoom:!0,doubleClickZoom:!0,zoomControl:!0,tileLayer:appConfig.tileLayer||"https://b.tile.openstreetmap.org/{z}/{x}/{y}.png",minZoom:1,maxZoom:15},vm.mapLayers={baselayers:{osm:{name:"Our Locations",type:"xyz",url:appConfig.tileLayer||"https://b.tile.openstreetmap.org/{z}/{x}/{y}.png"}},overlays:{locations:{name:"Locations",type:"markercluster",visible:!0,layerOptions:{maxClusterRadius:appConfig.maxClusterRadius||80,disableClusteringAtZoom:appConfig.disableClusteringAtZoom||!1,spiderfyDistanceMultiplier:appConfig.spiderfyDistanceMultiplier||1}}}},vm.mapEvents={map:{enable:["click","zoomstart","moveend","popupopen"],logic:"emit"},marker:{enable:["click"],logic:"emit"}};var defaultMapMarkerIconConfig=appConfig.mapMarkerIcon||{iconUrl:vm.mapMarkerIcon||"https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/map-marker-emerald.png",iconSize:[72,60],iconAnchor:[36,60],popupAnchor:[0,-72]},defaultMapMarkerIcon=defaultMapMarkerIconConfig,selectedMapMarkerIcon=!!appConfig.selectedMapMarkerIcon&&appConfig.selectedMapMarkerIcon;if(vm.headerImage?Settings.setHeaderImage(vm.headerImage):Settings.setHeaderImage(null),$scope.$on("updateSearchQuery",function(ev,query){vm.searchWords=query,updateSearchResults()}),$scope.$watch("vm.pagedResults",function(newValue,oldValue){newValue&&oldValue&&!angular.equals(newValue,oldValue)&&(_setupMapMarkers(),vm.mapCenter={lat:parseFloat(newValue[0].geo.latitude),lng:parseFloat(newValue[0].geo.longitude),focus:!0,draggable:!0,zoom:5})}),Settings.get("has_nearby_resorts")){var _regions=Settings.get("nearby_resorts");vm.allHotels=[],angular.forEach(_regions,function(region){angular.forEach(region.hotels,function(hotel){vm.allHotels.push(hotel)})}),vm.regions=_regions,_setupMapMarkers()}vm.amenityFeatureSet=[],vm.dataLoaded=!1,$window.HIDE_HOTEL_CATEGORIES||function(){Places.get("RegionCategories").then(function(response){if("ok"==response.data.status){_categories=response.data.categories,angular.forEach(vm.regions,function(region,regionName){var currentHotels=[];angular.forEach(region.hotels,function(hotel){currentHotels.push(hotel.id),hotel.geo&&hotel.geo.latitude&&hotel.geo.longitude&&(hotel.description=hotel.description||hotel.bodyContent,hotel.address?hotel.value=hotel.name.toLowerCase()+" "+(hotel.address.streetAddress?hotel.address.streetAddress.toLowerCase():"")+" "+(hotel.address.addressLocality?hotel.address.addressLocality.toLowerCase():"")+" "+(hotel.address.addressRegion?hotel.address.addressRegion.toLowerCase():"")+" "+(hotel.stateName?hotel.stateName.toLowerCase():"")+" "+(hotel.cityName?hotel.cityName.toLowerCase():"")+" "+(hotel.address.addressCountry?hotel.address.addressCountry.toLowerCase():"")+" "+hotel.telephone+" "+hotel.address.postalCode:hote.value=hotel.name.toLowerCase(),hotel.additionalProperty&&angular.forEach(hotel.additionalProperty,function(property){switch(property.name){case"Additional Locations":hotel.value+=" "+property.value.toLowerCase()}}),hotel.alternateName&&(hotel.value+=" "+hotel.alternateName.join(" ")),hotel.value=hotel.value.replace(/[^a-zA-Z0-9 ]/g,"").toLowerCase(),_allHotels.push(hotel),hotel.hasOfferCatalog&&hotel.hasOfferCatalog.itemListElement&&angular.forEach(hotel.hasOfferCatalog.itemListElement,function(offer){angular.forEach(offer.itemOffered.amenityFeature,function(feature){-1==_amenityFeatureSet.indexOf(feature.name)?(_amenityFeatureSet.push(feature.name),_amenityTotalCounts[feature.name]=1,vm.amenityFeatureSet.push(feature)):_amenityTotalCounts[feature.name]=_amenityTotalCounts[feature.name]+1})}),angular.forEach(_categories,function(category,index){category.hotels=[],hotel.cid.indexOf(category.id.toString())>-1&&category.hotels.push(hotel.id)}))}),_allRegions[regionName]={hotels:currentHotels}}),vm.amenityFeatureSetCounts=_amenityTotalCounts,vm.pagedResults=_allHotels,vm.dataLoaded=!0,vm.categories=_categories,Settings.get("topSearchQuery")?(vm.searchWords=Settings.get("topSearchQuery"),updateSearchResults(),Settings.set("topSearchQuery",null)):$stateParams.q&&(vm.searchWords=$stateParams.q,updateSearchResults(),Settings.set("topSearchQuery",null));var urlStateParam=_getUrlParam("state");if(urlStateParam){var matchedRegion=null;angular.forEach(vm.regions,function(region,regionName){regionName.toLowerCase()===urlStateParam.toLowerCase()&&(matchedRegion=regionName)}),matchedRegion&&(vm.searchFilters={destinationList:{}},vm.searchFilters.destinationList[matchedRegion]=1,updateSearchResults())}}})}()}angular.module("explorer.app").controller("HotelsCtrl",["$scope","$state","$stateParams","$mdDialog","$window","$filter","$timeout","$analytics","Places","Alert","Settings","appConfig",HotelsCtrl])}(),function(){"use strict";function InsiderCtrl($rootScope,$scope,$state,$location,$localStorage,$mdDialog,$window,$filter,$timeout,$http,$analytics,$q,Places,Destinations,Alert,Settings,appConfig,tokenService){function getJwtToken(){$http.get("https://search.travelclick.com/WEH#/").then(function(response){var htmlContent=response.data,tsMatch=(htmlContent.match(/var\s+authToken\s*=\s*["']([^"']+)["']/),htmlContent.match(/var\s+ts\s*=\s*['"]([^'"]+)['"]/)),tkMatch=htmlContent.match(/var\s+tk\s*=\s*['"]([^'"]+)['"]/),gtsMatch=htmlContent.match(/var\s+gts\s*=\s*['"]([^'"]+)['"]/),gtkMatch=htmlContent.match(/var\s+gtk\s*=\s*['"]([^'"]+)['"]/);window.ts=tsMatch?tsMatch[1]:"",window.tk=tkMatch?tkMatch[1]:"",window.gts=gtsMatch?gtsMatch[1]:"",window.gtk=gtkMatch?gtkMatch[1]:"",console.log("Set window properties:",{ts:window.ts,tk:window.tk,gts:window.gts,gtk:window.gtk});var encryptedToken=angular.copy(window.ts),tokenKey=angular.copy(window.tk);angular.copy(window.gts),angular.copy(window.gtk);if(!encryptedToken||!tokenKey)return console.error("Missing required values for token decryption"),null;try{const adjustedKey=encryptedToken.substring(encryptedToken.length-(16-"WEH".length))+"WEH",encryptionKey=aesjs.utils.utf8.toBytes(adjustedKey),encryptedBytes=aesjs.utils.hex.toBytes(tokenKey),aesCtr=new aesjs.ModeOfOperation.ctr(encryptionKey),decryptedBytes=aesCtr.decrypt(encryptedBytes);var decryptedText=aesjs.utils.utf8.fromBytes(decryptedBytes);return console.log("Decrypted token:",decryptedText),$scope.authorization=decryptedText,window.decryptedToken=decryptedText,decryptedText}catch(error){return console.error("Error decrypting token:",error),null}}).catch(function(error){console.error("Error fetching the external HTML:",error)})}function isStoredAuthValid(){const storedAuth=JSON.parse(localStorage.getItem(STORAGE_KEY)||"{}");return!!storedAuth.expiresAt&&(new Date).getTime()1&&(dist=1),dist=Math.acos(dist),dist=180*dist/Math.PI,dist=60*dist*1.1515}return dist},$scope.onProfileStateChange=function(){const selectedState=$scope.editableProfile.address.locality.state.name,stateAbbr=getStateAbbreviation(selectedState);stateAbbr&&($scope.editableProfile.address.locality.state.abbr=stateAbbr)},$scope.saveProfile=function(){const headers={accept:"application/json","content-type":"application/json",authorization:"Bearer "+$scope.currentIdToken,"group-uuid":GROUP_UUID},updateData={first_name:$scope.editableProfile.first_name,last_name:$scope.editableProfile.last_name,birthday:new Date($scope.editableProfile.birthday).toISOString().split("T")[0],address:$scope.editableProfile.address,gender:$scope.editableProfile.gender,phone_number:$scope.editableProfile.phone_number};$http.put(API_ENDPOINT+"/customer/",updateData,{headers:headers}).then(function(response){$scope.customerData=response.data,$scope.updateMessage="Profile updated successfully!",Alert.fire({title:"Updated",message:$scope.updateMessage}),$scope.updateSuccess=!0,$scope.editMode=!1}).catch(function(error){$scope.updateMessage="Error updating profile: "+(error.data?JSON.stringify(error.data):error.message),Alert.fire({title:"Error",message:$scope.updateMessage}),$scope.updateSuccess=!1})},$scope.login=function(){if(isStoredAuthValid()){const authData=getStoredAuthData();return $scope.currentIdToken=authData.idToken,void $state.go("insider-upcoming-stays")}performFullLogin()},$scope.logout=function(){localStorage.removeItem(STORAGE_KEY),$rootScope.$broadcast("userLoggedIn",!1),$state.go("insider-login",{reload:!0})},$scope.$watch("customerData",function(newVal){if(newVal)try{"string"==typeof newVal&&($scope.customerData=JSON.parse(newVal),$scope.editableProfile=JSON.parse(JSON.stringify($scope.customerData)),$scope.editableProfile.birthday&&($scope.editableProfile.birthday=new Date($scope.editableProfile.birthday)))}catch(e){console.error("Error parsing customer data:",e)}}),$scope.$watch("getUserResponse",function(newVal){if(newVal)try{"string"==typeof newVal&&($scope.getUserResponse=JSON.parse(newVal))}catch(e){console.error("Error parsing customer data:",e)}}),$scope.$watch("transactionData",function(newVal){if(newVal)try{"string"==typeof newVal&&($scope.transactionData=JSON.parse(newVal))}catch(e){console.error("Error parsing transaction preview:",e)}}),$scope.$watch("cancelledTransactionData",function(newVal){if(newVal)try{"string"==typeof newVal&&($scope.cancelledTransactionData=JSON.parse(newVal))}catch(e){console.error("Error parsing transaction preview:",e)}}),$scope.$watch("rewardData",function(newVal){if(newVal)try{"string"==typeof newVal&&($scope.rewardData=JSON.parse(newVal))}catch(e){console.error("Error parsing rewards preview:",e)}}),$scope.$watch("specialRewardData",function(newVal){if(newVal)try{"string"==typeof newVal&&($scope.specialRewardData=JSON.parse(newVal))}catch(e){console.error("Error parsing rewards preview:",e)}}),$scope.$watch("pastSpecialRewardData",function(newVal){if(newVal)try{"string"==typeof newVal&&($scope.pastSpecialRewardData=JSON.parse(newVal))}catch(e){console.error("Error parsing rewards preview:",e)}}),$scope.$watch("milestoneData",function(newVal){if(newVal)try{"string"==typeof newVal&&($scope.milestoneData=JSON.parse(newVal))}catch(e){console.error("Error parsing rewards preview:",e)}}),$scope.$watch("inactiveMilestoneData",function(newVal){if(newVal)try{"string"==typeof newVal&&($scope.inactiveMilestoneData=JSON.parse(newVal))}catch(e){console.error("Error parsing rewards preview:",e)}}),function(){$scope.isLoading=!0,getJwtToken();var savedPrefs=localStorage.getItem("communicationPrefs") ;if($scope.communicationPrefs=savedPrefs?JSON.parse(savedPrefs):{email:!1,sms:!1,marketing:!1,push:!1},Settings.get("has_nearby_resorts")){var allHotels=[];angular.forEach(Settings.get("nearby_resorts"),function(region,regionName){angular.forEach(region.hotels,function(hotel){allHotels.push(hotel)})}),$scope.allHotels=allHotels}if(isStoredAuthValid()){const authData=getStoredAuthData();$scope.currentIdToken=authData.idToken,"login"===$state.current.name&&$state.go("insider-upcoming-stays")}else $scope.isLoading=!1;$timeout(function(){$scope.isLoading=!1},5e3)}()}angular.module("explorer.app").service("tokenService",["$log","$window",function(e,t){function s(e,t){var a;if(e&&t){var o=""+a.chainCode;return e=e.substring(e.length-(16-o.length))+o,a=aesjs.utils.utf8.toBytes(e),e=aesjs.utils.hex.toBytes(t),t=new aesjs.ModeOfOperation.ctr(a).decrypt(e),aesjs.utils.utf8.fromBytes(t)}}e.debug("tokenService initialized");var a,n=(angular.copy(t.chainInfo),angular.copy(t.ts)),r=angular.copy(t.tk),i=angular.copy(t.gts),l=angular.copy(t.gtk);return a=s(n,r),{removeToken:function(){a=void 0},getToken:function(){return a||(a=s(n,r))},getEncryptedValue:function(e,t,a){if(e&&t&&a)return e=e.substring(e.length-(16-a.toString().length))+a,a=aesjs.utils.utf8.toBytes(e),e=new aesjs.ModeOfOperation.ctr(a),a=aesjs.utils.utf8.toBytes(t),t=e.encrypt(a),aesjs.utils.hex.fromBytes(t)},getGmsToken:function(){return s(i,l)}}}]).controller("InsiderCtrl",["$rootScope","$scope","$state","$location","$localStorage","$mdDialog","$window","$filter","$timeout","$http","$analytics","$q","Places","Destinations","Alert","Settings","appConfig","tokenService",InsiderCtrl])}(),function(){"use strict";function LandingPageCtrl($scope,$state,$stateParams,$analytics,$window,$timeout,$location,$mdDialog,Person,Places,Settings,Alert){function setupDestinations(destinations){var _cityStates=[];vm.destinations=[],vm.hotels=[],angular.forEach(destinations,function(destination,destinationName){angular.forEach(destination.hotels,function(hotel){if(_cityStates.indexOf(hotel.cityState)<0){_cityStates.push(hotel.cityState);var hotels=[];angular.forEach(destination.hotels,function(compare){hotel.cityState==compare.cityState&&hotels.push(compare)}),vm.destinations.push({name:hotel.cityName+", "+hotel.stateName,slug:hotel.cityState,hotels:hotels})}hotel.destinationName=hotel.cityState+", "+hotel.stateName,vm.hotels.push(hotel)})})}function loadHubspotScript(noRetry){$timeout(function(){var hubspotForm=document.querySelector("[id='hubspot-form']");hubspotForm&&$window.hbspt&&hubspotForm.dataset.formId&&hubspotForm.dataset.portalId?hbspt.forms.create({portalId:hubspotForm.dataset.portalId,formId:hubspotForm.dataset.formId,target:"#hubspot-form"}):noRetry||$timeout(function(){loadHubspotScript(!0)},1e4)},500)}var rfpForm,vm=this;vm.landingPage=$state.current.data||Settings.get("currentLandingPage"),vm.headerPhone=vm.landingPage.headerPhone,vm.headerImage=vm.landingPage.headerImage,vm.headerImageURL=vm.landingPage.headerImageURL,vm.headerImageAlt=vm.landingPage.headerImageAlt,vm.mobileHeaderImage=vm.landingPage.mobileHeaderImage,vm.hasFixedWidthHero="1"==vm.landingPage.hasFixedWidthHero,vm.featuredImage=vm.landingPage.featuredImage,vm.featuredImageURL=vm.landingPage.featuredImageURL,vm.featuredImageCaption=vm.landingPage.featuredImageCaption,vm.featuredImagePosition=vm.landingPage.featuredImagePosition||"rightSidebar",vm.pageTitle=vm.landingPage.pageTitle,vm.h1=vm.landingPage.h1,vm.h2=vm.landingPage.h2,vm.hasFullWidthContent=vm.landingPage.hasFullWidthContent,vm.hasFullWidthSecondaryContent="1"==vm.landingPage.hasFullWidthSecondaryContent,vm.hasRFP=vm.landingPage.hasRFP&&1==vm.landingPage.RFPID.toString().length||!1,vm.RFPID=vm.landingPage.RFPID||"1",vm.RFPPosition=vm.landingPage.RFPPosition,vm.hideBookingBarNumber=vm.landingPage.hideBookingBarNumber||!1,vm.promoCode=vm.landingPage.promoCode||null,vm.productId=vm.landingPage.productId||null,vm.gaEvent=vm.landingPage.gaEvent||null,vm.headerImagePositionY=vm.landingPage.headerImagePositionY||null,vm.callTel=$window.APP_CLIENT_PHONE,vm.contactEmail=$window.APP_CLIENT_EMAIL,vm.currentPageClass=vm.landingPage.slug?vm.landingPage.slug.replace("/","-"):"",vm.thankYouPage=vm.landingPage.thankYouPage,vm.formSubmitEvent=vm.landingPage.formSubmitEvent,vm.campaignName=vm.landingPage.campaignName,vm.customBookNow=vm.landingPage.customBookNow||null,"1"==vm.landingPage.requiresLogin?Settings.get("memberProfile")?vm.isLoggedIn=!0:(Settings.set("redirectAfterLogin",vm.landingPage.id),$state.go("memberLogin")):"1"==vm.landingPage.requiresPassword&&(vm.requiresPassword=!0,Settings.get("isAuthenticated")&&(vm.isAuthenticated=!0)),vm.headerPhone&&Settings.setHeaderPhone(vm.headerPhone),vm.headerImage?Settings.setHeaderImage(vm.headerImage):Settings.setHeaderImage(null),vm.landingPage&&vm.landingPage.id?Places.get("LandingPageDetails",vm.landingPage.id).then(function(response){"ok"==response.data.status&&(Settings.set("currentLandingPage",response.data.page),vm.bodyContent=response.data.page.bodyContent,vm.secondaryBodyContent=response.data.page.secondaryBodyContent,vm.hasGallery="1"==vm.landingPage.hasGallery&&vm.landingPage.galleries.toString().length>1||!1,vm.galleries=vm.landingPage.galleries||null)}):(vm.bodyContent=vm.landingPage.bodyContent,vm.secondaryBodyContent=vm.landingPage.secondaryBodyContent),Settings.get("has_nearby_resorts")?setupDestinations(Settings.get("nearby_resorts")):Places.getNearbyResorts().then(function(response){response.data&&"ok"==response.data.status&&setupDestinations(response.data.regions)}),vm.customBookNow&&$scope.$emit("triggerCustomBookNow",vm.customBookNow),$scope.$on("triggerUpdateH1",function(event,title){vm.h1=''+title+""}),vm.RFPID.toString().length>1?(vm.hasCustomRFP=!0,Person.get("FormDetails",vm.RFPID).then(function(response){"ok"==response.data.status&&(rfpForm=response.data.form,vm.customForm=response.data.form)})):vm.hasCustomRFP=!1,vm.submitCustomRFP=function(ev){vm.customForm?Person.submitForm("CustomRFP",vm.customForm).then(function(response){response&&response.data&&"ok"==response.data.status?($analytics.eventTrack(vm.customForm.heading,{category:"Custom Forms",label:vm.customForm.submitText}),Alert.fire({ev:ev,title:vm.customForm.submissionMessageHeading||"Attention",message:vm.customForm.submissionMessageText||"Thank you. We will reach out to you shortly!"}),$state.reload()):($analytics.eventTrack(vm.customForm.heading,{category:"Custom Forms",label:"Server Error"}),Alert.fire({ev:ev,title:"Error Submitting",message:response.data.message}),$state.reload())}):($analytics.eventTrack(vm.customForm.heading,{category:"Custom Forms",label:"Missing Fields"}),Alert.fire({ev:ev,message:"Error, try again later"}))},vm.popUp=function(popup){$mdDialog.show($mdDialog.alert({title:popup.title,htmlContent:popup.content,ok:"Close",clickOutsideToClose:!0}))},vm.checkPassword=function(ev){Person.checkPassword("landingPage",vm.landingPage.id,vm.password).then(function(response){"ok"==response.data.status?(vm.isAuthenticated=!0,Settings.set("isAuthenticated",!0)):Alert.fire({ev:ev,message:"There was a problem with your password."})})},$timeout(function(){vm.hasMktForm&&loadHubspotScript(),vm.landingPagePromoCode&&$scope.$emit("triggerUpdatePromoCode",vm.landingPagePromoCode)},1e3)}angular.module("explorer.app").controller("LandingPageCtrl",["$scope","$state","$stateParams","$analytics","$window","$timeout","$location","$mdDialog","Person","Places","Settings","Alert",LandingPageCtrl])}(),function(){"use strict";function MeetingsCtrl($scope,$state,$stateParams,$analytics,Person,Places,Alert,Settings){function submitMeetingRFP(){var pass=!0;if(!vm.resortIsRequired||vm.meetingForm.resort&&vm.meetingForm.resort.length||(pass=!1),pass&&(vm.meetingForm.name||vm.meetingForm.firstname&&vm.meetingForm.lastname)&&vm.meetingForm.email&&vm.meetingForm.phone){if(vm.customHotelEmails){var hotelAdminEmails=[];angular.forEach(vm.meetingForm.resort,function(hotelName){angular.forEach(vm.customHotelEmails,function(hotel){if(hotel.name==hotelName){var _hotelEmails=hotel.email.split(";");angular.forEach(_hotelEmails,function(email){hotelAdminEmails.push(email)})}})}),hotelAdminEmails.length&&(vm.meetingForm.adminEmails=hotelAdminEmails)}Person.submitForm("MeetingRFP",vm.meetingForm).then(function(response){response&&response.data&&"ok"==response.data.status?(vm.meetingForm={},$analytics.eventTrack("Meetings Form",{category:"Meetings",label:"Submit"}),Alert.fire({message:"Thank you. We will reach out to you shortly!"})):($analytics.eventTrack("Meetings Form",{category:"Meetings",label:"Server Error"}),Alert.fire({message:"There was an error, please try again later!"}))})}else $analytics.eventTrack("Meetings Form",{category:"Meetings",label:"Missing Fields"}),Alert.fire({message:"Please fill in all the required fields."})}function setupPropertySelect(){if(angular.forEach(vm.regions,function(destination,destinationName){angular.forEach(destination.hotels,function(hotel){vm.hotels.push(hotel)})}),Settings.get("selectedResort")){var _resort=Settings.get("currentHotel");vm.meetingForm.resort=[],vm.meetingForm.resort.push(_resort.name)}}var vm=this,_destinations=Settings.get("nearby_resorts")||[];if(vm.headerImage=$state.current.data.headerImage,vm.headerImagePositionY=$state.current.data.headerImagePositionY||null,vm.mobileHeaderImage=$state.current.data.mobileHeaderImage,vm.featuredImage=$state.current.data.featuredImage,vm.RFPID=$state.current.data.RFPID||1,vm.bodyContent=$state.current.data.bodyContent,vm.pageTitle=$state.current.data.pageTitle,vm.h1=$state.current.data.h1,vm.hideH1=$state.current.data.hideH1,vm.h2=$state.current.data.h2,vm.hideH2=$state.current.data.hideH2,vm.property=Settings.get("currentListing"),vm.meetingForm={},vm.hotels=[],vm.submitMeetingRFP=submitMeetingRFP,vm.checkinMinDate=new Date(moment()),vm.checkoutMinDate=new Date(moment().add(1,"days")),$stateParams.slug){var regions=_destinations;vm.isProperty=!0,angular.forEach(regions,function(destination,destinationName){angular.forEach(destination.hotels,function(hotel){hotel.slug==$stateParams.slug.toLowerCase()&&($scope.$broadcast("triggerResortSelect",hotel.hotelCode),$scope.$emit("triggerResortSelect",hotel.hotelCode),hotel.headerImage?vm.headerImage=hotel.headerImage:vm.headerImage=hotel.image,vm.destination=destination,vm.destinationName=destinationName,vm.property=hotel,vm.meetingForm.resort=[hotel.name],vm.pageTitle="Meetings at "+hotel.name,Settings.get("has_portal_property_details_"+hotel.id)?(vm.property=Settings.get("portal_property_details_"+hotel.id),vm.bodyContent=vm.property.meetingsContent||vm.property.bodyContent):Places.get("PortalPropertyDetails",hotel.id).then(function(response){"ok"==response.data.status&&(vm.property=response.data.details,Settings.set("portal_property_details_"+hotel.id,response.data.details),Settings.set("has_portal_property_details_"+hotel.id,!0),vm.bodyContent=vm.property.meetingsContent||vm.property.bodyContent)}))})})}Settings.get("has_nearby_resorts")?(vm.regions=Settings.get("nearby_resorts"),setupPropertySelect()):Places.getNearbyResorts().then(function(response){response.data&&"ok"==response.data.status&&(vm.regions=response.data.regions),setupPropertySelect()}),vm.RFPID.toString().length>1?(vm.hasCustomRFP=!0,Person.get("FormDetails",vm.RFPID).then(function(response){"ok"==response.data.status&&(vm.customForm=response.data.form)})):vm.hasCustomRFP=!1,vm.submitCustomRFP=function(ev){vm.customForm?Person.submitForm("CustomRFP",vm.customForm).then(function(response){response&&response.data&&"ok"==response.data.status?($analytics.eventTrack(vm.customForm.heading,{category:"Custom Forms",label:vm.customForm.submitText}),Alert.fire({ev:ev,title:vm.customForm.submissionMessageHeading||"Attention",message:vm.customForm.submissionMessageText||"Thank you. We will reach out to you shortly!"}),$state.reload()):($analytics.eventTrack(vm.customForm.heading,{category:"Custom Forms",label:"Server Error"}),Alert.fire({ev:ev,message:"There was an error, please try again later!"}),$state.reload())}):($analytics.eventTrack(vm.customForm.heading,{category:"Custom Forms",label:"Missing Fields"}),Alert.fire({ev:ev,message:"Error, try again later"}))}}angular.module("explorer.app").controller("MeetingsCtrl",["$scope","$state","$stateParams","$analytics","Person","Places","Alert","Settings",MeetingsCtrl])}(),function(){function NearbyCtrl($scope,$state,$stateParams,$window,$filter,$mdToast,$timeout,$analytics,Places,Person,Settings,appConfig){function fetchNearbyResults(hotelId){Places.get("NearbyCategories",hotelId).then(function(response){if(response.data&&"ok"==response.data.status){var nids=[],tmpItems=[];vm.mapCenter={lat:parseFloat(vm.property.geo.latitude),lng:parseFloat(vm.property.geo.longitude),focus:!1,draggable:!1,zoom:14},vm.mapOptions={attributionControl:!1,dragging:!1,boxZoom:!1,doubleClickZoom:!1,tap:!1,keyboard:!1,scrollWheelZoom:!1,zoomControl:!1,tileLayer:"https://b.tile.openstreetmap.org/{z}/{x}/{y}.png",minZoom:1,maxZoom:15},vm.mapEvents={map:{enable:["moveend","popupopen"],logic:"emit"},marker:{enable:[],logic:"emit"}},angular.forEach(response.data.categories,function(category){angular.forEach(category.items,function(item){tmpItems.push(item),nids.push(item.nid),item.centerMarker={lat:parseFloat(item.lat),lng:parseFloat(item.lng),focus:!1,draggable:!1,zoom:14},item.markers={hotel:{lat:vm.mapCenter.lat,lng:vm.mapCenter.lng,focus:!1,alt:"Map marker for "+vm.property.name+", located in "+vm.property.address.addressLocality+", "+vm.property.address.addressRegion,icon:{iconUrl:vm.mapMarkerIcon||"https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/map-marker-"+($window.APP_THEME||"emerald")+".png",iconSize:[36,36],iconAnchor:[18,36],popupAnchor:[0,-36]}},location:{lat:parseFloat(item.lat),lng:parseFloat(item.lng),focus:!0,alt:"Map marker for "+item.name+", located in "+item.addressLocality+", "+item.addressRegion,icon:{iconUrl:"https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/map-marker-"+($window.APP_THEME||"nearby")+".png",iconSize:[72,60],iconAnchor:[36,60],popupAnchor:[0,-60]},riseOnHover:!0}}})}),vm.allNearbyItems=tmpItems,vm.categories=response.data.categories}}),Places.nearby({category:"play",listingId:hotelId},function(data){data.places.length?vm.types[0].items=data.places:vm.types[0].noItems=!0,vm.contentFrame={},$timeout(function(){Places.nearby({category:"shop",listingId:hotelId},function(data){data.places.length?vm.types[1].items=data.places:vm.types[1].noItems=!0}),Places.nearby({category:"eat",listingId:hotelId},function(data){data.places.length?vm.types[2].items=data.places:vm.types[2].noItems=!0})},100)});var breakLoop=!1;breakLoop||$window.PORTAL_DESTINATIONS.states.indexOf($stateParams.slug)>-1&&(vm.isState=!0,vm.destinationName=$filter("properCaps")($stateParams.slug),breakLoop=!0),breakLoop||$window.PORTAL_DESTINATIONS.cityStates.indexOf($stateParams.slug)>-1&&(vm.isCityState=!0,angular.forEach(regions,function(destination,destinationName){angular.forEach(destination.hotels,function(hotel){hotel.cityState==$stateParams.slug&&(breakLoop||(vm.destinationName=hotel.cityName+", "+hotel.stateName,breakLoop=!0))})}))}function getToastPosition(){return Object.keys(vm.toastPosition).filter(function(pos){return vm.toastPosition[pos]}).join(" ")}function viewListing(flipped,category,id){flipped&&Places.markView("NearbyListing",id).then(function(data){console.log(data)})}var vm=this;if(vm.isSignedIn=Settings.get("token"),vm.isProperty=!1,vm.mapMarkerIcon=$window.APP_CONFIG.core.themes?$window.APP_CONFIG.core.themes.mapMarkerIcon:null,vm.allNearbyItems=[],$stateParams.cityState&&$stateParams.slug?vm.isProperty=!0:vm.h1="Things to do near "+$filter("properCaps")($stateParams.slug),vm.search="",vm.destinationSlug=$stateParams.slug,vm.types=[{type:"play",name:"Play"},{type:"shop",name:"Shop"},{type:"eat",name:"Eat"}],vm.bodyContent=$state.current.data.bodyContent,vm.listingId=$stateParams.listingId||"",vm.slug=$stateParams.slug||"",$stateParams.slug){var regions=Settings.get("nearby_resorts")||[],found=!1;angular.forEach(regions,function(destination,destinationName){angular.forEach(destination.hotels,function(hotel){found||hotel.cityState!=$stateParams.slug.toLowerCase()&&hotel.state!=$stateParams.slug.toLowerCase()||(vm.isProperty&&(Settings.set("currentHotel",hotel),vm.headerProperty=hotel),vm.destination=destination,vm.destinationName=destinationName,Settings.get("has_portal_property_details_"+hotel.id)?(vm.property=Settings.get("portal_property_details_"+hotel.id),fetchNearbyResults(hotel.id),$timeout(function(){$scope.$broadcast("triggerResortSelect",hotel.hotelCode),$scope.$emit("triggerResortSelect",hotel.hotelCode)},500)):Places.get("PortalPropertyDetails",hotel.id).then(function(response){"ok"==response.data.status&&response.data.details.id?(vm.property=response.data.details,Settings.set("portal_property_details_"+hotel.id,response.data.details),Settings.set("has_portal_property_details_"+hotel.id,!0)):vm.property=hotel,fetchNearbyResults(hotel.id),$timeout(function(){$scope.$broadcast("triggerResortSelect",hotel.hotelCode),$scope.$emit("triggerResortSelect",hotel.hotelCode)},500)}),vm.pageTitle=vm.h1,hotel.headerImage?vm.headerImage=hotel.headerImage:vm.headerImage=hotel.image,found=!0)})}),found||$state.go("404")}else vm.isProperty=!1,vm.headerImage=$state.current.data.headerImage,vm.headerImagePositionY=$state.current.data.headerImagePositionY||null,vm.featuredImage=$state.current.data.featuredImage,vm.bodyContent=$state.current.data.bodyContent,vm.pageTitle=$state.current.data.pageTitle,vm.h1=$state.current.data.h1,vm.h1=$state.current.data.h1,vm.h2=$state.current.data.h2,fetchNearbyResults();vm.getToastPosition=getToastPosition,vm.viewListing=viewListing,vm.toastPosition={bottom:!1,top:!0,left:!1,right:!0}}function NearbyHotelCtrl($scope,$state,$stateParams,$window,$mdToast,$timeout,$location,$analytics,Places,Person,Settings){function fetchNearbyResults(hotelId){Places.get("NearbyCategories",hotelId).then(function(response){if(response.data&&"ok"==response.data.status){var nids=[],tmpItems=[];vm.mapCenter={lat:parseFloat(vm.property.geo.latitude),lng:parseFloat(vm.property.geo.longitude),focus:!1,draggable:!1,zoom:14},vm.mapOptions={attributionControl:!1,dragging:!1,boxZoom:!1,doubleClickZoom:!1,tap:!1,keyboard:!1,scrollWheelZoom:!1,zoomControl:!1,tileLayer:"https://b.tile.openstreetmap.org/{z}/{x}/{y}.png"},vm.mapEvents={map:{enable:["moveend","popupopen"],logic:"emit"},marker:{enable:[],logic:"emit"}},angular.forEach(response.data.categories,function(category){angular.forEach(category.items,function(item){tmpItems.push(item),nids.push(item.nid),item.centerMarker={lat:parseFloat(item.lat),lng:parseFloat(item.lng),focus:!1,draggable:!1,zoom:14},item.markers={hotel:{lat:vm.mapCenter.lat,lng:vm.mapCenter.lng,focus:!1,alt:"Map marker for "+vm.property.name+", located in "+vm.property.address.addressLocality+", "+vm.property.address.addressRegion,icon:{iconUrl:vm.mapMarkerIcon||"https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/map-marker-nearby.png",iconSize:[36,36],iconAnchor:[18,36],popupAnchor:[0,-36]}},location:{lat:parseFloat(item.lat),lng:parseFloat(item.lng),focus:!0,alt:"Map marker for "+item.name+", located in "+item.addressLocality+", "+item.addressRegion,icon:{iconUrl:"https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/map-marker-nearby.png",iconSize:[72,60],iconAnchor:[36,60],popupAnchor:[0,-60]},riseOnHover:!0}}})}),vm.categories=response.data.categories,vm.allNearbyItems=tmpItems}})}function getToastPosition(){return Object.keys(vm.toastPosition).filter(function(pos){return vm.toastPosition[pos]}).join(" ")}function viewListing(flipped,category,slug){flipped&&Places.markView("NearbyListing",slug).then(function(data){console.log(data)})}function getDistanceFromHotel(item){var radlat1=Math.PI*parseFloat(vm.property.geo.latitude)/180,radlat2=Math.PI*parseFloat(item.lat)/180,theta=parseFloat(vm.property.geo.longitude)-parseFloat(item.lng),radtheta=Math.PI*theta/180,dist=Math.sin(radlat1)*Math.sin(radlat2)+Math.cos(radlat1)*Math.cos(radlat2)*Math.cos(radtheta);return dist>1&&(dist=1),dist=Math.acos(dist),dist=180*dist/Math.PI,dist=60*dist*1.1515}var vm=this;if(vm.isSignedIn=Settings.get("token"),vm.search="",vm.types=[{type:"play",name:"Play"},{type:"shop",name:"Shop"},{type:"eat",name:"Eat"}],vm.mapMarkerIcon=$window.APP_CONFIG.core.themes?$window.APP_CONFIG.core.themes.mapMarkerIcon:null,vm.listingId=$stateParams.listingId||"",vm.slug=$stateParams.slug||"",vm.getToastPosition=getToastPosition,vm.viewListing=viewListing,vm.getDistanceFromHotel=getDistanceFromHotel,vm.allNearbyItems=[],vm.toastPosition={bottom:!1,top:!0,left:!1,right:!0},$stateParams.slug){var regions=Settings.get("nearby_resorts")||[],found=!1;vm.isProperty=!0,angular.forEach(regions,function(destination,destinationName){angular.forEach(destination.hotels,function(hotel){hotel.slug==$stateParams.slug&&(found=!0,$stateParams.cityState&&$stateParams.slug&&$stateParams.cityState!=hotel.cityState&&(Object.keys($location.search()).length>0&&Settings.set("locationSearchUrlParams",$location.search()),$state.go("hotelNearby",{cityState:hotel.cityState,slug:hotel.slug},{reload:"hotelNearby"})),Settings.set("currentHotel",hotel),vm.destination=destination,vm.destinationName=destinationName,vm.headerProperty=hotel,hotel.nearbyContent&&(vm.bodyContent=hotel.nearbyContent),Places.get("PortalPropertyNoticesData",hotel.id).then(function(response){"ok"==response.data.status&&(vm.priorityNotices=response.data.content.priorityNotices,vm.notices=response.data.content.notices,vm.hints=response.data.content.hints)}),Settings.get("has_portal_property_details_"+hotel.id)?(vm.property=Settings.get("portal_property_details_"+hotel.id),vm.pageTitle="Things to do near "+hotel.name,hotel.headerImage?vm.headerImage=hotel.headerImage:vm.headerImage=hotel.image,fetchNearbyResults(hotel.id),$timeout(function(){$scope.$broadcast("triggerResortSelect",hotel.hotelCode),$scope.$emit("triggerResortSelect",hotel.hotelCode)},500)):Places.get("PortalPropertyDetails",hotel.id).then(function(response){"ok"==response.data.status&&response.data.details.id?(vm.property=response.data.details,Settings.set("portal_property_details_"+hotel.id,response.data.details),Settings.set("has_portal_property_details_"+hotel.id,!0)):vm.property=hotel,vm.pageTitle="Things to do near "+hotel.name,hotel.headerImage?vm.headerImage=hotel.headerImage:vm.headerImage=hotel.image,fetchNearbyResults(hotel.id),$timeout(function(){$scope.$broadcast("triggerResortSelect",hotel.hotelCode),$scope.$emit("triggerResortSelect",hotel.hotelCode)},500)}))})}),found||$state.go("404")}}function NearbyListingCtrl($scope,$state,$stateParams,$window,$mdToast,Places,Person,Settings){function fetchNearbyDetails(){Places.getNearbyListing(vm.property.id,vm.slug).then(function(response){var data=response.data;vm.item=data.place,vm.mapCenter={lat:parseFloat(vm.item.lat),lng:parseFloat(vm.item.lng),focus:!1,draggable:!1,zoom:14},vm.mapOptions={attributionControl:!1,dragging:!1,boxZoom:!1,doubleClickZoom:!1,tap:!1,keyboard:!1,scrollWheelZoom:!1,zoomControl:!1,tileLayer:"https://b.tile.openstreetmap.org/{z}/{x}/{y}.png"},vm.mapEvents={map:{enable:["moveend","popupopen"],logic:"emit"},marker:{enable:[],logic:"emit"}},vm.mapMarkers={marker:{lat:vm.mapCenter.lat,lng:vm.mapCenter.lng,message:"
"+vm.item.name+'
'+vm.item.addressLocality+", "+vm.item.addressRegion+"
",focus:!1,alt:"Map marker for "+vm.item.name+", located in "+vm.item.addressLocality+", "+vm.item.addressRegion,icon:vm.mapMarkerIcon}},vm.gallery=vm.item.photos,vm.currentIndex=0,vm.setCurrentSlideIndex=function(index){vm.currentIndex=index},vm.isCurrentSlideIndex=function(index){return vm.currentIndex===index},vm.prevSlide=function(){vm.currentIndex=vm.currentIndex>0?--vm.currentIndex:vm.gallery.length-1},vm.nextSlide=function(){vm.currentIndex=vm.currentIndex1&&(dist=1),dist=Math.acos(dist),dist=180*dist/Math.PI,dist=60*dist*1.1515}return""}var vm=this;if(vm.slug=$stateParams.slug,vm.category=$stateParams.category,vm.getDistanceFromHotel=getDistanceFromHotel,$stateParams.hotel&&$stateParams.slug){var regions=Settings.get("nearby_resorts")||[];vm.isProperty=!0,angular.forEach(regions,function(destination,destinationName){angular.forEach(destination.hotels,function(hotel){hotel.slug==$stateParams.hotel&&(Settings.set("currentHotel",hotel),Places.get("PortalPropertyNoticesData",hotel.id).then(function(response){"ok"==response.data.status&&(vm.priorityNotices=response.data.content.priorityNotices,vm.notices=response.data.content.notices,vm.hints=response.data.content.hints)}),$scope.$broadcast("triggerResortSelect",hotel.hotelCode),$scope.$emit("triggerResortSelect",hotel.hotelCode),vm.destination=destination,vm.destinationName=destinationName,Settings.get("has_portal_property_details_"+hotel.id)?(vm.property=Settings.get("portal_property_details_"+hotel.id),vm.pageTitle="Things to do near "+hotel.name,hotel.headerImage?vm.headerImage=hotel.headerImage:vm.headerImage=hotel.image,fetchNearbyDetails()):Places.get("PortalPropertyDetails",hotel.id).then(function(response){"ok"==response.data.status&&(vm.property=response.data.details,Settings.set("portal_property_details_"+hotel.id,response.data.details),Settings.set("has_portal_property_details_"+hotel.id,!0),vm.pageTitle="Things to do near "+hotel.name,hotel.headerImage?vm.headerImage=hotel.headerImage:vm.headerImage=hotel.image,fetchNearbyDetails())}))})})}else $state.go("home");vm.frame={},vm.frame.height=window.innerHeight,vm.frame.width=window.innerWidth,vm.frame.halfwidth=Math.ceil(window.innerWidth/2),vm.mapMarkerIcon=$window.APP_CONFIG.core.themes?$window.APP_CONFIG.core.themes.mapMarkerIcon:null,vm.getToastPosition=getToastPosition,vm.toastPosition={bottom:!1,top:!0,left:!1,right:!0}}angular.module("explorer.app").controller("NearbyCtrl",["$scope","$state","$stateParams","$window","$filter","$mdToast","$timeout","$analytics","Places","Person","Settings",NearbyCtrl]).controller("NearbyHotelCtrl",["$scope","$state","$stateParams","$window","$mdToast","$timeout","$location","$analytics","Places","Person","Settings",NearbyHotelCtrl]).controller("NearbyListingCtrl",["$scope","$state","$stateParams","$window","$mdToast","Places","Person","Settings",NearbyListingCtrl])}(),function(){"use strict";function OfferCategoryCtrl($scope,$state,$stateParams,$timeout,$filter,$window,$location,$http,$mdDialog,$mdpDatePicker,Settings,Places,Alert){function scrollBy(last,inview){last&&inview&&(vm.offersLimit+=9)}function checkinDatePicker(ev){$mdpDatePicker(vm.checkinDate,{minDate:today,targetEvent:ev,dateLabel:"Check-In"}).then(function(selectedDate){vm.checkinDate=selectedDate,moment(selectedDate).diff(moment(vm.checkoutDate))>=-86400001&&(vm.checkoutDate=new Date(moment(vm.checkinDate).add(2,"days"))),checkoutDatePicker(ev)})}function checkoutDatePicker(ev){$mdpDatePicker(vm.checkoutDate,{minDate:new Date(moment(vm.checkinDate).add(2,"days")),targetEvent:ev,dateLabel:"Check-Out"}).then(function(selectedDate){vm.checkoutDate=selectedDate,moment(selectedDate).diff(moment(vm.checkinDate))<=86400001&&(vm.checkinDate=new Date(moment(vm.checkoutDate).subtract(2,"days")))})}function calculatePercentDifference(oldPrice,newPrice){var oldPriceNumeric=parseInt(oldPrice.replace(/\D/g,""),10),newPriceNumeric=parseInt(newPrice.replace(/\D/g,""),10);if(isNaN(oldPriceNumeric)||isNaN(newPriceNumeric))return!1;var difference=oldPriceNumeric-newPriceNumeric;return Math.abs(difference/newPriceNumeric*100).toFixed(0)+"%"}function isDateGreater(dateInput1,dateInput2){return"string"==typeof dateInput1&&(dateInput1=new Date(dateInput1)),"string"==typeof dateInput2&&(dateInput2=new Date(dateInput2)),dateInput1>dateInput2}function isDateSame(dateInput1,dateInput2){return"string"==typeof dateInput1&&(dateInput1=new Date(new Date(dateInput1).setHours(0,0,0,0))),"string"==typeof dateInput2&&(dateInput2=new Date(new Date(dateInput2).setHours(0,0,0,0))),dateInput1==dateInput2}function isDisabledDate(d){return d0&&("stacked"==vm.currentCategory.featuredOffersLayout&&1!=vm.currentCategory.featuredOffers||(featuredOfferDefaultFlex=Math.floor(100/vm.currentCategory.featuredOffers),vm.stackableFlex=1==vm.currentCategory.featuredOffers?100:featuredOfferDefaultFlex,vm.stackableFlexSm=1==vm.currentCategory.featuredOffers?100:50, vm.stackRemainderFlexSm=100,vm.stackRemainderFlex=featuredOfferDefaultFlex),"stacked"==vm.currentCategory.featuredOffersLayout&&vm.currentCategory.featuredOffers>1&&(vm.stackRemainderFlex=100,vm.stackRemainderFlexSm=100,vm.stackableFlex=50,vm.stackableFlexSm=1==vm.currentCategory.featuredOffers?100:50)),angular.forEach(data.offers,function(offer){if(offer.categoryId==vm.currentCategory.id){if($window.CJEVENT&&-1==offer.cta.indexOf("cjevent")&&(offer.cta.indexOf("?")>0?offer.cta=offer.cta+"&cjevent="+$window.CJEVENT:offer.cta=offer.cta+"?cjevent="+$window.CJEVENT),$window.ROKTID&&-1==offer.cta.indexOf("rtid")&&(offer.cta.indexOf("?")>0?offer.cta=offer.cta+"&rtid="+$window.ROKTID:offer.cta=offer.cta+"?rtid="+$window.ROKTID),$window.DISCOUNTCODE&&(-1!==offer.cta.toLowerCase().indexOf("discount=")?offer.cta=offer.cta.toLowerCase().replace(/discount=[^&]+/,"discount="+$window.DISCOUNTCODE):offer.cta.indexOf("?")>0?offer.cta=offer.cta+"&discount="+$window.DISCOUNTCODE:offer.cta=offer.cta+"?discount="+$window.DISCOUNTCODE),$window.PROMOID&&(-1!==offer.cta.toLowerCase().indexOf("identifier=")?offer.cta=offer.cta.toLowerCase().replace(/identifier=[^&]+/,"identifier="+$window.PROMOID):offer.cta.indexOf("?")>0?offer.cta=offer.cta+"&identifier="+$window.PROMOID:offer.cta=offer.cta+"?identifier="+$window.PROMOID),offer.price&&offer.oldPrice&&(offer.percentDifference=calculatePercentDifference(offer.oldPrice,offer.price)),offer.image.indexOf("[")>-1)try{offer.image=JSON.parse(offer.image)}catch(e){console.log(e)}offer.isMultiImage=!!(offer.image&&"object"==typeof offer.image&&offer.image.length>1),_tmpState=offer.hotelCityStateText.split(", "),_tmpState=_tmpState.length>2?_tmpState[2].trim():_tmpState[1].trim(),_states.indexOf(_tmpState)<0&&(_states.push(_tmpState),vm.states.push({name:_tmpState,country:_countryStates[_tmpState]||"USA",slug:_tmpState.toLowerCase()})),angular.forEach(vm.countries,function(country){country.name==_countryStates[_tmpState]&&(country.count++,offer.country=country.name)}),offer.country=offer.country||"USA",offer.state=_tmpState,_hotels.indexOf(offer.hotelCode)<0&&(_hotels.push(offer.hotelCode),vm.hotels.push({name:offer.hotelName,id:offer.hotelCode,country:offer.country,state:_tmpState,cityState:offer.hotelCityStateText,image:offer.image,url:offer.cta,hotelCityState:offer.hotelCityState,hotelSlug:offer.hotelSlug})),_regions.indexOf(offer.hotelCityState)<0&&(_regions.push(offer.hotelCityState),vm.destinations.push({name:offer.hotelCityStateText,slug:offer.hotelCityState,country:offer.country})),offer.propertyIds&&offer.propertyIds.length&&(angular.forEach(destinationProperties,function(destinationProperty){destinationProperty.pid==offer.propertyIds[0]&&angular.forEach(destinationsTree,function(destination){destination.destinationId==destinationProperty.destinationId&&(offer.destinationUrl=destination.url)})}),offer._hotels=[],offer._destinations=[],angular.forEach(_allHotels,function(hotel){-1==_hotels.indexOf(hotel.hotelCode)&&offer.propertyIds.indexOf(hotel.id)>-1&&(_hotels.push(hotel.hotelCode),offer._hotels.push(hotel.hotelCode),vm.hotels.push({name:hotel.name,id:hotel.hotelCode,country:hotel.address.addressCountry||"USA",state:_tmpState,cityState:hotel.cityName+", "+hotel.stateName,image:offer.image,url:offer.cta,hotelCityState:hotel.cityState,hotelSlug:hotel.slug}),-1==_regions.indexOf(hotel.cityState)&&(_regions.push(hotel.cityState),offer._destinations.push(hotel.cityName+", "+hotel.stateName),vm.destinations.push({name:hotel.cityName+", "+hotel.stateName,slug:hotel.cityState,country:offer.country})))})),vm.offers.push(offer)}}),$location.search().country?($location.search().state&&($location.search().city&&angular.forEach(vm.destinations,function(destination){console.log(destination,destination.slug,$filter("toSlug")($location.search().city.toLowerCase()+" "+$location.search().state.toLowerCase())),destination.slug==$filter("toSlug")($location.search().city.toLowerCase()+" "+$location.search().state.toLowerCase())&&$timeout(function(){vm.selectedDestination=destination.slug},100)}),angular.forEach(vm.states,function(state){state.name.toLowerCase()===$location.search().state.toLowerCase()&&$timeout(function(){vm.selectedState=state.name},100)})),angular.forEach(vm.countries,function(country){country.name.toLowerCase()===$location.search().country.toLowerCase()&&$timeout(function(){vm.selectedCountry=country.name},100)})):$location.search().state?($location.search().city&&angular.forEach(vm.destinations,function(destination){destination.name.toLowerCase()===$location.search().city.toLowerCase()+", "+$location.search().state.toLowerCase()&&$timeout(function(){vm.selectedDestination=destination.name},100)}),angular.forEach(vm.states,function(state){state.name.toLowerCase()===$location.search().state.toLowerCase()&&$timeout(function(){vm.selectedState=state.name},100)})):$location.search().city&&angular.forEach(vm.destinations,function(destination){destination.name.toLowerCase().indexOf($location.search().city.toLowerCase())>-1&&$timeout(function(){vm.selectedDestination=destination.name},100)})),!vm.ignoreHexColorDecoration&&category.hexColor&&(category.hexColor.page||category.hexColor.content||category.hexColor.accent||category.hexColor.cta)&&$scope.$emit("triggerUpdateDecoration",category.hexColor),"1"==category.hideBookingBar&&($scope.$emit("triggerHideBookingBar",!0),$scope.$on("$destroy",function(){$scope.$emit("triggerHideBookingBar",!1)})),Places.get("RegionOfferCategoryChildren",category.id).then(function(response){response&&response.data&&($stateParams.child?angular.forEach(response.data.categories,function(category){vm.categories.push(category),$stateParams.child==category.slug&&(vm.currentCategory=category,vm.currentCategory.isFeatured=vm.isFeatured,vm.bodyContent=category.description||($state.current.data?$state.current.data.bodyContent:""),vm.secondaryBodyContent=category.secondaryDescription||($state.current.data?$state.current.data.secondaryBodyContent:""),vm.h1=$state.name||($state.current.data?$state.current.data.h1:""),vm.h2=$state.subtitle||($state.current.data?$state.current.data.h2:""),angular.forEach(data.offers,function(offer){offer.categoryId==vm.currentCategory.id&&(offer.cta&&(offer.cta=offer.cta+(offer.cta.indexOf("?")>-1?"&":"?")+"landing_site="+$window.APP_DOMAIN),vm.offers.push(offer),_hotels.indexOf(offer.hotelCode)<0&&(_hotels.push(offer.hotelCode),vm.hotels.push({name:offer.hotelName,id:offer.hotelCode,cityState:offer.hotelCityStateText})),_regions.indexOf(offer.hotelCityState)<0&&(_regions.push(offer.hotelCityState),vm.destinations.push({name:offer.hotelCityStateText,slug:offer.hotelCityState})))}))}):angular.forEach(response.data.categories,function(category){category.offers||(category.offers=[]),angular.forEach(data.offers,function(offer){offer.categoryId==category.id&&(offer.cta&&(offer.cta=offer.cta+(offer.cta.indexOf("?")>-1?"&":"?")+"landing_site="+$window.APP_DOMAIN),category.offers.push(offer),_hotels.indexOf(offer.hotelCode)<0&&(_hotels.push(offer.hotelCode),vm.hotels.push({name:offer.hotelName,id:offer.hotelCode,cityState:offer.hotelCityStateText})),_regions.indexOf(offer.hotelCityState)<0&&(_regions.push(offer.hotelCityState),vm.destinations.push({name:offer.hotelCityStateText,slug:offer.hotelCityState})))}),vm.categories.push(category)}))}))}),vm.ignoreCategoryNotFound||data.offers.length&&categoryFound||$state.go("offers"))}function loadMore(){currentPage++;var newItems=Places.getPlaces();vm.pagedItems.length>=newItems.length&&(vm.hideLoadMore=!0),offset=currentPage*itemsPerPage,newItems=newItems.slice(offset,offset+itemsPerPage),vm.pagedItems=vm.pagedItems.concat(newItems)}function nextPageDisabledClass(){return currentPage===vm.pageCount()-1?"disabled":""}function pageCount(){return Math.ceil(vm.total/itemsPerPage)}function viewProperty(hotelCode){var _regions=Settings.get("nearby_resorts")||[];angular.forEach(_regions,function(region){angular.forEach(region.hotels,function(hotel){if(hotel.hotelCode==hotelCode)return $state.go("hotel",{slug:hotel.slug,cityState:hotel.cityState})})})}function popPhotos(ev,imageSet,imgIndex){$mdDialog.show({parent:angular.element(document.body),clickOutsideToClose:!0,escapeToClose:!0,targetEvent:ev,templateUrl:"app/cards/photo-gallery.html",controller:function($scope,$filter,$mdDialog){var tmpIndex=imgIndex||0;$scope.image={url:imageSet[tmpIndex],index:tmpIndex},$scope.closeDialog=function(){$mdDialog.hide()},$scope.nextImage=function(){tmpIndex=$scope.image.index,$scope.image.index+1=0?($scope.image={url:imageSet[$scope.image.index-1]},$scope.image.index=tmpIndex-1):($scope.image={url:imageSet[$scope.image.index-1]},$scope.image.index=imageSet.length-1)}}})}function dynamicSearch(ev,selectedState,selectedDestination,selectedResort,startDate,endDate){if(vm.isSearch=!0,selectedResort){var cta,offers={length:0};vm.offers=offers,angular.forEach(vm.hotels,function(hotel){hotel.id==selectedResort&&(cta=hotel.url.split("="),vm.ratePlan=cta[1].replace("&landing_site",""))}),$http({url:"https://api.travelclick.com/ibe/v1/hotel/"+selectedResort+"/avail?lang=EN_US&adults=2&infants=0¤cy=USD&rooms=1&dateIn="+moment(startDate).format("YYYY-MM-DD")+"&dateOut="+moment(endDate).format("YYYY-MM-DD")+"&ratePlanCode="+vm.ratePlan,method:"GET",dataType:"json"}).success(function(data,status,headers,config){200==status&&(angular.forEach(vm.hotels,function(hotel){hotel.id==selectedResort&&(offers[selectedResort]=hotel)}),vm.isSearching=!1,angular.forEach(data.roomStays[0].ratePlans,function(plan){plan.leadRate&&plan.ratePlanCode==vm.ratePlan&&(offers[selectedResort].ratePlan=plan,offers[selectedResort].roomTypes=data.roomStays[0].allRoomTypes,offers.length++)}),vm.offers=offers)}).error(function(data,status,headers,config){vm.isSearching=!1})}else if(selectedDestination||selectedState){var cta,searchQuery=(selectedDestination||selectedState).toLowerCase(),results=vm.hotels.filter(function(hotel){return hotel.cityState.toLowerCase().indexOf(searchQuery)>-1});vm.isSearching=!0,vm.offers={length:0},results.length&&angular.forEach(results,function(result){cta=result.url.split("="),cta=cta[1].replace("&landing_site",""),result.cta=cta,result.ratePlan=result.ratePlan||{},result.ratePlan.leadRate="",vm.offers[result.id]=result,$http({url:"https://api.travelclick.com/ibe/v1/hotel/"+result.id+"/avail?lang=EN_US&adults=2&infants=0¤cy=USD&rooms=1&dateIn="+moment(startDate).format("YYYY-MM-DD")+"&dateOut="+moment(endDate).format("YYYY-MM-DD")+"&ratePlanCode="+cta,method:"GET",dataType:"json"}).success(function(data,status,headers,config){200==status&&(vm.isSearching=!1,angular.forEach(data.roomStays[0].ratePlans,function(plan){angular.forEach(vm.offers,function(offer){plan.leadRate&&offer.cta==plan.ratePlanCode&&(offer.currencyCode=data.roomStays[0].currencyCode,offer.ratePlan=plan,offer.roomTypes=data.roomStays[0].allRoomTypes,vm.offers.length++)})}))}).error(function(data,status,headers,config){vm.isSearching=!1})})}else Alert.fire({message:"Please select a state/destination or resort",ev:ev})}var prevDiff,featuredOfferDefaultFlex,vm=this,offset=0,itemsPerPage=18,currentPage=0,categoryFound=!1,today=$location.search().date?new Date($location.search().date):new Date;vm.currentSlug=$stateParams.slug||vm.currentSlug||null,vm.categories=[],vm.isCategoryPage=!!vm.currentSlug,vm.isPreview=!!$location.search().isPreview,vm.searchQuery=Settings.get("searchQuery")||"",vm.showMore=!0,vm.dynamicSearch=dynamicSearch,vm.checkinDate=new Date(moment().add(1,"days")),vm.checkoutDate=new Date(moment().add(3,"days")),vm.isSeaching=!1,vm.checkinDatePicker=checkinDatePicker,vm.checkoutDatePicker=checkoutDatePicker,vm.offerUrl="",vm.getBookingUrl=getBookingUrl,vm.isDisabledDate=isDisabledDate,vm.isDateGreater=isDateGreater,vm.isDateSame=isDateSame,vm.loadMore=loadMore,vm.nextPageDisabledClass=nextPageDisabledClass,vm.pageCount=pageCount,vm.viewProperty=viewProperty,vm.scrollBy=scrollBy,vm.popPhotos=popPhotos,vm.calculatePercentDifference=calculatePercentDifference,vm.currentUrl=$location.path(),vm.search="",vm.offers=[],vm.hotels=[],vm.destinations=[],vm.states=[],vm.countries=[],vm.currentYear=(new Date).getFullYear(),vm.currentESTDay=new Date(today.getTime()+-144e5),vm.currentPSTDay=new Date(today.getTime()+-252e5),vm.tomorrowPSTDay=new Date(today.getTime()+-144e5),vm.tomorrowPSTDay.setDate(vm.tomorrowPSTDay.getDate()+1),$scope.$watch("vm.checkinDate",function(oldDate,newDate){moment(vm.checkinDate).diff(moment(vm.checkoutDate))>=-86400001&&(prevDiff=moment(vm.checkinDate).diff(moment(vm.checkoutDate)))}),$scope.$watch("vm.checkoutDate",function(oldDate,newDate){moment(vm.checkoutDate).diff(moment(vm.checkinDate))!=prevDiff&&(vm.showDatePicker=!1)}),$stateParams.Identifier&&$scope.$emit("updatePromoCode",$stateParams.Identifier),$state.current.data&&$state.current.data.promoId,Places.get("RegionOffersDetails",$window.RID,$location.search().isPreview||null).then(function(response){response&&response.data&&handleOffersResponse(response.data)}),vm.popUp=function(popup){$mdDialog.show($mdDialog.alert({title:popup.title,htmlContent:popup.content,ok:"Close",clickOutsideToClose:!0}))}}angular.module("explorer.app").controller("OfferCategoryCtrl",["$scope","$state","$stateParams","$timeout","$filter","$window","$location","$http","$mdDialog","$mdpDatePicker","Settings","Places","Alert",OfferCategoryCtrl])}(),function(){"use strict";function OfferCtrl($scope,$state,$stateParams,$window,$location,$timeout,$filter,Places,Settings){function getOffers(){if($stateParams.hotel){vm.isProperty=!0;var found=!1;angular.forEach(_destinations,function(destination,destinationName){angular.forEach(destination.hotels,function(hotel){hotel.slug==$stateParams.hotel.toLowerCase()&&(found=!0,$stateParams.cityState&&$stateParams.hotel&&$stateParams.cityState!=hotel.cityState&&(Object.keys($location.search()).length>0&&Settings.set("locationSearchUrlParams",$location.search()),$state.go("hotelSpecial",{cityState:hotel.cityState,hotel:hotel.slug,slug:$stateParams.slug},{reload:"hotelSpecial"})),Places.get("PortalPropertyNoticesData",hotel.id).then(function(response){"ok"==response.data.status&&(vm.priorityNotices=response.data.content.priorityNotices,vm.notices=response.data.content.notices,vm.hints=response.data.content.hints)}),Settings.set("currentHotel",hotel),hotel.headerImage?vm.headerImage=hotel.headerImage:vm.headerImage=hotel.image,vm.headerProperty=hotel,Settings.get("has_portal_property_details_"+hotel.id)?(vm.property=Settings.get("portal_property_details_"+hotel.id),getPropertyOffers(),$timeout(function(){$scope.$broadcast("triggerResortSelect",hotel.hotelCode),$scope.$emit("triggerResortSelect",hotel.hotelCode)},500)):Places.get("PortalPropertyDetails",hotel.id).then(function(response){"ok"==response.data.status&&response.data.details.id?(vm.property=response.data.details,Settings.set("portal_property_details_"+hotel.id,response.data.details),Settings.set("has_portal_property_details_"+hotel.id,!0)):vm.property=hotel,getPropertyOffers(),$timeout(function(){$scope.$broadcast("triggerResortSelect",hotel.hotelCode),$scope.$emit("triggerResortSelect",hotel.hotelCode)},500)}),vm.destination=destination,vm.destinationName=destinationName,vm.headerProperty=hotel,vm.pageTitle="Offers at "+hotel.name)})}),found||$state.go("404"),vm.selectedResort=Settings.get("selectedResort")}else vm.headerImage=$state.current.data.headerImage,vm.bodyContent=$state.current.data.bodyContent,vm.pageTitle="Offers at "+$window.APP_CLIENT,vm.isProperty=!1,vm.hotels=[],vm.destinations=[],angular.forEach(_destinations,function(destination,destinationName){vm.destinations.push({name:destinationName,hotels:destination.hotels}),angular.forEach(destination.hotels,function(hotel){vm.hotels.push(hotel)})}),getRegionOffers()}function getRegionOffers(){Places.get("RegionOffersDetails",$window.RID).then(function(response){response&&response.data&&handleOffersResponse(response.data)})}function getPropertyOffers(propertyId){propertyId=propertyId||vm.property.id,$location.search().lid||$location.search().LID||$location.search().Lid?($window.LID=$location.search().lid||$location.search().LID||$location.search().Lid,Places.get("SiteDynamicPhone",$window.LID).then(function(response){"ok"==response.data.status&&response.data.phone&&Settings.setHeaderPhone(response.data.phone),Places.get("PropertyOffersDetails",propertyId).then(function(response){response&&response.data&&handleOffersResponse(response.data)})})):Places.get("PropertyOffersDetails",propertyId).then(function(response){response&&response.data&&handleOffersResponse(response.data)})}function handleOffersResponse(data){data=data||{},angular.forEach(data.offers,function(offer){if($stateParams.slug==offer.slug){if(found=!0,vm.property&&(Settings.setMetaTitle(offer.title+" by "+vm.property.name),Settings.setMetaDescription("Enjoy "+offer.title+" by "+vm.property.name+" in "+vm.property.cityName+", "+vm.property.stateName),!angular.isObject(offer.cta)&&0==offer.cta.indexOf("{")))try{offer.cta=JSON.parse(offer.cta),offer.cta=offer.cta[vm.property.id]}catch(e){}if(offer.propertyIds&&offer.propertyIds.length){var activePropertyIds=vm.hotels.map(function(hotel){return hotel.id});offer.propertyIds=offer.propertyIds.filter(function(propertyId){return activePropertyIds.indexOf(propertyId)>-1})}offer.headerPhone=Settings.getHeaderPhone(),$window.CJEVENT&&-1==offer.cta.indexOf("cjevent")&&(offer.cta.indexOf("?")>0?offer.cta=offer.cta+"&cjevent="+$window.CJEVENT:offer.cta=offer.cta+"?cjevent="+$window.CJEVENT),$window.ROKTID&&-1==offer.cta.indexOf("rtid")&&(offer.cta.indexOf("?")>0?offer.cta=offer.cta+"&rtid="+$window.ROKTID:offer.cta=offer.cta+"?rtid="+$window.ROKTID),$window.DISCOUNTCODE&&(-1!==offer.cta.toLowerCase().indexOf("discount=")?offer.cta=offer.cta.toLowerCase().replace(/discount=[^&]+/,"discount="+$window.DISCOUNTCODE):offer.cta.indexOf("?")>0?offer.cta=offer.cta+"&discount="+$window.DISCOUNTCODE:offer.cta=offer.cta+"?discount="+$window.DISCOUNTCODE),$window.PROMOID&&(-1!==offer.cta.toLowerCase().indexOf("identifier=")?offer.cta=offer.cta.toLowerCase().replace(/identifier=[^&]+/,"identifier="+$window.PROMOID):offer.cta.indexOf("?")>0?offer.cta=offer.cta+"&identifier="+$window.PROMOID:offer.cta=offer.cta+"?identifier="+$window.PROMOID),vm.offer=offer,vm.headerImage=offer.image,vm.h2=offer.title;var foundCategory=!1;$scope.$broadcast("triggerUpdateUrl",offer.cta),$scope.$emit("triggerUpdateUrl",offer.cta),("1"==offer.hideBookingBar||vm.hideBookingBar)&&($scope.$emit("triggerHideBookingBar",!0),$scope.$on("$destroy",function(){$scope.$emit("triggerHideBookingBar",!1)})),offer.categoryName?(foundCategory=!0,vm.category={name:offer.categoryName,slug:offer.categorySlug}):angular.forEach(data.categories,function(category){foundCategory||category.id!=offer.categoryId||(vm.category=category,foundCategory=!0)}),vm.hasMktForm&&$timeout(function(){var mktForm=document.querySelector("[id^='marketoForm_']"),hubspotForm=document.querySelector("[id='hubspot-form']");if(mktForm){mktForm=mktForm.id.replace("marketoForm_","").split("_"),vm.mktFormId=mktForm[1];vm.mktFormId,$window.location.hostname.replace("www.","");window.MktoForms2&&mktForm[0]?MktoForms2.loadForm("https://app-ab19.marketo.com",mktForm[0],vm.mktFormId):$timeout(function(){window.MktoForms2&&mktForm[0]&&MktoForms2.loadForm("https://app-ab19.marketo.com",mktForm[0],vm.mktFormId)},1e3)}else hubspotForm&&$window.hbspt&&hbspt.forms.create({portalId:hubspotForm.dataset.portalId,formId:hubspotForm.dataset.formId,target:"#hubspot-form"})},100)}}),found||(vm.isProperty?$state.go("hotelSpecials",{city:$filter("toSlug")(vm.property.cityName),state:$filter("toSlug")(vm.property.stateName),slug:vm.property.slug}):$state.go("offers"))}var vm=this,found=!1,_destinations=Settings.get("nearby_resorts")||[];vm.bodyContent=$state.current.data.bodyContent,vm.h1=$state.current.data.h1,vm.hideH1=$state.current.data.hideH1,vm.h2=$state.current.data.h2,vm.hideH2=$state.current.data.hideH2,vm.currentDate=new Date,vm.isObject=angular.isObject,_destinations&&_destinations.length?getOffers():$timeout(function(){Places.getNearbyResorts().then(function(response){response.data&&"ok"==response.data.status&&(_destinations=response.data.regions,getOffers())})},100)}angular.module("explorer.app").controller("OfferCtrl",["$scope","$state","$stateParams","$window","$location","$timeout","$filter","Places","Settings",OfferCtrl])}(),function(){"use strict";function OffersCtrl($scope,$state,$stateParams,$window,$filter,$location,$timeout,Places,Settings){function viewPropertyOffers(propertyId){angular.forEach(vm.hotels,function(hotel){if(hotel.id==propertyId)return void $state.go("hotelSpecials",{cityState:hotel.cityState,slug:hotel.slug})})}function getPropertyOffers(propertyId){propertyId?Places.get("PropertyOffersDetails",propertyId).then(function(response){"ok"==response.data.status&&handlePropertyOffersResponse(response.data)}):vm.offers=vm.allOffers}function getDestinationOffers(destinationName){Settings.get("nearby_resorts");vm.offers=destinationName?[]:vm.allOffers,angular.forEach(vm.destinations,function(destination){destinationName==destination.name&&(vm.offers=vm.allOffers.filter(function(offer){var found=!1;return angular.forEach(destination.hotels,function(hotel){found||hotel.hotelCode!=offer.hotelCode||(found=!0)}),found}))})}function getRegionOffers(){Places.get("RegionOffersDetails",$window.RID).then(function(response){response&&response.data&&handleOffersResponse(response.data)})}function handlePropertyOffersResponse(data){var destinationsTree=Settings.get("destinationsTree")||[],destinationProperties=Settings.get("destinationProperties")||[];angular.forEach(data.offers,function(offer){if(0==offer.cta.indexOf("{"))try{offer.cta=JSON.parse(offer.cta),offer.cta=offer.cta[vm.property.id]}catch(e){}offer.headerPhone=Settings.getHeaderPhone(),offer.hotelSlug=vm.property.slug,offer.cityState=vm.property.cityState,$window.CJEVENT&&-1==offer.cta.indexOf("cjevent")&&(offer.cta.indexOf("?")>0?offer.cta=offer.cta+"&cjevent="+$window.CJEVENT:offer.cta=offer.cta+"?cjevent="+$window.CJEVENT),$window.ROKTID&&-1==offer.cta.indexOf("rtid")&&(offer.cta.indexOf("?")>0?offer.cta=offer.cta+"&rtid="+$window.ROKTID:offer.cta=offer.cta+"?rtid="+$window.ROKTID),$window.DISCOUNTCODE&&(-1!==offer.cta.toLowerCase().indexOf("discount=")?offer.cta=offer.cta.toLowerCase().replace(/discount=[^&]+/,"discount="+$window.DISCOUNTCODE):offer.cta.indexOf("?")>0?offer.cta=offer.cta+"&discount="+$window.DISCOUNTCODE:offer.cta=offer.cta+"?discount="+$window.DISCOUNTCODE),$window.PROMOID&&(-1!==offer.cta.toLowerCase().indexOf("identifier=")?offer.cta=offer.cta.toLowerCase().replace(/identifier=[^&]+/,"identifier="+$window.PROMOID):offer.cta.indexOf("?")>0?offer.cta=offer.cta+"&identifier="+$window.PROMOID:offer.cta=offer.cta+"?identifier="+$window.PROMOID),angular.forEach(destinationProperties,function(destinationProperty){destinationProperty.pid==vm.property.id&&angular.forEach(destinationsTree,function(destination){destination.destinationId==destinationProperty.destinationId&&(offer.destinationUrl=destination.url)})})}),vm.offers=data.offers,vm.categories=data.categories}function handleOffersResponse(data){angular.forEach(data.offers,function(offer){offer.headerPhone=Settings.getHeaderPhone(),$window.CJEVENT&&-1==offer.cta.indexOf("cjevent")&&(offer.cta.indexOf("?")>0?offer.cta=offer.cta+"&cjevent="+$window.CJEVENT:offer.cta=offer.cta+"?cjevent="+$window.CJEVENT)}),vm.allOffers=data.offers,vm.offers=data.offers,vm.categories=data.categories,vm.hotels=vm.hotels.filter(function(hotel){var pass=!1;return angular.forEach(vm.offers,function(offer){(hotel.hotelCode==offer.hotelCode&&!offer.hideLocal||offer.propertyIds&&offer.propertyIds.length&&offer.propertyIds.indexOf(hotel.id)>-1)&&(pass=!0)}),pass})}var _promoId,vm=this,_destinations=Settings.get("nearby_resorts")||[];if(vm.currentDate=new Date,vm.getPropertyOffers=getPropertyOffers,vm.getRegionOffers=getRegionOffers,vm.getDestinationOffers=getDestinationOffers,vm.viewPropertyOffers=viewPropertyOffers,vm.destinations=[],vm.isProperty=!1,vm.hotels=[],_promoId=$state.current.data?$state.current.data.promoId:"",_promoId&&$scope.$emit("updatePromoCode",_promoId),$stateParams.slug&&"destinationSpecials"==$state.current.name){var regions=Settings.get("nearby_resorts")||[];angular.forEach(regions,function(destination,destinationName){$filter("toSlug")(destinationName)==$stateParams.slug&&(vm.destination=destination,vm.destinationName=destinationName,vm.pageTitle="Special Offers and Deals by near "+destinationName,Places.get("RegionOffersDetails",$window.RID).then(function(response){response&&response.data&&(vm.offers=response.data.offers.filter(function(offer){var found=!1;return angular.forEach(destination.hotels,function(hotel){found||hotel.hotelCode!=offer.hotelCode||(found=!0)}),found}).map(function(offer){return offer.headerPhone=Settings.getHeaderPhone(),offer}))}),angular.forEach(destination.hotels,function(hotel){vm.hotels.push(hotel),vm.headerImage||(vm.headerImage=hotel.headerImage),vm.headerImage||(vm.headerImage=hotel.image)}),vm.headerImage?Settings.setHeaderImage(vm.headerImage):Settings.setHeaderImage(null))})}else if($stateParams.slug){var regions=Settings.get("nearby_resorts")||[],found=!1;angular.forEach(regions,function(destination,destinationName){angular.forEach(destination.hotels,function(hotel){hotel.slug==$stateParams.slug.toLowerCase()&&(found=!0,"hotelSpecials"===$state.current.name&&$stateParams.cityState&&$stateParams.slug&&$stateParams.cityState!=hotel.cityState&&(Object.keys($location.search()).length>0&&Settings.set("locationSearchUrlParams",$location.search()),$state.go("hotelSpecials",{cityState:hotel.cityState,slug:hotel.slug},{reload:"hotelSpecials"})),vm.isProperty=!0,Settings.set("currentHotel",hotel),hotel.headerImage?vm.headerImage=hotel.headerImage:vm.headerImage=hotel.image,vm.headerImage?Settings.setHeaderImage(vm.headerImage):Settings.setHeaderImage(null),vm.destination=destination,vm.destinationName=destinationName,vm.headerProperty=hotel,Settings.get("has_portal_property_details_"+hotel.id)?(vm.property=Settings.get("portal_property_details_"+hotel.id),getPropertyOffers(vm.property.id),$timeout(function(){$scope.$broadcast("triggerResortSelect",hotel.hotelCode),$scope.$emit("triggerResortSelect",hotel.hotelCode)},500)):Places.get("PortalPropertyDetails",hotel.id).then(function(response){"ok"==response.data.status&&response.data.details.id?(vm.property=response.data.details,vm.headerImage=vm.property.offersHeaderImage?vm.property.offersHeaderImage:vm.headerImage,Settings.set("portal_property_details_"+hotel.id,response.data.details),Settings.set("has_portal_property_details_"+hotel.id,!0)):vm.property=hotel,getPropertyOffers(vm.property.id),$timeout(function(){$scope.$broadcast("triggerResortSelect",hotel.hotelCode),$scope.$emit("triggerResortSelect",hotel.hotelCode)},500)}),vm.pageTitle="Offers at "+hotel.name,Places.get("PortalPropertyNoticesData",hotel.id).then(function(response){"ok"==response.data.status&&(vm.priorityNotices=response.data.content.priorityNotices,vm.notices=response.data.content.notices,vm.hints=response.data.content.hints)}))})}),found||$state.go("404")}else vm.headerImage=$state.current.data.headerImage,vm.headerImagePositionY=$state.current.data.headerImagePositionY||null,vm.featuredImage=$state.current.data.featuredImage,vm.bodyContent=$state.current.data.bodyContent,vm.secondaryBodyContent=$state.current.data.secondaryBodyContent,vm.pageTitle=$state.current.data.pageTitle,vm.headerImage?Settings.setHeaderImage(vm.headerImage):Settings.setHeaderImage(null),vm.h1=$state.current.data.h1,vm.hideH1=$state.current.data.hideH1,vm.h2=$state.current.data.h2,vm.hideH2=$state.current.data.hideH2,angular.forEach(_destinations,function(destination,destinationName){vm.destinations.push({name:destinationName,hotels:destination.hotels}),angular.forEach(destination.hotels,function(hotel){vm.hotels.push(hotel)})}),vm.selectedResort=Settings.get("selectedResort")||vm.hotels[0]&&vm.hotels[0].hotelCode,getRegionOffers()}angular.module("explorer.app").controller("OffersCtrl",["$scope","$state","$stateParams","$window","$filter","$location","$timeout","Places","Settings",OffersCtrl])}(),function(){"use strict";function PhotosCtrl($scope,$state,$stateParams,$window,$filter,$timeout,$location,$mdDialog,Person,Places,Alert,Settings){function updateDestinations(){vm.selectedHotel&&angular.forEach(vm.destinations,function(destination){angular.forEach(destination.hotels,function(hotel){hotel.hotelCode==vm.selectedHotel&&(vm.selectedDestination=destination.name)})})}function updateResorts(){vm.selectedDestination&&angular.forEach(vm.destinations,function(destination){destination.name==vm.selectedDestination&&(vm.selectedHotel=destination.hotels[0].hotelCode)})}function scrollBy(last,inview){last&&inview&&(vm.hotelsLimit+=20)}function photoPop(index,image){image.title&&(image.title=$filter("capitalize")($filter("camelCaseToHuman")(image.title)),image.title=image.title.replace("Photo Urls","")),image.index=index,$mdDialog.show({parent:angular.element(document.body),clickOutsideToClose:!0,escapeToClose:!0,templateUrl:"app/cards/photo-gallery.html",controller:function($scope,$filter,$mdDialog){var tmpIndex,currentImageSet=vm.useTagAsCategory&&vm.currentPhotoTag?vm.property.photos.filter(vm.photoTagFilter):vm.property.photos;$scope.image=image,$scope.totalImages=currentImageSet.length,$scope.closeDialog=function(){$mdDialog.hide()},$scope.nextImage=function(){tmpIndex=$scope.image.index,$scope.image.index+1=0?($scope.image=currentImageSet[$scope.image.index-1],$scope.image.index=tmpIndex-1):($scope.image=currentImageSet[currentImageSet.length-1],$scope.image.index=currentImageSet.length-1),$scope.image.title=$filter("capitalize")($filter("camelCaseToHuman")($scope.image.title)),$scope.image.title=$scope.image.title.replace("Photo Urls","")}}})}function photoTagFilter(photo){if(photo&&photo.tags&&vm.currentPhotoTag){var tags=angular.isArray(photo.tags)?photo.tags:photo.tags.split(",");for(var i in tags)if(tags[i]==vm.currentPhotoTag)return!0;return!1}return!vm.currentPhotoTag}function viewHotel(listingId){$state.go("explore",{listingId:listingId})}var _property,vm=this,regions=Settings.get("nearby_resorts")||[],_countries=[],_states=[],_destinations=[];if(vm.user=Settings.get("user")||{},vm.query=Settings.get("query")||"",vm.viewHotel=viewHotel,vm.updateResorts=updateResorts,vm.updateDestinations=updateDestinations,vm.photoPop=photoPop,vm.photoTagFilter=photoTagFilter,vm.scrollBy=scrollBy,$stateParams.slug){var found=!1;if(angular.forEach(regions,function(destination,destinationName){angular.forEach(destination.hotels,function(hotel){hotel.slug==$stateParams.slug.toLowerCase()&&($stateParams.cityState&&$stateParams.slug&&$stateParams.cityState!=hotel.cityState&&(Object.keys($location.search()).length>0&&Settings.set("locationSearchUrlParams",$location.search()),$state.go("hotelPhotos",{cityState:hotel.cityState,slug:hotel.slug},{reload:"hotelPhotos"})),found=!0,vm.isProperty=!0,vm.headerProperty=hotel,Settings.set("currentHotel",hotel),vm.destination=destination,vm.destinationName=destinationName, $scope.$broadcast("triggerResortSelect",hotel.hotelCode),Places.get("PortalPropertyNoticesData",hotel.id).then(function(response){"ok"==response.data.status&&(vm.priorityNotices=response.data.content.priorityNotices,vm.notices=response.data.content.notices,vm.hints=response.data.content.hints)}),Settings.get("has_portal_property_details_"+hotel.id)?(_property=Settings.get("portal_property_details_"+hotel.id),_property.photoTags=[],_property.photos.map(function(photo){if(photo.thumb||(photo.thumb=photo.url),photo.tags){var tags=angular.isArray(photo.tags)?photo.tags:photo.tags.split(",");angular.forEach(tags,function(tag){-1==_property.photoTags.indexOf(tag)&&_property.photoTags.push(tag)})}}),vm.property=_property,vm.useTagAsCategory=!(!vm.property||"1"!=vm.property.useTagAsCategory),vm.bodyContent=vm.property.photosContent,$timeout(function(){$scope.$broadcast("triggerResortSelect",hotel.hotelCode),$scope.$emit("triggerResortSelect",hotel.hotelCode)},500)):Places.get("PortalPropertyDetails",hotel.id).then(function(response){"ok"==response.data.status&&response.data.details.id?(_property=response.data.details,vm.useTagAsCategory="1"==response.data.details.useTagAsCategory):_property=hotel,_property.photoTags=[],_property.photos.map(function(photo){if(photo.thumb||(photo.thumb=photo.url),photo.tags){var tags=angular.isArray(photo.tags)?photo.tags:photo.tags.split(",");angular.forEach(tags,function(tag){-1==_property.photoTags.indexOf(tag)&&_property.photoTags.push(tag)})}}),vm.property=_property,Settings.set("portal_property_details_"+hotel.id,_property),Settings.set("has_portal_property_details_"+hotel.id,!0),vm.bodyContent=vm.property.photosContent,$timeout(function(){$scope.$broadcast("triggerResortSelect",hotel.hotelCode),$scope.$emit("triggerResortSelect",hotel.hotelCode)},500)}),vm.pageTitle=hotel.name+" Photo Gallery",hotel.headerImage?vm.headerImage=hotel.headerImage:vm.headerImage=hotel.image,vm.headerImage?Settings.setHeaderImage(vm.headerImage):Settings.setHeaderImage(null))})}),!vm.isProperty){vm.hotels=[],vm.destinations=[],vm.states=[],vm.countries=[],vm.isProperty=!1,vm.headerImage=$state.current.data.headerImage,vm.destinationSlug=$stateParams.slug,vm.isDestination=!0,vm.pageTitle=$filter("properCaps")($stateParams.slug)+" Photo Gallery",vm.h1=vm.pageTitle,vm.headerImage?Settings.setHeaderImage(vm.headerImage):Settings.setHeaderImage(null),angular.forEach(regions,function(destination,destinationName){angular.forEach(destination.hotels,function(hotel){hotel.state!=$stateParams.slug&&hotel.cityState!=$stateParams.slug||(hotel.destinationName=destinationName,hotel.destinationSlug=$filter("toSlug")(destinationName),vm.selectedDestination=destinationName,vm.hotels.push(hotel),-1==_countries.indexOf(hotel.address.addressCountry)&&(_countries.push(hotel.address.addressCountry),vm.countries.push({name:hotel.address.addressCountry,slug:hotel.address.addressCountry.toLowerCase(),count:0})),_states.indexOf(hotel.stateName)<0&&(_states.push(hotel.stateName),vm.states.push({name:hotel.stateName,country:hotel.address.addressCountry||"",slug:hotel.stateName.toLowerCase()})),_destinations.indexOf(hotel.cityState)<0&&(_destinations.push(hotel.cityState),vm.destinations.push({name:hotel.cityName+", "+hotel.stateName,slug:hotel.cityState,country:hotel.address.addressCountry,state:hotel.stateName,city:hotel.address.addressLocality,hotels:destination.hotels})))})});var breakLoop=!1;breakLoop||$window.PORTAL_DESTINATIONS.states.indexOf($stateParams.slug)>-1&&(vm.isState=!0,vm.destinationName=$filter("properCaps")($stateParams.slug),breakLoop=!0),breakLoop||$window.PORTAL_DESTINATIONS.cityStates.indexOf($stateParams.slug)>-1&&(vm.isCityState=!0,angular.forEach(regions,function(destination,destinationName){angular.forEach(destination.hotels,function(hotel){hotel.cityState==$stateParams.slug&&(breakLoop||(vm.destinationName=hotel.cityName+", "+hotel.stateName,breakLoop=!0))})})),found||breakLoop||vm.hotels.length||$state.go("404")}}else vm.hotels=[],vm.destinations=[],vm.states=[],vm.countries=[],vm.isProperty=!1,vm.headerImage=$state.current.data.headerImage,vm.headerImagePositionY=$state.current.data.headerImagePositionY||null,vm.featuredImage=$state.current.data.featuredImage,vm.bodyContent=$state.current.data.bodyContent,vm.pageTitle=$state.current.data.pageTitle,vm.h1=$state.current.data.h1,vm.h1=$state.current.data.h1,vm.selectedDestination="",vm.selectedState="",vm.selectedCountry="",vm.selectedResort="",vm.h2=$state.current.data.h2,angular.forEach(regions,function(destination,destinationName){angular.forEach(destination.hotels,function(hotel){hotel.destinationName=destinationName,hotel.destinationSlug=$filter("toSlug")(destinationName),vm.hotels.push(hotel),-1==_countries.indexOf(hotel.address.addressCountry)&&(_countries.push(hotel.address.addressCountry),vm.countries.push({name:hotel.address.addressCountry,slug:hotel.address.addressCountry.toLowerCase(),count:0})),_states.indexOf(hotel.stateName)<0&&(_states.push(hotel.stateName),vm.states.push({name:hotel.stateName,country:hotel.address.addressCountry||"",slug:hotel.stateName.toLowerCase()})),_destinations.indexOf(hotel.cityState)<0&&(_destinations.push(hotel.cityState),vm.destinations.push({name:hotel.cityName+", "+hotel.stateName,slug:hotel.cityState,country:hotel.address.addressCountry,state:hotel.stateName,city:hotel.address.addressLocality,hotels:destination.hotels}))})}),vm.headerImage?Settings.setHeaderImage(vm.headerImage):Settings.setHeaderImage(null),$location.search().country?($location.search().state&&($location.search().city&&angular.forEach(vm.destinations,function(destination){destination.name.toLowerCase()===$location.search().city.toLowerCase()+", "+$location.search().state.toLowerCase()&&(vm.selectedDestination=destination.city)}),angular.forEach(vm.states,function(state){state.name.toLowerCase()===$location.search().state.toLowerCase()&&(vm.selectedState=state.name)})),angular.forEach(vm.countries,function(country){country.name.toLowerCase()===$location.search().country.toLowerCase()&&(vm.selectedCountry=country.name)})):$location.search().state?($location.search().city&&angular.forEach(vm.destinations,function(destination){destination.name.toLowerCase()===$location.search().city.toLowerCase()+", "+$location.search().state.toLowerCase()&&(vm.selectedDestination=destination.city)}),angular.forEach(vm.states,function(state){state.name.toLowerCase()===$location.search().state.toLowerCase()&&(vm.selectedState=state.name)})):$location.search().city&&angular.forEach(vm.destinations,function(destination){destination.name.toLowerCase().indexOf($location.search().city.toLowerCase())>-1&&(vm.selectedDestination=destination.city)});vm.currentIndex=0,vm.setCurrentSlideIndex=function(index){$analytics.eventTrack("webapp",{category:"page interaction",label:"View Image "+(index+1)}),vm.currentIndex=index},vm.isCurrentSlideIndex=function(index){return vm.currentIndex===index},vm.prevSlide=function(){$analytics.eventTrack("webapp",{category:"page interaction",label:"Prev Slide Image "+(vm.currentIndex+1)}),vm.currentIndex=vm.currentIndex>0?--vm.currentIndex:vm.images.length-1},vm.nextSlide=function(){$analytics.eventTrack("webapp",{category:"page interaction",label:"Next Slide Image "+(vm.currentIndex+1)}),vm.currentIndex=vm.currentIndex-1?imageSet=imageSet.split(",").map(function(image){return{url:image}}):"h"==imageSet[0]&&(imageSet=[{url:imageSet}]);else if("object"==typeof imageSet&&"string"==typeof imageSet[0]){var tmpImageSet=[];for(var i in imageSet)tmpImageSet.push({url:imageSet[i]});imageSet=tmpImageSet}$scope.totalImages=imageSet.length,"string"==typeof imageSet[0]?$scope.image={index:0,url:imageSet[0]}:$scope.image={index:0,url:imageSet[0].url,alt:imageSet[0].alt,title:imageSet[0].title},$scope.closeDialog=function(){$mdDialog.hide()},$scope.nextImage=function(){tmpIndex=$scope.image.index,$scope.image.index+1=0?($scope.image={url:imageSet[$scope.image.index-1].url,alt:imageSet[$scope.image.index-1].alt,title:imageSet[$scope.image.index-1].title},$scope.image.index=tmpIndex-1):($scope.image={url:imageSet[$scope.image.index-1].url,alt:imageSet[$scope.image.index-1].alt,title:imageSet[$scope.image.index-1].title},$scope.image.index=imageSet.length-1)}}})}var vm=this,_roomBedsIndex=[];if(vm.roomBeds=[],vm.popPhotos=popPhotos,vm.currentIndex=1,Settings.get("property_details_"+$stateParams.hotel))vm.property=Settings.get("property_details_"+$stateParams.hotel),$stateParams.cityState&&$stateParams.hotel&&$stateParams.cityState!=vm.property.cityState&&$state.go("hotelRoom",{cityState:vm.property.cityState,hotel:vm.property.slug,slug:$stateParams.slug},{reload:"hotelRoom"}),vm.property.headerImage?vm.headerImage=vm.property.headerImage:vm.headerImage=vm.property.image,Settings.set("currentHotel",vm.property),$scope.$broadcast("triggerResortSelect",vm.property.hotelCode),$scope.$emit("triggerResortSelect",vm.property.hotelCode),vm.headerImage?Settings.setHeaderImage(vm.headerImage):Settings.setHeaderImage(null);else if($stateParams.hotel){vm.isProperty=!0;var regions=Settings.get("nearby_resorts"),found=!1;angular.forEach(regions,function(destination,destinationName){angular.forEach(destination.hotels,function(hotel){hotel.slug==$stateParams.hotel.toLowerCase()&&(found=!0,$stateParams.cityState&&$stateParams.hotel&&$stateParams.cityState!=hotel.cityState&&(Object.keys($location.search()).length>0&&Settings.set("locationSearchUrlParams",$location.search()),$state.go("hotelRoom",{cityState:hotel.cityState,hotel:hotel.slug,slug:$stateParams.slug},{reload:"hotelRoom"})),Places.get("PortalPropertyNoticesData",hotel.id).then(function(response){"ok"==response.data.status&&(vm.priorityNotices=response.data.content.priorityNotices,vm.notices=response.data.content.notices,vm.hints=response.data.content.hints)}),vm.destination=destination,vm.destinationName=destinationName,vm.headerImage=hotel.headerImage||hotel.image,vm.headerProperty=hotel,Settings.set("currentHotel",hotel),$scope.$broadcast("triggerResortSelect",hotel.hotelCode),Settings.get("has_portal_property_details_"+hotel.id)?(vm.property=Settings.get("portal_property_details_"+hotel.id),setupRooms(),$timeout(function(){$scope.$broadcast("triggerResortSelect",hotel.hotelCode),$scope.$emit("triggerResortSelect",hotel.hotelCode)},500)):Places.get("PortalPropertyDetails",hotel.id).then(function(response){"ok"==response.data.status&&response.data.details.id?(vm.property=response.data.details,Settings.set("portal_property_details_"+hotel.id,response.data.details),Settings.set("has_portal_property_details_"+hotel.id,!0)):vm.property=hotel,setupRooms(),$timeout(function(){$scope.$broadcast("triggerResortSelect",hotel.hotelCode),$scope.$emit("triggerResortSelect",hotel.hotelCode)},500)}))})}),found||$state.go("404")}}angular.module("explorer.app").controller("RoomCtrl",["$scope","$state","$stateParams","$window","$filter","$timeout","$location","$http","$mdDialog","Places","Settings",RoomCtrl])}(),function(){"use strict";function RoomsCtrl($scope,$state,$stateParams,$window,$filter,$timeout,$location,$http,$mdDialog,Places,Settings){function setupRooms(){vm.property.hasOfferCatalog&&vm.property.hasOfferCatalog.itemListElement&&(angular.forEach(vm.property.hasOfferCatalog.itemListElement,function(element){"ja"==$window.DEFAULT_LANG?element.itemOffered.slug=$filter("toSlug")(element.itemOffered.name,!0):element.itemOffered.slug=$filter("toSlug")(element.itemOffered.name)}),1==$window.SHOW_LEAD_RATES&&$timeout(function(){$scope.$on("triggerUpdateBookingDates",function(ev,data){updateRates(data)})},50))}function dateRangeHasWeekend(dateRange){for(var startDate=dateRange.start,endDate=dateRange.end,start=new Date(startDate),end=new Date(endDate),currentDate=start;currentDate<=end;currentDate.setDate(currentDate.getDate()+1)){var dayOfWeek=currentDate.getDay();if(5===dayOfWeek||6===dayOfWeek)return!0}return!1}function updateRates(data){if(data&&data.roomStays&&data.roomStays[0]&&vm.property.hasOfferCatalog&&vm.property.hasOfferCatalog.itemListElement.length){dateRangeHasWeekend(data.roomStays[0].timeSpan);angular.forEach(vm.property.hasOfferCatalog.itemListElement,function(offer){var minPrice,specialRateFound=!1,lowestRate=!1,currentRate=0;angular.forEach(data.roomStays[0].allRoomTypes,function(room){offer.itemOffered.name==room.roomTypeName&&(angular.forEach(room.averageRates,function(rate){"Discount"==rate.ratePlanCategory&&rate.available&&(currentRate=rate.rate-(rate.discount||0),(!lowestRate||lowestRate.rate-lowestRate.discount>currentRate)&&(lowestRate=rate,specialRateFound=!0))}),angular.forEach(room.averageRates,function(rate){"Promotional"==rate.ratePlanCategory&&rate.available&&(currentRate=rate.rate-(rate.discount||0),(!lowestRate||lowestRate.rate-lowestRate.discount>currentRate)&&(lowestRate=rate,specialRateFound=!0))}),lowestRate?room.averageRates[0]=lowestRate:angular.forEach(room.averageRates,function(rate){specialRateFound||"Rack"!=rate.ratePlanCategory||(room.averageRates[0]=rate,specialRateFound=!0)}),offer.roomTypeId=room.roomTypeCode,offer.priceCurrency=data.currencyCode,offer.available=room.available,minPrice=room.averageRates[0].rate-room.averageRates[0].discount,offer.price=minPrice)})})}else angular.forEach(vm.property.hasOfferCatalog.itemListElement,function(offer){offer.available=!1,offer.price=!1})}function getRoomImage(image){return angular.isArray(image)&&image.length?image[0]:image}function photoPop(index,image){angular.isArray(image)||(image=[image]),$mdDialog.show({parent:angular.element(document.body),clickOutsideToClose:!0,escapeToClose:!0,templateUrl:"app/cards/photo-gallery.html",controller:function($scope,$filter,$mdDialog){function getPhotoUrl(target,url,size,crop){if(url&&"string"==typeof url){if(target&&""!=target)var result=document.getElementsByClassName(target);if("auto"===(size=size||"200")&&target){return size=angular.element(result)[0].clientWidth,url.replace("=s0","=s"+size+(crop?"-c":""))}return url.replace("=s0","=s"+size+(crop?"-c":""))}}var tmpIndex;$scope.image={url:image[0]},$scope.image.url=getPhotoUrl("listing-page",$scope.image.url,800,!1),$scope.closeDialog=function(){$mdDialog.hide()},$scope.nextImage=function(){tmpIndex=$scope.image.index,$scope.image.index+1=0?($scope.image.url=image[$scope.image.index-1],$scope.image.index=tmpIndex-1):($scope.image.url=image[vm.property.photos.length-1],$scope.image.index=vm.property.photos.length-1),$scope.image.title=$filter("capitalize")($filter("camelCaseToHuman")($scope.image.title)),$scope.image.title=$scope.image.title.replace("Photo Urls",""),$scope.image.url=getPhotoUrl("listing-page",$scope.image.url,800,!1)}}})}var vm=this,regions=Settings.get("nearby_resorts")||[];if(vm.currentIndex=1,vm.photoPop=photoPop,vm.getRoomImage=getRoomImage,$stateParams.slug){vm.isProperty=!0;var found=!1;angular.forEach(regions,function(destination,destinationName){angular.forEach(destination.hotels,function(hotel){hotel.slug==$stateParams.slug.toLowerCase()&&(found=!0,$stateParams.cityState&&$stateParams.slug&&$stateParams.cityState!=hotel.cityState&&(Object.keys($location.search()).length>0&&Settings.set("locationSearchUrlParams",$location.search()),$state.go("hotelRooms",{cityState:hotel.cityState,slug:hotel.slug},{reload:"hotelRooms"})),Settings.set("currentHotel",hotel),vm.headerProperty=hotel,vm.headerImage=hotel.headerImage||hotel.image,vm.headerImage?Settings.setHeaderImage(vm.headerImage):Settings.setHeaderImage(null),vm.destination=destination,vm.destinationName=destinationName,vm.pageTitle=hotel.name+" Rooms at "+hotel.name,$scope.$broadcast("triggerResortSelect",hotel.hotelCode),Settings.get("has_portal_property_details_"+hotel.id)?(vm.property=Settings.get("portal_property_details_"+hotel.id),setupRooms(),$timeout(function(){$scope.$broadcast("triggerResortSelect",hotel.hotelCode),$scope.$emit("triggerResortSelect",hotel.hotelCode)},500)):Places.get("PortalPropertyDetails",hotel.id).then(function(response){"ok"==response.data.status&&response.data.details.id?(vm.property=response.data.details,Settings.set("portal_property_details_"+hotel.id,response.data.details),Settings.set("has_portal_property_details_"+hotel.id,!0)):vm.property=hotel,setupRooms(),$timeout(function(){$scope.$broadcast("triggerResortSelect",hotel.hotelCode),$scope.$emit("triggerResortSelect",hotel.hotelCode)},500)}),Places.get("PortalPropertyNoticesData",hotel.id).then(function(response){"ok"==response.data.status&&(vm.priorityNotices=response.data.content.priorityNotices,vm.notices=response.data.content.notices,vm.hints=response.data.content.hints)}))})}),found||$state.go("404")}vm.currentIndex=0,vm.setCurrentSlideIndex=function(index){$analytics.eventTrack("webapp",{category:"page interaction",label:"View Room Image "+(index+1)}),vm.currentIndex=index},vm.isCurrentSlideIndex=function(index){return vm.currentIndex===index},vm.prevSlide=function(){$analytics.eventTrack("webapp",{category:"page interaction",label:"Prev Room Image "+(vm.currentIndex-1)}),vm.currentIndex=vm.currentIndex>0?--vm.currentIndex:vm.images.length-1},vm.nextSlide=function(){$analytics.eventTrack("webapp",{category:"page interaction",label:"Next Room Image "+(vm.currentIndex+1)}),vm.currentIndex=vm.currentIndex=100)return!1;if(vm.searchFilters.tripType&&vm.searchFilters.tripType.length){var pass=!1;if(angular.forEach(vm.searchFilters.tripType,function(searchType){angular.forEach(tripTypes[searchType],function(tripType){angular.forEach(item.amenityFeature,function(amenity){("ski"!=tripType&&amenity.name.toLowerCase().indexOf(tripType)>-1||"ski"==tripType&&amenity.name.toLowerCase().indexOf(tripType)>-1&&-1==amenity.name.toLowerCase().indexOf("waterskiing")&&-1==amenity.name.toLowerCase().indexOf("cross-country skiing"))&&(pass=!0)})})}),!pass)return!1}return(!vm.searchFilters.destination||"All Destinations"==vm.searchFilters.destination||(item.destinationId==vm.searchFilters.destination||!!item.destinationIds&&item.destinationIds.indexOf(vm.searchFilters.destination)>-1))&&(!vm.searchFilters.brand||!vm.searchFilters.brand.length||vm.searchFilters.brand.indexOf(item.brand)>-1)&&(!vm.showOnlyAvailableProperties||item.available)&&(!(parseInt(vm.searchFilters.price)>0)||!!item.price&&parseInt(vm.searchFilters.price)>=parseInt(item.price||0))&&(!(parseInt(vm.searchFilters.distance)>0)||!!item.distance&&parseInt(vm.searchFilters.distance)>=parseInt(item.distance||0))}),vm.searchFilters.ordering),vm.searchFilters.ordering.indexOf("price")>-1?96:vm.searchLimit):[];return $filter("orderBy")(result,vm.firstLoad?"name":"!available")}function updatePromoCode(){$window.PROMOID=vm.promoCode,$scope.$broadcast("updatePromoCode",vm.promoCode),$scope.$broadcast("triggerUpdateBookingDates")}function priceFilter(){return function(hotel){return!(parseInt(vm.searchFilters.price)>0)||!!hotel.price&&parseInt(vm.searchFilters.price)>=parseInt(hotel.price||0)}}function distanceFilter(){return function(hotel){return!(parseInt(vm.searchFilters.distance)>0)||!!hotel.distance&&parseInt(vm.searchFilters.distance)>=parseInt(hotel.distance||0)}}function isDisabledDate(d){return d=72?0:9,vm.virtualPagedResults=getVirtualPagedResults()),vm.isLoading=!1,loadingTimer=null},2500)}function filterByBrands(hotel){return!vm.searchFilters.brand||""==vm.searchFilters.brand||0==hotel.name.indexOf(vm.searchFilters.brand)}function filterByTripTypes(hotel){return!vm.searchFilters.tripType||""==vm.searchFilters.tripType||0==hotel.name.indexOf(vm.searchFilters.tripType)}function orderByFeatureCount(amenity){return vm.amenityFeatureSetCounts[amenity.name]}function updateTextSearchResults(){if(vm.predictionResults=[],!vm.searchWords.length)return vm.predictionResults;if($window.dataLayer.push({event:"areaSearch.searchQueryUpdate",eventCategory:"Area Search",eventLabel:vm.searchWords.trim()}),Settings.get("destinationsTree")&&(vm.predictionResults=vm.predictionResults.concat(Settings.get("destinationsTree").filter(function(destination){return"15218"!=destination.parentId&&destination.name.toLowerCase().indexOf(vm.searchWords.trim().toLowerCase())>-1}))),vm.predictionResults.length)vm.predictionResults=vm.predictionResults.concat(vm.allHotels.filter(function(hotel){return hotel.value.indexOf(vm.searchWords.trim().toLowerCase())>-1}));else{!elasticSearch&&window.elasticlunr&&(elasticSearch=elasticlunr(function(){this.addField("name"),this.addField("value"),this.setRef("id")}),Settings.get("destinationsTree").map(function(destination){destination.id=destination.destinationId,destination.value=destination.tree.toString(),"15218"!=destination.parentId&&elasticSearch.addDoc(destination)}),vm.allHotels.map(function(hotel){elasticSearch.addDoc(hotel)}));var elasticSearchResults=elasticSearch.search(vm.searchWords.trim(),{fields:{name:{boost:2},value:{boost:1}},expand:!0});if(vm.predictionResults=elasticSearchResults.map(function(result){return result.doc}),!vm.predictionResults.length){var searchTermsArray=vm.searchWords.trim().toLowerCase().replace(",","").split(" "),uniqueResults=[];searchTermsArray.map(function(term){vm.predictionResults=vm.predictionResults.concat(Settings.get("destinationsTree").filter(function(destination){return"15218"!=destination.parentId&&destination.name.toLowerCase().indexOf(term)>-1&&-1==uniqueResults.indexOf(destination.name)&&(uniqueResults.push(destination.name),!0)}))}),searchTermsArray.map(function(term){vm.predictionResults=vm.predictionResults.concat(vm.allHotels.filter(function(hotel){return hotel.value.indexOf(term.trim().toLowerCase())>-1&&-1==uniqueResults.indexOf(hotel.name)&&(uniqueResults.push(hotel.name),!0)}))})}}return vm.predictionResults}function updateSearchResults(options,filterChange){options=options||vm.selectedItem,vm.searchWords.length&&!options&&(options=updateTextSearchResults()),filterChange=filterChange||!1,timer&&$timeout.cancel(timer),vm.pagedResults=[],vm.virtualPagedResults=[],vm.isLoading=!0,vm.allHotels=vm.allHotels.map(function(hotel){return delete hotel.distance,hotel}),timer=$timeout(function(){!options&&filterChange||(vm.searchLimit=vm.searchLimit<=9?9:18),vm.firstLoad&&vm.selectedItem?vm.firstLoad=!1:vm.firstLoad=!0,vm.pagedResults=options?options.latlng?geoFilteredResults(options,filterChange):filteredResults(options):vm.allHotels,vm.virtualPagedResults=getVirtualPagedResults(),$scope.$broadcast("triggerUpdateSearchFilters"),vm.currentMarker&&(vm.currentMarker=null),vm.isLoading=!1},10),$timeout(function(){vm.setupFilters||($scope.$watch("vm.searchFilters['ordering']",function(newVal,oldVal){oldVal!=newVal&&(updateSearchResults(null,!0),$window.dataLayer.push({event:"areaSearch.sortOrderUpdate",eventCategory:"Area Search",eventLabel:newVal.toString()}))}),$scope.$watch("vm.searchFilters['brand']",function(newVal,oldVal){oldVal!=newVal&&(updateSearchResults(),$window.dataLayer.push({event:"areaSearch.brandFilterUpdate",eventCategory:"Area Search",eventLabel:newVal.toString()}))}),$scope.$watch("vm.searchFilters['tripType']",function(newVal,oldVal){oldVal!=newVal&&(updateSearchResults(),$window.dataLayer.push({event:"areaSearch.tripTypeFilterUpdate",eventCategory:"Area Search",eventLabel:newVal.toString()}))}),vm.setupFilters=!0),vm.virtualPagedResults=getVirtualPagedResults(),vm.searchFilters.ordering.indexOf("price")>-1&&(vm.virtualPagedResults=vm.virtualPagedResults.length==vm.virtualPagedResults.filter(function(result){return!result.available}).length?[]:vm.virtualPagedResults)},2e3)}function geoFilteredResults(options,filterChange){return angular.forEach(vm.allHotels,function(hotel){var lat1=hotel.geo.latitude,lon1=hotel.geo.longitude,lat2=options.latlng.lat,lon2=options.latlng.lng;if(lat1==lat2&&lon1==lon2)hotel.distance=0;else{var radlat1=Math.PI*lat1/180,radlat2=Math.PI*lat2/180,theta=lon1-lon2,radtheta=Math.PI*theta/180,dist=Math.sin(radlat1)*Math.sin(radlat2)+Math.cos(radlat1)*Math.cos(radlat2)*Math.cos(radtheta);dist>1&&(dist=1),dist=Math.acos(dist),dist=180*dist/Math.PI,dist=60*dist*1.1515,dist*=.8684,hotel.distance=dist}}),vm.allHotels}function filteredResults(options){if(options.hotelCode)return vm.allHotels.filter(function(hotel){return hotel.id==options.id});if(options.destinationId){var results=[],usedHotels=[];return angular.forEach(destinationProperties,function(destinationProperty){-1==usedHotels.indexOf(destinationProperty.pid)&&(destinationProperty.destinationId==options.destinationId||destinationProperty.destinationIds&&destinationProperty.destinationIds.indexOf(options.destinationId)>-1)&&angular.forEach(vm.allHotels,function(hotel){hotel.id==destinationProperty.pid&&(hotel.ordering=destinationProperty.ordering,results.push(hotel),usedHotels.push(hotel.id))})}),results.length?"distance"==vm.searchFilters.ordering?vm.searchFilters.ordering="recommended":"ordering"!=vm.searchFilters.ordering||vm.searchFilters.ordering:("recommended"!=vm.searchFilters.ordering||vm.searchFilters.ordering,angular.forEach(destinationProperties,function(destinationProperty){-1==usedHotels.indexOf(destinationProperty.pid)&&destinationProperty.tree.indexOf(options.tree[options.tree.length-1])>-1&&angular.forEach(vm.allHotels,function(hotel){hotel.id==destinationProperty.pid&&(hotel.ordering=destinationProperty.ordering,results.push(hotel),usedHotels.push(hotel.id))})})),results}return options}function resetFilters(type,skip){vm.searchWords="",vm.searchFilters={},vm.updateSearchResults()}$window.dataLayer=$window.dataLayer||[];var timer,loadingTimer,prevDiff,vm=this,_allHotels=[],_orderedHotels=[],_amenityFeatureSet=[],_amenityTotalCounts=[],_allRegions=[],today=new Date,yesterday=new Date,_regions={},destinationProperties=[],elasticSearch=null,tripTypes={Beaches:["beach"],Golfing:["golf","putt"],Family:["child","playground","picnic","pool","bbq","game","restaurant","bowling","wedding","kid","activities","river","mall"],Fun:["fish","lake","hot","night","tennis","basketball","volleyball","horse","hiking","bar","heli","plane","dance","cook","tub","massage","mall"],Ski:["ski"]};yesterday.setDate(today.getDate()-1),vm.centerLat?vm.mapCenter={lat:parseFloat(vm.centerLat),lng:parseFloat(vm.centerLng),focus:!0,draggable:!0,zoom:5}:appConfig.mapCenter&&(vm.mapCenter=appConfig.mapCenter),vm.defaultOrdering="brand",vm.orderByBrand=["Club Wyndham","WorldMark","Margaritaville Vacation Club","Shell","RCI","APAC"],Settings.set("checkinDate",moment().diff(moment($localStorage.checkinDate))>0?moment().add(1,"days"):$localStorage.checkinDate),Settings.set("checkoutDate",moment().diff(moment($localStorage.checkoutDate))>0?moment().add(3,"days"):$localStorage.checkoutDate),vm.headerImage=$state.current.data.headerImage,vm.mapMarkerIcon=$window.APP_CONFIG.core.themes?$window.APP_CONFIG.core.themes.mapMarkerIcon:null, vm.bodyContent=$state.current.data.bodyContent,vm.pageTitle=$state.current.data.pageTitle,vm.h1=$state.current.data.h1,vm.hideH1=$state.current.data.hideH1,vm.h2=$state.current.data.h2,vm.hideH2=$state.current.data.hideH2,vm.sidebarPromo=$state.current.data.sidebarPromo,vm.mapConfig={searchMode:"list",center:{lat:39.707186,lng:-101.351624},zoom:6},vm.searchFilters={ordering:"recommended"},vm.categories=[],vm.regions={},vm.updateSearchResults=updateSearchResults,vm.updateTextSearchResults=updateTextSearchResults,vm.updatePromoCode=updatePromoCode,vm.orderByFeatureCount=orderByFeatureCount,vm.filterByBrands=filterByBrands,vm.filterByTripTypes=filterByTripTypes,vm.resetFilters=resetFilters,vm.searchLimit=9,vm.scrollByProperties=scrollByProperties,vm.currentWindow={height:$window.innerHeight,width:$window.innerWidth},vm.isDisabledDate=isDisabledDate,vm.priceFilter=priceFilter,vm.distanceFilter=distanceFilter,vm.isLoading=!1,vm.firstLoad=!0;if(Settings.get("has_nearby_resorts")){_regions=Settings.get("nearby_resorts"),destinationProperties=Settings.get("destinationProperties"),vm.destinations=Settings.get("destinationsTree"),vm.amenityFeatureSet=[],vm.dataLoaded=!1,angular.forEach(_regions,function(region,regionName){var currentHotels=[];angular.forEach(region.hotels,function(hotel){currentHotels.push(hotel.id),hotel.geo&&hotel.geo.latitude&&hotel.geo.longitude&&(hotel.imageIndex=0,hotel.address?hotel.value=hotel.name.toLowerCase()+" "+(hotel.address.streetAddress?hotel.address.streetAddress.toLowerCase():"")+" "+(hotel.address.addressLocality?hotel.address.addressLocality.toLowerCase():"")+" "+(hotel.address.addressRegion?hotel.address.addressRegion.toLowerCase():"")+" "+(hotel.stateName?hotel.stateName.toLowerCase():"")+" "+(hotel.cityName?hotel.cityName.toLowerCase():"")+" "+(hotel.address.addressCountry?hotel.address.addressCountry.toLowerCase():"")+" "+hotel.telephone+" "+hotel.address.postalCode:hote.value=hotel.name.toLowerCase(),hotel.additionalProperty&&angular.forEach(hotel.additionalProperty,function(property){switch(property.name){case"Additional Locations":hotel.value+=" "+property.value.toLowerCase()}}),angular.forEach(destinationProperties,function(property){property.pid==hotel.id&&(hotel.destinationId=property.destinationId,hotel.destinationIds=hotel.destinationIds||[],hotel.destinationIds.push(property.destinationId))}),hotel.alternateName&&(hotel.value+=" "+hotel.alternateName.join(" ")),hotel.value=hotel.value.replace(/[^a-zA-Z0-9- ]/g,"").toLowerCase(),hotel.amenityFeature&&hotel.amenityFeature.length&&angular.forEach(hotel.amenityFeature,function(feature){hotel.value+=" "+feature.value.toLowerCase(),-1==_amenityFeatureSet.indexOf(feature.name)?(_amenityFeatureSet.push(feature.name),_amenityTotalCounts[feature.name]=1,vm.amenityFeatureSet.push(feature)):_amenityTotalCounts[feature.name]=_amenityTotalCounts[feature.name]+1}),_allHotels.push(hotel))}),_allRegions[regionName]={hotels:currentHotels}}),vm.amenityFeatureSet=_amenityFeatureSet,vm.amenityFeatureSetCounts=_amenityTotalCounts,vm.dataLoaded=!0,_allHotels=$filter("orderBy")(_allHotels,"name");var usedHotels=[];"brand"==vm.defaultOrdering&&(angular.forEach(vm.orderByBrand,function(brand){angular.forEach(_allHotels,function(hotel){-1==usedHotels.indexOf(hotel.id)&&hotel.brand==brand&&(usedHotels.push(hotel.id),hotel.recommended=usedHotels.length,_orderedHotels.push(hotel))})}),angular.forEach(_allHotels,function(hotel){-1==usedHotels.indexOf(hotel.id)&&(usedHotels.push(hotel.id),hotel.recommended=usedHotels.length,_orderedHotels.push(hotel))}),_allHotels=_orderedHotels),vm.regions=_regions,vm.allHotels=_allHotels}$timeout(function(){if(vm.checkinDate=new Date(Settings.get("checkinDate")?moment(Settings.get("checkinDate")):moment().add(1,"days")),vm.checkoutDate=new Date(Settings.get("checkoutDate")?moment(Settings.get("checkoutDate")):moment().add(3,"days")),$scope.$watch("vm.checkinDate",function(oldDate,newDate){moment(vm.checkinDate).diff(moment(vm.checkoutDate))>=-86400001?prevDiff=moment(vm.checkinDate).diff(moment(vm.checkoutDate)):$scope.$broadcast("triggerUpdateBookingDates"),Settings.set("checkinDate",vm.checkinDate),$localStorage.checkinDate=vm.checkinDate}),$scope.$watch("vm.checkoutDate",function(oldDate,newDate){Settings.set("checkoutDate",vm.checkoutDate),$localStorage.checkoutDate=vm.checkoutDate,moment(vm.checkinDate).diff(moment(vm.checkoutDate))!=prevDiff&&(vm.showDatePicker=!1,$scope.$broadcast("triggerUpdateBookingDates"),$window.dataLayer.push({event:"areaSearch.dateSelectionUpdate",eventCategory:"Area Search",eventLabel:moment(Settings.get("checkinDate")).format("YYYY-MM-DD")+" - "+moment(Settings.get("checkoutDate")).format("YYYY-MM-DD")}))}),$scope.$on("triggerRatesLookupComplete",function(){vm.virtualPagedResults=getVirtualPagedResults()}),vm.promoCode=$window.PROMOID||null,vm.searchWords=$location.search().q||"",vm.searchWords)updateTextSearchResults(),vm.predictionResults.length?updateSearchResults():(vm.isLoading=!0,$http.get(encodeURI("/prediction/v1/search?q="+vm.searchWords.toLowerCase())).then(function(response){if(response.data&&response.data.results&&response.data.results.length){var result=response.data.results[0];result.latlng={lat:result.place.geometry.coordinates[1],lng:result.place.geometry.coordinates[0]},updateSearchResults(result)}else updateSearchResults()},function(error){console.log(error),updateSearchResults()})),$timeout(function(){updateSearchResults()},200);else{if($location.search().destinationId){var searchDestination=vm.destinations.filter(function(destination){return destination.destinationId==$location.search().destinationId});searchDestination.length&&(vm.selectedItem=searchDestination[0],Settings.setMetaTitle(Settings.getMetaTitle().replace("Search Resorts",vm.selectedItem.city+", "+vm.selectedItem.state+" Resorts")))}updateSearchResults(),$timeout(function(){updateSearchResults()},200)}},100)}angular.module("explorer.app").controller("SearchCtrl",["$scope","$state","$stateParams","$location","$localStorage","$mdDialog","$window","$filter","$timeout","$http","$analytics","$q","Places","Destinations","Alert","Settings","appConfig",SearchCtrl])}(),function(){"use strict";function SiteMapCtrl($rootScope,$state,$window,$filter,Places,Settings){function setupRegions(regions){vm.allHotels=[],angular.forEach(regions,function(region,regionName){region.slug=$filter("toSlug")(regionName),angular.forEach(region.hotels,function(hotel){vm.allHotels.push(hotel)})}),vm.regions=regions}var vm=this,usedItems=[];vm.clientName=$window.APP_CLIENT,$window.APP_CONFIG.core&&$window.APP_CONFIG.core.sitemap&&(vm.headerImage=$window.APP_CONFIG.core.sitemap.headerImage,vm.bodyContent=$window.APP_CONFIG.core.sitemap.bodyContent),vm.headerImage?Settings.setHeaderImage(vm.headerImage):Settings.setHeaderImage(null);var _menuItems={},pageOrdering=1;angular.forEach($window.APP_CONFIG.menu,function(item,key){"1"==item.isActive&&(item.ordering=item.ordering?parseInt(item.ordering):pageOrdering++,item.children=[],_menuItems[key]=item)}),$window.LANDING_PAGES&&(angular.forEach($window.LANDING_PAGES,function(page){"1"==page.isActive&&(page.params={},page.menuName=page.title,page.state=page.id,page.slug&&0==page.slug.indexOf("http")&&(page.params.external=1),page.slug=page.slug&&page.slug.replace("https://"+$window.location.hostname,""),page.ordering=page.ordering?parseInt(page.ordering):pageOrdering++,page.children=[],"0"==page.noIndex&&(_menuItems[page.state]=page))}),angular.forEach(_menuItems,function(menuItem){angular.forEach(_menuItems,function(corePage){corePage.parent==menuItem.state&&"0"==corePage.noIndex&&"1"==corePage.isActive&&-1==usedItems.indexOf(corePage.state)&&(usedItems.push(corePage.state),menuItem.children.push({id:corePage.state,parent:corePage.parent,title:corePage.title,pageTitle:corePage.pageTitle||corePage.title,slug:corePage.slug,ordering:"1"==corePage.isMenuItem?parseInt(corePage.ordering):menuItem.ordering,children:[]}))}),angular.forEach($window.LANDING_PAGES,function(page){page.parent==menuItem.state&&"0"==page.noIndex&&"1"==page.isActive&&-1==usedItems.indexOf(page.state)&&(usedItems.push(page.state),menuItem.children.push({id:page.state,parent:page.parent,title:page.title,pageTitle:page.pageTitle||page.title,slug:page.slug,ordering:"1"==page.isMenuItem?parseInt(page.ordering):menuItem.ordering,children:[]}))})}),angular.forEach(_menuItems,function(menuItem){angular.forEach(_menuItems,function(corePage){angular.forEach(menuItem.children,function(child){corePage.parent==child.state&&"0"==corePage.noIndex&&"1"==corePage.isActive&&-1==usedItems.indexOf(corePage.state)&&(usedItems.push(corePage.id),child.children.push({id:corePage.id,parent:corePage.parent,title:corePage.title,pageTitle:corePage.pageTitle||corePage.title,slug:corePage.slug,ordering:"1"==corePage.isMenuItem?parseInt(corePage.ordering):menuItem.ordering}))})}),angular.forEach($window.LANDING_PAGES,function(page){angular.forEach(menuItem.children,function(child){page.parent==child.state&&"0"==page.noIndex&&"1"==page.isActive&&-1==usedItems.indexOf(page.state)&&(usedItems.push(page.state),child.children.push({id:page.state,parent:page.parent,title:page.title,pageTitle:page.pageTitle||page.title,slug:page.slug,ordering:"1"==page.isMenuItem?parseInt(page.ordering):menuItem.ordering}))})})}));var siteMapMenu={};angular.forEach(_menuItems,function(item,id){-1==usedItems.indexOf(id)&&(siteMapMenu[id]=item)}),vm.menuItems=siteMapMenu,Settings.get("has_nearby_resorts")?setupRegions(Settings.get("nearby_resorts")):Places.getNearbyResorts().then(function(response){response.data&&"ok"==response.data.status&&setupRegions(response.data.regions)},function(){$state.go("home")})}angular.module("explorer.app").controller("SiteMapCtrl",["$rootScope","$state","$window","$filter","Places","Settings",SiteMapCtrl])}(),function(){"use strict";function StoriesCtrl($scope,$state,$stateParams,$window,$location,$timeout,$filter,Stories,Settings,Alert){var stories,vm=this;vm.h1=$state.current.data.h1,vm.hideH1=$state.current.data.hideH1,vm.h2=$state.current.data.h2,vm.hideH2=$state.current.data.hideH2,vm.featuredImage=$state.current.data.featuredImage,vm.featuredImageURL=$state.current.data.featuredImageURL,vm.featuredImageCaption=$state.current.data.featuredImageCaption||"",vm.headerImagePositionY=$state.current.data.headerImagePositionY||null,vm.template=$state.current.data.template,vm.siteName=$window.APP_CLIENT,vm.parent=$stateParams.parent,vm.categorySlug=$stateParams.slug,Settings.get("hasPortalSiteStories")?$timeout(function(){if(stories=Settings.get("portalSiteStories"),vm.categories=Settings.get("portalSiteStoryCategories"),vm.categorySlug?(stories=stories.filter(function(story){var found=!1;return angular.forEach(story.categories,function(category){$filter("toSlug")(category.replace("&","and"))==vm.categorySlug&&(vm.isCategory=!0,vm.currentCategory=category,found=!0)}),found}),vm.isCategory&&angular.forEach(vm.categories,function(category){vm.currentCategory==category.name&&(vm.category=category,vm.headerImage=category.image,vm.bodyContent=category.bodyContent)})):(vm.headerImage=$state.current.data.headerImage,vm.bodyContent=$state.current.data.bodyContent),vm.headerImage?Settings.setHeaderImage(vm.headerImage):Settings.setHeaderImage(null),vm.offsetStories?vm.stories=stories.slice((vm.offsetStories%stories.length+stories.length)%stories.length).concat(stories.slice(0,(vm.offsetStories%stories.length+stories.length)%stories.length)):vm.stories=stories,"storiesCategory"==$state.current.name&&!vm.isCategory)try{if($stateParams.parent)return void $location.path("/"+$stateParams.parent);$state.go("stories")}catch(e){console.log(e)}},50):Stories.get("PropertySiteStories").then(function(response){if("ok"==response.data.status&&(stories=response.data.stories,vm.categories=response.data.categories,Settings.set("portalSiteStories",response.data.stories),Settings.set("portalSiteStoryCategories",response.data.categories),Settings.set("hasPortalSiteStories",!0),vm.categorySlug?(stories=stories.filter(function(story){var found=!1;return angular.forEach(story.categories,function(category){$filter("toSlug")(category.replace("&","and"))==vm.categorySlug&&(vm.isCategory=!0,vm.currentCategory=category,found=!0)}),found}),vm.isCategory&&angular.forEach(vm.categories,function(category){vm.currentCategory==category.name&&(vm.category=category,vm.headerImage=category.image,vm.bodyContent=category.bodyContent)})):(vm.headerImage=$state.current.data.headerImage,vm.bodyContent=$state.current.data.bodyContent),vm.headerImage?Settings.setHeaderImage(vm.headerImage):Settings.setHeaderImage(null),vm.offsetStories?vm.stories=stories.slice((vm.offsetStories%stories.length+stories.length)%stories.length).concat(stories.slice(0,(vm.offsetStories%stories.length+stories.length)%stories.length)):vm.stories=stories,"storiesCategory"==$state.current.name&&!vm.isCategory))try{if($stateParams.parent)return void $location.path("/"+$stateParams.parent);$state.go("stories")}catch(e){$state.go("stories")}})}angular.module("explorer.app").controller("StoriesCtrl",["$scope","$state","$stateParams","$window","$location","$timeout","$filter","Stories","Settings","Alert",StoriesCtrl])}(),function(){"use strict";function StoryCtrl($scope,$state,$stateParams,$window,$location,$timeout,Stories,Settings,Alert){function loadHubspotScript(noRetry){$timeout(function(){var hubspotForm=document.querySelector("[id='hubspot-form']");$window.hbspt&&hubspotForm.dataset.formId&&hubspotForm.dataset.portalId?hbspt.forms.create({portalId:hubspotForm.dataset.portalId,formId:hubspotForm.dataset.formId,target:"#hubspot-form"}):noRetry||$timeout(function(){loadHubspotScript(!0)},1e4)},500)}function setupPage(){if(page){found=!0,vm.title=page.title,vm.pageTitle=page.pageTitle||page.title,vm.featuredImage=page.featuredImage,vm.featuredImageURL=page.featuredImageURL,vm.featuredImageTitle=page.featuredImageTitle,page.pageTitle&&Settings.setMetaTitle(page.pageTitle),page.metaDescription&&Settings.setMetaDescription(page.metaDescription);const htmlContent=page.bodyContent,imgRegex=/]*?>/gi,updatedHtmlContent=(htmlContent.match(imgRegex),htmlContent.replace(imgRegex,function(imgTag){return updateSrc(imgTag)}));vm.bodyContent=updatedHtmlContent.replace("","load-external-script>"),vm.story=page,vm.currentUrl=$window.location.href,$timeout(function(){vm.hasHubspotForm&&document.querySelector("[id='hubspot-form']")&&loadHubspotScript()},10)}else $state.go("stories")}function updateSrc(imgTag){var widthMatch=imgTag.match(/width=["'](\d+)["']/i),heightMatch=imgTag.match(/height=["'](\d+)["']/i);if(widthMatch){var width=widthMatch[1],updatedTag=imgTag.replace(/(src="[^"]+=)\w+(")/i,"$1w"+width+"$2");if(heightMatch){var height=heightMatch[1];updatedTag=updatedTag.replace(/(src="[^"]+)=w(\d+)(")/i,"$1=w"+width+"-h"+height+"-n$3")}return updatedTag}if(heightMatch){var height=heightMatch[1];return imgTag.replace(/(src="[^"]+)(")/i,"$1=h"+height+"$2")}return imgTag}var page,vm=this,found=!1;vm.siteName=$window.APP_CLIENT,vm.parent=$stateParams.parent,Stories.get("StoryDetailsBySlug",$stateParams.slug).then(function(response){if("ok"==response.data.status)page=response.data.story,setupPage();else try{if($stateParams.parent)return void $location.path("/"+$stateParams.parent);$state.go("stories")}catch(e){console.log(e)}}),Settings.get("propertySiteStoryCategories")?vm.categories=Settings.get("propertySiteStoryCategories"):Stories.get("PropertySiteStories").then(function(response){"ok"==response.data.status&&(vm.categories=response.data.categories,Settings.set("propertySiteStories",response.data.stories),Settings.set("propertySiteStoryCategories",response.data.categories),Settings.set("hasPropertySiteStories",!0))})}angular.module("explorer.app").controller("StoryCtrl",["$scope","$state","$stateParams","$window","$location","$timeout","Stories","Settings","Alert",StoryCtrl])}(),function(){"use strict";angular.module("explorer.config",["ui.router"]).config(function($sceDelegateProvider,$locationProvider,$logProvider,$urlRouterProvider,$mdThemingProvider,$mdIconProvider,$analyticsProvider){$sceDelegateProvider.resourceUrlWhitelist(["self","https://storage.googleapis.com/**","http://www.cfmedia.vfmleonardo.com/**","https://wyndham-extra-holidays.leonardocontentcloud.com/**","https://reservations.travelclick.com/**","https://api.trustyou.com/**","http://**.keen.io/**","http://**.triptease.io/**","https://**.keen.io/**","https://**.triptease.io/**","https://googleads.g.doubleclick.net/**","https://www.facebook.com/**","https://player.vimeo.com/**","https://*.*.doubleclick.net/**","https://api.stathat.com/**","https://www.googletagmanager.com/**","https://www.opentable.com/**","https://**.getchute.com/**","https://**.amazonaws.com/**","https://www.youtube.com/**"]), $mdIconProvider.icon("w","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/wyndham-w-logo.svg",24).icon("home","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_home_24px.svg",24).icon("trip","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/language-lb.svg",24).icon("stay","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_hotel_24px.svg",24).icon("camera","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_photo_camera_24px.svg",24).icon("key","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_vpn_key_24px.svg",24).icon("deals","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_local_play_24px.svg",24).icon("specials","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_local_offer_24px.svg",24).icon("reviews","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_rate_review_24px.svg",24).icon("message","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_message_24px.svg",24).icon("checkin","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_person_pin_24px.svg",24).icon("checkout","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_assistant_24px.svg",24).icon("plus","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_add_circle_outline_24px.svg",24).icon("info","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_info_24px.svg",24).icon("privacy","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_lock_24px.svg",24).icon("terms","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_description_24px.svg",24).icon("external","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_launch_24px.svg",24).icon("label","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_label_24px.svg",24).icon("heart","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_favorite_24px.svg",24).icon("emptyheart","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_favorite_border_24px.svg",24).icon("gstar","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/g-star.svg",24).icon("gstarhalf","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/g-star-half.svg",24).icon("gstarempty","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/g-star-outline.svg",24).icon("person","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/person-lb.svg",24).icon("people","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/people-lb.svg",24).icon("id","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_perm_device_information_24px.svg",24).icon("personadd","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_person_add_24px.svg",24).icon("accountround","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_account_circle_24px.svg",24).icon("accountsquare","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_account_box_24px.svg",24).icon("website","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_web_24px.svg",24).icon("gender","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_wc_24px.svg",24).icon("occupation","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_accessibility_24px.svg",24).icon("jobtitle","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_airline_seat_recline_normal_24px.svg",24).icon("google","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/google.svg",24).icon("googleplus","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/google-plus.svg",24).icon("work","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_business_24px.svg",24).icon("ribbon","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_ribbon_24px.svg",24).icon("check","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_check_24px.svg",24).icon("checkcircle","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_check_circle_24px.svg",24).icon("create","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_create_24px.svg",24).icon("location","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/location-lb.svg",24).icon("map","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_map_24px.svg",24).icon("dashboard","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_dashboard_24px.svg",24).icon("reports","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_assignment_turned_in_24px.svg",24).icon("subject","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_textsms_24px.svg",24).icon("menu","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_menu_24px.svg",24).icon("share","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/share.svg",24).icon("google_plus","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/google_plus.svg",512).icon("hangouts","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/hangouts.svg",512).icon("twitter","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/twitter.svg",512).icon("previous","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_navigate_before_24px.svg",24).icon("next","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_navigate_next_24px.svg",24).icon("skipfirst","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_skip_previous_24px.svg",24).icon("skiplast","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_skip_next_24px.svg",24).icon("uparrow","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_arrow_drop_down_24px.svg",24).icon("downarrow","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_arrow_drop_up_24px.svg",24).icon("downwardarrow","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_arrow_downward_24px.svg",24).icon("upwardarrow","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_arrow_upward_24px.svg",24).icon("leftwardarrow","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_arrow_back_24px.svg",24).icon("rightwardarrow","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_arrow_forward_24px.svg",24).icon("downchevron","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_keyboard_arrow_down_24px.svg",24).icon("upchevron","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_keyboard_arrow_up_24px.svg",24).icon("rightchevron","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_chevron_right_24px.svg",24).icon("settings","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_settings_24px.svg",24).icon("moresettings","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_more_vert_24px.svg",24).icon("time","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_access_time_24px.svg",24).icon("timer","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_timelapse_24px.svg",24).icon("open","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_open_in_browser_24px.svg",24).icon("delete","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_delete_24px.svg",24).icon("mailopen","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_drafts_24px.svg",24).icon("close","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_close_24px.svg",24).icon("cancel","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_cancel_24px.svg",24).icon("no","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_do_not_disturb_24px.svg",24).icon("explore","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_explore_24px.svg",24).icon("undo","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_undo_24px.svg",24).icon("redo","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_redo_24px.svg",24).icon("remove","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_remove_circle_24px.svg",24).icon("address","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/location-lb.svg",24).icon("phonegroup","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_settings_phone_24px.svg",24).icon("room","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_hotel_24px.svg",24).icon("tag","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_local_offer_24px.svg",24).icon("child","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_face_24px.svg",24).icon("infant","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_tag_faces_24px.svg",24).icon("date","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/date-lb.svg",24).icon("datecheck","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_event_available_24px.svg",24).icon("datex","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_event_busy_24px.svg",24).icon("dateline","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_event_note_24px.svg",24).icon("personfolder","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_folder_shared_24px.svg",24).icon("specialfolder","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_folder_shared_24px.svg",24).icon("web","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_web_24px.svg",24).icon("creditcard","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_credit_card_24px.svg",24).icon("noteadd","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_folder_special_24px.svg",24).icon("book","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_book_24px.svg",24).icon("money","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_attach_money_24px.svg",24).icon("earth","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_earth_24px.svg",24).icon("wallet","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_account_balance_wallet_24px.svg",24).icon("cta","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_perm_phone_msg_24px.svg",24).icon("spa","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_spa_24px.svg",24).icon("golf","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_golf_course_24px.svg",24).icon("gym","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_fitness_center_24px.svg",24).icon("beach","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_beach_access_24px.svg",24).icon("bizcenter","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_business_center_24px.svg",24).icon("hottub","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_hot_tub_24px.svg",24).icon("service","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_room_service_24px.svg",24).icon("help","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_help_24px.svg",24).icon("logout","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_power_settings_new_24px.svg",24).icon("wifi","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_wifi_24px.svg",24).icon("pool","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/swim.svg",24).icon("rss","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_rss_feed_24px.svg",24).icon("stories","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_import_contacts_24px.svg",24).icon("soctripadvisor","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/social_tripadvisor_24.svg",24).icon("soctwitter","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/social_twitter_24.svg?v2",24).icon("socyoutube","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/social_youtube_24.svg",24).icon("socfacebook","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/social_facebook_24.svg",24).icon("socfoursquare","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/social_foursquare_24.svg",24).icon("socgoogle","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/social_google_24.svg",24).icon("socinstagram","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/social_instagram_24.svg",24).icon("soctiktok","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/social_tiktok_24.svg",24).icon("socpinterest","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/social_pinterest_24.svg",24).icon("mail","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/email_lb_2.svg",24).icon("search","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/search_lb.svg?",24).icon("hotel","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/hotel-lb.svg?",24).icon("photos","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/photos-lb.svg?",24).icon("star","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/specials-lb.svg?",24).icon("phone","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/phone_lb_2.svg?",24).icon("directions","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/directions-lb.svg?",24).icon("directionsinvert","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/directions-invert-lb.svg?",24).icon("checkcircle","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/checkcircle_lb.svg?",24).icon("signin","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/signin-lb.svg?",24).icon("promocode","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/promocode-lb.svg?",24).icon("clock","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/clock-lb.svg?",24);var brandOrangeMap=$mdThemingProvider.extendPalette("orange",{A100:"7A3E3A",A200:"7A3E3A",A400:"7A3E3A",A700:"7A3E3A",contrastDefaultColor:"light",contrastDarkColors:["A100"],contrastLightColors:void 0}),brandBlueMap=$mdThemingProvider.extendPalette("green",{300:"3c5550",500:"507c65",800:"507c65",A100:"5e7461"});$mdThemingProvider.definePalette("brandOrange",brandOrangeMap),$mdThemingProvider.definePalette("brandBlue",brandBlueMap),$mdThemingProvider.theme("default").primaryPalette("brandBlue").accentPalette("brandOrange"),$mdThemingProvider.theme("contrast","default").primaryPalette("brandBlue"),"wave.webaim.org"!=window.location.hostname&&$locationProvider.html5Mode(!0),$logProvider.debugEnabled(!1),$analyticsProvider.virtualPageviews(!1),$analyticsProvider.settings.ga.additionalAccountNames=["ehTracker","gtm18"]})}(),angular.module("brewervacations-app").run(["$templateCache",function($templateCache){"use strict";$templateCache.put("app/cards/booking-bar-dialog.html",'

Reserve Now

{{dialogCheckinDate | date : \'d\'}}
{{dialogCheckinDate | date : \'MMM yyyy\'}}
{{dialogCheckinDate | date : \'EEEE\'}}
{{dialogCheckoutDate | date : \'d\'}}
{{dialogCheckoutDate | date : \'MMM yyyy\'}}
{{dialogCheckoutDate | date : \'EEEE\'}}
12345678
01234567
'),$templateCache.put("app/cards/booking-bar.html",'
Reservations: {{phoneReservations}}
Reservations: {{phoneReservations}}
{{checkinDate | date : \'d\'}}
{{checkinDate | date : \'MMM yyyy\'}}
{{checkinDate | date : \'EEEE\'}}
{{checkoutDate | date : \'d\'}}
{{checkoutDate | date : \'MMM yyyy\'}}
{{checkoutDate | date : \'EEEE\'}}
12345678
01234567
1234
From
{{(!priceCurrency || priceCurrency == \'USD\') ? \'$\' : \'\'}}{{leadRate | number:0}}
{{priceCurrency || \'USD\'}}/Night
From {{(!priceCurrency || priceCurrency == \'USD\') ? \'$\' : \'\'}}{{leadRate | number:0}} {{priceCurrency || \'USD\'}}/Night
Check Rates
'),$templateCache.put("app/cards/cobalt-footer.html",'
{{clientBrand || clientName}} © {{currentYear}}
'), $templateCache.put("app/cards/eh-booking-bar.html",'
Destination
All{{destination.name}}
Destination
{{selectedDestinationName || \'Search Destinations\'}}
Resort
Check In
{{checkinDate | date : "EEE\',\' M/d/yy"}}
Check Out
{{checkoutDate | date : "EEE\',\' M/d/yy"}}
Promo
Check Rates
'),$templateCache.put("app/cards/eh-breadcrumb.html",''),$templateCache.put("app/cards/eh-campaign-footer.html",''),$templateCache.put("app/cards/eh-category-offer-card.html",'
Click to Explore {{vm.isProperty ? \'Offer\' : \'Resort\'}}{{offer.price}}{{offer.title || offer.hotelName}} {{offer.price}} {{offer.title}}
View Photos{{offer.price}}
View Photos

{{offer.title}}{{offer.hotelName}}

{{offer.hotelCityStateText}} | Resort Overview

Available at Multiple Resorts

{{offer.categoryName}}

View ResortOffer Details
Enter Code Above{{offer.cta_label || \'Check Rates\'}}View Offer Resorts
'),$templateCache.put("app/cards/eh-default-rfp.html",'

Plan Your Event in Extraordinary Destinations

Submit Request for Proposal

This is required.
This is required.
This is required.
This is required.
{{hotel.name}} - {{hotel.address.addressLocality}}, {{hotel.address.addressRegion}}

Flexible Dates:YesNo

Will you need meeting space?YesNo

Will you need food & beverage ?YesNo

Room Set Up?

{{type.name}}
Send Request
"), $templateCache.put("app/cards/eh-footer.html",''),$templateCache.put("app/cards/eh-hotel-hero-photos.html",'
{{::property.name}}

, ,

  ({{::property.aggregateRating.ratingCount}})  
• {{property.priceRange ? property.priceRange : \'\'}}
'),$templateCache.put("app/cards/eh-hotel-nav.html",""),$templateCache.put("app/cards/eh-resort-card.html",'
{{property.name}}

, ,
{{property.aggregateRating.ratingValue}}     ({{property.aggregateRating.ratingCount}})   • {{property.priceRange ? property.priceRange : \'~$$$\'}}

{{amenity.name}}

'),$templateCache.put("app/cards/eh-survey-dialog.html",'
Please take this brief survey to help us better serve you in the future.
Take the surveyNo Thanks
'), $templateCache.put("app/cards/eh-sweeps-rfp.html",'

Enter your info below for a chance to win!

This is required.
This is required.
This is required.
This is required.
This is required.
This is required.
Please SelectAfghanistanAlbaniaAlgeriaAmerican SamoaAndorraAngolaAnguillaAntarcticaAntigua and BarbudaArgentinaArmeniaArubaAustraliaAustriaAzerbaijanBahamasBahrainBangladeshBarbadosBelarusBelgiumBelizeBeninBermudaBhutanBoliviaBosnia and HerzegovinaBotswanaBouvet IslandBrazilBritish Indian Ocean TerritoryBrunei DarussalamBulgariaBurkina FasoBurundiCambodiaCameroonCanadaCape VerdeCayman IslandsCentral African RepublicChadChileChinaChristmas IslandCocos (Keeling) IslandsColombiaComorosCongoCook IslandsCosta RicaCroatia (Hrvatska)CubaCyprusCzech RepublicCzechoslovakia (former)DenmarkDjiboutiDominicaDominican RepublicEast TimorEcuadorEgyptEl SalvadorEquatorial GuineaEritreaEstoniaEthiopiaFalkland Islands (Malvinas)Faroe IslandsFijiFinlandFranceFrench GuianaFrench PolynesiaFrench Southern TerritoriesGabonGambiaGeorgiaGermanyGhanaGibraltarGreeceGreenlandGrenadaGuadeloupeGuamGuatemalaGuineaGuinea-BissauGuyanaHaitiHeard and McDonald IslandsHondurasHong KongHungaryIcelandIndiaIndonesiaIranIraqIrelandIsraelItalyJamaicaJapanJordanKazakhstanKenyaKiribatiKorea (North)Korea (South)KuwaitKyrgyzstanLaosLatviaLebanonLesothoLiberiaLibyaLiechtensteinLithuaniaLuxembourgMacauMacedoniaMadagascarMalawiMalaysiaMaldivesMaliMaltaMarshall IslandsMartiniqueMauritaniaMauritiusMayotteMexicoMicronesiaMoldovaMonacoMongoliaMontserratMoroccoMozambiqueMyanmarNamibiaNauruNepalNetherlandsNetherlands AntillesNeutral ZoneNew CaledoniaNew ZealandNicaraguaNigerNigeriaNiueNorfolk IslandNorthern Mariana IslandsNorwayOmanOtherPakistanPalauPanamaPapua New GuineaParaguayPeruPhilippinesPitcairnPolandPortugalPuerto RicoQatarReunionRomaniaRussian FederationRwandaSaint Kitts and NevisSaint LuciaSaint Vincent and the GrenadinSamoaSan MarinoSao Tome and PrincipeSaudi ArabiaSenegalSeychellesSierra LeoneSingaporeSlovak RepublicSloveniaSolomon IslandsSomaliaSouth AfricaSouth Georgia and South SandwiSpainSri LankaSt. HelenaSt. Pierre and MiquelonSudanSurinameSvalbard and Jan Mayen IslandsSwazilandSwedenSwitzerlandSyriaTaiwanTajikistanTanzaniaThailandTogoTokelauTongaTrinidad and TobagoTunisiaTurkeyTurkmenistanTurks and Caicos IslandsTuvaluUgandaUkraineUnited Arab EmirateUnited KingdomUnited StatesUruguayUS Minor Outlying IslandsUSSR (former)UzbekistanVanuatuVatican City State (Holy See)VenezuelaViet NamVirgin Islands (British)Virgin Islands (U.S.)Wallis and Futuna IslandsWestern SaharaYemenYugoslaviaZaireZambiaZimbabwe
This is required.

Travel Interests

{{type.name}}
Enter Sweepstakes
"),$templateCache.put("app/cards/emerald-booking-bar.html",'
{{checkinDate | date : \'d\'}}
{{checkinDate | date : \'MMM yyyy\'}}
{{checkinDate | date : \'EEEE\'}}
{{checkoutDate | date : \'d\'}}
{{checkoutDate | date : \'MMM yyyy\'}}
{{checkoutDate | date : \'EEEE\'}}
12345678
01234567
Discount CodeGroup AttendeePromo/CorporateTravel Agency Code
{{value}}
Check Availability
'),$templateCache.put("app/cards/forms.html",'

'),$templateCache.put("app/cards/galleries.html",''),$templateCache.put("app/cards/garnet-booking-bar.html",'
Reservations
{{checkinDate | date : \'d\'}}
{{checkinDate | date : \'MMM yyyy\'}}
{{checkinDate | date : \'EEEE\'}}
{{checkoutDate | date : \'d\'}}
{{checkoutDate | date : \'MMM yyyy\'}}
{{checkoutDate | date : \'EEEE\'}}
12345678
01234567
Check Rates
'), $templateCache.put("app/cards/garnet-footer.html",'
{{clientName}}
{{clientAddress}}
{{clientBrand}} © {{currentYear}}
'),$templateCache.put("app/cards/icon-square.html",'
{{attrs.label}}
'),$templateCache.put("app/cards/islandhopper-carousel.html",'
'),$templateCache.put("app/cards/item-carousel.html",''),$templateCache.put("app/cards/main-footer.html",''),$templateCache.put("app/cards/marker-info-window.html",''),$templateCache.put("app/cards/offers.html",'
{{::offer.price}}

{{::offer.title}}

Read More
View Details
{{::offer.cta_label || \'Check Rates\'}}
'),$templateCache.put("app/cards/opal-footer.html",'
{{clientName}}
{{clientAddress}}
{{clientBrand}} © {{currentYear}}
{{::subscribeHeading}} {{::clientName}} Specials
Looking for the latest vacation specials, news and updates from {{clientBrand}}? Enter your email below!
Best Western Rewards
Rewards Earned by {{clientName}}
'),$templateCache.put("app/cards/photo-gallery.html",'
{{image.alt || image.title || \'Gallery Photo\'}}
{{defaultLanguage == \'ja\' ? \'閉じる\' : \'Close\'}}
{{image.index + 1}}{{totalImages ? \'/\' + totalImages : \'\'}}
'),$templateCache.put("app/cards/pi-booking-bar.html",'
Hotel
{{resort.name}}
Check In
{{checkinDate | date : "EEE\',\' M/d/yy"}}
Check Out
{{checkoutDate | date : "EEE\',\' M/d/yy"}}
Check Rates
'),$templateCache.put("app/cards/pi-breadcrumb.html",''), $templateCache.put("app/cards/pi-footer.html",'
Phoenix Inn Suites Contrast Logo
Phoenix Inn Suites
Get deals and discounts in your inbox
from Phoenix Inn Suites:
Submit
Phoenix Inn Suites on the App StorePhoenix Inn Suites on the Play Store
'),$templateCache.put("app/cards/pi-hotel-nav.html",''),$templateCache.put("app/cards/pi-resort-card.html",'
{{property.name}}
{{property.address.streetAddress}}
{{property.address.addressLocality}}, {{property.address.addressRegion}} {{property.address.postalCode}} {{property.address.addressCountry}}
{{property.aggregateRating.ratingValue}}     ({{property.aggregateRating.ratingCount}})   • {{property.priceRange ? property.priceRange : \'~$$$\'}}

{{amenity.name}}

'),$templateCache.put("app/cards/placeholder.html",""),$templateCache.put("app/cards/pop-up.html",'
close
No, thanks.  (Don\'t show me this again)No, thanks.
'),$templateCache.put("app/cards/portal-booking-bar.html",'
Reservations: {{phoneReservations}}
Online Reservations
{{resort.name}}
{{checkinDate | date : \'d\'}}
{{checkinDate | date : \'MMM yyyy\'}}
{{checkinDate | date : \'EEEE\'}}
{{checkoutDate | date : \'d\'}}
{{checkoutDate | date : \'MMM yyyy\'}}
{{checkoutDate | date : \'EEEE\'}}
12345678
01234567
From
{{(!selectedResortDestination.priceCurrency || selectedResortDestination.priceCurrency == \'USD\') ? \'$\' : \'\'}}{{selectedResortDestination.leadRate | number:0}}
{{selectedResortDestination.priceCurrency || \'USD\'}}/Night
From {{(!selectedResortDestination.priceCurrency || selectedResortDestination.priceCurrency == \'USD\') ? \'$\' : \'\'}}{{selectedResortDestination.leadRate | number:0}} {{selectedResortDestination.priceCurrency || \'USD\'}}/Night
Check Rates
'), $templateCache.put("app/cards/raphael-footer.html",''),$templateCache.put("app/cards/regional-footer.html",'
{{clientName}}
{{clientAddress}}
{{clientBrand}} © {{currentYear}}
{{clientName}}
{{clientAddress}}
{{clientBrand}} © {{currentYear}}
{{clientName}} Offers
Looking for the latest vacation offers, news and updates from {{clientBrand}}? Click the link below!
'),$templateCache.put("app/cards/regional-property-header.html",''),$templateCache.put("app/cards/reviews.html",'
'),$templateCache.put("app/cards/rfp-contact.html",'
Name is required.
Email is required.
Message is required.
Send Message
'),$templateCache.put("app/cards/rfp-meetings.html",'

Flexible Dates:YesNo

Type of Event/Meeting

{{type.name}}
Send Request
"),$templateCache.put("app/cards/rfp-simple.html",'

Flexible Dates:YesNo

Send Request
'),$templateCache.put("app/cards/rfp-weddings.html",'

Flexible Dates:YesNo

Do you require Ceremony space? (Please select your desired choice)

{{type.name}}

Tell us a little bit about your love story and wedding! Also, any additional information you would like to learn more about.

Send Request
"),$templateCache.put("app/cards/rooms-category-type.html",''),$templateCache.put("app/cards/ruby-booking-bar.html",'
Reservations
{{checkinDate | date : \'d\'}}
{{checkinDate | date : \'MMM yyyy\'}}
{{checkinDate | date : \'EEEE\'}}
{{checkoutDate | date : \'d\'}}
{{checkoutDate | date : \'MMM yyyy\'}}
{{checkoutDate | date : \'EEEE\'}}
12345678
01234567
Check Rates
'), $templateCache.put("app/cards/ruby-footer.html",'
'),$templateCache.put("app/cards/sapphire-footer.html",'
{{clientName}} {{clientAddress}}
{{clientPhone | tel}} Reservations: {{clientReservationsPhone}} {{clientEmail}} {{clientURL}}
Looking for the latest vacation specials, news and updates from {{clientBrand}}? Enter your email below!
{{clientBrand}} © {{currentYear}}
'),$templateCache.put("app/cards/search-bar.html",'

{{title}}

'),$templateCache.put("app/cards/shell-footer.html",'
{{clientName}}
{{clientAddress}}
{{clientBrand}}
©{{::currentYear}} Extra Holidays. All Rights Reserved.
'),$templateCache.put("app/cards/shilo-booking-bar.html",'
Destination
All{{destination.name}}
Suites & Hotels
{{resort.name}}
Check In
{{checkinDate | date : "EEE\',\' M/d/yy"}}
Check Out
{{checkoutDate | date : "EEE\',\' M/d/yy"}}
Adults
12345
Children
01234
Rate
PreferredAAASeniorVeteransGovernmentBest Rate
Check Rates
'),$templateCache.put("app/cards/shilo-footer.html",'
Shilo Inns Hotels
Shilo Corporate | {{::clientAddress}} | Office: +1 503-641-6565
{{::clientBrand}}
All Rights Reserved © {{::currentYear}}
'), $templateCache.put("app/cards/shilo-hotel-nav.html",''),$templateCache.put("app/cards/shilo-resort-card.html",'
{{property.name}}
{{property.address.streetAddress}} {{property.address.addressLocality}}, {{property.address.addressRegion}} {{property.address.postalCode}} {{property.address.addressCountry}}
{{property.aggregateRating.ratingValue}}     ({{property.aggregateRating.ratingCount}})   • {{property.priceRange ? property.priceRange : \'~$$$\'}}

{{amenity.name}}

'),$templateCache.put("app/cards/si-resort-card.html",'

{{property.address.streetAddress}}
{{property.address.addressLocality}}, {{property.address.addressRegion}} {{property.address.postalCode}} {{property.address.addressCountry}}
{{property.aggregateRating.ratingValue}}     ({{property.aggregateRating.ratingCount || property.aggregateRating.reviewCount}})   •  {{property.priceRange ? property.priceRange : \'~$$$\'}}
{{property.telephone | tel}}

{{amenity.name}}

Check Rates
'),$templateCache.put("app/cards/sitemap-links.html",''),$templateCache.put("app/cards/sitewide-notice.html",'
'),$templateCache.put("app/cards/social-links.html",''),$templateCache.put("app/cards/social-share.html",''), $templateCache.put("app/cards/translate-popup.html",'

Language Select

close
English - English
English (UK) - English (UK)
Spanish - Español
Chinese (Simplified) - 简体中文
Chinese (Traditional) - 繁體中文
German - Deutsch

Afrikaans
Albanian
Amharic
Arabic
Armenian
Azerbaijani
Basque
Belarusian
Bengali
Bosnian
Bulgarian
Catalan
Cebuano
Chichewa
Chinese (Simplified)
Chinese (Traditional)
Corsican
Croatian
Czech
Danish
Dutch
English
English (UK)
Esperanto
Estonian
Filipino
Finnish
French
Frisian
Galician
Georgian
German
Greek
Gujarati
Haitian Creole
Hausa
Hawaiian
Hebrew
Hindi
Hmong
Hungarian
Icelandic
Igbo
Indonesian
Irish
Italian
Japanese
Javanese
Kannada
Kazakh
Khmer
Kinyarwanda
Korean
Kurdish (Kurmanji)
Kyrgyz
Lao
Latin
Latvian
Lithuanian
Luxembourgish
Macedonian
Malagasy
Malay
Malayalam
Maltese
Maori
Marathi
Mongolian
Myanmar (Burmese)
Nepali
Norwegian
Odia (Oriya)
Pashto
Persian
Polish
Portuguese
Punjabi
Romanian
Russian
Samoan
Scots Gaelic
Serbian
Sesotho
Shona
Sindhi
Sinhala
Slovak
Slovenian
Somali
Sundanese
Swahili
Swedish
Tajik
Tamil
Tatar
Telugu
Thai
Turkish
Turkmen
Ukrainian
Urdu
Uyghur
Uzbek
Vietnamese
Welsh
Xhosa
Yiddish
Yoruba
Zulu
No, thanks.
'),$templateCache.put("app/cards/trustyou-property-review.html",'

"{{::reviewData.summary.text}}"

{{::distribution.stars}}
{{::distribution.reviews_count}}

{{::badge.text}} – {{::badge.subtext}}

Good to Know

 {{item.text}}

Traveler Types

powered by TrustYou
'), $templateCache.put("app/cards/vh-booking-bar.html",'
Island
All{{destination.name}}
Resort
info_outline
Please enter or select a resort or destination to search
Check In
{{checkinDate | date : "MMM\' \'d"}}
Check Out
{{checkoutDate | date : "MMM\' \'d"}}
Promo
From
{{(!selectedResortDestination.priceCurrency || selectedResortDestination.priceCurrency == \'USD\') ? \'$\' : \'\'}}{{selectedResortDestination.leadRate | number:0}}
{{selectedResortDestination.priceCurrency || \'USD\'}}/Night
From {{(!selectedResortDestination.priceCurrency || selectedResortDestination.priceCurrency == \'USD\') ? \'$\' : \'\'}}{{selectedResortDestination.leadRate | number:0}} {{selectedResortDestination.priceCurrency || \'USD\'}}/Night
Check Rates
'),$templateCache.put("app/cards/vh-breadcrumb.html",''),$templateCache.put("app/cards/vh-footer.html",'
Vacation Hawaii by Extra Holidays
Seller of Travel
Hawaii TAT Broker ID #: TA-075-433-7792-01
©{{::currentYear}} Extra Holidays. All Rights Reserved.
Extra Holidays Inverse Logo
'),$templateCache.put("app/cards/write-review-dialog.html",'

Write a Review

Rating *
CancelSubmit Review
')}]),angular.module("brewervacations-app").run(["$templateCache",function($templateCache){"use strict";$templateCache.put("app/regional/shell/404/view/404.tpl.html",'

Whoops, that page could not be found. Please try one of the links below:

Explore Our Resorts

Wyndham Resorts in {{regionName}}
{{hotel.name}}
{{hotel.name}}
{{hotel.address.streetAddress}} {{hotel.address.addressLocality}}, {{hotel.address.addressRegion}} {{::hotel.address.postalCode}} {{hotel.address.addressCountry}}
{{hotel.email}} {{hotel.telephone | tel}}
'),$templateCache.put("app/regional/shell/amenities/view/amenities.tpl.html",'

{{::vm.property.name}} Amenities

Resort Amenities

{{::amenity.name}}

Pets Allowed Service Animals Welcome

100% Smoke-Free Rooms Smoking Rooms Available

Room Amenities

Room Amenity Icon {{::amenity.name}}

'),$templateCache.put("app/regional/shell/cards/view/breadcrumb.tpl.html",''),$templateCache.put("app/regional/shell/cards/view/campaign-footer.tpl.html",''), $templateCache.put("app/regional/shell/cards/view/category-offer-card.tpl.html",'
Click to Explore Offer{{offer.title || offer.hotelName}}
{{offer.title || offer.hotelName}}
{{offer.title}}
View Photos{{offer.price}}
View Photos
Offer Details{{offer.showOfferTerms ? \'Hide Terms\' : \'View Terms\'}}
Enter Code Above{{offer.cta_label || \'Find Dates\'}}
'),$templateCache.put("app/regional/shell/cards/view/default-rfp.tpl.html",'

Plan Your Event in Extraordinary Destinations

Submit Request for Proposal

This is required.
This is required.
This is required.
This is required.
{{hotel.name}} - {{hotel.address.addressLocality}}, {{hotel.address.addressRegion}}

Flexible Dates:YesNo

Will you need meeting space?YesNo

Will you need food & beverage ?YesNo

Room Set Up?

{{type.name}}
Send Request
"),$templateCache.put("app/regional/shell/cards/view/featured-destinations-carousel.tpl.html",''),$templateCache.put("app/regional/shell/cards/view/hotel-banner-notice.tpl.html",''),$templateCache.put("app/regional/shell/cards/view/hotel-hero-photos.tpl.html",'
{{::property.name}}

'),$templateCache.put("app/regional/shell/cards/view/hotel-nav.tpl.html",""),$templateCache.put("app/regional/shell/cards/view/laasie-registration.tpl.html",'
Join Insider Extras Today!
Sign up. Book direct. Get rewards. Earn every time.
Yes, I am a U.S. resident and 21 years or older. I agree to receive emails from Extra Holidays and accept your Terms. I acknowledge the Privacy Notice and Notice of Financial Incentive.Join Now
Already have an account? Sign In
'),$templateCache.put("app/regional/shell/cards/view/map-resort-card.tpl.html",''), $templateCache.put("app/regional/shell/cards/view/offer-resort-card.tpl.html",'
{{property.name}}
{{property.address.streetAddress}} {{property.address.addressLocality}}, {{property.address.addressRegion}} {{property.address.postalCode}} {{property.address.addressCountry}}
'),$templateCache.put("app/regional/shell/cards/view/property-notice.tpl.html",''),$templateCache.put("app/regional/shell/cards/view/resort-card.tpl.html",''),$templateCache.put("app/regional/shell/cards/view/shell-booking-bar.tpl.html",'
Resort or Destination
not_listed_location{{item.name | trustAsHTML}} | {{item.name != item.cityName ? item.cityName : \'\'}}{{item.stateName ? \', \' + item.stateName : \'\'}} Whoops, no locations found for that search.
info_outline
Please enter or select a resort or destination to search
Check In
{{checkinDate | date : "EEE\',\' M/d/yy"}}
Check Out
{{checkoutDate | date : "EEE\',\' M/d/yy"}}
Adults
12345678
Children
01234567
Promo Code
From
{{(!selectedResortDestination.priceCurrency || ([\'USD\',\'CAD\',\'AUD\',\'NZD\'].indexOf(selectedResortDestination.priceCurrency) > -1)) ? \'$\' : \'\'}}{{[\'JPY\',\'CNY\'].indexOf(selectedResortDestination.priceCurrency) > -1 ? \'¥\' : \'\'}}{{[\'IDR\'].indexOf(selectedResortDestination.priceCurrency) > -1 ? \'Rp\' : \'\'}}{{selectedResortDestination.leadRate | number:0}}
{{selectedResortDestination.priceCurrency || \'USD\'}}/{{[\'116083\'].indexOf(selectedResortDestination.hotelCode) > -1 ? \'Person\' : \'Night\'}}
From {{(!selectedResortDestination.priceCurrency || ([\'USD\',\'CAD\',\'AUD\',\'NZD\'].indexOf(selectedResortDestination.priceCurrency) > -1)) ? \'$\' : \'\'}}{{[\'JPY\',\'CNY\'].indexOf(selectedResortDestination.priceCurrency) > -1 ? \'¥\' : \'\'}}{{[\'IDR\'].indexOf(selectedResortDestination.priceCurrency) > -1 ? \'Rp\' : \'\'}}{{selectedResortDestination.leadRate | number:0}} {{selectedResortDestination.priceCurrency || \'USD\'}}/{{[\'116083\'].indexOf(selectedResortDestination.hotelCode) > -1 ? \'Person\' : \'Night\'}}
Check Rates
'),$templateCache.put("app/regional/shell/cards/view/shell-breadcrumb.tpl.html",''),$templateCache.put("app/regional/shell/cards/view/shell-date-picker.tpl.html",'
Book This Adventure:
Check In/Out
{{checkinDate | date : "EEE\',\' M/d/yy"}} - {{checkoutDate | date : "EEE\',\' M/d/yy"}}
Check Availability
'),$templateCache.put("app/regional/shell/cards/view/shell-expanded-features-list.tpl.html",'

Select Features

{{amenity}} {{featureSetCounts[amenity]}}
'), $templateCache.put("app/regional/shell/cards/view/shell-footer-BAK-5-10-2024.tpl.html",'
'),$templateCache.put("app/regional/shell/cards/view/shell-footer.tpl.html",''),$templateCache.put("app/regional/shell/cards/view/shell-sitewide-notice.tpl.html",''),$templateCache.put("app/regional/shell/cards/view/sitewide-notice.tpl.html",'
'),$templateCache.put("app/regional/shell/categories/view/categories.tpl.html",'

Vacation Experiences from Wyndham® Extra Holidays {{::vm.currentCategory.title}} {{::vm.h1 | trustAsHTML}}

{{::vm.currentCategory.description}}
All Destinations{{destination.name}}—or— All Resorts{{hotel.name}} - {{hotel.cityName}}, {{hotel.stateName}}
Choose a resort for: {{::categoryNav.title}} View All See Offer Details below.
{{::category.title}}
{{::category.title}}

{{::category.title}}

{{::category.excerpt}} Read More...

'),$templateCache.put("app/regional/shell/contact/view/contact.tpl.html",'

Contact

{{parentDestination.name}}

{{hotel.name}}
{{::hotel.name | trustAsHTML}}
{{::hotel.address.streetAddress}} {{::hotel.address.addressLocality}}, {{::hotel.address.postalCode}} {{hotel.address.addressCountry}}
'), $templateCache.put("app/regional/shell/destinations/view/destination.tpl.html",'

Explore Resorts in {{vm.destination.name}} {{::vm.destination.h2}}

Explore Resorts in {{vm.destination.name}} {{::vm.destination.h2}}

Check back soon for new resorts coming to {{vm.destination.name}} Destinations and Resorts {{vm.h1}}

{{vm.h2}}

{{child.name}}

Discover the beautiful {{property.name}}, from Extra Holidays.
Explore {{::vm.destination.name}} resorts from Extra Holidays, including  and {{property.name}},.
Explore {{::vm.destination.name}} resorts from Extra Holidays, including  and {{child.name}}, vacation destinations.
Filter Resorts
Viewing {{vm.globalSearch ? \'All\' : vm.destination.name}} Resorts
Show {{!vm.globalSearch ? \'All\' : vm.destination.name}} Resorts
Find your Stay
{{vm.destination.name}}
All Destinations{{child.name}}
Trip Type
{{type}}
Whoops, no resorts found for that search.
Please broaden your terms and try again, or explore all resorts.
{{vm.pagedResults.length}} Resort{{vm.pagedResults.length > 1 ? \'s\' : \'\'}} Found
Load More Results
'), $templateCache.put("app/regional/shell/destinations/view/destinations.tpl.html",''),$templateCache.put("app/regional/shell/dining/view/dining.tpl.html",'

{{vm.h2}}

Dining Experiences {{::vm.h1 | trustAsHTML}}

Dining

Hours

{{period.openDay}}{{vm.formatHours(period.openTime)}} - {{vm.formatHours(period.closeTime)}}
'),$templateCache.put("app/regional/shell/events/view/event.tpl.html",'
Experience fun nearby events!
Experience fun nearby events!
{{vm.event.name}} {{vm.event.name}}
{{vm.event.category | properCaps}}

{{vm.event.name}}

{{vm.event.category | properCaps}}

{{vm.event.start_time | date : \'MMM d, y h:mm a\'}} – {{vm.event.end_time | date : \'MMM d, y h:mm a\'}}
View Event
'), $templateCache.put("app/regional/shell/events/view/events.tpl.html",'

Experience fun nearby events!

Experience fun nearby events!

Events Near {{vm.property.name | trustAsHTML}}

{{hotel.name}}All Categories{{category | properCaps}}
All Categories{{category | properCaps}}
Sorry, no events were found for your search. Please broaden your query.
Please check again soon for the latest events from !
{{event.start_time | date : \'MMM d, y h:mm a\'}} – {{event.end_time | date : \'MMM d, y h:mm a\'}}
{{event.name}}
{{event.place.location.city}}
Read More
'), $templateCache.put("app/regional/shell/home/view/home.tpl.html",'

{{::vm.h1 | trustAsHTML}}

Shell Vacations Hospitality

Shell
Locations

See All Locations

See All Locations
See All Locations
See All Posts
{{item.title}}
{{item.bodyContent}}
Read More
See All Posts
'), $templateCache.put("app/regional/shell/hotels/view/hotel.tpl.html",'

Resort Overview of {{vm.property.name | trustAsHTML}}

View Resort Photos{{::image.title}}
View Resort Photos{{::image.title}}
View Resort Photos

About

{{::noticeTitle}} {{notices.expandNotice ? \'\' : \'\' }}

{{::title}} {{hints.expandNotice ? \'\' : \'\' }}

Key Amenities

Check-In
{{vm.property.checkinTime || \'4:00 PM\' | toTime}}
Check-Out
{{vm.property.checkoutTime || \'11:00 AM\' | toTime }}
Check Rates

Resort Location

'),$templateCache.put("app/regional/shell/hotels/view/hotels.tpl.html",'

Discover
Shell Vacations Hospitality

{{regionName | trustAsHTML}}

Load More

Resort Locations

'), $templateCache.put("app/regional/shell/landingpage/view/es.tpl.html",'

'),$templateCache.put("app/regional/shell/landingpage/view/landingpage.tpl.html",'
{{vm.headerImageAlt || vm.h2 || vm.h1 || \'Featured Image\'}} {{vm.headerImageAlt || vm.h2 || vm.h1 || \'Featured Image\'}}

'),$templateCache.put("app/regional/shell/landingpage/view/new.tpl.html",'

'),$templateCache.put("app/regional/shell/landingpage/view/okta-login.tpl.html",''),$templateCache.put("app/regional/shell/meetings/view/meetings.tpl.html","

Host your next meeting or event with us!

Groups & Meetings

{{::vm.h2 | trustAsHTML}}

"),$templateCache.put("app/regional/shell/nearby/view/nearby-listing.tpl.html",'
Item Thumb
{{::vm.item.name}} $
{{vm.item.types[0] | properCaps}} neaby-card-icon {{vm.item.types[1] | properCaps}}

{{::vm.item.formatted_address}}

{{::vm.item.rating}}   ({{::vm.item.user_ratings_total}})

{{::vm.item.formatted_phone_number}}

{{::vm.item.website}}

{{date | date:\'EEEE\'}}

{{::weekday}}

Recent Reviews

{{ ::review.author_name }}

{{ ::review.text }}
{{ ::review.text }} More...
{{vm.showMoreReviews ? "Show Less" : \'Show More Reviews\'}}
Local Resorts
'), $templateCache.put("app/regional/shell/nearby/view/nearby.tpl.html",'

Explore Nearby Things to Do

Explore Nearby Things to Do

Things to Do near {{vm.property.name | trustAsHTML}}

Please check again soon for fun attractions and things to do near {{vm.property.name}}!

{{::category.name}}

{{::item.name}} 

{{::item.streetAddress}}, {{::item.addressLocality}}, {{::item.addressRegion}} {{::item.postalCode}}  
Phone: {{::item.telephone | tel}} 
{{vm.getDistanceFromHotel(item) | number : 1}} mi. away  
'),$templateCache.put("app/regional/shell/offers/view/eh-travelclick-widget.tpl.html",'

{{currentCategory.title || currentCategory.name}}

{{::currentCategory.subtitle}}

All States{{state.name}}All Destinations{{destination.name}}All Resorts{{hotel.name}} - {{hotel.cityState}}
ListGrid
Select a state to start searching for resorts.
The dates you selected are not available, please select alternative dates or check the booking engine.
Tip #1 – For a full calendar of available dates, use the desktop version of this page.
Tip #2 – Remember that the Family Rental Rate may be an option at 30% off.
One moment while we check resort availability...
Click to Book {{vm.isProperty ? \'Offer\' : \'Resort\'}}
Find Dates
{{!offer.viewRooms ? \'View\' : \'Hide\'}} Rooms
From ${{rate.rate | number:0}}/Night
{{room.roomTypeName}}
{{feature.type}}: {{feature.quantity}} {{feature.amenityName}}{{feature.amenityName != \'People\' && feature.quantity > 1 ? \'s\' : \'\'}}  
'),$templateCache.put("app/regional/shell/offers/view/offer-category.tpl.html",'
{{vm.headerImageAlt || vm.h2 || vm.h1 || \'Featured Image\'}} {{vm.headerImageAlt || vm.h2 || vm.h1 || \'Featured Image\'}}

All States{{state.name}}All Destinations{{destination.name}} All Resorts{{hotel.name}} - {{hotel.cityState}}
Choose a resort for: {{::categoryNav.menuName}} View All View All See Offer Details below.

Unlock your special offer!

Enter your exclusive single-use code to redeem

Code applied to all offers below
ListGrid

Or call 844-903-2850 to book.

'), $templateCache.put("app/regional/shell/offers/view/offer.tpl.html",'
{{::vm.offer.title}} {{::vm.offer.title}}

{{::vm.offer.title}} {{::vm.offer.title}} {{::vm.h1 | trustAsHTML}}

{{::vm.offer.price}}

{{::vm.offer.hotelCityStateText}} |

Unlock your special offer!

Enter your exclusive single-use code to redeem

Code applied
Enter Code Above{{vm.offer.cta_label || \'Find Dates\'}}
'),$templateCache.put("app/regional/shell/offers/view/offers.tpl.html",'

Deals

Deals {{vm.h1}}

Deals from {{vm.property.name | trustAsHTML}}

{{category.title}}

{{category.showOfferTerms ? \'Hide Terms\' : \'View Terms\'}}
View {{category.totalOffers > 1 ? \'Offers\' : \'Offer\'}}
Sorry, no offers were found for your search. Please broaden your query.
Please check again soon for the latest offers and seasonal specials from {{vm.property.name | trustAsHTML}}!
Click to Explore {{vm.isProperty ? \'Offer\' : \'Resort\'}}{{offer.title || offer.hotelName}} {{offer.title || offer.hotelName}}

{{offer.title}}

{{offer.price}}

{{offer.showOfferTerms ? \'Hide Terms\' : \'View Terms\'}}
{{offer.cta_label || \'Book Now\'}}
Load More Offers
'),$templateCache.put("app/regional/shell/photos/view/photos.tpl.html",'

Explore Our Resort Photo Galleries

Photos {{vm.property.name | trustAsHTML}} Photo Gallery

All Destinations{{destination.name}}All Resorts{{hotel.name}}
 View the Virtual Tour
All Images
{{image.alt || image.title || (\'Gallery photo \' + ($index + 1) + \' from \' + vm.property.name)}}
{{image.alt || image.title || (\'Gallery photo \' + ($index + 1) + \' from \' + vm.property.name)}}
'),$templateCache.put("app/regional/shell/reviews/view/reviews.tpl.html",'
Read Recent {{::vm.property.LocationName}} Reviews
{{ ::review.user[0] }}

{{ ::review.user }} - {{ ::review.date }}

{{ ::review.comment }}
{{ ::review.comment }} More...
{{vm.showMoreReviews ? "Show Less" : \'Show More Reviews\'}}
Call
'), $templateCache.put("app/regional/shell/rooms/view/room.tpl.html",'

{{::vm.itemOffered.name}} from {{vm.property.name | trustAsHTML}}

Read More

Premium Amenities

{{::amenity.name}}{{::amenity.name}}

Resort Suite Amenities

{{::amenity.name}}{{::amenity.name}}

Premium Amenities

{{::amenity.name}}{{::amenity.name}}

View All Rooms
View Room Photos{{::vm.itemOffered.name}}
Click to View Photos

Capacity: {{::vm.itemOffered.occupancy.maxValue}}  

Bed Details

{{::bed.name}} Bed Icon {{::bed.numberOfBeds}} {{::bed.name}}{{bed.numberOfBeds > 1 ? \'s\' : \'\'}}

Check Rates
{{::vm.itemOffered.image.title}}
View Floor Plan
'),$templateCache.put("app/regional/shell/rooms/view/rooms.tpl.html",'
'),$templateCache.put("app/regional/shell/sitemap/view/sitemap.tpl.html",'

{{::clientName}} Sitemap

'),$templateCache.put("app/regional/shell/stories/view/stories.tpl.html",'

Stories

Stories from {{::vm.siteName}} {{::vm.h1 | trustAsHTML}} {{::vm.currentCategory}} | Stories from {{::vm.siteName}}

{{::vm.h2 | trustAsHTML}}

{{story.title}}
{{story.title}}
{{story.bodyContent}}
Load More
'),$templateCache.put("app/regional/shell/stories/view/story.tpl.html",'
{{::vm.story.title}}

{{::vm.story.title}}

{{::vm.story.subtitle}}

')}]);