@yugenlab/vaayu 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 +21 -0
- package/README.md +365 -0
- package/chunks/chunk-E5A3SCDJ.js +246 -0
- package/chunks/chunk-G5VYCA6O.js +69 -0
- package/chunks/chunk-H76V36OF.js +1029 -0
- package/chunks/chunk-HAPVUJ6A.js +238 -0
- package/chunks/chunk-IEKAYVA3.js +137 -0
- package/chunks/chunk-IGKYKEKT.js +43 -0
- package/chunks/chunk-IIET2K6D.js +7728 -0
- package/chunks/chunk-ITIVYGUG.js +347 -0
- package/chunks/chunk-JAWZ7ANC.js +208 -0
- package/chunks/chunk-JZU37VQ5.js +714 -0
- package/chunks/chunk-KC6NRZ7U.js +198 -0
- package/chunks/chunk-KDRROLVN.js +433 -0
- package/chunks/chunk-L7JICQBW.js +1006 -0
- package/chunks/chunk-MINFB5LT.js +1479 -0
- package/chunks/chunk-MJ74G5RB.js +5816 -0
- package/chunks/chunk-S4TBVCL2.js +2158 -0
- package/chunks/chunk-SMVJRPAH.js +2753 -0
- package/chunks/chunk-U6OLJ36B.js +438 -0
- package/chunks/chunk-URGEODS5.js +752 -0
- package/chunks/chunk-YSU3BWV6.js +123 -0
- package/chunks/consolidation-indexer-TOTTDZXW.js +21 -0
- package/chunks/day-consolidation-NKO63HZQ.js +24 -0
- package/chunks/graphrag-ZI2FSU7S.js +13 -0
- package/chunks/hierarchical-temporal-search-ZD46UMKR.js +8 -0
- package/chunks/hybrid-search-ZVLZVGFS.js +19 -0
- package/chunks/memory-store-KNJPMBLQ.js +17 -0
- package/chunks/periodic-consolidation-BPKOZDGB.js +10 -0
- package/chunks/postgres-3ZXBYTPC.js +8 -0
- package/chunks/recall-GMVHWQWW.js +20 -0
- package/chunks/search-7HZETVMZ.js +18 -0
- package/chunks/session-store-XKPGKXUS.js +44 -0
- package/chunks/sqlite-JPF5TICX.js +152 -0
- package/chunks/src-6GVZTUH6.js +12 -0
- package/chunks/src-QAXOD5SB.js +273 -0
- package/chunks/suncalc-NOHGYHDU.js +186 -0
- package/chunks/tree-RSHKDTCR.js +10 -0
- package/gateway.js +61944 -0
- package/package.json +51 -0
- package/pair-cli.js +133 -0
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AdaptiveScorer,
|
|
3
|
+
AkashaField,
|
|
4
|
+
AnveshanaEngine,
|
|
5
|
+
CheckpointManager,
|
|
6
|
+
ConsolidationEngine,
|
|
7
|
+
IdentityContext,
|
|
8
|
+
KalaChakra,
|
|
9
|
+
PanchaVritti,
|
|
10
|
+
SessionCompactor,
|
|
11
|
+
SmaranStore,
|
|
12
|
+
SvapnaConsolidation,
|
|
13
|
+
TEMPORAL_SCALES,
|
|
14
|
+
VRITTI_CONFIDENCE_WEIGHTS,
|
|
15
|
+
VRITTI_TYPES,
|
|
16
|
+
VasanaEngine,
|
|
17
|
+
VidhiEngine,
|
|
18
|
+
allocateBudgets,
|
|
19
|
+
branchSession,
|
|
20
|
+
buildAffinityMatrix,
|
|
21
|
+
classifyContent,
|
|
22
|
+
computeTokenBudgets,
|
|
23
|
+
computeTokenBudgetsMHC,
|
|
24
|
+
configureCompactorSignals,
|
|
25
|
+
detectCategory,
|
|
26
|
+
detectExportFormat,
|
|
27
|
+
detectMemoryIntent,
|
|
28
|
+
exportSessionToJson,
|
|
29
|
+
exportSessionToMarkdown,
|
|
30
|
+
extractSignals,
|
|
31
|
+
extractSignalsFromTurns,
|
|
32
|
+
getSessionTree,
|
|
33
|
+
importSessionFromJson,
|
|
34
|
+
loadProviderContext,
|
|
35
|
+
logsumexp,
|
|
36
|
+
mmrRerank,
|
|
37
|
+
recall,
|
|
38
|
+
sinkhornAccelerated,
|
|
39
|
+
sinkhornKnopp
|
|
40
|
+
} from "./chunk-IIET2K6D.js";
|
|
41
|
+
import {
|
|
42
|
+
FactExtractor,
|
|
43
|
+
consolidateDay,
|
|
44
|
+
detectSessionType,
|
|
45
|
+
extractEventChain,
|
|
46
|
+
getDayFilePath,
|
|
47
|
+
getDaysRoot,
|
|
48
|
+
getExtractorStrategy,
|
|
49
|
+
getFactExtractor,
|
|
50
|
+
getUnconsolidatedDates,
|
|
51
|
+
isDayConsolidated,
|
|
52
|
+
listDayFiles,
|
|
53
|
+
readDayFile,
|
|
54
|
+
searchDayFiles
|
|
55
|
+
} from "./chunk-H76V36OF.js";
|
|
56
|
+
import {
|
|
57
|
+
backfillConsolidationIndices,
|
|
58
|
+
extractSummaryText,
|
|
59
|
+
indexConsolidationSummary,
|
|
60
|
+
searchConsolidationSummaries
|
|
61
|
+
} from "./chunk-HAPVUJ6A.js";
|
|
62
|
+
import {
|
|
63
|
+
PeriodicConsolidation
|
|
64
|
+
} from "./chunk-URGEODS5.js";
|
|
65
|
+
import {
|
|
66
|
+
hierarchicalTemporalSearch
|
|
67
|
+
} from "./chunk-YSU3BWV6.js";
|
|
68
|
+
import {
|
|
69
|
+
GraphRAGEngine,
|
|
70
|
+
IncrementalPageRank,
|
|
71
|
+
NERExtractor,
|
|
72
|
+
annotateCommunities,
|
|
73
|
+
communitySummary,
|
|
74
|
+
compactEdges,
|
|
75
|
+
computePersonalizedPageRank,
|
|
76
|
+
createEdge,
|
|
77
|
+
expireEdge,
|
|
78
|
+
filterByCommunity,
|
|
79
|
+
findBridgeNodes,
|
|
80
|
+
getEdgeHistory,
|
|
81
|
+
leiden,
|
|
82
|
+
migrateGraphJson,
|
|
83
|
+
queryEdgesAtTime,
|
|
84
|
+
supersedEdge,
|
|
85
|
+
temporalDecay
|
|
86
|
+
} from "./chunk-S4TBVCL2.js";
|
|
87
|
+
import {
|
|
88
|
+
PRESERVATION_RATIOS,
|
|
89
|
+
RecallEngine,
|
|
90
|
+
STREAM_CONFIGS,
|
|
91
|
+
STREAM_ORDER,
|
|
92
|
+
StreamManager,
|
|
93
|
+
_resetRecallDbInit,
|
|
94
|
+
blobToVector,
|
|
95
|
+
configureRecallScoring,
|
|
96
|
+
migrateEmbeddingsJson,
|
|
97
|
+
vectorToBlob
|
|
98
|
+
} from "./chunk-JZU37VQ5.js";
|
|
99
|
+
import {
|
|
100
|
+
EmbeddingService,
|
|
101
|
+
estimateTokens,
|
|
102
|
+
fallbackEmbedding
|
|
103
|
+
} from "./chunk-JAWZ7ANC.js";
|
|
104
|
+
import {
|
|
105
|
+
HybridSearchEngine,
|
|
106
|
+
HybridWeightLearner,
|
|
107
|
+
PRAMANA_RELIABILITY,
|
|
108
|
+
shouldRetrieve
|
|
109
|
+
} from "./chunk-KDRROLVN.js";
|
|
110
|
+
import {
|
|
111
|
+
searchMemory,
|
|
112
|
+
searchSessions
|
|
113
|
+
} from "./chunk-ITIVYGUG.js";
|
|
114
|
+
import {
|
|
115
|
+
appendMemory,
|
|
116
|
+
deleteMemory,
|
|
117
|
+
getMemory,
|
|
118
|
+
listMemoryScopes,
|
|
119
|
+
updateMemory
|
|
120
|
+
} from "./chunk-E5A3SCDJ.js";
|
|
121
|
+
import {
|
|
122
|
+
addTurn,
|
|
123
|
+
createSession,
|
|
124
|
+
deleteSession,
|
|
125
|
+
findSessionByMetadata,
|
|
126
|
+
getMaxTurnNumber,
|
|
127
|
+
listSessionDates,
|
|
128
|
+
listSessionProjects,
|
|
129
|
+
listSessions,
|
|
130
|
+
listSessionsByDate,
|
|
131
|
+
listSessionsByDateRange,
|
|
132
|
+
listTurnsWithTimestamps,
|
|
133
|
+
loadSession,
|
|
134
|
+
migrateExistingSessions,
|
|
135
|
+
parseSessionMarkdown,
|
|
136
|
+
saveSession,
|
|
137
|
+
updateSessionMeta,
|
|
138
|
+
writeSessionMarkdown,
|
|
139
|
+
writeTurnMarkdown
|
|
140
|
+
} from "./chunk-L7JICQBW.js";
|
|
141
|
+
import {
|
|
142
|
+
DatabaseManager,
|
|
143
|
+
initAgentSchema,
|
|
144
|
+
initAllSchemas,
|
|
145
|
+
initGraphSchema,
|
|
146
|
+
initVectorsSchema
|
|
147
|
+
} from "./chunk-U6OLJ36B.js";
|
|
148
|
+
import "./chunk-KC6NRZ7U.js";
|
|
149
|
+
import "./chunk-IGKYKEKT.js";
|
|
150
|
+
export {
|
|
151
|
+
AdaptiveScorer,
|
|
152
|
+
AkashaField,
|
|
153
|
+
AnveshanaEngine,
|
|
154
|
+
CheckpointManager,
|
|
155
|
+
ConsolidationEngine,
|
|
156
|
+
DatabaseManager,
|
|
157
|
+
EmbeddingService,
|
|
158
|
+
FactExtractor,
|
|
159
|
+
GraphRAGEngine,
|
|
160
|
+
HybridSearchEngine,
|
|
161
|
+
HybridWeightLearner,
|
|
162
|
+
IdentityContext,
|
|
163
|
+
IncrementalPageRank,
|
|
164
|
+
KalaChakra,
|
|
165
|
+
NERExtractor,
|
|
166
|
+
PRAMANA_RELIABILITY,
|
|
167
|
+
PRESERVATION_RATIOS,
|
|
168
|
+
PanchaVritti,
|
|
169
|
+
PeriodicConsolidation,
|
|
170
|
+
RecallEngine,
|
|
171
|
+
STREAM_CONFIGS,
|
|
172
|
+
STREAM_ORDER,
|
|
173
|
+
SessionCompactor,
|
|
174
|
+
SmaranStore,
|
|
175
|
+
StreamManager,
|
|
176
|
+
SvapnaConsolidation,
|
|
177
|
+
TEMPORAL_SCALES,
|
|
178
|
+
VRITTI_CONFIDENCE_WEIGHTS,
|
|
179
|
+
VRITTI_TYPES,
|
|
180
|
+
VasanaEngine,
|
|
181
|
+
VidhiEngine,
|
|
182
|
+
_resetRecallDbInit,
|
|
183
|
+
addTurn,
|
|
184
|
+
allocateBudgets,
|
|
185
|
+
annotateCommunities,
|
|
186
|
+
appendMemory,
|
|
187
|
+
backfillConsolidationIndices,
|
|
188
|
+
blobToVector,
|
|
189
|
+
branchSession,
|
|
190
|
+
buildAffinityMatrix,
|
|
191
|
+
classifyContent,
|
|
192
|
+
communitySummary,
|
|
193
|
+
compactEdges,
|
|
194
|
+
computePersonalizedPageRank,
|
|
195
|
+
computeTokenBudgets,
|
|
196
|
+
computeTokenBudgetsMHC,
|
|
197
|
+
configureCompactorSignals,
|
|
198
|
+
configureRecallScoring,
|
|
199
|
+
consolidateDay,
|
|
200
|
+
createEdge,
|
|
201
|
+
createSession,
|
|
202
|
+
deleteMemory,
|
|
203
|
+
deleteSession,
|
|
204
|
+
detectCategory,
|
|
205
|
+
detectExportFormat,
|
|
206
|
+
detectMemoryIntent,
|
|
207
|
+
detectSessionType,
|
|
208
|
+
estimateTokens,
|
|
209
|
+
expireEdge,
|
|
210
|
+
exportSessionToJson,
|
|
211
|
+
exportSessionToMarkdown,
|
|
212
|
+
extractEventChain,
|
|
213
|
+
extractSignals,
|
|
214
|
+
extractSignalsFromTurns,
|
|
215
|
+
extractSummaryText,
|
|
216
|
+
fallbackEmbedding,
|
|
217
|
+
filterByCommunity,
|
|
218
|
+
findBridgeNodes,
|
|
219
|
+
findSessionByMetadata,
|
|
220
|
+
getDayFilePath,
|
|
221
|
+
getDaysRoot,
|
|
222
|
+
getEdgeHistory,
|
|
223
|
+
getExtractorStrategy,
|
|
224
|
+
getFactExtractor,
|
|
225
|
+
getMaxTurnNumber,
|
|
226
|
+
getMemory,
|
|
227
|
+
getSessionTree,
|
|
228
|
+
getUnconsolidatedDates,
|
|
229
|
+
hierarchicalTemporalSearch,
|
|
230
|
+
importSessionFromJson,
|
|
231
|
+
indexConsolidationSummary,
|
|
232
|
+
initAgentSchema,
|
|
233
|
+
initAllSchemas,
|
|
234
|
+
initGraphSchema,
|
|
235
|
+
initVectorsSchema,
|
|
236
|
+
isDayConsolidated,
|
|
237
|
+
leiden,
|
|
238
|
+
listDayFiles,
|
|
239
|
+
listMemoryScopes,
|
|
240
|
+
listSessionDates,
|
|
241
|
+
listSessionProjects,
|
|
242
|
+
listSessions,
|
|
243
|
+
listSessionsByDate,
|
|
244
|
+
listSessionsByDateRange,
|
|
245
|
+
listTurnsWithTimestamps,
|
|
246
|
+
loadProviderContext,
|
|
247
|
+
loadSession,
|
|
248
|
+
logsumexp,
|
|
249
|
+
migrateEmbeddingsJson,
|
|
250
|
+
migrateExistingSessions,
|
|
251
|
+
migrateGraphJson,
|
|
252
|
+
mmrRerank,
|
|
253
|
+
parseSessionMarkdown,
|
|
254
|
+
queryEdgesAtTime,
|
|
255
|
+
readDayFile,
|
|
256
|
+
recall,
|
|
257
|
+
saveSession,
|
|
258
|
+
searchConsolidationSummaries,
|
|
259
|
+
searchDayFiles,
|
|
260
|
+
searchMemory,
|
|
261
|
+
searchSessions,
|
|
262
|
+
shouldRetrieve,
|
|
263
|
+
sinkhornAccelerated,
|
|
264
|
+
sinkhornKnopp,
|
|
265
|
+
supersedEdge,
|
|
266
|
+
temporalDecay,
|
|
267
|
+
updateMemory,
|
|
268
|
+
updateSessionMeta,
|
|
269
|
+
vectorToBlob,
|
|
270
|
+
writeSessionMarkdown,
|
|
271
|
+
writeTurnMarkdown
|
|
272
|
+
};
|
|
273
|
+
//# sourceMappingURL=src-QAXOD5SB.js.map
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__commonJS
|
|
3
|
+
} from "./chunk-IGKYKEKT.js";
|
|
4
|
+
|
|
5
|
+
// ../node_modules/.pnpm/suncalc@1.9.0/node_modules/suncalc/suncalc.js
|
|
6
|
+
var require_suncalc = __commonJS({
|
|
7
|
+
"../node_modules/.pnpm/suncalc@1.9.0/node_modules/suncalc/suncalc.js"(exports, module) {
|
|
8
|
+
(function() {
|
|
9
|
+
"use strict";
|
|
10
|
+
var PI = Math.PI, sin = Math.sin, cos = Math.cos, tan = Math.tan, asin = Math.asin, atan = Math.atan2, acos = Math.acos, rad = PI / 180;
|
|
11
|
+
var dayMs = 1e3 * 60 * 60 * 24, J1970 = 2440588, J2000 = 2451545;
|
|
12
|
+
function toJulian(date) {
|
|
13
|
+
return date.valueOf() / dayMs - 0.5 + J1970;
|
|
14
|
+
}
|
|
15
|
+
function fromJulian(j) {
|
|
16
|
+
return new Date((j + 0.5 - J1970) * dayMs);
|
|
17
|
+
}
|
|
18
|
+
function toDays(date) {
|
|
19
|
+
return toJulian(date) - J2000;
|
|
20
|
+
}
|
|
21
|
+
var e = rad * 23.4397;
|
|
22
|
+
function rightAscension(l, b) {
|
|
23
|
+
return atan(sin(l) * cos(e) - tan(b) * sin(e), cos(l));
|
|
24
|
+
}
|
|
25
|
+
function declination(l, b) {
|
|
26
|
+
return asin(sin(b) * cos(e) + cos(b) * sin(e) * sin(l));
|
|
27
|
+
}
|
|
28
|
+
function azimuth(H, phi, dec) {
|
|
29
|
+
return atan(sin(H), cos(H) * sin(phi) - tan(dec) * cos(phi));
|
|
30
|
+
}
|
|
31
|
+
function altitude(H, phi, dec) {
|
|
32
|
+
return asin(sin(phi) * sin(dec) + cos(phi) * cos(dec) * cos(H));
|
|
33
|
+
}
|
|
34
|
+
function siderealTime(d, lw) {
|
|
35
|
+
return rad * (280.16 + 360.9856235 * d) - lw;
|
|
36
|
+
}
|
|
37
|
+
function astroRefraction(h) {
|
|
38
|
+
if (h < 0)
|
|
39
|
+
h = 0;
|
|
40
|
+
return 2967e-7 / Math.tan(h + 312536e-8 / (h + 0.08901179));
|
|
41
|
+
}
|
|
42
|
+
function solarMeanAnomaly(d) {
|
|
43
|
+
return rad * (357.5291 + 0.98560028 * d);
|
|
44
|
+
}
|
|
45
|
+
function eclipticLongitude(M) {
|
|
46
|
+
var C = rad * (1.9148 * sin(M) + 0.02 * sin(2 * M) + 3e-4 * sin(3 * M)), P = rad * 102.9372;
|
|
47
|
+
return M + C + P + PI;
|
|
48
|
+
}
|
|
49
|
+
function sunCoords(d) {
|
|
50
|
+
var M = solarMeanAnomaly(d), L = eclipticLongitude(M);
|
|
51
|
+
return {
|
|
52
|
+
dec: declination(L, 0),
|
|
53
|
+
ra: rightAscension(L, 0)
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
var SunCalc = {};
|
|
57
|
+
SunCalc.getPosition = function(date, lat, lng) {
|
|
58
|
+
var lw = rad * -lng, phi = rad * lat, d = toDays(date), c = sunCoords(d), H = siderealTime(d, lw) - c.ra;
|
|
59
|
+
return {
|
|
60
|
+
azimuth: azimuth(H, phi, c.dec),
|
|
61
|
+
altitude: altitude(H, phi, c.dec)
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
var times = SunCalc.times = [
|
|
65
|
+
[-0.833, "sunrise", "sunset"],
|
|
66
|
+
[-0.3, "sunriseEnd", "sunsetStart"],
|
|
67
|
+
[-6, "dawn", "dusk"],
|
|
68
|
+
[-12, "nauticalDawn", "nauticalDusk"],
|
|
69
|
+
[-18, "nightEnd", "night"],
|
|
70
|
+
[6, "goldenHourEnd", "goldenHour"]
|
|
71
|
+
];
|
|
72
|
+
SunCalc.addTime = function(angle, riseName, setName) {
|
|
73
|
+
times.push([angle, riseName, setName]);
|
|
74
|
+
};
|
|
75
|
+
var J0 = 9e-4;
|
|
76
|
+
function julianCycle(d, lw) {
|
|
77
|
+
return Math.round(d - J0 - lw / (2 * PI));
|
|
78
|
+
}
|
|
79
|
+
function approxTransit(Ht, lw, n) {
|
|
80
|
+
return J0 + (Ht + lw) / (2 * PI) + n;
|
|
81
|
+
}
|
|
82
|
+
function solarTransitJ(ds, M, L) {
|
|
83
|
+
return J2000 + ds + 53e-4 * sin(M) - 69e-4 * sin(2 * L);
|
|
84
|
+
}
|
|
85
|
+
function hourAngle(h, phi, d) {
|
|
86
|
+
return acos((sin(h) - sin(phi) * sin(d)) / (cos(phi) * cos(d)));
|
|
87
|
+
}
|
|
88
|
+
function observerAngle(height) {
|
|
89
|
+
return -2.076 * Math.sqrt(height) / 60;
|
|
90
|
+
}
|
|
91
|
+
function getSetJ(h, lw, phi, dec, n, M, L) {
|
|
92
|
+
var w = hourAngle(h, phi, dec), a = approxTransit(w, lw, n);
|
|
93
|
+
return solarTransitJ(a, M, L);
|
|
94
|
+
}
|
|
95
|
+
SunCalc.getTimes = function(date, lat, lng, height) {
|
|
96
|
+
height = height || 0;
|
|
97
|
+
var lw = rad * -lng, phi = rad * lat, dh = observerAngle(height), d = toDays(date), n = julianCycle(d, lw), ds = approxTransit(0, lw, n), M = solarMeanAnomaly(ds), L = eclipticLongitude(M), dec = declination(L, 0), Jnoon = solarTransitJ(ds, M, L), i, len, time, h0, Jset, Jrise;
|
|
98
|
+
var result = {
|
|
99
|
+
solarNoon: fromJulian(Jnoon),
|
|
100
|
+
nadir: fromJulian(Jnoon - 0.5)
|
|
101
|
+
};
|
|
102
|
+
for (i = 0, len = times.length; i < len; i += 1) {
|
|
103
|
+
time = times[i];
|
|
104
|
+
h0 = (time[0] + dh) * rad;
|
|
105
|
+
Jset = getSetJ(h0, lw, phi, dec, n, M, L);
|
|
106
|
+
Jrise = Jnoon - (Jset - Jnoon);
|
|
107
|
+
result[time[1]] = fromJulian(Jrise);
|
|
108
|
+
result[time[2]] = fromJulian(Jset);
|
|
109
|
+
}
|
|
110
|
+
return result;
|
|
111
|
+
};
|
|
112
|
+
function moonCoords(d) {
|
|
113
|
+
var L = rad * (218.316 + 13.176396 * d), M = rad * (134.963 + 13.064993 * d), F = rad * (93.272 + 13.22935 * d), l = L + rad * 6.289 * sin(M), b = rad * 5.128 * sin(F), dt = 385001 - 20905 * cos(M);
|
|
114
|
+
return {
|
|
115
|
+
ra: rightAscension(l, b),
|
|
116
|
+
dec: declination(l, b),
|
|
117
|
+
dist: dt
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
SunCalc.getMoonPosition = function(date, lat, lng) {
|
|
121
|
+
var lw = rad * -lng, phi = rad * lat, d = toDays(date), c = moonCoords(d), H = siderealTime(d, lw) - c.ra, h = altitude(H, phi, c.dec), pa = atan(sin(H), tan(phi) * cos(c.dec) - sin(c.dec) * cos(H));
|
|
122
|
+
h = h + astroRefraction(h);
|
|
123
|
+
return {
|
|
124
|
+
azimuth: azimuth(H, phi, c.dec),
|
|
125
|
+
altitude: h,
|
|
126
|
+
distance: c.dist,
|
|
127
|
+
parallacticAngle: pa
|
|
128
|
+
};
|
|
129
|
+
};
|
|
130
|
+
SunCalc.getMoonIllumination = function(date) {
|
|
131
|
+
var d = toDays(date || /* @__PURE__ */ new Date()), s = sunCoords(d), m = moonCoords(d), sdist = 149598e3, phi = acos(sin(s.dec) * sin(m.dec) + cos(s.dec) * cos(m.dec) * cos(s.ra - m.ra)), inc = atan(sdist * sin(phi), m.dist - sdist * cos(phi)), angle = atan(cos(s.dec) * sin(s.ra - m.ra), sin(s.dec) * cos(m.dec) - cos(s.dec) * sin(m.dec) * cos(s.ra - m.ra));
|
|
132
|
+
return {
|
|
133
|
+
fraction: (1 + cos(inc)) / 2,
|
|
134
|
+
phase: 0.5 + 0.5 * inc * (angle < 0 ? -1 : 1) / Math.PI,
|
|
135
|
+
angle
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
function hoursLater(date, h) {
|
|
139
|
+
return new Date(date.valueOf() + h * dayMs / 24);
|
|
140
|
+
}
|
|
141
|
+
SunCalc.getMoonTimes = function(date, lat, lng, inUTC) {
|
|
142
|
+
var t = new Date(date);
|
|
143
|
+
if (inUTC) t.setUTCHours(0, 0, 0, 0);
|
|
144
|
+
else t.setHours(0, 0, 0, 0);
|
|
145
|
+
var hc = 0.133 * rad, h0 = SunCalc.getMoonPosition(t, lat, lng).altitude - hc, h1, h2, rise, set, a, b, xe, ye, d, roots, x1, x2, dx;
|
|
146
|
+
for (var i = 1; i <= 24; i += 2) {
|
|
147
|
+
h1 = SunCalc.getMoonPosition(hoursLater(t, i), lat, lng).altitude - hc;
|
|
148
|
+
h2 = SunCalc.getMoonPosition(hoursLater(t, i + 1), lat, lng).altitude - hc;
|
|
149
|
+
a = (h0 + h2) / 2 - h1;
|
|
150
|
+
b = (h2 - h0) / 2;
|
|
151
|
+
xe = -b / (2 * a);
|
|
152
|
+
ye = (a * xe + b) * xe + h1;
|
|
153
|
+
d = b * b - 4 * a * h1;
|
|
154
|
+
roots = 0;
|
|
155
|
+
if (d >= 0) {
|
|
156
|
+
dx = Math.sqrt(d) / (Math.abs(a) * 2);
|
|
157
|
+
x1 = xe - dx;
|
|
158
|
+
x2 = xe + dx;
|
|
159
|
+
if (Math.abs(x1) <= 1) roots++;
|
|
160
|
+
if (Math.abs(x2) <= 1) roots++;
|
|
161
|
+
if (x1 < -1) x1 = x2;
|
|
162
|
+
}
|
|
163
|
+
if (roots === 1) {
|
|
164
|
+
if (h0 < 0) rise = i + x1;
|
|
165
|
+
else set = i + x1;
|
|
166
|
+
} else if (roots === 2) {
|
|
167
|
+
rise = i + (ye < 0 ? x2 : x1);
|
|
168
|
+
set = i + (ye < 0 ? x1 : x2);
|
|
169
|
+
}
|
|
170
|
+
if (rise && set) break;
|
|
171
|
+
h0 = h2;
|
|
172
|
+
}
|
|
173
|
+
var result = {};
|
|
174
|
+
if (rise) result.rise = hoursLater(t, rise);
|
|
175
|
+
if (set) result.set = hoursLater(t, set);
|
|
176
|
+
if (!rise && !set) result[ye > 0 ? "alwaysUp" : "alwaysDown"] = true;
|
|
177
|
+
return result;
|
|
178
|
+
};
|
|
179
|
+
if (typeof exports === "object" && typeof module !== "undefined") module.exports = SunCalc;
|
|
180
|
+
else if (typeof define === "function" && define.amd) define(SunCalc);
|
|
181
|
+
else window.SunCalc = SunCalc;
|
|
182
|
+
})();
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
export default require_suncalc();
|
|
186
|
+
//# sourceMappingURL=suncalc-NOHGYHDU.js.map
|