UNPKG

lunisolar

Version:

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

2 lines (1 loc) 4.09 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).lunisolarPluginFetalGod=t()}(this,(function(){"use strict";function e(e,t,n,o){return new(n||(n=Promise))((function(a,r){function i(e){try{c(o.next(e))}catch(e){r(e)}}function l(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,l)}c((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:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function l(l){return function(c){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;r&&(r=0,l[0]&&(i=0)),i;)try{if(n=1,o&&(a=2&l[0]?o.return:l[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,l[1])).done)return a;switch(o=0,a&&(l=[2&l[0],a.value]),l[0]){case 0:case 1:a=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,o=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(a=i.trys,(a=a.length>0&&a[a.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!a||l[1]>a[0]&&l[1]<a[3])){i.label=l[1];break}if(6===l[0]&&i.label<a[1]){i.label=a[1],a=l;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(l);break}a[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],o=0}finally{n=a=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,c])}}}"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:"外"};return function(a,r,i){return 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)],l=e.fetalGodDayDesc[t.value];return this._fetalGodData={stemPlace:o,branchPlace:a,directionValue:r,direction:i,description:l},this._fetalGodData}}),Object.defineProperty(e,"fetalGod",{get:function(){return this.fetalGodData.description}}),[2]}))}))}}));