UNPKG

lunisolar

Version:

专业农历库,支持公历阴历互转,支持各类黄历数据查询,如八字四柱、阴历、神煞宜忌、时辰吉凶、建除十二神、胎神占方、五行纳音等。支持自定义插件。

2 lines (1 loc) 5.29 kB
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).lunisolarPluginAdvanced=t()}(this,(function(){"use strict";function e(e,t,n,o){return new(n||(n=Promise))((function(a,r){function i(e){try{l(o.next(e))}catch(e){r(e)}}function u(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,u)}l((o=o.apply(e,t||[])).next())}))}function t(e,t){var n,o,a,r,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return r={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function u(u){return function(l){return function(u){if(n)throw new TypeError("Generator is already executing.");for(;r&&(r=0,u[0]&&(i=0)),i;)try{if(n=1,o&&(a=2&u[0]?o.return:u[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,u[1])).done)return a;switch(o=0,a&&(u=[2&u[0],a.value]),u[0]){case 0:case 1:a=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,o=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(a=i.trys,(a=a.length>0&&a[a.length-1])||6!==u[0]&&2!==u[0])){i=0;continue}if(3===u[0]&&(!a||u[1]>a[0]&&u[1]<a[3])){i.label=u[1];break}if(6===u[0]&&i.label<a[1]){i.label=a[1],a=u;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(u);break}a[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e],o=0}finally{n=a=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,l])}}}"function"==typeof SuppressedError&&SuppressedError;var n=[2,2,3,3,3,3,3,4,4,4,4,4,4,5,5,5,5,5,6,6,6,6,6,6,7,7,7,7,7,-7,-7,-7,-7,-7,0,0,-3,-3,-3,-5,-1,-1,-1,-1,0,8,8,8,8,8,8,1,1,1,1,1,2,2,2,2],o={name:"zh",stemFetalGodPlace:["門","碓磨","廚灶","倉庫","房床"],branchFetalGodPlace:["碓","廁","爐","門","雞棲","床"],fetalGodDirection:["中","東","東南","南","西南","西","西北","北","東北"],fetalGodDayDesc:["占門碓外東南","碓磨廁外東南","廚灶爐外正南","倉庫門外正南","房床棲外正南","占門床外正南","占碓磨外正南","廚灶廁外西南","倉庫爐外西南","房床門外西南","門雞棲外西南","碓磨床外西南","廚灶碓外西南","倉庫廁外正西","房床爐外正西","占大門外正西","碓磨棲外正西","廚灶床外正西","倉庫碓外西北","房床廁外西北","占門爐外西北","門碓磨外西北","廚灶棲外西北","倉庫床外西北","房床碓外正北","占門廁外正北","碓磨爐外正北","廚灶門外正北","倉庫棲外正北","占房床房内北","占門碓房内北","碓磨廁房内北","廚灶爐房内北","門倉庫房内北","房床棲房內中","占門床房內中","占碓磨房内南","廚灶廁房内南","倉庫爐房内南","房床門房内西","門雞棲房内東","碓磨床房内東","廚灶碓房内東","倉庫廁房内東","房床爐房内中","占大門外東北","碓磨棲外東北","廚灶床外東北","倉庫碓外東北","房床廁外東北","占門爐外東北","門碓磨外正東","廚灶棲外正東","倉庫床外正東","房床碓外正東","占門廁外正東","碓磨爐外東南","廚灶門外東南","倉庫棲外東南","占房床外東南"],fetalGodInsideDesc:"内",fetalGodOutsideDesc:"外"},a=[3,1,0,2,3,1,4,2,3,0,4,2,1,0,4,3,1,0,2,3,1,4,2,3,0,4,2,1,0,4],r={name:"zh",takeSound:["海中金","爐中火","大林木","路旁土","劍鋒金","山頭火","澗下水","城頭土","白臘金","楊柳木","井泉水","屋上土","霹靂火","松柏木","長流水","砂中金","山下火","平地木","壁上土","金箔金","覆燈火","天河水","大驛土","釵釧金","桑柘木","大溪水","砂中土","天上火","石榴木","大海水"]};return function(i,u,l){return e(void 0,void 0,void 0,(function(){return t(this,(function(i){return function(a,r,i){e(void 0,void 0,void 0,(function(){var e;return t(this,(function(t){return i.locale(o,!0),e=r.prototype,Object.defineProperty(e,"fetalGodData",{get:function(){if(this._fetalGodData)return this._fetalGodData;var e=this.getLocale(),t=this.char8.day,o=e.stemFetalGodPlace[t.stem.value%5],a=e.branchFetalGodPlace[t.branch.value%6],r=n[t.value%60],i=(0===r?"":r>0?e.fetalGodOutsideDesc:e.fetalGodInsideDesc)+e.fetalGodDirection[Math.abs(r)],u=e.fetalGodDayDesc[t.value];return this._fetalGodData={stemPlace:o,branchPlace:a,directionValue:r,direction:i,description:u},this._fetalGodData}}),Object.defineProperty(e,"fetalGod",{get:function(){return this.fetalGodData.description}}),[2]}))}))}(0,u,l),function(n,o,i){e(void 0,void 0,void 0,(function(){var e,n;return t(this,(function(t){return i.locale(r,!0),e=o.prototype,n=i.SB.prototype,Object.defineProperty(n,"takeSound",{get:function(){var e=i.getLocale(this._config.lang);return void 0===this._takeSoundValue&&(this._takeSoundValue=(this.value>>1)%30),e.takeSound[this._takeSoundValue]}}),Object.defineProperty(n,"takeSoundE5",{get:function(){return void 0===this._takeSoundValue&&(this._takeSoundValue=(this.value>>1)%30),new i.Element5(a[this._takeSoundValue],{lang:this._config.lang})}}),Object.defineProperty(e,"takeSound",{get:function(){return this.char8.day.takeSound}}),[2]}))}))}(0,u,l),[2]}))}))}}));