//>>built
define("dojox/uuid/generateTimeBasedUuid",["dojo/_base/lang","./_base"],function(h){dojox.uuid.generateTimeBasedUuid=function(d){return dojox.uuid.generateTimeBasedUuid._generator.generateUuidString(d)};dojox.uuid.generateTimeBasedUuid.isValidNode=function(d){var g=parseInt(d,16);return h.isString(d)&&12==d.length&&isFinite(g)};dojox.uuid.generateTimeBasedUuid.setNode=function(d){dojox.uuid.assert(null===d||this.isValidNode(d));this._uniformNode=d};dojox.uuid.generateTimeBasedUuid.getNode=function(){return this._uniformNode};
dojox.uuid.generateTimeBasedUuid._generator=new function(){function d(a){a[2]+=a[3]>>>16;a[3]&=65535;a[1]+=a[2]>>>16;a[2]&=65535;a[0]+=a[1]>>>16;a[1]&=65535;dojox.uuid.assert(0===a[0]>>>16)}function g(a){var c=[0,0,0,0];c[3]=a%65536;a-=c[3];a/=65536;c[2]=a%65536;a-=c[2];a/=65536;c[1]=a%65536;a-=c[1];c[0]=a/65536;return c}function m(a,c){dojox.uuid.assert(h.isArray(a));dojox.uuid.assert(h.isArray(c));dojox.uuid.assert(4==a.length);dojox.uuid.assert(4==c.length);var b=!1;0!==a[0]*c[0]&&(b=!0);0!==a[0]*
c[1]&&(b=!0);0!==a[0]*c[2]&&(b=!0);0!==a[1]*c[0]&&(b=!0);0!==a[1]*c[1]&&(b=!0);0!==a[2]*c[0]&&(b=!0);dojox.uuid.assert(!b);b=[0,0,0,0];b[0]+=a[0]*c[3];d(b);b[0]+=a[1]*c[2];d(b);b[0]+=a[2]*c[1];d(b);b[0]+=a[3]*c[0];d(b);b[1]+=a[1]*c[3];d(b);b[1]+=a[2]*c[2];d(b);b[1]+=a[3]*c[1];d(b);b[2]+=a[2]*c[3];d(b);b[2]+=a[3]*c[2];d(b);b[3]+=a[3]*c[3];d(b);return b}function k(a,c){for(;a.length<c;)a="0"+a;return a}this.GREGORIAN_CHANGE_OFFSET_IN_HOURS=3394248;var n=null,p=null,q=null,l=0,r=null,t=null;this.generateUuidString=
function(a){if(a)dojox.uuid.assert(dojox.uuid.generateTimeBasedUuid.isValidNode(a));else if(dojox.uuid.generateTimeBasedUuid._uniformNode)a=dojox.uuid.generateTimeBasedUuid._uniformNode;else{if(!n){a=(32768|Math.floor(Math.random()%1*Math.pow(2,15))).toString(16);for(var c=Math.floor(Math.random()%1*Math.pow(2,32)).toString(16);8>c.length;)c="0"+c;n=a+c}a=n}p||(p=(32768|Math.floor(Math.random()%1*Math.pow(2,14))).toString(16));var c=new Date,b=g(c.valueOf());if(!r){var e=g(3600),f=g(dojox.uuid.generateTimeBasedUuid._generator.GREGORIAN_CHANGE_OFFSET_IN_HOURS),
e=m(f,e),f=g(1E3);r=m(e,f);t=g(1E4)}e=r;dojox.uuid.assert(h.isArray(e));dojox.uuid.assert(h.isArray(b));dojox.uuid.assert(4==e.length);dojox.uuid.assert(4==b.length);f=[0,0,0,0];f[3]=e[3]+b[3];f[2]=e[2]+b[2];f[1]=e[1]+b[1];f[0]=e[0]+b[0];d(f);b=m(f,t);if(c.valueOf()==q){if(b[3]+=l,d(b),l+=1,1E4==l)for(;c.valueOf()==q;)c=new Date}else q=c.valueOf(),l=1;c=b[2].toString(16);e=b[3].toString(16);c=k(c,4)+k(e,4);e=b[1].toString(16);e=k(e,4);b=b[0].toString(16);b=k(b,3);a=c+"-"+e+"-1"+b+"-"+p+"-"+a;return a=
a.toLowerCase()}};return dojox.uuid.generateTimeBasedUuid});