aed-mapa/web/js/osmauth.min.js

2 wiersze
52 KiB
JavaScript

!function(f){"object"==typeof exports&&"undefined"!=typeof module?module.exports=f():"function"==typeof define&&define.amd?define([],f):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).osmAuth=f()}(function(){var define,module,exports;return function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var p="function"==typeof require&&require;if(!f&&p)return p(i,!0);if(u)return u(i,!0);throw(p=new Error("Cannot find module '"+i+"'")).code="MODULE_NOT_FOUND",p}p=n[i]={exports:{}},e[i][0].call(p.exports,function(r){return o(e[i][1][r]||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}({1:[function(require,module,exports){"use strict";var ohauth=require("ohauth"),resolveUrl=require("resolve-url"),store=require("store"),hasOwnProperty=Object.prototype.hasOwnProperty;function xtend(){for(var target={},i=0;i<arguments.length;i++){var key,source=arguments[i];for(key in source)hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target}module.exports=function(o){var storage,token,oauth={};function timenonce(o){return o.oauth_timestamp=ohauth.timestamp(),o.oauth_nonce=ohauth.nonce(),o}function getAuth(o){return{oauth_consumer_key:o.oauth_consumer_key,oauth_signature_method:"HMAC-SHA1"}}return oauth.authenticated=function(){return!(!token("oauth_token")||!token("oauth_token_secret"))},oauth.logout=function(){return token("oauth_token",""),token("oauth_token_secret",""),token("oauth_request_token_secret",""),oauth},oauth.authenticate=function(callback){if(oauth.authenticated())return callback();oauth.logout();var params=timenonce(getAuth(o)),url=o.url+"/oauth/request_token";if(params.oauth_signature=ohauth.signature(o.oauth_secret,"",ohauth.baseString("POST",url,params)),!o.singlepage){var w=600,error=550,error=[["width",w],["height",error],["left",screen.width/2-w/2],["top",screen.height/2-error/2]].map(function(x){return x.join("=")}).join(","),popup=window.open("about:blank","oauth_window",error);if(!(oauth.popupWindow=popup)){error=new Error("Popup was blocked");throw error.status="popup-blocked",error}}function get_access_token(oauth_token){var url=o.url+"/oauth/access_token",params=timenonce(getAuth(o)),request_token_secret=token("oauth_request_token_secret");params.oauth_token=oauth_token,params.oauth_signature=ohauth.signature(o.oauth_secret,request_token_secret,ohauth.baseString("POST",url,params)),ohauth.xhr("POST",url,params,null,{},accessTokenDone),o.loading()}function accessTokenDone(err,access_token){if(o.done(),err)return callback(err);access_token=ohauth.stringQs(access_token.response);token("oauth_token",access_token.oauth_token),token("oauth_token_secret",access_token.oauth_token_secret),callback(null,oauth)}ohauth.xhr("POST",url,params,null,{},function(err,authorize_url){if(o.done(),err)return callback(err);authorize_url=ohauth.stringQs(authorize_url.response);token("oauth_request_token_secret",authorize_url.oauth_token_secret);authorize_url=o.url+"/oauth/authorize?"+ohauth.qsString({oauth_token:authorize_url.oauth_token,oauth_callback:resolveUrl(o.landing)});o.singlepage?location.href=authorize_url:popup.location=authorize_url}),o.loading(),window.authComplete=function(token){get_access_token(ohauth.stringQs(token.split("?")[1]).oauth_token),delete window.authComplete}},oauth.bringPopupWindowToFront=function(){var brougtPopupToFront=!1;try{oauth.popupWindow&&!oauth.popupWindow.closed&&(oauth.popupWindow.focus(),brougtPopupToFront=!0)}catch(err){}return brougtPopupToFront},oauth.bootstrapToken=function(oauth_token,callback){function accessTokenDone(err,access_token){if(o.done(),err)return callback(err);access_token=ohauth.stringQs(access_token.response);token("oauth_token",access_token.oauth_token),token("oauth_token_secret",access_token.oauth_token_secret),callback(null,oauth)}!function(oauth_token){var url=o.url+"/oauth/access_token",params=timenonce(getAuth(o)),request_token_secret=token("oauth_request_token_secret");params.oauth_token=oauth_token,params.oauth_signature=ohauth.signature(o.oauth_secret,request_token_secret,ohauth.baseString("POST",url,params)),ohauth.xhr("POST",url,params,null,{},accessTokenDone),o.loading()}(oauth_token)},oauth.xhr=function(options,callback){return oauth.authenticated()?run():o.auto?oauth.authenticate(run):void callback("not authenticated",null);function run(){var params=timenonce(getAuth(o)),oauth_token_secret=token("oauth_token_secret"),url=!1!==options.prefix?o.url+options.path:options.path,query=url.replace(/#.*$/,"").split("?",2),base_url=query[0],query=2===query.length?query[1]:"";return options.options&&options.options.header&&"application/x-www-form-urlencoded"!==options.options.header["Content-Type"]||!options.content||(params=xtend(params,ohauth.stringQs(options.content))),params.oauth_token=token("oauth_token"),params.oauth_signature=ohauth.signature(o.oauth_secret,oauth_token_secret,ohauth.baseString(options.method,base_url,xtend(params,ohauth.stringQs(query)))),ohauth.xhr(options.method,url,params,options.content,options.options,done)}function done(err,xhr){return err?callback(err):xhr.responseXML?callback(err,xhr.responseXML):callback(err,xhr.response)}},oauth.preauth=function(c){if(c)return c.oauth_token&&token("oauth_token",c.oauth_token),c.oauth_token_secret&&token("oauth_token_secret",c.oauth_token_secret),oauth},oauth.options=function(_){return arguments.length?((o=_).url=o.url||"https://www.openstreetmap.org",o.landing=o.landing||"land.html",o.singlepage=o.singlepage||!1,o.loading=o.loading||function(){},o.done=o.done||function(){},oauth.preauth(o)):o},token=store.enabled?function(x,y){return 1===arguments.length?store.get(o.url+x):2===arguments.length?store.set(o.url+x,y):void 0}:(storage={},function(x,y){return 1===arguments.length?storage[o.url+x]:2===arguments.length?storage[o.url+x]=y:void 0}),oauth.options(o),oauth}},{ohauth:3,"resolve-url":4,store:5}],2:[function(require,module,exports){(function(global){(function(){!function(){var Hashes,window,freeExports;function utf8Encode(str){var x,y,l,output="",i=-1;if(str&&str.length)for(l=str.length;(i+=1)<l;)x=str.charCodeAt(i),y=i+1<l?str.charCodeAt(i+1):0,55296<=x&&x<=56319&&56320<=y&&y<=57343&&(x=65536+((1023&x)<<10)+(1023&y),i+=1),x<=127?output+=String.fromCharCode(x):x<=2047?output+=String.fromCharCode(192|x>>>6&31,128|63&x):x<=65535?output+=String.fromCharCode(224|x>>>12&15,128|x>>>6&63,128|63&x):x<=2097151&&(output+=String.fromCharCode(240|x>>>18&7,128|x>>>12&63,128|x>>>6&63,128|63&x));return output}function safe_add(x,y){var lsw=(65535&x)+(65535&y);return(x>>16)+(y>>16)+(lsw>>16)<<16|65535&lsw}function bit_rol(num,cnt){return num<<cnt|num>>>32-cnt}function rstr2hex(input,hexcase){for(var x,hex_tab=hexcase?"0123456789ABCDEF":"0123456789abcdef",output="",i=0,l=input.length;i<l;i+=1)x=input.charCodeAt(i),output+=hex_tab.charAt(x>>>4&15)+hex_tab.charAt(15&x);return output}function binb2rstr(input){for(var l=32*input.length,output="",i=0;i<l;i+=8)output+=String.fromCharCode(input[i>>5]>>>24-i%32&255);return output}function binl2rstr(input){for(var l=32*input.length,output="",i=0;i<l;i+=8)output+=String.fromCharCode(input[i>>5]>>>i%32&255);return output}function rstr2binl(input){for(var l=8*input.length,output=Array(input.length>>2),lo=output.length,i=0;i<lo;i+=1)output[i]=0;for(i=0;i<l;i+=8)output[i>>5]|=(255&input.charCodeAt(i/8))<<i%32;return output}function rstr2binb(input){for(var l=8*input.length,output=Array(input.length>>2),lo=output.length,i=0;i<lo;i+=1)output[i]=0;for(i=0;i<l;i+=8)output[i>>5]|=(255&input.charCodeAt(i/8))<<24-i%32;return output}function rstr2any(input,encoding){for(var q,x,quotient,output,full_length,divisor=encoding.length,remainders=Array(),dividend=Array(Math.ceil(input.length/2)),ld=dividend.length,i=0;i<ld;i+=1)dividend[i]=input.charCodeAt(2*i)<<8|input.charCodeAt(2*i+1);for(;0<dividend.length;){for(quotient=Array(),i=x=0;i<dividend.length;i+=1)x=(x<<16)+dividend[i],x-=(q=Math.floor(x/divisor))*divisor,(0<quotient.length||0<q)&&(quotient[quotient.length]=q);remainders[remainders.length]=x,dividend=quotient}for(output="",i=remainders.length-1;0<=i;i--)output+=encoding.charAt(remainders[i]);for(full_length=Math.ceil(8*input.length/(Math.log(encoding.length)/Math.log(2))),i=output.length;i<full_length;i+=1)output=encoding[0]+output;return output}function rstr2b64(input,b64pad){var i,j,triplet,output="",len=input.length;for(b64pad=b64pad||"=",i=0;i<len;i+=3)for(triplet=input.charCodeAt(i)<<16|(i+1<len?input.charCodeAt(i+1)<<8:0)|(i+2<len?input.charCodeAt(i+2):0),j=0;j<4;j+=1)8*i+6*j>8*input.length?output+=b64pad:output+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(triplet>>>6*(3-j)&63);return output}Hashes={VERSION:"1.0.6",Base64:function(){var tab="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",pad="=",utf8=!0;this.encode=function(input){var i,j,triplet,output="",len=input.length;for(pad=pad||"=",input=utf8?utf8Encode(input):input,i=0;i<len;i+=3)for(triplet=input.charCodeAt(i)<<16|(i+1<len?input.charCodeAt(i+1)<<8:0)|(i+2<len?input.charCodeAt(i+2):0),j=0;j<4;j+=1)output+=8*len<8*i+6*j?pad:tab.charAt(triplet>>>6*(3-j)&63);return output},this.decode=function(input){var i,o1,o2,h3,h4,o3,ac,dec="",arr=[];if(!input)return input;for(i=ac=0,input=input.replace(new RegExp("\\"+pad,"gi"),"");o1=(o3=tab.indexOf(input.charAt(i+=1))<<18|tab.indexOf(input.charAt(i+=1))<<12|(h3=tab.indexOf(input.charAt(i+=1)))<<6|(h4=tab.indexOf(input.charAt(i+=1))))>>16&255,o2=o3>>8&255,o3=255&o3,arr[ac+=1]=64===h3?String.fromCharCode(o1):64===h4?String.fromCharCode(o1,o2):String.fromCharCode(o1,o2,o3),i<input.length;);return dec=arr.join(""),dec=utf8?function(str){var ac,c1,c2,c3,l,arr=[],i=ac=c2=0;if(str&&str.length)for(l=str.length,str+="";i<l;)ac+=1,(c1=str.charCodeAt(i))<128?(arr[ac]=String.fromCharCode(c1),i+=1):191<c1&&c1<224?(c2=str.charCodeAt(i+1),arr[ac]=String.fromCharCode((31&c1)<<6|63&c2),i+=2):(c2=str.charCodeAt(i+1),c3=str.charCodeAt(i+2),arr[ac]=String.fromCharCode((15&c1)<<12|(63&c2)<<6|63&c3),i+=3);return arr.join("")}(dec):dec},this.setPad=function(str){return pad=str||pad,this},this.setTab=function(str){return tab=str||tab,this},this.setUTF8=function(bool){return"boolean"==typeof bool&&(utf8=bool),this}},CRC32:function(str){var y,table,i,iTop,crc=0;for(str=utf8Encode(str),table=["00000000 77073096 EE0E612C 990951BA 076DC419 706AF48F E963A535 9E6495A3 0EDB8832 ","79DCB8A4 E0D5E91E 97D2D988 09B64C2B 7EB17CBD E7B82D07 90BF1D91 1DB71064 6AB020F2 F3B97148 ","84BE41DE 1ADAD47D 6DDDE4EB F4D4B551 83D385C7 136C9856 646BA8C0 FD62F97A 8A65C9EC 14015C4F ","63066CD9 FA0F3D63 8D080DF5 3B6E20C8 4C69105E D56041E4 A2677172 3C03E4D1 4B04D447 D20D85FD ","A50AB56B 35B5A8FA 42B2986C DBBBC9D6 ACBCF940 32D86CE3 45DF5C75 DCD60DCF ABD13D59 26D930AC ","51DE003A C8D75180 BFD06116 21B4F4B5 56B3C423 CFBA9599 B8BDA50F 2802B89E 5F058808 C60CD9B2 ","B10BE924 2F6F7C87 58684C11 C1611DAB B6662D3D 76DC4190 01DB7106 98D220BC EFD5102A 71B18589 ","06B6B51F 9FBFE4A5 E8B8D433 7807C9A2 0F00F934 9609A88E E10E9818 7F6A0DBB 086D3D2D 91646C97 ","E6635C01 6B6B51F4 1C6C6162 856530D8 F262004E 6C0695ED 1B01A57B 8208F4C1 F50FC457 65B0D9C6 ","12B7E950 8BBEB8EA FCB9887C 62DD1DDF 15DA2D49 8CD37CF3 FBD44C65 4DB26158 3AB551CE A3BC0074 ","D4BB30E2 4ADFA541 3DD895D7 A4D1C46D D3D6F4FB 4369E96A 346ED9FC AD678846 DA60B8D0 44042D73 ","33031DE5 AA0A4C5F DD0D7CC9 5005713C 270241AA BE0B1010 C90C2086 5768B525 206F85B3 B966D409 ","CE61E49F 5EDEF90E 29D9C998 B0D09822 C7D7A8B4 59B33D17 2EB40D81 B7BD5C3B C0BA6CAD EDB88320 ","9ABFB3B6 03B6E20C 74B1D29A EAD54739 9DD277AF 04DB2615 73DC1683 E3630B12 94643B84 0D6D6A3E ","7A6A5AA8 E40ECF0B 9309FF9D 0A00AE27 7D079EB1 F00F9344 8708A3D2 1E01F268 6906C2FE F762575D ","806567CB 196C3671 6E6B06E7 FED41B76 89D32BE0 10DA7A5A 67DD4ACC F9B9DF6F 8EBEEFF9 17B7BE43 ","60B08ED5 D6D6A3E8 A1D1937E 38D8C2C4 4FDFF252 D1BB67F1 A6BC5767 3FB506DD 48B2364B D80D2BDA ","AF0A1B4C 36034AF6 41047A60 DF60EFC3 A867DF55 316E8EEF 4669BE79 CB61B38C BC66831A 256FD2A0 ","5268E236 CC0C7795 BB0B4703 220216B9 5505262F C5BA3BBE B2BD0B28 2BB45A92 5CB36A04 C2D7FFA7 ","B5D0CF31 2CD99E8B 5BDEAE1D 9B64C2B0 EC63F226 756AA39C 026D930A 9C0906A9 EB0E363F 72076785 ","05005713 95BF4A82 E2B87A14 7BB12BAE 0CB61B38 92D28E9B E5D5BE0D 7CDCEFB7 0BDBDF21 86D3D2D4 ","F1D4E242 68DDB3F8 1FDA836E 81BE16CD F6B9265B 6FB077E1 18B74777 88085AE6 FF0F6A70 66063BCA ","11010B5C 8F659EFF F862AE69 616BFFD3 166CCF45 A00AE278 D70DD2EE 4E048354 3903B3C2 A7672661 ","D06016F7 4969474D 3E6E77DB AED16A4A D9D65ADC 40DF0B66 37D83BF0 A9BCAE53 DEBB9EC5 47B2CF7F ","30B5FFE9 BDBDF21C CABAC28A 53B39330 24B4A3A6 BAD03605 CDD70693 54DE5729 23D967BF B3667A2E ","C4614AB8 5D681B02 2A6F2B94 B40BBE37 C30C8EA1 5A05DF1B 2D02EF8D"].join(""),crc^=-1,i=0,iTop=str.length;i<iTop;i+=1)y=255&(crc^str.charCodeAt(i)),crc=crc>>>8^"0x"+table.substr(9*y,8);return(-1^crc)>>>0},MD5:function(options){var hexcase=!(!options||"boolean"!=typeof options.uppercase)&&options.uppercase,b64pad=options&&"string"==typeof options.pad?options.pad:"=",utf8=!options||"boolean"!=typeof options.utf8||options.utf8;function rstr(s){return binl2rstr(binl(rstr2binl(s=utf8?utf8Encode(s):s),8*s.length))}function rstr_hmac(key,hash){var bkey,ipad,opad,i;for(key=utf8?utf8Encode(key):key,hash=utf8?utf8Encode(hash):hash,16<(bkey=rstr2binl(key)).length&&(bkey=binl(bkey,8*key.length)),ipad=Array(16),opad=Array(16),i=0;i<16;i+=1)ipad[i]=909522486^bkey[i],opad[i]=1549556828^bkey[i];return hash=binl(ipad.concat(rstr2binl(hash)),512+8*hash.length),binl2rstr(binl(opad.concat(hash),640))}function binl(x,len){var i,olda,oldb,oldc,oldd,a=1732584193,b=-271733879,c=-1732584194,d=271733878;for(x[len>>5]|=128<<len%32,x[14+(len+64>>>9<<4)]=len,i=0;i<x.length;i+=16)a=md5_ff(olda=a,oldb=b,oldc=c,oldd=d,x[i+0],7,-680876936),d=md5_ff(d,a,b,c,x[i+1],12,-389564586),c=md5_ff(c,d,a,b,x[i+2],17,606105819),b=md5_ff(b,c,d,a,x[i+3],22,-1044525330),a=md5_ff(a,b,c,d,x[i+4],7,-176418897),d=md5_ff(d,a,b,c,x[i+5],12,1200080426),c=md5_ff(c,d,a,b,x[i+6],17,-1473231341),b=md5_ff(b,c,d,a,x[i+7],22,-45705983),a=md5_ff(a,b,c,d,x[i+8],7,1770035416),d=md5_ff(d,a,b,c,x[i+9],12,-1958414417),c=md5_ff(c,d,a,b,x[i+10],17,-42063),b=md5_ff(b,c,d,a,x[i+11],22,-1990404162),a=md5_ff(a,b,c,d,x[i+12],7,1804603682),d=md5_ff(d,a,b,c,x[i+13],12,-40341101),c=md5_ff(c,d,a,b,x[i+14],17,-1502002290),a=md5_gg(a,b=md5_ff(b,c,d,a,x[i+15],22,1236535329),c,d,x[i+1],5,-165796510),d=md5_gg(d,a,b,c,x[i+6],9,-1069501632),c=md5_gg(c,d,a,b,x[i+11],14,643717713),b=md5_gg(b,c,d,a,x[i+0],20,-373897302),a=md5_gg(a,b,c,d,x[i+5],5,-701558691),d=md5_gg(d,a,b,c,x[i+10],9,38016083),c=md5_gg(c,d,a,b,x[i+15],14,-660478335),b=md5_gg(b,c,d,a,x[i+4],20,-405537848),a=md5_gg(a,b,c,d,x[i+9],5,568446438),d=md5_gg(d,a,b,c,x[i+14],9,-1019803690),c=md5_gg(c,d,a,b,x[i+3],14,-187363961),b=md5_gg(b,c,d,a,x[i+8],20,1163531501),a=md5_gg(a,b,c,d,x[i+13],5,-1444681467),d=md5_gg(d,a,b,c,x[i+2],9,-51403784),c=md5_gg(c,d,a,b,x[i+7],14,1735328473),a=md5_hh(a,b=md5_gg(b,c,d,a,x[i+12],20,-1926607734),c,d,x[i+5],4,-378558),d=md5_hh(d,a,b,c,x[i+8],11,-2022574463),c=md5_hh(c,d,a,b,x[i+11],16,1839030562),b=md5_hh(b,c,d,a,x[i+14],23,-35309556),a=md5_hh(a,b,c,d,x[i+1],4,-1530992060),d=md5_hh(d,a,b,c,x[i+4],11,1272893353),c=md5_hh(c,d,a,b,x[i+7],16,-155497632),b=md5_hh(b,c,d,a,x[i+10],23,-1094730640),a=md5_hh(a,b,c,d,x[i+13],4,681279174),d=md5_hh(d,a,b,c,x[i+0],11,-358537222),c=md5_hh(c,d,a,b,x[i+3],16,-722521979),b=md5_hh(b,c,d,a,x[i+6],23,76029189),a=md5_hh(a,b,c,d,x[i+9],4,-640364487),d=md5_hh(d,a,b,c,x[i+12],11,-421815835),c=md5_hh(c,d,a,b,x[i+15],16,530742520),a=md5_ii(a,b=md5_hh(b,c,d,a,x[i+2],23,-995338651),c,d,x[i+0],6,-198630844),d=md5_ii(d,a,b,c,x[i+7],10,1126891415),c=md5_ii(c,d,a,b,x[i+14],15,-1416354905),b=md5_ii(b,c,d,a,x[i+5],21,-57434055),a=md5_ii(a,b,c,d,x[i+12],6,1700485571),d=md5_ii(d,a,b,c,x[i+3],10,-1894986606),c=md5_ii(c,d,a,b,x[i+10],15,-1051523),b=md5_ii(b,c,d,a,x[i+1],21,-2054922799),a=md5_ii(a,b,c,d,x[i+8],6,1873313359),d=md5_ii(d,a,b,c,x[i+15],10,-30611744),c=md5_ii(c,d,a,b,x[i+6],15,-1560198380),b=md5_ii(b,c,d,a,x[i+13],21,1309151649),a=md5_ii(a,b,c,d,x[i+4],6,-145523070),d=md5_ii(d,a,b,c,x[i+11],10,-1120210379),c=md5_ii(c,d,a,b,x[i+2],15,718787259),b=md5_ii(b,c,d,a,x[i+9],21,-343485551),a=safe_add(a,olda),b=safe_add(b,oldb),c=safe_add(c,oldc),d=safe_add(d,oldd);return Array(a,b,c,d)}function md5_cmn(q,a,b,x,s,t){return safe_add(bit_rol(safe_add(safe_add(a,q),safe_add(x,t)),s),b)}function md5_ff(a,b,c,d,x,s,t){return md5_cmn(b&c|~b&d,a,b,x,s,t)}function md5_gg(a,b,c,d,x,s,t){return md5_cmn(b&d|c&~d,a,b,x,s,t)}function md5_hh(a,b,c,d,x,s,t){return md5_cmn(b^c^d,a,b,x,s,t)}function md5_ii(a,b,c,d,x,s,t){return md5_cmn(c^(b|~d),a,b,x,s,t)}this.hex=function(s){return rstr2hex(rstr(s),hexcase)},this.b64=function(s){return rstr2b64(rstr(s),b64pad)},this.any=function(s,e){return rstr2any(rstr(s),e)},this.raw=rstr,this.hex_hmac=function(k,d){return rstr2hex(rstr_hmac(k,d),hexcase)},this.b64_hmac=function(k,d){return rstr2b64(rstr_hmac(k,d),b64pad)},this.any_hmac=function(k,d,e){return rstr2any(rstr_hmac(k,d),e)},this.vm_test=function(){return"900150983cd24fb0d6963f7d28e17f72"===hex("abc").toLowerCase()},this.setUpperCase=function(a){return"boolean"==typeof a&&(hexcase=a),this},this.setPad=function(a){return b64pad=a||b64pad,this},this.setUTF8=function(a){return"boolean"==typeof a&&(utf8=a),this}},SHA1:function(options){var hexcase=!(!options||"boolean"!=typeof options.uppercase)&&options.uppercase,b64pad=options&&"string"==typeof options.pad?options.pad:"=",utf8=!options||"boolean"!=typeof options.utf8||options.utf8;function rstr(s){return binb2rstr(binb(rstr2binb(s=utf8?utf8Encode(s):s),8*s.length))}function rstr_hmac(key,hash){var bkey,ipad,opad,i;for(key=utf8?utf8Encode(key):key,hash=utf8?utf8Encode(hash):hash,16<(bkey=rstr2binb(key)).length&&(bkey=binb(bkey,8*key.length)),ipad=Array(16),opad=Array(16),i=0;i<16;i+=1)ipad[i]=909522486^bkey[i],opad[i]=1549556828^bkey[i];return hash=binb(ipad.concat(rstr2binb(hash)),512+8*hash.length),binb2rstr(binb(opad.concat(hash),672))}function binb(x,len){var i,j,t,olda,oldb,oldc,oldd,olde,w=Array(80),a=1732584193,b=-271733879,c=-1732584194,d=271733878,e=-1009589776;for(x[len>>5]|=128<<24-len%32,x[15+(len+64>>9<<4)]=len,i=0;i<x.length;i+=16){for(olda=a,oldb=b,oldc=c,oldd=d,olde=e,j=0;j<80;j+=1)w[j]=j<16?x[i+j]:bit_rol(w[j-3]^w[j-8]^w[j-14]^w[j-16],1),t=safe_add(safe_add(bit_rol(a,5),function(t,b,c,d){if(t<20)return b&c|~b&d;if(t<40)return b^c^d;if(t<60)return b&c|b&d|c&d;return b^c^d}(j,b,c,d)),safe_add(safe_add(e,w[j]),function(t){return t<20?1518500249:t<40?1859775393:t<60?-1894007588:-899497514}(j))),e=d,d=c,c=bit_rol(b,30),b=a,a=t;a=safe_add(a,olda),b=safe_add(b,oldb),c=safe_add(c,oldc),d=safe_add(d,oldd),e=safe_add(e,olde)}return Array(a,b,c,d,e)}this.hex=function(s){return rstr2hex(rstr(s),hexcase)},this.b64=function(s){return rstr2b64(rstr(s),b64pad)},this.any=function(s,e){return rstr2any(rstr(s),e)},this.raw=rstr,this.hex_hmac=function(k,d){return rstr2hex(rstr_hmac(k,d))},this.b64_hmac=function(k,d){return rstr2b64(rstr_hmac(k,d),b64pad)},this.any_hmac=function(k,d,e){return rstr2any(rstr_hmac(k,d),e)},this.vm_test=function(){return"900150983cd24fb0d6963f7d28e17f72"===hex("abc").toLowerCase()},this.setUpperCase=function(a){return"boolean"==typeof a&&(hexcase=a),this},this.setPad=function(a){return b64pad=a||b64pad,this},this.setUTF8=function(a){return"boolean"==typeof a&&(utf8=a),this}},SHA256:function(options){options&&"boolean"==typeof options.uppercase&&options.uppercase;var sha256_K,b64pad=options&&"string"==typeof options.pad?options.pad:"=",utf8=!options||"boolean"!=typeof options.utf8||options.utf8;function rstr(s,utf8){return binb2rstr(binb(rstr2binb(s=utf8?utf8Encode(s):s),8*s.length))}function rstr_hmac(key,hash){key=utf8?utf8Encode(key):key,hash=utf8?utf8Encode(hash):hash;var i=0,bkey=rstr2binb(key),ipad=Array(16),opad=Array(16);for(16<bkey.length&&(bkey=binb(bkey,8*key.length));i<16;i+=1)ipad[i]=909522486^bkey[i],opad[i]=1549556828^bkey[i];return hash=binb(ipad.concat(rstr2binb(hash)),512+8*hash.length),binb2rstr(binb(opad.concat(hash),768))}function sha256_S(X,n){return X>>>n|X<<32-n}function binb(m,l){var a,b,c,d,e,f,g,h,i,j,T1,T2,HASH=[1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225],W=new Array(64);for(m[l>>5]|=128<<24-l%32,m[15+(l+64>>9<<4)]=l,i=0;i<m.length;i+=16){for(a=HASH[0],b=HASH[1],c=HASH[2],d=HASH[3],e=HASH[4],f=HASH[5],g=HASH[6],h=HASH[7],j=0;j<64;j+=1)W[j]=j<16?m[j+i]:safe_add(safe_add(safe_add(sha256_S(T2=W[j-2],17)^sha256_S(T2,19)^T2>>>10,W[j-7]),function(x){return sha256_S(x,7)^sha256_S(x,18)^x>>>3}(W[j-15])),W[j-16]),T1=safe_add(safe_add(safe_add(safe_add(h,function(x){return sha256_S(x,6)^sha256_S(x,11)^sha256_S(x,25)}(e)),function(x,y,z){return x&y^~x&z}(e,f,g)),sha256_K[j]),W[j]),T2=safe_add(function(x){return sha256_S(x,2)^sha256_S(x,13)^sha256_S(x,22)}(a),function(x,y,z){return x&y^x&z^y&z}(a,b,c)),h=g,g=f,f=e,e=safe_add(d,T1),d=c,c=b,b=a,a=safe_add(T1,T2);HASH[0]=safe_add(a,HASH[0]),HASH[1]=safe_add(b,HASH[1]),HASH[2]=safe_add(c,HASH[2]),HASH[3]=safe_add(d,HASH[3]),HASH[4]=safe_add(e,HASH[4]),HASH[5]=safe_add(f,HASH[5]),HASH[6]=safe_add(g,HASH[6]),HASH[7]=safe_add(h,HASH[7])}return HASH}this.hex=function(s){return rstr2hex(rstr(s,utf8))},this.b64=function(s){return rstr2b64(rstr(s,utf8),b64pad)},this.any=function(s,e){return rstr2any(rstr(s,utf8),e)},this.raw=function(s){return rstr(s,utf8)},this.hex_hmac=function(k,d){return rstr2hex(rstr_hmac(k,d))},this.b64_hmac=function(k,d){return rstr2b64(rstr_hmac(k,d),b64pad)},this.any_hmac=function(k,d,e){return rstr2any(rstr_hmac(k,d),e)},this.vm_test=function(){return"900150983cd24fb0d6963f7d28e17f72"===hex("abc").toLowerCase()},this.setUpperCase=function(a){return"boolean"==typeof a&&0,this},this.setPad=function(a){return b64pad=a||b64pad,this},this.setUTF8=function(a){return"boolean"==typeof a&&(utf8=a),this},sha256_K=[1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998]},SHA512:function(options){options&&"boolean"==typeof options.uppercase&&options.uppercase;var sha512_k,b64pad=options&&"string"==typeof options.pad?options.pad:"=",utf8=!options||"boolean"!=typeof options.utf8||options.utf8;function rstr(s){return binb2rstr(binb(rstr2binb(s=utf8?utf8Encode(s):s),8*s.length))}function rstr_hmac(key,hash){key=utf8?utf8Encode(key):key,hash=utf8?utf8Encode(hash):hash;var i=0,bkey=rstr2binb(key),ipad=Array(32),opad=Array(32);for(32<bkey.length&&(bkey=binb(bkey,8*key.length));i<32;i+=1)ipad[i]=909522486^bkey[i],opad[i]=1549556828^bkey[i];return hash=binb(ipad.concat(rstr2binb(hash)),1024+8*hash.length),binb2rstr(binb(opad.concat(hash),1536))}function binb(x,len){var j,i,l,W=new Array(80),hash=new Array(16),H=[new int64(1779033703,-205731576),new int64(-1150833019,-2067093701),new int64(1013904242,-23791573),new int64(-1521486534,1595750129),new int64(1359893119,-1377402159),new int64(-1694144372,725511199),new int64(528734635,-79577749),new int64(1541459225,327033209)],T1=new int64(0,0),T2=new int64(0,0),a=new int64(0,0),b=new int64(0,0),c=new int64(0,0),d=new int64(0,0),e=new int64(0,0),f=new int64(0,0),g=new int64(0,0),h=new int64(0,0),s0=new int64(0,0),s1=new int64(0,0),Ch=new int64(0,0),Maj=new int64(0,0),r1=new int64(0,0),r2=new int64(0,0),r3=new int64(0,0);for(void 0===sha512_k&&(sha512_k=[new int64(1116352408,-685199838),new int64(1899447441,602891725),new int64(-1245643825,-330482897),new int64(-373957723,-2121671748),new int64(961987163,-213338824),new int64(1508970993,-1241133031),new int64(-1841331548,-1357295717),new int64(-1424204075,-630357736),new int64(-670586216,-1560083902),new int64(310598401,1164996542),new int64(607225278,1323610764),new int64(1426881987,-704662302),new int64(1925078388,-226784913),new int64(-2132889090,991336113),new int64(-1680079193,633803317),new int64(-1046744716,-815192428),new int64(-459576895,-1628353838),new int64(-272742522,944711139),new int64(264347078,-1953704523),new int64(604807628,2007800933),new int64(770255983,1495990901),new int64(1249150122,1856431235),new int64(1555081692,-1119749164),new int64(1996064986,-2096016459),new int64(-1740746414,-295247957),new int64(-1473132947,766784016),new int64(-1341970488,-1728372417),new int64(-1084653625,-1091629340),new int64(-958395405,1034457026),new int64(-710438585,-1828018395),new int64(113926993,-536640913),new int64(338241895,168717936),new int64(666307205,1188179964),new int64(773529912,1546045734),new int64(1294757372,1522805485),new int64(1396182291,-1651133473),new int64(1695183700,-1951439906),new int64(1986661051,1014477480),new int64(-2117940946,1206759142),new int64(-1838011259,344077627),new int64(-1564481375,1290863460),new int64(-1474664885,-1136513023),new int64(-1035236496,-789014639),new int64(-949202525,106217008),new int64(-778901479,-688958952),new int64(-694614492,1432725776),new int64(-200395387,1467031594),new int64(275423344,851169720),new int64(430227734,-1194143544),new int64(506948616,1363258195),new int64(659060556,-544281703),new int64(883997877,-509917016),new int64(958139571,-976659869),new int64(1322822218,-482243893),new int64(1537002063,2003034995),new int64(1747873779,-692930397),new int64(1955562222,1575990012),new int64(2024104815,1125592928),new int64(-2067236844,-1578062990),new int64(-1933114872,442776044),new int64(-1866530822,593698344),new int64(-1538233109,-561857047),new int64(-1090935817,-1295615723),new int64(-965641998,-479046869),new int64(-903397682,-366583396),new int64(-779700025,566280711),new int64(-354779690,-840897762),new int64(-176337025,-294727304),new int64(116418474,1914138554),new int64(174292421,-1563912026),new int64(289380356,-1090974290),new int64(460393269,320620315),new int64(685471733,587496836),new int64(852142971,1086792851),new int64(1017036298,365543100),new int64(1126000580,-1676669620),new int64(1288033470,-885112138),new int64(1501505948,-60457430),new int64(1607167915,987167468),new int64(1816402316,1246189591)]),i=0;i<80;i+=1)W[i]=new int64(0,0);for(x[len>>5]|=128<<24-(31&len),x[31+(len+128>>10<<5)]=len,l=x.length,i=0;i<l;i+=32){for(int64copy(a,H[0]),int64copy(b,H[1]),int64copy(c,H[2]),int64copy(d,H[3]),int64copy(e,H[4]),int64copy(f,H[5]),int64copy(g,H[6]),int64copy(h,H[7]),j=0;j<16;j+=1)W[j].h=x[i+2*j],W[j].l=x[i+2*j+1];for(j=16;j<80;j+=1)int64rrot(r1,W[j-2],19),int64revrrot(r2,W[j-2],29),int64shr(r3,W[j-2],6),s1.l=r1.l^r2.l^r3.l,s1.h=r1.h^r2.h^r3.h,int64rrot(r1,W[j-15],1),int64rrot(r2,W[j-15],8),int64shr(r3,W[j-15],7),s0.l=r1.l^r2.l^r3.l,s0.h=r1.h^r2.h^r3.h,function(dst,b,w3){var w0=(65535&s1.l)+(65535&b.l)+(65535&s0.l)+(65535&w3.l),w1=(s1.l>>>16)+(b.l>>>16)+(s0.l>>>16)+(w3.l>>>16)+(w0>>>16),w2=(65535&s1.h)+(65535&b.h)+(65535&s0.h)+(65535&w3.h)+(w1>>>16),w3=(s1.h>>>16)+(b.h>>>16)+(s0.h>>>16)+(w3.h>>>16)+(w2>>>16);dst.l=65535&w0|w1<<16,dst.h=65535&w2|w3<<16}(W[j],W[j-7],W[j-16]);for(j=0;j<80;j+=1)Ch.l=e.l&f.l^~e.l&g.l,Ch.h=e.h&f.h^~e.h&g.h,int64rrot(r1,e,14),int64rrot(r2,e,18),int64revrrot(r3,e,9),s1.l=r1.l^r2.l^r3.l,s1.h=r1.h^r2.h^r3.h,int64rrot(r1,a,28),int64revrrot(r2,a,2),int64revrrot(r3,a,7),s0.l=r1.l^r2.l^r3.l,s0.h=r1.h^r2.h^r3.h,Maj.l=a.l&b.l^a.l&c.l^b.l&c.l,Maj.h=a.h&b.h^a.h&c.h^b.h&c.h,function(dst,d,w3){var w0=(65535&h.l)+(65535&s1.l)+(65535&Ch.l)+(65535&d.l)+(65535&w3.l),w1=(h.l>>>16)+(s1.l>>>16)+(Ch.l>>>16)+(d.l>>>16)+(w3.l>>>16)+(w0>>>16),w2=(65535&h.h)+(65535&s1.h)+(65535&Ch.h)+(65535&d.h)+(65535&w3.h)+(w1>>>16),w3=(h.h>>>16)+(s1.h>>>16)+(Ch.h>>>16)+(d.h>>>16)+(w3.h>>>16)+(w2>>>16);dst.l=65535&w0|w1<<16,dst.h=65535&w2|w3<<16}(T1,sha512_k[j],W[j]),int64add(T2,s0,Maj),int64copy(h,g),int64copy(g,f),int64copy(f,e),int64add(e,d,T1),int64copy(d,c),int64copy(c,b),int64copy(b,a),int64add(a,T1,T2);int64add(H[0],H[0],a),int64add(H[1],H[1],b),int64add(H[2],H[2],c),int64add(H[3],H[3],d),int64add(H[4],H[4],e),int64add(H[5],H[5],f),int64add(H[6],H[6],g),int64add(H[7],H[7],h)}for(i=0;i<8;i+=1)hash[2*i]=H[i].h,hash[2*i+1]=H[i].l;return hash}function int64(h,l){this.h=h,this.l=l}function int64copy(dst,src){dst.h=src.h,dst.l=src.l}function int64rrot(dst,x,shift){dst.l=x.l>>>shift|x.h<<32-shift,dst.h=x.h>>>shift|x.l<<32-shift}function int64revrrot(dst,x,shift){dst.l=x.h>>>shift|x.l<<32-shift,dst.h=x.l>>>shift|x.h<<32-shift}function int64shr(dst,x,shift){dst.l=x.l>>>shift|x.h<<32-shift,dst.h=x.h>>>shift}function int64add(dst,x,w3){var w0=(65535&x.l)+(65535&w3.l),w1=(x.l>>>16)+(w3.l>>>16)+(w0>>>16),w2=(65535&x.h)+(65535&w3.h)+(w1>>>16),w3=(x.h>>>16)+(w3.h>>>16)+(w2>>>16);dst.l=65535&w0|w1<<16,dst.h=65535&w2|w3<<16}this.hex=function(s){return rstr2hex(rstr(s))},this.b64=function(s){return rstr2b64(rstr(s),b64pad)},this.any=function(s,e){return rstr2any(rstr(s),e)},this.raw=rstr,this.hex_hmac=function(k,d){return rstr2hex(rstr_hmac(k,d))},this.b64_hmac=function(k,d){return rstr2b64(rstr_hmac(k,d),b64pad)},this.any_hmac=function(k,d,e){return rstr2any(rstr_hmac(k,d),e)},this.vm_test=function(){return"900150983cd24fb0d6963f7d28e17f72"===hex("abc").toLowerCase()},this.setUpperCase=function(a){return"boolean"==typeof a&&0,this},this.setPad=function(a){return b64pad=a||b64pad,this},this.setUTF8=function(a){return"boolean"==typeof a&&(utf8=a),this}},RMD160:function(options){options&&"boolean"==typeof options.uppercase&&options.uppercase;var b64pad=options&&"string"==typeof options.pad?options.pa:"=",utf8=!options||"boolean"!=typeof options.utf8||options.utf8,rmd160_r1=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],rmd160_r2=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],rmd160_s1=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],rmd160_s2=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11];function rstr(s){return binl2rstr(binl(rstr2binl(s=utf8?utf8Encode(s):s),8*s.length))}function rstr_hmac(key,hash){key=utf8?utf8Encode(key):key,hash=utf8?utf8Encode(hash):hash;var i,bkey=rstr2binl(key),ipad=Array(16),opad=Array(16);for(16<bkey.length&&(bkey=binl(bkey,8*key.length)),i=0;i<16;i+=1)ipad[i]=909522486^bkey[i],opad[i]=1549556828^bkey[i];return hash=binl(ipad.concat(rstr2binl(hash)),512+8*hash.length),binl2rstr(binl(opad.concat(hash),672))}function binl2rstr(input){for(var output="",l=32*input.length,i=0;i<l;i+=8)output+=String.fromCharCode(input[i>>5]>>>i%32&255);return output}function binl(x,len){var T,j,i,l,A1,B1,C1,D1,E1,A2,B2,C2,D2,E2,h0=1732584193,h1=4023233417,h2=2562383102,h3=271733878,h4=3285377520;for(x[len>>5]|=128<<len%32,x[14+(len+64>>>9<<4)]=len,l=x.length,i=0;i<l;i+=16){for(A1=A2=h0,B1=B2=h1,C1=C2=h2,D1=D2=h3,E1=E2=h4,j=0;j<=79;j+=1)T=safe_add(A1,rmd160_f(j,B1,C1,D1)),T=safe_add(T,x[i+rmd160_r1[j]]),T=safe_add(T,function(j){return 0<=j&&j<=15?0:16<=j&&j<=31?1518500249:32<=j&&j<=47?1859775393:48<=j&&j<=63?2400959708:64<=j&&j<=79?2840853838:"rmd160_K1: j out of range"}(j)),T=safe_add(bit_rol(T,rmd160_s1[j]),E1),A1=E1,E1=D1,D1=bit_rol(C1,10),C1=B1,B1=T,T=safe_add(A2,rmd160_f(79-j,B2,C2,D2)),T=safe_add(T,x[i+rmd160_r2[j]]),T=safe_add(T,function(j){return 0<=j&&j<=15?1352829926:16<=j&&j<=31?1548603684:32<=j&&j<=47?1836072691:48<=j&&j<=63?2053994217:64<=j&&j<=79?0:"rmd160_K2: j out of range"}(j)),T=safe_add(bit_rol(T,rmd160_s2[j]),E2),A2=E2,E2=D2,D2=bit_rol(C2,10),C2=B2,B2=T;T=safe_add(h1,safe_add(C1,D2)),h1=safe_add(h2,safe_add(D1,E2)),h2=safe_add(h3,safe_add(E1,A2)),h3=safe_add(h4,safe_add(A1,B2)),h4=safe_add(h0,safe_add(B1,C2)),h0=T}return[h0,h1,h2,h3,h4]}function rmd160_f(j,x,y,z){return 0<=j&&j<=15?x^y^z:16<=j&&j<=31?x&y|~x&z:32<=j&&j<=47?(x|~y)^z:48<=j&&j<=63?x&z|y&~z:64<=j&&j<=79?x^(y|~z):"rmd160_f: j out of range"}this.hex=function(s){return rstr2hex(rstr(s))},this.b64=function(s){return rstr2b64(rstr(s),b64pad)},this.any=function(s,e){return rstr2any(rstr(s),e)},this.raw=rstr,this.hex_hmac=function(k,d){return rstr2hex(rstr_hmac(k,d))},this.b64_hmac=function(k,d){return rstr2b64(rstr_hmac(k,d),b64pad)},this.any_hmac=function(k,d,e){return rstr2any(rstr_hmac(k,d),e)},this.vm_test=function(){return"900150983cd24fb0d6963f7d28e17f72"===hex("abc").toLowerCase()},this.setUpperCase=function(a){return"boolean"==typeof a&&0,this},this.setPad=function(a){return void 0!==a&&(b64pad=a),this},this.setUTF8=function(a){return"boolean"==typeof a&&(utf8=a),this}}},window=this,freeExports=!1,"object"==typeof exports&&(freeExports=exports)&&"object"==typeof global&&global&&global===global.global&&(window=global),"function"==typeof define&&"object"==typeof define.amd&&define.amd?define(function(){return Hashes}):freeExports?"object"==typeof module&&module&&module.exports===freeExports?module.exports=Hashes:freeExports.Hashes=Hashes:window.Hashes=Hashes}()}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],3:[function(require,module,exports){"use strict";var sha1=new(require("jshashes").SHA1),hasOwnProperty=Object.prototype.hasOwnProperty;var ohauth={qsString:function(obj){return Object.keys(obj).sort().map(function(key){return ohauth.percentEncode(key)+"="+ohauth.percentEncode(obj[key])}).join("&")},stringQs:function(str){return str.split("&").filter(function(pair){return""!==pair}).reduce(function(obj,parts){parts=parts.split("=");return obj[decodeURIComponent(parts[0])]=null===parts[1]?"":decodeURIComponent(parts[1]),obj},{})},rawxhr:function(method,url,data,headers,callback){var h,xhr=new XMLHttpRequest,twoHundred=/^20\d$/;for(h in xhr.onreadystatechange=function(){if(4===xhr.readyState&&0!==xhr.status){if(!twoHundred.test(xhr.status))return callback(xhr,null);callback(null,xhr)}},xhr.onerror=function(e){return callback(e,null)},xhr.open(method,url,!0),headers)xhr.setRequestHeader(h,headers[h]);return xhr.send(data),xhr},xhr:function(method,url,auth,data,headers,callback){headers=headers&&headers.header||{"Content-Type":"application/x-www-form-urlencoded"};return headers.Authorization="OAuth "+ohauth.authHeader(auth),ohauth.rawxhr(method,url,data,headers,callback)},nonce:function(){for(var o="";o.length<6;)o+="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz"[Math.floor(61*Math.random())];return o},authHeader:function(obj){return Object.keys(obj).sort().map(function(key){return encodeURIComponent(key)+'="'+encodeURIComponent(obj[key])+'"'}).join(", ")},timestamp:function(){return~~(+new Date/1e3)},percentEncode:function(s){return encodeURIComponent(s).replace(/\!/g,"%21").replace(/\'/g,"%27").replace(/\*/g,"%2A").replace(/\(/g,"%28").replace(/\)/g,"%29")},baseString:function(method,url,params){return params.oauth_signature&&delete params.oauth_signature,[method,ohauth.percentEncode(url),ohauth.percentEncode(ohauth.qsString(params))].join("&")},signature:function(oauth_secret,token_secret,baseString){return sha1.b64_hmac(ohauth.percentEncode(oauth_secret)+"&"+ohauth.percentEncode(token_secret),baseString)}};ohauth.headerGenerator=function(options){var consumer_key=(options=options||{}).consumer_key||"",consumer_secret=options.consumer_secret||"",signature_method=options.signature_method||"HMAC-SHA1",version=options.version||"1.0",token=options.token||"",token_secret=options.token_secret||"";return function(method,query_params,base_str){method=method.toUpperCase(),"string"==typeof base_str&&0<base_str.length&&(base_str=ohauth.stringQs(base_str));var oauth_params=query_params.split("?",2),base_uri=oauth_params[0],query_params=2===oauth_params.length?ohauth.stringQs(oauth_params[1]):{},oauth_params={oauth_consumer_key:consumer_key,oauth_signature_method:signature_method,oauth_version:version,oauth_timestamp:ohauth.timestamp(),oauth_nonce:ohauth.nonce()};token&&(oauth_params.oauth_token=token);base_str=function(){for(var target={},i=0;i<arguments.length;i++){var key,source=arguments[i];for(key in source)hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target}({},oauth_params,query_params,base_str),base_str=ohauth.baseString(method,base_uri,base_str);return oauth_params.oauth_signature=ohauth.signature(consumer_secret,token_secret,base_str),"OAuth "+ohauth.authHeader(oauth_params)}},module.exports=ohauth},{jshashes:2}],4:[function(require,module,exports){var root,factory;root=this,factory=function(){return function(){var numUrls=arguments.length;if(0===numUrls)throw new Error("resolveUrl requires at least one argument; got none.");var base=document.createElement("base");if(base.href=arguments[0],1===numUrls)return base.href;var head=document.getElementsByTagName("head")[0];head.insertBefore(base,head.firstChild);for(var resolved,a=document.createElement("a"),index=1;index<numUrls;index++)a.href=arguments[index],resolved=a.href,base.href=resolved;return head.removeChild(base),resolved}},"function"==typeof define&&define.amd?define(factory):"object"==typeof exports?module.exports=factory():root.resolveUrl=factory()},{}],5:[function(plugins,module,exports){var engine=plugins("../src/store-engine"),storages=plugins("../storages/all"),plugins=[plugins("../plugins/json2")];module.exports=engine.createStore(storages,plugins)},{"../plugins/json2":6,"../src/store-engine":8,"../storages/all":10}],6:[function(require,module,exports){module.exports=function(){return require("./lib/json2"),{}}},{"./lib/json2":7}],7:[function(require,module,exports){"object"!=typeof JSON&&(JSON={}),function(){"use strict";var rx_one=/^[\],:{}\s]*$/,rx_two=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,rx_three=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,rx_four=/(?:^|:|,)(?:\s*\[)+/g,rx_escapable=/[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,rx_dangerous=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta,rep;function f(n){return n<10?"0"+n:n}function this_value(){return this.valueOf()}function quote(string){return rx_escapable.lastIndex=0,rx_escapable.test(string)?'"'+string.replace(rx_escapable,function(a){var c=meta[a];return"string"==typeof c?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+string+'"'}function str(key,holder){var i,k,v,length,partial,mind=gap,value=holder[key];switch(value&&"object"==typeof value&&"function"==typeof value.toJSON&&(value=value.toJSON(key)),"function"==typeof rep&&(value=rep.call(holder,key,value)),typeof value){case"string":return quote(value);case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value)return"null";if(gap+=indent,partial=[],"[object Array]"===Object.prototype.toString.apply(value)){for(length=value.length,i=0;i<length;i+=1)partial[i]=str(i,value)||"null";return v=0===partial.length?"[]":gap?"[\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"]":"["+partial.join(",")+"]",gap=mind,v}if(rep&&"object"==typeof rep)for(length=rep.length,i=0;i<length;i+=1)"string"==typeof rep[i]&&(v=str(k=rep[i],value))&&partial.push(quote(k)+(gap?": ":":")+v);else for(k in value)Object.prototype.hasOwnProperty.call(value,k)&&(v=str(k,value))&&partial.push(quote(k)+(gap?": ":":")+v);return v=0===partial.length?"{}":gap?"{\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"}":"{"+partial.join(",")+"}",gap=mind,v}}"function"!=typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},Boolean.prototype.toJSON=this_value,Number.prototype.toJSON=this_value,String.prototype.toJSON=this_value),"function"!=typeof JSON.stringify&&(meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},JSON.stringify=function(value,replacer,space){var i;if(indent=gap="","number"==typeof space)for(i=0;i<space;i+=1)indent+=" ";else"string"==typeof space&&(indent=space);if((rep=replacer)&&"function"!=typeof replacer&&("object"!=typeof replacer||"number"!=typeof replacer.length))throw new Error("JSON.stringify");return str("",{"":value})}),"function"!=typeof JSON.parse&&(JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&"object"==typeof value)for(k in value)Object.prototype.hasOwnProperty.call(value,k)&&(void 0!==(v=walk(value,k))?value[k]=v:delete value[k]);return reviver.call(holder,key,value)}if(text=String(text),rx_dangerous.lastIndex=0,rx_dangerous.test(text)&&(text=text.replace(rx_dangerous,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})),rx_one.test(text.replace(rx_two,"@").replace(rx_three,"]").replace(rx_four,"")))return j=eval("("+text+")"),"function"==typeof reviver?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}()},{}],8:[function(util,module,exports){var util=util("./util"),slice=util.slice,pluck=util.pluck,each=util.each,bind=util.bind,create=util.create,isList=util.isList,isFunction=util.isFunction,isObject=util.isObject,storeAPI={version:"2.0.12",enabled:!(module.exports={createStore:createStore}),get:function(data,optionalDefaultValue){data=this.storage.read(this._namespacePrefix+data);return this._deserialize(data,optionalDefaultValue)},set:function(key,value){return void 0===value?this.remove(key):(this.storage.write(this._namespacePrefix+key,this._serialize(value)),value)},remove:function(key){this.storage.remove(this._namespacePrefix+key)},each:function(callback){var self=this;this.storage.each(function(val,namespacedKey){callback.call(self,self._deserialize(val),(namespacedKey||"").replace(self._namespaceRegexp,""))})},clearAll:function(){this.storage.clearAll()},hasNamespace:function(namespace){return this._namespacePrefix=="__storejs_"+namespace+"_"},createStore:function(){return createStore.apply(this,arguments)},addPlugin:function(plugin){this._addPlugin(plugin)},namespace:function(namespace){return createStore(this.storage,this.plugins,namespace)}};function createStore(storages,plugins,namespace){namespace=namespace||"",storages&&!isList(storages)&&(storages=[storages]),plugins&&!isList(plugins)&&(plugins=[plugins]);var namespacePrefix=namespace?"__storejs_"+namespace+"_":"",namespaceRegexp=namespace?new RegExp("^"+namespacePrefix):null;if(!/^[a-zA-Z0-9_\-]*$/.test(namespace))throw new Error("store.js namespaces can only have alphanumerics + underscores and dashes");var store=create({_namespacePrefix:namespacePrefix,_namespaceRegexp:namespaceRegexp,_testStorage:function(storage){try{var testStr="__storejs__test__";storage.write(testStr,testStr);var ok=storage.read(testStr)===testStr;return storage.remove(testStr),ok}catch(e){return!1}},_assignPluginFnProp:function(pluginFnProp,propName){var oldFn=this[propName];this[propName]=function(){var args=slice(arguments,0),self=this;var newFnArgs=[function(){if(oldFn)return each(arguments,function(arg,i){args[i]=arg}),oldFn.apply(self,args)}].concat(args);return pluginFnProp.apply(self,newFnArgs)}},_serialize:function(obj){return JSON.stringify(obj)},_deserialize:function(strVal,defaultVal){if(!strVal)return defaultVal;var val="";try{val=JSON.parse(strVal)}catch(e){val=strVal}return void 0!==val?val:defaultVal},_addStorage:function(storage){this.enabled||this._testStorage(storage)&&(this.storage=storage,this.enabled=!0)},_addPlugin:function(plugin){var self=this;if(isList(plugin))each(plugin,function(plugin){self._addPlugin(plugin)});else if(!pluck(this.plugins,function(seenPlugin){return plugin===seenPlugin})){if(this.plugins.push(plugin),!isFunction(plugin))throw new Error("Plugins must be function values that return objects");var pluginProperties=plugin.call(this);if(!isObject(pluginProperties))throw new Error("Plugins must return an object of function properties");each(pluginProperties,function(pluginFnProp,propName){if(!isFunction(pluginFnProp))throw new Error("Bad plugin property: "+propName+" from plugin "+plugin.name+". Plugins should only return functions.");self._assignPluginFnProp(pluginFnProp,propName)})}},addStorage:function(storage){!function(){var _console="undefined"==typeof console?null:console;_console&&(_console.warn||_console.log).apply(_console,arguments)}("store.addStorage(storage) is deprecated. Use createStore([storages])"),this._addStorage(storage)}},storeAPI,{plugins:[]});return store.raw={},each(store,function(prop,propName){isFunction(prop)&&(store.raw[propName]=bind(store,prop))}),each(storages,function(storage){store._addStorage(storage)}),each(plugins,function(plugin){store._addPlugin(plugin)}),store}},{"./util":9}],9:[function(require,module,exports){(function(global){(function(){var assign=Object.assign||function(obj,props1,props2,etc){for(var i=1;i<arguments.length;i++)each(Object(arguments[i]),function(val,key){obj[key]=val});return obj},create=function(){{return Object.create?function(obj,assignProps1,assignProps2,etc){var assignArgsList=slice(arguments,1);return assign.apply(this,[Object.create(obj)].concat(assignArgsList))}:function(obj,assignProps1,assignProps2,etc){var assignArgsList=slice(arguments,1);return F.prototype=obj,assign.apply(this,[new F].concat(assignArgsList))};function F(){}}}(),trim=String.prototype.trim?function(str){return String.prototype.trim.call(str)}:function(str){return str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},Global="undefined"!=typeof window?window:global;function slice(arr,index){return Array.prototype.slice.call(arr,index||0)}function each(obj,fn){pluck(obj,function(val,key){fn(val,key)})}function pluck(obj,fn){if(isList(obj)){for(var i=0;i<obj.length;i++)if(fn(obj[i],i))return obj[i]}else for(var key in obj)if(obj.hasOwnProperty(key)&&fn(obj[key],key))return obj[key]}function isList(val){return null!=val&&"function"!=typeof val&&"number"==typeof val.length}module.exports={assign:assign,create:create,trim:trim,bind:function(obj,fn){return function(){return fn.apply(obj,Array.prototype.slice.call(arguments,0))}},slice:slice,each:each,map:function(obj,fn){var res=isList(obj)?[]:{};return pluck(obj,function(v,k){res[k]=fn(v,k)}),res},pluck:pluck,isList:isList,isFunction:function(val){return val&&"[object Function]"==={}.toString.call(val)},isObject:function(val){return val&&"[object Object]"==={}.toString.call(val)},Global:Global}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],10:[function(require,module,exports){module.exports=[require("./localStorage"),require("./oldFF-globalStorage"),require("./oldIE-userDataStorage"),require("./cookieStorage"),require("./sessionStorage"),require("./memoryStorage")]},{"./cookieStorage":11,"./localStorage":12,"./memoryStorage":13,"./oldFF-globalStorage":14,"./oldIE-userDataStorage":15,"./sessionStorage":16}],11:[function(Global,module,exports){var util=Global("../src/util"),Global=util.Global,trim=util.trim;module.exports={name:"cookieStorage",read:function(regexpStr){if(!regexpStr||!_has(regexpStr))return null;regexpStr="(?:^|.*;\\s*)"+escape(regexpStr).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*((?:[^;](?!;))*[^;]?).*";return unescape(doc.cookie.replace(new RegExp(regexpStr),"$1"))},write:function(key,data){if(!key)return;doc.cookie=escape(key)+"="+escape(data)+"; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/"},each:each,remove:remove,clearAll:function(){each(function(_,key){remove(key)})}};var doc=Global.document;function each(callback){for(var kvp,key,cookies=doc.cookie.split(/; ?/g),i=cookies.length-1;0<=i;i--)trim(cookies[i])&&(kvp=cookies[i].split("="),key=unescape(kvp[0]),callback(unescape(kvp[1]),key))}function remove(key){key&&_has(key)&&(doc.cookie=escape(key)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/")}function _has(key){return new RegExp("(?:^|;\\s*)"+escape(key).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(doc.cookie)}},{"../src/util":9}],12:[function(require,module,exports){var Global=require("../src/util").Global;function localStorage(){return Global.localStorage}function read(key){return localStorage().getItem(key)}module.exports={name:"localStorage",read:read,write:function(key,data){return localStorage().setItem(key,data)},each:function(fn){for(var i=localStorage().length-1;0<=i;i--){var key=localStorage().key(i);fn(read(key),key)}},remove:function(key){return localStorage().removeItem(key)},clearAll:function(){return localStorage().clear()}}},{"../src/util":9}],13:[function(require,module,exports){module.exports={name:"memoryStorage",read:function(key){return memoryStorage[key]},write:function(key,data){memoryStorage[key]=data},each:function(callback){for(var key in memoryStorage)memoryStorage.hasOwnProperty(key)&&callback(memoryStorage[key],key)},remove:function(key){delete memoryStorage[key]},clearAll:function(key){memoryStorage={}}};var memoryStorage={}},{}],14:[function(Global,module,exports){Global=Global("../src/util").Global;module.exports={name:"oldFF-globalStorage",read:function(key){return globalStorage[key]},write:function(key,data){globalStorage[key]=data},each:each,remove:function(key){return globalStorage.removeItem(key)},clearAll:function(){each(function(key,_){delete globalStorage[key]})}};var globalStorage=Global.globalStorage;function each(fn){for(var i=globalStorage.length-1;0<=i;i--){var key=globalStorage.key(i);fn(globalStorage[key],key)}}},{"../src/util":9}],15:[function(Global,module,exports){Global=Global("../src/util").Global;module.exports={name:"oldIE-userDataStorage",write:function(unfixedKey,data){if(disable)return;var fixedKey=fixKey(unfixedKey);_withStorageEl(function(storageEl){storageEl.setAttribute(fixedKey,data),storageEl.save(storageName)})},read:function(unfixedKey){if(disable)return;var fixedKey=fixKey(unfixedKey),res=null;return _withStorageEl(function(storageEl){res=storageEl.getAttribute(fixedKey)}),res},each:function(callback){_withStorageEl(function(storageEl){for(var attributes=storageEl.XMLDocument.documentElement.attributes,i=attributes.length-1;0<=i;i--){var attr=attributes[i];callback(storageEl.getAttribute(attr.name),attr.name)}})},remove:function(unfixedKey){var fixedKey=fixKey(unfixedKey);_withStorageEl(function(storageEl){storageEl.removeAttribute(fixedKey),storageEl.save(storageName)})},clearAll:function(){_withStorageEl(function(storageEl){var attributes=storageEl.XMLDocument.documentElement.attributes;storageEl.load(storageName);for(var i=attributes.length-1;0<=i;i--)storageEl.removeAttribute(attributes[i].name);storageEl.save(storageName)})}};var storageName="storejs",doc=Global.document,_withStorageEl=function(){if(!doc||!doc.documentElement||!doc.documentElement.addBehavior)return null;var storageOwner,storageContainer,storageEl;try{(storageContainer=new ActiveXObject("htmlfile")).open(),storageContainer.write('<script>document.w=window<\/script><iframe src="/favicon.ico"></iframe>'),storageContainer.close(),storageOwner=storageContainer.w.frames[0].document,storageEl=storageOwner.createElement("div")}catch(e){storageEl=doc.createElement("div"),storageOwner=doc.body}return function(storeFunction){var args=[].slice.call(arguments,0);args.unshift(storageEl),storageOwner.appendChild(storageEl),storageEl.addBehavior("#default#userData"),storageEl.load(storageName),storeFunction.apply(this,args),storageOwner.removeChild(storageEl)}}(),disable=(Global.navigator?Global.navigator.userAgent:"").match(/ (MSIE 8|MSIE 9|MSIE 10)\./);var forbiddenCharsRegex=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g");function fixKey(key){return key.replace(/^\d/,"___$&").replace(forbiddenCharsRegex,"___")}},{"../src/util":9}],16:[function(require,module,exports){var Global=require("../src/util").Global;function sessionStorage(){return Global.sessionStorage}function read(key){return sessionStorage().getItem(key)}module.exports={name:"sessionStorage",read:read,write:function(key,data){return sessionStorage().setItem(key,data)},each:function(fn){for(var i=sessionStorage().length-1;0<=i;i--){var key=sessionStorage().key(i);fn(read(key),key)}},remove:function(key){return sessionStorage().removeItem(key)},clearAll:function(){return sessionStorage().clear()}}},{"../src/util":9}]},{},[1])(1)});