/* YUI 3.8.0 (build 5744) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */ YUI.add("json-parse",function(e,t){function n(t){var n=typeof global=="object"?global:undefined;return(e.UA.nodejs&&n?n:e.config.win||{})[t]}function d(e,t){return e==="ok"?!0:t}var r=n("JSON"),i=Object.prototype.toString.call(r)==="[object JSON]"&&r,s=!!i,o=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,u=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,a=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,f=/(?:^|:|,)(?:\s*\[)+/g,l=/[^\],:{}\s]/,c=function(e){return"\\u"+("0000"+(+e.charCodeAt(0)).toString(16)).slice(-4)},h=function(e,t){var n=function(e,r){var i,s,o=e[r];if(o&&typeof o=="object")for(i in o)o.hasOwnProperty(i)&&(s=n(o,i),s===undefined?delete o[i]:o[i]=s);return t.call(e,r,o)};return typeof t=="function"?n({"":e},""):e},p=function(e,t){e=e.replace(o,c);if(!l.test(e.replace(u,"@").replace(a,"]").replace(f,"")))return h(eval("("+e+")"),t);throw new SyntaxError("JSON.parse")};e.namespace("JSON").parse=function(t,n){return typeof t!="string"&&(t+=""),i&&e.JSON.useNativeParse?i.parse(t,n):p(t,n)};if(i)try{s=i.parse('{"ok":false}',d).ok}catch(v){s=!1}e.JSON.useNativeParse=s},"3.8.0",{requires:["yui-base"]}); /* YUI 3.8.0 (build 5744) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */ YUI.add("json-stringify",function(e,t){function n(t){var n=typeof global=="object"?global:undefined;return(e.UA.nodejs&&n?n:e.config.win||{})[t]}function B(e){var t=typeof e;return y[t]||y[a.call(e)]||(t===h?e?h:p:c)}function j(e){return D[e]||(D[e]="\\u"+("0000"+(+e.charCodeAt(0)).toString(16)).slice(-4),P[e]=0),++P[e]===H&&(M.push([new RegExp(e,"g"),D[e]]),_=M.length),D[e]}function F(e){var t,n;for(t=0;t<_;t++)n=M[t],e=e.replace(n[0],n[1]);return A+e.replace(O,j)+A}function I(e,t){return e.replace(/^/gm,t)}function q(t,n,r){function M(e,t){var a=e[t],f=B(a),y=[],A=r?L:k,O,_,D,P,H;o(a)&&s(a.toJSON)?a=a.toJSON(t):f===g&&(a=l(a)),s(i)&&(a=i.call(e,t,a)),a!==e[t]&&(f=B(a));switch(f){case g:case h:break;case d:return F(a);case v:return isFinite(a)?a+b:p;case m:return a+b;case p:return p;default:return undefined}for(_=c.length-1;_>=0;--_)if(c[_]===a)throw new Error("JSON.stringify. Cyclical reference");O=u(a),c.push(a);if(O)for(_=a.length-1;_>=0;--_)y[_]=M(a,_)||p;else{D=n||a,_=0;for(P in D)D.hasOwnProperty(P)&&(H=M(a,P),H&&(y[_++]=F(P)+A+H))}return c.pop(),r&&y.length?O?S+C+I(y.join(N),r)+C+x:w+C+I(y.join(N),r)+C+E:O?S+y.join(T)+x:w+y.join(T)+E}if(t===undefined)return undefined;var i=s(n)?n:null,f=a.call(r).match(/String|Number/)||[],l=e.JSON.dateToString,c=[],y,A,O;P={},H=e.JSON.charCacheThreshold;if(i||!u(n))n=undefined;if(n){y={};for(A=0,O=n.length;A=0;--v){o=t[v];for(s in o)o.hasOwnProperty(s)&&(u=d({},o[s],g),h=u.value,m=u.cloneDefaultValue,h&&(m===undefined&&(f===h.constructor||r.isArray(h))||m===l||m===!0?u.value=e.clone(h):m===c&&(u.value=e.merge(h))),p=null,s.indexOf(i)!==-1&&(p=s.split(i),s=p.shift()),y=b[s],p&&y&&y.value?n.setValue(y.value,p,h):p||(y?(y.valueFn&&a in u&&(y.valueFn=null),d(y,u,g)):b[s]=u))}return b},_initHierarchy:function(e){var t=this._lazyAddAttrs,n,r,i,s,o,a,f,l=this._getClasses(),c=this._getAttrCfgs(),h=l.length-1;for(i=h;i>=0;i--){n=l[i],r=n.prototype,f=n._yuibuild&&n._yuibuild.exts;if(f)for(s=0,o=f.length;s=0}},entries:{readOnly:!0,getter:"_getEntries"}}}),e.extend(i,e.Base,{_entries:null,initializer:function(e){this.publish("add",{defaultFn:this._defAddFn}),this.publish("flush",{defaultFn:this._defFlushFn}),this._entries=[]},destructor:function(){this._entries=[]},_setMax:function(e){var t=this._entries;if(e>0){if(t)while(t.length>e)t.shift()}else e=0,this._entries=[];return e},_getSize:function(){return this._entries.length},_getEntries:function(){return this._entries},_defAddFn:function(e){var t=this._entries,r=e.entry,i=this.get("max"),s;this.get("uniqueKeys")&&(s=this._position(e.entry.request),n.isValue(s)&&t.splice(s,1));while(i&&t.length>=i)t.shift();t[t.length]=r},_defFlushFn:function(e){var t=this._entries,r=e.details[0],i;r&&n.isValue(r.request)?(i=this._position(r.request),n.isValue(i)&&t.splice(i,1)):this._entries=[]},_isMatch:function(e,t){return!t.expires||new Date0)for(;r>=0;r--)if(this._isMatch(e,t[r]))return r;return null},add:function(e,t){var i=this.get("expires");this.get("initialized")&&(this.get("max")===null||this.get("max")>0)&&(n.isValue(e)||n.isNull(e)||n.isUndefined(e))&&this.fire("add",{entry:{request:e,response:t,cached:new Date,expires:r(i)?i:i?new Date((new Date).getTime()+this.get("expires")):null}})},flush:function(e){this.fire("flush",{request:n.isValue(e)?e:null})},retrieve:function(e){var t=this._entries,r=t.length,i=null,s;if(r>0&&(this.get("max")===null||this.get("max")>0)){this.fire("request",{request:e}),s=this._position(e);if(n.isValue(s))return i=t[s],this.fire("retrieve",{entry:i}),s-1;--n)t=r.key(n),t.indexOf(this.get("sandbox"))===0&&r.removeItem(t)},retrieve:function(e){this.fire("request",{request:e});var t,n,s;try{s=this.get("sandbox")+i.stringify({request:e});try{t=i.parse(r.getItem(s))}catch(o){}}catch(u){}if(t){t.cached=new Date(t.cached),n=t.expires,n=n?new Date(n):null,t.expires=n;if(this._isMatch(e,t))return this.fire("retrieve",{entry:t}),t}return null}}:{_setMax:function(e){return null}}),e.CacheOffline=n},"3.8.0",{requires:["cache-base","json"]});