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G3UgFANAAANKPJMgDyswwfDNCoIXTWa6EVYPeT3gQk2uuHp4VVFSD5ZBLQN1BflYVoAFZL2edAtdwMAd8EIBoHSLLXulmA+gH5NQDGPBz+BeXAfzYAZgGwDSMMBeA24PdviC/bAJRrwglgnYFaMBKsAUg9LAWgaw0AiHFWJyLIpS2gy9NC9iYo5QCK8isgg4AxhctvmfUBbEwg5l1Zaap/HcD112vT54B8AI6OkNcagE1OQQOBaSKpAGD1nw9AjoXxvxTdYhboxs1zkD34BADduNlCOO+xAgDCC0AmG18yQP4cIIoFAFnOe0pHHFhAwJGyz/84iSUA5kIxDYC6dgeAHoCEo4hLAczGxn/q8o0KmI/FEwGw1nxwykS6NwCcAv8NAHg5gPlwOLQPgPl4vBwAKjk2Gd8CO/lXPs+Y3KSI+BIA7KNeSsTLAYDRALa0L4npy6EAdrXfFYlQADv7V9Ji+BmwsX8o/uMBYGMAOpFgAI+yL4keLy0AIBjA5kdAPoCnFkAkADzR/w9AHIBnXQM5AIDXA3iefgDwcv0AIElPOQzjASwfCDz37xjA5vYJaF+lNWAJBZD0hoDapjRqGYBYAl0znFQmABZ5W4e52gIAvy4XABaphnY3/0f3AJCov8sytPAI+wMA9Gl79+UMyEtyW/OfuR3kjvlV+pf+y83d9APAl+sHgC/XDwBfrtcD+A/tSd66lbx6tQAAAABJRU5ErkJggg==";var I="precision mediump float;uniform vec2 r;uniform vec3 F,w,x;uniform vec4 y[64];uniform float z,A,n,B,C;uniform sampler2D D;float l=1./n;mat3 E(float a,float b){float c=cos(a),d=cos(b),e=sin(a),f=sin(b);return mat3(d,f*e,-f*c,0.,c,e,f,d*-e,d*c);}vec3 s(vec2 a){float b=sqrt(1.-a.y*a.y);return vec3(cos(a.x)*b,sin(a.x)*b,a.y);}vec3 t(vec3 a,out float v){a=a.xzy,a.z=-a.z;vec2 d=vec2(atan(a.y,a.x),a.z);float m=max(2.,floor(log2(2.236068*n*3.141593*(1.-d.y*d.y))/1.388484));vec2 e=floor(pow(1.618034,m)/2.236068*vec2(1.,1.618034)+.5),b=fract((e+1.)*.618034)*6.283185-3.883222,c=-2.*l*e;mat2 o=mat2(c.y,-c.x,-b.y,b.x)/(b.x*c.y-c.x*b.y);float i=3.141593;vec2 p=floor(o*(d-vec2(0.,1.-l))),j;for(float f=0.;f<4.;f+=1.){vec2 q=vec2(mod(f,2.),floor(f/2.));float g=dot(e,p+q);if(g>n)continue;vec2 k=vec2(6.283185*fract(g*.618034),1.-(2.*g+1.)*l);float u=length(a-s(k));if(u<i)i=u,j=k;}v=i;vec3 h=s(j);h=h.xzy,h.y=-h.y;return h;}void main(){vec2 b=gl_FragCoord.xy/r*2.-1.;b.x*=r.x/r.y;float o=dot(b,b),a;if(o<=.64){vec3 c=normalize(vec3(b,sqrt(.64-b.x*b.x-b.y*b.y))),d=c*E(A,z),e=t(d,a);float i=asin(e.y),f=acos(-e.x/cos(i));f=e.z<0.?-f:f;float u=texture2D(D,vec2(f*.5/3.141593,-(i/3.141593+.5))).x,v=smoothstep(0.,a,.0016)*.8,G=pow(dot(c,normalize(vec3(0.,.2,1.))),1.2)*C,m=pow(dot(c,vec3(0.,0.,1.)),.5);gl_FragColor=vec4(vec3(pow(u*v*m,1.5)*G+.1)*F,1.);int H=int(B);for(int g=0;g<64;g++){if(g>=H)break;vec4 j=y[g];vec3 k=j.xyz,p=k-d;float h=j.w;if(dot(p,p)>h*h*4.)continue;vec3 I=t(k,a);a=length(I-d);if(a<h){if(a+a<h)gl_FragColor.xyz=m*w;gl_FragColor.xyz+=m*(1.-exp(-40.*(h-a)))*w;break;}}gl_FragColor.xyz+=pow(1.-dot(c,normalize(vec3(0.,.1,1.))),4.)*x;}else{a=sqrt(o)-.8;float q=.2*(exp(-40.*a)+exp(-20.*a)+exp(-99.*a));gl_FragColor=vec4(q*x,q);}}",v="phi",m="theta",g="mapSamples",x="mapBrightness",y="baseColor",s="markerColor",w="glowColor",i="markers",d="devicePixelRatio",B={[v]:"z",[m]:"A",[g]:"n",[x]:"C",[y]:"F",[s]:"w",[w]:"x"},{PI:f,sin:p,cos:C}=Math;function D(n){return[].concat(...n.map(o=>{let[t,e]=o.location;t=t*f/180,e=e*f/180-f;let a=C(t);return[-a*C(e),p(t),a*p(e),o.size]}))}function h(n,o){let t=new P({canvas:n,context:{alpha:!0,stencil:!1,antialias:!0,depth:!1,preserveDrawingBuffer:!1},settings:{[d]:o[d]||1,onSetup:e=>{let a=e.RGB,r=e.UNSIGNED_BYTE,A=e.TEXTURE_2D,l=e.createTexture();e.bindTexture(A,l),e.texImage2D(A,0,a,1,1,0,a,r,new Uint8Array([0,0,0,0]));let c=new Image;c.onload=function(){e.bindTexture(A,l),e.texImage2D(A,0,a,a,r,c),e.generateMipmap(A);let E=e.getParameter(e.CURRENT_PROGRAM),T=e.getUniformLocation(E,"F");e.texParameteri(A,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(A,e.TEXTURE_MAG_FILTER,e.NEAREST),e.uniform1i(T,0)},c.src=u}}});return t.add("",{vertex:"attribute vec3 aPosition;uniform mat4 uProjectionMatrix;uniform mat4 uModelMatrix;uniform mat4 uViewMatrix;void main(){gl_Position=uProjectionMatrix*uModelMatrix*uViewMatrix*vec4(aPosition,1.);}",fragment:I,uniforms:{r:{type:"vec2",value:[o.width,o.height]},z:{type:"float",value:o[v]},A:{type:"float",value:o[m]},n:{type:"float",value:o[g]},C:{type:"float",value:o[x]},F:{type:"vec3",value:o[y]},w:{type:"vec3",value:o[s]},x:{type:"vec3",value:o[w]},y:{type:"vec4",value:D(o.markers)},B:{type:"float",value:o.markers.length}},mode:4,geometry:{vertices:[{x:-100,y:100,z:0},{x:-100,y:-100,z:0},{x:100,y:100,z:0},{x:100,y:-100,z:0},{x:-100,y:-100,z:0},{x:100,y:100,z:0}]},onRender:({uniforms:e})=>{let a={};if(o.onRender){o.onRender(a);for(let r in B)a[r]!==void 0&&(e[B[r]].value=a[r]);a[i]!==void 0&&(e.y.value=D(a[i]),e.B.value=a[i].length)}}}),t}export{h as default}; | ||
import v from"phenomenon";var c="phi",M="theta",T="mapSamples",A="mapBrightness",s="baseColor",O="markerColor",N="glowColor",E="markers",G="diffuse",u="devicePixelRatio",m={[c]:"z",[M]:"A",[T]:"m",[A]:"C",[s]:"w",[O]:"G",[N]:"x",[G]:"D"},{PI:S,sin:P,cos:X}=Math,f=L=>[].concat(...L.map(n=>{let[t,o]=n.location;t=t*S/180,o=o*S/180-S;let e=X(t);return[-e*X(o),P(t),e*P(o),n.size]})),U=(L,n)=>{let t=(e,_)=>({type:e,value:n[_]}),o=new v({canvas:L,context:{alpha:!0,stencil:!1,antialias:!0,depth:!1,preserveDrawingBuffer:!1},settings:{[u]:n[u]||1,onSetup:e=>{let _=e.RGB,r=e.UNSIGNED_BYTE,a=e.TEXTURE_2D,R=e.createTexture();e.bindTexture(a,R),e.texImage2D(a,0,_,1,1,0,_,r,new Uint8Array([0,0,0,0]));let i=new Image;i.onload=()=>{e.bindTexture(a,R),e.texImage2D(a,0,_,_,r,i),e.generateMipmap(a);let x=e.getParameter(e.CURRENT_PROGRAM),d=e.getUniformLocation(x,"E");e.texParameteri(a,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(a,e.TEXTURE_MAG_FILTER,e.NEAREST),e.uniform1i(d,0)},i.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAACAAQAAAADMzoqnAAAAAXNSR0IArs4c6QAABA5JREFUeNrV179uHEUAx/Hf3JpbF+E2VASBsmVKTBcpKJs3SMEDcDwBiVJAAewYEBUivIHT0uUBIt0YCovKD0CRjUC4QfHYh8hYXu+P25vZ2Zm9c66gMd/GJ/tz82d3bk8GN4SrByYF2366FNTACIAkivVAAazQdnf3MvAlbNUQfOPAdQDvSAimMWhwy4I2g4SU+Kp04ISLpPBAKLxPyic3O/CCi+Y7rUJbiodcpDOFY7CgxCEXmdYD2EYK2s5lApOx5pEDDYCUwM1XdJUwBV11QQMg59kePSCaPAASQMEL2hwo6TJFgxpg+TgC2ymXPb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sJ/gU8bsxpM8IeAQAAAABJRU5ErkJggg=="}}});return o.add("",{vertex:"attribute vec3 aPosition;uniform mat4 uProjectionMatrix;uniform mat4 uModelMatrix;uniform mat4 uViewMatrix;void main(){gl_Position=uProjectionMatrix*uModelMatrix*uViewMatrix*vec4(aPosition,1.);}",fragment:"precision mediump float;uniform vec2 s;uniform vec3 w,G,x;uniform vec4 y[64];uniform float z,A,m,B,C,D;uniform sampler2D E;float l=1./m;mat3 F(float a,float b){float c=cos(a),d=cos(b),e=sin(a),f=sin(b);return mat3(d,f*e,-f*c,0.,c,e,f,d*-e,d*c);}vec3 t(vec2 a){float b=sqrt(1.-a.y*a.y);return vec3(cos(a.x)*b,sin(a.x)*b,a.y);}vec3 u(vec3 a,out float v){a=a.xzy,a.z=-a.z;vec2 d=vec2(atan(a.y,a.x),a.z);float n=max(2.,floor(log2(2.236068*m*3.141593*(1.-d.y*d.y))/1.388484));vec2 e=floor(pow(1.618034,n)/2.236068*vec2(1.,1.618034)+.5),b=fract((e+1.)*.618034)*6.283185-3.883222,c=-2.*l*e;mat2 o=mat2(c.y,-c.x,-b.y,b.x)/(b.x*c.y-c.x*b.y);float i=3.141593;vec2 p=floor(o*(d-vec2(0.,1.-l))),j;for(float f=0.;f<4.;f+=1.){vec2 q=vec2(mod(f,2.),floor(f/2.));float g=dot(e,p+q);if(g>m)continue;vec2 k=vec2(6.283185*fract(g*.618034),1.-(2.*g+1.)*l);float r=length(a-t(k));if(r<i)i=r,j=k;}v=i;vec3 h=t(j);h=h.xzy,h.y=-h.y;return h;}void main(){vec2 b=gl_FragCoord.xy/s*2.-1.;b.x*=s.x/s.y;float n=dot(b,b),a;if(n<=.64){vec3 c=normalize(vec3(b,sqrt(.64-b.x*b.x-b.y*b.y))),e=c*F(A,z),f=u(e,a);float i=asin(f.y),g=acos(-f.x/cos(i));g=f.z<0.?-g:g;float H=texture2D(E,vec2(g*.5/3.141593,-(i/3.141593+.5))).x,I=smoothstep(0.,a,.0016),o=pow(dot(c,normalize(vec3(0.,.2,1.))),D)*C,p=dot(c,vec3(0.,0.,1.));gl_FragColor=vec4(vec3(pow(H*I*p,1.5)*o+.2)*w,1.);int J=int(B);float q=0.;for(int h=0;h<64;h++){if(h>=J)break;vec4 j=y[h];vec3 k=j.xyz,r=k-e;float d=j.w;if(dot(r,r)>d*d*4.)continue;vec3 K=u(k,a);a=length(K-e);if(a<d){if(a+a<d)gl_FragColor.xyz=.2*w;q+=smoothstep(d*.5,0.,a)+(1.-exp(-2.*(d-a)));}}gl_FragColor.xyz+=q*p*o*G+pow(1.-dot(c,normalize(vec3(0.,.1,1.))),4.)*x;}else{a=sqrt(n)-.8;float v=.2*(exp(-40.*a)+exp(-20.*a)+exp(-99.*a));gl_FragColor=vec4(v*x,v);}}",uniforms:{s:{type:"vec2",value:[n.width,n.height]},z:t("float",c),A:t("float",M),m:t("float",T),C:t("float",A),w:t("vec3",s),G:t("vec3",O),D:t("vec3",G),x:t("vec3",N),y:{type:"vec4",value:f(n[E])},B:{type:"float",value:n[E].length}},mode:4,geometry:{vertices:[{x:-100,y:100,z:0},{x:-100,y:-100,z:0},{x:100,y:100,z:0},{x:100,y:-100,z:0},{x:-100,y:-100,z:0},{x:100,y:100,z:0}]},onRender:({uniforms:e})=>{let _={};if(n.onRender){n.onRender(_);for(let r in m)_[r]!==void 0&&(e[m[r]].value=_[r]);_[E]!==void 0&&(e["y"].value=f(_[E]),e["B"].value=_[E].length)}}}),o};export{U as default}; |
{ | ||
"name": "cobe", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"type": "module", | ||
@@ -12,3 +12,3 @@ "main": "./dist/index.esm.js", | ||
"scripts": { | ||
"build:esm": "esbuild src/index.js --bundle --minify --format=esm --outfile=dist/index.esm.js --external:phenomenon", | ||
"build:esm": "node scripts/build.js", | ||
"build": "yarn build:esm" | ||
@@ -15,0 +15,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
5437
20