//>>built
define("dojox/data/PicasaStore","dojo/_base/lang dojo/_base/declare dojo/_base/connect dojo/io/script dojo/data/util/simpleFetch dojo/date/stamp".split(" "),function(g,d,h,k,l,f){d=d("dojox.data.PicasaStore",null,{constructor:function(a){a&&a.label&&(this.label=a.label);a&&"urlPreventCache"in a&&(this.urlPreventCache=a.urlPreventCache?!0:!1);a&&"maxResults"in a&&(this.maxResults=parseInt(a.maxResults),this.maxResults||(this.maxResults=20))},_picasaUrl:"http://picasaweb.google.com/data/feed/api/all",
_storeRef:"_S",label:"title",urlPreventCache:!1,maxResults:20,_assertIsItem:function(a){if(!this.isItem(a))throw Error("dojox.data.PicasaStore: a function was passed an item argument that was not an item");},_assertIsAttribute:function(a){if("string"!==typeof a)throw Error("dojox.data.PicasaStore: a function was passed an attribute argument that was not an attribute name string");},getFeatures:function(){return{"dojo.data.api.Read":!0}},getValue:function(a,b,e){return(a=this.getValues(a,b))&&0<a.length?
a[0]:e},getAttributes:function(a){return"id published updated category title$type title summary$type summary rights$type rights link author gphoto$id gphoto$name location imageUrlSmall imageUrlMedium imageUrl datePublished dateTaken description".split(" ")},hasAttribute:function(a,b){return this.getValue(a,b)?!0:!1},isItemLoaded:function(a){return this.isItem(a)},loadItem:function(a){},getLabel:function(a){return this.getValue(a,this.label)},getLabelAttributes:function(a){return[this.label]},containsValue:function(a,
b,e){a=this.getValues(a,b);for(b=0;b<a.length;b++)if(a[b]===e)return!0;return!1},getValues:function(a,b){this._assertIsItem(a);this._assertIsAttribute(b);return"title"===b?[this._unescapeHtml(a.title)]:"author"===b?[this._unescapeHtml(a.author[0].name)]:"datePublished"===b?[dateAtamp.fromISOString(a.published)]:"dateTaken"===b?[f.fromISOString(a.published)]:"updated"===b?[f.fromISOString(a.updated)]:"imageUrlSmall"===b?[a.media.thumbnail[1].url]:"imageUrl"===b?[a.content$src]:"imageUrlMedium"===b?
[a.media.thumbnail[2].url]:"link"===b?[a.link[1]]:"tags"===b?a.tags.split(" "):"description"===b?[this._unescapeHtml(a.summary)]:[]},isItem:function(a){return a&&a[this._storeRef]===this?!0:!1},close:function(a){},_fetchItems:function(a,b,e){a.query||(a.query={});var c={alt:"jsonm",pp:"1",psc:"G","start-index":"1"};a.query.start&&(c["start-index"]=a.query.start);a.query.tags&&(c.q=a.query.tags);a.query.userid&&(c.uname=a.query.userid);a.query.userids&&(c.ids=a.query.userids);a.query.lang&&(c.hl=a.query.lang);
c["max-results"]=this.maxResults;var d=this;k.get({url:this._picasaUrl,preventCache:this.urlPreventCache,content:c,callbackParamName:"callback",handle:function(c){b(d._processPicasaData(c),a)}}).addErrback(function(b){h.disconnect(null);e(b,a)})},_processPicasaData:function(a){var b=[];if(a.feed)for(b=a.feed.entry,a=0;a<b.length;a++)b[a][this._storeRef]=this;return b},_unescapeHtml:function(a){a&&(a=a.replace(/&amp;/gm,"\x26").replace(/&lt;/gm,"\x3c").replace(/&gt;/gm,"\x3e").replace(/&quot;/gm,'"'),
a=a.replace(/&#39;/gm,"'"));return a}});g.extend(d,l);return d});