define(["exports","./arrayFill-4d3cc415","./buildModuleUrl-dba4ec07","./Cartesian2-1b9b0d8a","./Cartographic-1bbcab04","./ComponentDatatype-d430c7f7","./when-515d5295","./Check-3aa71481","./Rectangle-e170be8b","./GeometryAttribute-9bc31a7f","./GeometryAttributes-7d904f0f","./GeometryOffsetAttribute-800f7650","./IndexDatatype-eefd5922","./Math-5e38123d","./PrimitiveType-b38a4004","./VertexFormat-e844760b"],(function(t,e,a,n,i,r,o,m,s,c,u,f,p,d,l,_){"use strict";var h=new i.a,v=new i.a,y=new i.a,b=new i.a,w=new i.a(1,1,1),k=Math.cos,C=Math.sin;function A(t){t=o.e(t,o.e.EMPTY_OBJECT);var e=o.e(t.radii,w),a=o.e(t.innerRadii,e),n=o.e(t.minimumClock,0),r=o.e(t.maximumClock,d.n.TWO_PI),s=o.e(t.minimumCone,0),c=o.e(t.maximumCone,d.n.PI),u=Math.round(o.e(t.stackPartitions,64)),f=Math.round(o.e(t.slicePartitions,64)),p=o.e(t.vertexFormat,_.n.DEFAULT);if(f<3)throw new m.t("options.slicePartitions cannot be less than three.");if(u<3)throw new m.t("options.stackPartitions cannot be less than three.");this._radii=i.a.clone(e),this._innerRadii=i.a.clone(a),this._minimumClock=n,this._maximumClock=r,this._minimumCone=s,this._maximumCone=c,this._stackPartitions=u,this._slicePartitions=f,this._vertexFormat=_.n.clone(p),this._offsetAttribute=t.offsetAttribute,this._workerName="createEllipsoidGeometry"}A.packedLength=2*i.a.packedLength+_.n.packedLength+7,A.pack=function(t,e,a){if(!o.t(t))throw new m.t("value is required");if(!o.t(e))throw new m.t("array is required");return a=o.e(a,0),i.a.pack(t._radii,e,a),a+=i.a.packedLength,i.a.pack(t._innerRadii,e,a),a+=i.a.packedLength,_.n.pack(t._vertexFormat,e,a),a+=_.n.packedLength,e[a++]=t._minimumClock,e[a++]=t._maximumClock,e[a++]=t._minimumCone,e[a++]=t._maximumCone,e[a++]=t._stackPartitions,e[a++]=t._slicePartitions,e[a]=o.e(t._offsetAttribute,-1),e};var x,P=new i.a,g=new i.a,T=new _.n,F={radii:P,innerRadii:g,vertexFormat:T,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};A.unpack=function(t,e,a){if(!o.t(t))throw new m.t("array is required");e=o.e(e,0);var n=i.a.unpack(t,e,P);e+=i.a.packedLength;var r=i.a.unpack(t,e,g);e+=i.a.packedLength;var s=_.n.unpack(t,e,T);e+=_.n.packedLength;var c=t[e++],u=t[e++],f=t[e++],p=t[e++],d=t[e++],l=t[e++],h=t[e];return o.t(a)?(a._radii=i.a.clone(n,a._radii),a._innerRadii=i.a.clone(r,a._innerRadii),a._vertexFormat=_.n.clone(s,a._vertexFormat),a._minimumClock=c,a._maximumClock=u,a._minimumCone=f,a._maximumCone=p,a._stackPartitions=d,a._slicePartitions=l,a._offsetAttribute=-1===h?void 0:h,a):(F.minimumClock=c,F.maximumClock=u,F.minimumCone=f,F.maximumCone=p,F.stackPartitions=d,F.slicePartitions=l,F.offsetAttribute=-1===h?void 0:h,new A(F))},A.createGeometry=function(t){var n=t._radii;if(!(n.x<=0||n.y<=0||n.z<=0)){var m=t._innerRadii;if(!(m.x<=0||m.y<=0||m.z<=0)){var _=t._minimumClock,w=t._maximumClock,A=t._minimumCone,x=t._maximumCone,P=t._vertexFormat,g=t._slicePartitions+1,T=t._stackPartitions+1;(g=Math.round(g*Math.abs(w-_)/d.n.TWO_PI))<2&&(g=2),(T=Math.round(T*Math.abs(x-A)/d.n.PI))<2&&(T=2);var F,D,I=0,L=[A],O=[_];for(F=0;F0&&(G=!0,E+=g-1),x0&&F!==M-1&&0!==D&&D!==z-1&&(Y[ot]=!0),ot++;for(I=0,F=1;F=Ct&&F