YUI.add("pjax-base-patched",function(e,t){function a(){}var i=e.config.win,n=e.ClassNameManager.getClassName("pjax");a.prototype={initializer:function(){this.publish("navigate",{defaultFn:this._defNavigateFn}),this.get("html5")&&this._pjaxBindUI()},destructor:function(){this._pjaxEvents&&this._pjaxEvents.detach()},navigate:function(t,a){return t=this._resolveURL(t),!!this._navigate(t,a)||(this._hasSameOrigin(t)?!!this.get("allowFallThrough")&&(i.location=t,!0):(e.error("Security error: The new URL must be of the same origin as the current URL."),!1))},_isLinkSameOrigin:function(t){var a,i=e.getLocation(),n=i.protocol,r=i.hostname,s=parseInt(i.port,10)||null;return t.get("protocol")===n&&t.get("hostname")===r&&(a=parseInt(t.get("port"),10)||null,"http:"===n?(s||(s=80),a||(a=80)):"https:"===n&&(s||(s=443),a||(a=443)),a===s)},_navigate:function(t,a){if(t=this._upgradeURL(t),!this.hasRoute(t))return!1;a=e.merge(a,{url:t});var n,r,s=this._getURL();if(r=t.replace(/(#.*)$/,function(e,t,a){return n=t,e.substring(a)}),n&&r===s.replace(/#.*$/,"")){if(!this.get("navigateOnHash"))return!1;a.hash=n}return"replace"in a||(a.replace=t===s),this.get("html5")||a.force?this.fire("navigate",a):i&&(a.replace?i.location.replace(t):i.location=t),!0},_pjaxBindUI:function(){this._pjaxEvents||(this._pjaxEvents=e.one("body").delegate("click",this._onLinkClick,this.get("linkSelector"),this))},_defNavigateFn:function(e){this[e.replace?"replace":"save"](e.url),i&&this.get("scrollToTop")&&setTimeout(function(){i.scroll(0,0)},1)},_onLinkClick:function(e){var t,a;1!==e.button||e.ctrlKey||e.metaKey||"A"===(t=e.currentTarget).get("tagName").toUpperCase()&&this._isLinkSameOrigin(t)&&(a=t.get("href"))&&this._navigate(a,{originEvent:e})&&e.preventDefault()}},a.ATTRS={linkSelector:{value:"a."+n,writeOnce:"initOnly"},navigateOnHash:{value:!1},scrollToTop:{value:!0},allowFallThrough:{value:!0}},e.PjaxBase=a},"@VERSION@",{requires:["classnamemanager","node-event-delegate","router"],condition:{name:"pjax-base-patched",trigger:"pjax-base",when:"instead"}});YUI.add("view",function(e,t){function n(){n.superclass.constructor.apply(this,arguments)}e.View=e.extend(n,e.Base,{containerTemplate:"<div/>",events:{},template:"",_allowAdHocAttrs:!0,initializer:function(t){t||(t={}),t.containerTemplate&&(this.containerTemplate=t.containerTemplate),t.template&&(this.template=t.template),this.events=t.events?e.merge(this.events,t.events):this.events,this.after("containerChange",this._afterContainerChange)},destroy:function(e){return e&&(e.remove||e["delete"])&&this.onceAfter("destroy",function(){this._destroyContainer()}),n.superclass.destroy.call(this)},destructor:function(){this.detachEvents(),delete this._container},attachEvents:function(t){var n=this.get("container"),r=e.Object.owns,i,s,o,u;this.detachEvents(),t||(t=this.events);for(u in t){if(!r(t,u))continue;s=t[u];for(o in s){if(!r(s,o))continue;i=s[o],typeof i=="string"&&(i=this[i]);if(!i)continue;this._attachedViewEvents.push(n.delegate(o,i,u,this))}}return this},create:function(t){return t?e.one(t):e.Node.create(this.containerTemplate)},detachEvents:function(){return e.Array.each(this._attachedViewEvents,function(e){e&&e.detach()}),this._attachedViewEvents=[],this},remove:function(){var e=this.get("container");return e&&e.remove(),this},render:function(){return this},_destroyContainer:function(){var e=this.get("container");e&&e.remove(!0)},_getContainer:function(e){return this._container||(e?(this._container=e,this.attachEvents()):(e=this._container=this.create(),this._set("container",e))),e},_afterContainerChange:function(){this.attachEvents(this.events)}},{NAME:"view",ATTRS:{container:{getter:"_getContainer",setter:e.one,writeOnce:!0}},_NON_ATTRS_CFG:["containerTemplate","events","template"]})},"3.16.0",{requires:["base-build","node-event-delegate"]});
YUI.add("app-base",function(e,t){var n=e.Lang,r=e.Object,i=e.PjaxBase,s=e.Router,o=e.View,u=e.ClassNameManager.getClassName,a=e.config.win,f;f=e.Base.create("app",e.Base,[o,s,i],{views:{},initializer:function(t){function i(t,r){n[r]=e.merge(n[r],t)}t||(t={});var n={};r.each(this.views,i),r.each(t.views,i),this.views=n,this._viewInfoMap={},this.after("activeViewChange",e.bind("_afterActiveViewChange",this)),this.get("serverRouting")||this._pjaxBindUI()},createView:function(t,i){var s=this.getViewInfo(t),u=s&&s.type||o,a,f;return a=n.isString(u)?r.getValue(e,u.split(".")):u,f=new a(i),this._viewInfoMap[e.stamp(f,!0)]=s,f},getViewInfo:function(t){return n.isString(t)?this.views[t]:t&&this._viewInfoMap[e.stamp(t,!0)]},render:function(){var t=e.App.CLASS_NAMES,n=this.get("container"),r=this.get("viewContainer"),i=this.get("activeView"),s=i&&i.get("container"),o=n.compareTo(r);return n.addClass(t.app),r.addClass(t.views),i&&!r.contains(s)&&r.appendChild(s),!n.contains(r)&&!o&&n.appendChild(r),this},showView:function(t,r,i,s){var o,u;return i||(i={}),s?i=e.merge(i,{callback:s}):n.isFunction(i)&&(i={callback:i}),n.isString(t)&&(o=this.getViewInfo(t),o&&o.preserve&&o.instance?(t=o.instance,this._viewInfoMap[e.stamp(t,!0)]=o):(t=this.createView(t,r),u=!0)),i.update&&!u&&t.setAttrs(r),"render"in i?i.render&&t.render():u&&t.render(),this._set("activeView",t,{options:i})},_attachView:function(e,t){if(!e)return;var n=this.getViewInfo(e),r=this.get("viewContainer");e.addTarget(this),n&&(n.instance=e),r[t?"prepend":"append"](e.get("container"))},_destroyContainer:function(){var t=e.App.CLASS_NAMES,n=this.get("container"),r=this.get("viewContainer"),i=n.compareTo(r);if(e.one("body").compareTo(n)){this.detachEvents(),n.removeClass(t.app),i?n.removeClass(t.views):r.remove(!0);return}r.remove(!0),i||n.remove(!0)},_detachView:function(t){if(!t)return;var n=this.getViewInfo(t)||{};n.preserve?t.remove():(t.destroy({remove:!0}),delete this._viewInfoMap[e.stamp(t,!0)],t===n.instance&&delete n.instance),t.removeTarget(this)},_getRequest:function(){var e=s.prototype._getRequest.apply(this,arguments);return e.app=this,e},_getViewContainer:function(e){return!e&&!this._viewContainer&&(e=this._viewContainer=this.create(),this._set("viewContainer",e)),e},_initHtml5:function(){return this.get("serverRouting")===!1?!1:s.html5},_isChildView:function(e,t){var n=this.getViewInfo(e),r=this.getViewInfo(t);return n&&r?this.getViewInfo(n.parent)===r:!1},_isParentView:function(e,t){var n=this.getViewInfo(e),r=this.getViewInfo(t);return n&&r?this.getViewInfo(r.parent)===n:!1},_navigate:function(t,n){return this.get("serverRouting")||(n=e.merge({force:!0},n)),i.prototype._navigate.call(this,t,n)},_save:function(t,n){var r;return this.get("serverRouting")&&!this.get("html5")?this._hasSameOrigin(t)?(a&&(r=this._joinURL(t||""),n?a.location.replace(r):a.location=r),this):(e.error("Security error: The new URL must be of the same origin as the current URL."),this):s.prototype._save.apply(this,arguments)},_uiSetActiveView:function(e,t,n){n||(n={});var r=n.callback,i=this._isChildView(e,t),s=!i&&this._isParentView(e,t),o=!!n.prepend||s;if(e===t)return r&&r.call(this,e);this._attachView(e,o),this._detachView(t),r&&r.call(this,e)},_afterActiveViewChange:function(e){this._uiSetActiveView(e.newVal,e.prevVal,e.options)}},{ATTRS:{activeView:{value:null,readOnly:!0},container:{valueFn:function(){return e.one("body")}},html5:{valueFn:"_initHtml5"},linkSelector:{value:"a"},serverRouting:{valueFn:function(){return e.App.serverRouting},writeOnce:"initOnly"},viewContainer:{getter:"_getViewContainer",setter:e.one,writeOnce:!0}},_NON_ATTRS_CFG:["views"]}),e.namespace("App").Base=f,e.App=e.mix(e.Base.create("app",f,[]),e.App,!0),e.App.CLASS_NAMES={app:u("app"),views:u("app","views")}},"3.16.0",{requires:["classnamemanager","pjax-base","router","view"]});
YUI.add("querystring-stringify-simple",function(e,t){var n=e.namespace("QueryString"),r=encodeURIComponent;n.stringify=function(t,n){var i=[],s=n&&n.arrayKey?!0:!1,o,u,a;for(o in t)if(t.hasOwnProperty(o))if(e.Lang.isArray(t[o]))for(u=0,a=t[o].length;u<a;u++)i.push(r(s?o+"[]":o)+"="+r(t[o][u]));else i.push(r(o)+"="+r(t[o]));return i.join("&")}},"3.16.0",{requires:["yui-base"]});
YUI.add("io-base",function(e,t){function o(t){var n=this;n._uid="io:"+s++,n._init(t),e.io._map[n._uid]=n}var n=["start","complete","end","success","failure","progress"],r=["status","statusText","responseText","responseXML"],i=e.config.win,s=0;o.prototype={_id:0,_headers:{"X-Requested-With":"XMLHttpRequest"},_timeout:{},_init:function(t){var r=this,i,s;r.cfg=t||{},e.augment(r,e.EventTarget);for(i=0,s=n.length;i<s;++i)r.publish("io:"+n[i],e.merge({broadcast:1},t)),r.publish("io-trn:"+n[i],t)},_create:function(t,n){var r=this,s={id:e.Lang.isNumber(n)?n:r._id++,uid:r._uid},o=t.xdr?t.xdr.use:null,u=t.form&&t.form.upload?"iframe":null,a;return o==="native"&&(o=e.UA.ie&&!l?"xdr":null,r.setHeader("X-Requested-With")),a=o||u,s=a?e.merge(e.IO.customTransport(a),s):e.merge(e.IO.defaultTransport(),s),s.notify&&(t.notify=function(e,t,n){r.notify(e,t,n)}),a||i&&i.FormData&&t.data instanceof i.FormData&&(s.c.upload.onprogress=function(e){r.progress(s,e,t)},s.c.onload=function(e){r.load(s,e,t)},s.c.onerror=function(e){r.error(s,e,t)},s.upload=!0),s},_destroy:function(t){i&&!t.notify&&!t.xdr&&(u&&!t.upload?t.c.onreadystatechange=null:t.upload?(t.c.upload.onprogress=null,t.c.onload=null,t.c.onerror=null):e.UA.ie&&!t.e&&t.c.abort()),t=t.c=null},_evt:function(t,r,i){var s=this,o,u=i.arguments,a=s.cfg.emitFacade,f="io:"+t,l="io-trn:"+t;this.detach(l),r.e&&(r.c={status:0,statusText:r.e}),o=[a?{id:r.id,data:r.c,cfg:i,arguments:u}:r.id],a||(t===n[0]||t===n[2]?u&&o.push(u):(r.evt?o.push(r.evt):o.push(r.c),u&&o.push(u))),o.unshift(f),s.fire.apply(s,o),i.on&&(o[0]=l,s.once(l,i.on[t],i.context||e),s.fire.apply(s,o))},start:function(e,t){this._evt(n[0],e,t)},complete:function(e,t){this._evt(n[1],e,t)},end:function(e,t){this._evt(n[2],e,t),this._destroy(e)},success:function(e,t){this._evt(n[3],e,t),this.end(e,t)},failure:function(e,t){this._evt(n[4],e,t),this.end(e,t)},progress:function(e,t,r){e.evt=t,this._evt(n[5],e,r)},load:function(e,t,r){e.evt=t.target,this._evt(n[1],e,r)},error:function(e,t,r){e.evt=t,this._evt(n[4],e,r)},_retry:function(e,t,n){return this._destroy(e),n.xdr.use="flash",this.send(t,n,e.id)},_concat:function(e,t){return e+=(e.indexOf("?")===-1?"?":"&")+t,e},setHeader:function(e,t){t?this._headers[e]=t:delete this._headers[e]},_setHeaders:function(t,n){n=e.merge(this._headers,n),e.Object.each(n,function(e,r){e!=="disable"&&t.setRequestHeader(r,n[r])})},_startTimeout:function(e,t){var n=this;n._timeout[e.id]=setTimeout(function(){n._abort(e,"timeout")},t)},_clearTimeout:function(e){clearTimeout(this._timeout[e]),delete this._timeout[e]},_result:function(e,t){var n;try{n=e.c.status}catch(r){n=0}n>=200&&n<300||n===304||n===1223?this.success(e,t):this.failure(e,t)},_rS:function(e,t){var n=this;e.c.readyState===4&&(t.timeout&&n._clearTimeout(e.id),setTimeout(function(){n.complete(e,t),n._result(e,t)},0))},_abort:function(e,t){e&&e.c&&(e.e=t,e.c.abort())},send:function(t,n,i){var s,o,u,a,f,c,h=this,p=t,d={};n=n?e.Object(n):{},s=h._create(n,i),o=n.method?n.method.toUpperCase():"GET",f=n.sync,c=n.data,e.Lang.isObject(c)&&!c.nodeType&&!s.upload&&e.QueryString&&e.QueryString.stringify&&(n.data=c=e.QueryString.stringify(c));if(n.form){if(n.form.upload)return h.upload(s,t,n);c=h._serialize(n.form,c)}c||(c="");if(c)switch(o){case"GET":case"HEAD":case"DELETE":p=h._concat(p,c),c="";break;case"POST":case"PUT":n.headers=e.merge({"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},n.headers)}if(s.xdr)return h.xdr(p,s,n);if(s.notify)return s.c.send(s,t,n);!f&&!s.upload&&(s.c.onreadystatechange=function(){h._rS(s,n)});try{s.c.open(o,p,!f,n.username||null,n.password||null),h._setHeaders(s.c,n.headers||{}),h.start(s,n),n.xdr&&n.xdr.credentials&&l&&(s.c.withCredentials=!0),s.c.send(c);if(f){for(u=0,a=r.length;u<a;++u)d[r[u]]=s.c[r[u]];return d.getAllResponseHeaders=function(){return s.c.getAllResponseHeaders()},d.getResponseHeader=function(e){return s.c.getResponseHeader(e)},h.complete(s,n),h._result(s,n),d}}catch(v){if(s.xdr)return h._retry(s,t,n);h.complete(s,n),h._result(s,n)}return n.timeout&&h._startTimeout(s,n.timeout),{id:s.id,abort:function(){return s.c?h._abort(s,"abort"):!1},isInProgress:function(){return s.c?s.c.readyState%4:!1},io:h}}},e.io=function(t,n){var r=e.io._map["io:0"]||new o;return r.send.apply(r,[t,n])},e.io.header=function(t,n){var r=e.io._map["io:0"]||new o;r.setHeader(t,n)},e.IO=o,e.io._map={};var u=i&&i.XMLHttpRequest,a=i&&i.XDomainRequest,f=i&&i.ActiveXObject,l=u&&"withCredentials"in new XMLHttpRequest;e.mix(e.IO,{_default:"xhr",defaultTransport:function(t){if(!t){var n={c:e.IO.transports[e.IO._default](),notify:e.IO._default==="xhr"?!1:!0};return n}e.IO._default=t},transports:{xhr:function(){return u?new XMLHttpRequest:f?new ActiveXObject("Microsoft.XMLHTTP"):null},xdr:function(){return a?new XDomainRequest:null},iframe:function(){return{}},flash:null,nodejs:null},customTransport:function(t){var n={c:e.IO.transports[t]()};return n[t==="xdr"||t==="flash"?"xdr":"notify"]=!0,n}}),e.mix(e.IO.prototype,{notify:function(e,t,n){var r=this;switch(e){case"timeout":case"abort":case"transport error":t.c={status:0,statusText:e},e="failure";default:r[e].apply(r,[t,n])}}})},"3.16.0",{requires:["event-custom-base","querystring-stringify-simple"]});
YUI.add("pjax-content",function(e,t){function n(){}n.prototype={getContent:function(t){var n={},r=this.get("contentSelector"),i=e.Node.create(t||""),s=this.get("titleSelector"),o;return r&&i?n.node=i.all(r).toFrag():n.node=i,s&&i&&(o=i.one(s),o&&(n.title=o.get("text"))),n},loadContent:function(t,n,r){var i=t.url;this._request&&this._request.abort(),this.get("addPjaxParam")&&(i=i.replace(/([^#]*)(#.*)?$/,function(e,t,n){return t+=(t.indexOf("?")>-1?"&":"?")+"pjax=1",t+(n||"")})),this._request=e.io(i,{arguments:{route:{req:t,res:n,next:r},url:i},context:this,headers:{"X-PJAX":"true"},timeout:this.get("timeout"),on:{complete:this._onPjaxIOComplete,end:this._onPjaxIOEnd}})},_onPjaxIOComplete:function(e,t,n){var r=this.getContent(t.responseText),i=n.route,s=i.req,o=i.res;s.ioURL=n.url,o.content=r,o.ioResponse=t,i.next()},_onPjaxIOEnd:function(){this._request=null}},n.ATTRS={addPjaxParam:{value:!0},contentSelector:{value:null},titleSelector:{value:"title"},timeout:{value:3e4}},e.PjaxContent=n},"3.16.0",{requires:["io-base","node-base","router"]});
YUI.add("app-content",function(e,t){function r(){n.apply(this,arguments)}var n=e.PjaxContent;r.route=["loadContent","_contentRoute"],r.prototype={showContent:function(t,n,r){t=e.one(t),typeof n=="function"&&(n={callback:n},r=null),n=e.merge({render:!1},n);var i=n.view||"",s=typeof i=="string"?i:i.name,o=typeof i!="string"?i.config:{},u=this.getViewInfo(s),a,f,l,c;return delete n.view,t&&t.isFragment()&&t.get("childNodes").size()===1&&(t=t.get("firstChild")),t&&t.get("nodeType")===1?a=t:(l=u&&u.type||e.View,c=typeof l=="string"?e.Object.getValue(e,l.split(".")):l,f=c.prototype.containerTemplate,a=e.Node.create(f),a.append(t)),o=e.merge(o,{container:a}),this.showView(s,o,n,r)},_contentRoute:function(t,n,r){var i=n.content,s=e.config.doc,o;if(!i||!i.node)return r();i.title&&s&&(o=this.onceAfter("activeViewChange",function(){s.title=i.title})),this.showContent(i.node),o&&o.detach(),r()}},r.ATTRS=e.Attribute.protectAttrs(n.ATTRS),e.mix(r,n,!1,null,1),e.App.Content=r,e.Base.mix(e.App,[r])},"3.16.0",{requires:["app-base","pjax-content"]});
YUI.add("timers",function(e,t){function i(e){return s}function s(e){this.capacity=this.snap(e),this.length=0,this.front=0,this.initialize()}function o(e,t,n,r,i){for(var s=0;s<i;++s)n[s+r]=e[s+t]}function u(e){return e>>>=0,e-=1,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,e+1}function v(){while(a.length>0){var e=a.shift();try{e.call()}catch(t){if(d)throw l(),t;setTimeout(function(){throw t},0)}}f=!1}function y(e){d&&p.domain&&(e=p.domain.bind(e)),a.push(e),f||(l(),f=!0)}function b(e){var t;return b._asynchronizer(function(){t||e()}),{cancel:function(){t=1}}}var n={},r=e.config.global;"use strict",n.exports=s,s.prototype.push=function(e){var t=this.length;this.capacity<=t&&this.grow(this.snap(this.capacity*this.growFactor));var n=this.front+t&this.capacity-1;this[n]=e,this.length=t+1},s.prototype.shift=function(){var e=this.front,t=this[e];return this[e]=void 0,this.front=e+1&this.capacity-1,this.length--,t},s.prototype.grow=function(e){var t=this.front,n=this.capacity,r=new Array(n),i=this.length;o(this,0,r,0,n),this.capacity=e,this.initialize(),this.front=0;if(t+i<=n)o(r,t,this,0,i);else{var s=i-(t+i&n-1);o(r,t,this,0,s),o(r,0,this,s,i-s)}},s.prototype.initialize=function(){var e=this.capacity;for(var t=0;t<e;++t)this[t]=void 0},s.prototype.snap=function(e){return typeof e!="number"?this.minCapacity:u(Math.min(this.maxCapacity,Math.max(this.minCapacity,e)))},s.prototype.maxCapacity=1<<30|0,s.prototype.minCapacity=16,s.prototype.growFactor=8,"use strict";var s=i("./queue"),a=new s(1024),f=!1,l=void 0,c=typeof setImmediate=="function",h,p=r.process,d=!!p&&{}.toString.call(p)==="[object process]";if(d)l=function(){var e=p.domain;e&&(h=h||(1,i)("domain"),h.active=p.domain=null),f&&c?setImmediate(v):p.nextTick(v),e&&(h.active=p.domain=e)};else if(c)l=function(){setImmediate(v)};else if(typeof MessageChannel!="undefined"){var m=new MessageChannel;m.port1.onmessage=function(){l=g,m.port1.onmessage=v,v()};var g=function(){m.port2.postMessage(0)};l=function(){setTimeout(v,0),g()}}else l=function(){setTimeout(v,0)};n.exports=y,b._asynchronizer=y,b._impl="asap",e.soon=b},"3.16.0",{requires:["yui-base"]});
YUI.add("promise",function(e,t){function i(e){if(!(this instanceof i))return new i(e);var t=new i.Resolver(this);this._resolver=t;try{e.call(this,function(e){t.resolve(e)},function(e){t.reject(e)})}catch(n){t.reject(n)}}function s(e){this._callbacks=[],this._errbacks=[],this.promise=e,this._status="pending",this._result=null}var n=e.Lang,r=[].slice;e.mix(i.prototype,{then:function(e,t){var n=this.constructor,r=this._resolver;return new n(function(n,s){r._addCallbacks(typeof e=="function"?i._wrap(n,s,e):n,typeof t=="function"?i._wrap(n,s,t):s)})},"catch":function(e){return this.then(undefined,e)},getStatus:function(){return this._resolver.getStatus()}}),i._wrap=function(e,t,n){return function(r){var i;try{i=n(r)}catch(s){t(s);return}e(i)}},i.isPromise=function(e){var t;try{t=e.then}catch(n){}return typeof t=="function"},i.resolve=function(e){return i.isPromise(e)&&e.constructor===this?e:new this(function(t){t(e)})},i.reject=function(e){return new this(function(t,n){n(e)})},i.all=function(e){var t=this;return new t(function(r,i){function f(e){return function(t){a[e]=t,s--,s||r(a)}}if(!n.isArray(e)){i(new TypeError("Promise.all expects an array of values or promises"));return}var s=e.length,o=0,u=e.length,a=[];if(u<1)return r(a);for(;o<u;o++)t.resolve(e[o]).then(f(o),i)})},i.race=function(e){var t=this;return new t(function(r,i){if(!n.isArray(e)){i(new TypeError("Promise.race expects an array of values or promises"));return}for(var s=0,o=e.length;s<o;s++)t.resolve(e[s]).then(r,i)})},e.Promise=i,e.mix(s.prototype,{fulfill:function(e){this._status==="pending"&&(this._result=e,this._status="fulfilled"),this._status==="fulfilled"&&(this._notify(this._callbacks,this._result),this._callbacks=[],this._errbacks=null)},reject:function(e){this._status==="pending"&&(this._result=e,this._status="rejected"),this._status==="rejected"&&(this._notify(this._errbacks,this._result),this._callbacks=null,this._errbacks=[])},resolve:function(e){var t=this;i.isPromise(e)?e.then(function(e){t.resolve(e)},function(e){t.reject(e)}):this.fulfill(e)},then:function(e,t){return this.promise.then(e,t)},_addCallbacks:function(e,t){var n=this._callbacks,r=this._errbacks,i=this._status,s=this._result;n&&typeof e=="function"&&n.push(e),r&&typeof t=="function"&&r.push(t),i==="fulfilled"?this.fulfill(s):i==="rejected"&&this.reject(s)},getStatus:function(){return this._status},_notify:function(t,n){t.length&&e.soon(function(){var e,r;for(e=0,r=t.length;e<r;++e)t[e](n)})}},!0),e.Promise.Resolver=s,e.when=function(e,t,n){return e=i.resolve(e),t||n?e.then(t,n):e},e.batch=function(){return i.all(r.call(arguments))}},"3.16.0",{requires:["timers"]});
YUI.add("flickr-promise",function(r,e){"use strict";var o=require("hermes-core/flog")(e);r.FlickrPromise=function(e){"object"!=typeof e&&o.error("Incorrect use of Y.FlickrPromise. You should only be using Y.FlickrPromise as a wrapper for Y.Promise.all.");var n=Object.keys(e),t=n.map(function(r){return e[r]}),i={};return r.Promise.all(t).then(function(r){for(;r.length;)i[n.shift()]=r.shift();return i})},r.RetryablePromise=function(e,o,n){return o=o||1,n=n||0,n+=1,e(n,o).catch(function(t){if(n<o)return r.RetryablePromise(e,o,n);throw t})},r.PromiseCatcher=function(r){return r=r||"unnamed module",function(e){throw o.warn("Uncaught Promise exception",{module:r,err:e}),e}},r.FetcherErrorLogger=function(r){return r=r||"unnamed module",function(e){throw e.fatal?o.error("failed getting or processing API response",{module:r,err:e}):o.log("failed getting or processing API response",{module:r,err:e}),e}},r.PromiseChainDestroyer=function(){return new r.Promise(function(){})}},"@VERSION@",{requires:["promise"]});YUI.add("list-proxy",function(t){function e(t,e,i){this.registry=t,this.attrName=i,this.attrDef=this.registry.attributes[i],this.id=e,this.isListProxy=!0}function i(t){return s[t]}function n(t){delete s[t]}function r(e,r,a,o){if(!o||!t.Lang.isFunction(o.run))return t.Promise.reject("[list-proxy] `_cacheFetches` fetchFcn.run is not a function");var u=(function(t,e){return t+JSON.stringify(e)})(e,r),h=i(u);return h||((function(t,e){s[t]=e})(u,o.run.call(o,r,a).then(function(t){return n(u),t},function(t){throw n(u),t})),i(u))}function a(t,e,i){var n,r;for(n=e;n<i;n++)if(void 0===(r=t[n])||!r.registry.exists(r.id))return!1;return!0}var s,o="hasMaxBoundary",u="hasMinBoundary";e.prototype={getPage:function(e){var i=t.merge({page:1,perPage:20},e,this.attrDef.pageFetch);return i.id=this.id,t.ListProxyStatic.fetchListByPage(i,this.registry,this.attrName)},getRange:function(e){var i=t.merge({offset:0,limit:10},e,this.attrDef.rangeFetch);return i.id=this.id,t.ListProxyStatic.fetchListByRange(i,this.registry,this.attrName)},getContext:function(e){var i=t.merge({numPrev:10,numNext:10},e,this.attrDef.contextFetch);return i.id=this.id,i.listItemId=e[i.listItemIdField],t.ListProxyStatic.fetchListByContext(i,this.registry,this.attrName)},getList:function(){return this.registry._data[this.id][this.attrName]||[]},appendToListMulti:function(e){var i=t.clone(this.registry._data[this.id][this.attrName])||[];e.forEach(function(t){i.push(t)}),i.hasMinBoundary=this.hasMinBoundary(),i.hasMaxBoundary=this.hasMaxBoundary(),this.registry.setValue(this.id,this.attrName,i,!1)},appendToList:function(e){var i=t.clone(this.registry._data[this.id][this.attrName])||[];i.push(e),i.hasMinBoundary=this.hasMinBoundary(),i.hasMaxBoundary=this.hasMaxBoundary(),this.registry.setValue(this.id,this.attrName,i,!1)},prependToList:function(t){(this.registry._data[this.id][this.attrName]||[]).unshift(t)},getFromListByID:function(e,i){var n=this.registry._data[this.id][this.attrName]||[],r=!1;return t.Array.some(n,function(t){t[i||"id"]===e&&(r=t)}),r||!1},removeFromList:function(e,i){var n,r=this.registry._data[this.id][this.attrName]||[],a=0;0!==r.length&&(t.Array.some(r,function(t){return a++,t[i||"id"]===e}),a===r.length&&r[a-1][i||"id"]!==e||a>0&&((n=r.slice(0,a-1).concat(r.slice(a))).hasMinBoundary=this.hasMinBoundary(),n.hasMaxBoundary=this.hasMaxBoundary(),this.registry.setValue(this.id,this.attrName,n)))},setMinBoundary:function(){this.getList()[u]=!0},hasMinBoundary:function(){return!!this.getList()[u]},setMaxBoundary:function(){this.getList()[o]=!0},hasMaxBoundary:function(){return!!this.getList()[o]},toJSON:function(){var e=[];return t.Array.each(this.getList(),function(t){e.push(t.toJSON())}),e}},s={},t.ListProxy=e,t.ListProxyStatic={setBoundary:function(t,e){t["min"===e?u:o]=!0},fetchListByContext:function(e,i,n){var a,s,o,u,h,c,d=t.merge({},e),f=i.getValue(d.id,n),g=f.getList(),y=-1,m=f.hasMinBoundary&&f.hasMinBoundary(),x=f.hasMaxBoundary&&f.hasMaxBoundary(),p=i.attributes[n].contextFetch.listFetcher,l=d.numNext,v=d.numPrev;return d.refetchAt=void 0!==d.refetchAt?d.refetchAt:5,g.some(function(t,e){return t.getValue("id")===d.listItemId&&(y=e+1),!t.registry.exists(t.id)})||1===y&&!m||y===g.length&&!x||-1===y?(d.numPrev=d.numPrev+d.refetchAt,d.numNext=d.numNext+d.refetchAt,r("context",d,i.appContext,p)):(a=y+d.numNext,s=g.length,o=g[0].getValue("id"),u=g[s-1].getValue("id"),h=g.slice(0,1===y?0:y-1).reverse().slice(0,d.numPrev),c=g.slice(y,a),a>s&&y<d.numPrev&&!m&&!x?r("context",d,i.appContext,p):a>s&&!x?(d.photoId=u,d.numPrev=0,d.numNext=a-s,r("context",d,i.appContext,p).then(function(t){return{previous:h,next:c.concat(t.next).slice(0,l)}})):y<=d.numPrev&&!m?(d.photoId=o,d.numNext=0,d.numPrev=d.numPrev-y+1,r("context",d,i.appContext,p).then(function(t){return{previous:h.concat(t.previous).slice(0,v),next:c}})):new t.Promise(function(t){t({previous:h,next:c}),y>=g.length-d.numNext&&d.refetchAt>0&&!x&&(d.photoId=u,d.numPrev=0,d.numNext=d.refetchAt,r("context",d,i.appContext,p)),y-1<=d.numPrev&&d.refetchAt>0&&!m&&(d.photoId=o,d.numPrev=d.refetchAt,d.numNext=0,r("context",d,i.appContext,p))}))},fetchListByPage:function(e,i,n){var s,o,u=t.merge({},e),h=i.getValue(u.id,n),c=h.getList();return s=u.perPage*(u.page-1),o=u.perPage*(u.page-1)+u.perPage,!(h.hasMinBoundary&&h.hasMinBoundary()&&c.length>=o||h.hasMaxBoundary&&h.hasMaxBoundary()&&h.hasMinBoundary&&h.hasMinBoundary())||!a(c,s,o)&&i.attributes[n].pageFetch?r("page",u,i.appContext,i.attributes[n].pageFetch.listFetcher):t.Promise.resolve(c.slice(s,o))},fetchListByRange:function(e,i,n){var s,o,u=i.getValue(e.id,n).getList();return s=e.offset,o=e.offset+e.limit,u.length>=o&&a(u,s,o)?t.Promise.resolve(u.slice(s,o)):r("range",e,i.appContext,i.attributes[n].rangeFetch.listFetcher)}}},"@VERSION@");YUI.add("api-helper",function(e){function t(t){return t&&"string"==typeof t?t.replace(/(?:c|farm)\d\.static\.?flickr\.com/,e.config.flickr.xmen.host):t}function i(e){var i,r=/^https?:/;if("string"==typeof e)return t(e.replace(r,""));for(i in e)e[i]=e[i]?e[i].replace(r,""):null,e[i]=t(e[i]);return e}function r(t,r){var n={};return!r&&t.id?e.Object.each(t,function(r,a){var o,d=/^url_([a-z0-9]+)$/.exec(a);d&&(o=d[1],n[o]={displayUrl:i(t["url_"+o]),width:parseInt(t["width_"+o],10),height:parseInt(t["height_"+o],10)},t["url_"+o+"_cdn"]?(YUI.Env.isServer||(e.config.flickr.cdnUrls=!0),n[o].url=i(t["url_"+o+"_cdn"])):(YUI.Env.isServer||(e.config.flickr.cdnUrls=!1),n[o].url=i(t["url_"+o])))}):t&&t[0]&&t[0].location?e.Object.each(t,function(e,t){var r=/_[a-z0-9]+_([a-z])\./.exec(e.location);if(r&&e.width>0&&e.width>0&&"o"!==r[1]){var a=r[1],o=a,d=new RegExp("_("+a+")\\.$");o="m"===a?"s":a,n[o="l"===a?"m":a]={displayUrl:i(e.location),width:parseInt(e.width,10),height:parseInt(e.height,10),url:i(e.location.replace(d,"_"+o+".")),key:o}}}):e.Array.each(t,function(t,r,a){if("video"!==t.media){var o=/sizes\/(\w+)\/?$/.exec(t.url)[1];o&&(n[o]={displayUrl:i(t.source),width:parseInt(t.width,10),height:parseInt(t.height,10)},t.source_cdn?(YUI.Env.isServer||(e.config.flickr.cdnUrls=!0),n[o].url=i(t.source_cdn)):(YUI.Env.isServer||(e.config.flickr.cdnUrls=!1),n[o].url=i(t.source)))}}),n}function n(e,t){var n={id:e.id,title:e.title,description:e.description&&e.description.content||"",sizes:r(e),needsInterstitial:e.needsInterstitial,canComment:e.canComment,canPublicComment:e.publiceditability?e.publiceditability.cancomment:0,canAddMeta:e.canAddMeta||e.canAddmeta,canPrint:e.canPrint||0,safetyLevel:e.safetyLevel,license:e.license,mediaType:e.media,secret:e.secret,rotation:e.rotation,oWidth:e.oWidth?parseInt(e.oWidth,10):0,oHeight:e.oHeight?parseInt(e.oHeight,10):0,isVideoPending:e.video?e.video.pending:0,isVideoFailed:e.video?e.video.failed:0,systemModerated:e.system_moderated||0};return"processing"===e.mediaStatus?n.isVideoPending=1:"failed"===e.mediaStatus&&(n.isVideoFailed=1),n.owner={pathAlias:e.pathalias||e.pathAlias,username:e.ownername,realname:e.realname,id:t||e.owner,buddyicon:i(e.iconurls),isAdFree:e.isAdFree,isPro:e.ispro,proBadge:e.proBadge,dateCreated:e.ownerDatecreate},n.engagement={id:e.id,ownerNsid:t||e.owner,isFaved:e.isfavorite||!1,canShare:e.canShare,canDownload:e.canDownload,canPrint:e.canPrint,commentCount:e.countComments,faveCount:e.countFaves,viewCount:e.countViews},n.stats={id:e.id,dateTaken:e.datetaken,datePosted:e.dateupload,takenGranularity:e.datetakengranularity,isDateTakenUnknown:e.datetakenunknown||"1"===e.datetakenunknown||1===e.datetakenunknown},["ispublic","isfriend","isfamily","permissions"].every(function(t){return e.hasOwnProperty(t)})&&(n.privacy={id:e.id,isPublic:e.ispublic,isVisibleByFriends:e.isfriend,isVisibleByFamily:e.isfamily,permAddMeta:e.permissions?e.permissions.permaddmeta:0,permComment:e.permissions?e.permissions.permcomment:0,permPrint:e.permissions?e.permissions.permprint:0}),n}function a(t){var i={id:t.id,pageNumber:t.pageNumber,template:parseInt(t.template,10),countPhotos:t.countPhotos,backgroundColor:t.backgroundColor};return e.Lang.isNumber(i.backgroundColor)&&(i.backgroundColor=""+i.backgroundColor,i.backgroundColor=i.backgroundColor.match(/.{1,3}/g).join(",")),i}function o(e){return{id:e.nsid||e.user,username:e.username,realname:e.realname,iconfarm:e.iconfarm,iconserver:e.iconserver,pathAlias:e.pathAlias,buddyicon:e.iconUrls||e.iconurls||{}}}function d(t){return e.each(t,function(i,r){e.Lang.isObject(i)&&"appContext"!==r&&(i=d(i));var n=(function(e){return"string"!=typeof e?e:("_"===e[0]&&(e=e.slice(1)),e.replace(/_([a-zA-Z0-9])/g,function(e,t,i){return t.toUpperCase()}))})(r);t[n]=i}),t}function s(t){var r=e.Lang.isObject(t)&&t.primaryPhotoExtras,n={};return e.Lang.isObject(r)&&(e.Object.each(r,function(t,a){var o,d=/^url_([a-z]+)$/.exec(a);d&&(o=d[1],n[o]={displayUrl:i(t),width:parseInt(r["width_"+o],10),height:parseInt(r["height_"+o],10)},r["url_"+o+"_cdn"]?(YUI.Env.isServer||(e.config.flickr.cdnUrls=!0),n[o].src=i(r["url_"+o+"_cdn"])):(YUI.Env.isServer||(e.config.flickr.cdnUrls=!1),n[o].src=i(r["url_"+o])))}),delete t.primaryPhotoExtras),n}var l=["can_addmeta","can_comment","can_download","can_print","can_share","contact","count_comments","count_faves","count_views","date_taken","date_upload","description","icon_urls_deep","isfavorite","ispro","license","media","needs_interstitial","owner_name","owner_datecreate","path_alias","perm_print","realname","rotation","safety_level","secret_k","secret_h","url_sq","url_q","url_t","url_s","url_n","url_w","url_m","url_z","url_c","url_l","url_h","url_k","url_3k","url_4k","url_f","url_5k","url_6k","url_o","visibility","visibility_source","o_dims","publiceditability","system_moderation"],c=["datecreate","date_activity","eighteenplus","invitation_only","needs_interstitial","non_members_privacy","pool_pending_count","privacy","member_pending_count","icon_urls","date_activity_detail"],u=["url_sq","url_q","url_t","url_s","url_n","url_w","url_m","url_z","url_c","url_l","url_h","url_k","url_3k","url_4k","url_5k","url_6k","url_o","path_alias","owner_name"],p=["can_comment","can_print","count_comments","count_faves","description","isfavorite","license","media","needs_interstitial","owner_name","path_alias","realname","rotation","url_sq","url_q","url_t","url_s","url_n","url_w","url_m","url_z","url_c","url_l"],m=["owner_name","path_alias","realname","sizes","url_sq","url_q","url_t","url_s","url_n","url_w","url_m","url_z","url_c","url_l","url_h","url_k","url_3k","url_4k","url_5k","url_6k","needs_interstitial"],g=["icon_urls","safe_search","galleries_view_layout_pref"],_={fave:function(t){return{id:e.guid(),type:t.type,owner:o(t),timestamp:t.dateadded}},comment:function(e){return{id:e.commentid,type:e.type,owner:o(e),content:e._content,timestamp:e.dateadded}},contacted:function(t){return{id:e.guid(),type:t.type,owner:o(t),timestamp:t.dateadded}},gallery:function(t,i){return{id:e.guid(),type:t.type,owner:o(t),gallery:i,timestamp:t.dateadded}},people:function(t,i){return{id:e.guid(),type:t.type,owner:o(t),timestamp:t.dateadded,personTagged:i.personTagged,tagger:i.tagger}},tag:function(t){return{id:e.guid(),type:t.type,owner:o(t),timestamp:t.dateadded}},photo_comment_mention:function(t){return{id:e.guid(),type:t.type,owner:o(t),timestamp:t.dateadded}},group_invite:function(t,i){return{id:e.guid(),type:t.type,owner:o(t),group:i.toJSON(),timestamp:t.dateadded}},group_user_invite:function(t){return{id:e.guid(),type:t.type,owner:o(t),timestamp:t.dateadded}},note:function(t){return{id:e.guid(),type:t.type,owner:o(t),timestamp:t.dateadded}},share:function(t){return{id:e.guid(),type:t.type,owner:o(t),timestamp:t.dateadded}},upload:function(t,i){return{id:e.guid(),type:t.type,owner:o(i.owner),title:i.title,timestamp:t.dateupload,photo:i.photo}},reply_reply:function(t){return{id:e.guid(),type:t.type,owner:o(t),timestamp:t.dateadded,replyId:t.reply_id}},topic_reply:function(t){return{id:e.guid(),type:t.type,owner:o(t),timestamp:t.dateadded,replyId:t.reply_id}},friend_join:function(t){return{id:e.guid(),type:t.type,owner:o(t),timestamp:t.dateadded,service:t.service}},group_topic_new:function(t){return{id:e.guid(),type:t.type,owner:o(t),timestamp:t.dateadded}},flickrmail:function(t,i){return{id:e.guid(),type:t.type,owner:o(i.owner),timestamp:t.dateadded,mail:i.mail}},testimonial:function(t,i){return{id:e.guid(),type:t.type,owner:o(i.owner),timestamp:t.dateadded,url:i.url}},photo_bot_moderated:function(t,i){return{id:e.guid(),type:t.type,photo:i.photo,owner:o(i.owner),timestamp:t.audit_date,toSafetyLevel:t.to_safety_level,fromSafetyLevel:t.from_safety_level,moderatedBy:t.moderated_by}}};e.APIHelper={request:{getRebootPhotoExtras:function(){return l.join(",")},getRebootGroupExtras:function(){return c.join(",")},getRebootSearchSetsExtras:function(){return u.join(",")},getRebootPhotoLiteExtras:function(){return p.join(",")},getRebootAlbumsListExtras:function(){return m.join(",")},getRebootPeopleExtras:function(){return g.join(",")},addStaticMapsParams:function(e){e.extras?e.extras=e.extras+",static_maps":e.extras="static_maps",e.static_map_zoom="3,6,14",e.static_map_width="245",e.static_map_height="100"}},response:{addOrReplaceListByContext:function(t){var i,r,n,a=0,o=t.model,d=t.next,s=t.prev,l=t.hasMin,c=t.hasMax,u=t.current,p=t.numNext,m=t.numPrev,g=o.getValue("id");return u.some(function(e){return a++,e.getValue("id")===g})?1===a&&0===d.length?i=s.concat(u):a===u.length&&0===s.length?i=u.concat(d):a<s.length&&u.length-a<d.length?i=s.concat([o],d):(i=u,(n=s.slice(0)).some(function(e){return!i.some(function(t){return t.getValue("id")===e.getValue("id")})})?i=i.slice(a-1):n=[],(r=d.slice(0)).every(function(e){return i.some(function(t){return t.getValue("id")===e.getValue("id")})})?r=[]:i=i.slice(0,a),i=n.concat(i,r)):i=0===d.length&&0===p?s.concat([o],u):0===s.length&&0===m?u.concat([o],d):s.concat([o],d),(c||p>0&&d.length<p)&&e.ListProxyStatic.setBoundary(i,"max"),(l||m>0&&s.length<m)&&e.ListProxyStatic.setBoundary(i,"min"),i},addOrReplaceListByPage:function(t){var i=t.current,r=t.newPages,n=t.perPage,a=t.pageNum,o=t.hasMin,d=t.hasMax,s=t.totalItems,l=[],c=[],u=[];return 0===i.length?(u=r,1===a&&e.ListProxyStatic.setBoundary(u,"min"),void 0!==s&&s<=a*n&&e.ListProxyStatic.setBoundary(u,"max")):(o&&1!==a&&(l=i.slice(0,a*n),c=i.slice(a*n)),r.length<n||s===n*a?c=[]:s&&s>i.length&&d?(l=0===l.length?i.slice(0,-1*(a-1)*n):l,c=i.slice(-1*(a-1)*n)):d&&(c=0===c.length?i:c),u=l.concat(r,c),(o||1===a)&&e.ListProxyStatic.setBoundary(u,"min"),(d||r.length<n||s===n*a)&&e.ListProxyStatic.setBoundary(u,"max")),u},parsePhoto:n,parsePhotoLite:function(t){return t.owner&&t.owner.accountId?{id:t.id,pathAlias:t.owner.accountIdAlias||t.owner.accountId,username:t.owner.accountIdAlias,realname:t.owner.name,nsid:t.owner.accountId,ownerNsid:t.owner.accountId,isFaved:!1,faveCount:t.stats.favesCount,commentCount:t.stats.commentsCount,title:t.title,description:t.description,mediaType:void 0,license:void 0,sizes:e.APIHelper.response.parsePhotoSize(t.sizes),needsInterstitial:t.needsInterstitial||void 0,canComment:void 0,oWidth:parseInt(t.sizes[0].width,10),oHeight:parseInt(t.sizes[0].height,10),isPublic:!0,isVisibleByFriends:!1,isVisibleByFamily:!1}:{id:t.id,pathAlias:t.pathalias||t.owner,username:t.ownername,realname:t.realname,nsid:t.owner,ownerNsid:t.owner,isFaved:t.isfavorite||!1,faveCount:t.countFaves,commentCount:t.countComments,title:t.title,description:t.description&&t.description.content||"",mediaType:t.media,license:t.license,sizes:e.APIHelper.response.parsePhotoSize(t),needsInterstitial:t.needsInterstitial,canComment:t.canComment,oWidth:t.oWidth?parseInt(t.oWidth,10):0,oHeight:t.oHeight?parseInt(t.oHeight,10):0,isPublic:!!t.ispublic,isVisibleByFriends:!!t.isfriend,isVisibleByFamily:!!t.isfamily}},parsePhotos:function(t){var i=[],r=t.photos,a=t.photoModelRegistry,o=t.personModelRegistry,d=t.photoEngagementModelRegistry,s=t.photoStatsModelRegistry,l=t.photoPrivacyModelRegistry,c=t.ownerID,u=t.existingPerson,p={},m={},g={},_={};return r.length&&e.Array.each(r,function(e){var t=n(e,c),r=t.owner.id;p[r]||(u?p[r]=u:(o.addOrUpdate(t.owner),p[r]=o.proxy(r))),m[e.id]||(d.addOrUpdate(t.engagement),m[e.id]=d.proxy(e.id)),g[e.id]||(s.addOrUpdate(t.stats),g[e.id]=s.proxy(e.id)),l&&t.privacy&&(_[e.id]||(l.addOrUpdate(t.privacy),_[e.id]=l.proxy(e.id)),t.privacy=_[e.id]),t.owner=p[r],t.engagement=m[e.id],t.stats=g[e.id],a.addOrUpdate(t),i.push(a.proxy(e.id))}),i},parsePage:a,parsePages:function(t){var i=[],r=t.pages,n=t.pageModelRegistry;return r.length&&e.Array.each(r,function(e){var t=a(e);n.addOrUpdate(t),i.push(n.proxy(e.id))}),i},parsePhotoSize:r,parsePerson:function(e){var t={id:e.nsid,isDeleted:e.isDeleted,pathAlias:e.pathAlias,username:e.username,realname:e.realname,isAdFree:e.isAdFree,isPro:e.ispro,proBadge:e.proBadge,buddyicon:i(e.iconurls),location:e.location};return e.datecreate&&(t.dateCreated=e.datecreate),t},parsePlaces:function(e){var t=[],i=e.places,r=e.placeRegistry;return i.length&&i.forEach(function(e){var i,n=e.woeid||e.place_id;i=(function(e){return{id:e.woeid||e.place_id,woeId:e.woeid,woeName:e.woe_name,placeId:e.place_id,placeType:e.place_type,placeTypeId:e.place_type_id,placeUrl:e.place_url,latitude:e.latitude,longitude:e.longitude}})(e),r.addOrUpdate(i),t.push(r.proxy(n))}),t},parseContact:o,parseNotificationsEvents:_,removeProtocolFromURL:i,camelCaseProperties:d,addContextToRegistry:function(t,i,r,n){var a,o;"gallery-models"===i.name&&(t.compoundId=t.id,t.id=t.compoundId.split("-").pop()),t.owner&&(a=e.APIHelper.response.parsePerson(t.owner),t.owner=r.addOrUpdate(a)),"group-pool-models"===i.name&&(t.title=e.Escape.html(t.title),o=n.parseGroupModel(t.id,t.pathAlias,t),t={id:t.id,pathAlias:t.pathAlias,group:n.addOrUpdate(o)}),"set-models"!==i.name&&"gallery-models"!==i.name||(t.primaryPhotoSizes=s(t)),i.addOrUpdate(t)},parsePrimaryPhotoSizes:s,parsePhotoSetMeta:function(e){var t={};return t.title=e.title.content,t.id=e.id,t.photoCount=parseInt(e.photos,10),t.primary=e.primary,t.videoCount=parseInt(e.videos,10),t.totalCount=t.photoCount+t.videoCount,t.primaryPhotoSizes=s({primaryPhotoExtras:e}),t},parsePhotoMeta:function(e){return{id:e.photo_id,title:e.HTMLMETA["og:title"],keywords:e.HTMLMETA.keywords,"og:title":e.HTMLMETA["og:title"],"og:description":e.HTMLMETA["og:description"],"og:type":e.HTMLMETA["og:type"],"og:url":e.HTMLMETA["og:url"],"og:image":e.HTMLMETA["og:image"],"og:image:width":e.HTMLMETA["og:image:width"],"og:image:height":e.HTMLMETA["og:image:height"],"twitter:card":e.HTMLMETA["twitter:card"],"twitter:player":e.HTMLMETA["twitter:player"],"twitter:player:width":e.HTMLMETA["twitter:player:width"],"twitter:player:height":e.HTMLMETA["twitter:player:height"],"twitter:image":e.HTMLMETA["twitter:image"],"twitter:description":e.HTMLMETA["twitter:description"],"twitter:app:url:iphone":e.HTMLMETA["twitter:app:url:iphone"],"twitter:app:url:ipad":e.HTMLMETA["twitter:app:url:ipad"],"twitter:app:url:googleplay":e.HTMLMETA["twitter:app:url:googleplay"],"twitter:creator":e.HTMLMETA["twitter:creator"]}}}}},"@VERSION@",{requires:["flickr-promise","list-proxy"]});YUI.add("flickr-api",function(e){"use strict";function t(t,r){this.transport=e.transportFactory(t,r?r.flipper:null),void 0!==r&&(this.appContext=r),YUI.Env.isServer?this.api_url=YUI.Env.config.api.hostname_server:this.api_url=e.config.flickr.api.hostname_client}var r=require("hermes-core/fletrics"),s=require("hermes-core/flog")("API"),i=[96,97,98,99,100,105,106,111,112,114,115,116,117,118,119],o=["flickr.activity.getNotificationsCount","flickr.interestingness.getList","flickr.favorites.add","flickr.photos.addView","flickr.photos.getExif","flickr.photos.getInfo","flickr.photos.search","flickr.photos.upload","flickr.people.search","flickr.photosets.addView","flickr.photosets.getPhotos","flickr.photosets.search","flickr.groups.pools.add","flickr.groups.search","flickr.people.addView","flickr.people.getInfo","flickr.people.getPhotos","flickr.groups.pools.getPhotos","flickr.groups.getInfo","flickr.groups.getTopContributors","flickr.products.books.getBook","flickr.products.orders.getOrder","flickr.site.getBucketTestConfig","flickr.cameraroll.getMap","flickr.cameraroll.getPhotosByOffset","flickr.stats.getGraphData","flickr.stats.getTotalViewsForDateRange","flickr.stats.getMiscStats","flickr.stats.getPopularPhotos","flickr.stats.getReferrerCategoriesForDate","flickr.stats.getTotalViews","flickr.tags.getListPhoto"],a=function(e){return e&&e.message&&e.message.indexOf&&(e.message.indexOf("Photo not found")>-1||e.message.indexOf("not found (invalid ID)")>-1||e.message.indexOf("not found (inactive member)")>-1||e.message.indexOf("Login Failed")>-1)};t.prototype.callMethod=function(t,n,c,l){var p,f,d,h,u=0,m=null,g=null,k=null,x="";return n=n||{},l=l||{},this.appContext&&this.appContext.request&&(this.appContext.request.UA.isBot||this.appContext.request.UA.isSharingBot)&&(!0,x=r.getBotString()),-1!==o.indexOf(t)&&(m=r.createStopwatch("api."+t+".latency"+x),r.increment("api."+t+".calls"+x)),-1!==["flickr.photos.getInfo"].indexOf(t)&&(g=r.createStopwatch("api."+t+".latency.histogram"+x)),k=r.createStopwatch("api.latency"),r.increment("api.calls.initiated"+x),this.appContext&&this.appContext.random_slice&&(n.random_slice=this.appContext.random_slice),!YUI.Env.isServer&&e.config.flickr.random_slice&&(n.random_slice=e.config.flickr.random_slice),this.appContext&&this.appContext.flipper.isFlipped("enable-viewer-nsid-check")&&!YUI.Env.isServer&&(f=this.appContext.getViewer(),n.viewerNSID=f.signedIn?f.nsid:""),(!e.config.flickr.cameraroll.suppress_logging||"flickr.cameraroll.getPhotosByOffset"!==t&&"flickr.cameraroll.getMapVersion"!==t)&&s.info("params",{method:t,config:n}),p={flickr:!0,data:n},p.data.method=t,l.timeout&&(p.timeout=l.timeout),d=this.api_url+"/services/rest",m&&m.start(),g&&g.start(),k&&k.start(),(h=function(){return r.increment("api.call.attempt"),this.transport.makeRequest(d,p,c).then(function(c){var p,f="";c&&c.headers&&(c.headers["x-served-by"]&&(f=c.headers["x-served-by"]),c.headers["x-account-nsid"]&&this.appContext.setPreliminaryViewerNsid(c.headers["x-account-nsid"])),r.increment("api.calls"+x),r.increment("api.calls.responded"+x),m&&m.stop(),g&&g.stop(),k&&k.stop(),YUI.Env.isServer&&c.debug&&YUI.Env.config.api.log_urls&&!c.debug.wasBatched&&s.info("url",{method:t,url:c.debug.url});try{if(!(p=c.responseText?JSON.parse(c.responseText):c))throw s.error("returned an empty response",{method:t}),new Error("Empty response")}catch(e){var d="";if(c&&c.responseText&&c.responseText.toLowerCase().indexOf("502 bad gateway")>-1&&(e.flickrApiError="502 in response text"),c&&c.responseText||(e.flickrApiError="empty response"),c&&c.responseText){var h=c.responseText.toLowerCase().indexOf("<body>");d=h>-1?c.responseText.slice(h,100):c.responseText.slice(0,100)}throw s.error("responded with unparseable JSON",{method:t,err:e,servedBy:f,headers:c&&c.headers,response:d}),e.fatal=!0,e}try{(void 0===l.camelCase||l.camelCase)&&(p=e.APIHelper.response.camelCaseProperties(p))}catch(e){throw s.error("failed camelCase parsing",{method:t,err:e,servedBy:f}),e.fatal=!0,e}if("ok"===p.stat)return r.increment("api.call.success"),-1!==o.indexOf(t)&&r.increment("api."+t+".call.success"),s.log("successfully returned",{method:t,response:p}),p;if("fail"===p.stat){if(p.fatal=!0,a(p)&&(p.is404=!0),!p.code)throw s.error('responded with "stat: fail" but no error code',{method:t,response:p,servedBy:f}),p;if(-1!==i.indexOf(p.code))throw s.error('responded with "stat: fail" and fatal error code',{method:t,response:p,servedBy:f,headers:c&&c.headers,config:n}),p;throw s.info('responded with "stat: fail" and non-fatal error code',{method:t,response:p,servedBy:f}),p.fatal=!1,r.increment("api.call.success.stat_fail"),-1!==o.indexOf(t)&&r.increment("api."+t+".call.success.stat_fail"),p}throw s.error('responded without a known "stat"',{method:t,response:p,servedBy:f}),p.fatal=!0,p}.bind(this),function(r){throw r.fatal=!0,503===r.code&&(e.config.win.location="https://www.flickr.com/error/500"),"ECONNRESET"===r.code&&(r.flickrApiError="ECONNRESET"),r.code&&-1!==["ECONNRESET","ECONNREFUSED","ECONNABORTED","EHOSTUNREACH","ENETDOWN","ENETUNREACH","ETIMEDOUT"].indexOf(r.code)&&(r.timeout=!0),r.resp&&0===r.resp.status&&"timeout"===r.resp.statusText&&(r.clientTimeout=!0),a(r)&&(r.is404=!0),s.error("failed in an unexpected way",{method:t,err:r}),r}.bind(this)).then(void 0,function(e){throw e.fatal?r.increment("api.failures"+x):r.increment("api.warnings"+x),e}).then(void 0,function(e){if(!e.fatal||++u>=2)throw e;return e.flickrApiError=e.flickrApiError||"unknown",s.error("fatal api failure retry",{err:e,attempts:u}),h()})}.bind(this))()},t.prototype.fetchSiteKey=function(){return this.transport.makeSiteKeyRequest(this.api_url+"/services/rest")},t.prototype.fetchCsrf=function(){return this.transport.makeCsrfRequest(this.api_url+"/services/rest")},e.namespace("FlickrAPI"),e.FlickrAPI=t},"@VERSION@",{requires:["promise","oop","api-helper"]});YUI.add("cycle",function(r,c){var e=require("cyclical-json");r.decycle=function(r){return JSON.parse(e.stringify(r))},r.retrocycle=function(r){return e.parse(JSON.stringify(r))}},"@VERSION@");