@kerf-js/keel 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +16 -0
- package/README.md +306 -2
- package/package.json +59 -3
- package/src/blend-inset.ts +79 -0
- package/src/blend.ts +120 -0
- package/src/client.d.ts +9 -0
- package/src/generate/bust.ts +24 -0
- package/src/generate/bust.worker.ts +4 -0
- package/src/generate/pack.ts +69 -0
- package/src/generate/plate.ts +51 -0
- package/src/generate/plate.worker.ts +4 -0
- package/src/generate/serve.ts +56 -0
- package/src/generate/surface.ts +16 -0
- package/src/generate/surface.worker.ts +4 -0
- package/src/generate.ts +133 -0
- package/src/governor.ts +87 -0
- package/src/index.d.ts +15 -0
- package/src/index.mjs +63 -0
- package/src/lit.d.ts +384 -0
- package/src/paint-live.ts +60 -0
- package/src/paint-recipe.d.mts +29 -0
- package/src/paint-recipe.mjs +29 -0
- package/src/paint-worker.mjs +20 -0
- package/src/paint.d.mts +37 -0
- package/src/paint.mjs +180 -0
- package/src/runtime.ts +35 -0
- package/src/scene.ts +289 -0
- package/src/stage.ts +192 -0
- package/vendor/LICENSE +21 -0
- package/vendor/LICENSE-modules +21 -0
- package/vendor/NOTICE +24 -0
- package/vendor/README.md +13 -0
- package/vendor/lit.d.mts +1 -0
- package/vendor/lit.mjs +2 -0
- package/vendor/lock.json +177 -0
- package/vendor/modules/band/events.d.ts +20 -0
- package/vendor/modules/band/index.d.ts +29 -0
- package/vendor/modules/band/player.d.ts +43 -0
- package/vendor/modules/band/roll.d.ts +14 -0
- package/vendor/modules/band/score.d.ts +45 -0
- package/vendor/modules/band/styles.data.d.ts +37 -0
- package/vendor/modules/band/voices.d.ts +33 -0
- package/vendor/modules/band.d.mts +1 -0
- package/vendor/modules/band.mjs +2 -0
- package/vendor/modules/butterflies/butterflies.glsl.d.ts +2 -0
- package/vendor/modules/butterflies/flight.d.ts +68 -0
- package/vendor/modules/butterflies/index.d.ts +79 -0
- package/vendor/modules/butterflies/wing.d.ts +38 -0
- package/vendor/modules/butterflies.d.mts +1 -0
- package/vendor/modules/butterflies.inputs.json +73 -0
- package/vendor/modules/butterflies.mjs +39 -0
- package/vendor/modules/camera-rail/index.d.ts +113 -0
- package/vendor/modules/camera-rail.d.mts +1 -0
- package/vendor/modules/camera-rail.mjs +2 -0
- package/vendor/modules/device-profile/index.d.ts +47 -0
- package/vendor/modules/device-profile.d.mts +1 -0
- package/vendor/modules/device-profile.mjs +2 -0
- package/vendor/modules/lit-finish/dress.d.ts +34 -0
- package/vendor/modules/lit-finish/finish.glsl.d.ts +15 -0
- package/vendor/modules/lit-finish/index.d.ts +33 -0
- package/vendor/modules/lit-finish/lit.d.ts +52 -0
- package/vendor/modules/lit-finish/pass.d.ts +35 -0
- package/vendor/modules/lit-finish/settings.d.ts +88 -0
- package/vendor/modules/lit-finish.d.mts +1 -0
- package/vendor/modules/lit-finish.inputs.json +200 -0
- package/vendor/modules/lit-finish.mjs +267 -0
- package/vendor/modules/look/index.d.ts +159 -0
- package/vendor/modules/look.d.mts +1 -0
- package/vendor/modules/look.inputs.json +23 -0
- package/vendor/modules/look.mjs +2 -0
- package/vendor/modules/motes/index.d.ts +83 -0
- package/vendor/modules/motes/motes.glsl.d.ts +9 -0
- package/vendor/modules/motes/place.d.ts +59 -0
- package/vendor/modules/motes.d.mts +1 -0
- package/vendor/modules/motes.inputs.json +116 -0
- package/vendor/modules/motes.mjs +68 -0
- package/vendor/modules/plate-painter/dab.d.ts +44 -0
- package/vendor/modules/plate-painter/exact.d.ts +19 -0
- package/vendor/modules/plate-painter/foliage.d.ts +4 -0
- package/vendor/modules/plate-painter/gpu.d.ts +65 -0
- package/vendor/modules/plate-painter/index.d.ts +14 -0
- package/vendor/modules/plate-painter/paint.glsl.d.ts +14 -0
- package/vendor/modules/plate-painter/plan.d.ts +42 -0
- package/vendor/modules/plate-painter/recipe.d.ts +136 -0
- package/vendor/modules/plate-painter/scene.d.ts +4 -0
- package/vendor/modules/plate-painter.d.mts +1 -0
- package/vendor/modules/plate-painter.inputs.json +50 -0
- package/vendor/modules/plate-painter.mjs +384 -0
- package/vendor/modules/portrait/body.d.ts +25 -0
- package/vendor/modules/portrait/bust.d.ts +67 -0
- package/vendor/modules/portrait/cap.d.ts +12 -0
- package/vendor/modules/portrait/compile.d.ts +8 -0
- package/vendor/modules/portrait/exact.d.ts +17 -0
- package/vendor/modules/portrait/hair.d.ts +26 -0
- package/vendor/modules/portrait/hand.d.ts +30 -0
- package/vendor/modules/portrait/head.d.ts +18 -0
- package/vendor/modules/portrait/index.d.ts +12 -0
- package/vendor/modules/portrait/mesh.d.ts +24 -0
- package/vendor/modules/portrait/parts.d.ts +33 -0
- package/vendor/modules/portrait/portrait.glsl.d.ts +4 -0
- package/vendor/modules/portrait/render.d.ts +125 -0
- package/vendor/modules/portrait/sdf.d.ts +75 -0
- package/vendor/modules/portrait/settings.d.ts +27 -0
- package/vendor/modules/portrait.d.mts +1 -0
- package/vendor/modules/portrait.inputs.json +111 -0
- package/vendor/modules/portrait.mjs +2 -0
- package/vendor/modules/quality/index.d.ts +130 -0
- package/vendor/modules/quality.d.mts +1 -0
- package/vendor/modules/quality.inputs.json +34 -0
- package/vendor/modules/quality.mjs +2 -0
- package/vendor/modules/scene-blend/blend.d.ts +54 -0
- package/vendor/modules/scene-blend/blend.glsl.d.ts +8 -0
- package/vendor/modules/scene-blend/index.d.ts +25 -0
- package/vendor/modules/scene-blend/lit.d.ts +61 -0
- package/vendor/modules/scene-blend/noise.d.ts +13 -0
- package/vendor/modules/scene-blend/settings.d.ts +63 -0
- package/vendor/modules/scene-blend.d.mts +1 -0
- package/vendor/modules/scene-blend.inputs.json +133 -0
- package/vendor/modules/scene-blend.mjs +2 -0
- package/vendor/modules/section-post/index.d.ts +23 -0
- package/vendor/modules/section-post/lit.d.ts +47 -0
- package/vendor/modules/section-post/noise.d.ts +14 -0
- package/vendor/modules/section-post/post.d.ts +31 -0
- package/vendor/modules/section-post/post.glsl.d.ts +8 -0
- package/vendor/modules/section-post/settings.d.ts +84 -0
- package/vendor/modules/section-post.d.mts +1 -0
- package/vendor/modules/section-post.inputs.json +107 -0
- package/vendor/modules/section-post.mjs +53 -0
- package/vendor/modules/surfaces/exact.d.ts +8 -0
- package/vendor/modules/surfaces/field.d.ts +7 -0
- package/vendor/modules/surfaces/gpu.d.ts +19 -0
- package/vendor/modules/surfaces/index.d.ts +17 -0
- package/vendor/modules/surfaces/paint.d.ts +28 -0
- package/vendor/modules/surfaces/plan.d.ts +39 -0
- package/vendor/modules/surfaces/print.d.ts +55 -0
- package/vendor/modules/surfaces/recipe.d.ts +143 -0
- package/vendor/modules/surfaces/surface.glsl.d.ts +4 -0
- package/vendor/modules/surfaces.d.mts +1 -0
- package/vendor/modules/surfaces.inputs.json +54 -0
- package/vendor/modules/surfaces.mjs +172 -0
- package/vendor/modules/tracks/index.d.ts +66 -0
- package/vendor/modules/tracks.d.mts +1 -0
- package/vendor/modules/tracks.mjs +2 -0
- package/vendor/modules/tree-growth/bend.d.ts +28 -0
- package/vendor/modules/tree-growth/frame.d.ts +60 -0
- package/vendor/modules/tree-growth/index.d.ts +23 -0
- package/vendor/modules/tree-growth/light.d.ts +13 -0
- package/vendor/modules/tree-growth/math.d.ts +19 -0
- package/vendor/modules/tree-growth/model.d.ts +100 -0
- package/vendor/modules/tree-growth/sectors.d.ts +10 -0
- package/vendor/modules/tree-growth/simulation.d.ts +58 -0
- package/vendor/modules/tree-growth/species.d.ts +117 -0
- package/vendor/modules/tree-growth/species.data.d.ts +2 -0
- package/vendor/modules/tree-growth/year.d.ts +38 -0
- package/vendor/modules/tree-growth.d.mts +1 -0
- package/vendor/modules/tree-growth.inputs.json +75 -0
- package/vendor/modules/tree-growth.mjs +2 -0
- package/vendor/modules/tree-render/features.d.ts +9 -0
- package/vendor/modules/tree-render/forest/bake.d.ts +41 -0
- package/vendor/modules/tree-render/forest/cards.d.ts +28 -0
- package/vendor/modules/tree-render/forest/forest.d.ts +156 -0
- package/vendor/modules/tree-render/index.d.ts +52 -0
- package/vendor/modules/tree-render/inputs.d.ts +260 -0
- package/vendor/modules/tree-render/instances.d.ts +66 -0
- package/vendor/modules/tree-render/math.d.ts +8 -0
- package/vendor/modules/tree-render/tree/bark.d.ts +20 -0
- package/vendor/modules/tree-render/tree/leaves.d.ts +29 -0
- package/vendor/modules/tree-render/tree/litter.d.ts +21 -0
- package/vendor/modules/tree-render/tree/ornaments.d.ts +36 -0
- package/vendor/modules/tree-render/tree/roots.d.ts +75 -0
- package/vendor/modules/tree-render/tree/shapes.d.ts +49 -0
- package/vendor/modules/tree-render/tree/tree.d.ts +239 -0
- package/vendor/modules/tree-render/tree/wood.d.ts +27 -0
- package/vendor/modules/tree-render/wind.d.ts +51 -0
- package/vendor/modules/tree-render.d.mts +1 -0
- package/vendor/modules/tree-render.inputs.json +45 -0
- package/vendor/modules/tree-render.mjs +2 -0
- package/vendor/modules/voxel-dither/dither.glsl.d.ts +9 -0
- package/vendor/modules/voxel-dither/index.d.ts +35 -0
- package/vendor/modules/voxel-dither/light.d.ts +33 -0
- package/vendor/modules/voxel-dither/lit.d.ts +86 -0
- package/vendor/modules/voxel-dither/pass.d.ts +46 -0
- package/vendor/modules/voxel-dither/screens.d.ts +21 -0
- package/vendor/modules/voxel-dither/settings.d.ts +307 -0
- package/vendor/modules/voxel-dither/signals.d.ts +35 -0
- package/vendor/modules/voxel-dither.d.mts +1 -0
- package/vendor/modules/voxel-dither.inputs.json +295 -0
- package/vendor/modules/voxel-dither.mjs +452 -0
- package/vendor/modules/world-light/index.d.ts +133 -0
- package/vendor/modules/world-light.d.mts +1 -0
- package/vendor/modules/world-light.inputs.json +68 -0
- package/vendor/modules/world-light.mjs +2 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
{
|
|
2
|
+
"protocol": "keel-module-inputs@1",
|
|
3
|
+
"fields": [
|
|
4
|
+
{
|
|
5
|
+
"key": "climate",
|
|
6
|
+
"label": "Climate",
|
|
7
|
+
"required": false,
|
|
8
|
+
"type": "select",
|
|
9
|
+
"options": [
|
|
10
|
+
{
|
|
11
|
+
"value": "temperate",
|
|
12
|
+
"label": "Temperate"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"value": "maritime",
|
|
16
|
+
"label": "Maritime"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"value": "alpine",
|
|
20
|
+
"label": "Alpine"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"value": "monsoon",
|
|
24
|
+
"label": "Monsoon"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"value": "highland",
|
|
28
|
+
"label": "Highland"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"value": "desert",
|
|
32
|
+
"label": "Desert"
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"default": "temperate"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"key": "weather",
|
|
39
|
+
"label": "Weather",
|
|
40
|
+
"required": false,
|
|
41
|
+
"placement": "advanced",
|
|
42
|
+
"type": "select",
|
|
43
|
+
"options": [
|
|
44
|
+
{
|
|
45
|
+
"value": "clear",
|
|
46
|
+
"label": "Clear"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"value": "wind",
|
|
50
|
+
"label": "Wind"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"value": "leaves",
|
|
54
|
+
"label": "Blowing leaves"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"value": "rain",
|
|
58
|
+
"label": "Rain"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"value": "snow",
|
|
62
|
+
"label": "Snow"
|
|
63
|
+
}
|
|
64
|
+
],
|
|
65
|
+
"default": "clear"
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// world-light@0.1.0 from keel-modules 53c36d0 (MIT). Generated: don't edit.
|
|
2
|
+
var n=Math.PI/180,a=864e5,e=(n,a,e)=>Math.min(e,Math.max(a,n)),i=(n,a)=>(n%a+a)%a,t=(n,a,i)=>{let t=e((i-n)/(a-n),0,1);return t*t*(3-2*t)};function o(t,o,s){let l=t/a+2440587.5-2451545,u=i(280.46+.9856474*l,360),c=i(357.528+.9856003*l,360)*n,h=(u+1.915*Math.sin(c)+.02*Math.sin(2*c))*n,f=(23.439-4e-7*l)*n,d=Math.atan2(Math.cos(f)*Math.sin(h),Math.cos(h)),y=Math.asin(Math.sin(f)*Math.sin(h)),m=i(18.697374558+24.06570982441908*l,24),g=i(15*m+s-d/n+180,360)-180;return{...r(g*n,y,e(o,-89.9,89.9)*n),declination:y/n,hourAngle:g}}function r(a,e,t){let o=Math.asin(Math.sin(t)*Math.sin(e)+Math.cos(t)*Math.cos(e)*Math.cos(a)),r=Math.atan2(-Math.sin(a),Math.tan(e)*Math.cos(t)-Math.sin(t)*Math.cos(a));return{elevation:o/n,azimuth:i(r/n,360)}}function s(n,e,t){let r=i((n/a+2440587.5-2451550.1)/29.530588853,1),s=o(n-r*a,e,t);return{elevation:s.elevation,azimuth:s.azimuth,phase:r,illumination:(1-Math.cos(2*r*Math.PI))/2}}function l(a){let e=a.elevation*n,i=a.azimuth*n;return[Math.sin(i)*Math.cos(e),Math.sin(e),-Math.cos(i)*Math.cos(e)]}var u={"America/New_York":[40.71,-74.01,"New York"],"America/Chicago":[41.88,-87.63,"Chicago"],"America/Denver":[39.74,-104.99,"Denver"],"America/Phoenix":[33.45,-112.07,"Phoenix"],"America/Los_Angeles":[34.05,-118.24,"Los Angeles"],"America/Anchorage":[61.22,-149.9,"Anchorage"],"Pacific/Honolulu":[21.31,-157.86,"Honolulu"],"America/Toronto":[43.65,-79.38,"Toronto"],"America/Vancouver":[49.28,-123.12,"Vancouver"],"America/Mexico_City":[19.43,-99.13,"Mexico City"],"America/Bogota":[4.71,-74.07,"Bogot\xe1"],"America/Lima":[-12.05,-77.04,"Lima"],"America/Sao_Paulo":[-23.55,-46.63,"S\xe3o Paulo"],"America/Argentina/Buenos_Aires":[-34.6,-58.38,"Buenos Aires"],"America/Santiago":[-33.45,-70.67,"Santiago"],"Atlantic/Reykjavik":[64.15,-21.94,"Reykjav\xedk"],"Europe/London":[51.51,-.13,"London"],"Europe/Dublin":[53.35,-6.26,"Dublin"],"Europe/Lisbon":[38.72,-9.14,"Lisbon"],"Europe/Madrid":[40.42,-3.7,"Madrid"],"Europe/Paris":[48.86,2.35,"Paris"],"Europe/Berlin":[52.52,13.4,"Berlin"],"Europe/Rome":[41.9,12.5,"Rome"],"Europe/Amsterdam":[52.37,4.9,"Amsterdam"],"Europe/Stockholm":[59.33,18.07,"Stockholm"],"Europe/Oslo":[59.91,10.75,"Oslo"],"Europe/Helsinki":[60.17,24.94,"Helsinki"],"Europe/Athens":[37.98,23.73,"Athens"],"Europe/Istanbul":[41.01,28.98,"Istanbul"],"Europe/Moscow":[55.76,37.62,"Moscow"],"Africa/Cairo":[30.04,31.24,"Cairo"],"Africa/Lagos":[6.52,3.38,"Lagos"],"Africa/Nairobi":[-1.29,36.82,"Nairobi"],"Africa/Johannesburg":[-26.2,28.05,"Johannesburg"],"Asia/Dubai":[25.2,55.27,"Dubai"],"Asia/Tehran":[35.69,51.39,"Tehran"],"Asia/Karachi":[24.86,67,"Karachi"],"Asia/Kolkata":[22.57,88.36,"Kolkata"],"Asia/Kathmandu":[27.72,85.32,"Kathmandu"],"Asia/Bangkok":[13.76,100.5,"Bangkok"],"Asia/Jakarta":[-6.21,106.85,"Jakarta"],"Asia/Singapore":[1.35,103.82,"Singapore"],"Asia/Shanghai":[31.23,121.47,"Shanghai"],"Asia/Hong_Kong":[22.32,114.17,"Hong Kong"],"Asia/Taipei":[25.03,121.57,"Taipei"],"Asia/Manila":[14.6,120.98,"Manila"],"Asia/Seoul":[37.57,126.98,"Seoul"],"Asia/Tokyo":[35.68,139.69,"Tokyo"],"Australia/Perth":[-31.95,115.86,"Perth"],"Australia/Adelaide":[-34.93,138.6,"Adelaide"],"Australia/Brisbane":[-27.47,153.03,"Brisbane"],"Australia/Sydney":[-33.87,151.21,"Sydney"],"Australia/Melbourne":[-37.81,144.96,"Melbourne"],"Pacific/Auckland":[-36.85,174.76,"Auckland"],UTC:[51.48,0,"Greenwich"]};function c(n,a=0){let i=u[n];if(void 0!==i)return{lat:i[0],lon:i[1],place:i[2],exact:!0};let t=n.split("/").pop()?.replaceAll("_"," ")??"";return{lat:38,lon:e(Number.isFinite(a)?a/4:0,-180,180),place:t.length>0?t:"UTC",exact:!1}}var h=Object.keys(u);function f(n){let a=Number.parseInt(n.slice(1),16);return[a>>16&255,a>>8&255,255&a]}function d(n,a,i){let t=f(n),o=f(a),r=e(i,0,1);return function(n){return`#${n.map(n=>Math.round(e(n,0,255)).toString(16).padStart(2,"0")).join("")}`}([t[0]+(o[0]-t[0])*r,t[1]+(o[1]-t[1])*r,t[2]+(o[2]-t[2])*r])}var y=[{at:-90,top:"#03060f",horizon:"#0a1226",sun:"#000000",fill:"#1d2748",ground:"#06080e",sunIntensity:0,fillIntensity:.42},{at:-14,top:"#08122c",horizon:"#1d2a52",sun:"#000000",fill:"#27325c",ground:"#090c16",sunIntensity:0,fillIntensity:.5},{at:-6,top:"#1a2a5e",horizon:"#5b5a94",sun:"#ff6a4a",fill:"#4a5590",ground:"#151726",sunIntensity:0,fillIntensity:.66},{at:-1,top:"#2d4b8e",horizon:"#e2775c",sun:"#ff6236",fill:"#8a789e",ground:"#2a2230",sunIntensity:.35,fillIntensity:.84},{at:3,top:"#4870b4",horizon:"#f2ac72",sun:"#ff9a4c",fill:"#b3aac0",ground:"#3d3a38",sunIntensity:1.7,fillIntensity:1},{at:10,top:"#5a8ed0",horizon:"#f5d4a2",sun:"#ffd192",fill:"#cfd5df",ground:"#4a4a40",sunIntensity:2.5,fillIntensity:1.24},{at:25,top:"#4a8ae0",horizon:"#aed6f0",sun:"#fff0d8",fill:"#e4f0fb",ground:"#4f5a48",sunIntensity:3.3,fillIntensity:1.44},{at:90,top:"#357ae0",horizon:"#b8dcf4",sun:"#fffaf0",fill:"#f2f8ff",ground:"#56634e",sunIntensity:3.8,fillIntensity:1.6}];function m(n){let a=y[e(n,0,y.length-1)];if(void 0===a)throw new RangeError("world-light: no sky stops");return a}var g={spring:{horizon:["#f6d4e0",.14],fill:["#f4dde6",.1],haze:.15,sunScale:1,rays:1},summer:{top:["#2f72d6",.12],sun:["#fff0c8",.1],haze:.05,sunScale:1.06,rays:.9},autumn:{horizon:["#f2ad6a",.18],sun:["#ffbf78",.16],fill:["#f0d2b0",.1],haze:.3,sunScale:.95,rays:1.25},winter:{top:["#9db6d8",.22],sun:["#f4f2ff",.2],fill:["#d8e2f4",.16],haze:.12,sunScale:.85,rays:.95},"long rains":{horizon:["#c9d2c4",.16],haze:.35,sunScale:.92,rays:1.2},"short rains":{horizon:["#c9d2c4",.14],haze:.3,sunScale:.94,rays:1.15},"high sun":{top:["#2f72d6",.1],haze:.05,sunScale:1.08,rays:.85},"dry season":{horizon:["#e8c890",.2],sun:["#ffd9a0",.1],haze:.35,sunScale:1,rays:1.3}},p={temperate:{haze:0,sunScale:1,rays:1},maritime:{horizon:["#c4d0d6",.16],haze:.22,sunScale:.92,rays:1.15},alpine:{top:["#2a63c8",.14],haze:-.15,sunScale:1.1,rays:.85},monsoon:{horizon:["#e6d2c0",.14],haze:.28,sunScale:.95,rays:1.2},highland:{horizon:["#ead8b0",.12],haze:.12,sunScale:1.05,rays:1.1},desert:{horizon:["#efd0a0",.2],sun:["#fff0d0",.1],haze:.2,sunScale:1.1,rays:1.1}},z={clear:{haze:0,sunScale:1,rays:1},wind:{haze:.05,sunScale:1,rays:1.05},leaves:{haze:.12,sunScale:1,rays:1.15},rain:{top:["#7d878f",.62],horizon:["#99a2a8",.6],sun:["#c8ccd0",.5],fill:["#a9b0b6",.4],haze:.45,sunScale:.28,rays:.12},snow:{top:["#b8c4d0",.5],horizon:["#dfe5ec",.5],sun:["#eef2f8",.4],fill:["#dfe6f0",.3],haze:.35,sunScale:.5,rays:.35}};function A(n){return n<-12?"night":n<-4?"twilight":n<0?"blue hour":n<10?"golden hour":n<50?"day":"high sun"}function M(n,a,i,o){let r=function(n,a,i){let o=t(-3,2,n)*(1-t(14,50,n)),r=.3*t(2,70,n);return e((o+r)*(.55+a)*i,0,1.4)}(n.elevation,i,o),s=a.intensity*t(5,25,a.elevation)*.45*o;if(r<=.02&&s<=.02)return{source:"none",direction:n.direction,strength:0,color:"#000000",decay:.95,density:.8};if(r>=s){let a=1-t(4,30,n.elevation);return{source:"sun",direction:n.direction,strength:r,color:d(n.color,"#ffffff",.15),decay:.94+.04*a+.01*i,density:.75+.2*a}}return{source:"moon",direction:a.direction,strength:s,color:"#b7c6ff",decay:.95,density:.8}}function S(n){let a=o(n.timestamp,n.lat,n.lon),i=[g[n.season??""]??p.temperate,p[n.climate??"temperate"],z[n.weather??"clear"]],r=1-t(-14,-2,a.elevation),u=i.reduce((n,a)=>function(n,a,e=1){let i=(n,a)=>void 0===a?n:d(n,a[0],a[1]*e);return{...n,top:i(n.top,a.top),horizon:i(n.horizon,a.horizon),sun:i(n.sun,a.sun),fill:i(n.fill,a.fill),sunIntensity:n.sunIntensity*a.sunScale}}(n,a,1-.8*r),function(n){let a=y.findIndex(a=>a.at>n),i=m(-1===a?y.length-1:Math.max(1,a)),t=m(-1===a?y.length-2:Math.max(0,a-1)),o=e((n-t.at)/(i.at-t.at),0,1),r=n=>d(t[n],i[n],o);return{at:n,top:r("top"),horizon:r("horizon"),sun:r("sun"),fill:r("fill"),ground:r("ground"),sunIntensity:t.sunIntensity+(i.sunIntensity-t.sunIntensity)*o,fillIntensity:t.fillIntensity+(i.fillIntensity-t.fillIntensity)*o}}(a.elevation)),c=e(.06+i.reduce((n,a)=>n+a.haze,0)+function(n,a){return a>-4&&n<0?.35*(1-t(-6,30,a)):0}(a.hourAngle,a.elevation),0,1),h=i.reduce((n,a)=>n*a.rays,1),f={direction:l(a),elevation:a.elevation,azimuth:a.azimuth,color:u.sun,intensity:u.sunIntensity*t(-3,1,a.elevation)},S=function(n,a,e,i){let o=s(n,a,e),r=t(-2,12,o.elevation);return{direction:l(o),elevation:o.elevation,azimuth:o.azimuth,color:"#a9bcff",intensity:(.15+.85*o.illumination)*r*i*.9,phase:o.phase,illumination:o.illumination}}(n.timestamp,n.lat,n.lon,r);return{phase:A(a.elevation),sun:f,moon:S,sky:{top:u.top,horizon:u.horizon,ground:d(u.horizon,u.ground,.55)},fill:{sky:u.fill,ground:u.ground,intensity:u.fillIntensity*(1-.15*c)},fog:{color:d(d(u.horizon,u.top,.35),u.fill,.2),near:32-8*c,far:118-34*c},haze:c,night:r,rays:M(f,S,c,h)}}export{h as KNOWN_ZONES,A as lightPhase,c as locateTimeZone,d as mixHex,s as moonState,l as skyDirection,o as solarPosition,S as worldLight};
|