PageSourceSearch

https://toolbreezy.com/_next/static/chunks/80685-5737e1e35ad74d59.js

js toolbreezy.com collected 2026-09-24 14:57:55 UTC 42,558 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[80685],{80685:(e,t,n)=>{n.r(t),n.d(t,{PLACES:()=>G,clampGoldenHigh:()=>X,clampGoldenLow:()=>J,computeDay:()=>T,default:()=>et,fmtDuration:()=>I,goldenBand:()=>Q,instantFromZoned:()=>E,photoMinutes:()=>es,riseHeadline:()=>en,setHeadline:()=>ea,usableZone:()=>ee});var a=n(95155),s=n(12115),l=n(33789),o=n(27784),r=n(97003),i=n(33534),d=n(69869),u=n(25016),h=n(14827),c=n(16110);let m=Math.PI/180,g=e=>Math.sin(e*m),x=e=>Math.cos(e*m),p=e=>Math.tan(e*m);function f(e){let t=(e/864e5+2440587.5-2451545)/36525,n=(280.46646+t*(36000.76983+3032e-7*t))%360,a=357.52911+t*(35999.05029-1537e-7*t),s=.016708634-t*(42037e-9+1267e-10*t),l=g(a)*(1.914602-t*(.004817+14e-6*t))+g(2*a)*(.019993-101e-6*t)+289e-6*g(3*a),o=125.04-1934.136*t,r=n+l-.00569-.00478*g(o),i=23+(26+(21.448-t*(46.815+t*(59e-5-.001813*t)))/60)/60+.00256*x(o),d=Math.asin(g(i)*g(r))/m,u=p(i/2)**2;return{dec:d,eqTime:4*((u*g(2*n)-2*s*g(a)+4*s*u*g(a)*x(2*n)-.5*u*u*g(4*n)-1.25*s*s*g(2*a))/m)}}function y(e,t,n){let a=(((e%864e5+864e5)%864e5/6e4+n+4*t)%1440+1440)%1440/4-180;return a<-180&&(a+=360),a>180&&(a-=360),a}function b(e,t,n){let{dec:a,eqTime:s}=f(e),l=y(e,n,s);return 90-Math.acos(Math.max(-1,Math.min(1,g(t)*g(a)+x(t)*x(a)*x(l))))/m}function w(e,t,n){let{dec:a,eqTime:s}=f(e),l=y(e,n,s);return(Math.atan2(g(l),x(l)*g(t)-p(a)*x(t))/m+180+360)%360}function N(e){return 1/Math.tan((e+7.31/(e+4.4))*m)}let v=N(0);function j(e){return e<=0?-.833:e-.266-(e<=0?.567:.567*(N(e)/v))}function k(e,t,n,a,s){let l=[];for(let o=1;o<e.length;o++){let r=t[o-1]-s,i=t[o]-s;if(0===r){l.push({ms:e[o-1],rising:i>0});continue}if(r<0==i<0)continue;let d=e[o-1],u=e[o],h=r;for(let e=0;e<60;e++){let e=(d+u)/2,t=b(e,n,a)-s;h<0==t<0?(d=e,h=t):u=e}l.push({ms:(d+u)/2,rising:i>r})}return l}function z(e,t,n,a,s){let l=e,o=t;for(let e=0;e<70;e++){let e=l+(o-l)/3,t=o-(o-l)/3,r=b(e,n,a),i=b(t,n,a);(s?r<i:r>i)?l=e:o=t}return(l+o)/2}let S=[{key:"night",label:"Night",color:"#080d1c"},{key:"astro",label:"Astronomical twilight",color:"#16204a"},{key:"nautical",label:"Nautical twilight",color:"#26386f"},{key:"civil",label:"Civil twilight",color:"#5c7fbb"},{key:"day",label:"Daylight",color:"#bcdcf7"}],A={night:"Night",astro:"Astronomical twilight",nautical:"Nautical twilight",civil:"Civil twilight",day:"Daylight"},$={blue:"#3f63b4",golden:"#e5a437"},M={blue:"Blue hour",golden:"Golden hour"};function T(e,t,n,a,s){let l=[],o=[];for(let s=e;s<t;s+=3e5)l.push(s),o.push(b(s,n,a));l.push(t),o.push(b(t,n,a));let r=0,i=0;for(let e=1;e<o.length;e++)o[e]>o[r]&&(r=e),o[e]<o[i]&&(i=e);let d=z(l[Math.max(0,r-1)],l[Math.min(l.length-1,r+1)],n,a,!0),u=z(l[Math.max(0,i-1)],l[Math.min(l.length-1,i+1)],n,a,!1),h=b(d,n,a),c=b(u,n,a),m=new Map,g=e=>{let t=m.get(e);if(t)return t;let s=k(l,o,n,a,e);return m.set(e,s),s},x=new Map,p=(e,s)=>{let l=g(s).filter(e=>!e.rising),o=l.length?l[l.length-1].ms:null;return null===e||null===o||o>=e?o:(e=>{let s=x.get(e);if(s)return s;let l=[],o=[];for(let e=t;e<t+864e5;e+=3e5)l.push(e),o.push(b(e,n,a));l.push(t+864e5),o.push(b(t+864e5,n,a));let r=k(l,o,n,a,e);return x.set(e,r),r})(s).find(e=>!e.rising)?.ms??null},f=g(-.833),y=f.find(e=>e.rising)?.ms??null,N=p(y,-.833),v=new Set([e,t]);for(let e of[-18,-12,-6,-.833])for(let t of g(e))v.add(t.ms);let S=[...v].sort((e,t)=>e-t),A=[];for(let e=1;e<S.length;e++){let t=S[e-1],s=S[e];if(s-t<1)continue;let l=b((t+s)/2,n,a),o=l>=-.833?"day":l>=-6?"civil":l>=-12?"nautical":l>=-18?"astro":"night",r=A[A.length-1];r&&r.kind===o?r.end=s:A.push({kind:o,start:t,end:s})}let $={night:0,astro:0,nautical:0,civil:0,day:0};for(let e of A)$[e.kind]+=(e.end-e.start)/6e4;let M=new Set([e,t]);for(let e of[s.blueLow,s.goldenLow,s.goldenHigh])for(let t of g(e))M.add(t.ms);let T=[...M].sort((e,t)=>e-t),C=[];for(let e=1;e<T.length;e++){let t=T[e-1],l=T[e];if(l-t<1)continue;let o=b((t+l)/2,n,a),r=null;if(o>=s.goldenLow&&o<=s.goldenHigh?r="golden":o>=s.blueLow&&o<s.goldenLow&&(r="blue"),!r)continue;let i=C[C.length-1];i&&i.kind===r&&1>Math.abs(i.end-t)?i.end=l:C.push({kind:r,start:t,end:l})}let D=s.horizonEast>0?j(s.horizonEast):null,E=s.horizonWest>0?j(s.horizonWest):null,U=null===D?null:g(D).find(e=>e.rising)?.ms??null,L=null===E?null:p(y,E),F=[];null!==y&&F.push({ms:y,az:w(y,n,a),el:0});for(let e=0;e<l.length;e++){let t=l[e];o[e]<0||null!==y&&t<y||null!==N&&t>N||F.push({ms:t,az:w(t,n,a),el:o[e]})}null!==N&&F.push({ms:N,az:w(N,n,a),el:0});let P=[],I=(e,n,a)=>{null!=a&&P.push({key:e,label:n,ms:a,morning:a<=d,nextDay:a>=t})},W=(e,t)=>{let n=g(e).filter(e=>e.rising===t);return n.length?t?n[0].ms:n[n.length-1].ms:null};return I("astro-dawn","First light, astronomical dawn",W(-18,!0)),I("nautical-dawn","Nautical dawn",W(-12,!0)),I("civil-dawn","Civil dawn, blue hour starts",W(-6,!0)),I("golden-start","Golden hour starts",W(s.goldenLow,!0)),I("sunrise","Sunrise",y),I("ridge-rise","Sun clears your raised horizon",U),I("golden-end","Golden hour ends",W(s.goldenHigh,!0)),I("golden-pm-start","Golden hour starts",W(s.goldenHigh,!1)),I("ridge-set","Sun drops behind your raised horizon",L),I("sunset","Sunset",N),I("golden-pm-end","Golden hour ends, blue hour starts",W(s.goldenLow,!1)),I("civil-dusk","Civil dusk, blue hour ends",W(-6,!1)),I("nautical-dusk","Nautical dusk",W(-12,!1)),I("astro-dusk","Last light, astronomical dusk",W(-18,!1)),P.sort((e,t)=>
1e.ms-t.ms),{start:e,end:t,totalMinutes:(t-e)/6e4,bands:A,photoBands:C,tally:$,sunrise:y,sunset:N,sunsetNextDay:null!==N&&N>=t,riseAzimuth:null===y?null:w(y,n,a),setAzimuth:null===N?null:w(N,n,a),solarNoon:d,noonElevation:h,minElevation:c,maxElevation:h,daylightMinutes:$.day,neverSets:null===y&&null===N&&c>-.833,neverRises:null===y&&null===N&&h<-.833,ridgeRise:U,ridgeSet:L,path:F,events:P}}function C(){let e=Intl;try{if("function"==typeof e.supportedValuesOf)return e.supportedValuesOf("timeZone")}catch{}return["UTC","America/Los_Angeles","America/Denver","America/Chicago","America/New_York","America/Sao_Paulo","Europe/London","Europe/Paris","Europe/Moscow","Africa/Johannesburg","Asia/Dubai","Asia/Kolkata","Asia/Singapore","Asia/Tokyo","Australia/Perth","Australia/Sydney","Pacific/Auckland"]}function D(e,t){let n=new Intl.DateTimeFormat("en-US",{timeZone:e,hour12:!1,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).formatToParts(new Date(t)),a=e=>Number(n.find(t=>t.type===e)?.value??0);return Date.UTC(a("year"),a("month")-1,a("day"),a("hour")%24,a("minute"),a("second"))-t}function E(e,t,n,a,s,l){let o=Date.UTC(t,n-1,a,s,l,0),r=o-D(e,o);return o-D(e,r)}function U(e,t){let n=new Intl.DateTimeFormat("en-US",{timeZone:t,year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(new Date(e)),a=e=>Number(n.find(t=>t.type===e)?.value??0);return{year:a("year"),month:a("month"),day:a("day")}}function L(e,t){return new Intl.DateTimeFormat("en-US",{timeZone:t,hour:"numeric",minute:"2-digit"}).format(new Date(e))}function F(e,t){return new Intl.DateTimeFormat("en-US",{timeZone:t,weekday:"long",month:"long",day:"numeric",year:"numeric"}).format(new Date(e))}function P(e,t){try{let n=new Intl.DateTimeFormat("en-US",{timeZone:t,timeZoneName:"shortOffset"}).formatToParts(new Date(e)),a=n.find(e=>"timeZoneName"===e.type)?.value;return a?`${t.replace(/_/g," ")}, ${a}`:t.replace(/_/g," ")}catch{return t.replace(/_/g," ")}}function I(e){let t=Math.max(0,Math.round(e)),n=Math.floor(t/60),a=t%60;return 0===n?`${a}m`:`${n}h ${String(a).padStart(2,"0")}m`}let W=["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"],R=e=>W[Math.round((e%360+360)%360/22.5)%16];function B(e){let t=e.trim();if(!t)return null;let n=/[SW]/i.test(t.replace(/[^NSEWnsew]/g,""))?-1:1,a=t.match(/-?\d+(?:\.\d+)?/g);if(!a||!a.length)return null;let s=a.map(Number);if(s.some(e=>!Number.isFinite(e)))return null;let l=s[0]<0?-1:1,o=Math.abs(s[0]),r=s.length>1?Math.abs(s[1]):0,i=s.length>2?Math.abs(s[2]):0;return r>=60||i>=60?null:l*n*(o+r/60+i/3600)}function _(e,t){let n=Math.abs(e),a=Math.floor(n),s=(n-a)*60,l=Math.floor(s);return`${a}\u00b0 ${String(l).padStart(2,"0")}' ${((s-l)*60).toFixed(1).padStart(4,"0")}" ${t?e<0?"S":"N":e<0?"W":"E"}`}let G=[{name:"Anchorage, US",lat:61.22,lon:-149.9,zone:"America/Anchorage"},{name:"Atlanta, US",lat:33.75,lon:-84.39,zone:"America/New_York"},{name:"Boston, US",lat:42.36,lon:-71.06,zone:"America/New_York"},{name:"Chicago, US",lat:41.88,lon:-87.63,zone:"America/Chicago"},{name:"Dallas, US",lat:32.78,lon:-96.8,zone:"America/Chicago"},{name:"Denver, US",lat:39.74,lon:-104.99,zone:"America/Denver"},{name:"Honolulu, US",lat:21.31,lon:-157.86,zone:"Pacific/Honolulu"},{name:"Las Vegas, US",lat:36.17,lon:-115.14,zone:"America/Los_Angeles"},{name:"Los Angeles, US",lat:34.05,lon:-118.24,zone:"America/Los_Angeles"},{name:"Miami, US",lat:25.76,lon:-80.19,zone:"America/New_York"},{name:"Minneapolis, US",lat:44.98,lon:-93.27,zone:"America/Chicago"},{name:"New Orleans, US",lat:29.95,lon:-90.07,zone:"America/Chicago"},{name:"New York, US",lat:40.71,lon:-74.01,zone:"America/New_York"},{name:"Phoenix, US",lat:33.45,lon:-112.07,zone:"America/Phoenix"},{name:"Portland, US",lat:45.52,lon:-122.68,zone:"America/Los_Angeles"},{name:"Salt Lake City, US",lat:40.76,lon:-111.89,zone:"America/Denver"},{name:"San Francisco, US",lat:37.77,lon:-122.42,zone:"America/Los_Angeles"},{name:"Seattle, US",lat:47.61,lon:-122.33,zone:"America/Los_Angeles"},{name:"Washington DC, US",lat:38.91,lon:-77.04,zone:"America/Ne
1w_York"},{name:"Toronto, Canada",lat:43.65,lon:-79.38,zone:"America/Toronto"},{name:"Vancouver, Canada",lat:49.28,lon:-123.12,zone:"America/Vancouver"},{name:"Mexico City, Mexico",lat:19.43,lon:-99.13,zone:"America/Mexico_City"},{name:"Bogota, Colombia",lat:4.71,lon:-74.07,zone:"America/Bogota"},{name:"Lima, Peru",lat:-12.05,lon:-77.04,zone:"America/Lima"},{name:"Sao Paulo, Brazil",lat:-23.55,lon:-46.63,zone:"America/Sao_Paulo"},{name:"Buenos Aires, Argentina",lat:-34.6,lon:-58.38,zone:"America/Argentina/Buenos_Aires"},{name:"Ushuaia, Argentina",lat:-54.8,lon:-68.3,zone:"America/Argentina/Ushuaia"},{name:"Reykjavik, Iceland",lat:64.15,lon:-21.94,zone:"Atlantic/Reykjavik"},{name:"Dublin, Ireland",lat:53.35,lon:-6.26,zone:"Europe/Dublin"},{name:"London, UK",lat:51.51,lon:-.13,zone:"Europe/London"},{name:"Edinburgh, UK",lat:55.95,lon:-3.19,zone:"Europe/London"},{name:"Paris, France",lat:48.86,lon:2.35,zone:"Europe/Paris"},{name:"Madrid, Spain",lat:40.42,lon:-3.7,zone:"Europe/Madrid"},{name:"Lisbon, Portugal",lat:38.72,lon:-9.14,zone:"Europe/Lisbon"},{name:"Amsterdam, Netherlands",lat:52.37,lon:4.9,zone:"Europe/Amsterdam"},{name:"Berlin, Germany",lat:52.52,lon:13.4,zone:"Europe/Berlin"},{name:"Rome, Italy",lat:41.9,lon:12.5,zone:"Europe/Rome"},{name:"Athens, Greece",lat:37.98,lon:23.73,zone:"Europe/Athens"},{name:"Stockholm, Sweden",lat:59.33,lon:18.07,zone:"Europe/Stockholm"},{name:"Oslo, Norway",lat:59.91,lon:10.75,zone:"Europe/Oslo"},{name:"Tromso, Norway",lat:69.65,lon:18.96,zone:"Europe/Oslo"},{name:"Helsinki, Finland",lat:60.17,lon:24.94,zone:"Europe/Helsinki"},{name:"Warsaw, Poland",lat:52.23,lon:21.01,zone:"Europe/Warsaw"},{name:"Moscow, Russia",lat:55.76,lon:37.62,zone:"Europe/Moscow"},{name:"Istanbul, Turkey",lat:41.01,lon:28.98,zone:"Europe/Istanbul"},{name:"Cairo, Egypt",lat:30.04,lon:31.24,zone:"Africa/Cairo"},{name:"Lagos, Nigeria",lat:6.52,lon:3.38,zone:"Africa/Lagos"},{name:"Nairobi, Kenya",lat:-1.29,lon:36.82,zone:"Africa/Nairobi"},{name:"Cape Town, South Africa",lat:-33.92,lon:18.42,zone:"Africa/Johannesburg"},{name:"Dubai, UAE",lat:25.2,lon:55.27,zone:"Asia/Dubai"},{name:"Mumbai, India",lat:19.08,lon:72.88,zone:"Asia/Kolkata"},{name:"Delhi, India",lat:28.61,lon:77.21,zone:"Asia/Kolkata"},{name:"Bangkok, Thailand",lat:13.76,lon:100.5,zone:"Asia/Bangkok"},{name:"Singapore",lat:1.35,lon:103.82,zone:"Asia/Singapore"},{name:"Hong Kong",lat:22.32,lon:114.17,zone:"Asia/Hong_Kong"},{name:"Shanghai, China",lat:31.23,lon:121.47,zone:"Asia/Shanghai"},{name:"Seoul, South Korea",lat:37.57,lon:126.98,zone:"Asia/Seoul"},{name:"Tokyo, Japan",lat:35.68,lon:139.69,zone:"Asia/Tokyo"},{name:"Perth, Australia",lat:-31.95,lon:115.86,zone:"Australia/Perth"},{name:"Melbourne, Australia",lat:-37.81,lon:144.96,zone:"Australia/Melbourne"},{name:"Sydney, Australia",lat:-33.87,lon:151.21,zone:"Australia/Sydney"},{name:"Auckland, New Zealand",lat:-36.85,lon:174.76,zone:"Pacific/Auckland"}];function O(e){return e.replace(/\\/g,"\\\\").replace(/;/g,"\\;").replace(/,/g,"\\,").replace(/\n/g,"\\n")}function H(e){if(e.length<=73)return e;let t=[e.slice(0,73)],n=73;for(;n<e.length;)t.push(" "+e.slice(n,n+72)),n+=72;return t.join("\r\n")}function Z(e){return new Date(e).toISOString().replace(/[-:]/g,"").replace(/\.\d{3}/,"")}let V=e=>String(e).padStart(2,"0"),Y=(e,t,n)=>Math.max(t,Math.min(n,e)),K="tb-sun-v1",q=["p","d","tz","gl","gh","he","hw","lat","lon"],J=(e,t)=>Y(e,-6,Math.min(4,t-1)),X=(e,t)=>Y(e,Math.max(1,t+1),20);function Q(e,t){let n=X(Math.max(e,t),Math.min(e,t));return{low:J(Math.min(e,t),n),high:n}}function ee(e,t){if(!e)return t;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(0),e}catch{return t}}function et(){let[e,t]=(0,s.useState)(!1),[n,m]=(0,s.useState)("UTC"),[g,x]=(0,s.use
1State)("device"),[p,f]=(0,s.useState)(""),[y,N]=(0,s.useState)(!1),[v,j]=(0,s.useState)("40.71"),[k,z]=(0,s.useState)("-74.01"),[A,D]=(0,s.useState)(""),[W,et]=(0,s.useState)(-4),[eu,eh]=(0,s.useState)(6),[ec,em]=(0,s.useState)(0),[eg,ex]=(0,s.useState)(0),[ep,ef]=(0,s.useState)(!1),[ey,eb]=(0,s.useState)(""),[ew,eN]=(0,s.useState)(null),ev=(0,s.useRef)(0),ej=(0,s.useMemo)(C,[]);function ek(e){eb(e),window.setTimeout(()=>eb(t=>t===e?"":t),4e3)}(0,s.useEffect)(()=>{let e="UTC";try{e=Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC"}catch{}let n=e,a="device",s=-4,l=6,o="",r=(0,d.qA)(window.location.search,window.location.hash),i=(0,d.Yc)(r,q),u=r.get("lat"),h=r.get("lon"),c=!!(u&&h);try{let t=JSON.parse(localStorage.getItem(K)||"null");t&&"object"==typeof t&&("string"==typeof t.lat&&j(t.lat),"string"==typeof t.lon&&z(t.lon),"string"==typeof t.place&&f(t.place),"string"==typeof t.zone&&t.zone&&(n=ee(t.zone,e),a="place"===t.zoneSource||"chosen"===t.zoneSource?t.zoneSource:"device"),"number"==typeof t.gl&&(s=t.gl),"number"==typeof t.gh&&(l=t.gh),"number"==typeof t.he&&em(Y(t.he,0,30)),"number"==typeof t.hw&&ex(Y(t.hw,0,30)))}catch{}if(c){j(u),z(h),f(r.get("p")||"");let e=r.get("tz");if(e){let t=ee(e,n);t===e?a="chosen":o=e,n=t}let t=Number(r.get("he"));Number.isFinite(t)&&r.get("he")&&em(Y(t,0,30));let s=Number(r.get("hw"));Number.isFinite(s)&&r.get("hw")&&ex(Y(s,0,30))}let g=r.get("d");g&&/^\d{4}-\d{2}-\d{2}$/.test(g)&&D(g);let p=Number(r.get("gl"));Number.isFinite(p)&&r.get("gl")&&(s=p);let y=Number(r.get("gh"));Number.isFinite(y)&&r.get("gh")&&(l=y);let b=Q(s,l);if(et(b.low),eh(b.high),m(n),x(a),eN(Date.now()),!g){let e=U(Date.now(),n);D(`${e.year}-${V(e.month)}-${V(e.day)}`)}t(!0),o?eb(`This browser does not know the time zone "${o}" that link asks for, so these times are in ${n}. Pick the zone you want below.`):i&&!c&&eb("That link carried the date and the light settings but not a location, so these times are for the spot in the boxes below and the time zone already picked here, not the sender’s. Change either to see theirs.")},[]),(0,s.useEffect)(()=>{if(!e)return;let t=window.setInterval(()=>{document.hidden||eN(Date.now())},6e4);return()=>window.clearInterval(t)},[e]),(0,o.Vd)(K,()=>JSON.stringify({lat:v,lon:k,place:p,zone:n,zoneSource:g,gl:W,gh:eu,he:ec,hw:eg}),[v,k,p,n,g,W,eu,ec,eg]);let ez=B(v),eS=B(k),eA=""===v.trim()?"Enter a latitude.":null===ez?`Could not read a latitude from "${v.trim()}". Try 40.71 or 40 42 46 N.`:Math.abs(ez)>90?`Latitude ${ez} is outside the range. It has to sit between -90 and 90.`:"",e$=""===k.trim()?"Enter a longitude.":null===eS?`Could not read a longitude from "${k.trim()}". Try -74.01 or 74 0 36 W.`:Math.abs(eS)>180?`Longitude ${eS} is outside the range. It has to sit between -180 and 180.`:"",eM=(0,s.useMemo)(()=>{let e=/^(\d{4})-(\d{2})-(\d{2})$/.exec(A);if(!e)return null;let t=Number(e[1]),n=Number(e[2]),a=Number(e[3]);if(n<1||n>12||a<1||a>31)return null;let s=new Date(Date.UTC(t,n-1,a));return s.getUTCMonth()!==n-1||s.getUTCDate()!==a?null:{year:t,month:n,day:a}},[A]),eT=eM&&(eM.year<1901||eM.year>2099)?`These equations are only quoted as accurate from 1901 to 2099, so ${eM.year} is outside what this will answer for.`:"",eC=(0,s.useMemo)(()=>({goldenLow:W,goldenHigh:eu,blueLow:-6,horizonEast:ec,horizonWest:eg}),[W,eu,ec,eg]),eD=!eA&&!e$&&!eT&&null!==eM&&null!==ez&&null!==eS,eE=(0,s.useMemo)(()=>eD&&eM&&null!==ez&&null!==eS?T(E(n,eM.year,eM.month,eM.day,0,0),E(n,eM.year,eM.month,eM.day+1,0,0),ez,eS,eC):null,[eD,eM,ez,eS,n,eC]),eU=(0,s.useMemo)(()=>eD&&eM&&null!==ez&&null!==eS?T(E(n,eM.year,eM.month,eM.day-1,0,0),E(n,eM.year,eM.month,eM.day,0,0),ez,eS,eC):null,[eD,eM,ez,eS,n,eC]),eL=(0,s.useMemo)(()=>{if(!ep||!eD||!eM||null===ez||null===eS)return null;let e=new Date(Date.UTC(eM.year,eM.month,0)).getUTCDate(),t=[],a=null;for(let s=1;s<=e;s++){let e=T(E(n,eM.year,eM.month,s,0,0),E(n,eM.year,eM.month,s+1,0,0),ez,eS,eC),l=a?(e.daylightMinutes-a.daylightMinutes)*6e4:null;t.push({day:s,result:e,deltaMs:l}),a=e}return t},[ep,eD,eM,ez,eS,n,eC]),eF=eE?Math.round(eE.totalMinutes)-1440:0,eP=(0,s.useMemo)(()=>!!eE&&null!==ew&&ew>=eE.start&&ew<eE.end,[eE,ew]),eI=eP&&null!==ew&&null!==ez&&null!==eS?b(ew,ez,eS):null;function eW(e){if(!eM)return;let t=new Date(Date.UTC(eM.year,eM.month-1,eM.day+e));D(`${t.getUTCFullYear()}-${V(t.getUTCMonth()+1)}-${V(t.getUTCDate())}`)}let eR=(0,s.useCallback)(()=>{let e="the coordinates you entered",t=""===p,a=e=>t&&!y?null:e;return(0,d.CZ)([{key:"p",value:p||null},{key:"d",value:A||null},{key:"tz",value:n},{key:"gl",value:-4!==W?String(W):null},{key:"gh",value:6!==eu?String(eu):null},{key:"he",value:ec>0?String(ec):null},{key:"hw",value:eg>0?String(eg):null},{key:"lat",value:a(v.trim()),personal:t?e:void 0},{key:"lon",value:a(k.trim()),personal:t?e:void 0}])},[v,k,p,y,A,n,W,eu,ec,eg]);if(!e)return(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:"Working out the light..."});let eB=eE?eE.events.filter(e=>e.morning):[],e_=eE?eE.events.filter(e=>!e.morning):[],eG=eE?es(eE,"golden"):0,eO=eE?es(eE,"blue"):0,eH=eE&&eU?(eE.daylightMinutes-eU.daylightMinutes)*6e4:null;return(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsx)("section",{className:"rounded-lg border bg-background p-4 sm:p-5",children:eE?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"text-xs uppercase tracking-wide text-muted-foreground",children:[p||`${ez.toFixed(4)}, ${eS.toFixed(4)}`," on ",F(eE.start,n)]}),(0,a.jsxs)("div",{className:"mt-2 grid gap-3 sm:grid-cols-3",children:[(0,a.jsx)(el,{label:"Sunrise",...en(eE,n)}
1),(0,a.jsx)(el,{label:"Sunset",...ea(eE,n)}),(0,a.jsx)(el,{label:"Daylight",value:I(eE.daylightMinutes),sub:null===eH?"":function(e){let t=Math.round(Math.abs(e)/1e3),n=Math.floor(t/60),a=t%60,s=n>0?`${n}m ${String(a).padStart(2,"0")}s`:`${a}s`;return 0===t?"the same as yesterday":e>0?`${s} longer than yesterday`:`${s} shorter than yesterday`}(eH)})]}),(0,a.jsxs)("p",{className:"mt-3 text-sm text-muted-foreground",children:["Times in ",P(eE.start,n),". Highest the sun gets is ",eE.maxElevation.toFixed(1),"\xb0"," at ",L(eE.solarNoon,n),", which is solar noon rather than clock noon.",0!==eF&&(0,a.jsxs)(a.Fragment,{children:[" This date is a clock change in that zone, so it runs ",Math.round(eE.totalMinutes/60)," hours rather than 24."]}),eP&&null!==eI&&(0,a.jsxs)(a.Fragment,{children:[" ","Right now the sun is ",eI>=0?`${eI.toFixed(1)}\u00b0 up`:`${Math.abs(eI).toFixed(1)}\u00b0 below the horizon`,"."]})]})]}):(0,a.jsx)("p",{className:"text-sm text-destructive",children:eA||e$||eT||"Pick a date and a place to see the day."})}),ey&&(0,a.jsx)("p",{className:"text-sm text-primary",children:ey}),eE&&(0,a.jsxs)("section",{className:"space-y-2",children:[(0,a.jsx)("h2",{className:"text-sm font-medium",children:"The whole day, midnight to midnight"}),(0,a.jsx)(er,{day:eE,zone:n,nowMs:eP?ew:null}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-xs text-muted-foreground",children:[S.map(e=>(0,a.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"inline-block h-2.5 w-2.5 rounded-sm border border-black/20",style:{background:e.color}}),e.label," ",I(eE.tally[e.key])]},e.key)),(0,a.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"inline-block h-2.5 w-2.5 rounded-sm border border-black/20",style:{background:$.blue}}),"Blue hour ",I(eO)]}),(0,a.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"inline-block h-2.5 w-2.5 rounded-sm border border-black/20",style:{background:$.golden}}),"Golden hour ",I(eG)]})]}),(0,a.jsxs)("p",{className:"text-xs text-muted-foreground",children:["The five bands on the top row add up to the ",Math.round(eE.totalMinutes)," minutes in this date. Golden and blue hour sit on their own row because they overlap the others, and both are photographic conventions rather than defined standards. Their figures are the day’s total across both ends, and the morning and evening windows are listed separately below."]})]}),eE&&(0,a.jsxs)("section",{className:"grid gap-4 sm:grid-cols-2",children:[(0,a.jsx)(ei,{title:"Morning",events:eB,zone:n,empty:"Nothing crosses a threshold before solar noon here today."}),(0,a.jsx)(ei,{title:"Evening",events:e_,zone:n,empty:"Nothing crosses a threshold after solar noon here today."})]}),eE&&(0,a.jsxs)("section",{className:"space-y-2",children:[(0,a.jsx)("h2",{className:"text-sm font-medium",children:"Where the sun actually goes"}),(0,a.jsxs)("div",{className:"flex flex-col items-center gap-4 sm:flex-row sm:items-start",children:[(0,a.jsx)(ed,{day:eE}),(0,a.jsxs)("div",{className:"min-w-0 flex-1 space-y-2 text-sm text-muted-foreground",children:[null!==eE.riseAzimuth&&null!==eE.setAzimuth?(0,a.jsxs)("p",{children:["It comes up at ",Math.round(eE.riseAzimuth),"\xb0"," (",R(eE.riseAzimuth),") and goes down at ",Math.round(eE.setAzimuth),"\xb0"," (",R(eE.setAzimuth),"), peaking ",eE.maxElevation.toFixed(1),"\xb0"," above the horizon to the"," ",R(w(eE.solarNoon,ez,eS)),". Those two bearings are what decide which side of a building the light lands on, and they move a long way across the year."]}):(0,a.jsx)("p",{children:"The sun does not make both crossings on this date here, so there is no full pair of bearings to give you. The plot still shows whatever part of its track sits above the horizon."}),(0,a.jsx)("p",{children:"The circle is the sky seen from above. The rim is the horizon, the middle is straight overhead, and north is at the top."})]})]})]}),(0,a.jsxs)("section",{className:"space-y-3",children:[(0,a.jsx)("h2",{className:"text-sm font-medium",children:"Place and date"}),(0,a.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsxs)("label",{className:"text-xs text-muted-foreground",htmlFor:"sun-place",children:["Pick a place (",G.length," built in), or type coordinates below"]}),(0,a.jsxs)("select",{id:"sun-place",value:p,onChange:e=>(function(e){ev.current++;let t=G.find(t=>t.name===e);if(!t)return void f("");f(t.name),j(String(t.lat)),z(String(t.lon)),m(t.zone),x("place")})(e.target.value),className:(0,u.cn)("flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-sm shadow-sm","transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"),children:[(0,a.jsx)("option",{value:"",children:"Custom coordinates"}),G.map(e=>(0,a.jsx)("option",{value:e.name,children:e.name},e.name))]}),(0,a.jsx)("p",{className:"text-[11px] text-muted-foreground",children:"Picking a place sets its coordinates and its time zone together."})]}),(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("label",{className:"text-xs text-muted-foreground",htmlFor:"sun-date",children:"Date"}),(0,a.jsx)(l.p,{id:"sun-date",type:"date",min:"1901-01-01",max:"2099-12-31",value:A,onChange:e=>D(e.target.value)}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2 pt-1",children:[(0,a.jsx)(r.$,{variant:"outline",size:"sm",onClick:()=>eW(-1),children:"Day back"}),(0,a.jsx)(r.$,{variant:"outline",size:"sm",onClick:()=>eW(1),children:"Day forward"}),(0,a.jsx)(r.$,{variant:"ghost",size:"sm",onClick:function(){let e=U(Date.now(),n);D(`${e.year}-${V(e.month)}-${V(e.day)}`)},children:"Today"})]})]})]}),(0,a.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("label",{className:"text-xs text-muted-foreground",htmlFor:"sun-lat",children:"Latitude"}
1),(0,a.jsx)(l.p,{id:"sun-lat",value:v,inputMode:"text",onChange:e=>{ev.current++,j(e.target.value),f("")},placeholder:"40.71 or 40 42 46 N"}),(0,a.jsx)("p",{className:"text-[11px] text-muted-foreground",children:eA?(0,a.jsx)("span",{className:"text-destructive",children:eA}):_(ez,!0)})]}),(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("label",{className:"text-xs text-muted-foreground",htmlFor:"sun-lon",children:"Longitude"}),(0,a.jsx)(l.p,{id:"sun-lon",value:k,inputMode:"text",onChange:e=>{ev.current++,z(e.target.value),f("")},placeholder:"-74.01 or 74 0 36 W"}),(0,a.jsx)("p",{className:"text-[11px] text-muted-foreground",children:e$?(0,a.jsx)("span",{className:"text-destructive",children:e$}):_(eS,!1)})]})]}),(0,a.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("label",{className:"text-xs text-muted-foreground",htmlFor:"sun-zone",children:"Show times in"}),(0,a.jsx)("select",{id:"sun-zone",value:n,onChange:e=>{m(e.target.value),x("chosen")},className:(0,u.cn)("flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-sm shadow-sm","transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"),children:ej.map(e=>(0,a.jsx)("option",{value:e,children:e.replace(/_/g," ")},e))}),(0,a.jsx)("p",{className:"text-[11px] text-muted-foreground",children:"place"===g?"The zone that goes with the place you picked.":"chosen"===g?"Your choice, and it sticks for next time.":"Read from this device, which is not necessarily the zone at those coordinates. Change it if you are planning somewhere else."})]}),(0,a.jsxs)("div",{className:"flex items-end gap-2",children:[(0,a.jsx)(r.$,{variant:"outline",size:"sm",onClick:function(){if(!navigator.geolocation)return void ek("This browser will not share a location, so type the coordinates instead.");let e=++ev.current;navigator.geolocation.getCurrentPosition(t=>{e===ev.current&&(j(t.coords.latitude.toFixed(4)),z(t.coords.longitude.toFixed(4)),f(""),ek("Using the coordinates your browser reported. The time zone is unchanged."))},()=>{e===ev.current&&ek("Location was declined or unavailable. Type the coordinates or pick a place.")})},children:"Use my location"}),(0,a.jsx)(r.$,{variant:"ghost",size:"sm",onClick:()=>{m("UTC"),x("chosen")},children:"Switch to UTC"})]})]})]}),(0,a.jsxs)("details",{className:"rounded-lg border bg-muted/30 p-4",children:[(0,a.jsx)("summary",{className:"cursor-pointer text-sm font-medium",children:"Golden hour thresholds and a raised horizon"}),(0,a.jsxs)("div",{className:"mt-3 space-y-4 text-sm",children:[(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("p",{className:"text-muted-foreground",children:["Golden hour runs while the sun sits between ",W,"\xb0"," and ",eu,"\xb0",". Blue hour is the stretch from ",-6,"\xb0"," up to wherever golden hour begins, so the two can never overlap. Those defaults (",-4,"\xb0"," to ",6,"\xb0",") are the common photographic convention, not a standard, which is exactly why they are movable here. Two apps that disagree about your golden hour usually drew this line in different places."]}),(0,a.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,a.jsx)(eo,{id:"sun-gl",label:`Golden hour starts at (${W} degrees)`,value:W,min:-6,max:4,step:.5,onChange:e=>et(J(e,eu))}),(0,a.jsx)(eo,{id:"sun-gh",label:`Golden hour ends at (${eu} degrees)`,value:eu,min:1,max:20,step:.5,onChange:e=>eh(X(e,W))})]}),(0,a.jsx)(r.$,{variant:"ghost",size:"sm",onClick:()=>{et(-4),eh(6)},children:"Back to the usual thresholds"})]}),(0,a.jsxs)("div",{className:"space-y-2 border-t pt-3",children:[(0,a.jsx)("p",{className:"text-muted-foreground",children:"Published sunrise assumes a flat sea-level horizon. If a ridge, a treeline or a building stands in the way, the sun appears late and disappears early. Give the angle from your spot to the top of it and you get a second pair of times, while the headline sunrise stays the standard one. Above a few degrees the correction is approximate, because refraction shrinks fast with height."}),(0,a.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,a.jsx)(eo,{id:"sun-he",label:`Eastern horizon rises (${ec} degrees)`,value:ec,min:0,max:30,step:.5,onChange:e=>em(Y(e,0,30))}),(0,a.jsx)(eo,{id:"sun-hw",label:`Western horizon rises (${eg} degrees)`,value:eg,min:0,max:30,step:.5,onChange:e=>ex(Y(e,0,30))})]}),eE&&(null!==eE.ridgeRise||null!==eE.ridgeSet)&&(0,a.jsxs)("p",{className:"text-muted-foreground",children:["Behind your horizon: the sun clears it at"," ",(0,a.jsx)("span",{className:"font-medium text-foreground",children:null===eE.ridgeRise?"never today":L(eE.ridgeRise,n)})," ","and drops behind it at"," ",(0,a.jsx)("span",{className:"font-medium text-foreground",children:null===eE.ridgeSet?"never today":L(eE.ridgeSet,n)}),null!==eE.ridgeRise&&null!==eE.ridgeSet&&(0,a.jsxs)(a.Fragment,{children:[", which is ",I((eE.ridgeSet-eE.ridgeRise)/6e4)," of sun you can actually see"]}),"."]})]})]})]}),(0,a.jsxs)("section",{className:"space-y-2",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,a.jsx)("h2",{className:"text-sm font-medium",children:"The rest of the month"}),(0,a.jsx)(r.$,{variant:"outline",size:"sm",onClick:()=>ef(e=>!e),children:ep?"Hide the month":"Show every day this month"})]}),ep&&eL&&(0,a.jsxs)("div",{className:"overflow-x-auto",children:[(0,a.jsxs)("table",{className:"w-full min-w-[520px] border-collapse text-sm",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{className:"border-b text-left text-xs uppercase tracking-wide text-muted-foreground",children:[(0,a.jsx)("th",{className:"py-1.5 pr-3 font-medium",children:"Date"}),(0,a.jsx)("th",{className:"py-1.5 pr-3 font-medium",children:"Sunrise"}),(0,a.jsx)("th",{className:"py-1.5 pr-3 font-medium",children:"Sunset"}),(0,a.jsx)("th",{className:"py-1.5 pr-3 font-medium",children:"Daylight"}),(0,a.jsx)("th",{className:"py-1.5 pr-3 font-medium",children:"Change"}),(0,a.jsx)("th",{className:"py-1.5 font-medium",children:"Evening golden hour"})]})}),(0,a.jsx)("tbody",{children:eL.map(e=>{let t=e.result.photoBands.filter(e=>"golden"===e.kind),s=t.length?t[t.length-1]:null,l=null!==s&&s.start<=e.result.solarNoon&&s.end>=e.result.solarNoon,o=eM?.day===e.day;return(0,a.jsxs)("tr",{className:(0,u.cn)("border-b border-border/50",o&&"bg-primary/5"),children:[(0,a.jsx)("td",{className:"py-1.5 pr-3",children:(0,a.jsx)("button",{type:"button",className:"hover:underline",onClick:()=>D(`${eM.year}-${V(eM.month)}-${V(e.day)}`),children:e.day})}),(0,a.jsx)("td",{className:"py-1.5 pr-3 font-mono text-xs",children:null===e.result.sunrise?"--":L(e.result.sunrise,n)}),(0,a.jsxs)("td",{className:"py-1.5 pr-3 font-mono text-xs",children:[null===e.result.sunset?"--":L(e.result.sunset,n),e.result.sunsetNextDay&&(0,a.jsx)("span",{className:"ml-1 text-muted-foreground",title:"This sunset falls on the following date",children:"+1"})]}),(0,a.jsx)("td",{className:"py-1.5 pr-3",children:I(e.result.daylightMinutes)}),(0,a.jsx)("td",{className:"py-1.5 pr-3 text-xs text-muted-foreground",children:null===e.deltaMs?"first row":`${e.deltaMs>=0?"+":"-"}${Math.round(Math.abs(e.deltaMs)/1e3)}s`}),(0,a.jsx)("td",{className:"py-1.5 text-xs",children:s?l?"golden all day":`${L(s.start,n)} to ${L(s.end,n)}`:"none"})]},e.day)})})]}),(0,a.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:"Every row here runs the same calculation as the day above, so a date you click through to will match to the second. Change is the difference in daylight from the previous day, which is the number gardeners and beekeepers actually watch."})]})]}),(0,a.jsxs)("section",{className:"space-y-2",children:[(0,a.jsx)("h2",{className:"text-sm font-medium",children:"Take it with you"}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,a.jsx)(r.$,{variant:"outline",size:"sm",onClick:function(){if(!eE)return;let e=p||`${v.trim()}, ${k.trim()}`,t=Z(Date.now()),a=["BEGIN:VCALENDAR","VERSION:2.0","PRODID:-//ToolBreezy//Sunrise Sunset Calculator//EN","CALSCALE:GREGORIAN","METHOD:PUBLISH",`X-WR-CALNAME:${O(`Light at ${e}`)}`],s=eE.photoBands.map(t=>({name:`${M[t.kind]} at ${e}`,start:t.start,end:t.end}));
1if(null!==eE.sunrise&&s.push({name:`Sunrise at ${e}`,start:eE.sunrise,end:eE.sunrise+6e4}),null!==eE.sunset&&s.push({name:`Sunset at ${e}`,start:eE.sunset,end:eE.sunset+6e4}),!s.length)return void ek("There is no sunrise, sunset or golden hour on this date here, so there is nothing to export.");s.sort((e,t)=>e.start-t.start),s.forEach((e,s)=>{a.push("BEGIN:VEVENT",`UID:sun-${Math.round(e.start/1e3)}-${s}@toolbreezy.com`,`DTSTAMP:${t}`,`DTSTART:${Z(e.start)}`,`DTEND:${Z(e.end)}`,H(`SUMMARY:${O(e.name)}`),H(`DESCRIPTION:${O(`${L(e.start,n)} to ${L(e.end,n)} in ${P(e.start,n)}. From toolbreezy.com`)}`),"TRANSP:TRANSPARENT","END:VEVENT")}),a.push("END:VCALENDAR"),(0,h.WN)(new Blob([a.join("\r\n")+"\r\n"],{type:"text/calendar;charset=utf-8"}),`light-${A}.ics`),ek("Downloaded the light windows for this date as calendar events.")},disabled:!eE,children:"Light windows (.ics)"}),(0,a.jsx)(c.i,{value:function(){if(!eE)return"";let e=p||`${v.trim()}, ${k.trim()}`;return[`${e} on ${F(eE.start,n)}`,`Times in ${P(eE.start,n)}`,"",...eE.events.map(e=>`${L(e.ms,n).padStart(8)}  ${e.label}${e.nextDay?" (next day)":""}`),"",`Daylight ${I(eE.daylightMinutes)}`,`Golden hour ${I(es(eE,"golden"))}, blue hour ${I(es(eE,"blue"))}`,"From toolbreezy.com"].join("\n")}(),label:"Copy the day as text",variant:"outline",size:"sm",disabled:!eE})]}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"The calendar file holds golden hour, blue hour, sunrise and sunset for this date as fixed moments, so your phone shows them correctly wherever you are that week. Share copies a link that reopens this exact place, date, zone and thresholds."})]}),(0,a.jsxs)("details",{className:"rounded-lg border bg-muted/30 p-4",children:[(0,a.jsx)("summary",{className:"cursor-pointer text-sm font-medium",children:"Where these numbers come from, and what they cannot know"}),(0,a.jsxs)("div",{className:"mt-3 space-y-2 text-sm text-muted-foreground",children:[(0,a.jsxs)("p",{children:["Positions come from the NOAA solar calculator equations, which are quoted as accurate to about a minute between ",1901," and ",2099,". Sunrise is the moment the sun’s upper edge touches the horizon, which puts the center of the disc ",.833," degrees below it: ",.266," ","for half the width of the disc plus ",.567," for the way the atmosphere bends the light. Civil, nautical and astronomical twilight are the standard 6, 12 and 18 degrees."]}),(0,a.jsx)("p",{children:"Every time on this page is found by bisecting the elevation curve rather than by scanning a clock in steps, so the answer is the same whether the search starts coarse or fine. All of it runs on your device, so it works with the network off, and coordinates you type or let the browser fill in are never sent anywhere. They only go into a share link if you tick the box beside the Share button, and never into an embed."}),(0,a.jsx)("p",{children:"What it cannot know: your weather, and your actual horizon unless you set the angle yourself. Refraction also shifts with air pressure and temperature, so real sunrise can miss the computed one by a minute or more, and that gap grows near the poles where the sun meets the horizon at a shallow angle. The zone shown is the one in the picker, not one worked out from your coordinates, because that needs a map of zone boundaries this tool does not carry."})]})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[""===p&&(0,a.jsxs)("label",{className:"flex items-start gap-2 text-xs text-muted-foreground",children:[(0,a.jsx)("input",{type:"checkbox",className:"mt-0.5 h-4 w-4 shrink-0 rounded border-input accent-primary",checked:y,onChange:e=>N(e.target.checked)}),(0,a.jsx)("span",{children:"Put your coordinates in the Share link. Off by default, so Share copies the date and the settings and not where you are. Four decimal places is close enough to find a house, and a web address is readable by anyone who ends up holding it. The embed code leaves your coordinates out either way."})]}),(0,a.jsx)(i.ToolActions,{share:eR,title:"Sunrise and Sunset Calculator",embedCarriesPersonal:!1})]})]})}function en(e,t){return null!==e.sunrise?{value:L(e.sunrise,t),sub:null===e.riseAzimuth?"":`${Math.round(e.riseAzimuth)}\xb0 ${R(e.riseAzimuth)}`}:e.neverRises?{value:"None today",sub:"The sun stays below the horizon all day"}:{value:"Already up",sub:"It was above the horizon at midnight and did not rise today"}}function ea(e,t){if(null!==e.sunset){let n=null===e.setAzimuth?"":`${Math.round(e.setAzimuth)}\xb0 ${R(e.setAzimuth)}`;return{value:L(e.sunset,t),sub:e.sunsetNextDay?n?`next day, ${n}`:"next day":n}}return e.neverRises?{value:"None today",sub:"Polar night, so there is nothing to set"}:{value:"None today",sub:"Midnight sun, it is still up when the date runs out"}}function es(e,t){let n=0;for(let a of e.photoBands)a.kind===t&&(n+=(a.end-a.start)/6e4);return n}function el({label:e,value:t,sub:n}){return(0,a.jsxs)("div",{className:"rounded-md border bg-muted/30 p-3",children:[(0,a.jsx)("div",{className:"text-xs uppercase tracking-wide text-muted-foreground",children:e}),(0,a.jsx)("div",{className:"text-xl font-semibold sm:text-2xl",children:t}),n&&(0,a.jsx)("div",{className:"text-xs text-muted-foreground",children:n})]})}function eo({id:e,label:t,value:n,min:s,max:l,step:o,onChange:r}){return(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("label",{className:"text-xs text-muted-foreground",htmlFor:e,children:t}),(0,a.jsx)("input",{id:e,type:"range",min:s,max:l,step:o,value:n,onChange:e=>r(Number(e.target.value)),className:"w-full"})]})}function er({day:e,zone:t,nowMs:n}){let s=e.end-e.start,l=t=>(t-e.start)/s*100,o=[];null!==e.sunrise&&o.push({ms:e.sunrise,label:"Sunrise"}),null!==e.sunset&&o.push({ms:e.sunset,label:"Sunset"});let r=e.bands.map(e=>`${A[e.kind]} from ${L(e.start,t)} to ${L(e.end,t)}`).join(". ");return(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsxs)("div",{className:"relative h-10 w-full overflow-hidden rounded-md border","aria-hidden":"true",children:[e.bands.map(e=>(0,a.jsx)("div",{className:"absolute inset-y-0",style:{left:`${l(e.start)}%`,width:`${(e.end-e.start)/s*100}%`,background:S.find(t=>t.key===e.kind).color},title:`${A[e.kind]} ${L(e.start,t)} to ${L(e.end,t)} (${I((e.end-e.start)/6e4)})`},`band-${e.start}`)),o.map(e=>(0,a.jsx)("div",{className:"absolute inset-y-0 w-px bg-black/70",style:{left:`${l(e.ms)}%`},title:`${e.label} ${L(e.ms,t)}`},`mark-${e.ms}`)),null!==n&&(0,a.jsx)("div",{className:"absolute inset-y-0 w-0.5 bg-red-500",style:{left:`${l(n)}%`},title:"Right now"})]}),(0,a.jsx)("div",{className:"relative h-3 w-full overflow-hidden rounded-sm border","aria-hidden":"true",children:e.photoBands.map(e=>(0,a.jsx)("div",{className:"absolute inset-y-0",style:{left:`${l(e.start)}%`,width:`${(e.end-e.start)/s*100}%`,background:$[e.kind]},title:`${M[e.kind]} ${L(e.start,t)} to ${L(e.end,t)}`},`photo-${e.start}`))}),(0,a.jsx)("div",{className:"relative h-4 w-full text-[10px] text-muted-foreground","aria-hidden":"true",children:[0,3,6,9,12,15,18,21,24].map(e=>(0,a.jsx)("span",{className:(0,u.cn)("absolute -translate-x-1/2",e%6!=0&&"hidden sm:inline"),style:{left:`${e/24*100}%`},children:e},e))}),(0,a.jsx)("p",{className:"sr-only",children:r})]})}function ei({title:e,events:t,zone:n,empty:s}){return(0,a.jsxs)("div",{className:"rounded-lg border bg-background p-3",children:[(0,a.jsx)("h3",{className:"text-xs uppercase tracking-wide text-muted-foreground",children:e}),0===t.length?(0,a.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:s}):(0,a.jsx)("ul",{className:"mt-1 space-y-0.5 text-sm",children:t.map(e=>(0,a.jsxs)("li",{className:"flex items-baseline justify-between gap-3",children:[(0,a.jsx)("span",{className:"text-muted-foreground",children:e.label}),(0,a.jsxs)("span",{className:"shrink-0 font-mono text-xs",children:[L(e.ms,n),e.nextDay&&(0,a.jsx)("span",{className:"ml-1 text-muted-foreground",children:"next day"})]})]},e.key))})]})}function ed({day:e}){let t=(e,t)=>{let n=92*(90-Math.max(0,t))/90;return[110+n*g(e),110-n*x(e)]},n=e.path,s=n.map((e,n)=>`${0===n?"M":"L"}${t(e.az,e.el).map(e=>e.toFixed(1)).join(" ")}`).join(" "),l=n.length?n.reduce((e,t)=>
1e.el>t.el?e:t):null,o=null===e.riseAzimuth?null:t(e.riseAzimuth,0),r=null===e.setAzimuth?null:t(e.setAzimuth,0),i=l?t(l.az,l.el):null;return(0,a.jsxs)("svg",{width:220,height:220,viewBox:"0 0 220 220",className:"shrink-0",role:"img","aria-label":"Polar plot of the sun's track for the day, north at the top, the rim of the circle being the horizon.",children:[(0,a.jsx)("circle",{cx:110,cy:110,r:92,className:"fill-muted/40 stroke-border",strokeWidth:1}),(0,a.jsx)("circle",{cx:110,cy:110,r:184/3,className:"fill-none stroke-border",strokeWidth:.75}),(0,a.jsx)("circle",{cx:110,cy:110,r:92/3,className:"fill-none stroke-border",strokeWidth:.75}),(0,a.jsx)("line",{x1:110,y1:18,x2:110,y2:202,className:"stroke-border",strokeWidth:.75}),(0,a.jsx)("line",{x1:18,y1:110,x2:202,y2:110,className:"stroke-border",strokeWidth:.75}),["N","E","S","W"].map((e,t)=>{let n=90*t,[s,l]=[110+102*g(n),110-102*x(n)];return(0,a.jsx)("text",{x:s,y:l+3.5,textAnchor:"middle",className:"fill-muted-foreground",fontSize:10,children:e},e)}),s&&(0,a.jsx)("path",{d:s,fill:"none",stroke:$.golden,strokeWidth:2.5,strokeLinecap:"round"}),o&&(0,a.jsx)("circle",{cx:o[0],cy:o[1],r:4,fill:$.golden}),r&&(0,a.jsx)("circle",{cx:r[0],cy:r[1],r:4,fill:$.blue}),i&&(0,a.jsx)("circle",{cx:i[0],cy:i[1],r:5,fill:"#f5c451",stroke:"#8a6a12",strokeWidth:1})]})}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.