@magmacomputing/tempo-plugin-astro 1.1.3 → 1.1.5

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/README.md CHANGED
@@ -39,7 +39,7 @@ When resolving the term, the plugin intelligently returns the correct astronomic
39
39
  key: 'Vernal', // Flips to 'Autumnal' if sphere is set to 'south'
40
40
  season: 'Spring', // Flips to 'Autumn' if sphere is set to 'south'
41
41
  sphere: 'north', // Flips to 'south' if sphere is set to 'south'
42
- type: 'Equinox',
42
+ event: 'Equinox',
43
43
  group: 'astronomy',
44
44
  year: 2026,
45
45
  month: 3,
package/dist/index.d.ts CHANGED
@@ -1,4 +1,27 @@
1
1
  import { Tempo } from '@magmacomputing/tempo/core';
2
+ declare module '@magmacomputing/tempo/core' {
3
+ interface TempoTermRegistry {
4
+ astro: 'Vernal' | 'Summer' | 'Autumnal' | 'Winter';
5
+ astronomy: {
6
+ key: 'Vernal' | 'Summer' | 'Autumnal' | 'Winter';
7
+ season: 'Spring' | 'Summer' | 'Autumn' | 'Winter';
8
+ sphere: Tempo.COMPASS;
9
+ event: 'Equinox' | 'Solstice';
10
+ group: 'astronomy';
11
+ year: number;
12
+ month: number;
13
+ day: number;
14
+ hour: number;
15
+ minute: number;
16
+ second: number;
17
+ millisecond: number;
18
+ microsecond: number;
19
+ nanosecond: number;
20
+ start: Tempo;
21
+ end: Tempo;
22
+ };
23
+ }
24
+ }
2
25
  /**
3
26
  * ## AstroTerm
4
27
  * Exposes precise astronomical calculations as a standard Tempo scope.
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- function a0_0x76a1(_0x2fe614,_0x24c14a){_0x2fe614=_0x2fe614-0x140;const _0x58a836=a0_0x58a8();let _0x76a1d4=_0x58a836[_0x2fe614];return _0x76a1d4;}const a0_0x224e2b=a0_0x76a1;(function(_0x4a30f5,_0xc0a83b){const _0x3c949a=a0_0x76a1,_0x212712=_0x4a30f5();while(!![]){try{const _0xa1c8e0=parseInt(_0x3c949a(0x156))/0x1+-parseInt(_0x3c949a(0x15d))/0x2*(parseInt(_0x3c949a(0x14d))/0x3)+parseInt(_0x3c949a(0x146))/0x4*(parseInt(_0x3c949a(0x168))/0x5)+parseInt(_0x3c949a(0x154))/0x6+-parseInt(_0x3c949a(0x15a))/0x7+-parseInt(_0x3c949a(0x142))/0x8+parseInt(_0x3c949a(0x15f))/0x9*(parseInt(_0x3c949a(0x151))/0xa);if(_0xa1c8e0===_0xc0a83b)break;else _0x212712['push'](_0x212712['shift']());}catch(_0x4dea5d){_0x212712['push'](_0x212712['shift']());}}}(a0_0x58a8,0xacd0a));import{Tempo,enums}from'@magmacomputing/tempo/core';import{getTermRange}from'@magmacomputing/tempo/term';import{definePremiumTerm}from'@magmacomputing/tempo/plugin';import{enumify}from'@magmacomputing/tempo/library';var ASTRO=enumify({'Vernal':a0_0x224e2b(0x153),'Summer':a0_0x224e2b(0x149),'Autumnal':a0_0x224e2b(0x148),'Winter':a0_0x224e2b(0x150)}),{COMPASS,SEASON,DURATIONS}=enums,key='astro',scope=a0_0x224e2b(0x169);function calculateAstroMoment(_0xd31cde,_0xe6797f,_0x5aaef0){const _0x48ee99=a0_0x224e2b,_0x308371=(_0xd31cde-0x7d0)/0x3e8;let _0x20a963;switch(_0xe6797f){case ASTRO[_0x48ee99(0x141)]:_0x20a963=2451623.80984+365242.37404*_0x308371+0.05169*_0x308371*_0x308371;break;case ASTRO[_0x48ee99(0x161)]:_0x20a963=2451716.56767+365241.62603*_0x308371+0.00325*_0x308371*_0x308371;break;case ASTRO['Autumnal']:_0x20a963=2451810.21715+365242.01767*_0x308371-0.11575*_0x308371*_0x308371;break;case ASTRO[_0x48ee99(0x163)]:_0x20a963=2451900.05952+365242.74049*_0x308371-0.06223*_0x308371*_0x308371;break;}const _0x4c5dba=Math[_0x48ee99(0x157)]((_0x20a963-2440587.5)*DURATIONS[_0x48ee99(0x158)]);return new Tempo(_0x4c5dba,{'timeZone':_0x5aaef0,'timeStamp':'ms'});}function a0_0x58a8(){const _0x11fb03=['nanosecond','vernal','3785430oTxUjz','map','305870fdJdzx','trunc','days','Autumnal','7304073zHukfs','add','Autumn','10AATPUh','push','25176483CxvDZR','extend','Summer','month','Winter','microsecond','Solstice','day','sphere','2175lIydJY','astronomy','key','UTC','minute','Vernal','7811704CzMfNG','second','hour','South','1396QAuKiW','with','autumnal','summer','timeZoneId','find','Equinox','694935OGEAxS','year','millisecond','winter','10pWNvnz'];a0_0x58a8=function(){return _0x11fb03;};return a0_0x58a8();}function resolve(_0x3a4fd9,_0x5bac12){const _0x362dc0=a0_0x224e2b,_0x3c4466=_0x3a4fd9['config'][_0x362dc0(0x167)];if(!_0x3c4466)return[];const _0x1cf47a=_0x5bac12?.['yy']??_0x5bac12?.[_0x362dc0(0x14e)]??_0x3a4fd9['yy'],_0x2490f5=_0x5bac12?.[_0x362dc0(0x14a)]??_0x3a4fd9['tz']??_0x362dc0(0x16b),_0x293ec8=[],_0x5c6d3f=_0x3c4466===COMPASS[_0x362dc0(0x145)]?{'vernal':_0x362dc0(0x159),'summer':_0x362dc0(0x163),'autumnal':'Vernal','winter':'Summer'}:{'vernal':_0x362dc0(0x141),'summer':'Summer','autumnal':_0x362dc0(0x159),'winter':'Winter'},_0x115a91=_0x3c4466===COMPASS['South']?{'vernal':SEASON[_0x362dc0(0x15c)],'summer':SEASON[_0x362dc0(0x163)],'autumnal':SEASON['Spring'],'winter':SEASON['Summer']}:{'vernal':SEASON['Spring'],'summer':SEASON['Summer'],'autumnal':SEASON[_0x362dc0(0x15c)],'winter':SEASON[_0x362dc0(0x163)]};for(const _0x3a04fd of[_0x1cf47a-0x1,_0x1cf47a,_0x1cf47a+0x1]){const _0x1df356=(_0x3f599b,_0x5842d3)=>{const _0x267add=_0x362dc0,_0x4cb90d=calculateAstroMoment(_0x3f599b,_0x5842d3,_0x2490f5),_0xae4311=_0x4cb90d['toDateTime']();return{'year':_0xae4311[_0x267add(0x14e)],'month':_0xae4311[_0x267add(0x162)],'day':_0xae4311['day'],'hour':_0xae4311['hour'],'minute':_0xae4311['minute'],'second':_0xae4311[_0x267add(0x143)],'millisecond':_0xae4311[_0x267add(0x14f)],'microsecond':_0xae4311[_0x267add(0x164)],'nanosecond':_0xae4311[_0x267add(0x152)]};};_0x293ec8['push']({'key':_0x5c6d3f['vernal'],'season':_0x115a91[_0x362dc0(0x153)],'sphere':_0x3c4466,..._0x1df356(_0x3a04fd,ASTRO[_0x362dc0(0x141)]),'type':_0x362dc0(0x14c),'group':'astronomy'}),_0x293ec8[_0x362dc0(0x15e)]({'key':_0x5c6d3f['summer'],'season':_0x115a91['summer'],'sphere':_0x3c4466,..._0x1df356(_0x3a04fd,ASTRO[_0x362dc0(0x161)]),'type':_0x362dc0(0x165),'group':_0x362dc0(0x169)}),_0x293ec8['push']({'key':_0x5c6d3f[_0x362dc0(0x148)],'season':_0x115a91[_0x362dc0(0x148)],'sphere':_0x3c4466,..._0x1df356(_0x3a04fd,ASTRO[_0x362dc0(0x159)]),'type':'Equinox','group':_0x362dc0(0x169)}),_0x293ec8['push']({'key':_0x5c6d3f[_0x362dc0(0x150)],'season':_0x115a91['winter'],'sphere':_0x3c4466,..._0x1df356(_0x3a04fd,ASTRO[_0x362dc0(0x163)]),'type':'Solstice','group':_0x362dc0(0x169)});}return _0x293ec8;}function resolveDateBoundary(_0xfa0d4,_0x233978){const _0x265c95=a0_0x224e2b,_0x44c2b8=resolve(_0xfa0d4,_0x233978);return _0x44c2b8[_0x265c95(0x155)](_0x13dd35=>({..._0x13dd35,'hour':0x0,'minute':0x0,'second':0x0,'millisecond':0x0,'microsecond':0x0,'nanosecond':0x0}));}var AstroTerm=definePremiumTerm({'key':key,'scope':scope,'resolve'(_0x510e47){return resolve(this,_0x510e47);},'define'(_0x2a0072,_0x50bb0d){const _0x4753f1=a0_0x224e2b,_0x472980=resolve(this,_0x50bb0d),_0x1be25f=resolveDateBoundary(this,_0x50bb0d),_0x7521ab=_0x50bb0d??this['toDateTime']();if(_0x2a0072===!![]||_0x2a0072===void 0x0){const _0x110e02=getTermRange(this,_0x1be25f,!![],_0x50bb0d);return _0x110e02;}const _0x103b6d=getTermRange(this,_0x472980,![],_0x50bb0d);if(!_0x103b6d)return _0x103b6d;const _0x992615=getTermRange(this,_0x1be25f,![],_0x50bb0d);if(!_0x992615)return _0x103b6d;const _0xcd99ea=_0x472980[_0x4753f1(0x14b)](_0xccfb5f=>_0xccfb5f[_0x4753f1(0x16a)]===_0x992615['key']&&_0xccfb5f[_0x4753f1(0x14e)]===_0x992615['year']&&_0xccfb5f['month']===_0x992615['month']&&_0xccfb5f[_0x4753f1(0x166)]===_0x992615['day']);if(!_0xcd99ea)return{..._0x992615,'strict':_0x103b6d[_0x4753f1(0x16a)]};const _0x103719=_0x7521ab[_0x4753f1(0x147)]({'year':_0xcd99ea[_0x4753f1(0x14e)],'month':_0xcd99ea[_0x4753f1(0x162)],'day':_0xcd99ea[_0x4753f1(0x166)],'hour':_0xcd99ea[_0x4753f1(0x144)]??0x0,'minute':_0xcd99ea[_0x4753f1(0x140)]??0x0,'second':_0xcd99ea[_0x4753f1(0x143)]??0x0,'millisecond':_0xcd99ea[_0x4753f1(0x14f)]??0x0,'microsecond':_0xcd99ea[_0x4753f1(0x164)]??0x0,'nanosecond':_0xcd99ea['nanosecond']??0x0})[_0x4753f1(0x15b)]({'minutes':0x1}),_0x3dfb1d=getTermRange(this,_0x472980,![],_0x103719);if(!_0x3dfb1d)return{..._0x992615,'strict':_0x103b6d['key']};return{..._0x3dfb1d,'strict':_0x103b6d[_0x4753f1(0x16a)]};}});Tempo[a0_0x224e2b(0x160)](AstroTerm);export{AstroTerm};
1
+ const a0_0x2e7852=a0_0x24bb;(function(_0x4085b8,_0x36fb6c){const _0x4ce143=a0_0x24bb,_0x52677b=_0x4085b8();while(!![]){try{const _0x1cc85e=-parseInt(_0x4ce143(0x182))/0x1+parseInt(_0x4ce143(0x18e))/0x2*(parseInt(_0x4ce143(0x173))/0x3)+-parseInt(_0x4ce143(0x174))/0x4*(parseInt(_0x4ce143(0x188))/0x5)+parseInt(_0x4ce143(0x198))/0x6+-parseInt(_0x4ce143(0x17b))/0x7*(-parseInt(_0x4ce143(0x185))/0x8)+parseInt(_0x4ce143(0x19e))/0x9*(-parseInt(_0x4ce143(0x199))/0xa)+parseInt(_0x4ce143(0x196))/0xb*(parseInt(_0x4ce143(0x17e))/0xc);if(_0x1cc85e===_0x36fb6c)break;else _0x52677b['push'](_0x52677b['shift']());}catch(_0x5d0002){_0x52677b['push'](_0x52677b['shift']());}}}(a0_0x223a,0x34f4b));function a0_0x223a(){const _0x5ae4d2=['key','vernal','22296rpjbyC','Vernal','autumnal','winter','196605skHHGO','Spring','minute','8QFwyib','nanosecond','add','15WvMEHb','year','Winter','millisecond','South','UTC','2wXfRyz','trunc','microsecond','Solstice','map','Autumn','push','second','3058SbNJgW','hour','1588278hXWizm','33310fzsezk','Equinox','sphere','day','Summer','1143PhINjA','astronomy','month','599739obsOYi','206712isuJhG','toDateTime','config','extend','timeZoneId','find','Autumnal','73031TyqBgG'];a0_0x223a=function(){return _0x5ae4d2;};return a0_0x223a();}import{Tempo,enums}from'@magmacomputing/tempo/core';import{getTermRange}from'@magmacomputing/tempo/term';import{definePremiumTerm}from'@magmacomputing/tempo/plugin';import{enumify}from'@magmacomputing/tempo/library';var ASTRO=enumify({'Vernal':a0_0x2e7852(0x17d),'Summer':'summer','Autumnal':a0_0x2e7852(0x180),'Winter':'winter'}),{COMPASS,DURATIONS}=enums,key='astro',scope='astronomy';function calculateAstroMoment(_0x58ca84,_0x14dcc0,_0x51102e){const _0x4ddc85=a0_0x2e7852,_0x165c3b=(_0x58ca84-0x7d0)/0x3e8;let _0x366f7f;switch(_0x14dcc0){case ASTRO['Vernal']:_0x366f7f=2451623.80984+365242.37404*_0x165c3b+0.05169*_0x165c3b*_0x165c3b;break;case ASTRO[_0x4ddc85(0x19d)]:_0x366f7f=2451716.56767+365241.62603*_0x165c3b+0.00325*_0x165c3b*_0x165c3b;break;case ASTRO['Autumnal']:_0x366f7f=2451810.21715+365242.01767*_0x165c3b-0.11575*_0x165c3b*_0x165c3b;break;case ASTRO[_0x4ddc85(0x18a)]:_0x366f7f=2451900.05952+365242.74049*_0x165c3b-0.06223*_0x165c3b*_0x165c3b;break;}const _0x11c7e0=Math[_0x4ddc85(0x18f)]((_0x366f7f-2440587.5)*DURATIONS['days']);return new Tempo(_0x11c7e0,{'timeZone':_0x51102e,'timeStamp':'ms'});}function resolve(_0xf50638,_0x2179b){const _0x22af23=a0_0x2e7852,_0x43dba7=_0xf50638[_0x22af23(0x176)][_0x22af23(0x19b)];if(!_0x43dba7)return[];const _0x5132ce=_0x2179b?.['yy']??_0x2179b?.[_0x22af23(0x189)]??_0xf50638['yy'],_0x45f2ad=_0x2179b?.[_0x22af23(0x178)]??_0xf50638['tz']??_0x22af23(0x18d),_0x5b5b8f=[],_0x5aafe5=_0x43dba7===COMPASS[_0x22af23(0x18c)]?{'vernal':'Autumnal','summer':_0x22af23(0x18a),'autumnal':'Vernal','winter':_0x22af23(0x19d)}:{'vernal':_0x22af23(0x17f),'summer':_0x22af23(0x19d),'autumnal':_0x22af23(0x17a),'winter':_0x22af23(0x18a)},_0x4b0d62=_0x43dba7===COMPASS[_0x22af23(0x18c)]?{'vernal':'Autumn','summer':'Winter','autumnal':_0x22af23(0x183),'winter':'Summer'}:{'vernal':_0x22af23(0x183),'summer':_0x22af23(0x19d),'autumnal':_0x22af23(0x193),'winter':_0x22af23(0x18a)};for(const _0x4d0bac of[_0x5132ce-0x1,_0x5132ce,_0x5132ce+0x1]){const _0xf7ebeb=(_0x3cbfd8,_0x5b9ac8)=>{const _0x3c83af=_0x22af23,_0x4f12aa=calculateAstroMoment(_0x3cbfd8,_0x5b9ac8,_0x45f2ad),_0x161d9e=_0x4f12aa[_0x3c83af(0x175)]();return{'year':_0x161d9e['year'],'month':_0x161d9e[_0x3c83af(0x1a0)],'day':_0x161d9e[_0x3c83af(0x19c)],'hour':_0x161d9e[_0x3c83af(0x197)],'minute':_0x161d9e[_0x3c83af(0x184)],'second':_0x161d9e['second'],'millisecond':_0x161d9e[_0x3c83af(0x18b)],'microsecond':_0x161d9e[_0x3c83af(0x190)],'nanosecond':_0x161d9e[_0x3c83af(0x186)]};};_0x5b5b8f[_0x22af23(0x194)]({'key':_0x5aafe5['vernal'],'season':_0x4b0d62[_0x22af23(0x17d)],'sphere':_0x43dba7,..._0xf7ebeb(_0x4d0bac,ASTRO[_0x22af23(0x17f)]),'event':_0x22af23(0x19a),'group':_0x22af23(0x19f)}),_0x5b5b8f[_0x22af23(0x194)]({'key':_0x5aafe5['summer'],'season':_0x4b0d62['summer'],'sphere':_0x43dba7,..._0xf7ebeb(_0x4d0bac,ASTRO[_0x22af23(0x19d)]),'event':'Solstice','group':'astronomy'}),_0x5b5b8f['push']({'key':_0x5aafe5[_0x22af23(0x180)],'season':_0x4b0d62['autumnal'],'sphere':_0x43dba7,..._0xf7ebeb(_0x4d0bac,ASTRO[_0x22af23(0x17a)]),'event':_0x22af23(0x19a),'group':_0x22af23(0x19f)}),_0x5b5b8f[_0x22af23(0x194)]({'key':_0x5aafe5[_0x22af23(0x181)],'season':_0x4b0d62['winter'],'sphere':_0x43dba7,..._0xf7ebeb(_0x4d0bac,ASTRO[_0x22af23(0x18a)]),'event':_0x22af23(0x191),'group':_0x22af23(0x19f)});}return _0x5b5b8f;}function a0_0x24bb(_0x3c861a,_0x394f64){_0x3c861a=_0x3c861a-0x173;const _0x223ac5=a0_0x223a();let _0x24bbf3=_0x223ac5[_0x3c861a];return _0x24bbf3;}function resolveDateBoundary(_0x1d2029,_0x54d615){const _0x5abbe1=a0_0x2e7852,_0x1fddaa=resolve(_0x1d2029,_0x54d615);return _0x1fddaa[_0x5abbe1(0x192)](_0x7b82b9=>({..._0x7b82b9,'hour':0x0,'minute':0x0,'second':0x0,'millisecond':0x0,'microsecond':0x0,'nanosecond':0x0}));}var AstroTerm=definePremiumTerm({'key':key,'scope':scope,'resolve'(_0x5a2d2e){return resolve(this,_0x5a2d2e);},'define'(_0x246a08,_0x219658){const _0x549940=a0_0x2e7852,_0x19aae4=resolve(this,_0x219658),_0x45c5c5=resolveDateBoundary(this,_0x219658),_0xb40bb1=_0x219658??this['toDateTime']();if(_0x246a08===!![]||_0x246a08===void 0x0){const _0x3e7696=getTermRange(this,_0x45c5c5,!![],_0x219658);return _0x3e7696;}const _0x58e84d=getTermRange(this,_0x19aae4,![],_0x219658);if(!_0x58e84d)return _0x58e84d;const _0x37665b=getTermRange(this,_0x45c5c5,![],_0x219658);if(!_0x37665b)return _0x58e84d;const _0x349896=_0x19aae4[_0x549940(0x179)](_0xcb0ddd=>_0xcb0ddd[_0x549940(0x17c)]===_0x37665b[_0x549940(0x17c)]&&_0xcb0ddd['year']===_0x37665b[_0x549940(0x189)]&&_0xcb0ddd[_0x549940(0x1a0)]===_0x37665b[_0x549940(0x1a0)]&&_0xcb0ddd[_0x549940(0x19c)]===_0x37665b[_0x549940(0x19c)]);if(!_0x349896)return{..._0x37665b,'strict':_0x58e84d[_0x549940(0x17c)]};const _0x533594=_0xb40bb1['with']({'year':_0x349896['year'],'month':_0x349896[_0x549940(0x1a0)],'day':_0x349896[_0x549940(0x19c)],'hour':_0x349896[_0x549940(0x197)]??0x0,'minute':_0x349896[_0x549940(0x184)]??0x0,'second':_0x349896[_0x549940(0x195)]??0x0,'millisecond':_0x349896[_0x549940(0x18b)]??0x0,'microsecond':_0x349896[_0x549940(0x190)]??0x0,'nanosecond':_0x349896[_0x549940(0x186)]??0x0})[_0x549940(0x187)]({'minutes':0x1}),_0x26ab13=getTermRange(this,_0x19aae4,![],_0x533594);if(!_0x26ab13)return{..._0x37665b,'strict':_0x58e84d[_0x549940(0x17c)]};return{..._0x26ab13,'strict':_0x58e84d[_0x549940(0x17c)]};}});Tempo[a0_0x2e7852(0x177)](AstroTerm);export{AstroTerm};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magmacomputing/tempo-plugin-astro",
3
- "version": "1.1.3",
3
+ "version": "1.1.5",
4
4
  "description": "Tempo plugin that calculates precise astronomical seasons (solstices & equinoxes) using the Jean Meeus algorithm — hemisphere-aware, sub-minute accuracy",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -54,4 +54,4 @@
54
54
  "import": "./dist/index.js"
55
55
  }
56
56
  }
57
- }
57
+ }