define(["./GeometryOffsetAttribute-9dbaeacc","./Transforms-a6362ad2","./Matrix2-ae0e0b05","./RuntimeError-ffc802eb","./ComponentDatatype-64cf6611","./when-e3a49219","./GeometryAttribute-50aef525","./GeometryAttributes-3db3f2c9","./combine-c7a1ec8a","./PixelFormat-83d70a69","./WebGLConstants-1c8239cc"],(function(e,t,a,n,i,r,u,m,o,s,f){"use strict";var c=new a.Cartesian3;function d(e){var t=(e=r.defaultValue(e,r.defaultValue.EMPTY_OBJECT)).minimum,n=e.maximum;this._min=a.Cartesian3.clone(t),this._max=a.Cartesian3.clone(n),this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxOutlineGeometry"}d.fromDimensions=function(e){var t=(e=r.defaultValue(e,r.defaultValue.EMPTY_OBJECT)).dimensions,n=a.Cartesian3.multiplyByScalar(t,.5,new a.Cartesian3);return new d({minimum:a.Cartesian3.negate(n,new a.Cartesian3),maximum:n,offsetAttribute:e.offsetAttribute})},d.fromAxisAlignedBoundingBox=function(e){return new d({minimum:e.minimum,maximum:e.maximum})},d.packedLength=2*a.Cartesian3.packedLength+1,d.pack=function(e,t,n){return n=r.defaultValue(n,0),a.Cartesian3.pack(e._min,t,n),a.Cartesian3.pack(e._max,t,n+a.Cartesian3.packedLength),t[n+2*a.Cartesian3.packedLength]=r.defaultValue(e._offsetAttribute,-1),t};var p=new a.Cartesian3,y=new a.Cartesian3,l={minimum:p,maximum:y,offsetAttribute:void 0};return d.unpack=function(e,t,n){t=r.defaultValue(t,0);var i=a.Cartesian3.unpack(e,t,p),u=a.Cartesian3.unpack(e,t+a.Cartesian3.packedLength,y),m=e[t+2*a.Cartesian3.packedLength];return r.defined(n)?(n._min=a.Cartesian3.clone(i,n._min),n._max=a.Cartesian3.clone(u,n._max),n._offsetAttribute=-1===m?void 0:m,n):(l.offsetAttribute=-1===m?void 0:m,new d(l))},d.createGeometry=function(n){var o=n._min,s=n._max;if(!a.Cartesian3.equals(o,s)){var f=new m.GeometryAttributes,d=new Uint16Array(24),p=new Float64Array(24);p[0]=o.x,p[1]=o.y,p[2]=o.z,p[3]=s.x,p[4]=o.y,p[5]=o.z,p[6]=s.x,p[7]=s.y,p[8]=o.z,p[9]=o.x,p[10]=s.y,p[11]=o.z,p[12]=o.x,p[13]=o.y,p[14]=s.z,p[15]=s.x,p[16]=o.y,p[17]=s.z,p[18]=s.x,p[19]=s.y,p[20]=s.z,p[21]=o.x,p[22]=s.y,p[23]=s.z,f.position=new u.GeometryAttribute({componentDatatype:i.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:p}),d[0]=4,d[1]=5,d[2]=5,d[3]=6,d[4]=6,d[5]=7,d[6]=7,d[7]=4,d[8]=0,d[9]=1,d[10]=1,d[11]=2,d[12]=2,d[13]=3,d[14]=3,d[15]=0,d[16]=0,d[17]=4,d[18]=1,d[19]=5,d[20]=2,d[21]=6,d[22]=3,d[23]=7;var y=a.Cartesian3.subtract(s,o,c),l=.5*a.Cartesian3.magnitude(y);if(r.defined(n._offsetAttribute)){var b=p.length,C=new Uint8Array(b/3),A=n._offsetAttribute===e.GeometryOffsetAttribute.NONE?0:1;e.arrayFill(C,A),f.applyOffset=new u.GeometryAttribute({componentDatatype:i.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:C})}return new u.Geometry({attributes:f,indices:d,primitiveType:u.PrimitiveType.LINES,boundingSphere:new t.BoundingSphere(a.Cartesian3.ZERO,l),offsetAttribute:n._offsetAttribute})}},function(e,t){return r.defined(t)&&(e=d.unpack(e,t)),d.createGeometry(e)}}));