//>>built
define("dojox/io/OAuth","dojo/_base/kernel dojo/_base/lang dojo/_base/array dojo/_base/xhr dojo/dom dojox/encoding/digests/SHA1".split(" "),function(g,v,w,n,x,p){g.getObject("io.OAuth",!0,dojox);dojox.io.OAuth=new function(){function q(b,d){for(var a=d.consumer.key,c="",e=0;16>e;e++)c+="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz".charAt(Math.floor(61*Math.random()));a={oauth_consumer_key:a,oauth_nonce:c,oauth_signature_method:d.sig_method||"HMAC-SHA1",oauth_timestamp:Math.floor((new Date).valueOf()/
1E3)-2,oauth_version:"1.0"};d.token&&(a.oauth_token=d.token.key);b.content=g.mixin(b.content||{},a)}function r(b){var d=[{}];if(b.form){b.content||(b.content={});var a=g.byId(b.form);var c=a.getAttributeNode("action");b.url=b.url||(c?c.value:null);a=g.formToObject(a);delete b.form}a&&d.push(a);b.content&&d.push(b.content);c="source protocol authority userInfo user password host port relative path directory file query anchor".split(" ");var e=/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(b.url);
a={};for(var f=c.length;f--;)a[c[f]]=e[f]||"";c=a.protocol.toLowerCase();e=a.authority.toLowerCase();("http"==c&&80==a.port||"https"==c&&443==a.port)&&-1<e.lastIndexOf(":")&&(e=e.substring(0,e.lastIndexOf(":")));a.url=c+"://"+e+(a.path||"/");if(a.query){c=g.queryToObject(a.query);for(var h in c)c[h]=encodeURIComponent(c[h]);d.push(c)}b._url=a.url;a=[];c=0;for(e=d.length;c<e;c++)for(h in f=d[c],f)if(g.isArray(f[h]))for(var l=0,t=f.length;l<t;l++)a.push([h,f[l]]);else a.push([h,f[h]]);b._parameters=
a;return b}function u(b,d,a){q(d,a);r(d);a=d._parameters;a.sort(function(c,e){return c[0]>e[0]?1:c[0]<e[0]?-1:c[1]>e[1]?1:c[1]<e[1]?-1:0});a=g.map(a,function(c){return k(c[0])+"\x3d"+k((""+c[1]).length?c[1]:"")}).join("\x26");return b.toUpperCase()+"\x26"+k(d._url)+"\x26"+k(a)}function m(b,d,a){var c=k(a.consumer.secret)+"\x26"+(a.token&&a.token.secret?k(a.token.secret):"");b=u(b,d,a);if((a=a.sig_method||"HMAC-SHA1","PLAINTEXT"!=a)&&"HMAC-SHA1"!=a)throw Error("dojox.io.OAuth: the only supported signature encodings are PLAINTEXT and HMAC-SHA1.");
c="PLAINTEXT"==a?c:p._hmac(b,c);d.content.oauth_signature=c;return d}var k=this.encode=function(b){return(""+b).length?encodeURIComponent(b).replace(/!/g,"%21").replace(/\*/g,"%2A").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29"):""};this.decode=function(b){var d=[];b=b.split("\x26");for(var a=0,c=b.length;a<c;a++)if(""!=b[a])if(-1<b[a].indexOf("\x3d")){var e=b[a].split("\x3d");d.push([decodeURIComponent(e[0]),decodeURIComponent(e[1])])}else d.push([decodeURIComponent(b[a]),null]);return d};
this.sign=function(b,d,a){return m(b,d,a)};this.xhr=function(b,d,a,c){m(b,d,a);return n(b,d,c)};this.xhrGet=function(b,d){return this.xhr("GET",b,d)};this.xhrPost=this.xhrRawPost=function(b,d){return this.xhr("POST",b,d,!0)};this.xhrPut=this.xhrRawPut=function(b,d){return this.xhr("PUT",b,d,!0)};this.xhrDelete=function(b,d){return this.xhr("DELETE",b,d)}};return dojox.io.OAuth});